import { type ManagedEvent } from './managed-workflows.js'; export type ManagedSessionFacts = { status?: string; budget?: { max_list_cost?: { amount?: string; currency?: string; }; }; usage?: { list_cost?: { amount?: string; currency?: string; }; }; }; export type ManagedCollectorTransport = { readEvents: (since?: string) => Promise; readSession: () => Promise; }; type Phase = { id: string; name: string; status: string; }; type Thread = { id: string; runId: string | null; status: string; phaseId?: string; }; export type ManagedRunSnapshot = { sessionId: string; status: string; stopReason: string | null; budgetCents: number | null; listCostCents: number | null; providerFinished: boolean; workersInspected: false; acceptancePassed: false; verification: 'unverified'; runs: Array<{ id: string; status: string; result?: string; phases: Phase[]; }>; threads: Thread[]; threadOffset: number; threadCount: number; threadCounts: { running: number; ended: number; failed: number; idle: number; }; blockedEventIds: string[]; observedFailures: number; updatedMs: number; }; export type ManagedCollection = { events: ManagedEvent[]; snapshot: ManagedRunSnapshot; }; export declare const COLLECTOR_LIMITS: { readonly sessions: 6; readonly events: 10000; readonly bytes: 16000000; readonly shownThreads: 60; readonly staleMs: 300000; }; /** This cache is an observation aid. Cached facts never authorize an action. */ export declare class ManagedRunCollector { private readonly states; private readonly now; private readonly ttlMs; constructor(options?: { now?: () => number; ttlMs?: number; }); /** Singleflight includes event and session reads; a failed refresh is never cached as success. */ refresh(sessionId: string, transport: ManagedCollectorTransport): Promise; /** Pure observation, suitable for disk snapshot publication. Never invokes a transport. */ snapshots(): ManagedRunSnapshot[]; /** A local worker page only. Aggregate counts and observation timestamp do not change. */ page(sessionId: string, threadOffset?: number): ManagedRunSnapshot | undefined; /** A collector doing work cannot be forgotten midflight. No remote work is interrupted. */ forget(sessionId: string): boolean; private observe; } export declare const sharedManagedCollector: ManagedRunCollector; export {}; //# sourceMappingURL=managed-run-collector.d.ts.map