/** * Agent CRUD API Handlers * * REST endpoints aligned with Claude Managed Agents pattern: * - Optimistic concurrency (version required on update) * - No-op detection (skip version bump on identical config) * - Partial updates (omitted fields preserved) */ import type { ServerResponse } from 'node:http'; import type { SQLiteDatabase } from '../sqlite.js'; type LooseConfig = Record; import { type ActivitySummaryRow } from '../db/agent-store.js'; import { type ManagedAgentRuntimeSyncOptions } from '../agent/managed-agent-runtime-sync.js'; export declare function buildActivitySummaryAlerts(summary: ActivitySummaryRow[]): string[]; /** GET /api/agents — list all agents with latest version */ export declare function handleGetAgents(res: ServerResponse, config: LooseConfig, db: SQLiteDatabase): void; /** GET /api/agents/:id — single agent detail */ export declare function handleGetAgent(res: ServerResponse, agentId: string, config: LooseConfig, db: SQLiteDatabase): void; /** POST /api/agents — create new agent */ export declare function handleCreateAgent(res: ServerResponse, body: Record, db: SQLiteDatabase, options?: ManagedAgentRuntimeSyncOptions): Promise; /** POST /api/agents/:id — update agent (Managed Agents pattern: version required) */ export declare function handleUpdateAgent(res: ServerResponse, agentId: string, body: Record, db: SQLiteDatabase, options?: ManagedAgentRuntimeSyncOptions): Promise; /** POST /api/agents/:id/archive — archive (soft delete) */ export declare function handleArchiveAgent(res: ServerResponse, agentId: string, db: SQLiteDatabase): void; /** GET /api/agents/:id/versions — version history */ export declare function handleListVersions(res: ServerResponse, agentId: string, db: SQLiteDatabase): void; /** GET /api/agents/:id/metrics?from=&to= — metrics for period */ export declare function handleGetAgentMetrics(res: ServerResponse, agentId: string, from: string, to: string, db: SQLiteDatabase): void; /** GET /api/agents/:id/activity — recent activity log */ export declare function handleGetAgentActivity(res: ServerResponse, agentId: string, db: SQLiteDatabase, limit: number): void; /** GET /api/agents/activity-summary — aggregated activity with alerts */ export declare function handleGetActivitySummary(res: ServerResponse, db: SQLiteDatabase, since: string): void; /** GET /api/agents/:id/versions/:v1/compare/:v2 — before/after comparison */ export declare function handleCompareVersions(res: ServerResponse, agentId: string, v1: number, v2: number, db: SQLiteDatabase): void; export {}; //# sourceMappingURL=agent-handler.d.ts.map