@bridge_gpt/mcp-server 0.2.71 → 0.2.72
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 +55 -17
- package/build/agent-launchers/claude-executor-adapter.js +19 -3
- package/build/agent-notes.js +171 -95
- package/build/agents.generated.js +4 -4
- package/build/bridge-permissions.js +4 -0
- package/build/bridge-worktree-inspection.js +237 -0
- package/build/check-evidence.js +6 -0
- package/build/claude-review-workflow.js +1 -1
- package/build/cli-help.js +6 -0
- package/build/codex-auto-recovery.js +126 -0
- package/build/codex-skill-adapter.js +2 -0
- package/build/commands.generated.js +5 -5
- package/build/conductor/bridge-api-client.js +518 -23
- package/build/conductor/doctor.js +84 -10
- package/build/conductor/epic-implementer-cli.js +51 -2
- package/build/conductor/gate-discovery.js +136 -10
- package/build/conductor/gate-settings-review.js +305 -5
- package/build/conductor/git-hooks-uninstall.js +112 -0
- package/build/conductor/git-hooks.js +81 -15
- package/build/conductor/guided-repair.js +10 -1
- package/build/conductor/install-doctor.js +2 -4
- package/build/conductor/launch-plan.js +42 -2
- package/build/conductor/local-merge.js +12 -1
- package/build/conductor/merge-execution-contract.js +1 -1
- package/build/conductor/merged-child-check.js +2 -1
- package/build/conductor/prerequisite-inputs.js +379 -0
- package/build/conductor/readiness-assessment.js +78 -0
- package/build/conductor/readiness-cli.js +10 -0
- package/build/conductor/readiness-prerequisites.js +53 -0
- package/build/conductor/readiness-sections.js +21 -8
- package/build/conductor/readiness.js +20 -2
- package/build/conductor/recovery-cli.js +223 -13
- package/build/conductor/recovery-operations.js +34 -4
- package/build/conductor/repair-contract.js +33 -0
- package/build/conductor/tools.js +34 -3
- package/build/conductor/wait-run-attention.js +115 -0
- package/build/conductor/wait-run-cli.js +96 -3
- package/build/conductor/worker-database-doctor-inspector.js +1 -0
- package/build/credential-store.js +25 -20
- package/build/dependency-install-declarations.js +157 -0
- package/build/docs.generated.js +4 -4
- package/build/doctor.js +37 -5
- package/build/drive-epic-help.js +2 -2
- package/build/drive-epic.js +52 -11
- package/build/epic-implementer-bin.js +118 -43
- package/build/epic-launch-profile.js +1 -1
- package/build/executor/cli.js +2 -0
- package/build/executor/completion-contract.js +16 -0
- package/build/executor/credentials.js +1 -1
- package/build/executor/delivery-observations.js +113 -0
- package/build/executor/delivery-outcome.js +30 -0
- package/build/executor/dependency-refresh-runner.js +132 -0
- package/build/executor/dependency-refresh.js +530 -0
- package/build/executor/deps.js +4 -0
- package/build/executor/env.js +67 -2
- package/build/executor/harness-coverage.js +19 -0
- package/build/executor/http-client.js +35 -1
- package/build/executor/index.js +2 -1
- package/build/executor/install-preflight.js +1 -1
- package/build/executor/job-runner.js +246 -28
- package/build/executor/likely-tests.js +94 -97
- package/build/executor/prompt-spec.js +13 -3
- package/build/executor/required-verification.js +28 -0
- package/build/executor/required-work-diagnostics.js +30 -0
- package/build/executor/required-work-ledger.js +19 -1
- package/build/executor/results.js +42 -0
- package/build/executor/service-discovery.js +42 -0
- package/build/executor/service-lifecycle.js +109 -2
- package/build/executor/service-uninstall.js +205 -0
- package/build/executor/service-unit.js +5 -3
- package/build/executor/test-clock.js +3 -0
- package/build/executor/verification-hints.js +179 -0
- package/build/executor/worker-command.js +54 -2
- package/build/executor/worker-database.js +271 -31
- package/build/executor/worker-finalization.js +65 -10
- package/build/executor/worker-guard-hook.js +10 -2
- package/build/executor/worker-verification-guidance.js +37 -2
- package/build/executor/worktree-inspection.js +42 -0
- package/build/github-sign-in.js +1 -1
- package/build/index.js +679 -278
- package/build/init.js +3 -3
- package/build/install-bridge-conductor-gate.js +236 -42
- package/build/install-bridge-conductor-setup.js +115 -26
- package/build/install-bridge-conductor.js +448 -350
- package/build/install-bridge.js +418 -123
- package/build/install-maintenance.js +104 -0
- package/build/install-reexec.js +1 -1
- package/build/local-cleanup.js +59 -0
- package/build/mcp-install-state.js +68 -2
- package/build/merge-workflow-install.js +2 -2
- package/build/package-script-semantics.js +10 -0
- package/build/pipeline-utils.js +1 -1
- package/build/pipelines.generated.js +5 -5
- package/build/plan-execution-ledger.js +148 -2
- package/build/plane/plane-freshness.js +6 -7
- package/build/plane/terminal-run-cleanup.js +5 -1
- package/build/plane/terminal-run-status.js +4 -0
- package/build/printed-remedy-commands.js +24 -4
- package/build/readiness-check.js +1 -78
- package/build/readiness-prerequisites.generated.js +199 -0
- package/build/readme.generated.js +1 -1
- package/build/repository-toolchains.js +50 -8
- package/build/setup-change-policy.js +32 -0
- package/build/setup-epic.js +2 -2
- package/build/setup-question.js +62 -0
- package/build/start-tickets.js +4 -0
- package/build/test-command-detection.js +32 -88
- package/build/test-support/notes-fs.js +40 -0
- package/build/ticket-delivery-enrollment.js +21 -8
- package/build/ticket-delivery-run-scope.js +128 -0
- package/build/version.generated.js +3 -3
- package/build/worker-guard-hook-bin.js +2 -2
- package/build/worktrees.js +105 -0
- package/docs/EPIC-IMPLEMENTER.md +5 -0
- package/docs/epic-implementer/getting-started.md +40 -15
- package/package.json +1 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BAPI-1551 — the TypeScript copy of the `dependency_install` and `ci_database`
|
|
3
|
+
* gate-profile declaration rules.
|
|
4
|
+
*
|
|
5
|
+
* `api/library/epic_implementer/gate_profile.py` (`validate_dependency_install`,
|
|
6
|
+
* `validate_ci_database`) is the authority; this module mirrors its bounds so the
|
|
7
|
+
* Bridge API client can parse a stored profile fail-closed and the executor can
|
|
8
|
+
* re-check a job payload without trusting it.
|
|
9
|
+
*
|
|
10
|
+
* Two consumers, two postures:
|
|
11
|
+
*
|
|
12
|
+
* - {@link parseDependencyInstallStrict} — the client. Any invalid entry makes the
|
|
13
|
+
* whole list unreadable (`null`), like any other malformed profile member.
|
|
14
|
+
* - {@link admitDependencyInstallDeclarations} — the executor. Never throws: a bad
|
|
15
|
+
* entry is skipped with a closed reason and the rest still apply.
|
|
16
|
+
*
|
|
17
|
+
* Nothing here logs, and nothing returned for a refusal carries an argv item. A
|
|
18
|
+
* `cwd` is returned beside a refusal only after it passed the path rules, so it
|
|
19
|
+
* is safe to print.
|
|
20
|
+
*
|
|
21
|
+
* Identity: two entries are duplicates when they share the canonical
|
|
22
|
+
* `(cwd, sorted lockfiles)` pair. A JavaScript and a Python toolchain at the same
|
|
23
|
+
* root are two distinct entries.
|
|
24
|
+
*/
|
|
25
|
+
export const MAX_DEPENDENCY_INSTALL_ENTRIES = 8;
|
|
26
|
+
export const MAX_DEPENDENCY_INSTALL_ARGV_ITEMS = 32;
|
|
27
|
+
export const MAX_DEPENDENCY_INSTALL_ARG_CHARS = 1024;
|
|
28
|
+
export const MAX_DEPENDENCY_INSTALL_LOCKFILES = 8;
|
|
29
|
+
/** The longest repository-relative path a declaration may name. */
|
|
30
|
+
export const MAX_DEPENDENCY_INSTALL_PATH_CHARS = 512;
|
|
31
|
+
export const CI_DATABASE_VALUES = ["none", "provided", "unknown"];
|
|
32
|
+
export const CI_DATABASE_DEFAULT = "unknown";
|
|
33
|
+
const ENTRY_KEYS = new Set(["cwd", "argv", "lockfiles"]);
|
|
34
|
+
/** Absolute-looking, backslash, colon, and every control or line-separator character. */
|
|
35
|
+
const FORBIDDEN_PATH_CHARS = /[:\\\x00-\x1f\x7f-\x9f\u2028\u2029]/;
|
|
36
|
+
const FORBIDDEN_ARG_CHARS = /[\u0000\r\n]/;
|
|
37
|
+
/**
|
|
38
|
+
* True when `value` is a safe repository-relative path: not absolute, no `..`,
|
|
39
|
+
* no `.` segment, no empty segment, no backslash, colon, or control character.
|
|
40
|
+
* `allowRoot` admits the lone `"."` (the repository root) for a `cwd`.
|
|
41
|
+
*/
|
|
42
|
+
export function isSafeRepoRelativePath(value, options = {}) {
|
|
43
|
+
if (typeof value !== "string" || value.length === 0 || value.length > MAX_DEPENDENCY_INSTALL_PATH_CHARS) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
if (value === ".")
|
|
47
|
+
return options.allowRoot === true;
|
|
48
|
+
if (value.startsWith("/") || FORBIDDEN_PATH_CHARS.test(value))
|
|
49
|
+
return false;
|
|
50
|
+
return value.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
51
|
+
}
|
|
52
|
+
/** The canonical identity of an entry: its `cwd` and its lockfiles, sorted. */
|
|
53
|
+
export function dependencyInstallEntryIdentity(entry) {
|
|
54
|
+
return JSON.stringify([entry.cwd, [...entry.lockfiles].sort()]);
|
|
55
|
+
}
|
|
56
|
+
/** Check one raw entry against every rule except list bounds and duplicates. */
|
|
57
|
+
export function checkDependencyInstallEntry(raw) {
|
|
58
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
59
|
+
return { ok: false, reason: "dependency_install_invalid_entry" };
|
|
60
|
+
}
|
|
61
|
+
const item = raw;
|
|
62
|
+
for (const key of Object.keys(item)) {
|
|
63
|
+
if (!ENTRY_KEYS.has(key))
|
|
64
|
+
return { ok: false, reason: "dependency_install_invalid_entry" };
|
|
65
|
+
}
|
|
66
|
+
const { cwd, argv, lockfiles } = item;
|
|
67
|
+
if (typeof cwd !== "string")
|
|
68
|
+
return { ok: false, reason: "dependency_install_invalid_entry" };
|
|
69
|
+
if (!isSafeRepoRelativePath(cwd, { allowRoot: true })) {
|
|
70
|
+
return { ok: false, reason: "dependency_install_invalid_path" };
|
|
71
|
+
}
|
|
72
|
+
if (!Array.isArray(argv) || !Array.isArray(lockfiles)) {
|
|
73
|
+
return { ok: false, reason: "dependency_install_invalid_entry", cwd };
|
|
74
|
+
}
|
|
75
|
+
if (argv.length === 0 || lockfiles.length === 0) {
|
|
76
|
+
return { ok: false, reason: "dependency_install_invalid_entry", cwd };
|
|
77
|
+
}
|
|
78
|
+
if (argv.length > MAX_DEPENDENCY_INSTALL_ARGV_ITEMS || lockfiles.length > MAX_DEPENDENCY_INSTALL_LOCKFILES) {
|
|
79
|
+
return { ok: false, reason: "dependency_install_over_bound", cwd };
|
|
80
|
+
}
|
|
81
|
+
for (const arg of argv) {
|
|
82
|
+
if (typeof arg !== "string" || arg.length === 0 || FORBIDDEN_ARG_CHARS.test(arg)) {
|
|
83
|
+
return { ok: false, reason: "dependency_install_invalid_entry", cwd };
|
|
84
|
+
}
|
|
85
|
+
if (arg.length > MAX_DEPENDENCY_INSTALL_ARG_CHARS) {
|
|
86
|
+
return { ok: false, reason: "dependency_install_over_bound", cwd };
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const seenLockfiles = new Set();
|
|
90
|
+
for (const file of lockfiles) {
|
|
91
|
+
if (!isSafeRepoRelativePath(file))
|
|
92
|
+
return { ok: false, reason: "dependency_install_invalid_path", cwd };
|
|
93
|
+
if (seenLockfiles.has(file))
|
|
94
|
+
return { ok: false, reason: "dependency_install_duplicate", cwd };
|
|
95
|
+
seenLockfiles.add(file);
|
|
96
|
+
}
|
|
97
|
+
return { ok: true, entry: { cwd, argv: [...argv], lockfiles: [...lockfiles] } };
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The executor's never-throwing admission: re-check every server bound and skip
|
|
101
|
+
* a bad entry with a closed reason. The first occurrence of an identity wins.
|
|
102
|
+
*/
|
|
103
|
+
export function admitDependencyInstallDeclarations(raw) {
|
|
104
|
+
if (!Array.isArray(raw))
|
|
105
|
+
return { entries: [], skipped: [], notAList: true };
|
|
106
|
+
const entries = [];
|
|
107
|
+
const skipped = [];
|
|
108
|
+
const seen = new Set();
|
|
109
|
+
for (let index = 0; index < raw.length; index++) {
|
|
110
|
+
if (index >= MAX_DEPENDENCY_INSTALL_ENTRIES) {
|
|
111
|
+
skipped.push({ reason: "dependency_install_over_bound" });
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
const checked = checkDependencyInstallEntry(raw[index]);
|
|
115
|
+
if (!checked.ok) {
|
|
116
|
+
skipped.push({ reason: checked.reason, ...(checked.cwd !== undefined ? { cwd: checked.cwd } : {}) });
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const identity = dependencyInstallEntryIdentity(checked.entry);
|
|
120
|
+
if (seen.has(identity)) {
|
|
121
|
+
skipped.push({ reason: "dependency_install_duplicate", cwd: checked.entry.cwd });
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
seen.add(identity);
|
|
125
|
+
entries.push(checked.entry);
|
|
126
|
+
}
|
|
127
|
+
return { entries, skipped, notAList: false };
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* The client's fail-closed parse: the whole list or `null`. `undefined` (an
|
|
131
|
+
* absent field) reads as no declarations.
|
|
132
|
+
*/
|
|
133
|
+
export function parseDependencyInstallStrict(raw) {
|
|
134
|
+
if (raw === undefined)
|
|
135
|
+
return [];
|
|
136
|
+
if (!Array.isArray(raw) || raw.length > MAX_DEPENDENCY_INSTALL_ENTRIES)
|
|
137
|
+
return null;
|
|
138
|
+
const admitted = admitDependencyInstallDeclarations(raw);
|
|
139
|
+
if (admitted.notAList || admitted.skipped.length > 0)
|
|
140
|
+
return null;
|
|
141
|
+
return admitted.entries;
|
|
142
|
+
}
|
|
143
|
+
/** True when `value` is one of the three `ci_database` values. */
|
|
144
|
+
export function isCiDatabase(value) {
|
|
145
|
+
return typeof value === "string" && CI_DATABASE_VALUES.includes(value);
|
|
146
|
+
}
|
|
147
|
+
/** Any value other than the three reads as `unknown`. */
|
|
148
|
+
export function normalizeCiDatabase(value) {
|
|
149
|
+
return isCiDatabase(value) ? value : CI_DATABASE_DEFAULT;
|
|
150
|
+
}
|
|
151
|
+
/** True when two declaration lists are the same, entry for entry and in order. */
|
|
152
|
+
export function sameDependencyInstall(a, b) {
|
|
153
|
+
return JSON.stringify(a.map(canonicalEntry)) === JSON.stringify(b.map(canonicalEntry));
|
|
154
|
+
}
|
|
155
|
+
function canonicalEntry(entry) {
|
|
156
|
+
return { cwd: entry.cwd, argv: [...entry.argv], lockfiles: [...entry.lockfiles] };
|
|
157
|
+
}
|