@contentful/experience-design-system-cli 2.40.1-dev-build-b9f92429.0 → 2.40.1-dev-build-35756f2e.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.js CHANGED
@@ -2484,7 +2484,7 @@ var init_cache_keys = __esm({
2484
2484
  });
2485
2485
 
2486
2486
  // packages/experience-design-system-cli/app.tsx
2487
- import { useEffect as useEffect31, useState as useState39 } from "react";
2487
+ import { useEffect as useEffect30, useState as useState39 } from "react";
2488
2488
 
2489
2489
  // packages/experience-design-system-cli/src/tui/home/home.tsx
2490
2490
  import { useEffect as useEffect2, useState as useState2 } from "react";
@@ -3275,9 +3275,8 @@ function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
3275
3275
  }
3276
3276
 
3277
3277
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
3278
- import { useEffect as useEffect6, useRef as useRef4, useState as useState6 } from "react";
3278
+ import { useState as useState6 } from "react";
3279
3279
  import { Box as Box11, Text as Text11 } from "ink";
3280
- init_debug_store();
3281
3280
 
3282
3281
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/controls.ts
3283
3282
  import { useInput as useInput8 } from "ink";
@@ -3344,68 +3343,23 @@ function validateTokenPath(rawPath) {
3344
3343
 
3345
3344
  // packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx
3346
3345
  import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
3347
- var MAX_LOGGED_ATTEMPTS = 10;
3348
- function TokenInputScreen({
3349
- mode,
3350
- onConfirm,
3351
- onBack,
3352
- initialPath = ""
3353
- }) {
3346
+ function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
3354
3347
  const [tokenPath, setTokenPath] = useState6(initialPath);
3355
3348
  const [failure, setFailure] = useState6(null);
3356
- const rejected = useRef4([]).current;
3357
- useEffect6(() => {
3358
- startDebugRun({
3359
- flow: "import/token-input",
3360
- step: "02-token-input",
3361
- menuOption: "Token input",
3362
- inputs: { import_mode: mode, initial_path: initialPath }
3363
- });
3364
- }, []);
3365
- const back = () => {
3366
- void finishDebugRun({
3367
- outputs: { token_path: null, rejected_attempts: rejected, ...failure ? { error: failure.error } : {} },
3368
- status: failure ? "error" : "success",
3369
- exitMethod: "discarded"
3370
- });
3371
- onBack();
3372
- };
3373
- useTokenInputControls(back);
3349
+ useTokenInputControls(onBack);
3374
3350
  const change = (value) => {
3375
3351
  setTokenPath(value);
3376
3352
  setFailure(null);
3377
3353
  };
3378
- const reject = (entered, rejection) => {
3379
- if (rejected.length < MAX_LOGGED_ATTEMPTS) {
3380
- rejected.push({
3381
- entered,
3382
- error: rejection.error,
3383
- ...rejection.resolvedPath ? { resolved_path: rejection.resolvedPath } : {}
3384
- });
3385
- }
3386
- setFailure(rejection);
3387
- };
3388
3354
  const submit = (value) => {
3389
3355
  const rawPath = toTokenPath(value);
3390
3356
  if (!rawPath) {
3391
- reject("", { error: "Enter the path to your token file." });
3357
+ setFailure({ error: "Enter the path to your token file." });
3392
3358
  return;
3393
3359
  }
3394
3360
  const check = validateTokenPath(rawPath);
3395
- if (!check.ok) {
3396
- reject(rawPath, { error: check.error, resolvedPath: check.resolvedPath });
3397
- return;
3398
- }
3399
- void finishDebugRun({
3400
- outputs: {
3401
- token_path: check.path,
3402
- changed_from_initial: rawPath !== initialPath.trim(),
3403
- rejected_attempts: rejected
3404
- },
3405
- status: "success",
3406
- exitMethod: "saved"
3407
- });
3408
- onConfirm(check.path);
3361
+ if (check.ok) onConfirm(check.path);
3362
+ else setFailure({ error: check.error, resolvedPath: check.resolvedPath });
3409
3363
  };
3410
3364
  return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", children: [
3411
3365
  /* @__PURE__ */ jsx12(StepHeader, { step: "setup" }),
@@ -3435,8 +3389,9 @@ function TokenInputScreen({
3435
3389
  }
3436
3390
 
3437
3391
  // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
3438
- import { useEffect as useEffect7, useMemo, useState as useState7 } from "react";
3392
+ import { useEffect as useEffect6, useMemo, useState as useState7 } from "react";
3439
3393
  import { Box as Box12, Text as Text12 } from "ink";
3394
+ init_debug_store();
3440
3395
 
3441
3396
  // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/controls.ts
3442
3397
  import { useInput as useInput9 } from "ink";
@@ -3497,6 +3452,19 @@ function summarize(counts, { hasTokens = true } = {}) {
3497
3452
  warning: hasTokens ? "No component or token files found. Try a different path." : "No component files found. Try a different path."
3498
3453
  };
3499
3454
  }
3455
+ function scanReport(scan, path5, { hasTokens = true } = {}) {
3456
+ if (scan === void 0) return { scan: "unfinished" };
3457
+ if (!scan.ok) return { scan: "failed", failure: scan.failure, error: describeFailure(scan.failure, path5).headline };
3458
+ const { total, warning } = summarize(scan.counts, { hasTokens });
3459
+ const { total: _total, ...byType } = scan.counts;
3460
+ return {
3461
+ scan: "ok",
3462
+ files_found: total,
3463
+ counts: Object.fromEntries(Object.entries(byType).filter(([, count]) => count > 0)),
3464
+ ...warning ? { warning } : {},
3465
+ ...scan.warnings.length > 0 ? { scan_warnings: scan.warnings } : {}
3466
+ };
3467
+ }
3500
3468
  function phaseOf(scan) {
3501
3469
  if (scan === void 0) return "scanning";
3502
3470
  return scan.ok ? "ready" : "failed";
@@ -18084,6 +18052,7 @@ function Summary({
18084
18052
  ] });
18085
18053
  }
18086
18054
  function PathValidationScreen({
18055
+ mode,
18087
18056
  projectPath,
18088
18057
  onConfirm,
18089
18058
  onChangePath,
@@ -18092,16 +18061,39 @@ function PathValidationScreen({
18092
18061
  }) {
18093
18062
  const resolvedPath = useMemo(() => resolveUserPath(projectPath), [projectPath]);
18094
18063
  const [scan, setScan] = useState7();
18095
- useEffect7(() => {
18064
+ useEffect6(() => {
18065
+ startDebugRun({
18066
+ flow: "import/path-validation",
18067
+ step: "03-path-validation",
18068
+ menuOption: "Path validation",
18069
+ inputs: { import_mode: mode, project_path: projectPath, resolved_path: resolvedPath }
18070
+ });
18071
+ }, []);
18072
+ useEffect6(() => {
18096
18073
  setScan(scanFiles(resolvedPath));
18097
18074
  }, [resolvedPath]);
18098
18075
  const phase = phaseOf(scan);
18076
+ const finish = (outcome, exitMethod) => {
18077
+ void finishDebugRun({
18078
+ outputs: { outcome, ...scanReport(scan, resolvedPath, { hasTokens }) },
18079
+ status: scan?.ok === false ? "error" : "success",
18080
+ exitMethod
18081
+ });
18082
+ };
18099
18083
  usePathValidationControls(phase, {
18100
18084
  onConfirm: () => {
18101
- if (scan?.ok) onConfirm({ projectPath: resolvedPath, filePaths: scan.filePaths });
18085
+ if (!scan?.ok) return;
18086
+ finish("continued", "saved");
18087
+ onConfirm({ projectPath: resolvedPath, filePaths: scan.filePaths });
18088
+ },
18089
+ onChangePath: () => {
18090
+ finish("changed-path", "discarded");
18091
+ onChangePath();
18102
18092
  },
18103
- onChangePath,
18104
- onBack
18093
+ onBack: () => {
18094
+ finish("back", "discarded");
18095
+ onBack();
18096
+ }
18105
18097
  });
18106
18098
  return /* @__PURE__ */ jsxs12(Box12, { flexDirection: "column", children: [
18107
18099
  /* @__PURE__ */ jsx13(StepHeader, { step: "setup" }),
@@ -18119,7 +18111,7 @@ function PathValidationScreen({
18119
18111
  }
18120
18112
 
18121
18113
  // packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
18122
- import { useRef as useRef5, useState as useState9 } from "react";
18114
+ import { useRef as useRef4, useState as useState9 } from "react";
18123
18115
  import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
18124
18116
 
18125
18117
  // packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx
@@ -18371,7 +18363,7 @@ function CredentialsScreen({
18371
18363
  validate: validate3 = validateCredentials,
18372
18364
  tokensOnly = false
18373
18365
  }) {
18374
- const initialValues = useRef5(
18366
+ const initialValues = useRef4(
18375
18367
  normalize({
18376
18368
  spaceId: initial.spaceId ?? "",
18377
18369
  environmentId: initial.environmentId || "master",
@@ -18752,7 +18744,7 @@ function TokenReviewScreen({ tokensPath, onContinue, onQuit }) {
18752
18744
  init_config();
18753
18745
 
18754
18746
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-extraction.ts
18755
- import { useEffect as useEffect8, useRef as useRef6, useState as useState11 } from "react";
18747
+ import { useEffect as useEffect7, useRef as useRef5, useState as useState11 } from "react";
18756
18748
 
18757
18749
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/run.ts
18758
18750
  import { mkdir as mkdir8 } from "node:fs/promises";
@@ -19008,8 +19000,8 @@ async function resolveSelectionPrompt(overrides) {
19008
19000
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-extraction.ts
19009
19001
  function useExtraction(input) {
19010
19002
  const [state2, setState] = useState11();
19011
- const current = useRef6();
19012
- useEffect8(() => {
19003
+ const current = useRef5();
19004
+ useEffect7(() => {
19013
19005
  current.current = input;
19014
19006
  if (!input) {
19015
19007
  setState(void 0);
@@ -19035,7 +19027,7 @@ function useExtraction(input) {
19035
19027
  }
19036
19028
 
19037
19029
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-tokens-only.ts
19038
- import { useEffect as useEffect9, useRef as useRef7, useState as useState12 } from "react";
19030
+ import { useEffect as useEffect8, useRef as useRef6, useState as useState12 } from "react";
19039
19031
 
19040
19032
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/run-tokens-only.ts
19041
19033
  var TOKENS_SKILL_PATH2 = findSkillPath("generate-tokens.md");
@@ -19069,8 +19061,8 @@ async function runTokensOnly(input, deps = realDeps2) {
19069
19061
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-tokens-only.ts
19070
19062
  function useTokensOnly(input) {
19071
19063
  const [state2, setState] = useState12();
19072
- const current = useRef7();
19073
- useEffect9(() => {
19064
+ const current = useRef6();
19065
+ useEffect8(() => {
19074
19066
  current.current = input;
19075
19067
  if (!input) {
19076
19068
  setState(void 0);
@@ -20200,7 +20192,7 @@ import React11 from "react";
20200
20192
  import { Box as Box23, Text as Text24 } from "ink";
20201
20193
 
20202
20194
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/useImmediateInput.ts
20203
- import { useLayoutEffect, useRef as useRef8 } from "react";
20195
+ import { useLayoutEffect, useRef as useRef7 } from "react";
20204
20196
  import { useStdin } from "ink";
20205
20197
  function parseInput(data) {
20206
20198
  const isShiftTab = data === "\x1B[Z";
@@ -20263,7 +20255,7 @@ function registerInputHandler(stdin, setRawMode, handler) {
20263
20255
  }
20264
20256
  function useImmediateInput(handler, enabled = true) {
20265
20257
  const { stdin, setRawMode } = useStdin();
20266
- const handlerRef = useRef8(handler);
20258
+ const handlerRef = useRef7(handler);
20267
20259
  handlerRef.current = handler;
20268
20260
  useLayoutEffect(() => {
20269
20261
  if (!enabled) return;
@@ -20274,7 +20266,7 @@ function useImmediateInput(handler, enabled = true) {
20274
20266
 
20275
20267
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.ts
20276
20268
  import { useStdout as useStdout2 } from "ink";
20277
- import { useEffect as useEffect10, useState as useState13 } from "react";
20269
+ import { useEffect as useEffect9, useState as useState13 } from "react";
20278
20270
  function readTerminalSize(stdout) {
20279
20271
  return {
20280
20272
  columns: stdout?.columns ?? 80,
@@ -20284,7 +20276,7 @@ function readTerminalSize(stdout) {
20284
20276
  function useTerminalSize() {
20285
20277
  const { stdout } = useStdout2();
20286
20278
  const [size, setSize] = useState13(() => readTerminalSize(stdout));
20287
- useEffect10(() => {
20279
+ useEffect9(() => {
20288
20280
  const updateSize = () => setSize(readTerminalSize(stdout));
20289
20281
  stdout?.on("resize", updateSize);
20290
20282
  updateSize();
@@ -20467,7 +20459,7 @@ function createSidebarViewsHelpSection(includeBreaking) {
20467
20459
  }
20468
20460
 
20469
20461
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate.ts
20470
- import { useEffect as useEffect11, useMemo as useMemo3, useRef as useRef9, useState as useState16 } from "react";
20462
+ import { useEffect as useEffect10, useMemo as useMemo3, useRef as useRef8, useState as useState16 } from "react";
20471
20463
 
20472
20464
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/columns.ts
20473
20465
  var TWO_COLUMN_MIN_WIDTH = 100;
@@ -21203,8 +21195,8 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
21203
21195
  for (const p of cycleParticipants) seed.add(p);
21204
21196
  return seed;
21205
21197
  });
21206
- const seededGroupsRef = useRef9(closures.size > 0 || cycleParticipants.size > 0);
21207
- useEffect11(() => {
21198
+ const seededGroupsRef = useRef8(closures.size > 0 || cycleParticipants.size > 0);
21199
+ useEffect10(() => {
21208
21200
  if (seededGroupsRef.current) return;
21209
21201
  if (closures.size === 0 && cycleParticipants.size === 0) return;
21210
21202
  seededGroupsRef.current = true;
@@ -21295,7 +21287,7 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
21295
21287
  entryCount: 0
21296
21288
  });
21297
21289
  const panelLayout = useMemo3(() => computePanelLayout(visibleCount), [visibleCount]);
21298
- useEffect11(() => {
21290
+ useEffect10(() => {
21299
21291
  setNav((prev) => {
21300
21292
  const maxIdx = Math.max(0, visibleRows.length - 1);
21301
21293
  const nextCursor = Math.min(prev.cursor, maxIdx);
@@ -21770,7 +21762,7 @@ function ScopeGateView({ components, tokensPath, onConfirm, onQuit }) {
21770
21762
  }
21771
21763
 
21772
21764
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.ts
21773
- import { useEffect as useEffect12, useMemo as useMemo5, useRef as useRef10, useState as useState17 } from "react";
21765
+ import { useEffect as useEffect11, useMemo as useMemo5, useRef as useRef9, useState as useState17 } from "react";
21774
21766
 
21775
21767
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/cache-check.ts
21776
21768
  async function checkGenerationCache(input) {
@@ -21817,9 +21809,9 @@ var realDeps3 = { load: loadScopeGate, checkCache: checkGenerationCache };
21817
21809
  function useScopeGateFlow(input, deps = realDeps3) {
21818
21810
  const sessionId = input?.sessionId;
21819
21811
  const loaded = useMemo5(() => sessionId ? deps.load(sessionId) : void 0, [sessionId]);
21820
- const cacheCheck = useRef10(void 0);
21812
+ const cacheCheck = useRef9(void 0);
21821
21813
  const [confirmed, setConfirmed] = useState17();
21822
- useEffect12(() => {
21814
+ useEffect11(() => {
21823
21815
  if (!input || !loaded?.ok || cacheCheck.current) return;
21824
21816
  cacheCheck.current = deps.checkCache(input.cache);
21825
21817
  }, [input, loaded]);
@@ -21886,7 +21878,7 @@ function GenerationScreen({
21886
21878
  }
21887
21879
 
21888
21880
  // packages/experience-design-system-cli/src/tui/import/steps/08-generation/use-generation.ts
21889
- import { useEffect as useEffect13, useRef as useRef11, useState as useState18 } from "react";
21881
+ import { useEffect as useEffect12, useRef as useRef10, useState as useState18 } from "react";
21890
21882
 
21891
21883
  // packages/experience-design-system-cli/src/tui/import/steps/08-generation/run.ts
21892
21884
  import { resolve as resolve25 } from "node:path";
@@ -22051,8 +22043,8 @@ function applyProgressEvent2(event, previous, total) {
22051
22043
  // packages/experience-design-system-cli/src/tui/import/steps/08-generation/use-generation.ts
22052
22044
  function useGeneration(input) {
22053
22045
  const [state2, setState] = useState18();
22054
- const current = useRef11();
22055
- useEffect13(() => {
22046
+ const current = useRef10();
22047
+ useEffect12(() => {
22056
22048
  current.current = input;
22057
22049
  if (!input) {
22058
22050
  setState(void 0);
@@ -22533,7 +22525,7 @@ function PreviewValidationErrorScreen({
22533
22525
  }
22534
22526
 
22535
22527
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
22536
- import { useCallback as useCallback5, useEffect as useEffect20, useMemo as useMemo6, useRef as useRef16, useState as useState26 } from "react";
22528
+ import { useCallback as useCallback5, useEffect as useEffect19, useMemo as useMemo6, useRef as useRef15, useState as useState26 } from "react";
22537
22529
  import figures8 from "figures";
22538
22530
 
22539
22531
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
@@ -22794,7 +22786,7 @@ function enumerateCycleBreaks(cycle, components) {
22794
22786
  import { Box as Box32, Text as Text34 } from "ink";
22795
22787
 
22796
22788
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
22797
- import React13, { useEffect as useEffect14, useLayoutEffect as useLayoutEffect2, useState as useState19 } from "react";
22789
+ import React13, { useEffect as useEffect13, useLayoutEffect as useLayoutEffect2, useState as useState19 } from "react";
22798
22790
  import figures6 from "figures";
22799
22791
  import { Box as Box26, measureElement, Text as Text27 } from "ink";
22800
22792
 
@@ -24352,7 +24344,7 @@ function FieldEditor({
24352
24344
  }
24353
24345
  return Math.max(start + 1, end2);
24354
24346
  };
24355
- useEffect14(() => {
24347
+ useEffect13(() => {
24356
24348
  if (focusLevel === "field" || selectedRowIdx < 0) return;
24357
24349
  setListScrollStart((previous) => {
24358
24350
  if (initialFocusTarget && !initialFocusScrollApplied.current) {
@@ -25424,7 +25416,7 @@ function finalizeReviewSession(extractSessionId, components) {
25424
25416
  }
25425
25417
 
25426
25418
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-session.ts
25427
- import { useCallback as useCallback2, useEffect as useEffect16, useRef as useRef13, useState as useState21 } from "react";
25419
+ import { useCallback as useCallback2, useEffect as useEffect15, useRef as useRef12, useState as useState21 } from "react";
25428
25420
 
25429
25421
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/history.ts
25430
25422
  var DEFAULT_MAX_DEPTH = 50;
@@ -25480,7 +25472,7 @@ function createHistoryStack(seed, maxDepth = DEFAULT_MAX_DEPTH) {
25480
25472
  }
25481
25473
 
25482
25474
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-finalize-preview.ts
25483
- import { useEffect as useEffect15, useRef as useRef12, useState as useState20 } from "react";
25475
+ import { useEffect as useEffect14, useRef as useRef11, useState as useState20 } from "react";
25484
25476
 
25485
25477
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/run-live-preview.ts
25486
25478
  var TimeoutError = class extends Error {
@@ -25638,9 +25630,9 @@ function useFinalizePreview(opts) {
25638
25630
  const [status, setStatus] = useState20("idle");
25639
25631
  const [removed, setRemoved] = useState20([]);
25640
25632
  const [scrollOffset, setScrollOffset] = useState20(0);
25641
- const generationRef = useRef12(0);
25633
+ const generationRef = useRef11(0);
25642
25634
  const acceptedKey = [...acceptedKeys].sort().join("\0");
25643
- useEffect15(() => {
25635
+ useEffect14(() => {
25644
25636
  if (!open) {
25645
25637
  setStatus("idle");
25646
25638
  setRemoved([]);
@@ -25703,7 +25695,7 @@ function useReviewSession({
25703
25695
  }));
25704
25696
  return { result, catalog };
25705
25697
  }, [loadSession, tokensPath]);
25706
- useEffect16(() => {
25698
+ useEffect15(() => {
25707
25699
  let disposed = false;
25708
25700
  void (async () => {
25709
25701
  try {
@@ -25756,7 +25748,7 @@ function useReviewSession({
25756
25748
  function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
25757
25749
  const [reviewMetadata, setReviewMetadata] = useState21(null);
25758
25750
  const [componentRationale, setComponentRationale] = useState21(null);
25759
- useEffect16(() => {
25751
+ useEffect15(() => {
25760
25752
  const current = components[selectedIdx];
25761
25753
  if (!current) {
25762
25754
  setReviewMetadata(null);
@@ -25786,9 +25778,9 @@ function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
25786
25778
  return { reviewMetadata, componentRationale };
25787
25779
  }
25788
25780
  function useReviewHistory({ loading, components, createSnapshot, applySnapshot }) {
25789
- const historyRef = useRef13(null);
25790
- const historySeededRef = useRef13(false);
25791
- useEffect16(() => {
25781
+ const historyRef = useRef12(null);
25782
+ const historySeededRef = useRef12(false);
25783
+ useEffect15(() => {
25792
25784
  if (loading || historySeededRef.current) return;
25793
25785
  historySeededRef.current = true;
25794
25786
  historyRef.current = createHistoryStack(createSnapshot(components));
@@ -25839,7 +25831,7 @@ function useReviewFinalize({
25839
25831
  }
25840
25832
 
25841
25833
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-editor.ts
25842
- import { useEffect as useEffect17, useRef as useRef14, useState as useState22 } from "react";
25834
+ import { useEffect as useEffect16, useRef as useRef13, useState as useState22 } from "react";
25843
25835
 
25844
25836
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/token-suggestions.ts
25845
25837
  function collectTokenSuggestions(entry, availableTokens = []) {
@@ -25890,9 +25882,9 @@ function useReviewEditor({
25890
25882
  const [tokenReviewEditing, setTokenReviewEditing] = useState22(false);
25891
25883
  const [tokenReviewEditCursor, setTokenReviewEditCursor] = useState22(0);
25892
25884
  const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState22(/* @__PURE__ */ new Set());
25893
- const tokenReviewSuggestedRef = useRef14(/* @__PURE__ */ new Map());
25894
- const pendingGRef = useRef14(false);
25895
- useEffect17(() => {
25885
+ const tokenReviewSuggestedRef = useRef13(/* @__PURE__ */ new Map());
25886
+ const pendingGRef = useRef13(false);
25887
+ useEffect16(() => {
25896
25888
  setTokenReviewRow(0);
25897
25889
  setTokenReviewEditing(false);
25898
25890
  setTokenReviewEditCursor(0);
@@ -26304,7 +26296,7 @@ function handleJsonPanelInput(input, key, state2) {
26304
26296
  }
26305
26297
 
26306
26298
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-preview.ts
26307
- import { useCallback as useCallback4, useEffect as useEffect19, useState as useState25 } from "react";
26299
+ import { useCallback as useCallback4, useEffect as useEffect18, useState as useState25 } from "react";
26308
26300
 
26309
26301
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/preview-annotations.ts
26310
26302
  function applyPreviewAnnotations(preview, localNames) {
@@ -26339,25 +26331,25 @@ function applyPreviewAnnotations(preview, localNames) {
26339
26331
  }
26340
26332
 
26341
26333
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-live-preview.ts
26342
- import { useCallback as useCallback3, useEffect as useEffect18, useRef as useRef15, useState as useState24 } from "react";
26334
+ import { useCallback as useCallback3, useEffect as useEffect17, useRef as useRef14, useState as useState24 } from "react";
26343
26335
  var DEFAULT_DEBOUNCE_MS = 500;
26344
26336
  function useLivePreview(opts) {
26345
26337
  const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
26346
26338
  const [status, setStatus] = useState24("idle");
26347
26339
  const [disabled, setDisabled] = useState24(false);
26348
- const timerRef = useRef15(null);
26349
- const generationRef = useRef15(0);
26350
- const latestRef = useRef15(0);
26351
- const inflightRef = useRef15(0);
26352
- const optsRef = useRef15(opts);
26353
- useEffect18(() => {
26340
+ const timerRef = useRef14(null);
26341
+ const generationRef = useRef14(0);
26342
+ const latestRef = useRef14(0);
26343
+ const inflightRef = useRef14(0);
26344
+ const optsRef = useRef14(opts);
26345
+ useEffect17(() => {
26354
26346
  optsRef.current = opts;
26355
26347
  });
26356
- const disabledRef = useRef15(disabled);
26357
- useEffect18(() => {
26348
+ const disabledRef = useRef14(disabled);
26349
+ useEffect17(() => {
26358
26350
  disabledRef.current = disabled;
26359
26351
  }, [disabled]);
26360
- useEffect18(() => {
26352
+ useEffect17(() => {
26361
26353
  return () => {
26362
26354
  if (timerRef.current) {
26363
26355
  clearTimeout(timerRef.current);
@@ -26471,13 +26463,13 @@ function useReviewPreview({
26471
26463
  deleteAllComponents
26472
26464
  });
26473
26465
  const [spinnerTick, setSpinnerTick] = useState25(0);
26474
- useEffect19(() => {
26466
+ useEffect18(() => {
26475
26467
  if (livePreviewHook.status !== "running") return;
26476
26468
  const id = setInterval(() => setSpinnerTick((tick) => tick + 1), 80);
26477
26469
  return () => clearInterval(id);
26478
26470
  }, [livePreviewHook.status]);
26479
26471
  const livePreviewSpinner = SPINNER_FRAMES[spinnerTick % SPINNER_FRAMES.length];
26480
- useEffect19(() => {
26472
+ useEffect18(() => {
26481
26473
  if (loading) return;
26482
26474
  if (!livePreview) return;
26483
26475
  if (components.length === 0) return;
@@ -26790,7 +26782,7 @@ function GenerateReviewStepView({
26790
26782
  setFinalizeError
26791
26783
  } = reviewSurface;
26792
26784
  const [removedBannerCollapsed, setRemovedBannerCollapsed] = useState26(false);
26793
- const removedBannerDefaultedRef = useRef16(false);
26785
+ const removedBannerDefaultedRef = useRef15(false);
26794
26786
  const [cyclePanelScroll, setCyclePanelScroll] = useState26(0);
26795
26787
  const [cyclesCursor, setCyclesCursor] = useState26(0);
26796
26788
  const cyclePanel = useOverlayPanel({
@@ -26810,7 +26802,7 @@ function GenerateReviewStepView({
26810
26802
  const [breakCursor, setBreakCursor] = useState26(0);
26811
26803
  const [breakConfirm, setBreakConfirm] = useState26(false);
26812
26804
  const [expandedGroups, setExpandedGroups] = useState26(/* @__PURE__ */ new Set());
26813
- const seededGroupsRef = useRef16(false);
26805
+ const seededGroupsRef = useRef15(false);
26814
26806
  const {
26815
26807
  searchOpen,
26816
26808
  setSearchOpen,
@@ -26834,7 +26826,7 @@ function GenerateReviewStepView({
26834
26826
  const [pendingEditorFocus, setPendingEditorFocus] = useState26(null);
26835
26827
  const [autoRejected, setAutoRejected] = useState26([]);
26836
26828
  const [undoSnapshot, setUndoSnapshot] = useState26(null);
26837
- const autoRejectFiredRef = useRef16(false);
26829
+ const autoRejectFiredRef = useRef15(false);
26838
26830
  const [showReloadDialog, setShowReloadDialog] = useState26(false);
26839
26831
  const acceptedCountForPreview = components.filter((c2) => c2.status === "accepted").length;
26840
26832
  const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
@@ -26897,7 +26889,7 @@ function GenerateReviewStepView({
26897
26889
  [components]
26898
26890
  );
26899
26891
  const closures = useMemo6(() => computeAllClosures(componentGraph), [componentGraph]);
26900
- useEffect20(() => {
26892
+ useEffect19(() => {
26901
26893
  if (seededGroupsRef.current) return;
26902
26894
  if (closures.size === 0 && slotCycles.length === 0) return;
26903
26895
  seededGroupsRef.current = true;
@@ -26924,7 +26916,7 @@ function GenerateReviewStepView({
26924
26916
  suggestedBreak: cycle.edges.length > 0 ? suggestCycleBreakEdge2(cycle, cycleView.pushBlocking) : null
26925
26917
  }));
26926
26918
  }, [slotCycles, cycleView]);
26927
- useEffect20(() => {
26919
+ useEffect19(() => {
26928
26920
  const decision = computeAutoRejectDecision({
26929
26921
  loading,
26930
26922
  autoRejectFired: autoRejectFiredRef.current,
@@ -26967,8 +26959,8 @@ function GenerateReviewStepView({
26967
26959
  }),
26968
26960
  applySnapshot: applyHistorySnapshot
26969
26961
  });
26970
- const autoRejectPushedRef = useRef16(false);
26971
- useEffect20(() => {
26962
+ const autoRejectPushedRef = useRef15(false);
26963
+ useEffect19(() => {
26972
26964
  if (loading) return;
26973
26965
  if (!historySeededRef.current) return;
26974
26966
  if (!autoRejectFiredRef.current) return;
@@ -27052,7 +27044,7 @@ function GenerateReviewStepView({
27052
27044
  const panelHeight = leftPanelHeight + 2;
27053
27045
  const panelContentHeight = Math.max(1, panelHeight - 3);
27054
27046
  const cycleViewportHeight = Math.max(1, panelHeight - 4);
27055
- useEffect20(() => {
27047
+ useEffect19(() => {
27056
27048
  if (selectableRowPositions.length === 0) return;
27057
27049
  const cursorInRange = selectableRowPositions.includes(cursorRowIdx);
27058
27050
  const maxScroll = Math.max(0, visibleRowsMemo.length - visibleCount);
@@ -27997,10 +27989,10 @@ function normalizePath(input) {
27997
27989
  }
27998
27990
 
27999
27991
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-blinking-cursor.ts
28000
- import { useEffect as useEffect21, useState as useState27 } from "react";
27992
+ import { useEffect as useEffect20, useState as useState27 } from "react";
28001
27993
  function useBlinkingCursor() {
28002
27994
  const [visible, setVisible] = useState27(true);
28003
- useEffect21(() => {
27995
+ useEffect20(() => {
28004
27996
  const interval = setInterval(() => setVisible((current) => !current), 500);
28005
27997
  return () => clearInterval(interval);
28006
27998
  }, []);
@@ -28116,12 +28108,12 @@ function countedThings({ components, tokens }, counts = {}) {
28116
28108
  }
28117
28109
 
28118
28110
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
28119
- import { useEffect as useEffect22, useState as useState29 } from "react";
28111
+ import { useEffect as useEffect21, useState as useState29 } from "react";
28120
28112
  import { Spinner as Spinner2 } from "@inkjs/ui";
28121
28113
  import { jsx as jsx53 } from "react/jsx-runtime";
28122
28114
  function useTimedSpinner() {
28123
28115
  const [elapsedSeconds, setElapsedSeconds] = useState29(0);
28124
- useEffect22(() => {
28116
+ useEffect21(() => {
28125
28117
  const timer = setInterval(() => setElapsedSeconds((current) => current + 1), 1e3);
28126
28118
  return () => {
28127
28119
  clearInterval(timer);
@@ -28179,7 +28171,7 @@ function PushingStep({ progress, produced, counts }) {
28179
28171
  }
28180
28172
 
28181
28173
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
28182
- import { useEffect as useEffect23, useState as useState30, useMemo as useMemo7 } from "react";
28174
+ import { useEffect as useEffect22, useState as useState30, useMemo as useMemo7 } from "react";
28183
28175
  import { Box as Box44, Text as Text46 } from "ink";
28184
28176
 
28185
28177
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/preview-diff.ts
@@ -28574,7 +28566,7 @@ function WizardPreviewStep({
28574
28566
  const activeLines = diffExpanded ? diffLines : summaryLines;
28575
28567
  const maxScroll = Math.max(0, activeLines.length - viewportHeight);
28576
28568
  const boundedScrollOffset = Math.min(scrollOffset, maxScroll);
28577
- useEffect23(() => {
28569
+ useEffect22(() => {
28578
28570
  setScrollOffset((previous) => Math.min(previous, maxScroll));
28579
28571
  }, [maxScroll]);
28580
28572
  useImmediateInput((input, key) => {
@@ -28792,7 +28784,7 @@ function FlowScreen({
28792
28784
  }
28793
28785
 
28794
28786
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
28795
- import { useEffect as useEffect24, useRef as useRef17, useSyncExternalStore } from "react";
28787
+ import { useEffect as useEffect23, useRef as useRef16, useSyncExternalStore } from "react";
28796
28788
 
28797
28789
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/controller.ts
28798
28790
  import { appendFileSync, writeFileSync } from "node:fs";
@@ -29534,7 +29526,7 @@ function createFlowController(start, deps) {
29534
29526
 
29535
29527
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
29536
29528
  function useFlow(start, options = {}) {
29537
- const controller = useRef17();
29529
+ const controller = useRef16();
29538
29530
  if (start && !controller.current) {
29539
29531
  try {
29540
29532
  startWizardLog();
@@ -29551,14 +29543,14 @@ function useFlow(start, options = {}) {
29551
29543
  (listener) => current?.subscribe(listener) ?? (() => void 0),
29552
29544
  () => current?.getState()
29553
29545
  );
29554
- useEffect24(() => {
29546
+ useEffect23(() => {
29555
29547
  if (!start) controller.current = void 0;
29556
29548
  }, [start]);
29557
29549
  return current && state2 ? { controller: current, state: state2 } : void 0;
29558
29550
  }
29559
29551
 
29560
29552
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
29561
- import { useEffect as useEffect25, useState as useState31 } from "react";
29553
+ import { useEffect as useEffect24, useState as useState31 } from "react";
29562
29554
  import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
29563
29555
  init_debug_store();
29564
29556
 
@@ -29632,7 +29624,7 @@ function Section({ title, rows }) {
29632
29624
  }
29633
29625
  function HelpScreen({ onDone }) {
29634
29626
  const [info, setInfo] = useState31();
29635
- useEffect25(() => {
29627
+ useEffect24(() => {
29636
29628
  startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
29637
29629
  void readHelpInfo().then(setInfo);
29638
29630
  }, []);
@@ -29729,7 +29721,7 @@ import { useState as useState36 } from "react";
29729
29721
  import { Box as Box51, Text as Text53, useInput as useInput17 } from "ink";
29730
29722
 
29731
29723
  // packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
29732
- import { useEffect as useEffect27, useRef as useRef18, useState as useState34 } from "react";
29724
+ import { useEffect as useEffect26, useRef as useRef17, useState as useState34 } from "react";
29733
29725
  import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
29734
29726
  init_debug_store();
29735
29727
 
@@ -30058,7 +30050,7 @@ async function writeAgentConfig(config) {
30058
30050
  }
30059
30051
 
30060
30052
  // packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
30061
- import { useEffect as useEffect26, useState as useState33 } from "react";
30053
+ import { useEffect as useEffect25, useState as useState33 } from "react";
30062
30054
  import { Box as Box48, Text as Text50 } from "ink";
30063
30055
 
30064
30056
  // packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentStatusBadge.tsx
@@ -30121,7 +30113,7 @@ function AgentDetail({
30121
30113
  const [testing, setTesting] = useState33(false);
30122
30114
  const [notice, setNotice] = useState33(null);
30123
30115
  const [checks, setChecks] = useState33(void 0);
30124
- useEffect26(() => {
30116
+ useEffect25(() => {
30125
30117
  let active = true;
30126
30118
  setChecks(void 0);
30127
30119
  const timer = setTimeout(() => {
@@ -30206,7 +30198,7 @@ function AgentsScreen({ onDone }) {
30206
30198
  const [saving, setSaving] = useState34(false);
30207
30199
  const [loadError, setLoadError] = useState34(null);
30208
30200
  const [checks, setChecks] = useState34({});
30209
- const visit = useRef18({
30201
+ const visit = useRef17({
30210
30202
  trail: createTrail(),
30211
30203
  before: void 0,
30212
30204
  environment: void 0,
@@ -30219,7 +30211,7 @@ function AgentsScreen({ onDone }) {
30219
30211
  );
30220
30212
  }
30221
30213
  };
30222
- useEffect27(() => {
30214
+ useEffect26(() => {
30223
30215
  readAgentConfig().then((loaded) => {
30224
30216
  setConfig(loaded);
30225
30217
  inspectAll(loaded);
@@ -30396,7 +30388,7 @@ function AgentsScreen({ onDone }) {
30396
30388
  }
30397
30389
 
30398
30390
  // packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
30399
- import { useEffect as useEffect28, useRef as useRef19, useState as useState35 } from "react";
30391
+ import { useEffect as useEffect27, useRef as useRef18, useState as useState35 } from "react";
30400
30392
  import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
30401
30393
  init_debug_store();
30402
30394
 
@@ -30454,14 +30446,14 @@ function ProjectScreen({ onDone }) {
30454
30446
  const [saving, setSaving] = useState35(false);
30455
30447
  const [notice, setNotice] = useState35(null);
30456
30448
  const [loadError, setLoadError] = useState35(null);
30457
- const visit = useRef19({
30449
+ const visit = useRef18({
30458
30450
  trail: createTrail(),
30459
30451
  before: void 0,
30460
30452
  persisted: void 0,
30461
30453
  error: ""
30462
30454
  }).current;
30463
30455
  const scrub = (err) => scrubError(err, [config?.cmaToken ?? ""]);
30464
- useEffect28(() => {
30456
+ useEffect27(() => {
30465
30457
  readCredentials().then((cfg) => {
30466
30458
  setConfig(cfg);
30467
30459
  visit.before = snapshotOf(cfg);
@@ -30613,7 +30605,7 @@ function ConfigurationScreen({ onDone }) {
30613
30605
  }
30614
30606
 
30615
30607
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
30616
- import { useEffect as useEffect29, useState as useState37 } from "react";
30608
+ import { useEffect as useEffect28, useState as useState37 } from "react";
30617
30609
  import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
30618
30610
 
30619
30611
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
@@ -30637,7 +30629,7 @@ import { Fragment as Fragment20, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-
30637
30629
  function OptInAnalyticsScreen({ onDone }) {
30638
30630
  const [loading, setLoading] = useState37(true);
30639
30631
  const [enabled, setEnabled] = useState37(true);
30640
- useEffect29(() => {
30632
+ useEffect28(() => {
30641
30633
  readAnalyticsSetting().then((setting) => {
30642
30634
  setEnabled(setting.enabled);
30643
30635
  setLoading(false);
@@ -30691,7 +30683,7 @@ function OptInAnalyticsScreen({ onDone }) {
30691
30683
  }
30692
30684
 
30693
30685
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
30694
- import { useEffect as useEffect30, useRef as useRef20, useState as useState38 } from "react";
30686
+ import { useEffect as useEffect29, useRef as useRef19, useState as useState38 } from "react";
30695
30687
  import { Box as Box53, Text as Text55, useInput as useInput19 } from "ink";
30696
30688
  init_debug_mode_store();
30697
30689
  init_debug_store();
@@ -30708,8 +30700,8 @@ function DebugModeScreen({ onDone }) {
30708
30700
  RETENTION_CHOICES[RETENTION_CHOICES.length - 1]
30709
30701
  );
30710
30702
  const [notice, setNotice] = useState38(null);
30711
- const visit = useRef20({ trail: createTrail(), before: void 0, error: "" }).current;
30712
- useEffect30(() => {
30703
+ const visit = useRef19({ trail: createTrail(), before: void 0, error: "" }).current;
30704
+ useEffect29(() => {
30713
30705
  readDebugModeSetting().then((loaded) => {
30714
30706
  setSetting(loaded);
30715
30707
  setPending(loaded.retentionDays);
@@ -30864,7 +30856,7 @@ function App({ importOptions, inkClear }) {
30864
30856
  const [flowStart, setFlowStart] = useState39();
30865
30857
  const flow = useFlow(flowStart, { beforeStepChange: inkClear });
30866
30858
  const [importDefaults, setImportDefaults] = useState39();
30867
- useEffect31(() => {
30859
+ useEffect30(() => {
30868
30860
  if (screen !== "import") {
30869
30861
  setImportDefaults(void 0);
30870
30862
  return;
@@ -30937,7 +30929,7 @@ function App({ importOptions, inkClear }) {
30937
30929
  }
30938
30930
  });
30939
30931
  };
30940
- useEffect31(() => {
30932
+ useEffect30(() => {
30941
30933
  if (!tokensOnlyRun || tokensOnly?.status !== "done" || !tokensOnly.result.ok) return;
30942
30934
  const { credentialsSkipped, input, tokens } = tokensOnlyRun;
30943
30935
  const { tokensPath, tokenSessionId, tokenCount } = tokensOnly.result;
@@ -30959,12 +30951,12 @@ function App({ importOptions, inkClear }) {
30959
30951
  }
30960
30952
  });
30961
30953
  }, [tokensOnly, tokensOnlyRun]);
30962
- useEffect31(() => {
30954
+ useEffect30(() => {
30963
30955
  if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
30964
30956
  setExtractionRun(void 0);
30965
30957
  setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
30966
30958
  }, [extraction, extractionRun]);
30967
- useEffect31(() => {
30959
+ useEffect30(() => {
30968
30960
  if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
30969
30961
  const { extraction: produced, input, generatePromptPath } = scopeRun;
30970
30962
  setGenerationInput({
@@ -30982,7 +30974,7 @@ function App({ importOptions, inkClear }) {
30982
30974
  ...generatePromptPath ? { generatePromptPath } : {}
30983
30975
  });
30984
30976
  }, [scopeFlow, scopeRun, generationInput]);
30985
- useEffect31(() => {
30977
+ useEffect30(() => {
30986
30978
  if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
30987
30979
  const { credentialsSkipped, extraction: produced, input, generatePromptPath } = scopeRun;
30988
30980
  inkClear();
@@ -31075,7 +31067,6 @@ function App({ importOptions, inkClear }) {
31075
31067
  return /* @__PURE__ */ jsx66(
31076
31068
  TokenInputScreen,
31077
31069
  {
31078
- mode: target,
31079
31070
  initialPath: importDefaults.tokenFile,
31080
31071
  onConfirm: (tokensPath) => answer({ tokensPath }),
31081
31072
  onBack: () => goBackFrom("token-file")
@@ -31085,6 +31076,7 @@ function App({ importOptions, inkClear }) {
31085
31076
  return /* @__PURE__ */ jsx66(
31086
31077
  PathValidationScreen,
31087
31078
  {
31079
+ mode: target,
31088
31080
  projectPath: answers.projectPath ?? "",
31089
31081
  hasTokens: target !== "components",
31090
31082
  onConfirm: ({ filePaths }) => answer({ scannedFiles: filePaths }),