@bridge_gpt/mcp-server 0.2.57 → 0.2.59

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 (90) hide show
  1. package/README.md +112 -113
  2. package/build/agent-registry.js +15 -0
  3. package/build/agent-utils.js +16 -8
  4. package/build/claude-user-config-doctor.js +1 -35
  5. package/build/codex-bridge-profile.js +5 -1
  6. package/build/codex-launch-scope.js +13 -2
  7. package/build/commands.generated.js +5 -6
  8. package/build/conductor/bridge-api-client.js +149 -0
  9. package/build/conductor/bring-up-facts.js +1 -1
  10. package/build/conductor/claude-hook.js +16 -16
  11. package/build/conductor/doctor.js +24 -19
  12. package/build/conductor/epic-implementer-cli.js +38 -5
  13. package/build/conductor/epic-reconcile.js +1 -1
  14. package/build/conductor/epic-runtime.js +10 -10
  15. package/build/conductor/errors.js +3 -3
  16. package/build/conductor/file-scope-guard.js +4 -4
  17. package/build/conductor/git-ci-types.js +1 -1
  18. package/build/conductor/git-inspection.js +2 -2
  19. package/build/conductor/install-doctor.js +6 -6
  20. package/build/conductor/merge-ledger.js +2 -2
  21. package/build/conductor/pr-ci-producer.js +6 -6
  22. package/build/conductor/pr-review-producer.js +2 -2
  23. package/build/conductor/producer-ledger.js +2 -0
  24. package/build/conductor/readiness-sections.js +7 -7
  25. package/build/conductor/readiness.js +2 -2
  26. package/build/conductor/recovery-cli.js +243 -12
  27. package/build/conductor/recovery-operations.js +56 -4
  28. package/build/conductor/repair-contract.js +38 -4
  29. package/build/conductor/spec-review-producer.js +6 -6
  30. package/build/conductor/store.js +10 -10
  31. package/build/conductor/supervisor-config.js +14 -14
  32. package/build/conductor/supervisor-ledger.js +2 -2
  33. package/build/conductor/supervisor-message-relay.js +2 -2
  34. package/build/conductor/worker-ledger-cli.js +19 -19
  35. package/build/conductor-bundle-artifacts.js +2 -2
  36. package/build/cursor-agent-progress.js +72 -0
  37. package/build/doctor.js +20 -296
  38. package/build/drive-epic.js +65 -71
  39. package/build/epic-implementer-bin.js +22 -17
  40. package/build/epic-implementer-claude-hook-bin.js +4 -2
  41. package/build/epic-implementer-env.js +155 -0
  42. package/build/epic-integration-pr.js +2 -2
  43. package/build/epic-shared/bridge-client.js +773 -0
  44. package/build/epic-shared/cut-protocol.js +392 -0
  45. package/build/executor/env.js +19 -8
  46. package/build/executor/heartbeat.js +1 -1
  47. package/build/executor/job-errors.js +3 -3
  48. package/build/executor/job-runner.js +1 -1
  49. package/build/executor/merge-job.js +35 -3
  50. package/build/executor/observation.js +1 -1
  51. package/build/executor/preflight.js +1 -1
  52. package/build/executor/prompt-spec.js +1 -1
  53. package/build/executor/reconcile-overlap-job.js +10 -130
  54. package/build/executor/reconcile-overlap-types.js +1 -1
  55. package/build/executor/runner.js +1 -1
  56. package/build/implement-epic/cli.js +1 -1
  57. package/build/index.js +187 -224
  58. package/build/init.js +20 -28
  59. package/build/install-bridge-conductor.js +7 -7
  60. package/build/install-bridge.js +203 -10
  61. package/build/install-doctor.js +1 -1
  62. package/build/mcp-host-entry-adapter.js +6 -0
  63. package/build/mcp-host-targets.js +2 -0
  64. package/build/mcp-invoke.js +5 -5
  65. package/build/mcp-profile.js +2 -2
  66. package/build/mcp-provisioning.js +2 -2
  67. package/build/mcp-server-invocation.js +3 -3
  68. package/build/merge-pull-request.js +15 -0
  69. package/build/model-routing-host.js +25 -0
  70. package/build/model-routing-preferences.js +99 -0
  71. package/build/pipelines.generated.js +11 -11
  72. package/build/plan-epic-implementer-eligibility.js +215 -0
  73. package/build/plan-execution-ledger.js +8 -0
  74. package/build/plane/member-roster.js +5 -5
  75. package/build/plane/supervisor.js +1 -1
  76. package/build/plane/types.js +5 -5
  77. package/build/readiness-check.js +1 -1
  78. package/build/readme.generated.js +1 -1
  79. package/build/review-tickets.js +4 -4
  80. package/build/setup-epic.js +8 -8
  81. package/build/start-tickets-conductor.js +32 -32
  82. package/build/start-tickets-prereqs.js +4 -9
  83. package/build/start-tickets.js +494 -98
  84. package/build/version.generated.js +3 -3
  85. package/docs/CONDUCTOR.md +69 -18
  86. package/docs/install/mcp-tool-integrations.md +2 -1
  87. package/package.json +2 -2
  88. package/pipelines/implement-ticket.json +2 -2
  89. package/pipelines/plan-epic.json +2 -2
  90. package/pipelines/review-ticket.json +1 -1
