@bridge_gpt/mcp-server 0.2.65 → 0.2.66
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 +25 -13
- package/build/agent-launchers/claude-executor-adapter.js +12 -18
- package/build/agent-launchers/executor-adapter.js +27 -0
- package/build/bridge-config.js +104 -0
- package/build/codex-bridge-profile.js +10 -1
- package/build/commands.generated.js +4 -4
- package/build/conductor/bridge-api-client.js +230 -10
- package/build/conductor/epic-child-continuation.js +61 -34
- package/build/conductor/epic-implementer-cli.js +12 -0
- package/build/conductor/guided-repair.js +323 -0
- package/build/conductor/readiness-cli.js +30 -9
- package/build/conductor/readiness.js +23 -1
- package/build/conductor/recovery-cli.js +507 -16
- package/build/conductor/recovery-operations.js +325 -2
- package/build/conductor/repair-contract.js +61 -3
- package/build/credential-store.js +5 -4
- package/build/diagnostic-text.js +36 -0
- package/build/docs.generated.js +1 -1
- package/build/doctor.js +70 -10
- package/build/drive-epic.js +395 -78
- package/build/epic-implementer-bin.js +24 -22
- package/build/epic-launch-diagnostic.js +31 -0
- package/build/epic-launch-profile.js +44 -14
- package/build/executor/completion-supervision.js +5 -0
- package/build/executor/correction-dispatch.js +60 -0
- package/build/executor/env.js +6 -0
- package/build/executor/http-client.js +15 -0
- package/build/executor/integration-job.js +6 -1
- package/build/executor/job-errors.js +13 -4
- package/build/executor/job-log-registry.js +340 -73
- package/build/executor/job-runner.js +260 -33
- package/build/executor/job-types.js +8 -13
- package/build/executor/preflight.js +91 -2
- package/build/executor/prompt-spec.js +113 -9
- package/build/executor/runner.js +23 -0
- package/build/executor/stale-artifacts.js +5 -4
- package/build/executor/types.js +1 -0
- package/build/executor/watch-cli.js +35 -8
- package/build/executor/worker-command.js +43 -43
- package/build/executor/worker-finalization.js +80 -15
- package/build/executor/worker-guard-hook.js +46 -10
- package/build/executor/worker-log.js +137 -70
- package/build/executor/worktree-gc.js +30 -6
- package/build/index.js +177 -329
- package/build/init.js +107 -4
- package/build/install-bridge.js +284 -20
- package/build/install-doctor.js +172 -30
- package/build/install-reexec.js +69 -7
- package/build/macos-terminal-permission-guidance.js +16 -0
- package/build/model-thresholds-tool.js +185 -0
- package/build/pipelines.generated.js +1 -1
- package/build/plane/status.js +4 -0
- package/build/plane/supervisor.js +4 -0
- package/build/plane/worker-exit-code.js +2 -0
- package/build/project-root.js +99 -0
- package/build/readme.generated.js +1 -1
- package/build/review-tickets.js +156 -13
- package/build/setup-epic.js +180 -108
- package/build/sfcc/setup-status.js +2 -0
- package/build/sfcc/tool-wrapper.js +2 -0
- package/build/sfcc/tools-configured.js +96 -0
- package/build/start-tickets.js +163 -58
- package/build/upgrade-cli.js +109 -24
- package/build/version.generated.js +3 -3
- package/build/windows-npm-entry.js +103 -0
- package/build/worker-guard-hook-bin.js +4 -3
- package/build/worktree-core.js +6 -5
- package/docs/install/mcp-tool-integrations.md +1 -0
- package/docs/install/sfcc-integration.md +12 -7
- package/package.json +1 -1
- package/pipelines/implement-ticket.json +1 -1
package/build/project-root.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* so this stays trivially testable and swappable.
|
|
17
17
|
*/
|
|
18
18
|
import path from "path";
|
|
19
|
+
import { renderDiagnosticValue } from "./diagnostic-text.js";
|
|
19
20
|
/**
|
|
20
21
|
* Whether `cwd` looks like a project root: presence of `.git`, checked through the
|
|
21
22
|
* injected `stat` probe. Any probe failure (absent, or an unexpected I/O error) is
|
|
@@ -32,3 +33,101 @@ export async function hasProjectRootMarker(cwd, stat) {
|
|
|
32
33
|
return false;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Validate an explicit project root: it must exist, be a directory, and contain
|
|
38
|
+
* `.git` (a directory, or the `.git` FILE a worktree has) or `.bridge/config`.
|
|
39
|
+
* An absent path is `missing`; anything else that fails — a file, a folder with
|
|
40
|
+
* neither marker, or an inaccessible path — is `not-a-project`. Raw filesystem
|
|
41
|
+
* errors never leave this function.
|
|
42
|
+
*
|
|
43
|
+
* Deliberately a SIBLING of {@link hasProjectRootMarker}, which stays `.git`-only
|
|
44
|
+
* because `install` and `--init` use it and the README pins that wording. A
|
|
45
|
+
* marker proves only that the path looks like a project, not that it is THIS
|
|
46
|
+
* project; the stderr source line is how a wrong-but-valid root is noticed.
|
|
47
|
+
*/
|
|
48
|
+
export async function validateExplicitProjectRoot(root, stat) {
|
|
49
|
+
let info;
|
|
50
|
+
try {
|
|
51
|
+
info = await stat(root);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const code = error?.code;
|
|
55
|
+
return { ok: false, reason: code === "ENOENT" || code === "ENOTDIR" ? "missing" : "not-a-project" };
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
if (!info.isDirectory())
|
|
59
|
+
return { ok: false, reason: "not-a-project" };
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return { ok: false, reason: "not-a-project" };
|
|
63
|
+
}
|
|
64
|
+
for (const marker of [path.join(root, ".git"), path.join(root, ".bridge", "config")]) {
|
|
65
|
+
try {
|
|
66
|
+
await stat(marker);
|
|
67
|
+
return { ok: true };
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
/* try the next marker */
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { ok: false, reason: "not-a-project" };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Resolve the project root in the fixed order: a VALID `BAPI_PROJECT_ROOT`,
|
|
77
|
+
* then MCP `roots/list`, then `CLAUDE_PROJECT_DIR`, then `cwd`. Only the explicit
|
|
78
|
+
* value is validated — it is the one source written into (possibly committed)
|
|
79
|
+
* config files, so it is the one that can name another machine's path. The later
|
|
80
|
+
* sources come from the running host and keep today's behavior. An empty or
|
|
81
|
+
* whitespace `BAPI_PROJECT_ROOT` is treated as unset.
|
|
82
|
+
*
|
|
83
|
+
* Pure apart from the injected seams, so `index.ts` (which cannot be imported in
|
|
84
|
+
* tests) stays a thin wrapper over this.
|
|
85
|
+
*/
|
|
86
|
+
export async function resolveProjectRoot(options) {
|
|
87
|
+
let rejectedExplicit;
|
|
88
|
+
const explicit = (options.env.BAPI_PROJECT_ROOT ?? "").trim();
|
|
89
|
+
if (explicit.length > 0) {
|
|
90
|
+
const verdict = await validateExplicitProjectRoot(explicit, options.stat);
|
|
91
|
+
if (verdict.ok)
|
|
92
|
+
return { root: explicit, source: "BAPI_PROJECT_ROOT" };
|
|
93
|
+
rejectedExplicit = { path: explicit, reason: verdict.reason };
|
|
94
|
+
}
|
|
95
|
+
const withRejection = (root, source) => rejectedExplicit ? { root, source, rejectedExplicit } : { root, source };
|
|
96
|
+
let fromRoots = null;
|
|
97
|
+
try {
|
|
98
|
+
fromRoots = await options.listRoots();
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
fromRoots = null;
|
|
102
|
+
}
|
|
103
|
+
if (fromRoots && fromRoots.length > 0)
|
|
104
|
+
return withRejection(fromRoots, "roots/list");
|
|
105
|
+
const claudeDir = (options.env.CLAUDE_PROJECT_DIR ?? "").trim();
|
|
106
|
+
if (claudeDir.length > 0)
|
|
107
|
+
return withRejection(claudeDir, "CLAUDE_PROJECT_DIR");
|
|
108
|
+
return withRejection(options.cwd(), "cwd");
|
|
109
|
+
}
|
|
110
|
+
/** Resolve `BAPI_DOCS_DIR` (default `docs/tmp`) against the chosen project root. */
|
|
111
|
+
export function resolveDocsDirForRoot(root, env) {
|
|
112
|
+
return path.resolve(root, env.BAPI_DOCS_DIR ?? "docs/tmp");
|
|
113
|
+
}
|
|
114
|
+
/** Human wording for each closed refusal reason. */
|
|
115
|
+
export const PROJECT_ROOT_REFUSAL_TEXT = {
|
|
116
|
+
missing: "does not exist",
|
|
117
|
+
"not-a-project": "is not a project folder (no .git or .bridge/config)",
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* The one stderr line the server writes when it first resolves the root, e.g.
|
|
121
|
+
* `Bridge MCP: project root /home/b/app (from roots/list); BAPI_PROJECT_ROOT
|
|
122
|
+
* /Users/a/app ignored: does not exist`. Paths are rendered on one line with
|
|
123
|
+
* control characters escaped.
|
|
124
|
+
*/
|
|
125
|
+
export function formatProjectRootSourceLine(resolved) {
|
|
126
|
+
let line = `Bridge MCP: project root ${renderDiagnosticValue(resolved.root)} (from ${resolved.source})`;
|
|
127
|
+
if (resolved.rejectedExplicit) {
|
|
128
|
+
line +=
|
|
129
|
+
`; BAPI_PROJECT_ROOT ${renderDiagnosticValue(resolved.rejectedExplicit.path)} ignored: ` +
|
|
130
|
+
PROJECT_ROOT_REFUSAL_TEXT[resolved.rejectedExplicit.reason];
|
|
131
|
+
}
|
|
132
|
+
return line;
|
|
133
|
+
}
|