@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
@@ -56,7 +56,7 @@ export function classifyDatabaseMigration(bringUp) {
56
56
  const id = "database-migration-current";
57
57
  if (bringUp === null)
58
58
  return unreported(id);
59
- if (!bringUp.migration_readable) {
59
+ if (bringUp.migration_readable !== true || bringUp.database_migration_current === null) {
60
60
  return {
61
61
  id,
62
62
  state: "unreadable",
@@ -65,7 +65,7 @@ export function classifyDatabaseMigration(bringUp) {
65
65
  refusal: "database-migration-unreadable",
66
66
  };
67
67
  }
68
- if (!bringUp.database_migration_current) {
68
+ if (bringUp.database_migration_current === false) {
69
69
  return {
70
70
  id,
71
71
  state: "bad",
@@ -81,7 +81,7 @@ export function classifyWorkerPresent(bringUp) {
81
81
  const id = "worker-present";
82
82
  if (bringUp === null)
83
83
  return unreported(id);
84
- if (!bringUp.heartbeat_readable) {
84
+ if (bringUp.heartbeat_readable !== true || bringUp.worker_present === null) {
85
85
  return {
86
86
  id,
87
87
  state: "unreadable",
@@ -90,7 +90,7 @@ export function classifyWorkerPresent(bringUp) {
90
90
  refusal: "worker-heartbeat-unreadable",
91
91
  };
92
92
  }
93
- if (!bringUp.worker_present) {
93
+ if (bringUp.worker_present === false) {
94
94
  return {
95
95
  id,
96
96
  state: "bad",
@@ -109,7 +109,7 @@ export function classifySingleTransitionAuthority(bringUp) {
109
109
  const id = "single-transition-authority";
110
110
  if (bringUp === null)
111
111
  return unreported(id);
112
- if (!bringUp.heartbeat_readable) {
112
+ if (bringUp.heartbeat_readable !== true || bringUp.fresh_reconciler_count === null) {
113
113
  return {
114
114
  id,
115
115
  state: "unreadable",
@@ -160,6 +160,19 @@ export function firstBringUpRefusal(bringUp) {
160
160
  .filter((reason) => reason !== undefined));
161
161
  return BRING_UP_REFUSAL_REASONS.find((reason) => reasons.has(reason)) ?? null;
162
162
  }
163
+ /**
164
+ * BAPI-1595 — the first PROVEN-bad refusal only: a second reconciler, a database
165
+ * behind head, or a missing worker, each established by a readable fact. An
166
+ * unreported block and an unreadable fact are unknown, never a refusal, so the
167
+ * result is `null` for them. Same order as {@link firstBringUpRefusal}.
168
+ */
169
+ export function firstProvenBringUpRefusal(bringUp) {
170
+ const reasons = new Set(classifyBringUpFacts(bringUp)
171
+ .filter((verdict) => verdict.state === "bad")
172
+ .map((verdict) => verdict.refusal)
173
+ .filter((reason) => reason !== undefined));
174
+ return BRING_UP_REFUSAL_REASONS.find((reason) => reasons.has(reason)) ?? null;
175
+ }
163
176
  /**
164
177
  * The operator sentence for one refusal: the fact, the observed condition, and
165
178
  * one concrete remedy. The caller appends its own closing sentence ("No run was
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import { spawnSync } from "node:child_process";
17
17
  import { COMMANDS } from "../commands.generated.js";
18
+ import { buildPackagedAssetCatalog } from "../generated-assets-catalog.js";
18
19
  import { probeCommandDrift, } from "./command-drift.js";
19
20
  /** Bounded timeout for one Git subprocess. */
20
21
  const GIT_TIMEOUT_MS = 5_000;
@@ -71,27 +72,51 @@ export function createCommandDriftGit(run) {
71
72
  },
72
73
  };
73
74
  }
75
+ /**
76
+ * BAPI-1635 — normalize the installer's own rendered asset catalog for the probe.
77
+ * Documents are not commands, agents, or host mirrors of them and are left out;
78
+ * every other asset keeps its catalog destination, identifier, and rendered bytes.
79
+ * An empty result means the catalog is unusable and the probe keeps its command-only path.
80
+ */
81
+ export function normalizeDriftAssets(catalog) {
82
+ return catalog.assets.flatMap((asset) => {
83
+ if (asset.kind === "document")
84
+ return [];
85
+ const name = asset.workflows[0];
86
+ return name === undefined ? [] : [{ id: asset.id, destination: asset.destination, content: asset.content, kind: asset.kind, name }];
87
+ });
88
+ }
74
89
  /**
75
90
  * Build the production drift inspector: resolve Bridge access, read the confirmed
76
91
  * profile's `customized_commands` (an unconfirmed repository has none), and probe
77
92
  * Git. Never throws; an unresolved credential or failed read is a `warn`.
78
93
  */
79
94
  export function createCommandDriftInspector(options) {
80
- return () => probeCommandDrift({
81
- catalog: COMMANDS,
82
- git: createCommandDriftGit(options.runGit ?? createGitRunner(options.cwd)),
83
- fetchCustomizedCommands: async () => {
84
- // Lazy: keeps the credential/HTTP graph out of the static imports, as the
85
- // doctor's other credentialed inspections do.
86
- const client = await import("./bridge-api-client.js");
87
- const resolved = await client.resolveConductorBridgeApiAccess({
88
- env: options.env,
89
- cwd: options.cwd,
90
- });
91
- if (!resolved.ok)
92
- throw new Error("profile-unavailable");
93
- const read = await client.fetchConductorGateProfile(resolved.access, ((url, init) => (options.fetch ?? fetch)(url, init)));
94
- return read.profile?.customized_commands ?? [];
95
- },
96
- });
95
+ return () => {
96
+ let assets = [];
97
+ try {
98
+ assets = normalizeDriftAssets((options.buildCatalog ?? buildPackagedAssetCatalog)());
99
+ }
100
+ catch {
101
+ assets = [];
102
+ }
103
+ return probeCommandDrift({
104
+ catalog: COMMANDS,
105
+ ...(assets.length > 0 ? { assets } : {}),
106
+ git: createCommandDriftGit(options.runGit ?? createGitRunner(options.cwd)),
107
+ fetchCustomizedCommands: async () => {
108
+ // Lazy: keeps the credential/HTTP graph out of the static imports, as the
109
+ // doctor's other credentialed inspections do.
110
+ const client = await import("./bridge-api-client.js");
111
+ const resolved = await client.resolveConductorBridgeApiAccess({
112
+ env: options.env,
113
+ cwd: options.cwd,
114
+ });
115
+ if (!resolved.ok)
116
+ throw new Error("profile-unavailable");
117
+ const read = await client.fetchConductorGateProfile(resolved.access, ((url, init) => (options.fetch ?? fetch)(url, init)));
118
+ return read.profile?.customized_commands ?? [];
119
+ },
120
+ });
121
+ };
97
122
  }
@@ -2,7 +2,7 @@
2
2
  export const COMMAND_DRIFT_ROW_ID = "command-drift";
3
3
  export const COMMAND_DRIFT_ROW_LABEL = "Committed command drift";
4
4
  /** Group-level remedy for divergent, non-customized commands. */
5
- export const COMMAND_DRIFT_DIVERGENT_REMEDIATION = "run `/upgrade-bridge` and commit the refreshed commands, or mark the command customized in the gate profile";
5
+ export const COMMAND_DRIFT_DIVERGENT_REMEDIATION = "commit the refreshed command files (run /upgrade-bridge first if they are not refreshed), or mark the command customized in the gate profile";
6
6
  /** Remedy when the check itself could not be completed. */
7
7
  export const COMMAND_DRIFT_UNASSESSABLE_REMEDIATION = "restore Bridge profile access and Git access for this repository, then rerun `epic-implementer doctor`";
8
8
  const SAFE_COMMAND_FILE = /^([a-z][a-z0-9-]*)\.md$/;
@@ -10,6 +10,51 @@ const SAFE_COMMAND_FILE = /^([a-z][a-z0-9-]*)\.md$/;
10
10
  export function commandDriftTrackedPath(name) {
11
11
  return `.claude/commands/${name}.md`;
12
12
  }
13
+ function validAsset(value) {
14
+ if (typeof value !== "object" || value === null)
15
+ return false;
16
+ const a = value;
17
+ return typeof a.id === "string" && a.id.length > 0 && typeof a.destination === "string" && a.destination.length > 0
18
+ && typeof a.content === "string" && typeof a.name === "string" && a.name.length > 0
19
+ && ["command", "skill", "prompt", "agent"].includes(String(a.kind));
20
+ }
21
+ /** Compare every normalized asset by HEAD blob. Absent or untracked destinations are not installed, never drift. */
22
+ async function probeAssets(assets, customized, git) {
23
+ if (!Array.isArray(assets) || !assets.every(validAsset)) {
24
+ return { status: "warn", kind: "unassessable", reason: "git-unavailable" };
25
+ }
26
+ const divergent = new Set();
27
+ const customizedDivergent = new Set();
28
+ const refs = [];
29
+ try {
30
+ for (const asset of [...assets].sort((a, b) => a.destination.localeCompare(b.destination))) {
31
+ const tracked = await git.trackedBlob(asset.destination);
32
+ if (!tracked.tracked)
33
+ continue;
34
+ const packaged = await git.hashObject(asset.content);
35
+ if (packaged === tracked.blobId)
36
+ continue;
37
+ if (customized.has(asset.name) || customized.has(asset.id))
38
+ customizedDivergent.add(asset.name);
39
+ else {
40
+ divergent.add(asset.name);
41
+ refs.push({ id: asset.id, destination: asset.destination, kind: asset.kind });
42
+ }
43
+ }
44
+ }
45
+ catch {
46
+ return { status: "warn", kind: "unassessable", reason: "git-unavailable" };
47
+ }
48
+ if (divergent.size === 0)
49
+ return { status: "pass", customizedDivergent: [...customizedDivergent].sort() };
50
+ return {
51
+ status: "warn",
52
+ kind: "divergent",
53
+ divergent: [...divergent].sort(),
54
+ customizedDivergent: [...customizedDivergent].sort(),
55
+ divergentAssets: refs,
56
+ };
57
+ }
13
58
  /** Run the probe. Never throws and never returns a `fail`. */
14
59
  export async function probeCommandDrift(deps) {
15
60
  let customized;
@@ -19,6 +64,8 @@ export async function probeCommandDrift(deps) {
19
64
  catch {
20
65
  return { status: "warn", kind: "unassessable", reason: "profile-unavailable" };
21
66
  }
67
+ if (deps.assets !== undefined)
68
+ return probeAssets(deps.assets, customized, deps.git);
22
69
  const names = [];
23
70
  for (const key of Object.keys(deps.catalog)) {
24
71
  const match = SAFE_COMMAND_FILE.exec(key);