@bridge_gpt/mcp-server 0.2.34 → 0.2.37

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 (109) hide show
  1. package/README.md +490 -366
  2. package/build/agent-capabilities/probe-context.js +8 -1
  3. package/build/agent-capabilities/probes.js +7 -1
  4. package/build/agents.generated.js +1 -1
  5. package/build/base-url.js +79 -0
  6. package/build/bridge-api-urls.js +9 -0
  7. package/build/chain-orchestrator.js +93 -15
  8. package/build/claude-review-workflow.js +264 -0
  9. package/build/claude-user-config-doctor.js +317 -0
  10. package/build/cli-release.js +53 -0
  11. package/build/commands.generated.js +6 -5
  12. package/build/conductor/bridge-api-client.js +393 -4
  13. package/build/conductor/deny-enforcement-preflight.js +1 -0
  14. package/build/conductor/done-gate.js +44 -5
  15. package/build/conductor/epic-reconcile.js +6 -0
  16. package/build/conductor/install-doctor.js +462 -0
  17. package/build/conductor-bin.js +3 -3
  18. package/build/conductor-bundle-artifacts.js +37 -15
  19. package/build/credential-store.js +205 -4
  20. package/build/direct-ticket-tools.js +70 -0
  21. package/build/doctor.js +473 -81
  22. package/build/executor/cli.js +83 -6
  23. package/build/executor/credentials.js +39 -11
  24. package/build/executor/deps.js +32 -1
  25. package/build/executor/env.js +71 -28
  26. package/build/executor/heartbeat.js +138 -17
  27. package/build/executor/http-client.js +49 -8
  28. package/build/executor/index.js +4 -0
  29. package/build/executor/job-errors.js +4 -0
  30. package/build/executor/job-runner.js +530 -20
  31. package/build/executor/observation.js +130 -0
  32. package/build/executor/permissions.js +114 -8
  33. package/build/executor/preflight.js +127 -8
  34. package/build/executor/prompt-spec.js +51 -0
  35. package/build/executor/runner.js +23 -2
  36. package/build/executor/service-unit.js +876 -0
  37. package/build/executor/test-clock.js +75 -3
  38. package/build/executor/types.js +4 -18
  39. package/build/executor/worker-command.js +73 -12
  40. package/build/executor/worker-config-isolation.js +287 -0
  41. package/build/executor/worker-finalization.js +68 -14
  42. package/build/executor/worktree.js +46 -4
  43. package/build/index.js +1039 -237
  44. package/build/init.js +503 -111
  45. package/build/install-bridge-conductor.js +491 -0
  46. package/build/install-bridge.js +1188 -247
  47. package/build/install-reexec.js +233 -0
  48. package/build/launcher-config-inspection.js +351 -0
  49. package/build/mcp-host-config.js +11 -1
  50. package/build/mcp-install-state.js +32 -0
  51. package/build/mcp-invoke.js +49 -6
  52. package/build/mcp-provisioning.js +52 -13
  53. package/build/mcp-registration-doctor.js +14 -5
  54. package/build/notifications.js +553 -0
  55. package/build/pipeline-orchestrator.js +146 -4
  56. package/build/pipeline-utils.js +3 -0
  57. package/build/pipelines.generated.js +32 -13
  58. package/build/plan-execution-ledger.js +550 -0
  59. package/build/plan-phase-routing.js +272 -0
  60. package/build/plane/alembic-head.js +110 -0
  61. package/build/plane/build-freshness.js +167 -0
  62. package/build/plane/cli.js +480 -0
  63. package/build/plane/defaults.js +266 -0
  64. package/build/plane/manifest.js +377 -0
  65. package/build/plane/member-logs.js +147 -0
  66. package/build/plane/member-roster.js +147 -0
  67. package/build/plane/preflight.js +289 -0
  68. package/build/plane/shutdown.js +195 -0
  69. package/build/plane/status.js +125 -0
  70. package/build/plane/supervisor.js +569 -0
  71. package/build/plane/test-fakes.js +156 -0
  72. package/build/plane/types.js +75 -0
  73. package/build/readme.generated.js +1 -1
  74. package/build/run-unit-tests-launcher.js +259 -0
  75. package/build/setup-epic.js +772 -28
  76. package/build/sfcc/log-gate.js +38 -11
  77. package/build/sfcc/log-query.js +55 -15
  78. package/build/sfcc/ocapi-shape.js +51 -14
  79. package/build/sfcc/output.js +41 -11
  80. package/build/sfcc/permissions.js +24 -2
  81. package/build/sfcc/read-projection.js +181 -0
  82. package/build/sfcc/read-result.js +158 -0
  83. package/build/sfcc/reads-custom-object-def.js +29 -18
  84. package/build/sfcc/reads-site-preference.js +75 -29
  85. package/build/sfcc/reads-system-object.js +40 -34
  86. package/build/sfcc/sfcc-result.js +106 -0
  87. package/build/sfcc/tool-wrapper.js +56 -13
  88. package/build/sfcc/write-grants.js +45 -22
  89. package/build/sfcc/write-guard.js +21 -13
  90. package/build/sfcc/write-result.js +61 -14
  91. package/build/sfcc/write-tool-common.js +126 -32
  92. package/build/sfcc/writes-system-object.js +11 -50
  93. package/build/start-tickets-prereqs.js +129 -0
  94. package/build/start-tickets.js +17 -13
  95. package/build/ticket-backend-metadata.js +59 -0
  96. package/build/ticket-key-utils.js +92 -0
  97. package/build/tool-error-envelope.js +71 -0
  98. package/build/tool-surface-gating.js +72 -0
  99. package/build/update-status.js +102 -0
  100. package/build/upgrade-advice.js +47 -0
  101. package/build/upgrade-cli.js +412 -110
  102. package/build/version.generated.js +1 -1
  103. package/build/worktree-core.js +73 -0
  104. package/docs/CONDUCTOR.md +132 -6
  105. package/docs/install/mcp-tool-integrations.md +29 -21
  106. package/package.json +9 -6
  107. package/pipelines/implement-ticket.json +19 -4
  108. package/build/conductor/supervisor-judgment-python.js +0 -141
  109. package/build/conductor/supervisor-judgment.js +0 -215
