@contentful/experience-design-system-generation 2.30.1-dev-build-87c8cf1.0 → 2.30.1-dev-build-6f93a80.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.30.1-dev-build-
|
|
3
|
+
"version": "2.30.1-dev-build-6f93a80.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",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const AGENT_NAMES: readonly ["claude", "codex", "opencode", "cursor"];
|
|
1
|
+
export declare const AGENT_NAMES: readonly ["claude", "codex", "opencode", "cursor", "copilot"];
|
|
2
2
|
export type AgentName = (typeof AGENT_NAMES)[number];
|
|
3
3
|
export declare const DEFAULT_AGENT_NAME: AgentName;
|
|
4
4
|
export declare function isAgentName(value: string): value is AgentName;
|
package/dist/src/agent-names.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const AGENT_NAMES = ['claude', 'codex', 'opencode', 'cursor'];
|
|
1
|
+
export const AGENT_NAMES = ['claude', 'codex', 'opencode', 'cursor', 'copilot'];
|
|
2
2
|
export const DEFAULT_AGENT_NAME = 'claude';
|
|
3
3
|
export function isAgentName(value) {
|
|
4
4
|
return AGENT_NAMES.includes(value);
|
package/dist/src/agent-runner.js
CHANGED
|
@@ -271,6 +271,7 @@ const AGENT_BINARIES = {
|
|
|
271
271
|
codex: 'codex',
|
|
272
272
|
opencode: 'opencode',
|
|
273
273
|
cursor: 'cursor-agent',
|
|
274
|
+
copilot: 'copilot',
|
|
274
275
|
};
|
|
275
276
|
export function resolveBinary(agent) {
|
|
276
277
|
const envKey = `EDS_AGENT_BINARY_${agent.toUpperCase()}`;
|
|
@@ -289,6 +290,7 @@ const DEFAULT_MODELS = {
|
|
|
289
290
|
codex: 'gpt-5.4-mini', // requires OPENAI_API_KEY; ChatGPT account users must pass --model
|
|
290
291
|
opencode: 'claude-haiku-4-5',
|
|
291
292
|
cursor: 'gpt-mini', // cursor alias for gpt-5.4-mini-medium; haiku not in cursor's catalog
|
|
293
|
+
copilot: 'Auto', // the only model guaranteed on every Copilot plan (Free/Pro/Business/Enterprise); Pro+ users override via EDS_AGENT_MODEL_COPILOT
|
|
292
294
|
};
|
|
293
295
|
/**
|
|
294
296
|
* Resolve the model for an agent. Explicit flag/creds value wins, then a
|
|
@@ -321,6 +323,25 @@ export function buildArgs(agent, prompt, model, promptViaStdin = false) {
|
|
|
321
323
|
case 'cursor':
|
|
322
324
|
// cursor-agent uses --print for non-interactive stdout output
|
|
323
325
|
return ['--print', ...modelArg, ...promptArg];
|
|
326
|
+
case 'copilot': {
|
|
327
|
+
// copilot's -p takes the prompt as its value — it MUST come immediately
|
|
328
|
+
// after -p or the CLI rejects with "Invalid command format".
|
|
329
|
+
// --allow-all-tools mirrors codex's sandbox bypass for non-interactive
|
|
330
|
+
// use.
|
|
331
|
+
//
|
|
332
|
+
// Model handling is special: copilot's UI shows "Auto" as the default
|
|
333
|
+
// pick, but the CLI rejects --model Auto ("not available"). Auto is a
|
|
334
|
+
// UI-only label — internally, omitting --model IS Auto. So we only
|
|
335
|
+
// pass --model when the user set an explicit override (via flag or
|
|
336
|
+
// EDS_AGENT_MODEL_COPILOT); the sentinel string 'Auto' means "omit".
|
|
337
|
+
//
|
|
338
|
+
// Stdin fallback is unsupported: copilot -p requires an inline prompt
|
|
339
|
+
// value, so promptViaStdin will fail here — callers must pass the
|
|
340
|
+
// prompt inline for copilot.
|
|
341
|
+
const copilotModel = resolveAgentModel('copilot', model);
|
|
342
|
+
const copilotModelArg = copilotModel === 'Auto' ? [] : ['--model', copilotModel];
|
|
343
|
+
return ['-p', ...promptArg, ...copilotModelArg, '--allow-all-tools'];
|
|
344
|
+
}
|
|
324
345
|
}
|
|
325
346
|
}
|
|
326
347
|
export async function runAgent(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-generation",
|
|
3
|
-
"version": "2.30.1-dev-build-
|
|
3
|
+
"version": "2.30.1-dev-build-6f93a80.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.30.1-dev-build-
|
|
25
|
+
"@contentful/experience-design-system-types": "2.30.1-dev-build-6f93a80.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.
|
|
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,14 +208,12 @@ 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
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
"string"` per "no legal `enum` with a guessed list" — either way, record the
|
|
218
|
-
ambiguity in `reason`. When the three
|
|
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
|
|
219
217
|
questions *can* be answered from the source shown, they are answered and the
|
|
220
218
|
tie-break does not apply: a clear Q1-yes is `enum`, a clear Q2-yes + Q3-yes is
|
|
221
219
|
`token`, and a type annotation does not create ambiguity. An `enum` is delivered
|
|
@@ -299,7 +297,7 @@ A prop with a complex TypeScript type is **not automatically excluded**. Many pr
|
|
|
299
297
|
| Raw type pattern | How to resolve |
|
|
300
298
|
|---|---|
|
|
301
299
|
| `'primary' \| 'secondary' \| 'ghost'` (union of literals) | → `enum`, extract `values` |
|
|
302
|
-
| `HeadingSize` / `ButtonVariant` / any named type that is clearly a finite set of visual options | → `enum
|
|
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. |
|
|
303
301
|
| `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. |
|
|
304
302
|
| `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. |
|
|
305
303
|
| `ExperienceConfiguration<Variant>` / deep generic | Personalization config — → `exclude_prop`, reason: `"personalization configuration — framework internal"` |
|
|
@@ -464,30 +462,14 @@ footer is supplementary and optional
|
|
|
464
462
|
{"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."}
|
|
465
463
|
```
|
|
466
464
|
|
|
467
|
-
### Named type (HeadingSize, ButtonVariant, etc.)
|
|
465
|
+
### Named type (HeadingSize, ButtonVariant, etc.)
|
|
468
466
|
|
|
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.
|
|
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.
|
|
475
468
|
|
|
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`:
|
|
487
469
|
```
|
|
488
|
-
titleSize has type HeadingSize
|
|
489
|
-
|
|
490
|
-
{"tool":"classify_prop","prop":"titleSize","cdf_type":"
|
|
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"}
|
|
491
473
|
```
|
|
492
474
|
|
|
493
475
|
### href prop
|
|
@@ -513,7 +495,7 @@ Before emitting any tool calls, verify:
|
|
|
513
495
|
1. Every prop in the input has exactly one `classify_prop` or `exclude_prop` call
|
|
514
496
|
2. Every slot has exactly one `classify_slot` call
|
|
515
497
|
3. `classify_component` is emitted exactly once
|
|
516
|
-
4. Every `cdf_type: "enum"` has a non-empty `values` array
|
|
498
|
+
4. Every `cdf_type: "enum"` has a non-empty `values` array
|
|
517
499
|
5. Every `cdf_type: "token"` has `token_kind` (or a warning in `description` if lookup failed) and does **not** have `values` set
|
|
518
500
|
6. No `cdf_type: "link"` — all href/url props use `string`
|
|
519
501
|
7. `required` values are JSON booleans, not strings
|
|
@@ -525,7 +507,7 @@ Before emitting any tool calls, verify:
|
|
|
525
507
|
13. `rationale.description` follows the same "Description content rules" as `description` — no internal initiative names (`INTEG-*`, `EDSI`, `DSI`, `M1`, `M2`, wave/phase references, etc.).
|
|
526
508
|
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`.
|
|
527
509
|
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.
|
|
528
|
-
16. Every `enum`'s `values` array is copied from evidence in the
|
|
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`.
|
|
529
511
|
|
|
530
512
|
After the run completes, the developer can validate the pipeline output with:
|
|
531
513
|
|
|
@@ -546,6 +528,4 @@ properties — this is never acceptable.
|
|
|
546
528
|
If you are genuinely uncertain about every prop, classify each as:
|
|
547
529
|
{"tool":"classify_prop","prop":"<name>","cdf_type":"string","cdf_category":"content","required":false,"description":"Uncertain classification — review recommended"}
|
|
548
530
|
|
|
549
|
-
An imperfect classification is infinitely better than no classification.
|
|
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.
|
|
531
|
+
An imperfect classification is infinitely better than no classification.
|