@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 +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.d.cts
CHANGED
|
@@ -66,7 +66,7 @@ declare function loadCredentials(source?: string | HavenCredentialSource | undef
|
|
|
66
66
|
* which is where URL-hardening would matter.)
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
|
-
type HavenMcpToolName = 'haven_send' | 'haven_pay_mcp_tool' | 'haven_quote_x402' | 'haven_pay_x402_quote' | 'haven_pay_x402' | 'haven_resume_x402_payment' | 'haven_get_payment_status' | 'haven_get_resume_state' | 'haven_get_agent' | 'haven_get_allowances' | 'haven_list_receipts' | 'haven_verify_receipt' | 'haven_sweep_delegate' | 'haven_discover_tools' | 'haven_submit_catalog_entry' | 'haven_open_task_budget' | 'haven_close_task_budget' | 'haven_get_task_budget' | 'haven_submit';
|
|
69
|
+
type HavenMcpToolName = 'haven_send' | 'haven_pay_mcp_tool' | 'haven_quote_x402' | 'haven_pay_x402_quote' | 'haven_pay_x402' | 'haven_resume_x402_payment' | 'haven_get_payment_status' | 'haven_get_resume_state' | 'haven_get_agent' | 'haven_get_allowances' | 'haven_list_receipts' | 'haven_verify_receipt' | 'haven_get_receipt' | 'haven_sweep_delegate' | 'haven_discover_tools' | 'haven_submit_catalog_entry' | 'haven_open_task_budget' | 'haven_close_task_budget' | 'haven_get_task_budget' | 'haven_submit';
|
|
70
70
|
declare const toolSchemas: {
|
|
71
71
|
readonly haven_send: {
|
|
72
72
|
readonly asset: z.ZodEnum<["ETH", "USDC"]>;
|
|
@@ -156,6 +156,10 @@ declare const toolSchemas: {
|
|
|
156
156
|
};
|
|
157
157
|
readonly haven_verify_receipt: {
|
|
158
158
|
readonly receipt: z.ZodUnknown;
|
|
159
|
+
readonly verification: z.ZodOptional<z.ZodUnknown>;
|
|
160
|
+
};
|
|
161
|
+
readonly haven_get_receipt: {
|
|
162
|
+
readonly payment_id: z.ZodString;
|
|
159
163
|
};
|
|
160
164
|
readonly haven_open_task_budget: {
|
|
161
165
|
readonly max_amount_human: z.ZodString;
|
|
@@ -411,7 +415,7 @@ declare function createHavenMcpServer(options?: HavenMcpServerOptions): Promise<
|
|
|
411
415
|
* `agent_tool_invocations` rows are always attributed to the right tool.
|
|
412
416
|
*/
|
|
413
417
|
declare const MCP_NAME = "@haven_ai/mcp";
|
|
414
|
-
declare const MCP_VERSION = "0.
|
|
418
|
+
declare const MCP_VERSION = "0.9.0-alpha.0";
|
|
415
419
|
/**
|
|
416
420
|
* Refuse to start on an unsupported Node (#1161).
|
|
417
421
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ declare function loadCredentials(source?: string | HavenCredentialSource | undef
|
|
|
66
66
|
* which is where URL-hardening would matter.)
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
|
-
type HavenMcpToolName = 'haven_send' | 'haven_pay_mcp_tool' | 'haven_quote_x402' | 'haven_pay_x402_quote' | 'haven_pay_x402' | 'haven_resume_x402_payment' | 'haven_get_payment_status' | 'haven_get_resume_state' | 'haven_get_agent' | 'haven_get_allowances' | 'haven_list_receipts' | 'haven_verify_receipt' | 'haven_sweep_delegate' | 'haven_discover_tools' | 'haven_submit_catalog_entry' | 'haven_open_task_budget' | 'haven_close_task_budget' | 'haven_get_task_budget' | 'haven_submit';
|
|
69
|
+
type HavenMcpToolName = 'haven_send' | 'haven_pay_mcp_tool' | 'haven_quote_x402' | 'haven_pay_x402_quote' | 'haven_pay_x402' | 'haven_resume_x402_payment' | 'haven_get_payment_status' | 'haven_get_resume_state' | 'haven_get_agent' | 'haven_get_allowances' | 'haven_list_receipts' | 'haven_verify_receipt' | 'haven_get_receipt' | 'haven_sweep_delegate' | 'haven_discover_tools' | 'haven_submit_catalog_entry' | 'haven_open_task_budget' | 'haven_close_task_budget' | 'haven_get_task_budget' | 'haven_submit';
|
|
70
70
|
declare const toolSchemas: {
|
|
71
71
|
readonly haven_send: {
|
|
72
72
|
readonly asset: z.ZodEnum<["ETH", "USDC"]>;
|
|
@@ -156,6 +156,10 @@ declare const toolSchemas: {
|
|
|
156
156
|
};
|
|
157
157
|
readonly haven_verify_receipt: {
|
|
158
158
|
readonly receipt: z.ZodUnknown;
|
|
159
|
+
readonly verification: z.ZodOptional<z.ZodUnknown>;
|
|
160
|
+
};
|
|
161
|
+
readonly haven_get_receipt: {
|
|
162
|
+
readonly payment_id: z.ZodString;
|
|
159
163
|
};
|
|
160
164
|
readonly haven_open_task_budget: {
|
|
161
165
|
readonly max_amount_human: z.ZodString;
|
|
@@ -411,7 +415,7 @@ declare function createHavenMcpServer(options?: HavenMcpServerOptions): Promise<
|
|
|
411
415
|
* `agent_tool_invocations` rows are always attributed to the right tool.
|
|
412
416
|
*/
|
|
413
417
|
declare const MCP_NAME = "@haven_ai/mcp";
|
|
414
|
-
declare const MCP_VERSION = "0.
|
|
418
|
+
declare const MCP_VERSION = "0.9.0-alpha.0";
|
|
415
419
|
/**
|
|
416
420
|
* Refuse to start on an unsupported Node (#1161).
|
|
417
421
|
*
|
package/dist/index.js
CHANGED
|
@@ -336,7 +336,21 @@ var toolSchemas = {
|
|
|
336
336
|
compact: z.boolean().optional().describe("true drops challengePayload, selectedPayment and protocolReceiptPayload from each row; omit for the full row.")
|
|
337
337
|
},
|
|
338
338
|
haven_verify_receipt: {
|
|
339
|
-
receipt: z.unknown()
|
|
339
|
+
receipt: z.unknown(),
|
|
340
|
+
// #3723: the spread form — the endpoint's `{ receipt, verification }`
|
|
341
|
+
// spread as top-level arguments — verifies: `verification` is declared
|
|
342
|
+
// ACCEPTED-AND-IGNORED (Haven's own self-check, never read). The stdio
|
|
343
|
+
// z.object would strip it silently anyway; declaring it keeps the schema
|
|
344
|
+
// identical to the hosted runtime's, where the key must be declared to
|
|
345
|
+
// pass its strict refusal.
|
|
346
|
+
verification: z.unknown().optional().describe("accepted and ignored \u2014 verification reads the receipt itself")
|
|
347
|
+
},
|
|
348
|
+
// #3723: the signed bundle's read — `{ receipt }` only, settled payments
|
|
349
|
+
// only. The endpoint's server-side `verification` is deliberately NOT
|
|
350
|
+
// returned: it is computed on Haven's server, not offline, and an agent
|
|
351
|
+
// that trusted it would skip haven_verify_receipt.
|
|
352
|
+
haven_get_receipt: {
|
|
353
|
+
payment_id: z.string().min(1)
|
|
340
354
|
},
|
|
341
355
|
// #3329: a budget for one task that ends by itself — a short-lived child of
|
|
342
356
|
// the agent's own budget, capped and time-boxed independently of the period
|
|
@@ -421,6 +435,8 @@ var toolDescriptions = {
|
|
|
421
435
|
haven_submit_catalog_entry: composeDescription(toolDescriptions$1.submitCatalogEntry),
|
|
422
436
|
haven_list_receipts: composeDescription(toolDescriptions$1.listReceipts),
|
|
423
437
|
haven_verify_receipt: composeDescription(toolDescriptions$1.verifyReceipt),
|
|
438
|
+
// #3723: the signed bundle's read, described from the shared fragment.
|
|
439
|
+
haven_get_receipt: composeDescription(toolDescriptions$1.getReceipt),
|
|
424
440
|
haven_open_task_budget: OPEN_TASK_BUDGET_DESCRIPTION,
|
|
425
441
|
haven_close_task_budget: CLOSE_TASK_BUDGET_DESCRIPTION,
|
|
426
442
|
haven_get_task_budget: GET_TASK_BUDGET_DESCRIPTION,
|
|
@@ -767,6 +783,17 @@ function createToolHandlers(haven) {
|
|
|
767
783
|
const args = objectInput("haven_verify_receipt", input);
|
|
768
784
|
return runTool(async () => verifyPaymentReceipt(args.receipt));
|
|
769
785
|
},
|
|
786
|
+
// #3723: the signed bundle's home on the local surface. Parsed INSIDE
|
|
787
|
+
// runTool, so a missing payment_id is a structured INVALID_INPUT failure
|
|
788
|
+
// rather than a thrown ZodError (the hosted runtime's parseStrict already
|
|
789
|
+
// answers that way). Returns `{ receipt }` only — the endpoint's
|
|
790
|
+
// server-side `verification` is not offline evidence, and the agent
|
|
791
|
+
// verifies with haven_verify_receipt, which reads the bundle unchanged.
|
|
792
|
+
haven_get_receipt: async (input) => runTool(async () => {
|
|
793
|
+
const args = objectInput("haven_get_receipt", input);
|
|
794
|
+
const { receipt } = await haven.getReceipt(args.payment_id);
|
|
795
|
+
return { receipt };
|
|
796
|
+
}),
|
|
770
797
|
haven_open_task_budget: async (input) => {
|
|
771
798
|
const args = objectInput("haven_open_task_budget", input);
|
|
772
799
|
return runTool(async () => {
|
|
@@ -1050,6 +1077,14 @@ function normalizeError(err) {
|
|
|
1050
1077
|
body: err.body
|
|
1051
1078
|
};
|
|
1052
1079
|
}
|
|
1080
|
+
if (err instanceof z.ZodError) {
|
|
1081
|
+
return {
|
|
1082
|
+
success: false,
|
|
1083
|
+
code: "INVALID_INPUT",
|
|
1084
|
+
message: err.errors.map((e) => `${e.path.join(".") || "(root)"}: ${e.message}`).join("; "),
|
|
1085
|
+
statusCode: 400
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1053
1088
|
if (err instanceof HavenError) {
|
|
1054
1089
|
return {
|
|
1055
1090
|
success: false,
|
|
@@ -1286,7 +1321,7 @@ async function createHavenMcpServer(options = {}) {
|
|
|
1286
1321
|
return buildMcpServer(haven);
|
|
1287
1322
|
}
|
|
1288
1323
|
var MCP_NAME = "@haven_ai/mcp";
|
|
1289
|
-
var MCP_VERSION = "0.
|
|
1324
|
+
var MCP_VERSION = "0.9.0-alpha.0";
|
|
1290
1325
|
var MCP_INSTRUCTIONS = [
|
|
1291
1326
|
"Haven local MCP server: signs in-process with the delegate key it holds on",
|
|
1292
1327
|
"this machine \u2014 the key never leaves this process. Call haven_get_agent",
|