@contentful/experience-design-system-cli 2.37.1-dev-build-9da0d812.0 → 2.37.1-dev-build-932fd115.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/app.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
+ import type { ImportOptions } from './src/commands/import-options.js';
2
3
  export type Screen = 'start' | 'import' | 'help' | 'settings' | 'settings-configuration' | 'settings-opt-in-analytics' | 'settings-debug-mode' | 'upgrade';
3
4
  interface AppInstance {
4
5
  unmount: () => void;
5
6
  waitUntilExit: () => Promise<unknown>;
6
7
  }
7
8
  type RenderApp = (element: React.ReactElement) => AppInstance;
8
- export declare function runApp(renderApp: RenderApp): Promise<void>;
9
+ export declare function runApp(renderApp: RenderApp, importOptions: ImportOptions): Promise<void>;
9
10
  export {};
package/dist/app.js CHANGED
@@ -2758,6 +2758,15 @@ ${candidates.join("\n")}`);
2758
2758
  return found;
2759
2759
  }
2760
2760
 
2761
+ // packages/experience-design-system-cli/src/commands/import-options.ts
2762
+ function importOptionArgs(options) {
2763
+ return [
2764
+ ...options.agent ? ["--agent", options.agent] : [],
2765
+ ...options.prompt.flatMap((value) => ["--prompt", value]),
2766
+ ...options.cache ? [] : ["--no-cache"]
2767
+ ];
2768
+ }
2769
+
2761
2770
  // packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts
2762
2771
  function buildArgs2(options) {
2763
2772
  const args = ["import"];
@@ -2767,6 +2776,7 @@ function buildArgs2(options) {
2767
2776
  if (options.tokens) {
2768
2777
  args.push("--tokens", options.tokens);
2769
2778
  }
2779
+ args.push(...importOptionArgs({ agent: options.agent, prompt: options.prompt ?? [], cache: options.cache ?? true }));
2770
2780
  return args;
2771
2781
  }
2772
2782
  async function spawnV1Import(options = {}) {
@@ -3530,7 +3540,7 @@ function DebugModeScreen({ onDone }) {
3530
3540
 
3531
3541
  // packages/experience-design-system-cli/app.tsx
3532
3542
  import { Fragment as Fragment5, jsx as jsx14 } from "react/jsx-runtime";
3533
- function App({ onLaunchImport, importExitCode }) {
3543
+ function App({ importOptions, onLaunchImport, importExitCode }) {
3534
3544
  const returnedFromImport = importExitCode !== void 0;
3535
3545
  const [screen, setScreen] = useState13(returnedFromImport ? "import" : "start");
3536
3546
  const [showImportResult, setShowImportResult] = useState13(returnedFromImport);
@@ -3553,7 +3563,7 @@ function App({ onLaunchImport, importExitCode }) {
3553
3563
  }, [screen]);
3554
3564
  const finishCredentials = async (result, projectPath2, tokens, filePaths) => {
3555
3565
  if (!result.skipped) await writeCredentials({ ...result.credentials });
3556
- onLaunchImport?.({ projectPath: projectPath2, tokens, filePaths, skipCredentials: result.skipped });
3566
+ onLaunchImport?.({ projectPath: projectPath2, tokens, filePaths, skipCredentials: result.skipped, ...importOptions });
3557
3567
  };
3558
3568
  const goToStart = () => setScreen("start");
3559
3569
  const goToSettings = () => setScreen("settings");
@@ -3624,12 +3634,13 @@ function App({ onLaunchImport, importExitCode }) {
3624
3634
  }
3625
3635
  }
3626
3636
  var CLEAR_SCREEN = "\x1B[2J\x1B[H";
3627
- async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
3637
+ async function renderUntilImportRequestedOrExit(renderApp, importOptions, importExitCode) {
3628
3638
  let requestedImport;
3629
3639
  const instance = renderApp(
3630
3640
  /* @__PURE__ */ jsx14(
3631
3641
  App,
3632
3642
  {
3643
+ importOptions,
3633
3644
  importExitCode,
3634
3645
  onLaunchImport: (options) => {
3635
3646
  requestedImport = options;
@@ -3645,13 +3656,13 @@ async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
3645
3656
  }
3646
3657
  return requestedImport;
3647
3658
  }
3648
- async function runApp(renderApp) {
3659
+ async function runApp(renderApp, importOptions) {
3649
3660
  let importExitCode;
3650
- let requestedImport = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
3661
+ let requestedImport = await renderUntilImportRequestedOrExit(renderApp, importOptions, importExitCode);
3651
3662
  while (requestedImport !== void 0) {
3652
3663
  importExitCode = (await spawnV1Import(requestedImport)).exitCode;
3653
3664
  startReadingTerminal();
3654
- requestedImport = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
3665
+ requestedImport = await renderUntilImportRequestedOrExit(renderApp, importOptions, importExitCode);
3655
3666
  }
3656
3667
  }
3657
3668
  export {
package/dist/index.js CHANGED
@@ -57,6 +57,27 @@ var init_legacy_cli_path = __esm({
57
57
  }
58
58
  });
59
59
 
60
+ // packages/experience-design-system-cli/src/commands/import-options.ts
61
+ function toImportOptions(raw) {
62
+ return {
63
+ ...raw.agent ? { agent: raw.agent } : {},
64
+ prompt: raw.prompt ?? [],
65
+ cache: raw.cache !== false
66
+ };
67
+ }
68
+ function importOptionArgs(options) {
69
+ return [
70
+ ...options.agent ? ["--agent", options.agent] : [],
71
+ ...options.prompt.flatMap((value) => ["--prompt", value]),
72
+ ...options.cache ? [] : ["--no-cache"]
73
+ ];
74
+ }
75
+ var init_import_options = __esm({
76
+ "packages/experience-design-system-cli/src/commands/import-options.ts"() {
77
+ "use strict";
78
+ }
79
+ });
80
+
60
81
  // packages/experience-design-system-cli/src/tui/home/home.theme.ts
61
82
  function brandBar(width, ramp = BRAND_RAMP) {
62
83
  if (width <= 0 || ramp.length === 0) return [];
@@ -5060,6 +5081,7 @@ function buildArgs2(options) {
5060
5081
  if (options.tokens) {
5061
5082
  args.push("--tokens", options.tokens);
5062
5083
  }
5084
+ args.push(...importOptionArgs({ agent: options.agent, prompt: options.prompt ?? [], cache: options.cache ?? true }));
5063
5085
  return args;
5064
5086
  }
5065
5087
  async function spawnV1Import(options = {}) {
@@ -5082,6 +5104,7 @@ var init_spawn_v1_import = __esm({
5082
5104
  "packages/experience-design-system-cli/src/tui/import/spawn-v1-import.ts"() {
5083
5105
  "use strict";
5084
5106
  init_legacy_cli_path();
5107
+ init_import_options();
5085
5108
  }
5086
5109
  });
5087
5110
 
@@ -5934,7 +5957,7 @@ __export(app_exports, {
5934
5957
  });
5935
5958
  import { useEffect as useEffect9, useState as useState13 } from "react";
5936
5959
  import { Fragment as Fragment5, jsx as jsx14 } from "react/jsx-runtime";
5937
- function App({ onLaunchImport, importExitCode }) {
5960
+ function App({ importOptions, onLaunchImport, importExitCode }) {
5938
5961
  const returnedFromImport = importExitCode !== void 0;
5939
5962
  const [screen, setScreen] = useState13(returnedFromImport ? "import" : "start");
5940
5963
  const [showImportResult, setShowImportResult] = useState13(returnedFromImport);
@@ -5957,7 +5980,7 @@ function App({ onLaunchImport, importExitCode }) {
5957
5980
  }, [screen]);
5958
5981
  const finishCredentials = async (result, projectPath2, tokens, filePaths) => {
5959
5982
  if (!result.skipped) await writeCredentials({ ...result.credentials });
5960
- onLaunchImport?.({ projectPath: projectPath2, tokens, filePaths, skipCredentials: result.skipped });
5983
+ onLaunchImport?.({ projectPath: projectPath2, tokens, filePaths, skipCredentials: result.skipped, ...importOptions });
5961
5984
  };
5962
5985
  const goToStart = () => setScreen("start");
5963
5986
  const goToSettings = () => setScreen("settings");
@@ -6027,12 +6050,13 @@ function App({ onLaunchImport, importExitCode }) {
6027
6050
  return /* @__PURE__ */ jsx14(HomeScreen, { onNavigate: setScreen });
6028
6051
  }
6029
6052
  }
6030
- async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
6053
+ async function renderUntilImportRequestedOrExit(renderApp, importOptions, importExitCode) {
6031
6054
  let requestedImport;
6032
6055
  const instance = renderApp(
6033
6056
  /* @__PURE__ */ jsx14(
6034
6057
  App,
6035
6058
  {
6059
+ importOptions,
6036
6060
  importExitCode,
6037
6061
  onLaunchImport: (options) => {
6038
6062
  requestedImport = options;
@@ -6048,13 +6072,13 @@ async function renderUntilImportRequestedOrExit(renderApp, importExitCode) {
6048
6072
  }
6049
6073
  return requestedImport;
6050
6074
  }
6051
- async function runApp(renderApp) {
6075
+ async function runApp(renderApp, importOptions) {
6052
6076
  let importExitCode;
6053
- let requestedImport = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
6077
+ let requestedImport = await renderUntilImportRequestedOrExit(renderApp, importOptions, importExitCode);
6054
6078
  while (requestedImport !== void 0) {
6055
6079
  importExitCode = (await spawnV1Import(requestedImport)).exitCode;
6056
6080
  startReadingTerminal();
6057
- requestedImport = await renderUntilImportRequestedOrExit(renderApp, importExitCode);
6081
+ requestedImport = await renderUntilImportRequestedOrExit(renderApp, importOptions, importExitCode);
6058
6082
  }
6059
6083
  }
6060
6084
  var CLEAR_SCREEN;
@@ -6138,6 +6162,9 @@ function forwardedImportArgs(argv) {
6138
6162
  return argv[0] === "import" ? argv.slice(1) : argv;
6139
6163
  }
6140
6164
 
6165
+ // packages/experience-design-system-cli/src/commands/import.ts
6166
+ init_import_options();
6167
+
6141
6168
  // packages/experience-design-system-cli/src/commands/watch.ts
6142
6169
  init_package_root();
6143
6170
  import { spawn as spawn2 } from "node:child_process";
@@ -6168,12 +6195,17 @@ function runDevWatch(args) {
6168
6195
 
6169
6196
  // packages/experience-design-system-cli/src/commands/import.ts
6170
6197
  function registerImportCommand(program, openTui) {
6171
- program.command("import", { isDefault: true }).description("Launch the Experiences CLI").allowUnknownOption().allowExcessArguments().helpOption(false).argument("[args...]").action(async () => {
6198
+ program.command("import", { isDefault: true }).description("Launch the Experiences CLI").allowUnknownOption().allowExcessArguments().helpOption(false).argument("[args...]").option("--agent <name>", "Agent (or agent:model) the import runs its steps with").option(
6199
+ "--prompt <stage=value>",
6200
+ "Override a stage prompt (repeatable): a file path or literal text, e.g. --prompt select=./p.md",
6201
+ (value, previous) => [...previous, value],
6202
+ []
6203
+ ).option("--no-cache", "Re-run every step even if its output already exists").action(async (_args, raw) => {
6172
6204
  const { watch, rest: forwarded } = extractWatchFlag(forwardedImportArgs(process.argv.slice(2)));
6173
6205
  if (watch) {
6174
6206
  process.exit(await runDevWatch(forwarded));
6175
6207
  }
6176
- await openTui();
6208
+ await openTui(toImportOptions(raw));
6177
6209
  });
6178
6210
  }
6179
6211
 
@@ -6187,10 +6219,10 @@ var pkg = JSON.parse(
6187
6219
  );
6188
6220
  function createProgram() {
6189
6221
  const program = new Command().name("experiences").description("Contentful Experiences design system import CLI").version(pkg.version, "--version", "Print version number");
6190
- registerImportCommand(program, async () => {
6222
+ registerImportCommand(program, async (options) => {
6191
6223
  const { render } = await import("ink");
6192
6224
  const { runApp: runApp2 } = await Promise.resolve().then(() => (init_app(), app_exports));
6193
- await runApp2(render);
6225
+ await runApp2(render, options);
6194
6226
  });
6195
6227
  registerForwardedCommands(program);
6196
6228
  return program;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-9da0d812.0",
3
+ "version": "2.37.1-dev-build-932fd115.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,13 @@
1
+ export interface ImportOptions {
2
+ agent?: string;
3
+ prompt: string[];
4
+ cache: boolean;
5
+ }
6
+ interface RawImportOptions {
7
+ agent?: string;
8
+ prompt?: string[];
9
+ cache?: boolean;
10
+ }
11
+ export declare function toImportOptions(raw: RawImportOptions): ImportOptions;
12
+ export declare function importOptionArgs(options: ImportOptions): string[];
13
+ export {};
@@ -1,2 +1,3 @@
1
1
  import type { Command } from 'commander';
2
- export declare function registerImportCommand(program: Command, openTui: () => Promise<void>): void;
2
+ import { type ImportOptions } from './import-options.js';
3
+ export declare function registerImportCommand(program: Command, openTui: (options: ImportOptions) => Promise<void>): void;
@@ -1,3 +1,4 @@
1
+ import { type ImportOptions } from '../../commands/import-options.js';
1
2
  interface StepResult {
2
3
  step: string;
3
4
  status: 'complete' | 'failed' | 'skipped';
@@ -14,7 +15,7 @@ interface PipelineResult {
14
15
  report: string[];
15
16
  };
16
17
  }
17
- export interface SpawnV1ImportOptions {
18
+ export interface SpawnV1ImportOptions extends Partial<ImportOptions> {
18
19
  projectPath?: string;
19
20
  tokens?: string;
20
21
  filePaths?: string[];
@@ -27,5 +28,6 @@ export interface SpawnV1ImportResult {
27
28
  stdout: string;
28
29
  stderr: string;
29
30
  }
31
+ export declare function buildArgs(options: SpawnV1ImportOptions): string[];
30
32
  export declare function spawnV1Import(options?: SpawnV1ImportOptions): Promise<SpawnV1ImportResult>;
31
33
  export {};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-9da0d812.0",
3
+ "version": "2.37.1-dev-build-932fd115.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-9da0d812.0",
3
+ "version": "2.37.1-dev-build-932fd115.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -44,8 +44,8 @@
44
44
  "ts-morph": "^27.0.2",
45
45
  "typescript": "^5.9.3",
46
46
  "zod": "^4.6.5",
47
- "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-9da0d812.0",
48
- "@contentful/experience-design-system-types": "2.37.1-dev-build-9da0d812.0"
47
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-932fd115.0",
48
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-932fd115.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@tsconfig/node24": "^24.0.4",