import { type JinnMcpTool } from "./toolkit.js"; /** * GRS-020a — the company-REFERENCE tool group of the `jinn` MCP server: agents * search messages across all sessions, search sessions by structured filters, * and expand a search hit into its surrounding context. * * Contract (012d-0 admission rules, unchanged): every tool is a thin * DETERMINISTIC wrapper over ONE gateway read route; no LLM ranking (message * search is recency-first, session search is last-activity-first); outputs are * decision-shaped with a `hint` naming the next step. * * Domain rules this module owns: * - INJECTION SAFETY lives in the STORE, not here: the registry's * sanitizeFtsQuery turns every token into a quoted FTS5 phrase, so MATCH * operators (* NEAR - " OR) are literal text and a syntax error is * structurally impossible. The tools pass the raw query through as a URL * parameter — they never build SQL or MATCH strings. * - CONTEXT-BOMB GUARDS: search returns SNIPPETS only (≤ {@link SNIPPET_CHAR_CAP} * chars each, ≤ {@link SEARCH_LIMIT_MAX} hits); session search returns * summaries without message bodies; get-context is radius-bounded and * returns each selected message body in full. * - SELF-EXCLUSION (GRS-020a-fix finding 1): search_messages excludes * the CALLER'S OWN session by default — the act of searching for X is * itself a message containing X, and newest-first ranking would return it * as the top hit. Explicit sessionId scope or includeOwnSession opts back * in. This is a read-tier USE of the identity seam, not an authority gate. * - LENGTH CAPS (finding 3): query/text are capped tool-side (structured * "shorten it" error) BEFORE the HTTP call, so an over-long query can never * surface as a raw HTTP 431. Follow-up if real queries ever need more: move * search to a JSON POST route; the GET+caps shape is the KISS v1. * - READ TIER: these are privileged company reads. Tool-marked or * caller-session-claimed requests must carry a valid bound session * capability; operator/browser reads without those headers remain unchanged. * - TEACHING lives on search_messages (one teaching description per * domain); the other two stay short. */ /** Max hits per message search. */ export declare const SEARCH_LIMIT_MAX = 20; /** Default hits per message search. */ export declare const SEARCH_LIMIT_DEFAULT = 10; /** Defensive per-snippet char cap (the store's snippet() is ~12 tokens already). */ export declare const SNIPPET_CHAR_CAP = 300; /** Max session summaries per session search. */ export declare const SESSION_SEARCH_LIMIT_MAX = 50; /** Default session summaries per session search. */ export declare const SESSION_SEARCH_LIMIT_DEFAULT = 20; /** Max messages each side of a context anchor. */ export declare const CONTEXT_RADIUS_MAX = 100; /** Default context radius. */ export declare const CONTEXT_RADIUS_DEFAULT = 3; /** Tool-side cap on the search query / text filter (GRS-020a-fix finding 3): * an over-long query must become a STRUCTURED "shorten it" error before the * HTTP call — never a raw 431 from the HTTP parser. Half the route-side cap, * so the tool always fails first with the friendlier message. */ export declare const QUERY_CHAR_CAP = 512; /** Tool-side cap on every other string filter (ids/slugs are far shorter). */ export declare const FILTER_CHAR_CAP = 256; export declare function buildSearchTools(): JinnMcpTool[]; //# sourceMappingURL=search-tools.d.ts.map