@bridge-ds/mcp 0.9.0 → 0.10.0

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.
@@ -1,4 +1,4 @@
1
- import { type FigmaFixesFile } from '@bridge-ds/core';
1
+ import { type FigmaFidelityRun, type FigmaFixesFile, type MeasuredSpecsFile } from '@bridge-ds/core';
2
2
  import type { BridgeContext } from './context.js';
3
3
  /** Where `bridge specs --measure` writes, from the repo root. */
4
4
  export declare const MEASURED_SPECS_FILE = "measured-specs.json";
@@ -12,20 +12,48 @@ export interface FixFilesArgs {
12
12
  /** figma-fixes.json path in the repo. */
13
13
  fixesFile?: string | undefined;
14
14
  }
15
+ export interface FixFiles {
16
+ measured: MeasuredSpecsFile;
17
+ measuredPath: string;
18
+ /** Where the measure came from, in words: "measured-specs.json", or "measured-specs.json on bridge-requests". */
19
+ measuredFrom: string;
20
+ fixes?: FigmaFixesFile | undefined;
21
+ fixesPath: string;
22
+ run?: FigmaFidelityRun | undefined;
23
+ /** Where the run came from, in words. */
24
+ runFrom?: string | undefined;
25
+ }
26
+ /**
27
+ * Reads the measure (the repo, else the measure branch the automatic measure publishes to), the team's fixes and the
28
+ * fidelity run (the repo, else the requests branch the plugin writes to). No measure: MeasureMissingError, whose
29
+ * message is the designer sentence and the steps to turn the automatic measure on.
30
+ */
31
+ export declare function loadFixFiles(ctx: BridgeContext, a: FixFilesArgs): Promise<FixFiles>;
15
32
  /** bridge_figma_gaps / `bridge gaps`: the components whose Figma build differs from their story, or cannot be checked. */
16
33
  export declare function figmaGapsOp(ctx: BridgeContext, a?: FixFilesArgs): Promise<{
34
+ status: string;
35
+ say: string;
36
+ steps: string[];
37
+ gaps: never[];
38
+ } | {
17
39
  measured: string;
18
40
  gaps: import("@bridge-ds/core").FigmaGapRow[];
19
41
  next: string;
20
42
  report: string;
21
43
  checkedAt: string | undefined;
22
44
  referee: string;
45
+ status?: undefined;
46
+ say?: undefined;
47
+ steps?: undefined;
23
48
  } | {
24
49
  measured: string;
25
50
  gaps: import("@bridge-ds/core").FigmaGapRow[];
26
51
  next: string;
27
52
  note: string;
28
53
  referee: string;
54
+ status?: undefined;
55
+ say?: undefined;
56
+ steps?: undefined;
29
57
  }>;
30
58
  /** bridge_get_gap_case / `bridge fix <component> --case`: one component's gap case and the fix schema. */
