Interface ToolStateRecord

A tool's state as this process holds it. It mirrors the tool's row in agentos_emergent_tool_state, except for request, which can be null while the row stores a request this release cannot read.

interface ToolStateRecord {
    toolId: string;
    state: ToolState;
    reason: null | string;
    setBy: StateSetter;
    at: number;
    writeId?: string;
    request: null | StoredRequest;
}

Properties

toolId: string
state: ToolState
reason: null | string

The reason for a state other than active. The library's reasons are catalogue words (source_not_persisted, source_unreadable, legacy_inactive, legacy_owner); a host's reason is the text it gave.

Who recorded the state.

at: number

Unix epoch milliseconds of the last state change.

writeId?: string

The id of the write that set this state, when the row carries one.

request: null | StoredRequest

The request this process holds for the tool: the stored one when it could be read, else the one derived from the source, else null. A state change that names no request leaves the stored column as it is.