@haven_ai/connect 0.0.0-dev.202610082107.41e4d64 → 0.0.0-dev.202610090650.85a0cf3

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 CHANGED
@@ -637,9 +637,9 @@ var init_runtime_manifest = __esm({
637
637
  mcpPackage: "@haven_ai/mcp",
638
638
  mcpVersion: mcp.MCP_VERSION,
639
639
  sdkPackage: "@haven_ai/sdk",
640
- sdkVersion: "0.0.0-dev.202610082107.41e4d64",
640
+ sdkVersion: "0.0.0-dev.202610090650.85a0cf3",
641
641
  signerPackage: "@haven_ai/signer",
642
- signerVersion: "0.0.0-dev.202610082107.41e4d64",
642
+ signerVersion: "0.0.0-dev.202610090650.85a0cf3",
643
643
  // Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
644
644
  // while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
645
645
  // so the guard that was supposed to enforce the floor waved Node v23 through
@@ -4142,6 +4142,20 @@ async function executeConnect(options, deps, trace) {
4142
4142
  ...Object.keys(retirementMirrorErrors).length > 0 ? { retirementMirrorErrors } : {},
4143
4143
  existingAgentsBeforeWrite: existingAgents.map((a) => ({ agent_id: a.agentId, account_address: a.accountAddress })),
4144
4144
  ...reboundFrom ? { serverNameReboundFrom: reboundFrom } : {},
4145
+ // #3772: only when the install completed. An install that ended with an
4146
+ // error code may not have written the wiring, and on --replace it leaves the
4147
+ // old agent's wiring as possibly the only working one (retirement is skipped
4148
+ // on the same condition) — so it gets no such sentence. That includes
4149
+ // manual_runtime_setup_required, deliberately: the connector wrote nothing
4150
+ // and the manual instruction already says to start a fresh session. A
4151
+ // --replace names every displaced agent even when no binding record exists
4152
+ // (pre-0.4.0 wiring, or a failed best-effort write).
4153
+ ...!runtimeInstall.errorCode && (replacing || reboundFrom) ? {
4154
+ staleSession: {
4155
+ agentIds: [.../* @__PURE__ */ new Set([...replacing?.superseded.map((entry) => entry.agentId) ?? [], ...reboundFrom ? [reboundFrom.agent_id] : []])],
4156
+ ...reboundFrom?.backend_changed ? { otherBackendAgentId: reboundFrom.agent_id } : {}
4157
+ }
4158
+ } : {},
4145
4159
  setupChallengeExpiresAt: setup.challenge.expires_at,
4146
4160
  approvalRequired: registration.agent_status === "pending_approval",
4147
4161
  approvalUrl: registration.approval_url
@@ -4157,6 +4171,10 @@ async function executeConnect(options, deps, trace) {
4157
4171
  outcome
4158
4172
  };
4159
4173
  }
4174
+ function staleSessionNotice(previousAgentIds, otherBackendAgentId) {
4175
+ const one = previousAgentIds.length === 1;
4176
+ return `Any session that was already running keeps acting as the previous agent${one ? "" : "s"} (${previousAgentIds.join(", ")}) until it is restarted, and ${one ? "that agent" : "they"} may still be active in Haven` + (otherBackendAgentId ? ` (${otherBackendAgentId} is on the backend it was created on, not this one)` : "") + `: if ${one ? "it" : "they"} should no longer spend, use Remove agent\u2026 on the Haven agent page (it ends ${one ? "its" : "their"} live budgets).`;
4177
+ }
4160
4178
  function completionOutcome(input) {
4161
4179
  const { runtimeInstall } = input;
4162
4180
  const manualSetup = runtimeInstall.errorCode === "manual_runtime_setup_required";
@@ -4174,7 +4192,10 @@ function completionOutcome(input) {
4174
4192
  probe: { result: runtimeInstall.probeResult },
4175
4193
  activation: {
4176
4194
  restart_required: runtimeInstall.restartRequired,
4177
- instruction: manualSetup ? "Finish the manual MCP setup using the secret-free references shown in normal Connect output, then start a fresh session." : runtimeProfile(runtimeInstall.runtime).activationInstruction
4195
+ instruction: (manualSetup ? "Finish the manual MCP setup using the secret-free references shown in normal Connect output, then start a fresh session." : runtimeProfile(runtimeInstall.runtime).activationInstruction) + // #3772: a rebind changes which agent the server name means, but a
4196
+ // session that is already running keeps the config it loaded — it
4197
+ // goes on acting as the previous agent, which Connect never revokes.
4198
+ (input.staleSession && input.staleSession.agentIds.length > 0 ? ` ${staleSessionNotice(input.staleSession.agentIds, input.staleSession.otherBackendAgentId)}` : "")
4178
4199
  },
4179
4200
  next_action: nextAction2,
4180
4201
  approval: {
@@ -4561,7 +4582,7 @@ var init_runtime = __esm({
4561
4582
  init_tombstone();
4562
4583
  init_local_mcp_runtime();
4563
4584
  init_runtime_manifest();
4564
- CONNECTOR_VERSION = "0.0.0-dev.202610082107.41e4d64";
4585
+ CONNECTOR_VERSION = "0.0.0-dev.202610090650.85a0cf3";
4565
4586
  PRODUCTION_CHAIN_ID = 8453;
4566
4587
  CONNECTOR_CLIENT_IDENTITY = `@haven_ai/connect/${CONNECTOR_VERSION}`;
4567
4588
  CONNECT_OUTCOME_SCHEMA_VERSION = 1;