@bridge_gpt/mcp-server 0.2.54 → 0.2.56

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 (89) hide show
  1. package/README.md +45 -59
  2. package/build/agent-capabilities/types.js +4 -0
  3. package/build/agent-guidance.generated.js +3 -0
  4. package/build/agent-launchers/claude-executor-adapter.js +3 -0
  5. package/build/agent-notes.js +178 -0
  6. package/build/agent-registry.js +25 -5
  7. package/build/agent-utils.js +58 -0
  8. package/build/agents.generated.js +1 -1
  9. package/build/codex-launch-scope.js +49 -0
  10. package/build/codex-skill-adapter.js +58 -0
  11. package/build/command-host.js +9 -0
  12. package/build/command-provisioning.js +35 -4
  13. package/build/commands.generated.js +9 -8
  14. package/build/conductor/bridge-api-client.js +199 -6
  15. package/build/conductor/bring-up-facts.js +187 -0
  16. package/build/conductor/claude-hook.js +7 -5
  17. package/build/conductor/cli.js +28 -0
  18. package/build/conductor/doctor.js +80 -9
  19. package/build/conductor/epic-implementer-cli.js +1298 -0
  20. package/build/conductor/epic-runtime.js +1 -1
  21. package/build/conductor/errors.js +2 -2
  22. package/build/conductor/git-ci-types.js +1 -1
  23. package/build/conductor/git-hooks.js +28 -14
  24. package/build/conductor/install-doctor.js +11 -5
  25. package/build/conductor/readiness-cli.js +10 -10
  26. package/build/conductor/readiness-sections.js +58 -9
  27. package/build/conductor/readiness.js +37 -6
  28. package/build/conductor/recovery-cli.js +289 -10
  29. package/build/conductor/recovery-operations.js +125 -2
  30. package/build/conductor/repair-contract.js +58 -0
  31. package/build/conductor/store.js +2 -2
  32. package/build/conductor/supervisor-runtime.js +1 -1
  33. package/build/conductor-bin.js +2 -139
  34. package/build/conductor-claude-hook-bin.js +2 -2
  35. package/build/conductor-claude-hook-removed-stub-bin.js +31 -0
  36. package/build/conductor-removed-stub-bin.js +30 -0
  37. package/build/docs.generated.js +1 -1
  38. package/build/doctor.js +81 -18
  39. package/build/drive-epic.js +541 -115
  40. package/build/epic-implementer-bin.js +145 -0
  41. package/build/epic-implementer-bundle-cli.js +264 -0
  42. package/build/epic-implementer-claude-hook-bin.js +3 -0
  43. package/build/epic-integration-pr.js +5 -3
  44. package/build/executor/env.js +6 -0
  45. package/build/executor/interrupted-worktree.js +60 -0
  46. package/build/executor/job-errors.js +45 -0
  47. package/build/executor/job-runner.js +274 -9
  48. package/build/executor/job-types.js +25 -9
  49. package/build/executor/merge-tree-classifier.js +171 -0
  50. package/build/executor/reconcile-overlap-governance.js +129 -0
  51. package/build/executor/reconcile-overlap-job.js +989 -0
  52. package/build/executor/reconcile-overlap-types.js +14 -0
  53. package/build/executor/spawn-job-driver.js +1 -0
  54. package/build/executor/types.js +2 -0
  55. package/build/executor/worker-finalization.js +25 -2
  56. package/build/executor/worker-guard-hook.js +15 -7
  57. package/build/implement-epic/bridge-client.js +773 -0
  58. package/build/implement-epic/checkpoint-store.js +542 -0
  59. package/build/implement-epic/cli.js +3158 -0
  60. package/build/implement-epic/cut-protocol.js +392 -0
  61. package/build/implement-epic/lock.js +302 -0
  62. package/build/implement-epic/pr-state.js +286 -0
  63. package/build/implement-epic/spawn.js +113 -0
  64. package/build/index.js +617 -168
  65. package/build/init.js +74 -9
  66. package/build/install-bridge-conductor.js +5 -5
  67. package/build/install-bridge.js +425 -79
  68. package/build/mcp-host-config.js +22 -60
  69. package/build/mcp-host-entry-adapter.js +18 -0
  70. package/build/mcp-host-targets.js +19 -32
  71. package/build/mcp-provisioning.js +1 -1
  72. package/build/mcp-registration-doctor.js +1 -1
  73. package/build/merge-pull-request.js +1 -1
  74. package/build/pipelines.generated.js +7 -7
  75. package/build/plan-epic-conductor-eligibility.js +1 -1
  76. package/build/plane/cli.js +36 -5
  77. package/build/plane/preflight.js +128 -12
  78. package/build/plane/shutdown.js +4 -4
  79. package/build/readiness-check.js +3 -3
  80. package/build/readme.generated.js +1 -1
  81. package/build/review-tickets.js +50 -35
  82. package/build/run-unit-tests-launcher.js +1 -1
  83. package/build/setup-epic.js +69 -31
  84. package/build/start-tickets-conductor.js +8 -7
  85. package/build/start-tickets.js +266 -48
  86. package/build/version.generated.js +3 -3
  87. package/build/worker-guard-hook-bin.js +1 -1
  88. package/docs/CONDUCTOR.md +8 -6
  89. package/package.json +5 -3
