LocalAgent
Defined in: src/types/agent.ts:93
Interface for agents with locally accessible state, messages, tools, and hooks. Used by ToolContext and hook events that need access to agent internals.
Properties
Section titled “Properties”appState
Section titled “appState”appState: StateStore;Defined in: src/types/agent.ts:97
App state storage accessible to tools and application logic.
messages
Section titled “messages”messages: Message[];Defined in: src/types/agent.ts:102
The conversation history of messages between user and assistant.
toolRegistry
Section titled “toolRegistry”readonly toolRegistry: ToolRegistry;Defined in: src/types/agent.ts:107
The tool registry for registering tools with the agent.
Methods
Section titled “Methods”addHook()
Section titled “addHook()”addHook<T>(eventType, callback): HookCleanup;Defined in: src/types/agent.ts:116
Register a hook callback for a specific event type.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends HookableEvent |
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
eventType | HookableEventConstructor<T> | The event class constructor to register the callback for |
callback | HookCallback<T> | The callback function to invoke when the event occurs |
Returns
Section titled “Returns”HookCleanup
Cleanup function that removes the callback when invoked