/** * Localhost probe server - the piece the TeamShare website detects. * GET /ping answers { ok: true, version, agents } with permissive CORS so the * browser can reach it from the web app (contract section 5). * * Also hosts the workspace-arbitration endpoints (IMP-950): acquire/release * for PATH-shim callers and external tooling, an SSE event hub fed by * /arbitrate/publish, and a combined status view. All state is the shared * FS-backed lock tree in lib/workspace/repo-lock. */ import { type Server } from 'node:http'; export interface ProbeAgentStatus { agentId: string; lastWake?: string; /** True while a session lock is held for this agent (busy). */ busy?: boolean; since?: string; kind?: 'task' | 'chat' | 'doc' | 'board' | 'build' | 'orchestrator' | 'tool'; taskId?: string; projectId?: string; documentId?: string; /** Wakes waiting for the agent to free up. */ queued?: number; /** True when the daemon paused this agent after repeated 401 heartbeats. */ authInvalid?: boolean; } export interface ProbeStatus { configPath: string; agents: ProbeAgentStatus[]; registeredSchemes: boolean; /** Project guard: projectId -> linked folder (never keys). */ projects: Record; } /** Session relay callbacks — wired to SessionRelay by the daemon. */ export interface SessionCallbacks { sessionStart(body: Record): boolean; sessionOutput(body: Record): boolean; sessionEnd(body: Record): boolean; } export declare function startProbeServer(preferredPort: number | undefined, getStatus: () => ProbeStatus, onReload?: () => void, onPushState?: () => void, sessionCallbacks?: SessionCallbacks, onRelease?: (agentId: string) => void): Promise<{ server: Server; port: number; }>; /** Register a new session token for the given agent. Returns the token. */ export declare function registerSessionToken(agentId: string, apiKey: string): string; /** Revoke a session token (harness exit). */ export declare function revokeSessionToken(token: string): void; export declare function probeErrorMessage(err: unknown): string;