@haven_ai/mcp 0.0.0-dev.202609282315.dd06d7c → 0.0.0-dev.202609291158.c1438b6

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/dist/cli.cjs CHANGED
@@ -238,6 +238,17 @@ async function warnIfCredentialFilePermissive(path, log = (message) => process.s
238
238
  );
239
239
  }
240
240
  }
241
+ var TASK_BUDGET_MIN_SIGNER_VERSION = "0.6.0-alpha.0";
242
+ var SIGNER_CAPABILITY_KEY = "haven/signer-compatibility";
243
+ function taskSignerCompatibilityNotice() {
244
+ return {
245
+ task_sign_context_version: sdk.TASK_SIGN_CONTEXT_VERSION,
246
+ min_signer_version: TASK_BUDGET_MIN_SIGNER_VERSION,
247
+ signer_capability: SIGNER_CAPABILITY_KEY,
248
+ check: `Call next_tool with next_arguments EXACTLY as given \u2014 the signer fetches the exact bytes by task_budget_id. If haven_sign answers SIGNING_ERROR with a message starting "Pass payment_id (preferred for delegation-rail x402", the signer predates task budgets and signed nothing: first close this budget with haven_close_task_budget { task_budget_id } to release it, then update the connector by running \`${sdk.connectorUpgradeCommand()}\` and the repair line it prints, then open the budget again.`,
249
+ fallback: `haven_sign answered SIGNING_ERROR with a message starting "Pass payment_id (preferred for delegation-rail x402" \u2014 the signer predates task budgets and signed nothing: call haven_close_task_budget { task_budget_id } to release the pending budget, then update the connector by running \`${sdk.connectorUpgradeCommand()}\` and the repair line it prints, then open the budget again. There is no relay fallback for this signing context.`
250
+ };
251
+ }
241
252
  var headersSchema = v3.z.record(v3.z.string(), v3.z.string()).optional();
