@bridge-ds/core 0.17.0 → 0.18.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
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-DenQkr_e.js";
2
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, bN, bO, bP, p, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, b_, a, b$, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm, cn, t, co, cp, cq, cr, cs, ct, cu, cv, cw } from "./prod-branch-DenQkr_e.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-B4jNZhyC.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 as ct2, cu as cu2, cv as cv2, cw as cw2, 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, du, dv, dw, dx, dy, dz, dA, dB, dC, dD, dE, dF, dG, dH } from "./repo-source-B4jNZhyC.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, am as GitHubClient, an as effectiveTier, ao as parseRequestIssue, ap as requestStatus, aq as listSuggestionsOnGitHub, ar as getSuggestionOnGitHub } from "./repo-source-CRfhLO87.js";
4
+ import { 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 as ct2, cu as cu2, cv as cv2, cw as cw2, 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, du, dv, dw, dx, dy, dz, dA, dB, dC, dD, dE, dF, dG, dH } from "./repo-source-CRfhLO87.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.");
@@ -831,6 +831,7 @@ function gitHubHistoryBackend(client, config, opts = {}) {
831
831
  }
832
832
  return t2;
833
833
  };
834
+ const body = async (sha, e) => (!client.canWrite ? await client.readRawFile(e.path, sha).catch(() => void 0) : void 0) ?? client.getBlobText(e.sha);
834
835
  const root = config.tokens.root.replace(/\/$/, "");
835
836
  const prefix = root === "." || !root ? "" : `${root}/`;
836
837
  const limit = Math.max(1, opts.concurrency ?? 4);
@@ -885,7 +886,7 @@ function gitHubHistoryBackend(client, config, opts = {}) {
885
886
  const blobs = entries.filter((e) => e.type === "blob" && e.path.startsWith(prefix));
886
887
  const picked = new Set(selectTokenFiles(config, blobs.map((e) => e.path)));
887
888
  const wanted = blobs.filter((e) => picked.has(prefix ? e.path.slice(prefix.length) : e.path));
888
- const texts = await pool(wanted, async (e) => [prefix ? e.path.slice(prefix.length) : e.path, await client.getBlobText(e.sha)]);
889
+ const texts = await pool(wanted, async (e) => [prefix ? e.path.slice(prefix.length) : e.path, await body(sha, e)]);
889
890
  return new Map(texts);
890
891
  },
891
892
  async changesetPaths(sha) {
@@ -895,7 +896,7 @@ function gitHubHistoryBackend(client, config, opts = {}) {
895
896
  },
896
897
  async readFile(sha, path) {
897
898
  const e = (await tree(sha)).find((x) => x.type === "blob" && x.path === path);
898
- return e ? client.getBlobText(e.sha) : null;
899
+ return e ? body(sha, e) : null;
899
900
  }
900
901
  };
901
902
  }
@@ -1112,7 +1113,7 @@ const RADIUS_ROLES = ["inset", "control", "container", "overlay"];
1112
1113
  const RESERVED = /* @__PURE__ */ new Set(["default", "base", "all", "none", "new", "blank", "primitives", "semantic", "components", "density"]);
1113
1114
  const BRAND_SLUG_RE = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
1114
1115
  const DEFAULT_PRIMARY_CHROMA = 0.14;
1115
- const isObj$2 = (x) => !!x && typeof x === "object" && !Array.isArray(x);
1116
+ const isObj$3 = (x) => !!x && typeof x === "object" && !Array.isArray(x);
1116
1117
  const fileMap = (f) => f instanceof Map ? new Map(f) : new Map(Object.entries(f));
1117
1118
  const brandDisplayName = (slug) => slug.split("-").filter(Boolean).map((w) => w[0].toUpperCase() + w.slice(1)).join(" ");
