@bridge_gpt/mcp-server 0.2.72 → 0.2.74

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.
Files changed (181) hide show
  1. package/README.md +5 -5
  2. package/build/agent-launchers/claude-executor-adapter.js +15 -0
  3. package/build/agents.generated.js +6 -6
  4. package/build/bridge-config.js +7 -1
  5. package/build/bridge-permissions.js +30 -0
  6. package/build/ci-system-detection.js +50 -0
  7. package/build/ci-trigger-adapters.js +631 -0
  8. package/build/ci-trigger-install.js +106 -0
  9. package/build/codex-launcher-pin.js +33 -2
  10. package/build/codex-skill-adapter.js +3 -1
  11. package/build/command-host.js +33 -0
  12. package/build/command-provisioning.js +4 -3
  13. package/build/commands.generated.js +7 -6
  14. package/build/conductor/bridge-api-client.js +867 -35
  15. package/build/conductor/bring-up-facts.js +18 -5
  16. package/build/conductor/command-drift-production.js +42 -17
  17. package/build/conductor/command-drift.js +48 -1
  18. package/build/conductor/declare-blocked.js +554 -0
  19. package/build/conductor/declared-extras.js +335 -0
  20. package/build/conductor/doctor.js +108 -21
  21. package/build/conductor/driver-commands.js +141 -0
  22. package/build/conductor/driver-guard.js +277 -0
  23. package/build/conductor/driver-lapse.js +321 -0
  24. package/build/conductor/driver-pass-output.js +104 -0
  25. package/build/conductor/driver-pass.js +571 -0
  26. package/build/conductor/driver-register.js +176 -0
  27. package/build/conductor/driver-release.js +174 -0
  28. package/build/conductor/driver-session-state.js +315 -0
  29. package/build/conductor/epic-branch-ci-inspection.js +281 -43
  30. package/build/conductor/epic-implementer-cli.js +199 -15
  31. package/build/conductor/epic-server-database.js +162 -0
  32. package/build/conductor/epic-server-guidance.js +278 -0
  33. package/build/conductor/epic-server-journal.js +239 -0
  34. package/build/conductor/epic-server-processes.js +324 -0
  35. package/build/conductor/epic-server-recipe.js +397 -0
  36. package/build/conductor/epic-server-runtime.js +1207 -0
  37. package/build/conductor/epic-server-sfcc-upload.js +1567 -0
  38. package/build/conductor/epic-server-sfcc.js +85 -0
  39. package/build/conductor/epic-server-state.js +427 -0
  40. package/build/conductor/epic-server.js +647 -0
  41. package/build/conductor/gate-discovery.js +196 -11
  42. package/build/conductor/gate-settings-review.js +261 -4
  43. package/build/conductor/launch-need-probes.js +6 -53
  44. package/build/conductor/launch-plan.js +313 -156
  45. package/build/conductor/prerequisite-inputs.js +879 -45
  46. package/build/conductor/readiness-assessment.js +16 -1
  47. package/build/conductor/readiness-cli.js +20 -9
  48. package/build/conductor/readiness-prerequisites.js +28 -9
  49. package/build/conductor/readiness-sections.js +133 -126
  50. package/build/conductor/readiness.js +1 -1
  51. package/build/conductor/recovery-cli.js +13 -2
  52. package/build/conductor/tools.js +6 -5
  53. package/build/conductor/wait-run-attention.js +2 -2
  54. package/build/conductor/wait-run-cli.js +208 -22
  55. package/build/conductor/worker-database-doctor-inspector.js +33 -2
  56. package/build/conductor/worker-setup-tally.js +27 -0
  57. package/build/credential-delivery.js +280 -0
  58. package/build/credential-launch-safety.js +142 -0
  59. package/build/credential-materialization.js +91 -16
  60. package/build/credential-references-node-deps.js +29 -0
  61. package/build/credential-references.js +1394 -0
  62. package/build/credential-references.test-fixtures.js +211 -0
  63. package/build/credential-scan-conventions.js +145 -0
  64. package/build/credential-scan.js +517 -0
  65. package/build/credential-store.js +121 -1
  66. package/build/credentials-cli.js +252 -3
  67. package/build/dependency-install-declarations.js +102 -1
  68. package/build/docs.generated.js +10 -3
  69. package/build/doctor.js +95 -3
  70. package/build/drive-epic-help.js +21 -2
  71. package/build/drive-epic.js +2095 -375
  72. package/build/engine-paths.js +20 -0
  73. package/build/epic-branch-ci-summary.js +157 -0
  74. package/build/epic-capability-statement.js +175 -0
  75. package/build/epic-ci-workflow-drift.js +77 -23
  76. package/build/epic-ci-workflow-install.js +137 -44
  77. package/build/epic-ci-workflow-v2.js +274 -0
  78. package/build/epic-ci-workflow-v3.js +273 -0
  79. package/build/epic-ci-workflow.js +165 -18
  80. package/build/epic-implementer-bin.js +2204 -56
  81. package/build/epic-launch-context.js +702 -0
  82. package/build/epic-server-record.js +288 -0
  83. package/build/epic-shared/bridge-client.js +11 -3
  84. package/build/escalation-reachability.js +43 -0
  85. package/build/executor/ci-fix-test-runs.js +334 -0
  86. package/build/executor/completion-contract.js +8 -1
  87. package/build/executor/credential-delivery-step.js +168 -0
  88. package/build/executor/deps.js +3 -1
  89. package/build/executor/env.js +98 -23
  90. package/build/executor/epic-server-context.js +157 -0
  91. package/build/executor/gate-qualification-job.js +127 -26
  92. package/build/executor/guarded-fast-forward-push.js +13 -8
  93. package/build/executor/http-client.js +52 -5
  94. package/build/executor/job-runner.js +577 -81
  95. package/build/executor/observation.js +8 -0
  96. package/build/executor/permissions.js +85 -3
  97. package/build/executor/pre-pr-checks.js +363 -0
  98. package/build/executor/prompt-spec.js +149 -3
  99. package/build/executor/reconcile-overlap-job.js +5 -3
  100. package/build/executor/required-work-diagnostics.js +4 -2
  101. package/build/executor/required-work-ledger.js +936 -38
  102. package/build/executor/results.js +58 -0
  103. package/build/executor/terminal-mutation.js +8 -0
  104. package/build/executor/worker-command.js +72 -3
  105. package/build/executor/worker-database-config.js +281 -0
  106. package/build/executor/worker-database-target.js +16 -12
  107. package/build/executor/worker-database.js +320 -101
  108. package/build/executor/worker-finalization.js +7 -1
  109. package/build/executor/worker-resources.js +25 -3
  110. package/build/executor/worker-verification-guidance.js +18 -3
  111. package/build/executor/worktree.js +20 -1
  112. package/build/executor-launch.js +58 -4
  113. package/build/generated-assets-catalog.js +2 -2
  114. package/build/git-exclude-lock.js +187 -0
  115. package/build/index.js +824 -366
  116. package/build/init.js +26 -11
  117. package/build/install-bridge-conductor-answers.js +528 -0
  118. package/build/install-bridge-conductor-apply.js +288 -0
  119. package/build/install-bridge-conductor-assessment.js +1222 -0
  120. package/build/install-bridge-conductor-compact.js +186 -0
  121. package/build/install-bridge-conductor-contracts.js +72 -0
  122. package/build/install-bridge-conductor-gate.js +1312 -198
  123. package/build/install-bridge-conductor-setup.js +577 -83
  124. package/build/install-bridge-conductor.js +3381 -544
  125. package/build/install-bridge.js +280 -25
  126. package/build/install-doctor.js +38 -8
  127. package/build/install-maintenance.js +26 -3
  128. package/build/install-sfcc-detection.js +120 -0
  129. package/build/install-sfcc-setup.js +185 -0
  130. package/build/launcher-config-inspection.js +162 -1
  131. package/build/mcp-grant-candidates.js +779 -0
  132. package/build/mcp-grant-doctor.js +63 -0
  133. package/build/mcp-grant.js +288 -0
  134. package/build/mcp-host-targets.js +8 -0
  135. package/build/mcp-identity.js +23 -0
  136. package/build/mcp-invoke.js +292 -15
  137. package/build/mcp-presets.js +107 -0
  138. package/build/mcp-provisioning.js +155 -6
  139. package/build/mcp-registration-doctor.js +31 -2
  140. package/build/mcp-server-invocation.js +19 -1
  141. package/build/merge-workflow-install.js +243 -110
  142. package/build/pipelines.generated.js +7 -6
  143. package/build/plan-discovery.js +97 -4
  144. package/build/plan-execution-ledger.js +100 -7
  145. package/build/plan-generation-io.js +262 -0
  146. package/build/plan-generation.js +424 -0
  147. package/build/plane/build-freshness.js +6 -1
  148. package/build/plane/cli.js +75 -9
  149. package/build/plane/plane-freshness.js +17 -0
  150. package/build/plane/preflight.js +50 -10
  151. package/build/plane/shutdown.js +19 -0
  152. package/build/plane/status.js +8 -2
  153. package/build/plane/terminal-run-cleanup.js +18 -4
  154. package/build/printed-remedy-commands.js +211 -12
  155. package/build/project-root.js +40 -0
  156. package/build/readiness-check.js +77 -0
  157. package/build/readiness-prerequisites.generated.js +122 -14
  158. package/build/readme.generated.js +1 -1
  159. package/build/repository-state-paths.js +41 -0
  160. package/build/repository-toolchains.js +6 -3
  161. package/build/run-unit-tests-launcher.js +8 -1
  162. package/build/setup-epic.js +1305 -210
  163. package/build/setup-progress.js +44 -0
  164. package/build/setup-question.js +122 -4
  165. package/build/sfcc/credentials.js +3 -2
  166. package/build/sfcc/hostname.js +98 -2
  167. package/build/sfcc/tool-wrapper.js +6 -95
  168. package/build/start-tickets.js +193 -29
  169. package/build/test-support/executor-source-files.js +200 -0
  170. package/build/testing-config-client.js +25 -2
  171. package/build/third-party-mcp-targets.js +63 -2
  172. package/build/ticket-delivery-enrollment.js +9 -0
  173. package/build/upgrade-cli.js +85 -2
  174. package/build/v2-readiness-requirements.js +28 -1
  175. package/build/version.generated.js +3 -3
  176. package/build/with-credentials.js +208 -0
  177. package/build/worktree-credential-delivery.js +340 -0
  178. package/docs/EPIC-IMPLEMENTER-INSTALL.md +9 -1
  179. package/docs/epic-implementer/getting-started.md +3 -1
  180. package/docs/epic-implementer/self-hosting.md +14 -1
  181. package/package.json +2 -2