package/build/init.js CHANGED
@@ -13,15 +13,19 @@ import { writeFile, mkdir, readFile, stat } from "fs/promises";
13
13
  import path from "path";
14
14
  import os from "os";
15
15
  import { COMMANDS } from "./commands.generated.js";
16
+ import { renderCommandForHost } from "./command-host.js";
17
+ import { CODEX_SKILLS_DIR, codexSkillAssets } from "./codex-skill-adapter.js";
16
18
  import { AGENTS } from "./agents.generated.js";
17
19
  import { DOCS } from "./docs.generated.js";
18
20
  import { VERSION, LAUNCHER_ARGS } from "./version.generated.js";
19
- import { reconstructAgentMarkdown, translateAgentToCopilot } from "./agent-utils.js";
21
+ import { reconstructAgentMarkdown, translateAgentToCopilot, translateCommandToCopilot, } from "./agent-utils.js";
20
22
  import { validateRepoName, resolveRepoNameForProjectRoot } from "./bridge-config.js";
21
23
  import { ensureGitignored as ensureGitignoredShared } from "./git-ignore-utils.js";
22
24
  import { resolveBapiCredentials } from "./credential-store.js";
23
- import { describeLauncherReason, DUPLICATE_REGISTRATION_GUIDANCE, inspectLauncherConfigs, isPrerequisiteFailure, launcherTargetFor, } from "./launcher-config-inspection.js";
25
+ import { describeLauncherReason, DUPLICATE_REGISTRATION_GUIDANCE, inspectLauncherConfigs, isPrerequisiteFailure, } from "./launcher-config-inspection.js";
24
26
  import { MCP_SERVER_NAME, MCP_PACKAGE_NAME, resolveRegistrationKey, } from "./mcp-identity.js";
27
+ import { adaptBridgeEntryForHostTarget } from "./mcp-host-entry-adapter.js";
28
+ import { MCP_HOST_TARGETS, hostAdapterForTarget } from "./mcp-host-targets.js";
25
29
  // ---------------------------------------------------------------------------
26
30
  // CLI: --init scaffolds slash commands and MCP configs into the current project
27
31
  // ---------------------------------------------------------------------------
