@contentful/experience-design-system-cli 2.42.1-dev-build-f69db6bf.0 → 2.42.1-dev-build-fb965e69.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 (65) hide show
  1. package/bin/cli.js +1 -1
  2. package/dist/app.js +24734 -16921
  3. package/dist/index.js +34651 -25246
  4. package/dist/package.json +1 -1
  5. package/dist/src/commands/import-options.d.ts +8 -0
  6. package/dist/src/tui/debug-store.d.ts +2 -0
  7. package/dist/src/tui/import/cancellation.d.ts +26 -0
  8. package/dist/src/tui/import/debug-resume-screen.d.ts +7 -0
  9. package/dist/src/tui/import/debug-resume.d.ts +53 -0
  10. package/dist/src/tui/import/shared/agent-activity.d.ts +2 -0
  11. package/dist/src/tui/import/shared/running-step/logic.d.ts +7 -0
  12. package/dist/src/tui/import/shared/running-step/running-step.d.ts +2 -1
  13. package/dist/src/tui/import/shared/running-step/use-elapsed.d.ts +1 -0
  14. package/dist/src/tui/import/steps/03-path-validation/logic.d.ts +1 -0
  15. package/dist/src/tui/import/steps/03-path-validation/screen.d.ts +1 -0
  16. package/dist/src/tui/import/steps/06-extraction/logic.d.ts +2 -4
  17. package/dist/src/tui/import/steps/06-extraction/run-tokens-only.d.ts +1 -0
  18. package/dist/src/tui/import/steps/06-extraction/run.d.ts +9 -9
  19. package/dist/src/tui/import/steps/06-extraction/selection.d.ts +7 -1
  20. package/dist/src/tui/import/steps/06-extraction/types.d.ts +13 -0
  21. package/dist/src/tui/import/steps/07-scope-gate/graph/index.d.ts +3 -1
  22. package/dist/src/tui/import/steps/07-scope-gate/screen.d.ts +2 -1
  23. package/dist/src/tui/import/steps/07-scope-gate/sidebar/ai-flag.d.ts +0 -1
  24. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.d.ts +2 -0
  25. package/dist/src/tui/import/steps/07-scope-gate/state.d.ts +5 -2
  26. package/dist/src/tui/import/steps/07-scope-gate/types.d.ts +4 -6
  27. package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.d.ts +3 -0
  28. package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +7 -3
  29. package/dist/src/tui/import/steps/08-generation/logic.d.ts +2 -8
  30. package/dist/src/tui/import/steps/08-generation/map-tokens.d.ts +1 -1
  31. package/dist/src/tui/import/steps/08-generation/run.d.ts +9 -1
  32. package/dist/src/tui/import/steps/08-generation/save-decisions.d.ts +3 -5
  33. package/dist/src/tui/import/steps/08-generation/types.d.ts +15 -5
  34. package/dist/src/tui/import/steps/09-review/components/FieldEditor.d.ts +50 -2
  35. package/dist/src/tui/import/steps/09-review/components/RepresentationEditor.d.ts +11 -0
  36. package/dist/src/tui/import/steps/09-review/components/ReviewComponentPanel.d.ts +4 -1
  37. package/dist/src/tui/import/steps/09-review/components/ReviewDetailsEditor.d.ts +1 -1
  38. package/dist/src/tui/import/steps/09-review/components/source-observation-rows.d.ts +3 -0
  39. package/dist/src/tui/import/steps/09-review/generate-review-step.d.ts +17 -0
  40. package/dist/src/tui/import/steps/09-review/graph/cycle-view.d.ts +3 -0
  41. package/dist/src/tui/import/steps/09-review/history.d.ts +1 -0
  42. package/dist/src/tui/import/steps/09-review/persist-review-entry.d.ts +14 -0
  43. package/dist/src/tui/import/steps/09-review/review-details-panel.d.ts +1 -2
  44. package/dist/src/tui/import/steps/09-review/review-models.d.ts +12 -0
  45. package/dist/src/tui/import/steps/09-review/run-live-preview.d.ts +1 -0
  46. package/dist/src/tui/import/steps/09-review/types.d.ts +2 -1
  47. package/dist/src/tui/import/steps/09-review/use-review-editor.d.ts +7 -2
  48. package/dist/src/tui/import/steps/10-flow/flow/preview.d.ts +1 -0
  49. package/dist/src/tui/import/steps/10-flow/flow/push.d.ts +2 -0
  50. package/dist/src/tui/import/steps/10-flow/flow/save.d.ts +2 -0
  51. package/dist/src/tui/settings/PreferenceScreen.d.ts +17 -0
  52. package/package.json +3 -3
  53. package/skills/consensus/check.md +6 -0
  54. package/skills/consensus/tier.md +5 -0
  55. package/skills/consensus/verify.md +6 -0
  56. package/skills/debate-select.md +37 -0
  57. package/skills/explore/components.md +30 -0
  58. package/skills/explore/full-inventory.md +27 -0
  59. package/skills/explore/model-component.md +44 -0
  60. package/skills/explore/rules.md +20 -0
  61. package/skills/generate-components.md +156 -427
  62. package/skills/generate-tokens.md +1 -7
  63. package/skills/map-tokens.md +1 -1
  64. package/skills/select-components.md +20 -159
  65. package/dist/src/tui/import/steps/10-flow/support/use-timed-spinner.d.ts +0 -4
