@bridge_gpt/mcp-server 0.2.65 → 0.2.67
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 +269 -82
- package/build/agent-capabilities/probes.js +15 -5
- package/build/agent-launchers/claude-executor-adapter.js +55 -34
- package/build/agent-launchers/executor-adapter.js +34 -4
- package/build/agents.generated.js +1 -1
- package/build/bounded-wait.js +67 -10
- package/build/bridge-config.js +104 -0
- package/build/codex-bridge-profile.js +10 -1
- package/build/commands.generated.js +12 -12
- package/build/conductor/bridge-api-client.js +372 -10
- package/build/conductor/bring-up-facts.js +1 -1
- package/build/conductor/doctor.js +3 -3
- package/build/conductor/epic-child-continuation.js +61 -34
- package/build/conductor/epic-implementer-cli.js +34 -6
- package/build/conductor/errors.js +4 -3
- package/build/conductor/guided-repair.js +327 -0
- package/build/conductor/hook-runtime-qualification.js +1 -1
- package/build/conductor/merge-execution-contract.js +27 -8
- package/build/conductor/merge-execution-eligibility.js +3 -2
- package/build/conductor/pr-ci-producer.js +1 -1
- package/build/conductor/readiness-cli.js +46 -9
- package/build/conductor/readiness-sections.js +41 -6
- package/build/conductor/readiness.js +204 -30
- package/build/conductor/recovery-cli.js +703 -20
- package/build/conductor/recovery-operations.js +392 -3
- package/build/conductor/repair-contract.js +112 -3
- package/build/conductor/repository-workflow-remedy.js +125 -0
- package/build/conductor/tools.js +2 -2
- package/build/conductor-bundle-artifacts.js +8 -0
- package/build/credential-store.js +5 -4
- package/build/diagnostic-text.js +36 -0
- package/build/docs.generated.js +8 -3
- package/build/doctor.js +70 -10
- package/build/drive-epic-key.js +6 -5
- package/build/drive-epic.js +479 -131
- package/build/epic-coherence-input.js +2 -1
- package/build/epic-implementer-bin.js +30 -26
- package/build/epic-implementer-bundle-cli.js +2 -2
- package/build/epic-launch-diagnostic.js +31 -0
- package/build/epic-launch-profile.js +44 -14
- package/build/executor/cli.js +3 -2
- package/build/executor/completion-contract.js +48 -5
- package/build/executor/completion-supervision.js +9 -0
- package/build/executor/correction-dispatch.js +60 -0
- package/build/executor/env.js +25 -0
- package/build/executor/heartbeat.js +1 -1
- package/build/executor/http-client.js +35 -0
- package/build/executor/integration-job.js +6 -1
- package/build/executor/job-errors.js +38 -4
- package/build/executor/job-log-registry.js +340 -73
- package/build/executor/job-runner.js +485 -74
- package/build/executor/job-types.js +8 -13
- package/build/executor/observation.js +6 -1
- package/build/executor/preflight.js +136 -10
- package/build/executor/prompt-spec.js +113 -9
- package/build/executor/required-work-ledger.js +6 -1
- package/build/executor/resume-pre-spawn.js +2 -0
- package/build/executor/runner.js +31 -2
- package/build/executor/service-unit.js +7 -1
- 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 +161 -43
- package/build/executor/worker-guard-hook.js +152 -12
- package/build/executor/worker-log.js +137 -70
- package/build/executor/worktree-gc.js +30 -6
- package/build/executor/worktree.js +82 -1
- package/build/index.js +482 -660
- package/build/init.js +107 -4
- package/build/install-bridge-conductor.js +8 -6
- package/build/install-bridge.js +287 -23
- 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/phase-context-git-probe.js +68 -0
- package/build/phase-result-artifacts.js +173 -5
- package/build/pipelines.generated.js +19 -25
- package/build/plane/alembic-head.js +12 -3
- package/build/plane/base-worktree-guard.js +147 -0
- package/build/plane/cli.js +217 -17
- package/build/plane/code-snapshot.js +468 -0
- package/build/plane/defaults.js +48 -3
- package/build/plane/endpoint.js +41 -0
- package/build/plane/manifest.js +120 -1
- package/build/plane/member-roster.js +94 -19
- package/build/plane/preflight.js +30 -2
- package/build/plane/process-cwd.js +67 -0
- package/build/plane/restart.js +542 -0
- package/build/plane/shutdown.js +31 -0
- package/build/plane/status.js +145 -6
- package/build/plane/supervisor.js +588 -177
- package/build/plane/types.js +54 -2
- package/build/plane/worker-exit-code.js +2 -0
- package/build/printed-remedy-commands.js +37 -0
- package/build/project-root.js +99 -0
- package/build/readiness-check.js +1 -1
- package/build/readme.generated.js +1 -1
- package/build/review-generation.js +22 -0
- package/build/review-tickets.js +156 -13
- package/build/setup-epic.js +224 -127
- package/build/sfcc/config.js +9 -0
- package/build/sfcc/credentials.js +100 -38
- package/build/sfcc/hostname.js +67 -0
- package/build/sfcc/permissions.js +17 -13
- package/build/sfcc/register.js +1 -1
- package/build/sfcc/setup-status.js +2 -0
- package/build/sfcc/tool-wrapper.js +41 -43
- package/build/sfcc/tools-configured.js +96 -0
- package/build/sfcc/write-grants.js +17 -11
- package/build/sfcc/write-result.js +4 -3
- package/build/sfcc/writes-site-preference.js +20 -8
- package/build/start-tickets.js +332 -79
- package/build/tool-error-envelope.js +61 -0
- package/build/upgrade-cli.js +109 -24
- package/build/version.generated.js +3 -3
- package/build/visual-diff.js +22 -1
- package/build/windows-npm-entry.js +103 -0
- package/build/worker-guard-hook-bin.js +3 -5
- package/build/worker-guard-hook-main.js +47 -0
- package/build/worktree-core.js +136 -9
- package/docs/EPIC-IMPLEMENTER-INSTALL.md +849 -0
- package/docs/EPIC-IMPLEMENTER.md +662 -0
- package/docs/install/mcp-tool-integrations.md +25 -15
- package/docs/install/sfcc-integration.md +21 -8
- package/package.json +1 -1
- package/pipelines/implement-ticket.json +1 -1
- package/pipelines/plan-epic.json +0 -5
- package/pipelines/review-ticket.json +1 -1
- package/docs/CONDUCTOR.md +0 -605
- package/pipelines/idea-to-pr.json +0 -49
package/build/bridge-config.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* touching the filesystem or invoking real `git`.
|
|
12
12
|
*/
|
|
13
13
|
import path from "path";
|
|
14
|
+
import { MCP_PACKAGE_NAME } from "./mcp-identity.js";
|
|
14
15
|
/**
|
|
15
16
|
* True if a string contains any ASCII control character (0x00-0x1f or 0x7f).
|
|
16
17
|
* Keeps identifiers path-safe and free of anything that could smuggle into a
|
|
@@ -307,6 +308,109 @@ export function parseBridgeConfigToml(text) {
|
|
|
307
308
|
return { ok: true, manifest: { repoName, mcp: cleaned } };
|
|
308
309
|
}
|
|
309
310
|
// ---------------------------------------------------------------------------
|
|
311
|
+
// Teammate notice, representability, and lossless repo_name rewrite (BAPI-1318)
|
|
312
|
+
// ---------------------------------------------------------------------------
|
|
313
|
+
/**
|
|
314
|
+
* The teammate notice carried in the header of every scaffolded `.bridge/config`,
|
|
315
|
+
* and inserted by a consented repair when an older file lacks it. A teammate who
|
|
316
|
+
* clones a committed project gets this file but no MCP config (`.mcp.json` is
|
|
317
|
+
* gitignored), so this is the one place that tells them to run install.
|
|
318
|
+
*
|
|
319
|
+
* ONE source for both writers ({@link rewriteBridgeConfigRepoName} and
|
|
320
|
+
* `buildBridgeConfigManifest` in `init.ts`), and the exact-text detector for "this
|
|
321
|
+
* file already carries the notice", so the two can never drift.
|
|
322
|
+
*/
|
|
323
|
+
export const BRIDGE_CONFIG_TEAMMATE_NOTICE_LINES = [
|
|
324
|
+
"# Teammates: this file does not connect your editor. Run",
|
|
325
|
+
`# "npx -y ${MCP_PACKAGE_NAME} install" once in this folder.`,
|
|
326
|
+
];
|
|
327
|
+
/**
|
|
328
|
+
* Whether `name` can be written as `repo_name = "<name>"` and read back unchanged
|
|
329
|
+
* by {@link parseBridgeConfigToml}. `validateRepoName()` is deliberately left as
|
|
330
|
+
* it is (it gates every install name input); this is the stricter,
|
|
331
|
+
* manifest-only check the scaffold, post-rename, and repair writers all apply.
|
|
332
|
+
* The quoted-string subset has no escapes, so an embedded `"` or `\` is refused,
|
|
333
|
+
* and surrounding whitespace is refused because the parser would trim it away.
|
|
334
|
+
*/
|
|
335
|
+
export function validateBridgeConfigRepoNameRepresentability(name) {
|
|
336
|
+
const validated = validateRepoName(name);
|
|
337
|
+
if (!validated.ok)
|
|
338
|
+
return validated;
|
|
339
|
+
if (validated.value !== name) {
|
|
340
|
+
return { ok: false, error: "repo_name must not have leading or trailing whitespace" };
|
|
341
|
+
}
|
|
342
|
+
if (validated.value.includes('"')) {
|
|
343
|
+
return { ok: false, error: "repo_name cannot contain a double quote in .bridge/config" };
|
|
344
|
+
}
|
|
345
|
+
if (validated.value.includes("\\")) {
|
|
346
|
+
return { ok: false, error: "repo_name cannot contain a backslash in .bridge/config" };
|
|
347
|
+
}
|
|
348
|
+
return validated;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Rewrite ONLY the quoted value of the single top-level `repo_name` line, and add
|
|
352
|
+
* the teammate notice at the top when its exact lines are absent. Every other
|
|
353
|
+
* byte — comments, blank lines, each `[[mcp]]` block, the `repo_name` line's own
|
|
354
|
+
* indentation and spacing around `=`, and the line endings — is preserved.
|
|
355
|
+
*
|
|
356
|
+
* Pure. The input is parsed first (a malformed file is refused, never rewritten)
|
|
357
|
+
* and the output is parsed again: it must carry the new name and the same ordered
|
|
358
|
+
* `mcp` list, or the rewrite is refused. Refusal messages never echo file content.
|
|
359
|
+
*/
|
|
360
|
+
export function rewriteBridgeConfigRepoName(text, newName) {
|
|
361
|
+
const representable = validateBridgeConfigRepoNameRepresentability(newName);
|
|
362
|
+
if (!representable.ok) {
|
|
363
|
+
return { ok: false, kind: "unrepresentable-name", error: representable.error };
|
|
364
|
+
}
|
|
365
|
+
const before = parseBridgeConfigToml(text);
|
|
366
|
+
if (!before.ok) {
|
|
367
|
+
return { ok: false, kind: "parse-error", error: before.error };
|
|
368
|
+
}
|
|
369
|
+
const eol = text.includes("\r\n") ? "\r\n" : "\n";
|
|
370
|
+
const lines = text.split("\n");
|
|
371
|
+
// Locate the one top-level repo_name line: the parse above proved there is
|
|
372
|
+
// exactly one, and that it sits before the first [[mcp]] header.
|
|
373
|
+
let repoLine = -1;
|
|
374
|
+
for (let i = 0; i < lines.length; i++) {
|
|
375
|
+
const trimmed = lines[i].trim();
|
|
376
|
+
if (trimmed === "[[mcp]]")
|
|
377
|
+
break;
|
|
378
|
+
if (trimmed.startsWith("#") || trimmed.length === 0)
|
|
379
|
+
continue;
|
|
380
|
+
const eq = trimmed.indexOf("=");
|
|
381
|
+
if (eq !== -1 && trimmed.slice(0, eq).trim() === "repo_name") {
|
|
382
|
+
repoLine = i;
|
|
383
|
+
break;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
if (repoLine === -1) {
|
|
387
|
+
return { ok: false, kind: "verification-failed", error: "Could not locate the repo_name line" };
|
|
388
|
+
}
|
|
389
|
+
const original = lines[repoLine];
|
|
390
|
+
const open = original.indexOf('"', original.indexOf("=") + 1);
|
|
391
|
+
const close = original.lastIndexOf('"');
|
|
392
|
+
if (open === -1 || close <= open) {
|
|
393
|
+
return { ok: false, kind: "verification-failed", error: "Could not locate the repo_name value" };
|
|
394
|
+
}
|
|
395
|
+
lines[repoLine] = `${original.slice(0, open + 1)}${representable.value}${original.slice(close)}`;
|
|
396
|
+
let next = lines.join("\n");
|
|
397
|
+
const noticePresent = BRIDGE_CONFIG_TEAMMATE_NOTICE_LINES.every((line) => text.split("\n").some((existing) => existing.replace(/\r$/, "") === line));
|
|
398
|
+
if (!noticePresent) {
|
|
399
|
+
next = BRIDGE_CONFIG_TEAMMATE_NOTICE_LINES.map((line) => `${line}${eol}`).join("") + next;
|
|
400
|
+
}
|
|
401
|
+
const after = parseBridgeConfigToml(next);
|
|
402
|
+
if (!after.ok ||
|
|
403
|
+
after.manifest.repoName !== representable.value ||
|
|
404
|
+
JSON.stringify(after.manifest.mcp) !== JSON.stringify(before.manifest.mcp)) {
|
|
405
|
+
return {
|
|
406
|
+
ok: false,
|
|
407
|
+
kind: "verification-failed",
|
|
408
|
+
error: "The rewritten .bridge/config did not parse back to the same manifest",
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
return { ok: true, text: next, changed: next !== text, noticeAdded: !noticePresent };
|
|
412
|
+
}
|
|
413
|
+
// ---------------------------------------------------------------------------
|
|
310
414
|
// Reading + identity resolution
|
|
311
415
|
// ---------------------------------------------------------------------------
|
|
312
416
|
/** Absolute path to a project root's committed manifest. */
|
|
@@ -18,6 +18,15 @@ export const BRIDGE_WORKFLOW_TOOLS = [
|
|
|
18
18
|
"update_jira_status", "config_field", "resolve_ci_checks", "poll_ci_checks",
|
|
19
19
|
"wait_for_ci_checks",
|
|
20
20
|
];
|
|
21
|
+
// These bounded workflow writes are required to complete review and implementation.
|
|
22
|
+
// `auto` can route their repository-derived payloads to Auto-review, which can
|
|
23
|
+
// reject the Jira publish or phase ledger write despite the opted-in profile.
|
|
24
|
+
// Keep the general `attachment` tool on `auto`: it also supports delete/replace.
|
|
25
|
+
const PREAPPROVED_WORKFLOW_TOOLS = new Set([
|
|
26
|
+
"capture_review_decisions",
|
|
27
|
+
"publish_reviewed_attachment",
|
|
28
|
+
"record_phase_result",
|
|
29
|
+
]);
|
|
21
30
|
export function codexProfilePaths(home) {
|
|
22
31
|
return {
|
|
23
32
|
profile: path.join(home, PROFILE_FILE),
|
|
@@ -31,7 +40,7 @@ export function renderBridgeCodexProfile(key) {
|
|
|
31
40
|
`# Applies only when selected with codex --profile ${BRIDGE_CODEX_PROFILE}.`,
|
|
32
41
|
...BRIDGE_WORKFLOW_TOOLS.flatMap((tool) => [
|
|
33
42
|
`[mcp_servers.${key}.tools.${tool}]`,
|
|
34
|
-
|
|
43
|
+
`approval_mode = "${PREAPPROVED_WORKFLOW_TOOLS.has(tool) ? "approve" : "auto"}"`,
|
|
35
44
|
"",
|
|
36
45
|
]),
|
|
37
46
|
].join("\n") + "\n";
|