@@ -219,6 +223,9 @@ export async function resolveInitScaffoldAssets(options) {
219
223
  displayScaffoldPath(cwd, instructionsDir, true),
220
224
  displayScaffoldPath(cwd, path.join(cwd, ".claude", "commands"), true),
221
225
  ...(ide.cursor ? [displayScaffoldPath(cwd, path.join(cwd, ".cursor", "commands"), true)] : []),
226
+ displayScaffoldPath(cwd, path.join(cwd, CODEX_SKILLS_DIR), true),
227
+ ...(ide.vscode ? [displayScaffoldPath(cwd, path.join(cwd, ".github", "prompts"), true)] : []),
228
+ ...(ide.vscode ? [displayScaffoldPath(cwd, path.join(cwd, ".github", "skills"), true)] : []),
222
229
  displayScaffoldPath(cwd, path.join(cwd, ".claude", "agents"), true),
223
230
  ...(ide.vscode ? [displayScaffoldPath(cwd, path.join(cwd, ".github", "agents"), true)] : []),
224
231
  // Sourced from the bundled DOCS map, so a new scaffolded doc is covered
@@ -531,12 +538,12 @@ export async function runInit(cwd, options = {}) {
531
538
  // narration and its tests are unchanged; the per-path metadata (which root
532
539
  // key each config uses) now comes from the shared inspection module.
533
540
  const configTargets = [
534
- { path: ".mcp.json", shouldCreate: true },
535
- { path: ".vscode/mcp.json", shouldCreate: ideDetection.vscode },
536
- { path: ".cursor/mcp.json", shouldCreate: ideDetection.cursor },
541
+ { path: ".mcp.json", shouldCreate: true, target: MCP_HOST_TARGETS["claude-code"] },
542
+ { path: ".vscode/mcp.json", shouldCreate: ideDetection.vscode, target: MCP_HOST_TARGETS["copilot-vscode"] },
543
+ { path: ".cursor/mcp.json", shouldCreate: ideDetection.cursor, target: MCP_HOST_TARGETS.cursor },
537
544
  ].map((t) => ({
538
545
  ...t,
539
- topLevelKey: launcherTargetFor(t.path).topLevelKey,
546
+ topLevelKey: hostAdapterForTarget(t.target).topLevelKey,
540
547
  }));
541
548
  // ---- Phase 3a: read-only preflight, BEFORE the first write ----
542
549
  // A run must either reconcile every config or change nothing. Discovering a
@@ -620,7 +627,7 @@ export async function runInit(cwd, options = {}) {
620
627
  await io.mkdir(path.dirname(fullPath), { recursive: true });
621
628
  const content = {
622
629
  [target.topLevelKey]: {
623
- [MCP_SERVER_NAME]: buildBridgeApiEntry(cwd, newEntryMetadata),
630
+ [MCP_SERVER_NAME]: adaptBridgeEntryForHostTarget(buildBridgeApiEntry(cwd, newEntryMetadata), target.target),
624
631
  },
625
632
  };
626
633
  await io.writeFile(fullPath, JSON.stringify(content, null, 2) + "\n", "utf-8");
@@ -652,7 +659,7 @@ export async function runInit(cwd, options = {}) {
652
659
  // fresh registration and uses MCP_SERVER_NAME.
653
660
  if (!parsed[target.topLevelKey])
654
661
  parsed[target.topLevelKey] = {};
655
- parsed[target.topLevelKey][MCP_SERVER_NAME] = buildBridgeApiEntry(cwd, newEntryMetadata);
662
+ parsed[target.topLevelKey][MCP_SERVER_NAME] = adaptBridgeEntryForHostTarget(buildBridgeApiEntry(cwd, newEntryMetadata), target.target);
656
663
  await io.writeFile(fullPath, JSON.stringify(parsed, null, 2) + "\n", "utf-8");
657
664
  configActions.push({ path: target.path, action: "added entry" });
658
665
  structuredActions.push({
@@ -764,7 +771,7 @@ export async function runInit(cwd, options = {}) {
764
771
  await mkdir(dir, { recursive: true });
765
772
  // Per-file read/compare/write runs concurrently; outcomes are applied to the
766
773
  // Sets afterward in entry order so the summary counts are unchanged.
767
- const outcomes = await Promise.all(commandEntries.map(([filename, content]) => scaffoldFile(path.join(dir, filename), content)));
774
+ const outcomes = await Promise.all(commandEntries.map(([filename, content]) => scaffoldFile(path.join(dir, filename), renderCommandForHost(filename, content, dir === path.join(cwd, ".cursor", "commands") ? "cursor" : "claude-code"))));
768
775
  commandEntries.forEach(([filename], i) => {
769
776
  const outcome = outcomes[i];
770
777
  if (outcome === "skipped") {
@@ -789,6 +796,64 @@ export async function runInit(cwd, options = {}) {
789
796
  if (skippedFiles.size > 0)
790
797
  console.log(` Skipped (unchanged): ${skippedFiles.size}`);
791
798
  console.log(` ${dirNames}`);
799
+ // ---- Phase 4a: Scaffold Codex-native repository skills ----
800
+ // Codex skills are a project-local, commit-safe surface. They intentionally
801
+ // do not participate in the global Codex MCP registration at
802
+ // ~/.codex/config.toml; that registration is owned by install-bridge.
803
+ const codexAssets = codexSkillAssets(COMMANDS);
804
+ const codexOutcomes = await Promise.all(codexAssets.map((asset) => {
805
+ const target = path.join(cwd, asset.relativePath);
806
+ return scaffoldFile(target, asset.content, path.dirname(target));
807
+ }));
808
+ const codexWritten = codexOutcomes.filter((outcome) => outcome !== "skipped").length;
809
+ const codexOverwritten = codexOutcomes.filter((outcome) => outcome === "overwritten").length;
810
+ const codexSkipped = codexOutcomes.filter((outcome) => outcome === "skipped").length;
811
+ console.log(`\nCodex skills: scaffolded ${codexAssets.length} skills into ${CODEX_SKILLS_DIR}/`);
812
+ if (codexWritten > 0)
813
+ console.log(` Written: ${codexWritten}`);
814
+ if (codexOverwritten > 0)
815
+ console.log(` Overwritten (content changed): ${codexOverwritten}`);
816
+ if (codexSkipped > 0)
817
+ console.log(` Skipped (unchanged): ${codexSkipped}`);
818
+ // ---- Phase 4a: Scaffold GitHub Copilot command artifacts ----
819
+ // VS Code Local agent discovers prompt files; Agent Host discovers project
820
+ // skills. Both artifacts are rendered from COMMANDS above, never a second
821
+ // Copilot-specific command catalog.
822
+ if (ideDetection.vscode) {
823
+ const promptsDir = path.join(cwd, ".github", "prompts");
824
+ const skillsDir = path.join(cwd, ".github", "skills");
825
+ const copilotWritten = new Set();
826
+ const copilotSkipped = new Set();
827
+ const copilotOverwritten = new Set();
828
+ const artifacts = commandEntries.map(([filename, content]) => ({
829
+ filename,
830
+ commandName: filename.replace(/\.md$/, ""),
831
+ ...translateCommandToCopilot(filename, content),
832
+ }));
833
+ const outcomes = await Promise.all(artifacts.flatMap(({ filename, commandName, prompt, skill }) => [
834
+ scaffoldFile(path.join(promptsDir, filename.replace(/\.md$/, ".prompt.md")), prompt, promptsDir),
835
+ scaffoldFile(path.join(skillsDir, commandName, "SKILL.md"), skill, path.join(skillsDir, commandName)),
836
+ ]));
837
+ artifacts.forEach(({ commandName }, i) => {
838
+ const commandOutcomes = outcomes.slice(i * 2, i * 2 + 2);
839
+ if (commandOutcomes.every((outcome) => outcome === "skipped")) {
840
+ copilotSkipped.add(commandName);
841
+ return;
842
+ }
843
+ if (commandOutcomes.some((outcome) => outcome === "overwritten")) {
844
+ copilotOverwritten.add(commandName);
845
+ }
846
+ copilotWritten.add(commandName);
847
+ });
848
+ console.log(`\nCopilot workflows: scaffolded ${total} prompt files and ${total} Agent Host skills`);
849
+ if (copilotWritten.size > 0)
850
+ console.log(` Written: ${copilotWritten.size}`);
851
+ if (copilotOverwritten.size > 0)
852
+ console.log(` Overwritten (content changed): ${copilotOverwritten.size}`);
853
+ if (copilotSkipped.size > 0)
854
+ console.log(` Skipped (unchanged): ${copilotSkipped.size}`);
855
+ console.log(" .github/prompts/ (VS Code Local agent) and .github/skills/ (Agent Host)");
856
+ }
792
857
  // ---- Phase 4b: Scaffold shipped documentation assets ----
793
858
  // Every doc asset the /install-bridge capability report points a human at,
794
859
  // so no pointer it prints dangles inside an installed project: the
@@ -566,7 +566,7 @@ export const CONDUCTOR_PROFILE_EMPTY_MERGE_REMEDIATION = `run \`npx ${MCP_PACKAG
566
566
  "then re-run `install conductor`.";
567
567
  /** Remediation printed whenever the managed conductor hooks were not installed. */
568
568
  export const CONDUCTOR_HOOKS_MANUAL_REMEDIATION = "re-run `install conductor` and accept the local-observability consent, or run " +
569
- "`conductor install-git-hooks` directly.";
569
+ "`epic-implementer install-git-hooks` directly.";
570
570
  /**
571
571
  * Phase: tool visibility.
572
572
  *
@@ -713,7 +713,7 @@ async function runConductorLocalObservabilityPhase(deps, local) {
713
713
  else {
714
714
  // A skipped or warned hook is NOT provisioned local observability, and
715
715
  // recording the capability here would make install state claim
716
- // something a `conductor doctor` run would immediately contradict.
716
+ // something a `epic-implementer doctor` run would immediately contradict.
717
717
  deps.log(" the managed hooks are not fully usable, so local observability was not recorded.");
718
718
  manualActions.push(`local observability: ${CONDUCTOR_HOOKS_MANUAL_REMEDIATION}`);
719
719
  }
@@ -791,7 +791,7 @@ export async function runInstallBridgeConductorCli(argv, deps) {
791
791
  const access = accessResult.ok ? accessResult.access : null;
792
792
  const accessError = accessResult.ok ? undefined : accessResult.error;
793
793
  // ---- Phase 1: unified doctor, BEFORE every write -----------------------
794
- deps.log("Phase 1/8 — running the unified conductor doctor (read-only)…");
794
+ deps.log("Phase 1/8 — running the unified epic-implementer doctor (read-only)…");
795
795
  const firstReport = await deps.runDoctor({
796
796
  access,
797
797
  accessError,
@@ -1040,7 +1040,7 @@ export async function runInstallBridgeConductorCli(argv, deps) {
1040
1040
  else {
1041
1041
  deps.log(" skipped — this caller supplied no local-provisioning seams.");
1042
1042
  manualActions.push("local observability: run the packaged `install conductor` command, or " +
1043
- "`conductor install-git-hooks`, to install the managed conductor Git hooks.");
1043
+ "`epic-implementer install-git-hooks`, to install the managed conductor Git hooks.");
1044
1044
  }
1045
1045
  // The fail-loud hook-binary refusal exits 1 — but only AFTER the phase's
1046
1046
  // read-only ledger report has been printed, which the phase guarantees.
@@ -1111,7 +1111,7 @@ export async function runInstallBridgeConductorCli(argv, deps) {
1111
1111
  }
1112
1112
  const matrix = renderCapabilityMatrix(deps, postReadiness);
1113
1113
  deps.log("");
1114
- deps.log(" re-running the unified conductor doctor (read-only)…");
1114
+ deps.log(" re-running the unified epic-implementer doctor (read-only)…");
1115
1115
  const finalReport = await deps.runDoctor({
1116
1116
  access,
1117
1117
  reviewPolicySource: options.reviewPolicy,