242
253
  var toolSchemas = {
243
254
  haven_send: {
@@ -248,7 +259,13 @@ var toolSchemas = {
248
259
  /** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
249
260
  idempotencyKey: v3.z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key"),
250
261
  /** #3329: spend against an open task budget instead of the agent's period budget. */
251
- task_budget_id: v3.z.string().min(1).optional()
262
+ task_budget_id: v3.z.string().min(1).optional(),
263
+ /**
264
+ * #3330: spend against an open sub-budget this agent HOLDS (it is the
265
+ * sub-agent B) instead of the agent's own budget. Mutually exclusive
266
+ * with task_budget_id — the backend refuses a body naming both.
267
+ */
268
+ sub_budget_id: v3.z.string().min(1).optional()
252
269
  },
253
270
  haven_pay_mcp_tool: {
254
271
  merchant_url: v3.z.string().url(),
@@ -273,7 +290,9 @@ var toolSchemas = {
273
290
  /** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
274
291
  idempotencyKey: v3.z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key"),
275
292
  /** #3329: spend against an open task budget instead of the agent's period budget. */
276
- task_budget_id: v3.z.string().min(1).optional()
293
+ task_budget_id: v3.z.string().min(1).optional(),
294
+ /** #3330: spend against an open sub-budget this agent holds (it is sub-agent B). Mutually exclusive with task_budget_id. */
295
+ sub_budget_id: v3.z.string().min(1).optional()
277
296
  },
278
297
  haven_pay_x402: {
279
298
  url: v3.z.string().url(),
@@ -284,7 +303,9 @@ var toolSchemas = {
284
303
  /** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
285
304
  idempotencyKey: v3.z.string().optional().describe("REMOVED (#3411): refused \u2014 send idempotency_key"),
286
305
  /** #3329: spend against an open task budget instead of the agent's period budget. */
287
- task_budget_id: v3.z.string().min(1).optional()
306
+ task_budget_id: v3.z.string().min(1).optional(),
307
+ /** #3330: spend against an open sub-budget this agent holds (it is sub-agent B). Mutually exclusive with task_budget_id. */
308
+ sub_budget_id: v3.z.string().min(1).optional()
288
309
  },
289
310
  haven_resume_x402_payment: {
290
311
  payment_id: v3.z.string().optional(),
@@ -312,7 +333,9 @@ var toolSchemas = {
312
333
  haven_list_receipts: {
313
334
  limit: v3.z.number().int().min(1).max(100).optional(),
314
335
  /** #3128: the previous page's next_cursor (a receipt id). */
315
- cursor: v3.z.string().min(1).optional()
336
+ cursor: v3.z.string().min(1).optional(),
337
+ /** #3423: drop each row's payload echoes; the default shape is unchanged. */
338
+ compact: v3.z.boolean().optional().describe("true drops challengePayload, selectedPayment and protocolReceiptPayload from each row; omit for the full row.")
316
339
  },
317
340
  haven_verify_receipt: {
318
341
  receipt: v3.z.unknown()
@@ -406,7 +429,10 @@ function createToolHandlers(haven) {
406
429
  idempotencyKey: args.resolvedIdempotencyKey,
407
430
  // #3329: spend against an open task budget instead of the
408
431
  // agent's period budget, when the caller names one.
409
- ...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {}
432
+ ...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {},
433
+ // #3330: spend through a sub-budget this agent holds (it is
434
+ // sub-agent B). Exactly one of the two ids, never both.
435
+ ...typeof args.sub_budget_id === "string" ? { subBudgetId: args.sub_budget_id } : {}
410
436
  });
411
437
  return {
412
438
  payment_id: result.paymentId,
@@ -506,7 +532,8 @@ function createToolHandlers(haven) {
506
532
  return runTool(async () => {
507
533
  const response = await haven.payX402Quote(args.quote, {
508
534
  idempotencyKey: args.resolvedIdempotencyKey,
509
- ...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {}
535
+ ...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {},
536
+ ...typeof args.sub_budget_id === "string" ? { subBudgetId: args.sub_budget_id } : {}
510
537
  });
511
538
  return responsePayload(response);
512
539
  }, warnings);
@@ -518,7 +545,8 @@ function createToolHandlers(haven) {
518
545
  return runTool(async () => {
519
546
  const response = await haven.fetch(args.url, requestInit(args), {
520
547
  idempotencyKey: args.resolvedIdempotencyKey,
521
- ...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {}
548
+ ...typeof args.task_budget_id === "string" ? { taskBudgetId: args.task_budget_id } : {},
549
+ ...typeof args.sub_budget_id === "string" ? { subBudgetId: args.sub_budget_id } : {}
522
550
  });
523
551
  return responsePayload(response);
524
552
  }, warnings);
@@ -615,7 +643,9 @@ function createToolHandlers(haven) {
615
643
  },
616
644
  haven_list_receipts: async (input) => {
617
645
  const args = objectInput("haven_list_receipts", input);
618
- return runTool(async () => haven.listReceiptsPage({ limit: args.limit, cursor: args.cursor }));
646
+ return runTool(
647
+ async () => haven.listReceiptsPage({ limit: args.limit, cursor: args.cursor, compact: args.compact === true })
648
+ );
619
649
  },
620
650
  haven_verify_receipt: async (input) => {
621
651
  const args = objectInput("haven_verify_receipt", input);
@@ -643,7 +673,8 @@ function createToolHandlers(haven) {
643
673
  task_budget: result.taskBudget,
644
674
  next_action: "sign",
645
675
  next_tool: "mcp__haven-signer__haven_sign",
646
- next_arguments: { task_budget_id: result.taskBudget.id }
676
+ next_arguments: { task_budget_id: result.taskBudget.id },
677
+ signer_compatibility: taskSignerCompatibilityNotice()
647
678
  };
648
679
  });
649
680
  },
@@ -658,7 +689,8 @@ function createToolHandlers(haven) {
658
689
  task_budget: result.taskBudget,
659
690
  next_action: "sign",
660
691
  next_tool: "mcp__haven-signer__haven_sign",
661
- next_arguments: { task_budget_id: args.task_budget_id }
692
+ next_arguments: { task_budget_id: args.task_budget_id },
693
+ signer_compatibility: taskSignerCompatibilityNotice()
662
694
  };
663
695
  });
664
696
  },
@@ -1115,7 +1147,7 @@ async function resolveHavenClient(options = {}) {
1115
1147
  return { client, credentials };
1116
1148
  }
1117
1149
  var MCP_NAME = "@haven_ai/mcp";
1118
- var MCP_VERSION = "0.0.0-dev.202609282315.dd06d7c";
1150
+ var MCP_VERSION = "0.0.0-dev.202609291158.c1438b6";
1119
1151
  var MCP_INSTRUCTIONS = [
1120
1152
  "Haven local MCP server: signs in-process with the delegate key it holds on",
1121
1153
  "this machine \u2014 the key never leaves this process. Call haven_get_agent",