@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.js CHANGED
@@ -267,7 +267,7 @@ function signerPayload(input) {
267
267
  delegate_key: input.delegateKey,
268
268
  delegate_address: input.delegateAddress,
269
269
  agent_id: input.agentId,
270
- safe_address: input.safeAddress,
270
+ account_address: input.accountAddress,
271
271
  chain_id: input.chainId,
272
272
  network: input.network,
273
273
  x402_binding_signer: input.x402BindingSigner,
@@ -278,7 +278,7 @@ function identityPayload(input) {
278
278
  return {
279
279
  api_key: input.apiKey,
280
280
  agent_id: input.agentId,
281
- safe_address: input.safeAddress,
281
+ account_address: input.accountAddress,
282
282
  chain_id: input.chainId,
283
283
  network: input.network,
284
284
  api_url: input.apiUrl,
@@ -291,7 +291,7 @@ function agentPayload(input) {
291
291
  return {
292
292
  agent_id: input.agentId,
293
293
  delegate_address: input.delegateAddress,
294
- safe_address: input.safeAddress,
294
+ account_address: input.accountAddress,
295
295
  chain_id: input.chainId,
296
296
  network: input.network,
297
297
  agent_budget: input.agentBudget,
@@ -325,13 +325,20 @@ async function readStoredCredentials(serverName, agentIdOrSlug, baseDir) {
325
325
  apiUrl,
326
326
  hostedMcpUrl,
327
327
  delegateAddress: asString(agent.delegate_address) ?? asString(signer.delegate_address),
328
- safeAddress: asString(identity.safe_address) ?? asString(agent.safe_address),
328
+ ...readStoredAccountAddress(identity, agent),
329
329
  chainId: typeof identity.chain_id === "number" ? identity.chain_id : void 0,
330
330
  network: asString(identity.network),
331
331
  x402BindingSigner: asString(signer.x402_binding_signer),
332
332
  agentBudget: Array.isArray(identity.agent_budget) ? identity.agent_budget : void 0
333
333
  };
334
334
  }
335
+ function readStoredAccountAddress(identity, agent) {
336
+ const fresh = asString(identity.account_address) ?? asString(agent.account_address);
337
+ if (fresh) return { accountAddress: fresh, accountAddressKey: "account_address" };
338
+ const legacy = asString(identity.safe_address) ?? asString(agent.safe_address);
339
+ if (legacy) return { accountAddress: legacy, accountAddressKey: "safe_address" };
340
+ return {};
341
+ }
335
342
  async function discoverSoleAgentDirectory(baseDir) {
336
343
  const root = defaultCredentialRoot(baseDir);
337
344
  let entries = [];
@@ -543,9 +550,9 @@ var init_runtime_manifest = __esm({
543
550
  mcpPackage: "@haven_ai/mcp",
544
551
  mcpVersion: MCP_VERSION,
545
552
  sdkPackage: "@haven_ai/sdk",
546
- sdkVersion: "0.1.36-alpha.0",
553
+ sdkVersion: "0.2.0-alpha.0",
547
554
  signerPackage: "@haven_ai/signer",
548
- signerVersion: "0.1.36-alpha.0",
555
+ signerVersion: "0.2.0-alpha.0",
549
556
  // Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
550
557
  // while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
551
558
  // so the guard that was supposed to enforce the floor waved Node v23 through
@@ -1433,7 +1440,7 @@ async function buildLocalMcpConsentInput(identityPath, signerPath) {
1433
1440
  apiKey: credentials.apiKey,
1434
1441
  apiUrl: credentials.apiUrl,
1435
1442
  agentId: credentials.agentId,
1436
- safeAddress: credentials.safeAddress,
1443
+ safeAddress: credentials.accountAddress ?? credentials.safeAddress,
1437
1444
  delegateAddress: credentials.delegateAddress,
1438
1445
  chainId: credentials.chainId,
1439
1446
  allowanceSummary: credentials.allowanceSummary
@@ -2475,7 +2482,7 @@ async function buildSignerConsentInput(signerPath) {
2475
2482
  });
2476
2483
  return {
2477
2484
  delegateAddress: signer.delegateAddress,
2478
- safeAddress: credentials.safeAddress,
2485
+ safeAddress: credentials.accountAddress ?? credentials.safeAddress,
2479
2486
  agentId: credentials.agentId,
2480
2487
  chainId: credentials.chainId,
2481
2488
  network: credentials.network,
@@ -3313,7 +3320,9 @@ async function finishRekey(options, deps = {}) {
3313
3320
  apiKey: options.newApiKey,
3314
3321
  delegateKey: pending.new_delegate_key,
3315
3322
  delegateAddress: pending.new_delegate_address,
3316
- safeAddress: stored.safeAddress ?? identity.safe_address ?? void 0,
3323
+ // #2908: the stored value (already new-name-first) wins; the hosted
3324
+ // identity's `account_address` twin before its deprecated `safe_address`.
3325
+ accountAddress: stored.accountAddress ?? identity.account_address ?? identity.safe_address ?? void 0,
3317
3326
  chainId: stored.chainId ?? identity.chain_id ?? void 0,
3318
3327
  network: stored.network,
3319
3328
  agentBudget: stored.agentBudget,
@@ -3499,6 +3508,7 @@ var init_rekey_restart = __esm({
3499
3508
  // src/doctor.ts
3500
3509
  var doctor_exports = {};
3501
3510
  __export(doctor_exports, {
3511
+ describeAccountAddressKey: () => describeAccountAddressKey,
3502
3512
  runDoctor: () => runDoctor,
3503
3513
  runRepair: () => runRepair
3504
3514
  });
@@ -3649,6 +3659,15 @@ async function readIdentity(directory) {
3649
3659
  return void 0;
3650
3660
  }
3651
3661
  }
3662
+ function describeAccountAddressKey(identity, signerFile) {
3663
+ const files = [identity, signerFile];
3664
+ const has = (key) => files.some((f) => typeof f?.[key] === "string" && f[key].trim() !== "");
3665
+ if (has("account_address")) return "account address stored as account_address";
3666
+ if (has("safe_address")) {
3667
+ return "account address stored under the pre-#2908 name safe_address \u2014 still read; the next --rekey or setup rewrites it as account_address";
3668
+ }
3669
+ return "no account address stored";
3670
+ }
3652
3671
  async function checksForAgent(entry, input, deps) {
3653
3672
  const { directory, identity, sidecar } = entry;
3654
3673
  const checks = [];
@@ -3665,7 +3684,7 @@ async function checksForAgent(entry, input, deps) {
3665
3684
  id: "credentials",
3666
3685
  label: "Agent credentials",
3667
3686
  ok: credentialsOk,
3668
- detail: credentialsOk ? `identity.json and signer.json parse (agent ${identity?.agent_id ?? "unknown"})` : "identity.json or signer.json is missing or unparseable.",
3687
+ 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.",
3669
3688
  ...credentialsOk ? {} : { repair: `Re-run the full setup with a fresh token: ${RERUN} --setup <token>.` }
3670
3689
  });
3671
3690
  if (!sidecar) {
@@ -4396,7 +4415,7 @@ async function pathExists2(path) {
4396
4415
  init_unwire();
4397
4416
  init_local_mcp_runtime();
4398
4417
  init_runtime_manifest();
4399
- var CONNECTOR_VERSION = "0.1.36-alpha.0";
4418
+ var CONNECTOR_VERSION = "0.2.0-alpha.0";
4400
4419
  var CONNECT_OUTCOME_SCHEMA_VERSION = 1;
4401
4420
  var failureOutcomesByError = /* @__PURE__ */ new WeakMap();
4402
4421
  function failureOutcomeFor(runtimeHint, error) {
@@ -4572,7 +4591,7 @@ async function executeConnect(options, deps, trace) {
4572
4591
  apiKey: localApiKey,
4573
4592
  delegateKey: localKey.privateKey,
4574
4593
  delegateAddress: localKey.address,
4575
- safeAddress: setup.haven_wallet.address,
4594
+ accountAddress: setup.haven_wallet.address,
4576
4595
  chainId: setup.haven_wallet.chain_id,
4577
4596
  network: setup.haven_wallet.network,
4578
4597
  agentBudget: setup.agent_budget.map((budget) => ({