@haven_ai/mcp 0.8.1-alpha.0 → 0.9.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -117,6 +117,9 @@ Environment variable form:
117
117
  - `haven_discover_tools`
118
118
  - `haven_submit_catalog_entry`
119
119
  - `haven_list_receipts`
120
+ - `haven_verify_receipt`
121
+ - `haven_get_receipt` (#3723 — the signed bundle: `{ receipt }` from one of this agent's own settled payments, which `haven_verify_receipt` reads unchanged)
122
+ - `haven_get_task_budget` (#3518)
120
123
  - `haven_open_task_budget` (#3329)
121
124
  - `haven_close_task_budget` (#3329)
122
125
  - `haven_submit` (#3329 — relays a local signer signature by `task_budget_id`, or (#3506) by `sub_budget_id` for a sub-budget this agent delegates (listed in `haven_get_agent`'s `pendingSubBudgetSignatures[]`); a `payment_id` is refused on this runtime, which signs and submits payments inline)
package/dist/cli.cjs CHANGED
@@ -338,7 +338,21 @@ var toolSchemas = {
338
338
  compact: v3.z.boolean().optional().describe("true drops challengePayload, selectedPayment and protocolReceiptPayload from each row; omit for the full row.")
339
339
  },
340
340
  haven_verify_receipt: {
341
- receipt: v3.z.unknown()
341
+ receipt: v3.z.unknown(),
342
+ // #3723: the spread form — the endpoint's `{ receipt, verification }`
343
+ // spread as top-level arguments — verifies: `verification` is declared
344
+ // ACCEPTED-AND-IGNORED (Haven's own self-check, never read). The stdio
345
+ // z.object would strip it silently anyway; declaring it keeps the schema
346
+ // identical to the hosted runtime's, where the key must be declared to
347
+ // pass its strict refusal.
348
+ verification: v3.z.unknown().optional().describe("accepted and ignored \u2014 verification reads the receipt itself")
349
+ },
350
+ // #3723: the signed bundle's read — `{ receipt }` only, settled payments
351
+ // only. The endpoint's server-side `verification` is deliberately NOT
352
+ // returned: it is computed on Haven's server, not offline, and an agent
353
+ // that trusted it would skip haven_verify_receipt.
354
+ haven_get_receipt: {
355
+ payment_id: v3.z.string().min(1)
342
356
  },
343
357
  // #3329: a budget for one task that ends by itself — a short-lived child of
344
358
  // the agent's own budget, capped and time-boxed independently of the period
@@ -423,6 +437,8 @@ var toolDescriptions = {
423
437
  haven_submit_catalog_entry: sdk.composeDescription(sdk.toolDescriptions.submitCatalogEntry),
424
438
  haven_list_receipts: sdk.composeDescription(sdk.toolDescriptions.listReceipts),
425
439
  haven_verify_receipt: sdk.composeDescription(sdk.toolDescriptions.verifyReceipt),
440
+ // #3723: the signed bundle's read, described from the shared fragment.
441
+ haven_get_receipt: sdk.composeDescription(sdk.toolDescriptions.getReceipt),
426
442
  haven_open_task_budget: OPEN_TASK_BUDGET_DESCRIPTION,
427
443
  haven_close_task_budget: CLOSE_TASK_BUDGET_DESCRIPTION,
428
444
  haven_get_task_budget: GET_TASK_BUDGET_DESCRIPTION,
@@ -769,6 +785,17 @@ function createToolHandlers(haven) {
769
785
  const args = objectInput("haven_verify_receipt", input);
770
786
  return runTool(async () => sdk.verifyPaymentReceipt(args.receipt));
771
787
  },
788
+ // #3723: the signed bundle's home on the local surface. Parsed INSIDE
789
+ // runTool, so a missing payment_id is a structured INVALID_INPUT failure
790
+ // rather than a thrown ZodError (the hosted runtime's parseStrict already
791
+ // answers that way). Returns `{ receipt }` only — the endpoint's
792
+ // server-side `verification` is not offline evidence, and the agent
793
+ // verifies with haven_verify_receipt, which reads the bundle unchanged.
794
+ haven_get_receipt: async (input) => runTool(async () => {
795
+ const args = objectInput("haven_get_receipt", input);
796
+ const { receipt } = await haven.getReceipt(args.payment_id);
797
+ return { receipt };
798
+ }),
772
799
  haven_open_task_budget: async (input) => {
773
800
  const args = objectInput("haven_open_task_budget", input);
774
801
  return runTool(async () => {
@@ -1052,6 +1079,14 @@ function normalizeError(err) {
1052
1079
  body: err.body
1053
1080
  };
1054
1081
  }
1082
+ if (err instanceof v3.z.ZodError) {
1083
+ return {
1084
+ success: false,
1085
+ code: "INVALID_INPUT",
1086
+ message: err.errors.map((e) => `${e.path.join(".") || "(root)"}: ${e.message}`).join("; "),
1087
+ statusCode: 400
1088
+ };
1089
+ }
1055
1090
  if (err instanceof sdk.HavenError) {
1056
1091
  return {
1057
1092
  success: false,
@@ -1280,7 +1315,7 @@ async function resolveHavenClient(options = {}) {
1280
1315
  return { client, credentials };
1281
1316
  }
1282
1317
  var MCP_NAME = "@haven_ai/mcp";
1283
- var MCP_VERSION = "0.8.1-alpha.0";
1318
+ var MCP_VERSION = "0.9.0-alpha.0";
1284
1319
  var MCP_INSTRUCTIONS = [
1285
1320
  "Haven local MCP server: signs in-process with the delegate key it holds on",
1286
1321
  "this machine \u2014 the key never leaves this process. Call haven_get_agent",