@@ -185,10 +185,4 @@ Before emitting any tool calls, verify:
185
185
  6. No duplicate paths.
186
186
  7. `set_group` calls precede the `set_token` calls under them.
187
187
 
188
- After the run, the developer can validate with:
189
-
190
- ```
191
- experience-design-system-cli print validate --tokens <out-path>
192
- ```
193
-
194
- Re-run or iterate on any tokens flagged by warnings until validation passes.
188
+ Before finishing, review the token output against this checklist and iterate on any warning the supplied input can resolve. Preserve unresolved warnings in the token `description`; do not guess values.
@@ -26,7 +26,7 @@ If no token path index is provided, there is nothing to narrow against — do no
26
26
 
27
27
  For each design-category, token-typed prop shown in the "Generated CDF so far" section:
28
28
 
29
- 1. **Prop type is a union of variant names** (e.g. `'primary' | 'secondary'`)? That prop should not be a `token` at all — the component receives a name and resolves it, which is the `enum` case in the classification step. Do not narrow it; narrowing cannot repair a wrong type. Emit nothing, and note in a prose line that it looks misclassified.
29
+ 1. **Prop type is a union of variant names** (e.g. `'primary' | 'secondary'`)? That prop should not be a `token` at all — the component receives a name and resolves it, which is a primitive with typed `values` in the classification step. Do not narrow it; narrowing cannot repair a wrong type. Emit nothing, and note in a prose line that it looks misclassified.
30
30
  2. **A default value or `tokenReference` is the prop's default, not a restriction.** `padding = tokens.spacingM` or a structured `tokenReference` tells you which token the prop *starts* on — it does not say the author may choose no other. Narrowing to that single path would leave the marketer one option, which is worse than no list. On its own, this evidence yields no tool call. If you narrow on other grounds (step 3), the default's path must be in the list.
31
31
  3. **Look for an explicit restriction** in the component source or its siblings: a comment naming the valid tokens, or code that validates/maps the prop against a fixed list of token paths (an allowlist array, a `satisfies` over specific token keys). If found, emit `$token.allowed` as the evidenced subset, scoped to tokens of the prop's `$token.kind`.
32
32
  4. **No explicit restriction?** Emit nothing. Omitting the list means "any token of this kind," which is correct and live — a guessed list is worse than none because it freezes the author's choices.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Review the extracted React/Next.js component(s) provided below and decide whether each belongs in **Contentful Experience Orchestration** as a Component Type. The input is a JSON array — you may receive 1–N components in a single message. Output one JSON tool call per input component to stdout, named after the component. Tool calls may appear in any order.
5
+ Review the extracted component definition(s) provided below and decide whether each belongs in **Contentful Experience Orchestration** as a Component Type. Use the supplied framework and source evidence; supported inputs may come from more than one UI framework. The input is a JSON array — you may receive 1–N components in a single message. Output one JSON tool call per input component to stdout, named after the component. Tool calls may appear in any order.
6
6
 
7
7
  ---
8
8
 
@@ -20,59 +20,14 @@ The entity being defined — a **Component Type** — is the schema that tells C
20
20
 
21
21
  ---
22
22
 
23
- ## The one rule: is this the author-facing UI component?
23
+ ## Source purpose and inclusion
24
24
 
