@contentful/experience-design-system-cli 2.15.2-dev-build-0e302c8.0 → 2.15.2-dev-build-a2c2d9e.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-cli",
3
- "version": "2.15.2-dev-build-0e302c8.0",
3
+ "version": "2.15.2-dev-build-a2c2d9e.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,6 +2,7 @@ import { createElement } from 'react';
2
2
  import { render } from 'ink';
3
3
  import { mkdir, readdir, readFile, stat, writeFile } from 'node:fs/promises';
4
4
  import { isAbsolute, join, relative, resolve } from 'node:path';
5
+ import { addAgentModelOptions } from '../lib/agent-model-options.js';
5
6
  import { extractComponents, preClassifyComponent, isNonAuthorableComponent, computeExtractionScore, deriveNeedsReview, describeReviewReasons, inspectComponentSource, validateExtractedComponents, } from '@contentful/experience-design-system-extraction';
6
7
  import { AnalyzeView } from './tui/AnalyzeView.js';
7
8
  import { registerAnalyzeEditCommand } from './select/command.js';
@@ -165,7 +166,7 @@ export function registerAnalyzeCommand(program) {
165
166
  const analyze = program
166
167
  .command('analyze')
167
168
  .description('Extract component definitions from a project, or correct analysis output');
168
- analyze
169
+ const extractCmd = analyze
169
170
  .command('extract')
170
171
  .description('Extract component definitions from a project')
171
172
  .requiredOption('--project <path>', 'Path to the project root')
@@ -177,8 +178,11 @@ export function registerAnalyzeCommand(program) {
177
178
  .option('--composition-agent', 'Opt into agentic mapping resolution when deterministic sources find no groups (implies --composite)')
178
179
  .option('--composition-refresh', 'Force the mapping agent to run even where deterministic sources answered (implies --composite)')
179
180
  .option('--generate-map <path>', 'Write a skeleton interchange map from resolved composition (implies --composite)')
180
- .option('--prompt <stage=value>', 'Override a stage prompt (repeatable). value is a file path or literal text, e.g. --prompt composition=./p.md', (v, acc) => [...acc, v], [])
181
- .option('--agent <name>', 'Coding agent for composition mapping resolution (claude|codex|opencode|cursor)')
181
+ .option('--prompt <stage=value>', 'Override a stage prompt (repeatable). value is a file path or literal text, e.g. --prompt composition=./p.md', (v, acc) => [...acc, v], []);
182
+ addAgentModelOptions(extractCmd, {
183
+ includeModel: false,
184
+ agentDescription: 'Coding agent for composition mapping resolution (claude|codex|opencode|cursor)',
185
+ })
182
186
  .option('--composition-agent-mode <mode>', "Agent resolution mode: 'parser' (agent writes a sandboxed parser — deterministic, default) or 'edges' (agent lists edges directly)", 'parser')
183
187
  .action(async (opts) => {
184
188
  const resolveUnreachable = (() => {
@@ -1,3 +1,4 @@
1
+ import { addAgentModelOptions } from '../../lib/agent-model-options.js';
1
2
  import { openPipelineDb, loadRawComponents, loadScannedFiles, createStep, updateStep, computeComponentInputHash, lookupSelectCache, storeSelectCache, getCliCacheVersion, } from '../../session/db.js';
2
3
  import { hashPromptForSkill } from '../../session/cache-keys.js';
3
4
  import { appendReviewEvent, getRefineArtifactsRoot, ensureRefineSession, getRefineSessionPaths, saveReviewState, } from '../select/persistence.js';
@@ -300,13 +301,12 @@ async function selectAllComponents(agent, model, components, verbose, skillPathO
300
301
  return results;
301
302
  }
302
303
  export function registerAnalyzeSelectAgentCommand(program) {
303
- program
304
+ const cmd = program
304
305
  .command('select-agent')
305
306
  .description('Use an AI agent to select components for Contentful Experience Orchestration')
306
307
  .option('--session <id>', 'Session ID from analyze extract (defaults to most recent)')
307
- .option('--project-root <path>', 'Project root for resolving component source files')
308
- .option('--agent <name>', 'Agent to use: claude, codex, opencode, cursor (defaults to value saved by experiences setup)')
309
- .option('--model <name>', 'Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)')
308
+ .option('--project-root <path>', 'Project root for resolving component source files');
309
+ addAgentModelOptions(cmd)
310
310
  .option('--verbose', 'Show full agent output including reasoning text')
311
311
  .option('--dry-run', 'Print the prompt for the first component without invoking the agent')
312
312
  .option('--exclude-invalid', 'Auto-reject components with validation errors instead of failing loud (LLM cannot fix structural issues)')
@@ -14,6 +14,7 @@ import { openPipelineDb, loadRawComponents, applyToolCalls, applyTokenToolCalls,
14
14
  import { hashPromptForSkill } from '../session/cache-keys.js';
15
15
  import { getRefineArtifactsRoot, getRefineSessionPaths } from '../analyze/select/persistence.js';
16
16
  import { readExperiencesCredentials } from '../credentials-store.js';
17
+ import { addAgentModelOptions } from '../lib/agent-model-options.js';
17
18
  const execFileAsync = promisify(execFile);
18
19
  const VALID_AGENTS = new Set(['claude', 'codex', 'opencode', 'cursor']);
19
20
  const DEFAULT_TIMEOUT_MS = Number(process.env.EDS_AGENT_TIMEOUT_MS ?? 3 * 60 * 1000);
@@ -568,9 +569,7 @@ async function runGenerateSkill(skill, opts, verbose = false) {
568
569
  }
569
570
  }
570
571
  function addAgentFlags(cmd) {
571
- return cmd
572
- .option('--agent <name>', 'Agent to use: claude, codex, opencode, cursor (defaults to value saved by experiences setup)')
573
- .option('--model <name>', 'Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)')
572
+ return addAgentModelOptions(cmd)
574
573
  .option('--verbose', 'Show full agent output including reasoning text')
575
574
  .option('--dry-run', 'Print the prompt without invoking the agent')
576
575
  .option('--no-cache', 'Bypass ALL fine-grained caches (extract, select, generate) and force AI re-run. ' +
@@ -2,6 +2,7 @@ import { resolve, join } from 'node:path';
2
2
  import { runPipeline } from './orchestrator.js';
3
3
  import { resolveAutoFilter } from './auto-filter-resolve.js';
4
4
  import { resolveAgent, resolveModel } from './agent-model-resolve.js';
5
+ import { addAgentModelOptions } from '../lib/agent-model-options.js';
5
6
  import { resolveCompositionMode } from '../lib/composition-mode.js';
6
7
  import { readExperiencesCredentials } from '../credentials-store.js';
7
8
  import { DEFAULT_CONFIGURED_HOST, toConfiguredHost } from '../host-utils.js';
@@ -11,16 +12,18 @@ import { resolvePromptFlags } from './print-prompt.js';
11
12
  import { shouldShowRunPicker } from '../runs/run-picker-mount.js';
12
13
  import { dispatchPickerSelection } from './picker-dispatch.js';
13
14
  export function registerImportCommand(program) {
14
- program
15
+ const cmd = program
15
16
  .command('import')
16
17
  .description('Run the full pipeline: analyze → select → generate → push')
17
18
  .option('--space-id <id>', 'Contentful space ID (required unless --skip-apply)')
18
19
  .option('--environment-id <id>', 'Contentful environment ID (required unless --skip-apply)')
19
20
  .option('--cma-token <token>', 'CMA personal access token (or set CONTENTFUL_MANAGEMENT_TOKEN)')
20
21
  .option('--project <path>', 'Path to the project root to analyze', '.')
21
- .option('--out <path>', 'Output directory for pipeline artifacts')
22
- .option('--agent <name>', 'Agent to use for generate components (overrides credentials.json; falls back to "claude")')
23
- .option('--model <name>', 'Model to use for generate components (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)')
22
+ .option('--out <path>', 'Output directory for pipeline artifacts');
23
+ addAgentModelOptions(cmd, {
24
+ agentDescription: 'Agent to use for generate components (overrides credentials.json; falls back to "claude")',
25
+ modelDescription: 'Model to use for generate components (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)',
26
+ })
24
27
  .option('--tokens <path>', 'Path to a DTCG tokens.json file to push alongside generated components')
25
28
  .option('--raw-tokens <path>', 'Path to a raw token source file (SCSS, CSS variables, JS/TS, Style Dictionary, etc.) to classify and import alongside components. Bypasses the interactive token prompt.')
26
29
  .option('--select-all', 'Select all extracted components for generation (default)')
@@ -0,0 +1,13 @@
1
+ import type { Command } from 'commander';
2
+ export declare const AGENT_DESCRIPTION = "Agent to use: claude, codex, opencode, cursor (defaults to value saved by experiences setup)";
3
+ export declare const MODEL_DESCRIPTION = "Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)";
4
+ export interface AgentModelOptionsConfig {
5
+ agentDescription?: string;
6
+ includeModel?: boolean;
7
+ modelDescription?: string;
8
+ }
9
+ /**
10
+ * Register --agent and optionally --model flags to a Commander command, with customizable descriptions.
11
+ * Pass `includeModel: false` for commands where the model dimension is not applicable (e.g., mapping-resolution agents that select an agent for logic, not model choice).
12
+ */
13
+ export declare function addAgentModelOptions(cmd: Command, config?: AgentModelOptionsConfig): Command;
@@ -0,0 +1,14 @@
1
+ export const AGENT_DESCRIPTION = 'Agent to use: claude, codex, opencode, cursor (defaults to value saved by experiences setup)';
2
+ export const MODEL_DESCRIPTION = 'Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)';
3
+ /**
4
+ * Register --agent and optionally --model flags to a Commander command, with customizable descriptions.
5
+ * Pass `includeModel: false` for commands where the model dimension is not applicable (e.g., mapping-resolution agents that select an agent for logic, not model choice).
6
+ */
7
+ export function addAgentModelOptions(cmd, config = {}) {
8
+ const { agentDescription = AGENT_DESCRIPTION, includeModel = true, modelDescription = MODEL_DESCRIPTION } = config;
9
+ cmd.option('--agent <name>', agentDescription);
10
+ if (includeModel) {
11
+ cmd.option('--model <name>', modelDescription);
12
+ }
13
+ return cmd;
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.15.2-dev-build-0e302c8.0",
3
+ "version": "2.15.2-dev-build-a2c2d9e.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,8 +34,8 @@
34
34
  "react": "^18.3.1",
35
35
  "react-devtools-core": "^4.19.1",
36
36
  "react-dom": "^18.3.1",
37
- "@contentful/experience-design-system-extraction": "2.15.2-dev-build-0e302c8.0",
38
- "@contentful/experience-design-system-types": "2.15.2-dev-build-0e302c8.0"
37
+ "@contentful/experience-design-system-types": "2.15.2-dev-build-a2c2d9e.0",
38
+ "@contentful/experience-design-system-extraction": "2.15.2-dev-build-a2c2d9e.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@tsconfig/node24": "^24.0.3",