@bridge-ds/mcp 0.8.4 → 0.9.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/README.md CHANGED
@@ -12,7 +12,7 @@ with your own token.
12
12
  From npm, nothing to build:
13
13
 
14
14
  ```sh
15
- npx -y @bridge-ds/mcp --repo owner/name # GitHub repo, read-only
15
+ npx -y @bridge-ds/mcp --repo owner/name # GitHub repo: your gh sign-in, else read-only
16
16
  GITHUB_TOKEN=... npx -y @bridge-ds/mcp --repo owner/name # GitHub repo, can open PRs
17
17
  npx -y @bridge-ds/mcp --root . # local folder (default: current directory)
18
18
  npx -y @bridge-ds/mcp --help
@@ -43,59 +43,102 @@ Working on the server itself: `npm run mcp:build` in a clone of this repo builds
43
43
 
44
44
  ## Tools
45
45
 
46
- | Tool | What it does |
47
- | --- | --- |
48
- | `bridge_get_config` | Source, write access, tiers, modes, the effective `bridge.config.json` |
49
- | `bridge_list_tokens` | Tokens with resolved values, filtered by tier, `$type`, path prefix, mode |
50
- | `bridge_get_token` | One token: value per mode with alias chain, defining files, tokens aliasing it, components using it |
51
- | `bridge_search_tokens` | By words, CSS variable or value (exact and near colors) |
52
- | `bridge_check_contrast` | The contrast gate in every brand x theme; with `edits`, before/after and new failures |
53
- | `bridge_validate_tokens` | DTCG shapes, names, broken/circular aliases, type mismatches, light/dark parity |
54
- | `bridge_list_components` | Components with family and summary |
55
- | `bridge_get_component` | Props parsed from TypeScript, docs.json usage guidance, CSS variables used |
56
- | `bridge_draft_docs` | docs.json pre-fill from the code (props, tokens, anatomy, contrast, changelog line, missing keys) and a prompt to write the prose; writes nothing |
57
- | `bridge_get_design_language` | Sections of the design language doc |
58
- | `bridge_get_guidelines` | AGENTS.md rules, risk tiers, what Bridge enforces |
59
- | `bridge_propose_token_change` | Edits, validation, contrast, tier, changeset, PR body; branch (local) or PR (remote) |
60
- | `bridge_list_brands` | Brands: slug, name, default, primary action color, theme override files |
61
- | `bridge_plan_brand` | Dry run of a new brand: generated ramps, contrast for every theme, files, tier 3, PR body |
62
- | `bridge_propose_brand` | The new brand as a local `bridge/brand-<slug>` branch or a draft PR; blocked when a pair fails |
63
- | `bridge_list_reviews` | Open PRs (Bridge ones flagged) and local `bridge/*` branches |
64
- | `bridge_get_review` | Diff table, contrast before/after, impact, tier check, CI status, approvals |
65
- | `bridge_review_pr` | Comment, approve or request changes (token required; `bridge_review_branch` is the designer version) |
66
- | `bridge_scaffold_component` | New component folder per the repo checklist |
67
- | `bridge_visual_impact` | Before/after screenshots of the impacted stories and admin screens, pixel diff, manifest (local, needs Chrome; `plan` for the selection only) |
68
- | `bridge_get_history` | Token history: versions, merged PRs and commits, who, when, why, tier |
69
- | `bridge_get_token_history` | Every change of one token, before and after per mode |
70
- | `bridge_plan_revert` | Dry run of a revert (or a one-token restore) against the current base, conflicts shown |
71
- | `bridge_propose_revert` | The revert as a local bridge/* branch or a draft PR labelled revert |
72
- | `bridge_audit` | Adoption in a product folder or file (local): CSS, SCSS, Less, TS/JS, TSX/JSX, Astro, Vue and Svelte. Token and component adoption, hardcoded values with the closest token, foreign and native components with the DS one to use, top files and fixes; `allowlist` and `bridge-audit-ignore-next-line: reason` comments leave known exceptions out, listed under `ignored` |
73
- | `bridge_list_requests` | Component change requests (issues labeled `component-change`) with status and linked pull requests |
74
- | `bridge_get_request` | One request with the component's files and a brief to implement it in a pull request that says "Closes #n" |
75
- | `bridge_create_request` | File a request as an issue labeled `component-change` (token required; `dryRun` previews; `exploration` targets an exploration branch) |
76
- | `bridge_start_exploration` | Start an exploration: `explore/<name>` branch and a draft pull request labeled `exploration`, previews and a snapshot package, never merged as is |
77
- | `bridge_list_explorations` | Explorations with status, previews, the snapshot install command and linked requests |
78
- | `bridge_promote_exploration`, `bridge_close_exploration` | Promote an exploration to review, or close it |
79
- | `bridge_list_products` | Products (`products` in bridge.config.json) and the one the current folder belongs to |
80
- | `bridge_what_needs_me` | The review queue, the branches where you act now first |
81
- | `bridge_branch_status` | One branch: status, approvals, tests, main, whether you may merge, next step |
82
- | `bridge_list_comments`, `bridge_comment` | Read the conversation and line threads; comment or reply |
83
- | `bridge_send_for_review`, `bridge_back_to_draft` | Ready for review, or back to draft (the author) |
84
- | `bridge_review_branch` | Approve, request changes or comment on the version seen |
85
- | `bridge_ask_someone_else` | Ask the other people who can give the missing approvals to review |
86
- | `bridge_merge_branch` | Merge through Studio's gate; owner override with a reason posted first (token required) |
87
- | `bridge_close_branch`, `bridge_reopen_branch` | Close without merging; reopen with Studio's rule |
88
- | `bridge_update_from_main` | Update from main; token conflicts to pick, code conflicts left to a developer |
89
- | `bridge_try_branch` | Product previews Vercel reported, the install command and a message for a product team |
90
- | `bridge_combine_branches` | Try 2 to 4 token branches together (writes nothing) |
91
- | `bridge_save_docs` | Save usage guidance on a new branch for review, or on an open branch |
92
- | `bridge_get_settings` | Roles, who ships, owner override, protection, products |
93
- | `bridge_figma_coverage` | Which components are in Figma, code images for the fidelity check |
46
+ <!-- tools:start (generated from the server: npm run readme:tools -w @bridge-ds/mcp) -->
47
+
48
+ 73 tools. "writes" tools change files, branches, pull requests or issues; they need a token in remote mode and only run when the person asked.
49
+
50
+ | Tool | Access | What it does |
51
+ | --- | --- | --- |
52
+ | `bridge_apply_suggestion` | writes | Apply a Bridge suggestion to today's code ("Apply Bridge suggestion #42"). |
53
+ | `bridge_ask_someone_else` | writes | Ask the other people who can give the missing approvals to review a branch, as "Ask someone else to review" in the Studio review queue, and take the person off its requested reviewers. |
54
+ | `bridge_audit` | reads | Measure how a product codebase uses this design system (local only). |
55
+ | `bridge_back_to_draft` | writes | Take a branch out of review back to draft, as in Studio's More menu. |
56
+ | `bridge_branch_status` | reads | One branch in review as Studio shows it: its product, status (draft, in review, needs design or tech approval, blocked by tests, conflict, ready to merge, merged, closed), approvals (Tier 1: one owner approval; a branch that applies an approved suggestion carries its approvals), tests, how it stands against main, whether the person may merge it (the same verdict as the Merge button and status chips in Studio), and the next step. |
57
+ | `bridge_check_contrast` | reads | Run the repo's WCAG contrast gate (every pair in every brand x theme). |
58
+ | `bridge_close_branch` | writes | Close a branch without merging it, as in Studio's More menu. |
59
+ | `bridge_close_exploration` | writes | Close an exploration without merging it, as in Studio. |
60
+ | `bridge_combine_branches` | reads | Combined preview of 2 to 4 token branches, as "Try together" in Studio: each branch's own token edits on the latest main, the tokens two branches set differently (pick one per key with picks), and the links that open the combination (the admin demo with the Bridge toolbar, the library views). |
61
+ | `bridge_comment` | writes | Post a comment on a branch, or reply in the thread of a line comment (replyTo: its id from bridge_list_comments). |
62
+ | `bridge_create_request` | writes | File a component change request as a GitHub issue labeled component-change (source: mcp), in the same format as Figma and Bridge Studio requests. |
63
+ | `bridge_create_suggestion` | writes | File any change as a suggestion from its payload (schema bridge.suggestion/1: kind, title, summary, and tokens edits, docs, componentSpec or files). |
64
+ | `bridge_draft_docs` | reads | Start or refresh a component's docs.json. |
65
+ | `bridge_figma_changes` | reads | The library branches the DS Bridge Figma plugin opened for components changed in Figma (label from-figma), with where each stands: an exact token change (no AI, contrast gated), or a branch carrying the spec, waiting for Claude AI to draft the code, then drafted by Claude AI and reviewed by a person. |
66
+ | `bridge_figma_coverage` | reads | Which components are in Figma, in Studio's words (Yes, Drafted, Auto layout, Not yet with the reason), and whether code images exist for the fidelity check the DS Bridge Figma plugin runs (its scores live in Figma). |
67
+ | `bridge_figma_gaps` | reads | The components whose Figma build differs from their story (Differs) or cannot be checked (Can't check, with the reason), from the latest Check fidelity run of the DS Bridge plugin (the story shots are the referee), else from the measure's own check; a status fix in figma-fixes.json shows with its reason. |
68
+ | `bridge_get_build_request` | reads | One build request, ready to build: what the designer sent (the request, before and after images, props needed, the spec when the issue keeps it), the status timeline, the linked pull request, the Jira key, the component files and `brief`, the prompt to build it in this repo. |
69
+ | `bridge_get_component` | reads | One component: props parsed from TypeScript (type, default, description, allowed values), usage docs (summary, whenToUse, whenNotToUse, dos/donts with examples, accessibility, contentGuidelines, anatomy), CSS variables it uses, and story names. |
70
+ | `bridge_get_config` | reads | Where the design system lives and what Bridge may do: source (local path or GitHub repo), write access, token tiers, modes (brand/theme/density...) and the full bridge.config.json. |
71
+ | `bridge_get_design_language` | reads | The design language doc (principles, color, type, space, density, radius, elevation, motion, icons, voice, accessibility). |
72
+ | `bridge_get_figma_change` | reads | One library branch sent from Figma: its spec (variant matrix, properties, bound variables per variant, layers, what code gave Figma before, the exact token swaps) and the brief to draft the code on that branch. |
73
+ | `bridge_get_gap_case` | reads | One component's gap case: per differing variant, its story, args, state, shot and every difference with the part id, property, expected (code) and actual (Figma) and the delta in px, plus the figma-fixes.json schema. |
74
+ | `bridge_get_guidelines` | reads | Rules for agents in this repo (AGENTS.md): always / ask before / never lists, token conventions, risk tiers, and what Bridge enforces. |
75
+ | `bridge_get_history` | reads | History of the design tokens: merged token-changing PRs and commits (local git: first parent of HEAD; GitHub: PR merge commits), newest first, each with author, date, why (changeset summary, PR or commit body), version it shipped in, risk tier, semver bump, breaking flag and change counts, plus the timeline of design system versions. |
76
+ | `bridge_get_request` | reads | One request, ready to implement: the parsed request (component, kind, summary, changes asked, Figma link, images), its status and linked pull requests, the component files found under the components directory, the agent rules file, and `brief`: the prompt to implement it in this repo. |
77
+ | `bridge_get_review` | reads | Review a token change: designer-readable diff table, contrast before -> after, new validation errors, downstream impact, computed risk tier (and a warning if labelled lower), and for PRs the CI status, approvals and roles: who may approve design, approve tech and ship, with GitHub teams named and their size, and any team that cannot be read with the fix. |
78
+ | `bridge_get_settings` | reads | What Studio Settings shows that is safe to read: who approves design and tech (GitHub teams named with their size), who may merge, the owner override (who, what reason), whether main is protected, the products, the preview apps and the visual impact mode. |
79
+ | `bridge_get_suggestion` | reads | One suggestion: the change (tokens before and after, docs, component spec, files), the checks when suggested, links, its version (payloadSha: what approvals bind to), who approved it, which approvals are missing for its tier, reviews that no longer count (an older version, or not an owner), whether the machine-readable block was edited by hand, linked pull requests, and for a component spec the brief to implement it. |
80
+ | `bridge_get_token` | reads | Everything about one token: CSS variable, type, tier, description, the files that define it, resolved value in every mode (brand x theme x density, collapsed where equal) with its alias chain, tokens that alias it, and components whose CSS uses it (directly or through a component token). |
81
+ | `bridge_get_token_history` | reads | Every recorded change of one token, newest first, renames followed: value before and after per mode (raw and resolved CSS), who, when, the PR and why. |
82
+ | `bridge_link_suggestion` | writes | Record the pull request (or branch, or commit) that applies a suggestion: a comment on the issue and the "suggestion: applying" label. |
83
+ | `bridge_list_brands` | reads | Brands of the repo: slug, name, default, primary action color and theme override files. |
84
+ | `bridge_list_build_requests` | reads | Build requests: structure changes pushed from Figma (a new variant, option, layout or component) that developers build, as GitHub issues labeled component-change and bridge-build, plus library branches from Figma waiting for a developer. |
85
+ | `bridge_list_comments` | reads | The conversation on a branch and its line comment threads, with the ids to reply to (bridge_comment with replyTo). |
86
+ | `bridge_list_components` | reads | List design system components with family and one-line summary (what it is for). |
87
+ | `bridge_list_explorations` | reads | Explorations of the repo (draft pull requests labeled exploration on explore/* branches): name, purpose, status (active: running; promoted: ready for review; closed), author, last update, for running ones the preview links Vercel reports (url null while it has not reported one yet) and the install command a product staging branch uses, read from the preview comment on the pull request (state building until the snapshot of the latest commit is published, never a guessed command), and the component requests implemented on each. |
88
+ | `bridge_list_products` | reads | The products of this design system (bridge.config.json "products": name, repo or folder, preview link pattern, framework) and the one the current folder or repo belongs to, which tools that start work use when no product is given. |
89
+ | `bridge_list_requests` | reads | Component change requests: GitHub issues labeled component-change (from Figma, Bridge Studio, the CLI or Claude). |
90
+ | `bridge_list_reviews` | reads | Open pull requests on the repo (flagging the ones Bridge opened) and, locally, the bridge/* proposal branches. |
91
+ | `bridge_list_suggestions` | reads | Suggestions in the repo: GitHub issues labeled bridge-suggestion, each an exact change (tokens, docs, a component spec, a brand, a revert, settings) that the owners approve and a developer applies. |
92
+ | `bridge_list_tokens` | reads | List tokens with their resolved CSS value in one mode. |
93
+ | `bridge_mark_figma_change_drafted` | writes | After you pushed the code for a component change from Figma to its branch: mark its pull request ready for review, label it drafted-by-claude (no longer waiting-for-claude) and say so in its description, in one step, for a person to review. |
94
+ | `bridge_merge_branch` | writes | Merge a branch into main through the same gate as Studio's Merge button: tests pass, the approvals its tier needs (Tier 1: one owner approval; Tier 2 and 3: design and tech; a branch that applies an approved suggestion with Closes #n carries its approvals while the suggestion stays approved and the tier is not higher), no changes requested, no conflict, not a draft or an exploration, and the person holds the right to ship (governance.rights). |
95
+ | `bridge_missing_pieces` | writes | Check a product branch (an exploration started for a product) against the library: the adoption audit on each product file it changes, at its start and at its head, keeps what the branch added. |
96
+ | `bridge_open_library_branch` | writes | Turn one recorded missing piece into a library branch linked to the product branch, as Bridge Studio does: a token piece opens a token change (same gate and body as bridge_propose_token_change, a draft for design and tech review) and the product branch takes its preview; a variant opens a library exploration with the brief to build it (build it there, then bridge_use_library_preview); a new component opens a component request. |
97
+ | `bridge_pending_drafts` | reads | Change texts a designer asked their own Claude to write from the DS Bridge Figma plugin ("Draft with my Claude"), waiting on the bridge-requests branch. |
98
+ | `bridge_plan_brand` | reads | Dry run of a new brand: the brand token file (generated primary and neutral ramps, radius and font roles), copied theme overrides, the bridge.config.json change, every contrast pair for the new brand in light and dark (ok, or the failing pairs), validation issues, the risk tier (always Tier 3, minor) and the PR body. |
99
+ | `bridge_plan_revert` | reads | What undoing a merged token change takes, computed against the CURRENT base branch (not a blind git revert): the inverse edits, conflicts where a token changed again later (with the later PR), changes already undone, contrast before and after, new validation errors, risk tier, files and the PR body ("Revert: <title>", links the original PR). |
100
+ | `bridge_product_branch` | reads | A product branch as Studio shows it: the summary sentence, each linked library branch with its status and reviewers, what its preview means for the product branch and the next action, and the pieces with no library branch yet. |
101
+ | `bridge_promote_exploration` | writes | Promote an exploration (explore/<name>) to review, as in Studio: the draft becomes ready for review with its tier labels, the exploration label and note go, and the component requests it implements are linked so they close when it merges. |
102
+ | `bridge_propose_brand` | writes | Propose a new brand as a reviewable change. |
103
+ | `bridge_propose_figma_fixes` | writes | Opens the accepted fixes for review like other Bridge changes: figma-fixes.json with them on a new bridge/* branch and a draft pull request labelled drafted-by-claude, figma-fixes and its tier (locally: a new local branch, never pushed). |
104
+ | `bridge_propose_revert` | writes | Plans the revert (or restore) like bridge_plan_revert, then: local repo, commits to a new local bridge/* branch without touching your working tree (never pushes); GitHub with token, new bridge/* branch and a PR labelled revert and its tier (draft for Tier 2 and 3). |
105
+ | `bridge_propose_token_change` | writes | Propose token edits as a reviewable change. |
106
+ | `bridge_push_figma_component` | writes | What the DS Bridge plugin Push tab does, from a structured diff of a Figma component (the v 1 spec shape: component, figmaName, coded, kind, title, summary, changes, rebinds, needsCode, unknown, variantAxes, properties, bindings, anatomy). |
107
+ | `bridge_reopen_branch` | writes | Reopen a closed branch, with Studio's rule: its author or an owner with write access, and only while its work is still on GitHub. |
108
+ | `bridge_review_branch` | writes | Approve, request changes or comment on a branch, as the review box in Studio, on the version the person saw, under their GitHub account. |
109
+ | `bridge_review_pr` | writes | Post a review on a PR as the token owner: comment, approve or request changes, with a body. |
110
+ | `bridge_review_suggestion` | writes | Approve, request changes on, comment on or decline a suggestion, as the person whose GitHub token the server has. |
111
+ | `bridge_save_docs` | writes | Save a component's usage guidance (docs.json sections: summary, whenToUse, whenNotToUse, dos, donts, accessibility, contentGuidelines, anatomy, preview) the way the Library edit mode does: merged into the docs on the branch, cleaned and checked (a summary, no empty items, no em dash). |
112
+ | `bridge_scaffold_component` | writes | Generate a new component folder per the repo checklist: Name.tsx (forwardRef, typed props), Name.module.css (existing tokens only), stories with AllStates, docs.json with the reference component's keys, a keyboard + axe test when interactive, index.ts. |
113
+ | `bridge_search_tokens` | reads | Find tokens by words in the path or description ("danger text", "focus ring"), by CSS variable, or by value ("#c2410c", "16px": exact and near colors). |
114
+ | `bridge_send_for_review` | writes | Ask for review: a draft branch becomes ready for review, as "Mark as ready" in Studio. |
115
+ | `bridge_start_exploration` | writes | Start an exploration: a branch explore/<slug> from the default branch with a note file, and a DRAFT pull request labeled exploration that gets per-branch previews and a snapshot package a product staging branch installs (npm i @bridge-ds/react@<snapshot>). |
116
+ | `bridge_switch_to_published` | writes | Once its library branches shipped, bring main into the product branch (GitHub update branch): it stops carrying the library change and uses the shipped one. |
117
+ | `bridge_try_branch` | reads | Try a branch before it merges: the preview link of each product Vercel reported for it (the admin demo opens with the Bridge toolbar on, as "Try it in the product" in Studio), the other previews, and "Share with a product team": the install command a product team runs in a staging branch, or why there is none yet, with a ready-to-paste message. |
118
+ | `bridge_try_figma_fix` | reads | Checks proposed fixes offline, nothing is written: validates them (the strict figma-fixes.json validator), lays them on the measure, rebuilds the set the way the plugin pulls it, and compares each differing variant with what the code renders. |
119
+ | `bridge_update_from_main` | writes | Bring the latest main into a branch, as "Update from main" in Studio. |
120
+ | `bridge_use_library_preview` | writes | The product branch takes the latest commits of the library branch of a piece (Bridge merges it in), so the product preview shows the real library change before it ships. |
121
+ | `bridge_validate_tokens` | reads | Validate tokens: DTCG 2025.10 shape per $type, names, broken and circular aliases in every mode, alias type mismatches, missing layer files, and mode parity (a semantic token must exist in both light and dark). |
122
+ | `bridge_visual_impact` | writes | Screenshots what a design system change touches, before and after, and pixel-diffs them. |
123
+ | `bridge_what_needs_me` | reads | The review queue, as Studio counts it (open branches, without running explorations and the release automation), each with its status in designer words, and first the ones where the person acts now: an approval they can give, their own branch blocked, ready for them to merge. |
124
+ | `bridge_write_drafts` | writes | Write the titles, summaries and change lines (or, for docs items, the docs sections or the rewritten passage) you drafted for a session from bridge_pending_drafts. |
125
+
126
+ <!-- tools:end -->
94
127
 
95
128
  Resources: `bridge://tokens/resolved`, `bridge://design-language`, `bridge://guidelines`,
96
129
  `bridge://components/{name}`. Prompts: `review-token-pr`, `add-component`, `audit-ui-for-tokens`,
97
130
  `migrate-file-to-ds`.
98
131
 
132
+ ### The merge gate is Studio's
133
+
134
+ `bridge_branch_status`, `bridge_merge_branch` and `bridge_what_needs_me` (and `bridge branch status|merge|list` in the
135
+ CLI) read the same verdict as Studio's branch page and status chips: `branchVerdict` in `@bridge-ds/core`. Tier 1
136
+ needs one owner approval; Tier 2 and 3 a design owner and a tech owner. A branch whose body says `Closes #<n>` for an
137
+ approved suggestion carries that suggestion's approvals while it stays approved and the branch's tier is not higher.
138
+ The owner override (`overrideReason`) is for owners named in `governance.override.allowed` only, skips missing
139
+ approvals only, and always needs a reason of at least `minReasonLength` characters (20 by default). See
140
+ [GOVERNANCE.md](../../docs/GOVERNANCE.md#one-verdict-everywhere).
141
+
99
142
  ## Configuration
100
143
 
101
144
  `bridge.config.json` at the repo root says where tokens live, how they layer per mode, and what Bridge may
@@ -1,4 +1,4 @@
1
- import { type BridgeConfig, type GitHubClient, type MergeChoices, type ProductConfig, type ReviewStatusKind } from '@bridge-ds/core';
1
+ import { tokenFileChanges, type FigmaPush, type PullRequestFile, type BridgeConfig, type GitHubClient, type MergeChoices, type ProductConfig, type ReviewStatusKind } from '@bridge-ds/core';
2
2
  import type { BridgeContext } from './context.js';
3
3
  /** What a write needs from the token, per action, in the words GitHub's token settings use. */
