@agentbridge1/cli 0.0.5 → 0.0.7
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/build-info.json +4 -4
- package/dist/commands/accept.js +4 -4
- package/dist/commands/check.js +10 -1
- package/dist/commands/connect.js +5 -2
- package/dist/commands/doctor.js +228 -63
- package/dist/commands/install-rules.js +64 -0
- package/dist/commands/proof-guidance.js +30 -0
- package/dist/commands/recover.js +121 -23
- package/dist/commands/room.js +82 -0
- package/dist/commands/setup-mcp.js +22 -1
- package/dist/commands/start.js +33 -63
- package/dist/commands/verify.js +124 -91
- package/dist/commands/watch.js +428 -113
- package/dist/config.js +31 -1
- package/dist/error-catalog.js +51 -16
- package/dist/gates.js +3 -3
- package/dist/git-evidence.js +2 -0
- package/dist/http.js +29 -0
- package/dist/index.js +78 -30
- package/dist/init.js +134 -18
- package/dist/local-memory.js +33 -0
- package/dist/local-proof.js +158 -0
- package/dist/local-session-mirror.js +247 -0
- package/dist/local-supervision.js +250 -0
- package/dist/mcp/agentbridge-mcp.js +22947 -0
- package/dist/mcp/agentbridge-mcp.js.map +7 -0
- package/dist/mcp-runtime.js +31 -0
- package/dist/preflight-changed-files.js +24 -17
- package/dist/proof-obligations.js +155 -0
- package/dist/recovery-reconcile.js +183 -0
- package/dist/rules-sync.js +138 -0
- package/dist/server-sync.js +24 -0
- package/dist/session-state.js +119 -21
- package/dist/session.js +9 -2
- package/dist/supervision.js +100 -6
- package/package.json +5 -2
package/dist/config.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_API_BASE_URL = exports.CONFIG_PATH = exports.CONFIG_DIR = void 0;
|
|
3
|
+
exports.ROOM_CONNECTION_KEYS = exports.DEFAULT_API_BASE_URL = exports.CONFIG_PATH = exports.CONFIG_DIR = void 0;
|
|
4
4
|
exports.readConfig = readConfig;
|
|
5
5
|
exports.writeConfig = writeConfig;
|
|
6
6
|
exports.updateConfig = updateConfig;
|
|
7
|
+
exports.clearRoomConnection = clearRoomConnection;
|
|
7
8
|
exports.contextFromConfig = contextFromConfig;
|
|
8
9
|
const node_fs_1 = require("node:fs");
|
|
9
10
|
const node_path_1 = require("node:path");
|
|
@@ -30,6 +31,35 @@ function updateConfig(partial) {
|
|
|
30
31
|
writeConfig(next);
|
|
31
32
|
return next;
|
|
32
33
|
}
|
|
34
|
+
/** Config keys that bind this repo to a cloud room / execution surface. */
|
|
35
|
+
exports.ROOM_CONNECTION_KEYS = [
|
|
36
|
+
"projectId",
|
|
37
|
+
"apiKey",
|
|
38
|
+
"activeAgentId",
|
|
39
|
+
"executionSurfaceId",
|
|
40
|
+
"activeChangeRequestId",
|
|
41
|
+
"lastAcceptedSessionId",
|
|
42
|
+
"lastAcceptedAt",
|
|
43
|
+
];
|
|
44
|
+
function clearRoomConnection() {
|
|
45
|
+
const current = readConfig();
|
|
46
|
+
const clearedKeys = [];
|
|
47
|
+
const next = { ...current };
|
|
48
|
+
for (const key of exports.ROOM_CONNECTION_KEYS) {
|
|
49
|
+
if (next[key] !== undefined) {
|
|
50
|
+
clearedKeys.push(key);
|
|
51
|
+
delete next[key];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (clearedKeys.length > 0) {
|
|
55
|
+
writeConfig(next);
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
clearedKeys,
|
|
59
|
+
previousProjectId: current.projectId,
|
|
60
|
+
hadApiKey: Boolean(current.apiKey),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
33
63
|
function contextFromConfig() {
|
|
34
64
|
const cfg = readConfig();
|
|
35
65
|
const apiBaseUrl = process.env.AGENTBRIDGE_BASE_URL ??
|
package/dist/error-catalog.js
CHANGED
|
@@ -20,7 +20,7 @@ const CATALOG = {
|
|
|
20
20
|
title: "Authentication failed.",
|
|
21
21
|
what: "The API key was missing, invalid, or rejected by the server.",
|
|
22
22
|
why: "AgentBridge cannot reach project APIs without valid credentials.",
|
|
23
|
-
next: "
|
|
23
|
+
next: "Run `agentbridge room exit`, set a fresh AGENTBRIDGE_API_KEY, then `agentbridge connect`.",
|
|
24
24
|
},
|
|
25
25
|
PROJECT_ACCESS_NOT_FOUND: {
|
|
26
26
|
code: "PROJECT_ACCESS_NOT_FOUND",
|
|
@@ -44,7 +44,7 @@ const CATALOG = {
|
|
|
44
44
|
title: "No active tracked work session.",
|
|
45
45
|
what: "No active tracked work session was found for this command.",
|
|
46
46
|
why: "Proof, verify, accept, and handoff require a bound work session.",
|
|
47
|
-
next:
|
|
47
|
+
next: "Run `agentbridge watch` beside Cursor for live supervision, or `agentbridge verify -- <test command>` to record proof.",
|
|
48
48
|
blocksAcceptance: true,
|
|
49
49
|
},
|
|
50
50
|
WORK_CONTEXT_BINDING_REQUIRED: {
|
|
@@ -53,7 +53,7 @@ const CATALOG = {
|
|
|
53
53
|
title: "Work session binding required.",
|
|
54
54
|
what: "This command needs a linked local/server work session.",
|
|
55
55
|
why: "The CLI and server must agree on the active change request and session.",
|
|
56
|
-
next: 'Run `agentbridge
|
|
56
|
+
next: 'Run `agentbridge watch --allow-dirty` for default review, or `agentbridge watch --task "<task>" --scope "<path>"` for strict mode.',
|
|
57
57
|
blocksAcceptance: true,
|
|
58
58
|
},
|
|
59
59
|
PROOF_STALE_AFTER_CHANGE: {
|
|
@@ -70,8 +70,8 @@ const CATALOG = {
|
|
|
70
70
|
category: "SCOPE_DRIFT_ERROR",
|
|
71
71
|
title: "Scope drift detected.",
|
|
72
72
|
what: "The agent changed a file outside the declared scope.",
|
|
73
|
-
why: "Out-of-scope edits
|
|
74
|
-
next: 'Options: (1) revert the out-of-scope file, (2)
|
|
73
|
+
why: "Out-of-scope edits are not safe to trust until reviewed or rescoped.",
|
|
74
|
+
next: 'Options: (1) revert the out-of-scope file, (2) widen strict scope via `agentbridge watch --task "<work>" --scope "<wider-path>"`, or (3) split into a separate task.',
|
|
75
75
|
blocksAcceptance: true,
|
|
76
76
|
},
|
|
77
77
|
HANDOFF_REQUIRED: {
|
|
@@ -176,9 +176,12 @@ const CATALOG = {
|
|
|
176
176
|
code: "START_MISSING_ACTIVE_AGENT",
|
|
177
177
|
category: "IDENTITY_ERROR",
|
|
178
178
|
title: "No active agent configured.",
|
|
179
|
-
what: "Neither activeAgentId nor --agent was provided for start.",
|
|
180
|
-
why: "
|
|
181
|
-
next:
|
|
179
|
+
what: "Neither activeAgentId nor --agent was provided for strict tracked start.",
|
|
180
|
+
why: "Strict tracked work (--summary/--scope, --resume, or --change-request) must bind to a WorkIdentity in this project.",
|
|
181
|
+
next: [
|
|
182
|
+
"For strict tracked work: run `agentbridge identity list` then `agentbridge use <agent-id>`, or pass --agent.",
|
|
183
|
+
"For room-level watching only: run `agentbridge start` with no strict flags.",
|
|
184
|
+
].join("\n"),
|
|
182
185
|
},
|
|
183
186
|
START_EXECUTION_SURFACE_REQUIRED: {
|
|
184
187
|
code: "START_EXECUTION_SURFACE_REQUIRED",
|
|
@@ -237,10 +240,10 @@ const CATALOG = {
|
|
|
237
240
|
START_CR_OWNERSHIP_MISMATCH: {
|
|
238
241
|
code: "START_CR_OWNERSHIP_MISMATCH",
|
|
239
242
|
category: "START_ERROR",
|
|
240
|
-
title: "
|
|
241
|
-
what: "
|
|
242
|
-
why: "
|
|
243
|
-
next: "
|
|
243
|
+
title: "Tracked task belongs to another connected agent.",
|
|
244
|
+
what: "AgentBridge found an old tracked task owned by a different connected agent.",
|
|
245
|
+
why: "AgentBridge will not let one connected agent automatically take over another agent's tracked work.",
|
|
246
|
+
next: "Run `agentbridge watch` for live supervision, or switch back to the original connected agent if you intend to resume old tracked work.",
|
|
244
247
|
},
|
|
245
248
|
START_CR_NOT_EXECUTABLE: {
|
|
246
249
|
code: "START_CR_NOT_EXECUTABLE",
|
|
@@ -293,6 +296,33 @@ const CATALOG = {
|
|
|
293
296
|
next: "Run `agentbridge verify -- <command>` then `agentbridge check`.",
|
|
294
297
|
blocksAcceptance: true,
|
|
295
298
|
},
|
|
299
|
+
PROOF_TOO_WEAK: {
|
|
300
|
+
code: "PROOF_TOO_WEAK",
|
|
301
|
+
category: "PROOF_ERROR",
|
|
302
|
+
title: "Proof too weak.",
|
|
303
|
+
what: "Verification ran, but proof strength is below what this change requires.",
|
|
304
|
+
why: "High-risk or source changes need stronger proof than file-existence checks.",
|
|
305
|
+
next: "Rerun with a stronger command from proof guidance (e.g. `agentbridge verify -- npm test`).",
|
|
306
|
+
blocksAcceptance: true,
|
|
307
|
+
},
|
|
308
|
+
PROOF_NOT_RELEVANT: {
|
|
309
|
+
code: "PROOF_NOT_RELEVANT",
|
|
310
|
+
category: "PROOF_ERROR",
|
|
311
|
+
title: "Proof not relevant.",
|
|
312
|
+
what: "Recorded proof does not cover the files or impact of this change.",
|
|
313
|
+
why: "Proof must match the changed files — unrelated passing tests do not count.",
|
|
314
|
+
next: "Rerun verification scoped to the changed files listed in the acceptance report.",
|
|
315
|
+
blocksAcceptance: true,
|
|
316
|
+
},
|
|
317
|
+
PROOF_IMPACT_COVERAGE_GAP: {
|
|
318
|
+
code: "PROOF_IMPACT_COVERAGE_GAP",
|
|
319
|
+
category: "PROOF_ERROR",
|
|
320
|
+
title: "Proof impact coverage gap.",
|
|
321
|
+
what: "Proof exists but does not cover required impact areas for this work type.",
|
|
322
|
+
why: "Some change profiles require broader verification than a single lightweight check.",
|
|
323
|
+
next: "Run the minimum commands listed under proof guidance in `agentbridge check`.",
|
|
324
|
+
blocksAcceptance: true,
|
|
325
|
+
},
|
|
296
326
|
PROOF_EVIDENCE_NOT_RECORDED: {
|
|
297
327
|
code: "PROOF_EVIDENCE_NOT_RECORDED",
|
|
298
328
|
category: "PROOF_ERROR",
|
|
@@ -341,7 +371,7 @@ const CATALOG = {
|
|
|
341
371
|
title: "Work already closed.",
|
|
342
372
|
what: "This change request or session is already in a terminal acceptance state.",
|
|
343
373
|
why: "Accept and verify cannot mutate closed work.",
|
|
344
|
-
next: "
|
|
374
|
+
next: "Run `agentbridge watch --allow-dirty` to review new coding work.",
|
|
345
375
|
blocksAcceptance: true,
|
|
346
376
|
},
|
|
347
377
|
WORK_CONTEXT_SESSION_CR_MISMATCH: {
|
|
@@ -359,7 +389,7 @@ const CATALOG = {
|
|
|
359
389
|
title: "Stale local session.",
|
|
360
390
|
what: "Local session id no longer exists on the server.",
|
|
361
391
|
why: "Watch and verify would track orphaned state.",
|
|
362
|
-
next: 'Local session state has been cleared. Run `agentbridge
|
|
392
|
+
next: 'Local session state has been cleared. Run `agentbridge watch --allow-dirty` to review current work.',
|
|
363
393
|
blocksAcceptance: true,
|
|
364
394
|
},
|
|
365
395
|
WORK_CONTEXT_SCOPE_MISMATCH: {
|
|
@@ -368,7 +398,7 @@ const CATALOG = {
|
|
|
368
398
|
title: "Session scope or task mismatch.",
|
|
369
399
|
what: "The active session was started with a different task or scope than requested.",
|
|
370
400
|
why: "Resuming the wrong session would silently corrupt proof and scope boundaries.",
|
|
371
|
-
next: 'Finish or abandon the current session (`agentbridge session abandon --reason "..."`) then rerun `agentbridge
|
|
401
|
+
next: 'Finish or abandon the current session (`agentbridge session abandon --reason "..."`) then rerun `agentbridge watch --task "<task>" --scope "<path>"`.',
|
|
372
402
|
blocksAcceptance: true,
|
|
373
403
|
},
|
|
374
404
|
WORK_CONTEXT_AMBIGUOUS_SESSIONS: {
|
|
@@ -414,6 +444,9 @@ const SERVER_CODE_ALIASES = {
|
|
|
414
444
|
proof_stale: "PROOF_STALE_AFTER_CHANGE",
|
|
415
445
|
stale_evidence_after_change: "PROOF_STALE_AFTER_CHANGE",
|
|
416
446
|
evidence_missing: "PROOF_MISSING",
|
|
447
|
+
proof_too_weak: "PROOF_TOO_WEAK",
|
|
448
|
+
proof_not_relevant: "PROOF_NOT_RELEVANT",
|
|
449
|
+
proof_impact_coverage_gap: "PROOF_IMPACT_COVERAGE_GAP",
|
|
417
450
|
scope_drift: "SCOPE_DRIFT_OUT_OF_SCOPE_FILE",
|
|
418
451
|
out_of_scope_file: "SCOPE_DRIFT_OUT_OF_SCOPE_FILE",
|
|
419
452
|
cr_no_owner: "START_OWNER_UNRESOLVED",
|
|
@@ -424,11 +457,13 @@ const SERVER_CODE_ALIASES = {
|
|
|
424
457
|
local_session_not_found: "WORK_CONTEXT_STALE_LOCAL_SESSION",
|
|
425
458
|
};
|
|
426
459
|
function mapServerCodeToCatalog(code) {
|
|
460
|
+
if (typeof code !== "string" || code.trim().length === 0)
|
|
461
|
+
return "";
|
|
427
462
|
const normalized = code.toLowerCase();
|
|
428
463
|
return SERVER_CODE_ALIASES[normalized] ?? code;
|
|
429
464
|
}
|
|
430
465
|
function catalogEntryForCode(code) {
|
|
431
|
-
if (!code)
|
|
466
|
+
if (!code || typeof code !== "string")
|
|
432
467
|
return null;
|
|
433
468
|
const direct = CATALOG[code];
|
|
434
469
|
if (direct)
|
package/dist/gates.js
CHANGED
|
@@ -19,9 +19,9 @@ exports.ensureGatesFile = ensureGatesFile;
|
|
|
19
19
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
20
20
|
const node_path_1 = __importDefault(require("node:path"));
|
|
21
21
|
exports.DEFAULT_GATES = {
|
|
22
|
-
rollout_proof_too_weak: "
|
|
23
|
-
rollout_proof_not_relevant: "
|
|
24
|
-
rollout_impact_coverage_gap: "
|
|
22
|
+
rollout_proof_too_weak: "hard_fail",
|
|
23
|
+
rollout_proof_not_relevant: "hard_fail",
|
|
24
|
+
rollout_impact_coverage_gap: "hard_fail",
|
|
25
25
|
};
|
|
26
26
|
exports.STATS_HISTORY_CAP = 20;
|
|
27
27
|
exports.GITIGNORE_SESSION_LINE = ".agentbridge/session.json";
|
package/dist/git-evidence.js
CHANGED
package/dist/http.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CliMissingConfigError = exports.CliHttpError = void 0;
|
|
4
4
|
exports.isCliHttpError = isCliHttpError;
|
|
5
5
|
exports.parseCliHttpErrorBody = parseCliHttpErrorBody;
|
|
6
|
+
exports.extractHttpErrorCode = extractHttpErrorCode;
|
|
6
7
|
exports.postJson = postJson;
|
|
7
8
|
exports.putJson = putJson;
|
|
8
9
|
exports.getJson = getJson;
|
|
@@ -33,6 +34,34 @@ function parseCliHttpErrorBody(err) {
|
|
|
33
34
|
}
|
|
34
35
|
return null;
|
|
35
36
|
}
|
|
37
|
+
/** Extract a string error code from a parsed HTTP error body (handles nested error objects). */
|
|
38
|
+
function extractHttpErrorCode(parsed) {
|
|
39
|
+
if (!parsed)
|
|
40
|
+
return "";
|
|
41
|
+
const topCode = parsed["code"];
|
|
42
|
+
if (typeof topCode === "string" && topCode.trim().length > 0) {
|
|
43
|
+
return topCode.trim();
|
|
44
|
+
}
|
|
45
|
+
const err = parsed["error"];
|
|
46
|
+
if (typeof err === "string" && err.trim().length > 0) {
|
|
47
|
+
return err.trim();
|
|
48
|
+
}
|
|
49
|
+
if (err !== null && typeof err === "object" && !Array.isArray(err)) {
|
|
50
|
+
const nested = err["code"];
|
|
51
|
+
if (typeof nested === "string" && nested.trim().length > 0) {
|
|
52
|
+
return nested.trim();
|
|
53
|
+
}
|
|
54
|
+
const nestedMessage = err["message"];
|
|
55
|
+
if (typeof nestedMessage === "string" && nestedMessage.trim().length > 0) {
|
|
56
|
+
return nestedMessage.trim();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const message = parsed["message"];
|
|
60
|
+
if (typeof message === "string" && message.trim().length > 0) {
|
|
61
|
+
return message.trim();
|
|
62
|
+
}
|
|
63
|
+
return "";
|
|
64
|
+
}
|
|
36
65
|
class CliMissingConfigError extends Error {
|
|
37
66
|
code = "CONFIG_INCOMPLETE";
|
|
38
67
|
constructor(message) {
|
package/dist/index.js
CHANGED
|
@@ -25,14 +25,17 @@ const memory_1 = require("./commands/memory");
|
|
|
25
25
|
const session_1 = require("./commands/session");
|
|
26
26
|
const handshake_1 = require("./commands/handshake");
|
|
27
27
|
const connect_1 = require("./commands/connect");
|
|
28
|
+
const room_1 = require("./commands/room");
|
|
28
29
|
const setup_mcp_1 = require("./commands/setup-mcp");
|
|
29
30
|
const bug_1 = require("./commands/bug");
|
|
30
31
|
const autopilot_1 = require("./commands/autopilot");
|
|
31
32
|
const attention_1 = require("./commands/attention");
|
|
32
33
|
const recover_1 = require("./commands/recover");
|
|
34
|
+
const install_rules_1 = require("./commands/install-rules");
|
|
35
|
+
const proof_guidance_1 = require("./commands/proof-guidance");
|
|
33
36
|
const node_path_1 = require("node:path");
|
|
34
37
|
const node_child_process_1 = require("node:child_process");
|
|
35
|
-
const
|
|
38
|
+
const mcp_runtime_1 = require("./mcp-runtime");
|
|
36
39
|
const errors_1 = require("./errors");
|
|
37
40
|
const cli_failure_log_1 = require("./cli-failure-log");
|
|
38
41
|
const session_state_1 = require("./session-state");
|
|
@@ -40,6 +43,10 @@ const COMMAND_HELP = {
|
|
|
40
43
|
connect: " agentbridge connect [--project <id>] [--api-key <key>] [--api-base-url <url>] [--agent <id>]\n" +
|
|
41
44
|
" Save credentials and verify connection to your AgentBridge project.\n" +
|
|
42
45
|
" Credentials can also come from AGENTBRIDGE_PROJECT_ID / AGENTBRIDGE_API_KEY env vars.\n",
|
|
46
|
+
room: " agentbridge room exit [--keep-session] [--json]\n" +
|
|
47
|
+
" Clear saved room credentials from .agentbridge/config.json (no server call).\n" +
|
|
48
|
+
" Use when API keys are rejected or you need to connect to a different project.\n" +
|
|
49
|
+
" Preserves domain recovery data from init/recover.\n",
|
|
43
50
|
recover: " agentbridge recover [--force]\n" +
|
|
44
51
|
" Recover project context so AI agents do not start blind.\n" +
|
|
45
52
|
" Shows project name, domains, and known context.\n",
|
|
@@ -48,15 +55,19 @@ const COMMAND_HELP = {
|
|
|
48
55
|
" Run `agentbridge connect` first to save credentials.\n",
|
|
49
56
|
use: " agentbridge use <agent-id>\n" +
|
|
50
57
|
" Set the active agent identity used by `watch` and `start`.\n",
|
|
51
|
-
start: " agentbridge start [\"intent\"] [
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
watch: " agentbridge watch [--
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
" --
|
|
59
|
-
" --
|
|
58
|
+
start: " agentbridge start [\"intent\"] [--details] [--yes]\n" +
|
|
59
|
+
" Open or close a task checkpoint (not the live watcher).\n" +
|
|
60
|
+
" For live supervision beside Cursor, run `agentbridge watch`.\n" +
|
|
61
|
+
" Record proof: `agentbridge verify -- <test command>`.\n",
|
|
62
|
+
watch: " agentbridge watch [--allow-dirty] [--once] [--daemon] [--details] [--task \"<summary>\"] [--scope \"<path>\"]\n" +
|
|
63
|
+
" Primary live supervision command — run beside Cursor while the agent codes.\n" +
|
|
64
|
+
" Shows MCP-declared intent and disk changes; warns on scope drift.\n" +
|
|
65
|
+
" No --task or --scope required for normal use.\n" +
|
|
66
|
+
" --task / --scope Optional strict mode (both required together).\n" +
|
|
67
|
+
" --allow-dirty Skip the pre-existing dirty-files prompt.\n" +
|
|
68
|
+
" --once Run one supervision pass and exit.\n" +
|
|
69
|
+
" --daemon Non-interactive mode: skip prompts, auto-deny domain crossings.\n" +
|
|
70
|
+
" --change-request / --execution-surface Advanced session binding.\n",
|
|
60
71
|
"setup-mcp": " agentbridge setup-mcp [--editor cursor|windsurf|vscode]\n" +
|
|
61
72
|
" Print the MCP server configuration snippet to add to your editor.\n",
|
|
62
73
|
mcp: " agentbridge mcp\n" +
|
|
@@ -64,6 +75,8 @@ const COMMAND_HELP = {
|
|
|
64
75
|
status: " agentbridge status [--repair] [--json]\n Show current work session status.\n",
|
|
65
76
|
health: " agentbridge health [--json]\n Check project health against server.\n",
|
|
66
77
|
check: " agentbridge check [--json]\n Check whether current work session can be accepted.\n",
|
|
78
|
+
"proof-guidance": " agentbridge proof-guidance [--work-session <id>] [--change-request <id>] [--rollout-proof-too-weak warn_only|soft_fail|hard_fail]\n" +
|
|
79
|
+
" Print deterministic proof guidance JSON for the current or specified session.\n",
|
|
67
80
|
next: " agentbridge next [--json]\n Show the recommended next action.\n",
|
|
68
81
|
verify: " agentbridge verify [--json] -- <command>\n" +
|
|
69
82
|
" Run a command and verify output meets acceptance criteria.\n",
|
|
@@ -82,6 +95,9 @@ const COMMAND_HELP = {
|
|
|
82
95
|
" Manage domain memory packets.\n",
|
|
83
96
|
version: " agentbridge version\n Print CLI version.\n",
|
|
84
97
|
doctor: " agentbridge doctor\n Run config and connectivity diagnostics.\n",
|
|
98
|
+
"install-rules": " agentbridge install-rules [--project <id>] [--api-key <key>] [--api-base-url <url>]\n" +
|
|
99
|
+
" Fetch server protocol rules for the connected project, write AGENTBRIDGE.md and\n" +
|
|
100
|
+
" .cursor/rules/agentbridge.mdc, and mark rules installed on the server.\n",
|
|
85
101
|
"precommit-check": " agentbridge precommit-check\n Git pre-commit hook: block commits that violate domain boundaries.\n",
|
|
86
102
|
bug: " agentbridge bug report --title \"<text>\" --severity P0|P1|P2|P3 --category <CATEGORY> \\\n" +
|
|
87
103
|
" [--found-in dogfood,production,...] --observed \"<text>\" --expected \"<text>\" \\\n" +
|
|
@@ -103,30 +119,28 @@ function usage(command, opts) {
|
|
|
103
119
|
"Usage: agentbridge <command> [flags]",
|
|
104
120
|
"",
|
|
105
121
|
"Quick start:",
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
" agentbridge doctor",
|
|
111
|
-
" agentbridge recover",
|
|
112
|
-
" agentbridge start",
|
|
122
|
+
" agentbridge recover Understand an existing repo (first time)",
|
|
123
|
+
" agentbridge watch Live supervision beside Cursor (primary watcher)",
|
|
124
|
+
" agentbridge start [\"intent\"] Task checkpoint / close (not the live watcher)",
|
|
125
|
+
" agentbridge verify -- <command> Record verification proof AgentBridge trusts",
|
|
113
126
|
"",
|
|
114
|
-
"
|
|
115
|
-
" doctor
|
|
116
|
-
"
|
|
117
|
-
"
|
|
127
|
+
"Setup:",
|
|
128
|
+
" agentbridge doctor Check connection and repo readiness",
|
|
129
|
+
" agentbridge connect Save credentials (cloud projects)",
|
|
130
|
+
" agentbridge room exit Clear stale room credentials (no server call)",
|
|
131
|
+
" agentbridge install-rules Install server protocol rules in this repo",
|
|
118
132
|
"",
|
|
119
133
|
"Advanced commands:",
|
|
120
|
-
"
|
|
134
|
+
" start --task ... --scope ... Strict scoped session (both flags required)",
|
|
121
135
|
" init Recover domain map from git history and bootstrap the project",
|
|
122
136
|
" use Set active agent identity",
|
|
123
|
-
" watch
|
|
124
|
-
" start --summary ... --scope ... Backward-compatible explicit start mode",
|
|
137
|
+
" watch --task ... --scope ... Strict scope mode (optional flags on watch)",
|
|
125
138
|
" setup-mcp Print MCP server config for your editor",
|
|
126
139
|
" mcp Start local MCP stdio server",
|
|
127
140
|
" status Show current session status",
|
|
128
141
|
" health Check project health",
|
|
129
142
|
" check Check acceptance readiness",
|
|
143
|
+
" proof-guidance Print deterministic proof guidance JSON",
|
|
130
144
|
" next Show recommended next action",
|
|
131
145
|
" verify Run command and verify output",
|
|
132
146
|
" handoff Submit a handoff with proof of work",
|
|
@@ -260,6 +274,27 @@ async function main() {
|
|
|
260
274
|
});
|
|
261
275
|
return;
|
|
262
276
|
}
|
|
277
|
+
if (command === "room") {
|
|
278
|
+
const sub = positional[0] ?? "";
|
|
279
|
+
if (sub === "exit") {
|
|
280
|
+
(0, room_1.runRoomExit)({
|
|
281
|
+
keepSession: flags["--keep-session"] === "true",
|
|
282
|
+
json: flags["--json"] === "true",
|
|
283
|
+
});
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
process.stderr.write("Usage: agentbridge room exit [--keep-session] [--json]\n");
|
|
287
|
+
process.exit(3);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
if (command === "install-rules") {
|
|
291
|
+
await (0, install_rules_1.runInstallRules)({
|
|
292
|
+
projectId,
|
|
293
|
+
apiKey,
|
|
294
|
+
apiBaseUrl,
|
|
295
|
+
});
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
263
298
|
if (command === "recover") {
|
|
264
299
|
await (0, recover_1.runRecover)({ force: Boolean(flags["--force"]) });
|
|
265
300
|
return;
|
|
@@ -269,27 +304,27 @@ async function main() {
|
|
|
269
304
|
return;
|
|
270
305
|
}
|
|
271
306
|
if (command === "mcp") {
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
if (!(0, node_fs_1.existsSync)(localMcpEntrypoint)) {
|
|
307
|
+
const runtime = (0, mcp_runtime_1.resolveMcpRuntime)(__dirname);
|
|
308
|
+
if (!runtime) {
|
|
275
309
|
process.stderr.write([
|
|
276
310
|
"",
|
|
277
311
|
"AgentBridge MCP runtime is unavailable in this installation.",
|
|
278
312
|
"",
|
|
279
313
|
"Try:",
|
|
280
|
-
" npm install -g @
|
|
314
|
+
" npm install -g @agentbridge1/cli@latest",
|
|
281
315
|
" agentbridge doctor",
|
|
282
316
|
"",
|
|
283
317
|
].join("\n"));
|
|
284
318
|
process.exit(2);
|
|
285
319
|
return;
|
|
286
320
|
}
|
|
287
|
-
const child = (0, node_child_process_1.spawnSync)(
|
|
321
|
+
const child = (0, node_child_process_1.spawnSync)(runtime.command, runtime.args, {
|
|
288
322
|
stdio: "inherit",
|
|
289
323
|
env: process.env,
|
|
290
324
|
});
|
|
291
325
|
if (child.error) {
|
|
292
|
-
|
|
326
|
+
const via = runtime.mode === "bundled" ? "node" : "npx/tsx";
|
|
327
|
+
process.stderr.write(`Failed to start MCP server via ${via}: ${child.error.message}\n`);
|
|
293
328
|
process.exit(2);
|
|
294
329
|
return;
|
|
295
330
|
}
|
|
@@ -336,6 +371,7 @@ async function main() {
|
|
|
336
371
|
allowDirty: flags["--allow-dirty"] === "true",
|
|
337
372
|
daemon: flags["--daemon"] === "true",
|
|
338
373
|
once: flags["--once"] === "true",
|
|
374
|
+
details: flags["--details"] === "true",
|
|
339
375
|
});
|
|
340
376
|
return;
|
|
341
377
|
}
|
|
@@ -353,6 +389,8 @@ async function main() {
|
|
|
353
389
|
executionSurfaceId: flags["--execution-surface"],
|
|
354
390
|
changeRequestId: flags["--change-request"],
|
|
355
391
|
resume: flags["--resume"] === "true",
|
|
392
|
+
details: flags["--details"] === "true",
|
|
393
|
+
confirmClose: flags["--yes"] === "true",
|
|
356
394
|
});
|
|
357
395
|
return;
|
|
358
396
|
}
|
|
@@ -381,6 +419,16 @@ async function main() {
|
|
|
381
419
|
await (0, check_1.runCheck)({ json: flags["--json"] === "true" });
|
|
382
420
|
return;
|
|
383
421
|
}
|
|
422
|
+
if (command === "proof-guidance") {
|
|
423
|
+
await (0, proof_guidance_1.runProofGuidance)({
|
|
424
|
+
workSessionId: flags["--work-session"],
|
|
425
|
+
changeRequestId: flags["--change-request"],
|
|
426
|
+
rolloutProofTooWeak: flags["--rollout-proof-too-weak"],
|
|
427
|
+
rolloutProofNotRelevant: flags["--rollout-proof-not-relevant"],
|
|
428
|
+
rolloutImpactCoverageGap: flags["--rollout-impact-coverage-gap"],
|
|
429
|
+
});
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
384
432
|
if (command === "next") {
|
|
385
433
|
await (0, next_1.runNext)({ json: flags["--json"] === "true" });
|
|
386
434
|
return;
|