25
- **Accept** the component if it is the component that directly defines the author-facing UI surface — regardless of whether it is an atom, molecule, or organism, and regardless of whether it has many or few configurable props. A footer icon with two props (`icon`, `label`) is just as valid as a parallax hero with fifteen props.
26
-
27
- **Reject** the component if its primary purpose is framework or data-loading infrastructure rather than the author-facing UI surface:
28
-
29
- - It is a React hook (name starts `use` or `Use`)
30
- - It is a pure context provider with no visual output
31
- - It is a Ninetailed/personalization platform wrapper (its job is routing to variants, not rendering content)
32
- - It is a data-fetch wrapper that loads data for a sibling renderer and then forwards that data into the sibling renderer
33
- - It is an analytics/event-tracking component (fires events, renders nothing)
34
- - It is a security or infrastructure utility (no UI at all)
35
-
36
- ---
37
-
38
- ## What NOT to use as a rejection reason
39
-
40
- These are **not** valid reasons to reject a component:
41
-
42
- | Invalid reason | Why it is wrong |
43
- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
44
- | "Only atoms/low-level" | Atoms are first-class Component Types in Contentful Experience Orchestration |
45
- | "Tightly coupled to a parent component" | Contentful Experience Orchestration handles composition at the experience layer |
46
- | "Has A/B testing or personalization-related props" | These props are classified as `state` or excluded in the generate step — their presence does not disqualify the component |
47
- | "Has no marketer-configurable props" | Marketers are not the only users; designers and developers configure components too |
48
- | "Domain-specific or feature-level" | Press releases, newsrooms, search — all valid content components |
49
- | "Server-side or SSR" | Server components that render visible UI are valid |
50
- | "Few configurable props" | One or two props is fine |
51
-
52
- ---
53
-
54
- ## Reject only these categories
55
-
56
- | Category | Why |
57
- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
58
- | **React hooks** | `useXxx` / `UseXxx` — functions, not renderable components. Zero visual output. |
59
- | **Pure context providers** | Wrap children to pass context but render no UI themselves |
60
- | **A/B testing or personalization wrappers** | Components whose _entire purpose_ is routing users to content variants or tracking experiment participation — they render no UI of their own |
61
- | **Data-fetch wrappers** | Components whose job is to load or resolve data for a sibling renderer. Even if they eventually return visible UI, the sibling renderer is the real Component Type. |
62
- | **Analytics and event tracking** | Components that only fire analytics events and render nothing visible |
63
- | **Security utilities** | Non-visual security primitives with no rendered output |
64
-
65
- > **Variant routing rule**: Reject a component if its entire purpose is deciding _which_ content variant to show — that is framework infrastructure, not a Component Type. Do **not** reject a component merely because it _contains_ some A/B testing or personalization-related props — those props are handled as `state` in the generate step.
66
-
67
- > **Data-fetch wrapper rule**: Reject a component if it imports or calls a generated query hook, loads data, and then forwards that data into a sibling renderer. The sibling renderer is the Component Type; the data-loader wrapper is not.
68
-
69
- > **Utility-wrapper rule**: Reject a component if **all three** of the following are true:
70
- >
71
- > 1. It has no props that meaningfully shape user-facing content (no text strings, headings, image URLs, links, body content, rich text, or media references).
72
- > 2. The props it does have are purely structural or behavioral — e.g., `container`, `target`, `as`, `asChild`, render-prop callbacks, internal `ref` forwarding, focus/portal targets, debug toggles, or `children` only.
73
- > 3. It is a utility wrapper rather than a composable content surface. Concrete examples to reject under this rule: `Portal`, `SrOnly` (screen-reader-only wrappers), `FocusTrap`, `ErrorBoundary`, `Suspense` fallbacks, debug-only wrappers, and provider-shaped components whose only job is to forward children.
74
- >
75
- > Use `reject_component` with a reason like `"Utility wrapper — no authorable content surface"` or `"Structural-only component — no user-shaping props"`. This rule is additive to the categories above; do **not** use it to reject a component that has even one author-shaping prop (e.g., a `label`, `title`, `text`, `href`, `src`, or `richText` prop) — those still belong as Component Types per the "one rule" above.
25
+ Assess the component's declared purpose, visible/configurable surface and actual flow from the supplied source and renderer contract.
26
+ Do not use component names, framework families, property counts, styles, callback shapes, structural-only inputs or a known component pattern as an authorability recipe.
27
+ A renderable input, including a render callback, may be a source-supported configurable region even when its observed callers are missing or text-only.
28
+ Reject only when the supplied source establishes why the entity is outside the target component contract; absence from bounded excerpts is uncertainty.
29
+ A wrapper's behavior and delegated data are evidence to inspect, not a blanket rejection rule.
30
+ Preserve uncertain inclusion for human review and explain what the source supports.
76
31
 
