@contentful/experience-design-system-cli 2.27.1-dev-build-fd316dc.0 → 2.27.1-dev-build-c0edf3e.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.27.1-dev-build-fd316dc.0",
3
+ "version": "2.27.1-dev-build-c0edf3e.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -7,7 +7,6 @@ export interface PipelineOptions {
7
7
  cmaToken?: string;
8
8
  agent: string;
9
9
  model?: string;
10
- bedrock?: boolean;
11
10
  skipAnalyze: boolean;
12
11
  skipGenerate: boolean;
13
12
  print: boolean;
@@ -7,7 +7,6 @@ export declare function buildSelectAgentArgs(opts: {
7
7
  sessionId: string;
8
8
  agent: string;
9
9
  model?: string;
10
- bedrock?: boolean;
11
10
  selectPromptPath?: string;
12
11
  noCache?: boolean;
13
12
  }): string[];
@@ -24,7 +23,6 @@ export declare function buildGenerateComponentsArgs(opts: {
24
23
  tokensPath?: string;
25
24
  agent: string;
26
25
  model?: string;
27
- bedrock?: boolean;
28
26
  noCache?: boolean;
29
27
  generatePromptPath?: string;
30
28
  }): string[];
@@ -40,7 +38,6 @@ export type WizardAppProps = {
40
38
  initialHost?: string;
41
39
  initialAgent?: string;
42
40
  initialModel?: string;
43
- bedrock?: boolean;
44
41
  initialProjectPath?: string;
45
42
  host?: string;
46
43
  autoAcceptScope?: boolean;
@@ -71,4 +68,4 @@ export type WizardAppProps = {
71
68
  onRunPicked?: (selection: RunPickerSelection) => void;
72
69
  allowDeletions?: boolean;
73
70
  };
74
- export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, bedrock, initialProjectPath, host, autoAcceptScope, autoRejectCycles, compositionMode, compositionMap, compositionAgent, compositionAgentMode, compositionRefresh, generateMap, promptOverrides, noCache, autoFilter, livePreview, noPush, noSave, outDirOverride, onConflictMode, selectPromptPath, generatePromptPath, seedExtractSessionId, seedGenerateSessionId, seedTokenSessionId, seedTokensPath, initialStep, initialRawTokensPath, initialRuns, onRunPicked, allowDeletions, }?: WizardAppProps): React.ReactElement;
71
+ export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, initialProjectPath, host, autoAcceptScope, autoRejectCycles, compositionMode, compositionMap, compositionAgent, compositionAgentMode, compositionRefresh, generateMap, promptOverrides, noCache, autoFilter, livePreview, noPush, noSave, outDirOverride, onConflictMode, selectPromptPath, generatePromptPath, seedExtractSessionId, seedGenerateSessionId, seedTokenSessionId, seedTokensPath, initialStep, initialRawTokensPath, initialRuns, onRunPicked, allowDeletions, }?: WizardAppProps): React.ReactElement;
package/dist/src/index.js CHANGED
@@ -231,9 +231,6 @@ function resolveBinary(agent) {
231
231
  return override.trim();
232
232
  return AGENT_BINARIES[agent];
233
233
  }
234
- function agentSupportsBedrock(agent) {
235
- return agent in BEDROCK_ENV_BY_AGENT;
236
- }
237
234
  function resolveAgentModel(agent, explicit) {
238
235
  if (explicit && explicit.trim())
239
236
  return explicit.trim();
@@ -257,7 +254,7 @@ function buildArgs(agent, prompt2, model, promptViaStdin = false) {
257
254
  }
258
255
  }
259
256
  async function runAgent(options) {
260
- const { agent, prompt: prompt2, timeoutMs, model, bedrock, onOutput, promptViaStdin, onDebugEvent } = options;
257
+ const { agent, prompt: prompt2, timeoutMs, model, onOutput, promptViaStdin, onDebugEvent } = options;
261
258
  const binary = resolveBinary(agent);
262
259
  const useStdin2 = !!promptViaStdin;
263
260
  const args = buildArgs(agent, prompt2, model, useStdin2);
@@ -266,16 +263,13 @@ async function runAgent(options) {
266
263
  agent,
267
264
  binary,
268
265
  model,
269
- bedrock: !!bedrock,
270
266
  timeoutMs,
271
267
  promptLen: prompt2.length,
272
268
  promptHead: prompt2.slice(0, 500)
273
269
  });
