@contentful/experience-design-system-cli 2.37.1-dev-build-91ca3bb8.0 → 2.37.1-dev-build-ef8b693f.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
@@ -837,7 +837,7 @@ async function runAgent(options) {
837
837
  promptLen: prompt.length,
838
838
  promptHead: prompt.slice(0, 500)
839
839
  });
840
- return new Promise((resolve28) => {
840
+ return new Promise((resolve27) => {
841
841
  const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
842
842
  const child = spawn(binary, args, {
843
843
  stdio: ["pipe", "pipe", "pipe"],
@@ -886,7 +886,7 @@ async function runAgent(options) {
886
886
  stderrLen: stderr.length,
887
887
  stderrTail: stderr.slice(-1e3)
888
888
  });
889
- resolve28(result);
889
+ resolve27(result);
890
890
  });
891
891
  });
892
892
  }
@@ -908,7 +908,7 @@ async function checkAgentAuth(agent) {
908
908
  return "not-found";
909
909
  if (agent !== "claude")
910
910
  return "ok";
911
- return new Promise((resolve28) => {
911
+ return new Promise((resolve27) => {
912
912
  const child = spawn2(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
913
913
  let stdout = "";
914
914
  let done = false;
@@ -917,7 +917,7 @@ async function checkAgentAuth(agent) {
917
917
  return;
918
918
  done = true;
919
919
  child.kill("SIGTERM");
920
- resolve28("unauthenticated");
920
+ resolve27("unauthenticated");
921
921
  }, 5e3);
922
922
  child.stdout?.on("data", (chunk) => {
923
923
  stdout += chunk.toString();
@@ -928,14 +928,14 @@ async function checkAgentAuth(agent) {
928
928
  done = true;
929
929
  clearTimeout(timer);
930
930
  if (code !== 0) {
931
- resolve28("unauthenticated");
931
+ resolve27("unauthenticated");
932
932
  return;
933
933
  }
934
934
  try {
935
935
  const status = JSON.parse(stdout);
936
- resolve28(status.loggedIn ? "ok" : "unauthenticated");
936
+ resolve27(status.loggedIn ? "ok" : "unauthenticated");
937
937
  } catch {
938
- resolve28("unauthenticated");
938
+ resolve27("unauthenticated");
939
939
  }
940
940
  });
941
941
  });
@@ -945,9 +945,9 @@ async function binaryIsOnPath(binary) {
945
945
  const fs = await import("node:fs/promises");
946
946
  return fs.access(binary).then(() => true, () => false);
947
947
  }
948
- return new Promise((resolve28) => {
948
+ return new Promise((resolve27) => {
949
949
  const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
950
- child.on("close", (code) => resolve28(code === 0));
950
+ child.on("close", (code) => resolve27(code === 0));
951
951
  });
952
952
  }
953
953
  var init_check_agent_auth = __esm({
@@ -2329,32 +2329,55 @@ var init_debug_store = __esm({
2329
2329
  });
2330
2330
 
2331
2331
  // packages/experience-design-system-cli/app.tsx
2332
- import { join as join26 } from "node:path";
2333
- import { useEffect as useEffect28, useState as useState37 } from "react";
2332
+ import { join as join25 } from "node:path";
2333
+ import { useEffect as useEffect26, useState as useState33 } from "react";
2334
2334
 
2335
2335
  // packages/experience-design-system-cli/src/tui/home/home.tsx
2336
2336
  import { useEffect as useEffect2, useState as useState2 } from "react";
2337
2337
  import { Box, Text as Text2, useApp, useInput } from "ink";
2338
2338
 
2339
- // packages/experience-design-system-cli/src/tui/home/home.theme.ts
2340
- var BRAND = {
2341
- blue: "#1773EB",
2342
- green: "#00C459",
2343
- orange: "#E44F20",
2344
- yellow: "#FFDA00",
2345
- white: "#FFFFFF",
2346
- slate: "#8B8D91",
2347
- steel: "#C4D1DE"
2339
+ // packages/experience-design-system-cli/src/tui/theme.ts
2340
+ var DARK = {
2341
+ text: "#f7f9fa",
2342
+ // gray100
2343
+ muted: "#aec1cc",
2344
+ // gray400
2345
+ border: "#aec1cc",
2346
+ // gray400
2347
+ accent: "#40a0ff",
2348
+ // blue400
2349
+ error: "#ff707d",
2350
+ // red400
2351
+ success: "#5DB057",
2352
+ // green400
2353
+ warning: "#FFC835"
2354
+ // yellow500
2348
2355
  };
2349
- var PALETTE = {
2350
- accent: BRAND.blue,
2351
- success: BRAND.green,
2352
- error: BRAND.orange,
2353
- warning: BRAND.yellow,
2354
- muted: BRAND.slate,
2355
- border: BRAND.steel
2356
+ var LIGHT = {
2357
+ text: "#111B2B",
2358
+ // gray900
2359
+ muted: "#5A657C",
2360
+ // gray600
2361
+ border: "#5A657C",
2362
+ // gray600
2363
+ accent: "#0059c8",
2364
+ // semantic primary
2365
+ error: "#bd002a",
2366
+ // semantic negative
2367
+ success: "#006D23",
2368
+ // semantic positive
2369
+ warning: "#CC4500"
2370
+ // semantic warning
2356
2371
  };
2357
- var BRAND_RAMP = [BRAND.blue, BRAND.orange, BRAND.yellow];
2372
+ function detectColorMode(env = process.env) {
2373
+ const bg = env.COLORFGBG?.split(";").pop();
2374
+ if (bg === "7" || bg === "15") return "light";
2375
+ return "dark";
2376
+ }
2377
+ var PALETTE = detectColorMode() === "light" ? LIGHT : DARK;
2378
+
2379
+ // packages/experience-design-system-cli/src/tui/home/home.theme.ts
2380
+ var BRAND_RAMP = ["#1773EB", "#E44F20", "#FFDA00"];
2358
2381
  var BAR_CELL = "\u2501";
2359
2382
  function brandBar(width, ramp = BRAND_RAMP) {
2360
2383
  if (width <= 0 || ramp.length === 0) return [];
@@ -2397,7 +2420,7 @@ function useTerminalWidth() {
2397
2420
  import { Text } from "ink";
2398
2421
  import { jsx } from "react/jsx-runtime";
2399
2422
  function ControlHints({ hints }) {
2400
- return /* @__PURE__ */ jsx(Text, { children: hints.map((hint) => `[${hint.keys}] ${hint.label}`).join(" \xB7 ") });
2423
+ return /* @__PURE__ */ jsx(Text, { color: PALETTE.muted, children: hints.map((hint) => `[${hint.keys}] ${hint.label}`).join(" \xB7 ") });
2401
2424
  }
2402
2425
 
2403
2426
  // packages/experience-design-system-cli/src/tui/home/home.tsx
@@ -2566,20 +2589,19 @@ function WelcomeScreen({ onContinue, onQuit, initialPath = "" }) {
2566
2589
  if (path5) onContinue(path5);
2567
2590
  };
2568
2591
  return /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
2569
- /* @__PURE__ */ jsx4(Text4, { bold: true, color: PALETTE.success, children: "\u{1F44B} Hey! Let's import your design system into Contentful." }),
2570
- /* @__PURE__ */ jsx4(Text4, { color: PALETTE.muted, children: "I'll walk you through 5 steps to get your components into Contentful ExO." }),
2592
+ /* @__PURE__ */ jsx4(Text4, { bold: true, color: PALETTE.success, children: "Let's import your design system into Contentful." }),
2571
2593
  /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", children: [
2572
- /* @__PURE__ */ jsx4(Text4, { dimColor: true, children: RULE }),
2594
+ /* @__PURE__ */ jsx4(Text4, { color: PALETTE.muted, children: RULE }),
2573
2595
  OVERVIEW.map((item) => /* @__PURE__ */ jsxs3(Box3, { gap: 1, children: [
2574
2596
  /* @__PURE__ */ jsx4(Text4, { bold: true, children: item.label }),
2575
2597
  /* @__PURE__ */ jsx4(Text4, { color: PALETTE.muted, children: item.description })
2576
2598
  ] }, item.label)),
2577
- /* @__PURE__ */ jsx4(Text4, { dimColor: true, children: RULE })
2599
+ /* @__PURE__ */ jsx4(Text4, { color: PALETTE.muted, children: RULE })
2578
2600
  ] }),
2579
2601
  /* @__PURE__ */ jsxs3(Box3, { flexDirection: "column", gap: 1, children: [
2580
2602
  /* @__PURE__ */ jsx4(Text4, { children: "Where is your component library?" }),
2581
- /* @__PURE__ */ jsxs3(Box3, { gap: 1, children: [
2582
- /* @__PURE__ */ jsx4(Text4, { color: PALETTE.accent, children: "?" }),
2603
+ /* @__PURE__ */ jsxs3(Box3, { children: [
2604
+ /* @__PURE__ */ jsx4(Text4, { color: PALETTE.text, children: "?" }),
2583
2605
  /* @__PURE__ */ jsx4(Text4, { children: "Project path:" }),
2584
2606
  /* @__PURE__ */ jsx4(TextInput, { value: projectPath, onChange: setProjectPath, onSubmit: submit })
2585
2607
  ] })
@@ -8431,10 +8453,10 @@ function extractVueSlotsFromSetup(options) {
8431
8453
  if (!body)
8432
8454
  return [];
8433
8455
  const slotsByName = /* @__PURE__ */ new Map();
8434
- for (const access7 of body.getDescendantsOfKind(SyntaxKind5.PropertyAccessExpression)) {
8435
- if (access7.getExpression().getText() !== slotsName)
8456
+ for (const access6 of body.getDescendantsOfKind(SyntaxKind5.PropertyAccessExpression)) {
8457
+ if (access6.getExpression().getText() !== slotsName)
8436
8458
  continue;
8437
- const slotName = access7.getName();
8459
+ const slotName = access6.getName();
8438
8460
  if (!slotsByName.has(slotName)) {
8439
8461
  slotsByName.set(slotName, {
8440
8462
  name: slotName,
@@ -13824,7 +13846,7 @@ function errorMessage(error) {
13824
13846
  return error instanceof Error && error.message ? error.message : String(error);
13825
13847
  }
13826
13848
  function defaultSleep(delayMs) {
13827
- return new Promise((resolve28) => setTimeout(resolve28, delayMs));
13849
+ return new Promise((resolve27) => setTimeout(resolve27, delayMs));
13828
13850
  }
13829
13851
 
13830
13852
  // packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/sanitize-preview.js
@@ -14065,7 +14087,7 @@ var ApiClient = class {
14065
14087
  const progress = maxAttempts > 1 ? attempt / (maxAttempts - 1) : 0;
14066
14088
  const baseDelay = intervalMs + (maxIntervalMs - intervalMs) * progress;
14067
14089
  const jitter = Math.random() * baseDelay * 0.15;
14068
- await new Promise((resolve28) => setTimeout(resolve28, baseDelay + jitter));
14090
+ await new Promise((resolve27) => setTimeout(resolve27, baseDelay + jitter));
14069
14091
  }
14070
14092
  }
14071
14093
  throw new Error(`Operation ${operationId} timed out after ${maxAttempts} attempts`);
@@ -14550,7 +14572,6 @@ function readTokensFromPath2(request) {
14550
14572
  init_agents();
14551
14573
  init_agent_name();
14552
14574
  init_models();
14553
- init_binaries();
14554
14575
  init_is_agent_name();
14555
14576
  init_agent_supports_bedrock();
14556
14577
  init_check_agent_auth();
@@ -16375,7 +16396,7 @@ async function retryDatabaseWrite(operation, attempts = 8) {
16375
16396
  const message = error instanceof Error ? error.message : String(error);
16376
16397
  if (!/database is locked|database is busy/i.test(message) || attempt >= attempts)
16377
16398
  throw error;
16378
- await new Promise((resolve28) => setTimeout(resolve28, Math.min(250 * attempt, 2e3)));
16399
+ await new Promise((resolve27) => setTimeout(resolve27, Math.min(250 * attempt, 2e3)));
16379
16400
  }
16380
16401
  }
16381
16402
  }
@@ -17081,7 +17102,7 @@ function foldSvelteAndMdIntoOther(counts) {
17081
17102
  // packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx
17082
17103
  import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
17083
17104
  function Row({ row }) {
17084
- return /* @__PURE__ */ jsxs5(Text6, { color: row.tone === "accent" ? PALETTE.accent : void 0, dimColor: row.tone === "muted", children: [
17105
+ return /* @__PURE__ */ jsxs5(Text6, { color: row.tone === "accent" ? PALETTE.accent : row.tone === "muted" ? PALETTE.muted : void 0, children: [
17085
17106
  " \u2022 ",
17086
17107
  String(row.count).padStart(3),
17087
17108
  " ",
@@ -17095,7 +17116,7 @@ function Failure({ scan, path: path5 }) {
17095
17116
  "\u2717 ",
17096
17117
  headline
17097
17118
  ] }),
17098
- hints.map((hint) => /* @__PURE__ */ jsx6(Text6, { dimColor: true, children: hint }, hint))
17119
+ hints.map((hint) => /* @__PURE__ */ jsx6(Text6, { color: PALETTE.muted, children: hint }, hint))
17099
17120
  ] });
17100
17121
  }
17101
17122
  function Summary({ scan, path: path5 }) {
@@ -17140,14 +17161,14 @@ function PathValidationScreen({
17140
17161
  onBack
17141
17162
  });
17142
17163
  return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
17143
- scan === void 0 && /* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
17164
+ scan === void 0 && /* @__PURE__ */ jsxs5(Text6, { color: PALETTE.muted, children: [
17144
17165
  "Scanning ",
17145
17166
  /* @__PURE__ */ jsx6(Text6, { bold: true, children: resolvedPath }),
17146
17167
  "..."
17147
17168
  ] }),
17148
17169
  scan?.ok === false && /* @__PURE__ */ jsx6(Failure, { scan, path: resolvedPath }),
17149
17170
  scan?.ok === true && /* @__PURE__ */ jsx6(Summary, { scan, path: resolvedPath }),
17150
- /* @__PURE__ */ jsx6(Box5, { marginTop: 1, gap: 3, children: controlsFor(phase).map((control) => /* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
17171
+ /* @__PURE__ */ jsx6(Box5, { marginTop: 1, gap: 3, children: controlsFor(phase).map((control) => /* @__PURE__ */ jsxs5(Text6, { color: PALETTE.muted, children: [
17151
17172
  "[",
17152
17173
  control.keys,
17153
17174
  "] ",
@@ -17299,8 +17320,8 @@ function CredentialsScreen({
17299
17320
  /* @__PURE__ */ jsx7(Text7, { bold: true, children: "Contentful credentials" }),
17300
17321
  /* @__PURE__ */ jsx7(Text7, { children: prefilled ? "Credentials pre-filled from the configuration settings." : "Enter the Contentful space you want to import into." }),
17301
17322
  !prefilled && /* @__PURE__ */ jsxs6(Fragment, { children: [
17302
- /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "We use it to check what components already exist and to push your import. If you skip, files are saved locally and nothing is pushed." }),
17303
- /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Tip: save these under Settings \u2192 Configuration so they pre-fill here." })
17323
+ /* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "We use it to check what components already exist and to push your import. If you skip, files are saved locally and nothing is pushed." }),
17324
+ /* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "Tip: save these under Settings \u2192 Configuration so they pre-fill here." })
17304
17325
  ] })
17305
17326
  ] }),
17306
17327
  /* @__PURE__ */ jsx7(Box6, { flexDirection: "column", children: FIELDS.map((field) => /* @__PURE__ */ jsxs6(Box6, { gap: 1, children: [
@@ -17321,14 +17342,14 @@ function CredentialsScreen({
17321
17342
  }
17322
17343
  )
17323
17344
  ] }, field)) }),
17324
- active === "host" && /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Default: api.contentful.com \xB7 EU spaces: api.eu.contentful.com" }),
17345
+ active === "host" && /* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "Default: api.contentful.com \xB7 EU spaces: api.eu.contentful.com" }),
17325
17346
  error && /* @__PURE__ */ jsxs6(Text7, { color: PALETTE.error, children: [
17326
17347
  "\u2717 ",
17327
17348
  error
17328
17349
  ] }),
17329
17350
  validating && /* @__PURE__ */ jsx7(Text7, { color: PALETTE.accent, children: "Validating credentials..." }),
17330
- !validating && !error && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsx7(Text7, { dimColor: true, children: "Changed values are saved after they validate." }),
17331
- /* @__PURE__ */ jsx7(Box6, { marginTop: 1, gap: 3, children: CREDENTIALS_CONTROLS.map((control) => /* @__PURE__ */ jsxs6(Text7, { dimColor: true, children: [
17351
+ !validating && !error && !isUnchanged(normalize(values), initialValues) && /* @__PURE__ */ jsx7(Text7, { color: PALETTE.muted, children: "Changed values are saved after they validate." }),
17352
+ /* @__PURE__ */ jsx7(Box6, { marginTop: 1, gap: 3, children: CREDENTIALS_CONTROLS.map((control) => /* @__PURE__ */ jsxs6(Text7, { color: PALETTE.muted, children: [
17332
17353
  "[",
17333
17354
  control.keys,
17334
17355
  "] ",
@@ -17392,7 +17413,7 @@ function ErrorStep({
17392
17413
  " failed"
17393
17414
  ] }),
17394
17415
  /* @__PURE__ */ jsx8(Text8, { color: PALETTE.error, children: message }),
17395
- /* @__PURE__ */ jsx8(Box7, { marginTop: 1, gap: 3, children: controls.map((control) => /* @__PURE__ */ jsxs7(Text8, { dimColor: true, children: [
17416
+ /* @__PURE__ */ jsx8(Box7, { marginTop: 1, gap: 3, children: controls.map((control) => /* @__PURE__ */ jsxs7(Text8, { color: PALETTE.muted, children: [
17396
17417
  "[",
17397
17418
  control.keys,
17398
17419
  "] ",
@@ -17457,7 +17478,7 @@ function GateStep({
17457
17478
  ] }),
17458
17479
  summary && /* @__PURE__ */ jsx9(Text9, { color: PALETTE.muted, children: summary }),
17459
17480
  context && /* @__PURE__ */ jsx9(Box8, { marginTop: 1, children: /* @__PURE__ */ jsx9(Text9, { children: context }) }),
17460
- /* @__PURE__ */ jsx9(Box8, { marginTop: 1, gap: 3, children: gateControls(continueLabel, skipLabel2, onSkip !== void 0).map((control) => /* @__PURE__ */ jsxs8(Text9, { dimColor: true, children: [
17481
+ /* @__PURE__ */ jsx9(Box8, { marginTop: 1, gap: 3, children: gateControls(continueLabel, skipLabel2, onSkip !== void 0).map((control) => /* @__PURE__ */ jsxs8(Text9, { color: PALETTE.muted, children: [
17461
17482
  "[",
17462
17483
  control.keys,
17463
17484
  "] ",
@@ -17490,7 +17511,7 @@ var PROGRESS_THEME = extendTheme(defaultTheme, {
17490
17511
  components: {
17491
17512
  ProgressBar: {
17492
17513
  styles: {
17493
- completed: () => ({ color: "blue" })
17514
+ completed: () => ({ color: PALETTE.accent })
17494
17515
  }
17495
17516
  }
17496
17517
  }
@@ -17539,9 +17560,9 @@ function RunningStep({
17539
17560
  const elapsed = useElapsed();
17540
17561
  return /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
17541
17562
  /* @__PURE__ */ jsxs9(Box9, { flexDirection: "column", children: [
17542
- /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: RULE2 }),
17563
+ /* @__PURE__ */ jsx10(Text10, { color: PALETTE.muted, children: RULE2 }),
17543
17564
  /* @__PURE__ */ jsx10(Text10, { bold: true, children: stepLabel(stepNumber, totalSteps, title) }),
17544
- /* @__PURE__ */ jsx10(Text10, { dimColor: true, children: RULE2 })
17565
+ /* @__PURE__ */ jsx10(Text10, { color: PALETTE.muted, children: RULE2 })
17545
17566
  ] }),
17546
17567
  /* @__PURE__ */ jsx10(Text10, { children: description }),
17547
17568
  /* @__PURE__ */ jsx10(Box9, { marginTop: 1, flexDirection: "column", gap: 1, children: lines.map((line, index) => /* @__PURE__ */ jsx10(Line, { line }, index)) }),
@@ -18198,7 +18219,7 @@ function WindowedPanelHeader({
18198
18219
  }) {
18199
18220
  return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", children: [
18200
18221
  /* @__PURE__ */ jsx13(Text11, { bold: true, color: PALETTE2.info, inverse: focused, children: title }),
18201
- /* @__PURE__ */ jsx13(Text11, { dimColor: true, children: "\u2500".repeat(Math.max(0, width - 2)) })
18222
+ /* @__PURE__ */ jsx13(Text11, { color: PALETTE2.muted, children: "\u2500".repeat(Math.max(0, width - 2)) })
18202
18223
  ] });
18203
18224
  }
18204
18225
  function formatWindowIndicator(direction, count) {
@@ -18226,7 +18247,7 @@ function AddedColumn(props) {
18226
18247
  const showSeparator = firstNonCycleIdx > 0 && i === firstNonCycleIdx;
18227
18248
  const style = sideColumnLabelStyle({ isCycle: entry.isCycle, isSelected, focused });
18228
18249
  return /* @__PURE__ */ jsxs11(React6.Fragment, { children: [
18229
- showSeparator && /* @__PURE__ */ jsx14(Text12, { dimColor: true, children: "\u2500".repeat(Math.max(0, width - 2)) }),
18250
+ showSeparator && /* @__PURE__ */ jsx14(Text12, { color: PALETTE2.muted, children: "\u2500".repeat(Math.max(0, width - 2)) }),
18230
18251
  /* @__PURE__ */ jsxs11(Box11, { children: [
18231
18252
  isCursor ? /* @__PURE__ */ jsx14(Text12, { color: PALETTE2.info, bold: true, children: figures.pointer }) : /* @__PURE__ */ jsx14(Text12, { children: " " }),
18232
18253
  reserveAiBadge && (aiFlagged ? /* @__PURE__ */ jsx14(Text12, { color: PALETTE2.warning, bold: true, children: " [\xD7]" }) : /* @__PURE__ */ jsx14(Text12, { children: " " })),
@@ -21471,17 +21492,6 @@ function PreviewValidationErrorScreen({
21471
21492
  import { useCallback as useCallback5, useEffect as useEffect16, useMemo as useMemo4, useRef as useRef11, useState as useState22 } from "react";
21472
21493
  import figures7 from "figures";
21473
21494
 
21474
- // packages/experience-design-system-cli/src/tui/import/steps/09-review/theme.ts
21475
- var PALETTE3 = {
21476
- info: PALETTE.accent,
21477
- success: PALETTE.success,
21478
- error: PALETTE.error,
21479
- warning: PALETTE.warning,
21480
- muted: PALETTE.muted,
21481
- border: PALETTE.border,
21482
- inverse: "#FFFFFF"
21483
- };
21484
-
21485
21495
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
21486
21496
  var HIDDEN_PROP_CATEGORIES = /* @__PURE__ */ new Set(["state", "unattached"]);
21487
21497
  function getReviewJsonPanelValue(selected, showHiddenProps) {
@@ -21912,13 +21922,13 @@ function serializeState(state2, originalJson) {
21912
21922
  }
21913
21923
  function Picker({ value, active }) {
21914
21924
  return /* @__PURE__ */ jsxs22(Box21, { children: [
21915
- active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.warning, children: "\u2039" }),
21916
- /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE3.warning : void 0, bold: active, children: value }),
21917
- active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.warning, children: "\u203A" })
21925
+ active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u2039" }),
21926
+ /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
21927
+ active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u203A" })
21918
21928
  ] });
21919
21929
  }
21920
21930
  function Toggle({ value, active }) {
21921
- return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE3.warning : value ? PALETTE3.success : PALETTE3.border, children: value ? "[\u2713]" : "[ ]" }) });
21931
+ return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
21922
21932
  }
21923
21933
  function InlinePropField({
21924
21934
  label,
@@ -21928,7 +21938,7 @@ function InlinePropField({
21928
21938
  width
21929
21939
  }) {
21930
21940
  return /* @__PURE__ */ jsxs22(Box21, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
21931
- /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, wrap: "truncate-end", children: [
21941
+ /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
21932
21942
  focused ? "\u203A " : " ",
21933
21943
  label
21934
21944
  ] }),
@@ -21949,7 +21959,7 @@ function DefaultValueRow({
21949
21959
  focused
21950
21960
  }) {
21951
21961
  return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
21952
- /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
21962
+ /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
21953
21963
  focused ? "\u203A " : " ",
21954
21964
  "default:"
21955
21965
  ] }),
@@ -21964,9 +21974,9 @@ function RowLabel({
21964
21974
  return /* @__PURE__ */ jsxs22(
21965
21975
  Text23,
21966
21976
  {
21967
- color: selected ? PALETTE3.inverse : PALETTE3.info,
21977
+ color: selected ? "#FFFFFF" : PALETTE.accent,
21968
21978
  bold: selected,
21969
- backgroundColor: selected ? "blue" : void 0,
21979
+ backgroundColor: selected ? PALETTE.accent : void 0,
21970
21980
  wrap: "truncate-end",
21971
21981
  children: [
21972
21982
  " ",
@@ -21982,7 +21992,7 @@ function ValueInputRow({
21982
21992
  cursorVisible
21983
21993
  }) {
21984
21994
  return /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, children: [
21985
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.info, children: mode === "edit" ? "\u270E " : "+ " }),
21995
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
21986
21996
  /* @__PURE__ */ jsx27(Text23, { children: valueText }),
21987
21997
  /* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: " " })
21988
21998
  ] });
@@ -21999,7 +22009,7 @@ function EditableListItem({
21999
22009
  if (isBeingEdited) {
22000
22010
  return /* @__PURE__ */ jsx27(ValueInputRow, { mode: "edit", valueText, cursorVisible });
22001
22011
  }
22002
- return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE3.info : void 0, children: active ? `${figures5.pointer} ${value}` : ` ${value}` }) });
22012
+ return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.accent : void 0, children: active ? `${figures5.pointer} ${value}` : ` ${value}` }) });
22003
22013
  }
22004
22014
  function EditableValueList({
22005
22015
  values,
@@ -22013,7 +22023,7 @@ function EditableValueList({
22013
22023
  showAddInput
22014
22024
  }) {
22015
22025
  return /* @__PURE__ */ jsxs22(Fragment5, { children: [
22016
- values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: emptyMessage }) : /* @__PURE__ */ jsx27(Box21, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: emptyMessage }) })),
22026
+ values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: emptyMessage }) : /* @__PURE__ */ jsx27(Box21, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: emptyMessage }) })),
22017
22027
  values.map((value, index) => /* @__PURE__ */ jsx27(
22018
22028
  EditableListItem,
22019
22029
  {
@@ -22039,11 +22049,11 @@ function DefaultSubRow({
22039
22049
  const cursor = cursorVisible ? "\u2588" : " ";
22040
22050
  if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
22041
22051
  return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
22042
- /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
22052
+ /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
22043
22053
  focused ? "\u203A " : " ",
22044
22054
  "default:"
22045
22055
  ] }),
22046
- /* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE3.muted, children: "(not applicable)" })
22056
+ /* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(not applicable)" })
22047
22057
  ] });
22048
22058
  }
22049
22059
  if (prop.type === "boolean") {
@@ -22053,11 +22063,11 @@ function DefaultSubRow({
22053
22063
  if (prop.type === "enum") {
22054
22064
  if (prop.values.length === 0) {
22055
22065
  return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
22056
- /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
22066
+ /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
22057
22067
  focused ? "\u203A " : " ",
22058
22068
  "default:"
22059
22069
  ] }),
22060
- /* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE3.muted, children: "(no values defined)" })
22070
+ /* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(no values defined)" })
22061
22071
  ] });
22062
22072
  }
22063
22073
  const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
@@ -22066,11 +22076,11 @@ function DefaultSubRow({
22066
22076
  const value = typeof prop.default === "string" ? prop.default : "";
22067
22077
  if (active) {
22068
22078
  return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "row", flexShrink: 0, children: [
22069
- /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
22079
+ /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
22070
22080
  focused ? "\u203A " : " ",
22071
22081
  "default:"
22072
22082
  ] }),
22073
- /* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
22083
+ /* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
22074
22084
  /* @__PURE__ */ jsx27(Text23, { children: value.slice(0, textCursor) }),
22075
22085
  /* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
22076
22086
  /* @__PURE__ */ jsx27(Text23, { children: value.slice(textCursor + 1) })
@@ -22078,11 +22088,11 @@ function DefaultSubRow({
22078
22088
  ] });
22079
22089
  }
22080
22090
  return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
22081
- /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
22091
+ /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
22082
22092
  focused ? "\u203A " : " ",
22083
22093
  "default:"
22084
22094
  ] }),
22085
- /* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 : PALETTE3.muted, children: value || "(none)" })
22095
+ /* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 : PALETTE.muted, children: value || "(none)" })
22086
22096
  ] });
22087
22097
  }
22088
22098
  function DescriptionField({
@@ -22098,15 +22108,15 @@ function DescriptionField({
22098
22108
  }) {
22099
22109
  if (compact) {
22100
22110
  return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
22101
- /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
22111
+ /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
22102
22112
  focused ? "\u203A " : " ",
22103
22113
  label
22104
22114
  ] }),
22105
- /* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 : PALETTE3.muted, children: value || "\u2014" })
22115
+ /* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
22106
22116
  ] });
22107
22117
  }
22108
22118
  return /* @__PURE__ */ jsxs22(Box21, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
22109
- /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
22119
+ /* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
22110
22120
  focused ? "\u203A " : " ",
22111
22121
  label
22112
22122
  ] }),
@@ -22170,7 +22180,7 @@ function PropRow({
22170
22180
  ] }),
22171
22181
  prop.type === "token" && /* @__PURE__ */ jsx27(InlinePropField, { label: "kind:", focused: activeField === "tokenKind", width, children: editingField && activeField === "tokenKind" ? /* @__PURE__ */ jsx27(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: prop.tokenKind || "\u2014" }) }),
22172
22182
  prop.type === "enum" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
22173
- /* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ? PALETTE3.warning : PALETTE3.muted, bold: activeField === "values", children: [
22183
+ /* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
22174
22184
  activeField === "values" ? "\u203A " : " ",
22175
22185
  "values:"
22176
22186
  ] }),
@@ -22191,27 +22201,27 @@ function PropRow({
22191
22201
  }
22192
22202
  ),
22193
22203
  prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
22194
- /* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ? PALETTE3.warning : PALETTE3.muted, bold: activeField === "allowed", children: [
22204
+ /* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
22195
22205
  activeField === "allowed" ? "\u203A " : " ",
22196
22206
  "allowed:"
22197
22207
  ] }),
22198
- editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: /* @__PURE__ */ jsx27(Text23, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx27(
22208
+ editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: /* @__PURE__ */ jsx27(Text23, { children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx27(
22199
22209
  Text23,
22200
22210
  {
22201
- color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE3.muted : void 0,
22211
+ color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
22202
22212
  wrap: "wrap",
22203
22213
  children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)"
22204
22214
  }
22205
22215
  )
22206
22216
  ] }),
22207
- selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: (() => {
22217
+ selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: (() => {
22208
22218
  const max = Math.max(8, width - 8);
22209
22219
  const text = `~ ${rationale}`;
22210
22220
  return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
22211
22221
  })() }) }, rowKey ? `rationale-${rowKey}` : void 0),
22212
22222
  selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, flexDirection: "column", children: [
22213
22223
  /* @__PURE__ */ jsxs22(Box21, { children: [
22214
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "values:" }),
22224
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "values:" }),
22215
22225
  activeField === "values" && /* @__PURE__ */ jsx27(Text23, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
22216
22226
  ] }),
22217
22227
  /* @__PURE__ */ jsx27(
@@ -22272,7 +22282,7 @@ function SlotRow({
22272
22282
  /* @__PURE__ */ jsxs22(
22273
22283
  Text23,
22274
22284
  {
22275
- color: activeField === "allowedComponents" ? PALETTE3.warning : PALETTE3.muted,
22285
+ color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
22276
22286
  bold: activeField === "allowedComponents",
22277
22287
  children: [
22278
22288
  activeField === "allowedComponents" ? "\u203A " : " ",
@@ -22280,14 +22290,14 @@ function SlotRow({
22280
22290
  ]
22281
22291
  }
22282
22292
  ),
22283
- slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(any)" }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
22293
+ slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
22284
22294
  ] }),
22285
22295
  selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
22286
22296
  /* @__PURE__ */ jsxs22(Box21, { children: [
22287
22297
  /* @__PURE__ */ jsxs22(
22288
22298
  Text23,
22289
22299
  {
22290
- color: activeField === "allowedComponents" ? PALETTE3.warning : PALETTE3.muted,
22300
+ color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
22291
22301
  bold: activeField === "allowedComponents",
22292
22302
  children: [
22293
22303
  activeField === "allowedComponents" ? "\u203A " : " ",
@@ -22295,7 +22305,7 @@ function SlotRow({
22295
22305
  ]
22296
22306
  }
22297
22307
  ),
22298
- editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: slot.allowedComponents.length > 0 ? " [a] add [e] edit [r] remove [\u2190\u2192] cycle [\u2191\u2193] navigate [K/J] reorder" : " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
22308
+ editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: slot.allowedComponents.length > 0 ? " [a] add [e] edit [r] remove [\u2190\u2192] cycle [\u2191\u2193] navigate [K/J] reorder" : " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
22299
22309
  ] }),
22300
22310
  /* @__PURE__ */ jsx27(
22301
22311
  EditableValueList,
@@ -22311,21 +22321,21 @@ function SlotRow({
22311
22321
  showAddInput: editingField && activeField === "allowedComponents"
22312
22322
  }
22313
22323
  ),
22314
- editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
22324
+ editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
22315
22325
  const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
22316
22326
  if (filtered.length === 0) {
22317
- return /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
22327
+ return /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
22318
22328
  }
22319
22329
  const cursor = pickerCursor % filtered.length;
22320
22330
  const MAX_VISIBLE = 5;
22321
22331
  const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
22322
22332
  const slice = filtered.slice(start, start + MAX_VISIBLE);
22323
22333
  return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
22324
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
22334
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
22325
22335
  slice.map((name, i) => {
22326
22336
  const absIdx = start + i;
22327
22337
  const isCursor = absIdx === cursor;
22328
- return /* @__PURE__ */ jsx27(Text23, { color: isCursor ? PALETTE3.info : PALETTE3.muted, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
22338
+ return /* @__PURE__ */ jsx27(Text23, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
22329
22339
  })
22330
22340
  ] });
22331
22341
  })() })
@@ -23154,18 +23164,18 @@ function FieldEditor({
23154
23164
  });
23155
23165
  const innerWidth = Math.max(1, width - 2);
23156
23166
  if (parseErr) {
23157
- return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE3.error, children: [
23158
- /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE3.error, children: "FIELD EDITOR \u2014 parse error" }),
23159
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.error, children: parseErr }),
23160
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "Cannot display structured editor. Fix the JSON first." })
23167
+ return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
23168
+ /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
23169
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: parseErr }),
23170
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
23161
23171
  ] });
23162
23172
  }
23163
23173
  if (props.length === 0 && slots.length === 0) {
23164
- return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE3.warning, children: [
23165
- /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE3.warning, children: "FIELD EDITOR \u2014 no fields" }),
23166
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
23167
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "You can add fields manually below or reject this component." }),
23168
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "Enter to save \xB7 Esc to discard" })
23174
+ return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
23175
+ /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
23176
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
23177
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
23178
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Enter to save \xB7 Esc to discard" })
23169
23179
  ] });
23170
23180
  }
23171
23181
  const hasEmptyProperties = props.length === 0 && slots.length === 0;
@@ -23294,7 +23304,7 @@ function FieldEditor({
23294
23304
  const renderRow = (row, index) => {
23295
23305
  const key = rowKey(row, index);
23296
23306
  if (row.kind === "header") {
23297
- return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE3.success, children: row.label }) }, key);
23307
+ return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.success, children: row.label }) }, key);
23298
23308
  }
23299
23309
  if (row.kind === "component-description") {
23300
23310
  const isSelected2 = inComponentDesc && active;
@@ -23376,9 +23386,9 @@ function FieldEditor({
23376
23386
  ...fixedHeight ? { height } : { minHeight: height },
23377
23387
  clipOverflow: fixedHeight,
23378
23388
  borderStyle: "single",
23379
- borderColor: hasEmptyProperties ? PALETTE3.warning : active ? PALETTE3.info : PALETTE3.border,
23389
+ borderColor: hasEmptyProperties ? PALETTE.warning : active ? PALETTE.accent : PALETTE.border,
23380
23390
  children: [
23381
- hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
23391
+ hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
23382
23392
  header,
23383
23393
  /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx27(
23384
23394
  PropRow,
@@ -23429,7 +23439,7 @@ function FieldEditor({
23429
23439
  `visible-${key}`
23430
23440
  );
23431
23441
  }) }),
23432
- categoryBelow && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.success, bold: true, children: `(${categoryBelow} below)` }),
23442
+ categoryBelow && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.success, bold: true, children: `(${categoryBelow} below)` }),
23433
23443
  sourceOpen && !onToggleSourceExternal && (() => {
23434
23444
  const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
23435
23445
  const start = propMeta?.sourceStartLine ?? null;
@@ -23439,20 +23449,20 @@ function FieldEditor({
23439
23449
  const headerPath = path5 ?? "<unknown source path>";
23440
23450
  if (!start || !end2 || !src) {
23441
23451
  return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
23442
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, bold: true, children: `source: ${headerPath}` }),
23443
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(no source location captured for this prop)" }),
23452
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
23453
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
23444
23454
  /* @__PURE__ */ jsx27(Text23, { children: "[s] close" })
23445
23455
  ] });
23446
23456
  }
23447
23457
  const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
23448
23458
  return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
23449
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
23450
- lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: ln }, `source-line-${i}`)),
23459
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
23460
+ lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
23451
23461
  /* @__PURE__ */ jsx27(Text23, { children: "[s] close \xB7 [Esc] close" })
23452
23462
  ] });
23453
23463
  })(),
23454
- showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.info, paddingX: 1, children: [
23455
- /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE3.info, children: "Keybindings" }),
23464
+ showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
23465
+ /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
23456
23466
  /* @__PURE__ */ jsx27(Text23, { children: " " }),
23457
23467
  /* @__PURE__ */ jsx27(Text23, { bold: true, children: "Row navigation" }),
23458
23468
  /* @__PURE__ */ jsx27(Text23, { children: " \u2191/\u2193 move between rows" }),
@@ -23477,10 +23487,10 @@ function FieldEditor({
23477
23487
  /* @__PURE__ */ jsx27(Text23, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
23478
23488
  /* @__PURE__ */ jsx27(Text23, { children: " ? toggle this overlay" }),
23479
23489
  /* @__PURE__ */ jsx27(Text23, { children: " " }),
23480
- /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "press ? or Esc to close" })
23490
+ /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "press ? or Esc to close" })
23481
23491
  ] }),
23482
- validationError && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.error, children: "\u2717 " + validationError }),
23483
- /* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: modeLabel }) })
23492
+ validationError && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: "\u2717 " + validationError }),
23493
+ /* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: modeLabel }) })
23484
23494
  ]
23485
23495
  }
23486
23496
  );
@@ -23532,16 +23542,16 @@ function RationaleLine({ line, active }) {
23532
23542
  return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { children: " " }) });
23533
23543
  }
23534
23544
  if (line.kind === "heading") {
23535
- return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? PALETTE3.info : PALETTE3.muted, children: line.text }) });
23545
+ return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
23536
23546
  }
23537
23547
  if (line.kind === "label") {
23538
23548
  return /* @__PURE__ */ jsxs23(Box22, { children: [
23539
23549
  line.prefix && /* @__PURE__ */ jsx28(Text24, { children: line.prefix }),
23540
- /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color : PALETTE3.muted, children: line.text }),
23541
- line.suffix && /* @__PURE__ */ jsx28(Text24, { color: PALETTE3.muted, children: line.suffix })
23550
+ /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
23551
+ line.suffix && /* @__PURE__ */ jsx28(Text24, { color: PALETTE.muted, children: line.suffix })
23542
23552
  ] });
23543
23553
  }
23544
- return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ? PALETTE3.muted : void 0, children: line.text }) });
23554
+ return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
23545
23555
  }
23546
23556
 
23547
23557
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
@@ -23620,9 +23630,9 @@ function ComponentRationalePanel({
23620
23630
  width,
23621
23631
  height: height + 2,
23622
23632
  borderStyle: "single",
23623
- borderColor: active ? PALETTE3.inverse : void 0,
23633
+ borderColor: active ? PALETTE.text : void 0,
23624
23634
  children: [
23625
- /* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 : PALETTE3.muted, children: `Component rationale: ${data.name}` }) }),
23635
+ /* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
23626
23636
  visible.map((line, i) => /* @__PURE__ */ jsx29(RationaleLine, { line, active }, i)),
23627
23637
  /* @__PURE__ */ jsx29(Box23, { children: overflowed ? /* @__PURE__ */ jsx29(Text25, { children: `${visibleStart}-${visibleEnd}/${totalLines} [\u2191\u2193] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx29(Text25, { children: "[I/Esc] close" }) })
23628
23638
  ]
@@ -23637,7 +23647,7 @@ import { Box as Box25 } from "ink";
23637
23647
  import { Text as Text26 } from "ink";
23638
23648
  import { Fragment as Fragment6, jsx as jsx30 } from "react/jsx-runtime";
23639
23649
  function HighlightedLine({ parts }) {
23640
- return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ? PALETTE3.muted : part.color, children: part.text }, i)) });
23650
+ return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ? PALETTE.muted : part.color, children: part.text }, i)) });
23641
23651
  }
23642
23652
 
23643
23653
  // packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
@@ -23657,10 +23667,10 @@ function ScrollablePanel({
23657
23667
  const overflowed = totalLines > height;
23658
23668
  return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
23659
23669
  /* @__PURE__ */ jsxs25(Box24, { children: [
23660
- /* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 : PALETTE3.muted, children: title }),
23670
+ /* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
23661
23671
  overflowed && /* @__PURE__ */ jsxs25(Fragment7, { children: [
23662
23672
  /* @__PURE__ */ jsx31(Box24, { flexGrow: 1 }),
23663
- /* @__PURE__ */ jsx31(Text27, { color: active ? void 0 : PALETTE3.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
23673
+ /* @__PURE__ */ jsx31(Text27, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
23664
23674
  ] })
23665
23675
  ] }),
23666
23676
  children
@@ -23746,7 +23756,7 @@ function renderRationaleLines(rows, innerWidth) {
23746
23756
  out.push({
23747
23757
  kind: "label",
23748
23758
  text: row.name,
23749
- color: PALETTE3.info,
23759
+ color: PALETTE.accent,
23750
23760
  suffix: row.kind === "slot" ? " (slot)" : void 0
23751
23761
  });
23752
23762
  for (const line of wrapText(row.rationale, innerWidth)) {
@@ -23782,7 +23792,7 @@ function RationalePanel({
23782
23792
  totalLines,
23783
23793
  visibleStart,
23784
23794
  visibleEnd,
23785
- borderColor: active ? PALETTE3.inverse : void 0,
23795
+ borderColor: active ? PALETTE.text : void 0,
23786
23796
  children: visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i))
23787
23797
  }
23788
23798
  );
@@ -23817,21 +23827,29 @@ function TokenReviewPanel({
23817
23827
  width,
23818
23828
  height: height + 2,
23819
23829
  borderStyle: "single",
23820
- borderColor: active ? PALETTE3.inverse : void 0,
23830
+ borderColor: active ? PALETTE.text : void 0,
23821
23831
  children: [
23822
- /* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE3.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
23823
- /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
23832
+ /* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
23833
+ /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
23824
23834
  /* @__PURE__ */ jsx34(Text28, { children: " " }),
23825
- current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, children: "(no compatible tokens found for this token kind)" }),
23835
+ current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
23826
23836
  visiblePaths.map((path5, i) => {
23827
23837
  const pathIndex = scrollStart + i;
23828
23838
  const checked = editSelection.has(path5);
23829
23839
  const focused = pathIndex === editCursor;
23830
- return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ? PALETTE3.info : active ? void 0 : PALETTE3.muted, bold: focused, wrap: "truncate", children: ` [${checked ? "x" : " "}] ${path5}` }) }, path5);
23840
+ return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
23841
+ Text28,
23842
+ {
23843
+ color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
23844
+ bold: focused,
23845
+ wrap: "truncate",
23846
+ children: ` [${checked ? "x" : " "}] ${path5}`
23847
+ }
23848
+ ) }, path5);
23831
23849
  }),
23832
23850
  /* @__PURE__ */ jsx34(Text28, { children: " " }),
23833
- /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
23834
- /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
23851
+ /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
23852
+ /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
23835
23853
  ]
23836
23854
  }
23837
23855
  );
@@ -23843,16 +23861,16 @@ function TokenReviewPanel({
23843
23861
  width,
23844
23862
  height: height + 2,
23845
23863
  borderStyle: "single",
23846
- borderColor: active ? PALETTE3.inverse : void 0,
23864
+ borderColor: active ? PALETTE.text : void 0,
23847
23865
  children: [
23848
- /* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE3.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
23849
- suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, children: "(no token suggestions for this component)" }),
23866
+ /* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
23867
+ suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
23850
23868
  suggestions.map((s, i) => {
23851
23869
  const focused = i === selectedRow;
23852
23870
  return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
23853
- /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ? PALETTE3.info : active ? void 0 : PALETTE3.muted, bold: focused, children: `${focused ? figures6.pointer : " "} ${s.propName}` }) }),
23854
- /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
23855
- /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, children: ` allowed: ${s.allowed.join(", ")}` })
23871
+ /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures6.pointer : " "} ${s.propName}` }) }),
23872
+ /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
23873
+ /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
23856
23874
  ] }, s.propName);