77
32
  ## Using `selectionContext`
78
33
 
@@ -84,6 +39,16 @@ If the input includes `selectionContext`, treat it as the only repo-level contex
84
39
  - resolver or registry references
85
40
  - one likely parent usage site
86
41
 
42
+ ## Source evidence and selection uncertainty
43
+
44
+ - Make acceptance or rejection decisions from the supplied definition and captured evidence. Component names, framework labels, familiar patterns, prop counts, or a likely match in an existing model do not prove the component's purpose or rendering behavior by themselves.
45
+ - Captured source references, observations, and parent usage are bounded context. A single caller shows an example of use, not the complete contract or all uses. Missing callers, imports, sibling files, or excerpts do not prove that a component is unused, non-rendering, or an infrastructure wrapper.
46
+ - Treat existing model summaries as optional alignment context. They cannot force acceptance or rejection, and a mature model does not change the evidence required for a decision.
47
+ - When evidence does not establish whether a component defines author-facing UI, preserve that uncertainty in the reason and lower confidence. Do not turn missing evidence into a rejection.
48
+ - The inline context does not provide repository tools, filesystem or working-directory access, a complete compiler graph, final consensus, or an authorability guarantee.
49
+
50
+ The example component names below are illustrative. Apply an example's decision only when the supplied evidence supports the described behavior; a name alone is not evidence.
51
+
87
52
  Use that bounded context to distinguish the author-facing renderer from infrastructure wrappers. In particular:
88
53
 
89
54
  - If the component imports a sibling renderer and mainly forwards fetched data into it, reject the wrapper and prefer the sibling renderer.
@@ -121,115 +86,11 @@ Emit one JSON object on a single line. Lines not starting with `{` are ignored b
121
86
 
122
87
  ---
123
88
 
