@haven_ai/connect 0.1.17-alpha.0 → 0.1.19-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
@@ -235,10 +235,16 @@ var MCP_RUNTIME_MANIFEST = {
235
235
  mcpPackage: "@haven_ai/mcp",
236
236
  mcpVersion: mcp.MCP_VERSION,
237
237
  sdkPackage: "@haven_ai/sdk",
238
- sdkVersion: "0.1.17-alpha.0",
238
+ sdkVersion: "0.1.19-alpha.0",
239
239
  signerPackage: "@haven_ai/signer",
240
- signerVersion: "0.1.17-alpha.0",
241
- minimumNodeVersion: "20.0.0",
240
+ signerVersion: "0.1.19-alpha.0",
241
+ // Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
242
+ // while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
243
+ // so the guard that was supposed to enforce the floor waved Node v23 through
244
+ // — including on the `--local` path where it does run. A hand-maintained
245
+ // second copy of a number is a drift waiting to happen; a guard test pins
246
+ // this against `package.json`'s `engines.node`.
247
+ minimumNodeVersion: sdk.HAVEN_MINIMUM_NODE_VERSION,
242
248
  supportedClients: ["codex-cli", "codex-desktop", "claude-code"],
243
249
  requiredTools: mcp.registeredToolNames()
244
250
  };
@@ -912,9 +918,13 @@ async function fetchWithTimeout(fetchImpl, url, init) {
912
918
  var execFileAsync = util.promisify(child_process.execFile);
913
919
  var UnsupportedNodeVersionError = class extends Error {
914
920
  code = "local_mcp_unsupported_node_version";
915
- constructor(nodeVersion, minimumNodeVersion) {
916
- super(`Node.js ${nodeVersion} is not supported. Haven local MCP requires Node.js >=${minimumNodeVersion}.`);
921
+ nodeVersion;
922
+ minimumNodeVersion;
923
+ constructor(nodeVersion, minimumNodeVersion, subject = "Haven setup") {
924
+ super(sdk.unsupportedNodeVersionMessage({ subject, nodeVersion, minimumNodeVersion }));
917
925
  this.name = "UnsupportedNodeVersionError";
926
+ this.nodeVersion = nodeVersion;
927
+ this.minimumNodeVersion = minimumNodeVersion;
918
928
  }
919
929
  };
920
930
  async function prepareLocalMcpRuntime(input, deps = {}) {
@@ -960,28 +970,11 @@ async function prepareLocalMcpRuntime(input, deps = {}) {
960
970
  messages
961
971
  };
962
972
  }
963
- function assertSupportedNodeVersion(nodeVersion = process.versions.node, minimumNodeVersion = MCP_RUNTIME_MANIFEST.minimumNodeVersion) {
964
- if (compareNodeVersions(nodeVersion, minimumNodeVersion) < 0) {
965
- throw new UnsupportedNodeVersionError(nodeVersion, minimumNodeVersion);
973
+ function assertSupportedNodeVersion(nodeVersion = process.versions.node, minimumNodeVersion = MCP_RUNTIME_MANIFEST.minimumNodeVersion, subject = "Haven setup") {
974
+ if (!sdk.isSupportedNodeVersion(nodeVersion, minimumNodeVersion)) {
975
+ throw new UnsupportedNodeVersionError(nodeVersion, minimumNodeVersion, subject);
966
976
  }
967
977
  }
968
- function compareNodeVersions(left, right) {
969
- const leftParts = parseNodeVersion(left);
970
- const rightParts = parseNodeVersion(right);
971
- for (let i = 0; i < 3; i += 1) {
972
- if (leftParts[i] !== rightParts[i]) return leftParts[i] > rightParts[i] ? 1 : -1;
973
- }
974
- return 0;
975
- }
976
- function parseNodeVersion(value) {
977
- const match = value.trim().match(/^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
978
- if (!match) return [0, 0, 0];
979
- return [
980
- Number(match[1] ?? 0),
981
- Number(match[2] ?? 0),
982
- Number(match[3] ?? 0)
983
- ];
984
- }
985
978
  async function installRuntimePackages(runtimeDirectory, npmCacheDirectory, runCommand) {
986
979
  const baseArgs = [
987
980
  "install",
@@ -1405,7 +1398,12 @@ async function installRuntime(input, deps = {}) {
1405
1398
  localMcpAcknowledged: false,
1406
1399
  messages: [
1407
1400
  ...consentMessages,
1408
- "Runtime was not recognized. Keep the local credentials and add Haven MCP entries manually after wallet approval."
1401
+ "Custom runtime: Haven did not auto-configure it. Your credentials are on disk (chmod 600) \u2014 read them at runtime; never paste a key into the agent prompt, memory, or logs.",
1402
+ ` identity (hosted MCP Bearer): ${input.identityPath}`,
1403
+ ` signer (local signing key): ${input.signerPath}`,
1404
+ "After wallet approval, wire the runtime to Haven by reference:",
1405
+ ` Hosted MCP + local signer: point your MCP client at ${input.hostedMcpUrl} with the api_key from identity.json, then run npx -y ${signerPackageSpec()} --credentials ${input.signerPath}`,
1406
+ ` Fully local MCP (no hosted dependency): npx -y ${mcpPackageSpec()} --identity ${input.identityPath} --signer ${input.signerPath}`
1409
1407
  ]
1410
1408
  };
1411
1409
  }
@@ -1709,8 +1707,9 @@ function localRuntimePrepareErrorCode(err) {
1709
1707
  }
1710
1708
 
1711
1709
  // src/runtime.ts
1712
- var CONNECTOR_VERSION = "0.1.17-alpha.0";
1710
+ var CONNECTOR_VERSION = "0.1.19-alpha.0";
1713
1711
  async function runConnect(options, deps = {}) {
1712
+ assertSupportedNodeVersion(deps.nodeVersion, MCP_RUNTIME_MANIFEST.minimumNodeVersion);
1714
1713
  const connectorVersion = options.connectorVersion ?? CONNECTOR_VERSION;
1715
1714
  const api = deps.api ?? createConnectApiClient(options.apiBaseUrl);
1716
1715
  const log = secureLogger(deps.log ?? ((message) => process.stdout.write(`${message}