@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.
- package/README.md +490 -366
- package/build/agent-capabilities/probe-context.js +8 -1
- package/build/agent-capabilities/probes.js +7 -1
- package/build/agents.generated.js +1 -1
- package/build/base-url.js +79 -0
- package/build/bridge-api-urls.js +9 -0
- package/build/chain-orchestrator.js +93 -15
- package/build/claude-review-workflow.js +264 -0
- package/build/claude-user-config-doctor.js +317 -0
- package/build/cli-release.js +53 -0
- package/build/commands.generated.js +6 -5
- package/build/conductor/bridge-api-client.js +393 -4
- package/build/conductor/deny-enforcement-preflight.js +1 -0
- package/build/conductor/done-gate.js +44 -5
- package/build/conductor/epic-reconcile.js +6 -0
- package/build/conductor/install-doctor.js +462 -0
- package/build/conductor-bin.js +3 -3
- package/build/conductor-bundle-artifacts.js +37 -15
- package/build/credential-store.js +205 -4
- package/build/direct-ticket-tools.js +70 -0
- package/build/doctor.js +473 -81
- package/build/executor/cli.js +83 -6
- package/build/executor/credentials.js +39 -11
- package/build/executor/deps.js +32 -1
- package/build/executor/env.js +71 -28
- package/build/executor/heartbeat.js +138 -17
- package/build/executor/http-client.js +49 -8
- package/build/executor/index.js +4 -0
- package/build/executor/job-errors.js +4 -0
- package/build/executor/job-runner.js +530 -20
- package/build/executor/observation.js +130 -0
- package/build/executor/permissions.js +114 -8
- package/build/executor/preflight.js +127 -8
- package/build/executor/prompt-spec.js +51 -0
- package/build/executor/runner.js +23 -2
- package/build/executor/service-unit.js +876 -0
- package/build/executor/test-clock.js +75 -3
- package/build/executor/types.js +4 -18
- package/build/executor/worker-command.js +73 -12
- package/build/executor/worker-config-isolation.js +287 -0
- package/build/executor/worker-finalization.js +68 -14
- package/build/executor/worktree.js +46 -4
- package/build/index.js +1039 -237
- package/build/init.js +503 -111
- package/build/install-bridge-conductor.js +491 -0
- package/build/install-bridge.js +1188 -247
- package/build/install-reexec.js +233 -0
- package/build/launcher-config-inspection.js +351 -0
- package/build/mcp-host-config.js +11 -1
- package/build/mcp-install-state.js +32 -0
- package/build/mcp-invoke.js +49 -6
- package/build/mcp-provisioning.js +52 -13
- package/build/mcp-registration-doctor.js +14 -5
- package/build/notifications.js +553 -0
- package/build/pipeline-orchestrator.js +146 -4
- package/build/pipeline-utils.js +3 -0
- package/build/pipelines.generated.js +32 -13
- package/build/plan-execution-ledger.js +550 -0
- package/build/plan-phase-routing.js +272 -0
- package/build/plane/alembic-head.js +110 -0
- package/build/plane/build-freshness.js +167 -0
- package/build/plane/cli.js +480 -0
- package/build/plane/defaults.js +266 -0
- package/build/plane/manifest.js +377 -0
- package/build/plane/member-logs.js +147 -0
- package/build/plane/member-roster.js +147 -0
- package/build/plane/preflight.js +289 -0
- package/build/plane/shutdown.js +195 -0
- package/build/plane/status.js +125 -0
- package/build/plane/supervisor.js +569 -0
- package/build/plane/test-fakes.js +156 -0
- package/build/plane/types.js +75 -0
- package/build/readme.generated.js +1 -1
- package/build/run-unit-tests-launcher.js +259 -0
- package/build/setup-epic.js +772 -28
- package/build/sfcc/log-gate.js +38 -11
- package/build/sfcc/log-query.js +55 -15
- package/build/sfcc/ocapi-shape.js +51 -14
- package/build/sfcc/output.js +41 -11
- package/build/sfcc/permissions.js +24 -2
- package/build/sfcc/read-projection.js +181 -0
- package/build/sfcc/read-result.js +158 -0
- package/build/sfcc/reads-custom-object-def.js +29 -18
- package/build/sfcc/reads-site-preference.js +75 -29
- package/build/sfcc/reads-system-object.js +40 -34
- package/build/sfcc/sfcc-result.js +106 -0
- package/build/sfcc/tool-wrapper.js +56 -13
- package/build/sfcc/write-grants.js +45 -22
- package/build/sfcc/write-guard.js +21 -13
- package/build/sfcc/write-result.js +61 -14
- package/build/sfcc/write-tool-common.js +126 -32
- package/build/sfcc/writes-system-object.js +11 -50
- package/build/start-tickets-prereqs.js +129 -0
- package/build/start-tickets.js +17 -13
- package/build/ticket-backend-metadata.js +59 -0
- package/build/ticket-key-utils.js +92 -0
- package/build/tool-error-envelope.js +71 -0
- package/build/tool-surface-gating.js +72 -0
- package/build/update-status.js +102 -0
- package/build/upgrade-advice.js +47 -0
- package/build/upgrade-cli.js +412 -110
- package/build/version.generated.js +1 -1
- package/build/worktree-core.js +73 -0
- package/docs/CONDUCTOR.md +132 -6
- package/docs/install/mcp-tool-integrations.md +29 -21
- package/package.json +9 -6
- package/pipelines/implement-ticket.json +19 -4
- package/build/conductor/supervisor-judgment-python.js +0 -141
- package/build/conductor/supervisor-judgment.js +0 -215
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process-wide cached update status (BAPI-728).
|
|
3
|
+
*
|
|
4
|
+
* The staleness signal already existed — `checkForUpdate()` ran on every server
|
|
5
|
+
* start and computed the right answer. It was emitted through
|
|
6
|
+
* `sendLoggingMessage({ level: "notice", ... })`, an MCP log sink that no user
|
|
7
|
+
* or model surface reads. The published 0.2.16 tarball shipped that code, so a
|
|
8
|
+
* stale server correctly computed `updateAvailable: true` and announced it to
|
|
9
|
+
* nobody, on every session, for twenty releases.
|
|
10
|
+
*
|
|
11
|
+
* This manager gives that value two readers instead of zero: one stderr warning
|
|
12
|
+
* per process (humans), and a `tools/list` advisory (models). It is:
|
|
13
|
+
*
|
|
14
|
+
* - **single-flight** — one `checkForUpdate()` per process, cached forever;
|
|
15
|
+
* - **non-blocking** — started at boot, never awaited before `connect`;
|
|
16
|
+
* - **fail-open** — a null, malformed, rejected, or not-newer result yields
|
|
17
|
+
* no advisory and no warning, and never throws.
|
|
18
|
+
*/
|
|
19
|
+
import { checkForUpdate } from "./update-check.js";
|
|
20
|
+
import { formatUpdateAdvice, formatToolSurfaceUpdateAdvisory } from "./upgrade-advice.js";
|
|
21
|
+
/** The not-stale conclusion, used for every fail-open branch. */
|
|
22
|
+
const NOT_STALE = { stale: false };
|
|
23
|
+
/**
|
|
24
|
+
* Build the manager. Nothing runs until `start()` is called, so importing this
|
|
25
|
+
* module never performs I/O.
|
|
26
|
+
*/
|
|
27
|
+
export function createUpdateStatusManager(options = {}) {
|
|
28
|
+
const check = options.check ?? checkForUpdate;
|
|
29
|
+
const warn = options.warn ?? ((message) => console.error(message));
|
|
30
|
+
let started = false;
|
|
31
|
+
let settled = null;
|
|
32
|
+
let settledPromise = null;
|
|
33
|
+
let warned = false;
|
|
34
|
+
let listServed = false;
|
|
35
|
+
let lateNotified = false;
|
|
36
|
+
function conclude(result) {
|
|
37
|
+
// Every uncertain shape is fail-open. A malformed payload must never produce
|
|
38
|
+
// an advisory telling a user to upgrade to a version that may not exist.
|
|
39
|
+
if (!result || typeof result !== "object")
|
|
40
|
+
return NOT_STALE;
|
|
41
|
+
if (result.updateAvailable !== true)
|
|
42
|
+
return NOT_STALE;
|
|
43
|
+
const { currentVersion, latestVersion } = result;
|
|
44
|
+
if (typeof currentVersion !== "string" || currentVersion.length === 0)
|
|
45
|
+
return NOT_STALE;
|
|
46
|
+
if (typeof latestVersion !== "string" || latestVersion.length === 0)
|
|
47
|
+
return NOT_STALE;
|
|
48
|
+
return { stale: true, currentVersion, latestVersion };
|
|
49
|
+
}
|
|
50
|
+
function start() {
|
|
51
|
+
if (started)
|
|
52
|
+
return;
|
|
53
|
+
started = true;
|
|
54
|
+
settledPromise = (async () => {
|
|
55
|
+
let status;
|
|
56
|
+
try {
|
|
57
|
+
status = conclude(await check());
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
status = NOT_STALE; // `checkForUpdate` is contracted not to reject; belt and braces.
|
|
61
|
+
}
|
|
62
|
+
settled = status;
|
|
63
|
+
if (status.stale && !warned) {
|
|
64
|
+
warned = true;
|
|
65
|
+
// stderr, never stdout: stdout is the JSON-RPC frame channel and any
|
|
66
|
+
// stray write there corrupts the protocol stream.
|
|
67
|
+
warn(formatUpdateAdvice(status.currentVersion, status.latestVersion));
|
|
68
|
+
if (listServed && !lateNotified) {
|
|
69
|
+
lateNotified = true;
|
|
70
|
+
try {
|
|
71
|
+
options.onLateStale?.();
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
// A notification failure must never affect server operation.
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return status;
|
|
79
|
+
})();
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
start,
|
|
83
|
+
getStatus: () => settled ?? NOT_STALE,
|
|
84
|
+
whenSettled: async () => {
|
|
85
|
+
if (!started)
|
|
86
|
+
start();
|
|
87
|
+
return (await settledPromise) ?? NOT_STALE;
|
|
88
|
+
},
|
|
89
|
+
markListServed: () => {
|
|
90
|
+
listServed = true;
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Produce the model-visible advisory for a settled status, or null when the
|
|
96
|
+
* status is not (yet) known-stale. Pure — safe to call on every list request.
|
|
97
|
+
*/
|
|
98
|
+
export function updateAdvisoryFor(status) {
|
|
99
|
+
if (!status.stale || !status.currentVersion || !status.latestVersion)
|
|
100
|
+
return null;
|
|
101
|
+
return formatToolSurfaceUpdateAdvisory(status.currentVersion, status.latestVersion);
|
|
102
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one canonical upgrade command and its advice formatter (BAPI-728).
|
|
3
|
+
*
|
|
4
|
+
* Before this module the command literal was duplicated in three places — ping's
|
|
5
|
+
* advice, the startup update notice, and the backend release constant — and the
|
|
6
|
+
* copies had already drifted onto opposite conventions (`@latest` in the MCP
|
|
7
|
+
* server, unpinned in the backend). An unpinned `npx -y @bridge_gpt/mcp-server`
|
|
8
|
+
* is exactly what lets npx reuse a cached stale copy, which is the trap BAPI-430
|
|
9
|
+
* was written to close, so the pinned form is the canonical one.
|
|
10
|
+
*
|
|
11
|
+
* The formatter accepts ONLY version strings and validates their shape, so no
|
|
12
|
+
* caller can interpolate arbitrary (possibly secret-bearing) text into advice
|
|
13
|
+
* that is surfaced to users and models.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* The canonical, always-fresh upgrade invocation.
|
|
17
|
+
*
|
|
18
|
+
* `@latest` here refers to the UPGRADER — the short-lived CLI process that does
|
|
19
|
+
* the repinning. It is deliberately different from the exact `@MAJOR.MINOR.PATCH`
|
|
20
|
+
* pin that upgrader then writes into each host config: the upgrader must be the
|
|
21
|
+
* newest published code, while a project launcher must be reproducible.
|
|
22
|
+
*/
|
|
23
|
+
export const CANONICAL_UPGRADE_COMMAND = "npx -y @bridge_gpt/mcp-server@latest --upgrade";
|
|
24
|
+
/** Accept only plain release strings into user-facing advice. */
|
|
25
|
+
const SAFE_VERSION_RE = /^[0-9A-Za-z.\-+]{1,64}$/;
|
|
26
|
+
/** Replace anything that is not a plausible version string with a fixed marker. */
|
|
27
|
+
function sanitizeVersion(value) {
|
|
28
|
+
return typeof value === "string" && SAFE_VERSION_RE.test(value) ? value : "unknown";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Format the one-line staleness advisory shown to humans (stderr) and models
|
|
32
|
+
* (tool discovery). Only the two version values vary; the command is constant.
|
|
33
|
+
*/
|
|
34
|
+
export function formatUpdateAdvice(currentVersion, latestVersion) {
|
|
35
|
+
return (`Bridge API MCP server update available: running ${sanitizeVersion(currentVersion)}, ` +
|
|
36
|
+
`latest ${sanitizeVersion(latestVersion)} — run ${CANONICAL_UPGRADE_COMMAND}`);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The compact form attached to `tools/list`, so a model can see that the tool
|
|
40
|
+
* surface it is looking at may be missing or misnaming tools that exist in a
|
|
41
|
+
* newer release (the BAPI-645 `council` rename is the canonical example).
|
|
42
|
+
*/
|
|
43
|
+
export function formatToolSurfaceUpdateAdvisory(currentVersion, latestVersion) {
|
|
44
|
+
return (`NOTE: this Bridge API MCP server is running ${sanitizeVersion(currentVersion)}, ` +
|
|
45
|
+
`but ${sanitizeVersion(latestVersion)} is published. Some tools may be missing or ` +
|
|
46
|
+
`renamed in this older build. To update, run: ${CANONICAL_UPGRADE_COMMAND}`);
|
|
47
|
+
}
|