@bridge-ds/mcp 0.9.0 → 0.11.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.
- package/LICENSE +110 -0
- package/README.md +9 -7
- package/dist/branches.d.ts +5 -1
- package/dist/{chunk-TP33MW7E.js → chunk-LI4FNPYK.js} +5064 -3726
- package/dist/{chunk-ZVORAO5H.js → chunk-WSNJYGA5.js} +212 -164
- package/dist/context.d.ts +19 -0
- package/dist/explorations.d.ts +175 -14
- package/dist/figma-fixes.d.ts +40 -12
- package/dist/figma.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/lib.d.ts +20 -2
- package/dist/lib.js +16 -2
- package/dist/ops.d.ts +1 -0
- package/dist/pieces.d.ts +11 -4
- package/dist/product-link.d.ts +42 -0
- package/dist/product-repos.d.ts +25 -0
- package/dist/server.d.ts +28 -1
- package/dist/{src-RUS6SPYZ.js → src-P6G5JWLN.js} +1 -1
- package/dist/studio.d.ts +1 -0
- package/dist/suggestions.d.ts +18 -1
- package/package.json +4 -4
package/dist/explorations.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ export declare const settingsOf: (config: BridgeConfig) => {
|
|
|
9
9
|
export declare function toExplorationBranch(ref: string): string;
|
|
10
10
|
export interface StartExplorationInput {
|
|
11
11
|
name: string;
|
|
12
|
-
|
|
12
|
+
/** What the designer wants to learn. Optional: nobody is asked for a brief; Claude passes their first sentence when it has one. */
|
|
13
|
+
purpose?: string | undefined;
|
|
13
14
|
useCase?: string | undefined;
|
|
14
15
|
experimental?: string[] | undefined;
|
|
15
16
|
author?: string | undefined;
|
|
@@ -18,16 +19,61 @@ export interface StartExplorationInput {
|
|
|
18
19
|
agent?: string | undefined;
|
|
19
20
|
/** The product it is tried in (key or name, bridge.config.json "products"). Default: the product of the current folder or repo. */
|
|
20
21
|
product?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Where the branch is created. `product` (the default): in the product's own repository when the team connected one
|
|
24
|
+
* (bridge.config.json products[].repo), else in the design system repository. `library`: always in the design system
|
|
25
|
+
* repository, the fallback when the person chooses it because Bridge cannot reach the product repository.
|
|
26
|
+
*/
|
|
27
|
+
where?: 'product' | 'library' | undefined;
|
|
21
28
|
dryRun?: boolean | undefined;
|
|
22
29
|
}
|
|
30
|
+
/** What Claude says when Bridge cannot reach a product's own repository: the admin action first, the fallback on request. */
|
|
31
|
+
export declare function productRepoBlocked(ctx: BridgeContext, product: string, repo: string, reason: 'not-connected' | 'read-only' | 'no-token'): string;
|
|
23
32
|
/**
|
|
24
33
|
* bridge_start_exploration / `bridge explore start`. With a GitHub token: the branch on GitHub from the default branch
|
|
25
34
|
* and a draft pull request labeled exploration. Without one, in a local git repo: a local branch with the note,
|
|
26
35
|
* nothing pushed, and the commands to push it and open the draft pull request.
|
|
27
36
|
*/
|
|
28
37
|
export declare function startExploration(ctx: BridgeContext, a: StartExplorationInput): Promise<{
|
|
38
|
+
blocked?: string | undefined;
|
|
29
39
|
branch: string;
|
|
30
40
|
product: string;
|
|
41
|
+
repo: string;
|
|
42
|
+
inProductRepo: boolean;
|
|
43
|
+
slug: string;
|
|
44
|
+
base: string;
|
|
45
|
+
title: string;
|
|
46
|
+
label: string;
|
|
47
|
+
note: {
|
|
48
|
+
path: string;
|
|
49
|
+
content: string;
|
|
50
|
+
};
|
|
51
|
+
prBody: string;
|
|
52
|
+
status: "dry-run";
|
|
53
|
+
} | {
|
|
54
|
+
pr: number;
|
|
55
|
+
url: string;
|
|
56
|
+
commit: string;
|
|
57
|
+
next: string;
|
|
58
|
+
branch: string;
|
|
59
|
+
product: string;
|
|
60
|
+
repo: string;
|
|
61
|
+
inProductRepo: boolean;
|
|
62
|
+
slug: string;
|
|
63
|
+
base: string;
|
|
64
|
+
title: string;
|
|
65
|
+
label: string;
|
|
66
|
+
note: {
|
|
67
|
+
path: string;
|
|
68
|
+
content: string;
|
|
69
|
+
};
|
|
70
|
+
prBody: string;
|
|
71
|
+
status: "started";
|
|
72
|
+
} | {
|
|
73
|
+
branch: string;
|
|
74
|
+
product: string;
|
|
75
|
+
repo: string | null;
|
|
76
|
+
inProductRepo: boolean;
|
|
31
77
|
slug: string;
|
|
32
78
|
base: string;
|
|
33
79
|
title: string;
|
|
@@ -55,6 +101,8 @@ export declare function startExploration(ctx: BridgeContext, a: StartExploration
|
|
|
55
101
|
next: string;
|
|
56
102
|
branch: string;
|
|
57
103
|
product: string;
|
|
104
|
+
repo: string | null;
|
|
105
|
+
inProductRepo: boolean;
|
|
58
106
|
slug: string;
|
|
59
107
|
base: string;
|
|
60
108
|
title: string;
|
|
@@ -70,6 +118,8 @@ export declare function startExploration(ctx: BridgeContext, a: StartExploration
|
|
|
70
118
|
next: string;
|
|
71
119
|
branch: string;
|
|
72
120
|
product: string;
|
|
121
|
+
repo: string | null;
|
|
122
|
+
inProductRepo: boolean;
|
|
73
123
|
slug: string;
|
|
74
124
|
base: string;
|
|
75
125
|
title: string;
|
|
@@ -93,6 +143,8 @@ export declare function installOf(t: ExplorationTryIt): {
|
|
|
93
143
|
/** bridge_list_explorations / `bridge explore list`. */
|
|
94
144
|
export declare function listExplorations(ctx: BridgeContext, a?: {
|
|
95
145
|
state?: 'open' | 'closed' | 'all';
|
|
146
|
+
archived?: boolean | undefined;
|
|
147
|
+
mine?: boolean | undefined;
|
|
96
148
|
}): Promise<{
|
|
97
149
|
localBranches?: string[] | undefined;
|
|
98
150
|
localHint?: string | undefined;
|
|
@@ -109,6 +161,7 @@ export declare function listExplorations(ctx: BridgeContext, a?: {
|
|
|
109
161
|
url: string;
|
|
110
162
|
state: string;
|
|
111
163
|
}[];
|
|
164
|
+
ref: string;
|
|
112
165
|
number: number;
|
|
113
166
|
url: string;
|
|
114
167
|
branch: string;
|
|
@@ -117,6 +170,7 @@ export declare function listExplorations(ctx: BridgeContext, a?: {
|
|
|
117
170
|
purpose: string;
|
|
118
171
|
useCase?: string | undefined;
|
|
119
172
|
status: import("@bridge-ds/core").ExplorationStatus;
|
|
173
|
+
archived: boolean;
|
|
120
174
|
draft: boolean;
|
|
121
175
|
author: string;
|
|
122
176
|
source?: ExplorationSource | undefined;
|
|
@@ -128,6 +182,8 @@ export declare function listExplorations(ctx: BridgeContext, a?: {
|
|
|
128
182
|
label: string;
|
|
129
183
|
url: string;
|
|
130
184
|
}[];
|
|
185
|
+
repo?: string | undefined;
|
|
186
|
+
product?: string | undefined;
|
|
131
187
|
} | {
|
|
132
188
|
install: {
|
|
133
189
|
state: ExplorationTryIt["state"];
|
|
@@ -140,6 +196,7 @@ export declare function listExplorations(ctx: BridgeContext, a?: {
|
|
|
140
196
|
url: string;
|
|
141
197
|
state: string;
|
|
142
198
|
}[];
|
|
199
|
+
ref: string;
|
|
143
200
|
number: number;
|
|
144
201
|
url: string;
|
|
145
202
|
branch: string;
|
|
@@ -148,6 +205,7 @@ export declare function listExplorations(ctx: BridgeContext, a?: {
|
|
|
148
205
|
purpose: string;
|
|
149
206
|
useCase?: string | undefined;
|
|
150
207
|
status: import("@bridge-ds/core").ExplorationStatus;
|
|
208
|
+
archived: boolean;
|
|
151
209
|
draft: boolean;
|
|
152
210
|
author: string;
|
|
153
211
|
source?: ExplorationSource | undefined;
|
|
@@ -159,6 +217,8 @@ export declare function listExplorations(ctx: BridgeContext, a?: {
|
|
|
159
217
|
label: string;
|
|
160
218
|
url: string;
|
|
161
219
|
}[];
|
|
220
|
+
repo?: string | undefined;
|
|
221
|
+
product?: string | undefined;
|
|
162
222
|
} | {
|
|
163
223
|
previews: {
|
|
164
224
|
app: keyof import("@bridge-ds/core").PreviewApps;
|
|
@@ -177,6 +237,7 @@ export declare function listExplorations(ctx: BridgeContext, a?: {
|
|
|
177
237
|
url: string;
|
|
178
238
|
state: string;
|
|
179
239
|
}[];
|
|
240
|
+
ref: string;
|
|
180
241
|
number: number;
|
|
181
242
|
url: string;
|
|
182
243
|
branch: string;
|
|
@@ -185,37 +246,137 @@ export declare function listExplorations(ctx: BridgeContext, a?: {
|
|
|
185
246
|
purpose: string;
|
|
186
247
|
useCase?: string | undefined;
|
|
187
248
|
status: import("@bridge-ds/core").ExplorationStatus;
|
|
249
|
+
archived: boolean;
|
|
188
250
|
draft: boolean;
|
|
189
251
|
author: string;
|
|
190
252
|
source?: ExplorationSource | undefined;
|
|
191
253
|
agent?: string | undefined;
|
|
192
254
|
updatedAt: string;
|
|
193
255
|
headSha: string;
|
|
256
|
+
repo?: string | undefined;
|
|
257
|
+
product?: string | undefined;
|
|
194
258
|
})[];
|
|
195
259
|
}>;
|
|
196
|
-
/**
|
|
197
|
-
|
|
260
|
+
/**
|
|
261
|
+
* bridge_promote_exploration (kept name) / `bridge explore done` (`promote` is an alias): "Done exploring". The pieces
|
|
262
|
+
* named in `pieces` (ids from bridge_missing_pieces) go to the DS lead as requests with the preview link; the
|
|
263
|
+
* exploration label and note go, `ready-for-devs` comes, and developers take the branch from there. Nothing is closed,
|
|
264
|
+
* merged or marked ready for review, so the preview link stays alive. Without `pieces`, the result lists the pieces
|
|
265
|
+
* still unsent so the person can pick.
|
|
266
|
+
*/
|
|
267
|
+
export declare function doneExploring(ctx: BridgeContext, a: {
|
|
198
268
|
ref: string;
|
|
269
|
+
pieces?: string[] | undefined;
|
|
199
270
|
dryRun?: boolean | undefined;
|
|
271
|
+
source?: ExplorationSource | undefined;
|
|
272
|
+
agent?: string | undefined;
|
|
200
273
|
}): Promise<{
|
|
201
|
-
|
|
202
|
-
|
|
274
|
+
notProposed: {
|
|
275
|
+
id: string;
|
|
276
|
+
title: string;
|
|
277
|
+
summary: string;
|
|
278
|
+
}[];
|
|
279
|
+
checked: boolean;
|
|
280
|
+
forDevelopers: {
|
|
281
|
+
take: [string, string];
|
|
282
|
+
note: string;
|
|
283
|
+
};
|
|
284
|
+
warnings: string[];
|
|
285
|
+
next: string;
|
|
286
|
+
unknownPieces?: string[] | undefined;
|
|
203
287
|
url: string;
|
|
204
288
|
branch: string;
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
289
|
+
exploration: import("@bridge-ds/core").ExplorationStatus;
|
|
290
|
+
labels: {
|
|
291
|
+
add: string[];
|
|
292
|
+
remove: string[];
|
|
293
|
+
} | null;
|
|
210
294
|
removeFiles: string[];
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
295
|
+
requests: {
|
|
296
|
+
piece: string;
|
|
297
|
+
title: string;
|
|
298
|
+
number: number;
|
|
299
|
+
url: string;
|
|
300
|
+
}[];
|
|
301
|
+
alreadySent: {
|
|
302
|
+
piece: string;
|
|
303
|
+
number: number;
|
|
304
|
+
}[];
|
|
305
|
+
repo?: string | undefined;
|
|
306
|
+
product?: string | undefined;
|
|
307
|
+
requestsIn?: string | undefined;
|
|
308
|
+
status: "dry-run" | "done-exploring" | "already-done";
|
|
309
|
+
number: number;
|
|
310
|
+
ref: string;
|
|
311
|
+
}>;
|
|
312
|
+
/**
|
|
313
|
+
* bridge_continue_exploration / "Continue Bridge exploration #12" (or shop#12): resolves the exploration, switches the
|
|
314
|
+
* local checkout of its repository to its branch when that is safe, and returns where it stands in plain words (what
|
|
315
|
+
* changed, the last activity) for Claude to say first, with the previews and the missing pieces when recorded.
|
|
316
|
+
* One read of the pull request, its files and its commits.
|
|
317
|
+
*/
|
|
318
|
+
export declare function continueExploration(ctx: BridgeContext, a: {
|
|
319
|
+
ref: string;
|
|
320
|
+
checkout?: boolean | undefined;
|
|
321
|
+
}): Promise<{
|
|
322
|
+
checkout: {
|
|
323
|
+
status: "already-on-it" | "switched" | "not-switched";
|
|
324
|
+
note: string;
|
|
325
|
+
};
|
|
326
|
+
continueLines: {
|
|
327
|
+
app: string;
|
|
328
|
+
terminal: string;
|
|
329
|
+
};
|
|
330
|
+
next: string;
|
|
331
|
+
missingPieces?: {
|
|
332
|
+
id: string;
|
|
333
|
+
title: string;
|
|
334
|
+
}[] | undefined;
|
|
335
|
+
ref: string;
|
|
336
|
+
number: number;
|
|
337
|
+
name: string;
|
|
338
|
+
product: string;
|
|
339
|
+
repo: string;
|
|
340
|
+
branch: string;
|
|
341
|
+
url: string;
|
|
342
|
+
status: import("@bridge-ds/core").ExplorationStatus;
|
|
343
|
+
statusLabel: string;
|
|
344
|
+
archived: boolean;
|
|
345
|
+
stage: "exploring" | "not-started" | "handed";
|
|
346
|
+
whereItStands: string;
|
|
347
|
+
activity: {
|
|
348
|
+
who: string;
|
|
349
|
+
what: string;
|
|
350
|
+
when: string;
|
|
351
|
+
}[];
|
|
352
|
+
changedFiles: string[] | null;
|
|
353
|
+
previews: {
|
|
354
|
+
app: keyof import("@bridge-ds/core").PreviewApps;
|
|
355
|
+
label: string;
|
|
356
|
+
url: string;
|
|
357
|
+
}[];
|
|
358
|
+
}>;
|
|
359
|
+
/** @deprecated The old name: "Promote to review" became "Done exploring" (doneExploring). */
|
|
360
|
+
export declare const promoteExploration: typeof doneExploring;
|
|
361
|
+
/** bridge_archive_exploration / `bridge explore archive|unarchive`: the archived label on the still open pull request. */
|
|
362
|
+
export declare function archiveExploration(ctx: BridgeContext, a: {
|
|
363
|
+
ref: string;
|
|
364
|
+
archived?: boolean | undefined;
|
|
365
|
+
}): Promise<{
|
|
366
|
+
next: string;
|
|
367
|
+
repo?: string | undefined;
|
|
368
|
+
ref: string;
|
|
369
|
+
number: number;
|
|
370
|
+
url: string;
|
|
371
|
+
branch: string;
|
|
372
|
+
archived: boolean;
|
|
373
|
+
status: "archived" | "unarchived";
|
|
215
374
|
}>;
|
|
216
375
|
export declare function closeExploration(ctx: BridgeContext, a: {
|
|
217
376
|
ref: string;
|
|
218
377
|
}): Promise<{
|
|
378
|
+
note: string;
|
|
379
|
+
repo?: string | undefined;
|
|
219
380
|
number: number;
|
|
220
381
|
url: string;
|
|
221
382
|
branch: string;
|
package/dist/figma-fixes.d.ts
CHANGED
|
@@ -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: "
|
|
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: "
|
|
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:
|
|
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: "
|
|
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:
|
|
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: "
|
|
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:
|
|
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: "
|
|
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:
|
|
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: "
|
|
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:
|
|
228
|
+
tier: number;
|
|
201
229
|
prTitle: string;
|
|
202
230
|
status: string;
|
|
203
231
|
why?: undefined;
|
package/dist/figma.d.ts
CHANGED
|
@@ -84,7 +84,7 @@ export declare function pushFigmaComponentOp(ctx: BridgeContext, a: {
|
|
|
84
84
|
fixInFigma?: import("@bridge-ds/core").PushIssue[] | undefined;
|
|
85
85
|
reasons?: string[] | undefined;
|
|
86
86
|
edits?: import("@bridge-ds/core").TokenEdit[] | undefined;
|
|
87
|
-
status: "
|
|
87
|
+
status: "suggested" | "opened" | "dry-run" | "not-sent";
|
|
88
88
|
component: string;
|
|
89
89
|
route: string;
|
|
90
90
|
said: string;
|
package/dist/index.js
CHANGED
package/dist/lib.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
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';
|
|
4
|
+
export { findProductLink, GIT_CONFIG_KEYS, linkedOptions, parseProductPointer, PRODUCT_POINTER, type ProductLink, type ProductPointer } from './product-link.js';
|
|
3
5
|
export { BlockedError, isBlocked, say } from './say.js';
|
|
4
|
-
export { createServer, VERSION } from './server.js';
|
|
6
|
+
export { createServer, SERVER_INFO, VERSION, type ServerOptions } from './server.js';
|
|
5
7
|
export { CONFIG_FILE, detectConfig, parseConfig, toConfigJson, type BridgeConfig } from './config.js';
|
|
6
8
|
export { core } from './core-adapter.js';
|
|
7
9
|
export { LocalSource, GitRefSource, GitHubSource, type RepoSource } from './source.js';
|
|
@@ -29,6 +31,22 @@ export interface ServeOptions extends ContextOptions {
|
|
|
29
31
|
export declare function ghAuthToken(): string | undefined;
|
|
30
32
|
/** Said once at start, on stderr: where the token came from, or what the server does without one. Never the token. */
|
|
31
33
|
export declare function tokenNote(source: TokenSource | undefined): string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* One Streamable HTTP request to a Bridge MCP server (the hosted connector, apps/docs-site/api/mcp): stateless, a
|
|
36
|
+
* server per request on `ctx` (a remote repo with the signed-in person's GitHub token), JSON answers, no session id.
|
|
37
|
+
* `parsedBody` is the JSON-RPC body when the caller already read it; `opts.exclude` leaves tools out (createServer).
|
|
38
|
+
*
|
|
39
|
+
* The first POST of a Claude session answers 400, on purpose. Bridge speaks the initialize-based ("legacy") MCP
|
|
40
|
+
* revisions up to 2025-11-25, the newest the SDK supports. Claude is a dual-era client: it first tries a request of the
|
|
41
|
+
* stateless 2026-07-28 revision (no initialize, `MCP-Protocol-Version: 2026-07-28`), the SDK rejects that version with
|
|
42
|
+
* 400 and a plain -32000 error, and Claude falls back to initialize (200), notifications/initialized (202), tools/list
|
|
43
|
+
* (200). That 400 is the era detection the spec defines (2026-07-28 Streamable HTTP, Backward Compatibility; Versioning,
|
|
44
|
+
* compatibility matrix "Dual-era client, Legacy server"): a 4xx without a recognized modern error means "fall back".
|
|
45
|
+
* Never answer it with a modern error (UnsupportedProtocolVersionError -32022, HeaderMismatch -32020): Claude would
|
|
46
|
+
* then treat Bridge as a 2026-07-28 server and retry instead of falling back. The 400 goes away only when Bridge
|
|
47
|
+
* implements 2026-07-28 itself (server/discover, per-request _meta), which needs an SDK that supports it.
|
|
48
|
+
*/
|
|
49
|
+
export declare function handleHttp(ctx: BridgeContext, req: Request, parsedBody?: unknown, opts?: ServerOptions): Promise<Response>;
|
|
32
50
|
/** Starts the stdio MCP server. Logs go to stderr: stdout belongs to the protocol. */
|
|
33
51
|
export declare function serveStdio(opts?: ServeOptions): Promise<void>;
|
|
34
52
|
/**
|
package/dist/lib.js
CHANGED
|
@@ -2,9 +2,12 @@ import {
|
|
|
2
2
|
BlockedError,
|
|
3
3
|
BridgeContext,
|
|
4
4
|
DOCS_DRAFT_MODEL,
|
|
5
|
+
GIT_CONFIG_KEYS,
|
|
5
6
|
GitHubSource,
|
|
6
7
|
GitRefSource,
|
|
7
8
|
LocalSource,
|
|
9
|
+
PRODUCT_POINTER,
|
|
10
|
+
SERVER_INFO,
|
|
8
11
|
VERSION,
|
|
9
12
|
anthropicReplyText,
|
|
10
13
|
anthropicRequest,
|
|
@@ -19,15 +22,19 @@ import {
|
|
|
19
22
|
explorations_exports,
|
|
20
23
|
figma_exports,
|
|
21
24
|
figma_fixes_exports,
|
|
25
|
+
findProductLink,
|
|
22
26
|
formatDocsJson,
|
|
23
27
|
ghAuthToken,
|
|
28
|
+
handleHttp,
|
|
24
29
|
history_exports,
|
|
25
30
|
isBlocked,
|
|
31
|
+
linkedOptions,
|
|
26
32
|
mergeDocsDraft,
|
|
27
33
|
missingProse,
|
|
28
34
|
ops_exports,
|
|
29
35
|
optionsFromArgv,
|
|
30
36
|
parseDocsReply,
|
|
37
|
+
parseProductPointer,
|
|
31
38
|
pieces_exports,
|
|
32
39
|
requests_exports,
|
|
33
40
|
say,
|
|
@@ -35,20 +42,23 @@ import {
|
|
|
35
42
|
studio_exports,
|
|
36
43
|
suggestions_exports,
|
|
37
44
|
tokenNote
|
|
38
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-LI4FNPYK.js";
|
|
39
46
|
import {
|
|
40
47
|
CONFIG_FILE,
|
|
41
48
|
loadConfig,
|
|
42
49
|
toConfigJson
|
|
43
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-WSNJYGA5.js";
|
|
44
51
|
export {
|
|
45
52
|
BlockedError,
|
|
46
53
|
BridgeContext,
|
|
47
54
|
CONFIG_FILE,
|
|
48
55
|
DOCS_DRAFT_MODEL,
|
|
56
|
+
GIT_CONFIG_KEYS,
|
|
49
57
|
GitHubSource,
|
|
50
58
|
GitRefSource,
|
|
51
59
|
LocalSource,
|
|
60
|
+
PRODUCT_POINTER,
|
|
61
|
+
SERVER_INFO,
|
|
52
62
|
VERSION,
|
|
53
63
|
anthropicReplyText,
|
|
54
64
|
anthropicRequest,
|
|
@@ -63,16 +73,20 @@ export {
|
|
|
63
73
|
explorations_exports as explorations,
|
|
64
74
|
figma_exports as figma,
|
|
65
75
|
figma_fixes_exports as figmaFixes,
|
|
76
|
+
findProductLink,
|
|
66
77
|
formatDocsJson,
|
|
67
78
|
ghAuthToken,
|
|
79
|
+
handleHttp,
|
|
68
80
|
history_exports as history,
|
|
69
81
|
isBlocked,
|
|
82
|
+
linkedOptions,
|
|
70
83
|
mergeDocsDraft,
|
|
71
84
|
missingProse,
|
|
72
85
|
ops_exports as ops,
|
|
73
86
|
optionsFromArgv,
|
|
74
87
|
loadConfig as parseConfig,
|
|
75
88
|
parseDocsReply,
|
|
89
|
+
parseProductPointer,
|
|
76
90
|
pieces_exports as pieces,
|
|
77
91
|
requests_exports as requests,
|
|
78
92
|
say,
|
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/pieces.d.ts
CHANGED
|
@@ -30,10 +30,12 @@ export declare function missingPiecesOp(ctx: BridgeContext, a: {
|
|
|
30
30
|
recorded: boolean;
|
|
31
31
|
next: string;
|
|
32
32
|
skipped?: string | undefined;
|
|
33
|
-
pr: number;
|
|
34
33
|
branch: string;
|
|
35
34
|
product: string;
|
|
36
35
|
files: number;
|
|
36
|
+
repo?: string | undefined;
|
|
37
|
+
pr: number;
|
|
38
|
+
ref: string;
|
|
37
39
|
}>;
|
|
38
40
|
/**
|
|
39
41
|
* bridge_open_library_branch / `bridge pieces open <n> <piece>`: the library side of one recorded piece, linked both
|
|
@@ -57,13 +59,15 @@ export declare function openLibraryBranchOp(ctx: BridgeContext, a: {
|
|
|
57
59
|
number: number;
|
|
58
60
|
url: string;
|
|
59
61
|
} | undefined;
|
|
60
|
-
changesMode: ChangesMode;
|
|
61
62
|
neededBy: string;
|
|
63
|
+
ref?: string | undefined;
|
|
64
|
+
repo?: string | undefined;
|
|
65
|
+
changesMode: ChangesMode;
|
|
62
66
|
request?: string | undefined;
|
|
63
67
|
exploration?: string | undefined;
|
|
64
68
|
brief?: string | undefined;
|
|
65
69
|
edits?: import("@bridge-ds/core").TokenEdit[] | undefined;
|
|
66
|
-
status: "
|
|
70
|
+
status: "suggested" | "opened" | "already-linked" | "dry-run";
|
|
67
71
|
pr: number;
|
|
68
72
|
piece: string;
|
|
69
73
|
opens: string;
|
|
@@ -74,7 +78,6 @@ export declare function productBranchOp(ctx: BridgeContext, a: {
|
|
|
74
78
|
pr: number | string;
|
|
75
79
|
}): Promise<{
|
|
76
80
|
next?: string | undefined;
|
|
77
|
-
pr: number;
|
|
78
81
|
title: string;
|
|
79
82
|
product: string;
|
|
80
83
|
said: string;
|
|
@@ -102,6 +105,10 @@ export declare function productBranchOp(ctx: BridgeContext, a: {
|
|
|
102
105
|
title: string;
|
|
103
106
|
summary: string;
|
|
104
107
|
}[];
|
|
108
|
+
ref?: string | undefined;
|
|
109
|
+
repo?: string | undefined;
|
|
110
|
+
library?: string | undefined;
|
|
111
|
+
pr: number;
|
|
105
112
|
}>;
|
|
106
113
|
/** bridge_use_library_preview: the product branch takes (again) the library branch of a piece, merged in. */
|
|
107
114
|
export declare function useLibraryPreviewOp(ctx: BridgeContext, a: {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ContextOptions } from './context.js';
|
|
2
|
+
/** Where the pointer lives, relative to the product repository root. */
|
|
3
|
+
export declare const PRODUCT_POINTER = ".bridge/product.json";
|
|
4
|
+
export interface ProductPointer {
|
|
5
|
+
version: 1;
|
|
6
|
+
/** The team's design system repository, `owner/name`, where bridge.config.json lives. */
|
|
7
|
+
designSystem: string;
|
|
8
|
+
/** The product key in that bridge.config.json `products[]`. */
|
|
9
|
+
product: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ProductLink extends ProductPointer {
|
|
12
|
+
/** The product repository root: the folder holding `.bridge/product.json`. */
|
|
13
|
+
root: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The same link kept in the clone's own git config (`bridge.designSystem`, `bridge.product`, set by `bridge connect`):
|
|
17
|
+
* it survives switching to a branch made before the setup was committed, where `.bridge/product.json` is not.
|
|
18
|
+
*/
|
|
19
|
+
export declare const GIT_CONFIG_KEYS: {
|
|
20
|
+
readonly designSystem: "bridge.designSystem";
|
|
21
|
+
readonly product: "bridge.product";
|
|
22
|
+
};
|
|
23
|
+
/** The pointer from its JSON text, or why it cannot be read, in plain words. */
|
|
24
|
+
export declare function parseProductPointer(text: string): ProductPointer;
|
|
25
|
+
/**
|
|
26
|
+
* The connected product repository `dir` is in: the nearest folder at or above it with `.bridge/product.json`. A
|
|
27
|
+
* folder with its own bridge.config.json met first wins (it is a design system repository, not a product), and so
|
|
28
|
+
* does the end of the git repository (the folder holding `.git`): there the clone's git config may still keep the link
|
|
29
|
+
* (GIT_CONFIG_KEYS), else null.
|
|
30
|
+
*/
|
|
31
|
+
export declare function findProductLink(dir: string): Promise<ProductLink | null>;
|
|
32
|
+
/**
|
|
33
|
+
* Context options for a command run in `dir`. In a connected product repository: the design system repository on
|
|
34
|
+
* GitHub (`repo`), this checkout (`workTree`) and its product key (`product`). Elsewhere `base` unchanged with `root`.
|
|
35
|
+
* An explicit `repo` (the MCP server's `--repo`) keeps it, and takes the checkout and product only when the pointer
|
|
36
|
+
* names that same repository.
|
|
37
|
+
*/
|
|
38
|
+
export declare function linkedOptions(dir: string, base?: Omit<ContextOptions, 'root'> & {
|
|
39
|
+
root?: string | undefined;
|
|
40
|
+
}): Promise<ContextOptions & {
|
|
41
|
+
link?: ProductLink;
|
|
42
|
+
}>;
|