@haven_ai/connect 0.1.36-alpha.0 → 0.2.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/dist/cli.cjs +31 -12
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +31 -12
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +31 -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 +31 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -273,7 +273,7 @@ function signerPayload(input) {
|
|
|
273
273
|
delegate_key: input.delegateKey,
|
|
274
274
|
delegate_address: input.delegateAddress,
|
|
275
275
|
agent_id: input.agentId,
|
|
276
|
-
|
|
276
|
+
account_address: input.accountAddress,
|
|
277
277
|
chain_id: input.chainId,
|
|
278
278
|
network: input.network,
|
|
279
279
|
x402_binding_signer: input.x402BindingSigner,
|
|
@@ -284,7 +284,7 @@ function identityPayload(input) {
|
|
|
284
284
|
return {
|
|
285
285
|
api_key: input.apiKey,
|
|
286
286
|
agent_id: input.agentId,
|
|
287
|
-
|
|
287
|
+
account_address: input.accountAddress,
|
|
288
288
|
chain_id: input.chainId,
|
|
289
289
|
network: input.network,
|
|
290
290
|
api_url: input.apiUrl,
|
|
@@ -297,7 +297,7 @@ function agentPayload(input) {
|
|
|
297
297
|
return {
|
|
298
298
|
agent_id: input.agentId,
|
|
299
299
|
delegate_address: input.delegateAddress,
|
|
300
|
-
|
|
300
|
+
account_address: input.accountAddress,
|
|
301
301
|
chain_id: input.chainId,
|
|
302
302
|
network: input.network,
|
|
303
303
|
agent_budget: input.agentBudget,
|
|
@@ -331,13 +331,20 @@ async function readStoredCredentials(serverName, agentIdOrSlug, baseDir) {
|
|
|
331
331
|
apiUrl,
|
|
332
332
|
hostedMcpUrl,
|
|
333
333
|
delegateAddress: asString(agent.delegate_address) ?? asString(signer.delegate_address),
|
|
334
|
-
|
|
334
|
+
...readStoredAccountAddress(identity, agent),
|
|
335
335
|
chainId: typeof identity.chain_id === "number" ? identity.chain_id : void 0,
|
|
336
336
|
network: asString(identity.network),
|
|
337
337
|
x402BindingSigner: asString(signer.x402_binding_signer),
|
|
338
338
|
agentBudget: Array.isArray(identity.agent_budget) ? identity.agent_budget : void 0
|
|
339
339
|
};
|
|
340
340
|
}
|
|
341
|
+
function readStoredAccountAddress(identity, agent) {
|
|
342
|
+
const fresh = asString(identity.account_address) ?? asString(agent.account_address);
|
|
343
|
+
if (fresh) return { accountAddress: fresh, accountAddressKey: "account_address" };
|
|
344
|
+
const legacy = asString(identity.safe_address) ?? asString(agent.safe_address);
|
|
345
|
+
if (legacy) return { accountAddress: legacy, accountAddressKey: "safe_address" };
|
|
346
|
+
return {};
|
|
347
|
+
}
|
|
341
348
|
async function discoverSoleAgentDirectory(baseDir) {
|
|
342
349
|
const root = defaultCredentialRoot(baseDir);
|
|
343
350
|
let entries = [];
|
|
@@ -549,9 +556,9 @@ var init_runtime_manifest = __esm({
|
|
|
549
556
|
mcpPackage: "@haven_ai/mcp",
|
|
550
557
|
mcpVersion: mcp.MCP_VERSION,
|
|
551
558
|
sdkPackage: "@haven_ai/sdk",
|
|
552
|
-
sdkVersion: "0.
|
|
559
|
+
sdkVersion: "0.2.0-alpha.0",
|
|
553
560
|
signerPackage: "@haven_ai/signer",
|
|
554
|
-
signerVersion: "0.
|
|
561
|
+
signerVersion: "0.2.0-alpha.0",
|
|
555
562
|
// Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
|
|
556
563
|
// while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
|
|
557
564
|
// so the guard that was supposed to enforce the floor waved Node v23 through
|
|
@@ -1439,7 +1446,7 @@ async function buildLocalMcpConsentInput(identityPath, signerPath) {
|
|
|
1439
1446
|
apiKey: credentials.apiKey,
|
|
1440
1447
|
apiUrl: credentials.apiUrl,
|
|
1441
1448
|
agentId: credentials.agentId,
|
|
1442
|
-
safeAddress: credentials.safeAddress,
|
|
1449
|
+
safeAddress: credentials.accountAddress ?? credentials.safeAddress,
|
|
1443
1450
|
delegateAddress: credentials.delegateAddress,
|
|
1444
1451
|
chainId: credentials.chainId,
|
|
1445
1452
|
allowanceSummary: credentials.allowanceSummary
|
|
@@ -2481,7 +2488,7 @@ async function buildSignerConsentInput(signerPath) {
|
|
|
2481
2488
|
});
|
|
2482
2489
|
return {
|
|
2483
2490
|
delegateAddress: signer$1.delegateAddress,
|
|
2484
|
-
safeAddress: credentials.safeAddress,
|
|
2491
|
+
safeAddress: credentials.accountAddress ?? credentials.safeAddress,
|
|
2485
2492
|
agentId: credentials.agentId,
|
|
2486
2493
|
chainId: credentials.chainId,
|
|
2487
2494
|
network: credentials.network,
|
|
@@ -3319,7 +3326,9 @@ async function finishRekey(options, deps = {}) {
|
|
|
3319
3326
|
apiKey: options.newApiKey,
|
|
3320
3327
|
delegateKey: pending.new_delegate_key,
|
|
3321
3328
|
delegateAddress: pending.new_delegate_address,
|
|
3322
|
-
|
|
3329
|
+
// #2908: the stored value (already new-name-first) wins; the hosted
|
|
3330
|
+
// identity's `account_address` twin before its deprecated `safe_address`.
|
|
3331
|
+
accountAddress: stored.accountAddress ?? identity.account_address ?? identity.safe_address ?? void 0,
|
|
3323
3332
|
chainId: stored.chainId ?? identity.chain_id ?? void 0,
|
|
3324
3333
|
network: stored.network,
|
|
3325
3334
|
agentBudget: stored.agentBudget,
|
|
@@ -3505,6 +3514,7 @@ var init_rekey_restart = __esm({
|
|
|
3505
3514
|
// src/doctor.ts
|
|
3506
3515
|
var doctor_exports = {};
|
|
3507
3516
|
__export(doctor_exports, {
|
|
3517
|
+
describeAccountAddressKey: () => describeAccountAddressKey,
|
|
3508
3518
|
runDoctor: () => runDoctor,
|
|
3509
3519
|
runRepair: () => runRepair
|
|
3510
3520
|
});
|
|
@@ -3655,6 +3665,15 @@ async function readIdentity(directory) {
|
|
|
3655
3665
|
return void 0;
|
|
3656
3666
|
}
|
|
3657
3667
|
}
|
|
3668
|
+
function describeAccountAddressKey(identity, signerFile) {
|
|
3669
|
+
const files = [identity, signerFile];
|
|
3670
|
+
const has = (key) => files.some((f) => typeof f?.[key] === "string" && f[key].trim() !== "");
|
|
3671
|
+
if (has("account_address")) return "account address stored as account_address";
|
|
3672
|
+
if (has("safe_address")) {
|
|
3673
|
+
return "account address stored under the pre-#2908 name safe_address \u2014 still read; the next --rekey or setup rewrites it as account_address";
|
|
3674
|
+
}
|
|
3675
|
+
return "no account address stored";
|
|
3676
|
+
}
|
|
3658
3677
|
async function checksForAgent(entry, input, deps) {
|
|
3659
3678
|
const { directory, identity, sidecar } = entry;
|
|
3660
3679
|
const checks = [];
|
|
@@ -3671,7 +3690,7 @@ async function checksForAgent(entry, input, deps) {
|
|
|
3671
3690
|
id: "credentials",
|
|
3672
3691
|
label: "Agent credentials",
|
|
3673
3692
|
ok: credentialsOk,
|
|
3674
|
-
detail: credentialsOk ? `identity.json and signer.json parse (agent ${identity?.agent_id ?? "unknown"})` : "identity.json or signer.json is missing or unparseable.",
|
|
3693
|
+
detail: credentialsOk ? `identity.json and signer.json parse (agent ${identity?.agent_id ?? "unknown"}; ${describeAccountAddressKey(identity, signerFile)})` : "identity.json or signer.json is missing or unparseable.",
|
|
3675
3694
|
...credentialsOk ? {} : { repair: `Re-run the full setup with a fresh token: ${RERUN} --setup <token>.` }
|
|
3676
3695
|
});
|
|
3677
3696
|
if (!sidecar) {
|
|
@@ -4402,7 +4421,7 @@ async function pathExists2(path) {
|
|
|
4402
4421
|
init_unwire();
|
|
4403
4422
|
init_local_mcp_runtime();
|
|
4404
4423
|
init_runtime_manifest();
|
|
4405
|
-
var CONNECTOR_VERSION = "0.
|
|
4424
|
+
var CONNECTOR_VERSION = "0.2.0-alpha.0";
|
|
4406
4425
|
var CONNECT_OUTCOME_SCHEMA_VERSION = 1;
|
|
4407
4426
|
var failureOutcomesByError = /* @__PURE__ */ new WeakMap();
|
|
4408
4427
|
function failureOutcomeFor(runtimeHint, error) {
|
|
@@ -4578,7 +4597,7 @@ async function executeConnect(options, deps, trace) {
|
|
|
4578
4597
|
apiKey: localApiKey,
|
|
4579
4598
|
delegateKey: localKey.privateKey,
|
|
4580
4599
|
delegateAddress: localKey.address,
|
|
4581
|
-
|
|
4600
|
+
accountAddress: setup.haven_wallet.address,
|
|
4582
4601
|
chainId: setup.haven_wallet.chain_id,
|
|
4583
4602
|
network: setup.haven_wallet.network,
|
|
4584
4603
|
agentBudget: setup.agent_budget.map((budget) => ({
|