Skip to content

LocalAgent

Defined in: src/types/agent.ts:92

Interface for agents with locally accessible state, messages, tools, and hooks. Used by ToolContext and hook events that need access to agent internals.

appState: StateStore;

Defined in: src/types/agent.ts:96

App state storage accessible to tools and application logic.


messages: Message[];

Defined in: src/types/agent.ts:101

The conversation history of messages between user and assistant.


readonly toolRegistry: ToolRegistry;

Defined in: src/types/agent.ts:106

The tool registry for registering tools with the agent.

addHook<T>(eventType, callback): HookCleanup;

Defined in: src/types/agent.ts:115

Register a hook callback for a specific event type.

Type Parameter
T extends HookableEvent
ParameterTypeDescription
eventTypeHookableEventConstructor<T>The event class constructor to register the callback for
callbackHookCallback<T>The callback function to invoke when the event occurs

HookCleanup

Cleanup function that removes the callback when invoked