4
4
  export declare const RIGHTS: {
@@ -19,6 +19,29 @@ export declare function writer(ctx: BridgeContext, what: string, need: string):
19
19
  export declare function branchNumber(input: number | string): number;
20
20
  /** The viewer of the token, or null without one (or when GitHub does not say). */
21
21
  export declare function viewerOf(ctx: BridgeContext, gh: GitHubClient): Promise<string | null>;
22
+ type PullForTokens = {
23
+ labels: string[];
24
+ body: string;
25
+ baseRef: string;
26
+ headSha: string;
27
+ };
28
+ /**
29
+ * The token changes of a pull request, from its token files at the base and the head (never from its body). A renamed
30
+ * token file, or a read that fails, leaves them unknown (null): the tech approval is then still needed.
31
+ */
32
+ export declare function tokenChangesOf(gh: GitHubClient, config: BridgeConfig, pr: PullForTokens, files: PullRequestFile[], base: string | null | undefined): Promise<ReturnType<typeof tokenFileChanges> | null>;
33
+ /**
34
+ * The Figma push facts of a pull request (docs/BUILD-REQUESTS.md), read the way Studio reads them: only for a push
35
+ * from the Figma plugin (labels or the "From Figma" block) or the pull request of a build request sent from Figma
36
+ * (its body closes one labeled source: figma). The token changes come from tokenChangesOf (`read`, when the caller
37
+ * already reads them).
38
+ */
39
+ export declare function figmaPushFacts(gh: GitHubClient, config: BridgeConfig, pr: PullForTokens, files: PullRequestFile[], base: string | null | undefined, read?: () => Promise<ReturnType<typeof tokenFileChanges> | null>): Promise<FigmaPush | null>;
40
+ /**
41
+ * Whether a pull request only changes token values (core isTokenValueChange, decision TV-1), whoever opened it: the
42
+ * design approval is then all it needs, as in Studio. Reads the token files only when its files could be one.
43
+ */
44
+ export declare function tokenValuesFact(config: BridgeConfig, pr: Pick<PullForTokens, 'labels'>, files: PullRequestFile[], read: () => Promise<ReturnType<typeof tokenFileChanges> | null>): Promise<boolean>;
22
45
  /** Everything Studio reads about one branch to paint its header and decide its actions. */
23
46
  export declare function branchFacts(ctx: BridgeContext, gh: GitHubClient, n: number, viewer: string | null): Promise<{
24
47
  config: BridgeConfig;
@@ -26,13 +49,16 @@ export declare function branchFacts(ctx: BridgeContext, gh: GitHubClient, n: num
26
49
  body: string;
27
50
  mergeable: boolean | null;
28
51
  requestedReviewers: string[];
52
+ autoMerge: boolean;
29
53
  };
30
- files: import("@bridge-ds/core").PullRequestFile[];
54
+ files: PullRequestFile[];
31
55
  ci: import("@bridge-ds/core").CiSummary;
32
56
  approvals: import("@bridge-ds/core").ApprovalSummary;
33
57
  tier: import("@bridge-ds/core").RiskTier | null;
34
58
  gate: import("@bridge-ds/core").MergeGate;
35
59
  status: ReviewStatusKind;
60
+ override: import("@bridge-ds/core").OverridePolicy;
61
+ suggestion: import("@bridge-ds/core").ApprovedSuggestion | null;
36
62
  fresh: import("@bridge-ds/core").Freshness;
37
63
  compare: {
38
64
  behindBy: number;
@@ -48,6 +74,7 @@ export declare function branchFacts(ctx: BridgeContext, gh: GitHubClient, n: num
48
74
  } | null;
49
75
  exploration: boolean;
50
76
  product: ProductConfig;
77
+ lookAgain: string[];
51
78
  lifecycle: import("@bridge-ds/core").PullState;
52
79
  write: boolean | null;
53
80
  repo: {
@@ -61,11 +88,22 @@ export declare function branchFacts(ctx: BridgeContext, gh: GitHubClient, n: num
61
88
  };
62
89
  } | null;
63
90
  solo: string | null;
91
+ lists: import("@bridge-ds/core").Owners;
92
+ figmaPush: FigmaPush | null;
93
+ tokenValues: boolean;
94
+ autoShip: boolean;
95
+ statusLabel: string;
64
96
  }>;
65
97
  /** One branch, the way Studio shows it: status, what blocks the merge and who acts, how it stands against main. */
66
98
  export declare function branchStatus(ctx: BridgeContext, a: {
67
99
  pr: number | string;
68
100
  }): Promise<{
101
+ next: string;
102
+ fromFigma?: {
103
+ scope: import("@bridge-ds/core").FigmaPushScope;
104
+ shipsByItself: boolean;
105
+ said: string;
106
+ } | undefined;
69
107
  pr: number;
70
108
  title: string;
71
109
  url: string;
@@ -79,13 +117,16 @@ export declare function branchStatus(ctx: BridgeContext, a: {
79
117
  kind: ReviewStatusKind;
80
118
  label: string;
81
119
  };
82
- approvalNeeded: string;
120
+ approvalNeeded: string | null;
83
121
  approvals: {
84
122
  soloOwner?: string | undefined;
85
- approvedBy: string[];
86
- changesRequestedBy: string[];
123
+ carriedFrom?: string | undefined;
87
124
  design: boolean;
88
125
  tech: boolean;
126
+ owner: boolean;
127
+ lookAgain?: string[] | undefined;
128
+ approvedBy: string[];
129
+ changesRequestedBy: string[];
89
130
  };
90
131
  tests: {
91
132
  state: import("@bridge-ds/core").CiState;
@@ -109,7 +150,6 @@ export declare function branchStatus(ctx: BridgeContext, a: {
109
150
  allowed: boolean;
110
151
  blockedBy: string[];
111
152
  };
112
- next: string;
113
153
  }>;
114
154
  /**
115
155
  * What needs me: the review queue (open branches minus running explorations and release automation), each with its
@@ -120,7 +160,7 @@ export declare function whatNeedsMe(ctx: BridgeContext, a?: {
120
160
  }): Promise<{
121
161
  viewer: string | null;
122
162
  summary: string;
123
- branches: ({
163
+ branches: NonNullable<{
124
164
  pr: number;
125
165
  title: string;
126
166
  url: string;
@@ -140,7 +180,7 @@ export declare function whatNeedsMe(ctx: BridgeContext, a?: {
140
180
  statusLabel: string;
141
181
  yours: boolean;
142
182
  needsYou: string | null;
143
- })[];
183
+ } | null>[];
144
184
  }>;
145
185
  /** The configured products, and the one the current folder or repo belongs to (the default for new work). */
146
186
  export declare function listProducts(ctx: BridgeContext): Promise<{
@@ -183,6 +223,10 @@ export declare function tryBranch(ctx: BridgeContext, a: {
183
223
  url: string | null;
184
224
  how: string;
185
225
  }[];
226
+ local: {
227
+ branch: string;
228
+ command: string;
229
+ } | null;
186
230
  previews: {
187
231
  app: keyof import("@bridge-ds/core").PreviewApps;
188
232
  label: string;
@@ -325,8 +369,9 @@ export declare function listComments(ctx: BridgeContext, a: {
325
369
  }>;
326
370
  /**
327
371
  * Merge, through the same gate as Studio's Merge button (tests, approvals for the tier, who may ship, conflicts,
328
- * drafts and explorations). With `overrideReason`, the owner override: only missing approvals are skipped, the reason is
329
- * posted on the branch first, and only people in governance.override.allowed may use it.
372
+ * drafts and explorations; core branchVerdict). With `overrideReason`, the owner override: only missing approvals are
373
+ * skipped, the reason (always required, at least `minReasonLength` characters, 20 by default) is posted on the branch
374
+ * first, and only the owners governance.override.allowed names may use it.
330
375
  */
331
376
  export declare function mergeBranch(ctx: BridgeContext, a: {
332
377
  pr: number | string;
@@ -336,6 +381,22 @@ export declare function mergeBranch(ctx: BridgeContext, a: {
336
381
  pr: number;
337
382
  status: "would-merge";
338
383
  said: string;
384
+ note: string;
385
+ blockedBy?: undefined;
386
+ skips?: undefined;
387
+ } | {
388
+ pr: number;
389
+ status: "blocked";
390
+ blockedBy: string[];
391
+ said: string;
392
+ note: string;
393
+ skips?: undefined;
394
+ } | {
395
+ pr: number;
396
+ status: "would-merge";
397
+ said: string;
398
+ note?: undefined;
399
+ blockedBy?: undefined;
339
400
  skips?: undefined;
340
401
  } | {
341
402
  warnings?: string[] | undefined;
@@ -343,12 +404,23 @@ export declare function mergeBranch(ctx: BridgeContext, a: {
343
404
  status: "merged";
344
405
  sha: string;
345
406
  said: string;
407
+ note?: undefined;
408
+ blockedBy?: undefined;
409
+ skips?: undefined;
410
+ } | {
411
+ pr: number;
412
+ status: "blocked";
413
+ blockedBy: string[];
414
+ said: string;
415
+ note?: undefined;
346
416
  skips?: undefined;
347
417
  } | {
348
418
  pr: number;
349
419
  status: "would-override";
350
420
  skips: import("@bridge-ds/core").MissingApproval[];
351
421
  said: string;
422
+ note?: undefined;
423
+ blockedBy?: undefined;
352
424
  } | {
353
425
  warnings?: string[] | undefined;
354
426
  pr: number;
@@ -357,6 +429,8 @@ export declare function mergeBranch(ctx: BridgeContext, a: {
357
429
  sha: string;
358
430
  reasonUrl: string;
359
431
  said: string;
432
+ note?: undefined;
433
+ blockedBy?: undefined;
360
434
  skips?: undefined;
361
435
  }>;
362
436
  /** Close without merging (Studio More menu). The work stays on GitHub and the branch can be reopened. */
@@ -439,6 +513,7 @@ export declare function addableBranch(ctx: BridgeContext, n: number): Promise<{
439
513
  body: string;
440
514
  mergeable: boolean | null;
441
515
  requestedReviewers: string[];
516
+ autoMerge: boolean;
442
517
  };
443
518
  viewer: string;
444
519
  comment: (paths: string[]) => string;
@@ -0,0 +1,96 @@
1
+ import { type BuildFilter } from '@bridge-ds/core';
2
+ import type { BridgeContext } from './context.js';
3
+ export declare const BUILD_FILTERS: BuildFilter[];
4
+ export declare function listBuildRequests(ctx: BridgeContext, a?: {
5
+ filter?: BuildFilter | undefined;
6
+ component?: string | undefined;
7
+ limit?: number | undefined;
8
+ }): Promise<{
9
+ repo: string;
10
+ filter: BuildFilter;
11
+ summary: string;
12
+ total: number;
13
+ buildRequests: {
14
+ figma?: string | undefined;
15
+ jira?: string | undefined;
16
+ pull?: {
17
+ number: number;
18
+ url?: string | undefined;
19
+ state: string;
20
+ } | undefined;
21
+ url: string;
22
+ shippedAt?: string | undefined;
23
+ number: number;
24
+ kind: "issue" | "library branch";
25
+ component: string;
26
+ title: string;
27
+ status: import("@bridge-ds/core").BuildStatus;
28
+ statusLabel: string;
29
+ said: string;
30
+ builders: string[];
31
+ ageDays: number;
32
+ stale: boolean;
33
+ }[];
34
+ }>;
35
+ /**
36
+ * One build request, ready to build: what was sent (the request, before and after images, props needed, the spec when
37
+ * the issue keeps it), the status timeline, the linked pull request, the Jira key and `brief`, the prompt for Claude.
38
+ * A library branch from Figma waiting for a developer (direct mode) gives the spec and brief of that branch.
39
+ */
40
+ export declare function getBuildRequest(ctx: BridgeContext, a: {
41
+ number: number;
42
+ }): Promise<{
43
+ brief: string | null;
44
+ next: string;
45
+ spec?: (import("@bridge-ds/core").ComponentPushDiff & {
46
+ tokenEdits?: import("@bridge-ds/core").TokenEdit[];
47
+ reasons?: string[];
48
+ }) | undefined;
49
+ figma?: string | undefined;
50
+ jira?: string | undefined;
51
+ pull?: {
52
+ number: number;
53
+ url?: string | undefined;
54
+ state: string;
55
+ } | undefined;
56
+ url: string;
57
+ status: import("@bridge-ds/core").BuildStatus;
58
+ label: string;
59
+ said: string;
60
+ builders: string[];
61
+ ageDays: number;
62
+ stale: boolean;
63
+ timeline: import("@bridge-ds/core").BuildStatusEvent[];
64
+ number: number;
65
+ kind: "library branch";
66
+ component: string;
67
+ title: string;
68
+ } | {
69
+ componentFiles: string[];
70
+ agentsFile: string;
71
+ brief: string;
72
+ next: string;
73
+ spec?: {} | null | undefined;
74
+ request: import("@bridge-ds/core").ComponentChangeRequest & {
75
+ build: import("@bridge-ds/core").BuildRequestExtra;
76
+ };
77
+ figma?: string | undefined;
78
+ jira?: string | undefined;
79
+ pull?: {
80
+ number: number;
81
+ url?: string | undefined;
82
+ state: string;
83
+ } | undefined;
84
+ url: string;
85
+ status: import("@bridge-ds/core").BuildStatus;
86
+ label: string;
87
+ said: string;
88
+ builders: string[];
89
+ ageDays: number;
90
+ stale: boolean;
91
+ timeline: import("@bridge-ds/core").BuildStatusEvent[];
92
+ number: number;
93
+ kind: "issue";
94
+ component: string;
95
+ title: string;
96
+ }>;