@bridge-ds/mcp 0.5.0 → 0.7.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.
@@ -0,0 +1,90 @@
1
+ import { type ChangesMode, type ComponentPushDiff } from '@bridge-ds/core';
2
+ import type { BridgeContext } from './context.js';
3
+ /** Who sends from here: the MCP server speaks for an AI agent, the CLI for the person. */
4
+ export type FigmaSource = 'mcp' | 'cli';
5
+ /** bridge_figma_changes / `bridge figma`: the library branches opened from Figma components, and where each stands. */
6
+ export declare function figmaChangesOp(ctx: BridgeContext, a?: {
7
+ state?: 'open' | 'closed' | 'all' | undefined;
8
+ }): Promise<{
9
+ changes: {
10
+ pr: number;
11
+ title: string;
12
+ url: string;
13
+ branch: string;
14
+ component: string;
15
+ route: string;
16
+ status: string;
17
+ said: string;
18
+ }[];
19
+ next: string;
20
+ }>;
21
+ /** bridge_get_figma_change / `bridge figma show <n>`: one library branch from Figma, its spec and the brief to draft it. */
22
+ export declare function getFigmaChangeOp(ctx: BridgeContext, a: {
23
+ pr: number | string;
24
+ }): Promise<{
25
+ next: string;
26
+ brief?: string | undefined;
27
+ spec?: {
28
+ path: string | undefined;
29
+ changes: import("@bridge-ds/core").RequestChange[];
30
+ variantAxes: Record<string, string[]>;
31
+ properties: {
32
+ name: string;
33
+ type: string;
34
+ default: string;
35
+ }[];
36
+ tokenEdits: import("@bridge-ds/core").TokenEdit[];
37
+ reasons: string[];
38
+ } | undefined;
39
+ pr: number;
40
+ title: string;
41
+ url: string;
42
+ branch: string;
43
+ component: string;
44
+ route: string;
45
+ status: string;
46
+ said: string;
47
+ }>;
48
+ /** bridge_mark_figma_change_drafted / `bridge figma drafted <n>`: the code is on the branch, labelled drafted by Claude AI. */
49
+ export declare function markFigmaDraftedOp(ctx: BridgeContext, a: {
50
+ pr: number | string;
51
+ }): Promise<{
52
+ pr: number;
53
+ status: string;
54
+ said: string;
55
+ files: string[];
56
+ next: string;
57
+ }>;
58
+ /**
59
+ * bridge_push_figma_component / `bridge figma push <diff.json>`: the plugin's push from a structured diff. An exact token
60
+ * swap opens a token change (same plan, contrast gate and body as bridge_propose_token_change, plus the component pairs
61
+ * the swap moves); anything that needs code opens a draft branch with the spec for Claude AI; what cannot be read is
62
+ * listed with what to do. dryRun shows the route.
63
+ */
64
+ export declare function pushFigmaComponentOp(ctx: BridgeContext, a: {
65
+ diff: ComponentPushDiff;
66
+ dryRun?: boolean | undefined;
67
+ source?: FigmaSource | undefined;
68
+ changes?: ChangesMode | undefined;
69
+ }): Promise<{
70
+ next: string;
71
+ suggestion?: {
72
+ route: "token-change" | "claude-draft";
73
+ number: number;
74
+ url: string;
75
+ } | undefined;
76
+ library?: {
77
+ route: "token-change" | "claude-draft";
78
+ number: number;
79
+ url: string;
80
+ branch: string;
81
+ } | undefined;
82
+ changesMode: ChangesMode;
83
+ fixInFigma?: import("@bridge-ds/core").PushIssue[] | undefined;
84
+ reasons?: string[] | undefined;
85
+ edits?: import("@bridge-ds/core").TokenEdit[] | undefined;
86
+ status: "opened" | "suggested" | "dry-run" | "not-sent";
87
+ component: string;
88
+ route: string;
89
+ said: string;
90
+ }>;
package/dist/history.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type HistoryEntry, type HistoryReport, type RevertResolution } from '@bridge-ds/core';
1
+ import { type ChangesMode, type HistoryEntry, type HistoryReport, type RevertResolution } from '@bridge-ds/core';
2
2
  import type { BridgeContext } from './context.js';
3
3
  /** The history report for this context: local git (first parent of HEAD) or GitHub (the ref, PRs folded). */
