@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/README.md
CHANGED
|
@@ -121,21 +121,16 @@ Environment variable form:
|
|
|
121
121
|
- `haven_close_task_budget` (#3329)
|
|
122
122
|
- `haven_submit` (#3329 — relays a local signer signature by `task_budget_id`; a `payment_id` is refused on this runtime, which signs and submits payments inline)
|
|
123
123
|
|
|
124
|
-
### `idempotencyKey` is
|
|
124
|
+
### `idempotencyKey` is removed — send `idempotency_key`
|
|
125
125
|
|
|
126
126
|
The tools that take an idempotency key (`haven_send`, `haven_pay_mcp_tool`,
|
|
127
|
-
`haven_quote_x402`, `haven_pay_x402_quote`, `haven_pay_x402`)
|
|
128
|
-
**`idempotency_key`**, the spelling the hosted Haven MCP surface
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
whether a retry is the same payment or a second one, so Haven will not guess
|
|
135
|
-
which scope you meant. Sending both with the same value is fine.
|
|
136
|
-
|
|
137
|
-
The warning arrives in an optional `warnings` array on the success result. It is
|
|
138
|
-
additive: a caller that ignores it sees the response it always saw.
|
|
127
|
+
`haven_quote_x402`, `haven_pay_x402_quote`, `haven_pay_x402`) take
|
|
128
|
+
**`idempotency_key`**, the spelling the hosted Haven MCP surface uses.
|
|
129
|
+
|
|
130
|
+
The legacy `idempotencyKey` spelling is **refused**, not silently accepted or
|
|
131
|
+
dropped: any call that sets it — alone or alongside `idempotency_key` — fails
|
|
132
|
+
with `IDEMPOTENCY_KEY_RENAMED` before anything is contacted or spent. Send
|
|
133
|
+
`idempotency_key` instead.
|
|
139
134
|
|
|
140
135
|
## First-launch consent
|
|
141
136
|
|
package/dist/cli.cjs
CHANGED
|
@@ -245,8 +245,8 @@ var toolSchemas = {
|
|
|
245
245
|
recipient: v3.z.string().min(1),
|
|
246
246
|
amount: v3.z.string().min(1),
|
|
247
247
|
idempotency_key: v3.z.string().optional(),
|
|
248
|
-
/**
|
|
249
|
-
idempotencyKey: v3.z.string().optional(),
|
|
248
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
249
|
+
idempotencyKey: v3.z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key"),
|
|
250
250
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
251
251
|
task_budget_id: v3.z.string().min(1).optional()
|
|
252
252
|
},
|
|
@@ -255,8 +255,8 @@ var toolSchemas = {
|
|
|
255
255
|
tool_name: v3.z.string().min(1),
|
|
256
256
|
arguments: v3.z.record(v3.z.string(), v3.z.unknown()).optional(),
|
|
257
257
|
idempotency_key: v3.z.string().optional(),
|
|
258
|
-
/**
|
|
259
|
-
idempotencyKey: v3.z.string().optional()
|
|
258
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
259
|
+
idempotencyKey: v3.z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key")
|
|
260
260
|
},
|
|
261
261
|
haven_quote_x402: {
|
|
262
262
|
url: v3.z.string().url(),
|
|
@@ -264,14 +264,14 @@ var toolSchemas = {
|
|
|
264
264
|
headers: headersSchema,
|
|
265
265
|
body: v3.z.string().optional(),
|
|
266
266
|
idempotency_key: v3.z.string().optional(),
|
|
267
|
-
/**
|
|
268
|
-
idempotencyKey: v3.z.string().optional()
|
|
267
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
268
|
+
idempotencyKey: v3.z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key")
|
|
269
269
|
},
|
|
270
270
|
haven_pay_x402_quote: {
|
|
271
271
|
quote: v3.z.unknown(),
|
|
272
272
|
idempotency_key: v3.z.string().optional(),
|
|
273
|
-
/**
|
|
274
|
-
idempotencyKey: v3.z.string().optional(),
|
|
273
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
274
|
+
idempotencyKey: v3.z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key"),
|
|
275
275
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
276
276
|
task_budget_id: v3.z.string().min(1).optional()
|
|
277
277
|
},
|
|
@@ -281,8 +281,8 @@ var toolSchemas = {
|
|
|
281
281
|
headers: headersSchema,
|
|
282
282
|
body: v3.z.string().optional(),
|
|
283
283
|
idempotency_key: v3.z.string().optional(),
|
|
284
|
-
/**
|
|
285
|
-
idempotencyKey: v3.z.string().optional(),
|
|
284
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
285
|
+
idempotencyKey: v3.z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key"),
|
|
286
286
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
287
287
|
task_budget_id: v3.z.string().min(1).optional()
|
|
288
288
|
},
|
|
@@ -401,9 +401,9 @@ function createToolHandlers(haven) {
|
|
|
401
401
|
token: args.asset,
|
|
402
402
|
amount: args.amount,
|
|
403
403
|
to: args.recipient,
|
|
404
|
-
// #1207: was accepted by the schema but silently dropped — now
|
|
405
|
-
// carried to the backend's replay contract.
|
|
406
|
-
idempotencyKey: args.
|
|
404
|
+
// #1207/#3411: was accepted by the schema but silently dropped — now
|
|
405
|
+
// carried to the backend's replay contract via the resolved carrier.
|
|
406
|
+
idempotencyKey: args.resolvedIdempotencyKey,
|
|
407
407
|
// #3329: spend against an open task budget instead of the
|
|
408
408
|
// agent's period budget, when the caller names one.
|
|
409
409
|
...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {}
|
|
@@ -444,7 +444,7 @@ function createToolHandlers(haven) {
|
|
|
444
444
|
body: JSON.stringify(envelope)
|
|
445
445
|
};
|
|
446
446
|
let merchantUrl = args.merchant_url;
|
|
447
|
-
const idempotencyKey = args.
|
|
447
|
+
const idempotencyKey = args.resolvedIdempotencyKey;
|
|
448
448
|
const attempt = () => haven.fetch(merchantUrl, init, { idempotencyKey });
|
|
449
449
|
let response = await attempt();
|
|
450
450
|
if (!response.ok) {
|
|
@@ -478,7 +478,7 @@ function createToolHandlers(haven) {
|
|
|
478
478
|
if ("success" in pf) return pf;
|
|
479
479
|
const { args, warnings } = pf;
|
|
480
480
|
try {
|
|
481
|
-
const data = await haven.quoteX402(args.url, requestInit(args), { idempotencyKey: args.
|
|
481
|
+
const data = await haven.quoteX402(args.url, requestInit(args), { idempotencyKey: args.resolvedIdempotencyKey });
|
|
482
482
|
return warnings.length > 0 ? { success: true, data, warnings } : { success: true, data };
|
|
483
483
|
} catch (err) {
|
|
484
484
|
return normalizeError(err);
|
|
@@ -505,7 +505,7 @@ function createToolHandlers(haven) {
|
|
|
505
505
|
}
|
|
506
506
|
return runTool(async () => {
|
|
507
507
|
const response = await haven.payX402Quote(args.quote, {
|
|
508
|
-
idempotencyKey: args.
|
|
508
|
+
idempotencyKey: args.resolvedIdempotencyKey,
|
|
509
509
|
...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {}
|
|
510
510
|
});
|
|
511
511
|
return responsePayload(response);
|
|
@@ -517,7 +517,7 @@ function createToolHandlers(haven) {
|
|
|
517
517
|
const { args, warnings } = pf;
|
|
518
518
|
return runTool(async () => {
|
|
519
519
|
const response = await haven.fetch(args.url, requestInit(args), {
|
|
520
|
-
idempotencyKey: args.
|
|
520
|
+
idempotencyKey: args.resolvedIdempotencyKey,
|
|
521
521
|
...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {}
|
|
522
522
|
});
|
|
523
523
|
return responsePayload(response);
|
|
@@ -715,28 +715,20 @@ function preflight(name, input) {
|
|
|
715
715
|
}
|
|
716
716
|
const idem = resolveIdempotencyKey(args);
|
|
717
717
|
if ("success" in idem) return idem;
|
|
718
|
-
if (idem.key !== void 0) args = { ...args,
|
|
718
|
+
if (idem.key !== void 0) args = { ...args, resolvedIdempotencyKey: idem.key };
|
|
719
719
|
return { args, warnings: idem.warnings };
|
|
720
720
|
}
|
|
721
721
|
function resolveIdempotencyKey(args) {
|
|
722
722
|
const modern = typeof args.idempotency_key === "string" ? args.idempotency_key : void 0;
|
|
723
723
|
const legacy = typeof args.idempotencyKey === "string" ? args.idempotencyKey : void 0;
|
|
724
|
-
if (
|
|
724
|
+
if (legacy !== void 0) {
|
|
725
725
|
return {
|
|
726
726
|
success: false,
|
|
727
|
-
code: "
|
|
728
|
-
message: "
|
|
727
|
+
code: "IDEMPOTENCY_KEY_RENAMED",
|
|
728
|
+
message: "idempotencyKey has been renamed to idempotency_key and is no longer accepted. Send idempotency_key instead. Nothing was contacted or spent."
|
|
729
729
|
};
|
|
730
730
|
}
|
|
731
731
|
if (modern !== void 0) return { key: modern, warnings: [] };
|
|
732
|
-
if (legacy !== void 0) {
|
|
733
|
-
return {
|
|
734
|
-
key: legacy,
|
|
735
|
-
warnings: [
|
|
736
|
-
"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."
|
|
737
|
-
]
|
|
738
|
-
};
|
|
739
|
-
}
|
|
740
732
|
return { warnings: [] };
|
|
741
733
|
}
|
|
742
734
|
function buildMcpToolsCallEnvelope(toolName, args) {
|
|
@@ -1123,7 +1115,7 @@ async function resolveHavenClient(options = {}) {
|
|
|
1123
1115
|
return { client, credentials };
|
|
1124
1116
|
}
|
|
1125
1117
|
var MCP_NAME = "@haven_ai/mcp";
|
|
1126
|
-
var MCP_VERSION = "0.0.0-dev.
|
|
1118
|
+
var MCP_VERSION = "0.0.0-dev.202609282003.b645eff";
|
|
1127
1119
|
var MCP_INSTRUCTIONS = [
|
|
1128
1120
|
"Haven local MCP server: signs in-process with the delegate key it holds on",
|
|
1129
1121
|
"this machine \u2014 the key never leaves this process. Call haven_get_agent",
|