Skip to content

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.

const store = new GadgetOutputStore();
const id = store.store("Search", largeOutput);
// id = "Search_a1b2c3d4"
const stored = store.get(id);
console.log(stored?.lineCount); // 4200

new GadgetOutputStore(): GadgetOutputStore

GadgetOutputStore

get size(): number

Defined in: agent/gadget-output-store.ts:103

Get the number of stored outputs.

number

clear(): void

Defined in: agent/gadget-output-store.ts:111

Clear all stored outputs. Called when the agent run completes.

void


get(id): StoredOutput | undefined

Defined in: agent/gadget-output-store.ts:77

Retrieve a stored output by ID.

string

The output ID (e.g., “Search_d34db33f”)

StoredOutput | undefined

The stored output or undefined if not found


getIds(): string[]

Defined in: agent/gadget-output-store.ts:96

Get all stored output IDs.

string[]

Array of output IDs


has(id): boolean

Defined in: agent/gadget-output-store.ts:87

Check if an output exists.

string

The output ID to check

boolean

True if the output exists


store(gadgetName, content): string

Defined in: agent/gadget-output-store.ts:54

Store a gadget output and return its ID.

string

Name of the gadget that produced the output

string

Full output content to store

string

Generated ID for retrieving the output later