@haven_ai/connect 0.2.0-alpha.0 → 0.3.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
@@ -550,9 +550,9 @@ var init_runtime_manifest = __esm({
550
550
  mcpPackage: "@haven_ai/mcp",
551
551
  mcpVersion: MCP_VERSION,
552
552
  sdkPackage: "@haven_ai/sdk",
553
- sdkVersion: "0.2.0-alpha.0",
553
+ sdkVersion: "0.3.0-alpha.0",
554
554
  signerPackage: "@haven_ai/signer",
555
- signerVersion: "0.2.0-alpha.0",
555
+ signerVersion: "0.3.0-alpha.0",
556
556
  // Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
557
557
  // while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
558
558
  // so the guard that was supposed to enforce the floor waved Node v23 through
@@ -1440,7 +1440,7 @@ async function buildLocalMcpConsentInput(identityPath, signerPath) {
1440
1440
  apiKey: credentials.apiKey,
1441
1441
  apiUrl: credentials.apiUrl,
1442
1442
  agentId: credentials.agentId,
1443
- safeAddress: credentials.accountAddress ?? credentials.safeAddress,
1443
+ accountAddress: credentials.accountAddress,
1444
1444
  delegateAddress: credentials.delegateAddress,
1445
1445
  chainId: credentials.chainId,
1446
1446
  allowanceSummary: credentials.allowanceSummary
@@ -2482,7 +2482,7 @@ async function buildSignerConsentInput(signerPath) {
2482
2482
  });
2483
2483
  return {
2484
2484
  delegateAddress: signer.delegateAddress,
2485
- safeAddress: credentials.accountAddress ?? credentials.safeAddress,
2485
+ accountAddress: credentials.accountAddress,
2486
2486
  agentId: credentials.agentId,
2487
2487
  chainId: credentials.chainId,
2488
2488
  network: credentials.network,
@@ -2658,7 +2658,7 @@ async function installRuntime(input, deps = {}) {
2658
2658
  (signerProbe === void 0 || signerProbe.status === "ok");
2659
2659
  const restartRequired = configResult.restartRequired || restartRequiredForRuntime(runtime, deps.env);
2660
2660
  const errorCode = configResult.errorCode ?? (configResult.runtimeMcpMode === "local_stdio" ? localMcpErrorCode(signerCredentialReady, localMcpConsent, localMcpProbe?.status) : hostedMcpErrorCode(configResult.hostedConfigured, hostedProbe.status) ?? signerConsentErrorCode(signerCredentialReady, signerConsent) ?? signerProbeErrorCode(signerProbe));
2661
- const hostedProbeMessages = configResult.hostedConfigured && hostedProbe.status !== "ok" ? [`Hosted Haven MCP probe failed: ${hostedProbe.status}.`] : configResult.hostedConfigured ? ["Verified hosted Haven MCP tools with a read-only handshake."] : [];
2661
+ const hostedProbeMessages = configResult.hostedConfigured && hostedProbe.status !== "ok" ? [`Hosted Haven MCP probe failed: ${hostedProbe.status}.`] : configResult.hostedConfigured ? ["Verified that the hosted Haven MCP tools endpoint responds to a read-only handshake."] : [];
2662
2662
  const signerProbeMessages = signerProbe ? signerProbe.status === "ok" ? ["Verified local Haven signer with a stdio handshake."] : [
2663
2663
  `Local Haven signer handshake failed: ${signerProbe.status}.`,
2664
2664
  `Re-run \`${connectorRerunCommand()}\` to repair the signer setup.`
@@ -3320,9 +3320,10 @@ async function finishRekey(options, deps = {}) {
3320
3320
  apiKey: options.newApiKey,
3321
3321
  delegateKey: pending.new_delegate_key,
3322
3322
  delegateAddress: pending.new_delegate_address,
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,
3323
+ // The stored value (already new-name-first, from the credential-FILE
3324
+ // permanent fallback) wins; the hosted identity's `account_address` is a
3325
+ // LIVE server read, which as of #2914 emits only that name.
3326
+ accountAddress: stored.accountAddress ?? identity.account_address ?? void 0,
3326
3327
  chainId: stored.chainId ?? identity.chain_id ?? void 0,
3327
3328
  network: stored.network,
3328
3329
  agentBudget: stored.agentBudget,
@@ -3708,14 +3709,17 @@ async function checksForAgent(entry, input, deps) {
3708
3709
  ...matches ? {} : { repair: `Run: ${RERUN} --doctor --repair --runtime ${input.runtime} with the same HAVEN_*_SPEC variables set.` }
3709
3710
  });
3710
3711
  } else {
3711
- const matches = await installedRuntimeMatches(sidecar.runtime_directory, sidecar.cli_path);
3712
+ const intact = await installedRuntimeMatchesVersions(sidecar.runtime_directory, sidecar.cli_path, {
3713
+ signerVersion: sidecar.signer_version,
3714
+ sdkVersion: sidecar.sdk_version
3715
+ });
3712
3716
  const versionOk = sidecar.signer_version === MCP_RUNTIME_MANIFEST.signerVersion;
3713
- const ok = matches && versionOk;
3717
+ const ok = intact && versionOk;
3714
3718
  checks.push({
3715
3719
  id: "signer_runtime",
3716
3720
  label: "Signer runtime (preinstalled wrapper)",
3717
3721
  ok,
3718
- detail: ok ? `Installed ${sidecar.signer_package}@${sidecar.signer_version} at ${sidecar.runtime_directory}` : matches ? `Installed version ${sidecar.signer_version} does not match the connector's pinned ${MCP_RUNTIME_MANIFEST.signerVersion}.` : `Runtime directory is stale or empty (${sidecar.runtime_directory}) \u2014 the CLI or package versions are missing.`,
3722
+ detail: ok ? `Installed ${sidecar.signer_package}@${sidecar.signer_version} at ${sidecar.runtime_directory}` : intact ? `Installed version ${sidecar.signer_version} does not match the connector's pinned ${MCP_RUNTIME_MANIFEST.signerVersion} \u2014 intact, but outdated.` : `Runtime directory is stale or empty (${sidecar.runtime_directory}) \u2014 the CLI or package versions are missing.`,
3719
3723
  ...ok ? {} : { repair: `Run: ${RERUN} --doctor --repair --runtime ${input.runtime}` }
3720
3724
  });
3721
3725
  }
@@ -3728,9 +3732,9 @@ async function checksForAgent(entry, input, deps) {
3728
3732
  id: "hosted_mcp",
3729
3733
  label: "Hosted Haven MCP",
3730
3734
  ok: probe.status === "ok",
3731
- detail: probe.status === "ok" ? `Reachable and authorized (${hostedUrl}).` : `Probe failed: ${probe.status} (${hostedUrl}).`,
3735
+ detail: probe.status === "ok" ? `MCP tools endpoint is reachable (${hostedUrl}).` : `MCP tools endpoint probe failed: ${probe.status} (${hostedUrl}).`,
3732
3736
  ...probe.status === "ok" ? {} : {
3733
- repair: probe.status === "unauthorized" ? `The stored API key was rejected \u2014 re-run the full setup with a fresh token: ${RERUN} --setup <token>.` : "Check network access to the hosted MCP URL, then re-run --doctor."
3737
+ repair: "Check network access and runtime configuration for the hosted MCP URL, then re-run --doctor."
3734
3738
  }
3735
3739
  });
3736
3740
  } else {
@@ -3964,14 +3968,17 @@ async function runDoctor(input, deps = {}) {
3964
3968
  const identity = await readIdentity(entry.directory);
3965
3969
  const tombstone = await readAgentTombstone(entry.directory);
3966
3970
  const otherAgent = entry.agentId ?? basename(entry.directory);
3967
- const otherUrl = identity?.hosted_mcp_url ?? (identity?.api_url ? `${identity.api_url}/mcp` : void 0);
3968
- if (!identity?.api_key || !otherUrl) {
3971
+ if (!identity?.api_key || !identity.api_url) {
3969
3972
  if (tombstone) retired.push(`${otherAgent} (retired ${tombstone.retired_at})`);
3970
- else unverifiable.push(`${otherAgent} (no stored key/URL to probe)`);
3973
+ else unverifiable.push(`${otherAgent} (no stored key/API URL to probe)`);
3971
3974
  continue;
3972
3975
  }
3973
3976
  const suffix = tombstone ? " [tombstoned \u2014 key material still present]" : "";
3974
- const probe = await (deps.probeHosted ?? probeHostedMcpTools)(identity.api_key, otherUrl, deps.fetch);
3977
+ const probe = await (deps.probeHostedIdentity ?? probeHostedAgentIdentity)(
3978
+ identity.api_key,
3979
+ identity.api_url,
3980
+ deps.fetch
3981
+ );
3975
3982
  if (probe.status === "ok") live.push({ label: `${otherAgent}${suffix}`, entry });
3976
3983
  else if (probe.status === "unauthorized") revoked.push(`${otherAgent}${suffix}`);
3977
3984
  else unverifiable.push(`${otherAgent} (${probe.status})${suffix}`);
@@ -4415,7 +4422,7 @@ async function pathExists2(path) {
4415
4422
  init_unwire();
4416
4423
  init_local_mcp_runtime();
4417
4424
  init_runtime_manifest();
4418
- var CONNECTOR_VERSION = "0.2.0-alpha.0";
4425
+ var CONNECTOR_VERSION = "0.3.0-alpha.0";
4419
4426
  var CONNECT_OUTCOME_SCHEMA_VERSION = 1;
4420
4427
  var failureOutcomesByError = /* @__PURE__ */ new WeakMap();
4421
4428
  function failureOutcomeFor(runtimeHint, error) {