/** * Shared blackboard for sub-agent coordination + automatic maintenance. * * Sub-agents cannot message each other live (platform limitation), so * TeamMode uses a file blackboard under * `/.git/opencode-team///`: * - is a compact timestamp folder, one per conversation — * a fresh conversation can never collide with a not-yet-swept board * from an earlier one; * - each agent writes its full deliverable to a designated file; * - the team lead relays summaries + file paths in every dispatch; * - nobody deletes task directories by hand; the sweeper below reclaims * them once idle past the TTL (sole cleanup path, by design). * * This module is the code-level reclamation path, independent of the model: * a sweeper removes task directories whose last activity is older than * the TTL, at plugin startup and hourly in-process. Placing the board * inside `.git/` guarantees the user's working tree and commits are never * polluted; for non-git workspaces we fall back to the OS temp dir. * * TTL is user-configurable via plugin options: * "plugin": [["@te-river/opencode-team-mode", { "ttlDays": 7 }]] * Default: 5 days. */ /** Default idle time before a task directory is swept: 5 days. */ export declare const DEFAULT_TTL_DAYS = 5; export declare const DEFAULT_TTL_MS: number; /** Walk upward from `start` to find the git repository root, if any. */ export declare function findRepoRoot(start: string): string | null; /** Absolute blackboard root for a workspace. */ export declare function teamRootFor(directory: string): string; /** * Resolve the TTL from plugin options. Accepts `ttlDays` (or the more * explicit `blackboardTtlDays`) as a finite number in (0, 365]; anything * else silently falls back to the 5-day default. */ export declare function resolveTtlMs(options?: Record): number; /** * Remove idle boards under `root`. Understands both layouts: * - session-partitioned `///`: stale tasks are * pruned individually under a live session; an entirely idle session * folder goes as a whole; * - legacy flat `//`: unchanged semantics — and if such a dir * unexpectedly contains sub-directories, idle ones are pruned by the * same rule (harmless hygiene, though counted as task dirs). * Returns the number of task directories reclaimed; a wholesale session * removal counts its task dirs (min 1, so a ghost empty stale session dir * also counts 1). Never throws. */ export declare function sweepStale(root: string, ttlMs?: number): number; /** * Start blackboard maintenance (idempotent within the process) and return * the resolved board root. Runs a startup sweep (catches leftovers from * crashes / force-kills) plus an unref'd hourly interval so the timer never * keeps the process alive on its own. */ export declare function startBlackboardMaintenance(directory: string, ttlMs?: number): string; //# sourceMappingURL=blackboard.d.ts.map