@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/cli.cjs +20 -26
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +21 -27
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +20 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +21 -27
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,7 @@ import { join, resolve, dirname } from 'path';
|
|
|
7
7
|
import { execFile, spawn } from 'child_process';
|
|
8
8
|
import { promisify } from 'util';
|
|
9
9
|
import { registeredToolNames, MCP_VERSION, ensureConsent, computeConsentHash, loadCredentials, consentInputFromClient } from '@haven_ai/mcp';
|
|
10
|
-
import { SKILL_FOLDER_NAME, HAVEN_SKILL_MD } from '@haven_ai/sdk';
|
|
10
|
+
import { HAVEN_MINIMUM_NODE_VERSION, isSupportedNodeVersion, unsupportedNodeVersionMessage, SKILL_FOLDER_NAME, HAVEN_SKILL_MD } from '@haven_ai/sdk';
|
|
11
11
|
import { ensureSignerConsent, computeSignerConsentHash, loadSignerCredentials, createEdgeSigner, toolSchemas } from '@haven_ai/signer';
|
|
12
12
|
|
|
13
13
|
// src/api.ts
|
|
@@ -230,10 +230,16 @@ var MCP_RUNTIME_MANIFEST = {
|
|
|
230
230
|
mcpPackage: "@haven_ai/mcp",
|
|
231
231
|
mcpVersion: MCP_VERSION,
|
|
232
232
|
sdkPackage: "@haven_ai/sdk",
|
|
233
|
-
sdkVersion: "0.1.
|
|
233
|
+
sdkVersion: "0.1.19-alpha.0",
|
|
234
234
|
signerPackage: "@haven_ai/signer",
|
|
235
|
-
signerVersion: "0.1.
|
|
236
|
-
|
|
235
|
+
signerVersion: "0.1.19-alpha.0",
|
|
236
|
+
// Sourced from the SDK, never a literal (#1161). This field read '20.0.0'
|
|
237
|
+
// while every package's `engines` said `>=24` and the docs said `>=24.0.0`,
|
|
238
|
+
// so the guard that was supposed to enforce the floor waved Node v23 through
|
|
239
|
+
// — including on the `--local` path where it does run. A hand-maintained
|
|
240
|
+
// second copy of a number is a drift waiting to happen; a guard test pins
|
|
241
|
+
// this against `package.json`'s `engines.node`.
|
|
242
|
+
minimumNodeVersion: HAVEN_MINIMUM_NODE_VERSION,
|
|
237
243
|
supportedClients: ["codex-cli", "codex-desktop", "claude-code"],
|
|
238
244
|
requiredTools: registeredToolNames()
|
|
239
245
|
};
|
|
@@ -907,9 +913,13 @@ async function fetchWithTimeout(fetchImpl, url, init) {
|
|
|
907
913
|
var execFileAsync = promisify(execFile);
|
|
908
914
|
var UnsupportedNodeVersionError = class extends Error {
|
|
909
915
|
code = "local_mcp_unsupported_node_version";
|
|
910
|
-
|
|
911
|
-
|
|
916
|
+
nodeVersion;
|
|
917
|
+
minimumNodeVersion;
|
|
918
|
+
constructor(nodeVersion, minimumNodeVersion, subject = "Haven setup") {
|
|
919
|
+
super(unsupportedNodeVersionMessage({ subject, nodeVersion, minimumNodeVersion }));
|
|
912
920
|
this.name = "UnsupportedNodeVersionError";
|
|
921
|
+
this.nodeVersion = nodeVersion;
|
|
922
|
+
this.minimumNodeVersion = minimumNodeVersion;
|
|
913
923
|
}
|
|
914
924
|
};
|
|
915
925
|
async function prepareLocalMcpRuntime(input, deps = {}) {
|
|
@@ -955,28 +965,11 @@ async function prepareLocalMcpRuntime(input, deps = {}) {
|
|
|
955
965
|
messages
|
|
956
966
|
};
|
|
957
967
|
}
|
|
958
|
-
function assertSupportedNodeVersion(nodeVersion = process.versions.node, minimumNodeVersion = MCP_RUNTIME_MANIFEST.minimumNodeVersion) {
|
|
959
|
-
if (
|
|
960
|
-
throw new UnsupportedNodeVersionError(nodeVersion, minimumNodeVersion);
|
|
968
|
+
function assertSupportedNodeVersion(nodeVersion = process.versions.node, minimumNodeVersion = MCP_RUNTIME_MANIFEST.minimumNodeVersion, subject = "Haven setup") {
|
|
969
|
+
if (!isSupportedNodeVersion(nodeVersion, minimumNodeVersion)) {
|
|
970
|
+
throw new UnsupportedNodeVersionError(nodeVersion, minimumNodeVersion, subject);
|
|
961
971
|
}
|
|
962
972
|
}
|
|
963
|
-
function compareNodeVersions(left, right) {
|
|
964
|
-
const leftParts = parseNodeVersion(left);
|
|
965
|
-
const rightParts = parseNodeVersion(right);
|
|
966
|
-
for (let i = 0; i < 3; i += 1) {
|
|
967
|
-
if (leftParts[i] !== rightParts[i]) return leftParts[i] > rightParts[i] ? 1 : -1;
|
|
968
|
-
}
|
|
969
|
-
return 0;
|
|
970
|
-
}
|
|
971
|
-
function parseNodeVersion(value) {
|
|
972
|
-
const match = value.trim().match(/^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
|
|
973
|
-
if (!match) return [0, 0, 0];
|
|
974
|
-
return [
|
|
975
|
-
Number(match[1] ?? 0),
|
|
976
|
-
Number(match[2] ?? 0),
|
|
977
|
-
Number(match[3] ?? 0)
|
|
978
|
-
];
|
|
979
|
-
}
|
|
980
973
|
async function installRuntimePackages(runtimeDirectory, npmCacheDirectory, runCommand) {
|
|
981
974
|
const baseArgs = [
|
|
982
975
|
"install",
|
|
@@ -1709,8 +1702,9 @@ function localRuntimePrepareErrorCode(err) {
|
|
|
1709
1702
|
}
|
|
1710
1703
|
|
|
1711
1704
|
// src/runtime.ts
|
|
1712
|
-
var CONNECTOR_VERSION = "0.1.
|
|
1705
|
+
var CONNECTOR_VERSION = "0.1.19-alpha.0";
|
|
1713
1706
|
async function runConnect(options, deps = {}) {
|
|
1707
|
+
assertSupportedNodeVersion(deps.nodeVersion, MCP_RUNTIME_MANIFEST.minimumNodeVersion);
|
|
1714
1708
|
const connectorVersion = options.connectorVersion ?? CONNECTOR_VERSION;
|
|
1715
1709
|
const api = deps.api ?? createConnectApiClient(options.apiBaseUrl);
|
|
1716
1710
|
const log = secureLogger(deps.log ?? ((message) => process.stdout.write(`${message}
|