import { type AgClientCapabilities } from "@silverprotocol/core"; import type { AgentMessage, HistoryLoadResult, UseAgentInvokeOptions, UseAgentInvokeReturn } from "./types.js"; /** * What a block-preserving consumer advertises by default (guuey#207): it * folds `turn.done outcome:"paused"` records, so it can render the AgJSON * hitl card with declared grant modes — the `@guuey/chat` path. See * `UseAgentInvokeOptions.capabilities`. */ export declare const DEFAULT_BLOCK_PRESERVING_CAPABILITIES: AgClientCapabilities; /** The decision `applyHistoryResult` reaches for a loaded transcript. */ export type HistoryApplication = { kind: "seed"; messages: AgentMessage[]; } | { kind: "skip"; } | { kind: "clear"; }; /** * Pure decision seam for post-hydration history application (see * `AgentInvokeHistoryAdapter` in `./types`). `gone` always clears the * persisted thread. Otherwise a non-empty transcript seeds the chat UNLESS * the chat has already been touched (`currentMessages.length > 0`) — a * mid-flight send always beats late-arriving history. */ export declare function applyHistoryResult(result: HistoryLoadResult, currentMessages: AgentMessage[]): HistoryApplication; /** The guuey#192 stall watchdog's resolved tuning (see {@link stallProbeDecision}). */ export declare const STALL_RECOVERY_DEFAULTS: { readonly windowMs: 25000; readonly probeAttempts: 4; /** * guuey#409: the PRE-first-byte watchdog window. The #192 clock arms only * on the first chunk (so a silent cold start never trips it) — which left * a turn that never receives ANY byte with no watchdog at all: the * eternal-"Thinking…" face of the 2026-08-22 invoke-rail turn death. * Deliberately much longer than `windowMs`: the transport's cold-start * retries legitimately spend up to ~90s before the first byte. */ readonly preFirstByteWindowMs: 120000; }; /** * Pure decision seam for the guuey#192 stall probe: does a freshly-loaded * transcript already contain THIS turn's finished reply? * * `adopt` requires BOTH signals, because each alone lies in a real case: * * - **user-count**: history must hold at least as many user turns as the * local transcript (which includes the just-sent optimistic one). Without * it, a thread whose PREVIOUS turn ended in a completed assistant reply * would adopt that OLD transcript and silently drop the in-flight turn. * - **finished tail**: history's last message must be a non-empty assistant * reply. Without it, a history read that caught the persisted user row * before the assistant row would adopt a reply-less transcript. * * KNOWN LIMIT (documented, accepted): the runtime persists a turn's rows at * completion — the guuey#192 evidence (a reload mid-stall renders the FULL * reply) is only possible under that model, and the read plane carries no * per-row clientMessageId to match against. If persistence ever becomes * progressive (partial assistant rows), this heuristic needs the read plane * to grow a turn-completion marker — do not "fix" it client-side by text * comparison, which cannot distinguish a partial row from a finished one. */ export declare function stallProbeDecision(history: AgentMessage[], localUserCount: number): "adopt" | "in-flight"; export declare function useAgentInvoke(opts: UseAgentInvokeOptions): UseAgentInvokeReturn; //# sourceMappingURL=useAgentInvoke.d.ts.map