foundry-design 0.2.0-beta.17 → 0.2.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@ Design Branches keeps parallel visual directions isolated inside one local sessi
10
10
 
11
11
  Foundry is distributed through npm, so testers do not need GitHub access.
12
12
 
13
- > **Current public beta:** `0.2.0-beta.17`. Both npm `latest` and `beta` resolve to this release.
13
+ > **Current public beta:** `0.2.0-beta.19`. Both npm `latest` and `beta` resolve to this release.
14
14
 
15
15
  Full documentation is available at [withfoundry.ai](https://withfoundry.ai).
16
16
 
@@ -141,7 +141,7 @@ If an npm mirror or existing `npx` cache reports an old tag, bypass it with a te
141
141
 
142
142
  ```bash
143
143
  FOUNDRY_NPX_CACHE="$(mktemp -d)"
144
- npx --yes --prefer-online --registry=https://registry.npmjs.org --cache "$FOUNDRY_NPX_CACHE" --package=foundry-design@0.2.0-beta.17 foundry-design
144
+ npx --yes --prefer-online --registry=https://registry.npmjs.org --cache "$FOUNDRY_NPX_CACHE" --package=foundry-design@0.2.0-beta.19 foundry-design
145
145
  ```
146
146
 
147
147
  The beta supports Node.js 20 or newer. Read the [local-first safety model](https://withfoundry.ai/#safety) before using it with sensitive work.
@@ -167,7 +167,7 @@ Foundry remains local-first. Installing the plugin does not create an account, e
167
167
  - A searchable, collapsible, virtualized live layer hierarchy with mapped-source context, Shadow DOM traversal, drag reordering, and selection persistence across HMR
168
168
  - Multi-selection, measured spacing annotations, sibling-aware resize snapping, keyboard nudging, alignment, distribution, and preview undo/redo
169
169
  - A revisioned local design graph for CSS tokens, components, Storybook variants, breakpoints, themes, states, and motion presets
170
- - A Design System workspace that traces native tokens from definition to indexed usages, previews source blast radius, detects near-duplicates and literal/component drift, and explains every recommendation without changing source automatically
170
+ - A Design System workspace that resolves semantic alias chains, surfaces broken and circular references, traces native tokens from definition to indexed usages, groups recurring literals into existing-token-first promotion plans, and sends exact source refactors through Review without changing source automatically
171
171
  - Semantic source-mapping choices that block ambiguous changes until the user selects the intended implementation
172
172
  - Fixed, hug, fill, and min/max sizing; flex and grid flow; linked spacing; aspect ratio; overflow; and positional controls
173
173
  - Project-native spacing, radius, typography, and color choices with token-only filtering, exact and nearest-token ranking, component variants, type presets, gradients, opacity, and live contrast guidance
@@ -176,7 +176,7 @@ Foundry remains local-first. Installing the plugin does not create an account, e
176
176
  - Design Health scans for contrast, overflow and clipping, touch targets, accessible names, reduced-motion coverage, and project spacing consistency, with evidence, intentional-issue ignores, and safe corrections routed into review
177
177
  - An in-app state workbench with real viewport frames, theme switching, forced interaction states, motion controls, and contextual verification
178
178
  - A dedicated Motion Studio for live CSS and Web Animation discovery, preview-only transport, timeline scrubbing, keyframe editing, complete timing controls, performance classification, and reduced-motion review
179
- - Isolated Design Branches with fixed-viewport comparison, selective composition, rejection notes, and explicit promotion into the source-ready review ledger
179
+ - Isolated Design Branches with fixed-viewport comparison, selective composition, rejection notes, explicit promotion into the source-ready review ledger, and portable chosen or rejected decision records with source-aware compatibility, import, export, restore, removal, and explicit Design Memory linkage
180
180
  - Persistent, coalescing change ledger with JSON and consolidated prompt export
181
181
  - Center-workspace review with editable approved batches, grouped targets, and unresolved-target blocking
182
182
  - Persistent Apply with agent runs across Codex, Cursor, and Claude Code through MCP
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAGA,OAAO,EAQL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAuG3D,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,oBAAoB,GAAG,SAAS,EACxC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CAqR7B"}
1
+ {"version":3,"file":"indexer.d.ts","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAGA,OAAO,EAUL,KAAK,kBAAkB,EAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAkZ3D,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,oBAAoB,GAAG,SAAS,EACxC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC,CAgf7B"}
package/dist/indexer.js CHANGED
@@ -14,7 +14,31 @@ const SOURCE_EXTENSIONS = new Set([
14
14
  '.mjs',
15
15
  '.cjs',
16
16
  '.json',
17
+ '.html',
17
18
  ]);
19
+ const STYLESHEET_EXTENSIONS = new Set(['.css', '.scss', '.sass', '.less']);
20
+ function stylesheetSegments(file, content) {
21
+ const extension = extname(file).toLowerCase();
22
+ if (STYLESHEET_EXTENSIONS.has(extension))
23
+ return [{ content, offset: 0 }];
24
+ const segments = [];
25
+ const appendMatches = (pattern) => {
26
+ for (const match of content.matchAll(pattern)) {
27
+ const body = match[1];
28
+ if (!body || match.index == null)
29
+ continue;
30
+ const bodyOffset = match[0].indexOf(body);
31
+ segments.push({ content: body, offset: match.index + Math.max(0, bodyOffset) });
32
+ }
33
+ };
34
+ if (extension === '.html') {
35
+ appendMatches(/<style\b[^>]*>([\s\S]*?)<\/style>/gi);
36
+ }
37
+ else if (/\.[cm]?[jt]sx?$/.test(file)) {
38
+ appendMatches(/\b(?:css|createGlobalStyle|styled(?:\.[A-Za-z_$][\w$]*|\([^)]*\)))\s*`([\s\S]*?)`/g);
39
+ }
40
+ return segments;
41
+ }
18
42
  function stableId(prefix, value) {
19
43
  return `${prefix}_${createHash('sha1').update(value).digest('hex').slice(0, 12)}`;
20
44
  }
@@ -79,6 +103,250 @@ function closeNumericToken(value, tokens) {
79
103
  .filter((entry) => entry.distance > 0 && entry.distance <= Math.max(2, Math.abs(parsed.amount) * 0.25))
80
104
  .sort((a, b) => a.distance - b.distance)[0]?.token;
81
105
  }
106
+ function tokenComparableValue(token) {
107
+ return token.resolvedValue ?? token.value;
108
+ }
109
+ function aliasTarget(value) {
110
+ return /^var\(\s*(--[\w-]+)(?:\s*,[^)]*)?\s*\)$/.exec(value.trim())?.[1];
111
+ }
112
+ function resolveTokenAliases(tokens) {
113
+ const resolve = (token, trail = []) => {
114
+ const targetName = aliasTarget(token.value);
115
+ if (!targetName)
116
+ return { aliasChain: [token.name], aliasStatus: 'direct', resolvedValue: token.value };
117
+ if (trail.includes(token.name)) {
118
+ return { aliasChain: [...trail, token.name], aliasStatus: 'circular' };
119
+ }
120
+ const target = tokens.get(targetName);
121
+ if (!target)
122
+ return { aliasChain: [token.name, targetName], aliasStatus: 'broken' };
123
+ const resolved = resolve(target, [...trail, token.name]);
124
+ return {
125
+ aliasChain: [token.name, ...resolved.aliasChain.filter((name) => name !== token.name)],
126
+ aliasStatus: resolved.aliasStatus === 'direct' ? 'resolved' : resolved.aliasStatus,
127
+ resolvedValue: resolved.resolvedValue,
128
+ };
129
+ };
130
+ for (const token of tokens.values()) {
131
+ const targetName = aliasTarget(token.value);
132
+ if (targetName) {
133
+ token.aliasOfTokenName = targetName;
134
+ const target = tokens.get(targetName);
135
+ token.aliasOfTokenId = target?.id;
136
+ if (token.category === 'other' && target)
137
+ token.category = target.category;
138
+ }
139
+ Object.assign(token, resolve(token));
140
+ }
141
+ }
142
+ function promotionTokenName(category, property, value) {
143
+ const propertySlug = property
144
+ .toLowerCase()
145
+ .replace(/[^a-z0-9]+/g, '-')
146
+ .replace(/^-|-$/g, '');
147
+ const valueSlug = value
148
+ .toLowerCase()
149
+ .replace(/[^a-z0-9.]+/g, '-')
150
+ .replaceAll('.', '-')
151
+ .replace(/^-|-$/g, '')
152
+ .slice(0, 24);
153
+ return `--${category}-${propertySlug || 'value'}${valueSlug ? `-${valueSlug}` : ''}`;
154
+ }
155
+ function objectNumber(source, property) {
156
+ const match = new RegExp(`\\b${property}\\s*:\\s*(-?[\\d.]+)`).exec(source);
157
+ const value = Number(match?.[1]);
158
+ return Number.isFinite(value) ? value : undefined;
159
+ }
160
+ function objectString(source, property) {
161
+ const quoted = new RegExp(`\\b${property}\\s*:\\s*['\"]([^'\"]+)['\"]`).exec(source);
162
+ if (quoted?.[1])
163
+ return quoted[1];
164
+ const array = new RegExp(`\\b${property}\\s*:\\s*\\[([^\\]]+)\\]`).exec(source);
165
+ if (!array?.[1])
166
+ return undefined;
167
+ const values = array[1]
168
+ .split(',')
169
+ .map((value) => Number(value.trim()))
170
+ .filter(Number.isFinite);
171
+ return values.length === 4 ? `cubic-bezier(${values.join(', ')})` : undefined;
172
+ }
173
+ function nativeMotionPresets(file, content) {
174
+ const presets = [];
175
+ const push = (adapter, label, sourceProperty, index, body) => {
176
+ const seconds = adapter !== 'react-spring';
177
+ const duration = objectNumber(body, 'duration');
178
+ const delay = objectNumber(body, 'delay');
179
+ const easing = objectString(body, adapter === 'gsap' ? 'ease' : 'ease') ?? objectString(body, 'easing');
180
+ const configuration = Object.fromEntries([
181
+ 'type',
182
+ 'mass',
183
+ 'stiffness',
184
+ 'damping',
185
+ 'tension',
186
+ 'friction',
187
+ 'velocity',
188
+ 'repeat',
189
+ 'repeatType',
190
+ 'yoyo',
191
+ ]
192
+ .map((property) => [property, objectNumber(body, property) ?? objectString(body, property)])
193
+ .filter((entry) => entry[1] != null));
194
+ presets.push({
195
+ id: stableId('mot', `${file}:${index}:${adapter}`),
196
+ label,
197
+ duration: duration == null ? undefined : seconds ? duration * 1000 : duration,
198
+ delay: delay == null ? undefined : seconds ? delay * 1000 : delay,
199
+ easing,
200
+ adapter,
201
+ sourceProperty,
202
+ configuration,
203
+ source: { file, line: lineAt(content, index) },
204
+ evidence: [`${adapter} source import`, `${sourceProperty} authoring site`],
205
+ });
206
+ };
207
+ if (/from\s+['\"](?:motion\/react|framer-motion)['\"]/.test(content)) {
208
+ for (const match of content.matchAll(/<motion\.([A-Za-z][\w]*)\b([\s\S]*?)>/g)) {
209
+ const body = match[2] ?? '';
210
+ if (!/\b(?:animate|transition|variants)\s*=/.test(body))
211
+ continue;
212
+ push('motion', `Motion ${match[1]}`, 'transition', match.index ?? 0, body);
213
+ }
214
+ }
215
+ if (/from\s+['\"]gsap['\"]|require\(['\"]gsap['\"]\)/.test(content)) {
216
+ for (const match of content.matchAll(/gsap\.(to|from|fromTo|set)\s*\(([\s\S]{0,1200}?)\)\s*[;,]/g)) {
217
+ push('gsap', `GSAP ${match[1]} tween`, 'vars', match.index ?? 0, match[2] ?? '');
218
+ }
219
+ }
220
+ if (/from\s+['\"](?:@react-spring\/web|react-spring)['\"]/.test(content)) {
221
+ for (const match of content.matchAll(/\b(useSpring|useTransition|useTrail)\s*\(([\s\S]{0,1200}?)\)\s*[;,]/g)) {
222
+ push('react-spring', `React Spring ${match[1]}`, match[1] === 'useSpring' ? 'config' : (match[1] ?? 'config'), match.index ?? 0, match[2] ?? '');
223
+ }
224
+ }
225
+ return presets;
226
+ }
227
+ function balancedObject(content, openIndex) {
228
+ if (content[openIndex] !== '{')
229
+ return null;
230
+ let depth = 0;
231
+ let quote = '';
232
+ let escaped = false;
233
+ for (let index = openIndex; index < content.length; index += 1) {
234
+ const char = content[index];
235
+ if (quote) {
236
+ if (escaped)
237
+ escaped = false;
238
+ else if (char === '\\')
239
+ escaped = true;
240
+ else if (char === quote)
241
+ quote = '';
242
+ continue;
243
+ }
244
+ if (char === '"' || char === "'" || char === '`') {
245
+ quote = char;
246
+ continue;
247
+ }
248
+ if (char === '{')
249
+ depth += 1;
250
+ if (char === '}')
251
+ depth -= 1;
252
+ if (depth === 0)
253
+ return { body: content.slice(openIndex + 1, index), start: openIndex, end: index };
254
+ }
255
+ return null;
256
+ }
257
+ function objectProperty(content, property, offset = 0) {
258
+ const match = new RegExp(`(?:^|[,\\s])${property}\\s*:\\s*\\{`, 'm').exec(content.slice(offset));
259
+ if (!match)
260
+ return null;
261
+ const openIndex = offset + match.index + match[0].lastIndexOf('{');
262
+ return balancedObject(content, openIndex);
263
+ }
264
+ function topLevelObjectKeys(content) {
265
+ const keys = [];
266
+ let depth = 0;
267
+ let quote = '';
268
+ let escaped = false;
269
+ for (let index = 0; index < content.length; index += 1) {
270
+ const char = content[index];
271
+ if (quote) {
272
+ if (escaped)
273
+ escaped = false;
274
+ else if (char === '\\')
275
+ escaped = true;
276
+ else if (char === quote)
277
+ quote = '';
278
+ continue;
279
+ }
280
+ if (char === '"' || char === "'" || char === '`') {
281
+ quote = char;
282
+ continue;
283
+ }
284
+ if (char === '{' || char === '[' || char === '(')
285
+ depth += 1;
286
+ if (char === '}' || char === ']' || char === ')')
287
+ depth -= 1;
288
+ if (depth !== 0)
289
+ continue;
290
+ const match = /^\s*(?:['"]([^'"]+)['"]|([A-Za-z_$][\w$-]*))\s*:/.exec(content.slice(index));
291
+ const key = match?.[1] ?? match?.[2];
292
+ if (!key || keys.some((item) => item.key === key))
293
+ continue;
294
+ keys.push({ key, index });
295
+ index += (match?.[0].length ?? 1) - 1;
296
+ }
297
+ return keys;
298
+ }
299
+ function sourceVariantAxes(file, content) {
300
+ const axes = [];
301
+ for (const cva of content.matchAll(/\bcva\s*\(/g)) {
302
+ const configOpen = content.indexOf('{', cva.index ?? 0);
303
+ const config = configOpen >= 0 ? balancedObject(content, configOpen) : null;
304
+ if (!config)
305
+ continue;
306
+ const variants = objectProperty(config.body, 'variants');
307
+ if (!variants)
308
+ continue;
309
+ for (const axisKey of topLevelObjectKeys(variants.body)) {
310
+ const axisOpen = variants.body.indexOf('{', axisKey.index);
311
+ const axis = axisOpen >= 0 ? balancedObject(variants.body, axisOpen) : null;
312
+ if (!axis)
313
+ continue;
314
+ const values = topLevelObjectKeys(axis.body).map((item) => item.key);
315
+ if (!values.length)
316
+ continue;
317
+ const absolute = config.start + 1 + variants.start + 1 + axisOpen;
318
+ axes.push({
319
+ id: stableId('axis', `${file}:cva:${axisKey.key}`),
320
+ label: axisKey.key,
321
+ property: axisKey.key,
322
+ values,
323
+ adapter: 'cva',
324
+ source: { file, line: lineAt(content, absolute) },
325
+ sourceProperty: `variants.${axisKey.key}`,
326
+ canCreate: true,
327
+ evidence: ['CVA variants object', `Writable ${axisKey.key} option map`],
328
+ });
329
+ }
330
+ }
331
+ for (const match of content.matchAll(/\b([A-Za-z_$][\w$]*)\??\s*:\s*((?:['"][^'"]+['"]\s*\|\s*)+['"][^'"]+['"])/g)) {
332
+ const property = match[1];
333
+ const values = [...match[2].matchAll(/['"]([^'"]+)['"]/g)].map((item) => item[1]);
334
+ if (values.length < 2 || axes.some((axis) => axis.property === property))
335
+ continue;
336
+ axes.push({
337
+ id: stableId('axis', `${file}:typescript:${property}`),
338
+ label: property,
339
+ property,
340
+ values,
341
+ adapter: 'typescript',
342
+ source: { file, line: lineAt(content, match.index ?? 0) },
343
+ sourceProperty: property,
344
+ canCreate: true,
345
+ evidence: ['TypeScript string union', `Writable ${property} prop type`],
346
+ });
347
+ }
348
+ return axes;
349
+ }
82
350
  async function sourceFiles(root, exclusions) {
83
351
  const files = [];
84
352
  const excluded = new Set([
@@ -114,43 +382,95 @@ export async function indexProjectDesign(root, config, revision) {
114
382
  const tokens = new Map();
115
383
  const components = new Map();
116
384
  const breakpoints = new Map();
385
+ const containerQueries = new Map();
117
386
  const themes = new Set();
118
387
  const motion = new Map();
119
388
  const storyVariants = new Map();
389
+ const axesByFile = new Map();
120
390
  const documents = [];
121
391
  for (const path of files) {
122
392
  const content = await readFile(path, 'utf8').catch(() => '');
123
393
  const file = relative(root, path).replaceAll('\\', '/');
124
- documents.push({ file, content });
125
- for (const match of content.matchAll(/(--[\w-]+)\s*:\s*([^;}\n]+)/g)) {
126
- const name = match[1];
127
- const value = match[2].trim();
128
- tokens.set(name, {
129
- id: stableId('tok', name),
130
- name,
131
- value,
132
- category: tokenCategory(name, value),
133
- cssVariable: name,
134
- source: { file, line: lineAt(content, match.index ?? 0) },
135
- confidence: 'instrumented',
136
- evidence: ['CSS custom property'],
137
- });
138
- if (/duration|motion/.test(name)) {
139
- const duration = /([\d.]+)m?s/.exec(value);
140
- motion.set(name, {
141
- id: stableId('mot', name),
142
- label: name.replace(/^--/, ''),
143
- duration: duration ? Number(duration[1]) * (value.includes('ms') ? 1 : 1000) : undefined,
144
- source: { file, line: lineAt(content, match.index ?? 0) },
394
+ const stylesheets = stylesheetSegments(file, content);
395
+ documents.push({ file, content, stylesheets });
396
+ for (const preset of nativeMotionPresets(file, content))
397
+ motion.set(preset.id, preset);
398
+ for (const stylesheet of stylesheets) {
399
+ for (const match of stylesheet.content.matchAll(/(--[\w-]+)\s*:\s*([^;}\n]+)/g)) {
400
+ const name = match[1];
401
+ const value = match[2].trim();
402
+ if (!value || value.includes('${') || value.includes('\\s*'))
403
+ continue;
404
+ const index = stylesheet.offset + (match.index ?? 0);
405
+ tokens.set(name, {
406
+ id: stableId('tok', name),
407
+ name,
408
+ value,
409
+ category: tokenCategory(name, value),
410
+ cssVariable: name,
411
+ source: { file, line: lineAt(content, index) },
412
+ confidence: 'instrumented',
413
+ evidence: ['CSS custom property'],
414
+ });
415
+ if (/duration|motion/.test(name)) {
416
+ const duration = /([\d.]+)m?s/.exec(value);
417
+ motion.set(name, {
418
+ id: stableId('mot', name),
419
+ label: name.replace(/^--/, ''),
420
+ duration: duration
421
+ ? Number(duration[1]) * (value.includes('ms') ? 1 : 1000)
422
+ : undefined,
423
+ adapter: 'css',
424
+ configuration: {},
425
+ source: { file, line: lineAt(content, index) },
426
+ evidence: ['CSS custom property'],
427
+ });
428
+ }
429
+ }
430
+ for (const match of stylesheet.content.matchAll(/@media\s*\([^)]*(?:min|max)-width\s*:\s*(\d+)px[^)]*\)/g)) {
431
+ const index = stylesheet.offset + (match.index ?? 0);
432
+ const width = Number(match[1]);
433
+ breakpoints.set(width, {
434
+ width,
435
+ source: { file, line: lineAt(content, index) },
436
+ });
437
+ }
438
+ for (const match of stylesheet.content.matchAll(/@container(?:\s+([\w-]+))?\s*\(([^)]*)\)/g)) {
439
+ const name = match[1];
440
+ const condition = match[2].trim();
441
+ const min = /min-(?:width|inline-size)\s*:\s*([\d.]+)px/i.exec(condition)?.[1] ??
442
+ /(?:width|inline-size)\s*>=?\s*([\d.]+)px/i.exec(condition)?.[1];
443
+ const max = /max-(?:width|inline-size)\s*:\s*([\d.]+)px/i.exec(condition)?.[1] ??
444
+ /(?:width|inline-size)\s*<=?\s*([\d.]+)px/i.exec(condition)?.[1];
445
+ if (!min && !max)
446
+ continue;
447
+ const axis = /block-size|height/i.test(condition)
448
+ ? 'block-size'
449
+ : /\bsize\b/i.test(condition) && !/inline-size/i.test(condition)
450
+ ? 'size'
451
+ : 'inline-size';
452
+ const id = stableId('container', `${file}:${name ?? 'anonymous'}:${condition}`);
453
+ const index = stylesheet.offset + (match.index ?? 0);
454
+ containerQueries.set(id, {
455
+ id,
456
+ label: `${name ?? 'Anonymous container'} · ${condition}`,
457
+ ...(name ? { name } : {}),
458
+ condition,
459
+ axis,
460
+ ...(min ? { minWidth: Number(min) } : {}),
461
+ ...(max ? { maxWidth: Number(max) } : {}),
462
+ source: { file, line: lineAt(content, index) },
463
+ evidence: [
464
+ 'CSS @container rule',
465
+ ...(stylesheet.content.includes('container-type')
466
+ ? ['CSS container-type declaration']
467
+ : []),
468
+ ...(name && stylesheet.content.includes('container-name')
469
+ ? ['CSS container-name declaration']
470
+ : []),
471
+ ],
145
472
  });
146
473
  }
147
- }
148
- for (const match of content.matchAll(/@media\s*\([^)]*(?:min|max)-width\s*:\s*(\d+)px[^)]*\)/g)) {
149
- const width = Number(match[1]);
150
- breakpoints.set(width, {
151
- width,
152
- source: { file, line: lineAt(content, match.index ?? 0) },
153
- });
154
474
  }
155
475
  for (const match of content.matchAll(/(?:data-theme=["']|\[data-theme=["'])([\w-]+)/g)) {
156
476
  themes.add(match[1]);
@@ -158,6 +478,7 @@ export async function indexProjectDesign(root, config, revision) {
158
478
  if (/(?:^|\s)\.dark(?:\s|[{,:])/.test(content))
159
479
  themes.add('dark');
160
480
  if (/\.(?:tsx?|jsx?|mjs|cjs)$/.test(path)) {
481
+ axesByFile.set(file, sourceVariantAxes(file, content));
161
482
  if (/\.stories\.[cm]?[jt]sx?$/.test(path)) {
162
483
  const componentName = basename(path).replace(/\.stories\.[cm]?[jt]sx?$/, '');
163
484
  const variants = [...content.matchAll(/export\s+const\s+([A-Z][A-Za-z0-9_]*)/g)].map((story) => ({
@@ -167,6 +488,8 @@ export async function indexProjectDesign(root, config, revision) {
167
488
  value: story[1],
168
489
  props: { story: story[1] },
169
490
  source: { file, line: lineAt(content, story.index ?? 0) },
491
+ adapter: 'storybook',
492
+ sourceProperty: story[1],
170
493
  }));
171
494
  storyVariants.set(componentName, variants);
172
495
  continue;
@@ -180,6 +503,7 @@ export async function indexProjectDesign(root, config, revision) {
180
503
  source: { file, line: lineAt(content, match.index ?? 0) },
181
504
  instances: 0,
182
505
  variants: [],
506
+ variantAxes: [],
183
507
  evidence: ['exported component'],
184
508
  };
185
509
  components.set(id, component);
@@ -190,6 +514,17 @@ export async function indexProjectDesign(root, config, revision) {
190
514
  const component = [...components.values()].find((item) => item.name === componentName);
191
515
  if (component) {
192
516
  component.variants = variants;
517
+ component.variantAxes.push({
518
+ id: stableId('axis', `${variants[0]?.source?.file}:storybook:story`),
519
+ label: 'Story',
520
+ property: 'story',
521
+ values: variants.map((variant) => variant.value),
522
+ adapter: 'storybook',
523
+ source: variants[0].source,
524
+ sourceProperty: 'named export',
525
+ canCreate: true,
526
+ evidence: ['Storybook named exports', 'Writable story definition'],
527
+ });
193
528
  component.evidence.push('Storybook story');
194
529
  }
195
530
  else if (variants[0]?.source) {
@@ -200,88 +535,201 @@ export async function indexProjectDesign(root, config, revision) {
200
535
  source: variants[0].source,
201
536
  instances: 0,
202
537
  variants,
538
+ variantAxes: [
539
+ {
540
+ id: stableId('axis', `${variants[0].source.file}:storybook:story`),
541
+ label: 'Story',
542
+ property: 'story',
543
+ values: variants.map((variant) => variant.value),
544
+ adapter: 'storybook',
545
+ source: variants[0].source,
546
+ sourceProperty: 'named export',
547
+ canCreate: true,
548
+ evidence: ['Storybook named exports', 'Writable story definition'],
549
+ },
550
+ ],
203
551
  evidence: ['Storybook story'],
204
552
  });
205
553
  }
206
554
  }
555
+ for (const component of components.values()) {
556
+ const nativeAxes = axesByFile.get(component.source?.file ?? '') ?? [];
557
+ const known = new Set(component.variantAxes.map((axis) => axis.property));
558
+ component.variantAxes.push(...nativeAxes.filter((axis) => !known.has(axis.property)));
559
+ for (const axis of nativeAxes) {
560
+ for (const value of axis.values) {
561
+ const id = stableId('var', `${component.id}:${axis.property}:${String(value)}`);
562
+ if (component.variants.some((variant) => variant.id === id))
563
+ continue;
564
+ component.variants.push({
565
+ id,
566
+ label: String(value),
567
+ property: axis.property,
568
+ value,
569
+ props: { [axis.property]: value },
570
+ source: axis.source,
571
+ adapter: axis.adapter,
572
+ sourceProperty: `${axis.sourceProperty}.${String(value)}`,
573
+ });
574
+ }
575
+ }
576
+ if (nativeAxes.length)
577
+ component.evidence.push('Source-backed variant axis');
578
+ }
579
+ resolveTokenAliases(tokens);
207
580
  const tokenList = [...tokens.values()];
208
581
  const tokenUsages = [];
209
582
  const findings = [];
583
+ const recurringLiterals = new Map();
210
584
  const componentForSource = (file, line) => [...components.values()]
211
585
  .filter((component) => component.source?.file === file && (component.source.line ?? 0) <= line)
212
586
  .sort((a, b) => (b.source?.line ?? 0) - (a.source?.line ?? 0))[0];
213
- for (const { file, content } of documents) {
214
- for (const match of content.matchAll(/var\(\s*(--[\w-]+)(?:\s*,[^)]*)?\)/g)) {
215
- const token = tokens.get(match[1]);
216
- if (!token)
217
- continue;
218
- const line = lineAt(content, match.index ?? 0);
219
- const lineStart = content.lastIndexOf('\n', match.index ?? 0) + 1;
220
- const declarationPrefix = content.slice(lineStart, match.index ?? 0);
221
- const alias = /--[\w-]+\s*:\s*$/.test(declarationPrefix);
222
- const component = componentForSource(file, line);
223
- tokenUsages.push({
224
- id: stableId('use', `${file}:${match.index}:${token.id}`),
225
- tokenId: token.id,
226
- tokenName: token.name,
227
- value: token.value,
228
- category: token.category,
229
- kind: alias ? 'alias' : 'reference',
230
- componentId: component?.id,
231
- source: { file, line },
232
- evidence: [alias ? 'Token aliases this project value' : 'CSS variable reference'],
233
- });
234
- }
235
- for (const match of content.matchAll(/([a-zA-Z][\w-]*)\s*:\s*([^;\n},]+)[;},]/g)) {
236
- const property = match[1];
237
- const value = match[2].trim();
238
- if (property.startsWith('--') || value.includes('var('))
239
- continue;
240
- const category = declarationCategory(property, value);
241
- if (!category)
242
- continue;
243
- const categoryTokens = tokenList.filter((token) => token.category === category);
244
- const exact = categoryTokens.find((token) => comparable(token.value) === comparable(value));
245
- const suggested = exact ?? closeNumericToken(value, categoryTokens);
246
- if (!suggested)
247
- continue;
248
- const line = lineAt(content, match.index ?? 0);
249
- const component = componentForSource(file, line);
250
- const usage = {
251
- id: stableId('use', `${file}:${match.index}:${suggested.id}:literal`),
252
- tokenId: suggested.id,
253
- tokenName: suggested.name,
254
- value,
255
- category,
256
- kind: 'literal',
257
- property,
258
- componentId: component?.id,
259
- source: { file, line },
260
- evidence: [
261
- exact
262
- ? 'Literal equals an existing project token'
263
- : 'Literal is close to a project token',
264
- ],
265
- };
266
- tokenUsages.push(usage);
267
- findings.push({
268
- id: stableId('finding', usage.id),
269
- kind: component ? 'component-drift' : 'literal-drift',
270
- severity: exact ? 'info' : 'warning',
271
- title: exact ? `Use ${suggested.name}` : `${value} is close to ${suggested.name}`,
272
- detail: exact
273
- ? `${property} repeats ${suggested.value} as a literal instead of its project token.`
274
- : `${property} uses ${value}; the nearest ${category} token is ${suggested.name} at ${suggested.value}.`,
275
- category,
276
- tokenIds: [suggested.id],
277
- usageIds: [usage.id],
278
- componentIds: component ? [component.id] : [],
279
- suggestedTokenId: suggested.id,
280
- source: usage.source,
281
- evidence: usage.evidence,
282
- });
587
+ for (const { file, content, stylesheets } of documents) {
588
+ for (const stylesheet of stylesheets) {
589
+ for (const match of stylesheet.content.matchAll(/var\(\s*(--[\w-]+)(?:\s*,[^)]*)?\)/g)) {
590
+ const token = tokens.get(match[1]);
591
+ if (!token)
592
+ continue;
593
+ const index = stylesheet.offset + (match.index ?? 0);
594
+ const line = lineAt(content, index);
595
+ const lineStart = content.lastIndexOf('\n', index) + 1;
596
+ const declarationPrefix = content.slice(lineStart, index);
597
+ const alias = /--[\w-]+\s*:\s*$/.test(declarationPrefix);
598
+ const component = componentForSource(file, line);
599
+ tokenUsages.push({
600
+ id: stableId('use', `${file}:${index}:${token.id}`),
601
+ tokenId: token.id,
602
+ tokenName: token.name,
603
+ value: token.value,
604
+ category: token.category,
605
+ kind: alias ? 'alias' : 'reference',
606
+ componentId: component?.id,
607
+ source: { file, line },
608
+ evidence: [alias ? 'Token aliases this project value' : 'CSS variable reference'],
609
+ });
610
+ }
611
+ for (const match of stylesheet.content.matchAll(/([a-zA-Z][\w-]*)\s*:\s*([^;\n},]+)[;},]/g)) {
612
+ const property = match[1];
613
+ const value = match[2].trim();
614
+ if (property.startsWith('--') || value.includes('var('))
615
+ continue;
616
+ const category = declarationCategory(property, value);
617
+ if (!category)
618
+ continue;
619
+ const categoryTokens = tokenList.filter((token) => token.category === category);
620
+ const exact = categoryTokens
621
+ .filter((token) => comparable(tokenComparableValue(token)) === comparable(value))
622
+ .sort((a, b) => (b.aliasChain?.length ?? 0) - (a.aliasChain?.length ?? 0) ||
623
+ a.name.localeCompare(b.name))[0];
624
+ const suggested = exact ??
625
+ closeNumericToken(value, categoryTokens.map((token) => ({ ...token, value: tokenComparableValue(token) })));
626
+ const index = stylesheet.offset + (match.index ?? 0);
627
+ const line = lineAt(content, index);
628
+ const component = componentForSource(file, line);
629
+ const recurringKey = `${category}:${comparable(value)}`;
630
+ const recurring = recurringLiterals.get(recurringKey) ?? {
631
+ value,
632
+ category,
633
+ properties: [],
634
+ sources: [],
635
+ componentIds: [],
636
+ };
637
+ recurring.properties.push(property);
638
+ recurring.sources.push({ file, line });
639
+ if (component?.id)
640
+ recurring.componentIds.push(component.id);
641
+ recurringLiterals.set(recurringKey, recurring);
642
+ if (!suggested)
643
+ continue;
644
+ const usage = {
645
+ id: stableId('use', `${file}:${index}:${suggested.id}:literal`),
646
+ tokenId: suggested.id,
647
+ tokenName: suggested.name,
648
+ value,
649
+ category,
650
+ kind: 'literal',
651
+ property,
652
+ componentId: component?.id,
653
+ source: { file, line },
654
+ evidence: [
655
+ exact
656
+ ? 'Literal equals an existing project token'
657
+ : 'Literal is close to a project token',
658
+ ],
659
+ };
660
+ tokenUsages.push(usage);
661
+ findings.push({
662
+ id: stableId('finding', usage.id),
663
+ kind: component ? 'component-drift' : 'literal-drift',
664
+ severity: exact ? 'info' : 'warning',
665
+ title: exact ? `Use ${suggested.name}` : `${value} is close to ${suggested.name}`,
666
+ detail: exact
667
+ ? `${property} repeats ${suggested.value} as a literal instead of its project token.`
668
+ : `${property} uses ${value}; the nearest ${category} token is ${suggested.name} at ${suggested.value}.`,
669
+ category,
670
+ tokenIds: [suggested.id],
671
+ usageIds: [usage.id],
672
+ componentIds: component ? [component.id] : [],
673
+ suggestedTokenId: suggested.id,
674
+ source: usage.source,
675
+ evidence: usage.evidence,
676
+ });
677
+ }
283
678
  }
284
679
  }
680
+ const tokenPromotions = [...recurringLiterals.entries()]
681
+ .filter(([, recurring]) => recurring.sources.length >= 2)
682
+ .map(([key, recurring]) => {
683
+ const categoryTokens = tokenList.filter((token) => token.category === recurring.category);
684
+ const exact = categoryTokens
685
+ .filter((token) => comparable(tokenComparableValue(token)) === comparable(recurring.value))
686
+ .sort((a, b) => (b.aliasChain?.length ?? 0) - (a.aliasChain?.length ?? 0) ||
687
+ a.name.localeCompare(b.name))[0];
688
+ const near = exact
689
+ ? undefined
690
+ : closeNumericToken(recurring.value, categoryTokens.map((token) => ({ ...token, value: tokenComparableValue(token) })));
691
+ const suggested = exact ?? near;
692
+ const property = [...recurring.properties].sort((a, b) => recurring.properties.filter((item) => item === b).length -
693
+ recurring.properties.filter((item) => item === a).length || a.localeCompare(b))[0];
694
+ const sources = recurring.sources.filter((source, index, all) => all.findIndex((candidate) => candidate.file === source.file && candidate.line === source.line) === index);
695
+ const relation = exact ? 'exact' : near ? 'near' : 'new';
696
+ const proposedTokenName = promotionTokenName(recurring.category, property, recurring.value);
697
+ const suggestedTokenName = suggested?.name ??
698
+ (tokens.has(proposedTokenName)
699
+ ? `${proposedTokenName}-${stableId('token-name', key).slice(-4)}`
700
+ : proposedTokenName);
701
+ return {
702
+ id: stableId('promotion', key),
703
+ value: recurring.value,
704
+ category: recurring.category,
705
+ property,
706
+ occurrenceCount: sources.length,
707
+ sources,
708
+ componentIds: [...new Set(recurring.componentIds)],
709
+ recommendation: suggested ? 'use-existing' : 'create-token',
710
+ relation,
711
+ suggestedTokenId: suggested?.id,
712
+ suggestedTokenName,
713
+ suggestedValue: suggested ? `var(${suggested.name})` : recurring.value,
714
+ aliasChain: suggested?.aliasChain ?? [],
715
+ canStage: sources.length > 0,
716
+ blockers: [],
717
+ evidence: [
718
+ `${sources.length} authored literal occurrences`,
719
+ ...(suggested
720
+ ? [
721
+ relation === 'exact'
722
+ ? 'Resolved value matches an existing project token'
723
+ : 'Nearest compatible project token requires explicit review',
724
+ ]
725
+ : ['No compatible project token exists; create one before replacing usages']),
726
+ ...(suggested?.aliasStatus === 'resolved'
727
+ ? [`Preserves alias chain ${(suggested.aliasChain ?? []).join(' → ')}`]
728
+ : []),
729
+ ],
730
+ };
731
+ })
732
+ .sort((a, b) => b.occurrenceCount - a.occurrenceCount || a.value.localeCompare(b.value));
285
733
  for (let index = 0; index < tokenList.length; index += 1) {
286
734
  const token = tokenList[index];
287
735
  const near = tokenList.slice(index + 1).find((candidate) => {
@@ -361,11 +809,13 @@ export async function indexProjectDesign(root, config, revision) {
361
809
  tokens: [...tokens.values()],
362
810
  components: [...components.values()],
363
811
  breakpoints: graphBreakpoints,
812
+ containerQueries: [...containerQueries.values()].sort((a, b) => (a.minWidth ?? a.maxWidth ?? 0) - (b.minWidth ?? b.maxWidth ?? 0)),
364
813
  themes: graphThemes,
365
814
  states: config?.design?.states ?? [],
366
815
  motionPresets: [...motion.values()],
367
816
  tokenUsages,
368
817
  designSystemFindings: findings,
818
+ tokenPromotions,
369
819
  indexedAt: new Date().toISOString(),
370
820
  });
371
821
  }
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.js","sourceRoot":"","sources":["../src/indexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,wBAAwB,GAOzB,MAAM,yBAAyB,CAAC;AAGjC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,MAAM;IACN,OAAO;IACP,OAAO;IACP,OAAO;IACP,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;CACR,CAAC,CAAC;AAEH,SAAS,QAAQ,CAAC,MAAc,EAAE,KAAa;IAC7C,OAAO,GAAG,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC;AACpF,CAAC;AAED,SAAS,MAAM,CAAC,OAAe,EAAE,KAAa;IAC5C,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;AACpD,CAAC;AAED,SAAS,aAAa,CAAC,IAAY,EAAE,KAAa;IAChD,MAAM,IAAI,GAAG,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,kEAAkE,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,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5 @@
1
- export declare const FOUNDRY_VERSION = "0.2.0-beta.17";
2
- export declare const FOUNDRY_PACKAGE_SPEC = "foundry-design@0.2.0-beta.17";
3
- export declare const FOUNDRY_MCP_PACKAGE_SPEC = "foundry-design-mcp-server@0.2.0-beta.17";
1
+ export declare const FOUNDRY_VERSION = "0.2.0-beta.19";
2
+ export declare const FOUNDRY_PACKAGE_SPEC = "foundry-design@0.2.0-beta.19";
3
+ export declare const FOUNDRY_MCP_PACKAGE_SPEC = "foundry-design-mcp-server@0.2.0-beta.19";
4
4
  export declare function releasePreflight(action: string): string;
5
5
  //# sourceMappingURL=release.d.ts.map
package/dist/release.js CHANGED
@@ -1,4 +1,4 @@
1
- export const FOUNDRY_VERSION = '0.2.0-beta.17';
1
+ export const FOUNDRY_VERSION = '0.2.0-beta.19';
2
2
  export const FOUNDRY_PACKAGE_SPEC = `foundry-design@${FOUNDRY_VERSION}`;
3
3
  export const FOUNDRY_MCP_PACKAGE_SPEC = `foundry-design-mcp-server@${FOUNDRY_VERSION}`;
4
4
  export function releasePreflight(action) {
@@ -14,10 +14,10 @@ Resolve `<skill-root>` to the directory containing this `SKILL.md` before runnin
14
14
  1. Inspect the project, current worktree, framework, development command, and existing Foundry configuration.
15
15
  2. Run `<skill-root>/scripts/foundry.sh doctor --project <root>`.
16
16
  3. If setup is absent, stale, or Doctor reports a missing or conflicting connection, read [platform-setup.md](references/platform-setup.md), then run `<skill-root>/scripts/foundry.sh doctor --project <root> --repair`. Repair refreshes both project-scoped and shared agent configuration to the same exact release. It is transactional, validates the project, and restores every touched file if Foundry introduces a failure.
17
- 4. Confirm that `foundry_design_wait_for_apply` is callable before promising Apply with agent. If setup just added MCP configuration but the tool is unavailable in the current process, stop and ask the user to restart their coding agent and reopen the same project root. Do not start a session or describe the connection as ready.
17
+ 4. Confirm that `foundry_design_wait_for_work` or the legacy `foundry_design_wait_for_apply` is callable before promising agent collaboration. If setup just added MCP configuration but neither tool is available in the current process, stop and ask the user to restart their coding agent and reopen the same project root. Do not start a session or describe the connection as ready.
18
18
  5. Run `<skill-root>/scripts/foundry.sh start --project <root>`. It may start the detected development command and resumes the most recent session for the same source revision. Use `--new` only when the user explicitly wants a clean ledger.
19
- 6. Read the project design graph, then immediately call `foundry_design_wait_for_apply` in bounded waits using the returned session credentials and current revisions. This call publishes the agent-listener heartbeat that unlocks Apply with agent in the browser. Repeat the wait while the session is active. Do not finish the turn merely because one wait returns `waiting`; the browser cannot initiate a new agent turn by itself.
20
- 7. Keep the Foundry runtime and apply listener alive while the user selects and refines elements. End the wait loop only when the user exits Foundry, cancels the workflow, or asks to stop.
19
+ 6. Read the project design graph, then immediately call `foundry_design_wait_for_work` in bounded waits using the returned session credentials and current revisions. This one listener receives reviewed Apply runs and grounded Visual Agent requests. Fall back to `foundry_design_wait_for_apply` only when the unified tool is unavailable. Repeat the wait while the session is active. Do not finish the turn merely because one wait returns `waiting`; the browser cannot initiate a new agent turn by itself.
20
+ 7. Keep the Foundry runtime and agent listener alive while the user selects, discusses, and refines elements. End the wait loop only when the user exits Foundry, cancels the workflow, or asks to stop.
21
21
 
22
22
  In web sessions, selection mode stays active so ordinary clicks can move continuously between elements. Inspector categories filter the selected element's controls without changing selection mode. Switch the pointer tool to interaction mode only when testing the underlying app; Option-click still makes a temporary selection there. Repeating a click cycles overlapping layers, and Option-click prioritizes the strongest mapped or semantic target. Use the Layers panel or the Parent and Child controls for obscured and nested targets. Shift-click builds a multi-selection and exposes measured gaps when the layers share a parent.
23
23
 
@@ -33,7 +33,7 @@ When the user asks to inspect, scrub, preview, or edit rendered motion, read [mo
33
33
 
34
34
  When the user asks to audit, preview, or change fonts, type rhythm, scale, or reusable type styles, read [typography-studio.md](references/typography-studio.md). Keep local fonts preview-only, require an explicit integration strategy for new Google Fonts, and validate reviewed typography across the recorded viewport, theme, and state contexts.
35
35
 
36
- When the user asks to explore, compare, combine, reject, or choose parallel visual directions, read [design-branches.md](references/design-branches.md). Keep every direction isolated from Main, switch preview values reversibly, and require explicit promotion before anything enters Review and apply.
36
+ When the user asks to explore, compare, combine, reject, choose, export, import, or restore parallel visual directions, read [design-branches.md](references/design-branches.md). For portable chosen and rejected outcomes, also read [portable-branch-records.md](references/portable-branch-records.md). Keep every direction isolated from Main, switch preview values reversibly, require explicit promotion before anything enters Review and apply, and never turn a portable record into Design Memory without a separate user action.
37
37
 
38
38
  When the user runs Design Health or asks to correct its findings, read [design-health.md](references/design-health.md). Preserve evidence-only findings when Foundry cannot propose a narrow, reversible preview.
39
39
 
@@ -52,13 +52,17 @@ Do not launch Foundry merely because a task contains design work. Require an exp
52
52
 
53
53
  Read [change-contract.md](references/change-contract.md) when interpreting or troubleshooting a change set.
54
54
 
55
+ ## Discuss a visual request
56
+
57
+ When `foundry_design_wait_for_work` returns `kind: visual_request`, read [visual-agent-conversation.md](references/visual-agent-conversation.md). Ground the response in the attached rendered targets or region, source locations, viewport, theme, state, measurements, project tokens, and contextual comments. Return concrete proposals through `foundry_design_respond_to_visual_request`, then resume the unified listener. Never edit source from a proposal. Only a proposal the user previews, promotes to Review, and applies through a reviewed Apply run authorizes source work.
58
+
55
59
  ## Apply the reviewed batch
56
60
 
57
61
  1. Read the project design graph with `foundry_design_get_project_design`.
58
- 2. For an interactive web session, keep calling `foundry_design_wait_for_apply` in bounded waits as soon as Foundry starts. Include the current source revision, design-graph revision, and agent identity. A reviewed run may already be queued while the agent was offline. A `waiting` result means poll again while the session remains active, not that the workflow is complete.
62
+ 2. For an interactive session, keep calling `foundry_design_wait_for_work` in bounded waits as soon as Foundry starts. Include the current source revision, design-graph revision, and agent identity. A reviewed run or visual request may already be queued while the agent was offline. A `waiting` result means poll again while the session remains active, not that the workflow is complete.
59
63
  3. If a run is claimed, retain its `claimAttemptId`, read [apply-run-contract.md](references/apply-run-contract.md), and follow its state transitions. Do not edit from an unreviewed draft ledger.
60
64
  4. Immediately report `applying` with the current `claimAttemptId`, then reinspect current source before editing. The MCP bridge automatically renews a fresh claim while this turn is inspecting prerequisites, but do not rely on that as a progress state. If a long prerequisite prevents the transition, explicitly extend the lease with `foundry_design_heartbeat_apply_run` while the run remains `claimed`.
61
- 5. Stop if the claim is no longer active or the source inspection finds a stale revision, stale graph, unresolved target, or unresolved operation. Return to `foundry_design_wait_for_apply` when Foundry has safely requeued an abandoned handoff.
65
+ 5. Stop if the claim is no longer active or the source inspection finds a stale revision, stale graph, unresolved target, or unresolved operation. Return to `foundry_design_wait_for_work` when Foundry has safely requeued an abandoned handoff.
62
66
  6. Implement the user's selected semantic mapping at the narrowest source of truth.
63
67
  7. Preserve existing tokens and component conventions. Prefer a matching token over a new literal. Do not invent a global token for an instance-scoped adjustment.
64
68
  8. Apply the batch as a normal, reviewable source diff. Never write generated preview styles into production code.
@@ -10,6 +10,20 @@ Use Component Workshop to inspect a project-native component as a connected syst
10
10
  4. Use the state controls to preview default, hover, focus, pressed, disabled, loading, empty, and error behavior.
11
11
  5. Use variants only when the project design graph provides variant properties. Storybook stories are indexed as variant properties.
12
12
 
13
+ ## Create a source-backed variant
14
+
15
+ 1. Use **Create source variant** only when Component Workshop exposes a writable Storybook, CVA, configured, or TypeScript union axis.
16
+ 2. Enter both the human label and the exact source value. Choose a mapped base variant when the new option should preserve its visual treatment.
17
+ 3. Stage the operation, then inspect its exact authoring file, adapter, source property, base variant, and preservation evidence in Review.
18
+ 4. During Apply, follow the recorded adapter rather than inventing a parallel API: create a named Storybook export, add the option to the existing CVA variant map, or extend the recorded TypeScript union and its existing implementation mapping.
19
+ 5. Re-index after the source edit. The new option must return as a mapped variant on the same axis before verification can pass.
20
+
21
+ `component.variant.create.<property>` is a source-authoring operation, not a CSS property. Never satisfy it with a preview attribute or generated stylesheet.
22
+
23
+ ## Repair cross-instance drift
24
+
25
+ After selecting a mapped variant, use **Cross-instance drift** to compare only explicitly instrumented instance properties. Missing properties are unknown, not mismatches. A repair stages one exact `variant.<property>` change for each differing instance and retains that instance's source reference. Apply each repair at the narrowest recorded call site, then verify every repaired instance against the selected variant.
26
+
13
27
  State previews are presentation state. They must never create a design change or enter the review ledger. Return to Default before measuring or applying unrelated changes.
14
28
 
15
29
  ## Choose scope safely
@@ -28,3 +42,5 @@ Do not promote an instance edit to variant or component scope by inference. If t
28
42
  4. For variant scope, verify every rendered instance of the selected variant that is available in the session.
29
43
  5. For component scope, verify every rendered instance of that component that is available in the session.
30
44
  6. Keep unavailable combinations explicit. Never claim coverage for a state, theme, or viewport that was not rendered and measured.
45
+ 7. For a newly created variant, confirm the indexed axis includes the exact new value and that the chosen base treatment was preserved.
46
+ 8. For drift repair, confirm the mismatch count returns to zero without changing instances that did not expose that property.
@@ -30,6 +30,12 @@ Choosing a direction is an explicit boundary:
30
30
 
31
31
  Never merge a direction directly into project files and never automatically retry or promote a rejected direction.
32
32
 
33
+ ## Preserve the outcome
34
+
35
+ Choosing or rejecting a direction creates a portable branch decision record. Read [portable-branch-records.md](portable-branch-records.md) before exporting, importing, restoring, or linking one of these records to Design Memory.
36
+
37
+ The record preserves evidence without becoming a permanent rule. Adding it to Design Memory is always a separate, explicit user action.
38
+
33
39
  ## Verification
34
40
 
35
41
  - Confirm edits recorded in one branch never appear in another branch or Main.
@@ -37,4 +43,5 @@ Never merge a direction directly into project files and never automatically retr
37
43
  - Compare at the recorded viewport and theme.
38
44
  - Combine decisions from at least two branches and verify only selected changes appear in the new direction.
39
45
  - Promote the combined direction and confirm Review and apply contains the expected draft changes.
46
+ - Export and re-import chosen and rejected records, verify compatibility evidence, and restore only a current record into a new isolated direction.
40
47
  - Verify Light and Dark Foundry interface themes without altering the product theme.
@@ -18,6 +18,17 @@ Use the Design System workspace to understand and extend the product's existing
18
18
 
19
19
  Recommendations explain the matching category, value relationship, and source evidence. Exact token matches rank first in Inspector menus, followed by the nearest compatible project values. Never recommend a token from an unrelated category merely because its serialized value matches.
20
20
 
21
+ ## Promote recurring values
22
+
23
+ 1. Open **Promote** in the Design System workspace.
24
+ 2. Select a recurring authored value and inspect every indexed source location.
25
+ 3. Prefer the recommended existing semantic token when its resolved value matches. Foundry ranks the deepest compatible alias chain ahead of a raw primitive so theme and component intent survive the refactor.
26
+ 4. When no compatible token exists, review the proposed project-native token name and value. Treat the generated name as a source plan, not an applied convention.
27
+ 5. Add the plan to Review. Foundry records the exact locations, resolved value, alias chain, source blast radius, and required rebuild checks in one `token-refactor` operation.
28
+ 6. Apply with the active coding agent, re-index the project, and verify every affected consumer before marking the operation complete.
29
+
30
+ Broken and circular aliases remain visible in the token detail view but never receive an invented resolved value. Dynamic and generated usages remain outside the indexed count and must be reported as unresolved.
31
+
21
32
  ## Change the system safely
22
33
 
23
34
  1. Inspect affected components and contexts before proposing a replacement or token edit.
@@ -26,4 +37,4 @@ Recommendations explain the matching category, value relationship, and source ev
26
37
  4. Require an exact source mapping and explicit component, theme, breakpoint, and state scope.
27
38
  5. Rebuild and verify every affected rendered context. A token definition change is complete only after its indexed consumers remain visually and functionally correct.
28
39
 
29
- The Design System workspace never applies source changes automatically. Its index, guidance, selection, and impact preview are presentation and evidence state.
40
+ The Design System workspace never applies source changes automatically. Token promotion creates a draft Review operation; only the normal reviewed Apply workflow may change source.
@@ -5,10 +5,47 @@ Use Motion Studio when a rendered interface contains motion that must be underst
5
5
  ## Discover rendered motion
6
6
 
7
7
  1. Select the animated target on the Canvas, then open **Motion studio** from the workspace menu or command palette.
8
- 2. Treat the live browser and timeline as views of the same registered CSS animation, CSS transition, or Web Animation.
8
+ 2. Treat the live browser and timeline as views of the same registered CSS animation, CSS transition, Web Animation, Motion for React animation, GSAP tween, or React Spring animation.
9
9
  3. Preserve the source type, duration, delay, easing, iterations, direction, fill mode, animated properties, and keyframes exactly as reported by the adapter.
10
10
  4. Use the performance tier and reduced-motion status as evidence. Do not infer compositor safety or accessibility coverage from an animation name alone.
11
11
 
12
+ ## Preserve project-native motion
13
+
14
+ Foundry indexes Motion for React, GSAP, and React Spring authoring sites and associates the nearest source-backed preset with an instrumented element. For the strongest runtime evidence, register the actual animation or an equivalent preview on the rendered element:
15
+
16
+ ```ts
17
+ import { registerNativeMotion } from 'foundry-design-web-adapter';
18
+
19
+ registerNativeMotion(element, {
20
+ adapter: 'motion',
21
+ from: { opacity: 0, y: 12 },
22
+ to: { opacity: 1, y: 0 },
23
+ transition: { duration: 0.48, ease: [0.16, 1, 0.3, 1] },
24
+ source: { file: 'src/PrimaryAction.tsx', line: 18 },
25
+ });
26
+
27
+ registerNativeMotion(element, {
28
+ adapter: 'gsap',
29
+ from: { x: -24, opacity: 0 },
30
+ to: { x: 0, opacity: 1 },
31
+ config: { duration: 0.6, ease: 'power2.out' },
32
+ source: { file: 'src/Panel.tsx', line: 32 },
33
+ });
34
+
35
+ registerNativeMotion(element, {
36
+ adapter: 'react-spring',
37
+ from: { y: 16, opacity: 0 },
38
+ to: { y: 0, opacity: 1 },
39
+ config: { mass: 1, tension: 210, friction: 24 },
40
+ source: { file: 'src/Notice.tsx', line: 14 },
41
+ });
42
+ ```
43
+
44
+ - Keep seconds in Motion and GSAP source. Foundry displays milliseconds but records the native `transition.duration` or `vars.duration` property path.
45
+ - Preserve React Spring's physical `mass`, `tension`, and `friction` values rather than flattening the source into a guessed duration.
46
+ - Keep Motion `animate` and `variants`, GSAP `vars`, and React Spring `from`/`to` semantics in Apply evidence.
47
+ - A runtime preview is presentation state. Source changes still enter the existing Review and Apply flow and require rendered verification.
48
+
12
49
  ## Preview without recording changes
13
50
 
14
51
  Play, pause, replay, loop, speed, and timeline scrubbing are presentation controls. They must never enter the change ledger, modify source, or become part of an Apply run. Keep the selected motion and playhead synchronized between Motion Studio and the Inspector.
@@ -21,6 +58,32 @@ Play, pause, replay, loop, speed, and timeline scrubbing are presentation contro
21
58
  - Require exact source mapping before promoting an edit beyond the selected instance.
22
59
  - Never replace a project easing token or motion convention with an unexplained literal when a matching native value exists.
23
60
 
61
+ ## Shape timing curves
62
+
63
+ - Use the dedicated **Bezier** editor for CSS cubic Bezier timing. Drag either control point, use its keyboard-accessible handle, enter exact X and Y values, or start from a preset.
64
+ - Preserve all four cubic Bezier coordinates. Preview the resulting travel independently, then record the exact `cubic-bezier(x1, y1, x2, y2)` value through Review.
65
+ - Use the dedicated **Spring** editor to tune mass, stiffness, damping, and initial velocity. Show settling duration and overshoot so the physical response is understandable before it is recorded.
66
+ - CSS has no portable `spring()` timing function. For web targets, keep the exact physical parameters in the live Foundry curve model and generate a deterministic CSS `linear()` approximation for preview, Review, apply, and rendered verification.
67
+ - Treat presets as starting points, not hidden tokens. Every preset must resolve to visible editable values.
68
+ - Curve playback is temporary presentation state. It must never create a design change until the user changes a curve value.
69
+ - Respect reduced-motion preferences in the curve preview while retaining the authored curve values for inspection.
70
+
71
+ ## Author motion paths
72
+
73
+ - Use the dedicated **Motion path** editor when at least two rendered transform keyframes expose pixel-based translation values.
74
+ - Drag a path point, use Arrow keys for one-pixel changes, hold Shift for eight-pixel changes, or enter exact X and Y coordinates.
75
+ - Preserve scale, rotation, and matrix coefficients when translation changes. Do not convert percentage or otherwise unresolved transforms into guessed pixels.
76
+ - Record path edits as the corresponding transform keyframe value so Review, source mapping, undo, and rebuilt verification keep using the existing keyframe contract.
77
+ - Show native path bounds and total travel distance as inspection evidence. Path geometry is not a new production artifact by itself.
78
+
79
+ ## Compare before and after in sync
80
+
81
+ - Capture the source baseline once, immediately before the first timing, curve, or keyframe preview change.
82
+ - Draw the source baseline and current preview in one coordinate system. Use one playhead for both paths and evaluate each animation with its own timing curve.
83
+ - Playback, replay, and comparison scrubbing are presentation state. They must not enter Review or mutate the live product animation.
84
+ - Report duration, travel-distance, and keyframe-count deltas without claiming that a larger or smaller value is automatically better.
85
+ - If either side lacks a resolvable path, retain the timing and keyframe editors and explain why path comparison is unavailable.
86
+
24
87
  ## Review motion health
25
88
 
26
89
  - Prefer transform and opacity when the intended effect can remain on the compositor.
@@ -0,0 +1,38 @@
1
+ # Portable branch decision records
2
+
3
+ Use portable branch records to carry the outcome and evidence of a Design Branch beyond its original session without turning that outcome into an automatic project rule.
4
+
5
+ ## Record contract
6
+
7
+ - Choosing or rejecting a direction creates or refreshes one canonical record for that branch.
8
+ - Preserve the outcome, rationale, exact changes and operations, session context, design-graph revision, and source relationships.
9
+ - Export records as a versioned `foundry.design-branch-records` JSON bundle.
10
+ - Import records as reference material. Importing must not change the canvas, Main, source files, or Design Memory.
11
+ - Reassess compatibility against the current session and design graph whenever records are read, imported, or the graph changes.
12
+ - Match source relationships by project-relative path so a project can move between machines without becoming stale solely because its root path changed.
13
+
14
+ ## Compatibility
15
+
16
+ - `current` means every recorded source relationship is present and the design-graph revision still matches. The direction may be restored for exploration.
17
+ - `stale` means the relevant source still exists but the graph revision or part of the recorded context changed. Show the evidence and require review or repair before restore.
18
+ - `missing` means the record has no recoverable source relationship or none of its source files exist in the current graph. Never guess a replacement.
19
+
20
+ Compatibility is evidence, not an edit. It must not create a design change or alter the record's original context.
21
+
22
+ ## Restore and memory boundaries
23
+
24
+ 1. Restore only a `current` record.
25
+ 2. Clone its changes and operations with fresh identifiers into a new exploring direction.
26
+ 3. Keep the restored direction isolated from Main until the user explicitly chooses it again.
27
+ 4. Add a record to Design Memory only after the user selects **Add to Memory**. Choosing, rejecting, importing, or restoring a record must never silently create permanent guidance.
28
+ 5. Let the user remove a record without deleting its original branch or changing source.
29
+
30
+ ## Verification
31
+
32
+ - Export chosen and rejected records and parse the bundle against the protocol schema.
33
+ - Import into the same project at a different root path and confirm source-relative matching remains current.
34
+ - Change the design-graph revision and confirm the record becomes stale.
35
+ - Remove its source from the graph and confirm the record becomes missing.
36
+ - Restore a current record and confirm a new isolated direction appears without changing Main.
37
+ - Confirm explicit Add to Memory is the only path that creates remembered guidance.
38
+ - Verify Light and Dark workspace states and the matching Figma components.
@@ -7,8 +7,12 @@ Use Responsive Design Lab when a change must remain correct across real running
7
7
  1. Select the target once on the Canvas, then open **Responsive design lab** from the workspace menu or command palette.
8
8
  2. Treat each iframe's declared width and height as the browser viewport. Foundry may scale the outer frame for presentation, but must never resize the document to fit the workspace.
9
9
  3. Check the linked selection in every configured breakpoint and the session's recorded Current viewport.
10
- 4. Scrub Custom width to reveal media-query and container-query transitions between named boundaries.
11
- 5. Treat horizontal overflow, clipping, awkward wrapping, and large geometry jumps as findings. Do not enlarge a viewport from `scrollWidth` to conceal overflow.
10
+ 4. Keep **Viewport** selected to scrub the browser viewport through indexed media-query boundaries.
11
+ 5. Switch to **Container** to resize the nearest authored query container around the selected element without changing the iframe viewport. Indexed `@container` conditions remain visible as exact, source-linked boundary shortcuts.
12
+ 6. Capture **Before** and **After** at meaningful widths. Foundry freezes viewport, container, selected-element, wrapping, and overflow measurements while the live preview remains free to move.
13
+ 7. Treat horizontal overflow, clipping, awkward wrapping, and large geometry jumps as findings. Do not enlarge a viewport from `scrollWidth` to conceal overflow.
14
+
15
+ Container and comparison previews are presentation state. They must not create design changes, alter source, or disguise the viewport used by screenshots and verification. Clearing the preview restores the container's exact prior inline styles.
12
16
 
13
17
  ## Use stress tests safely
14
18
 
@@ -25,6 +29,6 @@ Never infer a global responsive edit from a successful local preview. If a custo
25
29
 
26
30
  1. Rebuild the real application.
27
31
  2. Reopen the linked selection at every approved viewport using native iframe dimensions.
28
- 3. Compare before and after in the failing context.
32
+ 3. Compare the captured before and after measurements in the failing viewport or container context.
29
33
  4. Confirm the original passing contexts remain stable.
30
34
  5. Report unsupported, cross-origin, or unavailable contexts explicitly rather than substituting the current viewport.
@@ -0,0 +1,14 @@
1
+ # Visual Agent conversation
2
+
3
+ Use this workflow only for a request claimed through `foundry_design_wait_for_work` or `foundry_design_wait_for_visual_request`.
4
+
5
+ 1. Read every attached rendered target, drawn region, contextual comment, source location, viewport, breakpoint, theme, state, measurement, token, and design-graph revision before proposing a direction.
6
+ 2. Inspect the referenced source and project conventions. State when a source location, token mapping, responsive effect, or measurement is unresolved. Do not fill missing evidence with an approximation.
7
+ 3. Explain the visual cause in plain language. Connect each conclusion to the rendered or source evidence that supports it.
8
+ 4. Return one to three meaningfully different proposals. For each proposal include a concise name, summary, reasoning, exact values, affected source locations, responsive impact, a verification plan, and complete draft `DesignChange` records for previewable edits.
9
+ 5. Keep each proposal internally coherent and independently previewable. Do not mix competing directions into one change list.
10
+ 6. Do not edit source, approve changes, or choose a proposal for the user. `foundry_design_respond_to_visual_request` only returns isolated proposals to Foundry.
11
+ 7. If the context is insufficient, return a clear explanation with no speculative changes. Ask for a narrower selection, region, state, or source mapping.
12
+ 8. After responding, resume `foundry_design_wait_for_work`. The user may preview, reject, or promote a proposal. Only a later reviewed Apply run authorizes source edits.
13
+
14
+ If a claim expires, stop. Do not retry automatically. Foundry preserves the request and requires the user to authorize a retry. If an applied proposal fails rebuilt verification, report the exact requested and rendered values and wait for explicit retry authorization.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foundry-design",
3
- "version": "0.2.0-beta.17",
3
+ "version": "0.2.0-beta.19",
4
4
  "description": "Install and run the local-first Foundry visual design control plane",
5
5
  "type": "module",
6
6
  "files": [
@@ -34,8 +34,8 @@
34
34
  "inspector"
35
35
  ],
36
36
  "dependencies": {
37
- "foundry-design-protocol": "0.2.0-beta.17",
38
- "foundry-design-runtime": "0.2.0-beta.17"
37
+ "foundry-design-protocol": "0.2.0-beta.19",
38
+ "foundry-design-runtime": "0.2.0-beta.19"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsc -p tsconfig.json && node ../../scripts/copy-cli-skill.mjs",