/** * Dashboard API — shared helpers for the thread route handlers: update-body * validation, thread-name enrichment, per-thread MCP server attachment/parsing. */ import type { ThreadRegistryEntry } from "../../data/memory/thread-registry.js"; import type { Database } from "../../data/memory/schema.js"; import { maskThreadMcpServers, type ThreadMcpServer } from "../../config/index.js"; export declare const VALID_CLIENTS: readonly ["claude", "copilot", "codex", "openai_codex"]; /** Extract valid update fields from a request body. Returns an error string on validation failure. */ export declare function buildThreadUpdates(body: Record): Partial> | string; /** * Enrich thread entries with topic names from topic_registry * when the thread name is generic (e.g. "Thread 1234"). */ export declare function enrichThreadNames(db: Database, threads: ThreadRegistryEntry[]): ThreadRegistryEntry[]; export type ThreadEntryOut = ThreadRegistryEntry & { mcpServers: ReturnType | null; }; /** Attach each thread's custom MCP servers (settings.json, not the DB), header values masked. */ export declare function withThreadMcpServers(threads: ThreadRegistryEntry[]): ThreadEntryOut[]; /** * Coerce a PATCH `mcpServers` body into a validated server map (or null to clear). * Shape-checks http-only transport and rejects the header mask sentinel so a * round-tripped masked value can never be persisted. Returns an error string on * malformed input; deeper rules (reserved names) are enforced by setThreadMcpServers. */ export declare function parseThreadMcpServersBody(raw: unknown): Record | null | string; //# sourceMappingURL=threads-helpers.d.ts.map