@haven_ai/connect 0.2.0-alpha.0 → 0.2.1-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/README.md CHANGED
@@ -101,6 +101,13 @@ one agent and sign as another, and it fails hard. This is the half of that
101
101
  hazard a local tool can know — the doctor still cannot see inside an
102
102
  already-running host, which is why the restart guidance below matters.
103
103
 
104
+ The hosted MCP `tools/list` row is an endpoint-reachability handshake, not a
105
+ credential-authentication result. When doctor classifies a superseded
106
+ directory, it uses the same authenticated, read-only identity endpoint: a
107
+ 401/403 means the stored key is already revoked; a successful identity read
108
+ means it remains spend-capable; and network or malformed responses remain
109
+ unverifiable.
110
+
104
111
  ## Retiring an old agent directory
105
112
 
106
113
  Re-running setup without `--replace` creates a NEW agent and retires nothing
package/dist/cli.cjs CHANGED
@@ -557,9 +557,9 @@ var init_runtime_manifest = __esm({
557
557
  mcpPackage: "@haven_ai/mcp",
558
558
  mcpVersion: mcp.MCP_VERSION,
559
559
  sdkPackage: "@haven_ai/sdk",
560
- sdkVersion: "0.2.0-alpha.0",
560
+ sdkVersion: "0.2.1-alpha.0",
561
561
  signerPackage: "@haven_ai/signer",
562
- signerVersion: "0.2.0-alpha.0",
562
+ signerVersion: "0.2.1-alpha.0",
563
563
  // Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
564
564
  // while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
565
565
  // so the guard that was supposed to enforce the floor waved Node v23 through
@@ -2665,7 +2665,7 @@ async function installRuntime(input, deps = {}) {
2665
2665
  (signerProbe === void 0 || signerProbe.status === "ok");
2666
2666
  const restartRequired = configResult.restartRequired || restartRequiredForRuntime(runtime, deps.env);
2667
2667
  const errorCode = configResult.errorCode ?? (configResult.runtimeMcpMode === "local_stdio" ? localMcpErrorCode(signerCredentialReady, localMcpConsent, localMcpProbe?.status) : hostedMcpErrorCode(configResult.hostedConfigured, hostedProbe.status) ?? signerConsentErrorCode(signerCredentialReady, signerConsent) ?? signerProbeErrorCode(signerProbe));
2668
- 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."] : [];
2668
+ 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."] : [];
2669
2669
  const signerProbeMessages = signerProbe ? signerProbe.status === "ok" ? ["Verified local Haven signer with a stdio handshake."] : [
2670
2670
  `Local Haven signer handshake failed: ${signerProbe.status}.`,
2671
2671
  `Re-run \`${sdk.connectorRerunCommand()}\` to repair the signer setup.`
@@ -3715,14 +3715,17 @@ async function checksForAgent(entry, input, deps) {
3715
3715
  ...matches ? {} : { repair: `Run: ${RERUN} --doctor --repair --runtime ${input.runtime} with the same HAVEN_*_SPEC variables set.` }
3716
3716
  });
3717
3717
  } else {
3718
- 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
+ });
3719
3722
  const versionOk = sidecar.signer_version === MCP_RUNTIME_MANIFEST.signerVersion;
3720
- const ok = matches && versionOk;
3723
+ const ok = intact && versionOk;
3721
3724
  checks.push({
3722
3725
  id: "signer_runtime",
3723
3726
  label: "Signer runtime (preinstalled wrapper)",
3724
3727
  ok,
3725
- 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.`,
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 ${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.`,
3726
3729
  ...ok ? {} : { repair: `Run: ${RERUN} --doctor --repair --runtime ${input.runtime}` }
3727
3730
  });
3728
3731
  }
@@ -3735,9 +3738,9 @@ async function checksForAgent(entry, input, deps) {
3735
3738
  id: "hosted_mcp",
3736
3739
  label: "Hosted Haven MCP",
3737
3740
  ok: probe.status === "ok",
3738
- 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}).`,
3739
3742
  ...probe.status === "ok" ? {} : {
3740
- 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."
3741
3744
  }
3742
3745
  });
3743
3746
  } else {
@@ -3971,14 +3974,17 @@ async function runDoctor(input, deps = {}) {
3971
3974
  const identity = await readIdentity(entry.directory);
3972
3975
  const tombstone = await readAgentTombstone(entry.directory);
3973
3976
  const otherAgent = entry.agentId ?? path.basename(entry.directory);
3974
- const otherUrl = identity?.hosted_mcp_url ?? (identity?.api_url ? `${identity.api_url}/mcp` : void 0);
3975
- if (!identity?.api_key || !otherUrl) {
3977
+ if (!identity?.api_key || !identity.api_url) {
3976
3978
  if (tombstone) retired.push(`${otherAgent} (retired ${tombstone.retired_at})`);
3977
- else unverifiable.push(`${otherAgent} (no stored key/URL to probe)`);
3979
+ else unverifiable.push(`${otherAgent} (no stored key/API URL to probe)`);
3978
3980
  continue;
3979
3981
  }
3980
3982
  const suffix = tombstone ? " [tombstoned \u2014 key material still present]" : "";
3981
- 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
+ );
3982
3988
  if (probe.status === "ok") live.push({ label: `${otherAgent}${suffix}`, entry });
3983
3989
  else if (probe.status === "unauthorized") revoked.push(`${otherAgent}${suffix}`);
3984
3990
  else unverifiable.push(`${otherAgent} (${probe.status})${suffix}`);
@@ -4422,7 +4428,7 @@ async function pathExists2(path) {
4422
4428
  init_unwire();
4423
4429
  init_local_mcp_runtime();
4424
4430
  init_runtime_manifest();
4425
- var CONNECTOR_VERSION = "0.2.0-alpha.0";
4431
+ var CONNECTOR_VERSION = "0.2.1-alpha.0";
4426
4432
  var CONNECT_OUTCOME_SCHEMA_VERSION = 1;
4427
4433
  var failureOutcomesByError = /* @__PURE__ */ new WeakMap();
4428
4434
  function failureOutcomeFor(runtimeHint, error) {