GadgetOutputStore
Defined in: agent/gadget-output-store.ts:44
In-memory store for large gadget outputs.
Outputs are stored with generated IDs in the format {GadgetName}_{hex8}.
The store is tied to an agent run and cleared when the agent completes.
Example
Section titled “Example”const store = new GadgetOutputStore();const id = store.store("Search", largeOutput);// id = "Search_a1b2c3d4"
const stored = store.get(id);console.log(stored?.lineCount); // 4200Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new GadgetOutputStore():
GadgetOutputStore
Returns
Section titled “Returns”GadgetOutputStore
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get size():
number
Defined in: agent/gadget-output-store.ts:103
Get the number of stored outputs.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Defined in: agent/gadget-output-store.ts:111
Clear all stored outputs. Called when the agent run completes.
Returns
Section titled “Returns”void
get(
id):StoredOutput|undefined
Defined in: agent/gadget-output-store.ts:77
Retrieve a stored output by ID.
Parameters
Section titled “Parameters”string
The output ID (e.g., “Search_d34db33f”)
Returns
Section titled “Returns”StoredOutput | undefined
The stored output or undefined if not found
getIds()
Section titled “getIds()”getIds():
string[]
Defined in: agent/gadget-output-store.ts:96
Get all stored output IDs.
Returns
Section titled “Returns”string[]
Array of output IDs
has(
id):boolean
Defined in: agent/gadget-output-store.ts:87
Check if an output exists.
Parameters
Section titled “Parameters”string
The output ID to check
Returns
Section titled “Returns”boolean
True if the output exists
store()
Section titled “store()”store(
gadgetName,content):string
Defined in: agent/gadget-output-store.ts:54
Store a gadget output and return its ID.
Parameters
Section titled “Parameters”gadgetName
Section titled “gadgetName”string
Name of the gadget that produced the output
content
Section titled “content”string
Full output content to store
Returns
Section titled “Returns”string
Generated ID for retrieving the output later