@haven_ai/mcp 0.1.30-alpha.0 → 0.1.32-alpha.0
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 +24 -9
- package/dist/cli.cjs +44 -12
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +44 -12
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +44 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -5
- package/dist/index.d.ts +14 -5
- package/dist/index.js +44 -12
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -95,6 +95,8 @@ Environment variable form:
|
|
|
95
95
|
- `haven_get_resume_state`
|
|
96
96
|
- `haven_get_agent`
|
|
97
97
|
- `haven_get_allowances`
|
|
98
|
+
- `haven_discover_tools`
|
|
99
|
+
- `haven_submit_catalog_entry`
|
|
98
100
|
- `haven_list_receipts`
|
|
99
101
|
|
|
100
102
|
## First-launch consent
|
|
@@ -117,9 +119,16 @@ Tools this server will expose to your agent runtime:
|
|
|
117
119
|
Return configured and on-chain allowance state …
|
|
118
120
|
…
|
|
119
121
|
|
|
120
|
-
On-chain
|
|
122
|
+
On-chain budget (the real spend gate — enforced by the agent's
|
|
123
|
+
signed delegation, not by Haven):
|
|
121
124
|
• up to 50.000000 USDC per 1440 min
|
|
122
125
|
|
|
126
|
+
Anything above the on-chain budget is declined before any money
|
|
127
|
+
moves — it is not queued, and no one is asked to review it. If the
|
|
128
|
+
agent needs more room, the wallet owner grants or raises the budget
|
|
129
|
+
in Haven. Revoking the agent on-chain disables every MCP tool that
|
|
130
|
+
would spend.
|
|
131
|
+
|
|
123
132
|
Consent hash: 6f4b…d1a2
|
|
124
133
|
```
|
|
125
134
|
|
|
@@ -151,14 +160,15 @@ Every MCP tool invocation tags the underlying Haven API call with
|
|
|
151
160
|
`X-Haven-MCP-Tool: <tool_name>`. The backend records one
|
|
152
161
|
`agent_tool_invocations` row per call (tool name, payment id when present,
|
|
153
162
|
result status, nextAction, error code, HTTP status, timestamp). The agent's
|
|
154
|
-
activity feed in the Haven dashboard surfaces these rows alongside payments
|
|
155
|
-
|
|
163
|
+
activity feed in the Haven dashboard surfaces these rows alongside payments,
|
|
164
|
+
so the wallet owner can see exactly which tools the
|
|
156
165
|
agent called and what happened — even for read-only calls that don't move
|
|
157
166
|
money.
|
|
158
167
|
|
|
159
|
-
The audit log is informational. The
|
|
160
|
-
the only thing that can stop a spend;
|
|
161
|
-
every MCP tool that would settle,
|
|
168
|
+
The audit log is informational. The agent's signed budget delegation — its
|
|
169
|
+
on-chain caveat enforcers — remains the only thing that can stop a spend;
|
|
170
|
+
revoking the agent on-chain disables every MCP tool that would settle,
|
|
171
|
+
regardless of audit state.
|
|
162
172
|
|
|
163
173
|
## Manual sanity test
|
|
164
174
|
|
|
@@ -167,9 +177,14 @@ every MCP tool that would settle, regardless of audit state.
|
|
|
167
177
|
delegate address.
|
|
168
178
|
3. Call `haven_quote_x402` for a paid test URL.
|
|
169
179
|
4. Call `haven_pay_x402_quote` with the returned quote.
|
|
170
|
-
5.
|
|
171
|
-
|
|
172
|
-
|
|
180
|
+
5. The pay tool performs the merchant retry itself, so a successful call needs
|
|
181
|
+
no follow-up. If the call is declined for budget, raise the agent budget in
|
|
182
|
+
Haven and repeat from step 4 — Haven holds no approval queue, so there is
|
|
183
|
+
nothing to wait for. If the process crashes after payment, a later
|
|
184
|
+
`haven_get_payment_status` call may report
|
|
185
|
+
`nextAction: 'retry_original_x402_request'` — only then call
|
|
186
|
+
`haven_resume_x402_payment` with the preserved resume state or payment id;
|
|
187
|
+
do not call it speculatively.
|
|
173
188
|
|
|
174
189
|
The legacy MPP demo flow is retired (#1328) — pay through the x402 merchant
|
|
175
190
|
flow above instead.
|
package/dist/cli.cjs
CHANGED
|
@@ -264,7 +264,12 @@ var toolSchemas = {
|
|
|
264
264
|
haven_discover_tools: {
|
|
265
265
|
category: v3.z.string().optional(),
|
|
266
266
|
search: v3.z.string().optional(),
|
|
267
|
-
rail: v3.z.enum(["x402", "mpp"]).optional()
|
|
267
|
+
rail: v3.z.enum(["x402", "mpp"]).optional(),
|
|
268
|
+
verified: v3.z.enum(["any", "verified", "operator"]).optional()
|
|
269
|
+
},
|
|
270
|
+
haven_submit_catalog_entry: {
|
|
271
|
+
resource_url: v3.z.string().min(1),
|
|
272
|
+
website: v3.z.string().optional()
|
|
268
273
|
},
|
|
269
274
|
haven_list_receipts: {
|
|
270
275
|
limit: v3.z.number().int().min(1).max(100).optional()
|
|
@@ -286,6 +291,7 @@ var toolDescriptions = {
|
|
|
286
291
|
haven_get_allowances: sdk.composeDescription(sdk.toolDescriptions.getAllowances),
|
|
287
292
|
haven_sweep_delegate: sdk.composeDescription(sdk.toolDescriptions.sweep_delegate),
|
|
288
293
|
haven_discover_tools: sdk.composeDescription(sdk.toolDescriptions.discoverTools),
|
|
294
|
+
haven_submit_catalog_entry: sdk.composeDescription(sdk.toolDescriptions.submitCatalogEntry),
|
|
289
295
|
haven_list_receipts: sdk.composeDescription(sdk.toolDescriptions.listReceipts),
|
|
290
296
|
haven_verify_receipt: sdk.composeDescription(sdk.toolDescriptions.verifyReceipt)
|
|
291
297
|
};
|
|
@@ -316,6 +322,8 @@ function createToolHandlers(haven) {
|
|
|
316
322
|
return {
|
|
317
323
|
payment_id: err.paymentId,
|
|
318
324
|
status: "pending_approval",
|
|
325
|
+
next_action: "stop_and_tell_user",
|
|
326
|
+
message: "This payment is not payable and nothing is queued for anyone to approve \u2014 stop and tell the user, then ask the wallet owner to grant or raise the agent budget in Haven. Do not retry, re-sign, or poll.",
|
|
319
327
|
asset: args.asset,
|
|
320
328
|
amount: args.amount,
|
|
321
329
|
recipient: args.recipient
|
|
@@ -422,7 +430,8 @@ function createToolHandlers(haven) {
|
|
|
422
430
|
const entries = await haven.discoverTools({
|
|
423
431
|
category: typeof args.category === "string" ? args.category : void 0,
|
|
424
432
|
search: typeof args.search === "string" ? args.search : void 0,
|
|
425
|
-
rail: args.rail === "x402" || args.rail === "mpp" ? args.rail : void 0
|
|
433
|
+
rail: args.rail === "x402" || args.rail === "mpp" ? args.rail : void 0,
|
|
434
|
+
verified: args.verified === "verified" || args.verified === "operator" ? args.verified : void 0
|
|
426
435
|
});
|
|
427
436
|
return entries.map((entry) => ({
|
|
428
437
|
id: entry.id,
|
|
@@ -440,6 +449,9 @@ function createToolHandlers(haven) {
|
|
|
440
449
|
network: entry.network,
|
|
441
450
|
status: entry.status,
|
|
442
451
|
verified_at: entry.verifiedAt,
|
|
452
|
+
source: entry.source,
|
|
453
|
+
domain_verified: entry.domainVerified,
|
|
454
|
+
verified_payable: entry.verifiedPayable,
|
|
443
455
|
// Which Haven pay tool reaches this entry from the local MCP surface.
|
|
444
456
|
// #1328: the 'mpp' rail's only-ever catalog row (the Haven MPP demo
|
|
445
457
|
// resource) is delisted with the mpp_demo retirement, so this
|
|
@@ -449,6 +461,20 @@ function createToolHandlers(haven) {
|
|
|
449
461
|
}));
|
|
450
462
|
});
|
|
451
463
|
},
|
|
464
|
+
haven_submit_catalog_entry: async (input) => {
|
|
465
|
+
const args = objectInput("haven_submit_catalog_entry", input);
|
|
466
|
+
return runTool(async () => {
|
|
467
|
+
const submission = await haven.submitCatalogEntry(
|
|
468
|
+
String(args.resource_url),
|
|
469
|
+
typeof args.website === "string" ? { website: args.website } : void 0
|
|
470
|
+
);
|
|
471
|
+
return {
|
|
472
|
+
id: submission.id,
|
|
473
|
+
verify_token: submission.verifyToken,
|
|
474
|
+
status: submission.status
|
|
475
|
+
};
|
|
476
|
+
});
|
|
477
|
+
},
|
|
452
478
|
haven_list_receipts: async (input) => {
|
|
453
479
|
const args = objectInput("haven_list_receipts", input);
|
|
454
480
|
return runTool(async () => haven.listReceipts({ limit: args.limit }));
|
|
@@ -621,20 +647,23 @@ function renderConsentBlock(input, hash) {
|
|
|
621
647
|
}
|
|
622
648
|
lines.push("");
|
|
623
649
|
if (input.allowanceSummary.length === 0) {
|
|
624
|
-
lines.push("On-chain
|
|
625
|
-
lines.push("
|
|
626
|
-
lines.push("
|
|
650
|
+
lines.push("On-chain budget: none configured.");
|
|
651
|
+
lines.push(" Until the wallet owner grants this agent a budget in Haven,");
|
|
652
|
+
lines.push(" every payment it attempts is declined on-chain.");
|
|
627
653
|
} else {
|
|
628
|
-
lines.push("On-chain
|
|
654
|
+
lines.push("On-chain budget (the real spend gate \u2014 enforced by the agent's");
|
|
655
|
+
lines.push("signed delegation, not by Haven):");
|
|
629
656
|
for (const a of input.allowanceSummary) {
|
|
630
657
|
const reset = a.resetMinutes ? ` per ${a.resetMinutes} min` : " (no reset)";
|
|
631
658
|
lines.push(` \u2022 up to ${a.amount} ${a.token}${reset}`);
|
|
632
659
|
}
|
|
633
660
|
}
|
|
634
661
|
lines.push("");
|
|
635
|
-
lines.push("Anything above the on-chain
|
|
636
|
-
lines.push("
|
|
637
|
-
lines.push("
|
|
662
|
+
lines.push("Anything above the on-chain budget is declined before any money");
|
|
663
|
+
lines.push("moves \u2014 it is not queued, and no one is asked to review it. If the");
|
|
664
|
+
lines.push("agent needs more room, the wallet owner grants or raises the budget");
|
|
665
|
+
lines.push("in Haven. Revoking the agent on-chain disables every MCP tool that");
|
|
666
|
+
lines.push("would spend.");
|
|
638
667
|
lines.push("");
|
|
639
668
|
lines.push(`Consent hash: ${hash}`);
|
|
640
669
|
lines.push("");
|
|
@@ -767,7 +796,7 @@ async function resolveHavenClient(options = {}) {
|
|
|
767
796
|
return { client, credentials };
|
|
768
797
|
}
|
|
769
798
|
var MCP_NAME = "@haven_ai/mcp";
|
|
770
|
-
var MCP_VERSION = "0.1.
|
|
799
|
+
var MCP_VERSION = "0.1.32-alpha.0";
|
|
771
800
|
var MCP_INSTRUCTIONS = [
|
|
772
801
|
"Haven local MCP server: signs in-process with the delegate key it holds on",
|
|
773
802
|
"this machine \u2014 the key never leaves this process. Call haven_get_agent",
|
|
@@ -779,8 +808,11 @@ var MCP_INSTRUCTIONS = [
|
|
|
779
808
|
"paywall. Tool responses carry nextAction \u2014 follow it; description prose",
|
|
780
809
|
"is fallback, not the source of truth.",
|
|
781
810
|
"",
|
|
782
|
-
"
|
|
783
|
-
"
|
|
811
|
+
"A payment outside the agent budget is declined before any money moves. Haven",
|
|
812
|
+
"holds no approval queue, so there is nothing to poll and no approval will",
|
|
813
|
+
"ever arrive for it. On a decline, or on any status you do not",
|
|
814
|
+
"recognise, stop and tell the user: do not retry or re-sign, and ask them to",
|
|
815
|
+
"grant or raise the budget in Haven. Spend authority is enforced on-chain by",
|
|
784
816
|
"the user's account; Haven never holds keys and cannot override it."
|
|
785
817
|
].join("\n");
|
|
786
818
|
function buildMcpServer(haven) {
|