@usekaval/mcp
Advanced tools
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,+EAA+E;AAC/E,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAkB,IAAI,oBAAoB;CAC3C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED,wBAAgB,mBAAmB,CACjC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,KAAK,CASP"} | ||
| {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,+EAA+E;AAC/E,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAkB,IAAI,oBAAoB;CAC3C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED,wBAAgB,mBAAmB,CACjC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,KAAK,CAqBP"} |
+13
-1
@@ -18,4 +18,16 @@ // Build the agent-facing client from env. MCP is a *thin client* over the hosted Kaval API — | ||
| // KAVAL_BASE_URL is optional; the client defaults to https://api.usekaval.com. | ||
| return new Kaval({ apiKey, baseUrl: env.KAVAL_BASE_URL }); | ||
| // | ||
| // The transport deadline is MCP's constraint, not the API's. A cold check researches for as long | ||
| // as the server's budget allows (up to 100s), so the client's own 30s default aborted the headline | ||
| // call a third of the way in — but the ceiling here is lower still: `@modelcontextprotocol/sdk` | ||
| // cancels a tool call after DEFAULT_REQUEST_TIMEOUT_MSEC (60s), and a caller-side cancellation | ||
| // reaches the agent as a dead request rather than an error it can act on. 55s is the widest | ||
| // deadline that still fires on OUR side, leaving room for the narrowed research budget in | ||
| // server.ts plus the round-trip around it. | ||
| return new Kaval({ | ||
| apiKey, | ||
| baseUrl: env.KAVAL_BASE_URL, | ||
| timeoutMs: 55_000, | ||
| }); | ||
| } | ||
| //# sourceMappingURL=env.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,kGAAkG;AAClG,yFAAyF;AACzF,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,+EAA+E;AAC/E,MAAM,OAAO,cAAe,SAAQ,KAAK;IACrB,IAAI,GAAG,gBAAgB,CAAC;CAC3C;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,KAAK,YAAY,cAAc,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,MAA0C,OAAO,CAAC,GAAG;IAErD,MAAM,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC;IACjC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,cAAc,CACtB,yFAAyF,CAC1F,CAAC;IACJ,CAAC;IACD,+EAA+E;IAC/E,OAAO,IAAI,KAAK,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;AAC5D,CAAC"} | ||
| {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,kGAAkG;AAClG,yFAAyF;AACzF,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,+EAA+E;AAC/E,MAAM,OAAO,cAAe,SAAQ,KAAK;IACrB,IAAI,GAAG,gBAAgB,CAAC;CAC3C;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,KAAK,YAAY,cAAc,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,MAA0C,OAAO,CAAC,GAAG;IAErD,MAAM,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC;IACjC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,cAAc,CACtB,yFAAyF,CAC1F,CAAC;IACJ,CAAC;IACD,+EAA+E;IAC/E,EAAE;IACF,iGAAiG;IACjG,mGAAmG;IACnG,gGAAgG;IAChG,+FAA+F;IAC/F,4FAA4F;IAC5F,0FAA0F;IAC1F,2CAA2C;IAC3C,OAAO,IAAI,KAAK,CAAC;QACf,MAAM;QACN,OAAO,EAAE,GAAG,CAAC,cAAc;QAC3B,SAAS,EAAE,MAAM;KAClB,CAAC,CAAC;AACL,CAAC"} |
+9
-6
| /** | ||
| * @usekaval/mcp — the Kaval verification surface for AI agents. Before an agent acts, Kaval | ||
| * verifies the facts the action relies on and returns a time-bounded signed proof a policy can | ||
| * enforce — ALLOW, REVIEW, or BLOCK. Exposes the primary `verify` conclusion tool, the | ||
| * `proof_audit` / `proof_gate` lifecycle, legacy currentness compatibility tools, and | ||
| * `report_outcome`, built on the thin `kaval` HTTP client for the hosted Kaval API. | ||
| * Run the stdio server via the `kaval-mcp` bin (for `mcp add` / `npx @usekaval/mcp`). | ||
| * @usekaval/mcp — the Kaval verification surface for AI agents. Before an agent acts, it sends the | ||
| * proposed action; Kaval identifies the facts that action depends on, checks them against the | ||
| * sources it watches, and answers ALLOW, REVIEW, or BLOCK with a signed receipt. | ||
| * | ||
| * Seven tools: `check` (the one that does the work), `get_receipt` (the signed document behind its | ||
| * verdict), `add_source` / `list_sources` / `remove_source` (what Kaval watches, which is what keeps | ||
| * `check` warm), `report_outcome`, and the deprecated `verify` pilot alias. Built on the thin | ||
| * `kaval` HTTP client for the hosted Kaval API. Run the stdio server via the `kaval-mcp` bin (for | ||
| * `mcp add` / `npx @usekaval/mcp`). | ||
| */ | ||
@@ -9,0 +12,0 @@ export { createMcpServer } from "./server.js"; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"} |
+9
-6
| /** | ||
| * @usekaval/mcp — the Kaval verification surface for AI agents. Before an agent acts, Kaval | ||
| * verifies the facts the action relies on and returns a time-bounded signed proof a policy can | ||
| * enforce — ALLOW, REVIEW, or BLOCK. Exposes the primary `verify` conclusion tool, the | ||
| * `proof_audit` / `proof_gate` lifecycle, legacy currentness compatibility tools, and | ||
| * `report_outcome`, built on the thin `kaval` HTTP client for the hosted Kaval API. | ||
| * Run the stdio server via the `kaval-mcp` bin (for `mcp add` / `npx @usekaval/mcp`). | ||
| * @usekaval/mcp — the Kaval verification surface for AI agents. Before an agent acts, it sends the | ||
| * proposed action; Kaval identifies the facts that action depends on, checks them against the | ||
| * sources it watches, and answers ALLOW, REVIEW, or BLOCK with a signed receipt. | ||
| * | ||
| * Seven tools: `check` (the one that does the work), `get_receipt` (the signed document behind its | ||
| * verdict), `add_source` / `list_sources` / `remove_source` (what Kaval watches, which is what keeps | ||
| * `check` warm), `report_outcome`, and the deprecated `verify` pilot alias. Built on the thin | ||
| * `kaval` HTTP client for the hosted Kaval API. Run the stdio server via the `kaval-mcp` bin (for | ||
| * `mcp add` / `npx @usekaval/mcp`). | ||
| */ | ||
@@ -9,0 +12,0 @@ export { createMcpServer } from "./server.js"; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC"} |
+9
-5
| import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; | ||
| import { type Kaval } from "@usekaval/kaval"; | ||
| /** | ||
| * The agent-facing verification server. Before an AI agent acts, Kaval verifies the facts the | ||
| * action relies on and returns a time-bounded signed proof a policy can enforce — ALLOW, REVIEW, | ||
| * or BLOCK. It exposes the primary `verify` conclusion surface, the full `proof_audit` / | ||
| * `proof_gate` lifecycle, the legacy currentness compatibility tools, and outcome reporting. | ||
| * Tool names use underscores for client portability. | ||
| * The agent-facing verification server. | ||
| * | ||
| * One tool does the work: `check`. Before an agent acts, it sends the proposed action; Kaval | ||
| * identifies the facts that action depends on, checks them against the sources it watches, and | ||
| * returns ALLOW, REVIEW, or BLOCK with a signed receipt. `get_receipt` fetches the full signed | ||
| * document behind that receipt id, which is what an agent shows when it blocks. `add_source` / | ||
| * `list_sources` / `remove_source` control what Kaval watches; `report_outcome` closes the | ||
| * calibration loop. `verify` is a deprecated alias kept for pilot integrations. Tool names use | ||
| * underscores for client portability. | ||
| */ | ||
| export declare function createMcpServer(client: Kaval): McpServer; | ||
| //# sourceMappingURL=server.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AA6MzD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,GAAG,SAAS,CAiSxD"} | ||
| {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAKL,KAAK,KAAK,EACX,MAAM,iBAAiB,CAAC;AAqSzB;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,KAAK,GAAG,SAAS,CA0SxD"} |
+275
-188
| import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; | ||
| import { KavalError } from "@usekaval/kaval"; | ||
| import { DEFAULT_CHECK_MAX_WAIT_MS, KavalError, KavalRetiredError, MIN_CHECK_MAX_WAIT_MS, } from "@usekaval/kaval"; | ||
| import { z } from "zod"; | ||
| /** | ||
| * The live-research budget MCP asks for. Its floor and the API's own default come from the client, | ||
| * which is where the published contract lives — quoting either by hand is how the "defaults to | ||
| * 3000" this tool text used to carry outlived the engine that abandoned it. | ||
| * | ||
| * A cold action check genuinely uses DEFAULT_CHECK_MAX_WAIT_MS, but MCP cannot spend it: | ||
| * `@modelcontextprotocol/sdk` cancels a tool call after DEFAULT_REQUEST_TIMEOUT_MSEC (60s), so a | ||
| * check that silently inherited the server default would be killed by the caller mid-research and | ||
| * the agent would see a cancelled request instead of a verdict. So this server sends a budget | ||
| * explicitly, sized to fit inside the transport deadline in `env.ts` (55s) with room for the | ||
| * round-trip: the timeout, when it comes, fires on our side with a recovery move attached. | ||
| * | ||
| * A caller can still ask for LESS — that is what the bound is for — down to MIN_CHECK_MAX_WAIT_MS, | ||
| * which disables research entirely and is exactly what `mode: "fast"` sets. | ||
| */ | ||
| const MCP_CHECK_MAX_WAIT_MS = 45_000; | ||
| const RECOVERABLE_API_CODES = new Set([ | ||
| "idempotency_in_progress", | ||
| "idempotency_resolution_pending", | ||
| "event_persistence_pending", | ||
| ]); | ||
| const idempotencyKeyInput = z | ||
@@ -11,7 +32,2 @@ .string() | ||
| .describe("reuse the operation key returned by an ambiguous prior attempt; omit for a new operation"); | ||
| const RECOVERABLE_API_CODES = new Set([ | ||
| "idempotency_in_progress", | ||
| "idempotency_resolution_pending", | ||
| "event_persistence_pending", | ||
| ]); | ||
| const materialityInput = z.enum(["low", "medium", "high", "critical"]); | ||
@@ -24,17 +40,2 @@ const reversibilityInput = z.enum([ | ||
| ]); | ||
| const actionContextInput = { | ||
| description: z.string().min(1).max(10_000), | ||
| materiality: materialityInput, | ||
| reversibility: reversibilityInput, | ||
| false_allow_cost_usd: z.number().finite().nonnegative().optional(), | ||
| false_block_cost_usd: z.number().finite().nonnegative().optional(), | ||
| wait_cost_usd: z.number().finite().nonnegative().optional(), | ||
| }; | ||
| const decisionThresholdInput = { | ||
| policy_id: z.string().min(1), | ||
| policy_version: z.string().min(1), | ||
| materiality: materialityInput, | ||
| maximum_false_allow_risk: z.number().min(0).max(1), | ||
| minimum_evidence_coverage: z.number().min(0).max(1), | ||
| }; | ||
| const httpUrlInput = z | ||
@@ -80,2 +81,48 @@ .string() | ||
| .describe("1-20 evidence references the conclusion relies on: plain http(s) URL strings, or { url, document_id } objects with unique document_id values"); | ||
| /** A caller-decomposed fact. Structured claims skip compilation entirely — no model call. */ | ||
| /** Mirrors the server's `EntityRef`: a named entity, optionally with an id and a type. */ | ||
| const entityRefInput = z.object({ | ||
| name: z.string().min(1), | ||
| id: z.string().min(1).optional(), | ||
| type: z.string().min(1).optional(), | ||
| }); | ||
| /** Mirrors the server's `FactScope`: scalar values, not strings only. */ | ||
| const scopeValueInput = z.union([ | ||
| z.string(), | ||
| z.number().finite(), | ||
| z.boolean(), | ||
| z.null(), | ||
| ]); | ||
| const structuredClaimInput = z | ||
| .object({ | ||
| subject: z.union([z.string().trim().min(1).max(1_000), entityRefInput]), | ||
| predicate: z.string().trim().min(1).max(1_000), | ||
| object: z | ||
| .union([ | ||
| z.string().trim().min(1).max(2_000), | ||
| entityRefInput, | ||
| z.number().finite(), | ||
| z.boolean(), | ||
| z.null(), | ||
| ]) | ||
| .optional(), | ||
| scope: z | ||
| .record(scopeValueInput) | ||
| .optional() | ||
| .describe("what the claim is scoped to, e.g. { jurisdiction: 'US', plan: 'HMO' }"), | ||
| materiality: materialityInput.optional(), | ||
| text: z.string().trim().min(1).max(2_000).optional(), | ||
| }) | ||
| .strict(); | ||
| const claimInput = z.union([ | ||
| z.string().trim().min(1).max(2_000).describe("the fact as a plain sentence"), | ||
| structuredClaimInput, | ||
| ]); | ||
| const watchedSourceKindInput = z.enum([ | ||
| "url", | ||
| "push", | ||
| "connection", | ||
| "entity", | ||
| "discovered", | ||
| ]); | ||
| function json(data) { | ||
@@ -108,9 +155,25 @@ return { content: [{ type: "text", text: JSON.stringify(data) }] }; | ||
| } | ||
| // The retired-route body is a FLAT { error: "tool_retired", replacement } — not the envelope. | ||
| if (typeof err === "string") | ||
| return { code: err }; | ||
| } | ||
| return {}; | ||
| } | ||
| /** True when a rejection means the request ran out of time — the MCP caller cancelled, or the | ||
| * client's own transport deadline fired. The node client aborts with the Error it constructed | ||
| * rather than a DOMException, so name-sniffing alone would miss its timeout. */ | ||
| function isTimeout(error, signal) { | ||
| if (signal?.aborted) | ||
| return true; | ||
| if (!(error instanceof Error)) | ||
| return false; | ||
| return (error.name === "AbortError" || | ||
| error.name === "TimeoutError" || | ||
| /timed out/i.test(error.message)); | ||
| } | ||
| /** Run a tool body, returning a sanitized error result. An API error (e.g. 402 out-of-credit, 401 | ||
| * invalid key, 404 proof_not_found) is surfaced with its status + code/message so the agent can act | ||
| * on it; anything else collapses to a generic message so internal details never leak. */ | ||
| async function safe(fn) { | ||
| * invalid key, 410 tool_retired) is surfaced with its status + code/message so the agent can act | ||
| * on it; a timeout and an unreachable host are named too, because both have a move the agent can | ||
| * make. Anything else collapses to a generic message so internal details never leak. */ | ||
| async function safe(fn, signal) { | ||
| try { | ||
@@ -121,2 +184,12 @@ return json(await fn()); | ||
| console.error("[kaval-mcp] tool error:", e); | ||
| // A 410 means this client is older than the server's surface. Name the route that replaced the | ||
| // one it called, read off the error — hard-coding a version number produced the absurdity of | ||
| // telling a 0.6 caller to upgrade to 0.6, and would do it again at 0.7. | ||
| if (e instanceof KavalRetiredError) { | ||
| return toolError({ | ||
| error: "tool_retired", | ||
| message: `this capability was folded into ${e.replacement} — call the \`check\` tool with the action you are about to take, or with the claims it depends on.`, | ||
| status: 410, | ||
| }); | ||
| } | ||
| if (e instanceof KavalError) { | ||
@@ -143,2 +216,19 @@ const { code, message } = apiError(e.payload); | ||
| } | ||
| // A check that outruns the deadline is the single most likely failure on the cold path, and an | ||
| // agent handed the bare words "internal error" has nowhere to go. Both of the remaining shapes | ||
| // have a next move, so say which one happened. | ||
| if (isTimeout(e, signal)) { | ||
| return toolError({ | ||
| error: "timeout", | ||
| message: "the request did not finish inside the deadline — retry with mode:'fast' (stored state only, no research) or a smaller max_wait_ms", | ||
| }); | ||
| } | ||
| // `fetch` rejects with a TypeError when no response was ever produced: an unreachable host, a | ||
| // DNS failure, or a malformed KAVAL_BASE_URL. That last one used to read as an internal fault. | ||
| if (e instanceof TypeError) { | ||
| return toolError({ | ||
| error: "network_unreachable", | ||
| message: "could not reach the Kaval API — check KAVAL_BASE_URL and network access, then retry", | ||
| }); | ||
| } | ||
| return toolError({ error: "internal error" }); | ||
@@ -148,203 +238,172 @@ } | ||
| /** | ||
| * The agent-facing verification server. Before an AI agent acts, Kaval verifies the facts the | ||
| * action relies on and returns a time-bounded signed proof a policy can enforce — ALLOW, REVIEW, | ||
| * or BLOCK. It exposes the primary `verify` conclusion surface, the full `proof_audit` / | ||
| * `proof_gate` lifecycle, the legacy currentness compatibility tools, and outcome reporting. | ||
| * Tool names use underscores for client portability. | ||
| * The agent-facing verification server. | ||
| * | ||
| * One tool does the work: `check`. Before an agent acts, it sends the proposed action; Kaval | ||
| * identifies the facts that action depends on, checks them against the sources it watches, and | ||
| * returns ALLOW, REVIEW, or BLOCK with a signed receipt. `get_receipt` fetches the full signed | ||
| * document behind that receipt id, which is what an agent shows when it blocks. `add_source` / | ||
| * `list_sources` / `remove_source` control what Kaval watches; `report_outcome` closes the | ||
| * calibration loop. `verify` is a deprecated alias kept for pilot integrations. Tool names use | ||
| * underscores for client portability. | ||
| */ | ||
| export function createMcpServer(client) { | ||
| const server = new McpServer({ name: "kaval", version: "0.5.0" }); | ||
| const server = new McpServer({ name: "kaval", version: "0.6.0" }); | ||
| const api = client; | ||
| // The primary compatibility surface for single conclusions: one call in, a signed decision out. | ||
| server.registerTool("verify", { | ||
| description: "Verify one load-bearing conclusion against its evidence references before an agent acts on it. Kaval independently re-derives the truth and returns status valid | invalidated | could_not_verify plus a signed, time-bounded proof receipt your policy can enforce: receipt.decision is ALLOW, REVIEW, or BLOCK, with the full signed ProofPacket attached. Expiry lives at receipt.packet.action_decision.expires_at. REVIEW is never permission to act. For production actions, build proof with proof_audit and enforce it at act time with proof_gate.", | ||
| server.registerTool("check", { | ||
| description: "Verify the facts an action depends on BEFORE acting on it. Describe the action you are about to take (and any context you are relying on), or pass the specific claims, and Kaval re-checks each fact against the sources it watches — returning decision ALLOW, REVIEW, or BLOCK with a signed receipt. ALLOW: every material fact still holds on fresh evidence — proceed. REVIEW: something is unknown, mid-re-evaluation, or changed at low/medium materiality — REVIEW IS NEVER PERMISSION TO ACT; surface it to a human or re-research. BLOCK: a high/critical fact has changed, or a critical fact is unknown — do not proceed. Each returned fact carries its status (holds | changed | unknown) and the sources it rests on, so you can see exactly WHICH belief moved. A fact already backed by a watched source is answered from stored state in ~50ms with no model call and no fetch, so calling it on every consequential action is cheap; a fact Kaval has not seen before has to be researched first and takes seconds. Use this instead of re-researching a fact you already believe.", | ||
| inputSchema: { | ||
| conclusion: z | ||
| action: z | ||
| .string() | ||
| .trim() | ||
| .min(1) | ||
| .max(10_000) | ||
| .describe("the exact assertable proposition the downstream workflow intends to rely on"), | ||
| evidence_refs: evidenceRefsInput, | ||
| as_of: z | ||
| .optional() | ||
| .describe("what you are about to do, in plain language, e.g. 'Approve this claim at the 2026 in-network rate'. Kaval extracts the facts it depends on."), | ||
| context: z | ||
| .string() | ||
| .datetime({ offset: true }) | ||
| .trim() | ||
| .min(1) | ||
| .max(10_000) | ||
| .optional() | ||
| .describe("RFC 3339 cutoff for what the conclusion may rely on"), | ||
| materiality: materialityInput.optional(), | ||
| intended_action: z.string().trim().min(1).max(10_000).optional(), | ||
| reversibility: reversibilityInput.optional(), | ||
| jurisdiction: z.string().trim().min(1).max(256).optional(), | ||
| context: z.string().trim().min(1).max(4_000).optional(), | ||
| idempotency_key: idempotencyKeyInput, | ||
| }, | ||
| }, async ({ idempotency_key, ...args }, { signal }) => safe(() => api.verify(args, transportOptions(idempotency_key, signal)))); | ||
| server.registerTool("proof_audit", { | ||
| description: "Build the complete action-bound Kaval ProofPacket (the expensive path): compile atomic claims, run support and falsification research, preserve exact evidence and lineage, adjudicate scope/time/conflicts, and return ALLOW, REVIEW, or BLOCK with an Ed25519-signed receipt. Apply the result at act time through proof_gate so the configured rollout policy remains authoritative.", | ||
| inputSchema: { | ||
| text: z.string().min(1).max(10_000), | ||
| .describe("what you already believe that bears on the action — the retrieved chunk, the cached field, the prior answer"), | ||
| claims: z | ||
| .array(claimInput) | ||
| .min(1) | ||
| .max(20) | ||
| .optional() | ||
| .describe("check these facts directly instead of extracting them: plain sentences, or {subject, predicate, object, scope} objects (structured claims skip extraction entirely)"), | ||
| mode: z | ||
| .enum(["fast", "standard"]) | ||
| .optional() | ||
| .describe("'standard' (default) may research anything stale or novel within max_wait_ms; 'fast' answers only from stored state and reports anything it does not know as unknown"), | ||
| max_wait_ms: z | ||
| .number() | ||
| .int() | ||
| .min(MIN_CHECK_MAX_WAIT_MS) | ||
| .max(MCP_CHECK_MAX_WAIT_MS) | ||
| .optional() | ||
| .describe(`budget in ms for live research on facts that are stale or new. Over MCP this defaults to ${MCP_CHECK_MAX_WAIT_MS} and cannot go higher, because a tool call is cancelled by the caller at 60s; the API's own default, for direct HTTP callers, is ${DEFAULT_CHECK_MAX_WAIT_MS}. Lower it when a bounded REVIEW beats waiting; ${MIN_CHECK_MAX_WAIT_MS} disables research entirely, which is what mode:'fast' does. Facts that miss the budget come back as unknown.`), | ||
| origin_urls: z | ||
| .array(httpUrlInput) | ||
| .max(20) | ||
| .optional() | ||
| .describe("authoritative sources for this action, merged with whatever this workspace already watches"), | ||
| materiality: materialityInput | ||
| .optional() | ||
| .describe("how much this action's correctness matters — drives whether a changed fact is REVIEW or BLOCK"), | ||
| as_of: z | ||
| .string() | ||
| .datetime({ offset: true }) | ||
| .optional() | ||
| .describe("RFC 3339 cutoff for what the action may rely on"), | ||
| materiality: materialityInput.optional(), | ||
| intended_action: z.string().min(1).max(10_000).optional(), | ||
| reversibility: reversibilityInput.optional(), | ||
| false_allow_cost_usd: z.number().finite().nonnegative().optional(), | ||
| false_block_cost_usd: z.number().finite().nonnegative().optional(), | ||
| wait_cost_usd: z.number().finite().nonnegative().optional(), | ||
| domain: z | ||
| .string() | ||
| .min(1) | ||
| .max(256) | ||
| .optional() | ||
| .describe("descriptive metadata only; never expands calibration support"), | ||
| subject_hint: z.string().min(1).max(1_000).optional(), | ||
| jurisdiction: z.string().min(1).max(256).optional(), | ||
| geography: z.string().min(1).max(256).optional(), | ||
| units: z.string().min(1).max(128).optional(), | ||
| context: z.string().min(1).max(4_000).optional(), | ||
| aliases: z.array(z.string().min(1).max(512)).max(50).optional(), | ||
| origin_urls: z.array(httpUrlInput).max(20).optional(), | ||
| record: z | ||
| .object({ | ||
| system: z.string(), | ||
| id: z.string(), | ||
| table: z.string().optional(), | ||
| }) | ||
| .strict() | ||
| .optional(), | ||
| record_field: z.string().min(1).max(512).optional(), | ||
| idempotency_key: idempotencyKeyInput, | ||
| }, | ||
| }, async ({ idempotency_key, ...args }, { signal }) => safe(() => api.audit(args, transportOptions(idempotency_key, signal)))); | ||
| server.registerTool("proof_gate", { | ||
| description: "Apply an existing durable proof to the exact action at act time — no search, parsing, or model call is repeated. Supply exactly one of proof_id or proof_key. Returns the proof state plus the full ActionDecision (ALLOW, REVIEW, or BLOCK). Only when enforcement.controlApplied is true may Kaval control execution; then honor executionAllowed exactly. controlApplied false is shadow telemetry and must not control the customer's action. If enforcement is absent, fail closed unless state is current and decision.decision is ALLOW. A missing proof surfaces as a typed proof_not_found error.", | ||
| inputSchema: { | ||
| proof_id: z.string().min(1).max(512).optional(), | ||
| proof_key: z.string().min(1).max(512).optional(), | ||
| expected_dependency_versions: z | ||
| .record(z.string().min(1), z.string().min(1)) | ||
| .optional(), | ||
| material_claim_ids: z.array(z.string().min(1).max(512)).min(1).max(100), | ||
| threshold: z.object(decisionThresholdInput).strict(), | ||
| action: z.object(actionContextInput).strict(), | ||
| idempotency_key: idempotencyKeyInput, | ||
| }, | ||
| }, async ({ idempotency_key, ...args }, { signal }) => { | ||
| if ((args.proof_id === undefined) === (args.proof_key === undefined)) { | ||
| }, async ({ max_wait_ms, ...args }, { signal }) => { | ||
| if (args.action === undefined && args.claims === undefined) { | ||
| return toolError({ | ||
| error: "bad_request", | ||
| message: "provide exactly one of proof_id or proof_key", | ||
| message: "provide `action` (what you are about to do) or `claims` (the facts to check)", | ||
| }); | ||
| } | ||
| return safe(() => api.gate(args, transportOptions(idempotency_key, signal))); | ||
| // Always send the budget. Omitting it inherits the API's 100s default, which outlives the MCP | ||
| // caller's own request deadline — the check would be cancelled rather than answered. | ||
| return safe(() => api.check({ ...args, max_wait_ms: max_wait_ms ?? MCP_CHECK_MAX_WAIT_MS }, transportOptions(undefined, signal)), signal); | ||
| }); | ||
| // Legacy compatibility for the original held-belief API. These POST the legacy belief body to the | ||
| // same live routes; the server accepts it as a fallback alongside the primary conclusion shape. | ||
| server.registerTool("currentness_verify", { | ||
| description: "LEGACY HELD-BELIEF COMPATIBILITY — call this before acting on a cached fact, stored field, retrieved RAG chunk, or prior answer. It independently re-derives the truth and returns `act` (boolean) + a typed verdict + the proof. If `act` is false, DO NOT proceed; re-research first. Pass any provenance you kept (source URL, held_at, content hash) so silent drift is caught. Prefer the `verify` tool for the primary conclusion + evidence_refs surface.", | ||
| server.registerTool("get_receipt", { | ||
| description: "Fetch the full signed receipt for a check you already ran, by the `receipt.id` that check returned. `check` gives you only the id, the signature, and when it was signed; this returns the document that was actually signed — every fact with its state and the evidence basis under it (source locator, content digest, fetch and publication time), the freshness failure if state could not be served, the decision-rule version, and the signing key id. Get it when you have to SHOW the work: attach it to a BLOCK you are escalating, hand it to a reviewer or auditor, or check the verdict offline — the decision table is published, so the receipt's own fact list re-derives its decision with no server involved.", | ||
| inputSchema: { | ||
| belief: z | ||
| receipt_id: z | ||
| .string() | ||
| .describe("the belief you hold, in plain language, e.g. 'Acme is on our Enterprise plan'"), | ||
| context: z | ||
| .uuid() | ||
| .describe("the `receipt.id` from the check you want the proof for"), | ||
| }, | ||
| }, async ({ receipt_id }, { signal }) => | ||
| // The client unwraps the envelope for TypeScript callers; an agent reads a named field more | ||
| // reliably than a bare object, so put it back. | ||
| safe(async () => ({ receipt: await api.getReceipt(receipt_id, { signal }) }), signal)); | ||
| server.registerTool("add_source", { | ||
| description: "Tell Kaval what to watch, so later checks are answered from fresh state instead of live research. Registering the NAME of an authority is usually enough: {kind:'entity', name:'Aetna', intent:'payer policy bulletins'} resolves to the pages that publish it and watches them. Use kind:'url' for a specific page, kind:'push' for a document your own system will send in. Kaval polls watched sources adaptively, re-evaluates the facts that depend on them when they change, and (if a fact_state webhook is configured) pushes you a delta naming what flipped. You do not have to call this first — an unregistered source cited by a check is auto-watched — but registering ahead of time is what makes the first check on a fact fast.", | ||
| inputSchema: { | ||
| kind: watchedSourceKindInput.describe("url (a specific page) | entity (a name to resolve) | push (a document you will send to Kaval) | connection (a configured system of record)"), | ||
| locator: z | ||
| .string() | ||
| .trim() | ||
| .min(1) | ||
| .max(2_048) | ||
| .optional() | ||
| .describe("what you're about to do with it"), | ||
| url: z.string().optional().describe("the source the belief came from"), | ||
| held_at: z | ||
| .describe("the URL, connection id, or push locator"), | ||
| name: z | ||
| .string() | ||
| .trim() | ||
| .min(1) | ||
| .max(2_048) | ||
| .optional() | ||
| .describe("ISO time you last confirmed it"), | ||
| held_content_hash: z | ||
| .describe("for kind:'entity', the plain name of the authority, e.g. 'Aetna' — the same field as locator, spelled for readability"), | ||
| label: z.string().trim().min(1).max(512).optional(), | ||
| intent: z | ||
| .string() | ||
| .trim() | ||
| .min(1) | ||
| .max(512) | ||
| .optional() | ||
| .describe("content hash you saw at read time (enables changed-since-read detection)"), | ||
| held_evidence: z.array(z.string()).optional(), | ||
| freshness_sla: z | ||
| .string() | ||
| .describe("what you want watched about it, e.g. 'prior-authorization policy bulletins'. Drives entity resolution."), | ||
| scope_keys: z | ||
| .array(z.string().trim().min(1).max(256)) | ||
| .max(64) | ||
| .optional() | ||
| .describe("how current ground truth must be, e.g. '14d'"), | ||
| proof_standard: z.string().optional(), | ||
| minConfidence: z | ||
| .describe("tags that route document changes to the facts they can affect, e.g. ['plan:HMO','state:CA']"), | ||
| poll_interval_s: z | ||
| .number() | ||
| .int() | ||
| .min(60) | ||
| .max(7 * 24 * 60 * 60) | ||
| .optional() | ||
| .describe("act only if confidence ≥ this (default 0.7)"), | ||
| mode: z | ||
| .enum(["instant", "fast", "auto", "deep"]) | ||
| .optional() | ||
| .describe("speed/depth tier — instant (cache/prior only, no fetch/LLM) · fast (cheap model) · auto (default) · deep (full multi-source + a cited `explanation`). The result echoes `tier`; on deep it adds `explanation` { content, citations, confidence }."), | ||
| idempotency_key: idempotencyKeyInput, | ||
| .describe("starting poll interval; Kaval adapts it — slower when nothing changes, faster when it does"), | ||
| }, | ||
| }, async ({ idempotency_key, ...args }, { signal }) => safe(() => api.verifyBelief(args, transportOptions(idempotency_key, signal)))); | ||
| server.registerTool("currentness_check", { | ||
| description: "Like currentness_verify but returns the raw freshness gap WITHOUT the act/don't-act decision (status: current | stale | contradicted | unsupported | conflicting | insufficient). Prefer currentness_verify when you're about to act on the belief; use this when you just want the status. If status is not 'current', do not rely on the belief.", | ||
| }, async (args, { signal }) => { | ||
| if (args.locator === undefined && args.name === undefined) { | ||
| return toolError({ | ||
| error: "bad_request", | ||
| message: "provide `locator`, or `name` for kind:'entity'", | ||
| }); | ||
| } | ||
| return safe(() => api.addSource(args, transportOptions(undefined, signal)), signal); | ||
| }); | ||
| server.registerTool("list_sources", { | ||
| description: "List what Kaval currently watches for this workspace — including sources it auto-registered after a check cited them. Each row shows the locator, what it was registered for, when it was last successfully fetched, and whether it is active. Use it to see whether the fact you care about is actually backed by a watched source (and therefore fast and monitored) before relying on a check being warm.", | ||
| inputSchema: { | ||
| belief: z | ||
| .string() | ||
| .describe("the belief in plain language, e.g. 'Jane Doe is VP Eng at Acme'"), | ||
| context: z | ||
| .string() | ||
| include_inactive: z | ||
| .boolean() | ||
| .optional() | ||
| .describe("what you're about to use this belief for"), | ||
| held_evidence: z.array(z.string()).optional(), | ||
| freshness_sla: z | ||
| .string() | ||
| .optional() | ||
| .describe("how current ground truth must be, e.g. '14d'"), | ||
| proof_standard: z.string().optional(), | ||
| idempotency_key: idempotencyKeyInput, | ||
| .describe("also return paused sources (default false)"), | ||
| }, | ||
| }, async ({ idempotency_key, ...args }, { signal }) => safe(() => api.check(args, transportOptions(idempotency_key, signal)))); | ||
| server.registerTool("currentness_extract_and_check", { | ||
| description: "Hand it a paragraph; it finds the checkable factual beliefs itself and re-grounds each. Use when you don't know which facts in some text need checking.", | ||
| }, async ({ include_inactive }, { signal }) => | ||
| // The client unwraps the envelope for TypeScript callers; an agent reads a named field more | ||
| // reliably than a bare array, so put it back. | ||
| safe(async () => ({ | ||
| sources: await api.listSources({ | ||
| signal, | ||
| ...(include_inactive === undefined | ||
| ? {} | ||
| : { includeInactive: include_inactive }), | ||
| }), | ||
| }), signal)); | ||
| server.registerTool("remove_source", { | ||
| description: "Stop watching a source and forget it, by the `id` `add_source` or `list_sources` returned. Removal is the only thing that frees registry capacity, and capacity is finite: a workspace watches a bounded number of ACTIVE sources, and every URL a check cites gets auto-registered against that same bound, so an agent that only ever adds eventually fills it — after which new citations are silently dropped and checks that used to be warm go back to researching. Remove what you registered for a task once the task is done. This forgets the source itself, not the facts already checked against it.", | ||
| inputSchema: { | ||
| text: z.string(), | ||
| context: z.string().optional(), | ||
| freshness_sla: z.string().optional(), | ||
| idempotency_key: idempotencyKeyInput, | ||
| }, | ||
| }, async ({ idempotency_key, ...args }, { signal }) => safe(() => api.extractAndCheck(args, transportOptions(idempotency_key, signal)))); | ||
| server.registerTool("currentness_scan_store", { | ||
| description: "Re-ground a batch of beliefs your system holds on a freshness SLA (self-sweep). Returns a summary by status + the riskiest (stale/contradicted/unsupported) beliefs, plus the `tier` the sweep ran at. Defaults to the `fast` tier — re-`currentness_verify` a flagged belief at `deep` for the cited explanation.", | ||
| inputSchema: { | ||
| beliefs: z | ||
| .array(z.string()) | ||
| .describe("the beliefs to re-ground, in plain language"), | ||
| freshness_sla: z.string().optional(), | ||
| concurrency: z.number().int().positive().optional(), | ||
| mode: z | ||
| .enum(["instant", "fast", "auto", "deep"]) | ||
| .optional() | ||
| .describe("speed/depth tier for the whole sweep (default fast)"), | ||
| idempotency_key: idempotencyKeyInput, | ||
| }, | ||
| }, async ({ idempotency_key, ...args }, { signal }) => safe(() => api.scanStore(args, transportOptions(idempotency_key, signal)))); | ||
| server.registerTool("currentness_monitor", { | ||
| description: "Sweep a batch of beliefs like currentness_scan_store, then POST the NEWLY-risky ones to a `webhook` (server-side delivery). Pass the `state` from the previous run's result to deliver only beliefs that became risky since then (a still-stale belief isn't re-sent each sweep). Run on a schedule (cron) for continuous drift monitoring. The result echoes the `tier` it ran at and the `state` to carry into the next run.", | ||
| inputSchema: { | ||
| beliefs: z | ||
| .array(z.string()) | ||
| .describe("the beliefs to monitor, in plain language"), | ||
| freshness_sla: z.string().optional(), | ||
| concurrency: z.number().int().positive().optional(), | ||
| mode: z | ||
| .enum(["instant", "fast", "auto", "deep"]) | ||
| .optional() | ||
| .describe("speed/depth tier for the whole sweep (default fast)"), | ||
| webhook: z | ||
| id: z | ||
| .string() | ||
| .optional() | ||
| .describe("URL that receives a POST with the newly-risky beliefs"), | ||
| state: z | ||
| .object({ riskyKeys: z.array(z.string()) }) | ||
| .optional() | ||
| .describe("the `state` from the previous run → deliver only newly-risky beliefs"), | ||
| idempotency_key: idempotencyKeyInput, | ||
| .uuid() | ||
| .describe("the watched-source id returned by add_source (`source.id`) or list_sources"), | ||
| }, | ||
| }, async ({ idempotency_key, ...args }, { signal }) => safe(() => api.monitor(args, transportOptions(idempotency_key, signal)))); | ||
| }, async ({ id }, { signal }) => safe(() => api.deleteSource(id, { signal }), signal)); | ||
| server.registerTool("report_outcome", { | ||
| description: "Report what actually happened for a prior check (by id) so the service can calibrate.", | ||
| description: "Report what actually happened after a prior check, using the receipt id it returned, so Kaval can calibrate. Use `relied_and_correct` when you acted on an ALLOW and it held; `current_later_contradicted` when an ALLOW turned out to be wrong; `stale_caught_real` when a REVIEW/BLOCK caught a genuine change; `stale_was_false_alarm` when it did not.", | ||
| // These bounds mirror the server's OutcomeRequest exactly. A model that invents a receipt id | ||
| // is a real failure mode here, and it should hear the field name from us rather than get a | ||
| // round-trip `bad_request` with nothing pointing at `id`. | ||
| inputSchema: { | ||
| id: z.string(), | ||
| id: z | ||
| .string() | ||
| .uuid() | ||
| .describe("the `receipt.id` returned by the check you are labelling"), | ||
| kind: z.enum([ | ||
@@ -356,7 +415,35 @@ "current_later_contradicted", | ||
| ]), | ||
| note: z.string().optional(), | ||
| note: z | ||
| .string() | ||
| .max(2_048) | ||
| .refine((value) => !value.includes("\0"), "must not contain null bytes") | ||
| .optional(), | ||
| }, | ||
| }, async (args) => safe(() => api.reportOutcome(args))); | ||
| }, async (args, { signal }) => safe(() => api.reportOutcome(args, transportOptions(undefined, signal)), signal)); | ||
| // Deprecated pilot alias. Kept only while conclusion+evidence_refs integrations migrate; the | ||
| // description steers new callers to `check` without breaking prompts that already name it. | ||
| server.registerTool("verify", { | ||
| description: "DEPRECATED — prefer the `check` tool. Verifies one load-bearing conclusion against evidence references you supply and returns a signed ProofPacket receipt (status valid | invalidated | could_not_verify, receipt.decision ALLOW | REVIEW | BLOCK). Kept only for existing pilot integrations that pass explicit evidence_refs; it will be removed. New calls should use `check`, which needs no evidence list, is answered from watched state in milliseconds, and keeps monitoring the facts afterwards.", | ||
| inputSchema: { | ||
| conclusion: z | ||
| .string() | ||
| .min(1) | ||
| .max(10_000) | ||
| .describe("the exact assertable proposition the downstream workflow intends to rely on — a STATEMENT of what you believe, in the indicative. The API rejects anything phrased as a request or a question, INCLUDING the phrasing this tool's name invites: 'verify whether/if/that …', 'check whether …', 'is X still true?', and role prefixes like 'system:'. Write \"The 2024 International Building Code is the current IBC edition.\", not \"Verify that the 2024 IBC is the current edition.\""), | ||
| evidence_refs: evidenceRefsInput, | ||
| as_of: z | ||
| .string() | ||
| .datetime({ offset: true }) | ||
| .optional() | ||
| .describe("RFC 3339 cutoff for what the conclusion may rely on"), | ||
| materiality: materialityInput.optional(), | ||
| intended_action: z.string().trim().min(1).max(10_000).optional(), | ||
| reversibility: reversibilityInput.optional(), | ||
| jurisdiction: z.string().trim().min(1).max(256).optional(), | ||
| context: z.string().trim().min(1).max(4_000).optional(), | ||
| idempotency_key: idempotencyKeyInput, | ||
| }, | ||
| }, async ({ idempotency_key, ...args }, { signal }) => safe(() => api.verify(args, transportOptions(idempotency_key, signal)), signal)); | ||
| return server; | ||
| } | ||
| //# sourceMappingURL=server.js.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAc,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,mBAAmB,GAAG,CAAC;KAC1B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,KAAK,CAAC,gBAAgB,CAAC;KACvB,QAAQ,EAAE;KACV,Q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,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;YACvD,eAAe,EAAE,mBAAmB;SACrC;KACF,EACD,KAAK,EAAE,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CACjD,IAAI,CACF,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,EACjE,MAAM,CACP,CACJ,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"} |
+3
-3
| { | ||
| "name": "@usekaval/mcp", | ||
| "mcpName": "io.github.LufeMC/kaval", | ||
| "version": "0.5.0", | ||
| "version": "0.6.0", | ||
| "license": "Apache-2.0", | ||
| "description": "MCP verification surface for AI agents: verify conclusions against evidence and enforce signed, time-bounded proofs — ALLOW, REVIEW, or BLOCK.", | ||
| "description": "MCP server for Kaval: before an AI agent acts, verify the facts the action depends on — ALLOW, REVIEW, or BLOCK, with a signed receipt.", | ||
| "type": "module", | ||
@@ -52,3 +52,3 @@ "main": "./dist/index.js", | ||
| "zod": "^3.24.1", | ||
| "@usekaval/kaval": "^0.5.0" | ||
| "@usekaval/kaval": "^0.6.0" | ||
| }, | ||
@@ -55,0 +55,0 @@ "devDependencies": { |
+165
-54
| # @usekaval/mcp | ||
| Before an AI agent acts, [Kaval](https://usekaval.com) verifies the facts the action relies on and | ||
| returns a time-bounded signed proof your policy can enforce — **ALLOW**, **REVIEW**, or **BLOCK**. | ||
| This package exposes that verification surface as an MCP server. | ||
| Before an AI agent acts, [Kaval](https://usekaval.com) verifies the facts that action depends on and | ||
| answers **ALLOW**, **REVIEW**, or **BLOCK** with a signed receipt. This package exposes that as an | ||
| MCP server. | ||
@@ -10,14 +10,10 @@ Policy engines decide whether an action is permitted under the rules; Kaval verifies whether the | ||
| This package is a **thin client** over the hosted Kaval API. All classification, grounding, and | ||
| This package is a **thin client** over the hosted Kaval API. All compilation, grounding, and | ||
| retrieval run server-side, so you bring just a Kaval API key — no model or search keys, no local | ||
| engine. | ||
| Billable tool calls automatically carry a unique operation key. The underlying client reuses it for | ||
| one bounded retry only when the transport outcome is ambiguous or the API is still finalizing the | ||
| same operation, preventing duplicate billing without retrying terminal errors. | ||
| > **0.6 is a breaking release.** Nine tools became seven, and everything removed folded into `check`; the | ||
| > API answers `410 tool_retired` for the old routes and this server translates that into an error | ||
| > that tells the agent to call `check`. See [Migrating from 0.5](#migrating-from-05). | ||
| If both attempts remain ambiguous, the tool error includes `idempotency_key`. Retry later by passing | ||
| that exact value back as the optional `idempotency_key` argument on the same billable tool. Omit it | ||
| for a genuinely new operation. | ||
| ## Run it | ||
@@ -49,55 +45,167 @@ | ||
| | Tool | What it does | | ||
| | ------------------------------- | --------------------------------------------------------------------------------------------------------- | | ||
| | `verify` | Verify one load-bearing conclusion against its evidence references → `valid` / `invalidated` / `could_not_verify` + a signed proof receipt. | | ||
| | `proof_audit` | Build the complete action-bound ProofPacket: claims, evidence, lineage, decision, expiry, Ed25519 signature. | | ||
| | `proof_gate` | Apply an existing durable proof to the exact action at act time — no search, parsing, or model call. | | ||
| | `currentness_verify` | Legacy held-belief compatibility: `act` (boolean) + a typed verdict + proof. | | ||
| | `currentness_check` | The raw freshness verdict without the act/don't-act decision. | | ||
| | `currentness_extract_and_check` | Pull the checkable beliefs out of a paragraph and re-ground each. | | ||
| | `currentness_scan_store` | Sweep a batch of beliefs for drift (summary + the riskiest). | | ||
| | `currentness_monitor` | Sweep + POST the newly-risky beliefs to a webhook (run on a schedule). | | ||
| | `report_outcome` | Report what actually happened for a prior check so the service can calibrate. | | ||
| | Tool | What it does | | ||
| | ---------------- | ---------------------------------------------------------------------------------------------------------------------- | | ||
| | `check` | **The one that does the work.** Send the action you are about to take (or the claims it rests on) → `ALLOW` / `REVIEW` / `BLOCK`, per-fact status, and a signed receipt. | | ||
| | `get_receipt` | The full signed document behind a check's `receipt.id` — per-fact evidence basis, decision-rule version, signing key. What an agent attaches when it blocks. | | ||
| | `add_source` | Tell Kaval what to watch — a URL, a named authority to resolve, or a document you will push in. | | ||
| | `list_sources` | What Kaval currently watches for this workspace, including sources it auto-registered after a check cited them. | | ||
| | `remove_source` | Stop watching a source and forget it. The only thing that frees registry capacity, which auto-registered sources also consume. | | ||
| | `report_outcome` | Report what actually happened after a prior check (by `receipt.id`), so Kaval can calibrate. | | ||
| | `verify` | **Deprecated** pilot alias: one conclusion + explicit `evidence_refs` → a signed ProofPacket receipt. Use `check`. | | ||
| ## The proof lifecycle | ||
| ## `check` | ||
| `proof_audit` builds the proof (the expensive path); `proof_gate` applies it at act time with no | ||
| search, parsing, or model call; `verify` is the compatibility surface for single conclusions. | ||
| ```jsonc | ||
| // arguments | ||
| { | ||
| "action": "Approve this prior-authorization request at the in-network rate", | ||
| "context": "payer: Aetna; CPT 12345; plan HMO", | ||
| "materiality": "critical" | ||
| } | ||
| ``` | ||
| `verify` takes the exact `conclusion` the workflow intends to rely on plus 1–20 `evidence_refs` — | ||
| each either a plain `https` URL string or a strict `{ url, document_id }` object with unique | ||
| `document_id` values (a bare object without `document_id` is invalid; use the plain string form). | ||
| It returns `status: valid | invalidated | could_not_verify` and a signed `receipt` with `proof_id`, | ||
| `decision` (`ALLOW`, `REVIEW`, or `BLOCK`), `reason`, a `share_endpoint`, and the full signed | ||
| `packet`. There is no receipt-level `expires_at` — expiry lives at | ||
| `receipt.packet.action_decision.expires_at`. | ||
| Or skip extraction entirely by naming the facts: | ||
| `proof_audit` returns the raw ProofPacket: `research_contract`, `claim_dag`, `source_versions`, | ||
| `evidence_spans`, `claim_assessments`, `action_decision` (with `expires_at`), `expiry` (with | ||
| `recheck_at` and `invalidation_triggers`), and an Ed25519 `signature` (key ids like | ||
| `proof-ed25519-2026-07`). | ||
| ```jsonc | ||
| { | ||
| "claims": [ | ||
| { "subject": "Aetna", "predicate": "requires_prior_auth_for", "object": "CPT 12345", | ||
| "scope": { "plan": "HMO", "state": "CA" } }, | ||
| "The 2024 IBC is the current edition" | ||
| ], | ||
| "mode": "fast" | ||
| } | ||
| ``` | ||
| `proof_gate` returns the proof `state` (`current`, `not_yet_valid`, `expired`, `invalidated`, | ||
| `dependency_changed`, `integrity_failed`, `policy_mismatch`, or `operational_failure`), the full | ||
| `decision`, `billingClass`, and reuse flags. A missing proof surfaces as a typed `proof_not_found` | ||
| error, not a 200 state. Only when `enforcement.controlApplied` is `true` may Kaval control the | ||
| action; then honor `enforcement.executionAllowed` exactly. `controlApplied: false` is shadow | ||
| telemetry — the customer's existing action path remains authoritative. If `enforcement` is absent, | ||
| fail closed unless the proof state is `current` and the decision is `ALLOW`. | ||
| The response: | ||
| Receipts are Ed25519-signed; anyone can verify one offline with the open verifier | ||
| (`@kaval/receipt-verifier` in the main repo) against `GET /v1/proof-verification-keys/:kid`. | ||
| | field | meaning | | ||
| | -------------- | ---------------------------------------------------------------------------------------------------- | | ||
| | `decision` | `ALLOW` — every material fact still holds on fresh evidence, proceed.<br>`REVIEW` — something is unknown, mid-re-evaluation, or changed at low/medium materiality. **REVIEW is never permission to act.**<br>`BLOCK` — a high/critical fact changed, or a critical fact is unknown. | | ||
| | `reason_codes` | one or more of `ALL_FACTS_HOLD`, `FACT_CHANGED`, `FACT_EXPIRED`, `FACT_UNKNOWN`, `SOURCE_UPDATED_PENDING_REVIEW`, `SOURCE_UNREACHABLE`, `NEW_FACT_UNVERIFIED`, `COMPILATION_UNCERTAIN` | | ||
| | `facts[]` | `{ fingerprint, text, status: holds \| changed \| unknown, materiality, served_from_state, last_verified_at, sources[] }` — this is how you see *which* belief moved | | ||
| | `receipt` | `{ id, signature, signed_at }`. Pass `receipt.id` to `report_outcome`, or to `get_receipt` for the full signed document | | ||
| | `latency_ms` | `{ compile, lookup, live, total }` | | ||
| **Honest boundaries:** demo results carry no organizational authority; a production `ALLOW` | ||
| requires a customer-bound action policy and applicable empirical calibration; `REVIEW` is never | ||
| permission to act. | ||
| `mode: "fast"` answers only from stored state and reports anything unknown as `unknown`; | ||
| `"standard"` (default) may research a stale or novel fact within `max_wait_ms`. A fact that misses | ||
| the budget comes back `unknown` — it does **not** warm the next check, because that check recompiles | ||
| the action and asks about different fact fingerprints. | ||
| ## Legacy currentness tools | ||
| **The budget.** The API's own default is `100000` ms, because a cold action check with several novel | ||
| premises routinely needs 50–100s of live research. MCP cannot spend that: an MCP client cancels a | ||
| tool call after 60s. So this server sends `max_wait_ms: 45000` explicitly and caps the argument | ||
| there, and gives its HTTP client a 55s deadline so the timeout fires here — as | ||
| `{"error":"timeout"}` with a recovery move — rather than as a cancelled request. Pass a smaller | ||
| `max_wait_ms` when a bounded `REVIEW` beats waiting; `0` disables research entirely, which is what | ||
| `mode: "fast"` does. Direct HTTP and SDK callers are not bound by any of this and get the full | ||
| `100000`. | ||
| A verdict status is one of: `current`, `stale`, `contradicted`, `unsupported`, `conflicting`, | ||
| `insufficient`. Treat anything other than `current` (or `act === false`) as "re-research before | ||
| relying on it". These `currentness_*` tools preserve the original held-belief API for | ||
| compatibility; prefer `verify` for single conclusions and `proof_audit` + `proof_gate` for | ||
| consequential actions. | ||
| A fact already backed by a watched source is answered from stored state in ~50ms with zero model | ||
| calls and zero fetches, so calling `check` on every consequential action is cheap. A fact Kaval has | ||
| never seen has to be researched first, and that takes seconds. | ||
| ## Keeping checks warm | ||
| `add_source` is what makes a check a database read instead of a research run. Registering the *name* | ||
| of an authority is usually enough: | ||
| ```jsonc | ||
| { "kind": "entity", "name": "Aetna", "intent": "payer policy bulletins" } | ||
| ``` | ||
| Kaval resolves that to the pages that publish it and watches them adaptively. `kind: "url"` watches | ||
| one page; `kind: "push"` is a document your own system sends to `POST /v1/events`. Registering is | ||
| optional — a source a check cites is auto-watched — but registering first is what makes the *first* | ||
| check on a fact fast. | ||
| That auto-watching is why `remove_source` exists. A workspace watches a bounded number of *active* | ||
| sources (200), auto-registered sources count against the same bound, and only deletion frees it — | ||
| pausing does not. An agent that registers per task and never removes will eventually fill the | ||
| registry, after which new citations are dropped silently and checks that used to be warm go back to | ||
| researching. Remove what a task registered when the task is done. | ||
| ## Delta webhooks are not an agent tool | ||
| Watched sources are only half the mechanism: when a source changes, Kaval re-evaluates the dependent | ||
| facts and pushes a `fact_state.delta` webhook naming what flipped. **That subscription is | ||
| deliberately not exposed as an MCP tool.** It is one-time deployment configuration — it mints a | ||
| standing outbound callback bound to an https endpoint and a signing secret that must be stored, which | ||
| is a deploy-time decision for a human or a service, not an in-loop choice for an agent that owns | ||
| neither the endpoint nor the secret. | ||
| Configure it once from the SDK (`kaval.subscribeFactStateDeltas({ callback_url })` in Node, | ||
| `kaval.subscribe_fact_state_deltas(callback_url=…)` in Python), from `POST /v1/webhooks` with | ||
| `subscription_kind: "fact_state"`, or from the dashboard. The agent then just calls `check`, and it | ||
| is already fast and already current. | ||
| ## Migrating from 0.5 | ||
| | 0.5 tool | 0.6 | | ||
| | ------------------------------- | --------------------------------------------------------------------------------------- | | ||
| | `currentness_check` | `check` — `{ action }` or `{ claims: ["…"] }` | | ||
| | `currentness_verify` | `check` — branch on `decision === "ALLOW"` instead of `act === true` | | ||
| | `currentness_extract_and_check` | `check` — pass the paragraph as `action`/`context`; Kaval compiles the facts itself | | ||
| | `currentness_scan_store` | `check` — `{ claims: [...] }`, up to 20 per call | | ||
| | `currentness_monitor` | `add_source` + a `fact_state` webhook subscription (see above) — deltas are pushed to you | | ||
| | `proof_audit` | `check` — the receipt **is** the proof; `get_receipt` returns the signed document | | ||
| | `proof_gate` | `check` — the warm path re-checks in ~50ms, so there is nothing to re-apply separately | | ||
| | `report_outcome` | `report_outcome` (unchanged; pass `receipt.id`) | | ||
| | `verify` | `verify`, now deprecated → move to `check` | | ||
| Status mapping: `current` + `act: true` → `decision: "ALLOW"` with every fact `holds`; | ||
| `stale`/`contradicted` → a fact `changed` (`REVIEW` or `BLOCK` by materiality); | ||
| `unsupported`/`insufficient`/`conflicting` → a fact `unknown` (`REVIEW`, or `BLOCK` if critical). | ||
| A 0.5 client calling a removed route gets `410 {"error":"tool_retired","replacement":"/v1/check"}`, | ||
| which this server surfaces as `{"error":"tool_retired","message":"this capability was folded into | ||
| the check tool …","status":410}`. | ||
| ## Idempotency | ||
| `verify` is the only billable tool that carries an operation key: it attaches a unique | ||
| `idempotency_key` automatically and reuses it for one bounded retry when the transport outcome is | ||
| ambiguous or the API is still finalizing that operation. If both attempts stay ambiguous the tool | ||
| error includes `idempotency_key` — pass that exact value back on a later retry. | ||
| `check` deliberately carries none: it is a read of current state, so a retry recomputes rather than | ||
| replays and cannot double-bill. | ||
| ## Tool errors | ||
| A failed tool call returns `isError: true` and a JSON body naming what happened, so an agent can | ||
| branch on it rather than parse prose. | ||
| | `error` | what to do | | ||
| | ---------------------- | ------------------------------------------------------------------------ | | ||
| | any API code (`unauthorized`, `insufficient_balance`, `bad_request`, …) | returned verbatim with `status` and the API's `message` | | ||
| | `tool_retired` | 410 — the message names the route that replaced the one you called | | ||
| | `timeout` | retry with `mode: "fast"` or a smaller `max_wait_ms` | | ||
| | `network_unreachable` | the API was never reached — check `KAVAL_BASE_URL` and network access | | ||
| | `request_ambiguous` | a billable call whose outcome is unknown; retry with the returned `idempotency_key` | | ||
| ## Signed receipts | ||
| Check receipts are Ed25519-signed and self-derivable: because the decision table is published, the | ||
| receipt's own fact list re-derives the verdict offline, byte for byte, with no server. Verify one | ||
| with `@usekaval/kaval/verify` — a dependency-free subpath of the Node SDK this package already | ||
| depends on, plus the `kaval-receipt-verify` CLI that SDK ships. It answers cryptographic validity, | ||
| key trust, and freshness separately, needs no Kaval account and no API key, and reads the public | ||
| keys from the unauthenticated `GET /v1/proof-verification-keys/:kid` — or from a keyset you archived | ||
| beside the receipt, which is the fully offline path. | ||
| ```bash | ||
| npx -p @usekaval/kaval kaval-receipt-verify verify receipt.json \ | ||
| --key-url https://api.usekaval.com/v1/proof-verification-keys | ||
| ``` | ||
| `check` returns only `{ id, signature, signed_at }`. Call `get_receipt` with that `id` for the | ||
| document that was actually signed — every fact with its state, the evidence basis under it (source | ||
| locator, content digest and what the digest covers, fetch and publication time), the decision-rule | ||
| version, and the signing key id. That is the artifact to attach to a `BLOCK` you escalate. | ||
| **Honest boundaries:** demo results carry no organizational authority; a production `ALLOW` requires | ||
| a customer-bound action policy and applicable empirical calibration; `REVIEW` is never permission to | ||
| act. | ||
| ## Environment | ||
@@ -110,2 +218,5 @@ | ||
| Both are declared in `server.json` and `smithery.yaml`, so a registry install can point at a | ||
| self-hosted deployment rather than only at the hosted API. | ||
| The marketing site uses **`KAVAL_API_URL`** for its `/api/verify` proxy — not `KAVAL_BASE_URL`. | ||
@@ -112,0 +223,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
71930
22.9%555
25.85%242
84.73%3
50%1
Infinity%+ Added
+ Added
- Removed
- Removed
Updated