@@ -12,6 +12,28 @@ function isOkBody(bodyText) {
12
12
  return false;
13
13
  }
14
14
  }
15
+ /**
16
+ * The server-published run-level stop field on a heartbeat response (BAPI-731,
17
+ * WS-B). Owned by the reconciler safety-plane ticket; until it ships the field is
18
+ * simply never present.
19
+ */
20
+ export const HEARTBEAT_STOP_FIELD = "stop_requested";
21
+ /**
22
+ * True ONLY for a literal `true` on the stop field. Anything else — absent,
23
+ * `false`, a string, a truthy non-boolean, or an unparseable body — means "no
24
+ * stop was requested", so an ambiguous body can never cancel a healthy run.
25
+ */
26
+ function parseStopRequested(bodyText) {
27
+ try {
28
+ const parsed = JSON.parse(bodyText);
29
+ if (!parsed || typeof parsed !== "object")
30
+ return false;
31
+ return parsed[HEARTBEAT_STOP_FIELD] === true;
32
+ }
33
+ catch {
34
+ return false;
35
+ }
36
+ }
15
37
  /**
16
38
  * Map a mutation (heartbeat/complete/fail) HTTP response onto the fencing
17
39
  * outcome. `allowInvalidResult` maps 422 to `invalid_job_result` (complete only).
@@ -92,14 +114,33 @@ export function createExecutorHttpClient(config) {
92
114
  // 5xx and any other unexpected status are retryable.
93
115
  return { kind: "retryable", error: `claim failed (HTTP ${status}): ${boundedDetail(text)}` };
94
116
  },
95
- heartbeat(job, payload) {
96
- return mutate(`/${job.id}/heartbeat`, {
97
- repo_name: job.repo_name,
98
- claim_token: job.claim_token,
99
- local_commit_count: payload.local_commit_count,
100
- last_commit_sha: payload.last_commit_sha,
101
- telemetry: payload.telemetry,
102
- }, false, job.repo_name);
117
+ // Heartbeat does NOT go through `mutate()`: it is the one mutation whose
118
+ // response BODY carries information beyond the outcome (the BAPI-731 stop
119
+ // request), so it maps the response itself instead of discarding the body.
120
+ async heartbeat(job, payload) {
121
+ let status;
122
+ let text;
123
+ try {
124
+ const res = await post(`/${job.id}/heartbeat`, {
125
+ repo_name: job.repo_name,
126
+ claim_token: job.claim_token,
127
+ local_commit_count: payload.local_commit_count,
128
+ last_commit_sha: payload.last_commit_sha,
129
+ telemetry: payload.telemetry,
130
+ }, job.repo_name);
131
+ status = res.status;
132
+ text = res.text;
133
+ }
134
+ catch {
135
+ // Transient network error — identical to the previous behavior; the
136
+ // caller's dead-man logic decides whether to keep the worker alive.
137
+ return { outcome: "fatal_http_error" };
138
+ }
139
+ const outcome = mapMutationResponse(status, text, false);
140
+ const result = { outcome };
141
+ if (parseStopRequested(text))
142
+ result.stop_requested = true;
143
+ return result;
103
144
  },
104
145
  complete(job, completion) {
105
146
  return mutate(`/${job.id}/complete`, {
@@ -7,4 +7,8 @@
7
7
  */
8
8
  export { runExecutorCli, getExecutorUsage, parseExecutorArgs } from "./cli.js";
9
9
  export { runExecutor } from "./runner.js";
10
+ // Persistent-service packaging (BAPI-688). The CLI entry plus the PURE helpers
11
+ // doctor needs to enumerate and inspect generated units — doctor must share this
12
+ // module's naming/format contract instead of maintaining a second parser.
13
+ export { runExecutorInstallServiceCli, getExecutorInstallServiceUsage, buildExecutorServiceArtifact, writeExecutorServiceArtifact, inspectExecutorServiceArtifact, executorLaunchdDirForHome, executorSystemdDirForHome, executorIdFromLaunchdFilename, executorIdFromSystemdFilename, EXECUTOR_SERVICE_BASE_URL_ENV, EXECUTOR_SERVICE_PATH_ENV, } from "./service-unit.js";
10
14
  export { runExecutorWatchCli, getExecutorWatchUsage, parseExecutorWatchArgs, } from "./watch-cli.js";
@@ -4,6 +4,10 @@ export const WorktreeLostBeforePush = "WorktreeLostBeforePush";
4
4
  export const BranchMismatch = "BranchMismatch";
5
5
  export const WorkerFinalizationMissingRemoteBranchAndPr = "WorkerFinalizationMissingRemoteBranchAndPr";
6
6
  export const WorkerFinalizationPrBaseMismatch = "WorkerFinalizationPrBaseMismatch";
7
+ export const WorkerFinalizationSavedButUnfinalized = "WorkerFinalizationSavedButUnfinalized";
8
+ export const WorkerConfigIsolation = "ContractError.WorkerConfigIsolation";
9
+ export const PreSpawnVerification = "ContractError.PreSpawnVerification";
10
+ export const BridgeCredentialUnavailable = "ContractError.BridgeCredentialUnavailable";
7
11
  /** Bound a failure message so no unbounded/secret-bearing text is posted. */
8
12
  const ERROR_MESSAGE_MAX_CHARS = 300;
9
13
  /**