import type { HookEventEnvelope, HookEventName } from "../../hooks/extensibility/types.js"; /** * Herdr semantic agent states, as documented by the official Herdr socket/CLI * protocol (herdr.dev/docs/agents, /docs/socket-api). `state` is semantic: it * drives Herdr waits, notifications, and workspace rollups. Display-only detail * is carried separately as metadata tokens. */ export declare const HERDR_SEMANTIC_STATES: readonly ["working", "blocked", "idle", "unknown"]; export type HerdrSemanticState = (typeof HERDR_SEMANTIC_STATES)[number]; export interface HerdrStateMapping { state: HerdrSemanticState; /** Whether OMX should release Herdr authority after reporting this state. */ terminal: boolean; /** Short, non-authoritative rationale for the mapping decision. */ reason: string; } /** * Map a single OMX hook lifecycle event to a Herdr semantic state. Unknown or * unmapped events resolve to `unknown` rather than guessing, matching the issue * requirement that reconciliation-uncertain state is reported as `unknown`. */ export declare function mapHookEventToHerdrState(event: HookEventEnvelope | HookEventName | string): HerdrStateMapping; export declare function isTerminalHookEvent(event: HookEventEnvelope | HookEventName | string): boolean; export type HerdrWorkerState = "working" | "blocked" | "done" | "failed" | "idle" | "unknown"; export interface HerdrRollupWorker { id: string; state: HerdrWorkerState; /** * True when this worker/task is blocked specifically on user action. Only * user-blocking workers escalate the rollup to `blocked`; a worker blocked on * the system alone does not make the whole pane look blocked. */ blockedOnUser?: boolean; } export interface HerdrRollupInput { /** The leader (or a workflow) is waiting on a user decision. */ leaderBlockedOnUser?: boolean; workers: HerdrRollupWorker[]; /** The whole run has reached a terminal outcome. */ runTerminal?: boolean; } export interface HerdrRollupResult { state: HerdrSemanticState; reason: string; counts: { total: number; working: number; blocked: number; blockedOnUser: number; done: number; failed: number; idle: number; unknown: number; }; } /** * Roll up authoritative OMX Team worker/task state into a single Herdr semantic * state, rather than relying on Herdr's pane-output inference. * * Precedence, per issue #3241: * 1. `blocked` if the leader needs user input or an authoritative worker/task * is blocked on user action. * 2. otherwise `working` while any worker/task is active. * 3. otherwise `idle` when the run is terminal (or nothing is active). */ export declare function rollupTeamState(input: HerdrRollupInput): HerdrRollupResult; //# sourceMappingURL=semantic.d.ts.map