23857
23875
  }),
23858
23876
  /* @__PURE__ */ jsx34(Text28, { children: " " }),
@@ -23937,9 +23955,9 @@ function ReviewDetailsPanel({
23937
23955
  const sourceLineCount = Math.max(1, height - 4);
23938
23956
  const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
23939
23957
  return /* @__PURE__ */ jsxs27(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
23940
- /* @__PURE__ */ jsx35(Text29, { color: PALETTE3.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
23941
- source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color: PALETTE3.muted, wrap: "truncate-end", children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx35(Text29, { color: PALETTE3.muted, children: "(no source captured)" }),
23942
- /* @__PURE__ */ jsx35(Text29, { color: PALETTE3.muted, wrap: "truncate-end", children: "[s/Esc] close" })
23958
+ /* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
23959
+ source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, wrap: "truncate-end", children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, children: "(no source captured)" }),
23960
+ /* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, wrap: "truncate-end", children: "[s/Esc] close" })
23943
23961
  ] });
23944
23962
  }
23945
23963
  if (panelOpen === "token-review") {
@@ -24089,17 +24107,17 @@ function ReviewEmptyComponentsWarning({
24089
24107
  hidden
24090
24108
  }) {
24091
24109
  if (hidden || count === 0) return null;
24092
- return /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
24110
+ return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
24093
24111
  }
24094
24112
  function ReviewNoSelection() {
24095
- return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.muted, children: "No component selected" }) });
24113
+ return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, children: "No component selected" }) });
24096
24114
  }
24097
24115
  function ReviewFinalizeError({
24098
24116
  message,
24099
24117
  hidden
24100
24118
  }) {
24101
24119
  if (hidden || !message) return null;
24102
- return /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.error, children: `\u26A0 ${message}` });
24120
+ return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.error, children: `\u26A0 ${message}` });
24103
24121
  }
24104
24122
  function ReviewPanelFooter({
24105
24123
  reviewEditor,
@@ -24123,7 +24141,7 @@ function ReviewComponentTitle({
24123
24141
  return /* @__PURE__ */ jsxs28(Box27, { paddingLeft: 2, paddingBottom: 1, children: [
24124
24142
  /* @__PURE__ */ jsx37(Text30, { bold: true, wrap: "truncate-end", children: selectedKey }),
24125
24143
  /* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
24126
- /* @__PURE__ */ jsxs28(Text30, { color: PALETTE3.muted, wrap: "truncate-end", children: [
24144
+ /* @__PURE__ */ jsxs28(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: [
24127
24145
  propCount,
24128
24146
  " prop",
24129
24147
  propCount !== 1 ? "s" : "",
@@ -24179,8 +24197,8 @@ function ReviewComponentPanel({
24179
24197
  )
24180
24198
  }
24181
24199
  ) }),
24182
- /* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ? PALETTE3.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
24183
- /* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx37(
24200
+ /* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ? PALETTE.error : void 0, wrap: "truncate-end", children: saveError ? "\u2717 " + saveError : " " }) }),
24201
+ /* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx37(
24184
24202
  ReviewPanelFooter,
24185
24203
  {
24186
24204
  reviewEditor,
@@ -24208,11 +24226,11 @@ function countReviewStatuses(entries) {
24208
24226
  );
24209
24227
  }
24210
24228
  function ReviewLoadingState() {
24211
- return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color: PALETTE3.muted, children: "Loading generated definitions..." }) });
24229
+ return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
24212
24230
  }
24213
24231
  function ReviewLoadError({ message }) {
24214
24232
  return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
24215
- /* @__PURE__ */ jsx38(Text31, { color: PALETTE3.error, children: message }),
24233
+ /* @__PURE__ */ jsx38(Text31, { color: PALETTE.error, children: message }),
24216
24234
  /* @__PURE__ */ jsx38(Text31, { children: " " }),
24217
24235
  /* @__PURE__ */ jsx38(Text31, { children: "[q / Enter / Esc] Quit" })
24218
24236
  ] });
@@ -24448,41 +24466,41 @@ function FinalizeDialog({
24448
24466
  /* @__PURE__ */ jsx39(Text32, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
24449
24467
  /* @__PURE__ */ jsx39(Text32, { children: " " }),
24450
24468
  /* @__PURE__ */ jsxs30(Text32, { children: [
24451
- /* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.success, children: [
24469
+ /* @__PURE__ */ jsxs30(Text32, { color: PALETTE.success, children: [
24452
24470
  accepted,
24453
24471
  " accepted"
24454
24472
  ] }),
24455
24473
  /* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
24456
- /* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.error, children: [
24474
+ /* @__PURE__ */ jsxs30(Text32, { color: PALETTE.error, children: [
24457
24475
  rejected,
24458
24476
  " rejected"
24459
24477
  ] }),
24460
24478
  /* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
24461
- /* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.muted, children: [
24479
+ /* @__PURE__ */ jsxs30(Text32, { color: PALETTE.muted, children: [
24462
24480
  needsReview,
24463
24481
  " unresolved"
24464
24482
  ] })
24465
24483
  ] }),
24466
24484
  /* @__PURE__ */ jsx39(Text32, { children: " " }),
24467
24485
  noneAccepted && /* @__PURE__ */ jsxs30(Fragment10, { children: [
24468
- /* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE3.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
24469
- /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
24486
+ /* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
24487
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
24470
24488
  /* @__PURE__ */ jsx39(Text32, { children: " " })
24471
24489
  ] }),
24472
24490
  !allResolved && /* @__PURE__ */ jsxs30(Fragment10, { children: [
24473
- /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
24474
- /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.warning, children: "Only explicitly accepted components ship." }),
24491
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
24492
+ /* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
24475
24493
  /* @__PURE__ */ jsx39(Text32, { children: " " })
24476
24494
  ] }),
24477
24495
  /* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", height: 2, children: [
24478
- previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx39(Text32, { children: " " }),
24496
+ previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "Previewing deletions against the target space\u2026" }) : previewStatus === "error" ? /* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }) : /* @__PURE__ */ jsx39(Text32, { children: " " }),
24479
24497
  /* @__PURE__ */ jsx39(Text32, { children: " " })
24480
24498
  ] }),
24481
24499
  previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs30(Fragment10, { children: [
24482
- /* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE3.error, children: removedComponentsHeader(removed.length, false) }),
24483
- hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.muted, children: "\u2191 more above" }),
24484
- windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.error, children: removedComponentLine(rc) }, rc.id)),
24485
- hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color: PALETTE3.muted, children: "\u2193 more below" }),
24500
+ /* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
24501
+ hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2191 more above" }),
24502
+ windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
24503
+ hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2193 more below" }),
24486
24504
  removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx39(Text32, { children: "[\u2191\u2193] scroll deletions" }),
24487
24505
  /* @__PURE__ */ jsx39(Text32, { children: " " })
24488
24506
  ] }),
@@ -24976,8 +24994,8 @@ function ReviewStepDialogs({
24976
24994
  }
24977
24995
  function ReviewReloadDialog({ open }) {
24978
24996
  if (!open) return null;
24979
- return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
24980
- /* @__PURE__ */ jsx41(Text34, { bold: true, color: PALETTE3.warning, children: "Reload from saved state?" }),
24997
+ return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
24998
+ /* @__PURE__ */ jsx41(Text34, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
24981
24999
  /* @__PURE__ */ jsx41(Text34, { children: "Unsaved in-memory changes will be lost." }),
24982
25000
  /* @__PURE__ */ jsx41(Text34, { children: " " }),
24983
25001
  /* @__PURE__ */ jsx41(Text34, { children: " [Enter] Confirm" }),
@@ -25363,19 +25381,19 @@ function LivePreviewSummary({
25363
25381
  const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
25364
25382
  for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
25365
25383
  const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
25366
- if (disabled) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE3.muted, children: "Preview: disabled (creds rejected)" });
25367
- if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE3.muted, children: `Preview: ${spinner} running...` });
25384
+ if (disabled) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
25385
+ if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
25368
25386
  if (!hasCounts) return null;
25369
25387
  return /* @__PURE__ */ jsxs33(Box32, { children: [
25370
25388
  /* @__PURE__ */ jsx42(Text35, { children: "Preview: " }),
25371
- /* @__PURE__ */ jsx42(Text35, { color: PALETTE3.success, children: `${counts.new} new` }),
25389
+ /* @__PURE__ */ jsx42(Text35, { color: PALETTE.success, children: `${counts.new} new` }),
25372
25390
  /* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
25373
- /* @__PURE__ */ jsx42(Text35, { color: PALETTE3.warning, children: `${counts.changed} changed` }),
25391
+ /* @__PURE__ */ jsx42(Text35, { color: PALETTE.warning, children: `${counts.changed} changed` }),
25374
25392
  /* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
25375
- /* @__PURE__ */ jsx42(Text35, { color: PALETTE3.muted, children: `${counts.removed} removed` }),
25393
+ /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `${counts.removed} removed` }),
25376
25394
  showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx42(Text35, { children: " ([d] removed list)" }),
25377
25395
  /* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
25378
- /* @__PURE__ */ jsx42(Text35, { color: PALETTE3.error, bold: true, children: `${counts.breaking} breaking` })
25396
+ /* @__PURE__ */ jsx42(Text35, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
25379
25397
  ] });
25380
25398
  }
25381
25399
 
@@ -25421,10 +25439,10 @@ function CyclePathLine({
25421
25439
  highlightComponents = false,
25422
25440
  highlightLine = false
25423
25441
  }) {
25424
- return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ? PALETTE3.warning : void 0, children: [
25442
+ return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ? PALETTE.warning : void 0, children: [
25425
25443
  prefix,
25426
25444
  segments.map(
25427
- (segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.info, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: segment.text }, index) : /* @__PURE__ */ jsx43(Text36, { color: highlightComponents ? PALETTE3.warning : void 0, children: segment.text }, index)
25445
+ (segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE.accent, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: segment.text }, index) : /* @__PURE__ */ jsx43(Text36, { color: highlightComponents ? PALETTE.warning : void 0, children: segment.text }, index)
25428
25446
  )
25429
25447
  ] });
25430
25448
  }
@@ -25436,9 +25454,9 @@ function CycleDetailPanel({
25436
25454
  height
25437
25455
  }) {
25438
25456
  const lines = [
25439
- /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
25440
- /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
25441
- /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
25457
+ /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
25458
+ /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
25459
+ /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
25442
25460
  /* @__PURE__ */ jsx43(Text36, { children: " " }, "cyc-space")
25443
25461
  ];
25444
25462
  cycles.forEach((cycle, index) => {
@@ -25450,7 +25468,7 @@ function CycleDetailPanel({
25450
25468
  );
25451
25469
  if (cycle.suggestedBreak) {
25452
25470
  lines.push(
25453
- /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
25471
+ /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
25454
25472
  );
25455
25473
  }
25456
25474
  lines.push(/* @__PURE__ */ jsx43(Text36, { children: " " }, `cyc-s-${index}`));
@@ -25458,9 +25476,9 @@ function CycleDetailPanel({
25458
25476
  const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
25459
25477
  const viewportHeight = Math.max(1, height - 3);
25460
25478
  const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
25461
- return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE3.warning, paddingLeft: 1, children: [
25479
+ return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
25462
25480
  visible,
25463
- /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: footer })
25481
+ /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: footer })
25464
25482
  ] });
25465
25483
  }
