import { type H2AObjectiveLoop } from "./runtime/loop/index.js"; export type StatusSessionState = "present" | "absent" | "unknown"; export type StatusGatewayState = "off" | "idle" | "active" | "rate-limited" | "unavailable" | "unknown"; export interface StatusRuntimeAgent { readonly id: string; readonly kind: "delegated-job" | "local-session"; readonly tool: string; readonly state: string; readonly label?: string; readonly tmuxSession?: string; readonly h2aInstance?: string; } export interface StatusRuntimeProjection { readonly kind: "h2a-status-runtime"; readonly version: 1; readonly session: { readonly state: StatusSessionState; readonly tmuxSession?: string; readonly profile?: string; readonly path?: string; }; readonly managed: { readonly agents: readonly StatusRuntimeAgent[]; readonly degraded: boolean; readonly attentionComplete?: boolean; }; readonly delegations?: { readonly executions: readonly StatusDelegatedExecution[]; readonly degraded: boolean; }; readonly gateway: { readonly state: StatusGatewayState; readonly requestedModel?: string; readonly upstreamModel?: string; readonly requestedModelTruncated?: boolean; readonly upstreamModelTruncated?: boolean; readonly provider?: string; readonly transport?: string; readonly accountId?: string; readonly accountLabel?: string; readonly previousAccountLabel?: string; readonly fallbackAccountLabel?: string; readonly retryAfterMs?: number; readonly updatedAt?: string; readonly reason?: string; }; readonly warnings: readonly string[]; } export interface StatusDelegatedExecution { readonly id: string; readonly origin: "mcp:h2a_run" | "cli:h2a-delegate"; readonly delegatorInstance: string; readonly delegatorTmuxSession: string; readonly tool: string; readonly state: "pending" | "running" | "throttled" | "failed"; } export interface StatusMcpDelegationAttestation { readonly workerTmuxSession: string; readonly workerPid: number; readonly origin: "mcp:h2a_run"; readonly delegatorInstance: string; readonly delegatorTmuxSession: string; } export interface StatusSubagent { readonly id: string; readonly parentInstance: string; readonly name: string; readonly state: "addressable" | "revoked"; readonly waiting: number; readonly lastRoutedAt?: string; readonly lastRoutedEnvelopeId?: string; readonly lastRoutedMailbox?: "inbox" | "outbox"; } export interface StatusInboxEnvelope { readonly id: string; readonly recipient: string; readonly from: string; readonly type: string; readonly createdAt: string; } export interface H2AStatusSnapshotV1 { readonly kind: "h2a-status"; readonly version: 1; readonly tmuxSession?: string; readonly session: StatusRuntimeProjection["session"]; readonly managed: { readonly active: number; readonly attention: number; readonly attentionComplete: boolean; readonly degraded: boolean; readonly agents: readonly StatusRuntimeAgent[]; }; readonly delegations: { readonly open: number; readonly attention: number; readonly degraded: boolean; readonly items: readonly StatusDelegatedExecution[]; }; readonly subagents: { readonly addressable: number; readonly degraded: boolean; readonly items: readonly StatusSubagent[]; }; readonly inbox: { readonly waiting: number; readonly degraded: boolean; readonly envelopes: readonly StatusInboxEnvelope[]; }; readonly loops: { readonly active: number; readonly attention: number; readonly degraded: boolean; readonly items: readonly H2AObjectiveLoop[]; }; readonly presence: { readonly reachable: number; readonly degraded: boolean; readonly instances: readonly string[]; }; readonly gateway: StatusRuntimeProjection["gateway"]; readonly warnings: readonly string[]; } export declare function cleanStatusText(value: unknown, maxScalars?: number): string; export interface StatusSnapshotDependencies { readonly projectRuntime?: (input: { tmuxSession?: string; ownerInstance?: string; includeGateway?: boolean; includeDelegations?: boolean; includeManagedInventory?: boolean; delegationAttestations?: readonly StatusMcpDelegationAttestation[]; delegationAttestationsKnown?: boolean; }) => Promise; } export declare function readStatusSnapshot(input: { readonly root: string; readonly tmuxSession?: string; /** Instance attested by the local MCP sidecar for this exact tmux session. */ readonly ownerInstance?: string; readonly includeGateway?: boolean; readonly includeDelegations?: boolean; readonly includeManagedInventory?: boolean; /** Human detail is the only path that reads ambient presence. */ readonly includePresence?: boolean; readonly includeInbox?: boolean; readonly includeLoops?: boolean; }, dependencies?: StatusSnapshotDependencies): Promise; export declare function renderWorkloadBar(snapshot: H2AStatusSnapshotV1): string; export declare function renderGatewayBar(snapshot: H2AStatusSnapshotV1, maxColumns?: number): string; export declare function renderStatusBar(snapshot: H2AStatusSnapshotV1, segment?: "workload" | "gateway" | "all", maxColumns?: number): string; export declare function renderHumanStatus(snapshot: H2AStatusSnapshotV1): string; export interface StatusSurfaceStreams { readonly stdout: { write(chunk: string): unknown; }; readonly stderr: { write(chunk: string): unknown; }; } export interface StatusSurfaceCliDependencies extends StatusSnapshotDependencies { readonly root: string; readonly openTmuxWindow?: (tmuxSession: string) => Promise; readonly signal?: AbortSignal; } export declare function statusWatchIntervalMs(raw: string | undefined): number; export declare function runStatusSurfaceCli(flags: Record, streams: StatusSurfaceStreams, dependencies: StatusSurfaceCliDependencies): Promise; //# sourceMappingURL=status-surface.d.ts.map