import type { H2AObjectiveLoop, H2ALoopTrackRef } from "../index.js"; export interface ProjectedAgent { readonly id: string; readonly tool: string; readonly state: string; readonly cwd: string; readonly tmuxSession?: string; readonly jobId?: string; readonly h2aInstance?: string; readonly capabilities: { readonly attach: boolean; readonly logs: boolean; readonly remote: boolean; }; } export interface AgentsSnapshot { readonly degraded: boolean; readonly version?: number; readonly agents: readonly ProjectedAgent[]; } export interface PresenceView { readonly instance: string; readonly liveSession: boolean; readonly hasTmuxLaunchContext: boolean; /** Drumbeat self-declared work status (DEC-084): working | paused | done | * blocked | out-of-tokens. Optional (only set when the agent records it). */ readonly workStatus?: string; /** Epoch ms of the last MCP activity (from `lastMcpActivityAt`). Proxy for * "the agent is doing work via tool calls" vs "silent/waiting". */ readonly lastActivityAtMs?: number; } export interface PresenceSnapshot { readonly byInstance: ReadonlyMap; } export type RefStatus = "accepted" | "done" | "pending" | "rejected" | "blocked" | "stale" | "unknown"; export interface RolledRef { readonly locator: string; readonly status: RefStatus; } export interface RefsRollup { readonly degraded: boolean; readonly refs: readonly RolledRef[]; } export interface PendingDecision { readonly id: string; readonly forAgent?: string; } export interface InboxSnapshot { readonly pendingDecisions: readonly PendingDecision[]; } export interface TickInput { readonly loop: H2AObjectiveLoop; readonly agents: AgentsSnapshot; readonly presence: PresenceSnapshot; readonly refs: RefsRollup; readonly inbox: InboxSnapshot; readonly now: number; } export type TickActionType = "request-launch" | "wake" | "route-decision" | "close" | "noop"; export interface TickAction { readonly type: TickActionType; readonly reason: string; readonly agentId?: string; readonly refLocator?: string; readonly decisionId?: string; } export type TickOutcome = "running" | "waiting-human" | "waiting-agent" | "stalled" | "degraded" | "eligible-for-close" | "stopped" | "failed"; export interface TickPlan { readonly loopId: string; readonly degraded: boolean; readonly degradedSources?: { readonly agents: boolean; readonly refs: boolean; }; readonly outcome: TickOutcome; readonly close: boolean; readonly actions: readonly TickAction[]; readonly reasons: readonly string[]; } /** Stable join key for a declared loop track-ref. Adapters MUST use the same. */ export declare function loopRefLocator(ref: H2ALoopTrackRef): string; /** * Pure objective-loop tick decision. Deterministic; no IO. Implements the spec * (2026-06-26 §Relaunch + §C completion) at MVP scope: degraded short-circuit, * multi-ref completion rollup, and conservative launch/wake/route intents. * * The shell never auto-closes unless `close===true` (policy.closeWhenRefsSatisfied). */ export declare function planLoopTick(input: TickInput): TickPlan; //# sourceMappingURL=decision.d.ts.map