Interface: AgentRun
Defined in: core/runner.ts:103
A running session, as runQuery() returns it: its events and the controls of the SDK's Query.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
close | () => void | Ends the session. No further events arrive after this; safe to call even if events is still being iterated elsewhere (e.g. from a SIGINT handler racing the main loop). | core/runner.ts:109 |
contextUsage | () => Promise<ContextUsage | null> | How full the context window is now, or null if the session can't tell (see the SDK's Query.getContextUsage()). | core/runner.ts:113 |
events | AsyncIterable<AgentEvent> | Normalized events for this run — iterate with for await. | core/runner.ts:105 |
interrupt | () => Promise<unknown> | Interrupts the current turn (doesn't end the session — a caller wanting a full stop should also call close()). | core/runner.ts:107 |
supportedCommands | () => Promise<SlashCommand[]> | This session's own slash commands (skills doubling as typable commands, etc.) — only meaningful once the session has actually started (see the SDK's own Query.supportedCommands()). | core/runner.ts:111 |