@bridge_gpt/mcp-server 0.2.53 → 0.2.55
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 +116 -56
- package/build/agent-guidance.generated.js +3 -0
- package/build/agent-launchers/claude-executor-adapter.js +3 -0
- package/build/agent-launchers/claude.js +3 -3
- package/build/agent-launchers/prompt.js +8 -11
- package/build/agent-notes.js +178 -0
- package/build/agent-registry.js +5 -2
- package/build/agent-utils.js +58 -0
- package/build/agents.generated.js +1 -1
- package/build/base-ref.js +33 -9
- package/build/bounded-wait.js +174 -0
- package/build/codex-skill-adapter.js +55 -0
- package/build/commands.generated.js +6 -5
- package/build/conductor/bridge-api-client.js +235 -14
- package/build/conductor/bring-up-facts.js +187 -0
- package/build/conductor/claude-hook.js +7 -5
- package/build/conductor/cli.js +28 -0
- package/build/conductor/doctor.js +80 -9
- package/build/conductor/epic-implementer-cli.js +1298 -0
- package/build/conductor/epic-runtime.js +134 -98
- package/build/conductor/errors.js +2 -2
- package/build/conductor/git-ci-types.js +1 -1
- package/build/conductor/git-hooks.js +28 -14
- package/build/conductor/install-doctor.js +11 -5
- package/build/conductor/readiness-cli.js +10 -10
- package/build/conductor/readiness-sections.js +58 -9
- package/build/conductor/readiness.js +120 -4
- package/build/conductor/recovery-cli.js +289 -10
- package/build/conductor/recovery-operations.js +125 -2
- package/build/conductor/repair-contract.js +58 -0
- package/build/conductor/run-branch.js +137 -0
- package/build/conductor/store.js +2 -2
- package/build/conductor/supervisor-runtime.js +1 -1
- package/build/conductor/test-run-branch-vectors.js +165 -0
- package/build/conductor-bin.js +2 -139
- package/build/conductor-claude-hook-bin.js +2 -2
- package/build/conductor-claude-hook-removed-stub-bin.js +31 -0
- package/build/conductor-removed-stub-bin.js +30 -0
- package/build/docs.generated.js +1 -1
- package/build/doctor.js +145 -18
- package/build/drive-epic.js +752 -90
- package/build/epic-implementer-bin.js +145 -0
- package/build/epic-implementer-bundle-cli.js +264 -0
- package/build/epic-implementer-claude-hook-bin.js +3 -0
- package/build/epic-integration-pr.js +5 -3
- package/build/executor/claim-scope.js +104 -0
- package/build/executor/cli.js +14 -25
- package/build/executor/env-file-guard.js +82 -3
- package/build/executor/env.js +6 -0
- package/build/executor/interrupted-worktree.js +60 -0
- package/build/executor/job-errors.js +45 -0
- package/build/executor/job-runner.js +334 -9
- package/build/executor/job-types.js +25 -9
- package/build/executor/merge-tree-classifier.js +171 -0
- package/build/executor/reconcile-overlap-governance.js +129 -0
- package/build/executor/reconcile-overlap-job.js +989 -0
- package/build/executor/reconcile-overlap-types.js +14 -0
- package/build/executor/spawn-job-driver.js +1 -0
- package/build/executor/types.js +2 -0
- package/build/executor/worker-finalization.js +25 -2
- package/build/executor/worker-guard-hook.js +15 -7
- package/build/implement-epic/bridge-client.js +773 -0
- package/build/implement-epic/checkpoint-store.js +542 -0
- package/build/implement-epic/cli.js +3158 -0
- package/build/implement-epic/cut-protocol.js +392 -0
- package/build/implement-epic/lock.js +302 -0
- package/build/implement-epic/pr-state.js +286 -0
- package/build/implement-epic/spawn.js +113 -0
- package/build/index.js +657 -481
- package/build/init.js +72 -8
- package/build/install-bridge-conductor.js +5 -5
- package/build/install-bridge.js +403 -70
- package/build/local-artifact-storage.js +130 -0
- package/build/mcp-host-config.js +22 -60
- package/build/mcp-host-entry-adapter.js +18 -0
- package/build/mcp-host-targets.js +1 -21
- package/build/merge-pull-request.js +1 -1
- package/build/pipelines.generated.js +23 -16
- package/build/plan-epic-conductor-eligibility.js +1 -1
- package/build/plane/cli.js +321 -41
- package/build/plane/manifest.js +209 -1
- package/build/plane/member-roster.js +70 -0
- package/build/plane/preflight.js +128 -12
- package/build/plane/shutdown.js +18 -5
- package/build/plane/status.js +35 -1
- package/build/plane/supervisor.js +546 -164
- package/build/plane/types.js +25 -2
- package/build/polling-policy.js +72 -0
- package/build/readiness-check.js +3 -3
- package/build/readme.generated.js +1 -1
- package/build/review-generation.js +219 -0
- package/build/run-unit-tests-launcher.js +6 -1
- package/build/setup-epic.js +567 -38
- package/build/start-tickets-conductor.js +8 -7
- package/build/ticket-key-utils.js +4 -3
- package/build/ticket-review-artifact-gate.js +461 -0
- package/build/upgrade-cli.js +5 -26
- package/build/version.generated.js +3 -3
- package/build/worker-guard-hook-bin.js +1 -1
- package/docs/CONDUCTOR.md +8 -6
- package/docs/install/mcp-tool-integrations.md +23 -1
- package/package.json +5 -3
- package/pipelines/review-ticket.json +17 -4
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secret-free agent-tab spawning for `implement-epic spawn` (BAPI-803).
|
|
3
|
+
*
|
|
4
|
+
* `spawn` opens exactly ONE terminal tab in a ticket's worktree running the
|
|
5
|
+
* agent against a prompt the CALLER wrote to a file. The prompt is arbitrary
|
|
6
|
+
* operator/loop-authored text — it can contain apostrophes, `$(…)`, backticks,
|
|
7
|
+
* and newlines — so it is placed inside a single-quoted shell literal using the
|
|
8
|
+
* repository's existing quoting helpers rather than any local escaping. Reusing
|
|
9
|
+
* `shSquoteInner` / `powershellSquote` is the point: a second escaping
|
|
10
|
+
* implementation is a second place for a quoting bug to produce shell execution.
|
|
11
|
+
*
|
|
12
|
+
* Two invariants this module is responsible for:
|
|
13
|
+
*
|
|
14
|
+
* - **Exactly one tab, and only after every check passes.** The spawn seam is
|
|
15
|
+
* invoked once, at the end, after the agent is validated and the command is
|
|
16
|
+
* built. A partial failure must leave no tab, because the caller increments
|
|
17
|
+
* `sessions_spawned` on success and a phantom tab would desynchronize it.
|
|
18
|
+
* - **No credential reaches the command.** Nothing here resolves, receives, or
|
|
19
|
+
* formats Bridge access data. The spawned agent resolves its own credentials
|
|
20
|
+
* from the user-scoped store, exactly as `start-tickets` workers do; a key in
|
|
21
|
+
* argv would be visible to every process on the machine via `ps`.
|
|
22
|
+
*/
|
|
23
|
+
import { powershellSquote, shSquoteInner, } from "../start-tickets.js";
|
|
24
|
+
import { INDEX_SCOPE_ENV_VAR } from "../index-scope-contract.js";
|
|
25
|
+
/** The agents `implement-epic spawn` may launch. */
|
|
26
|
+
export const CONDUCT_EPIC_AGENTS = ["claude", "cursor-agent"];
|
|
27
|
+
/** The repository's established default agent. */
|
|
28
|
+
export const CONDUCT_EPIC_DEFAULT_AGENT = "claude";
|
|
29
|
+
/**
|
|
30
|
+
* Validate an agent value, defaulting to {@link CONDUCT_EPIC_DEFAULT_AGENT}.
|
|
31
|
+
*
|
|
32
|
+
* Rejects before any command is built. The agent name becomes the executable in
|
|
33
|
+
* a shell command, so an unvalidated value is a command-injection surface even
|
|
34
|
+
* though the surrounding operands are quoted.
|
|
35
|
+
*/
|
|
36
|
+
export function resolveConductEpicAgent(agent) {
|
|
37
|
+
if (agent === undefined || agent.trim().length === 0) {
|
|
38
|
+
return { ok: true, agent: CONDUCT_EPIC_DEFAULT_AGENT };
|
|
39
|
+
}
|
|
40
|
+
const trimmed = agent.trim();
|
|
41
|
+
if (!CONDUCT_EPIC_AGENTS.includes(trimmed)) {
|
|
42
|
+
return {
|
|
43
|
+
ok: false,
|
|
44
|
+
error: `Unsupported agent '${trimmed}'. Expected one of: ${CONDUCT_EPIC_AGENTS.join(", ")}`,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
return { ok: true, agent: trimmed };
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Build `cd '<worktree>' && <agent> '<prompt>'` (POSIX) or the PowerShell
|
|
51
|
+
* equivalent, with both operands quoted by the shared helpers.
|
|
52
|
+
*
|
|
53
|
+
* Returns the command as a string rather than an argv array because that is what
|
|
54
|
+
* every terminal spawner in this repository consumes — a tab is opened by handing
|
|
55
|
+
* a shell a command line, not by `exec`ing a process.
|
|
56
|
+
*
|
|
57
|
+
* BAPI-844: a validated `indexScope` is prefixed as an environment assignment
|
|
58
|
+
* using the SAME quoting helpers as the rest of the command — the shell's own
|
|
59
|
+
* environment mechanism, not an argument the agent can see. An absent scope emits
|
|
60
|
+
* no prefix, so the unscoped command is unchanged byte-for-byte.
|
|
61
|
+
*/
|
|
62
|
+
export function buildConductEpicAgentCommand(input) {
|
|
63
|
+
const resolved = resolveConductEpicAgent(input.agent);
|
|
64
|
+
if (!resolved.ok)
|
|
65
|
+
return resolved;
|
|
66
|
+
if (input.worktreePath.trim().length === 0) {
|
|
67
|
+
return { ok: false, error: "A worktree path is required to build the agent command." };
|
|
68
|
+
}
|
|
69
|
+
if (input.platform === "win32") {
|
|
70
|
+
const scopePrefix = input.indexScope
|
|
71
|
+
? `$env:${INDEX_SCOPE_ENV_VAR} = ${powershellSquote(input.indexScope)}; `
|
|
72
|
+
: "";
|
|
73
|
+
return {
|
|
74
|
+
ok: true,
|
|
75
|
+
command: `${scopePrefix}Set-Location -LiteralPath ${powershellSquote(input.worktreePath)}; ` +
|
|
76
|
+
`${resolved.agent} ${powershellSquote(input.prompt)}`,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const scopePrefix = input.indexScope
|
|
80
|
+
? `export ${INDEX_SCOPE_ENV_VAR}='${shSquoteInner(input.indexScope)}' && `
|
|
81
|
+
: "";
|
|
82
|
+
return {
|
|
83
|
+
ok: true,
|
|
84
|
+
command: `${scopePrefix}cd '${shSquoteInner(input.worktreePath)}' && ` +
|
|
85
|
+
`${resolved.agent} '${shSquoteInner(input.prompt)}'`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Build the command and open exactly one tab through `spawnTab`.
|
|
90
|
+
*
|
|
91
|
+
* The seam is invoked once and only after construction succeeds. A spawner
|
|
92
|
+
* failure is returned as `{ ok: false }` with the spawner's own sanitized
|
|
93
|
+
* message — never the command, which embeds the full prompt text.
|
|
94
|
+
*/
|
|
95
|
+
export async function spawnConductEpicAgentTab(input, spawnTab) {
|
|
96
|
+
const built = buildConductEpicAgentCommand(input);
|
|
97
|
+
if (!built.ok)
|
|
98
|
+
return built;
|
|
99
|
+
let result;
|
|
100
|
+
try {
|
|
101
|
+
result = await spawnTab(built.command, {
|
|
102
|
+
key: input.ticketKey,
|
|
103
|
+
worktreePath: input.worktreePath,
|
|
104
|
+
title: `implement-epic ${input.ticketKey}`,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
return { ok: false, error: "The terminal tab could not be opened." };
|
|
109
|
+
}
|
|
110
|
+
if (!result.ok)
|
|
111
|
+
return { ok: false, error: result.error };
|
|
112
|
+
return { ok: true, command: built.command };
|
|
113
|
+
}
|