@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/index.d.cts
CHANGED
|
@@ -73,7 +73,7 @@ declare const toolSchemas: {
|
|
|
73
73
|
readonly recipient: z.ZodString;
|
|
74
74
|
readonly amount: z.ZodString;
|
|
75
75
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
76
|
-
/**
|
|
76
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
77
77
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
78
78
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
79
79
|
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
@@ -83,7 +83,7 @@ declare const toolSchemas: {
|
|
|
83
83
|
readonly tool_name: z.ZodString;
|
|
84
84
|
readonly arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
85
85
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
86
|
-
/**
|
|
86
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
87
87
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
88
88
|
};
|
|
89
89
|
readonly haven_quote_x402: {
|
|
@@ -92,13 +92,13 @@ declare const toolSchemas: {
|
|
|
92
92
|
readonly headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
93
93
|
readonly body: z.ZodOptional<z.ZodString>;
|
|
94
94
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
95
|
-
/**
|
|
95
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
96
96
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
97
97
|
};
|
|
98
98
|
readonly haven_pay_x402_quote: {
|
|
99
99
|
readonly quote: z.ZodUnknown;
|
|
100
100
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
101
|
-
/**
|
|
101
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
102
102
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
103
103
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
104
104
|
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
@@ -109,7 +109,7 @@ declare const toolSchemas: {
|
|
|
109
109
|
readonly headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
110
110
|
readonly body: z.ZodOptional<z.ZodString>;
|
|
111
111
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
112
|
-
/**
|
|
112
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
113
113
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
114
114
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
115
115
|
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
@@ -395,7 +395,7 @@ declare function createHavenMcpServer(options?: HavenMcpServerOptions): Promise<
|
|
|
395
395
|
* `agent_tool_invocations` rows are always attributed to the right tool.
|
|
396
396
|
*/
|
|
397
397
|
declare const MCP_NAME = "@haven_ai/mcp";
|
|
398
|
-
declare const MCP_VERSION = "0.0.0-dev.
|
|
398
|
+
declare const MCP_VERSION = "0.0.0-dev.202609282003.b645eff";
|
|
399
399
|
/**
|
|
400
400
|
* Refuse to start on an unsupported Node (#1161).
|
|
401
401
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -73,7 +73,7 @@ declare const toolSchemas: {
|
|
|
73
73
|
readonly recipient: z.ZodString;
|
|
74
74
|
readonly amount: z.ZodString;
|
|
75
75
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
76
|
-
/**
|
|
76
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
77
77
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
78
78
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
79
79
|
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
@@ -83,7 +83,7 @@ declare const toolSchemas: {
|
|
|
83
83
|
readonly tool_name: z.ZodString;
|
|
84
84
|
readonly arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
85
85
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
86
|
-
/**
|
|
86
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
87
87
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
88
88
|
};
|
|
89
89
|
readonly haven_quote_x402: {
|
|
@@ -92,13 +92,13 @@ declare const toolSchemas: {
|
|
|
92
92
|
readonly headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
93
93
|
readonly body: z.ZodOptional<z.ZodString>;
|
|
94
94
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
95
|
-
/**
|
|
95
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
96
96
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
97
97
|
};
|
|
98
98
|
readonly haven_pay_x402_quote: {
|
|
99
99
|
readonly quote: z.ZodUnknown;
|
|
100
100
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
101
|
-
/**
|
|
101
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
102
102
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
103
103
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
104
104
|
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
@@ -109,7 +109,7 @@ declare const toolSchemas: {
|
|
|
109
109
|
readonly headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
110
110
|
readonly body: z.ZodOptional<z.ZodString>;
|
|
111
111
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
112
|
-
/**
|
|
112
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
113
113
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
114
114
|
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
115
115
|
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
@@ -395,7 +395,7 @@ declare function createHavenMcpServer(options?: HavenMcpServerOptions): Promise<
|
|
|
395
395
|
* `agent_tool_invocations` rows are always attributed to the right tool.
|
|
396
396
|
*/
|
|
397
397
|
declare const MCP_NAME = "@haven_ai/mcp";
|
|
398
|
-
declare const MCP_VERSION = "0.0.0-dev.
|
|
398
|
+
declare const MCP_VERSION = "0.0.0-dev.202609282003.b645eff";
|
|
399
399
|
/**
|
|
400
400
|
* Refuse to start on an unsupported Node (#1161).
|
|
401
401
|
*
|
package/dist/index.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) {
|
|
@@ -1129,7 +1121,7 @@ async function createHavenMcpServer(options = {}) {
|
|
|
1129
1121
|
return buildMcpServer(haven);
|
|
1130
1122
|
}
|
|
1131
1123
|
var MCP_NAME = "@haven_ai/mcp";
|
|
1132
|
-
var MCP_VERSION = "0.0.0-dev.
|
|
1124
|
+
var MCP_VERSION = "0.0.0-dev.202609282003.b645eff";
|
|
1133
1125
|
var MCP_INSTRUCTIONS = [
|
|
1134
1126
|
"Haven local MCP server: signs in-process with the delegate key it holds on",
|
|
1135
1127
|
"this machine \u2014 the key never leaves this process. Call haven_get_agent",
|