@haven_ai/connect 0.1.18-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.d.cts CHANGED
@@ -264,7 +264,7 @@ declare function runtimeInstallCapabilities(runtime: string | undefined, env?: N
264
264
  restartRequired: boolean;
265
265
  };
266
266
 
267
- declare const CONNECTOR_VERSION = "0.1.18-alpha.0";
267
+ declare const CONNECTOR_VERSION = "0.1.19-alpha.0";
268
268
  interface ConnectOptions {
269
269
  setupToken: string;
270
270
  apiBaseUrl: string;
@@ -284,6 +284,8 @@ interface ConnectDeps {
284
284
  writeCredentials?: typeof writeCredentialFiles;
285
285
  installRuntime?: typeof installRuntime;
286
286
  log?: (message: string) => void;
287
+ /** Overridable so the Node-floor refusal is testable without spawning a Node. */
288
+ nodeVersion?: string;
287
289
  }
288
290
  interface ConnectResult {
289
291
  setupId: string;
@@ -305,12 +307,12 @@ declare function shortAddress(address: string): string;
305
307
 
306
308
  declare const MCP_RUNTIME_MANIFEST: {
307
309
  readonly mcpPackage: "@haven_ai/mcp";
308
- readonly mcpVersion: "0.1.18-alpha.0";
310
+ readonly mcpVersion: "0.1.19-alpha.0";
309
311
  readonly sdkPackage: "@haven_ai/sdk";
310
- readonly sdkVersion: "0.1.18-alpha.0";
312
+ readonly sdkVersion: "0.1.19-alpha.0";
311
313
  readonly signerPackage: "@haven_ai/signer";
312
- readonly signerVersion: "0.1.18-alpha.0";
313
- readonly minimumNodeVersion: "20.0.0";
314
+ readonly signerVersion: "0.1.19-alpha.0";
315
+ readonly minimumNodeVersion: "24.0.0";
314
316
  readonly supportedClients: readonly ["codex-cli", "codex-desktop", "claude-code"];
315
317
  readonly requiredTools: readonly string[];
316
318
  };
package/dist/index.d.ts CHANGED
@@ -264,7 +264,7 @@ declare function runtimeInstallCapabilities(runtime: string | undefined, env?: N
264
264
  restartRequired: boolean;
265
265
  };
266
266
 
267
- declare const CONNECTOR_VERSION = "0.1.18-alpha.0";
267
+ declare const CONNECTOR_VERSION = "0.1.19-alpha.0";
268
268
  interface ConnectOptions {
269
269
  setupToken: string;
270
270
  apiBaseUrl: string;
@@ -284,6 +284,8 @@ interface ConnectDeps {
284
284
  writeCredentials?: typeof writeCredentialFiles;
285
285
  installRuntime?: typeof installRuntime;
286
286
  log?: (message: string) => void;
287
+ /** Overridable so the Node-floor refusal is testable without spawning a Node. */
288
+ nodeVersion?: string;
287
289
  }
288
290
  interface ConnectResult {
289
291
  setupId: string;
@@ -305,12 +307,12 @@ declare function shortAddress(address: string): string;
305
307
 
306
308
  declare const MCP_RUNTIME_MANIFEST: {
307
309
  readonly mcpPackage: "@haven_ai/mcp";
308
- readonly mcpVersion: "0.1.18-alpha.0";
310
+ readonly mcpVersion: "0.1.19-alpha.0";
309
311
  readonly sdkPackage: "@haven_ai/sdk";
310
- readonly sdkVersion: "0.1.18-alpha.0";
312
+ readonly sdkVersion: "0.1.19-alpha.0";
311
313
  readonly signerPackage: "@haven_ai/signer";
312
- readonly signerVersion: "0.1.18-alpha.0";
313
- readonly minimumNodeVersion: "20.0.0";
314
+ readonly signerVersion: "0.1.19-alpha.0";
315
+ readonly minimumNodeVersion: "24.0.0";
314
316
  readonly supportedClients: readonly ["codex-cli", "codex-desktop", "claude-code"];
315
317
  readonly requiredTools: readonly string[];
316
318
  };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { join, resolve, dirname } from 'path';
6
6
  import { execFile, spawn } from 'child_process';
7
7
  import { promisify } from 'util';
8
8
  import { registeredToolNames, MCP_VERSION, ensureConsent, computeConsentHash, loadCredentials, consentInputFromClient } from '@haven_ai/mcp';
9
- import { SKILL_FOLDER_NAME, HAVEN_SKILL_MD } from '@haven_ai/sdk';
9
+ import { HAVEN_MINIMUM_NODE_VERSION, SKILL_FOLDER_NAME, HAVEN_SKILL_MD, isSupportedNodeVersion, unsupportedNodeVersionMessage } from '@haven_ai/sdk';
10
10
  import { ensureSignerConsent, computeSignerConsentHash, loadSignerCredentials, createEdgeSigner, toolSchemas } from '@haven_ai/signer';
11
11
 
12
12
  // src/api.ts
@@ -229,10 +229,16 @@ var MCP_RUNTIME_MANIFEST = {
229
229
  mcpPackage: "@haven_ai/mcp",
230
230
  mcpVersion: MCP_VERSION,
231
231
  sdkPackage: "@haven_ai/sdk",
232
- sdkVersion: "0.1.18-alpha.0",
232
+ sdkVersion: "0.1.19-alpha.0",
233
233
  signerPackage: "@haven_ai/signer",
234
- signerVersion: "0.1.18-alpha.0",
235
- minimumNodeVersion: "20.0.0",
234
+ signerVersion: "0.1.19-alpha.0",
235
+ // Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
236
+ // while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
237
+ // so the guard that was supposed to enforce the floor waved Node v23 through
238
+ // — including on the `--local` path where it does run. A hand-maintained
239
+ // second copy of a number is a drift waiting to happen; a guard test pins
240
+ // this against `package.json`'s `engines.node`.
241
+ minimumNodeVersion: HAVEN_MINIMUM_NODE_VERSION,
236
242
  supportedClients: ["codex-cli", "codex-desktop", "claude-code"],
237
243
  requiredTools: registeredToolNames()
238
244
  };
@@ -906,9 +912,13 @@ async function fetchWithTimeout(fetchImpl, url, init) {
906
912
  var execFileAsync = promisify(execFile);
907
913
  var UnsupportedNodeVersionError = class extends Error {
908
914
  code = "local_mcp_unsupported_node_version";
909
- constructor(nodeVersion, minimumNodeVersion) {
910
- super(`Node.js ${nodeVersion} is not supported. Haven local MCP requires Node.js >=${minimumNodeVersion}.`);
915
+ nodeVersion;
916
+ minimumNodeVersion;
917
+ constructor(nodeVersion, minimumNodeVersion, subject = "Haven setup") {
918
+ super(unsupportedNodeVersionMessage({ subject, nodeVersion, minimumNodeVersion }));
911
919
  this.name = "UnsupportedNodeVersionError";
920
+ this.nodeVersion = nodeVersion;
921
+ this.minimumNodeVersion = minimumNodeVersion;
912
922
  }
913
923
  };
914
924
  async function prepareLocalMcpRuntime(input, deps = {}) {
@@ -954,28 +964,11 @@ async function prepareLocalMcpRuntime(input, deps = {}) {
954
964
  messages
955
965
  };
956
966
  }
957
- function assertSupportedNodeVersion(nodeVersion = process.versions.node, minimumNodeVersion = MCP_RUNTIME_MANIFEST.minimumNodeVersion) {
958
- if (compareNodeVersions(nodeVersion, minimumNodeVersion) < 0) {
959
- throw new UnsupportedNodeVersionError(nodeVersion, minimumNodeVersion);
967
+ function assertSupportedNodeVersion(nodeVersion = process.versions.node, minimumNodeVersion = MCP_RUNTIME_MANIFEST.minimumNodeVersion, subject = "Haven setup") {
968
+ if (!isSupportedNodeVersion(nodeVersion, minimumNodeVersion)) {
969
+ throw new UnsupportedNodeVersionError(nodeVersion, minimumNodeVersion, subject);
960
970
  }
961
971
  }
962
- function compareNodeVersions(left, right) {
963
- const leftParts = parseNodeVersion(left);
964
- const rightParts = parseNodeVersion(right);
965
- for (let i = 0; i < 3; i += 1) {
966
- if (leftParts[i] !== rightParts[i]) return leftParts[i] > rightParts[i] ? 1 : -1;
967
- }
968
- return 0;
969
- }
970
- function parseNodeVersion(value) {
971
- const match = value.trim().match(/^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
972
- if (!match) return [0, 0, 0];
973
- return [
974
- Number(match[1] ?? 0),
975
- Number(match[2] ?? 0),
976
- Number(match[3] ?? 0)
977
- ];
978
- }
979
972
  async function installRuntimePackages(runtimeDirectory, npmCacheDirectory, runCommand) {
980
973
  const baseArgs = [
981
974
  "install",
@@ -1708,8 +1701,9 @@ function localRuntimePrepareErrorCode(err) {
1708
1701
  }
1709
1702
 
1710
1703
  // src/runtime.ts
1711
- var CONNECTOR_VERSION = "0.1.18-alpha.0";
1704
+ var CONNECTOR_VERSION = "0.1.19-alpha.0";
1712
1705
  async function runConnect(options, deps = {}) {
1706
+ assertSupportedNodeVersion(deps.nodeVersion, MCP_RUNTIME_MANIFEST.minimumNodeVersion);
1713
1707
  const connectorVersion = options.connectorVersion ?? CONNECTOR_VERSION;
1714
1708
  const api = deps.api ?? createConnectApiClient(options.apiBaseUrl);
1715
1709
  const log = secureLogger(deps.log ?? ((message) => process.stdout.write(`${message}