/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */ /** * Fleet archive, moves FINISHED process subtrees out of the live fleet view * into a session-scoped archive, without touching the source managers. * * The registry derives nodes live from its sources (AgentManager, WRFC * controller, …), which keep finished records for the life of the session, * so terminal agents/swarms otherwise accumulate in the fleet view forever. * `withFleetArchive` wraps a ProcessRegistry: `query()`/`subscribe()` hide * archived subtrees, `listArchived()` exposes them for a dedicated archive * view (nodes stay fully inspectable, transcripts, usage, cost all still * resolve through the same sources). Archiving is per-runtime (session) * state, mirroring the sources' own lifetime. * * Only subtrees that are ENTIRELY terminal (done / failed / killed / * interrupted) can be archived, a finished member of a still-running swarm * stays visible with its parent. */ import type { FleetSnapshot, ProcessRegistry } from './types.js'; export interface FleetArchiveResult { readonly archived: boolean; /** Number of nodes archived (root + descendants). 0 when refused. */ readonly count: number; /** Honest refusal reason when `archived` is false. */ readonly reason?: string; } export interface FleetArchiveView { /** Archive one finished subtree by root node id. Honest refusal for missing or still-running subtrees. */ archive(id: string): FleetArchiveResult; /** Return an archived subtree to the live view. Returns the number of nodes unarchived. */ unarchive(id: string): number; /** Archive every root subtree that is entirely terminal. Returns the number of nodes archived. */ archiveFinished(): number; /** Snapshot of archived nodes only (same shape as query(), still live-derived from the sources). */ listArchived(): FleetSnapshot; /** Number of currently archived nodes. */ archivedCount(): number; } export type ArchivableProcessRegistry = ProcessRegistry & FleetArchiveView; /** Wrap a ProcessRegistry with session-scoped archive semantics. */ export declare function withFleetArchive(registry: ProcessRegistry): ArchivableProcessRegistry; //# sourceMappingURL=archive.d.ts.map