@cat-factory/integrations 0.134.1 → 0.136.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.
Files changed (40) hide show
  1. package/dist/modules/documents/FigmaProvider.d.ts +28 -4
  2. package/dist/modules/documents/FigmaProvider.d.ts.map +1 -1
  3. package/dist/modules/documents/FigmaProvider.js +192 -34
  4. package/dist/modules/documents/FigmaProvider.js.map +1 -1
  5. package/dist/modules/documents/ZeplinProvider.d.ts +5 -0
  6. package/dist/modules/documents/ZeplinProvider.d.ts.map +1 -1
  7. package/dist/modules/documents/ZeplinProvider.js +14 -6
  8. package/dist/modules/documents/ZeplinProvider.js.map +1 -1
  9. package/dist/modules/documents/design.logic.d.ts +43 -4
  10. package/dist/modules/documents/design.logic.d.ts.map +1 -1
  11. package/dist/modules/documents/design.logic.js +0 -0
  12. package/dist/modules/documents/design.logic.js.map +1 -1
  13. package/dist/modules/documents/figma.logic.d.ts +143 -5
  14. package/dist/modules/documents/figma.logic.d.ts.map +1 -1
  15. package/dist/modules/documents/figma.logic.js +467 -49
  16. package/dist/modules/documents/figma.logic.js.map +1 -1
  17. package/dist/modules/documents/zeplin.logic.d.ts +15 -0
  18. package/dist/modules/documents/zeplin.logic.d.ts.map +1 -1
  19. package/dist/modules/documents/zeplin.logic.js +27 -0
  20. package/dist/modules/documents/zeplin.logic.js.map +1 -1
  21. package/dist/modules/environments/EnvironmentProvisioningService.d.ts +7 -1
  22. package/dist/modules/environments/EnvironmentProvisioningService.d.ts.map +1 -1
  23. package/dist/modules/environments/EnvironmentProvisioningService.js.map +1 -1
  24. package/dist/modules/kubernetes/KubernetesRunnerTransport.d.ts +12 -2
  25. package/dist/modules/kubernetes/KubernetesRunnerTransport.d.ts.map +1 -1
  26. package/dist/modules/kubernetes/KubernetesRunnerTransport.js +45 -1
  27. package/dist/modules/kubernetes/KubernetesRunnerTransport.js.map +1 -1
  28. package/dist/modules/provisioning-logs/LoggingRunnerTransport.d.ts +12 -2
  29. package/dist/modules/provisioning-logs/LoggingRunnerTransport.d.ts.map +1 -1
  30. package/dist/modules/provisioning-logs/LoggingRunnerTransport.js +27 -1
  31. package/dist/modules/provisioning-logs/LoggingRunnerTransport.js.map +1 -1
  32. package/dist/modules/runners/HttpRunnerPoolProvider.d.ts +3 -3
  33. package/dist/modules/runners/HttpRunnerPoolProvider.d.ts.map +1 -1
  34. package/dist/modules/runners/HttpRunnerPoolProvider.js +22 -3
  35. package/dist/modules/runners/HttpRunnerPoolProvider.js.map +1 -1
  36. package/dist/modules/runners/RunnerPoolTransport.d.ts +15 -2
  37. package/dist/modules/runners/RunnerPoolTransport.d.ts.map +1 -1
  38. package/dist/modules/runners/RunnerPoolTransport.js +22 -3
  39. package/dist/modules/runners/RunnerPoolTransport.js.map +1 -1
  40. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- import { dimensionMeta, } from './design.logic.js';
1
+ import { capped, dimensionMeta, sortDesignTokens, } from './design.logic.js';
2
2
  import { assertHostPinned } from './http.js';
3
3
  // Figma-specific pure logic, kept out of the provider shell so it is unit-testable
4
4
  // without a live workspace: parsing/canonicalising a file+node ref out of user input,
@@ -119,50 +119,208 @@ export function figmaUrlFor(externalId) {
119
119
  return base;
120
120
  return `${base}?node-id=${nodeId.replace(/:/g, '-')}`;
121
121
  }
