@bridge-ds/core 0.13.0 → 0.16.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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { m as modeDisplayName, b as modesOf$1, i as isMultiMode, T as TIER_NAMES, c as TIER_AXIS, d as collectRefs, f as findReferenceProblems, e as evaluatePairs, g as contrastScope, h as contextLabel, S as SINGLE_MODE, j as isAlias, k as aliasTarget, l as pathId, v as valuesEqual, n as flattenTokens, s as serializeTokenFile, r as removeToken, u as upsertToken, o as threeWayDiff, q as emptyTokenFile, w as parseTokenFile, E as EXT_ID, x as EXT_SCOPES, y as parseColor, z as rgbaToHex, A as formatValue, B as resolve, C as moveToken, D as effectiveScopes, F as sameScopes, G as defaultScopes, H as readTokenAt, I as modeFile, J as defaultFile, K as selectTokenFiles, L as LayeredTokenSet, M as resolveBranchPreviews, N as loadConfig, O as tokensPath, P as toConfigJson, Q as validateLayered, R as parseContrastChecks, U as classifyRisk, V as CONFIG_FILE, W as RISK_LABELS, X as previewLinks, Y as findPreviewComment, Z as previewsSettled, _ as DEFAULT_TOKEN_PATHS, $ as layoutOptions, a0 as buildTokenSet, a1 as readPreviewComment, a2 as linkStatus, a3 as libraryPreviewState, a4 as parsePiecesRecord, a5 as libraryBranchPlan, a6 as NEEDED_BY_LABEL, a7 as withNeededBy, a8 as withLink, a9 as withPiecesRecord, aa as productBranchSentence, ab as mergePiecesRecord, ac as productOfBranch, ad as defaultProduct, ae as slugify } from "./prod-branch-6ftQWwdu.js";
2
- import { af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, p, bM, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, a, bX, bY, bZ, b_, b$, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, t, ck, cl, cm, cn, co, cp, cq, cr } from "./prod-branch-6ftQWwdu.js";
3
- import { G as GitHubError, c as collectHistory, p as packageDirCandidates, a as parseChangelog, r as releasesFromTags, m as mergeReleases, b as buildReport, d as applyTokenEdits, e as buildHistoryEntry, f as coerceValue, g as checkLayeredPair, h as formatChangeset, P as PROSE_KEYS, i as markClaudeDraft, j as cleanDraftText, k as docsPrompt, D as DRAFT_LINE_MAX, R as REQUESTS_BRANCH, l as REQUEST_KINDS, s as sanitizeDraftLine, n as parseExplorationBody, E as EXPLORATION_PREFIX, o as explorationSlug, q as explorationStatus, t as explorationTryIt, u as isExplorationPull, v as promotionPlan, w as EXPLORATION_LABEL, x as explorationProblems, y as explorationNote, z as explorationNotePath, A as explorationPrTitle, B as explorationPrBody, C as variantKeyOf, F as overrideComment, O as OVERRIDE_HEADING, H as overrideRefusedComment, I as suggestionStateFromLabels, J as suggestionStatus, K as composeRequestIssue, L as EXPLORATION_NOTES_DIR, M as isExplorationBranch, N as diffLayered, Q as contrastDelta, S as runLayeredContrast, T as layeredImpact, U as classifyLayered, V as composeProposalBody, W as createSuggestionOnGitHub, X as gitBlobSha, Y as SUGGESTION_SCHEMA, Z as branchWithJiraKey, _ as titleWithJiraKey, $ as figmaSpecPath, a0 as formatFigmaSpec, a1 as figmaDraftBrief, a2 as parseFigmaOrigin, a3 as figmaPushStatus, a4 as parseFigmaSpec, a5 as FIGMA_SPEC_DIR, a6 as FROM_FIGMA_LABEL, a7 as withFigmaOrigin, a8 as WAITING_FOR_CLAUDE_LABEL, a9 as DRAFTED_BY_CLAUDE_LABEL, aa as planComponentPush, ab as figmaOriginSection, ac as figmaBranchTitle, ad as figmaSpecSlug, ae as figmaDraftBody, af as REQUEST_LABEL, ag as figmaNodeUrl } from "./suggestion-apply-bH6-gZrE.js";
4
- import { ah as ah2, ai as ai2, aj as aj2, ak as ak2, al as al2, am as am2, an as an2, ao as ao2, ap as ap2, aq as aq2, ar as ar2, as as as2, at as at2, au as au2, av as av2, aw as aw2, ax as ax2, ay as ay2, az as az2, aA as aA2, aB as aB2, aC as aC2, aD as aD2, aE as aE2, aF as aF2, aG as aG2, aH as aH2, aI as aI2, aJ as aJ2, aK as aK2, aL as aL2, aM as aM2, aN as aN2, aO as aO2, aP as aP2, aQ as aQ2, aR as aR2, aS as aS2, aT as aT2, aU as aU2, aV as aV2, aW as aW2, aX as aX2, aY as aY2, aZ as aZ2, a_ as a_2, a$ as a$2, b0 as b02, b1 as b12, b2 as b22, b3 as b32, b4 as b42, b5 as b52, b6 as b62, b7 as b72, b8 as b82, b9 as b92, ba as ba2, bb as bb2, bc as bc2, bd as bd2, be as be2, bf as bf2, bg as bg2, bh as bh2, bi as bi2, bj as bj2, bk as bk2, bl as bl2, bm as bm2, bn as bn2, bo as bo2, bp as bp2, bq as bq2, br as br2, bs as bs2, bt as bt2, bu as bu2, bv as bv2, bw as bw2, bx as bx2, by as by2, bz as bz2, bA as bA2, bB as bB2, bC as bC2, bD as bD2, bE as bE2, bF as bF2, bG as bG2, bH as bH2, bI as bI2, bJ as bJ2, bK as bK2, bL as bL2, bM as bM2, bN as bN2, bO as bO2, bP as bP2, bQ as bQ2, bR as bR2, bS as bS2, bT as bT2, bU as bU2, bV as bV2, bW as bW2, bX as bX2, bY as bY2, bZ as bZ2, b_ as b_2, b$ as b$2, c0 as c02, c1 as c12, c2 as c22, c3 as c32, c4 as c42, c5 as c52, c6 as c62, c7 as c72, c8 as c82, c9 as c92, ca as ca2, cb as cb2, cc as cc2, cd as cd2, ce as ce2, cf as cf2, cg as cg2, ch as ch2, ci as ci2, cj as cj2, ck as ck2, cl as cl2, cm as cm2, cn as cn2, co as co2, cp as cp2, cq as cq2, cr as cr2, cs, ct, cu, cv, cw, cx, cy, cz, cA, cB, cC, cD, cE, cF, cG, cH, cI, cJ, cK, cL, cM, cN, cO, cP, cQ, cR, cS, cT, cU, cV, cW, cX, cY, cZ, c_, c$, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, da, db, dc, dd, de, df, dg, dh } from "./suggestion-apply-bH6-gZrE.js";
1
+ import { m as modeDisplayName, b as modesOf$1, i as isMultiMode, T as TIER_NAMES, c as TIER_AXIS, d as collectRefs, f as findReferenceProblems, e as evaluatePairs, g as contrastScope, h as contextLabel, S as SINGLE_MODE, j as isAlias$1, k as aliasTarget, l as pathId, v as valuesEqual, n as flattenTokens, s as serializeTokenFile, r as removeToken, u as upsertToken, o as threeWayDiff, q as emptyTokenFile, w as parseTokenFile, E as EXT_ID, x as EXT_SCOPES, y as parseColor, z as rgbaToHex, A as formatValue, B as resolve, C as moveToken, D as effectiveScopes, F as sameScopes, G as defaultScopes, H as readTokenAt, I as modeFile, J as defaultFile, K as selectTokenFiles, L as LayeredTokenSet, M as resolveBranchPreviews, N as loadConfig, O as tokensPath, P as toConfigJson, Q as validateLayered, R as parseContrastChecks, U as classifyRisk, V as CONFIG_FILE, W as RISK_LABELS, X as previewLinks, Y as findPreviewComment, Z as previewsSettled, _ as DEFAULT_TOKEN_PATHS, $ as layoutOptions, a0 as buildTokenSet, a1 as readPreviewComment, a2 as linkStatus, a3 as libraryPreviewState, a4 as parsePiecesRecord, a5 as libraryBranchPlan, a6 as NEEDED_BY_LABEL, a7 as withNeededBy, a8 as withLink, a9 as withPiecesRecord, aa as productBranchSentence, ab as mergePiecesRecord, ac as productOfBranch, ad as defaultProduct, ae as slugify, af as defineConfig, ag as globToRegExp, ah as ConfigError, ai as DEFAULT_CHANGES_MODE, aj as DEFAULT_OVERRIDE, ak as DEFAULT_PRODUCTS } from "./prod-branch-CSM0c2OF.js";
2
+ import { al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, p, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, a, bY, bZ, b_, b$, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, t, cl, cm, cn, co, cp, cq, cr, cs } from "./prod-branch-CSM0c2OF.js";
3
+ import { G as GitHubError, c as collectHistory, p as packageDirCandidates, a as parseChangelog, r as releasesFromTags, m as mergeReleases, b as buildReport, d as applyTokenEdits, e as buildHistoryEntry, f as coerceValue, g as checkLayeredPair, h as formatChangeset, P as PROSE_KEYS, i as markClaudeDraft, j as cleanDraftText, k as docsPrompt, D as DRAFT_LINE_MAX, R as REQUESTS_BRANCH, l as REQUEST_KINDS, s as sanitizeDraftLine, n as parseExplorationBody, E as EXPLORATION_PREFIX, o as explorationSlug, q as explorationStatus, t as explorationTryIt, u as isExplorationPull, v as promotionPlan, w as EXPLORATION_LABEL, x as explorationProblems, y as explorationNote, z as explorationNotePath, A as explorationPrTitle, B as explorationPrBody, C as variantKeyOf, F as overrideComment, O as OVERRIDE_HEADING, H as overrideRefusedComment, I as suggestionStateFromLabels, J as suggestionStatus, K as composeRequestIssue, L as EXPLORATION_NOTES_DIR, M as isExplorationBranch, N as diffLayered, Q as contrastDelta, S as runLayeredContrast, T as layeredImpact, U as classifyLayered, V as composeProposalBody, W as createSuggestionOnGitHub, X as gitBlobSha, Y as SUGGESTION_SCHEMA, Z as branchWithJiraKey, _ as titleWithJiraKey, $ as figmaSpecPath, a0 as formatFigmaSpec, a1 as figmaDraftBrief, a2 as parseFigmaOrigin, a3 as figmaPushStatus, a4 as parseFigmaSpec, a5 as FIGMA_SPEC_DIR, a6 as FROM_FIGMA_LABEL, a7 as withFigmaOrigin, a8 as WAITING_FOR_CLAUDE_LABEL, a9 as DRAFTED_BY_CLAUDE_LABEL, aa as planComponentPush, ab as figmaOriginSection, ac as figmaBranchTitle, ad as figmaSpecSlug, ae as figmaDraftBody, af as REQUEST_LABEL, ag as figmaNodeUrl, ah as parentDir, ai as parseComponentSpecs, aj as readRepoTexts, ak as normalizeRepoPath, al as isUnder } from "./repo-source-73kARDJv.js";
4
+ import { am as am2, an as an2, ao as ao2, ap as ap2, aq as aq2, ar as ar2, as as as2, at as at2, au as au2, av as av2, aw as aw2, ax as ax2, ay as ay2, az as az2, aA as aA2, aB as aB2, aC as aC2, aD as aD2, aE as aE2, aF as aF2, aG as aG2, aH as aH2, aI as aI2, aJ as aJ2, aK as aK2, aL as aL2, aM as aM2, aN as aN2, aO as aO2, aP as aP2, aQ as aQ2, aR as aR2, aS as aS2, aT as aT2, aU as aU2, aV as aV2, aW as aW2, aX as aX2, aY as aY2, aZ as aZ2, a_ as a_2, a$ as a$2, b0 as b02, b1 as b12, b2 as b22, b3 as b32, b4 as b42, b5 as b52, b6 as b62, b7 as b72, b8 as b82, b9 as b92, ba as ba2, bb as bb2, bc as bc2, bd as bd2, be as be2, bf as bf2, bg as bg2, bh as bh2, bi as bi2, bj as bj2, bk as bk2, bl as bl2, bm as bm2, bn as bn2, bo as bo2, bp as bp2, bq as bq2, br as br2, bs as bs2, bt as bt2, bu as bu2, bv as bv2, bw as bw2, bx as bx2, by as by2, bz as bz2, bA as bA2, bB as bB2, bC as bC2, bD as bD2, bE as bE2, bF as bF2, bG as bG2, bH as bH2, bI as bI2, bJ as bJ2, bK as bK2, bL as bL2, bM as bM2, bN as bN2, bO as bO2, bP as bP2, bQ as bQ2, bR as bR2, bS as bS2, bT as bT2, bU as bU2, bV as bV2, bW as bW2, bX as bX2, bY as bY2, bZ as bZ2, b_ as b_2, b$ as b$2, c0 as c02, c1 as c12, c2 as c22, c3 as c32, c4 as c42, c5 as c52, c6 as c62, c7 as c72, c8 as c82, c9 as c92, ca as ca2, cb as cb2, cc as cc2, cd as cd2, ce as ce2, cf as cf2, cg as cg2, ch as ch2, ci as ci2, cj as cj2, ck as ck2, cl as cl2, cm as cm2, cn as cn2, co as co2, cp as cp2, cq as cq2, cr as cr2, cs as cs2, ct, cu, cv, cw, cx, cy, cz, cA, cB, cC, cD, cE, cF, cG, cH, cI, cJ, cK, cL, cM, cN, cO, cP, cQ, cR, cS, cT, cU, cV, cW, cX, cY, cZ, c_, c$, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, da, db, dc, dd, de, df, dg, dh, di, dj, dk, dl, dm, dn, dp, dq, dr, ds, dt } from "./repo-source-73kARDJv.js";
5
5
  const issueKey$1 = (i) => `${i.code}|${i.path ?? ""}|${i.mode ?? ""}|${i.code === "file-problem" ? i.message : ""}`;
6
6
  const modeName = (mode) => mode === SINGLE_MODE ? "all modes" : modeDisplayName(mode);
7
7
  const isPalette = (t2) => t2.tier === "brand" && t2.path.startsWith("palette.");
@@ -27,7 +27,7 @@ function aliasRule(owner, target) {
27
27
  }
28
28
  const MUST_ALIAS = ["brand", "semantic", "density", "component"];