31
59
  export declare function getGapCaseOp(ctx: BridgeContext, a: FixFilesArgs & {
@@ -107,7 +135,7 @@ export declare function proposeFigmaFixesOp(ctx: BridgeContext, a: FixFilesArgs
107
135
  source?: 'mcp' | 'cli' | undefined;
108
136
  }): Promise<{
109
137
  status: string;
110
- verdict: "same" | "worse";
138
+ verdict: import("@bridge-ds/core").FixVerdict;
111
139
  why: string;
112
140
  detail: string;
113
141
  hint: string;
@@ -119,11 +147,11 @@ export declare function proposeFigmaFixesOp(ctx: BridgeContext, a: FixFilesArgs
119
147
  content: string;
120
148
  }[];
121
149
  component: string;
122
- verdict: "closer" | "same";
150
+ verdict: import("@bridge-ds/core").FixVerdict;
123
151
  summary: string;
124
152
  variants: import("@bridge-ds/core").TriedVariant[];
125
153
  fixes: string[];
126
- tier: import("@bridge-ds/core").RiskTier;
154
+ tier: number;
127
155
  prTitle: string;
128
156
  status: string;
129
157
  why?: undefined;
@@ -136,11 +164,11 @@ export declare function proposeFigmaFixesOp(ctx: BridgeContext, a: FixFilesArgs
136
164
  content: string;
137
165
  }[];
138
166
  component: string;
139
- verdict: "closer" | "same";
167
+ verdict: import("@bridge-ds/core").FixVerdict;
140
168
  summary: string;
141
169
  variants: import("@bridge-ds/core").TriedVariant[];
142
170
  fixes: string[];
143
- tier: import("@bridge-ds/core").RiskTier;
171
+ tier: number;
144
172
  prTitle: string;
145
173
  status: string;
146
174
  message: string;
@@ -155,11 +183,11 @@ export declare function proposeFigmaFixesOp(ctx: BridgeContext, a: FixFilesArgs
155
183
  labels: string[];
156
184
  next: string;
157
185
  component: string;
158
- verdict: "closer" | "same";
186
+ verdict: import("@bridge-ds/core").FixVerdict;
159
187
  summary: string;
160
188
  variants: import("@bridge-ds/core").TriedVariant[];
161
189
  fixes: string[];
162
- tier: import("@bridge-ds/core").RiskTier;
190
+ tier: number;
163
191
  prTitle: string;
164
192
  status: string;
165
193
  why?: undefined;
@@ -173,11 +201,11 @@ export declare function proposeFigmaFixesOp(ctx: BridgeContext, a: FixFilesArgs
173
201
  content: string;
174
202
  }[];
175
203
  component: string;
176
- verdict: "closer" | "same";
204
+ verdict: import("@bridge-ds/core").FixVerdict;
177
205
  summary: string;
178
206
  variants: import("@bridge-ds/core").TriedVariant[];
179
207
  fixes: string[];
180
- tier: import("@bridge-ds/core").RiskTier;
208
+ tier: number;
181
209
  prTitle: string;
182
210
  status: string;
183
211
  message: string;
@@ -193,11 +221,11 @@ export declare function proposeFigmaFixesOp(ctx: BridgeContext, a: FixFilesArgs
193
221
  draft: boolean;
194
222
  next: string;
195
223
  component: string;
196
- verdict: "closer" | "same";
224
+ verdict: import("@bridge-ds/core").FixVerdict;
197
225
  summary: string;
198
226
  variants: import("@bridge-ds/core").TriedVariant[];
199
227
  fixes: string[];
200
- tier: import("@bridge-ds/core").RiskTier;
228
+ tier: number;
201
229
  prTitle: string;
202
230
  status: string;
203
231
  why?: undefined;
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  VERSION,
4
4
  optionsFromArgv,
5
5
  serveStdio
6
- } from "./chunk-TP33MW7E.js";
7
- import "./chunk-ZVORAO5H.js";
6
+ } from "./chunk-E5V42VCS.js";
7
+ import "./chunk-BZEPCY42.js";
8
8
 
9
9
  // src/index.ts
10
10
  var argv = process.argv.slice(2);
package/dist/lib.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { type ContextOptions } from './context.js';
1
+ import { BridgeContext, type ContextOptions } from './context.js';
2
+ import { type ServerOptions } from './server.js';
2
3
  export { BridgeContext, type ContextOptions } from './context.js';
3
4
  export { BlockedError, isBlocked, say } from './say.js';
4
- export { createServer, VERSION } from './server.js';
5
+ export { createServer, SERVER_INFO, VERSION, type ServerOptions } from './server.js';
5
6
  export { CONFIG_FILE, detectConfig, parseConfig, toConfigJson, type BridgeConfig } from './config.js';
6
7
  export { core } from './core-adapter.js';
7
8
  export { LocalSource, GitRefSource, GitHubSource, type RepoSource } from './source.js';
@@ -29,6 +30,22 @@ export interface ServeOptions extends ContextOptions {
29
30
  export declare function ghAuthToken(): string | undefined;
30
31
  /** Said once at start, on stderr: where the token came from, or what the server does without one. Never the token. */
31
32
  export declare function tokenNote(source: TokenSource | undefined): string | undefined;
33
+ /**
34
+ * One Streamable HTTP request to a Bridge MCP server (the hosted connector, apps/docs-site/api/mcp): stateless, a
35
+ * server per request on `ctx` (a remote repo with the signed-in person's GitHub token), JSON answers, no session id.
36
+ * `parsedBody` is the JSON-RPC body when the caller already read it; `opts.exclude` leaves tools out (createServer).
37
+ *
38
+ * The first POST of a Claude session answers 400, on purpose. Bridge speaks the initialize-based ("legacy") MCP
39
+ * revisions up to 2025-11-25, the newest the SDK supports. Claude is a dual-era client: it first tries a request of the
40
+ * stateless 2026-07-28 revision (no initialize, `MCP-Protocol-Version: 2026-07-28`), the SDK rejects that version with
41
+ * 400 and a plain -32000 error, and Claude falls back to initialize (200), notifications/initialized (202), tools/list
42
+ * (200). That 400 is the era detection the spec defines (2026-07-28 Streamable HTTP, Backward Compatibility; Versioning,
43
+ * compatibility matrix "Dual-era client, Legacy server"): a 4xx without a recognized modern error means "fall back".
44
+ * Never answer it with a modern error (UnsupportedProtocolVersionError -32022, HeaderMismatch -32020): Claude would
45
+ * then treat Bridge as a 2026-07-28 server and retry instead of falling back. The 400 goes away only when Bridge
46
+ * implements 2026-07-28 itself (server/discover, per-request _meta), which needs an SDK that supports it.
47
+ */
48
+ export declare function handleHttp(ctx: BridgeContext, req: Request, parsedBody?: unknown, opts?: ServerOptions): Promise<Response>;
32
49
  /** Starts the stdio MCP server. Logs go to stderr: stdout belongs to the protocol. */
33
50
  export declare function serveStdio(opts?: ServeOptions): Promise<void>;
34
51
  /**
package/dist/lib.js CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  GitHubSource,
6
6
  GitRefSource,
7
7
  LocalSource,
8
+ SERVER_INFO,
8
9
  VERSION,
9
10
  anthropicReplyText,
10
11
  anthropicRequest,
@@ -21,6 +22,7 @@ import {
21
22
  figma_fixes_exports,
22
23
  formatDocsJson,
23
24
  ghAuthToken,
25
+ handleHttp,
24
26
  history_exports,
25
27
  isBlocked,
26
28
  mergeDocsDraft,
@@ -35,12 +37,12 @@ import {
35
37
  studio_exports,
36
38
  suggestions_exports,
37
39
  tokenNote
38
- } from "./chunk-TP33MW7E.js";
40
+ } from "./chunk-E5V42VCS.js";
39
41
  import {
40
42
  CONFIG_FILE,
41
43
  loadConfig,
42
44
  toConfigJson
43
- } from "./chunk-ZVORAO5H.js";
45
+ } from "./chunk-BZEPCY42.js";
44
46
  export {
45
47
  BlockedError,
46
48
  BridgeContext,
@@ -49,6 +51,7 @@ export {
49
51
  GitHubSource,
50
52
  GitRefSource,
51
53
  LocalSource,
54
+ SERVER_INFO,
52
55
  VERSION,
53
56
  anthropicReplyText,
54
57
  anthropicRequest,
@@ -65,6 +68,7 @@ export {
65
68
  figma_fixes_exports as figmaFixes,
66
69
  formatDocsJson,
67
70
  ghAuthToken,
71
+ handleHttp,
68
72
  history_exports as history,
69
73
  isBlocked,
70
74
  mergeDocsDraft,
package/dist/ops.d.ts CHANGED
@@ -778,6 +778,7 @@ export declare function getReview(ctx: BridgeContext, a: {
778
778
  export declare function reviewRoles(gh: GitHubClient, config: BridgeConfig, approvers: string[]): Promise<{
779
779
  unreadableTeams?: string[] | undefined;
780
780
  ship: string;
781
+ tier1Publish: string;
781
782
  soloOwner?: string | undefined;
782
783
  design: {
783
784
  owners: string[];
package/dist/server.d.ts CHANGED
@@ -2,4 +2,31 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { BridgeContext } from './context.js';
3
3
  /** The package version, injected at build time; tests and source runs fall back to "dev". */
4
4
  export declare const VERSION: string;
5
- export declare function createServer(ctx: BridgeContext): McpServer;
5
+ /** The Bridge site: it serves the hosted connector (/mcp) and the official icons. */
6
+ export declare const BRIDGE_SITE = "https://bridge.floriangouloubi.com";
7
+ /**
8
+ * How clients show this server (MCP 2025-11-25, Implementation: `title` is the display name, `icons` the images; the
9
+ * SDK here supports that version). `name` stays machine-safe. Icons are absolute https URLs on the same domain as the
10
+ * hosted connector, PNG first since every client that renders icons must support it.
11
+ */
12
+ export declare const SERVER_INFO: {
13
+ name: string;
14
+ title: string;
15
+ version: string;
16
+ websiteUrl: string;
17
+ icons: {
18
+ src: string;
19
+ mimeType: string;
20
+ sizes: string[];
21
+ }[];
22
+ };
23
+ /** How a server is built for where it runs. */
24
+ export interface ServerOptions {
25
+ /**
26
+ * Tools this server neither lists nor runs. The hosted connector (Bridge inside the team's Claude) leaves out the
27
+ * merge (bridge_merge_branch and its owner override): agents never merge there, a person does. The local CLI and
28
+ * MCP server keep every tool.
29
+ */
30
+ exclude?: readonly string[] | undefined;
31
+ }
32
+ export declare function createServer(ctx: BridgeContext, opts?: ServerOptions): McpServer;
@@ -11,7 +11,7 @@ import {
11
11
  referenceImagePath,
12
12
  selectTokenFiles,
13
13
  showFile
14
- } from "./chunk-ZVORAO5H.js";
14
+ } from "./chunk-BZEPCY42.js";
15
15
 
16
16
  // ../visual/src/run.ts
17
17
  import { existsSync as existsSync3 } from "node:fs";
package/dist/studio.d.ts CHANGED
@@ -94,6 +94,7 @@ export declare function getSettings(ctx: BridgeContext): Promise<{
94
94
  main: string;
95
95
  roles: {
96
96
  teamsNotRead?: string[] | undefined;
97
+ tier1Publish: string;
97
98
  soloOwner?: string | undefined;
98
99
  designApproval: string[];
99
100
  techApproval: string[];
@@ -146,6 +146,7 @@ export declare function getSuggestionOp(ctx: BridgeContext, a: {
146
146
  }[];
147
147
  } | undefined;
148
148
  approvals: {
149
+ ownerOverride?: string | undefined;
149
150
  soloOwner?: string | undefined;
150
151
  notCounted?: string[] | undefined;
151
152
  staleReviews?: string[] | undefined;
@@ -226,7 +227,13 @@ export declare function getSuggestionOp(ctx: BridgeContext, a: {
226
227
  merged: boolean;
227
228
  }[];
228
229
  }>;
229
- export type SuggestionReviewEventArg = 'approve' | 'request-changes' | 'comment' | 'decline';
230
+ export type SuggestionReviewEventArg = 'approve' | 'request-changes' | 'comment' | 'decline' | 'override';
231
+ /** The owner override on a suggestion, as Studio and History say it. */
232
+ export declare const suggestionOverrideLine: (o: {
233
+ login: string;
234
+ reason: string;
235
+ missing: readonly string[];
236
+ }) => string;
230
237
  /**
231
238
  * bridge_review_suggestion / `bridge review <n>`: approve, request changes, comment on or decline a suggestion, as the
232
239
  * token's user. Approvals count only from the owners in bridge.config.json and only on the version reviewed
@@ -244,6 +251,16 @@ export declare function reviewSuggestionOp(ctx: BridgeContext, a: {
244
251
  number: number;
245
252
  status: SuggestionStatus;
246
253
  said: string;
254
+ } | {
255
+ next: string;
256
+ warnings?: string[] | undefined;
257
+ number: number;
258
+ event: "override";
259
+ counts: boolean;
260
+ version: string;
261
+ status: SuggestionStatus;
262
+ said: string;
263
+ comment: string;
247
264
  } | {
248
265
  next: string;
249
266
  warnings?: string[] | undefined;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@bridge-ds/mcp",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "Bridge MCP server: lets Claude (Claude Code, Claude Desktop or any MCP client) read, check and propose changes to a DTCG design system repo through pull requests.",
6
- "license": "MIT",
6
+ "license": "FSL-1.1-MIT",
7
7
  "author": "Florian Gouloubi",
8
8
  "homepage": "https://github.com/peterbono/ai-design-system-demo/tree/main/packages/mcp#readme",
9
9
  "repository": {
@@ -55,8 +55,8 @@
55
55
  "build:package": "node ../../scripts/build-packages.mjs mcp"
56
56
  },
57
57
  "dependencies": {
58
- "@bridge-ds/core": "^0.19.0",
59
- "@bridge-ds/visual": "^0.3.13",
58
+ "@bridge-ds/core": "^0.20.0",
59
+ "@bridge-ds/visual": "^0.3.14",
60
60
  "@modelcontextprotocol/sdk": "1.31.0",
61
61
  "typescript": "5.9.3",
62
62
  "zod": "3.25.76"