@bridge_gpt/mcp-server 0.2.73 → 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.
- package/README.md +5 -5
- package/build/agent-launchers/claude-executor-adapter.js +12 -0
- package/build/agents.generated.js +3 -3
- package/build/bridge-config.js +7 -1
- package/build/bridge-permissions.js +3 -0
- package/build/command-provisioning.js +4 -3
- package/build/commands.generated.js +5 -5
- package/build/conductor/bridge-api-client.js +26 -1
- package/build/conductor/command-drift.js +1 -1
- package/build/conductor/declared-extras.js +335 -0
- package/build/conductor/doctor.js +2 -0
- package/build/conductor/driver-pass-output.js +104 -0
- package/build/conductor/driver-pass.js +571 -0
- package/build/conductor/epic-branch-ci-inspection.js +61 -16
- package/build/conductor/epic-implementer-cli.js +33 -0
- package/build/conductor/epic-server-sfcc-upload.js +1567 -0
- package/build/conductor/epic-server-sfcc.js +58 -80
- package/build/conductor/epic-server.js +57 -4
- package/build/conductor/gate-discovery.js +46 -6
- package/build/conductor/gate-settings-review.js +51 -14
- package/build/credential-delivery.js +280 -0
- package/build/credential-launch-safety.js +142 -0
- package/build/credential-materialization.js +91 -16
- package/build/credential-references-node-deps.js +29 -0
- package/build/credential-references.js +1394 -0
- package/build/credential-references.test-fixtures.js +211 -0
- package/build/credential-scan-conventions.js +145 -0
- package/build/credential-scan.js +517 -0
- package/build/credential-store.js +50 -0
- package/build/credentials-cli.js +252 -3
- package/build/dependency-install-declarations.js +47 -1
- package/build/docs.generated.js +8 -1
- package/build/doctor.js +41 -0
- package/build/drive-epic.js +297 -37
- package/build/epic-branch-ci-summary.js +18 -1
- package/build/epic-capability-statement.js +71 -3
- package/build/epic-ci-workflow-drift.js +52 -13
- package/build/epic-ci-workflow-install.js +31 -6
- package/build/epic-ci-workflow-v3.js +273 -0
- package/build/epic-ci-workflow.js +128 -7
- package/build/epic-implementer-bin.js +161 -70
- package/build/epic-launch-context.js +102 -7
- package/build/epic-server-record.js +30 -15
- package/build/executor/credential-delivery-step.js +168 -0
- package/build/executor/deps.js +3 -1
- package/build/executor/env.js +39 -1
- package/build/executor/epic-server-context.js +23 -7
- package/build/executor/guarded-fast-forward-push.js +13 -8
- package/build/executor/job-runner.js +159 -17
- package/build/executor/permissions.js +85 -3
- package/build/executor/prompt-spec.js +37 -3
- package/build/executor-launch.js +4 -2
- package/build/git-exclude-lock.js +187 -0
- package/build/index.js +398 -269
- package/build/install-bridge-conductor-answers.js +84 -21
- package/build/install-bridge-conductor-apply.js +30 -1
- package/build/install-bridge-conductor-assessment.js +375 -48
- package/build/install-bridge-conductor-compact.js +27 -2
- package/build/install-bridge-conductor-contracts.js +10 -1
- package/build/install-bridge-conductor-gate.js +124 -11
- package/build/install-bridge-conductor-setup.js +46 -8
- package/build/install-bridge-conductor.js +625 -113
- package/build/install-bridge.js +88 -11
- package/build/install-doctor.js +38 -8
- package/build/install-sfcc-detection.js +120 -0
- package/build/install-sfcc-setup.js +185 -0
- package/build/mcp-grant-candidates.js +108 -96
- package/build/mcp-invoke.js +168 -4
- package/build/mcp-provisioning.js +21 -4
- package/build/mcp-server-invocation.js +13 -0
- package/build/merge-workflow-install.js +9 -1
- package/build/pipelines.generated.js +2 -1
- package/build/plane/status.js +8 -2
- package/build/printed-remedy-commands.js +5 -0
- package/build/project-root.js +40 -0
- package/build/readme.generated.js +1 -1
- package/build/repository-state-paths.js +5 -2
- package/build/repository-toolchains.js +6 -3
- package/build/setup-epic.js +116 -15
- package/build/sfcc/credentials.js +3 -2
- package/build/sfcc/hostname.js +98 -2
- package/build/sfcc/tool-wrapper.js +6 -95
- package/build/start-tickets.js +193 -29
- package/build/test-support/executor-source-files.js +200 -0
- package/build/testing-config-client.js +25 -2
- package/build/third-party-mcp-targets.js +35 -4
- package/build/version.generated.js +3 -3
- package/build/with-credentials.js +208 -0
- package/build/worktree-credential-delivery.js +340 -0
- package/package.json +1 -1
|
@@ -76,19 +76,38 @@
|
|
|
76
76
|
* line) so a later run can re-render the file byte for byte and tell a
|
|
77
77
|
* legitimate toolchain change from a hand edit.
|
|
78
78
|
*
|
|
79
|
+
* ## Approved install commands (renderer version 4, BAPI-1677)
|
|
80
|
+
*
|
|
81
|
+
* Version 3 always ran the fixed install line for each toolchain. A project whose
|
|
82
|
+
* tests need an optional extra failed in CI the way it failed on a worker. Version 4
|
|
83
|
+
* takes the entries the owner approved, the same ones the test trial and every worker
|
|
84
|
+
* use. With none, or with a list that only repeats fixed install lines, it keeps
|
|
85
|
+
* version 3's install lines. With any other list, it keeps the runtime setup, manager
|
|
86
|
+
* bootstrap, and PATH steps, and renders each entry as its own step in its own
|
|
87
|
+
* directory, every argument quoted for the shell. An entry replaces a fixed install
|
|
88
|
+
* line only when it runs that line's manager at the repository root. Every other fixed
|
|
89
|
+
* line stays, so a partial list loses nothing. The pip line always stays, because setup
|
|
90
|
+
* never proposes pip. Entry steps use a block scalar, so the stored test command stays
|
|
91
|
+
* the only double-quoted `run:` line. The entries are recorded in the header, so a later
|
|
92
|
+
* run can reproduce the file.
|
|
93
|
+
*
|
|
79
94
|
* The command still never receives a prefix or an install: it stays on its one
|
|
80
95
|
* protected scalar line.
|
|
81
96
|
*/
|
|
82
97
|
import { BUN_VERSION_RANGE, NODE_FALLBACK_MAJOR, PNPM_FALLBACK_MAJOR, POETRY_VERSION, PYTHON_FALLBACK_MINOR, YARN_BERRY_FALLBACK_MAJOR, serializeRepositoryToolchains, validateRepositoryToolchains, } from "./repository-toolchains.js";
|
|
98
|
+
import { DEPENDENCY_INSTALL_UNSAFE_MESSAGE, parseDependencyInstallStrict, } from "./dependency-install-declarations.js";
|
|
99
|
+
import { posixShellQuote } from "./platform-escaping.js";
|
|
83
100
|
import { validateTestCommand } from "./test-command-validation.js";
|
|
84
101
|
/** Repository-relative path of the managed workflow. */
|
|
85
102
|
export const EPIC_CI_WORKFLOW_PATH = ".github/workflows/epic-implementer-ci.yml";
|
|
86
103
|
/** The renderer version written into the managed header. */
|
|
87
|
-
export const EPIC_CI_WORKFLOW_RENDERER_VERSION =
|
|
104
|
+
export const EPIC_CI_WORKFLOW_RENDERER_VERSION = 4;
|
|
88
105
|
/** The header marker key; the line is `# <key>: <version>`. */
|
|
89
106
|
export const EPIC_CI_WORKFLOW_VERSION_MARKER_KEY = "x-bridge-ci-renderer-version";
|
|
90
107
|
/** The header marker key for the canonical toolchain set; the line is `# <key>: <json>`. */
|
|
91
108
|
export const EPIC_CI_WORKFLOW_TOOLCHAINS_MARKER_KEY = "x-bridge-ci-toolchains";
|
|
109
|
+
/** BAPI-1677 — the header marker key for the approved install commands; the line is `# <key>: <json>`. */
|
|
110
|
+
export const EPIC_CI_WORKFLOW_DEPENDENCY_INSTALL_MARKER_KEY = "x-bridge-ci-dependency-install";
|
|
92
111
|
/** The `name:` of the one step that runs the stored command. */
|
|
93
112
|
export const EPIC_CI_COMMAND_STEP_NAME = "Run the stored test command";
|
|
94
113
|
/** Pinned action majors. Changing any of these is a renderer-version change. */
|
|
@@ -146,6 +165,53 @@ function pythonSetupLines(python) {
|
|
|
146
165
|
: " python-version-file: " + python,
|
|
147
166
|
];
|
|
148
167
|
}
|
|
168
|
+
const INSTALL_STEP_NAME = " - name: Install dependencies";
|
|
169
|
+
/** The run text of each fixed "Install dependencies" step, in file order. Every such step is two lines. */
|
|
170
|
+
function fixedInstallCommands(lines) {
|
|
171
|
+
const fixed = [];
|
|
172
|
+
lines.forEach((line, index) => {
|
|
173
|
+
if (line === INSTALL_STEP_NAME)
|
|
174
|
+
fixed.push((lines[index + 1] ?? "").replace(/^ *run: /, ""));
|
|
175
|
+
});
|
|
176
|
+
return fixed;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* True when an approved entry replaces this fixed install command: it runs the same manager at the
|
|
180
|
+
* repository root, where the fixed step runs. An entry elsewhere does not install the root's
|
|
181
|
+
* dependencies. pip is never replaced, because setup never proposes it, so an approved list that
|
|
182
|
+
* leaves pip out has not decided anything about it.
|
|
183
|
+
*/
|
|
184
|
+
function entriesReplaceFixedInstall(command, entries) {
|
|
185
|
+
const manager = command.split(" ")[0];
|
|
186
|
+
return manager !== "pip" && entries.some((entry) => entry.cwd === "." && entry.argv[0] === manager);
|
|
187
|
+
}
|
|
188
|
+
/** Drop only the fixed install steps the approved entries replace, keeping everything around them. */
|
|
189
|
+
function withoutReplacedInstallSteps(lines, entries) {
|
|
190
|
+
const kept = [];
|
|
191
|
+
for (let i = 0; i < lines.length; i += 1) {
|
|
192
|
+
if (lines[i] === INSTALL_STEP_NAME && entriesReplaceFixedInstall((lines[i + 1] ?? "").replace(/^ *run: /, ""), entries)) {
|
|
193
|
+
i += 1;
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
kept.push(lines[i]);
|
|
197
|
+
}
|
|
198
|
+
return kept;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* True when every entry is one of the fixed install commands at the repository root, in the fixed
|
|
202
|
+
* order. The list may name only some of them, because the others keep running either way.
|
|
203
|
+
*/
|
|
204
|
+
function repeatsFixedInstallLines(lines, entries) {
|
|
205
|
+
const fixed = fixedInstallCommands(lines);
|
|
206
|
+
let next = 0;
|
|
207
|
+
return entries.every((entry) => {
|
|
208
|
+
if (entry.cwd !== ".")
|
|
209
|
+
return false;
|
|
210
|
+
const found = fixed.indexOf(entry.argv.join(" "), next);
|
|
211
|
+
next = found + 1;
|
|
212
|
+
return found !== -1;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
149
215
|
function javaScriptSetupLines(js) {
|
|
150
216
|
switch (js.manager) {
|
|
151
217
|
case "npm":
|
|
@@ -232,15 +298,62 @@ function toolchainSetupLines(toolchains) {
|
|
|
232
298
|
}
|
|
233
299
|
return lines;
|
|
234
300
|
}
|
|
301
|
+
/** Raised for approved entries the renderer will not write. Its message is fixed text. */
|
|
302
|
+
export class EpicCiDependencyInstallError extends Error {
|
|
303
|
+
constructor() {
|
|
304
|
+
super(DEPENDENCY_INSTALL_UNSAFE_MESSAGE);
|
|
305
|
+
this.name = "EpicCiDependencyInstallError";
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
/** Escape every non-ASCII character, so a permitted separator cannot start a new header line. */
|
|
309
|
+
function asciiJson(value) {
|
|
310
|
+
return JSON.stringify(value).replace(/[\u007f-\uffff]/g, (ch) => "\\u" + ch.charCodeAt(0).toString(16).padStart(4, "0"));
|
|
311
|
+
}
|
|
312
|
+
/** The one header form of the entries: fixed key order, and every list in its own order. */
|
|
313
|
+
export function serializeEpicCiDependencyInstall(entries) {
|
|
314
|
+
return asciiJson(entries.map((e) => ({ cwd: e.cwd, argv: e.argv, lockfiles: e.lockfiles })));
|
|
315
|
+
}
|
|
316
|
+
/** Characters a YAML reader could take as a break, or refuse, inside a block scalar. */
|
|
317
|
+
const BLOCK_SCALAR_UNSAFE = /([\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u2028\u2029\ufeff]+)/;
|
|
318
|
+
/** One argument for bash. Such characters are written as `$'\\xNN'` bytes, so the line stays one line. */
|
|
319
|
+
function shellWord(arg) {
|
|
320
|
+
const parts = arg.split(BLOCK_SCALAR_UNSAFE).filter((part) => part.length > 0);
|
|
321
|
+
return parts
|
|
322
|
+
.map((part) => BLOCK_SCALAR_UNSAFE.test(part)
|
|
323
|
+
? "$'" + [...Buffer.from(part, "utf8")].map((b) => "\\x" + b.toString(16).padStart(2, "0")).join("") + "'"
|
|
324
|
+
: posixShellQuote(part))
|
|
325
|
+
.join("");
|
|
326
|
+
}
|
|
327
|
+
function dependencyInstallStepLines(entries) {
|
|
328
|
+
return entries.flatMap((entry, index) => [
|
|
329
|
+
" - name: Install declared dependencies (" + String(index + 1) + " of " + String(entries.length) + ")",
|
|
330
|
+
" shell: bash",
|
|
331
|
+
" working-directory: " + encodeCommandScalar(entry.cwd),
|
|
332
|
+
" run: |-",
|
|
333
|
+
" " + entry.argv.map(shellWord).join(" "),
|
|
334
|
+
]);
|
|
335
|
+
}
|
|
235
336
|
/**
|
|
236
|
-
* Render the workflow for `testCommand
|
|
237
|
-
* Deterministic: the same inputs always give the same bytes. Throws
|
|
238
|
-
* `TestCommandValidationError` for a bad command
|
|
239
|
-
*
|
|
337
|
+
* Render the workflow for `testCommand`, the resolved `toolchains`, and the approved
|
|
338
|
+
* install `entries`. Deterministic: the same inputs always give the same bytes. Throws
|
|
339
|
+
* `TestCommandValidationError` for a bad command, `RepositoryToolchainError` for a
|
|
340
|
+
* toolchain set outside the closed vocabulary, and `EpicCiDependencyInstallError` for
|
|
341
|
+
* entries the shared rules refuse, so a value an older server accepted cannot reach a
|
|
342
|
+
* workflow.
|
|
240
343
|
*/
|
|
241
|
-
export function renderEpicImplementerCiWorkflow(testCommand, toolchains) {
|
|
344
|
+
export function renderEpicImplementerCiWorkflow(testCommand, toolchains, dependencyInstall = []) {
|
|
242
345
|
const command = validateTestCommand(testCommand);
|
|
243
346
|
const validated = validateRepositoryToolchains(toolchains);
|
|
347
|
+
const entries = parseDependencyInstallStrict(dependencyInstall);
|
|
348
|
+
if (entries === null)
|
|
349
|
+
throw new EpicCiDependencyInstallError();
|
|
350
|
+
const fixedLines = toolchainSetupLines(validated);
|
|
351
|
+
// A list that only repeats fixed install lines installs the same thing, so it renders the same
|
|
352
|
+
// bytes. Otherwise storing `npm ci` would turn an up-to-date workflow into an upgrade offer.
|
|
353
|
+
const sealed = repeatsFixedInstallLines(fixedLines, entries) ? [] : entries;
|
|
354
|
+
const setupLines = sealed.length === 0
|
|
355
|
+
? fixedLines
|
|
356
|
+
: [...withoutReplacedInstallSteps(fixedLines, sealed), ...dependencyInstallStepLines(sealed)];
|
|
244
357
|
const lines = [
|
|
245
358
|
"# ===========================================================================",
|
|
246
359
|
"# Epic Implementer CI gate — MANAGED FILE",
|
|
@@ -251,6 +364,7 @@ export function renderEpicImplementerCiWorkflow(testCommand, toolchains) {
|
|
|
251
364
|
"#",
|
|
252
365
|
"# " + EPIC_CI_WORKFLOW_VERSION_MARKER_KEY + ": " + String(EPIC_CI_WORKFLOW_RENDERER_VERSION),
|
|
253
366
|
"# " + EPIC_CI_WORKFLOW_TOOLCHAINS_MARKER_KEY + ": " + serializeRepositoryToolchains(validated),
|
|
367
|
+
"# " + EPIC_CI_WORKFLOW_DEPENDENCY_INSTALL_MARKER_KEY + ": " + serializeEpicCiDependencyInstall(sealed),
|
|
254
368
|
"#",
|
|
255
369
|
"# WHAT THIS WORKFLOW IS",
|
|
256
370
|
"#",
|
|
@@ -279,6 +393,13 @@ export function renderEpicImplementerCiWorkflow(testCommand, toolchains) {
|
|
|
279
393
|
"# installed for that ecosystem and the command must install what it needs",
|
|
280
394
|
"# itself.",
|
|
281
395
|
"#",
|
|
396
|
+
"# When the install commands line above lists any, those approved commands run",
|
|
397
|
+
"# in that order. One that runs a toolchain's manager at the repository root",
|
|
398
|
+
"# replaces that manager's fixed install line. Every other fixed install line",
|
|
399
|
+
"# still runs, and the pip line always does.",
|
|
400
|
+
"# When it is empty, the fixed install lines for the toolchains run.",
|
|
401
|
+
"# To change the commands, correct them through Bridge setup and re-run it.",
|
|
402
|
+
"#",
|
|
282
403
|
"# THE TEST COMMAND",
|
|
283
404
|
"#",
|
|
284
405
|
"# The command below is the repository's stored test command, run with bash",
|
|
@@ -306,7 +427,7 @@ export function renderEpicImplementerCiWorkflow(testCommand, toolchains) {
|
|
|
306
427
|
" uses: " + EPIC_CI_ACTION_CHECKOUT,
|
|
307
428
|
" with:",
|
|
308
429
|
" persist-credentials: false",
|
|
309
|
-
...
|
|
430
|
+
...setupLines,
|
|
310
431
|
" - name: " + EPIC_CI_COMMAND_STEP_NAME,
|
|
311
432
|
" shell: bash",
|
|
312
433
|
EPIC_CI_COMMAND_LINE_PREFIX + encodeCommandScalar(command),
|