29
29
  function checkValue(set, owner, value, mode, where, issues) {
30
- if (!isAlias(value)) {
30
+ if (!isAlias$1(value)) {
31
31
  if (MUST_ALIAS.includes(owner.tier) && value !== void 0) {
32
32
  issues.push({
33
33
  code: "raw-value",
@@ -1112,7 +1112,7 @@ const RADIUS_ROLES = ["inset", "control", "container", "overlay"];
1112
1112
  const RESERVED = /* @__PURE__ */ new Set(["default", "base", "all", "none", "new", "blank", "primitives", "semantic", "components", "density"]);
1113
1113
  const BRAND_SLUG_RE = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
1114
1114
  const DEFAULT_PRIMARY_CHROMA = 0.14;
1115
- const isObj$1 = (x) => !!x && typeof x === "object" && !Array.isArray(x);
1115
+ const isObj$2 = (x) => !!x && typeof x === "object" && !Array.isArray(x);
1116
1116
  const fileMap = (f) => f instanceof Map ? new Map(f) : new Map(Object.entries(f));
1117
1117
  const brandDisplayName = (slug) => slug.split("-").filter(Boolean).map((w) => w[0].toUpperCase() + w.slice(1)).join(" ");
1118
1118
  function brandLayers(config) {
@@ -1133,27 +1133,27 @@ function setAt(doc, path, node) {
1133
1133
  const keys = path.split(".");
1134
1134
  let cur = doc;
1135
1135
  for (const k of keys.slice(0, -1)) {
1136
- if (!isObj$1(cur[k])) cur[k] = {};
1136
+ if (!isObj$2(cur[k])) cur[k] = {};
1137
1137
  cur = cur[k];
1138
1138
  }
1139
1139
  const last = keys[keys.length - 1];
1140
- const prev = isObj$1(cur[last]) ? cur[last] : {};
1140
+ const prev = isObj$2(cur[last]) ? cur[last] : {};
1141
1141
  cur[last] = { ...prev, ...node };
1142
1142
  }
1143
1143
  function getAt(doc, path) {
1144
1144
  let cur = doc;
1145
- for (const k of path.split(".")) cur = isObj$1(cur) ? cur[k] : void 0;
1146
- return isObj$1(cur) ? cur : void 0;
1145
+ for (const k of path.split(".")) cur = isObj$2(cur) ? cur[k] : void 0;
1146
+ return isObj$2(cur) ? cur : void 0;
1147
1147
  }
1148
1148
  function typeAt(doc, path) {
1149
1149
  let cur = doc;
1150
1150
  let type;
1151
1151
  for (const k of path.split(".")) {
1152
- if (!isObj$1(cur)) return type;
1152
+ if (!isObj$2(cur)) return type;
1153
1153
  if (typeof cur.$type === "string") type = cur.$type;
1154
1154
  cur = cur[k];
1155
1155
  }
1156
- return isObj$1(cur) && typeof cur.$type === "string" ? cur.$type : type;
1156
+ return isObj$2(cur) && typeof cur.$type === "string" ? cur.$type : type;
1157
1157
  }
1158
1158
  function rampFor(input, pinStep, kind) {
1159
1159
  if (typeof input === "number" || typeof input === "string" && /^\d+(\.\d+)?$/.test(input.trim())) {
@@ -1210,7 +1210,7 @@ function listBrands(source) {
1210
1210
  doc = JSON.parse(files.get(file) ?? "{}");
1211
1211
  } catch {
1212
1212
  }
1213
- const meta = isObj$1(doc.$extensions) && isObj$1(doc.$extensions["dev.bridge.brand"]) ? doc.$extensions["dev.bridge.brand"] : {};
1213
+ const meta = isObj$2(doc.$extensions) && isObj$2(doc.$extensions["dev.bridge.brand"]) ? doc.$extensions["dev.bridge.brand"] : {};
1214
1214
  const combo = set.normalizeCombo({ brand: slug });
1215
1215
  const primary = set.resolve("color.action.primary.bg", combo);
1216
1216
  const overrides = layers.override ? (config.axes[layers.overrideAxis]?.values ?? []).map((v) => fill(layers.override, { brand: slug, [layers.overrideAxis]: v })).filter((f) => files.has(f)) : [];
@@ -1300,7 +1300,7 @@ function planNewBrand(source, input) {
1300
1300
  for (const [path, defs] of before.view(before.defaultCombo)) {
1301
1301
  const m = /^radius\.([\w-]+)$/.exec(path);
1302
1302
  const v = defs[defs.length - 1].value;
1303
- if (m && isObj$1(v) && typeof v.value === "number" && v.unit === "px" && !getAt(doc, path)) scale.set(v.value, m[1]);
1303
+ if (m && isObj$2(v) && typeof v.value === "number" && v.unit === "px" && !getAt(doc, path)) scale.set(v.value, m[1]);
1304
1304
  }
1305
1305
  const radius = input.radius ?? (blank ? RADIUS_PRESETS[0].radius : void 0);
1306
1306
  if (radius) {
@@ -1339,9 +1339,9 @@ function planNewBrand(source, input) {
1339
1339
  }
1340
1340
  const palette = getAt(doc, "palette");
1341
1341
  for (const [role, group] of Object.entries(palette ?? {})) {
1342
- if (role.startsWith("$") || !isObj$1(group)) continue;
1342
+ if (role.startsWith("$") || !isObj$2(group)) continue;
1343
1343
  for (const [step, node] of Object.entries(group)) {
1344
- if (step.startsWith("$") || !isObj$1(node) || !("$value" in node) || typeof node.$value === "string") continue;
1344
+ if (step.startsWith("$") || !isObj$2(node) || !("$value" in node) || typeof node.$value === "string") continue;
1345
1345
  const ramp = `${slug}-${role}`;
1346
1346
  const entry = prims.get(ramp) ?? { description: `${name} ${role}. Exact values set when the brand was created.`, steps: /* @__PURE__ */ new Map() };
1347
1347
  entry.steps.set(Number(step), node.$value);
@@ -1354,7 +1354,7 @@ function planNewBrand(source, input) {
1354
1354
  if (prims.size && files.has(primFile)) issues.push({ level: "error", code: "slug-file-exists", message: `${tokensPath(config, primFile)} already exists. Pick another name.` });
1355
1355
  for (const r of prims.keys()) if (before.allPaths().some((p2) => p2.startsWith(`color.${r}.`))) issues.push({ level: "error", code: "ramp-exists", message: `A primitive ramp color.${r} already exists. Pick another name.` });
1356
1356
  doc.$description = `${name}: created with Bridge, started from ${blank ? "a blank brand" : brandDisplayName(from)}.`;
1357
- doc.$extensions = { ...isObj$1(doc.$extensions) ? doc.$extensions : {}, "dev.bridge.brand": { name, from, ...Object.keys(anchors).length ? { anchors } : {} } };
1357
+ doc.$extensions = { ...isObj$2(doc.$extensions) ? doc.$extensions : {}, "dev.bridge.brand": { name, from, ...Object.keys(anchors).length ? { anchors } : {} } };
1358
1358
  const { $description, $extensions, ...rest } = doc;
1359
1359
  const brandFile = fill(layers.brand, { brand: slug });
1360
1360
  const nextFiles = new Map(files);
@@ -1429,10 +1429,10 @@ function planNewBrand(source, input) {
1429
1429
  ...created.map((f) => ({ path: tokensPath(config, f), action: "create", content: nextFiles.get(f) })),
1430
1430
  { path: CONFIG_FILE, action: "modify", content: configText }
1431
1431
  ];
1432
- const cs2 = config.changesets ?? (config.changeset ? { dir: ".changeset", package: config.changeset.package } : void 0);
1433
- const changeset = cs2 ? {
1434
- path: `${cs2.dir}/bridge-brand-${slug}.md`,
1435
- content: formatChangeset(cs2.package, "minor", `Add the ${name} brand (\`${slug}\`), started from ${blank ? "a blank brand" : brandDisplayName(from)}.`, `- ${created.map((f) => `\`${tokensPath(config, f)}\``).join("\n- ")}
1432
+ const cs3 = config.changesets ?? (config.changeset ? { dir: ".changeset", package: config.changeset.package } : void 0);
1433
+ const changeset = cs3 ? {
1434
+ path: `${cs3.dir}/bridge-brand-${slug}.md`,
1435
+ content: formatChangeset(cs3.package, "minor", `Add the ${name} brand (\`${slug}\`), started from ${blank ? "a blank brand" : brandDisplayName(from)}.`, `- ${created.map((f) => `\`${tokensPath(config, f)}\``).join("\n- ")}
1436
1436
  - \`${CONFIG_FILE}\`: modes.brand gains "${slug}", so the token build and the contrast gate cover it.`)
1437
1437
  } : void 0;
1438
1438
  if (changeset) planned.push({ path: changeset.path, action: "create", content: changeset.content });
@@ -1885,9 +1885,9 @@ function sanitizeResultLines(item, raw) {
1885
1885
  for (const l of raw) {
1886
1886
  const id = typeof l?.id === "string" ? l.id : "";
1887
1887
  if (!known.has(id)) throw new Error(`Item "${item.id}" has no change line "${id}".${known.size ? ` Use the line ids from bridge_pending_drafts: ${[...known].join(", ")}.` : " It lists no lines: leave lines out."}`);
1888
- const line = sanitizeDraftLine(l.line);
1888
+ const line2 = sanitizeDraftLine(l.line);
1889
1889
  const title = sanitizeDraftTitle(l.title);
1890
- if (line || title) out.set(id, { id, line, ...title ? { title } : {} });
1890
+ if (line2 || title) out.set(id, { id, line: line2, ...title ? { title } : {} });
1891
1891
  }
1892
1892
  return [...out.values()];
1893
1893
  }
@@ -2215,12 +2215,12 @@ function rgbAt(img, x, y) {
2215
2215
  return [255 + (img.data[i] - 255) * a2, 255 + (img.data[i + 1] - 255) * a2, 255 + (img.data[i + 2] - 255) * a2];
2216
2216
  }
2217
2217
  function colorDelta(a2, b) {
2218
- const dr = a2[0] - b[0];
2218
+ const dr2 = a2[0] - b[0];
2219
2219
  const dg2 = a2[1] - b[1];
2220
2220
  const db2 = a2[2] - b[2];
2221
- const y = dr * 0.29889531 + dg2 * 0.58662247 + db2 * 0.11448223;
2222
- const i = dr * 0.59597799 - dg2 * 0.2741761 - db2 * 0.32180189;
2223
- const q = dr * 0.21147017 - dg2 * 0.52261711 + db2 * 0.31114694;
2221
+ const y = dr2 * 0.29889531 + dg2 * 0.58662247 + db2 * 0.11448223;
2222
+ const i = dr2 * 0.59597799 - dg2 * 0.2741761 - db2 * 0.32180189;
2223
+ const q = dr2 * 0.21147017 - dg2 * 0.52261711 + db2 * 0.31114694;
2224
2224
  return 0.5053 * y * y + 0.299 * i * i + 0.1957 * q * q;
2225
2225
  }
2226
2226
  function foundNear(img, x, y, c, radius, max) {
@@ -2762,6 +2762,7 @@ function productPreview(apps, ctx, sources) {
2762
2762
  }
2763
2763
  function tryInProductUrl(preview, pr, screen) {
2764
2764
  const url = new URL(preview);
2765
+ if (url.protocol !== "https:" && url.protocol !== "http:") return "";
2765
2766
  url.pathname = "/";
2766
2767
  url.search = "";
2767
2768
  url.searchParams.set("bridge", String(pr));
@@ -3220,15 +3221,15 @@ class StorybookIndexError extends Error {
3220
3221
  code;
3221
3222
  status;
3222
3223
  }
3223
- const isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
3224
+ const isObj$1 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
3224
3225
  const str = (v) => typeof v === "string" && v.trim() ? v : void 0;
3225
3226
  function entryFrom(key, raw, v3) {
3226
- if (!isObj(raw)) return null;
3227
+ if (!isObj$1(raw)) return null;
3227
3228
  const id = str(raw.id) ?? key;
3228
3229
  const title = str(raw.title) ?? str(raw.kind);
3229
3230
  const name = str(raw.name) ?? str(raw.story);
3230
3231
  if (!id || !title || !name) return null;
3231
- const params = isObj(raw.parameters) ? raw.parameters : {};
3232
+ const params = isObj$1(raw.parameters) ? raw.parameters : {};
3232
3233
  const type = raw.type === "docs" || raw.type === "story" ? raw.type : v3 && params.docsOnly === true ? "docs" : "story";
3233
3234
  const e = {
3234
3235
  id,
@@ -3264,13 +3265,13 @@ function groupStorybookComponents(entries) {
3264
3265
  return out.sort((a2, b) => a2.title.localeCompare(b.title));
3265
3266
  }
3266
3267
  function parseStorybookIndex(json, source) {
3267
- if (!isObj(json)) throw new StorybookIndexError("not-json", "The Storybook index is not a JSON object.");
3268
+ if (!isObj$1(json)) throw new StorybookIndexError("not-json", "The Storybook index is not a JSON object.");
3268
3269
  if (typeof json.loginUrl === "string" && !("entries" in json) && !("stories" in json)) {
3269
3270
  throw new StorybookIndexError("private", "This Storybook is private: it asks for a sign-in before showing its index.");
3270
3271
  }
3271
- const map = isObj(json.entries) ? json.entries : isObj(json.stories) ? json.stories : null;
3272
+ const map = isObj$1(json.entries) ? json.entries : isObj$1(json.stories) ? json.stories : null;
3272
3273
  if (!map) throw new StorybookIndexError("empty", "This file has no Storybook entries.");
3273
- const v3 = !isObj(json.entries);
3274
+ const v3 = !isObj$1(json.entries);
3274
3275
  const entries = Object.entries(map).map(([k, raw]) => entryFrom(k, raw, v3)).filter((e) => e !== null);
3275
3276
  if (!entries.length) throw new StorybookIndexError("empty", "This Storybook index lists no stories or docs.");
3276
3277
  const version = typeof json.v === "number" ? json.v : v3 ? 3 : 4;
@@ -3353,40 +3354,1069 @@ async function fetchStorybookIndex(base, o = {}) {
3353
3354
  }
3354
3355
  throw worst ?? new StorybookIndexError("not-found", `No Storybook index at ${base}.`);
3355
3356
  }
3357
+ const FALLBACK_BRANDS = ["bridge", "ocean"];
3358
+ const FALLBACK_THEMES = ["light", "dark"];
3359
+ const FALLBACK_DENSITIES = ["comfortable", "compact"];
3360
+ function tokenRowAxes(config, readText = () => void 0) {
3361
+ const brandAxis = config.axes.brand;
3362
+ const brands = brandAxis?.values.length ? [...brandAxis.values] : [...FALLBACK_BRANDS];
3363
+ const defaultBrand = brandAxis?.default ?? brands[0];
3364
+ const themes = config.modes.themes.length ? [...config.modes.themes] : [...FALLBACK_THEMES];
3365
+ const densities = config.modes.densities.length ? [...config.modes.densities] : [...FALLBACK_DENSITIES];
3366
+ const files = tokenRowFiles(config);
3367
+ const brandName = (b) => {
3368
+ try {
3369
+ const text = readText(files.brandFile(b));
3370
+ const name = text ? JSON.parse(text).$extensions?.["dev.bridge.brand"]?.name : void 0;
3371
+ if (typeof name === "string" && name) return name;
3372
+ } catch {
3373
+ }
3374
+ return b.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
3375
+ };
3376
+ return {
3377
+ brands,
3378
+ defaultBrand,
3379
+ brandLabels: Object.fromEntries(brands.map((b) => [b, brandName(b)])),
3380
+ themes,
3381
+ densities,
3382
+ defaultDensity: config.modes.defaults.density ?? densities[0]
3383
+ };
3384
+ }
3385
+ function tokenRowFiles(config) {
3386
+ const t2 = config.tokens;
3387
+ const at3 = (rel) => tokensPath(config, rel);
3388
+ return {
3389
+ primitivesDir: at3(t2.primitives),
3390
+ semanticDir: at3(t2.semantic),
3391
+ brandsDir: at3(t2.brands),
3392
+ densityDir: at3(t2.density),
3393
+ componentsDir: at3(t2.components),
3394
+ baseFile: at3(`${t2.semantic}/${t2.base}.tokens.json`),
3395
+ semanticFile: (theme) => at3(`${t2.semantic}/${theme}.tokens.json`),
3396
+ brandFile: (brand) => at3(`${t2.brands}/${brand}.tokens.json`),
3397
+ overrideFile: (brand, theme) => at3(`${t2.brands}/${brand}.${theme}.tokens.json`),
3398
+ densityFile: (density) => at3(`${t2.density}/${density}.tokens.json`)
3399
+ };
3400
+ }
3401
+ function flattenTokenFile(node, file, path = [], inheritedType = "") {
3402
+ const type = node.$type ?? inheritedType;
3403
+ if ("$value" in node) {
3404
+ return [
3405
+ {
3406
+ path,
3407
+ type,
3408
+ value: node.$value,
3409
+ description: node.$description,
3410
+ deprecated: node.$deprecated,
3411
+ file
3412
+ }
3413
+ ];
3414
+ }
3415
+ const out = [];
3416
+ for (const [key, child] of Object.entries(node)) {
3417
+ if (key.startsWith("$") || typeof child !== "object" || child === null) continue;
3418
+ out.push(...flattenTokenFile(child, file, [...path, key], type));
3419
+ }
3420
+ return out;
3421
+ }
3422
+ const toHex2 = (n) => Math.round(n * 255).toString(16).padStart(2, "0");
3423
+ function colorCss(c) {
3424
+ if (typeof c === "string") return { css: c, hex: /^#[0-9a-f]{6}$/i.test(c) ? c.toLowerCase() : void 0 };
3425
+ const v = c;
3426
+ const [r = 0, g = 0, b = 0] = v.components;
3427
+ const hex = (v.hex ?? `#${[r, g, b].map(toHex2).join("")}`).toLowerCase();
3428
+ const alpha = v.alpha ?? 1;
3429
+ if (alpha < 1) return { css: `rgb(${[r, g, b].map((x) => Math.round(x * 255)).join(" ")} / ${alpha})`, hex };
3430
+ return { css: hex, hex };
3431
+ }
3432
+ const dimCss = (d) => typeof d === "object" && d !== null ? `${d.value}${d.unit}` : String(d);
3433
+ function shadowCss(s) {
3434
+ if (typeof s === "string") return s;
3435
+ const layers = Array.isArray(s) ? s : [s];
3436
+ return layers.map((l) => [l.inset ? "inset" : "", dimCss(l.offsetX), dimCss(l.offsetY), dimCss(l.blur), dimCss(l.spread), colorCss(l.color).css].filter(Boolean).join(" ")).join(", ");
3437
+ }
3438
+ function tokenValueCss(type, value) {
3439
+ switch (type) {
3440
+ case "color":
3441
+ return colorCss(value);
3442
+ case "dimension":
3443
+ case "duration":
3444
+ return { css: dimCss(value) };
3445
+ case "shadow":
3446
+ return { css: shadowCss(value) };
3447
+ case "cubicBezier":
3448
+ return { css: Array.isArray(value) ? `cubic-bezier(${value.join(", ")})` : String(value) };
3449
+ case "fontFamily":
3450
+ return { css: Array.isArray(value) ? value.map((n) => /\s/.test(n) ? `"${n}"` : n).join(", ") : String(value) };
3451
+ default:
3452
+ return { css: String(value) };
3453
+ }
3454
+ }
3455
+ const tokenRowCssVar = (segments) => `--${segments.join("-")}`;
3456
+ const tokenRowFigmaName = (segments) => segments.join("/");
3457
+ const isAlias = (v) => typeof v === "string" && /^\{[^}]+\}$/.test(v);
3458
+ function buildTokenRows(config, readText, listFiles) {
3459
+ const axes = tokenRowAxes(config, readText);
3460
+ const { brands: BRANDS, defaultBrand: DEFAULT_BRAND, themes: MODES, densities: DENSITIES, defaultDensity: DEFAULT_DENSITY } = axes;
3461
+ const files = tokenRowFiles(config);
3462
+ const REF_THEME = MODES[0];
3463
+ const jsonFiles = (dir) => listFiles(dir).filter((f) => f.endsWith(".tokens.json")).sort();
3464
+ const flatCache = /* @__PURE__ */ new Map();
3465
+ const flatFile = (f) => {
3466
+ if (!flatCache.has(f)) {
3467
+ const text = readText(f);
3468
+ flatCache.set(f, text === void 0 ? [] : flattenTokenFile(JSON.parse(text), f));
3469
+ }
3470
+ return flatCache.get(f);
3471
+ };
3472
+ const byPathOf = (tokens) => new Map(tokens.map((t2) => [t2.path.join("."), t2]));
3473
+ const primitiveFiles = jsonFiles(files.primitivesDir);
3474
+ const componentFiles = jsonFiles(files.componentsDir);
3475
+ const sources = [
3476
+ ...primitiveFiles,
3477
+ ...jsonFiles(files.brandsDir),
3478
+ ...MODES.map(files.semanticFile),
3479
+ files.baseFile,
3480
+ ...jsonFiles(files.densityDir),
3481
+ ...componentFiles
3482
+ ];
3483
+ const primitives = primitiveFiles.flatMap((f) => flatFile(f)).map((t2) => {
3484
+ const { css, hex } = tokenValueCss(t2.type, t2.value);
3485
+ return {
3486
+ path: t2.path.join("."),
3487
+ segments: t2.path,
3488
+ type: t2.type,
3489
+ css,
3490
+ hex,
3491
+ cssVar: tokenRowCssVar(t2.path),
3492
+ figma: tokenRowFigmaName(t2.path),
3493
+ description: t2.description,
3494
+ deprecated: t2.deprecated,
3495
+ raw: t2.value,
3496
+ file: t2.file
3497
+ };
3498
+ });
3499
+ const primByPath = new Map(primitives.map((p2) => [p2.path, p2]));
3500
+ const brandRaw = Object.fromEntries(BRANDS.map((b) => [b, flatFile(files.brandFile(b))]));
3501
+ const themeRaw = Object.fromEntries(MODES.map((m) => [m, flatFile(files.semanticFile(m))]));
3502
+ const baseRaw = flatFile(files.baseFile);
3503
+ const densityRaw = Object.fromEntries(DENSITIES.map((d) => [d, flatFile(files.densityFile(d))]));
3504
+ const componentRaw = componentFiles.flatMap((f) => flatFile(f));
3505
+ const layerCache = /* @__PURE__ */ new Map();
3506
+ const layers = (b, m, d) => {
3507
+ const k = `${b}.${m}.${d}`;
3508
+ if (!layerCache.has(k))
3509
+ layerCache.set(k, [
3510
+ byPathOf(flatFile(files.overrideFile(b, m))),
3511
+ byPathOf(themeRaw[m] ?? []),
3512
+ byPathOf(baseRaw),
3513
+ byPathOf(densityRaw[d] ?? []),
3514
+ byPathOf(componentRaw),
3515
+ byPathOf(brandRaw[b] ?? [])
3516
+ ]);
3517
+ return layerCache.get(k);
3518
+ };
3519
+ const resolve2 = (b, m, d, value, type) => {
3520
+ const chain = [];
3521
+ let current = value;
3522
+ let currentType = type;
3523
+ let guard = 0;
3524
+ while (isAlias(current) && guard++ < 30) {
3525
+ const target = current.slice(1, -1);
3526
+ chain.push(target);
3527
+ const prim = primByPath.get(target);
3528
+ if (prim) return { alias: chain[0] ?? null, chain, css: prim.css, hex: prim.hex };
3529
+ const hit = layers(b, m, d).map((l) => l.get(target)).find(Boolean);
3530
+ if (!hit) throw new Error(`tokens: alias {${target}} does not resolve in ${b} ${m} ${d}`);
3531
+ current = hit.value;
3532
+ currentType = hit.type || currentType;
3533
+ }
3534
+ const { css, hex } = tokenValueCss(currentType, current);
3535
+ return { alias: chain[0] ?? null, chain, css, hex };
3536
+ };
3537
+ const same = (a2, c) => a2.css === c.css && a2.chain.join() === c.chain.join();
3538
+ const build = (t2, tier, valueFor) => {
3539
+ const at3 = (b, m, d = DEFAULT_DENSITY) => {
3540
+ const raw = valueFor(b, m, d) ?? t2;
3541
+ return resolve2(b, m, d, raw.value, raw.type || t2.type);
3542
+ };
3543
+ const brands = Object.fromEntries(BRANDS.map((b) => [b, Object.fromEntries(MODES.map((m) => [m, at3(b, m)]))]));
3544
+ return {
3545
+ path: t2.path.join("."),
3546
+ segments: t2.path,
3547
+ type: t2.type,
3548
+ cssVar: tokenRowCssVar(t2.path),
3549
+ figma: tokenRowFigmaName(t2.path),
3550
+ description: t2.description,
3551
+ group: t2.path[0] === "color" ? t2.path.slice(0, 2).join(".") : t2.path[0],
3552
+ deprecated: t2.deprecated,
3553
+ tier,
3554
+ file: t2.file,
3555
+ modes: brands[DEFAULT_BRAND],
3556
+ brands,
3557
+ densities: tier === "density" ? Object.fromEntries(DENSITIES.map((d) => [d, at3(DEFAULT_BRAND, REF_THEME, d)])) : void 0,
3558
+ brandSpecific: BRANDS.some((b) => MODES.some((m) => !same(brands[b][m], brands[DEFAULT_BRAND][m])))
3559
+ };
3560
+ };
3561
+ const brand = (brandRaw[DEFAULT_BRAND] ?? []).map((t2) => build(t2, "brand", (b) => byPathOf(brandRaw[b] ?? []).get(t2.path.join("."))));
3562
+ const themedBy = Object.fromEntries(MODES.map((m) => [m, byPathOf(themeRaw[m] ?? [])]));
3563
+ const themed = (themeRaw[REF_THEME] ?? []).map((t2) => {
3564
+ const path = t2.path.join(".");
3565
+ const others = MODES.slice(1).map((m) => {
3566
+ const hit = themedBy[m].get(path);
3567
+ if (!hit) throw new Error(`tokens: semantic token ${path} is missing in ${files.semanticFile(m)}`);
3568
+ return hit;
3569
+ });
3570
+ const s = build(t2, "semantic", (b, m) => byPathOf(flatFile(files.overrideFile(b, m))).get(path) ?? (m === REF_THEME ? t2 : themedBy[m].get(path)));
3571
+ s.description = [t2, ...others].map((x) => x.description).find((x) => x !== void 0);
3572
+ s.deprecated = [t2, ...others].map((x) => x.deprecated).find((x) => x !== void 0);
3573
+ s.file = MODES.map(files.semanticFile).join(", ");
3574
+ return s;
3575
+ });
3576
+ const base = baseRaw.map((t2) => build(t2, "semantic", () => t2));
3577
+ const semantic = [...themed, ...base];
3578
+ const density = (densityRaw[DEFAULT_DENSITY] ?? []).map((t2) => build(t2, "density", (_b, _m, d) => byPathOf(densityRaw[d] ?? []).get(t2.path.join("."))));
3579
+ const component = componentRaw.map((t2) => build(t2, "component", () => t2));
3580
+ return { ...axes, primitives, semantic, brand, density, component, all: [...brand, ...semantic, ...density, ...component], sources };
3581
+ }
3582
+ function tokenRowIndex(rows) {
3583
+ const map = /* @__PURE__ */ new Map();
3584
+ for (const p2 of rows.primitives) map.set(p2.cssVar, { path: p2.path, kind: "primitive", type: p2.type });
3585
+ for (const s of rows.all) map.set(s.cssVar, { path: s.path, kind: s.tier, type: s.type });
3586
+ return map;
3587
+ }
3588
+ const CONTRAST_THRESHOLDS = { text: { aa: 4.5, aaa: 7 }, ui: { aa: 3, aaa: null } };
3589
+ const channel = (c) => {
3590
+ const s = c / 255;
3591
+ return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
3592
+ };
3593
+ function hexLuminance(hex) {
3594
+ const n = parseInt(hex.slice(1), 16);
3595
+ return 0.2126 * channel(n >> 16 & 255) + 0.7152 * channel(n >> 8 & 255) + 0.0722 * channel(n & 255);
3596
+ }
3597
+ function hexContrastRatio(a2, b) {
3598
+ const [hi, lo] = [hexLuminance(a2), hexLuminance(b)].sort((x, y) => y - x);
3599
+ return (hi + 0.05) / (lo + 0.05);
3600
+ }
3601
+ function parseContrastSpecs(text) {
3602
+ if (!text) return [];
3603
+ const data = JSON.parse(text);
3604
+ return (data.pairs ?? []).map((p2) => {
3605
+ const [fg, bg3, min] = Array.isArray(p2) ? p2 : [p2.fg, p2.bg, p2.min];
3606
+ return { fg, bg: bg3, min, usage: min >= CONTRAST_THRESHOLDS.text.aa ? "text" : "ui" };
3607
+ });
3608
+ }
3609
+ function evaluateContrastPairs(specs, rows) {
3610
+ const byPath = new Map(rows.all.map((s) => [s.path, s]));
3611
+ return specs.map((spec) => {
3612
+ const fgToken = byPath.get(spec.fg);
3613
+ const bgToken = byPath.get(spec.bg);
3614
+ if (!fgToken || !bgToken) throw new Error(`contrast: pair ${spec.fg} on ${spec.bg} references a token that does not exist`);
3615
+ const t2 = CONTRAST_THRESHOLDS[spec.usage];
3616
+ const result = (b, m) => {
3617
+ const fgHex = fgToken.brands[b][m].hex;
3618
+ const bgHex = bgToken.brands[b][m].hex;
3619
+ const r = hexContrastRatio(fgHex, bgHex);
3620
+ return { fgHex, bgHex, ratio: Math.floor(r * 100) / 100, aa: r >= spec.min, aaa: t2.aaa === null ? null : r >= t2.aaa };
3621
+ };
3622
+ const brands = Object.fromEntries(rows.brands.map((b) => [b, Object.fromEntries(rows.themes.map((m) => [m, result(b, m)]))]));
3623
+ return { ...spec, fgToken, bgToken, modes: brands[rows.defaultBrand], brands };
3624
+ });
3625
+ }
3626
+ const componentSlug = (s) => s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").toLowerCase();
3627
+ const escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
3628
+ function parseComponentFamilies(indexSrc, componentsRel = "components") {
3629
+ const out = [];
3630
+ const exportRe = new RegExp(`export \\* from '\\./${escapeRe(componentsRel)}/(\\w+)'`);
3631
+ for (const line2 of indexSrc.split("\n")) {
3632
+ const head = line2.match(/^\/\/\s*([A-Z][\w ]+)$/);
3633
+ if (head) out.push({ name: head[1].trim(), members: [] });
3634
+ const exp = line2.match(exportRe);
3635
+ if (exp && out.length) out[out.length - 1].members.push(exp[1]);
3636
+ }
3637
+ return out.filter((f) => f.members.length);
3638
+ }
3639
+ const NATIVE = {
3640
+ HTMLButtonElement: "button",
3641
+ HTMLInputElement: "input",
3642
+ HTMLSpanElement: "span",
3643
+ HTMLDivElement: "div",
3644
+ HTMLAnchorElement: "a"
3645
+ };
3646
+ function parseExtends(clause) {
3647
+ const el = clause.match(/<(HTML\w+Element)>/)?.[1];
3648
+ const omitted = [...(clause.match(/Omit<[^,]+,\s*([^>]+)>/)?.[1] ?? "").matchAll(/'([^']+)'/g)].map((m) => m[1]);
3649
+ return { inherits: el ? NATIVE[el] ?? el : void 0, omitted };
3650
+ }
3651
+ function parseComponentTsx(name, src) {
3652
+ const aliases = /* @__PURE__ */ new Map();
3653
+ for (const m of src.matchAll(/export type (\w+)\s*=\s*([^;]+);/g)) aliases.set(m[1], m[2].trim());
3654
+ let props = [];
3655
+ let inherits;
3656
+ let omitted = [];
3657
+ const iface = src.match(new RegExp(`export interface ${name}Props(?:\\s+extends\\s+([^{]+))?\\s*\\{([\\s\\S]*?)\\n\\}`));
3658
+ if (iface) {
3659
+ ({ inherits, omitted } = parseExtends(iface[1] ?? ""));
3660
+ for (const m of iface[2].matchAll(/(?:\/\*\*([\s\S]*?)\*\/\s*)?(\w+)(\?)?:\s*([^;]+);/g)) {
3661
+ const rawType = m[4].trim();
3662
+ props.push({
3663
+ name: m[2],
3664
+ type: aliases.get(rawType) ?? rawType,
3665
+ required: !m[3],
3666
+ description: m[1]?.replace(/^\s*\*\s?/gm, "").replace(/\s+/g, " ").trim() || void 0
3667
+ });
3668
+ }
3669
+ } else {
3670
+ const alias = aliases.get(`${name}Props`);
3671
+ if (alias) ({ inherits, omitted } = parseExtends(alias));
3672
+ }
3673
+ const sig = src.match(new RegExp(`function ${name}\\(\\s*\\{([^}]*)\\}`));
3674
+ if (sig) {
3675
+ for (const m of sig[1].matchAll(/(\w+)\s*=\s*('[^']*'|[\w.]+)/g)) {
3676
+ const p2 = props.find((x) => x.name === m[1]);
3677
+ if (p2) p2.defaultValue = m[2];
3678
+ }
3679
+ }
3680
+ const docBefore = (re) => {
3681
+ const idx = src.search(re);
3682
+ if (idx < 0) return void 0;
3683
+ const before = src.slice(0, idx).trimEnd();
3684
+ if (!before.endsWith("*/")) return void 0;
3685
+ const start = before.lastIndexOf("/*", before.length - 2);
3686
+ if (start < 0 || before[start + 2] !== "*") return void 0;
3687
+ return before.slice(start + 3, -2).replace(/^\s*\*\s?/gm, "").replace(/\s+/g, " ").trim();
3688
+ };
3689
+ const description = docBefore(new RegExp(`export (?:function|const) ${name}\\b`));
3690
+ const subcomponents = [...src.matchAll(/export function (\w+)/g)].map((m) => m[1]).filter((n) => n !== name);
3691
+ props = props.sort((a2, b) => Number(b.required) - Number(a2.required));
3692
+ return { props, inherits, omitted, description, subcomponents };
3693
+ }
3694
+ const stateOf = (selector) => {
3695
+ const states = [
3696
+ [/:focus-visible/, "focus"],
3697
+ [/:hover/, "hover"],
3698
+ [/:disabled(?!,)|^[^(]*:disabled/, "disabled"],
3699
+ [/\[data-loading\]/, "loading"],
3700
+ [/::placeholder/, "placeholder"]
3701
+ ];
3702
+ const hit = states.filter(([re]) => re.test(selector)).map(([, s]) => s);
3703
+ return hit.length ? `, ${hit.join(" + ")}` : "";
3704
+ };
3705
+ const BASE_UI_RUNTIME = /^--(_|accordion-panel-|collapsible-panel-|active-tab-|anchor-|available-|drawer-swipe-|toast-(frontmost-height|height|index|offset-y|swipe-)|transform-origin)/;
3706
+ function parseComponentCss(src, labels, describe) {
3707
+ const clean = src.replace(/\/\*[\s\S]*?\*\//g, "");
3708
+ const rules = [];
3709
+ const walk = (text, prefix = "") => {
3710
+ let i = 0;
3711
+ let buf = "";
3712
+ while (i < text.length) {
3713
+ const ch3 = text[i];
3714
+ if (ch3 === "{") {
3715
+ const head = buf.trim();
3716
+ buf = "";
3717
+ let depth = 1;
3718
+ const start = ++i;
3719
+ while (i < text.length && depth > 0) {
3720
+ if (text[i] === "{") depth++;
3721
+ else if (text[i] === "}") depth--;
3722
+ i++;
3723
+ }
3724
+ const inner = text.slice(start, i - 1);
3725
+ if (head.startsWith("@keyframes")) continue;
3726
+ if (head.startsWith("@")) {
3727
+ walk(inner, `${head} `);
3728
+ continue;
3729
+ }
3730
+ const names2 = [...new Set([...inner.matchAll(/var\((--[\w-]+)/g)].map((m) => m[1]))].filter((n) => !BASE_UI_RUNTIME.test(n));
3731
+ if (!names2.length) continue;
3732
+ const className = head.match(/\.([\w-]+)/)?.[1] ?? head;
3733
+ rules.push({
3734
+ selector: prefix + head.replace(/\s+/g, " "),
3735
+ className,
3736
+ label: (labels[className] ?? className) + stateOf(head),
3737
+ vars: names2.map((n) => {
3738
+ const d = describe(n);
3739
+ return { name: n, href: d?.href, known: !!d, path: d?.path, kind: d?.kind };
3740
+ })
3741
+ });
3742
+ } else {
3743
+ buf += ch3;
3744
+ i++;
3745
+ }
3746
+ }
3747
+ };
3748
+ walk(clean);
3749
+ return rules;
3750
+ }
3751
+ function parseComponentStories(src) {
3752
+ const title = src.match(/title:\s*'([^']+)'/)?.[1];
3753
+ if (!title) return [];
3754
+ const base = title.split("/").map((s) => componentSlug(s.trim()).replace(/\s+/g, "-")).join("-");
3755
+ return [...src.matchAll(/export const (\w+):\s*Story/g)].map((m) => ({ name: m[1], id: `${base}--${componentSlug(m[1])}` }));
3756
+ }
3757
+ function resolveInheritedTokens(list) {
3758
+ const byName = new Map(list.map((c) => [c.name, c]));
3759
+ for (const c of list) {
3760
+ const seen = /* @__PURE__ */ new Set([c.name]);
3761
+ const queue = [...c.reuses ?? []];
3762
+ const inherited = [];
3763
+ const taken = new Set(c.tokenPaths);
3764
+ while (queue.length) {
3765
+ const from = byName.get(queue.shift());
3766
+ if (!from || seen.has(from.name)) continue;
3767
+ seen.add(from.name);
3768
+ const paths = from.tokenPaths.filter((p2) => !taken.has(p2));
3769
+ paths.forEach((p2) => taken.add(p2));
3770
+ inherited.push({ from: from.name, slug: from.slug, paths });
3771
+ queue.push(...from.reuses ?? []);
3772
+ }
3773
+ c.inherited = inherited;
3774
+ c.allTokenPaths = [...taken].sort();
3775
+ }
3776
+ for (const c of list) delete c.reuses;
3777
+ }
3778
+ function scanComponents(input) {
3779
+ const { dir, readText, describeVar } = input;
3780
+ const docsSuffix = input.docsSuffix ?? ".docs.json";
3781
+ const styleSuffix = input.styleSuffix ?? ".module.css";
3782
+ const fileSet = new Set(input.files);
3783
+ const has = (p2) => fileSet.has(p2);
3784
+ const fam = input.indexText === void 0 ? [] : parseComponentFamilies(input.indexText, input.indexRel ?? "components");
3785
+ const familyOf = (name) => fam.find((f) => f.members.includes(name))?.name;
3786
+ const names2 = [
3787
+ ...new Set(
3788
+ input.files.map((f) => f.startsWith(`${dir}/`) ? f.slice(dir.length + 1).split("/") : []).filter((parts) => parts.length === 2 && parts[1] === `${parts[0]}.tsx`).map((parts) => parts[0])
3789
+ )
3790
+ ].sort();
3791
+ const reuseRe = new RegExp(`from\\s+'\\.\\.\\/(\\w+)\\/(\\w+)${escapeRe(styleSuffix)}'`, "g");
3792
+ const result = names2.map((name) => {
3793
+ const folder = `${dir}/${name}`;
3794
+ const files = { tsx: `${folder}/${name}.tsx`, css: `${folder}/${name}${styleSuffix}`, stories: `${folder}/${name}.stories.tsx`, docs: `${folder}/${name}${docsSuffix}` };
3795
+ let docs = null;
3796
+ if (has(files.docs)) {
3797
+ try {
3798
+ docs = JSON.parse(readText(files.docs) ?? "");
3799
+ } catch (err) {
3800
+ input.problems?.push(`${files.docs}: ${err.message}`);
3801
+ }
3802
+ }
3803
+ const tsxSrc = readText(files.tsx) ?? "";
3804
+ const tsx = parseComponentTsx(name, tsxSrc);
3805
+ const reuses = [...tsxSrc.matchAll(reuseRe)].filter((m) => m[1] === m[2] && m[1] !== name).map((m) => m[1]);
3806
+ const cssText = has(files.css) ? readText(files.css) : void 0;
3807
+ const rules = cssText === void 0 ? [] : parseComponentCss(cssText, docs?.anatomy ?? {}, describeVar);
3808
+ const used = [...new Set(rules.flatMap((r) => r.vars.map((v) => v.name)))].sort();
3809
+ const storiesText = has(files.stories) ? readText(files.stories) : void 0;
3810
+ return {
3811
+ name,
3812
+ slug: componentSlug(name),
3813
+ dir: folder,
3814
+ files,
3815
+ ...tsx,
3816
+ rules,
3817
+ tokensUsed: used.map((n) => {
3818
+ const d = describeVar(n);
3819
+ return { name: n, href: d?.href, known: !!d, kind: d?.kind };
3820
+ }),
3821
+ tokenPaths: [...new Set(used.flatMap((n) => describeVar(n)?.path ?? []))].sort(),
3822
+ inherited: [],
3823
+ allTokenPaths: [],
3824
+ reuses,
3825
+ stories: storiesText === void 0 ? [] : parseComponentStories(storiesText),
3826
+ docs,
3827
+ category: docs?.category ?? familyOf(name) ?? "Core"
3828
+ };
3829
+ });
3830
+ const order = (c) => {
3831
+ const i = fam.findIndex((f) => f.name === c.category);
3832
+ return i < 0 ? fam.length : i;
3833
+ };
3834
+ result.sort((a2, b) => order(a2) - order(b) || a2.name.localeCompare(b.name));
3835
+ resolveInheritedTokens(result);
3836
+ return result;
3837
+ }
3838
+ const REPO_MODEL_DEFAULTS = {
3839
+ tokensRoot: "packages/tokens/src",
3840
+ componentsDir: "packages/react/src/components",
3841
+ componentSpecs: "packages/react/component-specs.json",
3842
+ /** Optional token usage notes (group -> sentence), relative to tokens.root, when tokens.usage is not set. */
3843
+ tokensUsage: "usage.json",
3844
+ /** Most global stylesheets read (components.styles): a broad glob never turns into hundreds of reads. */
3845
+ maxStylesheets: 50,
3846
+ repo: { owner: "peterbono", repo: "ai-design-system-demo", defaultBranch: "main" }
3847
+ };
3848
+ function siteRepoFromConfig(config, raw, fallback = REPO_MODEL_DEFAULTS.repo) {
3849
+ const legacy = raw && typeof raw === "object" ? raw : void 0;
3850
+ const g = config.governance;
3851
+ const legacyOwners = legacy?.governance?.owners === void 0 ? legacy?.owners : void 0;
3852
+ return {
3853
+ owner: typeof legacy?.owner === "string" && legacy.owner ? legacy.owner : config.repo?.owner ?? fallback.owner,
3854
+ repo: config.repo?.name ?? fallback.repo,
3855
+ defaultBranch: typeof legacy?.defaultBranch === "string" && legacy.defaultBranch ? legacy.defaultBranch : config.repo?.defaultBranch ?? fallback.defaultBranch,
3856
+ owners: legacyOwners ? { design: legacyOwners.design ?? [], tech: legacyOwners.tech ?? [] } : { design: [...g.owners.design], tech: [...g.owners.tech] },
3857
+ override: g.override ? { ...g.override } : { ...DEFAULT_OVERRIDE },
3858
+ rights: g.rights ?? null,
3859
+ soloOwnerCanApproveBoth: g.soloOwnerCanApproveBoth === true,
3860
+ visualImpact: { mode: config.visualImpact?.mode === "on-demand" ? "on-demand" : "auto" },
3861
+ tokensRoot: config.tokens.root,
3862
+ integrations: config.integrations ?? {},
3863
+ products: config.products.length ? config.products : DEFAULT_PRODUCTS.map((p2) => ({ ...p2 })),
3864
+ changes: config.changes ?? DEFAULT_CHANGES_MODE
3865
+ };
3866
+ }
3867
+ function styleGlobs(config) {
3868
+ if (config.components?.styles) return [...config.components.styles];
3869
+ const parent = parentDir(config.components?.dir ?? REPO_MODEL_DEFAULTS.componentsDir);
3870
+ const at3 = (dir) => parent ? `${parent}/${dir}/**/*.css` : `${dir}/**/*.css`;
3871
+ return [at3("styles"), at3("theme")];
3872
+ }
3873
+ function globBase(glob) {
3874
+ const segs = glob.split("/");
3875
+ const fixed = [];
3876
+ for (const seg of segs.slice(0, -1)) {
3877
+ if (/[*?[{]/.test(seg)) break;
3878
+ fixed.push(seg);
3879
+ }
3880
+ return fixed.join("/");
3881
+ }
3882
+ async function listStylesheets(source, config) {
3883
+ const globs = styleGlobs(config);
3884
+ const matchers = globs.map(globToRegExp);
3885
+ const compDir = config.components?.dir ?? REPO_MODEL_DEFAULTS.componentsDir;
3886
+ const bases = [...new Set(globs.map(globBase))].filter((b, _, all) => !all.some((o) => o !== b && (o === "" || b.startsWith(`${o}/`))));
3887
+ const listed = (await Promise.all(bases.map((b) => source.list(b)))).flat();
3888
+ const paths = [...new Set(listed)].filter((p2) => matchers.some((re) => re.test(p2)) && !p2.startsWith(`${compDir}/`)).sort();
3889
+ const max = REPO_MODEL_DEFAULTS.maxStylesheets;
3890
+ if (paths.length <= max) return { globs, paths, problems: [] };
3891
+ return { globs, paths: paths.slice(0, max), problems: [`components.styles matches ${paths.length} files: Bridge reads the first ${max}. Narrow the globs to the stylesheets the library ships.`] };
3892
+ }
3893
+ async function readStylesheets(source, config, concurrency = 8) {
3894
+ const { globs, paths, problems } = await listStylesheets(source, config);
3895
+ const bodies = await readRepoTexts(source, paths, concurrency);
3896
+ const vars = {};
3897
+ for (const p2 of paths) {
3898
+ const text = bodies.get(p2);
3899
+ if (typeof text === "string") vars[p2] = cssVarsIn(text);
3900
+ }
3901
+ return { globs, vars, problems };
3902
+ }
3903
+ function withModelDefaults(raw) {
3904
+ const tokens = raw.tokens && typeof raw.tokens === "object" ? raw.tokens : {};
3905
+ return {
3906
+ ...raw,
3907
+ tokens: { ...tokens, root: tokens.root ?? REPO_MODEL_DEFAULTS.tokensRoot },
3908
+ components: raw.components ?? { dir: REPO_MODEL_DEFAULTS.componentsDir }
3909
+ };
3910
+ }
3911
+ const defaultModelConfig = () => defineConfig(withModelDefaults({}));
3912
+ function parseModelConfig(text) {
3913
+ if (text === null) return { config: defaultModelConfig(), raw: void 0, problems: [] };
3914
+ let raw;
3915
+ try {
3916
+ raw = JSON.parse(text);
3917
+ } catch (err) {
3918
+ return { config: defaultModelConfig(), raw: void 0, problems: [`${CONFIG_FILE} is not valid JSON (${err.message})`] };
3919
+ }
3920
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return { config: defaultModelConfig(), raw, problems: [`${CONFIG_FILE}: top level must be an object`] };
3921
+ try {
3922
+ return { config: loadConfig(withModelDefaults(raw)), raw, problems: [] };
3923
+ } catch (err) {
3924
+ const problems = err instanceof ConfigError ? err.problems.map((p2) => `${CONFIG_FILE}: ${p2}`) : [`${CONFIG_FILE}: ${err.message}`];
3925
+ return { config: defaultModelConfig(), raw, problems };
3926
+ }
3927
+ }
3928
+ const emptyRows = (config) => ({ ...tokenRowAxes(config), primitives: [], semantic: [], brand: [], density: [], component: [], all: [], sources: [] });
3929
+ async function loadRepoModel(source, options = {}) {
3930
+ const concurrency = options.concurrency ?? 8;
3931
+ const problems = [];
3932
+ const tooLarge = (path, err) => {
3933
+ if (err?.status !== 413) throw err;
3934
+ problems.push(`${path}: ${err.message}`);
3935
+ return null;
3936
+ };
3937
+ const configText = await source.text(CONFIG_FILE);
3938
+ const parsed = parseModelConfig(configText);
3939
+ const { config } = parsed;
3940
+ problems.push(...parsed.problems);
3941
+ const fallbackRepo = source.ref.owner && source.ref.repo ? { owner: source.ref.owner, repo: source.ref.repo, defaultBranch: REPO_MODEL_DEFAULTS.repo.defaultBranch } : REPO_MODEL_DEFAULTS.repo;
3942
+ const site = siteRepoFromConfig(config, parsed.raw, fallbackRepo);
3943
+ const root = config.tokens.root;
3944
+ const underRoot = await source.list(root === "." ? "" : root);
3945
+ const tokenRel = selectTokenFiles(config, underRoot);
3946
+ const contrastPath = config.contrast?.path;
3947
+ const usagePath = tokensPath(config, config.tokens.usage ?? REPO_MODEL_DEFAULTS.tokensUsage);
3948
+ const tokenPaths = tokenRel.map((f) => tokensPath(config, f));
3949
+ const tokenRead = [.../* @__PURE__ */ new Set([...tokenPaths, ...contrastPath ? [contrastPath] : [], usagePath])];
3950
+ const comps = config.components ?? { dir: REPO_MODEL_DEFAULTS.componentsDir, docsSuffix: ".docs.json", styleSuffix: ".module.css" };
3951
+ const specsPath = comps.specs ?? REPO_MODEL_DEFAULTS.componentSpecs;
3952
+ const indexPath = comps.index ?? (parentDir(comps.dir) ? `${parentDir(comps.dir)}/index.ts` : "index.ts");
3953
+ let compFiles = [];
3954
+ const codeRead = [specsPath];
3955
+ const docsRead = [];
3956
+ if (options.components !== false) {
3957
+ compFiles = await source.list(comps.dir);
3958
+ for (const f of compFiles) {
3959
+ const parts = f.slice(comps.dir.length + 1).split("/");
3960
+ if (parts.length !== 2) continue;
3961
+ const [n, file] = parts;
3962
+ if (file === `${n}${comps.docsSuffix}`) docsRead.push(f);
3963
+ else if ([`${n}.tsx`, `${n}${comps.styleSuffix}`, `${n}.stories.tsx`].includes(file)) codeRead.push(f);
3964
+ }
3965
+ codeRead.push(indexPath);
3966
+ }
3967
+ const listedStyles = await listStylesheets(source, config);
3968
+ problems.push(...listedStyles.problems);
3969
+ const stylePaths = listedStyles.paths;
3970
+ codeRead.push(...stylePaths);
3971
+ const seen = /* @__PURE__ */ new Set();
3972
+ const fresh = (paths) => paths.filter((p2) => {
3973
+ if (seen.has(p2)) return false;
3974
+ seen.add(p2);
3975
+ return true;
3976
+ });
3977
+ const phases = [
3978
+ ["tokens", fresh(tokenRead)],
3979
+ ["components", fresh(codeRead)],
3980
+ ["docs", fresh(docsRead)]
3981
+ ];
3982
+ const filesTotal = phases.reduce((n, [, paths]) => n + paths.length, 0);
3983
+ let before = 0;
3984
+ const readPhase = async (phase, paths) => {
3985
+ const offset = before;
3986
+ const out = await readRepoTexts(source, paths, concurrency, tooLarge, (done, total) => options.onProgress?.({ phase, done, total, filesDone: offset + done, filesTotal }));
3987
+ before += paths.length;
3988
+ return out;
3989
+ };
3990
+ const bodies = await readPhase("tokens", phases[0][1]);
3991
+ const read = (p2) => bodies.get(p2) ?? void 0;
3992
+ const files = {};
3993
+ tokenRel.forEach((rel, i) => {
3994
+ const body = read(tokenPaths[i]);
3995
+ if (body !== void 0) files[rel] = body;
3996
+ });
3997
+ const listFiles = (dir) => underRoot.filter((p2) => parentDir(p2) === dir);
3998
+ let rows;
3999
+ try {
4000
+ rows = buildTokenRows(config, read, listFiles);
4001
+ } catch (err) {
4002
+ problems.push(err.message);
4003
+ rows = emptyRows(config);
4004
+ }
4005
+ let usage = null;
4006
+ const usageText = read(usagePath);
4007
+ if (usageText !== void 0) {
4008
+ try {
4009
+ usage = JSON.parse(usageText);
4010
+ } catch (err) {
4011
+ problems.push(`${usagePath}: ${err.message}`);
4012
+ }
4013
+ }
4014
+ let specs = [];
4015
+ let pairs2 = [];
4016
+ try {
4017
+ specs = parseContrastSpecs(contrastPath ? read(contrastPath) : void 0);
4018
+ pairs2 = evaluateContrastPairs(specs, rows);
4019
+ } catch (err) {
4020
+ problems.push(err.message);
4021
+ }
4022
+ const index = tokenRowIndex(rows);
4023
+ const describeVar = (cssVar) => {
4024
+ const hit = index.get(cssVar);
4025
+ return hit ? { path: hit.path, kind: hit.kind, href: options.href?.(cssVar, hit.type, hit.kind, hit.path) } : void 0;
4026
+ };
4027
+ let components = null;
4028
+ const code2 = await readPhase("components", phases[1][1]);
4029
+ const docs = await readPhase("docs", phases[2][1]);
4030
+ const readMore = (p2) => code2.get(p2) ?? docs.get(p2) ?? bodies.get(p2) ?? void 0;
4031
+ if (options.components !== false) {
4032
+ const indexText = readMore(indexPath);
4033
+ const indexDir = parentDir(indexPath);
4034
+ const indexRel = indexDir && comps.dir.startsWith(`${indexDir}/`) ? comps.dir.slice(indexDir.length + 1) : comps.dir;
4035
+ const list = scanComponents({ dir: comps.dir, files: compFiles, readText: readMore, indexText, indexRel, docsSuffix: comps.docsSuffix, styleSuffix: comps.styleSuffix, describeVar, problems });
4036
+ components = { dir: comps.dir, index: indexText === void 0 ? void 0 : indexPath, families: indexText === void 0 ? [] : parseComponentFamilies(indexText, indexRel), list };
4037
+ }
4038
+ const styleVars = {};
4039
+ for (const p2 of stylePaths) {
4040
+ const text = readMore(p2);
4041
+ if (text !== void 0) styleVars[p2] = cssVarsIn(text);
4042
+ }
4043
+ const specsText = readMore(specsPath);
4044
+ let specsFile = null;
4045
+ let coverage = [];
4046
+ if (specsText !== void 0) {
4047
+ try {
4048
+ specsFile = parseComponentSpecs(specsText);
4049
+ } catch {
4050
+ }
4051
+ try {
4052
+ coverage = JSON.parse(specsText).coverage ?? [];
4053
+ } catch (err) {
4054
+ problems.push(`${specsPath}: ${err.message}`);
4055
+ }
4056
+ }
4057
+ return {
4058
+ ref: source.ref,
4059
+ configText,
4060
+ config,
4061
+ site,
4062
+ problems,
4063
+ tokens: { root, files, rows, usage },
4064
+ contrast: { path: contrastPath, specs, pairs: pairs2 },
4065
+ components,
4066
+ styles: { globs: listedStyles.globs, vars: styleVars },
4067
+ specs: { path: specsPath, file: specsFile, coverage }
4068
+ };
4069
+ }
4070
+ const FULL_SHA = /^[0-9a-f]{40}$/i;
4071
+ function limiter(n) {
4072
+ let active = 0;
4073
+ const waiting = [];
4074
+ return async (task) => {
4075
+ if (active >= n) await new Promise((resolve2) => waiting.push(resolve2));
4076
+ active++;
4077
+ try {
4078
+ return await task();
4079
+ } finally {
4080
+ active--;
4081
+ waiting.shift()?.();
4082
+ }
4083
+ };
4084
+ }
4085
+ function gitHubSource(client, sha, opts = {}) {
4086
+ if (!FULL_SHA.test(sha)) throw new Error(`gitHubSource needs a full commit sha, got "${sha}". Resolve the branch head first.`);
4087
+ const maxBytes = opts.maxFileBytes ?? 1e6;
4088
+ const run = limiter(Math.max(1, opts.concurrency ?? 4));
4089
+ const mode = client.canWrite ? "api" : "raw";
4090
+ let tree;
4091
+ const readTree = () => {
4092
+ tree ??= client.getTree(sha, true).then(
4093
+ ({ entries, truncated }) => {
4094
+ if (truncated) throw new GitHubError(413, "The repository tree is too large to read in one request.");
4095
+ const files = /* @__PURE__ */ new Map();
4096
+ for (const e of entries) if (e.type === "blob") files.set(e.path, { sha: e.sha, size: e.size });
4097
+ opts.onProgress?.({ kind: "tree", files: files.size });
4098
+ return files;
4099
+ },
4100
+ (err) => {
4101
+ tree = void 0;
4102
+ throw err;
4103
+ }
4104
+ );
4105
+ return tree;
4106
+ };
4107
+ const bodies = /* @__PURE__ */ new Map();
4108
+ const readBody = async (path, blobSha) => {
4109
+ const kept = await opts.blobCache?.get(blobSha);
4110
+ if (kept !== void 0) {
4111
+ opts.onProgress?.({ kind: "file", path, cached: true });
4112
+ return kept;
4113
+ }
4114
+ const text = mode === "api" ? await client.getBlobRaw(blobSha) : await client.readRawFile(path, sha);
4115
+ if (text === void 0) {
4116
+ const hint = mode === "raw" ? " Sign in with GitHub to read a private repository." : "";
4117
+ throw new GitHubError(404, `${path} is listed at ${sha.slice(0, 7)} but GitHub did not return it.${hint}`);
4118
+ }
4119
+ try {
4120
+ await opts.blobCache?.set(blobSha, text);
4121
+ } catch {
4122
+ }
4123
+ opts.onProgress?.({ kind: "file", path, cached: false });
4124
+ return text;
4125
+ };
4126
+ return {
4127
+ ref: { owner: client.owner, repo: client.name, sha },
4128
+ mode,
4129
+ async list(prefix) {
4130
+ return [...(await readTree()).keys()].filter((f) => isUnder(f, prefix)).sort();
4131
+ },
4132
+ async text(path) {
4133
+ const p2 = normalizeRepoPath(path);
4134
+ const entry = (await readTree()).get(p2);
4135
+ if (!entry) return null;
4136
+ if (entry.size !== void 0 && entry.size > maxBytes) {
4137
+ throw new GitHubError(413, `${p2} is ${Math.round(entry.size / 1e3)} KB; Bridge reads files up to ${Math.round(maxBytes / 1e3)} KB.`);
4138
+ }
4139
+ let body = bodies.get(entry.sha);
4140
+ if (!body) {
4141
+ body = run(() => readBody(p2, entry.sha));
4142
+ bodies.set(entry.sha, body);
4143
+ body.catch(() => bodies.delete(entry.sha));
4144
+ }
4145
+ return body;
4146
+ }
4147
+ };
4148
+ }
4149
+ function accessState(f) {
4150
+ if (!f.visible) return f.signedIn ? "no-access" : "anonymous-unknown";
4151
+ if (!f.signedIn) return "anonymous-public";
4152
+ const p2 = f.permissions ?? {};
4153
+ if (f.installed === false && !f.private) return p2.admin || p2.maintain || p2.push || p2.triage ? "not-installed" : "outside-contributor";
4154
+ if (p2.admin) return "admin";
4155
+ if (p2.push || p2.maintain) return "writer";
4156
+ return "reader";
4157
+ }
4158
+ const RANK = {
4159
+ "anonymous-unknown": 0,
4160
+ "no-access": 0,
4161
+ "anonymous-public": 1,
4162
+ "not-installed": 1,
4163
+ "outside-contributor": 1,
4164
+ reader: 2,
4165
+ writer: 3,
4166
+ admin: 4
4167
+ };
4168
+ function accessAtLeast(state, min) {
4169
+ return RANK[state] >= RANK[min];
4170
+ }
4171
+ async function installed(client, owner, repo) {
4172
+ try {
4173
+ const found = await client.findInstallation(owner, repo);
4174
+ return found ? { installed: true, id: found.id } : { installed: false };
4175
+ } catch (err) {
4176
+ if (err instanceof GitHubError && (err.status === 401 || err.status === 429)) throw err;
4177
+ return { installed: null };
4178
+ }
4179
+ }
4180
+ async function resolveRepoAccess(client, opts = {}) {
4181
+ const signedIn = client.canWrite;
4182
+ const base = { owner: client.owner, repo: client.name };
4183
+ let info;
4184
+ try {
4185
+ info = await client.getRepo();
4186
+ } catch (err) {
4187
+ if (err instanceof GitHubError && err.status === 404) {
4188
+ return { ...base, state: accessState({ signedIn, visible: false }), private: void 0, defaultBranch: void 0, permissions: void 0 };
4189
+ }
4190
+ throw err;
4191
+ }
4192
+ const inst = signedIn && opts.app ? await installed(client, client.owner, client.name) : { installed: null };
4193
+ const direct = signedIn && opts.direct ? (await installed(opts.direct, client.owner, client.name)).installed : void 0;
4194
+ return {
4195
+ ...base,
4196
+ state: accessState({ signedIn, visible: true, installed: inst.installed, private: info.private, permissions: info.permissions }),
4197
+ private: info.private,
4198
+ defaultBranch: info.defaultBranch,
4199
+ permissions: info.permissions,
4200
+ ...inst.id !== void 0 ? { installationId: inst.id } : {},
4201
+ ...direct !== void 0 ? { directInstalled: direct } : {}
4202
+ };
4203
+ }
4204
+ const SNAPSHOT_SCHEMA_VERSION = 1;
4205
+ const SNAPSHOT_BRANCH = "bridge-data";
4206
+ const SNAPSHOT_FILE = "snapshot.json";
4207
+ const SNAPSHOT_AUDITS_DIR = "audits";
4208
+ const SNAPSHOT_MAX_BYTES = 5e6;
4209
+ class SnapshotError extends Error {
4210
+ }
4211
+ const isObj = (x) => !!x && typeof x === "object" && !Array.isArray(x);
4212
+ const isStr = (x) => typeof x === "string";
4213
+ function parseSnapshot(input) {
4214
+ let data = input;
4215
+ if (typeof input === "string") {
4216
+ try {
4217
+ data = JSON.parse(input);
4218
+ } catch (err) {
4219
+ throw new SnapshotError(`${SNAPSHOT_FILE} is not valid JSON (${err.message})`);
4220
+ }
4221
+ }
4222
+ if (!isObj(data) || data.kind !== "bridge-snapshot") throw new SnapshotError(`${SNAPSHOT_FILE} is not a Bridge snapshot`);
4223
+ if (data.schemaVersion !== SNAPSHOT_SCHEMA_VERSION) throw new SnapshotError(`${SNAPSHOT_FILE} is schema version ${String(data.schemaVersion)}; this version of Bridge reads ${SNAPSHOT_SCHEMA_VERSION}`);
4224
+ const repo = data.repo;
4225
+ if (!isObj(repo) || !isStr(repo.owner) || !isStr(repo.name) || !isStr(repo.branch)) throw new SnapshotError(`${SNAPSHOT_FILE}: repo needs owner, name and branch`);
4226
+ if (!isStr(data.sourceSha) || !data.sourceSha) throw new SnapshotError(`${SNAPSHOT_FILE}: sourceSha is missing`);
4227
+ if (!isStr(data.generatedAt)) throw new SnapshotError(`${SNAPSHOT_FILE}: generatedAt is missing`);
4228
+ if (!Array.isArray(data.paths) || !data.paths.every(isStr)) throw new SnapshotError(`${SNAPSHOT_FILE}: paths must be a list of strings`);
4229
+ if (!isObj(data.files) || !Object.values(data.files).every(isStr)) throw new SnapshotError(`${SNAPSHOT_FILE}: files must map paths to text`);
4230
+ if (data.figma !== null && (!isObj(data.figma) || !isStr(data.figma.path) || !Array.isArray(data.figma.coverage))) throw new SnapshotError(`${SNAPSHOT_FILE}: figma must be null or { path, coverage }`);
4231
+ if (!isObj(data.summary) || typeof data.summary.tokens !== "number") throw new SnapshotError(`${SNAPSHOT_FILE}: summary is missing`);
4232
+ if (!isObj(data.contrast) || !Array.isArray(data.contrast.pairs)) throw new SnapshotError(`${SNAPSHOT_FILE}: contrast needs pairs`);
4233
+ if (!Array.isArray(data.audits) || !data.audits.every((a2) => isObj(a2) && isStr(a2.id) && isStr(a2.path) && isObj(a2.metrics))) throw new SnapshotError(`${SNAPSHOT_FILE}: audits must be a list of { id, path, metrics }`);
4234
+ if (!Array.isArray(data.problems)) throw new SnapshotError(`${SNAPSHOT_FILE}: problems must be a list`);
4235
+ return data;
4236
+ }
4237
+ const snapshotIsFresh = (snapshot, headSha) => !!headSha && snapshot.sourceSha === headSha;
4238
+ function snapshotSource(snapshot) {
4239
+ const files = new Map(Object.entries(snapshot.files).map(([k, v]) => [normalizeRepoPath(k), v]));
4240
+ const figmaPath = snapshot.figma ? normalizeRepoPath(snapshot.figma.path) : void 0;
4241
+ if (snapshot.figma && figmaPath && !files.has(figmaPath)) {
4242
+ files.set(figmaPath, JSON.stringify({ ...snapshot.figma.generated ? { generated: snapshot.figma.generated } : {}, coverage: snapshot.figma.coverage }));
4243
+ }
4244
+ const paths = [.../* @__PURE__ */ new Set([...snapshot.paths.map(normalizeRepoPath), ...files.keys()])].sort();
4245
+ return {
4246
+ ref: { owner: snapshot.repo.owner, repo: snapshot.repo.name, sha: snapshot.sourceSha },
4247
+ list: async (prefix) => paths.filter((p2) => isUnder(p2, prefix)),
4248
+ text: async (path) => files.get(normalizeRepoPath(path)) ?? null
4249
+ };
4250
+ }
4251
+ function recordingSource(source) {
4252
+ const paths = /* @__PURE__ */ new Set();
4253
+ const files = /* @__PURE__ */ new Map();
4254
+ return {
4255
+ paths,
4256
+ files,
4257
+ source: {
4258
+ get ref() {
4259
+ return source.ref;
4260
+ },
4261
+ async list(prefix) {
4262
+ const out = await source.list(prefix);
4263
+ for (const p2 of out) paths.add(p2);
4264
+ return out;
4265
+ },
4266
+ async text(path) {
4267
+ const body = await source.text(path);
4268
+ if (body !== null) files.set(normalizeRepoPath(path), body);
4269
+ return body;
4270
+ }
4271
+ }
4272
+ };
4273
+ }
4274
+ function snapshotAudit(id, report) {
4275
+ return {
4276
+ id,
4277
+ path: `${SNAPSHOT_AUDITS_DIR}/${id}.json`,
4278
+ ...report.label ? { label: report.label } : {},
4279
+ generatedAt: report.generatedAt,
4280
+ target: { path: report.target.path, files: report.target.files },
4281
+ metrics: report.metrics
4282
+ };
4283
+ }
4284
+ const auditId = (s) => s.toLowerCase().replace(/\.json$/, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "audit";
4285
+ const pairResults = (p2) => {
4286
+ const brands = Object.values(p2.brands);
4287
+ return brands.length ? brands.flatMap((b) => Object.values(b)) : Object.values(p2.modes);
4288
+ };
4289
+ function snapshotSummary(model) {
4290
+ const results = model.contrast.pairs.flatMap((p2) => pairResults(p2).map((r) => r.ratio >= p2.min));
4291
+ const coverage = model.specs.coverage;
4292
+ const visual = coverage.filter((c) => c.status !== "layout").length;
4293
+ const inFigma = coverage.filter((c) => c.status === "generated" || c.status === "drafted").length;
4294
+ return {
4295
+ tokens: model.tokens.rows.all.length + model.tokens.rows.primitives.length,
4296
+ components: model.components ? model.components.list.length : null,
4297
+ contrast: { pairs: model.contrast.pairs.length, checks: results.length, failing: results.filter((ok) => !ok).length },
4298
+ figma: coverage.length ? { inFigma, visual } : null
4299
+ };
4300
+ }
4301
+ function buildSnapshot(input) {
4302
+ const { model } = input;
4303
+ const files = {};
4304
+ const entries = input.files instanceof Map ? [...input.files] : Object.entries(input.files);
4305
+ const specsPath = normalizeRepoPath(model.specs.path);
4306
+ for (const [k, v] of entries.sort(([a2], [b]) => a2 < b ? -1 : a2 > b ? 1 : 0)) {
4307
+ const p2 = normalizeRepoPath(k);
4308
+ if (p2 !== specsPath) files[p2] = v;
4309
+ }
4310
+ const hasSpecs = entries.some(([k]) => normalizeRepoPath(k) === specsPath);
4311
+ return {
4312
+ kind: "bridge-snapshot",
4313
+ schemaVersion: SNAPSHOT_SCHEMA_VERSION,
4314
+ tool: { name: "bridge", version: input.version },
4315
+ generatedAt: input.generatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
4316
+ repo: { owner: model.ref.owner || model.site.owner, name: model.ref.repo || model.site.repo, branch: input.branch ?? model.site.defaultBranch },
4317
+ sourceSha: model.ref.sha,
4318
+ ...input.committedAt ? { committedAt: input.committedAt } : {},
4319
+ paths: [...new Set([...input.paths].map(normalizeRepoPath))].filter((p2) => p2 !== specsPath).sort(),
4320
+ files,
4321
+ figma: hasSpecs ? { path: specsPath, ...model.specs.file?.generated ? { generated: model.specs.file.generated } : {}, coverage: model.specs.coverage } : null,
4322
+ summary: snapshotSummary(model),
4323
+ contrast: { ...model.contrast.path ? { path: model.contrast.path } : {}, pairs: model.contrast.pairs.map(({ fgToken: _fg, bgToken: _bg, ...rest }) => rest) },
4324
+ audits: input.audits ?? [],
4325
+ problems: [...model.problems],
4326
+ styles: [...model.styles.globs]
4327
+ };
4328
+ }
4329
+ const SNAPSHOT_LLMS_FILE = "llms.txt";
4330
+ const LLMS_MAX_TOKENS = 600;
4331
+ const line = (text) => typeof text === "string" ? text.replace(/\s+/g, " ").trim() : "";
4332
+ const strings = (list) => Array.isArray(list) ? list.map(line).filter(Boolean) : [];
4333
+ function snapshotLlmsTxt(model, snapshot) {
4334
+ const { owner, name, branch } = snapshot.repo;
4335
+ const date = (snapshot.committedAt ?? snapshot.generatedAt).slice(0, 10);
4336
+ const rows = model.tokens.rows;
4337
+ const tokens = rows.all.filter((t2) => !t2.deprecated);
4338
+ const shown = tokens.slice(0, LLMS_MAX_TOKENS);
4339
+ const comps = model.components?.list ?? [];
4340
+ const out = [
4341
+ `# ${owner}/${name} design system`,
4342
+ "",
4343
+ `> Tokens, components and usage guidance of the design system in github.com/${owner}/${name}, read at ${snapshot.sourceSha.slice(0, 7)} on ${branch} (${date}). Published by Bridge for AI agents and people.`,
4344
+ "",
4345
+ `- Source: https://github.com/${owner}/${name}/tree/${snapshot.sourceSha}`,
4346
+ `- Every file Bridge read, as JSON: ${SNAPSHOT_FILE}, next to this file on the ${SNAPSHOT_BRANCH} branch.`,
4347
+ `- Themes: ${rows.themes.join(", ") || "none"}. Brands: ${rows.brands.join(", ") || "none"}. Densities: ${rows.densities.join(", ") || "none"}.`,
4348
+ "",
4349
+ "## Tokens",
4350
+ "",
4351
+ `${tokens.length} tokens (brand, semantic, density and component tiers) on top of ${rows.primitives.length} primitives. Use the semantic tokens in product code, never the primitives. Values are for the default brand${rows.defaultBrand ? ` (${rows.defaultBrand})` : ""}.`,
4352
+ ""
4353
+ ];
4354
+ for (const t2 of shown) {
4355
+ const values = Object.entries(t2.modes).map(([theme, v]) => `${theme} ${line(v.css)}`).join(", ");
4356
+ const note = line(t2.description);
4357
+ out.push(`- \`${t2.path}\` (\`${t2.cssVar}\`, ${t2.tier} ${t2.type}): ${values || "no value"}${note ? `. ${note}` : ""}`);
4358
+ }
4359
+ if (tokens.length > shown.length) out.push("", `${tokens.length - shown.length} more tokens are in ${SNAPSHOT_FILE}.`);
4360
+ out.push("", "## Components", "");
4361
+ if (!comps.length) out.push("No components were read (components.dir in bridge.config.json names the folder).");
4362
+ for (const c of comps) {
4363
+ const d = c.docs;
4364
+ out.push(`### ${line(c.name)}`, "");
4365
+ const summary = line(d?.summary) || line(c.description);
4366
+ if (summary) out.push(summary, "");
4367
+ out.push(`- Family: ${line(c.category)}${c.docs?.status && c.docs.status !== "stable" ? `, ${c.docs.status}` : ""}`);
4368
+ if (c.allTokenPaths.length) out.push(`- Tokens: ${c.allTokenPaths.slice(0, 40).join(", ")}${c.allTokenPaths.length > 40 ? ", ..." : ""}`);
4369
+ for (const [label, list] of [
4370
+ ["Use it for", strings(d?.whenToUse)],
4371
+ ["Not for", strings(d?.whenNotToUse)],
4372
+ ["Accessibility", strings(d?.accessibility)]
4373
+ ]) {
4374
+ if (list.length) out.push(`- ${label}:`, ...list.map((x) => ` - ${x}`));
4375
+ }
4376
+ const dos = Array.isArray(d?.dos) ? d.dos : [];
4377
+ const donts = Array.isArray(d?.donts) ? d.donts : [];
4378
+ for (const g of dos) if (line(g?.title)) out.push(`- Do: ${line(g.title)}${line(g.text) ? `. ${line(g.text)}` : ""}`);
4379
+ for (const g of donts) if (line(g?.title)) out.push(`- Don't: ${line(g.title)}${line(g.text) ? `. ${line(g.text)}` : ""}`);
4380
+ out.push("");
4381
+ }
4382
+ return `${out.join("\n").replace(/\n{3,}/g, "\n\n").trim()}
4383
+ `;
4384
+ }
3356
4385
  export {
3357
- af as AAA_MIN,
3358
- ag as AA_MIN,
4386
+ al as AAA_MIN,
4387
+ am as AA_MIN,
3359
4388
  ADMIN_ROLE_ID,
3360
4389
  ANTHROPIC_MESSAGES_URL,
3361
4390
  BELL,
3362
4391
  BRAND_FONTS,
3363
4392
  BRAND_SLUG_RE,
3364
- ah2 as BULK_LIMIT,
3365
- ah as CHANGES_MODES,
3366
- ai2 as COLOR_FIELDS,
4393
+ am2 as BULK_LIMIT,
4394
+ an as CHANGES_MODES,
4395
+ an2 as COLOR_FIELDS,
3367
4396
  COMBINE_COMPARE_LIMIT,
3368
4397
  COMPARE_FILE_LIMIT,
3369
- aj2 as COMPONENT_SPECS_VERSION,
4398
+ ao2 as COMPONENT_SPECS_VERSION,
3370
4399
  CONFIG_FILE,
3371
- ak2 as CONFLICT_REASON,
3372
- ai as CONTRAST_CELL_MAX,
3373
- aj as CONTRAST_CHECKS_FILE,
3374
- ak as ConfigError,
3375
- al as DEFAULT_CHANGES_MODE,
3376
- al2 as DEFAULT_COMPONENT_SPECS_FILE,
3377
- am as DEFAULT_GOVERNANCE,
3378
- an as DEFAULT_OVERRIDE,
3379
- ao as DEFAULT_PRODUCTS,
3380
- am2 as DEFAULT_PROTECTED_BRANCHES,
3381
- ap as DEFAULT_RIGHTS,
4400
+ ap2 as CONFLICT_REASON,
4401
+ ao as CONTRAST_CELL_MAX,
4402
+ ap as CONTRAST_CHECKS_FILE,
4403
+ CONTRAST_THRESHOLDS,
4404
+ ConfigError,
4405
+ DEFAULT_CHANGES_MODE,
4406
+ aq2 as DEFAULT_COMPONENT_SPECS_FILE,
4407
+ aq as DEFAULT_GOVERNANCE,
4408
+ DEFAULT_OVERRIDE,
4409
+ DEFAULT_PRODUCTS,
4410
+ ar2 as DEFAULT_PROTECTED_BRANCHES,
4411
+ ar as DEFAULT_RIGHTS,
3382
4412
  DEFAULT_TOKEN_PATHS,
3383
- aq as DEFAULT_VISUAL_IMPACT,
4413
+ as as DEFAULT_VISUAL_IMPACT,
3384
4414
  DEMO_RELEASES,
3385
- an2 as DOCS_CHANGE_BUMP,
4415
+ as2 as DOCS_CHANGE_BUMP,
3386
4416
  DOCS_DRAFT_MODEL,
3387
- ao2 as DOCS_EDITOR_ORIGIN,
3388
- ap2 as DOCS_KEYS,
3389
- aq2 as DOCS_MCP_ORIGIN,
4417
+ at2 as DOCS_EDITOR_ORIGIN,
4418
+ au2 as DOCS_KEYS,
4419
+ av2 as DOCS_MCP_ORIGIN,
3390
4420
  DOCS_SELECTION_MODES,
3391
4421
  DRAFTED_BY_CLAUDE_LABEL,
3392
4422
  DRAFTS_DIR,
@@ -3399,15 +4429,15 @@ export {
3399
4429
  DRAFT_SUMMARY_SENTENCES,
3400
4430
  DRAFT_TITLE_MAX,
3401
4431
  DRAFT_VOICE_RULES,
3402
- ar as DTCG_TYPES,
4432
+ at as DTCG_TYPES,
3403
4433
  DraftPoller,
3404
- ar2 as EXPLORATION_CHECK,
4434
+ aw2 as EXPLORATION_CHECK,
3405
4435
  EXPLORATION_LABEL,
3406
4436
  EXPLORATION_NOTES_DIR,
3407
4437
  EXPLORATION_PREFIX,
3408
- as2 as EXPLORATION_STATUS_LABEL,
3409
- at2 as EXPLORATION_TIER_LABEL,
3410
- au2 as EXPLORATION_USE_CASES,
4438
+ ax2 as EXPLORATION_STATUS_LABEL,
4439
+ ay2 as EXPLORATION_TIER_LABEL,
4440
+ az2 as EXPLORATION_USE_CASES,
3411
4441
  EXT_ID,
3412
4442
  EXT_SCOPES,
3413
4443
  FIDELITY_DEFAULTS,
@@ -3418,242 +4448,260 @@ export {
3418
4448
  FIGMA_REFERENCE_STORY,
3419
4449
  FIGMA_SPEC_DIR,
3420
4450
  FROM_FIGMA_LABEL,
3421
- av2 as GitHubClient,
4451
+ aA2 as GitHubClient,
3422
4452
  GitHubError,
3423
- as as JsonParseError,
4453
+ au as JsonParseError,
3424
4454
  LIGHTNESS,
3425
- at as LINK_STATUS_TONE,
4455
+ av as LINK_STATUS_TONE,
4456
+ LLMS_MAX_TOKENS,
3426
4457
  LayeredTokenSet,
3427
4458
  MAX_TOGETHER,
3428
4459
  MIN_TOGETHER,
3429
4460
  NEEDED_BY_LABEL,
3430
4461
  NEUTRAL_ANCHORS,
3431
4462
  OVERRIDE_HEADING,
3432
- au as OWNER_GROUPS,
4463
+ aw as OWNER_GROUPS,
3433
4464
  OverrideMergeError,
3434
4465
  PIECES_FILE_LIMIT,
3435
4466
  PIN_TOLERANCE,
3436
- av as PREVIEW_APP_LABELS,
3437
- aw as PREVIEW_COMMENT_MARKER,
3438
- ax as PREVIEW_PLACEHOLDERS,
3439
- ay as PRIMITIVE_MODE,
3440
- az as PRODUCT_LABEL_PREFIX,
4467
+ ax as PREVIEW_APP_LABELS,
4468
+ ay as PREVIEW_COMMENT_MARKER,
4469
+ az as PREVIEW_PLACEHOLDERS,
4470
+ aA as PRIMITIVE_MODE,
4471
+ aB as PRODUCT_LABEL_PREFIX,
3441
4472
  PROSE_KEYS,
3442
4473
  PROTECTION_PARTS,
3443
4474
  PROTECTION_PART_PHRASE,
3444
- aw2 as PULL_STATE_PILL,
3445
- ax2 as ProtectedBranchError,
4475
+ aB2 as PULL_STATE_PILL,
4476
+ aC2 as ProtectedBranchError,
3446
4477
  RADIUS_PRESETS,
3447
- ay2 as REDUCED_MOTION_NOTE,
4478
+ aD2 as REDUCED_MOTION_NOTE,
4479
+ REPO_MODEL_DEFAULTS,
3448
4480
  REQUESTS_BRANCH,
3449
4481
  REQUEST_KINDS,
3450
4482
  REQUEST_LABEL,
3451
- az2 as REQUEST_STATUS_LABEL,
3452
- aA2 as REVIEW_STATUS_ORDER,
3453
- aA as RIGHTS,
3454
- aB as RIGHT_LABEL,
4483
+ aE2 as REQUEST_STATUS_LABEL,
4484
+ aF2 as REVIEW_STATUS_ORDER,
4485
+ aC as RIGHTS,
4486
+ aD as RIGHT_LABEL,
3455
4487
  RISK_LABELS,
3456
- aC as RISK_TIER,
4488
+ aE as RISK_TIER,
3457
4489
  SHARE_EXPLAIN,
3458
4490
  SIMILARITY_THRESHOLD,
3459
4491
  SINGLE_MODE,
3460
- aB2 as SPEC_FIELDS,
4492
+ SNAPSHOT_AUDITS_DIR,
4493
+ SNAPSHOT_BRANCH,
4494
+ SNAPSHOT_FILE,
4495
+ SNAPSHOT_LLMS_FILE,
4496
+ SNAPSHOT_MAX_BYTES,
4497
+ SNAPSHOT_SCHEMA_VERSION,
4498
+ aG2 as SPEC_FIELDS,
3461
4499
  STEPS,
3462
- aC2 as SUGGESTION_APPLIED_MARK,
3463
- aD2 as SUGGESTION_APPLY_EXIT,
3464
- aE2 as SUGGESTION_KINDS,
3465
- aF2 as SUGGESTION_LABEL,
3466
- aG2 as SUGGESTION_LIMITS,
3467
- aH2 as SUGGESTION_REVIEW_MARK,
4500
+ aH2 as SUGGESTION_APPLIED_MARK,
4501
+ aI2 as SUGGESTION_APPLY_EXIT,
4502
+ aJ2 as SUGGESTION_KINDS,
4503
+ aK2 as SUGGESTION_LABEL,
4504
+ aL2 as SUGGESTION_LIMITS,
4505
+ aM2 as SUGGESTION_REVIEW_MARK,
3468
4506
  SUGGESTION_SCHEMA,
3469
- aI2 as SUGGESTION_STATE_LABELS,
3470
- aJ2 as SUGGESTION_STATUS_LABEL,
3471
- aK2 as SUGGESTION_TOO_LARGE,
4507
+ aN2 as SUGGESTION_STATE_LABELS,
4508
+ aO2 as SUGGESTION_STATUS_LABEL,
4509
+ aP2 as SUGGESTION_TOO_LARGE,
4510
+ SnapshotError,
3472
4511
  StorybookIndexError,
3473
- aL2 as SuggestionError,
4512
+ aQ2 as SuggestionError,
3474
4513
  TIER_AXIS,
3475
4514
  TIER_NAMES,
3476
- aD as TIER_ORDER,
3477
- aM2 as TOKEN_REJECTED_MESSAGE,
3478
- aN2 as TOKEN_SETTINGS_URL,
3479
- aO2 as TRIGGER_LABELS,
3480
- aE as TeamDirectory,
3481
- aP2 as UNRELEASED,
3482
- aF as VISUAL_CHECK_LABEL,
4515
+ aF as TIER_ORDER,
4516
+ aR2 as TOKEN_REJECTED_MESSAGE,
4517
+ aS2 as TOKEN_SETTINGS_URL,
4518
+ aT2 as TRIGGER_LABELS,
4519
+ aG as TeamDirectory,
4520
+ aU2 as UNRELEASED,
4521
+ aH as VISUAL_CHECK_LABEL,
3483
4522
  WAITING_FOR_CLAUDE_LABEL,
3484
- aQ2 as acceptDocsDraft,
3485
- aR2 as acceptDocsText,
4523
+ aV2 as acceptDocsDraft,
4524
+ aW2 as acceptDocsText,
4525
+ accessAtLeast,
4526
+ accessState,
3486
4527
  addBrandToConfigText,
3487
4528
  addedComment,
3488
- aG as affectedContrast,
3489
- aH as aliasOf,
4529
+ aI as affectedContrast,
4530
+ aJ as aliasOf,
3490
4531
  aliasTarget,
3491
- aS2 as allowedMergeMethods,
3492
- aT2 as anatomyLabel,
4532
+ aX2 as allowedMergeMethods,
4533
+ aY2 as anatomyLabel,
3493
4534
  anchoredRamp,
3494
4535
  anthropicReplyText,
3495
4536
  anthropicRequest,
3496
- aI as appForProject,
3497
- aJ as appUrl,
4537
+ aK as appForProject,
4538
+ aL as appUrl,
3498
4539
  applyConfirmedRenames,
3499
4540
  applyDocsSections,
3500
4541
  applyTokenEdits,
3501
4542
  applyTokenMerge,
3502
- aK as approverEntries,
3503
- aL as approverLists,
4543
+ aM as approverEntries,
4544
+ aN as approverLists,
3504
4545
  askOthersToReviewOnGitHub,
3505
- aU2 as assertSafeBranch,
3506
- aV2 as assignRequestOnGitHub,
3507
- aW2 as assignVersions,
3508
- aX2 as base64ToUtf8,
3509
- aM as baseBranchOf,
4546
+ aZ2 as assertSafeBranch,
4547
+ a_2 as assignRequestOnGitHub,
4548
+ a$2 as assignVersions,
4549
+ auditId,
4550
+ b02 as base64ToUtf8,
4551
+ aO as baseBranchOf,
3510
4552
  bellChroma,
3511
- aN as branchName,
4553
+ aP as branchName,
3512
4554
  branchPreviewUrls,
3513
- aO as branchSlug,
4555
+ aQ as branchSlug,
3514
4556
  branchWithJiraKey,
3515
4557
  brandDisplayName,
3516
4558
  brandPreviewVariables,
3517
- aY2 as bridgeMcpInstallCommand,
4559
+ b12 as bridgeMcpInstallCommand,
3518
4560
  buildFidelityReport,
3519
4561
  buildHistoryEntry,
3520
4562
  buildReport,
4563
+ buildSnapshot,
4564
+ buildTokenRows,
3521
4565
  buildTokenSet,
3522
4566
  buildUsageIndex,
3523
4567
  canAddTo,
3524
- aZ2 as canOverride,
4568
+ b22 as canOverride,
3525
4569
  canShare,
3526
- aP as canShip,
3527
- a_2 as canonicalJson,
4570
+ aR as canShip,
4571
+ b32 as canonicalJson,
3528
4572
  changeEdits,
3529
- aQ as changeKind,
4573
+ aS as changeKind,
3530
4574
  changeList,
3531
- a$2 as changeTable,
3532
- aR as changedModes,
3533
- aS as changesMode,
3534
- b02 as changesetBump,
4575
+ b42 as changeTable,
4576
+ aT as changedModes,
4577
+ aU as changesMode,
4578
+ b52 as changesetBump,
3535
4579
  checkBrandSlug,
3536
4580
  checkLayeredPair,
3537
4581
  choiceFor,
3538
- b12 as classifyAuth,
4582
+ b62 as classifyAuth,
3539
4583
  classifyLayered,
3540
4584
  classifyRisk,
3541
- b22 as cleanDocs,
4585
+ b72 as cleanDocs,
3542
4586
  cleanDocsText,
3543
4587
  cleanDraftText,
3544
- aT as clearRawDeep,
4588
+ aV as clearRawDeep,
4589
+ b82 as clearSharedEtags,
3545
4590
  closeExplorationOnGitHub,
3546
4591
  closeOnGitHub,
3547
- b32 as closingIssueNumbers,
4592
+ b92 as closingIssueNumbers,
3548
4593
  coerceValue,
3549
4594
  collectHistory,
3550
4595
  collectRefs,
3551
4596
  colorDelta,
3552
- aU as colorToCss,
3553
- aV as colorsEqual,
4597
+ aW as colorToCss,
4598
+ aX as colorsEqual,
3554
4599
  combineChanges,
3555
4600
  combineConflicts,
3556
- aW as comboKey,
4601
+ aY as comboKey,
3557
4602
  commentOnGitHub,
3558
- b42 as commitFileOnGitHub,
4603
+ ba2 as commitFileOnGitHub,
3559
4604
  commitLibraryResolution,
3560
- aX as commitMessage,
3561
- aY as compactJson,
4605
+ aZ as commitMessage,
4606
+ a_ as compactJson,
3562
4607
  compareImages,
3563
- b52 as componentContrastPairs,
4608
+ bb2 as componentContrastPairs,
3564
4609
  componentForPath,
3565
- b62 as componentMotion,
4610
+ bc2 as componentMotion,
4611
+ componentSlug,
3566
4612
  componentSpecSuggestionPayload,
3567
- b72 as componentsUsingMotionToken,
3568
- b82 as composeChangeset,
4613
+ bd2 as componentsUsingMotionToken,
4614
+ be2 as composeChangeset,
3569
4615
  composeFiles,
3570
4616
  composeNewBrandBody,
3571
4617
  composePendingDrafts,
3572
- aZ as composePrBody,
4618
+ a$ as composePrBody,
3573
4619
  composeProposalBody,
3574
4620
  composeRequestIssue,
3575
- b92 as composeSuggestionAppliedComment,
3576
- ba2 as composeSuggestionIssue,
3577
- bb2 as composeSuggestionReviewComment,
3578
- a_ as composite,
4621
+ bf2 as composeSuggestionAppliedComment,
4622
+ bg2 as composeSuggestionIssue,
4623
+ bh2 as composeSuggestionReviewComment,
4624
+ b0 as composite,
3579
4625
  conflictRoute,
3580
- a$ as contextFor,
4626
+ b1 as contextFor,
3581
4627
  contextLabel,
3582
- bc2 as continueDocsProposalOnGitHub,
4628
+ bi2 as continueDocsProposalOnGitHub,
3583
4629
  contrastDelta,
3584
- bd2 as contrastDeltaTable,
3585
- b0 as contrastLevel,
3586
- b1 as contrastPair,
3587
- b2 as contrastRatio,
4630
+ bj2 as contrastDeltaTable,
4631
+ b2 as contrastLevel,
4632
+ b3 as contrastPair,
4633
+ b4 as contrastRatio,
3588
4634
  contrastScope,
3589
- be2 as countChanges,
3590
- bf2 as coverageSummary,
4635
+ bk2 as countChanges,
4636
+ bl2 as coverageSummary,
3591
4637
  createDocsDraftSession,
3592
4638
  createPendingDrafts,
3593
4639
  createSuggestionOnGitHub,
3594
- bg2 as cssModuleClasses,
4640
+ bm2 as cssModuleClasses,
3595
4641
  cssOf,
3596
4642
  cssVarOf,
3597
4643
  cssVarsIn,
3598
- bh2 as declineComment,
3599
- bi2 as declineReasonProblems,
3600
- bj2 as declineRequestOnGitHub,
3601
- bk2 as declineSuggestionOnGitHub,
4644
+ bn2 as declineComment,
4645
+ bo2 as declineReasonProblems,
4646
+ bp2 as declineRequestOnGitHub,
4647
+ bq2 as declineSuggestionOnGitHub,
3602
4648
  decodePicks,
3603
4649
  defaultChoiceFor,
3604
- b3 as defaultContext,
3605
- bl2 as defaultDocsFooter,
4650
+ b5 as defaultContext,
4651
+ br2 as defaultDocsFooter,
3606
4652
  defaultFile,
4653
+ defaultModelConfig,
3607
4654
  defaultProduct,
3608
4655
  defaultScopes,
3609
- b4 as defaultTitle,
3610
- b5 as defineConfig,
4656
+ b6 as defaultTitle,
4657
+ defineConfig,
3611
4658
  deletePendingDrafts,
3612
4659
  demoHistory,
3613
- b6 as detectLayout,
4660
+ b7 as detectLayout,
3614
4661
  diffLayered,
3615
4662
  dismissStaleFrom,
3616
- bm2 as docsAuthorLine,
3617
- bn2 as docsFileText,
4663
+ bs2 as docsAuthorLine,
4664
+ bt2 as docsFileText,
3618
4665
  docsPrompt,
3619
- bo2 as docsProposal,
3620
- bp2 as docsSectionShapes,
4666
+ bu2 as docsProposal,
4667
+ bv2 as docsSectionShapes,
3621
4668
  docsSectionsAnswer,
3622
4669
  docsSectionsResult,
3623
4670
  docsSelectionPrompt,
3624
- bq2 as docsSlug,
3625
- br2 as docsSuggestionPayload,
4671
+ bw2 as docsSlug,
4672
+ bx2 as docsSuggestionPayload,
3626
4673
  docsTaskKeys,
3627
4674
  docsTaskPrompt,
3628
- bs2 as docsText,
3629
- bt2 as draftChangeLine,
4675
+ by2 as docsText,
4676
+ bz2 as draftChangeLine,
3630
4677
  draftImagePath,
3631
4678
  draftItemBrief,
3632
- bu2 as draftPushDescription,
3633
- bv2 as draftRequestText,
4679
+ bA2 as draftPushDescription,
4680
+ bB2 as draftRequestText,
3634
4681
  draftSessionPath,
3635
4682
  dtcgColor,
3636
4683
  effectiveScopes,
3637
- bw2 as effectiveTier,
3638
- bx2 as eligibleReviewers,
4684
+ bC2 as effectiveTier,
4685
+ bD2 as eligibleReviewers,
3639
4686
  emptyTokenFile,
3640
4687
  encodePicks,
3641
4688
  ensureRequestsBranch,
3642
- b7 as entriesFor,
3643
- b8 as entryLabel,
4689
+ b8 as entriesFor,
4690
+ b9 as entryLabel,
4691
+ evaluateContrastPairs,
3644
4692
  evaluatePairs,
3645
- b9 as expandEntries,
3646
- ba as expandOwners,
3647
- by2 as explorationBranch,
4693
+ ba as expandEntries,
4694
+ bb as expandOwners,
4695
+ bE2 as explorationBranch,
3648
4696
  explorationNote,
3649
4697
  explorationNotePath,
3650
4698
  explorationPrBody,
3651
4699
  explorationPrTitle,
3652
4700
  explorationProblems,
3653
- bz2 as explorationRules,
3654
- bA2 as explorationShareMessage,
4701
+ bF2 as explorationRules,
4702
+ bG2 as explorationShareMessage,
3655
4703
  explorationSlug,
3656
- bB2 as explorationSlugFromBranch,
4704
+ bH2 as explorationSlugFromBranch,
3657
4705
  explorationStatus,
3658
4706
  explorationSummary,
3659
4707
  explorationTestBuildOnGitHub,
@@ -3662,9 +4710,9 @@ export {
3662
4710
  fetchStorybookIndex,
3663
4711
  fidelityComponentLine,
3664
4712
  fidelityVerdict,
3665
- bb as fieldChanges,
4713
+ bc as fieldChanges,
3666
4714
  figmaBranchTitle,
3667
- bC2 as figmaCell,
4715
+ bI2 as figmaCell,
3668
4716
  figmaChangeOnGitHub,
3669
4717
  figmaDraftBody,
3670
4718
  figmaDraftBrief,
@@ -3675,44 +4723,49 @@ export {
3675
4723
  figmaPushStatusesOnGitHub,
3676
4724
  figmaSpecPath,
3677
4725
  figmaSpecSlug,
3678
- bD2 as fileModes,
3679
- bE2 as filterHistory,
4726
+ bJ2 as fileModes,
4727
+ bK2 as filterHistory,
3680
4728
  findExplorationOnGitHub,
3681
- bF2 as findOpenDocsProposal,
3682
- bG2 as findOpenDocsProposalOnGitHub,
4729
+ bL2 as findOpenDocsProposal,
4730
+ bM2 as findOpenDocsProposalOnGitHub,
3683
4731
  findPreviewComment,
3684
- bc as findProduct,
4732
+ bd as findProduct,
3685
4733
  findReferenceProblems,
3686
- bd as findToken,
3687
- be as findVercelComment,
3688
- bH2 as firstParagraph,
3689
- bf as flattenLayerFile,
4734
+ be as findToken,
4735
+ bf as findVercelComment,
4736
+ bN2 as firstParagraph,
4737
+ bg as flattenLayerFile,
4738
+ flattenTokenFile,
3690
4739
  flattenTokens,
3691
4740
  formatChangeset,
3692
- bI2 as formatDocsJson,
4741
+ bO2 as formatDocsJson,
3693
4742
  formatFigmaSpec,
3694
- bg as formatNumber,
3695
- bh as formatOwnerEntry,
4743
+ bh as formatNumber,
4744
+ bi as formatOwnerEntry,
3696
4745
  formatValue,
3697
4746
  freshness,
3698
- bJ2 as friendlyMessage,
4747
+ bP2 as friendlyMessage,
3699
4748
  fromHex,
3700
- bi as fromPlain,
4749
+ bj as fromPlain,
3701
4750
  generateRamp,
3702
- bj as getChild,
3703
- bk as getEntry,
3704
- bK2 as getSuggestionOnGitHub,
4751
+ bk as getChild,
4752
+ bl as getEntry,
4753
+ bQ2 as getSuggestionOnGitHub,
3705
4754
  gitBlobSha,
3706
4755
  gitHubHistoryBackend,
3707
- bl as globToRegExp,
4756
+ gitHubSource,
4757
+ globBase,
4758
+ globToRegExp,
3708
4759
  groupStorybookComponents,
3709
4760
  bm as groupsPhrase,
3710
- bL2 as hasSuggestionBlock,
3711
- bM2 as hasWriteAccess,
3712
- bN2 as hashSpec,
4761
+ bR2 as hasSuggestionBlock,
4762
+ bS2 as hasWriteAccess,
4763
+ bT2 as hashSpec,
4764
+ hexContrastRatio,
4765
+ hexLuminance,
3713
4766
  bn as hexToRgba,
3714
4767
  bo as holdersOf,
3715
- bO2 as iconComponentName,
4768
+ bU2 as iconComponentName,
3716
4769
  idExtensionFor,
3717
4770
  impactedModules,
3718
4771
  importsIn,
@@ -3720,219 +4773,241 @@ export {
3720
4773
  bq as inheritedTypeAt,
3721
4774
  br as installCommand,
3722
4775
  bs as installCommandFromPreviewComment,
3723
- bP2 as isActiveExploration,
3724
- isAlias,
3725
- bQ2 as isAutomationPull,
3726
- bR2 as isDocsProposalBranch,
4776
+ bV2 as installationFor,
4777
+ bW2 as isActiveExploration,
4778
+ isAlias$1 as isAlias,
4779
+ bX2 as isAutomationPull,
4780
+ bY2 as isDocsProposalBranch,
3727
4781
  isDocsSelectionMode,
3728
4782
  isDraftSessionId,
3729
4783
  isExplorationBranch,
3730
4784
  isExplorationPull,
3731
4785
  bt as isGuardrail,
3732
- bS2 as isGuardrailPath,
4786
+ bZ2 as isGuardrailPath,
3733
4787
  isHex,
3734
- bT2 as isJiraKey,
3735
- bU2 as isMissingPermission,
4788
+ b_2 as isJiraKey,
4789
+ b$2 as isMissingPermission,
3736
4790
  isMultiMode,
3737
4791
  isPlanRefusal,
3738
4792
  isProseKey,
3739
- bV2 as isReleasePull,
4793
+ c02 as isReleasePull,
3740
4794
  bu as isTeamEntry,
3741
4795
  bv as isTokenFile,
3742
- bW2 as isTokenRejected,
4796
+ c12 as isTokenRejected,
4797
+ isUnder,
3743
4798
  bw as isVercelComment,
3744
- bX2 as jiraIssueFields,
3745
- bY2 as jiraKeyOf,
4799
+ c22 as jiraIssueFields,
4800
+ c32 as jiraKeyOf,
4801
+ c42 as joinRepoPath,
3746
4802
  bx as kindForMin,
3747
4803
  layeredImpact,
3748
4804
  by as layeredParityIssues,
3749
4805
  layoutOptions,
3750
4806
  levenshtein,
3751
4807
  libraryBranchPlan,
4808
+ bz as libraryIsPublic,
3752
4809
  libraryPreviewState,
3753
- bZ2 as linkRequestToExplorationOnGitHub,
4810
+ c52 as linkRequestToExplorationOnGitHub,
3754
4811
  linkStatus,
3755
- b_2 as linkSuggestionPrOnGitHub,
4812
+ c62 as linkSuggestionPrOnGitHub,
3756
4813
  linkedLibraryBranchOnGitHub,
3757
- b$2 as linkedPullsOf,
4814
+ c72 as linkedPullsOf,
3758
4815
  listBrands,
3759
4816
  listExplorationsOnGitHub,
3760
4817
  listFigmaChangesOnGitHub,
3761
4818
  listPendingDrafts,
3762
- c02 as listSuggestionsOnGitHub,
4819
+ listStylesheets,
4820
+ c82 as listSuggestionsOnGitHub,
3763
4821
  loadConfig,
3764
4822
  loadGitHubHistory,
3765
4823
  loadProtection,
3766
- c12 as loadRepoFiles,
4824
+ c92 as loadRepoFiles,
4825
+ loadRepoModel,
3767
4826
  loadRequiredChecks,
3768
- bz as luminance,
4827
+ bA as luminance,
3769
4828
  mailtoHref,
3770
4829
  markClaudeDraft,
3771
4830
  markFigmaChangeDraftedOnGitHub,
4831
+ ca2 as memoryEtagStore,
4832
+ cb2 as memorySource,
3772
4833
  mergeDocsDraft,
3773
4834
  mergeDraftResults,
3774
- c22 as mergeGate,
4835
+ cc2 as mergeGate,
3775
4836
  mergeOnGitHub,
3776
4837
  mergePiecesRecord,
3777
4838
  mergeReleases,
3778
4839
  missingChoices,
3779
- c32 as missingPermissionMessage,
3780
- c42 as missingProse,
4840
+ cd2 as missingPermissionMessage,
4841
+ ce2 as missingProse,
3781
4842
  modeDisplayName,
3782
4843
  modeFile,
3783
- c52 as modeLabel,
4844
+ cf2 as modeLabel,
3784
4845
  modesOf$1 as modesOf,
3785
4846
  moveToken,
3786
- bA as nearestQuestion,
4847
+ bB as nearestQuestion,
3787
4848
  nearestStep,
3788
- bB as neededBySection,
3789
- c62 as needsDocsReview,
4849
+ bC as neededBySection,
4850
+ cg2 as needsDocsReview,
3790
4851
  neutralChroma,
3791
4852
  neutralOffset,
3792
4853
  newBrandSection,
3793
4854
  newDraftSessionId,
3794
- bC as nodesEqual,
3795
- bD as normalizeRights,
4855
+ bD as nodesEqual,
4856
+ normalizeRepoPath,
4857
+ bE as normalizeRights,
3796
4858
  normalizeStorybookUrl,
3797
4859
  oklch,
3798
4860
  oklchToLinear,
3799
4861
  onlyTokens,
3800
4862
  openComponentPushOnGitHub,
3801
4863
  openLibraryBranchOnGitHub,
3802
- c72 as openPulls,
4864
+ ch2 as openPulls,
3803
4865
  overlap,
3804
4866
  overrideComment,
3805
- bE as overrideKey,
4867
+ bF as overrideKey,
3806
4868
  overrideMergeOnGitHub,
3807
- c82 as overrideReasonProblem,
4869
+ ci2 as overrideReasonProblem,
3808
4870
  overrideRefusedComment,
3809
- bF as ownerEntryProblems,
4871
+ bG as ownerEntryProblems,
3810
4872
  packageDir,
3811
4873
  packageDirCandidates,
3812
- bG as pairKey,
4874
+ bH as pairKey,
4875
+ parentDir,
3813
4876
  parseChangelog,
3814
- c92 as parseChangesetText,
4877
+ cj2 as parseChangesetText,
3815
4878
  parseColor,
3816
- ca2 as parseComponentSpecs,
4879
+ parseComponentCss,
4880
+ parseComponentFamilies,
4881
+ parseComponentSpecs,
4882
+ parseComponentStories,
4883
+ parseComponentTsx,
3817
4884
  parseContrastChecks,
3818
- bH as parseDimension,
4885
+ parseContrastSpecs,
4886
+ bI as parseDimension,
3819
4887
  parseDocsReply,
3820
4888
  parseDocsTaskAnswer,
3821
4889
  parseExplorationBody,
3822
4890
  parseFigmaOrigin,
3823
4891
  parseFigmaSpec,
3824
- cb2 as parseJiraKey,
3825
- bI as parseJson,
3826
- bJ as parseNeededBy,
3827
- cc2 as parseOverrideComment,
3828
- bK as parseOwnerEntry,
4892
+ ck2 as parseJiraKey,
4893
+ bJ as parseJson,
4894
+ parseModelConfig,
4895
+ bK as parseNeededBy,
4896
+ cl2 as parseOverrideComment,
4897
+ bL as parseOwnerEntry,
3829
4898
  parsePendingDrafts,
3830
4899
  parsePiecesRecord,
3831
- cd2 as parseRepo,
3832
- ce2 as parseRequestIssue,
4900
+ cm2 as parseRepo,
4901
+ cn2 as parseRequestIssue,
4902
+ parseSnapshot,
3833
4903
  parseStorybookIndex,
3834
- cf2 as parseStructureChange,
3835
- cg2 as parseSuggestionAppliedComment,
3836
- ch2 as parseSuggestionIssue,
3837
- ci2 as parseSuggestionReviewComment,
3838
- cj2 as parseTier,
4904
+ co2 as parseStructureChange,
4905
+ cp2 as parseSuggestionAppliedComment,
4906
+ cq2 as parseSuggestionIssue,
4907
+ cr2 as parseSuggestionReviewComment,
4908
+ cs2 as parseTier,
3839
4909
  parseTokenFile,
3840
- bL as parseVercelComment,
3841
- ck2 as patchDocsJson,
4910
+ bM as parseVercelComment,
4911
+ ct as patchDocsJson,
3842
4912
  pathId,
3843
4913
  pathSimilarity,
3844
- cl2 as pendingApprovals,
3845
- cm2 as permissionLabel,
4914
+ cu as pendingApprovals,
4915
+ cv as permissionLabel,
3846
4916
  pickedOption,
3847
4917
  p as pieceId,
3848
- bM as piecesSection,
3849
- bN as plainEqual,
4918
+ bN as piecesSection,
4919
+ bO as plainEqual,
3850
4920
  planComponentPush,
3851
4921
  planNewBrand,
3852
4922
  planReference,
3853
4923
  planReferences,
3854
- cn2 as planRestore,
3855
- co2 as planRevert,
3856
- cp2 as planSuggestionApply,
3857
- cq2 as planToJson,
4924
+ cw as planRestore,
4925
+ cx as planRevert,
4926
+ cy as planSuggestionApply,
4927
+ cz as planToJson,
3858
4928
  planTokenMerge,
3859
4929
  planTokenProposal,
3860
- cr2 as prNumberFromSubject,
3861
- cs as prefillDocs,
3862
- bO as previewComment,
4930
+ cA as prNumberFromSubject,
4931
+ cB as prefillDocs,
4932
+ bP as previewComment,
3863
4933
  previewLinks,
3864
- bP as previewLinksOf,
4934
+ bQ as previewLinksOf,
3865
4935
  previewOverrides,
3866
- bQ as previewUrl,
4936
+ bR as previewUrl,
3867
4937
  previewsSettled,
3868
4938
  productBranchRef,
3869
4939
  productBranchSentence,
3870
4940
  productBranchViewOnGitHub,
3871
- bR as productForPlace,
3872
- bS as productLabel,
3873
- bT as productMarks,
4941
+ bS as productForPlace,
4942
+ bT as productLabel,
4943
+ bU as productMarks,
3874
4944
  productOfBranch,
3875
4945
  productPreview,
3876
- bU as productProblems,
3877
- bV as productsOf,
3878
- bW as projectOfLabel,
4946
+ bV as productProblems,
4947
+ bW as productsOf,
4948
+ bX as projectOfLabel,
3879
4949
  promoteExplorationOnGitHub,
3880
4950
  promotionPlan,
3881
- ct as proposeDocsOnGitHub,
4951
+ cC as proposeDocsOnGitHub,
3882
4952
  a as proposedTokenPath,
3883
- cu as propsTable,
4953
+ cD as propsTable,
3884
4954
  protectLibrary,
3885
4955
  protectRefusal,
3886
- bX as protectedBranchesOf,
4956
+ bY as protectedBranchesOf,
3887
4957
  protectionRuleset,
3888
4958
  protectionRulesetName,
3889
4959
  protectionSentence,
3890
4960
  protectionState,
3891
- cv as pullState,
3892
- cw as pushChangeRows,
3893
- cx as rateLimitMessage,
4961
+ cE as pullState,
4962
+ cF as pushChangeRows,
4963
+ cG as rateLimitMessage,
3894
4964
  readCombineBranch,
3895
4965
  readLibraryConflicts,
3896
4966
  readPendingDrafts,
3897
4967
  readPreviewComment,
3898
4968
  readProductBranchOnGitHub,
4969
+ readRepoTexts,
4970
+ readStylesheets,
3899
4971
  readTokenAt,
3900
4972
  reconcileIds,
3901
4973
  recordPiecesOnGitHub,
4974
+ recordingSource,
3902
4975
  referenceImagePath,
3903
- cy as releasePull,
4976
+ cH as releasePull,
3904
4977
  releasesFromTags,
3905
4978
  removeToken,
3906
4979
  removedSide,
3907
- bY as renderedColor,
3908
- cz as reopenEligibility,
4980
+ bZ as renderedColor,
4981
+ cI as reopenEligibility,
3909
4982
  reopenOnGitHub,
3910
- cA as requestBrief,
3911
- cB as requestImagePath,
3912
- cC as requestIssueTitle,
3913
- cD as requestStatus,
3914
- cE as requiredApprovals,
4983
+ cJ as requestBrief,
4984
+ cK as requestImagePath,
4985
+ cL as requestIssueTitle,
4986
+ cM as requestStatus,
4987
+ cN as requiredApprovals,
3915
4988
  requiredCheckNames,
3916
- cF as requiredPermission,
4989
+ cO as requiredPermission,
3917
4990
  resolutionMessage,
3918
4991
  resolve,
3919
4992
  resolveBranchPreviews,
4993
+ resolveInheritedTokens,
4994
+ resolveRepoAccess,
3920
4995
  resolvedTokenFiles,
3921
4996
  reviewOnGitHub,
3922
- cG as reviewQueue,
3923
- cH as reviewStatusKind,
3924
- cI as reviewSuggestionOnGitHub,
3925
- cJ as reviewersToAsk,
3926
- bZ as rgbaToDtcg,
4997
+ cP as reviewQueue,
4998
+ cQ as reviewStatusKind,
4999
+ cR as reviewSuggestionOnGitHub,
5000
+ cS as reviewersToAsk,
5001
+ b_ as rgbaToDtcg,
3927
5002
  rgbaToHex,
3928
- b_ as rightsProblems,
5003
+ b$ as rightsProblems,
3929
5004
  round3,
3930
5005
  rulesSettingsUrl,
3931
5006
  rulesetTargetsDefault,
3932
5007
  runLayeredContrast,
3933
- b$ as sameProducts,
5008
+ c0 as sameProducts,
3934
5009
  sameScopes,
3935
- c0 as sameToken,
5010
+ c1 as sameToken,
3936
5011
  sanitizeDocsReplacement,
3937
5012
  sanitizeDocsResult,
3938
5013
  sanitizeDocsSections,
@@ -3940,119 +5015,135 @@ export {
3940
5015
  sanitizeDraftText,
3941
5016
  sanitizeDraftTitle,
3942
5017
  sanitizeResultLines,
3943
- cK as sectionsNeedingReview,
5018
+ scanComponents,
5019
+ cT as sectionsNeedingReview,
3944
5020
  selectTokenFiles,
3945
- c1 as serializeJson,
5021
+ c2 as serializeJson,
3946
5022
  serializePendingDrafts,
3947
5023
  serializeTokenFile,
3948
- cL as sha256Hex,
5024
+ cU as sha256Hex,
3949
5025
  shadowedEdits,
3950
5026
  shareDescription,
3951
5027
  shareMessage,
3952
5028
  shareState,
3953
- c2 as shipPolicy,
3954
- cM as shortVariant,
3955
- cN as shortVariants,
5029
+ c3 as shipPolicy,
5030
+ cV as shortVariant,
5031
+ cW as shortVariants,
3956
5032
  showShare,
5033
+ siteRepoFromConfig,
3957
5034
  slugify,
3958
- c3 as snapshotUrl,
3959
- c4 as soloApprover,
3960
- c5 as soloOwnerOf,
3961
- c6 as soloOwnerSentence,
3962
- cO as specHash,
3963
- cP as specsUsage,
5035
+ snapshotAudit,
5036
+ snapshotIsFresh,
5037
+ snapshotLlmsTxt,
5038
+ snapshotSource,
5039
+ snapshotSummary,
5040
+ c4 as snapshotUrl,
5041
+ c5 as soloApprover,
5042
+ c6 as soloOwnerOf,
5043
+ c7 as soloOwnerSentence,
5044
+ cX as specHash,
5045
+ cY as specsUsage,
3964
5046
  stableCommand,
3965
5047
  startExplorationOnGitHub,
3966
5048
  stateSentence,
3967
5049
  storybookIframeUrl,
3968
5050
  storybookIndexUrls,
3969
5051
  storybookManagerUrl,
3970
- c7 as storybookUrl,
3971
- c8 as suggestNearestComment,
5052
+ c8 as storybookUrl,
5053
+ styleGlobs,
5054
+ c9 as suggestNearestComment,
3972
5055
  suggestTokenProposalOnGitHub,
3973
- cQ as suggestionAllowedRoots,
3974
- cR as suggestionAppliedComment,
3975
- cS as suggestionApplyTable,
3976
- cT as suggestionIssueTitle,
3977
- cU as suggestionKindFromLabels,
3978
- cV as suggestionLabels,
3979
- cW as suggestionPathProblems,
3980
- cX as suggestionPayloadSha,
3981
- cY as suggestionReviewState,
3982
- cZ as suggestionShapeProblems,
5056
+ cZ as suggestionAllowedRoots,
5057
+ c_ as suggestionAppliedComment,
5058
+ c$ as suggestionApplyTable,
5059
+ d0 as suggestionIssueTitle,
5060
+ d1 as suggestionKindFromLabels,
5061
+ d2 as suggestionLabels,
5062
+ d3 as suggestionPathProblems,
5063
+ d4 as suggestionPayloadSha,
5064
+ d5 as suggestionReviewState,
5065
+ d6 as suggestionShapeProblems,
3983
5066
  suggestionStateFromLabels,
3984
- c_ as suggestionStateLabel,
5067
+ d7 as suggestionStateLabel,
3985
5068
  suggestionStatus,
3986
- c$ as suggestionSubject,
3987
- d0 as summarizeApprovals,
3988
- d1 as summarizeCi,
5069
+ d8 as suggestionSubject,
5070
+ d9 as summarizeApprovals,
5071
+ da as summarizeCi,
3989
5072
  summarizeComponent,
3990
- d2 as summarizeSuggestionApprovals,
3991
- c9 as summarizeTokenChange,
5073
+ db as summarizeSuggestionApprovals,
5074
+ ca as summarizeTokenChange,
3992
5075
  switchToPublishedOnGitHub,
3993
- d3 as syncSuggestionStateLabel,
5076
+ dc as syncSuggestionStateLabel,
3994
5077
  takeMine,
3995
- ca as tarballAssetName,
3996
- cb as tarballUrl,
3997
- cc as teamKey,
3998
- cd as teamKeyOf,
3999
- ce as teamUnreadableMessage,
4000
- cf as teamsIn,
5078
+ cb as tarballAssetName,
5079
+ cc as tarballUrl,
5080
+ cd as teamKey,
5081
+ ce as teamKeyOf,
5082
+ cf as teamUnreadableMessage,
5083
+ cg as teamsIn,
4001
5084
  threeWayDiff,
4002
5085
  tintedNeutral,
4003
- d4 as titleOf,
5086
+ dd as titleOf,
4004
5087
  titleWithJiraKey,
4005
- cg as toAlias,
4006
- d5 as toChangeSummary,
5088
+ ch as toAlias,
5089
+ de as toChangeSummary,
4007
5090
  toConfigJson,
4008
5091
  toHex,
4009
- ch as toMap,
5092
+ ci as toMap,
4010
5093
  toOklch,
4011
- ci as toPlain,
4012
- cj as tokenBump,
4013
- d6 as tokenCssVar,
5094
+ cj as toPlain,
5095
+ ck as tokenBump,
5096
+ df as tokenCssVar,
4014
5097
  tokenFilesOf,
4015
- d7 as tokenHistory,
5098
+ dg as tokenFingerprint,
5099
+ dh as tokenHistory,
4016
5100
  t as tokenLabel,
4017
- ck as tokenNode,
5101
+ cl as tokenNode,
5102
+ tokenRowAxes,
5103
+ tokenRowCssVar,
5104
+ tokenRowFigmaName,
5105
+ tokenRowFiles,
5106
+ tokenRowIndex,
4018
5107
  tokenSuggestionPayload,
4019
5108
  tokenUsage,
5109
+ tokenValueCss,
4020
5110
  tokensPath,
4021
5111
  touchesPackages,
4022
5112
  tryInProductUrl,
4023
5113
  tryTogetherUrl,
4024
5114
  unpicked,
4025
- cl as unreadableShipTeams,
4026
- cm as unreadableTeams,
4027
- d8 as unsafePathProblem,
5115
+ cm as unreadableShipTeams,
5116
+ cn as unreadableTeams,
5117
+ di as unsafePathProblem,
4028
5118
  updatePendingDrafts,
4029
5119
  upsertToken,
4030
5120
  useLibraryPreviewOnGitHub,
4031
- d9 as utf8ToBase64,
4032
- da as validateComponentSpec,
4033
- db as validateDocs,
5121
+ dj as utf8ToBase64,
5122
+ dk as validateComponentSpec,
5123
+ dl as validateDocs,
4034
5124
  validateDocsTask,
4035
- dc as validateIntegrations,
5125
+ dm as validateIntegrations,
4036
5126
  validateLayered,
4037
5127
  validatePendingDrafts,
4038
5128
  validateProposal,
4039
5129
  validateSet,
4040
- cn as valueIn,
4041
- co as valueToCss,
5130
+ co as valueIn,
5131
+ cp as valueToCss,
4042
5132
  valuesEqual,
4043
5133
  variantKeyOf,
4044
- dd as variantName,
4045
- de as versionTimeline,
4046
- cp as visualImpactProblems,
4047
- cq as whoCanShipSentence,
4048
- cr as whyItExists,
4049
- df as withAuthorLine,
5134
+ dn as variantName,
5135
+ dp as versionTimeline,
5136
+ cq as visualImpactProblems,
5137
+ dq as webStorageEtagStore,
5138
+ cr as whoCanShipSentence,
5139
+ cs as whyItExists,
5140
+ dr as withAuthorLine,
4050
5141
  withFigmaOrigin,
4051
5142
  withLink,
4052
5143
  withNeededBy,
4053
5144
  withPiecesRecord,
4054
- dg as withRequestExploration,
4055
- dh as withoutJiraKey,
5145
+ ds as withRequestExploration,
5146
+ dt as withoutJiraKey,
4056
5147
  writeDraftResults,
4057
5148
  writeTokenProposalOnGitHub
4058
5149
  };