1118
1119
  function brandLayers(config) {
@@ -1133,27 +1134,27 @@ function setAt(doc, path, node) {
1133
1134
  const keys = path.split(".");
1134
1135
  let cur = doc;
1135
1136
  for (const k of keys.slice(0, -1)) {
1136
- if (!isObj$2(cur[k])) cur[k] = {};
1137
+ if (!isObj$3(cur[k])) cur[k] = {};
1137
1138
  cur = cur[k];
1138
1139
  }
1139
1140
  const last = keys[keys.length - 1];
1140
- const prev = isObj$2(cur[last]) ? cur[last] : {};
1141
+ const prev = isObj$3(cur[last]) ? cur[last] : {};
1141
1142
  cur[last] = { ...prev, ...node };
1142
1143
  }
1143
1144
  function getAt(doc, path) {
1144
1145
  let cur = doc;
1145
- for (const k of path.split(".")) cur = isObj$2(cur) ? cur[k] : void 0;
1146
- return isObj$2(cur) ? cur : void 0;
1146
+ for (const k of path.split(".")) cur = isObj$3(cur) ? cur[k] : void 0;
1147
+ return isObj$3(cur) ? cur : void 0;
1147
1148
  }
1148
1149
  function typeAt(doc, path) {
1149
1150
  let cur = doc;
1150
1151
  let type;
1151
1152
  for (const k of path.split(".")) {
1152
- if (!isObj$2(cur)) return type;
1153
+ if (!isObj$3(cur)) return type;
1153
1154
  if (typeof cur.$type === "string") type = cur.$type;
1154
1155
  cur = cur[k];
1155
1156
  }
1156
- return isObj$2(cur) && typeof cur.$type === "string" ? cur.$type : type;
1157
+ return isObj$3(cur) && typeof cur.$type === "string" ? cur.$type : type;
1157
1158
  }
1158
1159
  function rampFor(input, pinStep, kind) {
1159
1160
  if (typeof input === "number" || typeof input === "string" && /^\d+(\.\d+)?$/.test(input.trim())) {
@@ -1210,7 +1211,7 @@ function listBrands(source) {
1210
1211
  doc = JSON.parse(files.get(file) ?? "{}");
1211
1212
  } catch {
1212
1213
  }
1213
- const meta = isObj$2(doc.$extensions) && isObj$2(doc.$extensions["dev.bridge.brand"]) ? doc.$extensions["dev.bridge.brand"] : {};
1214
+ const meta = isObj$3(doc.$extensions) && isObj$3(doc.$extensions["dev.bridge.brand"]) ? doc.$extensions["dev.bridge.brand"] : {};
1214
1215
  const combo = set.normalizeCombo({ brand: slug });
1215
1216
  const primary = set.resolve("color.action.primary.bg", combo);
1216
1217
  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 +1301,7 @@ function planNewBrand(source, input) {
1300
1301
  for (const [path, defs] of before.view(before.defaultCombo)) {
1301
1302
  const m = /^radius\.([\w-]+)$/.exec(path);
1302
1303
  const v = defs[defs.length - 1].value;
1303
- if (m && isObj$2(v) && typeof v.value === "number" && v.unit === "px" && !getAt(doc, path)) scale.set(v.value, m[1]);
1304
+ if (m && isObj$3(v) && typeof v.value === "number" && v.unit === "px" && !getAt(doc, path)) scale.set(v.value, m[1]);
1304
1305
  }
1305
1306
  const radius = input.radius ?? (blank ? RADIUS_PRESETS[0].radius : void 0);
1306
1307
  if (radius) {
@@ -1339,9 +1340,9 @@ function planNewBrand(source, input) {
1339
1340
  }
1340
1341
  const palette = getAt(doc, "palette");
1341
1342
  for (const [role, group] of Object.entries(palette ?? {})) {
1342
- if (role.startsWith("$") || !isObj$2(group)) continue;
1343
+ if (role.startsWith("$") || !isObj$3(group)) continue;
1343
1344
  for (const [step, node] of Object.entries(group)) {
1344
- if (step.startsWith("$") || !isObj$2(node) || !("$value" in node) || typeof node.$value === "string") continue;
1345
+ if (step.startsWith("$") || !isObj$3(node) || !("$value" in node) || typeof node.$value === "string") continue;
1345
1346
  const ramp = `${slug}-${role}`;
1346
1347
  const entry = prims.get(ramp) ?? { description: `${name} ${role}. Exact values set when the brand was created.`, steps: /* @__PURE__ */ new Map() };
1347
1348
  entry.steps.set(Number(step), node.$value);
@@ -1354,7 +1355,7 @@ function planNewBrand(source, input) {
1354
1355
  if (prims.size && files.has(primFile)) issues.push({ level: "error", code: "slug-file-exists", message: `${tokensPath(config, primFile)} already exists. Pick another name.` });
1355
1356
  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
1357
  doc.$description = `${name}: created with Bridge, started from ${blank ? "a blank brand" : brandDisplayName(from)}.`;
1357
- doc.$extensions = { ...isObj$2(doc.$extensions) ? doc.$extensions : {}, "dev.bridge.brand": { name, from, ...Object.keys(anchors).length ? { anchors } : {} } };
1358
+ doc.$extensions = { ...isObj$3(doc.$extensions) ? doc.$extensions : {}, "dev.bridge.brand": { name, from, ...Object.keys(anchors).length ? { anchors } : {} } };
1358
1359
  const { $description, $extensions, ...rest } = doc;
1359
1360
  const brandFile = fill(layers.brand, { brand: slug });
1360
1361
  const nextFiles = new Map(files);
@@ -3221,15 +3222,15 @@ class StorybookIndexError extends Error {
3221
3222
  code;
3222
3223
  status;
3223
3224
  }
3224
- const isObj$1 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
3225
+ const isObj$2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
3225
3226
  const str = (v) => typeof v === "string" && v.trim() ? v : void 0;
3226
3227
  function entryFrom(key, raw, v3) {
3227
- if (!isObj$1(raw)) return null;
3228
+ if (!isObj$2(raw)) return null;
3228
3229
  const id = str(raw.id) ?? key;
3229
3230
  const title = str(raw.title) ?? str(raw.kind);
3230
3231
  const name = str(raw.name) ?? str(raw.story);
3231
3232
  if (!id || !title || !name) return null;
3232
- const params = isObj$1(raw.parameters) ? raw.parameters : {};
3233
+ const params = isObj$2(raw.parameters) ? raw.parameters : {};
3233
3234
  const type = raw.type === "docs" || raw.type === "story" ? raw.type : v3 && params.docsOnly === true ? "docs" : "story";
3234
3235
  const e = {
3235
3236
  id,
@@ -3265,13 +3266,13 @@ function groupStorybookComponents(entries) {
3265
3266
  return out.sort((a2, b) => a2.title.localeCompare(b.title));
3266
3267
  }
3267
3268
  function parseStorybookIndex(json, source) {
3268
- if (!isObj$1(json)) throw new StorybookIndexError("not-json", "The Storybook index is not a JSON object.");
3269
+ if (!isObj$2(json)) throw new StorybookIndexError("not-json", "The Storybook index is not a JSON object.");
3269
3270
  if (typeof json.loginUrl === "string" && !("entries" in json) && !("stories" in json)) {
3270
3271
  throw new StorybookIndexError("private", "This Storybook is private: it asks for a sign-in before showing its index.");
3271
3272
  }
3272
- const map = isObj$1(json.entries) ? json.entries : isObj$1(json.stories) ? json.stories : null;
3273
+ const map = isObj$2(json.entries) ? json.entries : isObj$2(json.stories) ? json.stories : null;
3273
3274
  if (!map) throw new StorybookIndexError("empty", "This file has no Storybook entries.");
3274
- const v3 = !isObj$1(json.entries);
3275
+ const v3 = !isObj$2(json.entries);
3275
3276
  const entries = Object.entries(map).map(([k, raw]) => entryFrom(k, raw, v3)).filter((e) => e !== null);
3276
3277
  if (!entries.length) throw new StorybookIndexError("empty", "This Storybook index lists no stories or docs.");
3277
3278
  const version = typeof json.v === "number" ? json.v : v3 ? 3 : 4;
@@ -4208,7 +4209,7 @@ const SNAPSHOT_AUDITS_DIR = "audits";
4208
4209
  const SNAPSHOT_MAX_BYTES = 5e6;
4209
4210
  class SnapshotError extends Error {
4210
4211
  }
4211
- const isObj = (x) => !!x && typeof x === "object" && !Array.isArray(x);
4212
+ const isObj$1 = (x) => !!x && typeof x === "object" && !Array.isArray(x);
4212
4213
  const isStr = (x) => typeof x === "string";
4213
4214
  function parseSnapshot(input) {
4214
4215
  let data = input;
@@ -4219,18 +4220,18 @@ function parseSnapshot(input) {
4219
4220
  throw new SnapshotError(`${SNAPSHOT_FILE} is not valid JSON (${err.message})`);
4220
4221
  }
4221
4222
  }
4222
- if (!isObj(data) || data.kind !== "bridge-snapshot") throw new SnapshotError(`${SNAPSHOT_FILE} is not a Bridge snapshot`);
4223
+ if (!isObj$1(data) || data.kind !== "bridge-snapshot") throw new SnapshotError(`${SNAPSHOT_FILE} is not a Bridge snapshot`);
4223
4224
  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
4225
  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 (!isObj$1(repo) || !isStr(repo.owner) || !isStr(repo.name) || !isStr(repo.branch)) throw new SnapshotError(`${SNAPSHOT_FILE}: repo needs owner, name and branch`);
4226
4227
  if (!isStr(data.sourceSha) || !data.sourceSha) throw new SnapshotError(`${SNAPSHOT_FILE}: sourceSha is missing`);
4227
4228
  if (!isStr(data.generatedAt)) throw new SnapshotError(`${SNAPSHOT_FILE}: generatedAt is missing`);
4228
4229
  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 }`);
4230
+ if (!isObj$1(data.files) || !Object.values(data.files).every(isStr)) throw new SnapshotError(`${SNAPSHOT_FILE}: files must map paths to text`);
4231
+ if (data.figma !== null && (!isObj$1(data.figma) || !isStr(data.figma.path) || !Array.isArray(data.figma.coverage))) throw new SnapshotError(`${SNAPSHOT_FILE}: figma must be null or { path, coverage }`);
4232
+ if (!isObj$1(data.summary) || typeof data.summary.tokens !== "number") throw new SnapshotError(`${SNAPSHOT_FILE}: summary is missing`);
4233
+ if (!isObj$1(data.contrast) || !Array.isArray(data.contrast.pairs)) throw new SnapshotError(`${SNAPSHOT_FILE}: contrast needs pairs`);
4234
+ if (!Array.isArray(data.audits) || !data.audits.every((a2) => isObj$1(a2) && isStr(a2.id) && isStr(a2.path) && isObj$1(a2.metrics))) throw new SnapshotError(`${SNAPSHOT_FILE}: audits must be a list of { id, path, metrics }`);
4234
4235
  if (!Array.isArray(data.problems)) throw new SnapshotError(`${SNAPSHOT_FILE}: problems must be a list`);
4235
4236
  return data;
4236
4237
  }
@@ -4382,42 +4383,441 @@ function snapshotLlmsTxt(model, snapshot) {
4382
4383
  return `${out.join("\n").replace(/\n{3,}/g, "\n\n").trim()}
4383
4384
  `;
4384
4385
  }
4386
+ const ACTIVITY_SCHEMA_VERSION = 1;
4387
+ const ACTIVITY_FILE = "activity.json";
4388
+ const ACTIVITY_MAX_BYTES = 3e6;
4389
+ const ACTIVITY_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
4390
+ const ACTIVITY_LIMITS = {
4391
+ /** Open pull requests recorded in full (the page of each; the list carries every open one). */
4392
+ branches: 30,
4393
+ /** Open suggestions read with their comments (parsed payload, counted approvals). */
4394
+ suggestions: 30,
4395
+ /** Request issues listed (open and closed); open ones are read with their comments. */
4396
+ requests: 30,
4397
+ /** Merged pull requests summarized. */
4398
+ merged: 20,
4399
+ /** Token history entries (core loadGitHubHistory limit). */
4400
+ history: 20,
4401
+ /** History entries whose two commits' file lists are recorded, so their before/after opens without the API. */
4402
+ historyTrees: 10
4403
+ };
4404
+ class ActivityError extends Error {
4405
+ }
4406
+ const isObj = (x) => !!x && typeof x === "object" && !Array.isArray(x);
4407
+ const API = "https://api.github.com";
4408
+ function activityKey(url) {
4409
+ let u;
4410
+ try {
4411
+ u = new URL(url, API);
4412
+ } catch {
4413
+ return null;
4414
+ }
4415
+ if (u.origin !== API) return null;
4416
+ const parts = u.pathname.split("/");
4417
+ if (parts[1] === "repos" && parts.length > 3) {
4418
+ parts[2] = parts[2].toLowerCase();
4419
+ parts[3] = parts[3].toLowerCase();
4420
+ } else if (parts[1] === "users" && parts.length > 2) parts[2] = parts[2].toLowerCase();
4421
+ const q = [...u.searchParams].sort(([a2, av3], [b, bv3]) => a2 === b ? av3 < bv3 ? -1 : 1 : a2 < b ? -1 : 1);
4422
+ const search = q.length ? `?${new URLSearchParams(q).toString()}` : "";
4423
+ return parts.join("/") + search;
4424
+ }
4425
+ const KEPT_URLS = /* @__PURE__ */ new Set(["html_url", "avatar_url", "target_url", "details_url", "environment_url", "raw_url"]);
4426
+ const DROPPED = /* @__PURE__ */ new Set(["_links", "patch", "body_html", "body_text", "reactions", "performed_via_github_app", "node_id", "gravatar_id", "user_view_type", "site_admin", "event", "sub_issues_summary", "issue_dependencies_summary", "pull_request_review_id"]);
4427
+ const LONG_TEXT = 6e4;
4428
+ const trimUser = (u) => ({
4429
+ login: u.login,
4430
+ ...u.id !== void 0 ? { id: u.id } : {},
4431
+ ...u.avatar_url ? { avatar_url: u.avatar_url } : {},
4432
+ ...u.html_url ? { html_url: u.html_url } : {},
4433
+ ...u.type ? { type: u.type } : {}
4434
+ });
4435
+ const trimRepo = (r) => ({
4436
+ ...r.id !== void 0 ? { id: r.id } : {},
4437
+ name: r.name,
4438
+ full_name: r.full_name,
4439
+ ...r.private !== void 0 ? { private: r.private } : {},
4440
+ ...r.fork !== void 0 ? { fork: r.fork } : {},
4441
+ ...r.default_branch ? { default_branch: r.default_branch } : {},
4442
+ ...isObj(r.owner) ? { owner: trimUser(r.owner) } : {},
4443
+ ...r.html_url ? { html_url: r.html_url } : {}
4444
+ });
4445
+ function trimGitHub(value, key = "") {
4446
+ if (typeof value === "string") return value.length > LONG_TEXT ? value.slice(0, LONG_TEXT) : value;
4447
+ if (Array.isArray(value)) return value.map((v) => trimGitHub(v, key));
4448
+ if (!isObj(value)) return value;
4449
+ if (key === "tree" && typeof value.path === "string" && typeof value.type === "string") return { path: value.path, type: value.type, sha: value.sha, ...value.mode ? { mode: value.mode } : {} };
4450
+ if ((key === "repo" || key === "repository" || key === "head_repository") && typeof value.full_name === "string") return trimRepo(value);
4451
+ if (typeof value.login === "string" && ("avatar_url" in value || "type" in value)) return trimUser(value);
4452
+ const out = {};
4453
+ for (const [k, v] of Object.entries(value)) {
4454
+ if (DROPPED.has(k)) continue;
4455
+ if ((k === "url" || k.endsWith("_url")) && !KEPT_URLS.has(k)) continue;
4456
+ if (k === "output" && isObj(v)) {
4457
+ out[k] = { title: v.title ?? null, summary: typeof v.summary === "string" ? v.summary.slice(0, 2e3) : null, annotations_count: v.annotations_count ?? 0 };
4458
+ continue;
4459
+ }
4460
+ if (k === "app" && isObj(v)) {
4461
+ out[k] = { id: v.id, slug: v.slug, name: v.name };
4462
+ continue;
4463
+ }
4464
+ out[k] = trimGitHub(v, k);
4465
+ }
4466
+ return out;
4467
+ }
4468
+ const JSON_ACCEPT = /application\/(vnd\.github\+)?json/;
4469
+ const SKIP = /* @__PURE__ */ Symbol("skip");
4470
+ function activityTreeFilter(config) {
4471
+ const under = (dir) => {
4472
+ const d = (dir ?? "").replace(/^\.\/|\/$/g, "");
4473
+ return d && d !== "." ? `${d}/` : "";
4474
+ };
4475
+ const tokens = under(config.tokens.root);
4476
+ const changesets = config.changesets ? under(config.changesets.dir) : null;
4477
+ const pkg = new Set(packageDirCandidates(config).flatMap((d) => [d ? `${d}/CHANGELOG.md` : "CHANGELOG.md", d ? `${d}/package.json` : "package.json"]));
4478
+ return (p2) => p2 === "bridge.config.json" || pkg.has(p2) || (tokens ? p2.startsWith(tokens) : p2.endsWith(".json")) || changesets !== null && changesets !== "" && p2.startsWith(changesets);
4479
+ }
4480
+ const UNREAD = [/\/git\/blobs\//, /\/commits\/[^/]+\/pulls$/, /\/commits\?/, /\/tags\?/, /\/contents\//];
4481
+ function activityShaper(config) {
4482
+ const keep = activityTreeFilter(config);
4483
+ return (key, body) => {
4484
+ if (UNREAD.some((r) => r.test(key))) return SKIP;
4485
+ if (key.includes("/git/trees/") && isObj(body) && Array.isArray(body.tree)) return { sha: body.sha, tree: body.tree.filter((e) => keep(e.path)), truncated: Boolean(body.truncated) };
4486
+ if (key.includes("/compare/") && isObj(body)) {
4487
+ const c = body;
4488
+ return {
4489
+ status: c.status,
4490
+ ahead_by: c.ahead_by,
4491
+ behind_by: c.behind_by,
4492
+ total_commits: c.total_commits,
4493
+ merge_base_commit: c.merge_base_commit ? { sha: c.merge_base_commit.sha } : null,
4494
+ base_commit: c.base_commit ? { sha: c.base_commit.sha, commit: { tree: { sha: c.base_commit.commit?.tree?.sha } } } : null,
4495
+ files: Array.isArray(c.files) ? c.files.map((f) => ({ filename: f.filename, status: f.status, ...f.previous_filename ? { previous_filename: f.previous_filename } : {}, sha: f.sha, additions: f.additions, deletions: f.deletions, changes: f.changes })) : []
4496
+ };
4497
+ }
4498
+ return body;
4499
+ };
4500
+ }
4501
+ const HISTORY_MAX_CHANGES = 100;
4502
+ function capHistory(report, max = HISTORY_MAX_CHANGES) {
4503
+ return {
4504
+ ...report,
4505
+ entries: report.entries.map((e) => e.changes.length > max || (e.reasons?.length ?? 0) > max ? { ...e, changes: e.changes.slice(0, max), ...e.reasons ? { reasons: e.reasons.slice(0, max) } : {} } : e)
4506
+ };
4507
+ }
4508
+ function recordingFetch(fetchImpl, into, shape2 = (_k, b) => b) {
4509
+ return async (url, init) => {
4510
+ const res = await fetchImpl(url, init);
4511
+ const method = (init?.method ?? "GET").toUpperCase();
4512
+ const accept = init?.headers?.Accept ?? init?.headers?.accept ?? "application/vnd.github+json";
4513
+ const key = activityKey(url);
4514
+ if (method !== "GET" || !key || !JSON_ACCEPT.test(accept) || res.status !== 200 && res.status !== 404) return res;
4515
+ const text = await res.text();
4516
+ let body;
4517
+ try {
4518
+ body = JSON.parse(text);
4519
+ } catch {
4520
+ return { ok: res.ok, status: res.status, headers: res.headers, json: async () => JSON.parse(text), text: async () => text };
4521
+ }
4522
+ const shaped = shape2(key, trimGitHub(body));
4523
+ if (shaped !== SKIP) into.set(key, { status: res.status, body: shaped });
4524
+ return { ok: res.ok, status: res.status, ...res.headers ? { headers: res.headers } : {}, json: async () => JSON.parse(text), text: async () => text };
4525
+ };
4526
+ }
4527
+ const labelObjs = (labels) => labelNames(labels).map((name) => ({ name }));
4528
+ function labelNames(labels) {
4529
+ return (labels ?? []).map((l) => typeof l === "string" ? l : l.name ?? "").filter(Boolean);
4530
+ }
4531
+ const byUpdated = (a2, b) => a2.updated_at < b.updated_at ? 1 : a2.updated_at > b.updated_at ? -1 : 0;
4532
+ async function collectActivity(input) {
4533
+ const limits = { ...ACTIVITY_LIMITS, ...input.limits };
4534
+ const responses = /* @__PURE__ */ new Map();
4535
+ const rec = recordingFetch(input.fetch, responses, activityShaper(input.config));
4536
+ const client = new GitHubClient(`${input.owner}/${input.repo}`, input.token, rec, { attempts: 2, baseDelayMs: 500, sleep: (ms) => new Promise((r) => setTimeout(r, ms)) }, { etags: false });
4537
+ const R = `/repos/${input.owner}/${input.repo}`;
4538
+ const problems = [];
4539
+ const truncated = [];
4540
+ let limited = false;
4541
+ const headers = { Accept: "application/vnd.github+json", "X-GitHub-Api-Version": "2022-11-28", ...input.token ? { Authorization: `Bearer ${input.token}` } : {} };
4542
+ const get = async (path) => {
4543
+ if (limited) return void 0;
4544
+ try {
4545
+ const res = await rec(`${API}${path}`, { headers });
4546
+ if (res.status === 404) return void 0;
4547
+ if (!res.ok) {
4548
+ if ((res.status === 403 || res.status === 429) && res.headers?.get("x-ratelimit-remaining") === "0") {
4549
+ limited = true;
4550
+ problems.push("GitHub hourly limit reached while reading activity: the rest was left out.");
4551
+ } else problems.push(`GitHub answered ${res.status} for ${path}`);
4552
+ return void 0;
4553
+ }
4554
+ return await res.json();
4555
+ } catch (err) {
4556
+ problems.push(`Could not read ${path}: ${err.message}`);
4557
+ return void 0;
4558
+ }
4559
+ };
4560
+ const safely = async (what, fn, fallback) => {
4561
+ if (limited) return fallback;
4562
+ try {
4563
+ return await fn();
4564
+ } catch (err) {
4565
+ const msg = err.message;
4566
+ if (/limit/i.test(msg) && err.status === 429) limited = true;
4567
+ problems.push(`${what}: ${msg}`);
4568
+ return fallback;
4569
+ }
4570
+ };
4571
+ const info = await safely("Repository", () => client.getRepo(), null);
4572
+ const branch = info?.defaultBranch ?? input.config.repo?.defaultBranch ?? "main";
4573
+ const headSha = await safely("Default branch", () => client.getBranchSha(branch), void 0) ?? "";
4574
+ const open = await get(`${R}/pulls?state=open&per_page=100`) ?? [];
4575
+ const closed = await get(`${R}/pulls?state=closed&sort=updated&direction=desc&per_page=30`) ?? [];
4576
+ await get(`${R}/pulls?state=closed&per_page=50&sort=updated&direction=desc`);
4577
+ await get(`${R}/rules/branches/${encodeURIComponent(branch)}`);
4578
+ await get(`${R}/git/matching-refs/heads/bridge-visual`);
4579
+ await safely("Owner account", () => client.getAccountType(input.owner), null);
4580
+ const prev = input.previous ?? null;
4581
+ const sameRepoPrev = Boolean(prev && sameRepo(prev, input));
4582
+ const prevOk = sameRepoPrev && Boolean(headSha) && prev.headSha === headSha;
4583
+ const kept = async (path, reuse) => {
4584
+ const key = reuse ? activityKey(`${API}${path}`) : null;
4585
+ const hit = key ? prev.responses[key] : void 0;
4586
+ if (key && hit) {
4587
+ responses.set(key, hit);
4588
+ return hit.status === 200 ? hit.body : void 0;
4589
+ }
4590
+ return get(path);
4591
+ };
4592
+ const branches = [];
4593
+ const sorted = [...open].sort(byUpdated);
4594
+ if (sorted.length > limits.branches) truncated.push(`${sorted.length - limits.branches} open branches beyond the ${limits.branches} most recently updated are listed without their pages.`);
4595
+ for (const [i, p2] of sorted.entries()) {
4596
+ const full = i < limits.branches;
4597
+ const base = {
4598
+ number: p2.number,
4599
+ title: p2.title,
4600
+ author: p2.user?.login ?? "",
4601
+ url: p2.html_url,
4602
+ branch: p2.head.ref,
4603
+ base: p2.base.ref,
4604
+ headSha: p2.head.sha,
4605
+ baseSha: p2.base.sha,
4606
+ state: p2.draft ? "draft" : "open",
4607
+ labels: labelNames(p2.labels),
4608
+ tier: effectiveTier(labelObjs(p2.labels), p2.body ?? null, null),
4609
+ createdAt: p2.created_at,
4610
+ updatedAt: p2.updated_at,
4611
+ comments: null,
4612
+ files: null,
4613
+ previews: [],
4614
+ checks: null
4615
+ };
4616
+ if (!full || limited) {
4617
+ branches.push(base);
4618
+ continue;
4619
+ }
4620
+ const n = p2.number;
4621
+ const was = prevOk ? prev.branches.find((b) => b.number === n) : void 0;
4622
+ const same = Boolean(was && was.updatedAt === p2.updated_at && was.headSha === p2.head.sha && was.comments !== null);
4623
+ const [pull, files, , , , , status] = await Promise.all([
4624
+ kept(`${R}/pulls/${n}`, same),
4625
+ kept(`${R}/pulls/${n}/files?per_page=100`, same),
4626
+ kept(`${R}/pulls/${n}/reviews?per_page=100`, same),
4627
+ kept(`${R}/issues/${n}/comments?per_page=100`, same),
4628
+ kept(`${R}/pulls/${n}/comments?per_page=100`, same),
4629
+ get(`${R}/commits/${p2.head.sha}/check-runs?per_page=100`),
4630
+ get(`${R}/commits/${p2.head.sha}/status`),
4631
+ kept(`${R}/compare/${encodeURIComponent(p2.base.ref)}...${p2.head.sha}`, same),
4632
+ kept(`${R}/git/trees/${p2.base.sha}?recursive=1`, sameRepoPrev),
4633
+ kept(`${R}/git/trees/${p2.head.sha}?recursive=1`, sameRepoPrev),
4634
+ kept(`${R}/issues/${n}/labels`, same)
4635
+ ]);
4636
+ const root = input.config.tokens.root.replace(/\/$/, "");
4637
+ branches.push({
4638
+ ...base,
4639
+ tier: effectiveTier(labelObjs((pull ?? p2).labels), (pull ?? p2).body ?? null, files ?? null),
4640
+ comments: pull ? (pull.comments ?? 0) + (pull.review_comments ?? 0) : null,
4641
+ files: files ? { changed: files.length, tokens: files.map((f) => f.filename).filter((f) => f.startsWith(`${root}/`) && f.endsWith(".json")) } : null,
4642
+ previews: (status?.statuses ?? []).filter((s) => s.state === "success" && s.target_url && /^https:\/\//.test(s.target_url)).map((s) => ({ context: s.context, url: s.target_url })),
4643
+ checks: status ? status.state === "success" || status.state === "failure" || status.state === "pending" ? status.state : "none" : null
4644
+ });
4645
+ }
4646
+ const gov = { owners: input.config.governance.owners, rights: input.config.governance.rights, soloOwnerCanApproveBoth: input.config.governance.soloOwnerCanApproveBoth };
4647
+ const items = await safely("Suggestions", () => listSuggestionsOnGitHub(client, { state: "open" }), []);
4648
+ const pullsAll = items.length ? await safely("Pull requests", () => client.listPullRequests("all"), []) : [];
4649
+ if (items.length > limits.suggestions) truncated.push(`${items.length - limits.suggestions} open suggestions beyond the ${limits.suggestions} newest are listed without their pages.`);
4650
+ const suggestions = [];
4651
+ for (const [i, s] of items.entries()) {
4652
+ const d = i < limits.suggestions ? await safely(`Suggestion #${s.number}`, () => getSuggestionOnGitHub(client, s.number, gov, { pulls: pullsAll }), null) : null;
4653
+ suggestions.push({
4654
+ number: s.number,
4655
+ title: s.title,
4656
+ author: s.author,
4657
+ url: s.url,
4658
+ createdAt: s.createdAt,
4659
+ kind: s.kind ?? null,
4660
+ status: d?.status ?? s.status,
4661
+ labels: s.labels,
4662
+ comments: d ? d.comments.length : null,
4663
+ payload: d?.parsed.ok ? d.parsed.payload : null,
4664
+ approvers: d?.approvals?.approvers ?? []
4665
+ });
4666
+ }
4667
+ const issues = await safely("Requests", () => client.listIssues({ label: REQUEST_LABEL, state: "all", perPage: 50 }), []);
4668
+ const requests = [];
4669
+ const openIssues = issues.filter((i) => i.state === "open");
4670
+ if (openIssues.length > limits.requests) truncated.push(`${openIssues.length - limits.requests} open requests beyond the ${limits.requests} newest are listed without their pages.`);
4671
+ for (const [i, r] of issues.slice(0, Math.max(limits.requests, 0)).entries()) {
4672
+ if (r.state === "open" && i < limits.requests) {
4673
+ await get(`${R}/issues/${r.number}`);
4674
+ await get(`${R}/issues/${r.number}/comments?per_page=100`);
4675
+ }
4676
+ const parsed = parseRequestIssue(r.body);
4677
+ const linked = [...open, ...closed].filter((p2) => new RegExp(`(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\\s+#${r.number}\\b`, "i").test(p2.body ?? ""));
4678
+ requests.push({
4679
+ number: r.number,
4680
+ title: r.title,
4681
+ author: r.author,
4682
+ url: r.url,
4683
+ state: r.state,
4684
+ status: requestStatus({ state: r.state, stateReason: r.stateReason, linkedPrs: linked.map((p2) => ({ state: p2.state === "open" ? "open" : "closed", merged: Boolean(p2.merged_at) })) }),
4685
+ kind: parsed?.kind ?? null,
4686
+ component: parsed?.component ?? null,
4687
+ labels: r.labels,
4688
+ createdAt: r.createdAt
4689
+ });
4690
+ }
4691
+ const merged = closed.filter((p2) => p2.merged_at).slice(0, limits.merged).map((p2) => ({ number: p2.number, title: p2.title, author: p2.user?.login ?? "", url: p2.html_url, mergedAt: p2.merged_at, labels: labelNames(p2.labels), tier: effectiveTier(labelObjs(p2.labels), p2.body ?? null, null) }));
4692
+ let history = null;
4693
+ if (prevOk && prev.history) {
4694
+ history = prev.history;
4695
+ for (const [k, v] of Object.entries(prev.responses)) if (isHistoryKey(k) && !responses.has(k)) responses.set(k, v);
4696
+ } else if (!limited && headSha) {
4697
+ const read = await safely("Token history", () => loadGitHubHistory(client, input.config, { ref: branch, limit: limits.history }), null);
4698
+ history = read && capHistory(read);
4699
+ if (history) {
4700
+ const backend = gitHubHistoryBackend(client, input.config, { concurrency: 2 });
4701
+ const shas = [...new Set(history.entries.filter((e) => !e.bulk).slice(0, limits.historyTrees).flatMap((e) => [e.sha, ...e.baseSha ? [e.baseSha] : []]))];
4702
+ for (const sha of shas) await safely(`Files at ${sha.slice(0, 7)}`, () => backend.tree(sha), []);
4703
+ }
4704
+ }
4705
+ const activity = {
4706
+ kind: "bridge-activity",
4707
+ schemaVersion: ACTIVITY_SCHEMA_VERSION,
4708
+ tool: { name: "bridge", version: input.version },
4709
+ generatedAt: input.generatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
4710
+ repo: { owner: input.owner, name: input.repo, branch },
4711
+ headSha,
4712
+ branches,
4713
+ suggestions,
4714
+ requests,
4715
+ merged,
4716
+ history,
4717
+ responses: Object.fromEntries([...responses].sort(([a2], [b]) => a2 < b ? -1 : a2 > b ? 1 : 0)),
4718
+ truncated,
4719
+ problems
4720
+ };
4721
+ return fitActivity(activity);
4722
+ }
4723
+ const sameRepo = (a2, b) => a2.repo.owner.toLowerCase() === b.owner.toLowerCase() && a2.repo.name.toLowerCase() === b.repo.toLowerCase();
4724
+ const isHistoryKey = (k) => /\/git\/commits\/[0-9a-f]+$/.test(k) || /\/git\/trees\/[0-9a-f]+\?recursive=1$/.test(k);
4725
+ const activityBytes = (a2) => new TextEncoder().encode(`${JSON.stringify(a2)}
4726
+ `).length;
4727
+ function fitActivity(activity, max = ACTIVITY_MAX_BYTES) {
4728
+ if (activityBytes(activity) <= max) return activity;
4729
+ const out = { ...activity, responses: { ...activity.responses }, truncated: [...activity.truncated] };
4730
+ const drop = (test) => {
4731
+ for (const k of Object.keys(out.responses)) if (test(k)) delete out.responses[k];
4732
+ };
4733
+ drop((k) => k.includes("/git/trees/"));
4734
+ out.truncated.push("File lists were left out to keep activity.json small: a branch or history change reads them from GitHub.");
4735
+ if (activityBytes(out) <= max) return out;
4736
+ const old = [...out.branches].sort((a2, b) => a2.updatedAt < b.updatedAt ? -1 : 1);
4737
+ for (const b of old) {
4738
+ drop((k) => new RegExp(`/(pulls|issues)/${b.number}(/|$|\\?)`).test(k) || k.includes(`/commits/${b.headSha}/`) || k.includes(`...${b.headSha}`));
4739
+ if (activityBytes(out) <= max) {
4740
+ out.truncated.push("The pages of the least recently updated branches were left out: they read from GitHub.");
4741
+ return out;
4742
+ }
4743
+ }
4744
+ out.responses = {};
4745
+ out.truncated.push("Every recorded read was left out: pages read GitHub live.");
4746
+ return out;
4747
+ }
4748
+ function parseActivity(input) {
4749
+ let data = input;
4750
+ if (typeof input === "string") {
4751
+ try {
4752
+ data = JSON.parse(input);
4753
+ } catch (err) {
4754
+ throw new ActivityError(`${ACTIVITY_FILE} is not valid JSON (${err.message})`);
4755
+ }
4756
+ }
4757
+ if (!isObj(data) || data.kind !== "bridge-activity") throw new ActivityError(`${ACTIVITY_FILE} is not a Bridge activity file`);
4758
+ if (data.schemaVersion !== ACTIVITY_SCHEMA_VERSION) throw new ActivityError(`${ACTIVITY_FILE} is schema version ${String(data.schemaVersion)}; this version of Bridge reads ${ACTIVITY_SCHEMA_VERSION}`);
4759
+ const repo = data.repo;
4760
+ if (!isObj(repo) || typeof repo.owner !== "string" || typeof repo.name !== "string" || typeof repo.branch !== "string") throw new ActivityError(`${ACTIVITY_FILE}: repo needs owner, name and branch`);
4761
+ if (typeof data.generatedAt !== "string" || Number.isNaN(Date.parse(data.generatedAt))) throw new ActivityError(`${ACTIVITY_FILE}: generatedAt is missing`);
4762
+ for (const k of ["branches", "suggestions", "requests", "merged", "truncated", "problems"]) if (!Array.isArray(data[k])) throw new ActivityError(`${ACTIVITY_FILE}: ${k} must be a list`);
4763
+ if (!isObj(data.responses) || !Object.values(data.responses).every((r) => isObj(r) && typeof r.status === "number")) throw new ActivityError(`${ACTIVITY_FILE}: responses must map paths to { status, body }`);
4764
+ if (data.history !== null && !(isObj(data.history) && Array.isArray(data.history.entries))) throw new ActivityError(`${ACTIVITY_FILE}: history must be null or a history report`);
4765
+ return data;
4766
+ }
4767
+ const activityAge = (a2, now = Date.now()) => Math.max(0, now - Date.parse(a2.generatedAt));
4768
+ function activityIsUsable(a2, team, now = Date.now(), maxAge = ACTIVITY_MAX_AGE_MS) {
4769
+ return a2.repo.owner.toLowerCase() === team.owner.toLowerCase() && a2.repo.name.toLowerCase() === team.repo.toLowerCase() && activityAge(a2, now) <= maxAge;
4770
+ }
4771
+ function activityAnswer(a2, url) {
4772
+ const key = activityKey(url);
4773
+ if (!key) return void 0;
4774
+ const own = `/repos/${a2.repo.owner.toLowerCase()}/${a2.repo.name.toLowerCase()}`;
4775
+ if (!(key === own || key.startsWith(`${own}/`) || key.startsWith(`${own}?`) || key.startsWith("/users/"))) return void 0;
4776
+ return Object.prototype.hasOwnProperty.call(a2.responses, key) ? a2.responses[key] : void 0;
4777
+ }
4778
+ const activityRawUrl = (owner, repo) => `https://raw.githubusercontent.com/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/${SNAPSHOT_BRANCH}/${ACTIVITY_FILE}`;
4385
4779
  export {
4386
4780
  al as AAA_MIN,
4387
4781
  am as AA_MIN,
4782
+ ACTIVITY_FILE,
4783
+ ACTIVITY_LIMITS,
4784
+ ACTIVITY_MAX_AGE_MS,
4785
+ ACTIVITY_MAX_BYTES,
4786
+ ACTIVITY_SCHEMA_VERSION,
4388
4787
  ADMIN_ROLE_ID,
4389
4788
  ANTHROPIC_MESSAGES_URL,
4789
+ ActivityError,
4390
4790
  BELL,
4391
4791
  BRAND_FONTS,
4392
4792
  BRAND_SLUG_RE,
4393
- am2 as BULK_LIMIT,
4793
+ as2 as BULK_LIMIT,
4394
4794
  an as CHANGES_MODES,
4395
- an2 as CI_STATE_LABEL,
4396
- ao2 as COLOR_FIELDS,
4795
+ at2 as CI_STATE_LABEL,
4796
+ au2 as COLOR_FIELDS,
4397
4797
  COMBINE_COMPARE_LIMIT,
4398
4798
  COMPARE_FILE_LIMIT,
4399
- ap2 as COMPONENT_SPECS_VERSION,
4799
+ av2 as COMPONENT_SPECS_VERSION,
4400
4800
  CONFIG_FILE,
4401
- aq2 as CONFLICT_REASON,
4801
+ aw2 as CONFLICT_REASON,
4402
4802
  ao as CONTRAST_CELL_MAX,
4403
4803
  ap as CONTRAST_CHECKS_FILE,
4404
4804
  CONTRAST_THRESHOLDS,
4405
4805
  ConfigError,
4406
4806
  DEFAULT_CHANGES_MODE,
4407
- ar2 as DEFAULT_COMPONENT_SPECS_FILE,
4807
+ ax2 as DEFAULT_COMPONENT_SPECS_FILE,
4408
4808
  aq as DEFAULT_GOVERNANCE,
4409
4809
  DEFAULT_OVERRIDE,
4410
4810
  DEFAULT_PRODUCTS,
4411
- as2 as DEFAULT_PROTECTED_BRANCHES,
4811
+ ay2 as DEFAULT_PROTECTED_BRANCHES,
4412
4812
  ar as DEFAULT_RIGHTS,
4413
4813
  DEFAULT_TOKEN_PATHS,
4414
4814
  as as DEFAULT_VISUAL_IMPACT,
4415
4815
  DEMO_RELEASES,
4416
- at2 as DOCS_CHANGE_BUMP,
4816
+ az2 as DOCS_CHANGE_BUMP,
4417
4817
  DOCS_DRAFT_MODEL,
4418
- au2 as DOCS_EDITOR_ORIGIN,
4419
- av2 as DOCS_KEYS,
4420
- aw2 as DOCS_MCP_ORIGIN,
4818
+ aA2 as DOCS_EDITOR_ORIGIN,
4819
+ aB2 as DOCS_KEYS,
4820
+ aC2 as DOCS_MCP_ORIGIN,
4421
4821
  DOCS_SELECTION_MODES,
4422
4822
  DRAFTED_BY_CLAUDE_LABEL,
4423
4823
  DRAFTS_DIR,
@@ -4432,13 +4832,13 @@ export {
4432
4832
  DRAFT_VOICE_RULES,
4433
4833
  at as DTCG_TYPES,
4434
4834
  DraftPoller,
4435
- ax2 as EXPLORATION_CHECK,
4835
+ aD2 as EXPLORATION_CHECK,
4436
4836
  EXPLORATION_LABEL,
4437
4837
  EXPLORATION_NOTES_DIR,
4438
4838
  EXPLORATION_PREFIX,
4439
- ay2 as EXPLORATION_STATUS_LABEL,
4440
- az2 as EXPLORATION_TIER_LABEL,
4441
- aA2 as EXPLORATION_USE_CASES,
4839
+ aE2 as EXPLORATION_STATUS_LABEL,
4840
+ aF2 as EXPLORATION_TIER_LABEL,
4841
+ aG2 as EXPLORATION_USE_CASES,
4442
4842
  EXT_ID,
4443
4843
  EXT_SCOPES,
4444
4844
  FIDELITY_DEFAULTS,
@@ -4449,8 +4849,9 @@ export {
4449
4849
  FIGMA_REFERENCE_STORY,
4450
4850
  FIGMA_SPEC_DIR,
4451
4851
  FROM_FIGMA_LABEL,
4452
- aB2 as GitHubClient,
4852
+ GitHubClient,
4453
4853
  GitHubError,
4854
+ HISTORY_MAX_CHANGES,
4454
4855
  au as JsonParseError,
4455
4856
  LIGHTNESS,
4456
4857
  av as LINK_STATUS_TONE,
@@ -4473,17 +4874,17 @@ export {
4473
4874
  PROSE_KEYS,
4474
4875
  PROTECTION_PARTS,
4475
4876
  PROTECTION_PART_PHRASE,
4476
- aC2 as PULL_STATE_PILL,
4477
- aD2 as ProtectedBranchError,
4877
+ aH2 as PULL_STATE_PILL,
4878
+ aI2 as ProtectedBranchError,
4478
4879
  RADIUS_PRESETS,
4479
- aE2 as REDUCED_MOTION_NOTE,
4880
+ aJ2 as REDUCED_MOTION_NOTE,
4480
4881
  REPO_MODEL_DEFAULTS,
4481
4882
  REQUESTS_BRANCH,
4482
4883
  REQUEST_KINDS,
4483
4884
  REQUEST_LABEL,
4484
- aF2 as REQUEST_STATUS_LABEL,
4485
- aG2 as REVIEW_STATUS_LABEL,
4486
- aH2 as REVIEW_STATUS_ORDER,
4885
+ aK2 as REQUEST_STATUS_LABEL,
4886
+ aL2 as REVIEW_STATUS_LABEL,
4887
+ aM2 as REVIEW_STATUS_ORDER,
4487
4888
  aC as RIGHTS,
4488
4889
  aD as RIGHT_LABEL,
4489
4890
  RISK_LABELS,
@@ -4491,58 +4892,67 @@ export {
4491
4892
  SHARE_EXPLAIN,
4492
4893
  SIMILARITY_THRESHOLD,
4493
4894
  SINGLE_MODE,
4895
+ SKIP,
4494
4896
  SNAPSHOT_AUDITS_DIR,
4495
4897
  SNAPSHOT_BRANCH,
4496
4898
  SNAPSHOT_FILE,
4497
4899
  SNAPSHOT_LLMS_FILE,
4498
4900
  SNAPSHOT_MAX_BYTES,
4499
4901
  SNAPSHOT_SCHEMA_VERSION,
4500
- aI2 as SPEC_FIELDS,
4902
+ aN2 as SPEC_FIELDS,
4501
4903
  STEPS,
4502
- aJ2 as SUGGESTION_APPLIED_MARK,
4503
- aK2 as SUGGESTION_APPLY_EXIT,
4504
- aL2 as SUGGESTION_FINAL_LABELS,
4505
- aM2 as SUGGESTION_KINDS,
4506
- aN2 as SUGGESTION_LABEL,
4507
- aO2 as SUGGESTION_LIMITS,
4508
- aP2 as SUGGESTION_REVIEW_MARK,
4904
+ aO2 as SUGGESTION_APPLIED_MARK,
4905
+ aP2 as SUGGESTION_APPLY_EXIT,
4906
+ aQ2 as SUGGESTION_FINAL_LABELS,
4907
+ aR2 as SUGGESTION_KINDS,
4908
+ aS2 as SUGGESTION_LABEL,
4909
+ aT2 as SUGGESTION_LIMITS,
4910
+ aU2 as SUGGESTION_REVIEW_MARK,
4509
4911
  SUGGESTION_SCHEMA,
4510
- aQ2 as SUGGESTION_STATE_LABELS,
4511
- aR2 as SUGGESTION_STATUS_LABEL,
4512
- aS2 as SUGGESTION_STATUS_LABELS,
4513
- aT2 as SUGGESTION_TOO_LARGE,
4912
+ aV2 as SUGGESTION_STATE_LABELS,
4913
+ aW2 as SUGGESTION_STATUS_LABEL,
4914
+ aX2 as SUGGESTION_STATUS_LABELS,
4915
+ aY2 as SUGGESTION_TOO_LARGE,
4514
4916
  SnapshotError,
4515
4917
  StorybookIndexError,
4516
- aU2 as SuggestionError,
4918
+ aZ2 as SuggestionError,
4517
4919
  TIER_AXIS,
4518
4920
  TIER_NAMES,
4519
4921
  aF as TIER_ORDER,
4520
- aV2 as TOKEN_REJECTED_MESSAGE,
4521
- aW2 as TOKEN_SETTINGS_URL,
4522
- aX2 as TRIGGER_LABELS,
4922
+ a_2 as TOKEN_REJECTED_MESSAGE,
4923
+ a$2 as TOKEN_SETTINGS_URL,
4924
+ b02 as TRIGGER_LABELS,
4523
4925
  aG as TeamDirectory,
4524
- aY2 as UNRELEASED,
4926
+ b12 as UNRELEASED,
4525
4927
  aH as VISUAL_CHECKS_DOCS,
4526
4928
  aI as VISUAL_CHECK_LABEL,
4527
4929
  aJ as VISUAL_WORKFLOW_FILES,
4528
4930
  WAITING_FOR_CLAUDE_LABEL,
4529
- aZ2 as acceptDocsDraft,
4530
- a_2 as acceptDocsText,
4931
+ b22 as acceptDocsDraft,
4932
+ b32 as acceptDocsText,
4531
4933
  accessAtLeast,
4532
4934
  accessState,
4935
+ activityAge,
4936
+ activityAnswer,
4937
+ activityBytes,
4938
+ activityIsUsable,
4939
+ activityKey,
4940
+ activityRawUrl,
4941
+ activityShaper,
4942
+ activityTreeFilter,
4533
4943
  addBrandToConfigText,
4534
4944
  addedComment,
4535
4945
  aK as affectedContrast,
4536
4946
  aL as aliasOf,
4537
4947
  aliasTarget,
4538
- a$2 as allowedMergeMethods,
4539
- b02 as anatomyLabel,
4948
+ b42 as allowedMergeMethods,
4949
+ b52 as anatomyLabel,
4540
4950
  anchoredRamp,
4541
4951
  anthropicReplyText,
4542
4952
  anthropicRequest,
4543
4953
  aM as appForProject,
4544
4954
  aN as appUrl,
4545
- b12 as appliedStatus,
4955
+ b62 as appliedStatus,
4546
4956
  applyConfirmedRenames,
4547
4957
  applyDocsSections,
4548
4958
  applyTokenEdits,
@@ -4550,11 +4960,11 @@ export {
4550
4960
  aO as approverEntries,
4551
4961
  aP as approverLists,
4552
4962
  askOthersToReviewOnGitHub,
4553
- b22 as assertSafeBranch,
4554
- b32 as assignRequestOnGitHub,
4555
- b42 as assignVersions,
4963
+ b72 as assertSafeBranch,
4964
+ b82 as assignRequestOnGitHub,
4965
+ b92 as assignVersions,
4556
4966
  auditId,
4557
- b52 as base64ToUtf8,
4967
+ ba2 as base64ToUtf8,
4558
4968
  aQ as baseBranchOf,
4559
4969
  bellChroma,
4560
4970
  aR as branchName,
@@ -4563,7 +4973,7 @@ export {
4563
4973
  branchWithJiraKey,
4564
4974
  brandDisplayName,
4565
4975
  brandPreviewVariables,
4566
- b62 as bridgeMcpInstallCommand,
4976
+ bb2 as bridgeMcpInstallCommand,
4567
4977
  buildFidelityReport,
4568
4978
  buildHistoryEntry,
4569
4979
  buildReport,
@@ -4572,32 +4982,34 @@ export {
4572
4982
  buildTokenSet,
4573
4983
  buildUsageIndex,
4574
4984
  canAddTo,
4575
- b72 as canOverride,
4985
+ bc2 as canOverride,
4576
4986
  canShare,
4577
4987
  aT as canShip,
4578
- b82 as canonicalJson,
4988
+ bd2 as canonicalJson,
4989
+ capHistory,
4579
4990
  changeEdits,
4580
4991
  aU as changeKind,
4581
4992
  changeList,
4582
- b92 as changeTable,
4993
+ be2 as changeTable,
4583
4994
  aV as changedModes,
4584
4995
  aW as changesMode,
4585
- ba2 as changesetBump,
4996
+ bf2 as changesetBump,
4586
4997
  checkBrandSlug,
4587
4998
  checkLayeredPair,
4588
4999
  choiceFor,
4589
- bb2 as classifyAuth,
5000
+ bg2 as classifyAuth,
4590
5001
  classifyLayered,
4591
5002
  classifyRisk,
4592
- bc2 as cleanDocs,
5003
+ bh2 as cleanDocs,
4593
5004
  cleanDocsText,
4594
5005
  cleanDraftText,
4595
5006
  aX as clearRawDeep,
4596
- bd2 as clearSharedEtags,
5007
+ bi2 as clearSharedEtags,
4597
5008
  closeExplorationOnGitHub,
4598
5009
  closeOnGitHub,
4599
- be2 as closingIssueNumbers,
5010
+ bj2 as closingIssueNumbers,
4600
5011
  coerceValue,
5012
+ collectActivity,
4601
5013
  collectHistory,
4602
5014
  collectRefs,
4603
5015
  colorDelta,
@@ -4607,55 +5019,55 @@ export {
4607
5019
  combineConflicts,
4608
5020
  a_ as comboKey,
4609
5021
  commentOnGitHub,
4610
- bf2 as commitFileOnGitHub,
5022
+ bk2 as commitFileOnGitHub,
4611
5023
  commitLibraryResolution,
4612
5024
  a$ as commitMessage,
4613
5025
  b0 as compactJson,
4614
5026
  compareImages,
4615
- bg2 as componentContrastPairs,
5027
+ bl2 as componentContrastPairs,
4616
5028
  componentForPath,
4617
- bh2 as componentMotion,
5029
+ bm2 as componentMotion,
4618
5030
  componentSlug,
4619
5031
  componentSpecSuggestionPayload,
4620
- bi2 as componentsUsingMotionToken,
4621
- bj2 as composeChangeset,
5032
+ bn2 as componentsUsingMotionToken,
5033
+ bo2 as composeChangeset,
4622
5034
  composeFiles,
4623
5035
  composeNewBrandBody,
4624
5036
  composePendingDrafts,
4625
5037
  b1 as composePrBody,
4626
5038
  composeProposalBody,
4627
5039
  composeRequestIssue,
4628
- bk2 as composeSuggestionAppliedComment,
4629
- bl2 as composeSuggestionIssue,
4630
- bm2 as composeSuggestionReviewComment,
5040
+ bp2 as composeSuggestionAppliedComment,
5041
+ bq2 as composeSuggestionIssue,
5042
+ br2 as composeSuggestionReviewComment,
4631
5043
  b2 as composite,
4632
5044
  conflictRoute,
4633
5045
  b3 as contextFor,
4634
5046
  contextLabel,
4635
- bn2 as continueDocsProposalOnGitHub,
5047
+ bs2 as continueDocsProposalOnGitHub,
4636
5048
  contrastDelta,
4637
- bo2 as contrastDeltaTable,
5049
+ bt2 as contrastDeltaTable,
4638
5050
  b4 as contrastLevel,
4639
5051
  b5 as contrastPair,
4640
5052
  b6 as contrastRatio,
4641
5053
  contrastScope,
4642
- bp2 as countChanges,
4643
- bq2 as coverageSummary,
5054
+ bu2 as countChanges,
5055
+ bv2 as coverageSummary,
4644
5056
  createDocsDraftSession,
4645
5057
  createPendingDrafts,
4646
5058
  createSuggestionOnGitHub,
4647
- br2 as cssModuleClasses,
5059
+ bw2 as cssModuleClasses,
4648
5060
  cssOf,
4649
5061
  cssVarOf,
4650
5062
  cssVarsIn,
4651
- bs2 as declineComment,
4652
- bt2 as declineReasonProblems,
4653
- bu2 as declineRequestOnGitHub,
4654
- bv2 as declineSuggestionOnGitHub,
5063
+ bx2 as declineComment,
5064
+ by2 as declineReasonProblems,
5065
+ bz2 as declineRequestOnGitHub,
5066
+ bA2 as declineSuggestionOnGitHub,
4655
5067
  decodePicks,
4656
5068
  defaultChoiceFor,
4657
5069
  b7 as defaultContext,
4658
- bw2 as defaultDocsFooter,
5070
+ bB2 as defaultDocsFooter,
4659
5071
  defaultFile,
4660
5072
  defaultModelConfig,
4661
5073
  defaultProduct,
@@ -4667,29 +5079,29 @@ export {
4667
5079
  b9 as detectLayout,
4668
5080
  diffLayered,
4669
5081
  dismissStaleFrom,
4670
- bx2 as docsAuthorLine,
4671
- by2 as docsFileText,
5082
+ bC2 as docsAuthorLine,
5083
+ bD2 as docsFileText,
4672
5084
  docsPrompt,
4673
- bz2 as docsProposal,
4674
- bA2 as docsSectionShapes,
5085
+ bE2 as docsProposal,
5086
+ bF2 as docsSectionShapes,
4675
5087
  docsSectionsAnswer,
4676
5088
  docsSectionsResult,
4677
5089
  docsSelectionPrompt,
4678
- bB2 as docsSlug,
4679
- bC2 as docsSuggestionPayload,
5090
+ bG2 as docsSlug,
5091
+ bH2 as docsSuggestionPayload,
4680
5092
  docsTaskKeys,
4681
5093
  docsTaskPrompt,
4682
- bD2 as docsText,
4683
- bE2 as draftChangeLine,
5094
+ bI2 as docsText,
5095
+ bJ2 as draftChangeLine,
4684
5096
  draftImagePath,
4685
5097
  draftItemBrief,
4686
- bF2 as draftPushDescription,
4687
- bG2 as draftRequestText,
5098
+ bK2 as draftPushDescription,
5099
+ bL2 as draftRequestText,
4688
5100
  draftSessionPath,
4689
5101
  dtcgColor,
4690
5102
  effectiveScopes,
4691
- bH2 as effectiveTier,
4692
- bI2 as eligibleReviewers,
5103
+ effectiveTier,
5104
+ bM2 as eligibleReviewers,
4693
5105
  emptyTokenFile,
4694
5106
  encodePicks,
4695
5107
  ensureRequestsBranch,
@@ -4699,16 +5111,16 @@ export {
4699
5111
  evaluatePairs,
4700
5112
  bc as expandEntries,
4701
5113
  bd as expandOwners,
4702
- bJ2 as explorationBranch,
5114
+ bN2 as explorationBranch,
4703
5115
  explorationNote,
4704
5116
  explorationNotePath,
4705
5117
  explorationPrBody,
4706
5118
  explorationPrTitle,
4707
5119
  explorationProblems,
4708
- bK2 as explorationRules,
4709
- bL2 as explorationShareMessage,
5120
+ bO2 as explorationRules,
5121
+ bP2 as explorationShareMessage,
4710
5122
  explorationSlug,
4711
- bM2 as explorationSlugFromBranch,
5123
+ bQ2 as explorationSlugFromBranch,
4712
5124
  explorationStatus,
4713
5125
  explorationSummary,
4714
5126
  explorationTestBuildOnGitHub,
@@ -4719,7 +5131,7 @@ export {
4719
5131
  fidelityVerdict,
4720
5132
  be as fieldChanges,
4721
5133
  figmaBranchTitle,
4722
- bN2 as figmaCell,
5134
+ bR2 as figmaCell,
4723
5135
  figmaChangeOnGitHub,
4724
5136
  figmaDraftBody,
4725
5137
  figmaDraftBrief,
@@ -4730,51 +5142,52 @@ export {
4730
5142
  figmaPushStatusesOnGitHub,
4731
5143
  figmaSpecPath,
4732
5144
  figmaSpecSlug,
4733
- bO2 as fileModes,
4734
- bP2 as filterHistory,
5145
+ bS2 as fileModes,
5146
+ bT2 as filterHistory,
4735
5147
  findExplorationOnGitHub,
4736
- bQ2 as findOpenDocsProposal,
4737
- bR2 as findOpenDocsProposalOnGitHub,
5148
+ bU2 as findOpenDocsProposal,
5149
+ bV2 as findOpenDocsProposalOnGitHub,
4738
5150
  findPreviewComment,
4739
5151
  bf as findProduct,
4740
5152
  findReferenceProblems,
4741
5153
  bg as findToken,
4742
5154
  bh as findVercelComment,
4743
- bS2 as firstParagraph,
5155
+ bW2 as firstParagraph,
5156
+ fitActivity,
4744
5157
  bi as flattenLayerFile,
4745
5158
  flattenTokenFile,
4746
5159
  flattenTokens,
4747
5160
  formatChangeset,
4748
- bT2 as formatDocsJson,
5161
+ bX2 as formatDocsJson,
4749
5162
  formatFigmaSpec,
4750
5163
  bj as formatNumber,
4751
5164
  bk as formatOwnerEntry,
4752
5165
  formatValue,
4753
5166
  freshness,
4754
- bU2 as friendlyMessage,
5167
+ bY2 as friendlyMessage,
4755
5168
  fromHex,
4756
5169
  bl as fromPlain,
4757
5170
  generateRamp,
4758
5171
  bm as getChild,
4759
5172
  bn as getEntry,
4760
- bV2 as getSuggestionOnGitHub,
5173
+ getSuggestionOnGitHub,
4761
5174
  gitBlobSha,
4762
5175
  gitHubHistoryBackend,
4763
5176
  gitHubSource,
4764
- bW2 as githubSuggestionWorkspace,
5177
+ bZ2 as githubSuggestionWorkspace,
4765
5178
  globBase,
4766
5179
  globToRegExp,
4767
5180
  groupStorybookComponents,
4768
5181
  bo as groupsPhrase,
4769
- bX2 as hasSuggestionBlock,
5182
+ b_2 as hasSuggestionBlock,
4770
5183
  bp as hasVisualWorkflow,
4771
- bY2 as hasWriteAccess,
4772
- bZ2 as hashSpec,
5184
+ b$2 as hasWriteAccess,
5185
+ c02 as hashSpec,
4773
5186
  hexContrastRatio,
4774
5187
  hexLuminance,
4775
5188
  bq as hexToRgba,
4776
5189
  br as holdersOf,
4777
- b_2 as iconComponentName,
5190
+ c12 as iconComponentName,
4778
5191
  idExtensionFor,
4779
5192
  impactedModules,
4780
5193
  importsIn,
@@ -4782,32 +5195,32 @@ export {
4782
5195
  bt as inheritedTypeAt,
4783
5196
  bu as installCommand,
4784
5197
  bv as installCommandFromPreviewComment,
4785
- b$2 as installationFor,
4786
- c02 as isActiveExploration,
5198
+ c22 as installationFor,
5199
+ c32 as isActiveExploration,
4787
5200
  isAlias$1 as isAlias,
4788
- c12 as isAutomationPull,
4789
- c22 as isDocsProposalBranch,
5201
+ c42 as isAutomationPull,
5202
+ c52 as isDocsProposalBranch,
4790
5203
  isDocsSelectionMode,
4791
5204
  isDraftSessionId,
4792
5205
  isExplorationBranch,
4793
5206
  isExplorationPull,
4794
5207
  bw as isGuardrail,
4795
- c32 as isGuardrailPath,
5208
+ c62 as isGuardrailPath,
4796
5209
  isHex,
4797
- c42 as isJiraKey,
4798
- c52 as isMissingPermission,
5210
+ c72 as isJiraKey,
5211
+ c82 as isMissingPermission,
4799
5212
  isMultiMode,
4800
5213
  isPlanRefusal,
4801
5214
  isProseKey,
4802
- c62 as isReleasePull,
5215
+ c92 as isReleasePull,
4803
5216
  bx as isTeamEntry,
4804
5217
  by as isTokenFile,
4805
- c72 as isTokenRejected,
5218
+ ca2 as isTokenRejected,
4806
5219
  isUnder,
4807
5220
  bz as isVercelComment,
4808
- c82 as jiraIssueFields,
4809
- c92 as jiraKeyOf,
4810
- ca2 as joinRepoPath,
5221
+ cb2 as jiraIssueFields,
5222
+ cc2 as jiraKeyOf,
5223
+ cd2 as joinRepoPath,
4811
5224
  bA as kindForMin,
4812
5225
  layeredImpact,
4813
5226
  bB as layeredParityIssues,
@@ -4816,49 +5229,49 @@ export {
4816
5229
  libraryBranchPlan,
4817
5230
  bC as libraryIsPublic,
4818
5231
  libraryPreviewState,
4819
- cb2 as linkRequestToExplorationOnGitHub,
5232
+ ce2 as linkRequestToExplorationOnGitHub,
4820
5233
  linkStatus,
4821
- cc2 as linkSuggestionPrOnGitHub,
5234
+ cf2 as linkSuggestionPrOnGitHub,
4822
5235
  linkedLibraryBranchOnGitHub,
4823
- cd2 as linkedPullsOf,
5236
+ cg2 as linkedPullsOf,
4824
5237
  listBrands,
4825
5238
  listExplorationsOnGitHub,
4826
5239
  listFigmaChangesOnGitHub,
4827
5240
  listPendingDrafts,
4828
5241
  listStylesheets,
4829
- ce2 as listSuggestionsOnGitHub,
5242
+ listSuggestionsOnGitHub,
4830
5243
  loadConfig,
4831
5244
  loadGitHubHistory,
4832
5245
  loadProtection,
4833
- cf2 as loadRepoFiles,
5246
+ ch2 as loadRepoFiles,
4834
5247
  loadRepoModel,
4835
5248
  loadRequiredChecks,
4836
- cg2 as lowerFirstWord,
5249
+ ci2 as lowerFirstWord,
4837
5250
  bD as luminance,
4838
5251
  mailtoHref,
4839
5252
  markClaudeDraft,
4840
5253
  markFigmaChangeDraftedOnGitHub,
4841
- ch2 as markSuggestionsAppliedOnGitHub,
4842
- ci2 as memoryEtagStore,
4843
- cj2 as memorySource,
5254
+ cj2 as markSuggestionsAppliedOnGitHub,
5255
+ ck2 as memoryEtagStore,
5256
+ cl2 as memorySource,
4844
5257
  mergeDocsDraft,
4845
5258
  mergeDraftResults,
4846
- ck2 as mergeGate,
5259
+ cm2 as mergeGate,
4847
5260
  mergeOnGitHub,
4848
5261
  mergePiecesRecord,
4849
5262
  mergeReleases,
4850
5263
  missingChoices,
4851
- cl2 as missingPermissionMessage,
4852
- cm2 as missingProse,
5264
+ cn2 as missingPermissionMessage,
5265
+ co2 as missingProse,
4853
5266
  modeDisplayName,
4854
5267
  modeFile,
4855
- cn2 as modeLabel,
5268
+ cp2 as modeLabel,
4856
5269
  modesOf$1 as modesOf,
4857
5270
  moveToken,
4858
5271
  bE as nearestQuestion,
4859
5272
  nearestStep,
4860
5273
  bF as neededBySection,
4861
- co2 as needsDocsReview,
5274
+ cq2 as needsDocsReview,
4862
5275
  neutralChroma,
4863
5276
  neutralOffset,
4864
5277
  newBrandSection,
@@ -4872,20 +5285,21 @@ export {
4872
5285
  onlyTokens,
4873
5286
  openComponentPushOnGitHub,
4874
5287
  openLibraryBranchOnGitHub,
4875
- cp2 as openPulls,
5288
+ cr2 as openPulls,
4876
5289
  overlap,
4877
5290
  overrideComment,
4878
5291
  bI as overrideKey,
4879
5292
  overrideMergeOnGitHub,
4880
- cq2 as overrideReasonProblem,
5293
+ cs2 as overrideReasonProblem,
4881
5294
  overrideRefusedComment,
4882
5295
  bJ as ownerEntryProblems,
4883
5296
  packageDir,
4884
5297
  packageDirCandidates,
4885
5298
  bK as pairKey,
4886
5299
  parentDir,
5300
+ parseActivity,
4887
5301
  parseChangelog,
4888
- cr2 as parseChangesetText,
5302
+ ct2 as parseChangesetText,
4889
5303
  parseColor,
4890
5304
  parseComponentCss,
4891
5305
  parseComponentFamilies,
@@ -4900,30 +5314,30 @@ export {
4900
5314
  parseExplorationBody,
4901
5315
  parseFigmaOrigin,
4902
5316
  parseFigmaSpec,
4903
- cs2 as parseJiraKey,
5317
+ cu2 as parseJiraKey,
4904
5318
  bM as parseJson,
4905
5319
  parseModelConfig,
4906
5320
  bN as parseNeededBy,
4907
- ct2 as parseOverrideComment,
5321
+ cv2 as parseOverrideComment,
4908
5322
  bO as parseOwnerEntry,
4909
5323
  parsePendingDrafts,
4910
5324
  parsePiecesRecord,
4911
- cu2 as parseRepo,
4912
- cv2 as parseRequestIssue,
5325
+ cw2 as parseRepo,
5326
+ parseRequestIssue,
4913
5327
  parseSnapshot,
4914
5328
  parseStorybookIndex,
4915
- cw2 as parseStructureChange,
4916
- cx as parseSuggestionAppliedComment,
4917
- cy as parseSuggestionIssue,
4918
- cz as parseSuggestionReviewComment,
4919
- cA as parseTier,
5329
+ cx as parseStructureChange,
5330
+ cy as parseSuggestionAppliedComment,
5331
+ cz as parseSuggestionIssue,
5332
+ cA as parseSuggestionReviewComment,
5333
+ cB as parseTier,
4920
5334
  parseTokenFile,
4921
5335
  bP as parseVercelComment,
4922
- cB as patchDocsJson,
5336
+ cC as patchDocsJson,
4923
5337
  pathId,
4924
5338
  pathSimilarity,
4925
- cC as pendingApprovals,
4926
- cD as permissionLabel,
5339
+ cD as pendingApprovals,
5340
+ cE as permissionLabel,
4927
5341
  pickedOption,
4928
5342
  p as pieceId,
4929
5343
  bQ as piecesSection,
@@ -4932,14 +5346,14 @@ export {
4932
5346
  planNewBrand,
4933
5347
  planReference,
4934
5348
  planReferences,
4935
- cE as planRestore,
4936
- cF as planRevert,
4937
- cG as planSuggestionApply,
4938
- cH as planToJson,
5349
+ cF as planRestore,
5350
+ cG as planRevert,
5351
+ cH as planSuggestionApply,
5352
+ cI as planToJson,
4939
5353
  planTokenMerge,
4940
5354
  planTokenProposal,
4941
- cI as prNumberFromSubject,
4942
- cJ as prefillDocs,
5355
+ cJ as prNumberFromSubject,
5356
+ cK as prefillDocs,
4943
5357
  bS as previewComment,
4944
5358
  previewLinks,
4945
5359
  bT as previewLinksOf,
@@ -4959,9 +5373,9 @@ export {
4959
5373
  b_ as projectOfLabel,
4960
5374
  promoteExplorationOnGitHub,
4961
5375
  promotionPlan,
4962
- cK as proposeDocsOnGitHub,
5376
+ cL as proposeDocsOnGitHub,
4963
5377
  a as proposedTokenPath,
4964
- cL as propsTable,
5378
+ cM as propsTable,
4965
5379
  protectLibrary,
4966
5380
  protectRefusal,
4967
5381
  b$ as protectedBranchesOf,
@@ -4969,9 +5383,9 @@ export {
4969
5383
  protectionRulesetName,
4970
5384
  protectionSentence,
4971
5385
  protectionState,
4972
- cM as pullState,
4973
- cN as pushChangeRows,
4974
- cO as rateLimitMessage,
5386
+ cN as pullState,
5387
+ cO as pushChangeRows,
5388
+ cP as rateLimitMessage,
4975
5389
  readCombineBranch,
4976
5390
  readLibraryConflicts,
4977
5391
  readPendingDrafts,
@@ -4982,19 +5396,20 @@ export {
4982
5396
  readTokenAt,
4983
5397
  reconcileIds,
4984
5398
  recordPiecesOnGitHub,
5399
+ recordingFetch,
4985
5400
  recordingSource,
4986
5401
  referenceImagePath,
4987
- cP as releasePull,
5402
+ cQ as releasePull,
4988
5403
  releasesFromTags,
4989
5404
  removeToken,
4990
5405
  removedSide,
4991
5406
  c0 as renderedColor,
4992
- cQ as reopenEligibility,
5407
+ cR as reopenEligibility,
4993
5408
  reopenOnGitHub,
4994
- cR as requestBrief,
4995
- cS as requestImagePath,
4996
- cT as requestIssueTitle,
4997
- cU as requestStatus,
5409
+ cS as requestBrief,
5410
+ cT as requestImagePath,
5411
+ cU as requestIssueTitle,
5412
+ requestStatus,
4998
5413
  cV as requiredApprovals,
4999
5414
  requiredCheckNames,
5000
5415
  cW as requiredPermission,
@@ -5125,6 +5540,7 @@ export {
5125
5540
  tokenValueCss,
5126
5541
  tokensPath,
5127
5542
  touchesPackages,
5543
+ trimGitHub,
5128
5544
  tryInProductUrl,
5129
5545
  tryTogetherUrl,
5130
5546
  unpicked,