@@ -0,0 +1,99 @@
1
+ /** Personal, secret-free provider preferences. Read afresh for every tool call. */
2
+ import { promises as fs } from "node:fs";
3
+ import { homedir } from "node:os";
4
+ import { join } from "node:path";
5
+ const MAX_BYTES = 64 * 1024;
6
+ const PROVIDERS = new Set(["openai", "anthropic", "gemini"]);
7
+ const FEATURES = new Set(["review_ticket", "second_opinion", "council"]);
8
+ const warned = new Set();
9
+ const defaultIO = {
10
+ lstat: path => fs.lstat(path),
11
+ readFile: path => fs.readFile(path),
12
+ stderr: message => console.error(message),
13
+ platform: process.platform,
14
+ uid: typeof process.getuid === "function" ? process.getuid() : undefined,
15
+ };
16
+ export function modelRoutingPreferencesPath(home = homedir()) {
17
+ return join(home, ".config", "bridge", "model-routing.json");
18
+ }
19
+ function warn(category, io) {
20
+ if (!warned.has(category)) {
21
+ warned.add(category);
22
+ io.stderr(`Bridge model routing preference ignored (${category}).`);
23
+ }
24
+ return { providers: [], source: "automatic", warning: category };
25
+ }
26
+ function record(value) {
27
+ return value !== null && typeof value === "object" && !Array.isArray(value)
28
+ ? value : null;
29
+ }
30
+ function featureMap(value) {
31
+ const obj = record(value);
32
+ if (!obj)
33
+ return null;
34
+ const out = {};
35
+ for (const [key, raw] of Object.entries(obj)) {
36
+ if (!FEATURES.has(key) || !Array.isArray(raw) || raw.length > 3)
37
+ return null;
38
+ const providers = [];
39
+ for (const item of raw) {
40
+ if (typeof item !== "string")
41
+ return null;
42
+ const provider = item.trim().toLowerCase();
43
+ if (!PROVIDERS.has(provider) || providers.includes(provider))
44
+ return null;
45
+ providers.push(provider);
46
+ }
47
+ out[key] = providers;
48
+ }
49
+ return out;
50
+ }
51
+ /** Resolve an exact repository feature key over the machine key. */
52
+ export async function readModelRoutingPreference(repoName, feature, path = modelRoutingPreferencesPath(), io = defaultIO) {
53
+ if (!FEATURES.has(feature) || typeof repoName !== "string" || !repoName)
54
+ return warn("invalid_file", io);
55
+ let stat;
56
+ try {
57
+ stat = await io.lstat(path);
58
+ }
59
+ catch (error) {
60
+ if (error.code === "ENOENT")
61
+ return { providers: [], source: "automatic" };
62
+ return warn("unreadable_file", io);
63
+ }
64
+ if (!stat.isFile() || stat.size > MAX_BYTES || stat.size < 0 ||
65
+ (io.platform !== "win32" && ((stat.mode & 0o022) !== 0 ||
66
+ (io.uid !== undefined && stat.uid !== io.uid)))) {
67
+ return warn("unsafe_file", io);
68
+ }
69
+ let data;
70
+ try {
71
+ const raw = await io.readFile(path);
72
+ const decoded = typeof raw === "string" ? raw : new TextDecoder("utf-8", { fatal: true }).decode(raw);
73
+ data = JSON.parse(decoded);
74
+ }
75
+ catch {
76
+ return warn("unreadable_file", io);
77
+ }
78
+ const root = record(data);
79
+ if (!root || root.version !== 1 || (root.repositories !== undefined && !record(root.repositories)))
80
+ return warn("invalid_file", io);
81
+ const machine = featureMap(root.defaults ?? {});
82
+ if (!machine)
83
+ return warn("invalid_file", io);
84
+ const repositories = record(root.repositories ?? {});
85
+ if (Object.values(repositories).some(value => !featureMap(value)))
86
+ return warn("invalid_file", io);
87
+ const repository = Object.hasOwn(repositories, repoName) ? featureMap(repositories[repoName]) : {};
88
+ if (!repository)
89
+ return warn("invalid_file", io);
90
+ if (Object.hasOwn(repository, feature))
91
+ return {
92
+ providers: repository[feature], source: repository[feature].length ? "repository" : "automatic",
93
+ };
94
+ if (Object.hasOwn(machine, feature))
95
+ return {
96
+ providers: machine[feature], source: machine[feature].length ? "machine" : "automatic",
97
+ };
98
+ return { providers: [], source: "automatic" };
99
+ }