Skip to content

OffloadStrategyBuilder

Defined in: src/context-manager/strategies/offload/base.ts:70

Intermediate builder result that allows chaining .when() conditions. Also implements ContextStrategy directly so it can be used without .when().

readonly name: string;

Defined in: src/context-manager/types.ts:22

Stable identifier for logging and observability.

ContextStrategy.name

when(conditions): ContextStrategy;

Defined in: src/context-manager/strategies/offload/base.ts:72

Add conditions that determine when this strategy fires.

ParameterType
conditionsOffloadConditions

ContextStrategy


optional init(agent, stash?): void;

Defined in: src/context-manager/types.ts:28

Called once when the ContextManager is attached to an agent. Strategies can use this to register hooks (e.g., eager offloading on message arrival).

ParameterType
agentLocalAgent
stash?Stash

void

ContextStrategy.init


apply(context): Promise<boolean>;

Defined in: src/context-manager/types.ts:34

Attempt to reduce context. Returns true if it made changes, false if it decided not to act (e.g., conditions not met, nothing to offload).

ParameterType
contextContextState

Promise<boolean>

ContextStrategy.apply