A reference to the completion resource.
API
interface CompletionResourceRef<State = unknown> extends Resource<string | null> {generatingError: Signal <
Error | undefined
>;getRecoveryConfiguration(): ConversationRecoveryConfiguration;isGenerating: Signal <boolean>;isLoading: Signal <boolean>;isReceiving: Signal <boolean>;readonly isResuming: Signal<boolean>;isRunningToolCalls: Signal <boolean>;isSending: Signal <boolean>;lastRunFinishReason: Signal <
FinishReason | undefined
>;lastRunResult: Signal <
JsonValue | undefined
>;lastRunUsage: Signal <
readonly TokenUsage [] | undefined
>;readonly pendingConversationRecovery: Signal<PendingConversationRecovery | undefined>;readonly pendingInterrupts: Signal<PendingInterruptBatch | undefined>;readonly recovery: Signal<ConversationRecoveryState>;reload: () => boolean;restoreConversation(snapshot: ConversationSnapshot<State>, options: ConversationRestoreOptions): void;resume(options: ResumeOptions): void;resumeConversationRecovery(options: ResumeConversationRecoveryOptions): void;sendingError: Signal <
Error | undefined
>;setState(state: State): void;readonly state: Signal<State | undefined>;stop: (clearStreamingMessage?: boolean) => void;}@typeStateSignal<Error | undefined>Error emitted during generation events.
Signal<boolean>Indicates whether the chat is generating.
Signal<boolean>Aggregate loading flag across transport, generation, and tool calls.
Signal<boolean>Indicates whether the chat is receiving tokens.
Signal<boolean>Whether the whole resumed interaction is executing.
Signal<boolean>Indicates whether tool calls are running.
Signal<boolean>Indicates whether the chat is sending.
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.
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.
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.
Signal<PendingConversationRecovery | undefined>The inert browser recovery batch awaiting explicit settlement.
Signal<PendingInterruptBatch | undefined>The current interrupt batch, retained until resume is acknowledged.
Signal<ConversationRecoveryState>The local recovery revision and whether an explicit restore is required.
() => booleanReloads the resource.
Signal<Error | undefined>Transport/request error before generation events arrive.
Signal<State | undefined>The currently visible shared agent state.
(clearStreamingMessage?: boolean) => voidStops any currently-streaming message.