@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/index.cjs CHANGED
@@ -556,9 +556,9 @@ var init_runtime_manifest = __esm({
556
556
  mcpPackage: "@haven_ai/mcp",
557
557
  mcpVersion: mcp.MCP_VERSION,
558
558
  sdkPackage: "@haven_ai/sdk",
559
- sdkVersion: "0.2.0-alpha.0",
559
+ sdkVersion: "0.3.0-alpha.0",
560
560
  signerPackage: "@haven_ai/signer",
561
- signerVersion: "0.2.0-alpha.0",
561
+ signerVersion: "0.3.0-alpha.0",
562
562
  // Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
563
563
  // while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
564
564
  // so the guard that was supposed to enforce the floor waved Node v23 through
@@ -1446,7 +1446,7 @@ async function buildLocalMcpConsentInput(identityPath, signerPath) {
1446
1446
  apiKey: credentials.apiKey,
1447
1447
  apiUrl: credentials.apiUrl,
1448
1448
  agentId: credentials.agentId,
1449
- safeAddress: credentials.accountAddress ?? credentials.safeAddress,
1449
+ accountAddress: credentials.accountAddress,
1450
1450
  delegateAddress: credentials.delegateAddress,
1451
1451
  chainId: credentials.chainId,
1452
1452
  allowanceSummary: credentials.allowanceSummary
@@ -2488,7 +2488,7 @@ async function buildSignerConsentInput(signerPath) {
2488
2488
  });
2489
2489
  return {
2490
2490
  delegateAddress: signer$1.delegateAddress,
2491
- safeAddress: credentials.accountAddress ?? credentials.safeAddress,
2491
+ accountAddress: credentials.accountAddress,
2492
2492
  agentId: credentials.agentId,
2493
2493
  chainId: credentials.chainId,
2494
2494
  network: credentials.network,
@@ -2664,7 +2664,7 @@ async function installRuntime(input, deps = {}) {
2664
2664
  (signerProbe === void 0 || signerProbe.status === "ok");
2665
2665
  const restartRequired = configResult.restartRequired || restartRequiredForRuntime(runtime, deps.env);
2666
2666
  const errorCode = configResult.errorCode ?? (configResult.runtimeMcpMode === "local_stdio" ? localMcpErrorCode(signerCredentialReady, localMcpConsent, localMcpProbe?.status) : hostedMcpErrorCode(configResult.hostedConfigured, hostedProbe.status) ?? signerConsentErrorCode(signerCredentialReady, signerConsent) ?? signerProbeErrorCode(signerProbe));
2667
- 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."] : [];
2667
+ 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."] : [];
2668
2668
  const signerProbeMessages = signerProbe ? signerProbe.status === "ok" ? ["Verified local Haven signer with a stdio handshake."] : [
2669
2669
  `Local Haven signer handshake failed: ${signerProbe.status}.`,
2670
2670
  `Re-run \`${sdk.connectorRerunCommand()}\` to repair the signer setup.`
@@ -3326,9 +3326,10 @@ async function finishRekey(options, deps = {}) {
3326
3326
  apiKey: options.newApiKey,
3327
3327
  delegateKey: pending.new_delegate_key,
3328
3328
  delegateAddress: pending.new_delegate_address,
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,
3329
+ // The stored value (already new-name-first, from the credential-FILE
3330
+ // permanent fallback) wins; the hosted identity's `account_address` is a
3331
+ // LIVE server read, which as of #2914 emits only that name.
3332
+ accountAddress: stored.accountAddress ?? identity.account_address ?? void 0,
3332
3333
  chainId: stored.chainId ?? identity.chain_id ?? void 0,
3333
3334
  network: stored.network,
3334
3335
  agentBudget: stored.agentBudget,
@@ -3714,14 +3715,17 @@ async function checksForAgent(entry, input, deps) {
3714
3715
  ...matches ? {} : { repair: `Run: ${RERUN} --doctor --repair --runtime ${input.runtime} with the same HAVEN_*_SPEC variables set.` }
3715
3716
  });
3716
3717
  } else {
3717
- const matches = await installedRuntimeMatches(sidecar.runtime_directory, sidecar.cli_path);
3718
+ const intact = await installedRuntimeMatchesVersions(sidecar.runtime_directory, sidecar.cli_path, {
3719
+ signerVersion: sidecar.signer_version,
3720
+ sdkVersion: sidecar.sdk_version
3721
+ });
3718
3722
  const versionOk = sidecar.signer_version === exports.MCP_RUNTIME_MANIFEST.signerVersion;
3719
- const ok = matches && versionOk;
3723
+ const ok = intact && versionOk;
3720
3724
  checks.push({
3721
3725
  id: "signer_runtime",
3722
3726
  label: "Signer runtime (preinstalled wrapper)",
3723
3727
  ok,
3724
- 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 ${exports.MCP_RUNTIME_MANIFEST.signerVersion}.` : `Runtime directory is stale or empty (${sidecar.runtime_directory}) \u2014 the CLI or package versions are missing.`,
3728
+ 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 ${exports.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.`,
3725
3729
  ...ok ? {} : { repair: `Run: ${RERUN} --doctor --repair --runtime ${input.runtime}` }
3726
3730
  });
3727
3731
  }
@@ -3734,9 +3738,9 @@ async function checksForAgent(entry, input, deps) {
3734
3738
  id: "hosted_mcp",
3735
3739
  label: "Hosted Haven MCP",
3736
3740
  ok: probe.status === "ok",
3737
- detail: probe.status === "ok" ? `Reachable and authorized (${hostedUrl}).` : `Probe failed: ${probe.status} (${hostedUrl}).`,
3741
+ detail: probe.status === "ok" ? `MCP tools endpoint is reachable (${hostedUrl}).` : `MCP tools endpoint probe failed: ${probe.status} (${hostedUrl}).`,
3738
3742
  ...probe.status === "ok" ? {} : {
3739
- 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."
3743
+ repair: "Check network access and runtime configuration for the hosted MCP URL, then re-run --doctor."
3740
3744
  }
3741
3745
  });
3742
3746
  } else {
@@ -3970,14 +3974,17 @@ async function runDoctor(input, deps = {}) {
3970
3974
  const identity = await readIdentity(entry.directory);
3971
3975
  const tombstone = await readAgentTombstone(entry.directory);
3972
3976
  const otherAgent = entry.agentId ?? path.basename(entry.directory);
3973
- const otherUrl = identity?.hosted_mcp_url ?? (identity?.api_url ? `${identity.api_url}/mcp` : void 0);
3974
- if (!identity?.api_key || !otherUrl) {
3977
+ if (!identity?.api_key || !identity.api_url) {
3975
3978
  if (tombstone) retired.push(`${otherAgent} (retired ${tombstone.retired_at})`);
3976
- else unverifiable.push(`${otherAgent} (no stored key/URL to probe)`);
3979
+ else unverifiable.push(`${otherAgent} (no stored key/API URL to probe)`);
3977
3980
  continue;
3978
3981
  }
3979
3982
  const suffix = tombstone ? " [tombstoned \u2014 key material still present]" : "";
3980
- const probe = await (deps.probeHosted ?? probeHostedMcpTools)(identity.api_key, otherUrl, deps.fetch);
3983
+ const probe = await (deps.probeHostedIdentity ?? probeHostedAgentIdentity)(
3984
+ identity.api_key,
3985
+ identity.api_url,
3986
+ deps.fetch
3987
+ );
3981
3988
  if (probe.status === "ok") live.push({ label: `${otherAgent}${suffix}`, entry });
3982
3989
  else if (probe.status === "unauthorized") revoked.push(`${otherAgent}${suffix}`);
3983
3990
  else unverifiable.push(`${otherAgent} (${probe.status})${suffix}`);
@@ -4421,7 +4428,7 @@ async function pathExists2(path) {
4421
4428
  init_unwire();
4422
4429
  init_local_mcp_runtime();
4423
4430
  init_runtime_manifest();
4424
- var CONNECTOR_VERSION = "0.2.0-alpha.0";
4431
+ var CONNECTOR_VERSION = "0.3.0-alpha.0";
4425
4432
  var CONNECT_OUTCOME_SCHEMA_VERSION = 1;
4426
4433
  var failureOutcomesByError = /* @__PURE__ */ new WeakMap();
4427
4434
  function failureOutcomeFor(runtimeHint, error) {