@autohq/cli 0.1.441 → 0.1.442
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/agent-bridge.js +36 -17
- package/dist/index.js +36 -17
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -30825,7 +30825,7 @@ Object.assign(lookup, {
|
|
|
30825
30825
|
// package.json
|
|
30826
30826
|
var package_default = {
|
|
30827
30827
|
name: "@autohq/cli",
|
|
30828
|
-
version: "0.1.
|
|
30828
|
+
version: "0.1.442",
|
|
30829
30829
|
license: "SEE LICENSE IN README.md",
|
|
30830
30830
|
publishConfig: {
|
|
30831
30831
|
access: "public"
|
|
@@ -90605,7 +90605,7 @@ function withClaudeStderrDiagnosticsPointer(error51, capturedStderr) {
|
|
|
90605
90605
|
var CLAUDE_AGENT_STARTUP_TIMEOUT_MS = 3e4;
|
|
90606
90606
|
var CLAUDE_INTERRUPT_SETTLE_TIMEOUT_MS = 1e4;
|
|
90607
90607
|
var CLAUDE_INTERRUPT_ACK_TIMEOUT_MS = 1e4;
|
|
90608
|
-
var CLAUDE_MCP_REGISTRATION_TIMEOUT_MS =
|
|
90608
|
+
var CLAUDE_MCP_REGISTRATION_TIMEOUT_MS = 3e4;
|
|
90609
90609
|
var CLAUDE_MCP_REGISTRATION_POLL_INTERVAL_MS = 100;
|
|
90610
90610
|
var CLAUDE_READ_STATE_SEED_FAILURE_LIMIT = 3;
|
|
90611
90611
|
var CLAUDE_STARTUP_PROFILE_HOOK_EVENTS = [
|
|
@@ -90636,6 +90636,12 @@ var ClaudeMcpRequiredToolsMissingError = class extends Error {
|
|
|
90636
90636
|
this.name = "ClaudeMcpRequiredToolsMissingError";
|
|
90637
90637
|
}
|
|
90638
90638
|
};
|
|
90639
|
+
var ClaudeMcpRegistryNotReadyError = class extends Error {
|
|
90640
|
+
constructor(detail) {
|
|
90641
|
+
super(`MCP tool registry was not ready at session start: ${detail}`);
|
|
90642
|
+
this.name = "ClaudeMcpRegistryNotReadyError";
|
|
90643
|
+
}
|
|
90644
|
+
};
|
|
90639
90645
|
var ClaudeAgentBridgeSessionImpl = class {
|
|
90640
90646
|
input;
|
|
90641
90647
|
inputQueue;
|
|
@@ -91202,12 +91208,13 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
91202
91208
|
}
|
|
91203
91209
|
// Why this gate is correct without a provider-backed test (it relies on real
|
|
91204
91210
|
// SDK mcpServerStatus() timing that fakes cannot prove):
|
|
91205
|
-
// -
|
|
91206
|
-
//
|
|
91207
|
-
//
|
|
91208
|
-
//
|
|
91209
|
-
//
|
|
91210
|
-
//
|
|
91211
|
+
// - Fail closed before first-turn injection whenever configured servers are
|
|
91212
|
+
// still pending or their status cannot be read. The model must never see a
|
|
91213
|
+
// callable MCP name whose SDK registry snapshot is not ready to dispatch
|
|
91214
|
+
// it. Closing the SDK session lets the wrapper's existing bounded command
|
|
91215
|
+
// delivery retries warm a fresh registry without replaying a tool call.
|
|
91216
|
+
// - Confirmed-empty and missing-required-tool states retain their distinct
|
|
91217
|
+
// diagnostics and typed failures from FRA-3458.
|
|
91211
91218
|
// - Provider-path validation is deferred deliberately: the failure is the
|
|
91212
91219
|
// intermittent live-prod race on the chief-of-staff singleton (a real
|
|
91213
91220
|
// runtime restart dispatching turn-1 while real mcp__* servers reconnect),
|
|
@@ -91240,14 +91247,19 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
91240
91247
|
};
|
|
91241
91248
|
}
|
|
91242
91249
|
const result = await this.mcpRegistrationGate.promise;
|
|
91243
|
-
if (result.outcome
|
|
91250
|
+
if (result.outcome === "ready" || result.outcome === "closed") {
|
|
91244
91251
|
return;
|
|
91245
91252
|
}
|
|
91246
91253
|
this.close();
|
|
91247
|
-
|
|
91248
|
-
|
|
91254
|
+
switch (result.outcome) {
|
|
91255
|
+
case "missing_required_tools":
|
|
91256
|
+
throw new ClaudeMcpRequiredToolsMissingError(result.detail);
|
|
91257
|
+
case "not_ready":
|
|
91258
|
+
case "status_failed":
|
|
91259
|
+
throw new ClaudeMcpRegistryNotReadyError(result.detail);
|
|
91260
|
+
case "empty":
|
|
91261
|
+
throw new ClaudeMcpRegistryEmptyError(result.detail);
|
|
91249
91262
|
}
|
|
91250
|
-
throw new ClaudeMcpRegistryEmptyError(result.detail);
|
|
91251
91263
|
}
|
|
91252
91264
|
// Poll the live query's MCP server status until no configured server is still
|
|
91253
91265
|
// `pending`, bounded by CLAUDE_MCP_REGISTRATION_TIMEOUT_MS. Terminal states
|
|
@@ -91259,7 +91271,9 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
91259
91271
|
// status-read failure, timeout, or a closed session all resolve so the caller
|
|
91260
91272
|
// degrades to immediate injection when the registry state is uncertain. A
|
|
91261
91273
|
// connected required server with positive zero/missing-tool telemetry fails
|
|
91262
|
-
// immediately even while unrelated configured servers remain pending.
|
|
91274
|
+
// immediately even while unrelated configured servers remain pending. A
|
|
91275
|
+
// timeout or status-read failure returns a distinct not-ready result so the
|
|
91276
|
+
// caller closes the session and rejects before first-turn injection.
|
|
91263
91277
|
async pollMcpRegistration(query) {
|
|
91264
91278
|
const configuredNames = Object.keys(this.options.mcpServers ?? {});
|
|
91265
91279
|
const startedAt = Date.now();
|
|
@@ -91275,10 +91289,14 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
91275
91289
|
try {
|
|
91276
91290
|
statuses = await query.mcpServerStatus();
|
|
91277
91291
|
} catch (error51) {
|
|
91292
|
+
const detail = error51 instanceof Error ? error51.message : String(error51);
|
|
91278
91293
|
this.input.writeOutput?.(
|
|
91279
|
-
`agent_bridge_claude_mcp_gate_status_failed duration_ms=${Date.now() - startedAt} error=${
|
|
91294
|
+
`agent_bridge_claude_mcp_gate_status_failed duration_ms=${Date.now() - startedAt} error=${detail}`
|
|
91280
91295
|
);
|
|
91281
|
-
return {
|
|
91296
|
+
return {
|
|
91297
|
+
outcome: "status_failed",
|
|
91298
|
+
detail: `status read failed: ${detail}`
|
|
91299
|
+
};
|
|
91282
91300
|
}
|
|
91283
91301
|
const missingRequiredTools = missingRequiredMcpTools(
|
|
91284
91302
|
statuses,
|
|
@@ -91305,10 +91323,11 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
91305
91323
|
return { outcome: "ready" };
|
|
91306
91324
|
}
|
|
91307
91325
|
if (Date.now() >= deadline) {
|
|
91326
|
+
const detail = mcpStatusDetailList(statuses);
|
|
91308
91327
|
this.input.writeOutput?.(
|
|
91309
|
-
`
|
|
91328
|
+
`agent_bridge_claude_mcp_gate_not_ready duration_ms=${Date.now() - startedAt} servers=${detail}`
|
|
91310
91329
|
);
|
|
91311
|
-
return { outcome: "
|
|
91330
|
+
return { outcome: "not_ready", detail };
|
|
91312
91331
|
}
|
|
91313
91332
|
await delay(
|
|
91314
91333
|
CLAUDE_MCP_REGISTRATION_POLL_INTERVAL_MS,
|
package/dist/index.js
CHANGED
|
@@ -47834,7 +47834,7 @@ var init_package = __esm({
|
|
|
47834
47834
|
"package.json"() {
|
|
47835
47835
|
package_default = {
|
|
47836
47836
|
name: "@autohq/cli",
|
|
47837
|
-
version: "0.1.
|
|
47837
|
+
version: "0.1.442",
|
|
47838
47838
|
license: "SEE LICENSE IN README.md",
|
|
47839
47839
|
publishConfig: {
|
|
47840
47840
|
access: "public"
|
|
@@ -61626,7 +61626,7 @@ function withClaudeStderrDiagnosticsPointer(error51, capturedStderr) {
|
|
|
61626
61626
|
var CLAUDE_AGENT_STARTUP_TIMEOUT_MS = 3e4;
|
|
61627
61627
|
var CLAUDE_INTERRUPT_SETTLE_TIMEOUT_MS = 1e4;
|
|
61628
61628
|
var CLAUDE_INTERRUPT_ACK_TIMEOUT_MS = 1e4;
|
|
61629
|
-
var CLAUDE_MCP_REGISTRATION_TIMEOUT_MS =
|
|
61629
|
+
var CLAUDE_MCP_REGISTRATION_TIMEOUT_MS = 3e4;
|
|
61630
61630
|
var CLAUDE_MCP_REGISTRATION_POLL_INTERVAL_MS = 100;
|
|
61631
61631
|
var CLAUDE_READ_STATE_SEED_FAILURE_LIMIT = 3;
|
|
61632
61632
|
var CLAUDE_STARTUP_PROFILE_HOOK_EVENTS = [
|
|
@@ -61657,6 +61657,12 @@ var ClaudeMcpRequiredToolsMissingError = class extends Error {
|
|
|
61657
61657
|
this.name = "ClaudeMcpRequiredToolsMissingError";
|
|
61658
61658
|
}
|
|
61659
61659
|
};
|
|
61660
|
+
var ClaudeMcpRegistryNotReadyError = class extends Error {
|
|
61661
|
+
constructor(detail) {
|
|
61662
|
+
super(`MCP tool registry was not ready at session start: ${detail}`);
|
|
61663
|
+
this.name = "ClaudeMcpRegistryNotReadyError";
|
|
61664
|
+
}
|
|
61665
|
+
};
|
|
61660
61666
|
var ClaudeAgentBridgeSessionImpl = class {
|
|
61661
61667
|
input;
|
|
61662
61668
|
inputQueue;
|
|
@@ -62223,12 +62229,13 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
62223
62229
|
}
|
|
62224
62230
|
// Why this gate is correct without a provider-backed test (it relies on real
|
|
62225
62231
|
// SDK mcpServerStatus() timing that fakes cannot prove):
|
|
62226
|
-
// -
|
|
62227
|
-
//
|
|
62228
|
-
//
|
|
62229
|
-
//
|
|
62230
|
-
//
|
|
62231
|
-
//
|
|
62232
|
+
// - Fail closed before first-turn injection whenever configured servers are
|
|
62233
|
+
// still pending or their status cannot be read. The model must never see a
|
|
62234
|
+
// callable MCP name whose SDK registry snapshot is not ready to dispatch
|
|
62235
|
+
// it. Closing the SDK session lets the wrapper's existing bounded command
|
|
62236
|
+
// delivery retries warm a fresh registry without replaying a tool call.
|
|
62237
|
+
// - Confirmed-empty and missing-required-tool states retain their distinct
|
|
62238
|
+
// diagnostics and typed failures from FRA-3458.
|
|
62232
62239
|
// - Provider-path validation is deferred deliberately: the failure is the
|
|
62233
62240
|
// intermittent live-prod race on the chief-of-staff singleton (a real
|
|
62234
62241
|
// runtime restart dispatching turn-1 while real mcp__* servers reconnect),
|
|
@@ -62261,14 +62268,19 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
62261
62268
|
};
|
|
62262
62269
|
}
|
|
62263
62270
|
const result = await this.mcpRegistrationGate.promise;
|
|
62264
|
-
if (result.outcome
|
|
62271
|
+
if (result.outcome === "ready" || result.outcome === "closed") {
|
|
62265
62272
|
return;
|
|
62266
62273
|
}
|
|
62267
62274
|
this.close();
|
|
62268
|
-
|
|
62269
|
-
|
|
62275
|
+
switch (result.outcome) {
|
|
62276
|
+
case "missing_required_tools":
|
|
62277
|
+
throw new ClaudeMcpRequiredToolsMissingError(result.detail);
|
|
62278
|
+
case "not_ready":
|
|
62279
|
+
case "status_failed":
|
|
62280
|
+
throw new ClaudeMcpRegistryNotReadyError(result.detail);
|
|
62281
|
+
case "empty":
|
|
62282
|
+
throw new ClaudeMcpRegistryEmptyError(result.detail);
|
|
62270
62283
|
}
|
|
62271
|
-
throw new ClaudeMcpRegistryEmptyError(result.detail);
|
|
62272
62284
|
}
|
|
62273
62285
|
// Poll the live query's MCP server status until no configured server is still
|
|
62274
62286
|
// `pending`, bounded by CLAUDE_MCP_REGISTRATION_TIMEOUT_MS. Terminal states
|
|
@@ -62280,7 +62292,9 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
62280
62292
|
// status-read failure, timeout, or a closed session all resolve so the caller
|
|
62281
62293
|
// degrades to immediate injection when the registry state is uncertain. A
|
|
62282
62294
|
// connected required server with positive zero/missing-tool telemetry fails
|
|
62283
|
-
// immediately even while unrelated configured servers remain pending.
|
|
62295
|
+
// immediately even while unrelated configured servers remain pending. A
|
|
62296
|
+
// timeout or status-read failure returns a distinct not-ready result so the
|
|
62297
|
+
// caller closes the session and rejects before first-turn injection.
|
|
62284
62298
|
async pollMcpRegistration(query) {
|
|
62285
62299
|
const configuredNames = Object.keys(this.options.mcpServers ?? {});
|
|
62286
62300
|
const startedAt = Date.now();
|
|
@@ -62296,10 +62310,14 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
62296
62310
|
try {
|
|
62297
62311
|
statuses = await query.mcpServerStatus();
|
|
62298
62312
|
} catch (error51) {
|
|
62313
|
+
const detail = error51 instanceof Error ? error51.message : String(error51);
|
|
62299
62314
|
this.input.writeOutput?.(
|
|
62300
|
-
`agent_bridge_claude_mcp_gate_status_failed duration_ms=${Date.now() - startedAt} error=${
|
|
62315
|
+
`agent_bridge_claude_mcp_gate_status_failed duration_ms=${Date.now() - startedAt} error=${detail}`
|
|
62301
62316
|
);
|
|
62302
|
-
return {
|
|
62317
|
+
return {
|
|
62318
|
+
outcome: "status_failed",
|
|
62319
|
+
detail: `status read failed: ${detail}`
|
|
62320
|
+
};
|
|
62303
62321
|
}
|
|
62304
62322
|
const missingRequiredTools = missingRequiredMcpTools(
|
|
62305
62323
|
statuses,
|
|
@@ -62326,10 +62344,11 @@ var ClaudeAgentBridgeSessionImpl = class {
|
|
|
62326
62344
|
return { outcome: "ready" };
|
|
62327
62345
|
}
|
|
62328
62346
|
if (Date.now() >= deadline) {
|
|
62347
|
+
const detail = mcpStatusDetailList(statuses);
|
|
62329
62348
|
this.input.writeOutput?.(
|
|
62330
|
-
`
|
|
62349
|
+
`agent_bridge_claude_mcp_gate_not_ready duration_ms=${Date.now() - startedAt} servers=${detail}`
|
|
62331
62350
|
);
|
|
62332
|
-
return { outcome: "
|
|
62351
|
+
return { outcome: "not_ready", detail };
|
|
62333
62352
|
}
|
|
62334
62353
|
await delay(
|
|
62335
62354
|
CLAUDE_MCP_REGISTRATION_POLL_INTERVAL_MS,
|