@haven_ai/mcp 0.8.0-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 +3 -0
- package/dist/cli.cjs +37 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +37 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +37 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +37 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.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,
|
|
@@ -1288,7 +1323,7 @@ async function createHavenMcpServer(options = {}) {
|
|
|
1288
1323
|
return buildMcpServer(haven);
|
|
1289
1324
|
}
|
|
1290
1325
|
var MCP_NAME = "@haven_ai/mcp";
|
|
1291
|
-
var MCP_VERSION = "0.
|
|
1326
|
+
var MCP_VERSION = "0.9.0-alpha.0";
|
|
1292
1327
|
var MCP_INSTRUCTIONS = [
|
|
1293
1328
|
"Haven local MCP server: signs in-process with the delegate key it holds on",
|
|
1294
1329
|
"this machine \u2014 the key never leaves this process. Call haven_get_agent",
|