@bridge_gpt/mcp-server 0.2.56 → 0.2.58
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 +23 -6
- package/build/codex-bridge-profile.js +155 -0
- package/build/codex-home.js +7 -0
- package/build/codex-launch-scope.js +23 -7
- package/build/commands.generated.js +2 -2
- package/build/cursor-agent-progress.js +72 -0
- package/build/doctor.js +8 -1
- package/build/epic-implementer-bin.js +4 -4
- package/build/index.js +98 -94
- package/build/install-bridge.js +48 -1
- package/build/install-doctor.js +1 -1
- package/build/mcp-host-config.js +4 -0
- package/build/mcp-host-targets.js +3 -0
- package/build/pipelines.generated.js +4 -4
- package/build/readme.generated.js +1 -1
- package/build/start-tickets.js +95 -24
- package/build/version.generated.js +3 -3
- package/package.json +1 -1
- package/pipelines/implement-ticket.json +2 -2
- package/pipelines/review-ticket.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** Human-readable progress for headless Cursor runs without exposing tool payloads. */
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { createInterface } from "node:readline";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
/** Only render assistant prose and tool NAMES; tool arguments/results may contain secrets. */
|
|
7
|
+
export function formatCursorProgressEvent(event) {
|
|
8
|
+
if (event.type === "system" && event.subtype === "init") {
|
|
9
|
+
return "Cursor agent started. Progress will appear below.\n";
|
|
10
|
+
}
|
|
11
|
+
if (event.type === "assistant") {
|
|
12
|
+
const content = event.message?.content;
|
|
13
|
+
const prose = (Array.isArray(content) ? content : [])
|
|
14
|
+
.filter((item) => item && item.type === "text" && typeof item.text === "string")
|
|
15
|
+
.map((item) => item.text)
|
|
16
|
+
.join("");
|
|
17
|
+
return prose ? `${prose}\n` : null;
|
|
18
|
+
}
|
|
19
|
+
if (event.type === "tool_call" && event.subtype === "started") {
|
|
20
|
+
const call = event.tool_call;
|
|
21
|
+
const name = call && typeof call === "object" && !Array.isArray(call)
|
|
22
|
+
? Object.keys(call)[0]
|
|
23
|
+
: undefined;
|
|
24
|
+
if (!name)
|
|
25
|
+
return "Working with a tool...\n";
|
|
26
|
+
const label = name.replace(/ToolCall$/, "").replace(/([a-z])([A-Z])/g, "$1 $2").toLowerCase();
|
|
27
|
+
return `Using ${label}...\n`;
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
async function main(argv) {
|
|
32
|
+
const args = argv[0] === "--" ? argv.slice(1) : argv;
|
|
33
|
+
if (args[0] !== "cursor-agent") {
|
|
34
|
+
process.stderr.write("cursor-agent-progress expects cursor-agent as its child command.\n");
|
|
35
|
+
return 2;
|
|
36
|
+
}
|
|
37
|
+
const child = spawn(args[0], args.slice(1), { stdio: ["inherit", "pipe", "inherit"] });
|
|
38
|
+
const forwardSignal = (signal) => child.kill(signal);
|
|
39
|
+
process.on("SIGINT", forwardSignal);
|
|
40
|
+
process.on("SIGTERM", forwardSignal);
|
|
41
|
+
const completion = new Promise((resolve) => {
|
|
42
|
+
child.once("close", (code, signal) => resolve(code ?? (signal ? 128 : 1)));
|
|
43
|
+
child.once("error", () => resolve(1));
|
|
44
|
+
});
|
|
45
|
+
const lines = createInterface({ input: child.stdout });
|
|
46
|
+
let sawAssistantText = false;
|
|
47
|
+
for await (const line of lines) {
|
|
48
|
+
let event;
|
|
49
|
+
try {
|
|
50
|
+
event = JSON.parse(line);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const rendered = formatCursorProgressEvent(event);
|
|
56
|
+
if (rendered) {
|
|
57
|
+
if (event.type === "assistant")
|
|
58
|
+
sawAssistantText = true;
|
|
59
|
+
process.stdout.write(rendered);
|
|
60
|
+
}
|
|
61
|
+
if (event.type === "result" && !sawAssistantText && typeof event.result === "string") {
|
|
62
|
+
process.stdout.write(`${event.result}\n`);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const exit = await completion;
|
|
66
|
+
process.off("SIGINT", forwardSignal);
|
|
67
|
+
process.off("SIGTERM", forwardSignal);
|
|
68
|
+
return exit;
|
|
69
|
+
}
|
|
70
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
71
|
+
void main(process.argv.slice(2)).then((code) => { process.exitCode = code; });
|
|
72
|
+
}
|
package/build/doctor.js
CHANGED
|
@@ -21,6 +21,7 @@ import path from "path";
|
|
|
21
21
|
import { createDefaultStartTicketsDeps } from "./start-tickets.js";
|
|
22
22
|
import { VERSION, BUILD_COMMIT } from "./version.generated.js";
|
|
23
23
|
import { collectInstallStatusChecks, formatInstallStatusReport, formatInstallStatusFallbackReport, resolveInstallDoctorTarget, } from "./install-doctor.js";
|
|
24
|
+
import { codexHome, inspectBridgeCodexProfile } from "./codex-bridge-profile.js";
|
|
24
25
|
import { inspectExecutorAgentAdapter, inspectionForFailedResolution, } from "./agent-launchers/executor-adapter-inspection.js";
|
|
25
26
|
import { resolveExecutorAgentAdapter } from "./agent-launchers/executor-adapter-registry.js";
|
|
26
27
|
import { parseDefaultOnEnvFlag } from "./env-flags.js";
|
|
@@ -1743,7 +1744,13 @@ export async function runDoctorCli(argv, overrides = {}) {
|
|
|
1743
1744
|
}
|
|
1744
1745
|
}
|
|
1745
1746
|
if (parsed.options.agentName === "codex") {
|
|
1746
|
-
|
|
1747
|
+
const readCodexFile = deps.readFile ?? ((p) => readFile(p, "utf-8"));
|
|
1748
|
+
const profile = await inspectBridgeCodexProfile(codexHome(deps.env), readCodexFile);
|
|
1749
|
+
log(profile.status === "active"
|
|
1750
|
+
? "Codex Bridge approval profile installed; spawned workers use --profile bridge."
|
|
1751
|
+
: profile.status === "stale"
|
|
1752
|
+
? "Codex Bridge approval profile is an older unmodified managed version; the next spawned worker refreshes it before launch."
|
|
1753
|
+
: `Codex Bridge approval profile ${profile.status}; spawned workers use existing Codex approvals. Run install --tools=codex --codex-profile=on to opt in.`);
|
|
1747
1754
|
}
|
|
1748
1755
|
log(formatDoctorPrereqSection(deps.platform, collection));
|
|
1749
1756
|
// Executor-adapter section (BAPI-781). Advisory with respect to the EXIT CODE
|