122
- const MAX_TREE_DEPTH = 6;
123
- const MAX_TREE_NODES = 400;
122
+ // Every cap below is sized against the ~256 KB linked-context corpus budget
123
+ // (`context_documents_over_budget`), which is what decides whether this document reaches the
124
+ // agent at all. Worst case, roughly: layout 1,500 lines × ~60 B ≈ 90 KB, text 600 × ~50 B
125
+ // ≈ 30 KB, tokens 250 × ~50 B ≈ 13 KB, components 150 × ~80 B ≈ 12 KB, so a maximal import
126
+ // lands near 145 KB and leaves headroom for the rest of the corpus. RAISING ONE MEANS
127
+ // REDOING THAT ARITHMETIC, not just picking a bigger number.
128
+ /**
129
+ * Levels of descendants rendered below a frame's own children. Exported because the provider
130
+ * derives the API `depth=` it requests from it: the two must not drift, or the tree is cut by
131
+ * the fetch at a depth the renderer never states.
132
+ */
133
+ export const MAX_TREE_DEPTH = 6;
134
+ /** Nodes rendered for one frame. */
135
+ const MAX_FRAME_NODES = 400;
136
+ /** Nodes rendered across the WHOLE import: a whole-file import fans out over many frames. */
137
+ const MAX_IMPORT_NODES = 1500;
138
+ /** Text lines collected for one frame, and across the whole import. */
139
+ const MAX_FRAME_TEXT = 200;
140
+ const MAX_IMPORT_TEXT = 600;
141
+ /** Top-level frames a whole-file import fetches as subtrees. */
142
+ export const MAX_FILE_FRAMES = 12;
143
+ /** Distinct variants listed on one component's note before the rest are summarised away. */
144
+ const MAX_VARIANTS_PER_COMPONENT = 6;
145
+ /** Components listed, ranked by how often the design instantiates them. */
146
+ const MAX_COMPONENTS = 150;
147
+ /** Token lines listed, whichever source produced them. */
148
+ const MAX_TOKENS = 250;
149
+ /** Page children worth fetching as a frame subtree; a stray vector or sticky is not one. */
150
+ const FRAME_TYPES = new Set(['FRAME', 'COMPONENT', 'COMPONENT_SET', 'SECTION', 'GROUP']);
124
151
  function dimensionLabel(node) {
125
152
  return dimensionMeta(node.absoluteBoundingBox?.width, node.absoluteBoundingBox?.height) ?? '';
126
153
  }
