/** * Structural subset of @hasna/events' EventsClient that the registry emits * lifecycle events through. Kept identical to the deleted package's * `AgentEventsClient`. */ export interface AgentEventsClient { emit(input: { source: string; type: string; subject?: string; severity?: 'debug' | 'info' | 'notice' | 'warning' | 'error' | 'critical'; data?: Record; message?: string; }): Promise | unknown; } export interface Agent { id: string; name: string; session_id: string | null; role: string; status: string; active_project_id: string | null; working_dir: string | null; machine_id: string | null; capabilities: string[]; metadata: Record; last_seen_at: string; created_at: string; } interface SqlLike { get(sql: string, ...params: unknown[]): Record | null; all(sql: string, ...params: unknown[]): Array>; run(sql: string, ...params: unknown[]): { changes: number; }; exec(sql: string): void; } /** bun:sqlite's in-memory database: no file, process-local. */ export declare const MEMORY_REGISTRY_PATH = ":memory:"; /** * Where the registry lives. An explicit `HASNA_AGENT_REGISTRY_DB_PATH` always * wins. Otherwise the storage seam decides: a hosted client (a credential * resolved through the @hasna/contracts chain) gets the in-memory registry — * the app home stays free of SQLite files in hosted mode — and only the * explicit local opt-in persists `agent-registry.db` beside economy's store. * With neither, the seam throws its fail-closed error (the same one the * server's own store raised at startup). */ export declare function resolveRegistryDbPath(): string; export declare function resetDefaultStoreForTests(): void; interface ConflictDescriptor { conflict: true; existing_id: string; existing_name: string; last_seen_at: string; session_hint: string | null; working_dir: string | null; message: string; } export declare function emitAgentEvent(client: AgentEventsClient | undefined, type: string, agent: Agent, extra?: Record): Promise; export declare function emitConflictEvent(client: AgentEventsClient | undefined, conflict: ConflictDescriptor): Promise; interface AgentFocus { set(agentId: string, value: { project_id: string | null; }): void; } export interface RegisterAgentToolsOptions { service?: string; events?: AgentEventsClient; db?: SqlLike; agentFocus?: AgentFocus; includeExtendedTools?: boolean; toolFilter?: (name: string) => boolean; } /** * Register the fleet-standard agent-lifecycle tools on an MCP server. * `send_feedback` from the deleted package is NOT implemented here — it * delegated to the retired cloud storage; consumers ship their own * feedback tool (economy's routes through the Store with a category enum). */ export declare function registerAgentTools(server: { tool: (...args: any[]) => unknown; }, opts?: RegisterAgentToolsOptions): void; export {}; //# sourceMappingURL=agent-registry.d.ts.map