@haven_ai/mcp 0.0.0-dev.202609281736.4aa027b → 0.0.0-dev.202609282003.b645eff
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 +8 -13
- package/dist/cli.cjs +22 -30
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +22 -30
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +22 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +22 -30
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -243,8 +243,8 @@ var toolSchemas = {
|
|
|
243
243
|
recipient: z.string().min(1),
|
|
244
244
|
amount: z.string().min(1),
|
|
245
245
|
idempotency_key: z.string().optional(),
|
|
246
|
-
/**
|
|
247
|
-
idempotencyKey: z.string().optional(),
|
|
246
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
247
|
+
idempotencyKey: z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key"),
|
|
248
248
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
249
249
|
task_budget_id: z.string().min(1).optional()
|
|
250
250
|
},
|
|
@@ -253,8 +253,8 @@ var toolSchemas = {
|
|
|
253
253
|
tool_name: z.string().min(1),
|
|
254
254
|
arguments: z.record(z.string(), z.unknown()).optional(),
|
|
255
255
|
idempotency_key: z.string().optional(),
|
|
256
|
-
/**
|
|
257
|
-
idempotencyKey: z.string().optional()
|
|
256
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
257
|
+
idempotencyKey: z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key")
|
|
258
258
|
},
|
|
259
259
|
haven_quote_x402: {
|
|
260
260
|
url: z.string().url(),
|
|
@@ -262,14 +262,14 @@ var toolSchemas = {
|
|
|
262
262
|
headers: headersSchema,
|
|
263
263
|
body: z.string().optional(),
|
|
264
264
|
idempotency_key: z.string().optional(),
|
|
265
|
-
/**
|
|
266
|
-
idempotencyKey: z.string().optional()
|
|
265
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
266
|
+
idempotencyKey: z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key")
|
|
267
267
|
},
|
|
268
268
|
haven_pay_x402_quote: {
|
|
269
269
|
quote: z.unknown(),
|
|
270
270
|
idempotency_key: z.string().optional(),
|
|
271
|
-
/**
|
|
272
|
-
idempotencyKey: z.string().optional(),
|
|
271
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
272
|
+
idempotencyKey: z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key"),
|
|
273
273
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
274
274
|
task_budget_id: z.string().min(1).optional()
|
|
275
275
|
},
|
|
@@ -279,8 +279,8 @@ var toolSchemas = {
|
|
|
279
279
|
headers: headersSchema,
|
|
280
280
|
body: z.string().optional(),
|
|
281
281
|
idempotency_key: z.string().optional(),
|
|
282
|
-
/**
|
|
283
|
-
idempotencyKey: z.string().optional(),
|
|
282
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
283
|
+
idempotencyKey: z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key"),
|
|
284
284
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
285
285
|
task_budget_id: z.string().min(1).optional()
|
|
286
286
|
},
|
|
@@ -399,9 +399,9 @@ function createToolHandlers(haven) {
|
|
|
399
399
|
token: args.asset,
|
|
400
400
|
amount: args.amount,
|
|
401
401
|
to: args.recipient,
|
|
402
|
-
// #1207: was accepted by the schema but silently dropped — now
|
|
403
|
-
// carried to the backend's replay contract.
|
|
404
|
-
idempotencyKey: args.
|
|
402
|
+
// #1207/#3411: was accepted by the schema but silently dropped — now
|
|
403
|
+
// carried to the backend's replay contract via the resolved carrier.
|
|
404
|
+
idempotencyKey: args.resolvedIdempotencyKey,
|
|
405
405
|
// #3329: spend against an open task budget instead of the
|
|
406
406
|
// agent's period budget, when the caller names one.
|
|
407
407
|
...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {}
|
|
@@ -442,7 +442,7 @@ function createToolHandlers(haven) {
|
|
|
442
442
|
body: JSON.stringify(envelope)
|
|
443
443
|
};
|
|
444
444
|
let merchantUrl = args.merchant_url;
|
|
445
|
-
const idempotencyKey = args.
|
|
445
|
+
const idempotencyKey = args.resolvedIdempotencyKey;
|
|
446
446
|
const attempt = () => haven.fetch(merchantUrl, init, { idempotencyKey });
|
|
447
447
|
let response = await attempt();
|
|
448
448
|
if (!response.ok) {
|
|
@@ -476,7 +476,7 @@ function createToolHandlers(haven) {
|
|
|
476
476
|
if ("success" in pf) return pf;
|
|
477
477
|
const { args, warnings } = pf;
|
|
478
478
|
try {
|
|
479
|
-
const data = await haven.quoteX402(args.url, requestInit(args), { idempotencyKey: args.
|
|
479
|
+
const data = await haven.quoteX402(args.url, requestInit(args), { idempotencyKey: args.resolvedIdempotencyKey });
|
|
480
480
|
return warnings.length > 0 ? { success: true, data, warnings } : { success: true, data };
|
|
481
481
|
} catch (err) {
|
|
482
482
|
return normalizeError(err);
|
|
@@ -503,7 +503,7 @@ function createToolHandlers(haven) {
|
|
|
503
503
|
}
|
|
504
504
|
return runTool(async () => {
|
|
505
505
|
const response = await haven.payX402Quote(args.quote, {
|
|
506
|
-
idempotencyKey: args.
|
|
506
|
+
idempotencyKey: args.resolvedIdempotencyKey,
|
|
507
507
|
...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {}
|
|
508
508
|
});
|
|
509
509
|
return responsePayload(response);
|
|
@@ -515,7 +515,7 @@ function createToolHandlers(haven) {
|
|
|
515
515
|
const { args, warnings } = pf;
|
|
516
516
|
return runTool(async () => {
|
|
517
517
|
const response = await haven.fetch(args.url, requestInit(args), {
|
|
518
|
-
idempotencyKey: args.
|
|
518
|
+
idempotencyKey: args.resolvedIdempotencyKey,
|
|
519
519
|
...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {}
|
|
520
520
|
});
|
|
521
521
|
return responsePayload(response);
|
|
@@ -713,28 +713,20 @@ function preflight(name, input) {
|
|
|
713
713
|
}
|
|
714
714
|
const idem = resolveIdempotencyKey(args);
|
|
715
715
|
if ("success" in idem) return idem;
|
|
716
|
-
if (idem.key !== void 0) args = { ...args,
|
|
716
|
+
if (idem.key !== void 0) args = { ...args, resolvedIdempotencyKey: idem.key };
|
|
717
717
|
return { args, warnings: idem.warnings };
|
|
718
718
|
}
|
|
719
719
|
function resolveIdempotencyKey(args) {
|
|
720
720
|
const modern = typeof args.idempotency_key === "string" ? args.idempotency_key : void 0;
|
|
721
721
|
const legacy = typeof args.idempotencyKey === "string" ? args.idempotencyKey : void 0;
|
|
722
|
-
if (
|
|
722
|
+
if (legacy !== void 0) {
|
|
723
723
|
return {
|
|
724
724
|
success: false,
|
|
725
|
-
code: "
|
|
726
|
-
message: "
|
|
725
|
+
code: "IDEMPOTENCY_KEY_RENAMED",
|
|
726
|
+
message: "idempotencyKey has been renamed to idempotency_key and is no longer accepted. Send idempotency_key instead. Nothing was contacted or spent."
|
|
727
727
|
};
|
|
728
728
|
}
|
|
729
729
|
if (modern !== void 0) return { key: modern, warnings: [] };
|
|
730
|
-
if (legacy !== void 0) {
|
|
731
|
-
return {
|
|
732
|
-
key: legacy,
|
|
733
|
-
warnings: [
|
|
734
|
-
"idempotencyKey is deprecated and will be removed in a future release of @haven_ai/mcp. Send idempotency_key instead \u2014 it is the spelling the hosted Haven MCP surface and every other Haven wire contract use."
|
|
735
|
-
]
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
730
|
return { warnings: [] };
|
|
739
731
|
}
|
|
740
732
|
function buildMcpToolsCallEnvelope(toolName, args) {
|
|
@@ -1121,7 +1113,7 @@ async function resolveHavenClient(options = {}) {
|
|
|
1121
1113
|
return { client, credentials };
|
|
1122
1114
|
}
|
|
1123
1115
|
var MCP_NAME = "@haven_ai/mcp";
|
|
1124
|
-
var MCP_VERSION = "0.0.0-dev.
|
|
1116
|
+
var MCP_VERSION = "0.0.0-dev.202609282003.b645eff";
|
|
1125
1117
|
var MCP_INSTRUCTIONS = [
|
|
1126
1118
|
"Haven local MCP server: signs in-process with the delegate key it holds on",
|
|
1127
1119
|
"this machine \u2014 the key never leaves this process. Call haven_get_agent",
|