4
4
  export declare function loadHistory(ctx: BridgeContext, limit?: number): Promise<HistoryReport>;
@@ -187,6 +187,8 @@ export declare function planRevertOp(ctx: BridgeContext, a: PlanArgs & {
187
187
  /** Plans, then commits to a new local bridge/* branch or opens a PR on a new bridge/* branch. Never main. */
188
188
  export declare function proposeRevert(ctx: BridgeContext, a: PlanArgs & {
189
189
  dryRun?: boolean;
190
+ changes?: ChangesMode | undefined;
191
+ source?: 'mcp' | 'cli' | undefined;
190
192
  }): Promise<{
191
193
  hint: string;
192
194
  tier: 1 | 2 | 3;
@@ -232,6 +234,162 @@ export declare function proposeRevert(ctx: BridgeContext, a: PlanArgs & {
232
234
  title: string;
233
235
  why?: string | undefined;
234
236
  status: "ready" | "blocked" | "nothing-to-do";
237
+ } | {
238
+ status: string;
239
+ changesMode: string;
240
+ suggestion: {
241
+ title: string;
242
+ labels: string[];
243
+ body: string;
244
+ parts: number;
245
+ };
246
+ fileContents: {
247
+ path: string;
248
+ content: string;
249
+ }[];
250
+ tier: 1 | 2 | 3;
251
+ bump: import("@bridge-ds/core").SemverBump;
252
+ reasons: string[];
253
+ edits: string[];
254
+ conflicts: {
255
+ before?: string | undefined;
256
+ now?: unknown;
257
+ key: string;
258
+ path: string;
259
+ file: string;
260
+ reason: import("@bridge-ds/core").ConflictReason;
261
+ message: string;
262
+ later: string[];
263
+ resolution: RevertResolution;
264
+ }[];
265
+ skipped: string[];
266
+ changes: {
267
+ kind: "added" | "changed" | "renamed" | "removed";
268
+ path: string;
269
+ file: string;
270
+ before: string | undefined;
271
+ after: string | undefined;
272
+ }[];
273
+ contrast: {
274
+ moved: number;
275
+ newFailures: import("@bridge-ds/core").ContrastDelta[];
276
+ sample: import("@bridge-ds/core").ContrastDelta[];
277
+ };
278
+ newErrors: import("@bridge-ds/core").LayerIssue[];
279
+ branch: string;
280
+ files: string[];
281
+ notes: string[];
282
+ reverts?: {
283
+ pr?: number | undefined;
284
+ id: string;
285
+ title: string;
286
+ date: string;
287
+ author: string;
288
+ } | undefined;
289
+ kind: "revert" | "restore";
290
+ title: string;
291
+ why?: string | undefined;
292
+ } | {
293
+ status: string;
294
+ message: string;
295
+ changesMode: string;
296
+ fileContents: {
297
+ path: string;
298
+ content: string;
299
+ }[];
300
+ tier: 1 | 2 | 3;
301
+ bump: import("@bridge-ds/core").SemverBump;
302
+ reasons: string[];
303
+ edits: string[];
304
+ conflicts: {
305
+ before?: string | undefined;
306
+ now?: unknown;
307
+ key: string;
308
+ path: string;
309
+ file: string;
310
+ reason: import("@bridge-ds/core").ConflictReason;
311
+ message: string;
312
+ later: string[];
313
+ resolution: RevertResolution;
314
+ }[];
315
+ skipped: string[];
316
+ changes: {
317
+ kind: "added" | "changed" | "renamed" | "removed";
318
+ path: string;
319
+ file: string;
320
+ before: string | undefined;
321
+ after: string | undefined;
322
+ }[];
323
+ contrast: {
324
+ moved: number;
325
+ newFailures: import("@bridge-ds/core").ContrastDelta[];
326
+ sample: import("@bridge-ds/core").ContrastDelta[];
327
+ };
328
+ newErrors: import("@bridge-ds/core").LayerIssue[];
329
+ branch: string;
330
+ files: string[];
331
+ notes: string[];
332
+ reverts?: {
333
+ pr?: number | undefined;
334
+ id: string;
335
+ title: string;
336
+ date: string;
337
+ author: string;
338
+ } | undefined;
339
+ kind: "revert" | "restore";
340
+ title: string;
341
+ why?: string | undefined;
342
+ } | {
343
+ next: string;
344
+ warnings?: string[] | undefined;
345
+ status: string;
346
+ changesMode: string;
347
+ number: number;
348
+ url: string;
349
+ version: string;
350
+ labels: string[];
351
+ tier: 1 | 2 | 3;
352
+ bump: import("@bridge-ds/core").SemverBump;
353
+ reasons: string[];
354
+ edits: string[];
355
+ conflicts: {
356
+ before?: string | undefined;
357
+ now?: unknown;
358
+ key: string;
359
+ path: string;
360
+ file: string;
361
+ reason: import("@bridge-ds/core").ConflictReason;
362
+ message: string;
363
+ later: string[];
364
+ resolution: RevertResolution;
365
+ }[];
366
+ skipped: string[];
367
+ changes: {
368
+ kind: "added" | "changed" | "renamed" | "removed";
369
+ path: string;
370
+ file: string;
371
+ before: string | undefined;
372
+ after: string | undefined;
373
+ }[];
374
+ contrast: {
375
+ moved: number;
376
+ newFailures: import("@bridge-ds/core").ContrastDelta[];
377
+ sample: import("@bridge-ds/core").ContrastDelta[];
378
+ };
379
+ newErrors: import("@bridge-ds/core").LayerIssue[];
380
+ branch: string;
381
+ files: string[];
382
+ notes: string[];
383
+ reverts?: {
384
+ pr?: number | undefined;
385
+ id: string;
386
+ title: string;
387
+ date: string;
388
+ author: string;
389
+ } | undefined;
390
+ kind: "revert" | "restore";
391
+ title: string;
392
+ why?: string | undefined;
235
393
  } | {
236
394
  status: string;
237
395
  prBody: string;
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  VERSION,
4
4
  optionsFromArgv,
5
5
  serveStdio
6
- } from "./chunk-MHCXMHCL.js";
7
- import "./chunk-QTO4EP6V.js";
6
+ } from "./chunk-MFV5WHB5.js";
7
+ import "./chunk-BZ3KXXMM.js";
8
8
 
9
9
  // src/index.ts
10
10
  var argv = process.argv.slice(2);
package/dist/lib.d.ts CHANGED
@@ -14,6 +14,8 @@ export * as drafts from './drafts.js';
14
14
  export * as branches from './branches.js';
15
15
  export * as studio from './studio.js';
16
16
  export * as pieces from './pieces.js';
17
+ export * as figma from './figma.js';
18
+ export * as suggestions from './suggestions.js';
17
19
  export { DOCS_DRAFT_MODEL, anthropicReplyText, anthropicRequest, formatDocsJson, mergeDocsDraft, missingProse, parseDocsReply } from '@bridge-ds/core';
18
20
  export interface ServeOptions extends ContextOptions {
19
21
  }
package/dist/lib.js CHANGED
@@ -15,6 +15,7 @@ import {
15
15
  detectConfig,
16
16
  drafts_exports,
17
17
  explorations_exports,
18
+ figma_exports,
18
19
  formatDocsJson,
19
20
  history_exports,
20
21
  mergeDocsDraft,
@@ -25,13 +26,14 @@ import {
25
26
  pieces_exports,
26
27
  requests_exports,
27
28
  serveStdio,
28
- studio_exports
29
- } from "./chunk-MHCXMHCL.js";
29
+ studio_exports,
30
+ suggestions_exports
31
+ } from "./chunk-MFV5WHB5.js";
30
32
  import {
31
33
  CONFIG_FILE,
32
34
  loadConfig,
33
35
  toConfigJson
34
- } from "./chunk-QTO4EP6V.js";
36
+ } from "./chunk-BZ3KXXMM.js";
35
37
  export {
36
38
  BridgeContext,
37
39
  CONFIG_FILE,
@@ -50,6 +52,7 @@ export {
50
52
  detectConfig,
51
53
  drafts_exports as drafts,
52
54
  explorations_exports as explorations,
55
+ figma_exports as figma,
53
56
  formatDocsJson,
54
57
  history_exports as history,
55
58
  mergeDocsDraft,
@@ -62,5 +65,6 @@ export {
62
65
  requests_exports as requests,
63
66
  serveStdio,
64
67
  studio_exports as studio,
68
+ suggestions_exports as suggestions,
65
69
  toConfigJson
66
70
  };
package/dist/ops.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DesignSystemIndex } from '@bridge-ds/core/audit';
2
2
  import { type ScaffoldInput } from './components.js';
3
- import { type BridgeConfig, type GitHubClient } from '@bridge-ds/core';
3
+ import { type ChangesMode, type BridgeConfig, type GitHubClient } from '@bridge-ds/core';
4
4
  import { type Combo, type PairInput, type TokenEdit, type TokenSet } from './core-adapter.js';
5
5
  import { BridgeContext } from './context.js';
6
6
  /** Accepts `color.text.muted`, `--color-text-muted` or `var(--color-text-muted)`. */
@@ -9,6 +9,7 @@ export declare function getConfig(ctx: BridgeContext): Promise<{
9
9
  source: string;
10
10
  configOrigin: string;
11
11
  write: string;
12
+ changes: string;
12
13
  repo: string | null;
13
14
  tokenFiles: number;
14
15
  tokens: number;
@@ -278,6 +279,10 @@ export declare function proposeTokenChange(ctx: BridgeContext, a: {
278
279
  pr?: number | string | undefined;
279
280
  jira?: string | undefined;
280
281
  product?: string | undefined;
282
+ /** "suggest" or "direct" for this call; default: `changes` in bridge.config.json, else "suggest". */
283
+ changes?: ChangesMode | undefined;
284
+ /** Who sends it: the MCP server (an AI agent) or the CLI (the person). */
285
+ source?: 'mcp' | 'cli' | undefined;
281
286
  }): Promise<{
282
287
  status: string;
283
288
  pr: number;
@@ -374,6 +379,106 @@ export declare function proposeTokenChange(ctx: BridgeContext, a: {
374
379
  why: string;
375
380
  newErrors: import("@bridge-ds/core").LayerIssue[];
376
381
  message?: undefined;
382
+ } | {
383
+ suggestion: {
384
+ title: string;
385
+ body: string;
386
+ };
387
+ fileContents: {
388
+ path: string;
389
+ content: string | null;
390
+ }[];
391
+ changesMode: "suggest";
392
+ files: string[];
393
+ title: string;
394
+ tier: 1 | 2 | 3;
395
+ bump: import("@bridge-ds/core").SemverBump;
396
+ reasons: string[];
397
+ changes: {
398
+ fields?: ("value" | "description" | "type" | "extensions")[] | undefined;
399
+ file: string;
400
+ before: string | undefined;
401
+ after: string | undefined;
402
+ from?: string | undefined;
403
+ kind: "added" | "changed" | "renamed" | "removed";
404
+ path: string;
405
+ }[];
406
+ contrast: {
407
+ moved: number;
408
+ newFailures: import("@bridge-ds/core").ContrastDelta[];
409
+ };
410
+ impact: {
411
+ total: number;
412
+ sample: import("@bridge-ds/core").ImpactEntry[];
413
+ };
414
+ notes: string[];
415
+ status: string;
416
+ message?: undefined;
417
+ } | {
418
+ fileContents: {
419
+ path: string;
420
+ content: string | null;
421
+ }[];
422
+ changesMode: "suggest";
423
+ files: string[];
424
+ title: string;
425
+ tier: 1 | 2 | 3;
426
+ bump: import("@bridge-ds/core").SemverBump;
427
+ reasons: string[];
428
+ changes: {
429
+ fields?: ("value" | "description" | "type" | "extensions")[] | undefined;
430
+ file: string;
431
+ before: string | undefined;
432
+ after: string | undefined;
433
+ from?: string | undefined;
434
+ kind: "added" | "changed" | "renamed" | "removed";
435
+ path: string;
436
+ }[];
437
+ contrast: {
438
+ moved: number;
439
+ newFailures: import("@bridge-ds/core").ContrastDelta[];
440
+ };
441
+ impact: {
442
+ total: number;
443
+ sample: import("@bridge-ds/core").ImpactEntry[];
444
+ };
445
+ notes: string[];
446
+ status: string;
447
+ message: string;
448
+ } | {
449
+ product: string;
450
+ next: string;
451
+ warnings?: string[] | undefined;
452
+ number: number;
453
+ url: string;
454
+ version: string;
455
+ labels: string[];
456
+ changesMode: "suggest";
457
+ files: string[];
458
+ title: string;
459
+ tier: 1 | 2 | 3;
460
+ bump: import("@bridge-ds/core").SemverBump;
461
+ reasons: string[];
462
+ changes: {
463
+ fields?: ("value" | "description" | "type" | "extensions")[] | undefined;
464
+ file: string;
465
+ before: string | undefined;
466
+ after: string | undefined;
467
+ from?: string | undefined;
468
+ kind: "added" | "changed" | "renamed" | "removed";
469
+ path: string;
470
+ }[];
471
+ contrast: {
472
+ moved: number;
473
+ newFailures: import("@bridge-ds/core").ContrastDelta[];
474
+ };
475
+ impact: {
476
+ total: number;
477
+ sample: import("@bridge-ds/core").ImpactEntry[];
478
+ };
479
+ notes: string[];
480
+ status: string;
481
+ message?: undefined;
377
482
  } | {
378
483
  fileContents: {
379
484
  path: string;
package/dist/pieces.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type ChangesMode } from '@bridge-ds/core';
1
2
  import type { BridgeContext } from './context.js';
2
3
  /** Who opens library branches from here: the MCP server speaks for an AI agent, the CLI for the person. */
3
4
  export type PiecesSource = 'mcp' | 'cli';
@@ -45,6 +46,7 @@ export declare function openLibraryBranchOp(ctx: BridgeContext, a: {
45
46
  usePreview?: boolean | undefined;
46
47
  dryRun?: boolean | undefined;
47
48
  source?: PiecesSource | undefined;
49
+ changes?: ChangesMode | undefined;
48
50
  }): Promise<{
49
51
  next: string;
50
52
  warnings?: string[] | undefined;
@@ -55,12 +57,13 @@ export declare function openLibraryBranchOp(ctx: BridgeContext, a: {
55
57
  number: number;
56
58
  url: string;
57
59
  } | undefined;
60
+ changesMode: ChangesMode;
58
61
  neededBy: string;
59
62
  request?: string | undefined;
60
63
  exploration?: string | undefined;
61
64
  brief?: string | undefined;
62
65
  edits?: import("@bridge-ds/core").TokenEdit[] | undefined;
63
- status: "opened" | "already-linked" | "dry-run";
66
+ status: "opened" | "suggested" | "already-linked" | "dry-run";
64
67
  pr: number;
65
68
  piece: string;
66
69
  opens: string;
@@ -11,7 +11,7 @@ import {
11
11
  referenceImagePath,
12
12
  selectTokenFiles,
13
13
  showFile
14
- } from "./chunk-QTO4EP6V.js";
14
+ } from "./chunk-BZ3KXXMM.js";
15
15
 
16
16
  // ../visual/src/run.ts
17
17
  import { existsSync as existsSync3 } from "node:fs";
package/dist/studio.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type ChangesMode } from '@bridge-ds/core';
1
2
  import type { BridgeContext } from './context.js';
2
3
  /**
3
4
  * Save a component's guidance (docs.json) the way the Library edit mode does: merged into the docs on the branch,
@@ -13,6 +14,9 @@ export declare function saveDocs(ctx: BridgeContext, a: {
13
14
  jira?: string | undefined;
14
15
  product?: string | undefined;
15
16
  dryRun?: boolean | undefined;
17
+ /** "suggest" or "direct" for this call; default: `changes` in bridge.config.json, else "suggest". */
18
+ changes?: ChangesMode | undefined;
19
+ source?: 'mcp' | 'cli' | undefined;
16
20
  }): Promise<{
17
21
  status: "dry-run";
18
22
  pr: number;
@@ -57,9 +61,23 @@ export declare function saveDocs(ctx: BridgeContext, a: {
57
61
  path: string;
58
62
  content: string;
59
63
  product: string;
64
+ changesMode: ChangesMode;
60
65
  pr?: undefined;
61
66
  url?: undefined;
62
67
  title?: undefined;
68
+ } | {
69
+ said: string;
70
+ next: string;
71
+ warnings?: string[] | undefined;
72
+ status: "suggested";
73
+ number: number;
74
+ url: string;
75
+ title: string;
76
+ path: string;
77
+ product: string;
78
+ changesMode: "suggest";
79
+ pr?: undefined;
80
+ content?: undefined;
63
81
  } | {
64
82
  status: "sent-for-review";
65
83
  pr: number;