274
270
  return new Promise((resolve27) => {
275
- const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
276
271
  const child = spawn(binary, args, {
277
- stdio: ["pipe", "pipe", "pipe"],
278
- ...bedrockEnv ? { env: { ...process.env, ...bedrockEnv } } : {}
272
+ stdio: ["pipe", "pipe", "pipe"]
279
273
  });
280
274
  if (useStdin2 && child.stdin) {
281
275
  child.stdin.on("error", () => {
@@ -393,7 +387,7 @@ function extractSentinelOutput(stdout) {
393
387
  return "multiple";
394
388
  return stdout.slice(startIdx + START.length, endIdx).trim();
395
389
  }
396
- var VALID_SELECT_TOOL_NAMES, VALID_TOOL_NAMES, VALID_TOKEN_TOOL_NAMES, VALID_CDF_TYPES, VALID_CATEGORIES, AGENT_BINARIES, BEDROCK_ENV_BY_AGENT, DEFAULT_MODELS;
390
+ var VALID_SELECT_TOOL_NAMES, VALID_TOOL_NAMES, VALID_TOKEN_TOOL_NAMES, VALID_CDF_TYPES, VALID_CATEGORIES, AGENT_BINARIES, DEFAULT_MODELS;
397
391
  var init_agent_runner = __esm({
398
392
  "packages/experience-design-system-generation/dist/src/agent-runner.js"() {
399
393
  "use strict";
@@ -409,9 +403,6 @@ var init_agent_runner = __esm({
409
403
  opencode: "opencode",
410
404
  cursor: "cursor-agent"
411
405
  };
412
- BEDROCK_ENV_BY_AGENT = {
413
- claude: { CLAUDE_CODE_USE_BEDROCK: "1" }
414
- };
415
406
  DEFAULT_MODELS = {
416
407
  claude: "haiku",
417
408
  codex: "gpt-5.4-mini",
@@ -680,7 +671,6 @@ var src_exports = {};
680
671
  __export(src_exports, {
681
672
  AGENT_NAMES: () => AGENT_NAMES,
682
673
  DEFAULT_AGENT_NAME: () => DEFAULT_AGENT_NAME,
683
- agentSupportsBedrock: () => agentSupportsBedrock,
684
674
  buildArgs: () => buildArgs,
685
675
  buildPrompt: () => buildPrompt,
686
676
  checkAgentAuth: () => checkAgentAuth,
@@ -21765,8 +21755,7 @@ function PropRow({
21765
21755
  ] }),
21766
21756
  /* @__PURE__ */ jsx44(Text43, { dimColor: !selected, children: "type:" }),
21767
21757
  activeField === "type" ? /* @__PURE__ */ jsx44(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx44(Text43, { color: selected ? PALETTE.warning : PALETTE.inverse, children: prop.type }),
21768
- /* @__PURE__ */ jsx44(Text43, { dimColor: !selected, children: "cat:" }),
21769
- activeField === "category" ? /* @__PURE__ */ jsx44(Picker, { value: prop.category, active: true }) : /* @__PURE__ */ jsx44(Text43, { color: selected ? PALETTE.info : PALETTE.inverse, children: prop.category }),
21758
+ activeField === "category" && /* @__PURE__ */ jsx44(Picker, { value: prop.category, active: true }),
21770
21759
  /* @__PURE__ */ jsx44(Text43, { dimColor: !selected, children: "req:" }),
21771
21760
  activeField === "required" ? /* @__PURE__ */ jsx44(Toggle, { value: prop.required, active: true }) : /* @__PURE__ */ jsx44(Toggle, { value: prop.required, active: false }),
21772
21761
  prop.type === "token" && /* @__PURE__ */ jsxs43(Fragment12, { children: [
@@ -22099,13 +22088,58 @@ function FieldEditor({
22099
22088
  const [showHelp, setShowHelp] = useState23(false);
22100
22089
  const props = editorState.props;
22101
22090
  const slots = editorState.slots;
22102
- const visiblePropIndexes = React23.useMemo(
22103
- () => props.flatMap(
22104
- (prop, index) => showHiddenProps || prop.category !== "state" && prop.category !== "unattached" ? [index] : []
22105
- ),
22091
+ const contentPropIndexes = React23.useMemo(
22092
+ () => props.flatMap((prop, index) => prop.category === "content" ? [index] : []),
22093
+ [props]
22094
+ );
22095
+ const designPropIndexes = React23.useMemo(
22096
+ () => props.flatMap((prop, index) => prop.category === "design" ? [index] : []),
22097
+ [props]
22098
+ );
22099
+ const hiddenPropIndexes = React23.useMemo(
22100
+ () => showHiddenProps ? props.flatMap((prop, index) => prop.category === "state" || prop.category === "unattached" ? [index] : []) : [],
22106
22101
  [props, showHiddenProps]
22107
22102
  );
22103
+ const visiblePropIndexes = React23.useMemo(
22104
+ () => [...contentPropIndexes, ...designPropIndexes, ...hiddenPropIndexes],
22105
+ [contentPropIndexes, designPropIndexes, hiddenPropIndexes]
22106
+ );
22107
+ const propGroups = React23.useMemo(
22108
+ () => [
22109
+ { kind: "content", label: "\u2500\u2500 CONTENT PROPERTIES", indexes: contentPropIndexes },
22110
+ { kind: "design", label: "\u2500\u2500 DESIGN PROPERTIES", indexes: designPropIndexes },
22111
+ { kind: "hidden", label: "\u2500\u2500 OTHER / HIDDEN", indexes: hiddenPropIndexes }
22112
+ ],
22113
+ [contentPropIndexes, designPropIndexes, hiddenPropIndexes]
22114
+ );
22115
+ const selectableRows = React23.useMemo(
22116
+ () => [
22117
+ ...contentPropIndexes.map((idx) => ({ kind: "prop", idx })),
22118
+ ...designPropIndexes.map((idx) => ({ kind: "prop", idx })),
22119
+ ...slots.map((_, idx) => ({ kind: "slot", idx })),
22120
+ ...hiddenPropIndexes.map((idx) => ({ kind: "prop", idx }))
22121
+ ],
22122
+ [contentPropIndexes, designPropIndexes, hiddenPropIndexes, slots]
22123
+ );
22108
22124
  const visiblePropPosition = visiblePropIndexes.indexOf(propIdx);
22125
+ const selectedSelectableIndex = React23.useMemo(
22126
+ () => selectableRows.findIndex(
22127
+ (row) => inSlots ? row.kind === "slot" && row.idx === slotIdx : row.kind === "prop" && row.idx === propIdx
22128
+ ),
22129
+ [inSlots, propIdx, selectableRows, slotIdx]
22130
+ );
22131
+ const focusSelectableRow = (row) => {
22132
+ setInComponentDesc(false);
22133
+ if (row.kind === "prop") {
22134
+ setInSlots(false);
22135
+ setPropIdx(row.idx);
22136
+ setFocusLevel("prop");
22137
+ } else {
22138
+ setInSlots(true);
22139
+ setSlotIdx(row.idx);
22140
+ setFocusLevel("slot");
22141
+ }
22142
+ };
22109
22143
  const textEntryActive = focusLevel === "field" && activeField === "description" || focusLevel === "field" && activeField === "default" && (editorState.props[propIdx]?.type === "string" || editorState.props[propIdx]?.type === "token") || editingValue != null;
22110
22144
  React23.useEffect(() => {
22111
22145
  onTextEntryActiveChange?.(textEntryActive);
@@ -22326,51 +22360,13 @@ function FieldEditor({
22326
22360
  }
22327
22361
  return;
22328
22362
  }
22329
- if (focusLevel === "prop") {
22330
- if (key.upArrow || input === "k") {
22331
- if (visiblePropPosition > 0) {
22332
- setPropIdx(visiblePropIndexes[visiblePropPosition - 1]);
22333
- } else {
22334
- setFocusLevel("componentDescription");
22335
- setInSlots(false);
22336
- setInComponentDesc(true);
22337
- }
22338
- return;
22339
- }
22340
- if (key.downArrow || input === "j") {
22341
- if (visiblePropPosition >= 0 && visiblePropPosition < visiblePropIndexes.length - 1) {
22342
- setPropIdx(visiblePropIndexes[visiblePropPosition + 1]);
22343
- } else if (slots.length > 0) {
22344
- setInSlots(true);
22345
- setSlotIdx(0);
22346
- setFocusLevel("slot");
22347
- }
22348
- return;
22349
- }
22350
- if (key.return && currentProp) {
22351
- setFocusLevel("field");
22352
- setActiveField(propFields(currentProp)[0] ?? null);
22353
- setTextCursor(currentProp.description.length);
22354
- return;
22355
- }
22356
- return;
22357
- }
22358
22363
  if (focusLevel === "componentDescription") {
22359
22364
  if (key.upArrow || input === "k") {
22360
22365
  return;
22361
22366
  }
22362
22367
  if (key.downArrow || input === "j") {
22363
- if (visiblePropIndexes.length > 0) {
22364
- setFocusLevel("prop");
22365
- setPropIdx(visiblePropIndexes[0]);
22366
- setInSlots(false);
22367
- setInComponentDesc(false);
22368
- } else if (slots.length > 0) {
22369
- setFocusLevel("slot");
22370
- setSlotIdx(0);
22371
- setInSlots(true);
22372
- setInComponentDesc(false);
22373
- }
22368
+ const firstSelectableRow = selectableRows[0];
22369
+ if (firstSelectableRow) focusSelectableRow(firstSelectableRow);
22374
22370
  return;
22375
22371
  }
22376
22372
  if (key.return) {
@@ -22381,29 +22377,35 @@ function FieldEditor({
22381
22377
  }
22382
22378
  return;
22383
22379
  }
22384
- if (focusLevel === "slot") {
22380
+ if (focusLevel === "prop" || focusLevel === "slot") {
22385
22381
  if (key.upArrow || input === "k") {
22386
- if (slotIdx > 0) {
22387
- setSlotIdx(slotIdx - 1);
22388
- } else if (visiblePropIndexes.length > 0) {
22382
+ if (selectedSelectableIndex > 0) {
22383
+ focusSelectableRow(selectableRows[selectedSelectableIndex - 1]);
22384
+ } else if (selectedSelectableIndex === 0) {
22385
+ setFocusLevel("componentDescription");
22389
22386
  setInSlots(false);
22390
- setPropIdx(visiblePropIndexes[visiblePropIndexes.length - 1]);
22391
- setFocusLevel("prop");
22387
+ setInComponentDesc(true);
22392
22388
  }
22393
22389
  return;
22394
22390
  }
22395
22391
  if (key.downArrow || input === "j") {
22396
- if (slotIdx < slots.length - 1) {
22397
- setSlotIdx(slotIdx + 1);
22392
+ if (selectedSelectableIndex >= 0 && selectedSelectableIndex < selectableRows.length - 1) {
22393
+ focusSelectableRow(selectableRows[selectedSelectableIndex + 1]);
22398
22394
  }
22399
22395
  return;
22400
22396
  }
22401
- if (key.return && currentSlot) {
22397
+ if (focusLevel === "slot" && key.return && currentSlot) {
22402
22398
  setFocusLevel("field");
22403
22399
  setActiveField(SLOT_FIELDS[0] ?? null);
22404
22400
  setTextCursor(currentSlot.description.length);
22405
22401
  return;
22406
22402
  }
22403
+ if (focusLevel === "prop" && key.return && currentProp) {
22404
+ setFocusLevel("field");
22405
+ setActiveField(propFields(currentProp)[0] ?? null);
22406
+ setTextCursor(currentProp.description.length);
22407
+ return;
22408
+ }
22407
22409
  return;
22408
22410
  }
22409
22411
  if (focusLevel === "field") {
@@ -22732,14 +22734,24 @@ function FieldEditor({
22732
22734
  })();
22733
22735
  const rows = [];
22734
22736
  rows.push({ kind: "component-description" });
22735
- if (visiblePropIndexes.length > 0) {
22736
- rows.push({ kind: "header", label: `\u2500\u2500 PROPERTIES (${visiblePropIndexes.length}) `, section: "properties" });
22737
- visiblePropIndexes.forEach((idx) => rows.push({ kind: "prop", idx }));
22737
+ for (const group of propGroups.filter((candidate) => candidate.kind !== "hidden")) {
22738
+ if (group.indexes.length === 0) continue;
22739
+ rows.push({ kind: "header", label: `${group.label} (${group.indexes.length}) `, section: group.kind });
22740
+ group.indexes.forEach((idx) => rows.push({ kind: "prop", idx }));
22738
22741
  }
22739
22742
  if (slots.length > 0) {
22740
22743
  rows.push({ kind: "header", label: `\u2500\u2500 SLOTS (${slots.length}) `, section: "slots" });
22741
22744
  slots.forEach((_, i) => rows.push({ kind: "slot", idx: i }));
22742
22745
  }
22746
+ const hiddenGroup = propGroups.find((group) => group.kind === "hidden");
22747
+ if (hiddenGroup && hiddenGroup.indexes.length > 0) {
22748
+ rows.push({
22749
+ kind: "header",
22750
+ label: `${hiddenGroup.label} (${hiddenGroup.indexes.length}) `,
22751
+ section: "hidden"
22752
+ });
22753
+ hiddenGroup.indexes.forEach((idx) => rows.push({ kind: "prop", idx }));
22754
+ }
22743
22755
  const selectedRowIdx = rows.findIndex(
22744
22756
  (r) => r.kind === "prop" && !inSlots && !inComponentDesc && r.idx === propIdx || r.kind === "slot" && inSlots && r.idx === slotIdx || r.kind === "component-description" && inComponentDesc
22745
22757
  );
@@ -22758,7 +22770,15 @@ function FieldEditor({
22758
22770
  hasEmptyProperties && /* @__PURE__ */ jsx44(Text43, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
22759
22771
  /* @__PURE__ */ jsx44(Box41, { flexDirection: "column", width: innerWidth, children: visibleRowSlice.map((row, i) => {
22760
22772
  if (row.kind === "header") {
22761
- return /* @__PURE__ */ jsx44(Text43, { bold: true, color: row.section === "slots" ? PALETTE.info : PALETTE.success, children: row.label }, `header-${i}`);
22773
+ return /* @__PURE__ */ jsx44(
22774
+ Text43,
22775
+ {
22776
+ bold: true,
22777
+ color: row.section === "slots" ? PALETTE.info : row.section === "hidden" ? PALETTE.warning : PALETTE.success,
22778
+ children: row.label
22779
+ },
22780
+ `header-${i}`
22781
+ );
22762
22782
  }
22763
22783
  if (row.kind === "component-description") {
22764
22784
  const isSelected2 = inComponentDesc;
@@ -22771,7 +22791,7 @@ function FieldEditor({
22771
22791
  color: isSelected2 ? PALETTE.inverse : PALETTE.info,
22772
22792
  bold: isSelected2,
22773
22793
  backgroundColor: isSelected2 ? "blue" : void 0,
22774
- children: " component-$description "
22794
+ children: " description: "
22775
22795
  }
22776
22796
  ) }),
22777
22797
  isEditing ? /* @__PURE__ */ jsx44(Box41, { paddingLeft: 2, flexDirection: "row", children: /* @__PURE__ */ jsxs43(Box41, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
@@ -26419,7 +26439,6 @@ import { jsx as jsx50, jsxs as jsxs49 } from "react/jsx-runtime";
26419
26439
  function buildSelectAgentArgs(opts) {
26420
26440
  const args = ["analyze", "select-agent", "--agent", opts.agent, "--session", opts.sessionId, "--exclude-invalid"];
26421
26441
  if (opts.model) args.push("--model", opts.model);
26422
- if (opts.bedrock) args.push("--bedrock");
26423
26442
  if (opts.selectPromptPath) args.push("--select-prompt-path", opts.selectPromptPath);
26424
26443
  if (opts.noCache) args.push("--no-cache");
26425
26444
  return args;
@@ -26455,7 +26474,6 @@ function buildGenerateComponentsArgs(opts) {
26455
26474
  const args = ["generate", "components", "--agent", opts.agent, "--session", opts.sessionId];
26456
26475
  if (opts.tokensPath) args.push("--tokens", opts.tokensPath);
26457
26476
  if (opts.model) args.push("--model", opts.model);
26458
- if (opts.bedrock) args.push("--bedrock");
26459
26477
  if (opts.noCache) args.push("--no-cache");
26460
26478
  if (opts.generatePromptPath) args.push("--generate-prompt-path", opts.generatePromptPath);
26461
26479
  return args;
@@ -26488,7 +26506,6 @@ function WizardApp({
26488
26506
  initialHost,
26489
26507
  initialAgent,
26490
26508
  initialModel,
26491
- bedrock = false,
26492
26509
  initialProjectPath,
26493
26510
  host,
26494
26511
  autoAcceptScope = false,
@@ -26549,7 +26566,6 @@ function WizardApp({
26549
26566
  step: modifyEntryReady || rawTokensEntryReady || pushFromPickerReady ? initialStepResolved : initialRuns && initialRuns.length > 0 ? "run-picker" : initialStepResolved,
26550
26567
  agent: initialAgent ?? "claude",
26551
26568
  ...initialModel ? { agentModel: initialModel } : {},
26552
- ...bedrock ? { bedrock: true } : {},
26553
26569
  projectPath: initialProjectPath ?? "",
26554
26570
  outDir: initialOutDir,
26555
26571
  rawTokensPath: rawTokensEntryReady ? initialRawTokensPath : "",
@@ -26688,7 +26704,6 @@ If you are using AWS Bedrock, run:
26688
26704
  const result = await new Promise((res) => {
26689
26705
  const tokenArgs = [findCliPath(), "generate", "tokens", "--agent", state.agent, "--raw-tokens", rawTokensPath];
26690
26706
  if (state.agentModel) tokenArgs.push("--model", state.agentModel);
26691
- if (state.bedrock) tokenArgs.push("--bedrock");
26692
26707
  const child = spawn4("node", tokenArgs);
26693
26708
  let stdout2 = "";
26694
26709
  let stderr = "";
@@ -26846,7 +26861,6 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
26846
26861
  sessionId: sessionId2,
26847
26862
  agent: state.agent,
26848
26863
  ...state.agentModel ? { model: state.agentModel } : {},
26849
- ...state.bedrock ? { bedrock: true } : {},
26850
26864
  selectPromptPath,
26851
26865
  noCache
26852
26866
  });
@@ -26945,7 +26959,6 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
26945
26959
  tokensPath,
26946
26960
  agent: state.agent,
26947
26961
  ...state.agentModel ? { model: state.agentModel } : {},
26948
- ...state.bedrock ? { bedrock: true } : {},
26949
26962
  noCache: effectiveNoCache
26950
26963
  })
26951
26964
  ];
@@ -27015,7 +27028,6 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
27015
27028
  tokensPath,
27016
27029
  agent: state.agent,
27017
27030
  ...state.agentModel ? { model: state.agentModel } : {},
27018
- ...state.bedrock ? { bedrock: true } : {},
27019
27031
  noCache: effectiveNoCache,
27020
27032
  generatePromptPath
27021
27033
  })
@@ -28491,14 +28503,11 @@ import { isAbsolute as isAbsolute4, join as join15, relative as relative3, resol
28491
28503
  init_src();
28492
28504
  var AGENT_DESCRIPTION = `Agent to use: ${AGENT_NAMES.join(", ")} (defaults to value saved by experiences setup)`;
28493
28505
  var MODEL_DESCRIPTION = "Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)";
28494
- var BEDROCK_AGENTS = AGENT_NAMES.filter((agent) => agentSupportsBedrock(agent)).join(", ");
28495
- var BEDROCK_DESCRIPTION = `Route the selected agent through AWS Bedrock instead of its default model provider (requires AWS credentials in the environment: AWS_PROFILE, or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN, plus AWS_REGION). Only supported by agents with a Bedrock routing mechanism (currently: ${BEDROCK_AGENTS}).`;
28496
28506
  function addAgentModelOptions(cmd, config = {}) {
28497
28507
  const { agentDescription = AGENT_DESCRIPTION, includeModel = true, modelDescription = MODEL_DESCRIPTION } = config;
28498
28508
  cmd.option("--agent <name>", agentDescription);
28499
28509
  if (includeModel) {
28500
28510
  cmd.option("--model <name>", modelDescription);
28501
- cmd.option("--bedrock", BEDROCK_DESCRIPTION);
28502
28511
  }
28503
28512
  return cmd;
28504
28513
  }
@@ -29051,7 +29060,7 @@ function resolveProjectRoot(sessionId2, projectRootFlag) {
29051
29060
  db.close();
29052
29061
  }
29053
29062
  }
29054
- async function selectBatch(agent, model, bedrock, batch, total, verbose, skillPathOverride) {
29063
+ async function selectBatch(agent, model, batch, total, verbose, skillPathOverride) {
29055
29064
  const prompt2 = await buildPrompt({
29056
29065
  skill: "select",
29057
29066
  mode: "autonomous",
@@ -29070,7 +29079,6 @@ async function selectBatch(agent, model, bedrock, batch, total, verbose, skillPa
29070
29079
  const result = await invoker.invoke({
29071
29080
  agent,
29072
29081
  model,
29073
- bedrock,
29074
29082
  prompt: prompt2,
29075
29083
  timeoutMs: DEFAULT_TIMEOUT_MS,
29076
29084
  onOutput: (chunk) => formatter.push(chunk)
@@ -29157,7 +29165,7 @@ ${outputBuf}`);
29157
29165
  }
29158
29166
  return results;
29159
29167
  }
29160
- async function selectAllComponents(agent, model, bedrock, components, verbose, skillPathOverride, cacheConfig = { noCache: true }) {
29168
+ async function selectAllComponents(agent, model, components, verbose, skillPathOverride, cacheConfig = { noCache: true }) {
29161
29169
  const concurrency = Number(process.env.EDS_GENERATE_CONCURRENCY ?? DEFAULT_CONCURRENCY);
29162
29170
  const batchSize = resolveBatchSize();
29163
29171
  const total = components.length;
@@ -29222,7 +29230,7 @@ async function selectAllComponents(agent, model, bedrock, components, verbose, s
29222
29230
  while (nextBatch < batches.length) {
29223
29231
  const b = nextBatch++;
29224
29232
  const batch = batches[b];
29225
- const batchResults = await selectBatch(agent, model, bedrock, batch, total, verbose, skillPathOverride);
29233
+ const batchResults = await selectBatch(agent, model, batch, total, verbose, skillPathOverride);
29226
29234
  for (let k = 0; k < batch.length; k++) {
29227
29235
  results[batch[k].index] = batchResults[k];
29228
29236
  }
@@ -29286,12 +29294,6 @@ function registerAnalyzeSelectAgentCommand(program) {
29286
29294
  return;
29287
29295
  }
29288
29296
  const agent = agentName;
29289
- if (opts.bedrock && !agentSupportsBedrock(agent)) {
29290
- process.stderr.write(`Error: --bedrock is not supported for --agent ${agent}
29291
- `);
29292
- await exitWithAnalytics(1);
29293
- return;
29294
- }
29295
29297
  const selectPromptPath = opts.selectPromptPath ?? savedCreds.selectPromptPath;
29296
29298
  if (selectPromptPath) {
29297
29299
  const resolvedPath = resolve12(selectPromptPath);
@@ -29390,7 +29392,6 @@ function registerAnalyzeSelectAgentCommand(program) {
29390
29392
  const selectResults = await selectAllComponents(
29391
29393
  agent,
29392
29394
  model,
29393
- opts.bedrock,
29394
29395
  selectionCandidates,
29395
29396
  opts.verbose ?? false,
29396
29397
  selectPromptPath ? resolve12(selectPromptPath) : void 0,
@@ -31150,7 +31151,7 @@ function printFallbackInstructions(options) {
31150
31151
  lines.push(` Re-run the generate command with the agent available, or use --dry-run to inspect the prompt.`);
31151
31152
  process.stderr.write(lines.join("\n") + "\n");
31152
31153
  }
31153
- async function runOneComponent(agent, model, bedrock, db, sessionId2, component, tokensInline, tokenMapInline, index, total, verbose, noCache, skillPathOverride, promptHash) {
31154
+ async function runOneComponent(agent, model, db, sessionId2, component, tokensInline, tokenMapInline, index, total, verbose, noCache, skillPathOverride, promptHash) {
31154
31155
  const pos = c.dim(`[${index + 1}/${total}]`);
31155
31156
  if (!noCache) {
31156
31157
  const inputHash = computeComponentInputHash(component);
@@ -31235,7 +31236,6 @@ async function runOneComponent(agent, model, bedrock, db, sessionId2, component,
31235
31236
  const result = await invoker2.invoke({
31236
31237
  agent,
31237
31238
  model,
31238
- bedrock,
31239
31239
  prompt: prompt2,
31240
31240
  timeoutMs: DEFAULT_TIMEOUT_MS3,
31241
31241
  onOutput: (chunk) => formatter.push(chunk)
@@ -31291,7 +31291,7 @@ ${outputBuf}`);
31291
31291
  renamedSlotsCount: renames.length
31292
31292
  };
31293
31293
  }
31294
- async function runAllComponents(agent, model, bedrock, db, sessionId2, components, tokensInline, tokenMapInline, verbose, noCache, skillPathOverride, promptHash) {
31294
+ async function runAllComponents(agent, model, db, sessionId2, components, tokensInline, tokenMapInline, verbose, noCache, skillPathOverride, promptHash) {
31295
31295
  const concurrency = Number(process.env.EDS_GENERATE_CONCURRENCY ?? DEFAULT_COMPONENT_CONCURRENCY);
31296
31296
  process.stderr.write(
31297
31297
  `Categorizing ${c.bold(String(components.length))} component${components.length === 1 ? "" : "s"}` + c.dim(` (concurrency: ${concurrency})`) + "\n"
@@ -31305,7 +31305,6 @@ async function runAllComponents(agent, model, bedrock, db, sessionId2, component
31305
31305
  results[i] = await runOneComponent(
31306
31306
  agent,
31307
31307
  model,
31308
- bedrock,
31309
31308
  db,
31310
31309
  sessionId2,
31311
31310
  components[i],
@@ -31373,9 +31372,6 @@ async function runGenerateSkill(skill, opts, verbose = false) {
31373
31372
  );
31374
31373
  }
31375
31374
  const agent = agentName;
31376
- if (opts.bedrock && !agentSupportsBedrock(agent)) {
31377
- die2(`Error: --bedrock is not supported for --agent ${agent}`);
31378
- }
31379
31375
  const generatePromptPath = skill === "components" ? opts.generatePromptPath ?? savedCreds.generatePromptPath : void 0;
31380
31376
  if (generatePromptPath) {
31381
31377
  if (!await pathExists3(resolve17(generatePromptPath))) {
@@ -31485,7 +31481,6 @@ async function runGenerateSkill(skill, opts, verbose = false) {
31485
31481
  componentResults = await runAllComponents(
31486
31482
  agent,
31487
31483
  model,
31488
- opts.bedrock,
31489
31484
  db,
31490
31485
  sessionId2,
31491
31486
  allComponents,
@@ -31598,7 +31593,6 @@ session=${sessionId2 ?? ""}
31598
31593
  const result = await invoker2.invoke({
31599
31594
  agent,
31600
31595
  model,
31601
- bedrock: opts.bedrock,
31602
31596
  prompt: prompt2,
31603
31597
  timeoutMs: DEFAULT_TIMEOUT_MS3 * 5
31604
31598
  });
@@ -32622,7 +32616,6 @@ function registerPrintCommand(program) {
32622
32616
  }
32623
32617
 
32624
32618
  // packages/experience-design-system-cli/src/import/command.ts
32625
- init_src();
32626
32619
  init_path_utils();
32627
32620
  import { resolve as resolve25, join as join25 } from "node:path";
32628
32621
 
@@ -32827,7 +32820,6 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
32827
32820
  if (useAgentSelect) {
32828
32821
  editArgs = ["analyze", "select-agent", "--session", extractSessionId, "--agent", opts.agent];
32829
32822
  if (opts.model) editArgs.push("--model", opts.model);
32830
- if (opts.bedrock) editArgs.push("--bedrock");
32831
32823
  if (opts.excludeInvalid) editArgs.push("--exclude-invalid");
32832
32824
  if (opts.noCache) editArgs.push("--no-cache");
32833
32825
  if (opts.selectPromptPath) editArgs.push("--select-prompt-path", opts.selectPromptPath);
@@ -32889,7 +32881,6 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
32889
32881
  const generateLabel = stepLabel("Categorizing component props");
32890
32882
  const generateArgs = ["generate", "components", "--agent", opts.agent];
32891
32883
  if (opts.model) generateArgs.push("--model", opts.model);
32892
- if (opts.bedrock) generateArgs.push("--bedrock");
32893
32884
  if (extractSessionId) generateArgs.push("--session", extractSessionId);
32894
32885
  if (opts.dryRun) generateArgs.push("--dry-run");
32895
32886
  if (opts.verbose) generateArgs.push("--verbose");
@@ -33833,11 +33824,6 @@ function registerImportCommand(program) {
33833
33824
  const resolvedAgent = resolveAgent(opts.agent, creds.agent);
33834
33825
  const resolvedModel = resolveModel(opts.model, creds.agentModel);
33835
33826
  const resolvedCompositionMode = resolveCompositionMode(opts, creds.compositionMode);
33836
- if (opts.bedrock && !(isAgentName(resolvedAgent) && agentSupportsBedrock(resolvedAgent))) {
33837
- process.stderr.write(`Error: --bedrock is not supported for --agent ${resolvedAgent}
33838
- `);
33839
- process.exit(1);
33840
- }
33841
33827
  const pickerDecision = await shouldShowRunPicker({
33842
33828
  flags: {
33843
33829
  ...opts.pushFromRun !== void 0 ? { pushFromRun: opts.pushFromRun } : {},
@@ -33866,7 +33852,6 @@ function registerImportCommand(program) {
33866
33852
  initialHost: toConfiguredHost(opts.host ?? creds.host) ?? DEFAULT_CONFIGURED_HOST,
33867
33853
  initialAgent: resolvedAgent,
33868
33854
  ...resolvedModel ? { initialModel: resolvedModel } : {},
33869
- ...opts.bedrock ? { bedrock: true } : {},
33870
33855
  initialProjectPath: opts.project !== "." ? normalizePath(opts.project) : void 0,
33871
33856
  host: opts.host,
33872
33857
  autoAcceptScope,
@@ -33929,11 +33914,6 @@ function registerImportCommand(program) {
33929
33914
  const headlessAgent = resolveAgent(opts.agent, headlessCreds.agent);
33930
33915
  const headlessModel = resolveModel(opts.model, headlessCreds.agentModel);
33931
33916
  const headlessCompositionMode = resolveCompositionMode(opts, headlessCreds.compositionMode);
33932
- if (opts.bedrock && !(isAgentName(headlessAgent) && agentSupportsBedrock(headlessAgent))) {
33933
- process.stderr.write(`Error: --bedrock is not supported for --agent ${headlessAgent}
33934
- `);
33935
- process.exit(1);
33936
- }
33937
33917
  const result = await runPipeline(
33938
33918
  {
33939
33919
  project: projectRoot,
@@ -33943,7 +33923,6 @@ function registerImportCommand(program) {
33943
33923
  cmaToken,
33944
33924
  agent: headlessAgent,
33945
33925
  model: headlessModel,
33946
- ...opts.bedrock ? { bedrock: true } : {},
33947
33926
  tokens: opts.tokens,
33948
33927
  selectAll: opts.selectAll,
33949
33928
  select: opts.select.length > 0 ? opts.select : void 0,
@@ -1,11 +1,13 @@
1
1
  import type { Command } from 'commander';
2
2
  export declare const AGENT_DESCRIPTION: string;
3
3
  export declare const MODEL_DESCRIPTION = "Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)";
4
- export declare const BEDROCK_DESCRIPTION: string;
5
4
  export interface AgentModelOptionsConfig {
6
5
  agentDescription?: string;
7
6
  includeModel?: boolean;
8
7
  modelDescription?: string;
9
8
  }
10
- /** Register --agent and optional --model/--bedrock flags with a Commander command. Pass includeModel: false to omit both. */
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
+ */
11
13
  export declare function addAgentModelOptions(cmd: Command, config?: AgentModelOptionsConfig): Command;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.27.1-dev-build-fd316dc.0",
3
+ "version": "2.27.1-dev-build-c0edf3e.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "svelte": "^5.56.4",
40
40
  "ts-morph": "^27.0.2",
41
41
  "typescript": "^5.9.3",
42
- "@contentful/experience-design-system-types": "2.27.1-dev-build-fd316dc.0"
42
+ "@contentful/experience-design-system-types": "2.27.1-dev-build-c0edf3e.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@tsconfig/node24": "^24.0.4",
@@ -51,9 +51,9 @@
51
51
  "ink-testing-library": "^4.0.0",
52
52
  "typescript-eslint": "^8.67.0",
53
53
  "vitest": "^4.0.16",
54
- "@contentful/experience-design-system-client": "2.27.1-dev-build-fd316dc.0",
55
- "@contentful/experience-design-system-extraction": "2.27.1-dev-build-fd316dc.0",
56
- "@contentful/experience-design-system-generation": "2.27.1-dev-build-fd316dc.0"
54
+ "@contentful/experience-design-system-client": "2.27.1-dev-build-c0edf3e.0",
55
+ "@contentful/experience-design-system-extraction": "2.27.1-dev-build-c0edf3e.0",
56
+ "@contentful/experience-design-system-generation": "2.27.1-dev-build-c0edf3e.0"
57
57
  },
58
58
  "repository": {
59
59
  "type": "git",