import { type JinnMcpTool } from "./toolkit.js"; /** * GRS-017a — the SESSIONS tool group of the `jinn` MCP server: agents spawn, * read, message, list, and stop sessions through typed tools instead of curl. * This is the operator's headline for the MCP company surface: agents * communicate via MCP, not raw HTTP. * * Contract (012d-0 admission rules, unchanged): every tool is a thin * DETERMINISTIC wrapper over ONE existing gateway session route; outputs are * decision-shaped (record fields + a `hint` naming the next step); structured * gateway errors pass through readable so the agent self-corrects. * * Domain-specific rules this module owns: * - SESSION READING: `last` is a non-negative integer, where 0 requests the * whole transcript. Message bodies are returned as stored. * - PROTOCOL TEACHING lives in exactly two places (schema-budget rule "one * teaching description per domain"): the spawn tool's description/hint * carries the end-turn-and-await-callback protocol; everything else stays * one-line. * - IDENTITY: ctx.callerSessionId (the JINN_SESSION_ID env) rides every call * as `x-jinn-caller-session` via the toolkit. The GATEWAY enforces the * guards (no-self, rate cap, hop budget, own-descendant stop) so curl is * equally guarded; tools only pre-check what saves a pointless round trip. * - FAIL CLOSED ON LOST IDENTITY (codex finding 2): spawn/send/stop always * act on behalf of a session, so when this server has NO caller identity * (an engine stripped JINN_SESSION_ID) they refuse locally — and the * routes refuse the marker-tagged request too — instead of falling through * to the gateway's unrestricted operator paths. Reads stay available. * - DELIBERATELY ABSENT: a delete tool. Deleting a session destroys the * durable record (messages, links, evidence). That is the session-domain * twin of gate-resolve: it needs HUMAN actor authority, which no * environment gate or self-declared header can substitute (GRS-015 * lesson). Deletion stays on the HTTP route / web UI for the operator. */ /** Default messages per read when `last` is omitted. */ export declare const READ_LAST_DEFAULT = 30; /** Max sessions per list call. */ export declare const LIST_LIMIT_MAX = 50; /** Default sessions per list call. */ export declare const LIST_LIMIT_DEFAULT = 20; export declare function buildSessionTools(): JinnMcpTool[]; //# sourceMappingURL=session-tools.d.ts.map