154
+ function round(value) {
155
+ return Math.round(value * 100) / 100;
156
+ }
157
+ // ---- Styling facts ---------------------------------------------------------
158
+ /** Figma's 0–1 colour channels → `#rrggbb`, with an alpha qualifier below full opacity. */
159
+ export function figmaColorHex(color, paintOpacity) {
160
+ if (!color)
161
+ return null;
162
+ const to2 = (n) => Math.max(0, Math.min(255, Math.round((n ?? 0) * 255)))
163
+ .toString(16)
164
+ .padStart(2, '0');
165
+ const hex = `#${to2(color.r)}${to2(color.g)}${to2(color.b)}`;
166
+ const alpha = (color.a ?? 1) * (paintOpacity ?? 1);
167
+ return alpha < 1 ? `${hex} (a=${alpha.toFixed(2)})` : hex;
168
+ }
169
+ /** The first visible SOLID paint's hex, or null when the node has none we can name. */
170
+ function firstSolidHex(paints) {
171
+ for (const paint of paints ?? []) {
172
+ if (paint.visible === false || paint.type !== 'SOLID')
173
+ continue;
174
+ const hex = figmaColorHex(paint.color, paint.opacity);
175
+ if (hex)
176
+ return hex;
177
+ }
178
+ return null;
179
+ }
180
+ /** `Inter 16/600 lh 24`: the typography an implementer would otherwise have to guess. */
181
+ function typographyLabel(style) {
182
+ if (!style)
183
+ return null;
184
+ const parts = [];
185
+ if (style.fontFamily?.trim())
186
+ parts.push(style.fontFamily.trim());
187
+ if (style.fontSize != null) {
188
+ parts.push(style.fontWeight != null
189
+ ? `${round(style.fontSize)}/${style.fontWeight}`
190
+ : `${round(style.fontSize)}px`);
191
+ }
192
+ else if (style.fontWeight != null) {
193
+ parts.push(`w${style.fontWeight}`);
194
+ }
195
+ if (style.lineHeightPx != null)
196
+ parts.push(`lh ${round(style.lineHeightPx)}`);
197
+ return parts.length ? parts.join(' ') : null;
198
+ }
199
+ /** `padding 16` when uniform, else the CSS-ordered `padding 16/24/16/24` (top right bottom left). */
200
+ function paddingLabel(node) {
201
+ const sides = [node.paddingTop, node.paddingRight, node.paddingBottom, node.paddingLeft];
202
+ if (sides.every((s) => s == null))
203
+ return null;
204
+ const values = sides.map((s) => round(s ?? 0));
205
+ if (values.every((v) => v === values[0])) {
206
+ return values[0] === 0 ? null : `padding ${values[0]}`;
207
+ }
208
+ return `padding ${values.join('/')}`;
209
+ }
210
+ function cornerRadiusLabel(node) {
211
+ const corners = node.rectangleCornerRadii;
212
+ if (corners?.length === 4 && corners.some((c) => c !== corners[0])) {
213
+ return `radius ${corners.map((c) => round(c)).join('/')}`;
214
+ }
215
+ const radius = node.cornerRadius ?? corners?.[0];
216
+ return radius ? `radius ${round(radius)}` : null;
217
+ }
218
+ function autoLayoutLabel(node) {
219
+ const mode = node.layoutMode;
220
+ if (!mode || mode === 'NONE')
221
+ return null;
222
+ const parts = [`auto-layout ${mode.toLowerCase()}`];
223
+ if (node.itemSpacing)
224
+ parts.push(`gap ${round(node.itemSpacing)}`);
225
+ const padding = paddingLabel(node);
226
+ if (padding)
227
+ parts.push(padding);
228
+ return parts.join(' ');
229
+ }
230
+ /**
231
+ * The styling clause appended to a node's layout line. Everything here is a fact the agent
232
+ * would otherwise invent: the colour, the type ramp, the radius, and the auto-layout that
233
+ * decides whether the implementation is a flex row or a stack.
234
+ */
235
+ export function figmaStylingFacts(node) {
236
+ const facts = [];
237
+ const fill = firstSolidHex(node.fills);
238
+ if (fill)
239
+ facts.push(`fill ${fill}`);
240
+ const stroke = firstSolidHex(node.strokes);
241
+ if (stroke)
242
+ facts.push(`stroke ${stroke}`);
243
+ const typography = typographyLabel(node.style);
244
+ if (typography)
245
+ facts.push(typography);
246
+ const radius = cornerRadiusLabel(node);
247
+ if (radius)
248
+ facts.push(radius);
249
+ const layout = autoLayoutLabel(node);
250
+ if (layout)
251
+ facts.push(layout);
252
+ return facts;
253
+ }
127
254
  /**
128
- * Render a node and its descendants as an indented bullet tree (name + type +
129
- * size), bounded in depth and total nodes so a huge frame can't blow up the
130
- * context file. Mutates `counter` to enforce the global node cap.
255
+ * Render a node and its descendants as an indented bullet tree (name, type, size, styling),
256
+ * bounded in depth and in nodes so a huge frame can't blow up the context file.
257
+ *
258
+ * Returns false only on EXHAUSTION (see {@link LayoutCut}), which the caller must propagate:
259
+ * a `true` return means siblings may still render, even when this branch was cut by depth.
260
+ * The `(truncated)` marker is pushed by the exhaustion guard itself, at the depth the walk
261
+ * actually ran out, so unwinding ancestors add nothing and one cut leaves ONE marker.
131
262
  */
