/** * MCP Tool Handlers * * 12 memory tools calling @traqr/memory library functions directly. * No HTTP layer, no apiCall(), no localhost server needed. */ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; /** One capture's triage outcome, as much of it as the headline needs. */ export interface PulseOutcome { zone?: string; deduplicated?: boolean; merged?: boolean; } /** * The `memory_pulse` headline — what actually happened to the caller's text (TD-1334 half a). * * ## Why this was rewritten * * The old line was `Captured N, merged M | Zones: x noop, y new, z borderline`. **Every number * in it was arithmetically correct**, and it was misread five separate times: #4309, twice on * 2026-08-30, once on 08-31, and again on 09-02 — that last one AFTER #4317 had fixed the * destructive half, by an agent who had just read this ticket. Five independent readers is not * five careless readers. It is a wrong vocabulary, and #4317 predicted the fifth in as many * words: *"it should be decided here rather than re-discovered a fifth time."* * * Two words did the damage, and they fail in the SAME direction — both understate what was * written, which is the flattering direction for a store that has lost text before (TD-1069): * * | word | what it means | how it reads | * | -- | -- | -- | * | `merged M` | `action: 'extended'` — **stored your new row** AND retired an older one | M of your captures were absorbed into something else and your text is gone | * | `y new` | `zones.add`, the **triage band** | y rows were written | * * `stored` (band `add`), `extended` and `related` (both band `borderline`) all insert a row, so * `0 new, 3 borderline` printed over three fresh inserts. `deduplicated` is the ONLY outcome * where the caller's text was not written, and it already has its own loud line. * * So: report the write outcome first, and keep the band as a clearly-labelled secondary. * * ⚠️ **This deliberately does NOT rename the `merged` FIELD.** That is the taste call #4317 left * open, and it breaks every reader of the HTTP route's response shape. This is the half that * needs no permission: nothing parses this string (swept 2026-09-02 — the only other hits are * prose in `docs/claude/proxy-invariant.md` and this file's own comments), it is prose for the * agent that just called. * * Pure and exported so the wording is testable without a DB or an OpenAI round-trip — the same * reason #4317 extracted `interpretBorderlineResponse()`, after the defect it fixed survived 150 * days behind an unreachable code path. */ export declare function formatPulseHeadline(successful: PulseOutcome[]): string; export interface PulseIdOutcome { index: number; zone?: string; merged?: boolean; existingId?: string; memory?: { id?: string; }; } /** * The `IDs:` line of a memory_pulse response. On a supersede (`merged`) it also names the row * that was RETIRED (TD-1334, 2026-09-23): the headline said "1 of them ALSO retired an older * memory" without saying which, so a caller whose fuller record had just dropped out of search * had to guess candidates and `memory_read` each one to find it. */ export declare function formatPulseIds(successful: PulseIdOutcome[]): string | null; export declare function registerTools(server: McpServer): void; //# sourceMappingURL=tools.d.ts.map