25466
25484
  function BreakCyclePanel({
@@ -25471,14 +25489,14 @@ function BreakCyclePanel({
25471
25489
  width,
25472
25490
  height
25473
25491
  }) {
25474
- return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE3.warning, paddingLeft: 1, children: [
25475
- /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
25492
+ return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
25493
+ /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
25476
25494
  cycle && /* @__PURE__ */ jsx43(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
25477
- /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
25495
+ /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
25478
25496
  /* @__PURE__ */ jsx43(Text36, { children: " " }),
25479
- edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: "remove slot edge:" }),
25497
+ edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "remove slot edge:" }),
25480
25498
  edges.map((edge, index) => /* @__PURE__ */ jsx43(Text36, { inverse: index === cursor, children: `${index === cursor ? figures7.pointer : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `${edge.fromComponent}-${edge.slotName}-${edge.toComponent}`)),
25481
- confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.warning, children: "Delete this slot edge? [y] confirm [n] cancel" }) : /* @__PURE__ */ jsx43(Text36, { children: "[\u2191\u2193] move [Enter] delete [x/Esc] close" })
25499
+ confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" }) : /* @__PURE__ */ jsx43(Text36, { children: "[\u2191\u2193] move [Enter] delete [x/Esc] close" })
25482
25500
  ] });
25483
25501
  }
25484
25502
  var HELP_SECTIONS2 = [
@@ -25584,7 +25602,7 @@ function deriveBreakingChanges(response) {
25584
25602
  }
25585
25603
  function GenerateReviewStep(props) {
25586
25604
  if (!props.extractSessionId) {
25587
- return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
25605
+ return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
25588
25606
  }
25589
25607
  return /* @__PURE__ */ jsx43(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
25590
25608
  }
@@ -26501,8 +26519,8 @@ function GenerateReviewStepView({
26501
26519
  }
26502
26520
  ),
26503
26521
  /* @__PURE__ */ jsx43(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
26504
- removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.error, paddingX: 1, children: [
26505
- /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.error, children: removedComponentsHeader(removedComponents.length, true) }),
26522
+ removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
26523
+ /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
26506
26524
  !removedBannerCollapsed && /* @__PURE__ */ jsxs34(Fragment13, { children: [
26507
26525
  /* @__PURE__ */ jsx43(Text36, { children: " " }),
26508
26526
  removedComponents.map((rc) => /* @__PURE__ */ jsx43(Text36, { children: removedComponentLine(rc) }, rc.id))
@@ -26511,7 +26529,7 @@ function GenerateReviewStepView({
26511
26529
  breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx43(Box33, { paddingX: 1, children: /* @__PURE__ */ jsx43(
26512
26530
  Text36,
26513
26531
  {
26514
- color: PALETTE3.warning,
26532
+ color: PALETTE.warning,
26515
26533
  children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
26516
26534
  }
26517
26535
  ) }),
@@ -26519,10 +26537,10 @@ function GenerateReviewStepView({
26519
26537
  const row = breakingRows[breakingCursor];
26520
26538
  const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
26521
26539
  if (!comp) return null;
26522
- return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
26523
- /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE3.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
26524
- comp.impact && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
26525
- comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx43(Text36, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
26540
+ return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
26541
+ /* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
26542
+ comp.impact && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
26543
+ comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx43(Text36, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
26526
26544
  /* @__PURE__ */ jsx43(Text36, { children: "[D/Esc] close detail" })
26527
26545
  ] });
26528
26546
  })(),
@@ -26545,11 +26563,11 @@ function GenerateReviewStepView({
26545
26563
  const participantSet = cycleView.structural;
26546
26564
  const members = stillRejected.filter((n) => participantSet.has(n)).sort();
26547
26565
  const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
26548
- return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE3.error, paddingX: 1, children: [
26549
- /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
26550
- members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.error, children: ` Cycle members: ${members.join(", ")}` }),
26551
- ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
26552
- /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
26566
+ return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
26567
+ /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
26568
+ members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
26569
+ ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
26570
+ /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
26553
26571
  ] });
26554
26572
  })(),
26555
26573
  /* @__PURE__ */ jsx43(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
@@ -26665,7 +26683,7 @@ function GenerateReviewStepView({
26665
26683
  ) : /* @__PURE__ */ jsx43(ReviewNoSelection, {})
26666
26684
  ] }),
26667
26685
  !dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", children: [
26668
- /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
26686
+ /* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
26669
26687
  cycleRows.slice(0, 3).map((cycle, idx) => {
26670
26688
  return /* @__PURE__ */ jsx43(
26671
26689
  CyclePathLine,
@@ -26678,7 +26696,7 @@ function GenerateReviewStepView({
26678
26696
  `cyc-banner-${idx}`
26679
26697
  );
26680
26698
  }),
26681
- cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.warning, children: ` \u2026${cycleRows.length - 3} more` }),
26699
+ cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: ` \u2026${cycleRows.length - 3} more` }),
26682
26700
  /* @__PURE__ */ jsx43(Text36, { children: " press [c] for detail" })
26683
26701
  ] }),
26684
26702
  /* @__PURE__ */ jsx43(
@@ -26698,36 +26716,16 @@ function GenerateReviewStepView({
26698
26716
 
26699
26717
  // packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/CustomPromptBanner.tsx
26700
26718
  import { Box as Box34, Text as Text37 } from "ink";
26701
-
26702
- // packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts
26703
- import { defaultTheme as defaultTheme2, extendTheme as extendTheme2 } from "@inkjs/ui";
26704
- var PALETTE4 = {
26705
- ...PALETTE3,
26706
- link: "#58A6FF"
26707
- };
26708
- var INK_UI_THEME = extendTheme2(defaultTheme2, {
26709
- components: {
26710
- ProgressBar: {
26711
- styles: {
26712
- completed: () => ({
26713
- color: "blue"
26714
- })
26715
- }
26716
- }
26717
- }
26718
- });
26719
-
26720
- // packages/experience-design-system-cli/src/tui/import/steps/10-flow/components/CustomPromptBanner.tsx
26721
26719
  import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
26722
26720
  function CustomPromptBanner({ generatePromptPath }) {
26723
26721
  if (!generatePromptPath) return null;
26724
- return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE4.warning, paddingX: 1, children: [
26725
- /* @__PURE__ */ jsx44(Text37, { color: PALETTE4.warning, bold: true, children: "WARNING: Custom prompt active" }),
26726
- generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color: PALETTE4.warning, children: [
26722
+ return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
26723
+ /* @__PURE__ */ jsx44(Text37, { color: PALETTE.warning, bold: true, children: "WARNING: Custom prompt active" }),
26724
+ generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color: PALETTE.warning, children: [
26727
26725
  "components: ",
26728
26726
  generatePromptPath
26729
26727
  ] }) : null,
26730
- /* @__PURE__ */ jsx44(Text37, { color: PALETTE4.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
26728
+ /* @__PURE__ */ jsx44(Text37, { color: PALETTE.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
26731
26729
  ] });
26732
26730
  }
26733
26731
 
@@ -26752,10 +26750,10 @@ import { Box as Box35, Text as Text38 } from "ink";
26752
26750
  import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
26753
26751
  function SpaceEnvironment({ spaceId, environmentId }) {
26754
26752
  return /* @__PURE__ */ jsxs36(Box35, { gap: 1, marginTop: 1, children: [
26755
- /* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "Space:" }),
26753
+ /* @__PURE__ */ jsx45(Text38, { color: PALETTE.muted, children: "Space:" }),
26756
26754
  /* @__PURE__ */ jsx45(Text38, { children: spaceId }),
26757
- /* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "/" }),
26758
- /* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "Environment:" }),
26755
+ /* @__PURE__ */ jsx45(Text38, { color: PALETTE.muted, children: "/" }),
26756
+ /* @__PURE__ */ jsx45(Text38, { color: PALETTE.muted, children: "Environment:" }),
26759
26757
  /* @__PURE__ */ jsx45(Text38, { children: environmentId })
26760
26758
  ] });
26761
26759
  }
@@ -26767,13 +26765,13 @@ function EntityRows({ entity, label }) {
26767
26765
  const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
26768
26766
  return /* @__PURE__ */ jsxs37(Fragment14, { children: [
26769
26767
  ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs37(Text39, { children: [
26770
- /* @__PURE__ */ jsx46(Text39, { color: PALETTE4.success, children: "\u2713" }),
26768
+ /* @__PURE__ */ jsx46(Text39, { color: PALETTE.success, children: "\u2713" }),
26771
26769
  " ",
26772
26770
  plural3(entity[action]),
26773
26771
  " ",
26774
26772
  action
26775
26773
  ] }, action)),
26776
- entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
26774
+ entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE.error, children: [
26777
26775
  "\u2717 ",
26778
26776
  plural3(entity.failed),
26779
26777
  " failed \u2014 check logs above"
@@ -26782,8 +26780,8 @@ function EntityRows({ entity, label }) {
26782
26780
  }
26783
26781
  function LinkRow({ title, url }) {
26784
26782
  return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
26785
- /* @__PURE__ */ jsx46(Text39, { color: PALETTE4.muted, children: title }),
26786
- /* @__PURE__ */ jsx46(Text39, { color: PALETTE4.link, children: url })
26783
+ /* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: title }),
26784
+ /* @__PURE__ */ jsx46(Text39, { color: PALETTE.accent, children: url })
26787
26785
  ] });
26788
26786
  }
26789
26787
  function DoneStep({
@@ -26806,17 +26804,17 @@ function DoneStep({
26806
26804
  const success = totalFailed === 0;
26807
26805
  const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
26808
26806
  return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
26809
- success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE4.success, children: "Done!" }) : /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE4.warning, children: "\u26A0 Finished with errors" }),
26810
- totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE4.muted, children: "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
26807
+ success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.success, children: "Done!" }) : /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.warning, children: "\u26A0 Finished with errors" }),
26808
+ totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE.muted, children: "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
26811
26809
  /* @__PURE__ */ jsx46(EntityRows, { entity: componentTypes, label: "Component Type" }),
26812
26810
  /* @__PURE__ */ jsx46(EntityRows, { entity: designTokens, label: "Design Token" }),
26813
- summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.muted, children: [
26811
+ summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color: PALETTE.muted, children: [
26814
26812
  "Push result: ",
26815
26813
  summary.succeeded,
26816
26814
  "/",
26817
26815
  summary.total,
26818
26816
  " succeeded",
26819
- summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
26817
+ summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE.error, children: [
26820
26818
  ", ",
26821
26819
  summary.failed,
26822
26820
  " failed"
@@ -26824,8 +26822,8 @@ function DoneStep({
26824
26822
  ] }) })
26825
26823
  ] }),
26826
26824
  failures.length > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
26827
- /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE4.error, children: "Failure details" }),
26828
- failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
26825
+ /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE.error, children: "Failure details" }),
26826
+ failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color: PALETTE.error, children: [
26829
26827
  failure.entityType,
26830
26828
  " ",
26831
26829
  failure.entityId,
@@ -26835,7 +26833,7 @@ function DoneStep({
26835
26833
  ] }),
26836
26834
  /* @__PURE__ */ jsx46(SpaceEnvironment, { spaceId, environmentId }),
26837
26835
  success && totalPushed > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, children: [
26838
- /* @__PURE__ */ jsx46(Text39, { color: PALETTE4.success, children: "Your design system is now in Contentful Experiences." }),
26836
+ /* @__PURE__ */ jsx46(Text39, { color: PALETTE.success, children: "Your design system is now in Contentful Experiences." }),
26839
26837
  /* @__PURE__ */ jsx46(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
26840
26838
  /* @__PURE__ */ jsx46(
26841
26839
  LinkRow,
@@ -26944,12 +26942,12 @@ function PathPrompt({
26944
26942
  const cursor = cursorVisible ? "\u2588" : " ";
26945
26943
  return /* @__PURE__ */ jsxs38(Box37, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
26946
26944
  /* @__PURE__ */ jsxs38(Box37, { gap: 1, children: [
26947
- /* @__PURE__ */ jsx47(Text40, { color: "cyan", children: "?" }),
26945
+ /* @__PURE__ */ jsx47(Text40, { color: PALETTE.accent, children: "?" }),
26948
26946
  /* @__PURE__ */ jsxs38(Text40, { bold: true, children: [
26949
26947
  label,
26950
26948
  ":"
26951
26949
  ] }),
26952
- /* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ? PALETTE4.muted : void 0, children: shown }),
26950
+ /* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ? PALETTE.muted : void 0, children: shown }),
26953
26951
  /* @__PURE__ */ jsx47(Text40, { children: cursor })
26954
26952
  ] }),
26955
26953
  /* @__PURE__ */ jsxs38(Box37, { gap: 3, children: [
@@ -26969,7 +26967,7 @@ import { Box as Box38, Text as Text41 } from "ink";
26969
26967
  import { jsx as jsx48, jsxs as jsxs39 } from "react/jsx-runtime";
26970
26968
  function StepHeader({ stepNumber, totalSteps, title }) {
26971
26969
  return /* @__PURE__ */ jsxs39(Box38, { flexDirection: "column", gap: 0, children: [
26972
- /* @__PURE__ */ jsx48(Text41, { dimColor: true, children: "\u2500".repeat(40) }),
26970
+ /* @__PURE__ */ jsx48(Text41, { color: PALETTE.muted, children: "\u2500".repeat(40) }),
26973
26971
  /* @__PURE__ */ jsxs39(Box38, { gap: 1, children: [
26974
26972
  /* @__PURE__ */ jsxs39(Text41, { bold: true, children: [
26975
26973
  "Step ",
@@ -26980,7 +26978,7 @@ function StepHeader({ stepNumber, totalSteps, title }) {
26980
26978
  /* @__PURE__ */ jsx48(Text41, { bold: true, children: "\u2014" }),
26981
26979
  /* @__PURE__ */ jsx48(Text41, { bold: true, children: title })
26982
26980
  ] }),
26983
- /* @__PURE__ */ jsx48(Text41, { dimColor: true, children: "\u2500".repeat(40) })
26981
+ /* @__PURE__ */ jsx48(Text41, { color: PALETTE.muted, children: "\u2500".repeat(40) })
26984
26982
  ] });
26985
26983
  }
26986
26984
 
@@ -27015,12 +27013,12 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
27015
27013
  /* @__PURE__ */ jsx50(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
27016
27014
  /* @__PURE__ */ jsx50(Text42, { children: "Writing component types and design tokens to your Contentful space..." }),
27017
27015
  operationId && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
27018
- /* @__PURE__ */ jsx50(Text42, { color: PALETTE4.muted, children: "Operation:" }),
27016
+ /* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: "Operation:" }),
27019
27017
  /* @__PURE__ */ jsx50(Text42, { children: operationId })
27020
27018
  ] }),
27021
27019
  showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx50(Box39, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs40(Box39, { gap: 2, children: [
27022
- /* @__PURE__ */ jsx50(Box39, { width: 40, children: /* @__PURE__ */ jsx50(ThemeProvider2, { theme: INK_UI_THEME, children: /* @__PURE__ */ jsx50(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
27023
- /* @__PURE__ */ jsxs40(Text42, { color: PALETTE4.muted, children: [
27020
+ /* @__PURE__ */ jsx50(Box39, { width: 40, children: /* @__PURE__ */ jsx50(ThemeProvider2, { theme: PROGRESS_THEME, children: /* @__PURE__ */ jsx50(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
27021
+ /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.muted, children: [
27024
27022
  progress.processed,
27025
27023
  "/",
27026
27024
  progress.total,
@@ -27028,10 +27026,10 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
27028
27026
  ] })
27029
27027
  ] }) }),
27030
27028
  showCurrent && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
27031
- /* @__PURE__ */ jsx50(Text42, { color: PALETTE4.muted, children: "Now processing:" }),
27029
+ /* @__PURE__ */ jsx50(Text42, { color: PALETTE.muted, children: "Now processing:" }),
27032
27030
  /* @__PURE__ */ jsx50(Text42, { children: showCurrent })
27033
27031
  ] }),
27034
- /* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE4.muted, children: [
27032
+ /* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE.muted, children: [
27035
27033
  "Elapsed: ",
27036
27034
  elapsed
27037
27035
  ] }) })
@@ -27221,25 +27219,25 @@ function buildPreviewSummaryLines(preview) {
27221
27219
  if (components.new.length > 0) {
27222
27220
  lines.push({
27223
27221
  key: "summary-components-new",
27224
- color: PALETTE4.success,
27222
+ color: PALETTE.success,
27225
27223
  text: ` \uFF0B ${components.new.length} components will be created`
27226
27224
  });
27227
27225
  for (const [index, item] of components.new.entries()) {
27228
27226
  const name = item.key ?? item.$name ?? "unknown";
27229
- lines.push({ key: `summary-components-new-${index}`, color: PALETTE4.success, text: ` + ${name}` });
27227
+ lines.push({ key: `summary-components-new-${index}`, color: PALETTE.success, text: ` + ${name}` });
27230
27228
  }
27231
27229
  }
27232
27230
  if (components.changed.length > 0) {
27233
27231
  lines.push({
27234
27232
  key: "summary-components-changed",
27235
- color: PALETTE4.warning,
27233
+ color: PALETTE.warning,
27236
27234
  text: ` \uFF5E ${components.changed.length} components will be updated`
27237
27235
  });
27238
27236
  for (const [index, item] of components.changed.entries()) {
27239
27237
  const isBreaking = item.changeClassification?.classification === "breaking";
27240
27238
  lines.push({
27241
27239
  key: `summary-components-changed-${index}`,
27242
- color: isBreaking ? PALETTE4.error : PALETTE4.warning,
27240
+ color: isBreaking ? PALETTE.error : PALETTE.warning,
27243
27241
  text: ` ${isBreaking ? "\u26A0" : "~"} ${item.current.name}`
27244
27242
  });
27245
27243
  }
@@ -27247,11 +27245,11 @@ function buildPreviewSummaryLines(preview) {
27247
27245
  if (components.removed.length > 0) {
27248
27246
  lines.push({
27249
27247
  key: "summary-components-removed",
27250
- color: PALETTE4.warning,
27248
+ color: PALETTE.warning,
27251
27249
  text: ` \u2298 ${components.removed.length} components will be skipped`
27252
27250
  });
27253
27251
  for (const [index, item] of components.removed.entries()) {
27254
- lines.push({ key: `summary-components-removed-${index}`, color: PALETTE4.warning, text: ` \u2298 ${item.name}` });
27252
+ lines.push({ key: `summary-components-removed-${index}`, color: PALETTE.warning, text: ` \u2298 ${item.name}` });
27255
27253
  }
27256
27254
  }
27257
27255
  if (components.unchanged.length > 0) {
@@ -27264,21 +27262,21 @@ function buildPreviewSummaryLines(preview) {
27264
27262
  if (tokens.new.length > 0) {
27265
27263
  lines.push({
27266
27264
  key: "summary-tokens-new",
27267
- color: PALETTE4.success,
27265
+ color: PALETTE.success,
27268
27266
  text: ` \uFF0B ${tokens.new.length} design tokens will be created`
27269
27267
  });
27270
27268
  }
27271
27269
  if (tokens.changed.length > 0) {
27272
27270
  lines.push({
27273
27271
  key: "summary-tokens-changed",
27274
- color: PALETTE4.warning,
27272
+ color: PALETTE.warning,
27275
27273
  text: ` \uFF5E ${tokens.changed.length} design tokens will be updated`
27276
27274
  });
27277
27275
  }
27278
27276
  if (tokens.removed.length > 0) {
27279
27277
  lines.push({
27280
27278
  key: "summary-tokens-removed",
27281
- color: PALETTE4.warning,
27279
+ color: PALETTE.warning,
27282
27280
  text: ` \u2298 ${tokens.removed.length} design tokens will be skipped`
27283
27281
  });
27284
27282
  }
@@ -27322,12 +27320,12 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
27322
27320
  function appendChangedPreviewLine(lines, keyPrefix, name, hasPendingDraftChanges, changeClassification) {
27323
27321
  lines.push({
27324
27322
  key: `${keyPrefix}-h-${name}`,
27325
- color: PALETTE4.warning,
27323
+ color: PALETTE.warning,
27326
27324
  text: ` ~ ${name}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
27327
27325
  });
27328
27326
  if (changeClassification?.classification !== "breaking") return;
27329
27327
  const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
27330
- lines.push({ key: `${keyPrefix}-b-${name}`, color: PALETTE4.error, text: ` \u26A0 BREAKING: ${reasons}` });
27328
+ lines.push({ key: `${keyPrefix}-b-${name}`, color: PALETTE.error, text: ` \u26A0 BREAKING: ${reasons}` });
27331
27329
  }
27332
27330
  function buildPreviewDiffLines(preview) {
27333
27331
  const lines = [];
@@ -27335,12 +27333,12 @@ function buildPreviewDiffLines(preview) {
27335
27333
  for (const item of components.new) {
27336
27334
  const raw = item;
27337
27335
  const name = raw.key ?? raw.$name ?? "unknown";
27338
- lines.push({ key: `comp-new-${name}`, color: PALETTE4.success, text: ` + ${name}` });
27336
+ lines.push({ key: `comp-new-${name}`, color: PALETTE.success, text: ` + ${name}` });
27339
27337
  const slots = raw.$slots ?? {};
27340
27338
  for (const slotName of Object.keys(slots).sort()) {
27341
27339
  lines.push({
27342
27340
  key: `comp-new-${name}-slot-${slotName}`,
27343
- color: PALETTE4.success,
27341
+ color: PALETTE.success,
27344
27342
  text: ` slot: ${slotName}`
27345
27343
  });
27346
27344
  const allowed = slots[slotName]?.["$allowedComponents"];
@@ -27348,14 +27346,14 @@ function buildPreviewDiffLines(preview) {
27348
27346
  const names = allowed.filter((n) => typeof n === "string");
27349
27347
  lines.push({
27350
27348
  key: `comp-new-${name}-slot-${slotName}-allow`,
27351
- color: PALETTE4.success,
27349
+ color: PALETTE.success,
27352
27350
  text: ` allowedComponents: [${names.join(", ")}]`
27353
27351
  });
27354
27352
  }
27355
27353
  }
27356
27354
  }
27357
27355
  for (const item of components.removed) {
27358
- lines.push({ key: `comp-rm-${item.name}`, color: PALETTE4.error, text: ` - ${item.name}` });
27356
+ lines.push({ key: `comp-rm-${item.name}`, color: PALETTE.error, text: ` - ${item.name}` });
27359
27357
  }
27360
27358
  for (const item of components.changed) {
27361
27359
  appendChangedPreviewLine(lines, "comp", item.current.name, item.hasPendingDraftChanges, item.changeClassification);
@@ -27386,10 +27384,10 @@ function buildPreviewDiffLines(preview) {
27386
27384
  for (const item of tokens.new) {
27387
27385
  const raw = item;
27388
27386
  const name = raw.name ?? raw.path ?? "unknown";
27389
- lines.push({ key: `tok-new-${name}`, color: PALETTE4.success, text: ` + ${name}` });
27387
+ lines.push({ key: `tok-new-${name}`, color: PALETTE.success, text: ` + ${name}` });
27390
27388
  }
27391
27389
  for (const item of tokens.removed) {
27392
- lines.push({ key: `tok-rm-${item.name}`, color: PALETTE4.error, text: ` - ${item.name}` });
27390
+ lines.push({ key: `tok-rm-${item.name}`, color: PALETTE.error, text: ` - ${item.name}` });
27393
27391
  }
27394
27392
  for (const item of tokens.changed) {
27395
27393
  const tokenName = item.current.name;
@@ -27480,13 +27478,13 @@ function WizardPreviewStep({
27480
27478
  title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
27481
27479
  focused: false,
27482
27480
  children: [
27483
- activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ? PALETTE4.muted : line.color, wrap: "truncate-end", children: line.text }, line.key)),
27484
- /* @__PURE__ */ jsx51(Text43, { color: PALETTE4.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
27481
+ activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ? PALETTE.muted : line.color, wrap: "truncate-end", children: line.text }, line.key)),
27482
+ /* @__PURE__ */ jsx51(Text43, { color: PALETTE.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
27485
27483
  ]
27486
27484
  }
27487
27485
  )
27488
- ] }) : /* @__PURE__ */ jsx51(Text43, { color: PALETTE4.muted, children: "Nothing to push \u2014 everything is already up to date." }),
27489
- breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color: PALETTE4.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
27486
+ ] }) : /* @__PURE__ */ jsx51(Text43, { color: PALETTE.muted, children: "Nothing to push \u2014 everything is already up to date." }),
27487
+ breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color: PALETTE.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
27490
27488
  /* @__PURE__ */ jsx51(SpaceEnvironment, { spaceId, environmentId }),
