@haven_ai/mcp 0.5.0-alpha.1 → 0.7.0-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 +11 -13
- package/dist/cli.cjs +228 -35
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +229 -36
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +231 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -10
- package/dist/index.d.ts +99 -10
- package/dist/index.js +230 -37
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -66,22 +66,30 @@ declare function loadCredentials(source?: string | HavenCredentialSource | undef
|
|
|
66
66
|
* which is where URL-hardening would matter.)
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
|
-
type HavenMcpToolName = 'haven_send' | 'haven_pay_mcp_tool' | 'haven_quote_x402' | 'haven_pay_x402_quote' | 'haven_pay_x402' | 'haven_resume_x402_payment' | 'haven_get_payment_status' | 'haven_get_resume_state' | 'haven_get_agent' | 'haven_get_allowances' | 'haven_list_receipts' | 'haven_verify_receipt' | 'haven_sweep_delegate' | 'haven_discover_tools' | 'haven_submit_catalog_entry';
|
|
69
|
+
type HavenMcpToolName = 'haven_send' | 'haven_pay_mcp_tool' | 'haven_quote_x402' | 'haven_pay_x402_quote' | 'haven_pay_x402' | 'haven_resume_x402_payment' | 'haven_get_payment_status' | 'haven_get_resume_state' | 'haven_get_agent' | 'haven_get_allowances' | 'haven_list_receipts' | 'haven_verify_receipt' | 'haven_sweep_delegate' | 'haven_discover_tools' | 'haven_submit_catalog_entry' | 'haven_open_task_budget' | 'haven_close_task_budget' | 'haven_submit';
|
|
70
70
|
declare const toolSchemas: {
|
|
71
71
|
readonly haven_send: {
|
|
72
72
|
readonly asset: z.ZodEnum<["ETH", "USDC"]>;
|
|
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
|
+
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
79
|
+
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
80
|
+
/**
|
|
81
|
+
* #3330: spend against an open sub-budget this agent HOLDS (it is the
|
|
82
|
+
* sub-agent B) instead of the agent's own budget. Mutually exclusive
|
|
83
|
+
* with task_budget_id — the backend refuses a body naming both.
|
|
84
|
+
*/
|
|
85
|
+
readonly sub_budget_id: z.ZodOptional<z.ZodString>;
|
|
78
86
|
};
|
|
79
87
|
readonly haven_pay_mcp_tool: {
|
|
80
88
|
readonly merchant_url: z.ZodString;
|
|
81
89
|
readonly tool_name: z.ZodString;
|
|
82
90
|
readonly arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
83
91
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
84
|
-
/**
|
|
92
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
85
93
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
86
94
|
};
|
|
87
95
|
readonly haven_quote_x402: {
|
|
@@ -90,14 +98,18 @@ declare const toolSchemas: {
|
|
|
90
98
|
readonly headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
91
99
|
readonly body: z.ZodOptional<z.ZodString>;
|
|
92
100
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
93
|
-
/**
|
|
101
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
94
102
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
95
103
|
};
|
|
96
104
|
readonly haven_pay_x402_quote: {
|
|
97
105
|
readonly quote: z.ZodUnknown;
|
|
98
106
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
99
|
-
/**
|
|
107
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
100
108
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
109
|
+
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
110
|
+
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
111
|
+
/** #3330: spend against an open sub-budget this agent holds (it is sub-agent B). Mutually exclusive with task_budget_id. */
|
|
112
|
+
readonly sub_budget_id: z.ZodOptional<z.ZodString>;
|
|
101
113
|
};
|
|
102
114
|
readonly haven_pay_x402: {
|
|
103
115
|
readonly url: z.ZodString;
|
|
@@ -105,8 +117,12 @@ declare const toolSchemas: {
|
|
|
105
117
|
readonly headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
106
118
|
readonly body: z.ZodOptional<z.ZodString>;
|
|
107
119
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
108
|
-
/**
|
|
120
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
109
121
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
122
|
+
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
123
|
+
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
124
|
+
/** #3330: spend against an open sub-budget this agent holds (it is sub-agent B). Mutually exclusive with task_budget_id. */
|
|
125
|
+
readonly sub_budget_id: z.ZodOptional<z.ZodString>;
|
|
110
126
|
};
|
|
111
127
|
readonly haven_resume_x402_payment: {
|
|
112
128
|
readonly payment_id: z.ZodOptional<z.ZodString>;
|
|
@@ -135,10 +151,27 @@ declare const toolSchemas: {
|
|
|
135
151
|
readonly limit: z.ZodOptional<z.ZodNumber>;
|
|
136
152
|
/** #3128: the previous page's next_cursor (a receipt id). */
|
|
137
153
|
readonly cursor: z.ZodOptional<z.ZodString>;
|
|
154
|
+
/** #3423: drop each row's payload echoes; the default shape is unchanged. */
|
|
155
|
+
readonly compact: z.ZodOptional<z.ZodBoolean>;
|
|
138
156
|
};
|
|
139
157
|
readonly haven_verify_receipt: {
|
|
140
158
|
readonly receipt: z.ZodUnknown;
|
|
141
159
|
};
|
|
160
|
+
readonly haven_open_task_budget: {
|
|
161
|
+
readonly max_amount_human: z.ZodString;
|
|
162
|
+
readonly ttl_minutes: z.ZodNumber;
|
|
163
|
+
readonly recipient: z.ZodOptional<z.ZodString>;
|
|
164
|
+
readonly label: z.ZodOptional<z.ZodString>;
|
|
165
|
+
readonly token: z.ZodOptional<z.ZodString>;
|
|
166
|
+
};
|
|
167
|
+
readonly haven_close_task_budget: {
|
|
168
|
+
readonly task_budget_id: z.ZodString;
|
|
169
|
+
};
|
|
170
|
+
readonly haven_submit: {
|
|
171
|
+
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
172
|
+
readonly payment_id: z.ZodOptional<z.ZodString>;
|
|
173
|
+
readonly signature: z.ZodString;
|
|
174
|
+
};
|
|
142
175
|
};
|
|
143
176
|
/**
|
|
144
177
|
* MCP tool descriptions, composed from the shared semantic source in
|
|
@@ -162,7 +195,9 @@ interface ToolSuccess<T> {
|
|
|
162
195
|
/**
|
|
163
196
|
* #3303: the backend's `client_update` hint when this package is behind the
|
|
164
197
|
* version the deployment recommends (`required: false`) or below its
|
|
165
|
-
* minimum (`required: true`).
|
|
198
|
+
* minimum (`required: true`). `upgrade_command` starts the update: for the
|
|
199
|
+
* connector-installed packages it is the connector doctor, which prints the
|
|
200
|
+
* repair line to run next (#3412).
|
|
166
201
|
*/
|
|
167
202
|
client_update?: HavenClientUpdate;
|
|
168
203
|
}
|
|
@@ -254,6 +289,20 @@ interface ConsentInput {
|
|
|
254
289
|
/** Chain the agent operates on. */
|
|
255
290
|
chainId?: number;
|
|
256
291
|
toolNames: readonly HavenMcpToolName[];
|
|
292
|
+
/**
|
|
293
|
+
* #3410: every amount here is ATOMIC (smallest on-chain units, e.g. 6
|
|
294
|
+
* decimals for USDC — `1000000` is one USDC, never "1000000 tokens"). Both
|
|
295
|
+
* producers agree: the live read takes `onchain.amount`, and the seed takes
|
|
296
|
+
* the credential file's `allowance_amount` — both atomic. `renderConsentBlock`
|
|
297
|
+
* converts for display through the token registry and falls back to an
|
|
298
|
+
* explicit `(atomic units)` label when the token is unknown; the consent
|
|
299
|
+
* hash deliberately covers the atomic string, so a display change alone
|
|
300
|
+
* never re-prompts the operator.
|
|
301
|
+
*
|
|
302
|
+
* Known limitation (#3410, stated not fixed): the seed is setup-time data.
|
|
303
|
+
* If the wallet owner edits the budget after setup AND the live read then
|
|
304
|
+
* fails, the screen shows the stale seed budget as if it were current.
|
|
305
|
+
*/
|
|
257
306
|
allowanceSummary: readonly {
|
|
258
307
|
token: string;
|
|
259
308
|
amount: string;
|
|
@@ -294,7 +343,12 @@ interface CredentialIdentitySeed {
|
|
|
294
343
|
delegateAddress?: string;
|
|
295
344
|
/** Chain from the credential file, used as a fallback. */
|
|
296
345
|
chainId?: number;
|
|
297
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* Intended agent budget from the setup flow, used before on-chain approval
|
|
348
|
+
* is visible. #3410: every amount is ATOMIC — the connector writes the
|
|
349
|
+
* credential file's `allowance_amount` straight from the setup response's
|
|
350
|
+
* `agent_budget`, and the backend puts `budget_atomic` there.
|
|
351
|
+
*/
|
|
298
352
|
allowanceSummary?: readonly {
|
|
299
353
|
token: string;
|
|
300
354
|
amount: string;
|
|
@@ -353,7 +407,7 @@ declare function createHavenMcpServer(options?: HavenMcpServerOptions): Promise<
|
|
|
353
407
|
* `agent_tool_invocations` rows are always attributed to the right tool.
|
|
354
408
|
*/
|
|
355
409
|
declare const MCP_NAME = "@haven_ai/mcp";
|
|
356
|
-
declare const MCP_VERSION = "0.
|
|
410
|
+
declare const MCP_VERSION = "0.7.0-alpha.0";
|
|
357
411
|
/**
|
|
358
412
|
* Refuse to start on an unsupported Node (#1161).
|
|
359
413
|
*
|
|
@@ -366,4 +420,39 @@ declare const MCP_VERSION = "0.5.0-alpha.1";
|
|
|
366
420
|
declare function assertSupportedNodeVersion(nodeVersion?: string): void;
|
|
367
421
|
declare function runStdioServer(options?: HavenMcpServerOptions): Promise<void>;
|
|
368
422
|
|
|
369
|
-
|
|
423
|
+
/**
|
|
424
|
+
* The first `@haven_ai/signer` release whose `haven_sign` accepts the
|
|
425
|
+
* `task_budget_id` argument form (#3329). ONE constant on this surface, with
|
|
426
|
+
* exactly one job: the value `signer_compatibility.min_signer_version`
|
|
427
|
+
* reports on the two task-budget handoffs below. The hosted package exports
|
|
428
|
+
* `TASK_BUDGET_MIN_SIGNER_VERSION` with the same value, tied to the same
|
|
429
|
+
* release record (`client-releases.data.ts`) by its cross-package pin.
|
|
430
|
+
*/
|
|
431
|
+
declare const TASK_BUDGET_MIN_SIGNER_VERSION = "0.6.0-alpha.0";
|
|
432
|
+
/** The capability key both runtimes report in `signer_compatibility.signer_capability`. */
|
|
433
|
+
declare const SIGNER_CAPABILITY_KEY = "haven/signer-compatibility";
|
|
434
|
+
/**
|
|
435
|
+
* The recovery notice every result that hands off to
|
|
436
|
+
* `haven_sign { task_budget_id }` carries — the local twin of the hosted
|
|
437
|
+
* `taskSignerCompatibilityNotice()`. Field-for-field the same shape:
|
|
438
|
+
*
|
|
439
|
+
* - `task_sign_context_version` — from the SDK's single source;
|
|
440
|
+
* - `min_signer_version` — the constant above;
|
|
441
|
+
* - `signer_capability` — the existing capability key;
|
|
442
|
+
* - `check` / `fallback` — the recovery sentence as prose and as data: the
|
|
443
|
+
* trigger substring (the generic refusal every pre-0.6.0 signer answers,
|
|
444
|
+
* both historic lines begin with it), then close the pending budget, update
|
|
445
|
+
* via the connector doctor and its printed repair line, reopen. No relay
|
|
446
|
+
* fallback exists for this signing context (an `eip712_delegation` payload
|
|
447
|
+
* the 0.5.x unbound allowlist refuses and a 0.4.x signer must not be
|
|
448
|
+
* steered into), so none is named.
|
|
449
|
+
*/
|
|
450
|
+
declare function taskSignerCompatibilityNotice(): {
|
|
451
|
+
task_sign_context_version: number;
|
|
452
|
+
min_signer_version: string;
|
|
453
|
+
signer_capability: string;
|
|
454
|
+
check: string;
|
|
455
|
+
fallback: string;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
export { type ConsentDecision, type ConsentInput, type ConsentOptions, type CredentialIdentitySeed, type HavenCredentialAllowance, type HavenCredentialFile, type HavenCredentialSource, type HavenMcpServerOptions, type HavenMcpToolName, MCP_NAME, MCP_VERSION, SIGNER_CAPABILITY_KEY, TASK_BUDGET_MIN_SIGNER_VERSION, type ToolFailure, type ToolPayload, type ToolSuccess, assertSupportedNodeVersion, computeConsentHash, consentInputFromClient, createHavenClient, createHavenMcpServer, createToolHandlers, ensureConsent, loadCredentials, registeredToolNames, renderConsentBlock, resolveHavenClient, runStdioServer, taskSignerCompatibilityNotice, toolDescriptions, toolSchemas };
|
package/dist/index.d.ts
CHANGED
|
@@ -66,22 +66,30 @@ declare function loadCredentials(source?: string | HavenCredentialSource | undef
|
|
|
66
66
|
* which is where URL-hardening would matter.)
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
|
-
type HavenMcpToolName = 'haven_send' | 'haven_pay_mcp_tool' | 'haven_quote_x402' | 'haven_pay_x402_quote' | 'haven_pay_x402' | 'haven_resume_x402_payment' | 'haven_get_payment_status' | 'haven_get_resume_state' | 'haven_get_agent' | 'haven_get_allowances' | 'haven_list_receipts' | 'haven_verify_receipt' | 'haven_sweep_delegate' | 'haven_discover_tools' | 'haven_submit_catalog_entry';
|
|
69
|
+
type HavenMcpToolName = 'haven_send' | 'haven_pay_mcp_tool' | 'haven_quote_x402' | 'haven_pay_x402_quote' | 'haven_pay_x402' | 'haven_resume_x402_payment' | 'haven_get_payment_status' | 'haven_get_resume_state' | 'haven_get_agent' | 'haven_get_allowances' | 'haven_list_receipts' | 'haven_verify_receipt' | 'haven_sweep_delegate' | 'haven_discover_tools' | 'haven_submit_catalog_entry' | 'haven_open_task_budget' | 'haven_close_task_budget' | 'haven_submit';
|
|
70
70
|
declare const toolSchemas: {
|
|
71
71
|
readonly haven_send: {
|
|
72
72
|
readonly asset: z.ZodEnum<["ETH", "USDC"]>;
|
|
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
|
+
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
79
|
+
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
80
|
+
/**
|
|
81
|
+
* #3330: spend against an open sub-budget this agent HOLDS (it is the
|
|
82
|
+
* sub-agent B) instead of the agent's own budget. Mutually exclusive
|
|
83
|
+
* with task_budget_id — the backend refuses a body naming both.
|
|
84
|
+
*/
|
|
85
|
+
readonly sub_budget_id: z.ZodOptional<z.ZodString>;
|
|
78
86
|
};
|
|
79
87
|
readonly haven_pay_mcp_tool: {
|
|
80
88
|
readonly merchant_url: z.ZodString;
|
|
81
89
|
readonly tool_name: z.ZodString;
|
|
82
90
|
readonly arguments: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
83
91
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
84
|
-
/**
|
|
92
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
85
93
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
86
94
|
};
|
|
87
95
|
readonly haven_quote_x402: {
|
|
@@ -90,14 +98,18 @@ declare const toolSchemas: {
|
|
|
90
98
|
readonly headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
91
99
|
readonly body: z.ZodOptional<z.ZodString>;
|
|
92
100
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
93
|
-
/**
|
|
101
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
94
102
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
95
103
|
};
|
|
96
104
|
readonly haven_pay_x402_quote: {
|
|
97
105
|
readonly quote: z.ZodUnknown;
|
|
98
106
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
99
|
-
/**
|
|
107
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
100
108
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
109
|
+
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
110
|
+
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
111
|
+
/** #3330: spend against an open sub-budget this agent holds (it is sub-agent B). Mutually exclusive with task_budget_id. */
|
|
112
|
+
readonly sub_budget_id: z.ZodOptional<z.ZodString>;
|
|
101
113
|
};
|
|
102
114
|
readonly haven_pay_x402: {
|
|
103
115
|
readonly url: z.ZodString;
|
|
@@ -105,8 +117,12 @@ declare const toolSchemas: {
|
|
|
105
117
|
readonly headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
106
118
|
readonly body: z.ZodOptional<z.ZodString>;
|
|
107
119
|
readonly idempotency_key: z.ZodOptional<z.ZodString>;
|
|
108
|
-
/**
|
|
120
|
+
/** REMOVED (#3411): declared only so the resolver can refuse it by name, never accepted. */
|
|
109
121
|
readonly idempotencyKey: z.ZodOptional<z.ZodString>;
|
|
122
|
+
/** #3329: spend against an open task budget instead of the agent's period budget. */
|
|
123
|
+
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
124
|
+
/** #3330: spend against an open sub-budget this agent holds (it is sub-agent B). Mutually exclusive with task_budget_id. */
|
|
125
|
+
readonly sub_budget_id: z.ZodOptional<z.ZodString>;
|
|
110
126
|
};
|
|
111
127
|
readonly haven_resume_x402_payment: {
|
|
112
128
|
readonly payment_id: z.ZodOptional<z.ZodString>;
|
|
@@ -135,10 +151,27 @@ declare const toolSchemas: {
|
|
|
135
151
|
readonly limit: z.ZodOptional<z.ZodNumber>;
|
|
136
152
|
/** #3128: the previous page's next_cursor (a receipt id). */
|
|
137
153
|
readonly cursor: z.ZodOptional<z.ZodString>;
|
|
154
|
+
/** #3423: drop each row's payload echoes; the default shape is unchanged. */
|
|
155
|
+
readonly compact: z.ZodOptional<z.ZodBoolean>;
|
|
138
156
|
};
|
|
139
157
|
readonly haven_verify_receipt: {
|
|
140
158
|
readonly receipt: z.ZodUnknown;
|
|
141
159
|
};
|
|
160
|
+
readonly haven_open_task_budget: {
|
|
161
|
+
readonly max_amount_human: z.ZodString;
|
|
162
|
+
readonly ttl_minutes: z.ZodNumber;
|
|
163
|
+
readonly recipient: z.ZodOptional<z.ZodString>;
|
|
164
|
+
readonly label: z.ZodOptional<z.ZodString>;
|
|
165
|
+
readonly token: z.ZodOptional<z.ZodString>;
|
|
166
|
+
};
|
|
167
|
+
readonly haven_close_task_budget: {
|
|
168
|
+
readonly task_budget_id: z.ZodString;
|
|
169
|
+
};
|
|
170
|
+
readonly haven_submit: {
|
|
171
|
+
readonly task_budget_id: z.ZodOptional<z.ZodString>;
|
|
172
|
+
readonly payment_id: z.ZodOptional<z.ZodString>;
|
|
173
|
+
readonly signature: z.ZodString;
|
|
174
|
+
};
|
|
142
175
|
};
|
|
143
176
|
/**
|
|
144
177
|
* MCP tool descriptions, composed from the shared semantic source in
|
|
@@ -162,7 +195,9 @@ interface ToolSuccess<T> {
|
|
|
162
195
|
/**
|
|
163
196
|
* #3303: the backend's `client_update` hint when this package is behind the
|
|
164
197
|
* version the deployment recommends (`required: false`) or below its
|
|
165
|
-
* minimum (`required: true`).
|
|
198
|
+
* minimum (`required: true`). `upgrade_command` starts the update: for the
|
|
199
|
+
* connector-installed packages it is the connector doctor, which prints the
|
|
200
|
+
* repair line to run next (#3412).
|
|
166
201
|
*/
|
|
167
202
|
client_update?: HavenClientUpdate;
|
|
168
203
|
}
|
|
@@ -254,6 +289,20 @@ interface ConsentInput {
|
|
|
254
289
|
/** Chain the agent operates on. */
|
|
255
290
|
chainId?: number;
|
|
256
291
|
toolNames: readonly HavenMcpToolName[];
|
|
292
|
+
/**
|
|
293
|
+
* #3410: every amount here is ATOMIC (smallest on-chain units, e.g. 6
|
|
294
|
+
* decimals for USDC — `1000000` is one USDC, never "1000000 tokens"). Both
|
|
295
|
+
* producers agree: the live read takes `onchain.amount`, and the seed takes
|
|
296
|
+
* the credential file's `allowance_amount` — both atomic. `renderConsentBlock`
|
|
297
|
+
* converts for display through the token registry and falls back to an
|
|
298
|
+
* explicit `(atomic units)` label when the token is unknown; the consent
|
|
299
|
+
* hash deliberately covers the atomic string, so a display change alone
|
|
300
|
+
* never re-prompts the operator.
|
|
301
|
+
*
|
|
302
|
+
* Known limitation (#3410, stated not fixed): the seed is setup-time data.
|
|
303
|
+
* If the wallet owner edits the budget after setup AND the live read then
|
|
304
|
+
* fails, the screen shows the stale seed budget as if it were current.
|
|
305
|
+
*/
|
|
257
306
|
allowanceSummary: readonly {
|
|
258
307
|
token: string;
|
|
259
308
|
amount: string;
|
|
@@ -294,7 +343,12 @@ interface CredentialIdentitySeed {
|
|
|
294
343
|
delegateAddress?: string;
|
|
295
344
|
/** Chain from the credential file, used as a fallback. */
|
|
296
345
|
chainId?: number;
|
|
297
|
-
/**
|
|
346
|
+
/**
|
|
347
|
+
* Intended agent budget from the setup flow, used before on-chain approval
|
|
348
|
+
* is visible. #3410: every amount is ATOMIC — the connector writes the
|
|
349
|
+
* credential file's `allowance_amount` straight from the setup response's
|
|
350
|
+
* `agent_budget`, and the backend puts `budget_atomic` there.
|
|
351
|
+
*/
|
|
298
352
|
allowanceSummary?: readonly {
|
|
299
353
|
token: string;
|
|
300
354
|
amount: string;
|
|
@@ -353,7 +407,7 @@ declare function createHavenMcpServer(options?: HavenMcpServerOptions): Promise<
|
|
|
353
407
|
* `agent_tool_invocations` rows are always attributed to the right tool.
|
|
354
408
|
*/
|
|
355
409
|
declare const MCP_NAME = "@haven_ai/mcp";
|
|
356
|
-
declare const MCP_VERSION = "0.
|
|
410
|
+
declare const MCP_VERSION = "0.7.0-alpha.0";
|
|
357
411
|
/**
|
|
358
412
|
* Refuse to start on an unsupported Node (#1161).
|
|
359
413
|
*
|
|
@@ -366,4 +420,39 @@ declare const MCP_VERSION = "0.5.0-alpha.1";
|
|
|
366
420
|
declare function assertSupportedNodeVersion(nodeVersion?: string): void;
|
|
367
421
|
declare function runStdioServer(options?: HavenMcpServerOptions): Promise<void>;
|
|
368
422
|
|
|
369
|
-
|
|
423
|
+
/**
|
|
424
|
+
* The first `@haven_ai/signer` release whose `haven_sign` accepts the
|
|
425
|
+
* `task_budget_id` argument form (#3329). ONE constant on this surface, with
|
|
426
|
+
* exactly one job: the value `signer_compatibility.min_signer_version`
|
|
427
|
+
* reports on the two task-budget handoffs below. The hosted package exports
|
|
428
|
+
* `TASK_BUDGET_MIN_SIGNER_VERSION` with the same value, tied to the same
|
|
429
|
+
* release record (`client-releases.data.ts`) by its cross-package pin.
|
|
430
|
+
*/
|
|
431
|
+
declare const TASK_BUDGET_MIN_SIGNER_VERSION = "0.6.0-alpha.0";
|
|
432
|
+
/** The capability key both runtimes report in `signer_compatibility.signer_capability`. */
|
|
433
|
+
declare const SIGNER_CAPABILITY_KEY = "haven/signer-compatibility";
|
|
434
|
+
/**
|
|
435
|
+
* The recovery notice every result that hands off to
|
|
436
|
+
* `haven_sign { task_budget_id }` carries — the local twin of the hosted
|
|
437
|
+
* `taskSignerCompatibilityNotice()`. Field-for-field the same shape:
|
|
438
|
+
*
|
|
439
|
+
* - `task_sign_context_version` — from the SDK's single source;
|
|
440
|
+
* - `min_signer_version` — the constant above;
|
|
441
|
+
* - `signer_capability` — the existing capability key;
|
|
442
|
+
* - `check` / `fallback` — the recovery sentence as prose and as data: the
|
|
443
|
+
* trigger substring (the generic refusal every pre-0.6.0 signer answers,
|
|
444
|
+
* both historic lines begin with it), then close the pending budget, update
|
|
445
|
+
* via the connector doctor and its printed repair line, reopen. No relay
|
|
446
|
+
* fallback exists for this signing context (an `eip712_delegation` payload
|
|
447
|
+
* the 0.5.x unbound allowlist refuses and a 0.4.x signer must not be
|
|
448
|
+
* steered into), so none is named.
|
|
449
|
+
*/
|
|
450
|
+
declare function taskSignerCompatibilityNotice(): {
|
|
451
|
+
task_sign_context_version: number;
|
|
452
|
+
min_signer_version: string;
|
|
453
|
+
signer_capability: string;
|
|
454
|
+
check: string;
|
|
455
|
+
fallback: string;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
export { type ConsentDecision, type ConsentInput, type ConsentOptions, type CredentialIdentitySeed, type HavenCredentialAllowance, type HavenCredentialFile, type HavenCredentialSource, type HavenMcpServerOptions, type HavenMcpToolName, MCP_NAME, MCP_VERSION, SIGNER_CAPABILITY_KEY, TASK_BUDGET_MIN_SIGNER_VERSION, type ToolFailure, type ToolPayload, type ToolSuccess, assertSupportedNodeVersion, computeConsentHash, consentInputFromClient, createHavenClient, createHavenMcpServer, createToolHandlers, ensureConsent, loadCredentials, registeredToolNames, renderConsentBlock, resolveHavenClient, runStdioServer, taskSignerCompatibilityNotice, toolDescriptions, toolSchemas };
|