@contentful/experience-design-system-generation 2.32.1-dev-build-111fac0.0 → 2.32.1-dev-build-0e6dd6e.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-generation",
3
- "version": "2.32.1-dev-build-111fac0.0",
3
+ "version": "2.32.1-dev-build-0e6dd6e.0",
4
4
  "description": "Agent-invocation and skill-prompt engine for the Contentful Experience Design System SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -111,7 +111,7 @@ export declare function agentSupportsBedrock(agent: AgentName): boolean;
111
111
  * agents whose model id changes shape under Bedrock (codex, opencode) — an
112
112
  * explicit value or env override is never rewritten.
113
113
  */
114
- export declare function resolveAgentModel(agent: AgentName, explicit?: string, bedrock?: boolean): string;
114
+ export declare function resolveAgentModel(agent: AgentName, explicit?: string, bedrock?: boolean): string | undefined;
115
115
  export type AgentDebugEvent = (name: string, payload?: Record<string, unknown>) => void;
116
116
  export declare function buildArgs(agent: AgentName, prompt: string, model?: string, promptViaStdin?: boolean, bedrock?: boolean): string[];
117
117
  export declare function runAgent(options: {
@@ -295,18 +295,21 @@ export function agentSupportsBedrock(agent) {
295
295
  return BEDROCK_CAPABLE_AGENTS.has(agent);
296
296
  }
297
297
  const DEFAULT_CODEX_BEDROCK_REGION = 'us-east-1';
298
+ const DEFAULT_OPENCODE_MODEL = 'claude-haiku-4-5';
298
299
  /**
299
300
  * Default models per agent — lightweight/fast picks to control cost when no
300
301
  * explicit model is configured. cursor uses `gpt-mini` (verified alias from
301
- * GetUsableModels; haiku is not available in cursor's model catalog). codex's
302
- * default differs on Bedrock: the model id there carries an `openai.` prefix,
303
- * required by the Bedrock provider and absent from the direct api.openai.com
304
- * id.
302
+ * GetUsableModels; haiku is not available in cursor's model catalog).
303
+ *
304
+ * codex is deliberately absent: with no entry here it gets no `--model` at
305
+ * all, so the installed Codex CLI picks whatever its account supports. On
306
+ * Bedrock it still needs an explicit id, since the model id there carries an
307
+ * `openai.` prefix required by the Bedrock provider and absent from the
308
+ * direct api.openai.com id — see DEFAULT_CODEX_BEDROCK_MODEL.
305
309
  */
306
310
  const DEFAULT_MODELS = {
307
311
  claude: 'haiku',
308
- codex: 'gpt-5.6-luna', // requires OPENAI_API_KEY; ChatGPT account users must pass --model
309
- opencode: 'claude-haiku-4-5',
312
+ opencode: DEFAULT_OPENCODE_MODEL,
310
313
  cursor: 'gpt-mini', // cursor alias for gpt-5.4-mini-medium; haiku not in cursor's catalog
311
314
  copilot: 'Auto', // the only model guaranteed on every Copilot plan (Free/Pro/Business/Enterprise); Pro+ users override via EDS_AGENT_MODEL_COPILOT
312
315
  };
@@ -328,7 +331,7 @@ export function resolveAgentModel(agent, explicit, bedrock = false) {
328
331
  if (bedrock && agent === 'codex')
329
332
  return DEFAULT_CODEX_BEDROCK_MODEL;
330
333
  if (bedrock && agent === 'opencode')
331
- return withBedrockProviderPrefix(DEFAULT_MODELS.opencode);
334
+ return withBedrockProviderPrefix(DEFAULT_OPENCODE_MODEL);
332
335
  return DEFAULT_MODELS[agent];
333
336
  }
334
337
  /**
@@ -353,7 +356,10 @@ function codexBedrockConfigArgs() {
353
356
  return ['-c', 'model_provider=amazon-bedrock', '-c', `model_providers.amazon-bedrock.region=${region}`];
354
357
  }
355
358
  export function buildArgs(agent, prompt, model, promptViaStdin = false, bedrock = false) {
356
- const modelArg = ['--model', resolveAgentModel(agent, model, bedrock)];
359
+ // codex with no configured model resolves to undefined — omit --model
360
+ // entirely so the CLI picks its own account-compatible default.
361
+ const resolvedModel = resolveAgentModel(agent, model, bedrock);
362
+ const modelArg = resolvedModel ? ['--model', resolvedModel] : [];
357
363
  // When the prompt is delivered on stdin, omit it from argv — a large prompt
358
364
  // as a command-line argument overflows ARG_MAX (spawn E2BIG). All four CLIs
359
365
  // read the prompt from stdin when it isn't passed positionally.
@@ -387,7 +393,7 @@ export function buildArgs(agent, prompt, model, promptViaStdin = false, bedrock
387
393
  // value, so promptViaStdin will fail here — callers must pass the
388
394
  // prompt inline for copilot.
389
395
  const copilotModel = resolveAgentModel('copilot', model);
390
- const copilotModelArg = copilotModel === 'Auto' ? [] : ['--model', copilotModel];
396
+ const copilotModelArg = !copilotModel || copilotModel === 'Auto' ? [] : ['--model', copilotModel];
391
397
  return ['-p', ...promptArg, ...copilotModelArg, '--allow-all-tools'];
392
398
  }
393
399
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-generation",
3
- "version": "2.32.1-dev-build-111fac0.0",
3
+ "version": "2.32.1-dev-build-0e6dd6e.0",
4
4
  "description": "Agent-invocation and skill-prompt engine for the Contentful Experience Design System SDK",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -22,7 +22,7 @@
22
22
  "skills/"
23
23
  ],
24
24
  "dependencies": {
25
- "@contentful/experience-design-system-types": "2.32.1-dev-build-111fac0.0"
25
+ "@contentful/experience-design-system-types": "2.32.1-dev-build-0e6dd6e.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@tsconfig/node24": "^24.0.4",
@@ -91,7 +91,7 @@ Emit one JSON object per line. The CLI parses lines starting with `{`. Lines not
91
91
  - Every prop in the input must produce exactly one call: `classify_prop` OR `exclude_prop`.
92
92
  - Every slot must produce exactly one `classify_slot` call.
93
93
  - Emit `classify_component` once at the start (required). The `description` field is **required** — always provide a brief description of the component's purpose.
94
- - `values` is required for `cdf_type: "enum"` — must be a non-empty string array of the variant names the prop accepts.
94
+ - `values` is required for `cdf_type: "enum"` — must be a non-empty string array of the variant names the prop accepts. **There is no legal `enum` with a guessed list.** If the value set is shown to you anywhere in the material below — the type's own declaration, an `allowedValues` list on the raw prop, a variant/lookup map, a default, a sibling excerpt — copy it and emit `enum`. If it is shown nowhere, emit `cdf_type: "string"` and leave `values` off. `string` is an unrestricted enum: the author can still pass the real value. A guessed list silently rejects it.
95
95
  - **Do NOT include `values` for `cdf_type: "token"`.** The two property types carry different kinds of list. An `enum` prop's list holds *variant names* the component accepts (`"primary"`, `"secondary"`). A `token` prop's list holds *design token paths* (`"color.brand.primary"`), produced by the separate token-mapping step (`$token.allowed`) — never by you. Emitting `values` on a token prop makes the definition invalid.
96
96
  - `token_kind` is required for `cdf_type: "token"` — must be a DTCG `$type` string, e.g. `"color"`.
97
97
  - `required` must be a JSON boolean (`true`/`false`), not a string.
@@ -208,12 +208,14 @@ the default "could be overridden" (every default can), or because the tie-break
208
208
  below exists. Nothing downstream re-derives, corrects, or second-guesses this —
209
209
  what you emit is what ships.
210
210
 
211
- **Ambiguity resolves to `enum` — but only when Q1–Q3 cannot be answered.** The
212
- tie-break applies solely when the source shown does not let you answer the three
213
- questions: the property is interpolated in one place and looked up in another,
214
- the use sits in a file you cannot see, or the source is truncated at the point
215
- of use (the "uses not shown" line). In those cases emit `enum` (or `string` when
216
- it has no value set) and record the ambiguity in `reason`. When the three
211
+ **Ambiguity resolves to `enum` — but only when Q1–Q3 cannot be answered, and only
212
+ when you can still cite its values.** The tie-break applies solely when the source
213
+ shown does not let you answer the three questions: the property is interpolated
214
+ in one place and looked up in another, the use sits in a file you cannot see, or
215
+ the source is truncated at the point of use (the "uses not shown" line). In those
216
+ cases emit `enum` if a value set is citable from the source shown, else `cdf_type:
217
+ "string"` per "no legal `enum` with a guessed list" — either way, record the
218
+ ambiguity in `reason`. When the three
217
219
  questions *can* be answered from the source shown, they are answered and the
218
220
  tie-break does not apply: a clear Q1-yes is `enum`, a clear Q2-yes + Q3-yes is
219
221
  `token`, and a type annotation does not create ambiguity. An `enum` is delivered
@@ -297,7 +299,7 @@ A prop with a complex TypeScript type is **not automatically excluded**. Many pr
297
299
  | Raw type pattern | How to resolve |
298
300
  |---|---|
299
301
  | `'primary' \| 'secondary' \| 'ghost'` (union of literals) | → `enum`, extract `values` |
300
- | `HeadingSize` / `ButtonVariant` / any named type that is clearly a finite set of visual options | → `enum`. **Never invent a value list.** Use only values you can cite from the source shown (the type's own declaration, a lookup table, a default). If the source shown does not enumerate the values, this is the "cannot be answered" case — apply "Ambiguity resolves to `enum`": emit `enum` (or `string` if it has no discoverable value set) and record the missing evidence in `description` (not `reason` — `description` ships to the CDF, `reason` does not), e.g. `"WARNING: values not visible in source — enum values unconfirmed"`. Do not default to a generic guess like `['sm', 'md', 'lg']` or `['primary', 'secondary']` — those are one design system's vocabulary, not a fallback for missing evidence. |
302
+ | `HeadingSize` / `ButtonVariant` / any named type that is clearly a finite set of visual options | → `enum` if you can cite its values from the source shown (the type's own declaration, a lookup table, a default) — copy them, never invent them. If the source shown does not enumerate the values, this is not the Q1–Q3 ambiguity tie-break — it is the "no legal `enum` with a guessed list" rule: emit `cdf_type: "string"` instead, with the missing evidence noted in `reason`. Do not default to a generic guess like `['sm', 'md', 'lg']` or `['primary', 'secondary']` — those are one design system's vocabulary, not a fallback for missing evidence. |
301
303
  | `Variant` / `variant` prop | Usually a visual design variant. → `enum`, `cdf_category: "design"`. Same evidence rule as above — cite values from the source shown; do not invent them. |
302
304
  | `Section[]` / array of custom items where the structure is unclear | → `exclude_prop` only if the array elements are complex objects with no obvious flat representation. If items are simple (title, label, id), consider representing as `string` (a comma-separated IDs or keys) or note in `description` why. |
303
305
  | `ExperienceConfiguration<Variant>` / deep generic | Personalization config — → `exclude_prop`, reason: `"personalization configuration — framework internal"` |
@@ -462,14 +464,30 @@ footer is supplementary and optional
462
464
  {"tool":"classify_slot","slot":"footer","required":false,"description":"Optional footer area for actions or metadata","rationale":"Footer is a supplementary region typically used for actions or metadata. Optional because most cards do not need one and the card renders correctly without it."}
463
465
  ```
464
466
 
465
- ### Named type (HeadingSize, ButtonVariant, etc.)
467
+ ### Named type (HeadingSize, ButtonVariant, etc.) — do NOT infer the values
466
468
 
467
- When a prop has a named TypeScript type that is not inlined as a union literal, reason from the prop name and type name to infer the finite value set.
469
+ When a prop has a named TypeScript type that is not inlined as a union literal,
470
+ the value set is whatever that type's declaration says. A type *name* is not
471
+ evidence of its members: `HeadingSize` could be `h1`–`h6`, `sm|md|lg`, or
472
+ `s|m|l|xl`. Guessing picks one design system's vocabulary and is wrong more
473
+ often than it is right, and a wrong name matches no style rule — the author's
474
+ setting silently does nothing.
468
475
 
476
+ So: look for the declaration in the source shown. If it is there, copy it. If it
477
+ is not, **emit `string`** — `string` is an unrestricted enum, so the author stays
478
+ unrestricted but correct.
479
+
480
+ Members visible in the source shown — copy them, do not paraphrase:
481
+ ```
482
+ titleSize has type HeadingSize; HeadingSize is declared in the excerpt as 'sm' | 'md' | 'lg'
483
+ {"tool":"classify_prop","prop":"titleSize","cdf_type":"enum","cdf_category":"design","required":false,"values":["sm","md","lg"],"description":"Heading size","reason":"Copied from the HeadingSize declaration shown in the excerpt."}
484
+ ```
485
+
486
+ Members NOT visible in the source shown — degrade to `string`:
469
487
  ```
470
- titleSize has type HeadingSize — this is a named enum controlling heading size
471
- inferring likely values: ["h1", "h2", "h3", "h4", "h5", "h6"] — documenting inference
472
- {"tool":"classify_prop","prop":"titleSize","cdf_type":"enum","cdf_category":"design","required":false,"values":["h1","h2","h3","h4","h5","h6"],"description":"Heading level — inferred from HeadingSize type name; actual values may be h1–h6 or sm/md/lg"}
488
+ titleSize has type HeadingSize; HeadingSize is not declared anywhere in the source shown
489
+ no evidence for its members, so no values list — string, not a guess
490
+ {"tool":"classify_prop","prop":"titleSize","cdf_type":"string","cdf_category":"design","required":false,"description":"Heading size","reason":"HeadingSize is not declared in the source shown, so its members cannot be cited. Emitted as string rather than inventing a value list."}
473
491
  ```
474
492
 
475
493
  ### href prop
@@ -495,7 +513,7 @@ Before emitting any tool calls, verify:
495
513
  1. Every prop in the input has exactly one `classify_prop` or `exclude_prop` call
496
514
  2. Every slot has exactly one `classify_slot` call
497
515
  3. `classify_component` is emitted exactly once
498
- 4. Every `cdf_type: "enum"` has a non-empty `values` array
516
+ 4. Every `cdf_type: "enum"` has a non-empty `values` array taken from the material shown. A prop whose value set was shown nowhere is `cdf_type: "string"` with no `values` — never an `enum` with a plausible-looking list, and never an `exclude_prop`.
499
517
  5. Every `cdf_type: "token"` has `token_kind` (or a warning in `description` if lookup failed) and does **not** have `values` set
500
518
  6. No `cdf_type: "link"` — all href/url props use `string`
501
519
  7. `required` values are JSON booleans, not strings
@@ -507,7 +525,7 @@ Before emitting any tool calls, verify:
507
525
  13. `rationale.description` follows the same "Description content rules" as `description` — no internal initiative names (`INTEG-*`, `EDSI`, `DSI`, `M1`, `M2`, wave/phase references, etc.).
508
526
  14. Every `cdf_type: "token"` prop cites a line that interpolates its value into a style **and** a token reference at that use (Q2 yes, Q3 yes), and carries no `values`. If you cannot cite both, it is `enum` or `string`; if you can, it is `token` — its type annotation is not a reason to emit `string`.
509
527
  15. Every prop whose values are friendly names is `enum` with a non-empty `values` array, even when each name resolves to a design token internally; every prop for which Q1–Q3 could not be answered was emitted as `enum` (or `string`) with the ambiguity stated in `reason`, and no answerable prop was called ambiguous.
510
- 16. Every `enum`'s `values` array is copied from evidence in the source shown (a type declaration, lookup table, or default) — none of it was invented. Where no evidence exists for the values, the `description` states so (e.g. `"WARNING: values not visible in source"`), not just `reason`.
528
+ 16. Every `enum`'s `values` array is copied from evidence in the material shown — a type declaration, an `allowedValues` list on the raw prop, a variant or lookup map, a default, in the component's own file or in any sibling excerpt — and none of it was invented. Where the value set appears nowhere, the prop is `cdf_type: "string"`, with the reason recorded in `reason`. Do not drop a prop merely because you could not enumerate its values.
511
529
 
512
530
  After the run completes, the developer can validate the pipeline output with:
513
531
 
@@ -528,4 +546,6 @@ properties — this is never acceptable.
528
546
  If you are genuinely uncertain about every prop, classify each as:
529
547
  {"tool":"classify_prop","prop":"<name>","cdf_type":"string","cdf_category":"content","required":false,"description":"Uncertain classification — review recommended"}
530
548
 
531
- An imperfect classification is infinitely better than no classification.
549
+ An imperfect classification is infinitely better than no classification. That is
550
+ about **classifying a prop rather than dropping it** — it is not a licence to
551
+ invent a `values` list. The uncertain answer is `cdf_type: "string"`, every time.