@@ -119,6 +119,13 @@ export const BRIDGE_SUPERVISOR_MCP_TOOLS = [
119
119
  ];
120
120
  /** The private run-state directory the tally, patch, and context files live in. */
121
121
  export const BRIDGE_RUN_STATE_DIR = "~/.local/state/bapi-conductor-runs";
122
+ /**
123
+ * BAPI-1642: the driver guard's own state (block counters, release markers, lapse
124
+ * records). A sibling of {@link BRIDGE_RUN_STATE_DIR}, deliberately outside its
125
+ * `Edit`/`Write` rules, so the driving agent is never pre-authorized to reset the
126
+ * cap or forge a release. Only the packaged CLI writes here.
127
+ */
128
+ export const BRIDGE_DRIVER_GUARD_STATE_DIR = "~/.local/state/bapi-conductor-guard";
122
129
  /**
123
130
  * Launcher override characters that cannot be part of an exact, safe rule
124
131
  * prefix: shell operators, quotes (the posture writes the launcher unquoted),
@@ -187,6 +194,14 @@ export function buildProjectPermissionRules(launcherPrefix, serverNames = [MCP_S
187
194
  rules.push(`Bash(${launcherPrefix} epic-implementer wait-run *)`);
188
195
  // BAPI-1557: reads stored tickets and writes private scanner inputs under the run-state directory.
189
196
  rules.push(`Bash(${launcherPrefix} epic-implementer prerequisite-inputs *)`);
197
+ // BAPI-1642: driver supervision. Registration and the advisory blocker check run
198
+ // unattended; release only for the two server-checked reasons. There is
199
+ // deliberately NO rule for `driver-release --reason owner`: the owner is present,
200
+ // and Claude Code's own prompt is the second consent layer (as for BAPI-1448).
201
+ rules.push(`Bash(${launcherPrefix} epic-implementer driver-register *)`);
202
+ rules.push(`Bash(${launcherPrefix} epic-implementer declare-blocked *)`);
203
+ rules.push(`Bash(${launcherPrefix} epic-implementer driver-release --reason done *)`);
204
+ rules.push(`Bash(${launcherPrefix} epic-implementer driver-release --reason handoff *)`);
190
205
  // BAPI-1550: the read-only status read the driver may use outside a pass.
191
206
  rules.push(`Bash(${launcherPrefix} epic-implementer epic-status *)`);
192
207
  rules.push(`Bash(${launcherPrefix} epic-implementer doctor)`);
@@ -245,9 +260,24 @@ export function buildProjectPermissionRules(launcherPrefix, serverNames = [MCP_S
245
260
  // supervisor never runs, so they have no rule.
246
261
  rules.push("Bash(python scripts/worker_supervisor.py pause --owner '*')");
247
262
  rules.push(`Bash(${launcherPrefix} plane down --expect-epic-run-id '*')`);
263
+ // BAPI-1546: the run's epic server. Prove and start the detached helper, read its
264
+ // status and journal, and the ownership-guarded stop of THIS run's own helper.
265
+ // Only the quoted values fill the `*`; there is no rule for a bare stop.
266
+ rules.push(`Bash(${launcherPrefix} epic-implementer epic-server prove --epic '*' --epic-run-id '*' --head '*')`);
267
+ rules.push(`Bash(${launcherPrefix} epic-implementer epic-server start --epic '*' --epic-run-id '*' --head '*')`);
268
+ rules.push(`Bash(${launcherPrefix} epic-implementer epic-server status)`);
269
+ rules.push("Bash(git show '*:.bridge/epic-server.toml')");
270
+ rules.push(`Bash(${launcherPrefix} epic-implementer epic-server status --epic-run-id '*')`);
271
+ rules.push(`Bash(${launcherPrefix} epic-implementer epic-server status --epic-run-id '*' --since '*')`);
272
+ rules.push(`Bash(${launcherPrefix} epic-implementer epic-server stop --expect-epic-run-id '*')`);
273
+ // BAPI-1669: this run's own full SFCC upload, at run start and wind-down. The worker form and the
274
+ // bare --full form have no rule: only the quoted full command with all three values matches.
275
+ rules.push(`Bash(${launcherPrefix} epic-implementer epic-server sfcc-upload --full --epic '*' --epic-run-id '*' --head '*')`);
248
276
  rules.push("Bash(python scripts/worker_supervisor.py resume --owner '*')");
249
277
  // The planned-hand-off comparison's one read of each dependent child PR.
250
278
  rules.push("Bash(gh pr view * --json number,body)");
279
+ // BAPI-1651: the read-only conflict check on an unbound PR at a required-work park.
280
+ rules.push("Bash(gh pr view * --json mergeable,statusCheckRollup)");
251
281
  // The Bridge MCP tools the supervisor uses, under each installed server key.
252
282
  for (const serverName of serverNames) {
253
283
  for (const tool of BRIDGE_SUPERVISOR_MCP_TOOLS) {
@@ -0,0 +1,50 @@
1
+ /**
2
+ * BAPI-1654 — which CI systems does this repository configure?
3
+ *
4
+ * Read-only, file-based, and independent of the remote host: a repository on
5
+ * GitHub can still run CircleCI, and "no checks have reported" is not "no CI".
6
+ * The answer names every system found, in a fixed order, so the owner-facing
7
+ * wording can name them. It never reads a file's contents beyond what is needed
8
+ * to tell that it exists, and it never returns content.
9
+ */
10
+ /** Plain names, by id. */
11
+ export const CI_SYSTEM_NAMES = Object.freeze({
12
+ github_actions: "GitHub Actions",
13
+ circleci: "CircleCI",
14
+ jenkins: "Jenkins",
15
+ buildkite: "Buildkite",
16
+ });
17
+ const FILE_PROBES = Object.freeze([
18
+ { id: "circleci", path: ".circleci/config.yml" },
19
+ { id: "jenkins", path: "Jenkinsfile" },
20
+ { id: "buildkite", path: ".buildkite/pipeline.yml" },
21
+ ]);
22
+ /** Detect configured CI systems. Never throws. */
23
+ export async function detectCiSystems(fs) {
24
+ const systems = [];
25
+ let complete = true;
26
+ try {
27
+ const entries = await fs.listDir(".github/workflows");
28
+ const workflow = (entries ?? []).filter((n) => typeof n === "string" && /^[^/\\]+\.ya?ml$/.test(n)).sort()[0];
29
+ if (workflow !== undefined) {
30
+ systems.push({ id: "github_actions", name: CI_SYSTEM_NAMES.github_actions, path: `.github/workflows/${workflow}` });
31
+ }
32
+ }
33
+ catch {
34
+ complete = false;
35
+ }
36
+ for (const probe of FILE_PROBES) {
37
+ try {
38
+ if (await fs.exists(probe.path))
39
+ systems.push({ id: probe.id, name: CI_SYSTEM_NAMES[probe.id], path: probe.path });
40
+ }
41
+ catch {
42
+ complete = false;
43
+ }
44
+ }
45
+ return { systems, complete };
46
+ }
47
+ /** The plain names of the detected systems Bridge cannot safely change. */
48
+ export function systemsWithoutAdapter(systems) {
49
+ return systems.filter((s) => s.id !== "github_actions" && s.name !== CI_SYSTEM_NAMES.github_actions).map((s) => s.name);
50
+ }