OffloadedBlock
Defined in: src/types/messages.ts:325
Experimental
The text a context-manager strategy left in place of content it offloaded, recording what that content was.
A text block to every reader of agent.messages and to every model provider — type stays 'textBlock', since
the content really is text — so only code that cares about the provenance narrows to it with instanceof.
Extends
Section titled “Extends”Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new OffloadedBlock(data): OffloadedBlock;Defined in: src/types/messages.ts:342
Experimental
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | OffloadedBlockData |
Returns
Section titled “Returns”OffloadedBlock
Overrides
Section titled “Overrides”Properties
Section titled “Properties”readonly type: "textBlock";Defined in: src/types/messages.ts:263
Experimental
Discriminator for text content.
Inherited from
Section titled “Inherited from”readonly text: string;Defined in: src/types/messages.ts:268
Experimental
Plain text content.
Implementation of
Section titled “Implementation of”Inherited from
Section titled “Inherited from”method
Section titled “method”readonly method: OffloadMethod;Defined in: src/types/messages.ts:329
Experimental
Offload method that left the placeholder.
Implementation of
Section titled “Implementation of”readonly ref?: string;Defined in: src/types/messages.ts:334
Experimental
Stash reference under which the original is retrievable; absent when it was not stashed.
Implementation of
Section titled “Implementation of”tokens?
Section titled “tokens?”readonly tokens?: number;Defined in: src/types/messages.ts:340
Experimental
Size of the content this placeholder stands for, in tokens, including any placeholder it replaced; absent when the token count could not measure it.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”toJSON()
Section titled “toJSON()”toJSON(): TextBlockData & { offloaded: Omit<OffloadedBlockData, "text">;};Defined in: src/types/messages.ts:356
Experimental
Serializes the OffloadedBlock to a JSON-compatible object, with its provenance under offloaded.
Called automatically by JSON.stringify().
One key holds the provenance so a text block’s own data keeps the rest of the namespace, and so the presence of that key alone decides whether stored data is a placeholder.
Returns
Section titled “Returns”TextBlockData & {
offloaded: Omit<OffloadedBlockData, "text">;
}
Overrides
Section titled “Overrides”fromJSON()
Section titled “fromJSON()”static fromJSON(data): OffloadedBlock;Defined in: src/types/messages.ts:373
Experimental
Creates an OffloadedBlock instance from its serialized form.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
data | TextBlockData & { offloaded: Omit<OffloadedBlockData, "text">; } | Serialized placeholder to deserialize |
Returns
Section titled “Returns”OffloadedBlock
OffloadedBlock instance