@bridge_gpt/mcp-server 0.2.60 → 0.2.65
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 +58 -11
- package/build/agent-launchers/claude-executor-adapter.js +134 -3
- package/build/agent-launchers/executor-adapter.js +54 -2
- package/build/agents.generated.js +10 -1
- package/build/bounded-wait.js +32 -1
- package/build/commands.generated.js +8 -7
- package/build/conductor/bridge-api-client.js +678 -14
- package/build/conductor/bring-up-facts.js +3 -1
- package/build/conductor/doctor.js +23 -14
- package/build/conductor/epic-child-continuation.js +324 -0
- package/build/conductor/epic-implementer-cli.js +142 -17
- package/build/conductor/git-hooks.js +529 -118
- package/build/conductor/hook-runtime-qualification.js +340 -0
- package/build/conductor/merge-execution-contract.js +30 -5
- package/build/conductor/merge-execution-eligibility.js +10 -9
- package/build/conductor/readiness-sections.js +104 -20
- package/build/conductor/readiness.js +129 -25
- package/build/conductor/recovery-cli.js +354 -13
- package/build/conductor/recovery-operations.js +251 -5
- package/build/conductor/repair-contract.js +8 -0
- package/build/conductor-bundle-artifacts.js +1 -0
- package/build/credential-store.js +194 -0
- package/build/docs.generated.js +2 -1
- package/build/doctor.js +161 -7
- package/build/drive-epic-key.js +12 -0
- package/build/drive-epic.js +1318 -111
- package/build/epic-coherence-input-cli.js +137 -0
- package/build/epic-coherence-input.js +920 -0
- package/build/epic-coherence-input.test-fixtures.js +175 -0
- package/build/epic-implementer-bin.js +35 -29
- package/build/epic-implementer-bundle-cli.js +14 -1
- package/build/epic-integration-pr.js +61 -15
- package/build/epic-launch-profile.js +464 -0
- package/build/epic-run-status.js +5 -0
- package/build/epic-shared/bridge-client.js +46 -4
- package/build/executor/cli.js +48 -0
- package/build/executor/completion-contract.js +423 -0
- package/build/executor/completion-supervision.js +286 -0
- package/build/executor/credentials.js +19 -1
- package/build/executor/deps.js +65 -1
- package/build/executor/env.js +6 -0
- package/build/executor/heartbeat.js +13 -3
- package/build/executor/http-client.js +117 -1
- package/build/executor/integration-job.js +759 -0
- package/build/executor/job-errors.js +48 -0
- package/build/executor/job-runner.js +1386 -35
- package/build/executor/job-types.js +10 -2
- package/build/executor/observation.js +114 -7
- package/build/executor/preflight.js +99 -0
- package/build/executor/process-containment.js +756 -0
- package/build/executor/process.js +235 -5
- package/build/executor/prompt-spec.js +262 -1
- package/build/executor/provider-checks.js +69 -0
- package/build/executor/rebase-finalization.js +351 -0
- package/build/executor/reconcile-overlap-job.js +77 -84
- package/build/executor/required-verification.js +313 -0
- package/build/executor/required-work-ledger.js +1121 -0
- package/build/executor/results.js +142 -0
- package/build/executor/resume-pre-spawn.js +87 -4
- package/build/executor/runner.js +246 -1
- package/build/executor/test-declaration.js +20 -0
- package/build/executor/types.js +55 -0
- package/build/executor/worker-command.js +49 -13
- package/build/executor/worker-finalization.js +88 -11
- package/build/executor/worker-guard-hook.js +29 -4
- package/build/executor/worktree.js +13 -0
- package/build/executor-launch.js +658 -0
- package/build/index.js +772 -954
- package/build/install-bridge-conductor.js +622 -40
- package/build/install-bridge.js +92 -16
- package/build/merge-pull-request.js +1 -1
- package/build/merge-workflow-config.js +54 -0
- package/build/merge-workflow-drift.js +35 -4
- package/build/merge-workflow.js +386 -2
- package/build/pipelines.generated.js +9 -8
- package/build/plan-discovery.js +137 -0
- package/build/plan-epic-implementer-eligibility.js +2 -2
- package/build/plane/cli.js +37 -3
- package/build/plane/member-logs.js +3 -0
- package/build/plane/member-roster.js +7 -1
- package/build/plane/shutdown.js +59 -1
- package/build/plane/supervisor.js +148 -0
- package/build/readme.generated.js +1 -1
- package/build/scripts/executor-protocol-contract-driver.js +13 -3
- package/build/setup-epic.js +130 -48
- package/build/version.generated.js +3 -3
- package/build/worker-guard-hook-bin.js +2 -2
- package/docs/CONDUCTOR.md +116 -2
- package/package.json +2 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BAPI-1320: thin CLI handler for the `epic-coherence-input` subcommand.
|
|
3
|
+
*
|
|
4
|
+
* The coherence procedure ships to consumer repositories, where
|
|
5
|
+
* `mcp_server/src/` does not exist, so authors who draft an epic as local
|
|
6
|
+
* markdown files reach the builder through this packaged subcommand. It holds
|
|
7
|
+
* no policy of its own: it parses argv, delegates to `epic-coherence-input.ts`,
|
|
8
|
+
* and prints exactly one JSON envelope on stdout. Diagnostics go only to the
|
|
9
|
+
* injected stderr logger. It never starts the MCP server.
|
|
10
|
+
*/
|
|
11
|
+
import { buildEpicCoherenceInput, checkEpicCoherenceInput, } from "./epic-coherence-input.js";
|
|
12
|
+
const USAGE = [
|
|
13
|
+
"Usage: epic-coherence-input build --outline <path> --out <path>",
|
|
14
|
+
" epic-coherence-input check <path>",
|
|
15
|
+
"",
|
|
16
|
+
" build Build epic-coherence-input.json from an outline and local markdown",
|
|
17
|
+
" drafts, validate it, and print its three digests. Writes nothing",
|
|
18
|
+
" when parsing or validation fails.",
|
|
19
|
+
" check Structurally validate an existing input document and print its",
|
|
20
|
+
" three digests. Never judges coverage. Writes nothing.",
|
|
21
|
+
"",
|
|
22
|
+
"Every path is repository-relative to the current directory.",
|
|
23
|
+
" -h, --help Show this help.",
|
|
24
|
+
].join("\n");
|
|
25
|
+
/** Parse argv into the help / error / ok shape. Never throws. */
|
|
26
|
+
export function parseEpicCoherenceInputArgs(argv) {
|
|
27
|
+
const mode = argv[0];
|
|
28
|
+
if (mode === undefined || mode === "-h" || mode === "--help")
|
|
29
|
+
return { kind: "help" };
|
|
30
|
+
if (argv.includes("-h") || argv.includes("--help"))
|
|
31
|
+
return { kind: "help" };
|
|
32
|
+
if (mode === "check") {
|
|
33
|
+
const rest = argv.slice(1);
|
|
34
|
+
if (rest.length !== 1 || rest[0].startsWith("-")) {
|
|
35
|
+
return { kind: "error", message: "check takes exactly one input path." };
|
|
36
|
+
}
|
|
37
|
+
return { kind: "ok", options: { mode: "check", input: rest[0] } };
|
|
38
|
+
}
|
|
39
|
+
if (mode === "build") {
|
|
40
|
+
let outline;
|
|
41
|
+
let out;
|
|
42
|
+
for (let i = 1; i < argv.length; i++) {
|
|
43
|
+
const arg = argv[i];
|
|
44
|
+
const value = argv[i + 1];
|
|
45
|
+
if (arg === "--outline" || arg === "--out") {
|
|
46
|
+
if (value === undefined || value.startsWith("-")) {
|
|
47
|
+
return { kind: "error", message: `Flag "${arg}" requires a value.` };
|
|
48
|
+
}
|
|
49
|
+
if (arg === "--outline")
|
|
50
|
+
outline = value;
|
|
51
|
+
else
|
|
52
|
+
out = value;
|
|
53
|
+
i++;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
return { kind: "error", message: `Unknown argument "${arg}".` };
|
|
57
|
+
}
|
|
58
|
+
if (!outline)
|
|
59
|
+
return { kind: "error", message: 'Flag "--outline" is required.' };
|
|
60
|
+
if (!out)
|
|
61
|
+
return { kind: "error", message: 'Flag "--out" is required.' };
|
|
62
|
+
return { kind: "ok", options: { mode: "build", outline, out } };
|
|
63
|
+
}
|
|
64
|
+
return { kind: "error", message: `Unknown mode "${mode}". Expected "build" or "check".` };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Run the `epic-coherence-input` subcommand. Returns 0 or 1 and never throws:
|
|
68
|
+
* every handled invocation prints exactly one JSON envelope on stdout.
|
|
69
|
+
*/
|
|
70
|
+
export async function runEpicCoherenceInputCli(argv, overrides = {}) {
|
|
71
|
+
const deps = {
|
|
72
|
+
env: process.env,
|
|
73
|
+
cwd: process.cwd(),
|
|
74
|
+
fs: createDefaultFs(),
|
|
75
|
+
log: (m) => process.stdout.write(`${m}\n`),
|
|
76
|
+
errorLog: (m) => process.stderr.write(`${m}\n`),
|
|
77
|
+
...overrides,
|
|
78
|
+
};
|
|
79
|
+
const emitFailure = (error, errors) => {
|
|
80
|
+
deps.log(JSON.stringify({ ok: false, error, errors }));
|
|
81
|
+
deps.errorLog(`Error: ${error}`);
|
|
82
|
+
for (const detail of errors)
|
|
83
|
+
deps.errorLog(` - ${detail}`);
|
|
84
|
+
return 1;
|
|
85
|
+
};
|
|
86
|
+
const parsed = parseEpicCoherenceInputArgs(argv);
|
|
87
|
+
if (parsed.kind === "help") {
|
|
88
|
+
deps.errorLog(USAGE);
|
|
89
|
+
deps.log(JSON.stringify({ ok: true, usage: USAGE }));
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
if (parsed.kind === "error") {
|
|
93
|
+
deps.errorLog(USAGE);
|
|
94
|
+
return emitFailure(parsed.message, [parsed.message]);
|
|
95
|
+
}
|
|
96
|
+
const builderDeps = { cwd: deps.cwd, fs: deps.fs };
|
|
97
|
+
try {
|
|
98
|
+
if (parsed.options.mode === "build") {
|
|
99
|
+
const result = await buildEpicCoherenceInput({ outlinePath: parsed.options.outline, outPath: parsed.options.out }, builderDeps);
|
|
100
|
+
for (const warning of result.warnings)
|
|
101
|
+
deps.errorLog(`Warning: ${warning}`);
|
|
102
|
+
if (!result.ok) {
|
|
103
|
+
return emitFailure("build failed; nothing was written.", result.errors);
|
|
104
|
+
}
|
|
105
|
+
deps.log(JSON.stringify({
|
|
106
|
+
ok: true,
|
|
107
|
+
output_path: result.value.output_path,
|
|
108
|
+
digests: result.value.digests,
|
|
109
|
+
warnings: result.warnings,
|
|
110
|
+
}));
|
|
111
|
+
return 0;
|
|
112
|
+
}
|
|
113
|
+
const result = await checkEpicCoherenceInput(parsed.options.input, builderDeps);
|
|
114
|
+
if (!result.ok) {
|
|
115
|
+
return emitFailure("check failed: the input document is missing, unreadable, or not structurally valid.", result.errors);
|
|
116
|
+
}
|
|
117
|
+
deps.log(JSON.stringify({ ok: true, digests: result.value.digests, warnings: result.warnings }));
|
|
118
|
+
return 0;
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
122
|
+
return emitFailure(`unexpected failure: ${message}`, [message]);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/** Real filesystem seam, loaded lazily so importing this module stays cheap. */
|
|
126
|
+
function createDefaultFs() {
|
|
127
|
+
return {
|
|
128
|
+
readFile: async (p) => (await import("node:fs/promises")).readFile(p, "utf-8"),
|
|
129
|
+
writeFile: async (p, data) => (await import("node:fs/promises")).writeFile(p, data, "utf-8"),
|
|
130
|
+
rename: async (from, to) => (await import("node:fs/promises")).rename(from, to),
|
|
131
|
+
unlink: async (p) => (await import("node:fs/promises")).unlink(p),
|
|
132
|
+
realpath: async (p) => (await import("node:fs/promises")).realpath(p),
|
|
133
|
+
mkdir: async (p) => {
|
|
134
|
+
await (await import("node:fs/promises")).mkdir(p, { recursive: true });
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|