@haven_ai/connect 0.1.37-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/index.d.cts CHANGED
@@ -170,7 +170,10 @@ interface AgentIdentity {
170
170
  id: string;
171
171
  name: string;
172
172
  status: string;
173
+ /** @deprecated #2908 — same value as `account_address`; the server drops it at #2914. */
173
174
  safe_address: string | null;
175
+ /** #2908 — the account-vocabulary twin (not emitted by every server yet; read first, never required). */
176
+ account_address?: string | null;
174
177
  delegate_address: string | null;
175
178
  chain_id: number | null;
176
179
  execution_rail: 'legacy' | 'delegation' | string;
@@ -204,7 +207,13 @@ interface WriteCredentialInput {
204
207
  apiKey: string;
205
208
  delegateKey: string;
206
209
  delegateAddress: string;
207
- safeAddress?: string;
210
+ /**
211
+ * The Haven account (smart account) address. Written to every credential
212
+ * file as `account_address` ONLY (#2908 — write the new name, never the
213
+ * old; the readers in `@haven_ai/signer` / `@haven_ai/mcp` fall back to the
214
+ * pre-#2908 `safe_address` permanently, so a file from either era loads).
215
+ */
216
+ accountAddress?: string;
208
217
  chainId?: number;
209
218
  network?: string;
210
219
  agentBudget?: Array<{
@@ -729,7 +738,7 @@ type WiringCollisionResolution = {
729
738
  action: 'abort';
730
739
  };
731
740
 
732
- declare const CONNECTOR_VERSION = "0.1.37-alpha.0";
741
+ declare const CONNECTOR_VERSION = "0.2.0-alpha.0";
733
742
  interface ConnectOptions {
734
743
  setupToken: string;
735
744
  apiBaseUrl: string;
@@ -1129,11 +1138,11 @@ declare function isConnectError(err: unknown): err is ConnectError;
1129
1138
 
1130
1139
  declare const MCP_RUNTIME_MANIFEST: {
1131
1140
  readonly mcpPackage: "@haven_ai/mcp";
1132
- readonly mcpVersion: "0.1.37-alpha.0";
1141
+ readonly mcpVersion: "0.2.0-alpha.0";
1133
1142
  readonly sdkPackage: "@haven_ai/sdk";
1134
- readonly sdkVersion: "0.1.37-alpha.0";
1143
+ readonly sdkVersion: "0.2.0-alpha.0";
1135
1144
  readonly signerPackage: "@haven_ai/signer";
1136
- readonly signerVersion: "0.1.37-alpha.0";
1145
+ readonly signerVersion: "0.2.0-alpha.0";
1137
1146
  readonly minimumNodeVersion: "22.0.0";
1138
1147
  readonly supportedClients: readonly ["codex-cli", "codex-desktop", "claude-code"];
1139
1148
  readonly requiredTools: readonly string[];
package/dist/index.d.ts CHANGED
@@ -170,7 +170,10 @@ interface AgentIdentity {
170
170
  id: string;
171
171
  name: string;
172
172
  status: string;
173
+ /** @deprecated #2908 — same value as `account_address`; the server drops it at #2914. */
173
174
  safe_address: string | null;
175
+ /** #2908 — the account-vocabulary twin (not emitted by every server yet; read first, never required). */
176
+ account_address?: string | null;
174
177
  delegate_address: string | null;
175
178
  chain_id: number | null;
176
179
  execution_rail: 'legacy' | 'delegation' | string;
@@ -204,7 +207,13 @@ interface WriteCredentialInput {
204
207
  apiKey: string;
205
208
  delegateKey: string;
206
209
  delegateAddress: string;
207
- safeAddress?: string;
210
+ /**
211
+ * The Haven account (smart account) address. Written to every credential
212
+ * file as `account_address` ONLY (#2908 — write the new name, never the
213
+ * old; the readers in `@haven_ai/signer` / `@haven_ai/mcp` fall back to the
214
+ * pre-#2908 `safe_address` permanently, so a file from either era loads).
215
+ */
216
+ accountAddress?: string;
208
217
  chainId?: number;
209
218
  network?: string;
210
219
  agentBudget?: Array<{
@@ -729,7 +738,7 @@ type WiringCollisionResolution = {
729
738
  action: 'abort';
730
739
  };
731
740
 
732
- declare const CONNECTOR_VERSION = "0.1.37-alpha.0";
741
+ declare const CONNECTOR_VERSION = "0.2.0-alpha.0";
733
742
  interface ConnectOptions {
734
743
  setupToken: string;
735
744
  apiBaseUrl: string;
@@ -1129,11 +1138,11 @@ declare function isConnectError(err: unknown): err is ConnectError;
1129
1138
 
1130
1139
  declare const MCP_RUNTIME_MANIFEST: {
1131
1140
  readonly mcpPackage: "@haven_ai/mcp";
1132
- readonly mcpVersion: "0.1.37-alpha.0";
1141
+ readonly mcpVersion: "0.2.0-alpha.0";
1133
1142
  readonly sdkPackage: "@haven_ai/sdk";
1134
- readonly sdkVersion: "0.1.37-alpha.0";
1143
+ readonly sdkVersion: "0.2.0-alpha.0";
1135
1144
  readonly signerPackage: "@haven_ai/signer";
1136
- readonly signerVersion: "0.1.37-alpha.0";
1145
+ readonly signerVersion: "0.2.0-alpha.0";
1137
1146
  readonly minimumNodeVersion: "22.0.0";
1138
1147
  readonly supportedClients: readonly ["codex-cli", "codex-desktop", "claude-code"];
1139
1148
  readonly requiredTools: readonly string[];
package/dist/index.js CHANGED
@@ -266,7 +266,7 @@ function signerPayload(input) {
266
266
  delegate_key: input.delegateKey,
267
267
  delegate_address: input.delegateAddress,
268
268
  agent_id: input.agentId,
269
- safe_address: input.safeAddress,
269
+ account_address: input.accountAddress,
270
270
  chain_id: input.chainId,
271
271
  network: input.network,
272
272
  x402_binding_signer: input.x402BindingSigner,
@@ -277,7 +277,7 @@ function identityPayload(input) {
277
277
  return {
278
278
  api_key: input.apiKey,
279
279
  agent_id: input.agentId,
280
- safe_address: input.safeAddress,
280
+ account_address: input.accountAddress,
281
281
  chain_id: input.chainId,
282
282
  network: input.network,
283
283
  api_url: input.apiUrl,
@@ -290,7 +290,7 @@ function agentPayload(input) {
290
290
  return {
291
291
  agent_id: input.agentId,
292
292
  delegate_address: input.delegateAddress,
293
- safe_address: input.safeAddress,
293
+ account_address: input.accountAddress,
294
294
  chain_id: input.chainId,
295
295
  network: input.network,
296
296
  agent_budget: input.agentBudget,
@@ -324,13 +324,20 @@ async function readStoredCredentials(serverName, agentIdOrSlug, baseDir) {
324
324
  apiUrl,
325
325
  hostedMcpUrl,
326
326
  delegateAddress: asString(agent.delegate_address) ?? asString(signer.delegate_address),
327
- safeAddress: asString(identity.safe_address) ?? asString(agent.safe_address),
327
+ ...readStoredAccountAddress(identity, agent),
328
328
  chainId: typeof identity.chain_id === "number" ? identity.chain_id : void 0,
329
329
  network: asString(identity.network),
330
330
  x402BindingSigner: asString(signer.x402_binding_signer),
331
331
  agentBudget: Array.isArray(identity.agent_budget) ? identity.agent_budget : void 0
332
332
  };
333
333
  }
334
+ function readStoredAccountAddress(identity, agent) {
335
+ const fresh = asString(identity.account_address) ?? asString(agent.account_address);
336
+ if (fresh) return { accountAddress: fresh, accountAddressKey: "account_address" };
337
+ const legacy = asString(identity.safe_address) ?? asString(agent.safe_address);
338
+ if (legacy) return { accountAddress: legacy, accountAddressKey: "safe_address" };
339
+ return {};
340
+ }
334
341
  async function discoverSoleAgentDirectory(baseDir) {
335
342
  const root = defaultCredentialRoot(baseDir);
336
343
  let entries = [];
@@ -542,9 +549,9 @@ var init_runtime_manifest = __esm({
542
549
  mcpPackage: "@haven_ai/mcp",
543
550
  mcpVersion: MCP_VERSION,
544
551
  sdkPackage: "@haven_ai/sdk",
545
- sdkVersion: "0.1.37-alpha.0",
552
+ sdkVersion: "0.2.0-alpha.0",
546
553
  signerPackage: "@haven_ai/signer",
547
- signerVersion: "0.1.37-alpha.0",
554
+ signerVersion: "0.2.0-alpha.0",
548
555
  // Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
549
556
  // while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
550
557
  // so the guard that was supposed to enforce the floor waved Node v23 through
@@ -1432,7 +1439,7 @@ async function buildLocalMcpConsentInput(identityPath, signerPath) {
1432
1439
  apiKey: credentials.apiKey,
1433
1440
  apiUrl: credentials.apiUrl,
1434
1441
  agentId: credentials.agentId,
1435
- safeAddress: credentials.safeAddress,
1442
+ safeAddress: credentials.accountAddress ?? credentials.safeAddress,
1436
1443
  delegateAddress: credentials.delegateAddress,
1437
1444
  chainId: credentials.chainId,
1438
1445
  allowanceSummary: credentials.allowanceSummary
@@ -2474,7 +2481,7 @@ async function buildSignerConsentInput(signerPath) {
2474
2481
  });
2475
2482
  return {
2476
2483
  delegateAddress: signer.delegateAddress,
2477
- safeAddress: credentials.safeAddress,
2484
+ safeAddress: credentials.accountAddress ?? credentials.safeAddress,
2478
2485
  agentId: credentials.agentId,
2479
2486
  chainId: credentials.chainId,
2480
2487
  network: credentials.network,
@@ -3312,7 +3319,9 @@ async function finishRekey(options, deps = {}) {
3312
3319
  apiKey: options.newApiKey,
3313
3320
  delegateKey: pending.new_delegate_key,
3314
3321
  delegateAddress: pending.new_delegate_address,
3315
- safeAddress: stored.safeAddress ?? identity.safe_address ?? void 0,
3322
+ // #2908: the stored value (already new-name-first) wins; the hosted
3323
+ // identity's `account_address` twin before its deprecated `safe_address`.
3324
+ accountAddress: stored.accountAddress ?? identity.account_address ?? identity.safe_address ?? void 0,
3316
3325
  chainId: stored.chainId ?? identity.chain_id ?? void 0,
3317
3326
  network: stored.network,
3318
3327
  agentBudget: stored.agentBudget,
@@ -3498,6 +3507,7 @@ var init_rekey_restart = __esm({
3498
3507
  // src/doctor.ts
3499
3508
  var doctor_exports = {};
3500
3509
  __export(doctor_exports, {
3510
+ describeAccountAddressKey: () => describeAccountAddressKey,
3501
3511
  runDoctor: () => runDoctor,
3502
3512
  runRepair: () => runRepair
3503
3513
  });
@@ -3648,6 +3658,15 @@ async function readIdentity(directory) {
3648
3658
  return void 0;
3649
3659
  }
3650
3660
  }
3661
+ function describeAccountAddressKey(identity, signerFile) {
3662
+ const files = [identity, signerFile];
3663
+ const has = (key) => files.some((f) => typeof f?.[key] === "string" && f[key].trim() !== "");
3664
+ if (has("account_address")) return "account address stored as account_address";
3665
+ if (has("safe_address")) {
3666
+ return "account address stored under the pre-#2908 name safe_address \u2014 still read; the next --rekey or setup rewrites it as account_address";
3667
+ }
3668
+ return "no account address stored";
3669
+ }
3651
3670
  async function checksForAgent(entry, input, deps) {
3652
3671
  const { directory, identity, sidecar } = entry;
3653
3672
  const checks = [];
@@ -3664,7 +3683,7 @@ async function checksForAgent(entry, input, deps) {
3664
3683
  id: "credentials",
3665
3684
  label: "Agent credentials",
3666
3685
  ok: credentialsOk,
3667
- detail: credentialsOk ? `identity.json and signer.json parse (agent ${identity?.agent_id ?? "unknown"})` : "identity.json or signer.json is missing or unparseable.",
3686
+ 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.",
3668
3687
  ...credentialsOk ? {} : { repair: `Re-run the full setup with a fresh token: ${RERUN} --setup <token>.` }
3669
3688
  });
3670
3689
  if (!sidecar) {
@@ -4395,7 +4414,7 @@ async function pathExists2(path) {
4395
4414
  init_unwire();
4396
4415
  init_local_mcp_runtime();
4397
4416
  init_runtime_manifest();
4398
- var CONNECTOR_VERSION = "0.1.37-alpha.0";
4417
+ var CONNECTOR_VERSION = "0.2.0-alpha.0";
4399
4418
  var CONNECT_OUTCOME_SCHEMA_VERSION = 1;
4400
4419
  var failureOutcomesByError = /* @__PURE__ */ new WeakMap();
4401
4420
  function failureOutcomeFor(runtimeHint, error) {
@@ -4571,7 +4590,7 @@ async function executeConnect(options, deps, trace) {
4571
4590
  apiKey: localApiKey,
4572
4591
  delegateKey: localKey.privateKey,
4573
4592
  delegateAddress: localKey.address,
4574
- safeAddress: setup.haven_wallet.address,
4593
+ accountAddress: setup.haven_wallet.address,
4575
4594
  chainId: setup.haven_wallet.chain_id,
4576
4595
  network: setup.haven_wallet.network,
4577
4596
  agentBudget: setup.agent_budget.map((budget) => ({