@contentful/experience-design-system-cli 2.40.0 → 2.40.1-dev-build-08f065f9.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 useEffect29, 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";
@@ -3158,8 +3158,9 @@ function PreflightScreen({ onChoose, onQuit }) {
3158
3158
  }
3159
3159
 
3160
3160
  // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
3161
- import { useState as useState5 } from "react";
3161
+ import { useEffect as useEffect5, useRef as useRef3, useState as useState5 } from "react";
3162
3162
  import { Box as Box10, Text as Text10 } from "ink";
3163
+ init_debug_store();
3163
3164
 
3164
3165
  // packages/experience-design-system-cli/src/tui/shared/components/ClearableTextInput.tsx
3165
3166
  import { useRef as useRef2 } from "react";
@@ -3216,12 +3217,46 @@ function useWelcomeControls(onQuit) {
3216
3217
 
3217
3218
  // packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx
3218
3219
  import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
3219
- function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
3220
+ function WelcomeScreen({ mode, onContinue, onQuit, initialPath = "" }) {
3220
3221
  const [projectPath, setProjectPath] = useState5(initialPath);
3221
- useWelcomeControls(onQuit);
3222
+ const visit = useRef3({ emptySubmits: 0 }).current;
3223
+ useEffect5(() => {
3224
+ startDebugRun({
3225
+ flow: "import/welcome",
3226
+ step: "01-welcome",
3227
+ menuOption: "Welcome",
3228
+ inputs: { import_mode: mode, initial_path: initialPath }
3229
+ });
3230
+ }, []);
3231
+ const quit = () => {
3232
+ void finishDebugRun({
3233
+ outputs: {
3234
+ project_path: null,
3235
+ typed_something: toProjectPath(projectPath) !== null,
3236
+ empty_submits: visit.emptySubmits
3237
+ },
3238
+ status: "success",
3239
+ exitMethod: "discarded"
3240
+ });
3241
+ onQuit();
3242
+ };
3243
+ useWelcomeControls(quit);
3222
3244
  const submit = (value) => {
3223
3245
  const path5 = toProjectPath(value);
3224
- if (path5) onContinue(path5);
3246
+ if (!path5) {
3247
+ visit.emptySubmits += 1;
3248
+ return;
3249
+ }
3250
+ void finishDebugRun({
3251
+ outputs: {
3252
+ project_path: path5,
3253
+ changed_from_initial: path5 !== initialPath.trim(),
3254
+ empty_submits: visit.emptySubmits
3255
+ },
3256
+ status: "success",
3257
+ exitMethod: "saved"
3258
+ });
3259
+ onContinue(path5);
3225
3260
  };
3226
3261
  return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
3227
3262
  /* @__PURE__ */ jsx11(StepHeader, { step: "setup" }),
@@ -3354,7 +3389,7 @@ function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
3354
3389
  }
3355
3390
 
3356
3391
  // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
3357
- import { useEffect as useEffect5, useMemo, useState as useState7 } from "react";
3392
+ import { useEffect as useEffect6, useMemo, useState as useState7 } from "react";
3358
3393
  import { Box as Box12, Text as Text12 } from "ink";
3359
3394
 
3360
3395
  // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/controls.ts
@@ -18011,7 +18046,7 @@ function PathValidationScreen({
18011
18046
  }) {
18012
18047
  const resolvedPath = useMemo(() => resolveUserPath(projectPath), [projectPath]);
18013
18048
  const [scan, setScan] = useState7();
18014
- useEffect5(() => {
18049
+ useEffect6(() => {
18015
18050
  setScan(scanFiles(resolvedPath));
18016
18051
  }, [resolvedPath]);
18017
18052
  const phase = phaseOf(scan);
@@ -18038,7 +18073,7 @@ function PathValidationScreen({
18038
18073
  }
18039
18074
 
18040
18075
  // packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx
18041
- import { useRef as useRef3, useState as useState9 } from "react";
18076
+ import { useRef as useRef4, useState as useState9 } from "react";
18042
18077
  import { Box as Box14, Text as Text14, useInput as useInput11 } from "ink";
18043
18078
 
18044
18079
  // packages/experience-design-system-cli/src/tui/shared/components/FieldForm.tsx
@@ -18290,7 +18325,7 @@ function CredentialsScreen({
18290
18325
  validate: validate3 = validateCredentials,
18291
18326
  tokensOnly = false
18292
18327
  }) {
18293
- const initialValues = useRef3(
18328
+ const initialValues = useRef4(
18294
18329
  normalize({
18295
18330
  spaceId: initial.spaceId ?? "",
18296
18331
  environmentId: initial.environmentId || "master",
@@ -18671,7 +18706,7 @@ function TokenReviewScreen({ tokensPath, onContinue, onQuit }) {
18671
18706
  init_config();
18672
18707
 
18673
18708
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-extraction.ts
18674
- import { useEffect as useEffect6, useRef as useRef4, useState as useState11 } from "react";
18709
+ import { useEffect as useEffect7, useRef as useRef5, useState as useState11 } from "react";
18675
18710
 
18676
18711
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/run.ts
18677
18712
  import { mkdir as mkdir8 } from "node:fs/promises";
@@ -18927,8 +18962,8 @@ async function resolveSelectionPrompt(overrides) {
18927
18962
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-extraction.ts
18928
18963
  function useExtraction(input) {
18929
18964
  const [state2, setState] = useState11();
18930
- const current = useRef4();
18931
- useEffect6(() => {
18965
+ const current = useRef5();
18966
+ useEffect7(() => {
18932
18967
  current.current = input;
18933
18968
  if (!input) {
18934
18969
  setState(void 0);
@@ -18954,7 +18989,7 @@ function useExtraction(input) {
18954
18989
  }
18955
18990
 
18956
18991
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-tokens-only.ts
18957
- import { useEffect as useEffect7, useRef as useRef5, useState as useState12 } from "react";
18992
+ import { useEffect as useEffect8, useRef as useRef6, useState as useState12 } from "react";
18958
18993
 
18959
18994
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/run-tokens-only.ts
18960
18995
  var TOKENS_SKILL_PATH2 = findSkillPath("generate-tokens.md");
@@ -18988,8 +19023,8 @@ async function runTokensOnly(input, deps = realDeps2) {
18988
19023
  // packages/experience-design-system-cli/src/tui/import/steps/06-extraction/use-tokens-only.ts
18989
19024
  function useTokensOnly(input) {
18990
19025
  const [state2, setState] = useState12();
18991
- const current = useRef5();
18992
- useEffect7(() => {
19026
+ const current = useRef6();
19027
+ useEffect8(() => {
18993
19028
  current.current = input;
18994
19029
  if (!input) {
18995
19030
  setState(void 0);
@@ -20119,7 +20154,7 @@ import React11 from "react";
20119
20154
  import { Box as Box23, Text as Text24 } from "ink";
20120
20155
 
20121
20156
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/useImmediateInput.ts
20122
- import { useLayoutEffect, useRef as useRef6 } from "react";
20157
+ import { useLayoutEffect, useRef as useRef7 } from "react";
20123
20158
  import { useStdin } from "ink";
20124
20159
  function parseInput(data) {
20125
20160
  const isShiftTab = data === "\x1B[Z";
@@ -20182,7 +20217,7 @@ function registerInputHandler(stdin, setRawMode, handler) {
20182
20217
  }
20183
20218
  function useImmediateInput(handler, enabled = true) {
20184
20219
  const { stdin, setRawMode } = useStdin();
20185
- const handlerRef = useRef6(handler);
20220
+ const handlerRef = useRef7(handler);
20186
20221
  handlerRef.current = handler;
20187
20222
  useLayoutEffect(() => {
20188
20223
  if (!enabled) return;
@@ -20193,7 +20228,7 @@ function useImmediateInput(handler, enabled = true) {
20193
20228
 
20194
20229
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.ts
20195
20230
  import { useStdout as useStdout2 } from "ink";
20196
- import { useEffect as useEffect8, useState as useState13 } from "react";
20231
+ import { useEffect as useEffect9, useState as useState13 } from "react";
20197
20232
  function readTerminalSize(stdout) {
20198
20233
  return {
20199
20234
  columns: stdout?.columns ?? 80,
@@ -20203,7 +20238,7 @@ function readTerminalSize(stdout) {
20203
20238
  function useTerminalSize() {
20204
20239
  const { stdout } = useStdout2();
20205
20240
  const [size, setSize] = useState13(() => readTerminalSize(stdout));
20206
- useEffect8(() => {
20241
+ useEffect9(() => {
20207
20242
  const updateSize = () => setSize(readTerminalSize(stdout));
20208
20243
  stdout?.on("resize", updateSize);
20209
20244
  updateSize();
@@ -20386,7 +20421,7 @@ function createSidebarViewsHelpSection(includeBreaking) {
20386
20421
  }
20387
20422
 
20388
20423
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate.ts
20389
- import { useEffect as useEffect9, useMemo as useMemo3, useRef as useRef7, useState as useState16 } from "react";
20424
+ import { useEffect as useEffect10, useMemo as useMemo3, useRef as useRef8, useState as useState16 } from "react";
20390
20425
 
20391
20426
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/columns.ts
20392
20427
  var TWO_COLUMN_MIN_WIDTH = 100;
@@ -21122,8 +21157,8 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
21122
21157
  for (const p of cycleParticipants) seed.add(p);
21123
21158
  return seed;
21124
21159
  });
21125
- const seededGroupsRef = useRef7(closures.size > 0 || cycleParticipants.size > 0);
21126
- useEffect9(() => {
21160
+ const seededGroupsRef = useRef8(closures.size > 0 || cycleParticipants.size > 0);
21161
+ useEffect10(() => {
21127
21162
  if (seededGroupsRef.current) return;
21128
21163
  if (closures.size === 0 && cycleParticipants.size === 0) return;
21129
21164
  seededGroupsRef.current = true;
@@ -21214,7 +21249,7 @@ function useScopeGate({ components, tokenCount, tokensWidth, onConfirm, onQuit }
21214
21249
  entryCount: 0
21215
21250
  });
21216
21251
  const panelLayout = useMemo3(() => computePanelLayout(visibleCount), [visibleCount]);
21217
- useEffect9(() => {
21252
+ useEffect10(() => {
21218
21253
  setNav((prev) => {
21219
21254
  const maxIdx = Math.max(0, visibleRows.length - 1);
21220
21255
  const nextCursor = Math.min(prev.cursor, maxIdx);
@@ -21689,7 +21724,7 @@ function ScopeGateView({ components, tokensPath, onConfirm, onQuit }) {
21689
21724
  }
21690
21725
 
21691
21726
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.ts
21692
- import { useEffect as useEffect10, useMemo as useMemo5, useRef as useRef8, useState as useState17 } from "react";
21727
+ import { useEffect as useEffect11, useMemo as useMemo5, useRef as useRef9, useState as useState17 } from "react";
21693
21728
 
21694
21729
  // packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/cache-check.ts
21695
21730
  async function checkGenerationCache(input) {
@@ -21736,9 +21771,9 @@ var realDeps3 = { load: loadScopeGate, checkCache: checkGenerationCache };
21736
21771
  function useScopeGateFlow(input, deps = realDeps3) {
21737
21772
  const sessionId = input?.sessionId;
21738
21773
  const loaded = useMemo5(() => sessionId ? deps.load(sessionId) : void 0, [sessionId]);
21739
- const cacheCheck = useRef8(void 0);
21774
+ const cacheCheck = useRef9(void 0);
21740
21775
  const [confirmed, setConfirmed] = useState17();
21741
- useEffect10(() => {
21776
+ useEffect11(() => {
21742
21777
  if (!input || !loaded?.ok || cacheCheck.current) return;
21743
21778
  cacheCheck.current = deps.checkCache(input.cache);
21744
21779
  }, [input, loaded]);
@@ -21805,7 +21840,7 @@ function GenerationScreen({
21805
21840
  }
21806
21841
 
21807
21842
  // packages/experience-design-system-cli/src/tui/import/steps/08-generation/use-generation.ts
21808
- import { useEffect as useEffect11, useRef as useRef9, useState as useState18 } from "react";
21843
+ import { useEffect as useEffect12, useRef as useRef10, useState as useState18 } from "react";
21809
21844
 
21810
21845
  // packages/experience-design-system-cli/src/tui/import/steps/08-generation/run.ts
21811
21846
  import { resolve as resolve25 } from "node:path";
@@ -21970,8 +22005,8 @@ function applyProgressEvent2(event, previous, total) {
21970
22005
  // packages/experience-design-system-cli/src/tui/import/steps/08-generation/use-generation.ts
21971
22006
  function useGeneration(input) {
21972
22007
  const [state2, setState] = useState18();
21973
- const current = useRef9();
21974
- useEffect11(() => {
22008
+ const current = useRef10();
22009
+ useEffect12(() => {
21975
22010
  current.current = input;
21976
22011
  if (!input) {
21977
22012
  setState(void 0);
@@ -22452,7 +22487,7 @@ function PreviewValidationErrorScreen({
22452
22487
  }
22453
22488
 
22454
22489
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx
22455
- import { useCallback as useCallback5, useEffect as useEffect18, useMemo as useMemo6, useRef as useRef14, useState as useState26 } from "react";
22490
+ import { useCallback as useCallback5, useEffect as useEffect19, useMemo as useMemo6, useRef as useRef15, useState as useState26 } from "react";
22456
22491
  import figures8 from "figures";
22457
22492
 
22458
22493
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
@@ -22713,7 +22748,7 @@ function enumerateCycleBreaks(cycle, components) {
22713
22748
  import { Box as Box32, Text as Text34 } from "ink";
22714
22749
 
22715
22750
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx
22716
- import React13, { useEffect as useEffect12, useLayoutEffect as useLayoutEffect2, useState as useState19 } from "react";
22751
+ import React13, { useEffect as useEffect13, useLayoutEffect as useLayoutEffect2, useState as useState19 } from "react";
22717
22752
  import figures6 from "figures";
22718
22753
  import { Box as Box26, measureElement, Text as Text27 } from "ink";
22719
22754
 
@@ -24271,7 +24306,7 @@ function FieldEditor({
24271
24306
  }
24272
24307
  return Math.max(start + 1, end2);
24273
24308
  };
24274
- useEffect12(() => {
24309
+ useEffect13(() => {
24275
24310
  if (focusLevel === "field" || selectedRowIdx < 0) return;
24276
24311
  setListScrollStart((previous) => {
24277
24312
  if (initialFocusTarget && !initialFocusScrollApplied.current) {
@@ -25343,7 +25378,7 @@ function finalizeReviewSession(extractSessionId, components) {
25343
25378
  }
25344
25379
 
25345
25380
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-session.ts
25346
- import { useCallback as useCallback2, useEffect as useEffect14, useRef as useRef11, useState as useState21 } from "react";
25381
+ import { useCallback as useCallback2, useEffect as useEffect15, useRef as useRef12, useState as useState21 } from "react";
25347
25382
 
25348
25383
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/history.ts
25349
25384
  var DEFAULT_MAX_DEPTH = 50;
@@ -25399,7 +25434,7 @@ function createHistoryStack(seed, maxDepth = DEFAULT_MAX_DEPTH) {
25399
25434
  }
25400
25435
 
25401
25436
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-finalize-preview.ts
25402
- import { useEffect as useEffect13, useRef as useRef10, useState as useState20 } from "react";
25437
+ import { useEffect as useEffect14, useRef as useRef11, useState as useState20 } from "react";
25403
25438
 
25404
25439
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/run-live-preview.ts
25405
25440
  var TimeoutError = class extends Error {
@@ -25557,9 +25592,9 @@ function useFinalizePreview(opts) {
25557
25592
  const [status, setStatus] = useState20("idle");
25558
25593
  const [removed, setRemoved] = useState20([]);
25559
25594
  const [scrollOffset, setScrollOffset] = useState20(0);
25560
- const generationRef = useRef10(0);
25595
+ const generationRef = useRef11(0);
25561
25596
  const acceptedKey = [...acceptedKeys].sort().join("\0");
25562
- useEffect13(() => {
25597
+ useEffect14(() => {
25563
25598
  if (!open) {
25564
25599
  setStatus("idle");
25565
25600
  setRemoved([]);
@@ -25622,7 +25657,7 @@ function useReviewSession({
25622
25657
  }));
25623
25658
  return { result, catalog };
25624
25659
  }, [loadSession, tokensPath]);
25625
- useEffect14(() => {
25660
+ useEffect15(() => {
25626
25661
  let disposed = false;
25627
25662
  void (async () => {
25628
25663
  try {
@@ -25675,7 +25710,7 @@ function useReviewSession({
25675
25710
  function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
25676
25711
  const [reviewMetadata, setReviewMetadata] = useState21(null);
25677
25712
  const [componentRationale, setComponentRationale] = useState21(null);
25678
- useEffect14(() => {
25713
+ useEffect15(() => {
25679
25714
  const current = components[selectedIdx];
25680
25715
  if (!current) {
25681
25716
  setReviewMetadata(null);
@@ -25705,9 +25740,9 @@ function useReviewMetadata({ components, selectedIdx, extractSessionId }) {
25705
25740
  return { reviewMetadata, componentRationale };
25706
25741
  }
25707
25742
  function useReviewHistory({ loading, components, createSnapshot, applySnapshot }) {
25708
- const historyRef = useRef11(null);
25709
- const historySeededRef = useRef11(false);
25710
- useEffect14(() => {
25743
+ const historyRef = useRef12(null);
25744
+ const historySeededRef = useRef12(false);
25745
+ useEffect15(() => {
25711
25746
  if (loading || historySeededRef.current) return;
25712
25747
  historySeededRef.current = true;
25713
25748
  historyRef.current = createHistoryStack(createSnapshot(components));
@@ -25758,7 +25793,7 @@ function useReviewFinalize({
25758
25793
  }
25759
25794
 
25760
25795
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-editor.ts
25761
- import { useEffect as useEffect15, useRef as useRef12, useState as useState22 } from "react";
25796
+ import { useEffect as useEffect16, useRef as useRef13, useState as useState22 } from "react";
25762
25797
 
25763
25798
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/token-suggestions.ts
25764
25799
  function collectTokenSuggestions(entry, availableTokens = []) {
@@ -25809,9 +25844,9 @@ function useReviewEditor({
25809
25844
  const [tokenReviewEditing, setTokenReviewEditing] = useState22(false);
25810
25845
  const [tokenReviewEditCursor, setTokenReviewEditCursor] = useState22(0);
25811
25846
  const [tokenReviewEditSelection, setTokenReviewEditSelection] = useState22(/* @__PURE__ */ new Set());
25812
- const tokenReviewSuggestedRef = useRef12(/* @__PURE__ */ new Map());
25813
- const pendingGRef = useRef12(false);
25814
- useEffect15(() => {
25847
+ const tokenReviewSuggestedRef = useRef13(/* @__PURE__ */ new Map());
25848
+ const pendingGRef = useRef13(false);
25849
+ useEffect16(() => {
25815
25850
  setTokenReviewRow(0);
25816
25851
  setTokenReviewEditing(false);
25817
25852
  setTokenReviewEditCursor(0);
@@ -26223,7 +26258,7 @@ function handleJsonPanelInput(input, key, state2) {
26223
26258
  }
26224
26259
 
26225
26260
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-review-preview.ts
26226
- import { useCallback as useCallback4, useEffect as useEffect17, useState as useState25 } from "react";
26261
+ import { useCallback as useCallback4, useEffect as useEffect18, useState as useState25 } from "react";
26227
26262
 
26228
26263
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/preview-annotations.ts
26229
26264
  function applyPreviewAnnotations(preview, localNames) {
@@ -26258,25 +26293,25 @@ function applyPreviewAnnotations(preview, localNames) {
26258
26293
  }
26259
26294
 
26260
26295
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/use-live-preview.ts
26261
- import { useCallback as useCallback3, useEffect as useEffect16, useRef as useRef13, useState as useState24 } from "react";
26296
+ import { useCallback as useCallback3, useEffect as useEffect17, useRef as useRef14, useState as useState24 } from "react";
26262
26297
  var DEFAULT_DEBOUNCE_MS = 500;
26263
26298
  function useLivePreview(opts) {
26264
26299
  const debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
26265
26300
  const [status, setStatus] = useState24("idle");
26266
26301
  const [disabled, setDisabled] = useState24(false);
26267
- const timerRef = useRef13(null);
26268
- const generationRef = useRef13(0);
26269
- const latestRef = useRef13(0);
26270
- const inflightRef = useRef13(0);
26271
- const optsRef = useRef13(opts);
26272
- useEffect16(() => {
26302
+ const timerRef = useRef14(null);
26303
+ const generationRef = useRef14(0);
26304
+ const latestRef = useRef14(0);
26305
+ const inflightRef = useRef14(0);
26306
+ const optsRef = useRef14(opts);
26307
+ useEffect17(() => {
26273
26308
  optsRef.current = opts;
26274
26309
  });
26275
- const disabledRef = useRef13(disabled);
26276
- useEffect16(() => {
26310
+ const disabledRef = useRef14(disabled);
26311
+ useEffect17(() => {
26277
26312
  disabledRef.current = disabled;
26278
26313
  }, [disabled]);
26279
- useEffect16(() => {
26314
+ useEffect17(() => {
26280
26315
  return () => {
26281
26316
  if (timerRef.current) {
26282
26317
  clearTimeout(timerRef.current);
@@ -26390,13 +26425,13 @@ function useReviewPreview({
26390
26425
  deleteAllComponents
26391
26426
  });
26392
26427
  const [spinnerTick, setSpinnerTick] = useState25(0);
26393
- useEffect17(() => {
26428
+ useEffect18(() => {
26394
26429
  if (livePreviewHook.status !== "running") return;
26395
26430
  const id = setInterval(() => setSpinnerTick((tick) => tick + 1), 80);
26396
26431
  return () => clearInterval(id);
26397
26432
  }, [livePreviewHook.status]);
26398
26433
  const livePreviewSpinner = SPINNER_FRAMES[spinnerTick % SPINNER_FRAMES.length];
26399
- useEffect17(() => {
26434
+ useEffect18(() => {
26400
26435
  if (loading) return;
26401
26436
  if (!livePreview) return;
26402
26437
  if (components.length === 0) return;
@@ -26709,7 +26744,7 @@ function GenerateReviewStepView({
26709
26744
  setFinalizeError
26710
26745
  } = reviewSurface;
26711
26746
  const [removedBannerCollapsed, setRemovedBannerCollapsed] = useState26(false);
26712
- const removedBannerDefaultedRef = useRef14(false);
26747
+ const removedBannerDefaultedRef = useRef15(false);
26713
26748
  const [cyclePanelScroll, setCyclePanelScroll] = useState26(0);
26714
26749
  const [cyclesCursor, setCyclesCursor] = useState26(0);
26715
26750
  const cyclePanel = useOverlayPanel({
@@ -26729,7 +26764,7 @@ function GenerateReviewStepView({
26729
26764
  const [breakCursor, setBreakCursor] = useState26(0);
26730
26765
  const [breakConfirm, setBreakConfirm] = useState26(false);
26731
26766
  const [expandedGroups, setExpandedGroups] = useState26(/* @__PURE__ */ new Set());
26732
- const seededGroupsRef = useRef14(false);
26767
+ const seededGroupsRef = useRef15(false);
26733
26768
  const {
26734
26769
  searchOpen,
26735
26770
  setSearchOpen,
@@ -26753,7 +26788,7 @@ function GenerateReviewStepView({
26753
26788
  const [pendingEditorFocus, setPendingEditorFocus] = useState26(null);
26754
26789
  const [autoRejected, setAutoRejected] = useState26([]);
26755
26790
  const [undoSnapshot, setUndoSnapshot] = useState26(null);
26756
- const autoRejectFiredRef = useRef14(false);
26791
+ const autoRejectFiredRef = useRef15(false);
26757
26792
  const [showReloadDialog, setShowReloadDialog] = useState26(false);
26758
26793
  const acceptedCountForPreview = components.filter((c2) => c2.status === "accepted").length;
26759
26794
  const { previewAnnotations, removedComponents, livePreviewHook, livePreviewSpinner } = useReviewPreview({
@@ -26816,7 +26851,7 @@ function GenerateReviewStepView({
26816
26851
  [components]
26817
26852
  );
26818
26853
  const closures = useMemo6(() => computeAllClosures(componentGraph), [componentGraph]);
26819
- useEffect18(() => {
26854
+ useEffect19(() => {
26820
26855
  if (seededGroupsRef.current) return;
26821
26856
  if (closures.size === 0 && slotCycles.length === 0) return;
26822
26857
  seededGroupsRef.current = true;
@@ -26843,7 +26878,7 @@ function GenerateReviewStepView({
26843
26878
  suggestedBreak: cycle.edges.length > 0 ? suggestCycleBreakEdge2(cycle, cycleView.pushBlocking) : null
26844
26879
  }));
26845
26880
  }, [slotCycles, cycleView]);
26846
- useEffect18(() => {
26881
+ useEffect19(() => {
26847
26882
  const decision = computeAutoRejectDecision({
26848
26883
  loading,
26849
26884
  autoRejectFired: autoRejectFiredRef.current,
@@ -26886,8 +26921,8 @@ function GenerateReviewStepView({
26886
26921
  }),
26887
26922
  applySnapshot: applyHistorySnapshot
26888
26923
  });
26889
- const autoRejectPushedRef = useRef14(false);
26890
- useEffect18(() => {
26924
+ const autoRejectPushedRef = useRef15(false);
26925
+ useEffect19(() => {
26891
26926
  if (loading) return;
26892
26927
  if (!historySeededRef.current) return;
26893
26928
  if (!autoRejectFiredRef.current) return;
@@ -26971,7 +27006,7 @@ function GenerateReviewStepView({
26971
27006
  const panelHeight = leftPanelHeight + 2;
26972
27007
  const panelContentHeight = Math.max(1, panelHeight - 3);
26973
27008
  const cycleViewportHeight = Math.max(1, panelHeight - 4);
26974
- useEffect18(() => {
27009
+ useEffect19(() => {
26975
27010
  if (selectableRowPositions.length === 0) return;
26976
27011
  const cursorInRange = selectableRowPositions.includes(cursorRowIdx);
26977
27012
  const maxScroll = Math.max(0, visibleRowsMemo.length - visibleCount);
@@ -27916,10 +27951,10 @@ function normalizePath(input) {
27916
27951
  }
27917
27952
 
27918
27953
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-blinking-cursor.ts
27919
- import { useEffect as useEffect19, useState as useState27 } from "react";
27954
+ import { useEffect as useEffect20, useState as useState27 } from "react";
27920
27955
  function useBlinkingCursor() {
27921
27956
  const [visible, setVisible] = useState27(true);
27922
- useEffect19(() => {
27957
+ useEffect20(() => {
27923
27958
  const interval = setInterval(() => setVisible((current) => !current), 500);
27924
27959
  return () => clearInterval(interval);
27925
27960
  }, []);
@@ -28035,12 +28070,12 @@ function countedThings({ components, tokens }, counts = {}) {
28035
28070
  }
28036
28071
 
28037
28072
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/use-timed-spinner.tsx
28038
- import { useEffect as useEffect20, useState as useState29 } from "react";
28073
+ import { useEffect as useEffect21, useState as useState29 } from "react";
28039
28074
  import { Spinner as Spinner2 } from "@inkjs/ui";
28040
28075
  import { jsx as jsx53 } from "react/jsx-runtime";
28041
28076
  function useTimedSpinner() {
28042
28077
  const [elapsedSeconds, setElapsedSeconds] = useState29(0);
28043
- useEffect20(() => {
28078
+ useEffect21(() => {
28044
28079
  const timer = setInterval(() => setElapsedSeconds((current) => current + 1), 1e3);
28045
28080
  return () => {
28046
28081
  clearInterval(timer);
@@ -28098,7 +28133,7 @@ function PushingStep({ progress, produced, counts }) {
28098
28133
  }
28099
28134
 
28100
28135
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/screens/WizardPreviewStep.tsx
28101
- import { useEffect as useEffect21, useState as useState30, useMemo as useMemo7 } from "react";
28136
+ import { useEffect as useEffect22, useState as useState30, useMemo as useMemo7 } from "react";
28102
28137
  import { Box as Box44, Text as Text46 } from "ink";
28103
28138
 
28104
28139
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/support/preview-diff.ts
@@ -28493,7 +28528,7 @@ function WizardPreviewStep({
28493
28528
  const activeLines = diffExpanded ? diffLines : summaryLines;
28494
28529
  const maxScroll = Math.max(0, activeLines.length - viewportHeight);
28495
28530
  const boundedScrollOffset = Math.min(scrollOffset, maxScroll);
28496
- useEffect21(() => {
28531
+ useEffect22(() => {
28497
28532
  setScrollOffset((previous) => Math.min(previous, maxScroll));
28498
28533
  }, [maxScroll]);
28499
28534
  useImmediateInput((input, key) => {
@@ -28711,7 +28746,7 @@ function FlowScreen({
28711
28746
  }
28712
28747
 
28713
28748
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
28714
- import { useEffect as useEffect22, useRef as useRef15, useSyncExternalStore } from "react";
28749
+ import { useEffect as useEffect23, useRef as useRef16, useSyncExternalStore } from "react";
28715
28750
 
28716
28751
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/controller.ts
28717
28752
  import { appendFileSync, writeFileSync } from "node:fs";
@@ -29453,7 +29488,7 @@ function createFlowController(start, deps) {
29453
29488
 
29454
29489
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/flow/use-flow.ts
29455
29490
  function useFlow(start, options = {}) {
29456
- const controller = useRef15();
29491
+ const controller = useRef16();
29457
29492
  if (start && !controller.current) {
29458
29493
  try {
29459
29494
  startWizardLog();
@@ -29470,14 +29505,14 @@ function useFlow(start, options = {}) {
29470
29505
  (listener) => current?.subscribe(listener) ?? (() => void 0),
29471
29506
  () => current?.getState()
29472
29507
  );
29473
- useEffect22(() => {
29508
+ useEffect23(() => {
29474
29509
  if (!start) controller.current = void 0;
29475
29510
  }, [start]);
29476
29511
  return current && state2 ? { controller: current, state: state2 } : void 0;
29477
29512
  }
29478
29513
 
29479
29514
  // packages/experience-design-system-cli/src/tui/help/PageContainer.tsx
29480
- import { useEffect as useEffect23, useState as useState31 } from "react";
29515
+ import { useEffect as useEffect24, useState as useState31 } from "react";
29481
29516
  import { Box as Box46, Text as Text47, useInput as useInput13 } from "ink";
29482
29517
  init_debug_store();
29483
29518
 
@@ -29551,7 +29586,7 @@ function Section({ title, rows }) {
29551
29586
  }
29552
29587
  function HelpScreen({ onDone }) {
29553
29588
  const [info, setInfo] = useState31();
29554
- useEffect23(() => {
29589
+ useEffect24(() => {
29555
29590
  startDebugRun({ flow: "help", step: "01-help", menuOption: "Help", inputs: {} });
29556
29591
  void readHelpInfo().then(setInfo);
29557
29592
  }, []);
@@ -29648,7 +29683,7 @@ import { useState as useState36 } from "react";
29648
29683
  import { Box as Box51, Text as Text53, useInput as useInput17 } from "ink";
29649
29684
 
29650
29685
  // packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentsScreen.tsx
29651
- import { useEffect as useEffect25, useRef as useRef16, useState as useState34 } from "react";
29686
+ import { useEffect as useEffect26, useRef as useRef17, useState as useState34 } from "react";
29652
29687
  import { Box as Box49, Text as Text51, useInput as useInput15 } from "ink";
29653
29688
  init_debug_store();
29654
29689
 
@@ -29977,7 +30012,7 @@ async function writeAgentConfig(config) {
29977
30012
  }
29978
30013
 
29979
30014
  // packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx
29980
- import { useEffect as useEffect24, useState as useState33 } from "react";
30015
+ import { useEffect as useEffect25, useState as useState33 } from "react";
29981
30016
  import { Box as Box48, Text as Text50 } from "ink";
29982
30017
 
29983
30018
  // packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentStatusBadge.tsx
@@ -30040,7 +30075,7 @@ function AgentDetail({
30040
30075
  const [testing, setTesting] = useState33(false);
30041
30076
  const [notice, setNotice] = useState33(null);
30042
30077
  const [checks, setChecks] = useState33(void 0);
30043
- useEffect24(() => {
30078
+ useEffect25(() => {
30044
30079
  let active = true;
30045
30080
  setChecks(void 0);
30046
30081
  const timer = setTimeout(() => {
@@ -30125,7 +30160,7 @@ function AgentsScreen({ onDone }) {
30125
30160
  const [saving, setSaving] = useState34(false);
30126
30161
  const [loadError, setLoadError] = useState34(null);
30127
30162
  const [checks, setChecks] = useState34({});
30128
- const visit = useRef16({
30163
+ const visit = useRef17({
30129
30164
  trail: createTrail(),
30130
30165
  before: void 0,
30131
30166
  environment: void 0,
@@ -30138,7 +30173,7 @@ function AgentsScreen({ onDone }) {
30138
30173
  );
30139
30174
  }
30140
30175
  };
30141
- useEffect25(() => {
30176
+ useEffect26(() => {
30142
30177
  readAgentConfig().then((loaded) => {
30143
30178
  setConfig(loaded);
30144
30179
  inspectAll(loaded);
@@ -30315,7 +30350,7 @@ function AgentsScreen({ onDone }) {
30315
30350
  }
30316
30351
 
30317
30352
  // packages/experience-design-system-cli/src/tui/settings/configuration/project/ProjectScreen.tsx
30318
- import { useEffect as useEffect26, useRef as useRef17, useState as useState35 } from "react";
30353
+ import { useEffect as useEffect27, useRef as useRef18, useState as useState35 } from "react";
30319
30354
  import { Box as Box50, Text as Text52, useInput as useInput16 } from "ink";
30320
30355
  init_debug_store();
30321
30356
 
@@ -30373,14 +30408,14 @@ function ProjectScreen({ onDone }) {
30373
30408
  const [saving, setSaving] = useState35(false);
30374
30409
  const [notice, setNotice] = useState35(null);
30375
30410
  const [loadError, setLoadError] = useState35(null);
30376
- const visit = useRef17({
30411
+ const visit = useRef18({
30377
30412
  trail: createTrail(),
30378
30413
  before: void 0,
30379
30414
  persisted: void 0,
30380
30415
  error: ""
30381
30416
  }).current;
30382
30417
  const scrub = (err) => scrubError(err, [config?.cmaToken ?? ""]);
30383
- useEffect26(() => {
30418
+ useEffect27(() => {
30384
30419
  readCredentials().then((cfg) => {
30385
30420
  setConfig(cfg);
30386
30421
  visit.before = snapshotOf(cfg);
@@ -30532,7 +30567,7 @@ function ConfigurationScreen({ onDone }) {
30532
30567
  }
30533
30568
 
30534
30569
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
30535
- import { useEffect as useEffect27, useState as useState37 } from "react";
30570
+ import { useEffect as useEffect28, useState as useState37 } from "react";
30536
30571
  import { Box as Box52, Text as Text54, useInput as useInput18 } from "ink";
30537
30572
 
30538
30573
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
@@ -30556,7 +30591,7 @@ import { Fragment as Fragment20, jsx as jsx64, jsxs as jsxs52 } from "react/jsx-
30556
30591
  function OptInAnalyticsScreen({ onDone }) {
30557
30592
  const [loading, setLoading] = useState37(true);
30558
30593
  const [enabled, setEnabled] = useState37(true);
30559
- useEffect27(() => {
30594
+ useEffect28(() => {
30560
30595
  readAnalyticsSetting().then((setting) => {
30561
30596
  setEnabled(setting.enabled);
30562
30597
  setLoading(false);
@@ -30610,7 +30645,7 @@ function OptInAnalyticsScreen({ onDone }) {
30610
30645
  }
30611
30646
 
30612
30647
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
30613
- import { useEffect as useEffect28, useRef as useRef18, useState as useState38 } from "react";
30648
+ import { useEffect as useEffect29, useRef as useRef19, useState as useState38 } from "react";
30614
30649
  import { Box as Box53, Text as Text55, useInput as useInput19 } from "ink";
30615
30650
  init_debug_mode_store();
30616
30651
  init_debug_store();
@@ -30627,8 +30662,8 @@ function DebugModeScreen({ onDone }) {
30627
30662
  RETENTION_CHOICES[RETENTION_CHOICES.length - 1]
30628
30663
  );
30629
30664
  const [notice, setNotice] = useState38(null);
30630
- const visit = useRef18({ trail: createTrail(), before: void 0, error: "" }).current;
30631
- useEffect28(() => {
30665
+ const visit = useRef19({ trail: createTrail(), before: void 0, error: "" }).current;
30666
+ useEffect29(() => {
30632
30667
  readDebugModeSetting().then((loaded) => {
30633
30668
  setSetting(loaded);
30634
30669
  setPending(loaded.retentionDays);
@@ -30783,7 +30818,7 @@ function App({ importOptions, inkClear }) {
30783
30818
  const [flowStart, setFlowStart] = useState39();
30784
30819
  const flow = useFlow(flowStart, { beforeStepChange: inkClear });
30785
30820
  const [importDefaults, setImportDefaults] = useState39();
30786
- useEffect29(() => {
30821
+ useEffect30(() => {
30787
30822
  if (screen !== "import") {
30788
30823
  setImportDefaults(void 0);
30789
30824
  return;
@@ -30856,7 +30891,7 @@ function App({ importOptions, inkClear }) {
30856
30891
  }
30857
30892
  });
30858
30893
  };
30859
- useEffect29(() => {
30894
+ useEffect30(() => {
30860
30895
  if (!tokensOnlyRun || tokensOnly?.status !== "done" || !tokensOnly.result.ok) return;
30861
30896
  const { credentialsSkipped, input, tokens } = tokensOnlyRun;
30862
30897
  const { tokensPath, tokenSessionId, tokenCount } = tokensOnly.result;
@@ -30878,12 +30913,12 @@ function App({ importOptions, inkClear }) {
30878
30913
  }
30879
30914
  });
30880
30915
  }, [tokensOnly, tokensOnlyRun]);
30881
- useEffect29(() => {
30916
+ useEffect30(() => {
30882
30917
  if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
30883
30918
  setExtractionRun(void 0);
30884
30919
  setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
30885
30920
  }, [extraction, extractionRun]);
30886
- useEffect29(() => {
30921
+ useEffect30(() => {
30887
30922
  if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
30888
30923
  const { extraction: produced, input, generatePromptPath } = scopeRun;
30889
30924
  setGenerationInput({
@@ -30901,7 +30936,7 @@ function App({ importOptions, inkClear }) {
30901
30936
  ...generatePromptPath ? { generatePromptPath } : {}
30902
30937
  });
30903
30938
  }, [scopeFlow, scopeRun, generationInput]);
30904
- useEffect29(() => {
30939
+ useEffect30(() => {
30905
30940
  if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
30906
30941
  const { credentialsSkipped, extraction: produced, input, generatePromptPath } = scopeRun;
30907
30942
  inkClear();
@@ -30984,6 +31019,7 @@ function App({ importOptions, inkClear }) {
30984
31019
  return /* @__PURE__ */ jsx66(
30985
31020
  WelcomeScreen,
30986
31021
  {
31022
+ mode: target,
30987
31023
  onContinue: (projectPath) => answer({ projectPath }),
30988
31024
  onQuit: () => goBackFrom("project"),
30989
31025
  initialPath: importDefaults.componentDir