27491
27489
  /* @__PURE__ */ jsxs41(Box40, { gap: 3, marginTop: 1, children: [
27492
27490
  /* @__PURE__ */ jsx51(Text43, { children: "[Enter] Push to Contentful" }),
@@ -28032,7 +28030,7 @@ var realSaveDeps = () => ({
28032
28030
  writeFile: (path5, contents) => writeFile7(path5, contents),
28033
28031
  appendRun,
28034
28032
  buildSourceFingerprint,
28035
- sleep: (ms) => new Promise((resolve28) => setTimeout(resolve28, ms)),
28033
+ sleep: (ms) => new Promise((resolve27) => setTimeout(resolve27, ms)),
28036
28034
  warn: (message) => process.stderr.write(message)
28037
28035
  });
28038
28036
  async function runPrintFiles(input, deps, onPatch) {
@@ -28422,44 +28420,12 @@ init_config();
28422
28420
  init_debug_store();
28423
28421
  init_debug_mode_store();
28424
28422
  init_version();
28425
-
28426
- // packages/experience-design-system-cli/src/tui/help/file-locations.ts
28427
- import { join as join25, resolve as resolve27 } from "node:path";
28428
- function describeFileLocations({
28429
- contentfulBaseDir,
28430
- debugModeEnabled,
28431
- currentSessionDir: currentSessionDir2
28432
- }) {
28433
- if (!debugModeEnabled) {
28434
- return {
28435
- debugLogs: "none while Debug Mode is off",
28436
- importFiles: `${join25("<project>", ".contentful")}/ (tokens.json, components.json)`
28437
- };
28438
- }
28439
- const base = contentfulBaseDir ? resolve27(contentfulBaseDir) : "<project>";
28440
- const session = currentSessionDir2 ?? join25(base, ".contentful", "<date>-session-<n>");
28441
- return {
28442
- debugLogs: join25(session, "debug"),
28443
- importFiles: `${join25(session, "dsi-import-<n>")}/ (tokens.json, components.json)`
28444
- };
28445
- }
28446
-
28447
- // packages/experience-design-system-cli/src/tui/help/help-info.ts
28448
28423
  async function readHelpInfo() {
28449
- const [debugMode, settings] = await Promise.all([readDebugModeSetting(), readSettings2()]);
28450
- const base = settings["contentfulBaseDir"];
28451
- const locations = describeFileLocations({
28452
- contentfulBaseDir: typeof base === "string" ? base : "",
28453
- debugModeEnabled: debugMode.enabled,
28454
- currentSessionDir: currentSessionDir()
28455
- });
28424
+ const debugMode = await readDebugModeSetting();
28456
28425
  return {
28457
28426
  storage: [
28458
28427
  { label: "Config folder", value: configRoot2() },
28459
- { label: "Settings file", value: configFilePath2() },
28460
- { label: "Agent settings", value: `${configFilePath2()} (keys: agent, agentModel, agents)` },
28461
- { label: "Debug logs", value: locations.debugLogs },
28462
- { label: "Import files", value: locations.importFiles }
28428
+ { label: "Settings file", value: configFilePath2() }
28463
28429
  ],
28464
28430
  troubleshooting: [
28465
28431
  { label: "CLI version", value: readPackageVersion() },
@@ -28480,7 +28446,7 @@ function Section({ title, rows }) {
28480
28446
  return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
28481
28447
  /* @__PURE__ */ jsx53(Text44, { bold: true, color: PALETTE.accent, children: title }),
28482
28448
  rows.map((row) => /* @__PURE__ */ jsxs43(Box42, { gap: 1, children: [
28483
- /* @__PURE__ */ jsx53(Box42, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: row.label }) }),
28449
+ /* @__PURE__ */ jsx53(Box42, { width: 14, flexShrink: 0, children: /* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: row.label }) }),
28484
28450
  /* @__PURE__ */ jsx53(Text44, { children: row.value })
28485
28451
  ] }, row.label))
28486
28452
  ] });
@@ -28560,8 +28526,8 @@ function SettingsScreen({
28560
28526
  });
28561
28527
  return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
28562
28528
  /* @__PURE__ */ jsx54(Text45, { bold: true, children: "Settings" }),
28563
- /* @__PURE__ */ jsx54(Text45, { children: " " }),
28564
- items.map((item, i) => /* @__PURE__ */ jsxs44(Text45, { color: i === focusIdx ? "cyan" : void 0, children: [
28529
+ /* @__PURE__ */ jsx54(Text45, { color: PALETTE.muted, children: " " }),
28530
+ items.map((item, i) => /* @__PURE__ */ jsxs44(Text45, { color: i === focusIdx ? PALETTE.accent : void 0, children: [
28565
28531
  i === focusIdx ? "> " : " ",
28566
28532
  item.label
28567
28533
  ] }, item.label)),
@@ -28580,776 +28546,15 @@ function SettingsScreen({
28580
28546
  }
28581
28547
 
28582
28548
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
28583
- import { useState as useState33 } from "react";
28584
- import { Box as Box48, Text as Text51, useInput as useInput14 } from "ink";
28585
-
28586
- // packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
28587
- import { useEffect as useEffect23, useState as useState30 } from "react";
28588
- import { Box as Box45, Text as Text48, useInput as useInput12 } from "ink";
28589
- init_debug_store();
28549
+ import { useEffect as useEffect22, useState as useState29 } from "react";
28550
+ import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
28551
+ import TextInput4 from "ink-text-input";
28590
28552
 
28591
28553
  // packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
28592
28554
  init_config();
28593
28555
  var readV1Store = readSettings2;
28594
28556
  var writeV1Store = writeSettings2;
28595
28557
 
28596
- // packages/experience-design-system-cli/src/tui/settings/agents/agent-store.ts
28597
- var DEFAULT_AGENT3 = "claude";
28598
- var AGENT_LABELS = {
28599
- claude: "Claude Code",
28600
- codex: "OpenAI Codex",
28601
- opencode: "OpenCode",
28602
- cursor: "Cursor",
28603
- copilot: "GitHub Copilot"
28604
- };
28605
- var AGENT_HINTS = {
28606
- claude: "claude",
28607
- codex: "codex",
28608
- opencode: "opencode",
28609
- cursor: "cursor-agent",
28610
- copilot: "copilot"
28611
- };
28612
- var asString = (value) => typeof value === "string" ? value : "";
28613
- function emptyAgents() {
28614
- return Object.fromEntries(AGENT_NAMES.map((name) => [name, { model: "", binary: "" }]));
28615
- }
28616
- async function readAgentConfig() {
28617
- const store = await readV1Store();
28618
- const stored = asString(store["agent"]);
28619
- const defaultAgent = isAgentName(stored) ? stored : DEFAULT_AGENT3;
28620
- const agents = emptyAgents();
28621
- const saved = store["agents"];
28622
- if (saved && typeof saved === "object") {
28623
- for (const name of AGENT_NAMES) {
28624
- const entry = saved[name];
28625
- if (entry && typeof entry === "object") {
28626
- const fields = entry;
28627
- agents[name] = { model: asString(fields["model"]), binary: asString(fields["binary"]) };
28628
- }
28629
- }
28630
- }
28631
- const legacyModel = asString(store["agentModel"]);
28632
- if (legacyModel && !agents[defaultAgent].model)
28633
- agents[defaultAgent] = { ...agents[defaultAgent], model: legacyModel };
28634
- return { defaultAgent, agents };
28635
- }
28636
- async function writeAgentConfig(config) {
28637
- const existing = await readV1Store();
28638
- const merged = { ...existing };
28639
- const agents = {};
28640
- for (const name of AGENT_NAMES) {
28641
- const model = config.agents[name].model.trim();
28642
- const binary = config.agents[name].binary.trim();
28643
- if (model || binary) agents[name] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
28644
- }
28645
- merged["agent"] = config.defaultAgent;
28646
- const defaultModel = agents[config.defaultAgent]?.model;
28647
- if (defaultModel) merged["agentModel"] = defaultModel;
28648
- else delete merged["agentModel"];
28649
- if (Object.keys(agents).length > 0) merged["agents"] = agents;
28650
- else delete merged["agents"];
28651
- await writeV1Store(merged);
28652
- }
28653
-
28654
- // packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts
28655
- import { execFile as execFile2 } from "node:child_process";
28656
- import { access as access6, constants } from "node:fs/promises";
28657
- var VERSION_TIMEOUT_MS = 5e3;
28658
- var PROMPT_TIMEOUT_MS = 6e4;
28659
- var TEST_PROMPT = "Reply with the single word: ok";
28660
- var INSTALL_HINTS = {
28661
- claude: "npm install -g @anthropic-ai/claude-code",
28662
- codex: "npm install -g @openai/codex",
28663
- opencode: "npm install -g opencode-ai",
28664
- cursor: "install Cursor\u2019s `cursor-agent` command",
28665
- copilot: "npm install -g @github/copilot"
28666
- };
28667
- var LOGIN_HINTS = {
28668
- claude: "run `claude login`",
28669
- codex: "set OPENAI_API_KEY, or sign in with a ChatGPT account",
28670
- opencode: "run `opencode auth`",
28671
- cursor: "sign in from Cursor",
28672
- copilot: "run `copilot` and sign in"
28673
- };
28674
- function effectiveBinary(name, savedBinary) {
28675
- return savedBinary.trim() || AGENT_BINARIES[name];
28676
- }
28677
- function defaultModelLabel(name) {
28678
- const model = DEFAULT_MODELS[name];
28679
- return model && model !== "Auto" ? model : "chosen by the agent";
28680
- }
28681
- var fail3 = (step, detail) => ({ step, ok: false, detail });
28682
- var pass = (step, detail) => ({ step, ok: true, detail });
28683
- function resolveOnPath(binary) {
28684
- if (binary.includes("/")) {
28685
- return access6(binary, constants.X_OK).then(
28686
- () => binary,
28687
- () => null
28688
- );
28689
- }
28690
- return new Promise((resolve28) => {
28691
- execFile2(
28692
- process.platform === "win32" ? "where" : "which",
28693
- [binary],
28694
- (error, stdout) => resolve28(error ? null : stdout.split("\n")[0]?.trim() ?? null)
28695
- );
28696
- });
28697
- }
28698
- function readVersion(binary) {
28699
- return new Promise((resolve28) => {
28700
- execFile2(binary, ["--version"], { timeout: VERSION_TIMEOUT_MS }, (error, stdout) => {
28701
- const line = stdout.split("\n")[0]?.trim() ?? "";
28702
- if (!error && line) resolve28(pass("version", line));
28703
- else resolve28(fail3("version", "runs, but did not report a version"));
28704
- });
28705
- });
28706
- }
28707
- async function inspectAgent(name, binary) {
28708
- const target = effectiveBinary(name, binary);
28709
- const found = await resolveOnPath(target);
28710
- if (!found) return [fail3("path", `\`${target}\` was not found or is not executable`)];
28711
- const checks = [pass("path", found)];
28712
- checks.push(await readVersion(found));
28713
- if (name === "claude") {
28714
- const auth = await withBinaryEnv(name, found, () => checkAgentAuth(name));
28715
- checks.push(
28716
- auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
28717
- );
28718
- }
28719
- return checks;
28720
- }
28721
- async function testAgent(name, binary, model) {
28722
- const checks = await inspectAgent(name, binary);
28723
- if (!checks.every((check) => check.step === "version" || check.ok)) return checks;
28724
- const target = effectiveBinary(name, binary);
28725
- const found = await resolveOnPath(target) ?? target;
28726
- const started = Date.now();
28727
- const result = await withBinaryEnv(
28728
- name,
28729
- found,
28730
- () => createLocalCliAgentInvoker().invoke({
28731
- agent: name,
28732
- ...model.trim() ? { model: model.trim() } : {},
28733
- prompt: TEST_PROMPT,
28734
- timeoutMs: PROMPT_TIMEOUT_MS
28735
- })
28736
- );
28737
- const seconds = ((Date.now() - started) / 1e3).toFixed(1);
28738
- if (result.timedOut) {
28739
- return [...checks, { ...fail3("prompt", `no answer within ${PROMPT_TIMEOUT_MS / 1e3}s`), timedOut: true }];
28740
- }
28741
- if (result.exitCode !== 0) {
28742
- const reason = result.stderr.trim().split("\n").pop()?.slice(0, 160) || `exited with code ${result.exitCode}`;
28743
- return [...checks, fail3("prompt", reason)];
28744
- }
28745
- return [...checks, pass("prompt", `answered in ${seconds}s`)];
28746
- }
28747
- function statusFromChecks(name, checks, savedBinary) {
28748
- if (checks.length === 0) return "checking";
28749
- if (checks.some((check) => check.step === "path" && !check.ok)) {
28750
- return savedBinary.trim() ? "not-found" : "not-configured";
28751
- }
28752
- const prompt = checks.find((check) => check.step === "prompt");
28753
- if (prompt) {
28754
- if (prompt.ok) return "ready";
28755
- return prompt.timedOut ? "timed-out" : "test-failed";
28756
- }
28757
- const login = checks.find((check) => check.step === "login");
28758
- if (login) return login.ok ? "ready" : "not-logged-in";
28759
- return name === "claude" ? "ready" : "unknown";
28760
- }
28761
- function setupHint(name, status) {
28762
- if (status === "not-configured") return `${INSTALL_HINTS[name]}, or set its command path in settings`;
28763
- if (status === "not-found") return `${INSTALL_HINTS[name]}, or correct the command path in settings`;
28764
- if (status === "not-logged-in") return LOGIN_HINTS[name];
28765
- if (status === "test-failed") return `read the test message; if it is a login problem, ${LOGIN_HINTS[name]}`;
28766
- if (status === "timed-out") return "it may be slow or waiting for input; run the test again, or try it in a terminal";
28767
- if (status === "unknown") return "run a full test to confirm it is logged in";
28768
- return "";
28769
- }
28770
- function testOutcome(checks) {
28771
- const prompt = checks?.find((check) => check.step === "prompt");
28772
- if (!prompt) return void 0;
28773
- if (prompt.ok) return { ok: true, text: `Test passed: ${prompt.detail}` };
28774
- if (prompt.timedOut) return { ok: false, text: `Test timed out: ${prompt.detail}` };
28775
- return { ok: false, text: `Test failed: ${prompt.detail}` };
28776
- }
28777
- var LIST_STATUS = {
28778
- checking: { symbol: "\u2026", text: "checking", tone: "muted" },
28779
- ready: { symbol: "\u25CF", text: "ready", tone: "ok" },
28780
- "not-configured": { symbol: "\u25CB", text: "not installed", tone: "muted" },
28781
- "not-found": { symbol: "\u25CB", text: "not installed", tone: "bad" },
28782
- "not-logged-in": { symbol: "\u25D0", text: "not logged in", tone: "bad" },
28783
- "test-failed": { symbol: "\u2717", text: "test failed", tone: "bad" },
28784
- "timed-out": { symbol: "\u2717", text: "test timed out", tone: "bad" },
28785
- unknown: { symbol: "\u25D0", text: "installed, login unknown", tone: "muted" }
28786
- };
28787
- function modelLine(name, savedModel) {
28788
- const model = savedModel.trim();
28789
- return model ? model : `${defaultModelLabel(name)} (built-in default)`;
28790
- }
28791
- function panelRows(name, checks, settings) {
28792
- if (!checks) return [{ label: "Command", value: "checking...", tone: "muted" }];
28793
- const status = statusFromChecks(name, checks, settings.binary);
28794
- const path5 = checks.find((check) => check.step === "path");
28795
- if (!path5?.ok) {
28796
- const rows2 = [
28797
- {
28798
- label: "Command",
28799
- value: settings.binary.trim() ? path5?.detail ?? "not found" : "not found on your PATH",
28800
- tone: settings.binary.trim() ? "bad" : "muted"
28801
- }
28802
- ];
28803
- const hint2 = setupHint(name, status);
28804
- if (hint2) rows2.push({ label: "Setup", value: hint2, tone: "muted" });
28805
- return rows2;
28806
- }
28807
- const rows = [{ label: "Command", value: path5.detail, tone: "ok" }];
28808
- const version = checks.find((check) => check.step === "version");
28809
- if (version?.ok) rows.push({ label: "Version", value: version.detail, tone: "ok" });
28810
- rows.push({ label: "Model", value: modelLine(name, settings.model), tone: "muted" });
28811
- const hint = setupHint(name, status);
28812
- if (hint) rows.push({ label: "Setup", value: hint, tone: "muted" });
28813
- return rows;
28814
- }
28815
- function statusRows(_name, checks, savedBinary) {
28816
- if (!checks) return [{ label: "Command", value: "checking...", tone: "muted" }];
28817
- const find = (step) => checks.find((check) => check.step === step);
28818
- const path5 = find("path");
28819
- if (!path5?.ok) {
28820
- if (savedBinary.trim()) return [{ label: "Command", value: path5?.detail ?? "not found", tone: "bad" }];
28821
- return [{ label: "Command", value: "not configured (not on the PATH)", tone: "muted" }];
28822
- }
28823
- const rows = [{ label: "Command", value: path5.detail, tone: "ok" }];
28824
- const version = find("version");
28825
- if (version) {
28826
- rows.push({
28827
- label: "Version",
28828
- value: version.ok ? version.detail : "could not be read",
28829
- tone: version.ok ? "ok" : "muted"
28830
- });
28831
- }
28832
- const login = find("login");
28833
- const prompt = find("prompt");
28834
- if (login) {
28835
- rows.push({ label: "Login", value: login.detail, tone: login.ok ? "ok" : "bad" });
28836
- } else if (prompt) {
28837
- rows.push({
28838
- label: "Login",
28839
- value: prompt.ok ? "confirmed by the test" : prompt.timedOut ? "unknown (the test timed out)" : "see the test result",
28840
- tone: prompt.ok ? "ok" : prompt.timedOut ? "muted" : "bad"
28841
- });
28842
- } else {
28843
- rows.push({ label: "Login", value: "not checked (use Run test)", tone: "muted" });
28844
- }
28845
- if (prompt) rows.push({ label: "Test", value: prompt.detail, tone: prompt.ok ? "ok" : "bad" });
28846
- return rows;
28847
- }
28848
- async function withBinaryEnv(name, binary, run) {
28849
- const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
28850
- const previous = process.env[key];
28851
- process.env[key] = binary;
28852
- try {
28853
- return await run();
28854
- } finally {
28855
- if (previous === void 0) delete process.env[key];
28856
- else process.env[key] = previous;
28857
- }
28858
- }
28859
-
28860
- // packages/experience-design-system-cli/src/tui/settings/agents/AgentDetail.tsx
28861
- import { useEffect as useEffect22, useState as useState29 } from "react";
28862
- import { Box as Box44, Text as Text47, useInput as useInput11 } from "ink";
28863
- import TextInput4 from "ink-text-input";
28864
-
28865
- // packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusBadge.tsx
28866
- import { Text as Text46 } from "ink";
28867
- import { jsx as jsx55 } from "react/jsx-runtime";
28868
- var TONE_COLOR = {
28869
- ok: PALETTE.success,
28870
- bad: PALETTE.error,
28871
- muted: PALETTE.muted
28872
- };
28873
- function AgentStatusBadge({
28874
- name,
28875
- checks,
28876
- binary
28877
- }) {
28878
- const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(name, checks, binary) : "checking"];
28879
- return /* @__PURE__ */ jsx55(Text46, { color: TONE_COLOR[tone], children: `${symbol} ${text}` });
28880
- }
28881
-
28882
- // packages/experience-design-system-cli/src/tui/settings/agents/apply-binary-overrides.ts
28883
- var shellValues = /* @__PURE__ */ new Map();
28884
- function applyBinaryOverrides(config) {
28885
- for (const name of AGENT_NAMES) {
28886
- const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
28887
- const binary = config.agents[name].binary.trim();
28888
- if (binary) {
28889
- if (!shellValues.has(key)) shellValues.set(key, process.env[key]);
28890
- process.env[key] = binary;
28891
- } else if (shellValues.has(key)) {
28892
- const shellValue = shellValues.get(key);
28893
- if (shellValue === void 0) delete process.env[key];
28894
- else process.env[key] = shellValue;
28895
- shellValues.delete(key);
28896
- }
28897
- }
28898
- }
28899
-
28900
- // packages/experience-design-system-cli/src/tui/settings/agents/AgentDetail.tsx
28901
- import { jsx as jsx56, jsxs as jsxs45 } from "react/jsx-runtime";
28902
- var FOCUS_ORDER = ["binary", "model", "test"];
28903
- var FIELDS2 = ["binary", "model"];
28904
- var FIELD_LABEL = { binary: "Command path", model: "Model" };
28905
- var LABEL_WIDTH = "Command path".length;
28906
- var LABEL_GAP = 2;
28907
- var POINTER_WIDTH = 2;
28908
- var fieldHint = (name, field) => field === "binary" ? `(empty: \`${AGENT_HINTS[name]}\` from the PATH)` : `(empty: ${defaultModelLabel(name)})`;
28909
- function Row2({
28910
- pointer,
28911
- label,
28912
- labelProps,
28913
- children
28914
- }) {
28915
- return /* @__PURE__ */ jsxs45(Box44, { children: [
28916
- /* @__PURE__ */ jsx56(Box44, { width: POINTER_WIDTH, flexShrink: 0, children: pointer }),
28917
- /* @__PURE__ */ jsx56(Box44, { width: LABEL_WIDTH + LABEL_GAP, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, ...labelProps, children: label }) }),
28918
- children
28919
- ] });
28920
- }
28921
- function Section2({
28922
- title,
28923
- note,
28924
- interactive = false,
28925
- children
28926
- }) {
28927
- return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", marginTop: 1, children: [
28928
- /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
28929
- /* @__PURE__ */ jsx56(Text47, { bold: true, color: interactive ? PALETTE.accent : PALETTE.muted, children: title }),
28930
- /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: `\xB7 ${note}` })
28931
- ] }),
28932
- children
28933
- ] });
28934
- }
28935
- function AgentDetail({
28936
- name,
28937
- config,
28938
- setConfig,
28939
- onBack
28940
- }) {
28941
- const settings = config.agents[name];
28942
- const [focusIndex, setFocusIndex] = useState29(0);
28943
- const [editing, setEditing] = useState29(false);
28944
- const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
28945
- const [saving, setSaving] = useState29(false);
28946
- const [testing, setTesting] = useState29(false);
28947
- const [notice, setNotice] = useState29(null);
28948
- const [checks, setChecks] = useState29(void 0);
28949
- useEffect22(() => {
28950
- let active = true;
28951
- setChecks(void 0);
28952
- void inspectAgent(name, settings.binary).then((result) => active && setChecks(result));
28953
- return () => {
28954
- active = false;
28955
- };
28956
- }, [name, settings.binary]);
28957
- const setField = (field, value) => {
28958
- setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [field]: value } } });
28959
- setNotice(null);
28960
- };
28961
- const save = () => {
28962
- setSaving(true);
28963
- setNotice(null);
28964
- writeAgentConfig(config).then(() => {
28965
- applyBinaryOverrides(config);
28966
- setNotice({ kind: "success", text: `Saved: ${AGENT_LABELS[name]} settings are written to config.json` });
28967
- }).catch(
28968
- (err) => setNotice({ kind: "error", text: `Not saved: ${err instanceof Error ? err.message : String(err)}` })
28969
- ).finally(() => setSaving(false));
28970
- };
28971
- const runTest = () => {
28972
- setTesting(true);
28973
- setNotice(null);
28974
- testAgent(name, settings.binary, settings.model).then((result) => {
28975
- setChecks(result);
28976
- const outcome = testOutcome(result);
28977
- setNotice(
28978
- outcome ? { kind: outcome.ok ? "success" : "error", text: outcome.text } : { kind: "error", text: "Test not run: the agent could not be started (see Status)" }
28979
- );
28980
- }).catch(
28981
- (err) => setNotice({ kind: "error", text: `Test could not run: ${err instanceof Error ? err.message : String(err)}` })
28982
- ).finally(() => setTesting(false));
28983
- };
28984
- const focused = FOCUS_ORDER[focusIndex];
28985
- const focusedField = focused === "test" ? null : focused;
28986
- useInput11((input, key) => {
28987
- if (saving || testing) return;
28988
- if (editing) {
28989
- if (key.escape && focusedField) {
28990
- setField(focusedField, valueBeforeEdit);
28991
- setEditing(false);
28992
- }
28993
- return;
28994
- }
28995
- if (key.escape || input === "q") {
28996
- onBack();
28997
- return;
28998
- }
28999
- if (input === "s") {
29000
- save();
29001
- return;
29002
- }
29003
- if (key.upArrow) {
29004
- setFocusIndex((i) => (i - 1 + FOCUS_ORDER.length) % FOCUS_ORDER.length);
29005
- return;
29006
- }
29007
- if (key.downArrow || key.tab) {
29008
- setFocusIndex((i) => (i + 1) % FOCUS_ORDER.length);
29009
- return;
29010
- }
29011
- if (input === "c" && focusedField) {
29012
- setField(focusedField, "");
29013
- return;
29014
- }
29015
- if (key.return) {
29016
- if (focusedField) {
29017
- setValueBeforeEdit(settings[focusedField]);
29018
- setEditing(true);
29019
- } else {
29020
- runTest();
29021
- }
29022
- }
29023
- });
29024
- const status = checks ? statusFromChecks(name, checks, settings.binary) : "checking";
29025
- const hint = setupHint(name, status);
29026
- const pointer = (isFocused) => /* @__PURE__ */ jsx56(Text47, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
29027
- return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
29028
- /* @__PURE__ */ jsx56(Text47, { bold: true, children: AGENT_LABELS[name] }),
29029
- /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: config.defaultAgent === name ? "This is the default agent." : `Runs the \`${AGENT_HINTS[name]}\` command.` }),
29030
- (notice || testing || saving) && /* @__PURE__ */ jsx56(Box44, { marginTop: 1, children: testing || saving ? /* @__PURE__ */ jsx56(Text47, { color: PALETTE.accent, children: testing ? "\u2026 Running the test (up to 60s)" : "\u2026 Saving" }) : notice && /* @__PURE__ */ jsxs45(Text47, { bold: true, color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
29031
- notice.kind === "success" ? "\u2713" : "\u2717",
29032
- " ",
29033
- notice.text
29034
- ] }) }),
29035
- /* @__PURE__ */ jsxs45(Section2, { title: "CONFIGURE", note: "you can change these", interactive: true, children: [
29036
- FIELDS2.map((field) => {
29037
- const isFocused = focused === field;
29038
- const value = settings[field];
29039
- const display = isFocused && editing ? /* @__PURE__ */ jsx56(TextInput4, { value, onChange: (next) => setField(field, next), onSubmit: () => setEditing(false) }) : value ? /* @__PURE__ */ jsx56(Text47, { bold: true, children: value }) : /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: fieldHint(name, field) });
29040
- return /* @__PURE__ */ jsx56(
29041
- Row2,
29042
- {
29043
- pointer: pointer(isFocused),
29044
- label: FIELD_LABEL[field],
29045
- labelProps: { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted },
29046
- children: display
29047
- },
29048
- field
29049
- );
29050
- }),
29051
- /* @__PURE__ */ jsx56(
29052
- Row2,
29053
- {
29054
- pointer: pointer(focused === "test"),
29055
- label: "Run test",
29056
- labelProps: { bold: focused === "test", color: focused === "test" ? PALETTE.accent : PALETTE.muted },
29057
- children: /* @__PURE__ */ jsx56(Text47, { color: testing ? PALETTE.accent : PALETTE.muted, children: testing ? "running..." : "sends one small prompt (uses a few tokens)" })
29058
- }
29059
- )
29060
- ] }),
29061
- /* @__PURE__ */ jsxs45(Section2, { title: "STATUS", note: "read only", children: [
29062
- statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsx56(Row2, { pointer: null, label: row.label, children: /* @__PURE__ */ jsx56(Text47, { color: TONE_COLOR[row.tone], children: row.value }) }, row.label)),
29063
- hint && /* @__PURE__ */ jsx56(Row2, { pointer: null, label: "Setup", children: /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: hint }) })
29064
- ] }),
29065
- /* @__PURE__ */ jsx56(Text47, { children: " " }),
29066
- /* @__PURE__ */ jsx56(
29067
- ControlHints,
29068
- {
29069
- hints: editing ? [
29070
- { keys: "type", label: "edit" },
29071
- { keys: "\u2190/\u2192", label: "move cursor" },
29072
- { keys: "\u23CE", label: "done" },
29073
- { keys: "Esc", label: "cancel edit" }
29074
- ] : [
29075
- { keys: "\u2191/\u2193", label: "move" },
29076
- { keys: "\u23CE", label: focusedField ? "edit" : "run test" },
29077
- ...focusedField ? [{ keys: "c", label: "clear" }] : [],
29078
- { keys: "s", label: "save" },
29079
- { keys: "Esc/q", label: "back without saving" }
29080
- ]
29081
- }
29082
- )
29083
- ] });
29084
- }
29085
-
29086
- // packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
29087
- import { Fragment as Fragment17, jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
29088
- var NAME_WIDTH = 16;
29089
- var PANEL_LABEL_WIDTH = "Command".length;
29090
- function AgentsScreen({ onDone }) {
29091
- const [config, setConfig] = useState30(null);
29092
- const [focus, setFocus] = useState30(0);
29093
- const [open, setOpen] = useState30(null);
29094
- const [notice, setNotice] = useState30(null);
29095
- const [saving, setSaving] = useState30(false);
29096
- const [checks, setChecks] = useState30({});
29097
- const inspectAll = (loaded) => {
29098
- for (const name of AGENT_NAMES) {
29099
- void inspectAgent(name, loaded.agents[name].binary).then(
29100
- (result) => setChecks((previous) => ({ ...previous, [name]: result }))
29101
- );
29102
- }
29103
- };
29104
- useEffect23(() => {
29105
- void readAgentConfig().then((loaded) => {
29106
- setConfig(loaded);
29107
- inspectAll(loaded);
29108
- startDebugRun({
29109
- flow: "settings/agents",
29110
- step: "01-agents",
29111
- menuOption: "Configuration > Agents",
29112
- inputs: { default_agent: loaded.defaultAgent }
29113
- });
29114
- });
29115
- }, []);
29116
- const makeDefault = (name) => {
29117
- if (!config || saving) return;
29118
- if (name === config.defaultAgent) {
29119
- setNotice({ kind: "success", text: `${AGENT_LABELS[name]} is already the default agent` });
29120
- return;
29121
- }
29122
- setSaving(true);
29123
- setNotice(null);
29124
- writeAgentConfig({ ...config, defaultAgent: name }).then(() => {
29125
- setConfig((current) => current ? { ...current, defaultAgent: name } : current);
29126
- setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[name]}` });
29127
- }).catch(
29128
- (err) => setNotice({
29129
- kind: "error",
29130
- text: `Default agent not changed: ${err instanceof Error ? err.message : String(err)}`
29131
- })
29132
- ).finally(() => setSaving(false));
29133
- };
29134
- useInput12((input, key) => {
29135
- if (!config || open || saving) return;
29136
- const focused = AGENT_NAMES[focus];
29137
- if (key.upArrow || key.downArrow || key.tab) setNotice(null);
29138
- if (key.upArrow) {
29139
- setFocus((i) => (i - 1 + AGENT_NAMES.length) % AGENT_NAMES.length);
29140
- return;
29141
- }
29142
- if (key.downArrow || key.tab) {
29143
- setFocus((i) => (i + 1) % AGENT_NAMES.length);
29144
- return;
29145
- }
29146
- if (key.return) {
29147
- makeDefault(focused);
29148
- return;
29149
- }
29150
- if (key.rightArrow) {
29151
- setNotice(null);
29152
- setOpen(focused);
29153
- return;
29154
- }
29155
- if (key.escape || input === "q") {
29156
- void finishDebugRun({ outputs: { default_agent: config.defaultAgent }, status: "success", exitMethod: "saved" });
29157
- onDone();
29158
- }
29159
- });
29160
- if (!config) {
29161
- return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
29162
- /* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
29163
- /* @__PURE__ */ jsx57(Text48, { children: " " }),
29164
- /* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "Loading..." })
29165
- ] });
29166
- }
29167
- if (open) {
29168
- return /* @__PURE__ */ jsx57(
29169
- AgentDetail,
29170
- {
29171
- name: open,
29172
- config,
29173
- setConfig,
29174
- onBack: () => {
29175
- setOpen(null);
29176
- void readAgentConfig().then((saved) => {
29177
- setConfig(saved);
29178
- inspectAll(saved);
29179
- });
29180
- }
29181
- }
29182
- );
29183
- }
29184
- const focusedAgent = AGENT_NAMES[focus];
29185
- return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
29186
- /* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
29187
- /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "The coding agent the CLI runs, and what was found for each one." }),
29188
- /* @__PURE__ */ jsx57(Text48, { children: " " }),
29189
- /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
29190
- /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "Default agent" }),
29191
- /* @__PURE__ */ jsx57(Text48, { bold: true, children: AGENT_LABELS[config.defaultAgent] }),
29192
- saving && /* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "\u2026 saving" })
29193
- ] }),
29194
- /* @__PURE__ */ jsxs46(Box45, { marginTop: 1, gap: 1, children: [
29195
- /* @__PURE__ */ jsx57(Text48, { children: " " }),
29196
- /* @__PURE__ */ jsx57(Text48, { children: " " }),
29197
- /* @__PURE__ */ jsx57(Box45, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "AGENT" }) }),
29198
- /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "STATUS" })
29199
- ] }),
29200
- AGENT_NAMES.map((name) => {
29201
- const isFocused = focusedAgent === name;
29202
- return /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
29203
- /* @__PURE__ */ jsx57(Text48, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
29204
- /* @__PURE__ */ jsx57(Text48, { color: PALETTE.success, children: name === config.defaultAgent ? "\u2605" : " " }),
29205
- /* @__PURE__ */ jsx57(Box45, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name] }) }),
29206
- /* @__PURE__ */ jsx57(AgentStatusBadge, { name, checks: checks[name], binary: config.agents[name].binary })
29207
- ] }, name);
29208
- }),
29209
- /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", marginTop: 1, children: [
29210
- /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
29211
- panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs46(Box45, { gap: 1, paddingLeft: 1, children: [
29212
- /* @__PURE__ */ jsx57(Box45, { width: PANEL_LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: row.label }) }),
29213
- /* @__PURE__ */ jsx57(Text48, { color: TONE_COLOR[row.tone], children: row.value })
29214
- ] }, row.label))
29215
- ] }),
29216
- notice && /* @__PURE__ */ jsxs46(Fragment17, { children: [
29217
- /* @__PURE__ */ jsx57(Text48, { children: " " }),
29218
- /* @__PURE__ */ jsxs46(Text48, { bold: true, color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
29219
- notice.kind === "success" ? "\u2713" : "\u2717",
29220
- " ",
29221
- notice.text
29222
- ] })
29223
- ] }),
29224
- /* @__PURE__ */ jsx57(Text48, { children: " " }),
29225
- /* @__PURE__ */ jsx57(
29226
- ControlHints,
29227
- {
29228
- hints: [
29229
- { keys: "\u2191/\u2193", label: "move" },
29230
- { keys: "\u23CE", label: "make default" },
29231
- { keys: "\u2192", label: "settings and test" },
29232
- { keys: "Esc/q", label: "back" }
29233
- ]
29234
- }
29235
- )
29236
- ] });
29237
- }
29238
-
29239
- // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
29240
- import { useEffect as useEffect24, useState as useState32 } from "react";
29241
- import { Box as Box47, Text as Text50 } from "ink";
29242
- init_debug_store();
29243
-
29244
- // packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx
29245
- import { useState as useState31 } from "react";
29246
- import { Box as Box46, Text as Text49, useInput as useInput13 } from "ink";
29247
- import TextInput5 from "ink-text-input";
29248
- import { Fragment as Fragment18, jsx as jsx58, jsxs as jsxs47 } from "react/jsx-runtime";
29249
- function FieldForm({
29250
- title,
29251
- subtitle,
29252
- fields,
29253
- values,
29254
- onChange,
29255
- onSave,
29256
- onQuit,
29257
- notice,
29258
- busy = false,
29259
- footer
29260
- }) {
29261
- const [active, setActive] = useState31(0);
29262
- const [editing, setEditing] = useState31(false);
29263
- const [valueBeforeEdit, setValueBeforeEdit] = useState31("");
29264
- const labelWidth = Math.max(...fields.map((field) => field.label.length));
29265
- const current = fields[active];
29266
- useInput13((input, key) => {
29267
- if (busy) return;
29268
- if (editing) {
29269
- if (key.escape) {
29270
- onChange(current.key, valueBeforeEdit);
29271
- setEditing(false);
29272
- }
29273
- return;
29274
- }
29275
- if (key.escape || input === "q") {
29276
- onQuit();
29277
- return;
29278
- }
29279
- if (input === "s") {
29280
- onSave();
29281
- return;
29282
- }
29283
- if (input === "c") {
29284
- onChange(current.key, "");
29285
- return;
29286
- }
29287
- if (key.tab || key.downArrow) {
29288
- setActive((i) => (i + 1) % fields.length);
29289
- return;
29290
- }
29291
- if (key.upArrow) {
29292
- setActive((i) => (i - 1 + fields.length) % fields.length);
29293
- return;
29294
- }
29295
- if (key.return) {
29296
- setValueBeforeEdit(values[current.key]);
29297
- setEditing(true);
29298
- }
29299
- });
29300
- return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
29301
- /* @__PURE__ */ jsx58(Text49, { bold: true, children: title }),
29302
- subtitle && /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: subtitle }),
29303
- /* @__PURE__ */ jsx58(Text49, { children: " " }),
29304
- /* @__PURE__ */ jsx58(Box46, { flexDirection: "column", children: fields.map((field, index) => {
29305
- const isActive = index === active;
29306
- const value = values[field.key];
29307
- const display = field.masked ? "\u2022".repeat(value.length) : value;
29308
- return /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
29309
- /* @__PURE__ */ jsx58(Text49, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
29310
- /* @__PURE__ */ jsx58(Box46, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx58(Text49, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
29311
- isActive && editing ? /* @__PURE__ */ jsx58(
29312
- TextInput5,
29313
- {
29314
- value,
29315
- onChange: (next) => onChange(field.key, next),
29316
- onSubmit: () => setEditing(false),
29317
- mask: field.masked ? "\u2022" : void 0
29318
- }
29319
- ) : /* @__PURE__ */ jsx58(Text49, { bold: !!display, children: display || (field.hint ? "" : /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: "(empty)" })) }),
29320
- field.hint && /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: field.hint })
29321
- ] }, field.key);
29322
- }) }),
29323
- notice && /* @__PURE__ */ jsxs47(Fragment18, { children: [
29324
- /* @__PURE__ */ jsx58(Text49, { children: " " }),
29325
- /* @__PURE__ */ jsxs47(Text49, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
29326
- notice.kind === "success" ? "\u2713" : "\u2717",
29327
- " ",
29328
- notice.text
29329
- ] })
29330
- ] }),
29331
- footer,
29332
- /* @__PURE__ */ jsx58(Text49, { children: " " }),
29333
- /* @__PURE__ */ jsx58(
29334
- ControlHints,
29335
- {
29336
- hints: editing ? [
29337
- { keys: "type", label: "edit" },
29338
- { keys: "\u2190/\u2192", label: "move cursor" },
29339
- { keys: "\u23CE", label: "done" },
29340
- { keys: "Esc", label: "cancel edit" }
29341
- ] : [
29342
- { keys: "\u2191/\u2193", label: "move" },
29343
- { keys: "\u23CE", label: "edit" },
29344
- { keys: "c", label: "clear" },
29345
- { keys: "s", label: "save" },
29346
- { keys: "Esc/q", label: "back without saving" }
29347
- ]
29348
- }
29349
- )
29350
- ] });
29351
- }
29352
-
29353
28558
  // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
29354
28559
  async function readCredentials() {
29355
28560
  const store = await readV1Store();
@@ -29375,16 +28580,17 @@ async function writeCredentials(config) {
29375
28580
  await writeV1Store(merged);
29376
28581
  }
29377
28582
 
29378
- // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
29379
- import { jsx as jsx59, jsxs as jsxs48 } from "react/jsx-runtime";
29380
- var FIELDS3 = [
29381
- { key: "spaceId", label: "Space ID" },
29382
- { key: "environmentId", label: "Environment ID" },
29383
- { key: "cmaToken", label: "CMA Token", masked: true },
29384
- { key: "host", label: "API Host" },
29385
- { key: "defaultComponentDir", label: "Default component directory" },
29386
- { key: "defaultTokenFile", label: "Default token file" },
29387
- { key: "contentfulBaseDir", label: "Root Project Directory", hint: "(where .contentful goes)" }
28583
+ // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
28584
+ init_debug_store();
28585
+ import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
28586
+ var FIELD_ORDER = [
28587
+ "spaceId",
28588
+ "environmentId",
28589
+ "cmaToken",
28590
+ "host",
28591
+ "defaultComponentDir",
28592
+ "defaultTokenFile",
28593
+ "contentfulBaseDir"
29388
28594
  ];
29389
28595
  function debugFields(config) {
29390
28596
  return {
@@ -29397,114 +28603,156 @@ function debugFields(config) {
29397
28603
  contentful_base_dir: config?.contentfulBaseDir ?? ""
29398
28604
  };
29399
28605
  }
29400
- var valuesOf = (config) => Object.fromEntries(FIELDS3.map(({ key }) => [key, config[key] || ""]));
29401
- function ProjectConfigScreen({ onDone }) {
29402
- const [config, setConfig] = useState32(null);
29403
- const [saving, setSaving] = useState32(false);
29404
- const [notice, setNotice] = useState32(null);
29405
- const [lastSaved, setLastSaved] = useState32(null);
29406
- useEffect24(() => {
29407
- void readCredentials().then((cfg) => {
28606
+ var FIELD_LABELS = {
28607
+ spaceId: "Space ID",
28608
+ environmentId: "Environment ID",
28609
+ cmaToken: "CMA Token",
28610
+ host: "API Host",
28611
+ defaultComponentDir: "Default component directory",
28612
+ defaultTokenFile: "Default token file",
28613
+ contentfulBaseDir: "Root Project Directory"
28614
+ };
28615
+ var FIELD_HINTS = {
28616
+ contentfulBaseDir: "(where .contentful goes)"
28617
+ };
28618
+ var LABEL_WIDTH = Math.max(...Object.values(FIELD_LABELS).map((label) => label.length));
28619
+ function ConfigurationScreen({ onDone }) {
28620
+ const [stage, setStage] = useState29("loading");
28621
+ const [config, setConfig] = useState29(null);
28622
+ const [activeField, setActiveField] = useState29("spaceId");
28623
+ const [notice, setNotice] = useState29(null);
28624
+ const [lastSaved, setLastSaved] = useState29(null);
28625
+ const [editing, setEditing] = useState29(false);
28626
+ const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
28627
+ useEffect22(() => {
28628
+ readCredentials().then((cfg) => {
29408
28629
  setConfig(cfg);
28630
+ setStage("form");
29409
28631
  startDebugRun({
29410
28632
  flow: "settings/contentful-configuration",
29411
28633
  step: "01-configuration",
29412
- menuOption: "Configuration > Project",
28634
+ menuOption: "Configuration",
29413
28635
  inputs: debugFields(cfg)
29414
28636
  });
29415
28637
  });
29416
28638
  }, []);
29417
- if (!config) {
29418
- return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
29419
- /* @__PURE__ */ jsx59(Text50, { bold: true, children: "Project" }),
29420
- /* @__PURE__ */ jsx59(Text50, { children: " " }),
29421
- /* @__PURE__ */ jsx59(Text50, { color: PALETTE.accent, children: "Loading..." })
29422
- ] });
28639
+ function fieldValue(field) {
28640
+ if (!config) return "";
28641
+ return config[field] || "";
29423
28642
  }
29424
- const save = () => {
29425
- setSaving(true);
28643
+ function setFieldValue(field, value) {
28644
+ if (!config) return;
28645
+ setConfig({ ...config, [field]: value });
28646
+ setNotice(null);
28647
+ }
28648
+ function handleSave() {
28649
+ if (!config) return;
28650
+ setStage("saving");
29426
28651
  setNotice(null);
29427
28652
  writeCredentials(config).then(() => {
29428
28653
  setLastSaved(config);
29429
28654
  if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
29430
- setNotice({ kind: "success", text: "Project settings saved" });
28655
+ setNotice({ kind: "success", text: "Configuration saved" });
28656
+ setStage("form");
29431
28657
  }).catch((err) => {
29432
28658
  setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
29433
- }).finally(() => setSaving(false));
29434
- };
29435
- const quit = () => {
28659
+ setStage("form");
28660
+ });
28661
+ }
28662
+ function quit() {
29436
28663
  void finishDebugRun(
29437
28664
  lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
29438
28665
  );
29439
28666
  onDone();
29440
- };
29441
- return /* @__PURE__ */ jsx59(
29442
- FieldForm,
29443
- {
29444
- title: "Project",
29445
- subtitle: "The Contentful space and where the CLI keeps its files.",
29446
- fields: FIELDS3,
29447
- values: valuesOf(config),
29448
- onChange: (key, value) => {
29449
- setConfig({ ...config, [key]: value });
29450
- setNotice(null);
29451
- },
29452
- onSave: save,
29453
- onQuit: quit,
29454
- notice,
29455
- busy: saving
28667
+ }
28668
+ useInput11((input, key) => {
28669
+ if (stage === "loading" || stage === "saving") return;
28670
+ if (editing) {
28671
+ if (key.escape) {
28672
+ setFieldValue(activeField, valueBeforeEdit);
28673
+ setEditing(false);
28674
+ }
28675
+ return;
29456
28676
  }
29457
- );
29458
- }
29459
-
29460
- // packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
29461
- import { jsx as jsx60, jsxs as jsxs49 } from "react/jsx-runtime";
29462
- var SECTIONS = [
29463
- {
29464
- id: "project",
29465
- label: "Project",
29466
- description: "Contentful space, credentials, defaults and where .contentful goes"
29467
- },
29468
- { id: "agents", label: "Agents", description: "Which coding agent the CLI uses, and each agent\u2019s settings" }
29469
- ];
29470
- function ConfigurationScreen({ onDone }) {
29471
- const [focus, setFocus] = useState33(0);
29472
- const [open, setOpen] = useState33(null);
29473
- const close = () => setOpen(null);
29474
- useInput14((input, key) => {
29475
- if (open) return;
29476
- if (key.upArrow) {
29477
- setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
28677
+ if (key.escape || input === "q") {
28678
+ quit();
29478
28679
  return;
29479
28680
  }
29480
- if (key.downArrow || key.tab) {
29481
- setFocus((i) => (i + 1) % SECTIONS.length);
28681
+ if (input === "s") {
28682
+ handleSave();
29482
28683
  return;
29483
28684
  }
29484
- if (key.return) {
29485
- setOpen(SECTIONS[focus].id);
28685
+ if (input === "c") {
28686
+ setFieldValue(activeField, "");
28687
+ return;
28688
+ }
28689
+ if (key.tab || key.downArrow) {
28690
+ const idx = FIELD_ORDER.indexOf(activeField);
28691
+ setActiveField(FIELD_ORDER[(idx + 1) % FIELD_ORDER.length]);
28692
+ return;
28693
+ }
28694
+ if (key.upArrow) {
28695
+ const idx = FIELD_ORDER.indexOf(activeField);
28696
+ setActiveField(FIELD_ORDER[(idx - 1 + FIELD_ORDER.length) % FIELD_ORDER.length]);
29486
28697
  return;
29487
28698
  }
29488
- if (key.escape || input === "q") onDone();
28699
+ if (key.return) {
28700
+ setValueBeforeEdit(fieldValue(activeField));
28701
+ setEditing(true);
28702
+ }
29489
28703
  });
29490
- if (open === "project") return /* @__PURE__ */ jsx60(ProjectConfigScreen, { onDone: close });
29491
- if (open === "agents") return /* @__PURE__ */ jsx60(AgentsScreen, { onDone: close });
29492
- return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
29493
- /* @__PURE__ */ jsx60(Text51, { bold: true, children: "Configuration" }),
29494
- /* @__PURE__ */ jsx60(Text51, { children: " " }),
29495
- SECTIONS.map((section, index) => /* @__PURE__ */ jsxs49(Box48, { gap: 1, children: [
29496
- /* @__PURE__ */ jsx60(Text51, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
29497
- /* @__PURE__ */ jsx60(Box48, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text51, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
29498
- /* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: section.description })
29499
- ] }, section.id)),
29500
- /* @__PURE__ */ jsx60(Text51, { children: " " }),
29501
- /* @__PURE__ */ jsx60(
28704
+ if (stage === "loading") {
28705
+ return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
28706
+ /* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
28707
+ /* @__PURE__ */ jsx55(Text46, { children: " " }),
28708
+ /* @__PURE__ */ jsx55(Text46, { color: PALETTE.accent, children: "Loading..." })
28709
+ ] });
28710
+ }
28711
+ return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
28712
+ /* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
28713
+ /* @__PURE__ */ jsx55(Text46, { children: " " }),
28714
+ /* @__PURE__ */ jsx55(Box44, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
28715
+ const isActive = activeField === field;
28716
+ const value = fieldValue(field);
28717
+ const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
28718
+ return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
28719
+ /* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
28720
+ /* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
28721
+ isActive && editing ? /* @__PURE__ */ jsx55(
28722
+ TextInput4,
28723
+ {
28724
+ value,
28725
+ onChange: (next) => setFieldValue(field, next),
28726
+ onSubmit: () => setEditing(false),
28727
+ mask: field === "cmaToken" ? "\u2022" : void 0
28728
+ }
28729
+ ) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (FIELD_HINTS[field] ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
28730
+ FIELD_HINTS[field] && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: FIELD_HINTS[field] })
28731
+ ] }, field);
28732
+ }) }),
28733
+ notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
28734
+ /* @__PURE__ */ jsx55(Text46, { children: " " }),
28735
+ /* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
28736
+ notice.kind === "success" ? "\u2713" : "\u2717",
28737
+ " ",
28738
+ notice.text
28739
+ ] })
28740
+ ] }),
28741
+ /* @__PURE__ */ jsx55(Text46, { children: " " }),
28742
+ /* @__PURE__ */ jsx55(
29502
28743
  ControlHints,
29503
28744
  {
29504
- hints: [
28745
+ hints: editing ? [
28746
+ { keys: "type", label: "edit" },
28747
+ { keys: "\u2190/\u2192", label: "move cursor" },
28748
+ { keys: "\u23CE", label: "done" },
28749
+ { keys: "Esc", label: "cancel edit" }
28750
+ ] : [
29505
28751
  { keys: "\u2191/\u2193", label: "move" },
29506
- { keys: "\u23CE", label: "open" },
29507
- { keys: "Esc/q", label: "back" }
28752
+ { keys: "\u23CE", label: "edit" },
28753
+ { keys: "c", label: "clear" },
28754
+ { keys: "s", label: "save" },
28755
+ { keys: "Esc/q", label: "quit without saving" }
29508
28756
  ]
29509
28757
  }
29510
28758
  )
@@ -29512,8 +28760,8 @@ function ConfigurationScreen({ onDone }) {
29512
28760
  }
29513
28761
 
29514
28762
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
29515
- import { useEffect as useEffect25, useState as useState34 } from "react";
29516
- import { Box as Box49, Text as Text52, useInput as useInput15 } from "ink";
28763
+ import { useEffect as useEffect23, useState as useState30 } from "react";
28764
+ import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
29517
28765
 
29518
28766
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
29519
28767
  async function readAnalyticsSetting() {
@@ -29532,11 +28780,11 @@ async function writeAnalyticsSetting(setting) {
29532
28780
 
29533
28781
  // packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
29534
28782
  init_debug_store();
29535
- import { Fragment as Fragment19, jsx as jsx61, jsxs as jsxs50 } from "react/jsx-runtime";
28783
+ import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
29536
28784
  function OptInAnalyticsScreen({ onDone }) {
29537
- const [loading, setLoading] = useState34(true);
29538
- const [enabled, setEnabled] = useState34(true);
29539
- useEffect25(() => {
28785
+ const [loading, setLoading] = useState30(true);
28786
+ const [enabled, setEnabled] = useState30(true);
28787
+ useEffect23(() => {
29540
28788
  readAnalyticsSetting().then((setting) => {
29541
28789
  setEnabled(setting.enabled);
29542
28790
  setLoading(false);
@@ -29548,7 +28796,7 @@ function OptInAnalyticsScreen({ onDone }) {
29548
28796
  });
29549
28797
  });
29550
28798
  }, []);
29551
- useInput15((input, key) => {
28799
+ useInput12((input, key) => {
29552
28800
  if (loading) return;
29553
28801
  if (key.return || input === " ") {
29554
28802
  setEnabled((current) => {
@@ -29563,21 +28811,21 @@ function OptInAnalyticsScreen({ onDone }) {
29563
28811
  onDone();
29564
28812
  }
29565
28813
  });
29566
- return /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
29567
- /* @__PURE__ */ jsx61(Text52, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
29568
- /* @__PURE__ */ jsx61(Text52, { children: " " }),
29569
- loading ? /* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs50(Fragment19, { children: [
29570
- /* @__PURE__ */ jsxs50(Text52, { children: [
28814
+ return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
28815
+ /* @__PURE__ */ jsx56(Text47, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
28816
+ /* @__PURE__ */ jsx56(Text47, { children: " " }),
28817
+ loading ? /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs46(Fragment18, { children: [
28818
+ /* @__PURE__ */ jsxs46(Text47, { children: [
29571
28819
  "Share anonymous usage data:",
29572
28820
  " ",
29573
- /* @__PURE__ */ jsx61(Text52, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
28821
+ /* @__PURE__ */ jsx56(Text47, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
29574
28822
  ] }),
29575
- /* @__PURE__ */ jsx61(Text52, { children: " " }),
29576
- /* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
29577
- /* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
28823
+ /* @__PURE__ */ jsx56(Text47, { children: " " }),
28824
+ /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
28825
+ /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
29578
28826
  ] }),
29579
- /* @__PURE__ */ jsx61(Text52, { children: " " }),
29580
- /* @__PURE__ */ jsx61(
28827
+ /* @__PURE__ */ jsx56(Text47, { children: " " }),
28828
+ /* @__PURE__ */ jsx56(
29581
28829
  ControlHints,
29582
28830
  {
29583
28831
  hints: [
@@ -29590,15 +28838,15 @@ function OptInAnalyticsScreen({ onDone }) {
29590
28838
  }
29591
28839
 
29592
28840
  // packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
29593
- import { useEffect as useEffect26, useState as useState35 } from "react";
29594
- import { Box as Box50, Text as Text53, useInput as useInput16 } from "ink";
28841
+ import { useEffect as useEffect24, useState as useState31 } from "react";
28842
+ import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
29595
28843
  init_version();
29596
28844
  init_debug_store();
29597
- import { jsx as jsx62, jsxs as jsxs51 } from "react/jsx-runtime";
28845
+ import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
29598
28846
  var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
29599
28847
  function UpgradeScreen({ onDone }) {
29600
- const [upgradeCheck, setUpgradeCheck] = useState35();
29601
- useEffect26(() => {
28848
+ const [upgradeCheck, setUpgradeCheck] = useState31();
28849
+ useEffect24(() => {
29602
28850
  startDebugRun({
29603
28851
  flow: "upgrade",
29604
28852
  step: "01-upgrade",
@@ -29607,7 +28855,7 @@ function UpgradeScreen({ onDone }) {
29607
28855
  });
29608
28856
  checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
29609
28857
  }, []);
29610
- useInput16((_input, key) => {
28858
+ useInput13((_input, key) => {
29611
28859
  if (key.return) {
29612
28860
  void finishDebugRun({
29613
28861
  outputs: upgradeCheck ?? {},
@@ -29618,12 +28866,12 @@ function UpgradeScreen({ onDone }) {
29618
28866
  return;
29619
28867
  }
29620
28868
  });
29621
- return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
29622
- /* @__PURE__ */ jsx62(Text53, { bold: true, children: "Upgrade" }),
29623
- /* @__PURE__ */ jsx62(Text53, { children: " " }),
28869
+ return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
28870
+ /* @__PURE__ */ jsx57(Text48, { bold: true, children: "Upgrade" }),
28871
+ /* @__PURE__ */ jsx57(Text48, { children: " " }),
29624
28872
  renderBody(upgradeCheck),
29625
- /* @__PURE__ */ jsx62(Text53, { children: " " }),
29626
- /* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.accent, children: [
28873
+ /* @__PURE__ */ jsx57(Text48, { children: " " }),
28874
+ /* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.accent, children: [
29627
28875
  FOCUS_MARKER,
29628
28876
  " Go Back"
29629
28877
  ] })
@@ -29631,47 +28879,47 @@ function UpgradeScreen({ onDone }) {
29631
28879
  }
29632
28880
  function renderBody(upgradeCheck) {
29633
28881
  if (!upgradeCheck) {
29634
- return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Checking for updates\u2026" });
28882
+ return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "Checking for updates\u2026" });
29635
28883
  }
29636
28884
  if (upgradeCheck.status === "error") {
29637
- return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
28885
+ return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
29638
28886
  }
29639
28887
  if (upgradeCheck.status === "up-to-date") {
29640
- return /* @__PURE__ */ jsxs51(Text53, { color: PALETTE.success, children: [
28888
+ return /* @__PURE__ */ jsxs47(Text48, { color: PALETTE.success, children: [
29641
28889
  "You're already on the latest version (v",
29642
28890
  upgradeCheck.current,
29643
28891
  ")."
29644
28892
  ] });
29645
28893
  }
29646
- return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", children: [
29647
- /* @__PURE__ */ jsxs51(Text53, { color: PALETTE.muted, children: [
29648
- /* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.success, children: [
28894
+ return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", children: [
28895
+ /* @__PURE__ */ jsxs47(Text48, { color: PALETTE.muted, children: [
28896
+ /* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.success, children: [
29649
28897
  "v",
29650
28898
  upgradeCheck.latest
29651
28899
  ] }),
29652
28900
  " ",
29653
28901
  "is available (you're on ",
29654
- /* @__PURE__ */ jsxs51(Text53, { bold: true, children: [
28902
+ /* @__PURE__ */ jsxs47(Text48, { bold: true, children: [
29655
28903
  "v",
29656
28904
  upgradeCheck.current
29657
28905
  ] }),
29658
28906
  "). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
29659
28907
  ] }),
29660
- /* @__PURE__ */ jsx62(Text53, { children: " " }),
29661
- /* @__PURE__ */ jsx62(Box50, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx62(Text53, { bold: true, children: cmd }, cmd)) })
28908
+ /* @__PURE__ */ jsx57(Text48, { children: " " }),
28909
+ /* @__PURE__ */ jsx57(Box46, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx57(Text48, { bold: true, children: cmd }, cmd)) })
29662
28910
  ] });
29663
28911
  }
29664
28912
 
29665
28913
  // packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
29666
- import { useEffect as useEffect27, useState as useState36 } from "react";
29667
- import { Box as Box51, Text as Text54, useInput as useInput17 } from "ink";
28914
+ import { useEffect as useEffect25, useState as useState32 } from "react";
28915
+ import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
29668
28916
  init_debug_mode_store();
29669
28917
  init_debug_store();
29670
- import { jsx as jsx63, jsxs as jsxs52 } from "react/jsx-runtime";
28918
+ import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
29671
28919
  function DebugModeScreen({ onDone }) {
29672
- const [loading, setLoading] = useState36(true);
29673
- const [enabled, setEnabled] = useState36(true);
29674
- useEffect27(() => {
28920
+ const [loading, setLoading] = useState32(true);
28921
+ const [enabled, setEnabled] = useState32(true);
28922
+ useEffect25(() => {
29675
28923
  readDebugModeSetting().then((setting) => {
29676
28924
  setEnabled(setting.enabled);
29677
28925
  setLoading(false);
@@ -29683,7 +28931,7 @@ function DebugModeScreen({ onDone }) {
29683
28931
  });
29684
28932
  });
29685
28933
  }, []);
29686
- useInput17((input, key) => {
28934
+ useInput14((input, key) => {
29687
28935
  if (loading) return;
29688
28936
  if (key.return || input === " ") {
29689
28937
  setEnabled((current) => {
@@ -29698,16 +28946,16 @@ function DebugModeScreen({ onDone }) {
29698
28946
  onDone();
29699
28947
  }
29700
28948
  });
29701
- return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
29702
- /* @__PURE__ */ jsx63(Text54, { bold: true, children: "Settings \u203A Debug Mode" }),
29703
- /* @__PURE__ */ jsx63(Text54, { children: " " }),
29704
- loading ? /* @__PURE__ */ jsx63(Text54, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs52(Text54, { children: [
28949
+ return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
28950
+ /* @__PURE__ */ jsx58(Text49, { bold: true, children: "Settings \u203A Debug Mode" }),
28951
+ /* @__PURE__ */ jsx58(Text49, { children: " " }),
28952
+ loading ? /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs48(Text49, { children: [
29705
28953
  "Debug logging:",
29706
28954
  " ",
29707
- /* @__PURE__ */ jsx63(Text54, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
28955
+ /* @__PURE__ */ jsx58(Text49, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
29708
28956
  ] }),
29709
- /* @__PURE__ */ jsx63(Text54, { children: " " }),
29710
- /* @__PURE__ */ jsx63(
28957
+ /* @__PURE__ */ jsx58(Text49, { children: " " }),
28958
+ /* @__PURE__ */ jsx58(
29711
28959
  ControlHints,
29712
28960
  {
29713
28961
  hints: [
@@ -29720,18 +28968,18 @@ function DebugModeScreen({ onDone }) {
29720
28968
  }
29721
28969
 
29722
28970
  // packages/experience-design-system-cli/app.tsx
29723
- import { Fragment as Fragment20, jsx as jsx64 } from "react/jsx-runtime";
28971
+ import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
29724
28972
  function App({ importOptions, inkClear }) {
29725
- const [screen, setScreen] = useState37("start");
29726
- const [importExitCode, setImportExitCode] = useState37();
28973
+ const [screen, setScreen] = useState33("start");
28974
+ const [importExitCode, setImportExitCode] = useState33();
29727
28975
  const showImportResult = importExitCode !== void 0;
29728
- const [projectPath, setProjectPath] = useState37();
29729
- const [tokensPath, setTokensPath] = useState37();
29730
- const [scannedFiles, setScannedFiles] = useState37();
29731
- const [pendingLaunch, setPendingLaunch] = useState37();
29732
- const [extractionRun, setExtractionRun] = useState37();
28976
+ const [projectPath, setProjectPath] = useState33();
28977
+ const [tokensPath, setTokensPath] = useState33();
28978
+ const [scannedFiles, setScannedFiles] = useState33();
28979
+ const [pendingLaunch, setPendingLaunch] = useState33();
28980
+ const [extractionRun, setExtractionRun] = useState33();
29733
28981
  const extraction = useExtraction(extractionRun?.input);
29734
- const [scopeRun, setScopeRun] = useState37();
28982
+ const [scopeRun, setScopeRun] = useState33();
29735
28983
  const scopeFlow = useScopeGateFlow(
29736
28984
  scopeRun && {
29737
28985
  sessionId: scopeRun.extraction.sessionId,
@@ -29746,12 +28994,12 @@ function App({ importOptions, inkClear }) {
29746
28994
  }
29747
28995
  }
29748
28996
  );
29749
- const [generationInput, setGenerationInput] = useState37();
28997
+ const [generationInput, setGenerationInput] = useState33();
29750
28998
  const generation = useGeneration(generationInput);
29751
- const [flowStart, setFlowStart] = useState37();
28999
+ const [flowStart, setFlowStart] = useState33();
29752
29000
  const flow = useFlow(flowStart, { beforeStepChange: inkClear });
29753
- const [importDefaults, setImportDefaults] = useState37();
29754
- useEffect28(() => {
29001
+ const [importDefaults, setImportDefaults] = useState33();
29002
+ useEffect26(() => {
29755
29003
  if (screen !== "import") {
29756
29004
  setImportDefaults(void 0);
29757
29005
  return;
@@ -29769,7 +29017,7 @@ function App({ importOptions, inkClear }) {
29769
29017
  const launch = { projectPath: projectPath2, tokens, filePaths, ...importOptions };
29770
29018
  const state2 = await inspectTokens({
29771
29019
  rawTokensPath: tokens,
29772
- contentfulDir: join26(resolveUserPath(projectPath2), ".contentful"),
29020
+ contentfulDir: join25(resolveUserPath(projectPath2), ".contentful"),
29773
29021
  cache: importOptions.cache
29774
29022
  });
29775
29023
  if (state2.kind === "cached") {
@@ -29811,12 +29059,12 @@ function App({ importOptions, inkClear }) {
29811
29059
  }
29812
29060
  });
29813
29061
  };
29814
- useEffect28(() => {
29062
+ useEffect26(() => {
29815
29063
  if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
29816
29064
  setExtractionRun(void 0);
29817
29065
  setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
29818
29066
  }, [extraction, extractionRun]);
29819
- useEffect28(() => {
29067
+ useEffect26(() => {
29820
29068
  if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
29821
29069
  const { extraction: produced, input, generatePromptPath } = scopeRun;
29822
29070
  setGenerationInput({
@@ -29834,7 +29082,7 @@ function App({ importOptions, inkClear }) {
29834
29082
  ...generatePromptPath ? { generatePromptPath } : {}
29835
29083
  });
29836
29084
  }, [scopeFlow, scopeRun, generationInput]);
29837
- useEffect28(() => {
29085
+ useEffect26(() => {
29838
29086
  if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
29839
29087
  const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
29840
29088
  inkClear();
@@ -29877,9 +29125,9 @@ function App({ importOptions, inkClear }) {
29877
29125
  };
29878
29126
  switch (screen) {
29879
29127
  case "import":
29880
- if (showImportResult) return /* @__PURE__ */ jsx64(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
29128
+ if (showImportResult) return /* @__PURE__ */ jsx59(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
29881
29129
  if (flow && flowStart) {
29882
- return /* @__PURE__ */ jsx64(
29130
+ return /* @__PURE__ */ jsx59(
29883
29131
  FlowScreen,
29884
29132
  {
29885
29133
  state: flow.state,
@@ -29889,12 +29137,12 @@ function App({ importOptions, inkClear }) {
29889
29137
  }
29890
29138
  );
29891
29139
  }
29892
- if (importDefaults === void 0) return /* @__PURE__ */ jsx64(Fragment20, {});
29140
+ if (importDefaults === void 0) return /* @__PURE__ */ jsx59(Fragment19, {});
29893
29141
  if (projectPath === void 0) {
29894
- return /* @__PURE__ */ jsx64(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
29142
+ return /* @__PURE__ */ jsx59(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
29895
29143
  }
29896
29144
  if (tokensPath === void 0) {
29897
- return /* @__PURE__ */ jsx64(
29145
+ return /* @__PURE__ */ jsx59(
29898
29146
  TokenInputScreen,
29899
29147
  {
29900
29148
  initialPath: importDefaults.tokenFile,
@@ -29904,7 +29152,7 @@ function App({ importOptions, inkClear }) {
29904
29152
  );
29905
29153
  }
29906
29154
  if (scannedFiles === void 0) {
29907
- return /* @__PURE__ */ jsx64(
29155
+ return /* @__PURE__ */ jsx59(
29908
29156
  PathValidationScreen,
29909
29157
  {
29910
29158
  projectPath,
@@ -29916,10 +29164,10 @@ function App({ importOptions, inkClear }) {
29916
29164
  }
29917
29165
  if (extractionRun) {
29918
29166
  if (extraction?.status === "done" && !extraction.result.ok) {
29919
- return /* @__PURE__ */ jsx64(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
29167
+ return /* @__PURE__ */ jsx59(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
29920
29168
  }
29921
29169
  if (extraction?.status === "running") {
29922
- return /* @__PURE__ */ jsx64(
29170
+ return /* @__PURE__ */ jsx59(
29923
29171
  ExtractionScreen,
29924
29172
  {
29925
29173
  progress: extraction.progress,
@@ -29928,14 +29176,14 @@ function App({ importOptions, inkClear }) {
29928
29176
  }
29929
29177
  );
29930
29178
  }
29931
- return /* @__PURE__ */ jsx64(Fragment20, {});
29179
+ return /* @__PURE__ */ jsx59(Fragment19, {});
29932
29180
  }
29933
29181
  if (scopeRun && scopeFlow) {
29934
29182
  if (scopeFlow.status === "failed") {
29935
- return /* @__PURE__ */ jsx64(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
29183
+ return /* @__PURE__ */ jsx59(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
29936
29184
  }
29937
29185
  if (scopeFlow.status === "deciding") {
29938
- return /* @__PURE__ */ jsx64(
29186
+ return /* @__PURE__ */ jsx59(
29939
29187
  ScopeGateScreen,
29940
29188
  {
29941
29189
  components: scopeFlow.load.components,
@@ -29945,7 +29193,7 @@ function App({ importOptions, inkClear }) {
29945
29193
  );
29946
29194
  }
29947
29195
  if (generation?.status === "done" && !generation.result.ok) {
29948
- return /* @__PURE__ */ jsx64(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
29196
+ return /* @__PURE__ */ jsx59(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
29949
29197
  }
29950
29198
  if (generation?.status === "running") {
29951
29199
  const hasRawTokens = scopeRun.input.rawTokensPath !== "";
@@ -29953,7 +29201,7 @@ function App({ importOptions, inkClear }) {
29953
29201
  hasRawTokens,
29954
29202
  mapTokensEligible: generation.progress.mapTokensEligible
29955
29203
  });
29956
- return /* @__PURE__ */ jsx64(
29204
+ return /* @__PURE__ */ jsx59(
29957
29205
  GenerationScreen,
29958
29206
  {
29959
29207
  progress: generation.progress,
@@ -29965,10 +29213,10 @@ function App({ importOptions, inkClear }) {
29965
29213
  }
29966
29214
  );
29967
29215
  }
29968
- return /* @__PURE__ */ jsx64(Fragment20, {});
29216
+ return /* @__PURE__ */ jsx59(Fragment19, {});
29969
29217
  }
29970
29218
  if (pendingLaunch?.cached) {
29971
- return /* @__PURE__ */ jsx64(
29219
+ return /* @__PURE__ */ jsx59(
29972
29220
  TokenReuseScreen,
29973
29221
  {
29974
29222
  tokensPath: pendingLaunch.cached.tokensPath,
@@ -29979,7 +29227,7 @@ function App({ importOptions, inkClear }) {
29979
29227
  }
29980
29228
  );
29981
29229
  }
29982
- return /* @__PURE__ */ jsx64(
29230
+ return /* @__PURE__ */ jsx59(
29983
29231
  CredentialsScreen,
29984
29232
  {
29985
29233
  initial: importDefaults.credentials,
@@ -29988,19 +29236,19 @@ function App({ importOptions, inkClear }) {
29988
29236
  }
29989
29237
  );
29990
29238
  case "help":
29991
- return /* @__PURE__ */ jsx64(HelpScreen, { onDone: goToStart });
29239
+ return /* @__PURE__ */ jsx59(HelpScreen, { onDone: goToStart });
29992
29240
  case "upgrade":
29993
- return /* @__PURE__ */ jsx64(UpgradeScreen, { onDone: goToStart });
29241
+ return /* @__PURE__ */ jsx59(UpgradeScreen, { onDone: goToStart });
29994
29242
  case "settings":
29995
- return /* @__PURE__ */ jsx64(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
29243
+ return /* @__PURE__ */ jsx59(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
29996
29244
  case "settings-configuration":
29997
- return /* @__PURE__ */ jsx64(ConfigurationScreen, { onDone: goToSettings });
29245
+ return /* @__PURE__ */ jsx59(ConfigurationScreen, { onDone: goToSettings });
29998
29246
  case "settings-opt-in-analytics":
29999
- return /* @__PURE__ */ jsx64(OptInAnalyticsScreen, { onDone: goToSettings });
29247
+ return /* @__PURE__ */ jsx59(OptInAnalyticsScreen, { onDone: goToSettings });
30000
29248
  case "settings-debug-mode":
30001
- return /* @__PURE__ */ jsx64(DebugModeScreen, { onDone: goToSettings });
29249
+ return /* @__PURE__ */ jsx59(DebugModeScreen, { onDone: goToSettings });
30002
29250
  case "start":
30003
- return /* @__PURE__ */ jsx64(HomeScreen, { onNavigate: setScreen });
29251
+ return /* @__PURE__ */ jsx59(HomeScreen, { onNavigate: setScreen });
30004
29252
  }
30005
29253
  }
30006
29254
  async function runApp(renderApp, importOptions) {
@@ -30008,7 +29256,7 @@ async function runApp(renderApp, importOptions) {
30008
29256
  instance.clear?.();
30009
29257
  process.stdout.write("\x1B[H\x1B[0J");
30010
29258
  };
30011
- const instance = renderApp(/* @__PURE__ */ jsx64(App, { importOptions, inkClear }));
29259
+ const instance = renderApp(/* @__PURE__ */ jsx59(App, { importOptions, inkClear }));
30012
29260
  await instance.waitUntilExit();
30013
29261
  }
30014
29262
  export {