@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/cli.cjs +26 -27
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +27 -28
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +26 -27
- 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 +27 -28
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
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.
|
|
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.
|
|
310
|
+
readonly mcpVersion: "0.1.19-alpha.0";
|
|
309
311
|
readonly sdkPackage: "@haven_ai/sdk";
|
|
310
|
-
readonly sdkVersion: "0.1.
|
|
312
|
+
readonly sdkVersion: "0.1.19-alpha.0";
|
|
311
313
|
readonly signerPackage: "@haven_ai/signer";
|
|
312
|
-
readonly signerVersion: "0.1.
|
|
313
|
-
readonly minimumNodeVersion: "
|
|
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.
|
|
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.
|
|
310
|
+
readonly mcpVersion: "0.1.19-alpha.0";
|
|
309
311
|
readonly sdkPackage: "@haven_ai/sdk";
|
|
310
|
-
readonly sdkVersion: "0.1.
|
|
312
|
+
readonly sdkVersion: "0.1.19-alpha.0";
|
|
311
313
|
readonly signerPackage: "@haven_ai/signer";
|
|
312
|
-
readonly signerVersion: "0.1.
|
|
313
|
-
readonly minimumNodeVersion: "
|
|
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.
|
|
232
|
+
sdkVersion: "0.1.19-alpha.0",
|
|
233
233
|
signerPackage: "@haven_ai/signer",
|
|
234
|
-
signerVersion: "0.1.
|
|
235
|
-
|
|
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
|
-
|
|
910
|
-
|
|
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 (
|
|
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",
|
|
@@ -1399,7 +1392,12 @@ async function installRuntime(input, deps = {}) {
|
|
|
1399
1392
|
localMcpAcknowledged: false,
|
|
1400
1393
|
messages: [
|
|
1401
1394
|
...consentMessages,
|
|
1402
|
-
"
|
|
1395
|
+
"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.",
|
|
1396
|
+
` identity (hosted MCP Bearer): ${input.identityPath}`,
|
|
1397
|
+
` signer (local signing key): ${input.signerPath}`,
|
|
1398
|
+
"After wallet approval, wire the runtime to Haven by reference:",
|
|
1399
|
+
` 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}`,
|
|
1400
|
+
` Fully local MCP (no hosted dependency): npx -y ${mcpPackageSpec()} --identity ${input.identityPath} --signer ${input.signerPath}`
|
|
1403
1401
|
]
|
|
1404
1402
|
};
|
|
1405
1403
|
}
|
|
@@ -1703,8 +1701,9 @@ function localRuntimePrepareErrorCode(err) {
|
|
|
1703
1701
|
}
|
|
1704
1702
|
|
|
1705
1703
|
// src/runtime.ts
|
|
1706
|
-
var CONNECTOR_VERSION = "0.1.
|
|
1704
|
+
var CONNECTOR_VERSION = "0.1.19-alpha.0";
|
|
1707
1705
|
async function runConnect(options, deps = {}) {
|
|
1706
|
+
assertSupportedNodeVersion(deps.nodeVersion, MCP_RUNTIME_MANIFEST.minimumNodeVersion);
|
|
1708
1707
|
const connectorVersion = options.connectorVersion ?? CONNECTOR_VERSION;
|
|
1709
1708
|
const api = deps.api ?? createConnectApiClient(options.apiBaseUrl);
|
|
1710
1709
|
const log = secureLogger(deps.log ?? ((message) => process.stdout.write(`${message}
|