/** Read-only stdio observability DTOs. No extension runtime or filesystem dependencies. */ export declare const SUBAGENT_OBSERVE_EVENT = "subagent:observe:v1"; export declare const SUBAGENT_RPC_MAX_BYTES = 65536; export interface RpcObservationScope { version: 1; sessionId: string | null; epoch: string; } export type SubagentRpcCommand = { type: "subagent_status"; id?: string; version: 1; }; export interface SubagentRpcTokens { input: number; output: number; total: number; window?: number; windowPeak?: number; } export interface SubagentRpcFleet { version: 1; entries: Array<{ key: string; agent: string; role?: string; model?: string; effort?: string; startedAt: number; tokens: SubagentRpcTokens; goal?: string; }>; totalActive: number; topLevelAsyncCapacity: { used: number; limit: number; }; omitted: number; } export type SubagentRpcLifecycle = "queued" | "pending" | "running" | "complete" | "completed" | "failed" | "partial" | "paused" | "stopped" | "rejected" | "detached"; export interface SubagentRpcNode { key: string; runId?: string; workflowId?: string; agent?: string; status: SubagentRpcLifecycle; activity?: "waiting_supervisor" | "needs_attention"; startedAt?: number; updatedAt?: number; endedAt?: number; progress?: string; currentTool?: string; tokens?: SubagentRpcTokens; error?: string; reason?: string; /** Only explicit runtime execution projections; lifecycle is not a task verdict. */ outcome?: { status: SubagentRpcLifecycle; success?: boolean; exitCode?: number; }; /** Independent point-in-time runner proof, never inferred from outcome. */ processTerminal?: { state: "pending" | "observed" | "unknown" | "not-started"; observedAt?: number; reason?: string; }; children: SubagentRpcNode[]; omittedChildren: number; } export interface SubagentRpcProjection { fleet: SubagentRpcFleet; runs: SubagentRpcNode[]; omitted: { runs: number; children: number; }; } export interface SubagentRpcSnapshot extends RpcObservationScope, SubagentRpcProjection { available: boolean; capabilities: { snapshot: true; events: boolean; }; revision: number; } export interface SubagentRpcEvent extends RpcObservationScope { type: "subagent_event"; revision: number; snapshot: SubagentRpcSnapshot; } export type SubagentRpcResponse = { id?: string; type: "response"; command: "subagent_status"; success: true; data: SubagentRpcSnapshot; }; /** Synchronous, dedicated internal registration. Only native projections, never generic bus invocation. */ export interface SubagentObserveRequest { version: 1; sessionId: string; accept(source: SubagentObservationSource): void; } export interface SubagentObservationSource { snapshot(): SubagentRpcProjection; subscribe(listener: (projection: SubagentRpcProjection | null) => void): () => void; } /** Reject malformed or oversized trusted-extension payloads before JSONL publication. */ export declare function isSubagentRpcProjection(v: unknown): v is SubagentRpcProjection;