@haven_ai/connect 0.1.26-alpha.0 → 0.1.27-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 +68 -2
- package/dist/cli.cjs +1220 -660
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1224 -664
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1234 -670
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +73 -7
- package/dist/index.d.ts +73 -7
- package/dist/index.js +1217 -652
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -51,7 +51,11 @@ interface UpdateInstallStatusInput {
|
|
|
51
51
|
localMcpAcknowledged?: boolean;
|
|
52
52
|
activationCommandAvailable?: boolean;
|
|
53
53
|
skillInstalled?: boolean;
|
|
54
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Omitted on the #1543 early config-written report — no probe has run yet,
|
|
56
|
+
* and the backend merge keeps the key absent until the final report sets it.
|
|
57
|
+
*/
|
|
58
|
+
probeResult?: string;
|
|
55
59
|
restartRequired: boolean;
|
|
56
60
|
nextUserAction: string;
|
|
57
61
|
errorCode?: string | null;
|
|
@@ -163,6 +167,14 @@ type RuntimeMcpMode = 'local_stdio' | 'hosted_plus_signer' | 'manual';
|
|
|
163
167
|
type LocalMcpProbeStatus = 'ok' | 'timeout' | 'process_error' | 'bad_response' | 'missing_tools';
|
|
164
168
|
interface LocalMcpProbeResult {
|
|
165
169
|
status: LocalMcpProbeStatus;
|
|
170
|
+
/** #1589: the initialize response's serverInfo/capabilities, when reached —
|
|
171
|
+
* the doctor reports the signer's advertised compat versions from here
|
|
172
|
+
* instead of a second probe call. */
|
|
173
|
+
serverInfo?: {
|
|
174
|
+
name?: string;
|
|
175
|
+
version?: string;
|
|
176
|
+
};
|
|
177
|
+
capabilities?: Record<string, unknown>;
|
|
166
178
|
toolNames?: string[];
|
|
167
179
|
}
|
|
168
180
|
|
|
@@ -201,6 +213,8 @@ interface PreparedSignerRuntime {
|
|
|
201
213
|
}
|
|
202
214
|
interface SignerRuntimeDeps {
|
|
203
215
|
runCommand?: (command: string, args: string[]) => Promise<void>;
|
|
216
|
+
/** Heartbeats during the (possibly minutes-long) npm install (#1586). */
|
|
217
|
+
onProgress?: (message: string) => void;
|
|
204
218
|
}
|
|
205
219
|
/**
|
|
206
220
|
* Pre-install the edge signer into a version-pinned, connector-managed
|
|
@@ -262,6 +276,27 @@ interface RuntimeInstallResult {
|
|
|
262
276
|
signerRuntimePrepared?: boolean;
|
|
263
277
|
messages: string[];
|
|
264
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* The config-write snapshot handed to `onRuntimeConfigured` (#1543). The
|
|
281
|
+
* booleans mirror the semantics of the FINAL report's unlock keys minus the
|
|
282
|
+
* probe verdicts: "configured" here means the config write succeeded, the
|
|
283
|
+
* required consent is acknowledged, and the signer credential exists on disk
|
|
284
|
+
* (a local fs check) — not that a handshake has verified it. A later probe
|
|
285
|
+
* failure refines the final report and sets its errorCode; the dashboard's
|
|
286
|
+
* unlock condition accepts either state.
|
|
287
|
+
*/
|
|
288
|
+
interface EarlyRuntimeConfigReport {
|
|
289
|
+
runtime: RuntimeId;
|
|
290
|
+
runtimeMcpMode: RuntimeMcpMode;
|
|
291
|
+
hostedMcpConfigured: boolean;
|
|
292
|
+
localSignerConfigured: boolean;
|
|
293
|
+
localMcpConfigured: boolean;
|
|
294
|
+
signerAcknowledged?: boolean;
|
|
295
|
+
localMcpAcknowledged?: boolean;
|
|
296
|
+
restartRequired: boolean;
|
|
297
|
+
nextUserAction: string;
|
|
298
|
+
errorCode?: string;
|
|
299
|
+
}
|
|
265
300
|
interface RuntimeInstallDeps {
|
|
266
301
|
env?: NodeJS.ProcessEnv;
|
|
267
302
|
homeDir?: string;
|
|
@@ -274,9 +309,22 @@ interface RuntimeInstallDeps {
|
|
|
274
309
|
* When provided, a few lightweight heartbeat lines are emitted as they run.
|
|
275
310
|
*/
|
|
276
311
|
onProgress?: (message: string) => void;
|
|
312
|
+
/**
|
|
313
|
+
* #1543: invoked once, the moment the runtime MCP config write has settled —
|
|
314
|
+
* BEFORE the network probes and the skill install. The dashboard withholds
|
|
315
|
+
* its budget-approval controls until an install-status report shows the
|
|
316
|
+
* runtime configured, and the final report only lands after the entire
|
|
317
|
+
* install; gating approval on that tail made the user wait on work approval
|
|
318
|
+
* does not depend on. The snapshot carries the config-write facts (no probe
|
|
319
|
+
* verdicts, no skill state); the caller's complete report remains
|
|
320
|
+
* authoritative and overwrites these keys. Best-effort by contract: a
|
|
321
|
+
* throwing callback is swallowed and never fails the install.
|
|
322
|
+
*/
|
|
323
|
+
onRuntimeConfigured?: (report: EarlyRuntimeConfigReport) => Promise<void> | void;
|
|
277
324
|
runCommand?: (command: string, args: string[]) => Promise<void>;
|
|
278
325
|
prepareLocalMcpRuntime?: (input: PrepareLocalMcpRuntimeInput) => Promise<PreparedLocalMcpRuntime>;
|
|
279
326
|
prepareSignerRuntime?: (input: PrepareSignerRuntimeInput) => Promise<PreparedSignerRuntime>;
|
|
327
|
+
probeSignerTools?: (command: string, args: string[], requiredTools: readonly string[]) => Promise<LocalMcpProbeResult>;
|
|
280
328
|
probeLocalMcpTools?: (command: string, args: string[], requiredTools: readonly string[]) => Promise<LocalMcpProbeResult>;
|
|
281
329
|
}
|
|
282
330
|
declare function installRuntime(input: RuntimeInstallInput, deps?: RuntimeInstallDeps): Promise<RuntimeInstallResult>;
|
|
@@ -285,7 +333,7 @@ declare function runtimeInstallCapabilities(runtime: string | undefined, env?: N
|
|
|
285
333
|
restartRequired: boolean;
|
|
286
334
|
};
|
|
287
335
|
|
|
288
|
-
declare const CONNECTOR_VERSION = "0.1.
|
|
336
|
+
declare const CONNECTOR_VERSION = "0.1.27-alpha.0";
|
|
289
337
|
interface ConnectOptions {
|
|
290
338
|
setupToken: string;
|
|
291
339
|
apiBaseUrl: string;
|
|
@@ -380,8 +428,16 @@ declare function failedConnectOutcome(runtimeHint: string | undefined, error: un
|
|
|
380
428
|
* (agent-API-key auth, works during `setup_pending`) and narrates progress in
|
|
381
429
|
* the flow's voice, ending in a concrete celebration naming the granted
|
|
382
430
|
* authority. Bounds (stated per the issue): poll every 5 s, give up after
|
|
383
|
-
* 3 minutes
|
|
384
|
-
*
|
|
431
|
+
* 3 minutes (36 polls; with the immediate first check below the last one
|
|
432
|
+
* lands at ~175 s) — the connector ALWAYS terminates on its own; a timeout
|
|
433
|
+
* is a clean exit with guidance, never a hang. Injectable clock/cadence for
|
|
434
|
+
* tests.
|
|
435
|
+
*
|
|
436
|
+
* #1542: the first check happens BEFORE the "waiting for you to approve" line
|
|
437
|
+
* is printed. Users routinely approve in the dashboard while the runtime
|
|
438
|
+
* install is still running, and announcing a wait that is already over made
|
|
439
|
+
* the very next line ("Budget approved 🎉") read as a contradiction — the
|
|
440
|
+
* field-test agent relayed the pair verbatim as a bug.
|
|
385
441
|
*/
|
|
386
442
|
interface ApprovalWaitOptions {
|
|
387
443
|
intervalMs?: number;
|
|
@@ -393,6 +449,9 @@ interface ParsedCli {
|
|
|
393
449
|
options: ConnectOptions;
|
|
394
450
|
help: boolean;
|
|
395
451
|
json: boolean;
|
|
452
|
+
/** #1589: diagnosis mode — no setup token required. */
|
|
453
|
+
doctor: boolean;
|
|
454
|
+
repair: boolean;
|
|
396
455
|
}
|
|
397
456
|
declare function parseArgs(argv: string[], env?: NodeJS.ProcessEnv): ParsedCli;
|
|
398
457
|
declare function helpText(): string;
|
|
@@ -402,14 +461,21 @@ declare function shortAddress(address: string): string;
|
|
|
402
461
|
|
|
403
462
|
declare const MCP_RUNTIME_MANIFEST: {
|
|
404
463
|
readonly mcpPackage: "@haven_ai/mcp";
|
|
405
|
-
readonly mcpVersion: "0.1.
|
|
464
|
+
readonly mcpVersion: "0.1.27-alpha.0";
|
|
406
465
|
readonly sdkPackage: "@haven_ai/sdk";
|
|
407
|
-
readonly sdkVersion: "0.1.
|
|
466
|
+
readonly sdkVersion: "0.1.27-alpha.0";
|
|
408
467
|
readonly signerPackage: "@haven_ai/signer";
|
|
409
|
-
readonly signerVersion: "0.1.
|
|
468
|
+
readonly signerVersion: "0.1.27-alpha.0";
|
|
410
469
|
readonly minimumNodeVersion: "22.0.0";
|
|
411
470
|
readonly supportedClients: readonly ["codex-cli", "codex-desktop", "claude-code"];
|
|
412
471
|
readonly requiredTools: readonly string[];
|
|
472
|
+
/**
|
|
473
|
+
* The signer MCP's tool surface, DERIVED from the pinned @haven_ai/signer
|
|
474
|
+
* package (#1587) — same anti-drift rule as `requiredTools` above: a
|
|
475
|
+
* literal list here would rot the first time the signer gains a tool.
|
|
476
|
+
* The handshake probe requires all of them.
|
|
477
|
+
*/
|
|
478
|
+
readonly requiredSignerTools: readonly string[];
|
|
413
479
|
};
|
|
414
480
|
declare function mcpPackageSpec(): string;
|
|
415
481
|
declare function sdkPackageSpec(): string;
|
package/dist/index.d.ts
CHANGED
|
@@ -51,7 +51,11 @@ interface UpdateInstallStatusInput {
|
|
|
51
51
|
localMcpAcknowledged?: boolean;
|
|
52
52
|
activationCommandAvailable?: boolean;
|
|
53
53
|
skillInstalled?: boolean;
|
|
54
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Omitted on the #1543 early config-written report — no probe has run yet,
|
|
56
|
+
* and the backend merge keeps the key absent until the final report sets it.
|
|
57
|
+
*/
|
|
58
|
+
probeResult?: string;
|
|
55
59
|
restartRequired: boolean;
|
|
56
60
|
nextUserAction: string;
|
|
57
61
|
errorCode?: string | null;
|
|
@@ -163,6 +167,14 @@ type RuntimeMcpMode = 'local_stdio' | 'hosted_plus_signer' | 'manual';
|
|
|
163
167
|
type LocalMcpProbeStatus = 'ok' | 'timeout' | 'process_error' | 'bad_response' | 'missing_tools';
|
|
164
168
|
interface LocalMcpProbeResult {
|
|
165
169
|
status: LocalMcpProbeStatus;
|
|
170
|
+
/** #1589: the initialize response's serverInfo/capabilities, when reached —
|
|
171
|
+
* the doctor reports the signer's advertised compat versions from here
|
|
172
|
+
* instead of a second probe call. */
|
|
173
|
+
serverInfo?: {
|
|
174
|
+
name?: string;
|
|
175
|
+
version?: string;
|
|
176
|
+
};
|
|
177
|
+
capabilities?: Record<string, unknown>;
|
|
166
178
|
toolNames?: string[];
|
|
167
179
|
}
|
|
168
180
|
|
|
@@ -201,6 +213,8 @@ interface PreparedSignerRuntime {
|
|
|
201
213
|
}
|
|
202
214
|
interface SignerRuntimeDeps {
|
|
203
215
|
runCommand?: (command: string, args: string[]) => Promise<void>;
|
|
216
|
+
/** Heartbeats during the (possibly minutes-long) npm install (#1586). */
|
|
217
|
+
onProgress?: (message: string) => void;
|
|
204
218
|
}
|
|
205
219
|
/**
|
|
206
220
|
* Pre-install the edge signer into a version-pinned, connector-managed
|
|
@@ -262,6 +276,27 @@ interface RuntimeInstallResult {
|
|
|
262
276
|
signerRuntimePrepared?: boolean;
|
|
263
277
|
messages: string[];
|
|
264
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* The config-write snapshot handed to `onRuntimeConfigured` (#1543). The
|
|
281
|
+
* booleans mirror the semantics of the FINAL report's unlock keys minus the
|
|
282
|
+
* probe verdicts: "configured" here means the config write succeeded, the
|
|
283
|
+
* required consent is acknowledged, and the signer credential exists on disk
|
|
284
|
+
* (a local fs check) — not that a handshake has verified it. A later probe
|
|
285
|
+
* failure refines the final report and sets its errorCode; the dashboard's
|
|
286
|
+
* unlock condition accepts either state.
|
|
287
|
+
*/
|
|
288
|
+
interface EarlyRuntimeConfigReport {
|
|
289
|
+
runtime: RuntimeId;
|
|
290
|
+
runtimeMcpMode: RuntimeMcpMode;
|
|
291
|
+
hostedMcpConfigured: boolean;
|
|
292
|
+
localSignerConfigured: boolean;
|
|
293
|
+
localMcpConfigured: boolean;
|
|
294
|
+
signerAcknowledged?: boolean;
|
|
295
|
+
localMcpAcknowledged?: boolean;
|
|
296
|
+
restartRequired: boolean;
|
|
297
|
+
nextUserAction: string;
|
|
298
|
+
errorCode?: string;
|
|
299
|
+
}
|
|
265
300
|
interface RuntimeInstallDeps {
|
|
266
301
|
env?: NodeJS.ProcessEnv;
|
|
267
302
|
homeDir?: string;
|
|
@@ -274,9 +309,22 @@ interface RuntimeInstallDeps {
|
|
|
274
309
|
* When provided, a few lightweight heartbeat lines are emitted as they run.
|
|
275
310
|
*/
|
|
276
311
|
onProgress?: (message: string) => void;
|
|
312
|
+
/**
|
|
313
|
+
* #1543: invoked once, the moment the runtime MCP config write has settled —
|
|
314
|
+
* BEFORE the network probes and the skill install. The dashboard withholds
|
|
315
|
+
* its budget-approval controls until an install-status report shows the
|
|
316
|
+
* runtime configured, and the final report only lands after the entire
|
|
317
|
+
* install; gating approval on that tail made the user wait on work approval
|
|
318
|
+
* does not depend on. The snapshot carries the config-write facts (no probe
|
|
319
|
+
* verdicts, no skill state); the caller's complete report remains
|
|
320
|
+
* authoritative and overwrites these keys. Best-effort by contract: a
|
|
321
|
+
* throwing callback is swallowed and never fails the install.
|
|
322
|
+
*/
|
|
323
|
+
onRuntimeConfigured?: (report: EarlyRuntimeConfigReport) => Promise<void> | void;
|
|
277
324
|
runCommand?: (command: string, args: string[]) => Promise<void>;
|
|
278
325
|
prepareLocalMcpRuntime?: (input: PrepareLocalMcpRuntimeInput) => Promise<PreparedLocalMcpRuntime>;
|
|
279
326
|
prepareSignerRuntime?: (input: PrepareSignerRuntimeInput) => Promise<PreparedSignerRuntime>;
|
|
327
|
+
probeSignerTools?: (command: string, args: string[], requiredTools: readonly string[]) => Promise<LocalMcpProbeResult>;
|
|
280
328
|
probeLocalMcpTools?: (command: string, args: string[], requiredTools: readonly string[]) => Promise<LocalMcpProbeResult>;
|
|
281
329
|
}
|
|
282
330
|
declare function installRuntime(input: RuntimeInstallInput, deps?: RuntimeInstallDeps): Promise<RuntimeInstallResult>;
|
|
@@ -285,7 +333,7 @@ declare function runtimeInstallCapabilities(runtime: string | undefined, env?: N
|
|
|
285
333
|
restartRequired: boolean;
|
|
286
334
|
};
|
|
287
335
|
|
|
288
|
-
declare const CONNECTOR_VERSION = "0.1.
|
|
336
|
+
declare const CONNECTOR_VERSION = "0.1.27-alpha.0";
|
|
289
337
|
interface ConnectOptions {
|
|
290
338
|
setupToken: string;
|
|
291
339
|
apiBaseUrl: string;
|
|
@@ -380,8 +428,16 @@ declare function failedConnectOutcome(runtimeHint: string | undefined, error: un
|
|
|
380
428
|
* (agent-API-key auth, works during `setup_pending`) and narrates progress in
|
|
381
429
|
* the flow's voice, ending in a concrete celebration naming the granted
|
|
382
430
|
* authority. Bounds (stated per the issue): poll every 5 s, give up after
|
|
383
|
-
* 3 minutes
|
|
384
|
-
*
|
|
431
|
+
* 3 minutes (36 polls; with the immediate first check below the last one
|
|
432
|
+
* lands at ~175 s) — the connector ALWAYS terminates on its own; a timeout
|
|
433
|
+
* is a clean exit with guidance, never a hang. Injectable clock/cadence for
|
|
434
|
+
* tests.
|
|
435
|
+
*
|
|
436
|
+
* #1542: the first check happens BEFORE the "waiting for you to approve" line
|
|
437
|
+
* is printed. Users routinely approve in the dashboard while the runtime
|
|
438
|
+
* install is still running, and announcing a wait that is already over made
|
|
439
|
+
* the very next line ("Budget approved 🎉") read as a contradiction — the
|
|
440
|
+
* field-test agent relayed the pair verbatim as a bug.
|
|
385
441
|
*/
|
|
386
442
|
interface ApprovalWaitOptions {
|
|
387
443
|
intervalMs?: number;
|
|
@@ -393,6 +449,9 @@ interface ParsedCli {
|
|
|
393
449
|
options: ConnectOptions;
|
|
394
450
|
help: boolean;
|
|
395
451
|
json: boolean;
|
|
452
|
+
/** #1589: diagnosis mode — no setup token required. */
|
|
453
|
+
doctor: boolean;
|
|
454
|
+
repair: boolean;
|
|
396
455
|
}
|
|
397
456
|
declare function parseArgs(argv: string[], env?: NodeJS.ProcessEnv): ParsedCli;
|
|
398
457
|
declare function helpText(): string;
|
|
@@ -402,14 +461,21 @@ declare function shortAddress(address: string): string;
|
|
|
402
461
|
|
|
403
462
|
declare const MCP_RUNTIME_MANIFEST: {
|
|
404
463
|
readonly mcpPackage: "@haven_ai/mcp";
|
|
405
|
-
readonly mcpVersion: "0.1.
|
|
464
|
+
readonly mcpVersion: "0.1.27-alpha.0";
|
|
406
465
|
readonly sdkPackage: "@haven_ai/sdk";
|
|
407
|
-
readonly sdkVersion: "0.1.
|
|
466
|
+
readonly sdkVersion: "0.1.27-alpha.0";
|
|
408
467
|
readonly signerPackage: "@haven_ai/signer";
|
|
409
|
-
readonly signerVersion: "0.1.
|
|
468
|
+
readonly signerVersion: "0.1.27-alpha.0";
|
|
410
469
|
readonly minimumNodeVersion: "22.0.0";
|
|
411
470
|
readonly supportedClients: readonly ["codex-cli", "codex-desktop", "claude-code"];
|
|
412
471
|
readonly requiredTools: readonly string[];
|
|
472
|
+
/**
|
|
473
|
+
* The signer MCP's tool surface, DERIVED from the pinned @haven_ai/signer
|
|
474
|
+
* package (#1587) — same anti-drift rule as `requiredTools` above: a
|
|
475
|
+
* literal list here would rot the first time the signer gains a tool.
|
|
476
|
+
* The handshake probe requires all of them.
|
|
477
|
+
*/
|
|
478
|
+
readonly requiredSignerTools: readonly string[];
|
|
413
479
|
};
|
|
414
480
|
declare function mcpPackageSpec(): string;
|
|
415
481
|
declare function sdkPackageSpec(): string;
|