124
- ## Examples
125
-
126
- ```
127
- Analytics — fires analytics events, no visual output
128
- {"tool":"reject_component","name":"Analytics","reason":"analytics tracker — no visual output"}
129
- ```
130
-
131
- ```
132
- CanaryToken — security utility, no visual output
133
- {"tool":"reject_component","name":"CanaryToken","reason":"security utility — no visual output"}
134
- ```
135
-
136
- ```
137
- ClientExperience — personalization wrapper whose entire purpose is routing users to content variants
138
- {"tool":"reject_component","name":"ClientExperience","reason":"variant routing wrapper — entire purpose is A/B routing, not rendering UI"}
139
- ```
140
-
141
- ```
142
- ComponentMarker — experimentation marker component, no visual output
143
- {"tool":"reject_component","name":"ComponentMarker","reason":"experimentation marker — no visual output"}
144
- ```
145
-
146
- ```
147
- ComponentTracker — variant attribution tracker, no visual output
148
- {"tool":"reject_component","name":"ComponentTracker","reason":"variant attribution tracker — no visual output"}
149
- ```
150
-
151
- ```
152
- Refresh — client-side route refresh utility for personalization platform, no visual output
153
- {"tool":"reject_component","name":"Refresh","reason":"personalization route refresh utility — no visual output"}
154
- ```
155
-
156
- ```
157
- ServerExperience — server-side variant routing wrapper, no visual output
158
- {"tool":"reject_component","name":"ServerExperience","reason":"server-side variant routing wrapper — no visual output"}
159
- ```
160
-
161
- ```
162
- UseHelpNavigation — React hook, not a renderable component
163
- {"tool":"reject_component","name":"UseHelpNavigation","reason":"React hook — not a renderable component"}
164
- ```
165
-
166
- ```
167
- Providers — React context provider with no visual output
168
- {"tool":"reject_component","name":"Providers","reason":"pure context provider — no visual output"}
169
- ```
170
-
171
- ```
172
- HeroBannerGql — fetch wrapper that loads data and forwards it into HeroBanner
173
- It may eventually return visible UI, but the author-facing component is HeroBanner, not HeroBannerGql.
174
- {"tool":"reject_component","name":"HeroBannerGql","reason":"data-fetch wrapper — loads data for a sibling renderer rather than defining the author-facing UI surface"}
175
- ```
176
-
177
- ```
178
- FooterIcon — atom: renders an icon with optional label in the footer
179
- {"tool":"select_component","name":"FooterIcon","reason":"UI atom — renders icon with configurable icon and label"}
180
- ```
181
-
182
- ```
183
- FeedbackModal — modal dialog with visibility state
184
- {"tool":"select_component","name":"FeedbackModal","reason":"modal UI component with configurable visibility and content"}
185
- ```
186
-
187
- ```
188
- ActiveFilters — renders active filter chips with remove controls
189
- {"tool":"select_component","name":"ActiveFilters","reason":"filter UI component — renders visible filter chips"}
190
- ```
191
-
192
- ```
193
- FullSizeBarNoContent — full-width text bar with link; has some personalization state props
194
- The personalization props (hideContentForPersonalization, componentId) are state props handled in the generate step.
195
- The component renders real visual UI — a bar with text, chevron, and link.
196
- {"tool":"select_component","name":"FullSizeBarNoContent","reason":"content bar UI — renders visible bar with configurable text, link, and design"}
197
- ```
198
-
199
- ```
200
- ParallaxComponent — parallax marketing section; has some A/B testing props alongside real content props
201
- The A/B testing props (abmFallback, abmLinkedFromAccount) are state props, not the component's primary purpose.
202
- The component renders a parallax section with title, subtitle, and visual effects.
203
- {"tool":"select_component","name":"ParallaxComponent","reason":"marketing section UI — renders parallax content with configurable title, subtitle, and design"}
204
- ```
205
-
206
- ```
207
- NewsroomLandingPressReleases — press release list with pagination and locale
208
- {"tool":"select_component","name":"NewsroomLandingPressReleases","reason":"content list UI — renders press releases with configurable locale and pagination"}
209
- ```
210
-
211
- ```
212
- ServerHelpNavigation — server-side navigation with configurable search visibility and locale
213
- {"tool":"select_component","name":"ServerHelpNavigation","reason":"navigation UI — renders help navigation with configurable locale and search toggle"}
214
- ```
215
-
216
- ```
217
- TextImageCard — card with rich text and background image
218
- {"tool":"select_component","name":"TextImageCard","reason":"content card UI — configurable rich text, image, and layout"}
219
- ```
220
-
221
- ```
222
- SearchInput — search field with dropdown
223
- {"tool":"select_component","name":"SearchInput","reason":"search UI — configurable placeholder and state"}
224
- ```
225
-
226
- ---
227
-
228
89
  ## Existing entities in the target space
229
90
 
230
91
  The preamble may include an "Existing components in the target Contentful space" JSON block and a rolled-up token summary. Use them as **signal, not as a filter**. Rules:
231
92
 
232
- 1. Never let a name overlap force a decision. Acceptance is still driven purely by "does the codebase component render visible, authorable UI?" — a name match does not auto-accept, and a name conflict does not auto-reject.
93
+ 1. Never let a name overlap force a decision. Decide from supplied evidence about whether the component renders visible, author-facing UI; a name match does not auto-accept, and a name conflict does not auto-reject.
233
94
  2. When a codebase component appears to correspond to an existing space component (name overlap, semantic overlap in the description), note it in your `reason` — e.g. `"accepted; likely maps to existing space component 'Button'"`. This surfaces the mapping for downstream review.
234
- 3. When the space is mature (many existing components, dozens of tokens) and the codebase has thin wrappers with no visible UI difference, lean harder toward rejecting the wrappers. Extra noise in a mature space is more costly than in an empty one.
95
+ 3. A mature space does not change the evidence threshold for deciding whether a component is an author-facing UI surface. Record possible duplication for review without using model size to reject a component.
235
96
  4. When no overlap exists, the acceptance decision is unchanged from the rules above.
@@ -1,4 +0,0 @@
1
- export declare function useTimedSpinner(): {
2
- spinner: React.ReactElement;
3
- elapsed: string;
4
- };