/** * Pure ordinary-dispatch gate. The caller owns every Store/terminal read and * supplies only the facts observed at the existing preflight boundary. */ export declare function isActiveTerminalDispatchStatus(status: unknown): boolean; export declare function isRecoverableTerminalDispatchStatus(status: unknown): boolean; export type TerminalDispatchReceiptStatus = "submitted" | "enter_dispatched" | "agent_accepted"; export interface TerminalDispatchLedgerFacts { readonly status?: string; readonly lifecycle: boolean; readonly transitionId?: string; readonly ownerConversationId?: string; } export interface TerminalDispatchOwnerFacts { readonly conversationId: string; readonly status: string; readonly released: boolean; readonly continuingSameTurn: boolean; readonly exactReplay: boolean; } export interface TerminalDispatchPreflightFacts { readonly ledger: TerminalDispatchLedgerFacts; readonly owner?: TerminalDispatchOwnerFacts; } export type TerminalDispatchPreflightPlan = { action: "proceed"; basis: "no_blocking_dispatch" | "released_owner" | "continuing_same_turn"; } | { action: "reject"; reason: "unresolved_lifecycle" | "terminal_level_dispatch" | "owner_unavailable" | "active_owner"; status?: string; transitionId?: string; ownerConversationId?: string; ownerStatus?: string; } | { action: "replay"; proofLevel: "submitted" | "enter_dispatched" | "agent_accepted"; }; export interface TerminalDispatchReplayAcceptance { readonly accepted: boolean; readonly invalid: boolean; } export interface UserExplicitTerminalInputSafetyFacts { readonly reachable: boolean; readonly approvalScanned: boolean; readonly approvalBlocked: boolean; readonly approvalReason?: string; readonly awaitingApproval: boolean; readonly questionnaireActive: boolean; } export type UserExplicitTerminalInputSafety = { readonly action: "proceed"; } | { readonly action: "reject"; readonly reason: string; }; /** * Human priority bypasses management uncertainty, never the live TUI's * physical input mode. A questionnaire is as unsafe for task text as an * approval menu because the same bytes would be interpreted as an answer. */ export declare function decideUserExplicitTerminalInputSafety(facts: UserExplicitTerminalInputSafetyFacts): UserExplicitTerminalInputSafety; export type TerminalDispatchLedgerAuthority = "absent" | "unreadable" | "resolved" | "stale_process_incarnation" | "inactive_status" | "active"; export type TerminalDispatchOwnerAuthority = "unavailable" | "released" | "terminal_mismatch" | "generation_mismatch" | "current"; export declare function decideTerminalDispatchOwnership(ledger: TerminalDispatchLedgerAuthority, owner?: TerminalDispatchOwnerAuthority): { state: "conflict"; code: "ledger_unreadable"; basis?: undefined; } | { state: "none"; basis: "absent" | "inactive_status" | "resolved" | "stale_process_incarnation"; code?: undefined; } | { state: "needs_owner"; basis?: undefined; code?: undefined; } | { readonly state: "conflict"; readonly code: "owner_unavailable"; basis?: undefined; } | { state: "none"; basis: "released_owner"; code?: undefined; } | { basis?: undefined; state: "conflict"; code: "owner_terminal_mismatch"; } | { basis?: undefined; state: "current"; code?: undefined; } | { basis?: undefined; state: "conflict"; code: "owner_generation_mismatch"; }; export { decideTerminalSendAuthority, type TerminalSendAuthority, type TerminalSendAuthorityFacts } from "./terminal-action-projection.js"; /** * Preserve the legacy lazy Store read: only an ordinary active receipt status * reaches owner loading, and an unresolved lifecycle ledger wins first. */ export declare function terminalDispatchPreflightRequiresOwner(ledger: TerminalDispatchLedgerFacts): boolean; /** * Reduce already-observed dispatch facts to one side-effect-free next action. * Error wording, output envelopes and replay receipt construction remain in * the CLI compatibility shell. */ export declare function decideTerminalDispatchPreflight(facts: TerminalDispatchPreflightFacts): TerminalDispatchPreflightPlan; export declare function decideTerminalDispatchReplayAcceptance({ delivered, submissionOutcome }: { delivered: boolean; submissionOutcome: string; }): TerminalDispatchReplayAcceptance;