@bridge_gpt/mcp-server 0.2.65 → 0.2.67
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.
- package/README.md +269 -82
- package/build/agent-capabilities/probes.js +15 -5
- package/build/agent-launchers/claude-executor-adapter.js +55 -34
- package/build/agent-launchers/executor-adapter.js +34 -4
- package/build/agents.generated.js +1 -1
- package/build/bounded-wait.js +67 -10
- package/build/bridge-config.js +104 -0
- package/build/codex-bridge-profile.js +10 -1
- package/build/commands.generated.js +12 -12
- package/build/conductor/bridge-api-client.js +372 -10
- package/build/conductor/bring-up-facts.js +1 -1
- package/build/conductor/doctor.js +3 -3
- package/build/conductor/epic-child-continuation.js +61 -34
- package/build/conductor/epic-implementer-cli.js +34 -6
- package/build/conductor/errors.js +4 -3
- package/build/conductor/guided-repair.js +327 -0
- package/build/conductor/hook-runtime-qualification.js +1 -1
- package/build/conductor/merge-execution-contract.js +27 -8
- package/build/conductor/merge-execution-eligibility.js +3 -2
- package/build/conductor/pr-ci-producer.js +1 -1
- package/build/conductor/readiness-cli.js +46 -9
- package/build/conductor/readiness-sections.js +41 -6
- package/build/conductor/readiness.js +204 -30
- package/build/conductor/recovery-cli.js +703 -20
- package/build/conductor/recovery-operations.js +392 -3
- package/build/conductor/repair-contract.js +112 -3
- package/build/conductor/repository-workflow-remedy.js +125 -0
- package/build/conductor/tools.js +2 -2
- package/build/conductor-bundle-artifacts.js +8 -0
- package/build/credential-store.js +5 -4
- package/build/diagnostic-text.js +36 -0
- package/build/docs.generated.js +8 -3
- package/build/doctor.js +70 -10
- package/build/drive-epic-key.js +6 -5
- package/build/drive-epic.js +479 -131
- package/build/epic-coherence-input.js +2 -1
- package/build/epic-implementer-bin.js +30 -26
- package/build/epic-implementer-bundle-cli.js +2 -2
- package/build/epic-launch-diagnostic.js +31 -0
- package/build/epic-launch-profile.js +44 -14
- package/build/executor/cli.js +3 -2
- package/build/executor/completion-contract.js +48 -5
- package/build/executor/completion-supervision.js +9 -0
- package/build/executor/correction-dispatch.js +60 -0
- package/build/executor/env.js +25 -0
- package/build/executor/heartbeat.js +1 -1
- package/build/executor/http-client.js +35 -0
- package/build/executor/integration-job.js +6 -1
- package/build/executor/job-errors.js +38 -4
- package/build/executor/job-log-registry.js +340 -73
- package/build/executor/job-runner.js +485 -74
- package/build/executor/job-types.js +8 -13
- package/build/executor/observation.js +6 -1
- package/build/executor/preflight.js +136 -10
- package/build/executor/prompt-spec.js +113 -9
- package/build/executor/required-work-ledger.js +6 -1
- package/build/executor/resume-pre-spawn.js +2 -0
- package/build/executor/runner.js +31 -2
- package/build/executor/service-unit.js +7 -1
- package/build/executor/stale-artifacts.js +5 -4
- package/build/executor/types.js +1 -0
- package/build/executor/watch-cli.js +35 -8
- package/build/executor/worker-command.js +43 -43
- package/build/executor/worker-finalization.js +161 -43
- package/build/executor/worker-guard-hook.js +152 -12
- package/build/executor/worker-log.js +137 -70
- package/build/executor/worktree-gc.js +30 -6
- package/build/executor/worktree.js +82 -1
- package/build/index.js +482 -660
- package/build/init.js +107 -4
- package/build/install-bridge-conductor.js +8 -6
- package/build/install-bridge.js +287 -23
- package/build/install-doctor.js +172 -30
- package/build/install-reexec.js +69 -7
- package/build/macos-terminal-permission-guidance.js +16 -0
- package/build/model-thresholds-tool.js +185 -0
- package/build/phase-context-git-probe.js +68 -0
- package/build/phase-result-artifacts.js +173 -5
- package/build/pipelines.generated.js +19 -25
- package/build/plane/alembic-head.js +12 -3
- package/build/plane/base-worktree-guard.js +147 -0
- package/build/plane/cli.js +217 -17
- package/build/plane/code-snapshot.js +468 -0
- package/build/plane/defaults.js +48 -3
- package/build/plane/endpoint.js +41 -0
- package/build/plane/manifest.js +120 -1
- package/build/plane/member-roster.js +94 -19
- package/build/plane/preflight.js +30 -2
- package/build/plane/process-cwd.js +67 -0
- package/build/plane/restart.js +542 -0
- package/build/plane/shutdown.js +31 -0
- package/build/plane/status.js +145 -6
- package/build/plane/supervisor.js +588 -177
- package/build/plane/types.js +54 -2
- package/build/plane/worker-exit-code.js +2 -0
- package/build/printed-remedy-commands.js +37 -0
- package/build/project-root.js +99 -0
- package/build/readiness-check.js +1 -1
- package/build/readme.generated.js +1 -1
- package/build/review-generation.js +22 -0
- package/build/review-tickets.js +156 -13
- package/build/setup-epic.js +224 -127
- package/build/sfcc/config.js +9 -0
- package/build/sfcc/credentials.js +100 -38
- package/build/sfcc/hostname.js +67 -0
- package/build/sfcc/permissions.js +17 -13
- package/build/sfcc/register.js +1 -1
- package/build/sfcc/setup-status.js +2 -0
- package/build/sfcc/tool-wrapper.js +41 -43
- package/build/sfcc/tools-configured.js +96 -0
- package/build/sfcc/write-grants.js +17 -11
- package/build/sfcc/write-result.js +4 -3
- package/build/sfcc/writes-site-preference.js +20 -8
- package/build/start-tickets.js +332 -79
- package/build/tool-error-envelope.js +61 -0
- package/build/upgrade-cli.js +109 -24
- package/build/version.generated.js +3 -3
- package/build/visual-diff.js +22 -1
- package/build/windows-npm-entry.js +103 -0
- package/build/worker-guard-hook-bin.js +3 -5
- package/build/worker-guard-hook-main.js +47 -0
- package/build/worktree-core.js +136 -9
- package/docs/EPIC-IMPLEMENTER-INSTALL.md +849 -0
- package/docs/EPIC-IMPLEMENTER.md +662 -0
- package/docs/install/mcp-tool-integrations.md +25 -15
- package/docs/install/sfcc-integration.md +21 -8
- package/package.json +1 -1
- package/pipelines/implement-ticket.json +1 -1
- package/pipelines/plan-epic.json +0 -5
- package/pipelines/review-ticket.json +1 -1
- package/docs/CONDUCTOR.md +0 -605
- package/pipelines/idea-to-pr.json +0 -49
package/build/init.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* effects and depends only on leaf modules.
|
|
11
11
|
*/
|
|
12
12
|
import { writeFile, mkdir, readFile, stat } from "fs/promises";
|
|
13
|
+
import { execFile } from "child_process";
|
|
13
14
|
import path from "path";
|
|
14
15
|
import os from "os";
|
|
15
16
|
import { COMMANDS } from "./commands.generated.js";
|
|
@@ -19,7 +20,7 @@ import { AGENTS } from "./agents.generated.js";
|
|
|
19
20
|
import { DOCS } from "./docs.generated.js";
|
|
20
21
|
import { VERSION, LAUNCHER_ARGS } from "./version.generated.js";
|
|
21
22
|
import { reconstructAgentMarkdown, translateAgentToCopilot, translateCommandToCopilot, } from "./agent-utils.js";
|
|
22
|
-
import { validateRepoName, resolveRepoNameForProjectRoot } from "./bridge-config.js";
|
|
23
|
+
import { BRIDGE_CONFIG_TEAMMATE_NOTICE_LINES, validateBridgeConfigRepoNameRepresentability, validateRepoName, resolveRepoNameForProjectRoot, } from "./bridge-config.js";
|
|
23
24
|
import { ensureGitignored as ensureGitignoredShared } from "./git-ignore-utils.js";
|
|
24
25
|
import { resolveBapiCredentials } from "./credential-store.js";
|
|
25
26
|
import { describeLauncherReason, DUPLICATE_REGISTRATION_GUIDANCE, inspectLauncherConfigs, isPrerequisiteFailure, } from "./launcher-config-inspection.js";
|
|
@@ -133,6 +134,8 @@ export function buildBridgeConfigManifest(repoName) {
|
|
|
133
134
|
"# Inherited by every git worktree; start-tickets worktree provisioning reads it",
|
|
134
135
|
"# to decide which Bridge API MCP registrations to write. Do not add credentials,",
|
|
135
136
|
"# connection URLs, or machine-specific paths here — those are resolved at runtime.",
|
|
137
|
+
"#",
|
|
138
|
+
...BRIDGE_CONFIG_TEAMMATE_NOTICE_LINES,
|
|
136
139
|
"",
|
|
137
140
|
`repo_name = "${repoName}"`,
|
|
138
141
|
"",
|
|
@@ -389,6 +392,65 @@ export class InitPreflightError extends Error {
|
|
|
389
392
|
this.failures = failures;
|
|
390
393
|
}
|
|
391
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* Classify `git ls-files --error-unmatch -- <relPath>` from its exit code: 0 is
|
|
397
|
+
* tracked, 1 is untracked, anything else is undetermined. Shared by `runInit`
|
|
398
|
+
* and install so both reach the same verdict from the same probe.
|
|
399
|
+
*/
|
|
400
|
+
export function classifyTrackedProbeExitCode(exitCode) {
|
|
401
|
+
if (exitCode === 0)
|
|
402
|
+
return "tracked";
|
|
403
|
+
if (exitCode === 1)
|
|
404
|
+
return "untracked";
|
|
405
|
+
return "undetermined";
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Default tracked-config probe for `runInit`: runs git with an ARGUMENT LIST,
|
|
409
|
+
* never a shell string, in `cwd`. Any failure is `undetermined`, which callers
|
|
410
|
+
* treat as untracked — the probe fails OPEN, so a missing git or a non-repo
|
|
411
|
+
* folder still gets today's `BAPI_PROJECT_ROOT = cwd` rewrite.
|
|
412
|
+
*/
|
|
413
|
+
export function defaultIsTrackedConfig(cwd) {
|
|
414
|
+
return (relPath) => new Promise((resolve) => {
|
|
415
|
+
try {
|
|
416
|
+
execFile("git", ["ls-files", "--error-unmatch", "--", relPath], { cwd, windowsHide: true, timeout: 10_000 }, (error) => {
|
|
417
|
+
if (!error)
|
|
418
|
+
return resolve("tracked");
|
|
419
|
+
const code = error.code;
|
|
420
|
+
resolve(classifyTrackedProbeExitCode(typeof code === "number" ? code : null));
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
catch {
|
|
424
|
+
resolve("undetermined");
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Decide the `BAPI_PROJECT_ROOT` an EXISTING Bridge entry should carry (BAPI-1318).
|
|
430
|
+
* A git-tracked config keeps its existing non-blank value exactly: the runtime
|
|
431
|
+
* check in `project-root.ts` makes a committed path harmless for teammates, and
|
|
432
|
+
* rewriting it would put this machine's path into everyone's diff. Untracked and
|
|
433
|
+
* undetermined configs, and blank or absent values, get `cwd` as before.
|
|
434
|
+
*
|
|
435
|
+
* `warnReplaced` is true only when the probe was undetermined AND a different,
|
|
436
|
+
* non-blank value is being replaced — the one case where a tracked path may have
|
|
437
|
+
* been rewritten without the protection applying.
|
|
438
|
+
*/
|
|
439
|
+
export function decideExistingProjectRoot(existing, cwd, tracked) {
|
|
440
|
+
const current = typeof existing === "string" ? existing : "";
|
|
441
|
+
const blank = current.trim().length === 0;
|
|
442
|
+
if (tracked === "tracked" && !blank)
|
|
443
|
+
return { value: current, warnReplaced: false };
|
|
444
|
+
return {
|
|
445
|
+
value: cwd,
|
|
446
|
+
warnReplaced: tracked === "undetermined" && !blank && current !== cwd,
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
/** The one secret-safe warning for an undetermined probe that replaced a root. */
|
|
450
|
+
export function formatUndeterminedRootReplacedWarning(relPath) {
|
|
451
|
+
return (` Warning: could not tell whether ${relPath} is tracked by git, so its BAPI_PROJECT_ROOT ` +
|
|
452
|
+
"was rewritten to this folder. Review its diff before committing.");
|
|
453
|
+
}
|
|
392
454
|
/**
|
|
393
455
|
* Resolve the non-secret identity a NEW Bridge entry should carry.
|
|
394
456
|
*
|
|
@@ -518,6 +580,20 @@ export async function runInit(cwd, options = {}) {
|
|
|
518
580
|
const targetSpec = `${MCP_PACKAGE_NAME}@${targetVersion}`;
|
|
519
581
|
const say = options.stdout ?? ((m) => console.log(m));
|
|
520
582
|
const warn = options.stderr ?? ((m) => console.error(m));
|
|
583
|
+
const trackedProbe = options.isTrackedConfig ?? defaultIsTrackedConfig(cwd);
|
|
584
|
+
const probeTracked = async (relPath) => {
|
|
585
|
+
try {
|
|
586
|
+
const verdict = await trackedProbe(relPath);
|
|
587
|
+
if (verdict === true)
|
|
588
|
+
return "tracked";
|
|
589
|
+
if (verdict === false)
|
|
590
|
+
return "untracked";
|
|
591
|
+
return verdict === "tracked" || verdict === "untracked" ? verdict : "undetermined";
|
|
592
|
+
}
|
|
593
|
+
catch {
|
|
594
|
+
return "undetermined";
|
|
595
|
+
}
|
|
596
|
+
};
|
|
521
597
|
// ---- Phase 1: IDE Detection ----
|
|
522
598
|
// BAPI-708: detection lives in `detectInitIdes` so the commit-safe asset
|
|
523
599
|
// manifest resolves the SAME conditional targets this scaffolder writes.
|
|
@@ -701,7 +777,17 @@ export async function runInit(cwd, options = {}) {
|
|
|
701
777
|
entry.args = refreshed;
|
|
702
778
|
if (!entry.env)
|
|
703
779
|
entry.env = {};
|
|
704
|
-
|
|
780
|
+
// BAPI-1318: a git-tracked config keeps its committed BAPI_PROJECT_ROOT.
|
|
781
|
+
// The probe runs only when there is a non-blank value to preserve.
|
|
782
|
+
const existingRoot = entry.env.BAPI_PROJECT_ROOT;
|
|
783
|
+
let trackedVerdict = "untracked";
|
|
784
|
+
if (typeof existingRoot === "string" && existingRoot.trim().length > 0 && existingRoot !== cwd) {
|
|
785
|
+
trackedVerdict = await probeTracked(target.path);
|
|
786
|
+
}
|
|
787
|
+
const rootDecision = decideExistingProjectRoot(existingRoot, cwd, trackedVerdict);
|
|
788
|
+
entry.env.BAPI_PROJECT_ROOT = rootDecision.value;
|
|
789
|
+
if (rootDecision.warnReplaced)
|
|
790
|
+
warn(formatUndeterminedRootReplacedWarning(target.path));
|
|
705
791
|
await io.writeFile(fullPath, JSON.stringify(parsed, null, 2) + "\n", "utf-8");
|
|
706
792
|
const kind = found.action === "already-current"
|
|
707
793
|
? "already-current"
|
|
@@ -1094,9 +1180,24 @@ says to serialize structured output.
|
|
|
1094
1180
|
// the credential landed and which generated assets are safe to commit. Removed
|
|
1095
1181
|
// outright rather than behind an output-mode flag — parameterizing would change
|
|
1096
1182
|
// the injected `deps.runInit` seam signature for no user-visible gain.
|
|
1183
|
+
// BAPI-1318: a caller that already resolved the project name (install) is
|
|
1184
|
+
// authoritative, so the manifest agrees with the MCP entry. `--init` and
|
|
1185
|
+
// `upgrade` pass no creation context and keep the folder-name default.
|
|
1186
|
+
let bridgeConfigCreated = false;
|
|
1187
|
+
let bridgeConfigRepoName;
|
|
1097
1188
|
if (!bridgeConfigExists) {
|
|
1098
|
-
|
|
1099
|
-
|
|
1189
|
+
const scaffoldName = options.creationContext?.repoName ?? chooseScaffoldRepoName(cwd);
|
|
1190
|
+
const representable = validateBridgeConfigRepoNameRepresentability(scaffoldName);
|
|
1191
|
+
if (representable.ok) {
|
|
1192
|
+
await mkdir(path.dirname(bridgeConfigPath), { recursive: true });
|
|
1193
|
+
await writeFile(bridgeConfigPath, buildBridgeConfigManifest(representable.value), "utf-8");
|
|
1194
|
+
bridgeConfigCreated = true;
|
|
1195
|
+
bridgeConfigRepoName = representable.value;
|
|
1196
|
+
}
|
|
1197
|
+
else {
|
|
1198
|
+
warn(" Warning: .bridge/config was not created because this project name cannot be written " +
|
|
1199
|
+
`there (${representable.error}). Worktrees and shell tools will fall back to the git folder name.`);
|
|
1200
|
+
}
|
|
1100
1201
|
}
|
|
1101
1202
|
// BAPI-728: authoritative, secret-free outcome. `ok` is false whenever any
|
|
1102
1203
|
// entry authenticates as nobody, so no caller can report full success over a
|
|
@@ -1106,5 +1207,7 @@ says to serialize structured output.
|
|
|
1106
1207
|
configActions: structuredActions,
|
|
1107
1208
|
readinessWarnings,
|
|
1108
1209
|
targetVersion,
|
|
1210
|
+
bridgeConfigCreated,
|
|
1211
|
+
...(bridgeConfigRepoName !== undefined ? { bridgeConfigRepoName } : {}),
|
|
1109
1212
|
};
|
|
1110
1213
|
}
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
* The command does NOT persist a repository-level review policy: that is
|
|
107
107
|
* BAPI-694's. The policy selected here is per-run and is reported as such.
|
|
108
108
|
*/
|
|
109
|
+
import { PRINTED_INSTALL_COMMAND } from "./printed-remedy-commands.js";
|
|
109
110
|
import { bootstrapConductorSupervisorDefaults, classifySupervisorBootstrapFailure, fetchConductorReadiness, previewConductorSupervisorBootstrap, } from "./conductor/bridge-api-client.js";
|
|
110
111
|
import { CONDUCTOR_OPERATOR_RUNBOOK_POINTER, EXECUTOR_PROVISIONING_GUIDANCE, conductorInstallDoctorExitCode, conductorInstallDoctorHasFatal, formatConductorInstallDoctorReport, } from "./conductor/install-doctor.js";
|
|
111
112
|
import { describeNativeLedgerAvailability, } from "./conductor/doctor.js";
|
|
@@ -138,7 +139,7 @@ export function getInstallBridgeConductorUsage() {
|
|
|
138
139
|
return [
|
|
139
140
|
"Usage: install conductor [options]",
|
|
140
141
|
"",
|
|
141
|
-
"Bootstrap Epic
|
|
142
|
+
"Bootstrap the Epic Implementer for this repository: run the unified read-only",
|
|
142
143
|
"doctor, write the safe project-default supervisor posture, optionally scaffold",
|
|
143
144
|
"the claude-review workflow, report the capability matrix, and re-run the doctor.",
|
|
144
145
|
"",
|
|
@@ -183,9 +184,10 @@ export function getInstallBridgeConductorUsage() {
|
|
|
183
184
|
" approves one named server and has no default.",
|
|
184
185
|
" --execution-mode <mode> local | durable (default: durable with",
|
|
185
186
|
" --executor-id, otherwise local).",
|
|
186
|
-
" --policy-file <path> Run policy the profile references
|
|
187
|
-
" run
|
|
188
|
-
" API server
|
|
187
|
+
" --policy-file <path> Run policy the profile references. An unattended",
|
|
188
|
+
" run escalates to a notify.webhook_url reachable",
|
|
189
|
+
" from the API server or, with none declared, to the",
|
|
190
|
+
" account's email (notify.local_sink is not enough).",
|
|
189
191
|
" --dry-run Diagnose and preview only. Performs NO writes:",
|
|
190
192
|
" no POST, no file write, no host MCP config write,",
|
|
191
193
|
" no Git hook write, no install-state or capability",
|
|
@@ -208,7 +210,7 @@ export function getInstallBridgeConductorUsage() {
|
|
|
208
210
|
"nor changed. No file is ever created: when no supported config carries a",
|
|
209
211
|
"a Bridge entry, the run says so and points at the base `install` command.",
|
|
210
212
|
"The MCP server captures its active groups at startup, so a merge activates on",
|
|
211
|
-
"the next launch — restart your MCP client to see the
|
|
213
|
+
"the next launch — restart your MCP client to see the Epic Implementer tools.",
|
|
212
214
|
"",
|
|
213
215
|
"Local observability (a SEPARATE consent): installs or updates this",
|
|
214
216
|
"repository's managed conductor Git hooks (post-commit,",
|
|
@@ -939,7 +941,7 @@ export function formatConductorRestartAdvisory(mergedProfile) {
|
|
|
939
941
|
"client to gain access to the Epic Implementer tools.");
|
|
940
942
|
}
|
|
941
943
|
/** Remediation printed when no supported host config carries a Bridge entry. */
|
|
942
|
-
export const CONDUCTOR_PROFILE_EMPTY_MERGE_REMEDIATION = `run
|
|
944
|
+
export const CONDUCTOR_PROFILE_EMPTY_MERGE_REMEDIATION = `run \`${PRINTED_INSTALL_COMMAND}\` to create and register the host MCP entry, ` +
|
|
943
945
|
"then re-run `install conductor`.";
|
|
944
946
|
/** Remediation printed whenever the managed conductor hooks were not installed. */
|
|
945
947
|
export const CONDUCTOR_HOOKS_MANUAL_REMEDIATION = "re-run `install conductor` and accept the local-observability consent, or run " +
|