hashbrown

CompletionResourceRef

A reference to the completion resource.

CompletionResourceRef
@typeState
generatingError
Signal<Error | undefined>

Error emitted during generation events.

isGenerating
Signal<boolean>

Indicates whether the chat is generating.

isLoading
Signal<boolean>

Aggregate loading flag across transport, generation, and tool calls.

isReceiving
Signal<boolean>

Indicates whether the chat is receiving tokens.

isResuming
Signal<boolean>

Whether the whole resumed interaction is executing.

isRunningToolCalls
Signal<boolean>

Indicates whether tool calls are running.

isSending
Signal<boolean>

Indicates whether the chat is sending.

lastRunFinishReason
Signal<FinishReason | undefined>

Why the model stopped in the last run that completed, such as length when the answer was cut off by a token limit, or undefined when the server did not say. Cleared when the next run starts.

lastRunResult
Signal<JsonValue | undefined>

The return value the agent attached to the last run that completed (AG-UI's RUN_FINISHED.result), or undefined when it attached none. Cleared when the next run starts. Interrupted, cancelled, and failed runs never set it.

lastRunUsage
Signal<readonly TokenUsage[] | undefined>

The token usage of the last run that completed (AG-UI's RUN_FINISHED.usage), one entry per provider and model, or undefined when the server reported none. Cleared when the next run starts, so a turn that calls tools reports only its final run.

pendingConversationRecovery
Signal<PendingConversationRecovery | undefined>

The inert browser recovery batch awaiting explicit settlement.

pendingInterrupts
Signal<PendingInterruptBatch | undefined>

The current interrupt batch, retained until resume is acknowledged.

recovery
Signal<ConversationRecoveryState>

The local recovery revision and whether an explicit restore is required.

reload
() => boolean

Reloads the resource.

sendingError
Signal<Error | undefined>

Transport/request error before generation events arrive.

state
Signal<State | undefined>

The currently visible shared agent state.

stop
(clearStreamingMessage?: boolean) => void

Stops any currently-streaming message.