132
- function renderLayout(node, depth, counter, lines) {
133
- if (depth > MAX_TREE_DEPTH || counter.n >= MAX_TREE_NODES)
134
- return;
135
- counter.n++;
263
+ function renderLayout(node, depth, walk, lines) {
136
264
  const indent = ' '.repeat(depth);
265
+ if (walk.budget.nodes <= 0) {
266
+ walk.cuts.add('import-nodes');
267
+ lines.push(`${indent}- … (truncated)`);
268
+ return false;
269
+ }
270
+ if (walk.frameNodes <= 0) {
271
+ walk.cuts.add('frame-nodes');
272
+ lines.push(`${indent}- … (truncated)`);
273
+ return false;
274
+ }
275
+ walk.frameNodes--;
276
+ walk.budget.nodes--;
137
277
  const name = node.name?.trim() || '(unnamed)';
138
278
  const type = node.type ? ` _${node.type}_` : '';
139
- lines.push(`${indent}- ${name}${type}${dimensionLabel(node)}`);
140
- for (const child of node.children ?? []) {
141
- if (counter.n >= MAX_TREE_NODES) {
142
- lines.push(`${indent} - (truncated)`);
143
- break;
144
- }
145
- renderLayout(child, depth + 1, counter, lines);
279
+ const facts = figmaStylingFacts(node);
280
+ const styling = facts.length ? ` [${facts.join('; ')}]` : '';
281
+ lines.push(`${indent}- ${name}${type}${dimensionLabel(node)}${styling}`);
282
+ const children = node.children ?? [];
283
+ if (!children.length)
284
+ return true;
285
+ if (depth >= MAX_TREE_DEPTH) {
286
+ // The design continues below what we render. Naming the count is what separates "the cap
287
+ // stopped here" from "this node is a leaf", which an omitted line renders identically.
288
+ walk.cuts.add('depth');
289
+ const label = children.length === 1 ? 'node' : 'nodes';
290
+ lines.push(`${indent} - … (${children.length} deeper ${label} not shown)`);
291
+ return true;
146
292
  }
293
+ for (const child of children) {
294
+ if (!renderLayout(child, depth + 1, walk, lines))
295
+ return false;
296
+ }
297
+ return true;
147
298
  }
148
- /** Collect every TEXT node's `characters`, in document order, bounded. */
149
- function collectText(node, out) {
150
- if (out.length >= MAX_TREE_NODES)
151
- return;
152
- if (node.type === 'TEXT' && node.characters?.trim())
299
+ /**
300
+ * Collect every TEXT node's `characters`, in document order, bounded per frame and import.
301
+ * Returns false when a cap stopped it, because an empty `Text content` section is DROPPED by
302
+ * the renderer: without this the frames whose text the import budget refused read exactly
303
+ * like frames that contain no text.
304
+ */
305
+ function collectText(node, walk, out) {
306
+ if (walk.budget.text <= 0) {
307
+ walk.cut = 'import-text';
308
+ return false;
309
+ }
310
+ if (walk.frameLines <= 0) {
311
+ walk.cut = 'frame-text';
312
+ return false;
313
+ }
314
+ if (node.type === 'TEXT' && node.characters?.trim()) {
153
315
  out.push(node.characters.trim());
154
- for (const child of node.children ?? [])
155
- collectText(child, out);
156
- }
157
- /** Collect the distinct design-system components a node tree instantiates. */
158
- function collectComponents(node, components, out) {
159
- if (node.type === 'INSTANCE') {
160
- const name = (node.componentId && components[node.componentId]?.name) || node.name?.trim();
161
- if (name)
162
- out.add(name);
316
+ walk.frameLines--;
317
+ walk.budget.text--;
163
318
  }
164
- for (const child of node.children ?? [])
165
- collectComponents(child, components, out);
319
+ for (const child of node.children ?? []) {
320
+ if (!collectText(child, walk, out))
321
+ return false;
322
+ }
323
+ return true;
166
324
  }
167
325
  /**
168
326
  * Map the fetched Figma frames into the source-neutral {@link DesignBlock}s: one block
@@ -171,31 +329,191 @@ function collectComponents(node, components, out) {
171
329
  * shared global `### Components` section rather than per-frame.
172
330
  */
173
331
  export function figmaBlocks(roots) {
174
- return roots.map((root) => {
332
+ // One budget for the whole import: a whole-file import renders many frames, so a
333
+ // per-frame cap alone bounds nothing about the size of the context file it produces.
334
+ const budget = { nodes: MAX_IMPORT_NODES, text: MAX_IMPORT_TEXT };
335
+ // Frames counted per CAP, not one "was cut" tally: each cap is a different fact about the
336
+ // import and asks a different thing of the reader.
337
+ const cutFrames = new Map();
338
+ const count = (cut) => cutFrames.set(cut, (cutFrames.get(cut) ?? 0) + 1);
339
+ const blocks = roots.map((root) => {
340
+ // One frame counter shared across every top-level child, so the per-frame cap bounds the
341
+ // whole frame rather than each subtree: a wide frame can't pass it one branch at a time.
342
+ const walk = { frameNodes: MAX_FRAME_NODES, budget, cuts: new Set() };
175
343
  const layout = [];
176
- // One counter shared across every top-level child so MAX_TREE_NODES bounds the whole
177
- // frame, not each subtree — a wide frame can't blow past the cap one branch at a time.
178
- const counter = { n: 0 };
179
- for (const child of root.children ?? [])
180
- renderLayout(child, 0, counter, layout);
344
+ for (const child of root.children ?? []) {
345
+ if (!renderLayout(child, 0, walk, layout))
346
+ break;
347
+ }
348
+ for (const cut of walk.cuts)
349
+ count(cut);
350
+ const textWalk = { frameLines: MAX_FRAME_TEXT, budget };
181
351
  const text = [];
182
- collectText(root, text);
352
+ collectText(root, textWalk, text);
353
+ const lines = text.map((t) => `- ${t.replace(/\s+/g, ' ')}`);
354
+ if (textWalk.cut) {
355
+ count(textWalk.cut);
356
+ // Keeps the section non-empty, so a refused budget can never render as "no text here".
357
+ lines.push('- … (text truncated)');
358
+ }
183
359
  return {
184
360
  title: root.name?.trim() || '(unnamed frame)',
185
361
  meta: dimensionLabel(root),
186
362
  sections: [
187
363
  { heading: 'Layout', lines: layout },
188
- { heading: 'Text content', lines: text.map((t) => `- ${t.replace(/\s+/g, ' ')}`) },
364
+ { heading: 'Text content', lines },
189
365
  ],
190
366
  };
191
367
  });
368
+ return { blocks, notes: capNotes(cutFrames, roots.length) };
369
+ }
370
+ /** One note per cap that bit, each naming what the reader must do about that particular cap. */
371
+ function capNotes(cutFrames, total) {
372
+ const notes = [];
373
+ const of = (n) => `${n} of ${total} frames`;
374
+ const depth = cutFrames.get('depth');
375
+ if (depth) {
376
+ notes.push(`Layout is rendered ${MAX_TREE_DEPTH} levels deep below each frame's own children; in ` +
377
+ `${of(depth)} a branch continues past that and ends at a "(N deeper nodes not shown)" ` +
378
+ `marker. Link that sub-frame's own URL to import it at full depth.`);
379
+ }
380
+ const frameNodes = cutFrames.get('frame-nodes');
381
+ if (frameNodes) {
382
+ notes.push(`Layout is capped at ${MAX_FRAME_NODES} nodes per frame; ${of(frameNodes)} hit that cap ` +
383
+ `and stop at a "(truncated)" marker, so their later siblings are absent entirely.`);
384
+ }
385
+ const importNodes = cutFrames.get('import-nodes');
386
+ if (importNodes) {
387
+ notes.push(`The import-wide budget of ${MAX_IMPORT_NODES} layout nodes was spent; ${of(importNodes)} ` +
388
+ `are missing part or all of their layout. Link individual frame URLs to import fewer ` +
389
+ `frames at full fidelity.`);
390
+ }
391
+ const frameText = cutFrames.get('frame-text');
392
+ if (frameText) {
393
+ notes.push(`Text content is capped at ${MAX_FRAME_TEXT} lines per frame; ${of(frameText)} stop at a ` +
394
+ `"(text truncated)" marker.`);
395
+ }
396
+ const importText = cutFrames.get('import-text');
397
+ if (importText) {
398
+ notes.push(`The import-wide budget of ${MAX_IMPORT_TEXT} text lines was spent; ${of(importText)} are ` +
399
+ `missing part or all of their text. Link individual frame URLs to import fewer frames ` +
400
+ `at full fidelity.`);
401
+ }
402
+ return notes;
192
403
  }
193
- /** Collect the distinct design-system components instantiated across the frames. */
194
- export function figmaComponents(roots, components = {}) {
195
- const names = new Set();
404
+ /**
405
+ * The top-level frames of a whole file, in document order: the page children a
406
+ * {@link figmaBlocks} block is rendered from. The whole-file file read is shallow (it
407
+ * returns these with no grandchildren), so the caller fetches their subtrees separately.
408
+ */
409
+ export function figmaTopLevelFrames(document) {
410
+ const frames = [];
411
+ for (const page of document?.children ?? []) {
412
+ for (const child of page.children ?? []) {
413
+ if (child.id && (!child.type || FRAME_TYPES.has(child.type)))
414
+ frames.push(child);
415
+ }
416
+ }
417
+ return frames;
418
+ }
419
+ /**
420
+ * How many importable frames each page contributes, in the same document order
421
+ * {@link figmaTopLevelFrames} flattens. The frame cap counts frames, so on its own it cannot
422
+ * say whether it stopped mid-page or dropped a whole page of the design: this is what lets the
423
+ * cap note name the pages, which is the difference between "some frames are missing" and "you
424
+ * imported none of page 2".
425
+ */
426
+ export function figmaPageSummary(document) {
427
+ const pages = [];
428
+ for (const [index, page] of (document?.children ?? []).entries()) {
429
+ const frames = (page.children ?? []).filter((child) => child.id && (!child.type || FRAME_TYPES.has(child.type))).length;
430
+ if (frames)
431
+ pages.push({ name: page.name?.trim() || `Page ${index + 1}`, frames });
432
+ }
433
+ return pages;
434
+ }
435
+ // ---- Components ------------------------------------------------------------
436
+ /** Strip Figma's `#1:0` disambiguation suffix off a component-property name. */
437
+ function cleanPropertyName(raw) {
438
+ return raw.split('#')[0].trim();
439
+ }
440
+ function renderPropertyValue(value) {
441
+ if (typeof value === 'string')
442
+ return value.trim() || null;
443
+ if (typeof value === 'number' || typeof value === 'boolean')
444
+ return String(value);
445
+ return null;
446
+ }
447
+ function readInstanceProperties(props, usage) {
448
+ for (const [rawName, entry] of Object.entries(props ?? {})) {
449
+ const name = cleanPropertyName(rawName);
450
+ if (!name)
451
+ continue;
452
+ const value = renderPropertyValue(entry?.value);
453
+ if (entry?.type === 'VARIANT') {
454
+ if (value)
455
+ usage.variants.add(`${name}=${value}`);
456
+ }
457
+ else {
458
+ usage.props.add(value != null && entry?.type === 'BOOLEAN' ? `${name}=${value}` : name);
459
+ }
460
+ }
461
+ }
462
+ function collectComponents(node, components, sets, out) {
463
+ if (node.type === 'INSTANCE') {
464
+ const definition = node.componentId ? components[node.componentId] : undefined;
465
+ const set = definition?.componentSetId ? sets[definition.componentSetId] : undefined;
466
+ // A variant's own component name IS its property assignment ("Size=Large, Type=Primary"),
467
+ // so it identifies the component only through its SET. Without a set, the component name
468
+ // is the identity and there is no variant to report.
469
+ const name = (set?.name || definition?.name || node.name)?.trim();
470
+ if (name) {
471
+ const usage = out.get(name) ?? {
472
+ variants: new Set(),
473
+ props: new Set(),
474
+ instances: 0,
475
+ };
476
+ usage.instances++;
477
+ if (set?.name && definition?.name?.includes('='))
478
+ usage.variants.add(definition.name.trim());
479
+ readInstanceProperties(node.componentProperties, usage);
480
+ usage.description ??= (definition?.description || set?.description)?.trim().split('\n')[0];
481
+ out.set(name, usage);
482
+ }
483
+ }
484
+ for (const child of node.children ?? [])
485
+ collectComponents(child, components, sets, out);
486
+ }
487
+ function usageNote(usage) {
488
+ const parts = [];
489
+ const variants = capped([...usage.variants].sort(), MAX_VARIANTS_PER_COMPONENT);
490
+ if (variants.items.length) {
491
+ const shown = variants.items.join(' | ');
492
+ parts.push(`variants: ${shown}${variants.dropped ? ` (+${variants.dropped} more)` : ''}`);
493
+ }
494
+ const props = [...usage.props].sort();
495
+ if (props.length)
496
+ parts.push(`props: ${props.join(', ')}`);
497
+ if (usage.description)
498
+ parts.push(usage.description);
499
+ return parts.length ? parts.join('; ') : undefined;
500
+ }
501
+ /**
502
+ * Collect the distinct design-system components instantiated across the frames, each with
503
+ * the variants and properties the design actually uses. That signal is what lets an agent
504
+ * match "reuse the existing component" against a repo component rather than a bare name.
505
+ *
506
+ * Ordered by instance count (ties by name, so the result is deterministic) because that order
507
+ * is what the component cap slices: the components the design leans on survive it. The
508
+ * renderer sorts alphabetically for display, so the order here is a RANKING, not a layout.
509
+ */
510
+ export function figmaComponents(roots, components = {}, componentSets = {}) {
511
+ const usages = new Map();
196
512
  for (const root of roots)
197
- collectComponents(root, components, names);
198
- return [...names].map((name) => ({ name }));
513
+ collectComponents(root, components, componentSets, usages);
514
+ return [...usages]
515
+ .sort(([aName, a], [bName, b]) => b.instances - a.instances || aName.localeCompare(bName))
516
+ .map(([name, usage]) => ({ name, note: usageNote(usage) }));
199
517
  }
200
518
  /** Render a single variable value (colour object → hex/rgba, else compact JSON). */
201
519
  function renderVariableValue(value) {
@@ -246,19 +564,119 @@ export function figmaTokens(meta) {
246
564
  }
247
565
  return tokens;
248
566
  }
567
+ // ---- Published styles → DesignToken[] --------------------------------------
568
+ /** How a published style's role maps to the token collection it belongs in. */
569
+ const STYLE_COLLECTIONS = {
570
+ fill: 'Colors',
571
+ fills: 'Colors',
572
+ stroke: 'Strokes',
573
+ strokes: 'Strokes',
574
+ text: 'Typography',
575
+ };
576
+ /** The value a styled node carries for the given role, or null when we can't name one. */
577
+ function styledValue(node, role) {
578
+ if (role === 'fill' || role === 'fills')
579
+ return firstSolidHex(node.fills);
580
+ if (role === 'stroke' || role === 'strokes')
581
+ return firstSolidHex(node.strokes);
582
+ if (role === 'text')
583
+ return typographyLabel(node.style);
584
+ return null;
585
+ }
586
+ function collectStyleTokens(node, styles, out) {
587
+ for (const [role, styleId] of Object.entries(node.styles ?? {})) {
588
+ const collection = STYLE_COLLECTIONS[role];
589
+ const name = styleId ? styles[styleId]?.name?.trim() : undefined;
590
+ if (!collection || !name)
591
+ continue;
592
+ const value = styledValue(node, role);
593
+ // A style with no resolvable value is a name and nothing else, which teaches an
594
+ // implementer nothing they can apply. Skip it rather than emit `name = ?`.
595
+ if (!value)
596
+ continue;
597
+ const key = `${collection}:${name}`;
598
+ if (!out.has(key))
599
+ out.set(key, { collection, name, value });
600
+ }
601
+ for (const child of node.children ?? [])
602
+ collectStyleTokens(child, styles, out);
603
+ }
604
+ /**
605
+ * Derive tokens from the file's PUBLISHED STYLES, the token source every Figma plan
606
+ * serves: the `styles` map names each published style and the nodes referencing one carry
607
+ * the concrete value, so the join produces `name = value` without the Enterprise-gated
608
+ * variables API. Deliberately NOT merged with {@link figmaTokens}: the two are different
609
+ * sources with different coverage, and a merged section could not say which one it came
610
+ * from.
611
+ */
612
+ export function figmaStyleTokens(roots, styles = {}) {
613
+ const tokens = new Map();
614
+ for (const root of roots)
615
+ collectStyleTokens(root, styles, tokens);
616
+ return [...tokens.values()];
617
+ }
618
+ /**
619
+ * State which token path produced the section. A 403 from the variables API is a PLAN
620
+ * GATE, not an error, and neither of those reads the same as a design that simply defines
621
+ * no tokens, so the three cases must not collapse into one silent omission.
622
+ */
623
+ export function figmaTokenOrigin(input) {
624
+ if (input.variableTokens > 0)
625
+ return { label: 'Figma variables' };
626
+ const missing = input.status === 'gated'
627
+ ? 'the Figma variables API is not available on this plan'
628
+ : input.status === 'failed'
629
+ ? 'the Figma variables read failed'
630
+ : null;
631
+ if (input.styleTokens > 0) {
632
+ return {
633
+ label: 'published styles',
634
+ note: missing ? `Variable-defined tokens are absent: ${missing}.` : undefined,
635
+ };
636
+ }
637
+ if (!missing)
638
+ return undefined;
639
+ return {
640
+ note: `No design tokens: ${missing}, and this design's published styles resolved to no value.`,
641
+ };
642
+ }
249
643
  /** Assemble the fetched Figma pieces into the shared {@link DesignContext}. */
250
644
  export function buildFigmaDesignContext(input) {
251
645
  const { fileKey } = splitFigmaExternalId(input.externalId);
252
646
  const title = input.nodeId
253
647
  ? `${input.fileName || fileKey} — ${input.roots[0]?.name?.trim() || input.nodeId}`
254
648
  : input.fileName || fileKey;
649
+ const { blocks, notes } = figmaBlocks(input.roots);
650
+ const variableTokens = figmaTokens(input.variablesMeta);
651
+ const styleTokens = figmaStyleTokens(input.roots, input.styles);
652
+ // Components and tokens are bounded too: both grow with the DESIGN SYSTEM rather than with
653
+ // the frames imported, so the layout/text budgets above say nothing about them, and a
654
+ // library file can carry hundreds of published styles.
655
+ const components = capped(figmaComponents(input.roots, input.components, input.componentSets), MAX_COMPONENTS);
656
+ const tokens = capped(sortDesignTokens(variableTokens.length ? variableTokens : styleTokens), MAX_TOKENS);
657
+ const capNotes = [];
658
+ if (components.dropped) {
659
+ capNotes.push(`${components.dropped} of ${components.dropped + components.items.length} components are ` +
660
+ `not listed: the ${MAX_COMPONENTS} instantiated most often were kept (the list itself is ` +
661
+ `alphabetical).`);
662
+ }
663
+ if (tokens.dropped) {
664
+ capNotes.push(`${tokens.dropped} of ${tokens.dropped + tokens.items.length} design tokens are not ` +
665
+ `listed; the list is capped at ${MAX_TOKENS} and is otherwise in full.`);
666
+ }
255
667
  return {
256
668
  title,
257
669
  url: figmaUrlFor(input.externalId),
258
- blocks: figmaBlocks(input.roots),
259
- components: figmaComponents(input.roots, input.components),
260
- tokens: figmaTokens(input.variablesMeta),
670
+ blocks,
671
+ components: components.items,
672
+ tokens: tokens.items,
673
+ tokenOrigin: figmaTokenOrigin({
674
+ status: input.variablesStatus ?? 'ok',
675
+ variableTokens: variableTokens.length,
676
+ styleTokens: styleTokens.length,
677
+ }),
261
678
  references: input.previewUrl ? [{ label: 'Rendered preview', url: input.previewUrl }] : [],
679
+ notes: [...(input.fetchNotes ?? []), ...notes, ...capNotes],
262
680
  };
263
681
  }
264
682
  //# sourceMappingURL=figma.logic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"figma.logic.js","sourceRoot":"","sources":["../../../src/modules/documents/figma.logic.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,GAKd,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CA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