@haven_ai/mcp 0.0.0-dev.202609281945.3f83e0e → 0.0.0-dev.202609282018.d7956ad

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
@@ -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 deprecated — send `idempotency_key`
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`) now accept
128
- **`idempotency_key`**, the spelling the hosted Haven MCP surface and every other
129
- Haven wire contract use. `idempotencyKey` still works and returns a deprecation
130
- warning; it will be removed in a future release.
131
-
132
- Send **one** of them. Sending both with different values is refused
133
- (`AMBIGUOUS_IDEMPOTENCY_KEY`) with nothing contacted or spent — the key decides
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
- /** Legacy spelling, accepted during the #2366 window. Warns; do not use. */
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
- /** Legacy spelling, accepted during the #2366 window. Warns; do not use. */
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
- /** Legacy spelling, accepted during the #2366 window. Warns; do not use. */
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
- /** Legacy spelling, accepted during the #2366 window. Warns; do not use. */
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
- /** Legacy spelling, accepted during the #2366 window. Warns; do not use. */
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.idempotencyKey,
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.idempotencyKey;
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.idempotencyKey });
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.idempotencyKey,
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.idempotencyKey,
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, idempotencyKey: idem.key };
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 (modern !== void 0 && legacy !== void 0 && modern !== legacy) {
724
+ if (legacy !== void 0) {
725
725
  return {
726
726
  success: false,
727
- code: "AMBIGUOUS_IDEMPOTENCY_KEY",
728
- message: "Both idempotency_key and idempotencyKey were sent with different values. Nothing was contacted or spent. Send exactly one \u2014 idempotency_key is the current spelling; idempotencyKey is deprecated and will be removed."
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.202609281945.3f83e0e";
1118
+ var MCP_VERSION = "0.0.0-dev.202609282018.d7956ad";
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",