import type { HandoffSummary, LiveActivityItem, SessionTreeResponse } from "../../types.js"; import type { RuntimeInstanceRecord } from "../../runtime-instance-store.js"; import type { OutboxSummary } from "../../outbox.js"; import type { ChatThreadSummary } from "../../chat-store.js"; import type { AgentLaunchContext, RunLaunchContext } from "../../agent-context-store.js"; import type { Router } from "../router.js"; type LocalSnapshot = Awaited>; type AgentContextState = { agents: Record; runs?: Record; }; type SnapshotPersistState = { lastFingerprint: string; lastPersistAt: number; }; type LiveSnapshotRoutesDeps = { parsePositiveInt: (raw: string | null, fallback: number, max?: number) => number; readSnapshotResponseCache: (key: string, options?: { allowStale?: boolean; }) => Record | null; writeSnapshotResponseCache: (key: string, payload: Record) => void; getSnapshotCacheGeneration: () => number; safeErrorMessage: (err: unknown) => string; readAgentContexts: () => AgentContextState; getScopedAgentIds: (contexts: Record) => Set; readDiagnosticsOutboxStatus: () => Promise | null>; readOutboxSummary: () => Promise; readOutboxItems: () => Promise; loadLocalOpenClawSnapshot: (limit: number) => Promise; toLocalSessionTree: (snapshot: LocalSnapshot, limit?: number) => SessionTreeResponse; toLocalLiveActivity: (snapshot: LocalSnapshot, limit?: number) => Promise<{ activities: LiveActivityItem[]; total: number; }>; toLocalLiveAgents: (snapshot: LocalSnapshot) => { agents: Array<{ initiativeId: string | null; status: string; } & Record>; }; getLiveSessions: (input: { initiative: string | null; projectId: string | null; limit: number; }) => Promise; getLiveActivity: (input: { run: string | null; since: string | null; projectId: string | null; limit: number; }) => Promise<{ activities: LiveActivityItem[]; }>; getHandoffs: () => Promise<{ handoffs: HandoffSummary[]; }>; getLiveDecisions: (input: { status: string; projectId: string | null; limit: number; }) => Promise<{ decisions: unknown[]; }>; getLiveAgents: (input: { initiative: string | null; projectId: string | null; includeIdle: boolean | undefined; }) => Promise<{ agents?: unknown[]; }>; listInitiativeIdsForProject: (input: { projectId: string; }) => Promise; mapDecisionEntity: (entry: unknown) => Record & { waitingMinutes: number; }; applyAgentContextsToSessionTree: (input: SessionTreeResponse, contexts: { agents: Record; runs: Record; }) => SessionTreeResponse; applyAgentContextsToActivity: (input: LiveActivityItem[], contexts: { agents: Record; runs: Record; }) => LiveActivityItem[]; mergeSessionTrees: (base: SessionTreeResponse, extra: SessionTreeResponse) => SessionTreeResponse; mergeActivities: (base: LiveActivityItem[], extra: LiveActivityItem[], limit: number) => LiveActivityItem[]; semanticActivityKey: (item: LiveActivityItem) => string | null; listRuntimeInstances: (input: { limit: number; }) => RuntimeInstanceRecord[]; injectRuntimeInstancesAsSessions: (input: SessionTreeResponse, instances: RuntimeInstanceRecord[]) => SessionTreeResponse; enrichSessionsWithRuntime: (input: SessionTreeResponse, instances: RuntimeInstanceRecord[]) => SessionTreeResponse; enrichActivityWithRuntime: (input: LiveActivityItem[], instances: RuntimeInstanceRecord[]) => LiveActivityItem[]; snapshotActivityFingerprint: (items: LiveActivityItem[]) => string; appendActivityItems: (items: LiveActivityItem[]) => void; snapshotActivityPersistMinIntervalMs: number; readSnapshotPersistState: () => SnapshotPersistState; writeSnapshotPersistState: (state: SnapshotPersistState) => void; parseJsonRequest?: (req: TReq) => Promise>; buildNextUpQueue?: (input: { initiativeId?: string | null; projectId?: string | null; }) => Promise<{ items: Array>; degraded: string[]; }>; bulkDecideDecisions?: (ids: string[], action: "approve" | "reject", input?: { note?: string; optionId?: string; }) => Promise>; emitDecisionResolvedActivity?: (input: { ids: string[]; action: "approve" | "reject"; note?: string | null; optionId?: string | null; sliceRunId?: string | null; initiativeId?: string | null; }) => Promise; runAction?: (runId: string, action: "pause" | "resume" | "cancel" | "rollback", input?: { checkpointId?: string; reason?: string; }) => Promise; listChatThreads?: (input: { commandCenterId?: string | null; initiativeId?: string | null; limit?: number; offset?: number; }) => { threads: ChatThreadSummary[]; total: number; updatedAt: string; }; getCanonicalAutopilotState?: (initiativeId: string) => { state: "idle" | "running" | "blocked" | "stopping"; reason: string | null; activeRunId: string | null; activeWorkstreamId: string | null; activeWorkstreamTitle: string | null; queueHeadTitle: string | null; lastTransitionAt: string; } | null; sendJson: (res: TRes, status: number, payload: unknown) => void; securityHeaders: Record; corsHeaders: Record; }; export declare function registerLiveSnapshotRoutes void) => void; }, TRes extends { write?: (chunk: string | Buffer) => boolean | void; end: (chunk?: string | Buffer) => void; writeHead: (statusCode: number, headers?: Record) => unknown; writableEnded?: boolean; on?: (event: string, listener: () => void) => void; once?: (event: string, listener: () => void) => void; }>(router: Router, TReq, TRes>, deps: LiveSnapshotRoutesDeps): void; export {};