import type { ReasonCode, CanarySignal } from './types.js'; export interface SessionFacts { toolFailures: number; activeSubagents: number; lastEventAt: number; /** Last boundary that proves the task made meaningful progress. */ lastMeaningfulAt?: number; startedAt: number; executionStartSeq?: number; /** Number of tools that have been called without a matching result. */ activeToolCount?: number; /** The class of the currently active/most recent tool, without its arguments. */ toolClass?: ToolClass; waitingForHuman?: boolean; turnState?: TurnState; contextCompactions?: number; lastToolName?: string; sameToolFailures?: number; lastFailedToolName?: string; backgroundJobs?: number; } export type ToolClass = 'long-running' | 'ordinary' | 'unknown'; export type TurnState = 'running' | 'terminal' | 'unknown'; export interface ToolFailureState { toolFailures: number; sameToolFailures: number; lastFailedToolName?: string | undefined; } /** Read public outcome metadata without touching tool arguments or result blocks. */ export declare function toolResultFailed(data: Record): boolean; /** Keep the failure identity independent from tools started in parallel or between failures. */ export declare function recordToolResult(state: ToolFailureState, data: Record, name: string | undefined): void; export interface SessionLike { id: string; header?: { cwd?: string; parentSession?: string; origin?: 'subagent'; isSeeded?: boolean; createdAt?: number; }; } export interface SessionEventLike { type: string; seq?: number; time?: number; /** DSH marks routine extension events so observers do not treat them as progress facts. */ ignorable?: boolean; data?: Record; } /** Classify only the public tool name; arguments and result content are never inspected. */ export declare function toolClassForName(name: string | undefined): ToolClass; /** Classify the tools still executing, rather than the most recently started one. */ export declare function toolClassForActiveTools(names: Iterable): ToolClass; /** Read the public tool identity, never the model-facing result content. */ export declare function toolCallIdOf(data: Record): string | undefined; /** Whether an event is a bounded, structured progress boundary for liveness. */ export declare function isMeaningfulSessionEvent(eventType: string, data?: Record): boolean; export declare function signalsFromSessionEvent(session: SessionLike, event: SessionEventLike, facts: SessionFacts): CanarySignal[]; export declare function humanActionRef(sessionId: string, kind: ReasonCode, data: Record, seq?: number): string; /** * Recreate a Human Needed observation from an authoritative startup snapshot. * The event sequence remains an opaque evidence join key; no event payload is * copied into the signal or its persistence path. */ export declare function signalFromAuthoritativeHumanWait(session: SessionLike, reason: 'approval' | 'question', eventSeq?: number, occurredAt?: number, identity?: { humanActionRef: string; executionStartSeq?: number; }): CanarySignal; export declare function signalFromAgentError(payload: { agent?: { id?: string; }; turn?: number; step?: number; }): CanarySignal; export declare function signalFromSubagentPressure(activeSubagents: number, threshold: number, now?: number): CanarySignal; export declare function signalFromHostProbe(ok: boolean, detail: string, now?: number, outageId?: string): CanarySignal | undefined; export declare function signalFromStall(session: SessionLike, facts: SessionFacts, thresholdMs: number, now?: number): CanarySignal | undefined; export declare function signalFromStallRecovery(session: SessionLike, now?: number): CanarySignal; export declare function signalFromHostRecovery(outageId?: string, now?: number): CanarySignal; //# sourceMappingURL=providers.d.ts.map