@contentful/experience-design-system-cli 2.37.1-dev-build-35e4cab1.0 → 2.37.1-dev-build-8affe270.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 +1179 -484
- package/dist/index.js +1324 -559
- package/dist/package.json +1 -1
- package/dist/src/tui/help/file-locations.d.ts +23 -0
- package/dist/src/tui/home/home.theme.d.ts +8 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +6 -6
- package/dist/src/tui/import/steps/09-review/theme.d.ts +9 -0
- package/dist/src/tui/import/steps/10-flow/theme.d.ts +7 -16
- package/dist/src/tui/settings/agents/AgentDetail.d.ts +13 -0
- package/dist/src/tui/settings/agents/AgentScreens.d.ts +11 -0
- package/dist/src/tui/settings/agents/AgentStatusBadge.d.ts +10 -0
- package/dist/src/tui/settings/agents/agent-status.d.ts +70 -0
- package/dist/src/tui/settings/agents/agent-store.d.ts +17 -0
- package/dist/src/tui/settings/agents/apply-binary-overrides.d.ts +13 -0
- package/dist/src/tui/settings/contentful-configuration/ContentfulConfigScreen.d.ts +1 -0
- package/dist/src/tui/settings/contentful-configuration/ProjectConfigScreen.d.ts +5 -0
- package/dist/src/tui/settings/shared/FieldForm.d.ts +35 -0
- package/legacy/dist/src/index.js +1 -0
- package/legacy/package.json +1 -1
- package/package.json +3 -3
- package/dist/src/tui/theme.d.ts +0 -19
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((
|
|
840
|
+
return new Promise((resolve28) => {
|
|
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
|
-
|
|
889
|
+
resolve28(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((
|
|
911
|
+
return new Promise((resolve28) => {
|
|
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
|
-
|
|
920
|
+
resolve28("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
|
-
|
|
931
|
+
resolve28("unauthenticated");
|
|
932
932
|
return;
|
|
933
933
|
}
|
|
934
934
|
try {
|
|
935
935
|
const status = JSON.parse(stdout);
|
|
936
|
-
|
|
936
|
+
resolve28(status.loggedIn ? "ok" : "unauthenticated");
|
|
937
937
|
} catch {
|
|
938
|
-
|
|
938
|
+
resolve28("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((
|
|
948
|
+
return new Promise((resolve28) => {
|
|
949
949
|
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
950
|
-
child.on("close", (code) =>
|
|
950
|
+
child.on("close", (code) => resolve28(code === 0));
|
|
951
951
|
});
|
|
952
952
|
}
|
|
953
953
|
var init_check_agent_auth = __esm({
|
|
@@ -2329,55 +2329,32 @@ var init_debug_store = __esm({
|
|
|
2329
2329
|
});
|
|
2330
2330
|
|
|
2331
2331
|
// packages/experience-design-system-cli/app.tsx
|
|
2332
|
-
import { join as
|
|
2333
|
-
import { useEffect as
|
|
2332
|
+
import { join as join26 } from "node:path";
|
|
2333
|
+
import { useEffect as useEffect28, useState as useState37 } 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/theme.ts
|
|
2340
|
-
var
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
// blue400
|
|
2349
|
-
error: "#ff707d",
|
|
2350
|
-
// red400
|
|
2351
|
-
success: "#5DB057",
|
|
2352
|
-
// green400
|
|
2353
|
-
warning: "#FFC835"
|
|
2354
|
-
// yellow500
|
|
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"
|
|
2355
2348
|
};
|
|
2356
|
-
var
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
accent: "#0059c8",
|
|
2364
|
-
// semantic primary
|
|
2365
|
-
error: "#bd002a",
|
|
2366
|
-
// semantic negative
|
|
2367
|
-
success: "#006D23",
|
|
2368
|
-
// semantic positive
|
|
2369
|
-
warning: "#CC4500"
|
|
2370
|
-
// semantic warning
|
|
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
|
|
2371
2356
|
};
|
|
2372
|
-
|
|
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 = [PALETTE.accent, PALETTE.error, PALETTE.warning];
|
|
2357
|
+
var BRAND_RAMP = [BRAND.blue, BRAND.orange, BRAND.yellow];
|
|
2381
2358
|
var BAR_CELL = "\u2501";
|
|
2382
2359
|
function brandBar(width, ramp = BRAND_RAMP) {
|
|
2383
2360
|
if (width <= 0 || ramp.length === 0) return [];
|
|
@@ -8454,10 +8431,10 @@ function extractVueSlotsFromSetup(options) {
|
|
|
8454
8431
|
if (!body)
|
|
8455
8432
|
return [];
|
|
8456
8433
|
const slotsByName = /* @__PURE__ */ new Map();
|
|
8457
|
-
for (const
|
|
8458
|
-
if (
|
|
8434
|
+
for (const access7 of body.getDescendantsOfKind(SyntaxKind5.PropertyAccessExpression)) {
|
|
8435
|
+
if (access7.getExpression().getText() !== slotsName)
|
|
8459
8436
|
continue;
|
|
8460
|
-
const slotName =
|
|
8437
|
+
const slotName = access7.getName();
|
|
8461
8438
|
if (!slotsByName.has(slotName)) {
|
|
8462
8439
|
slotsByName.set(slotName, {
|
|
8463
8440
|
name: slotName,
|
|
@@ -13847,7 +13824,7 @@ function errorMessage(error) {
|
|
|
13847
13824
|
return error instanceof Error && error.message ? error.message : String(error);
|
|
13848
13825
|
}
|
|
13849
13826
|
function defaultSleep(delayMs) {
|
|
13850
|
-
return new Promise((
|
|
13827
|
+
return new Promise((resolve28) => setTimeout(resolve28, delayMs));
|
|
13851
13828
|
}
|
|
13852
13829
|
|
|
13853
13830
|
// packages/experience-design-system-backend-pipeline/dist/src/steps/apply/src/helpers/sanitize-preview.js
|
|
@@ -14088,7 +14065,7 @@ var ApiClient = class {
|
|
|
14088
14065
|
const progress = maxAttempts > 1 ? attempt / (maxAttempts - 1) : 0;
|
|
14089
14066
|
const baseDelay = intervalMs + (maxIntervalMs - intervalMs) * progress;
|
|
14090
14067
|
const jitter = Math.random() * baseDelay * 0.15;
|
|
14091
|
-
await new Promise((
|
|
14068
|
+
await new Promise((resolve28) => setTimeout(resolve28, baseDelay + jitter));
|
|
14092
14069
|
}
|
|
14093
14070
|
}
|
|
14094
14071
|
throw new Error(`Operation ${operationId} timed out after ${maxAttempts} attempts`);
|
|
@@ -14573,6 +14550,7 @@ function readTokensFromPath2(request) {
|
|
|
14573
14550
|
init_agents();
|
|
14574
14551
|
init_agent_name();
|
|
14575
14552
|
init_models();
|
|
14553
|
+
init_binaries();
|
|
14576
14554
|
init_is_agent_name();
|
|
14577
14555
|
init_agent_supports_bedrock();
|
|
14578
14556
|
init_check_agent_auth();
|
|
@@ -16397,7 +16375,7 @@ async function retryDatabaseWrite(operation, attempts = 8) {
|
|
|
16397
16375
|
const message = error instanceof Error ? error.message : String(error);
|
|
16398
16376
|
if (!/database is locked|database is busy/i.test(message) || attempt >= attempts)
|
|
16399
16377
|
throw error;
|
|
16400
|
-
await new Promise((
|
|
16378
|
+
await new Promise((resolve28) => setTimeout(resolve28, Math.min(250 * attempt, 2e3)));
|
|
16401
16379
|
}
|
|
16402
16380
|
}
|
|
16403
16381
|
}
|
|
@@ -17512,7 +17490,7 @@ var PROGRESS_THEME = extendTheme(defaultTheme, {
|
|
|
17512
17490
|
components: {
|
|
17513
17491
|
ProgressBar: {
|
|
17514
17492
|
styles: {
|
|
17515
|
-
completed: () => ({ color:
|
|
17493
|
+
completed: () => ({ color: "blue" })
|
|
17516
17494
|
}
|
|
17517
17495
|
}
|
|
17518
17496
|
}
|
|
@@ -21493,6 +21471,17 @@ function PreviewValidationErrorScreen({
|
|
|
21493
21471
|
import { useCallback as useCallback5, useEffect as useEffect16, useMemo as useMemo4, useRef as useRef11, useState as useState22 } from "react";
|
|
21494
21472
|
import figures7 from "figures";
|
|
21495
21473
|
|
|
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
|
+
|
|
21496
21485
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
|
|
21497
21486
|
var HIDDEN_PROP_CATEGORIES = /* @__PURE__ */ new Set(["state", "unattached"]);
|
|
21498
21487
|
function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
@@ -21923,13 +21912,13 @@ function serializeState(state2, originalJson) {
|
|
|
21923
21912
|
}
|
|
21924
21913
|
function Picker({ value, active }) {
|
|
21925
21914
|
return /* @__PURE__ */ jsxs22(Box21, { children: [
|
|
21926
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
21927
|
-
/* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
21928
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
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" })
|
|
21929
21918
|
] });
|
|
21930
21919
|
}
|
|
21931
21920
|
function Toggle({ value, active }) {
|
|
21932
|
-
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
21921
|
+
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE3.warning : value ? PALETTE3.success : PALETTE3.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
21933
21922
|
}
|
|
21934
21923
|
function InlinePropField({
|
|
21935
21924
|
label,
|
|
@@ -21939,7 +21928,7 @@ function InlinePropField({
|
|
|
21939
21928
|
width
|
|
21940
21929
|
}) {
|
|
21941
21930
|
return /* @__PURE__ */ jsxs22(Box21, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
21942
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
21931
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, wrap: "truncate-end", children: [
|
|
21943
21932
|
focused ? "\u203A " : " ",
|
|
21944
21933
|
label
|
|
21945
21934
|
] }),
|
|
@@ -21960,7 +21949,7 @@ function DefaultValueRow({
|
|
|
21960
21949
|
focused
|
|
21961
21950
|
}) {
|
|
21962
21951
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
21963
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
21952
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
21964
21953
|
focused ? "\u203A " : " ",
|
|
21965
21954
|
"default:"
|
|
21966
21955
|
] }),
|
|
@@ -21975,7 +21964,7 @@ function RowLabel({
|
|
|
21975
21964
|
return /* @__PURE__ */ jsxs22(
|
|
21976
21965
|
Text23,
|
|
21977
21966
|
{
|
|
21978
|
-
color: selected ?
|
|
21967
|
+
color: selected ? PALETTE3.inverse : PALETTE3.info,
|
|
21979
21968
|
bold: selected,
|
|
21980
21969
|
backgroundColor: selected ? "blue" : void 0,
|
|
21981
21970
|
wrap: "truncate-end",
|
|
@@ -21993,7 +21982,7 @@ function ValueInputRow({
|
|
|
21993
21982
|
cursorVisible
|
|
21994
21983
|
}) {
|
|
21995
21984
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, children: [
|
|
21996
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
21985
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.info, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
21997
21986
|
/* @__PURE__ */ jsx27(Text23, { children: valueText }),
|
|
21998
21987
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: " " })
|
|
21999
21988
|
] });
|
|
@@ -22010,7 +21999,7 @@ function EditableListItem({
|
|
|
22010
21999
|
if (isBeingEdited) {
|
|
22011
22000
|
return /* @__PURE__ */ jsx27(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
22012
22001
|
}
|
|
22013
|
-
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
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}` }) });
|
|
22014
22003
|
}
|
|
22015
22004
|
function EditableValueList({
|
|
22016
22005
|
values,
|
|
@@ -22024,7 +22013,7 @@ function EditableValueList({
|
|
|
22024
22013
|
showAddInput
|
|
22025
22014
|
}) {
|
|
22026
22015
|
return /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
22027
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
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 }) })),
|
|
22028
22017
|
values.map((value, index) => /* @__PURE__ */ jsx27(
|
|
22029
22018
|
EditableListItem,
|
|
22030
22019
|
{
|
|
@@ -22050,11 +22039,11 @@ function DefaultSubRow({
|
|
|
22050
22039
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
22051
22040
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
22052
22041
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22053
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22042
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22054
22043
|
focused ? "\u203A " : " ",
|
|
22055
22044
|
"default:"
|
|
22056
22045
|
] }),
|
|
22057
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
22046
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE3.muted, children: "(not applicable)" })
|
|
22058
22047
|
] });
|
|
22059
22048
|
}
|
|
22060
22049
|
if (prop.type === "boolean") {
|
|
@@ -22064,11 +22053,11 @@ function DefaultSubRow({
|
|
|
22064
22053
|
if (prop.type === "enum") {
|
|
22065
22054
|
if (prop.values.length === 0) {
|
|
22066
22055
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22067
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22056
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22068
22057
|
focused ? "\u203A " : " ",
|
|
22069
22058
|
"default:"
|
|
22070
22059
|
] }),
|
|
22071
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
22060
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE3.muted, children: "(no values defined)" })
|
|
22072
22061
|
] });
|
|
22073
22062
|
}
|
|
22074
22063
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
@@ -22077,11 +22066,11 @@ function DefaultSubRow({
|
|
|
22077
22066
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
22078
22067
|
if (active) {
|
|
22079
22068
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "row", flexShrink: 0, children: [
|
|
22080
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22069
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22081
22070
|
focused ? "\u203A " : " ",
|
|
22082
22071
|
"default:"
|
|
22083
22072
|
] }),
|
|
22084
|
-
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor:
|
|
22073
|
+
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
|
|
22085
22074
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(0, textCursor) }),
|
|
22086
22075
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
22087
22076
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(textCursor + 1) })
|
|
@@ -22089,11 +22078,11 @@ function DefaultSubRow({
|
|
|
22089
22078
|
] });
|
|
22090
22079
|
}
|
|
22091
22080
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
22092
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22081
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22093
22082
|
focused ? "\u203A " : " ",
|
|
22094
22083
|
"default:"
|
|
22095
22084
|
] }),
|
|
22096
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 :
|
|
22085
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 : PALETTE3.muted, children: value || "(none)" })
|
|
22097
22086
|
] });
|
|
22098
22087
|
}
|
|
22099
22088
|
function DescriptionField({
|
|
@@ -22109,15 +22098,15 @@ function DescriptionField({
|
|
|
22109
22098
|
}) {
|
|
22110
22099
|
if (compact) {
|
|
22111
22100
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22112
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22101
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22113
22102
|
focused ? "\u203A " : " ",
|
|
22114
22103
|
label
|
|
22115
22104
|
] }),
|
|
22116
|
-
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 :
|
|
22105
|
+
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 : PALETTE3.muted, children: value || "\u2014" })
|
|
22117
22106
|
] });
|
|
22118
22107
|
}
|
|
22119
22108
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
22120
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
22109
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
22121
22110
|
focused ? "\u203A " : " ",
|
|
22122
22111
|
label
|
|
22123
22112
|
] }),
|
|
@@ -22181,7 +22170,7 @@ function PropRow({
|
|
|
22181
22170
|
] }),
|
|
22182
22171
|
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" }) }),
|
|
22183
22172
|
prop.type === "enum" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22184
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ?
|
|
22173
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ? PALETTE3.warning : PALETTE3.muted, bold: activeField === "values", children: [
|
|
22185
22174
|
activeField === "values" ? "\u203A " : " ",
|
|
22186
22175
|
"values:"
|
|
22187
22176
|
] }),
|
|
@@ -22202,27 +22191,27 @@ function PropRow({
|
|
|
22202
22191
|
}
|
|
22203
22192
|
),
|
|
22204
22193
|
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
22205
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ?
|
|
22194
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ? PALETTE3.warning : PALETTE3.muted, bold: activeField === "allowed", children: [
|
|
22206
22195
|
activeField === "allowed" ? "\u203A " : " ",
|
|
22207
22196
|
"allowed:"
|
|
22208
22197
|
] }),
|
|
22209
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor:
|
|
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(
|
|
22210
22199
|
Text23,
|
|
22211
22200
|
{
|
|
22212
|
-
color: activeField !== "allowed" && prop.allowed.length === 0 ?
|
|
22201
|
+
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE3.muted : void 0,
|
|
22213
22202
|
wrap: "wrap",
|
|
22214
22203
|
children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)"
|
|
22215
22204
|
}
|
|
22216
22205
|
)
|
|
22217
22206
|
] }),
|
|
22218
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
22207
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: (() => {
|
|
22219
22208
|
const max = Math.max(8, width - 8);
|
|
22220
22209
|
const text = `~ ${rationale}`;
|
|
22221
22210
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
22222
22211
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
22223
22212
|
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, flexDirection: "column", children: [
|
|
22224
22213
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
22225
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
22214
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "values:" }),
|
|
22226
22215
|
activeField === "values" && /* @__PURE__ */ jsx27(Text23, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
22227
22216
|
] }),
|
|
22228
22217
|
/* @__PURE__ */ jsx27(
|
|
@@ -22283,7 +22272,7 @@ function SlotRow({
|
|
|
22283
22272
|
/* @__PURE__ */ jsxs22(
|
|
22284
22273
|
Text23,
|
|
22285
22274
|
{
|
|
22286
|
-
color: activeField === "allowedComponents" ?
|
|
22275
|
+
color: activeField === "allowedComponents" ? PALETTE3.warning : PALETTE3.muted,
|
|
22287
22276
|
bold: activeField === "allowedComponents",
|
|
22288
22277
|
children: [
|
|
22289
22278
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -22291,14 +22280,14 @@ function SlotRow({
|
|
|
22291
22280
|
]
|
|
22292
22281
|
}
|
|
22293
22282
|
),
|
|
22294
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
22283
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(any)" }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
22295
22284
|
] }),
|
|
22296
22285
|
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
22297
22286
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
22298
22287
|
/* @__PURE__ */ jsxs22(
|
|
22299
22288
|
Text23,
|
|
22300
22289
|
{
|
|
22301
|
-
color: activeField === "allowedComponents" ?
|
|
22290
|
+
color: activeField === "allowedComponents" ? PALETTE3.warning : PALETTE3.muted,
|
|
22302
22291
|
bold: activeField === "allowedComponents",
|
|
22303
22292
|
children: [
|
|
22304
22293
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -22306,7 +22295,7 @@ function SlotRow({
|
|
|
22306
22295
|
]
|
|
22307
22296
|
}
|
|
22308
22297
|
),
|
|
22309
|
-
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color:
|
|
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" })
|
|
22310
22299
|
] }),
|
|
22311
22300
|
/* @__PURE__ */ jsx27(
|
|
22312
22301
|
EditableValueList,
|
|
@@ -22322,21 +22311,21 @@ function SlotRow({
|
|
|
22322
22311
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
22323
22312
|
}
|
|
22324
22313
|
),
|
|
22325
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
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)" }) : (() => {
|
|
22326
22315
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
22327
22316
|
if (filtered.length === 0) {
|
|
22328
|
-
return /* @__PURE__ */ jsx27(Text23, { color:
|
|
22317
|
+
return /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
22329
22318
|
}
|
|
22330
22319
|
const cursor = pickerCursor % filtered.length;
|
|
22331
22320
|
const MAX_VISIBLE = 5;
|
|
22332
22321
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
22333
22322
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
22334
22323
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
22335
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
22324
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
22336
22325
|
slice.map((name, i) => {
|
|
22337
22326
|
const absIdx = start + i;
|
|
22338
22327
|
const isCursor = absIdx === cursor;
|
|
22339
|
-
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ?
|
|
22328
|
+
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ? PALETTE3.info : PALETTE3.muted, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
|
|
22340
22329
|
})
|
|
22341
22330
|
] });
|
|
22342
22331
|
})() })
|
|
@@ -23165,18 +23154,18 @@ function FieldEditor({
|
|
|
23165
23154
|
});
|
|
23166
23155
|
const innerWidth = Math.max(1, width - 2);
|
|
23167
23156
|
if (parseErr) {
|
|
23168
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
23169
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23170
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23171
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
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." })
|
|
23172
23161
|
] });
|
|
23173
23162
|
}
|
|
23174
23163
|
if (props.length === 0 && slots.length === 0) {
|
|
23175
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
23176
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23177
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23178
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23179
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
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" })
|
|
23180
23169
|
] });
|
|
23181
23170
|
}
|
|
23182
23171
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -23305,7 +23294,7 @@ function FieldEditor({
|
|
|
23305
23294
|
const renderRow = (row, index) => {
|
|
23306
23295
|
const key = rowKey(row, index);
|
|
23307
23296
|
if (row.kind === "header") {
|
|
23308
|
-
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
23297
|
+
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE3.success, children: row.label }) }, key);
|
|
23309
23298
|
}
|
|
23310
23299
|
if (row.kind === "component-description") {
|
|
23311
23300
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -23387,9 +23376,9 @@ function FieldEditor({
|
|
|
23387
23376
|
...fixedHeight ? { height } : { minHeight: height },
|
|
23388
23377
|
clipOverflow: fixedHeight,
|
|
23389
23378
|
borderStyle: "single",
|
|
23390
|
-
borderColor: hasEmptyProperties ?
|
|
23379
|
+
borderColor: hasEmptyProperties ? PALETTE3.warning : active ? PALETTE3.info : PALETTE3.border,
|
|
23391
23380
|
children: [
|
|
23392
|
-
hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color:
|
|
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." }),
|
|
23393
23382
|
header,
|
|
23394
23383
|
/* @__PURE__ */ jsx27(Box21, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx27(
|
|
23395
23384
|
PropRow,
|
|
@@ -23440,7 +23429,7 @@ function FieldEditor({
|
|
|
23440
23429
|
`visible-${key}`
|
|
23441
23430
|
);
|
|
23442
23431
|
}) }),
|
|
23443
|
-
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23432
|
+
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
23444
23433
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
23445
23434
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
23446
23435
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -23450,20 +23439,20 @@ function FieldEditor({
|
|
|
23450
23439
|
const headerPath = path5 ?? "<unknown source path>";
|
|
23451
23440
|
if (!start || !end2 || !src) {
|
|
23452
23441
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23453
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23454
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
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)" }),
|
|
23455
23444
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close" })
|
|
23456
23445
|
] });
|
|
23457
23446
|
}
|
|
23458
23447
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
23459
23448
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
23460
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23461
|
-
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color:
|
|
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}`)),
|
|
23462
23451
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close \xB7 [Esc] close" })
|
|
23463
23452
|
] });
|
|
23464
23453
|
})(),
|
|
23465
|
-
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
23466
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
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" }),
|
|
23467
23456
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
23468
23457
|
/* @__PURE__ */ jsx27(Text23, { bold: true, children: "Row navigation" }),
|
|
23469
23458
|
/* @__PURE__ */ jsx27(Text23, { children: " \u2191/\u2193 move between rows" }),
|
|
@@ -23488,10 +23477,10 @@ function FieldEditor({
|
|
|
23488
23477
|
/* @__PURE__ */ jsx27(Text23, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
23489
23478
|
/* @__PURE__ */ jsx27(Text23, { children: " ? toggle this overlay" }),
|
|
23490
23479
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
23491
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
23480
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "press ? or Esc to close" })
|
|
23492
23481
|
] }),
|
|
23493
|
-
validationError && /* @__PURE__ */ jsx27(Text23, { color:
|
|
23494
|
-
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
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 }) })
|
|
23495
23484
|
]
|
|
23496
23485
|
}
|
|
23497
23486
|
);
|
|
@@ -23543,16 +23532,16 @@ function RationaleLine({ line, active }) {
|
|
|
23543
23532
|
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { children: " " }) });
|
|
23544
23533
|
}
|
|
23545
23534
|
if (line.kind === "heading") {
|
|
23546
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ?
|
|
23535
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? PALETTE3.info : PALETTE3.muted, children: line.text }) });
|
|
23547
23536
|
}
|
|
23548
23537
|
if (line.kind === "label") {
|
|
23549
23538
|
return /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
23550
23539
|
line.prefix && /* @__PURE__ */ jsx28(Text24, { children: line.prefix }),
|
|
23551
|
-
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color :
|
|
23552
|
-
line.suffix && /* @__PURE__ */ jsx28(Text24, { color:
|
|
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 })
|
|
23553
23542
|
] });
|
|
23554
23543
|
}
|
|
23555
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ?
|
|
23544
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ? PALETTE3.muted : void 0, children: line.text }) });
|
|
23556
23545
|
}
|
|
23557
23546
|
|
|
23558
23547
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx
|
|
@@ -23631,9 +23620,9 @@ function ComponentRationalePanel({
|
|
|
23631
23620
|
width,
|
|
23632
23621
|
height: height + 2,
|
|
23633
23622
|
borderStyle: "single",
|
|
23634
|
-
borderColor: active ?
|
|
23623
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
23635
23624
|
children: [
|
|
23636
|
-
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 :
|
|
23625
|
+
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 : PALETTE3.muted, children: `Component rationale: ${data.name}` }) }),
|
|
23637
23626
|
visible.map((line, i) => /* @__PURE__ */ jsx29(RationaleLine, { line, active }, i)),
|
|
23638
23627
|
/* @__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" }) })
|
|
23639
23628
|
]
|
|
@@ -23648,7 +23637,7 @@ import { Box as Box25 } from "ink";
|
|
|
23648
23637
|
import { Text as Text26 } from "ink";
|
|
23649
23638
|
import { Fragment as Fragment6, jsx as jsx30 } from "react/jsx-runtime";
|
|
23650
23639
|
function HighlightedLine({ parts }) {
|
|
23651
|
-
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ?
|
|
23640
|
+
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ? PALETTE3.muted : part.color, children: part.text }, i)) });
|
|
23652
23641
|
}
|
|
23653
23642
|
|
|
23654
23643
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx
|
|
@@ -23668,10 +23657,10 @@ function ScrollablePanel({
|
|
|
23668
23657
|
const overflowed = totalLines > height;
|
|
23669
23658
|
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
23670
23659
|
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
23671
|
-
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 :
|
|
23660
|
+
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 : PALETTE3.muted, children: title }),
|
|
23672
23661
|
overflowed && /* @__PURE__ */ jsxs25(Fragment7, { children: [
|
|
23673
23662
|
/* @__PURE__ */ jsx31(Box24, { flexGrow: 1 }),
|
|
23674
|
-
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 :
|
|
23663
|
+
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 : PALETTE3.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
23675
23664
|
] })
|
|
23676
23665
|
] }),
|
|
23677
23666
|
children
|
|
@@ -23757,7 +23746,7 @@ function renderRationaleLines(rows, innerWidth) {
|
|
|
23757
23746
|
out.push({
|
|
23758
23747
|
kind: "label",
|
|
23759
23748
|
text: row.name,
|
|
23760
|
-
color:
|
|
23749
|
+
color: PALETTE3.info,
|
|
23761
23750
|
suffix: row.kind === "slot" ? " (slot)" : void 0
|
|
23762
23751
|
});
|
|
23763
23752
|
for (const line of wrapText(row.rationale, innerWidth)) {
|
|
@@ -23793,7 +23782,7 @@ function RationalePanel({
|
|
|
23793
23782
|
totalLines,
|
|
23794
23783
|
visibleStart,
|
|
23795
23784
|
visibleEnd,
|
|
23796
|
-
borderColor: active ?
|
|
23785
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
23797
23786
|
children: visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i))
|
|
23798
23787
|
}
|
|
23799
23788
|
);
|
|
@@ -23828,29 +23817,21 @@ function TokenReviewPanel({
|
|
|
23828
23817
|
width,
|
|
23829
23818
|
height: height + 2,
|
|
23830
23819
|
borderStyle: "single",
|
|
23831
|
-
borderColor: active ?
|
|
23820
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
23832
23821
|
children: [
|
|
23833
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
23834
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
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})` }),
|
|
23835
23824
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
23836
|
-
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
23825
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE3.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
23837
23826
|
visiblePaths.map((path5, i) => {
|
|
23838
23827
|
const pathIndex = scrollStart + i;
|
|
23839
23828
|
const checked = editSelection.has(path5);
|
|
23840
23829
|
const focused = pathIndex === editCursor;
|
|
23841
|
-
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
23842
|
-
Text28,
|
|
23843
|
-
{
|
|
23844
|
-
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
23845
|
-
bold: focused,
|
|
23846
|
-
wrap: "truncate",
|
|
23847
|
-
children: ` [${checked ? "x" : " "}] ${path5}`
|
|
23848
|
-
}
|
|
23849
|
-
) }, path5);
|
|
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);
|
|
23850
23831
|
}),
|
|
23851
23832
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
23852
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23853
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
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" })
|
|
23854
23835
|
]
|
|
23855
23836
|
}
|
|
23856
23837
|
);
|
|
@@ -23862,16 +23843,16 @@ function TokenReviewPanel({
|
|
|
23862
23843
|
width,
|
|
23863
23844
|
height: height + 2,
|
|
23864
23845
|
borderStyle: "single",
|
|
23865
|
-
borderColor: active ?
|
|
23846
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
23866
23847
|
children: [
|
|
23867
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
23868
|
-
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
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)" }),
|
|
23869
23850
|
suggestions.map((s, i) => {
|
|
23870
23851
|
const focused = i === selectedRow;
|
|
23871
23852
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
23872
|
-
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ?
|
|
23873
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
23874
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
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(", ")}` })
|
|
23875
23856
|
] }, s.propName);
|
|
23876
23857
|
}),
|
|
23877
23858
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
@@ -23956,9 +23937,9 @@ function ReviewDetailsPanel({
|
|
|
23956
23937
|
const sourceLineCount = Math.max(1, height - 4);
|
|
23957
23938
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
23958
23939
|
return /* @__PURE__ */ jsxs27(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
23959
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
23960
|
-
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color:
|
|
23961
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
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" })
|
|
23962
23943
|
] });
|
|
23963
23944
|
}
|
|
23964
23945
|
if (panelOpen === "token-review") {
|
|
@@ -24108,17 +24089,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
24108
24089
|
hidden
|
|
24109
24090
|
}) {
|
|
24110
24091
|
if (hidden || count === 0) return null;
|
|
24111
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
24092
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
24112
24093
|
}
|
|
24113
24094
|
function ReviewNoSelection() {
|
|
24114
|
-
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
24095
|
+
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.muted, children: "No component selected" }) });
|
|
24115
24096
|
}
|
|
24116
24097
|
function ReviewFinalizeError({
|
|
24117
24098
|
message,
|
|
24118
24099
|
hidden
|
|
24119
24100
|
}) {
|
|
24120
24101
|
if (hidden || !message) return null;
|
|
24121
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
24102
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.error, children: `\u26A0 ${message}` });
|
|
24122
24103
|
}
|
|
24123
24104
|
function ReviewPanelFooter({
|
|
24124
24105
|
reviewEditor,
|
|
@@ -24142,7 +24123,7 @@ function ReviewComponentTitle({
|
|
|
24142
24123
|
return /* @__PURE__ */ jsxs28(Box27, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
24143
24124
|
/* @__PURE__ */ jsx37(Text30, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
24144
24125
|
/* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
|
|
24145
|
-
/* @__PURE__ */ jsxs28(Text30, { color:
|
|
24126
|
+
/* @__PURE__ */ jsxs28(Text30, { color: PALETTE3.muted, wrap: "truncate-end", children: [
|
|
24146
24127
|
propCount,
|
|
24147
24128
|
" prop",
|
|
24148
24129
|
propCount !== 1 ? "s" : "",
|
|
@@ -24198,8 +24179,8 @@ function ReviewComponentPanel({
|
|
|
24198
24179
|
)
|
|
24199
24180
|
}
|
|
24200
24181
|
) }),
|
|
24201
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ?
|
|
24202
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
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(
|
|
24203
24184
|
ReviewPanelFooter,
|
|
24204
24185
|
{
|
|
24205
24186
|
reviewEditor,
|
|
@@ -24227,11 +24208,11 @@ function countReviewStatuses(entries) {
|
|
|
24227
24208
|
);
|
|
24228
24209
|
}
|
|
24229
24210
|
function ReviewLoadingState() {
|
|
24230
|
-
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color:
|
|
24211
|
+
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color: PALETTE3.muted, children: "Loading generated definitions..." }) });
|
|
24231
24212
|
}
|
|
24232
24213
|
function ReviewLoadError({ message }) {
|
|
24233
24214
|
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
24234
|
-
/* @__PURE__ */ jsx38(Text31, { color:
|
|
24215
|
+
/* @__PURE__ */ jsx38(Text31, { color: PALETTE3.error, children: message }),
|
|
24235
24216
|
/* @__PURE__ */ jsx38(Text31, { children: " " }),
|
|
24236
24217
|
/* @__PURE__ */ jsx38(Text31, { children: "[q / Enter / Esc] Quit" })
|
|
24237
24218
|
] });
|
|
@@ -24467,41 +24448,41 @@ function FinalizeDialog({
|
|
|
24467
24448
|
/* @__PURE__ */ jsx39(Text32, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
|
|
24468
24449
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24469
24450
|
/* @__PURE__ */ jsxs30(Text32, { children: [
|
|
24470
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24451
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.success, children: [
|
|
24471
24452
|
accepted,
|
|
24472
24453
|
" accepted"
|
|
24473
24454
|
] }),
|
|
24474
24455
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
24475
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24456
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.error, children: [
|
|
24476
24457
|
rejected,
|
|
24477
24458
|
" rejected"
|
|
24478
24459
|
] }),
|
|
24479
24460
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
24480
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
24461
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.muted, children: [
|
|
24481
24462
|
needsReview,
|
|
24482
24463
|
" unresolved"
|
|
24483
24464
|
] })
|
|
24484
24465
|
] }),
|
|
24485
24466
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
24486
24467
|
noneAccepted && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24487
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
24488
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
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." }),
|
|
24489
24470
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24490
24471
|
] }),
|
|
24491
24472
|
!allResolved && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24492
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
24493
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
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." }),
|
|
24494
24475
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24495
24476
|
] }),
|
|
24496
24477
|
/* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", height: 2, children: [
|
|
24497
|
-
previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color:
|
|
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: " " }),
|
|
24498
24479
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24499
24480
|
] }),
|
|
24500
24481
|
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
24501
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
24502
|
-
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color:
|
|
24503
|
-
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color:
|
|
24504
|
-
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color:
|
|
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" }),
|
|
24505
24486
|
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx39(Text32, { children: "[\u2191\u2193] scroll deletions" }),
|
|
24506
24487
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
24507
24488
|
] }),
|
|
@@ -24995,8 +24976,8 @@ function ReviewStepDialogs({
|
|
|
24995
24976
|
}
|
|
24996
24977
|
function ReviewReloadDialog({ open }) {
|
|
24997
24978
|
if (!open) return null;
|
|
24998
|
-
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
24999
|
-
/* @__PURE__ */ jsx41(Text34, { bold: true, color:
|
|
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?" }),
|
|
25000
24981
|
/* @__PURE__ */ jsx41(Text34, { children: "Unsaved in-memory changes will be lost." }),
|
|
25001
24982
|
/* @__PURE__ */ jsx41(Text34, { children: " " }),
|
|
25002
24983
|
/* @__PURE__ */ jsx41(Text34, { children: " [Enter] Confirm" }),
|
|
@@ -25382,19 +25363,19 @@ function LivePreviewSummary({
|
|
|
25382
25363
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
25383
25364
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
25384
25365
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
25385
|
-
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
25386
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
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...` });
|
|
25387
25368
|
if (!hasCounts) return null;
|
|
25388
25369
|
return /* @__PURE__ */ jsxs33(Box32, { children: [
|
|
25389
25370
|
/* @__PURE__ */ jsx42(Text35, { children: "Preview: " }),
|
|
25390
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25371
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.success, children: `${counts.new} new` }),
|
|
25391
25372
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25392
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25373
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.warning, children: `${counts.changed} changed` }),
|
|
25393
25374
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25394
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25375
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.muted, children: `${counts.removed} removed` }),
|
|
25395
25376
|
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx42(Text35, { children: " ([d] removed list)" }),
|
|
25396
25377
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
25397
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
25378
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.error, bold: true, children: `${counts.breaking} breaking` })
|
|
25398
25379
|
] });
|
|
25399
25380
|
}
|
|
25400
25381
|
|
|
@@ -25440,10 +25421,10 @@ function CyclePathLine({
|
|
|
25440
25421
|
highlightComponents = false,
|
|
25441
25422
|
highlightLine = false
|
|
25442
25423
|
}) {
|
|
25443
|
-
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ?
|
|
25424
|
+
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ? PALETTE3.warning : void 0, children: [
|
|
25444
25425
|
prefix,
|
|
25445
25426
|
segments.map(
|
|
25446
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
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)
|
|
25447
25428
|
)
|
|
25448
25429
|
] });
|
|
25449
25430
|
}
|
|
@@ -25455,9 +25436,9 @@ function CycleDetailPanel({
|
|
|
25455
25436
|
height
|
|
25456
25437
|
}) {
|
|
25457
25438
|
const lines = [
|
|
25458
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
25459
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25460
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
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"),
|
|
25461
25442
|
/* @__PURE__ */ jsx43(Text36, { children: " " }, "cyc-space")
|
|
25462
25443
|
];
|
|
25463
25444
|
cycles.forEach((cycle, index) => {
|
|
@@ -25469,7 +25450,7 @@ function CycleDetailPanel({
|
|
|
25469
25450
|
);
|
|
25470
25451
|
if (cycle.suggestedBreak) {
|
|
25471
25452
|
lines.push(
|
|
25472
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25453
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
25473
25454
|
);
|
|
25474
25455
|
}
|
|
25475
25456
|
lines.push(/* @__PURE__ */ jsx43(Text36, { children: " " }, `cyc-s-${index}`));
|
|
@@ -25477,9 +25458,9 @@ function CycleDetailPanel({
|
|
|
25477
25458
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
25478
25459
|
const viewportHeight = Math.max(1, height - 3);
|
|
25479
25460
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
25480
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
25461
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE3.warning, paddingLeft: 1, children: [
|
|
25481
25462
|
visible,
|
|
25482
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25463
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: footer })
|
|
25483
25464
|
] });
|
|
25484
25465
|
}
|
|
25485
25466
|
function BreakCyclePanel({
|
|
@@ -25490,14 +25471,14 @@ function BreakCyclePanel({
|
|
|
25490
25471
|
width,
|
|
25491
25472
|
height
|
|
25492
25473
|
}) {
|
|
25493
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
25494
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
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" }),
|
|
25495
25476
|
cycle && /* @__PURE__ */ jsx43(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
|
|
25496
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
25477
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
25497
25478
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
25498
|
-
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
25479
|
+
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: "remove slot edge:" }),
|
|
25499
25480
|
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}`)),
|
|
25500
|
-
confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
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" })
|
|
25501
25482
|
] });
|
|
25502
25483
|
}
|
|
25503
25484
|
var HELP_SECTIONS2 = [
|
|
@@ -25603,7 +25584,7 @@ function deriveBreakingChanges(response) {
|
|
|
25603
25584
|
}
|
|
25604
25585
|
function GenerateReviewStep(props) {
|
|
25605
25586
|
if (!props.extractSessionId) {
|
|
25606
|
-
return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color:
|
|
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." }) });
|
|
25607
25588
|
}
|
|
25608
25589
|
return /* @__PURE__ */ jsx43(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
25609
25590
|
}
|
|
@@ -26520,8 +26501,8 @@ function GenerateReviewStepView({
|
|
|
26520
26501
|
}
|
|
26521
26502
|
),
|
|
26522
26503
|
/* @__PURE__ */ jsx43(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
26523
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26524
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
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) }),
|
|
26525
26506
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs34(Fragment13, { children: [
|
|
26526
26507
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
26527
26508
|
removedComponents.map((rc) => /* @__PURE__ */ jsx43(Text36, { children: removedComponentLine(rc) }, rc.id))
|
|
@@ -26530,7 +26511,7 @@ function GenerateReviewStepView({
|
|
|
26530
26511
|
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx43(Box33, { paddingX: 1, children: /* @__PURE__ */ jsx43(
|
|
26531
26512
|
Text36,
|
|
26532
26513
|
{
|
|
26533
|
-
color:
|
|
26514
|
+
color: PALETTE3.warning,
|
|
26534
26515
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
26535
26516
|
}
|
|
26536
26517
|
) }),
|
|
@@ -26538,10 +26519,10 @@ function GenerateReviewStepView({
|
|
|
26538
26519
|
const row = breakingRows[breakingCursor];
|
|
26539
26520
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
26540
26521
|
if (!comp) return null;
|
|
26541
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26542
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
26543
|
-
comp.impact && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26544
|
-
comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
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}`)),
|
|
26545
26526
|
/* @__PURE__ */ jsx43(Text36, { children: "[D/Esc] close detail" })
|
|
26546
26527
|
] });
|
|
26547
26528
|
})(),
|
|
@@ -26564,11 +26545,11 @@ function GenerateReviewStepView({
|
|
|
26564
26545
|
const participantSet = cycleView.structural;
|
|
26565
26546
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
26566
26547
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
26567
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor:
|
|
26568
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26569
|
-
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26570
|
-
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26571
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
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" })
|
|
26572
26553
|
] });
|
|
26573
26554
|
})(),
|
|
26574
26555
|
/* @__PURE__ */ jsx43(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
@@ -26684,7 +26665,7 @@ function GenerateReviewStepView({
|
|
|
26684
26665
|
) : /* @__PURE__ */ jsx43(ReviewNoSelection, {})
|
|
26685
26666
|
] }),
|
|
26686
26667
|
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", children: [
|
|
26687
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
26668
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
26688
26669
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
26689
26670
|
return /* @__PURE__ */ jsx43(
|
|
26690
26671
|
CyclePathLine,
|
|
@@ -26697,7 +26678,7 @@ function GenerateReviewStepView({
|
|
|
26697
26678
|
`cyc-banner-${idx}`
|
|
26698
26679
|
);
|
|
26699
26680
|
}),
|
|
26700
|
-
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
26681
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
26701
26682
|
/* @__PURE__ */ jsx43(Text36, { children: " press [c] for detail" })
|
|
26702
26683
|
] }),
|
|
26703
26684
|
/* @__PURE__ */ jsx43(
|
|
@@ -26720,8 +26701,8 @@ import { Box as Box34, Text as Text37 } from "ink";
|
|
|
26720
26701
|
|
|
26721
26702
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts
|
|
26722
26703
|
import { defaultTheme as defaultTheme2, extendTheme as extendTheme2 } from "@inkjs/ui";
|
|
26723
|
-
var
|
|
26724
|
-
...
|
|
26704
|
+
var PALETTE4 = {
|
|
26705
|
+
...PALETTE3,
|
|
26725
26706
|
link: "#58A6FF"
|
|
26726
26707
|
};
|
|
26727
26708
|
var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
@@ -26729,7 +26710,7 @@ var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
|
26729
26710
|
ProgressBar: {
|
|
26730
26711
|
styles: {
|
|
26731
26712
|
completed: () => ({
|
|
26732
|
-
color:
|
|
26713
|
+
color: "blue"
|
|
26733
26714
|
})
|
|
26734
26715
|
}
|
|
26735
26716
|
}
|
|
@@ -26740,13 +26721,13 @@ var INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
|
26740
26721
|
import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
26741
26722
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
26742
26723
|
if (!generatePromptPath) return null;
|
|
26743
|
-
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
26744
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
26745
|
-
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color:
|
|
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: [
|
|
26746
26727
|
"components: ",
|
|
26747
26728
|
generatePromptPath
|
|
26748
26729
|
] }) : null,
|
|
26749
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
26730
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE4.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
|
|
26750
26731
|
] });
|
|
26751
26732
|
}
|
|
26752
26733
|
|
|
@@ -26771,10 +26752,10 @@ import { Box as Box35, Text as Text38 } from "ink";
|
|
|
26771
26752
|
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
26772
26753
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
26773
26754
|
return /* @__PURE__ */ jsxs36(Box35, { gap: 1, marginTop: 1, children: [
|
|
26774
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26755
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "Space:" }),
|
|
26775
26756
|
/* @__PURE__ */ jsx45(Text38, { children: spaceId }),
|
|
26776
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26777
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
26757
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "/" }),
|
|
26758
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "Environment:" }),
|
|
26778
26759
|
/* @__PURE__ */ jsx45(Text38, { children: environmentId })
|
|
26779
26760
|
] });
|
|
26780
26761
|
}
|
|
@@ -26786,13 +26767,13 @@ function EntityRows({ entity, label }) {
|
|
|
26786
26767
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
26787
26768
|
return /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
26788
26769
|
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs37(Text39, { children: [
|
|
26789
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26770
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.success, children: "\u2713" }),
|
|
26790
26771
|
" ",
|
|
26791
26772
|
plural3(entity[action]),
|
|
26792
26773
|
" ",
|
|
26793
26774
|
action
|
|
26794
26775
|
] }, action)),
|
|
26795
|
-
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26776
|
+
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
|
|
26796
26777
|
"\u2717 ",
|
|
26797
26778
|
plural3(entity.failed),
|
|
26798
26779
|
" failed \u2014 check logs above"
|
|
@@ -26801,8 +26782,8 @@ function EntityRows({ entity, label }) {
|
|
|
26801
26782
|
}
|
|
26802
26783
|
function LinkRow({ title, url }) {
|
|
26803
26784
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26804
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26805
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26785
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.muted, children: title }),
|
|
26786
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.link, children: url })
|
|
26806
26787
|
] });
|
|
26807
26788
|
}
|
|
26808
26789
|
function DoneStep({
|
|
@@ -26825,17 +26806,17 @@ function DoneStep({
|
|
|
26825
26806
|
const success = totalFailed === 0;
|
|
26826
26807
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
26827
26808
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
26828
|
-
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
26829
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color:
|
|
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: [
|
|
26830
26811
|
/* @__PURE__ */ jsx46(EntityRows, { entity: componentTypes, label: "Component Type" }),
|
|
26831
26812
|
/* @__PURE__ */ jsx46(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
26832
|
-
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26813
|
+
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.muted, children: [
|
|
26833
26814
|
"Push result: ",
|
|
26834
26815
|
summary.succeeded,
|
|
26835
26816
|
"/",
|
|
26836
26817
|
summary.total,
|
|
26837
26818
|
" succeeded",
|
|
26838
|
-
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26819
|
+
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
|
|
26839
26820
|
", ",
|
|
26840
26821
|
summary.failed,
|
|
26841
26822
|
" failed"
|
|
@@ -26843,8 +26824,8 @@ function DoneStep({
|
|
|
26843
26824
|
] }) })
|
|
26844
26825
|
] }),
|
|
26845
26826
|
failures.length > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
26846
|
-
/* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
26847
|
-
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color:
|
|
26827
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE4.error, children: "Failure details" }),
|
|
26828
|
+
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
|
|
26848
26829
|
failure.entityType,
|
|
26849
26830
|
" ",
|
|
26850
26831
|
failure.entityId,
|
|
@@ -26854,7 +26835,7 @@ function DoneStep({
|
|
|
26854
26835
|
] }),
|
|
26855
26836
|
/* @__PURE__ */ jsx46(SpaceEnvironment, { spaceId, environmentId }),
|
|
26856
26837
|
success && totalPushed > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, children: [
|
|
26857
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
26838
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.success, children: "Your design system is now in Contentful Experiences." }),
|
|
26858
26839
|
/* @__PURE__ */ jsx46(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
26859
26840
|
/* @__PURE__ */ jsx46(
|
|
26860
26841
|
LinkRow,
|
|
@@ -26968,7 +26949,7 @@ function PathPrompt({
|
|
|
26968
26949
|
label,
|
|
26969
26950
|
":"
|
|
26970
26951
|
] }),
|
|
26971
|
-
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ?
|
|
26952
|
+
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ? PALETTE4.muted : void 0, children: shown }),
|
|
26972
26953
|
/* @__PURE__ */ jsx47(Text40, { children: cursor })
|
|
26973
26954
|
] }),
|
|
26974
26955
|
/* @__PURE__ */ jsxs38(Box37, { gap: 3, children: [
|
|
@@ -27034,12 +27015,12 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
27034
27015
|
/* @__PURE__ */ jsx50(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
|
|
27035
27016
|
/* @__PURE__ */ jsx50(Text42, { children: "Writing component types and design tokens to your Contentful space..." }),
|
|
27036
27017
|
operationId && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
27037
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
27018
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE4.muted, children: "Operation:" }),
|
|
27038
27019
|
/* @__PURE__ */ jsx50(Text42, { children: operationId })
|
|
27039
27020
|
] }),
|
|
27040
27021
|
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx50(Box39, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs40(Box39, { gap: 2, children: [
|
|
27041
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) }) }) }),
|
|
27042
|
-
/* @__PURE__ */ jsxs40(Text42, { color:
|
|
27023
|
+
/* @__PURE__ */ jsxs40(Text42, { color: PALETTE4.muted, children: [
|
|
27043
27024
|
progress.processed,
|
|
27044
27025
|
"/",
|
|
27045
27026
|
progress.total,
|
|
@@ -27047,10 +27028,10 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
27047
27028
|
] })
|
|
27048
27029
|
] }) }),
|
|
27049
27030
|
showCurrent && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
27050
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
27031
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE4.muted, children: "Now processing:" }),
|
|
27051
27032
|
/* @__PURE__ */ jsx50(Text42, { children: showCurrent })
|
|
27052
27033
|
] }),
|
|
27053
|
-
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color:
|
|
27034
|
+
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE4.muted, children: [
|
|
27054
27035
|
"Elapsed: ",
|
|
27055
27036
|
elapsed
|
|
27056
27037
|
] }) })
|
|
@@ -27240,25 +27221,25 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27240
27221
|
if (components.new.length > 0) {
|
|
27241
27222
|
lines.push({
|
|
27242
27223
|
key: "summary-components-new",
|
|
27243
|
-
color:
|
|
27224
|
+
color: PALETTE4.success,
|
|
27244
27225
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
27245
27226
|
});
|
|
27246
27227
|
for (const [index, item] of components.new.entries()) {
|
|
27247
27228
|
const name = item.key ?? item.$name ?? "unknown";
|
|
27248
|
-
lines.push({ key: `summary-components-new-${index}`, color:
|
|
27229
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE4.success, text: ` + ${name}` });
|
|
27249
27230
|
}
|
|
27250
27231
|
}
|
|
27251
27232
|
if (components.changed.length > 0) {
|
|
27252
27233
|
lines.push({
|
|
27253
27234
|
key: "summary-components-changed",
|
|
27254
|
-
color:
|
|
27235
|
+
color: PALETTE4.warning,
|
|
27255
27236
|
text: ` \uFF5E ${components.changed.length} components will be updated`
|
|
27256
27237
|
});
|
|
27257
27238
|
for (const [index, item] of components.changed.entries()) {
|
|
27258
27239
|
const isBreaking = item.changeClassification?.classification === "breaking";
|
|
27259
27240
|
lines.push({
|
|
27260
27241
|
key: `summary-components-changed-${index}`,
|
|
27261
|
-
color: isBreaking ?
|
|
27242
|
+
color: isBreaking ? PALETTE4.error : PALETTE4.warning,
|
|
27262
27243
|
text: ` ${isBreaking ? "\u26A0" : "~"} ${item.current.name}`
|
|
27263
27244
|
});
|
|
27264
27245
|
}
|
|
@@ -27266,11 +27247,11 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27266
27247
|
if (components.removed.length > 0) {
|
|
27267
27248
|
lines.push({
|
|
27268
27249
|
key: "summary-components-removed",
|
|
27269
|
-
color:
|
|
27250
|
+
color: PALETTE4.warning,
|
|
27270
27251
|
text: ` \u2298 ${components.removed.length} components will be skipped`
|
|
27271
27252
|
});
|
|
27272
27253
|
for (const [index, item] of components.removed.entries()) {
|
|
27273
|
-
lines.push({ key: `summary-components-removed-${index}`, color:
|
|
27254
|
+
lines.push({ key: `summary-components-removed-${index}`, color: PALETTE4.warning, text: ` \u2298 ${item.name}` });
|
|
27274
27255
|
}
|
|
27275
27256
|
}
|
|
27276
27257
|
if (components.unchanged.length > 0) {
|
|
@@ -27283,21 +27264,21 @@ function buildPreviewSummaryLines(preview) {
|
|
|
27283
27264
|
if (tokens.new.length > 0) {
|
|
27284
27265
|
lines.push({
|
|
27285
27266
|
key: "summary-tokens-new",
|
|
27286
|
-
color:
|
|
27267
|
+
color: PALETTE4.success,
|
|
27287
27268
|
text: ` \uFF0B ${tokens.new.length} design tokens will be created`
|
|
27288
27269
|
});
|
|
27289
27270
|
}
|
|
27290
27271
|
if (tokens.changed.length > 0) {
|
|
27291
27272
|
lines.push({
|
|
27292
27273
|
key: "summary-tokens-changed",
|
|
27293
|
-
color:
|
|
27274
|
+
color: PALETTE4.warning,
|
|
27294
27275
|
text: ` \uFF5E ${tokens.changed.length} design tokens will be updated`
|
|
27295
27276
|
});
|
|
27296
27277
|
}
|
|
27297
27278
|
if (tokens.removed.length > 0) {
|
|
27298
27279
|
lines.push({
|
|
27299
27280
|
key: "summary-tokens-removed",
|
|
27300
|
-
color:
|
|
27281
|
+
color: PALETTE4.warning,
|
|
27301
27282
|
text: ` \u2298 ${tokens.removed.length} design tokens will be skipped`
|
|
27302
27283
|
});
|
|
27303
27284
|
}
|
|
@@ -27341,12 +27322,12 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
27341
27322
|
function appendChangedPreviewLine(lines, keyPrefix, name, hasPendingDraftChanges, changeClassification) {
|
|
27342
27323
|
lines.push({
|
|
27343
27324
|
key: `${keyPrefix}-h-${name}`,
|
|
27344
|
-
color:
|
|
27325
|
+
color: PALETTE4.warning,
|
|
27345
27326
|
text: ` ~ ${name}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
27346
27327
|
});
|
|
27347
27328
|
if (changeClassification?.classification !== "breaking") return;
|
|
27348
27329
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
27349
|
-
lines.push({ key: `${keyPrefix}-b-${name}`, color:
|
|
27330
|
+
lines.push({ key: `${keyPrefix}-b-${name}`, color: PALETTE4.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
27350
27331
|
}
|
|
27351
27332
|
function buildPreviewDiffLines(preview) {
|
|
27352
27333
|
const lines = [];
|
|
@@ -27354,12 +27335,12 @@ function buildPreviewDiffLines(preview) {
|
|
|
27354
27335
|
for (const item of components.new) {
|
|
27355
27336
|
const raw = item;
|
|
27356
27337
|
const name = raw.key ?? raw.$name ?? "unknown";
|
|
27357
|
-
lines.push({ key: `comp-new-${name}`, color:
|
|
27338
|
+
lines.push({ key: `comp-new-${name}`, color: PALETTE4.success, text: ` + ${name}` });
|
|
27358
27339
|
const slots = raw.$slots ?? {};
|
|
27359
27340
|
for (const slotName of Object.keys(slots).sort()) {
|
|
27360
27341
|
lines.push({
|
|
27361
27342
|
key: `comp-new-${name}-slot-${slotName}`,
|
|
27362
|
-
color:
|
|
27343
|
+
color: PALETTE4.success,
|
|
27363
27344
|
text: ` slot: ${slotName}`
|
|
27364
27345
|
});
|
|
27365
27346
|
const allowed = slots[slotName]?.["$allowedComponents"];
|
|
@@ -27367,14 +27348,14 @@ function buildPreviewDiffLines(preview) {
|
|
|
27367
27348
|
const names = allowed.filter((n) => typeof n === "string");
|
|
27368
27349
|
lines.push({
|
|
27369
27350
|
key: `comp-new-${name}-slot-${slotName}-allow`,
|
|
27370
|
-
color:
|
|
27351
|
+
color: PALETTE4.success,
|
|
27371
27352
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
27372
27353
|
});
|
|
27373
27354
|
}
|
|
27374
27355
|
}
|
|
27375
27356
|
}
|
|
27376
27357
|
for (const item of components.removed) {
|
|
27377
|
-
lines.push({ key: `comp-rm-${item.name}`, color:
|
|
27358
|
+
lines.push({ key: `comp-rm-${item.name}`, color: PALETTE4.error, text: ` - ${item.name}` });
|
|
27378
27359
|
}
|
|
27379
27360
|
for (const item of components.changed) {
|
|
27380
27361
|
appendChangedPreviewLine(lines, "comp", item.current.name, item.hasPendingDraftChanges, item.changeClassification);
|
|
@@ -27405,10 +27386,10 @@ function buildPreviewDiffLines(preview) {
|
|
|
27405
27386
|
for (const item of tokens.new) {
|
|
27406
27387
|
const raw = item;
|
|
27407
27388
|
const name = raw.name ?? raw.path ?? "unknown";
|
|
27408
|
-
lines.push({ key: `tok-new-${name}`, color:
|
|
27389
|
+
lines.push({ key: `tok-new-${name}`, color: PALETTE4.success, text: ` + ${name}` });
|
|
27409
27390
|
}
|
|
27410
27391
|
for (const item of tokens.removed) {
|
|
27411
|
-
lines.push({ key: `tok-rm-${item.name}`, color:
|
|
27392
|
+
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE4.error, text: ` - ${item.name}` });
|
|
27412
27393
|
}
|
|
27413
27394
|
for (const item of tokens.changed) {
|
|
27414
27395
|
const tokenName = item.current.name;
|
|
@@ -27499,13 +27480,13 @@ function WizardPreviewStep({
|
|
|
27499
27480
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
27500
27481
|
focused: false,
|
|
27501
27482
|
children: [
|
|
27502
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ?
|
|
27503
|
-
/* @__PURE__ */ jsx51(Text43, { color:
|
|
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) })
|
|
27504
27485
|
]
|
|
27505
27486
|
}
|
|
27506
27487
|
)
|
|
27507
|
-
] }) : /* @__PURE__ */ jsx51(Text43, { color:
|
|
27508
|
-
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color:
|
|
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." }) }),
|
|
27509
27490
|
/* @__PURE__ */ jsx51(SpaceEnvironment, { spaceId, environmentId }),
|
|
27510
27491
|
/* @__PURE__ */ jsxs41(Box40, { gap: 3, marginTop: 1, children: [
|
|
27511
27492
|
/* @__PURE__ */ jsx51(Text43, { children: "[Enter] Push to Contentful" }),
|
|
@@ -28051,7 +28032,7 @@ var realSaveDeps = () => ({
|
|
|
28051
28032
|
writeFile: (path5, contents) => writeFile7(path5, contents),
|
|
28052
28033
|
appendRun,
|
|
28053
28034
|
buildSourceFingerprint,
|
|
28054
|
-
sleep: (ms) => new Promise((
|
|
28035
|
+
sleep: (ms) => new Promise((resolve28) => setTimeout(resolve28, ms)),
|
|
28055
28036
|
warn: (message) => process.stderr.write(message)
|
|
28056
28037
|
});
|
|
28057
28038
|
async function runPrintFiles(input, deps, onPatch) {
|
|
@@ -28441,12 +28422,44 @@ init_config();
|
|
|
28441
28422
|
init_debug_store();
|
|
28442
28423
|
init_debug_mode_store();
|
|
28443
28424
|
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
|
|
28444
28448
|
async function readHelpInfo() {
|
|
28445
|
-
const debugMode = await readDebugModeSetting();
|
|
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
|
+
});
|
|
28446
28456
|
return {
|
|
28447
28457
|
storage: [
|
|
28448
28458
|
{ label: "Config folder", value: configRoot2() },
|
|
28449
|
-
{ label: "Settings file", value: configFilePath2() }
|
|
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 }
|
|
28450
28463
|
],
|
|
28451
28464
|
troubleshooting: [
|
|
28452
28465
|
{ label: "CLI version", value: readPackageVersion() },
|
|
@@ -28467,7 +28480,7 @@ function Section({ title, rows }) {
|
|
|
28467
28480
|
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
28468
28481
|
/* @__PURE__ */ jsx53(Text44, { bold: true, color: PALETTE.accent, children: title }),
|
|
28469
28482
|
rows.map((row) => /* @__PURE__ */ jsxs43(Box42, { gap: 1, children: [
|
|
28470
|
-
/* @__PURE__ */ jsx53(Box42, { width:
|
|
28483
|
+
/* @__PURE__ */ jsx53(Box42, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: row.label }) }),
|
|
28471
28484
|
/* @__PURE__ */ jsx53(Text44, { children: row.value })
|
|
28472
28485
|
] }, row.label))
|
|
28473
28486
|
] });
|
|
@@ -28567,200 +28580,721 @@ function SettingsScreen({
|
|
|
28567
28580
|
}
|
|
28568
28581
|
|
|
28569
28582
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28570
|
-
import {
|
|
28571
|
-
import { Box as
|
|
28572
|
-
|
|
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();
|
|
28573
28590
|
|
|
28574
28591
|
// packages/experience-design-system-cli/src/tui/settings/utils/v1-store.ts
|
|
28575
28592
|
init_config();
|
|
28576
28593
|
var readV1Store = readSettings2;
|
|
28577
28594
|
var writeV1Store = writeSettings2;
|
|
28578
28595
|
|
|
28579
|
-
// packages/experience-design-system-cli/src/tui/settings/
|
|
28580
|
-
|
|
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() {
|
|
28581
28617
|
const store = await readV1Store();
|
|
28582
|
-
|
|
28583
|
-
|
|
28584
|
-
|
|
28585
|
-
|
|
28586
|
-
|
|
28587
|
-
|
|
28588
|
-
|
|
28589
|
-
|
|
28590
|
-
|
|
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 };
|
|
28591
28635
|
}
|
|
28592
|
-
async function
|
|
28636
|
+
async function writeAgentConfig(config) {
|
|
28593
28637
|
const existing = await readV1Store();
|
|
28594
|
-
const merged = {
|
|
28595
|
-
|
|
28596
|
-
|
|
28597
|
-
|
|
28598
|
-
|
|
28599
|
-
if (
|
|
28600
|
-
}
|
|
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"];
|
|
28601
28651
|
await writeV1Store(merged);
|
|
28602
28652
|
}
|
|
28603
28653
|
|
|
28604
|
-
// packages/experience-design-system-cli/src/tui/settings/
|
|
28605
|
-
|
|
28606
|
-
import {
|
|
28607
|
-
var
|
|
28608
|
-
|
|
28609
|
-
|
|
28610
|
-
|
|
28611
|
-
"
|
|
28612
|
-
"
|
|
28613
|
-
"
|
|
28614
|
-
"
|
|
28615
|
-
|
|
28616
|
-
|
|
28617
|
-
|
|
28618
|
-
|
|
28619
|
-
|
|
28620
|
-
|
|
28621
|
-
|
|
28622
|
-
|
|
28623
|
-
|
|
28624
|
-
|
|
28625
|
-
|
|
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
|
+
});
|
|
28626
28697
|
}
|
|
28627
|
-
|
|
28628
|
-
|
|
28629
|
-
|
|
28630
|
-
|
|
28631
|
-
|
|
28632
|
-
|
|
28633
|
-
|
|
28634
|
-
|
|
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) return [...checks, fail3("prompt", `no answer within ${PROMPT_TIMEOUT_MS / 1e3}s`)];
|
|
28739
|
+
if (result.exitCode !== 0) {
|
|
28740
|
+
const reason = result.stderr.trim().split("\n").pop()?.slice(0, 160) || `exited with code ${result.exitCode}`;
|
|
28741
|
+
return [...checks, fail3("prompt", reason)];
|
|
28742
|
+
}
|
|
28743
|
+
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
28744
|
+
}
|
|
28745
|
+
function statusFromChecks(name, checks, savedBinary) {
|
|
28746
|
+
if (checks.length === 0) return "checking";
|
|
28747
|
+
if (checks.some((check) => check.step === "path" && !check.ok)) {
|
|
28748
|
+
return savedBinary.trim() ? "not-found" : "not-configured";
|
|
28749
|
+
}
|
|
28750
|
+
const login = checks.find((check) => check.step === "login");
|
|
28751
|
+
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
28752
|
+
const prompt = checks.find((check) => check.step === "prompt");
|
|
28753
|
+
if (prompt) return prompt.ok ? "ready" : "not-logged-in";
|
|
28754
|
+
return name === "claude" ? "ready" : "unknown";
|
|
28755
|
+
}
|
|
28756
|
+
function setupHint(name, status) {
|
|
28757
|
+
if (status === "not-configured") return `${INSTALL_HINTS[name]}, or set its command path in settings`;
|
|
28758
|
+
if (status === "not-found") return `${INSTALL_HINTS[name]}, or correct the command path in settings`;
|
|
28759
|
+
if (status === "not-logged-in") return LOGIN_HINTS[name];
|
|
28760
|
+
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
28761
|
+
return "";
|
|
28762
|
+
}
|
|
28763
|
+
var LIST_STATUS = {
|
|
28764
|
+
checking: { symbol: "\u2026", text: "checking", tone: "muted" },
|
|
28765
|
+
ready: { symbol: "\u25CF", text: "ready", tone: "ok" },
|
|
28766
|
+
"not-configured": { symbol: "\u25CB", text: "not installed", tone: "muted" },
|
|
28767
|
+
"not-found": { symbol: "\u25CB", text: "not installed", tone: "bad" },
|
|
28768
|
+
"not-logged-in": { symbol: "\u25D0", text: "not logged in", tone: "bad" },
|
|
28769
|
+
unknown: { symbol: "\u25D0", text: "installed, login unknown", tone: "muted" }
|
|
28635
28770
|
};
|
|
28636
|
-
|
|
28637
|
-
|
|
28771
|
+
function modelLine(name, savedModel) {
|
|
28772
|
+
const model = savedModel.trim();
|
|
28773
|
+
return model ? model : `${defaultModelLabel(name)} (built-in default)`;
|
|
28774
|
+
}
|
|
28775
|
+
function panelRows(name, checks, settings) {
|
|
28776
|
+
if (!checks) return [{ label: "Command", value: "checking...", tone: "muted" }];
|
|
28777
|
+
const status = statusFromChecks(name, checks, settings.binary);
|
|
28778
|
+
const path5 = checks.find((check) => check.step === "path");
|
|
28779
|
+
if (!path5?.ok) {
|
|
28780
|
+
const rows2 = [
|
|
28781
|
+
{
|
|
28782
|
+
label: "Command",
|
|
28783
|
+
value: settings.binary.trim() ? path5?.detail ?? "not found" : "not found on your PATH",
|
|
28784
|
+
tone: settings.binary.trim() ? "bad" : "muted"
|
|
28785
|
+
}
|
|
28786
|
+
];
|
|
28787
|
+
const hint2 = setupHint(name, status);
|
|
28788
|
+
if (hint2) rows2.push({ label: "Setup", value: hint2, tone: "muted" });
|
|
28789
|
+
return rows2;
|
|
28790
|
+
}
|
|
28791
|
+
const rows = [{ label: "Command", value: path5.detail, tone: "ok" }];
|
|
28792
|
+
const version = checks.find((check) => check.step === "version");
|
|
28793
|
+
if (version?.ok) rows.push({ label: "Version", value: version.detail, tone: "ok" });
|
|
28794
|
+
rows.push({ label: "Model", value: modelLine(name, settings.model), tone: "muted" });
|
|
28795
|
+
const hint = setupHint(name, status);
|
|
28796
|
+
if (hint) rows.push({ label: "Setup", value: hint, tone: "muted" });
|
|
28797
|
+
return rows;
|
|
28798
|
+
}
|
|
28799
|
+
function statusRows(_name, checks, savedBinary) {
|
|
28800
|
+
if (!checks) return [{ label: "Command", value: "checking...", tone: "muted" }];
|
|
28801
|
+
const find = (step) => checks.find((check) => check.step === step);
|
|
28802
|
+
const path5 = find("path");
|
|
28803
|
+
if (!path5?.ok) {
|
|
28804
|
+
if (savedBinary.trim()) return [{ label: "Command", value: path5?.detail ?? "not found", tone: "bad" }];
|
|
28805
|
+
return [{ label: "Command", value: "not configured (not on the PATH)", tone: "muted" }];
|
|
28806
|
+
}
|
|
28807
|
+
const rows = [{ label: "Command", value: path5.detail, tone: "ok" }];
|
|
28808
|
+
const version = find("version");
|
|
28809
|
+
if (version) {
|
|
28810
|
+
rows.push({
|
|
28811
|
+
label: "Version",
|
|
28812
|
+
value: version.ok ? version.detail : "could not be read",
|
|
28813
|
+
tone: version.ok ? "ok" : "muted"
|
|
28814
|
+
});
|
|
28815
|
+
}
|
|
28816
|
+
const login = find("login");
|
|
28817
|
+
const prompt = find("prompt");
|
|
28818
|
+
if (login) {
|
|
28819
|
+
rows.push({ label: "Login", value: login.detail, tone: login.ok ? "ok" : "bad" });
|
|
28820
|
+
} else if (prompt) {
|
|
28821
|
+
rows.push({
|
|
28822
|
+
label: "Login",
|
|
28823
|
+
value: prompt.ok ? "confirmed by the test" : "see the test result",
|
|
28824
|
+
tone: prompt.ok ? "ok" : "bad"
|
|
28825
|
+
});
|
|
28826
|
+
} else {
|
|
28827
|
+
rows.push({ label: "Login", value: "not checked (use Run test)", tone: "muted" });
|
|
28828
|
+
}
|
|
28829
|
+
if (prompt) rows.push({ label: "Test", value: prompt.detail, tone: prompt.ok ? "ok" : "bad" });
|
|
28830
|
+
return rows;
|
|
28831
|
+
}
|
|
28832
|
+
async function withBinaryEnv(name, binary, run) {
|
|
28833
|
+
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
28834
|
+
const previous = process.env[key];
|
|
28835
|
+
process.env[key] = binary;
|
|
28836
|
+
try {
|
|
28837
|
+
return await run();
|
|
28838
|
+
} finally {
|
|
28839
|
+
if (previous === void 0) delete process.env[key];
|
|
28840
|
+
else process.env[key] = previous;
|
|
28841
|
+
}
|
|
28842
|
+
}
|
|
28843
|
+
|
|
28844
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentDetail.tsx
|
|
28845
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
28846
|
+
import { Box as Box44, Text as Text47, useInput as useInput11 } from "ink";
|
|
28847
|
+
import TextInput4 from "ink-text-input";
|
|
28848
|
+
|
|
28849
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusBadge.tsx
|
|
28850
|
+
import { Text as Text46 } from "ink";
|
|
28851
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
28852
|
+
var TONE_COLOR = {
|
|
28853
|
+
ok: PALETTE.success,
|
|
28854
|
+
bad: PALETTE.error,
|
|
28855
|
+
muted: PALETTE.muted
|
|
28638
28856
|
};
|
|
28639
|
-
|
|
28640
|
-
|
|
28641
|
-
|
|
28642
|
-
|
|
28643
|
-
|
|
28644
|
-
const
|
|
28645
|
-
|
|
28857
|
+
function AgentStatusBadge({
|
|
28858
|
+
name,
|
|
28859
|
+
checks,
|
|
28860
|
+
binary
|
|
28861
|
+
}) {
|
|
28862
|
+
const { symbol, text, tone } = LIST_STATUS[checks ? statusFromChecks(name, checks, binary) : "checking"];
|
|
28863
|
+
return /* @__PURE__ */ jsx55(Text46, { color: TONE_COLOR[tone], children: `${symbol} ${text}` });
|
|
28864
|
+
}
|
|
28865
|
+
|
|
28866
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/apply-binary-overrides.ts
|
|
28867
|
+
var shellValues = /* @__PURE__ */ new Map();
|
|
28868
|
+
function applyBinaryOverrides(config) {
|
|
28869
|
+
for (const name of AGENT_NAMES) {
|
|
28870
|
+
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
28871
|
+
const binary = config.agents[name].binary.trim();
|
|
28872
|
+
if (binary) {
|
|
28873
|
+
if (!shellValues.has(key)) shellValues.set(key, process.env[key]);
|
|
28874
|
+
process.env[key] = binary;
|
|
28875
|
+
} else if (shellValues.has(key)) {
|
|
28876
|
+
const shellValue = shellValues.get(key);
|
|
28877
|
+
if (shellValue === void 0) delete process.env[key];
|
|
28878
|
+
else process.env[key] = shellValue;
|
|
28879
|
+
shellValues.delete(key);
|
|
28880
|
+
}
|
|
28881
|
+
}
|
|
28882
|
+
}
|
|
28883
|
+
|
|
28884
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentDetail.tsx
|
|
28885
|
+
import { Fragment as Fragment17, jsx as jsx56, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
28886
|
+
var FOCUS_ORDER = ["binary", "model", "test"];
|
|
28887
|
+
var FIELDS2 = ["binary", "model"];
|
|
28888
|
+
var FIELD_LABEL = { binary: "Command path", model: "Model" };
|
|
28889
|
+
var LABEL_WIDTH = "Command path".length;
|
|
28890
|
+
var fieldHint = (name, field) => field === "binary" ? `(empty: \`${AGENT_HINTS[name]}\` from the PATH)` : `(empty: ${defaultModelLabel(name)})`;
|
|
28891
|
+
function Section2({
|
|
28892
|
+
title,
|
|
28893
|
+
note,
|
|
28894
|
+
interactive = false,
|
|
28895
|
+
children
|
|
28896
|
+
}) {
|
|
28897
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", marginTop: 1, children: [
|
|
28898
|
+
/* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
28899
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, color: interactive ? PALETTE.accent : PALETTE.muted, children: title }),
|
|
28900
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: `\xB7 ${note}` })
|
|
28901
|
+
] }),
|
|
28902
|
+
children
|
|
28903
|
+
] });
|
|
28904
|
+
}
|
|
28905
|
+
function AgentDetail({
|
|
28906
|
+
name,
|
|
28907
|
+
config,
|
|
28908
|
+
setConfig,
|
|
28909
|
+
onBack
|
|
28910
|
+
}) {
|
|
28911
|
+
const settings = config.agents[name];
|
|
28912
|
+
const [focusIndex, setFocusIndex] = useState29(0);
|
|
28646
28913
|
const [editing, setEditing] = useState29(false);
|
|
28647
28914
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
28915
|
+
const [saving, setSaving] = useState29(false);
|
|
28916
|
+
const [testing, setTesting] = useState29(false);
|
|
28917
|
+
const [notice, setNotice] = useState29(null);
|
|
28918
|
+
const [checks, setChecks] = useState29(void 0);
|
|
28648
28919
|
useEffect22(() => {
|
|
28649
|
-
|
|
28650
|
-
|
|
28651
|
-
|
|
28920
|
+
let active = true;
|
|
28921
|
+
setChecks(void 0);
|
|
28922
|
+
void inspectAgent(name, settings.binary).then((result) => active && setChecks(result));
|
|
28923
|
+
return () => {
|
|
28924
|
+
active = false;
|
|
28925
|
+
};
|
|
28926
|
+
}, [name, settings.binary]);
|
|
28927
|
+
const setField = (field, value) => {
|
|
28928
|
+
setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [field]: value } } });
|
|
28929
|
+
setNotice(null);
|
|
28930
|
+
};
|
|
28931
|
+
const save = () => {
|
|
28932
|
+
setSaving(true);
|
|
28933
|
+
setNotice(null);
|
|
28934
|
+
writeAgentConfig(config).then(() => {
|
|
28935
|
+
applyBinaryOverrides(config);
|
|
28936
|
+
setNotice({ kind: "success", text: `${AGENT_LABELS[name]} settings saved` });
|
|
28937
|
+
}).catch(
|
|
28938
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
28939
|
+
).finally(() => setSaving(false));
|
|
28940
|
+
};
|
|
28941
|
+
const runTest = () => {
|
|
28942
|
+
setTesting(true);
|
|
28943
|
+
setNotice(null);
|
|
28944
|
+
setChecks(void 0);
|
|
28945
|
+
testAgent(name, settings.binary, settings.model).then(setChecks).catch(
|
|
28946
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "The test could not run" })
|
|
28947
|
+
).finally(() => setTesting(false));
|
|
28948
|
+
};
|
|
28949
|
+
const focused = FOCUS_ORDER[focusIndex];
|
|
28950
|
+
const focusedField = focused === "test" ? null : focused;
|
|
28951
|
+
useInput11((input, key) => {
|
|
28952
|
+
if (saving || testing) return;
|
|
28953
|
+
if (editing) {
|
|
28954
|
+
if (key.escape && focusedField) {
|
|
28955
|
+
setField(focusedField, valueBeforeEdit);
|
|
28956
|
+
setEditing(false);
|
|
28957
|
+
}
|
|
28958
|
+
return;
|
|
28959
|
+
}
|
|
28960
|
+
if (key.escape || input === "q") {
|
|
28961
|
+
onBack();
|
|
28962
|
+
return;
|
|
28963
|
+
}
|
|
28964
|
+
if (input === "s") {
|
|
28965
|
+
save();
|
|
28966
|
+
return;
|
|
28967
|
+
}
|
|
28968
|
+
if (key.upArrow) {
|
|
28969
|
+
setFocusIndex((i) => (i - 1 + FOCUS_ORDER.length) % FOCUS_ORDER.length);
|
|
28970
|
+
return;
|
|
28971
|
+
}
|
|
28972
|
+
if (key.downArrow || key.tab) {
|
|
28973
|
+
setFocusIndex((i) => (i + 1) % FOCUS_ORDER.length);
|
|
28974
|
+
return;
|
|
28975
|
+
}
|
|
28976
|
+
if (input === "c" && focusedField) {
|
|
28977
|
+
setField(focusedField, "");
|
|
28978
|
+
return;
|
|
28979
|
+
}
|
|
28980
|
+
if (key.return) {
|
|
28981
|
+
if (focusedField) {
|
|
28982
|
+
setValueBeforeEdit(settings[focusedField]);
|
|
28983
|
+
setEditing(true);
|
|
28984
|
+
} else {
|
|
28985
|
+
runTest();
|
|
28986
|
+
}
|
|
28987
|
+
}
|
|
28988
|
+
});
|
|
28989
|
+
const status = checks ? statusFromChecks(name, checks, settings.binary) : "checking";
|
|
28990
|
+
const hint = setupHint(name, status);
|
|
28991
|
+
const pointer = (isFocused) => /* @__PURE__ */ jsx56(Text47, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
28992
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28993
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, children: AGENT_LABELS[name] }),
|
|
28994
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: config.defaultAgent === name ? "This is the default agent." : `Runs the \`${AGENT_HINTS[name]}\` command.` }),
|
|
28995
|
+
/* @__PURE__ */ jsxs45(Section2, { title: "CONFIGURE", note: "you can change these", interactive: true, children: [
|
|
28996
|
+
FIELDS2.map((field) => {
|
|
28997
|
+
const isFocused = focused === field;
|
|
28998
|
+
const value = settings[field];
|
|
28999
|
+
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
29000
|
+
pointer(isFocused),
|
|
29001
|
+
/* @__PURE__ */ jsx56(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text47, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: FIELD_LABEL[field] }) }),
|
|
29002
|
+
isFocused && editing ? /* @__PURE__ */ jsx56(
|
|
29003
|
+
TextInput4,
|
|
29004
|
+
{
|
|
29005
|
+
value,
|
|
29006
|
+
onChange: (next) => setField(field, next),
|
|
29007
|
+
onSubmit: () => setEditing(false)
|
|
29008
|
+
}
|
|
29009
|
+
) : /* @__PURE__ */ jsx56(Text47, { bold: true, children: value }),
|
|
29010
|
+
!value && /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: fieldHint(name, field) })
|
|
29011
|
+
] }, field);
|
|
29012
|
+
}),
|
|
29013
|
+
/* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
29014
|
+
pointer(focused === "test"),
|
|
29015
|
+
/* @__PURE__ */ jsx56(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text47, { bold: focused === "test", color: focused === "test" ? PALETTE.accent : PALETTE.muted, children: "Run test" }) }),
|
|
29016
|
+
/* @__PURE__ */ jsx56(Text47, { color: testing ? PALETTE.accent : PALETTE.muted, children: testing ? "running..." : "sends one small prompt (uses a few tokens)" })
|
|
29017
|
+
] })
|
|
29018
|
+
] }),
|
|
29019
|
+
/* @__PURE__ */ jsxs45(Section2, { title: "STATUS", note: "read only", children: [
|
|
29020
|
+
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsxs45(Box44, { gap: 1, paddingLeft: 2, children: [
|
|
29021
|
+
/* @__PURE__ */ jsx56(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: row.label }) }),
|
|
29022
|
+
/* @__PURE__ */ jsx56(Text47, { color: TONE_COLOR[row.tone], children: row.value })
|
|
29023
|
+
] }, row.label)),
|
|
29024
|
+
hint && /* @__PURE__ */ jsx56(Box44, { paddingLeft: 2, children: /* @__PURE__ */ jsxs45(Text47, { color: PALETTE.muted, children: [
|
|
29025
|
+
"Setup: ",
|
|
29026
|
+
hint
|
|
29027
|
+
] }) })
|
|
29028
|
+
] }),
|
|
29029
|
+
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
29030
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
29031
|
+
/* @__PURE__ */ jsxs45(Text47, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
29032
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
29033
|
+
" ",
|
|
29034
|
+
notice.text
|
|
29035
|
+
] })
|
|
29036
|
+
] }),
|
|
29037
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
29038
|
+
/* @__PURE__ */ jsx56(
|
|
29039
|
+
ControlHints,
|
|
29040
|
+
{
|
|
29041
|
+
hints: editing ? [
|
|
29042
|
+
{ keys: "type", label: "edit" },
|
|
29043
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
29044
|
+
{ keys: "\u23CE", label: "done" },
|
|
29045
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
29046
|
+
] : [
|
|
29047
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
29048
|
+
{ keys: "\u23CE", label: focusedField ? "edit" : "run test" },
|
|
29049
|
+
...focusedField ? [{ keys: "c", label: "clear" }] : [],
|
|
29050
|
+
{ keys: "s", label: "save" },
|
|
29051
|
+
{ keys: "Esc/q", label: "back without saving" }
|
|
29052
|
+
]
|
|
29053
|
+
}
|
|
29054
|
+
)
|
|
29055
|
+
] });
|
|
29056
|
+
}
|
|
29057
|
+
|
|
29058
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
29059
|
+
import { Fragment as Fragment18, jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
29060
|
+
var NAME_WIDTH = 16;
|
|
29061
|
+
var PANEL_LABEL_WIDTH = "Command".length;
|
|
29062
|
+
function AgentsScreen({ onDone }) {
|
|
29063
|
+
const [config, setConfig] = useState30(null);
|
|
29064
|
+
const [focus, setFocus] = useState30(0);
|
|
29065
|
+
const [open, setOpen] = useState30(null);
|
|
29066
|
+
const [notice, setNotice] = useState30(null);
|
|
29067
|
+
const [checks, setChecks] = useState30({});
|
|
29068
|
+
const inspectAll = (loaded) => {
|
|
29069
|
+
for (const name of AGENT_NAMES) {
|
|
29070
|
+
void inspectAgent(name, loaded.agents[name].binary).then(
|
|
29071
|
+
(result) => setChecks((previous) => ({ ...previous, [name]: result }))
|
|
29072
|
+
);
|
|
29073
|
+
}
|
|
29074
|
+
};
|
|
29075
|
+
useEffect23(() => {
|
|
29076
|
+
void readAgentConfig().then((loaded) => {
|
|
29077
|
+
setConfig(loaded);
|
|
29078
|
+
inspectAll(loaded);
|
|
28652
29079
|
startDebugRun({
|
|
28653
|
-
flow: "settings/
|
|
28654
|
-
step: "01-
|
|
28655
|
-
menuOption: "Configuration",
|
|
28656
|
-
inputs:
|
|
29080
|
+
flow: "settings/agents",
|
|
29081
|
+
step: "01-agents",
|
|
29082
|
+
menuOption: "Configuration > Agents",
|
|
29083
|
+
inputs: { default_agent: loaded.defaultAgent }
|
|
28657
29084
|
});
|
|
28658
29085
|
});
|
|
28659
29086
|
}, []);
|
|
28660
|
-
|
|
28661
|
-
if (!config) return "";
|
|
28662
|
-
return config[field] || "";
|
|
28663
|
-
}
|
|
28664
|
-
function setFieldValue(field, value) {
|
|
29087
|
+
const makeDefault = (name) => {
|
|
28665
29088
|
if (!config) return;
|
|
28666
|
-
|
|
28667
|
-
|
|
28668
|
-
|
|
28669
|
-
|
|
28670
|
-
|
|
28671
|
-
|
|
28672
|
-
setNotice(
|
|
28673
|
-
|
|
28674
|
-
|
|
28675
|
-
|
|
28676
|
-
|
|
28677
|
-
|
|
28678
|
-
|
|
28679
|
-
|
|
28680
|
-
|
|
28681
|
-
|
|
29089
|
+
if (name === config.defaultAgent) {
|
|
29090
|
+
setNotice({ kind: "success", text: `${AGENT_LABELS[name]} is already the default agent` });
|
|
29091
|
+
return;
|
|
29092
|
+
}
|
|
29093
|
+
const next = { ...config, defaultAgent: name };
|
|
29094
|
+
setConfig(next);
|
|
29095
|
+
writeAgentConfig(next).then(() => setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[name]}` })).catch(
|
|
29096
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
29097
|
+
);
|
|
29098
|
+
};
|
|
29099
|
+
useInput12((input, key) => {
|
|
29100
|
+
if (!config || open) return;
|
|
29101
|
+
const focused = AGENT_NAMES[focus];
|
|
29102
|
+
if (key.upArrow || key.downArrow || key.tab) setNotice(null);
|
|
29103
|
+
if (key.upArrow) {
|
|
29104
|
+
setFocus((i) => (i - 1 + AGENT_NAMES.length) % AGENT_NAMES.length);
|
|
29105
|
+
return;
|
|
29106
|
+
}
|
|
29107
|
+
if (key.downArrow || key.tab) {
|
|
29108
|
+
setFocus((i) => (i + 1) % AGENT_NAMES.length);
|
|
29109
|
+
return;
|
|
29110
|
+
}
|
|
29111
|
+
if (key.return) {
|
|
29112
|
+
makeDefault(focused);
|
|
29113
|
+
return;
|
|
29114
|
+
}
|
|
29115
|
+
if (key.rightArrow) {
|
|
29116
|
+
setNotice(null);
|
|
29117
|
+
setOpen(focused);
|
|
29118
|
+
return;
|
|
29119
|
+
}
|
|
29120
|
+
if (key.escape || input === "q") {
|
|
29121
|
+
void finishDebugRun({ outputs: { default_agent: config.defaultAgent }, status: "success", exitMethod: "saved" });
|
|
29122
|
+
onDone();
|
|
29123
|
+
}
|
|
29124
|
+
});
|
|
29125
|
+
if (!config) {
|
|
29126
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29127
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
29128
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29129
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "Loading..." })
|
|
29130
|
+
] });
|
|
28682
29131
|
}
|
|
28683
|
-
|
|
28684
|
-
|
|
28685
|
-
|
|
29132
|
+
if (open) {
|
|
29133
|
+
return /* @__PURE__ */ jsx57(
|
|
29134
|
+
AgentDetail,
|
|
29135
|
+
{
|
|
29136
|
+
name: open,
|
|
29137
|
+
config,
|
|
29138
|
+
setConfig,
|
|
29139
|
+
onBack: () => {
|
|
29140
|
+
setOpen(null);
|
|
29141
|
+
void readAgentConfig().then((saved) => {
|
|
29142
|
+
setConfig(saved);
|
|
29143
|
+
inspectAll(saved);
|
|
29144
|
+
});
|
|
29145
|
+
}
|
|
29146
|
+
}
|
|
28686
29147
|
);
|
|
28687
|
-
onDone();
|
|
28688
29148
|
}
|
|
28689
|
-
|
|
28690
|
-
|
|
29149
|
+
const focusedAgent = AGENT_NAMES[focus];
|
|
29150
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29151
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
29152
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "The coding agent the CLI runs, and what was found for each one." }),
|
|
29153
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29154
|
+
/* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
29155
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "Default agent" }),
|
|
29156
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: AGENT_LABELS[config.defaultAgent] })
|
|
29157
|
+
] }),
|
|
29158
|
+
/* @__PURE__ */ jsxs46(Box45, { marginTop: 1, gap: 1, children: [
|
|
29159
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29160
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29161
|
+
/* @__PURE__ */ jsx57(Box45, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "AGENT" }) }),
|
|
29162
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "STATUS" })
|
|
29163
|
+
] }),
|
|
29164
|
+
AGENT_NAMES.map((name) => {
|
|
29165
|
+
const isFocused = focusedAgent === name;
|
|
29166
|
+
return /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
29167
|
+
/* @__PURE__ */ jsx57(Text48, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " }),
|
|
29168
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.success, children: name === config.defaultAgent ? "\u2605" : " " }),
|
|
29169
|
+
/* @__PURE__ */ jsx57(Box45, { width: NAME_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[name] }) }),
|
|
29170
|
+
/* @__PURE__ */ jsx57(AgentStatusBadge, { name, checks: checks[name], binary: config.agents[name].binary })
|
|
29171
|
+
] }, name);
|
|
29172
|
+
}),
|
|
29173
|
+
/* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", marginTop: 1, children: [
|
|
29174
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: `\u2500 ${AGENT_LABELS[focusedAgent]} ${"\u2500".repeat(30)}` }),
|
|
29175
|
+
panelRows(focusedAgent, checks[focusedAgent], config.agents[focusedAgent]).map((row) => /* @__PURE__ */ jsxs46(Box45, { gap: 1, paddingLeft: 1, children: [
|
|
29176
|
+
/* @__PURE__ */ jsx57(Box45, { width: PANEL_LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: row.label }) }),
|
|
29177
|
+
/* @__PURE__ */ jsx57(Text48, { color: TONE_COLOR[row.tone], children: row.value })
|
|
29178
|
+
] }, row.label))
|
|
29179
|
+
] }),
|
|
29180
|
+
notice && /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
29181
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29182
|
+
/* @__PURE__ */ jsxs46(Text48, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
29183
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
29184
|
+
" ",
|
|
29185
|
+
notice.text
|
|
29186
|
+
] })
|
|
29187
|
+
] }),
|
|
29188
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29189
|
+
/* @__PURE__ */ jsx57(
|
|
29190
|
+
ControlHints,
|
|
29191
|
+
{
|
|
29192
|
+
hints: [
|
|
29193
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
29194
|
+
{ keys: "\u23CE", label: "make default" },
|
|
29195
|
+
{ keys: "\u2192", label: "settings and test" },
|
|
29196
|
+
{ keys: "Esc/q", label: "back" }
|
|
29197
|
+
]
|
|
29198
|
+
}
|
|
29199
|
+
)
|
|
29200
|
+
] });
|
|
29201
|
+
}
|
|
29202
|
+
|
|
29203
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
29204
|
+
import { useEffect as useEffect24, useState as useState32 } from "react";
|
|
29205
|
+
import { Box as Box47, Text as Text50 } from "ink";
|
|
29206
|
+
init_debug_store();
|
|
29207
|
+
|
|
29208
|
+
// packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx
|
|
29209
|
+
import { useState as useState31 } from "react";
|
|
29210
|
+
import { Box as Box46, Text as Text49, useInput as useInput13 } from "ink";
|
|
29211
|
+
import TextInput5 from "ink-text-input";
|
|
29212
|
+
import { Fragment as Fragment19, jsx as jsx58, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
29213
|
+
function FieldForm({
|
|
29214
|
+
title,
|
|
29215
|
+
subtitle,
|
|
29216
|
+
fields,
|
|
29217
|
+
values,
|
|
29218
|
+
onChange,
|
|
29219
|
+
onSave,
|
|
29220
|
+
onQuit,
|
|
29221
|
+
notice,
|
|
29222
|
+
busy = false,
|
|
29223
|
+
footer
|
|
29224
|
+
}) {
|
|
29225
|
+
const [active, setActive] = useState31(0);
|
|
29226
|
+
const [editing, setEditing] = useState31(false);
|
|
29227
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState31("");
|
|
29228
|
+
const labelWidth = Math.max(...fields.map((field) => field.label.length));
|
|
29229
|
+
const current = fields[active];
|
|
29230
|
+
useInput13((input, key) => {
|
|
29231
|
+
if (busy) return;
|
|
28691
29232
|
if (editing) {
|
|
28692
29233
|
if (key.escape) {
|
|
28693
|
-
|
|
29234
|
+
onChange(current.key, valueBeforeEdit);
|
|
28694
29235
|
setEditing(false);
|
|
28695
29236
|
}
|
|
28696
29237
|
return;
|
|
28697
29238
|
}
|
|
28698
29239
|
if (key.escape || input === "q") {
|
|
28699
|
-
|
|
29240
|
+
onQuit();
|
|
28700
29241
|
return;
|
|
28701
29242
|
}
|
|
28702
29243
|
if (input === "s") {
|
|
28703
|
-
|
|
29244
|
+
onSave();
|
|
28704
29245
|
return;
|
|
28705
29246
|
}
|
|
28706
29247
|
if (input === "c") {
|
|
28707
|
-
|
|
29248
|
+
onChange(current.key, "");
|
|
28708
29249
|
return;
|
|
28709
29250
|
}
|
|
28710
29251
|
if (key.tab || key.downArrow) {
|
|
28711
|
-
|
|
28712
|
-
setActiveField(FIELD_ORDER[(idx + 1) % FIELD_ORDER.length]);
|
|
29252
|
+
setActive((i) => (i + 1) % fields.length);
|
|
28713
29253
|
return;
|
|
28714
29254
|
}
|
|
28715
29255
|
if (key.upArrow) {
|
|
28716
|
-
|
|
28717
|
-
setActiveField(FIELD_ORDER[(idx - 1 + FIELD_ORDER.length) % FIELD_ORDER.length]);
|
|
29256
|
+
setActive((i) => (i - 1 + fields.length) % fields.length);
|
|
28718
29257
|
return;
|
|
28719
29258
|
}
|
|
28720
29259
|
if (key.return) {
|
|
28721
|
-
setValueBeforeEdit(
|
|
29260
|
+
setValueBeforeEdit(values[current.key]);
|
|
28722
29261
|
setEditing(true);
|
|
28723
29262
|
}
|
|
28724
29263
|
});
|
|
28725
|
-
|
|
28726
|
-
|
|
28727
|
-
|
|
28728
|
-
|
|
28729
|
-
|
|
28730
|
-
|
|
28731
|
-
|
|
28732
|
-
|
|
28733
|
-
|
|
28734
|
-
|
|
28735
|
-
|
|
28736
|
-
|
|
28737
|
-
|
|
28738
|
-
const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
|
|
28739
|
-
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
28740
|
-
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
28741
|
-
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
|
|
28742
|
-
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
28743
|
-
TextInput4,
|
|
29264
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29265
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, children: title }),
|
|
29266
|
+
subtitle && /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: subtitle }),
|
|
29267
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
29268
|
+
/* @__PURE__ */ jsx58(Box46, { flexDirection: "column", children: fields.map((field, index) => {
|
|
29269
|
+
const isActive = index === active;
|
|
29270
|
+
const value = values[field.key];
|
|
29271
|
+
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
29272
|
+
return /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
29273
|
+
/* @__PURE__ */ jsx58(Text49, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
29274
|
+
/* @__PURE__ */ jsx58(Box46, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx58(Text49, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
29275
|
+
isActive && editing ? /* @__PURE__ */ jsx58(
|
|
29276
|
+
TextInput5,
|
|
28744
29277
|
{
|
|
28745
29278
|
value,
|
|
28746
|
-
onChange: (next) =>
|
|
29279
|
+
onChange: (next) => onChange(field.key, next),
|
|
28747
29280
|
onSubmit: () => setEditing(false),
|
|
28748
|
-
mask: field
|
|
29281
|
+
mask: field.masked ? "\u2022" : void 0
|
|
28749
29282
|
}
|
|
28750
|
-
) : /* @__PURE__ */
|
|
28751
|
-
|
|
28752
|
-
] }, field);
|
|
29283
|
+
) : /* @__PURE__ */ jsx58(Text49, { bold: !!display, children: display || (field.hint ? "" : /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
29284
|
+
field.hint && /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: field.hint })
|
|
29285
|
+
] }, field.key);
|
|
28753
29286
|
}) }),
|
|
28754
|
-
notice && /* @__PURE__ */
|
|
28755
|
-
/* @__PURE__ */
|
|
28756
|
-
/* @__PURE__ */
|
|
29287
|
+
notice && /* @__PURE__ */ jsxs47(Fragment19, { children: [
|
|
29288
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
29289
|
+
/* @__PURE__ */ jsxs47(Text49, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
28757
29290
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
28758
29291
|
" ",
|
|
28759
29292
|
notice.text
|
|
28760
29293
|
] })
|
|
28761
29294
|
] }),
|
|
28762
|
-
|
|
28763
|
-
/* @__PURE__ */
|
|
29295
|
+
footer,
|
|
29296
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
29297
|
+
/* @__PURE__ */ jsx58(
|
|
28764
29298
|
ControlHints,
|
|
28765
29299
|
{
|
|
28766
29300
|
hints: editing ? [
|
|
@@ -28773,7 +29307,168 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28773
29307
|
{ keys: "\u23CE", label: "edit" },
|
|
28774
29308
|
{ keys: "c", label: "clear" },
|
|
28775
29309
|
{ keys: "s", label: "save" },
|
|
28776
|
-
{ keys: "Esc/q", label: "
|
|
29310
|
+
{ keys: "Esc/q", label: "back without saving" }
|
|
29311
|
+
]
|
|
29312
|
+
}
|
|
29313
|
+
)
|
|
29314
|
+
] });
|
|
29315
|
+
}
|
|
29316
|
+
|
|
29317
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
29318
|
+
async function readCredentials() {
|
|
29319
|
+
const store = await readV1Store();
|
|
29320
|
+
return {
|
|
29321
|
+
spaceId: store.spaceId || "",
|
|
29322
|
+
environmentId: store.environmentId || "",
|
|
29323
|
+
cmaToken: store.cmaToken || "",
|
|
29324
|
+
host: store.host || "",
|
|
29325
|
+
defaultComponentDir: store.defaultComponentDir || "",
|
|
29326
|
+
defaultTokenFile: store.defaultTokenFile || "",
|
|
29327
|
+
contentfulBaseDir: store.contentfulBaseDir || ""
|
|
29328
|
+
};
|
|
29329
|
+
}
|
|
29330
|
+
async function writeCredentials(config) {
|
|
29331
|
+
const existing = await readV1Store();
|
|
29332
|
+
const merged = {
|
|
29333
|
+
...existing,
|
|
29334
|
+
...config
|
|
29335
|
+
};
|
|
29336
|
+
Object.keys(merged).forEach((k) => {
|
|
29337
|
+
if (!merged[k]) delete merged[k];
|
|
29338
|
+
});
|
|
29339
|
+
await writeV1Store(merged);
|
|
29340
|
+
}
|
|
29341
|
+
|
|
29342
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
29343
|
+
import { jsx as jsx59, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
29344
|
+
var FIELDS3 = [
|
|
29345
|
+
{ key: "spaceId", label: "Space ID" },
|
|
29346
|
+
{ key: "environmentId", label: "Environment ID" },
|
|
29347
|
+
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
29348
|
+
{ key: "host", label: "API Host" },
|
|
29349
|
+
{ key: "defaultComponentDir", label: "Default component directory" },
|
|
29350
|
+
{ key: "defaultTokenFile", label: "Default token file" },
|
|
29351
|
+
{ key: "contentfulBaseDir", label: "Root Project Directory", hint: "(where .contentful goes)" }
|
|
29352
|
+
];
|
|
29353
|
+
function debugFields(config) {
|
|
29354
|
+
return {
|
|
29355
|
+
space_id: config?.spaceId ?? "",
|
|
29356
|
+
environment_id: config?.environmentId ?? "",
|
|
29357
|
+
cma_token: config?.cmaToken ?? "",
|
|
29358
|
+
host: config?.host ?? "",
|
|
29359
|
+
default_component_dir: config?.defaultComponentDir ?? "",
|
|
29360
|
+
default_token_file: config?.defaultTokenFile ?? "",
|
|
29361
|
+
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
29362
|
+
};
|
|
29363
|
+
}
|
|
29364
|
+
var valuesOf = (config) => Object.fromEntries(FIELDS3.map(({ key }) => [key, config[key] || ""]));
|
|
29365
|
+
function ProjectConfigScreen({ onDone }) {
|
|
29366
|
+
const [config, setConfig] = useState32(null);
|
|
29367
|
+
const [saving, setSaving] = useState32(false);
|
|
29368
|
+
const [notice, setNotice] = useState32(null);
|
|
29369
|
+
const [lastSaved, setLastSaved] = useState32(null);
|
|
29370
|
+
useEffect24(() => {
|
|
29371
|
+
void readCredentials().then((cfg) => {
|
|
29372
|
+
setConfig(cfg);
|
|
29373
|
+
startDebugRun({
|
|
29374
|
+
flow: "settings/contentful-configuration",
|
|
29375
|
+
step: "01-configuration",
|
|
29376
|
+
menuOption: "Configuration > Project",
|
|
29377
|
+
inputs: debugFields(cfg)
|
|
29378
|
+
});
|
|
29379
|
+
});
|
|
29380
|
+
}, []);
|
|
29381
|
+
if (!config) {
|
|
29382
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29383
|
+
/* @__PURE__ */ jsx59(Text50, { bold: true, children: "Project" }),
|
|
29384
|
+
/* @__PURE__ */ jsx59(Text50, { children: " " }),
|
|
29385
|
+
/* @__PURE__ */ jsx59(Text50, { color: PALETTE.accent, children: "Loading..." })
|
|
29386
|
+
] });
|
|
29387
|
+
}
|
|
29388
|
+
const save = () => {
|
|
29389
|
+
setSaving(true);
|
|
29390
|
+
setNotice(null);
|
|
29391
|
+
writeCredentials(config).then(() => {
|
|
29392
|
+
setLastSaved(config);
|
|
29393
|
+
if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
|
|
29394
|
+
setNotice({ kind: "success", text: "Project settings saved" });
|
|
29395
|
+
}).catch((err) => {
|
|
29396
|
+
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
29397
|
+
}).finally(() => setSaving(false));
|
|
29398
|
+
};
|
|
29399
|
+
const quit = () => {
|
|
29400
|
+
void finishDebugRun(
|
|
29401
|
+
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
29402
|
+
);
|
|
29403
|
+
onDone();
|
|
29404
|
+
};
|
|
29405
|
+
return /* @__PURE__ */ jsx59(
|
|
29406
|
+
FieldForm,
|
|
29407
|
+
{
|
|
29408
|
+
title: "Project",
|
|
29409
|
+
subtitle: "The Contentful space and where the CLI keeps its files.",
|
|
29410
|
+
fields: FIELDS3,
|
|
29411
|
+
values: valuesOf(config),
|
|
29412
|
+
onChange: (key, value) => {
|
|
29413
|
+
setConfig({ ...config, [key]: value });
|
|
29414
|
+
setNotice(null);
|
|
29415
|
+
},
|
|
29416
|
+
onSave: save,
|
|
29417
|
+
onQuit: quit,
|
|
29418
|
+
notice,
|
|
29419
|
+
busy: saving
|
|
29420
|
+
}
|
|
29421
|
+
);
|
|
29422
|
+
}
|
|
29423
|
+
|
|
29424
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
29425
|
+
import { jsx as jsx60, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
29426
|
+
var SECTIONS = [
|
|
29427
|
+
{
|
|
29428
|
+
id: "project",
|
|
29429
|
+
label: "Project",
|
|
29430
|
+
description: "Contentful space, credentials, defaults and where .contentful goes"
|
|
29431
|
+
},
|
|
29432
|
+
{ id: "agents", label: "Agents", description: "Which coding agent the CLI uses, and each agent\u2019s settings" }
|
|
29433
|
+
];
|
|
29434
|
+
function ConfigurationScreen({ onDone }) {
|
|
29435
|
+
const [focus, setFocus] = useState33(0);
|
|
29436
|
+
const [open, setOpen] = useState33(null);
|
|
29437
|
+
const close = () => setOpen(null);
|
|
29438
|
+
useInput14((input, key) => {
|
|
29439
|
+
if (open) return;
|
|
29440
|
+
if (key.upArrow) {
|
|
29441
|
+
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
29442
|
+
return;
|
|
29443
|
+
}
|
|
29444
|
+
if (key.downArrow || key.tab) {
|
|
29445
|
+
setFocus((i) => (i + 1) % SECTIONS.length);
|
|
29446
|
+
return;
|
|
29447
|
+
}
|
|
29448
|
+
if (key.return) {
|
|
29449
|
+
setOpen(SECTIONS[focus].id);
|
|
29450
|
+
return;
|
|
29451
|
+
}
|
|
29452
|
+
if (key.escape || input === "q") onDone();
|
|
29453
|
+
});
|
|
29454
|
+
if (open === "project") return /* @__PURE__ */ jsx60(ProjectConfigScreen, { onDone: close });
|
|
29455
|
+
if (open === "agents") return /* @__PURE__ */ jsx60(AgentsScreen, { onDone: close });
|
|
29456
|
+
return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29457
|
+
/* @__PURE__ */ jsx60(Text51, { bold: true, children: "Configuration" }),
|
|
29458
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
29459
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs49(Box48, { gap: 1, children: [
|
|
29460
|
+
/* @__PURE__ */ jsx60(Text51, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
29461
|
+
/* @__PURE__ */ jsx60(Box48, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text51, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
29462
|
+
/* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: section.description })
|
|
29463
|
+
] }, section.id)),
|
|
29464
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
29465
|
+
/* @__PURE__ */ jsx60(
|
|
29466
|
+
ControlHints,
|
|
29467
|
+
{
|
|
29468
|
+
hints: [
|
|
29469
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
29470
|
+
{ keys: "\u23CE", label: "open" },
|
|
29471
|
+
{ keys: "Esc/q", label: "back" }
|
|
28777
29472
|
]
|
|
28778
29473
|
}
|
|
28779
29474
|
)
|
|
@@ -28781,8 +29476,8 @@ function ConfigurationScreen({ onDone }) {
|
|
|
28781
29476
|
}
|
|
28782
29477
|
|
|
28783
29478
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
28784
|
-
import { useEffect as
|
|
28785
|
-
import { Box as
|
|
29479
|
+
import { useEffect as useEffect25, useState as useState34 } from "react";
|
|
29480
|
+
import { Box as Box49, Text as Text52, useInput as useInput15 } from "ink";
|
|
28786
29481
|
|
|
28787
29482
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
28788
29483
|
async function readAnalyticsSetting() {
|
|
@@ -28801,11 +29496,11 @@ async function writeAnalyticsSetting(setting) {
|
|
|
28801
29496
|
|
|
28802
29497
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
28803
29498
|
init_debug_store();
|
|
28804
|
-
import { Fragment as
|
|
29499
|
+
import { Fragment as Fragment20, jsx as jsx61, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
28805
29500
|
function OptInAnalyticsScreen({ onDone }) {
|
|
28806
|
-
const [loading, setLoading] =
|
|
28807
|
-
const [enabled, setEnabled] =
|
|
28808
|
-
|
|
29501
|
+
const [loading, setLoading] = useState34(true);
|
|
29502
|
+
const [enabled, setEnabled] = useState34(true);
|
|
29503
|
+
useEffect25(() => {
|
|
28809
29504
|
readAnalyticsSetting().then((setting) => {
|
|
28810
29505
|
setEnabled(setting.enabled);
|
|
28811
29506
|
setLoading(false);
|
|
@@ -28817,7 +29512,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28817
29512
|
});
|
|
28818
29513
|
});
|
|
28819
29514
|
}, []);
|
|
28820
|
-
|
|
29515
|
+
useInput15((input, key) => {
|
|
28821
29516
|
if (loading) return;
|
|
28822
29517
|
if (key.return || input === " ") {
|
|
28823
29518
|
setEnabled((current) => {
|
|
@@ -28832,21 +29527,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28832
29527
|
onDone();
|
|
28833
29528
|
}
|
|
28834
29529
|
});
|
|
28835
|
-
return /* @__PURE__ */
|
|
28836
|
-
/* @__PURE__ */
|
|
28837
|
-
/* @__PURE__ */
|
|
28838
|
-
loading ? /* @__PURE__ */
|
|
28839
|
-
/* @__PURE__ */
|
|
29530
|
+
return /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29531
|
+
/* @__PURE__ */ jsx61(Text52, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
29532
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
29533
|
+
loading ? /* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs50(Fragment20, { children: [
|
|
29534
|
+
/* @__PURE__ */ jsxs50(Text52, { children: [
|
|
28840
29535
|
"Share anonymous usage data:",
|
|
28841
29536
|
" ",
|
|
28842
|
-
/* @__PURE__ */
|
|
29537
|
+
/* @__PURE__ */ jsx61(Text52, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
28843
29538
|
] }),
|
|
28844
|
-
/* @__PURE__ */
|
|
28845
|
-
/* @__PURE__ */
|
|
28846
|
-
/* @__PURE__ */
|
|
29539
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
29540
|
+
/* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
29541
|
+
/* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
28847
29542
|
] }),
|
|
28848
|
-
/* @__PURE__ */
|
|
28849
|
-
/* @__PURE__ */
|
|
29543
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
29544
|
+
/* @__PURE__ */ jsx61(
|
|
28850
29545
|
ControlHints,
|
|
28851
29546
|
{
|
|
28852
29547
|
hints: [
|
|
@@ -28859,15 +29554,15 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
28859
29554
|
}
|
|
28860
29555
|
|
|
28861
29556
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
28862
|
-
import { useEffect as
|
|
28863
|
-
import { Box as
|
|
29557
|
+
import { useEffect as useEffect26, useState as useState35 } from "react";
|
|
29558
|
+
import { Box as Box50, Text as Text53, useInput as useInput16 } from "ink";
|
|
28864
29559
|
init_version();
|
|
28865
29560
|
init_debug_store();
|
|
28866
|
-
import { jsx as
|
|
29561
|
+
import { jsx as jsx62, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
28867
29562
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
28868
29563
|
function UpgradeScreen({ onDone }) {
|
|
28869
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
28870
|
-
|
|
29564
|
+
const [upgradeCheck, setUpgradeCheck] = useState35();
|
|
29565
|
+
useEffect26(() => {
|
|
28871
29566
|
startDebugRun({
|
|
28872
29567
|
flow: "upgrade",
|
|
28873
29568
|
step: "01-upgrade",
|
|
@@ -28876,7 +29571,7 @@ function UpgradeScreen({ onDone }) {
|
|
|
28876
29571
|
});
|
|
28877
29572
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
28878
29573
|
}, []);
|
|
28879
|
-
|
|
29574
|
+
useInput16((_input, key) => {
|
|
28880
29575
|
if (key.return) {
|
|
28881
29576
|
void finishDebugRun({
|
|
28882
29577
|
outputs: upgradeCheck ?? {},
|
|
@@ -28887,12 +29582,12 @@ function UpgradeScreen({ onDone }) {
|
|
|
28887
29582
|
return;
|
|
28888
29583
|
}
|
|
28889
29584
|
});
|
|
28890
|
-
return /* @__PURE__ */
|
|
28891
|
-
/* @__PURE__ */
|
|
28892
|
-
/* @__PURE__ */
|
|
29585
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29586
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, children: "Upgrade" }),
|
|
29587
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
28893
29588
|
renderBody(upgradeCheck),
|
|
28894
|
-
/* @__PURE__ */
|
|
28895
|
-
/* @__PURE__ */
|
|
29589
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29590
|
+
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.accent, children: [
|
|
28896
29591
|
FOCUS_MARKER,
|
|
28897
29592
|
" Go Back"
|
|
28898
29593
|
] })
|
|
@@ -28900,47 +29595,47 @@ function UpgradeScreen({ onDone }) {
|
|
|
28900
29595
|
}
|
|
28901
29596
|
function renderBody(upgradeCheck) {
|
|
28902
29597
|
if (!upgradeCheck) {
|
|
28903
|
-
return /* @__PURE__ */
|
|
29598
|
+
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
28904
29599
|
}
|
|
28905
29600
|
if (upgradeCheck.status === "error") {
|
|
28906
|
-
return /* @__PURE__ */
|
|
29601
|
+
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
28907
29602
|
}
|
|
28908
29603
|
if (upgradeCheck.status === "up-to-date") {
|
|
28909
|
-
return /* @__PURE__ */
|
|
29604
|
+
return /* @__PURE__ */ jsxs51(Text53, { color: PALETTE.success, children: [
|
|
28910
29605
|
"You're already on the latest version (v",
|
|
28911
29606
|
upgradeCheck.current,
|
|
28912
29607
|
")."
|
|
28913
29608
|
] });
|
|
28914
29609
|
}
|
|
28915
|
-
return /* @__PURE__ */
|
|
28916
|
-
/* @__PURE__ */
|
|
28917
|
-
/* @__PURE__ */
|
|
29610
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", children: [
|
|
29611
|
+
/* @__PURE__ */ jsxs51(Text53, { color: PALETTE.muted, children: [
|
|
29612
|
+
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.success, children: [
|
|
28918
29613
|
"v",
|
|
28919
29614
|
upgradeCheck.latest
|
|
28920
29615
|
] }),
|
|
28921
29616
|
" ",
|
|
28922
29617
|
"is available (you're on ",
|
|
28923
|
-
/* @__PURE__ */
|
|
29618
|
+
/* @__PURE__ */ jsxs51(Text53, { bold: true, children: [
|
|
28924
29619
|
"v",
|
|
28925
29620
|
upgradeCheck.current
|
|
28926
29621
|
] }),
|
|
28927
29622
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
28928
29623
|
] }),
|
|
28929
|
-
/* @__PURE__ */
|
|
28930
|
-
/* @__PURE__ */
|
|
29624
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29625
|
+
/* @__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)) })
|
|
28931
29626
|
] });
|
|
28932
29627
|
}
|
|
28933
29628
|
|
|
28934
29629
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
28935
|
-
import { useEffect as
|
|
28936
|
-
import { Box as
|
|
29630
|
+
import { useEffect as useEffect27, useState as useState36 } from "react";
|
|
29631
|
+
import { Box as Box51, Text as Text54, useInput as useInput17 } from "ink";
|
|
28937
29632
|
init_debug_mode_store();
|
|
28938
29633
|
init_debug_store();
|
|
28939
|
-
import { jsx as
|
|
29634
|
+
import { jsx as jsx63, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
28940
29635
|
function DebugModeScreen({ onDone }) {
|
|
28941
|
-
const [loading, setLoading] =
|
|
28942
|
-
const [enabled, setEnabled] =
|
|
28943
|
-
|
|
29636
|
+
const [loading, setLoading] = useState36(true);
|
|
29637
|
+
const [enabled, setEnabled] = useState36(true);
|
|
29638
|
+
useEffect27(() => {
|
|
28944
29639
|
readDebugModeSetting().then((setting) => {
|
|
28945
29640
|
setEnabled(setting.enabled);
|
|
28946
29641
|
setLoading(false);
|
|
@@ -28952,7 +29647,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
28952
29647
|
});
|
|
28953
29648
|
});
|
|
28954
29649
|
}, []);
|
|
28955
|
-
|
|
29650
|
+
useInput17((input, key) => {
|
|
28956
29651
|
if (loading) return;
|
|
28957
29652
|
if (key.return || input === " ") {
|
|
28958
29653
|
setEnabled((current) => {
|
|
@@ -28967,16 +29662,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
28967
29662
|
onDone();
|
|
28968
29663
|
}
|
|
28969
29664
|
});
|
|
28970
|
-
return /* @__PURE__ */
|
|
28971
|
-
/* @__PURE__ */
|
|
28972
|
-
/* @__PURE__ */
|
|
28973
|
-
loading ? /* @__PURE__ */
|
|
29665
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29666
|
+
/* @__PURE__ */ jsx63(Text54, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
29667
|
+
/* @__PURE__ */ jsx63(Text54, { children: " " }),
|
|
29668
|
+
loading ? /* @__PURE__ */ jsx63(Text54, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs52(Text54, { children: [
|
|
28974
29669
|
"Debug logging:",
|
|
28975
29670
|
" ",
|
|
28976
|
-
/* @__PURE__ */
|
|
29671
|
+
/* @__PURE__ */ jsx63(Text54, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
28977
29672
|
] }),
|
|
28978
|
-
/* @__PURE__ */
|
|
28979
|
-
/* @__PURE__ */
|
|
29673
|
+
/* @__PURE__ */ jsx63(Text54, { children: " " }),
|
|
29674
|
+
/* @__PURE__ */ jsx63(
|
|
28980
29675
|
ControlHints,
|
|
28981
29676
|
{
|
|
28982
29677
|
hints: [
|
|
@@ -28989,18 +29684,18 @@ function DebugModeScreen({ onDone }) {
|
|
|
28989
29684
|
}
|
|
28990
29685
|
|
|
28991
29686
|
// packages/experience-design-system-cli/app.tsx
|
|
28992
|
-
import { Fragment as
|
|
29687
|
+
import { Fragment as Fragment21, jsx as jsx64 } from "react/jsx-runtime";
|
|
28993
29688
|
function App({ importOptions, inkClear }) {
|
|
28994
|
-
const [screen, setScreen] =
|
|
28995
|
-
const [importExitCode, setImportExitCode] =
|
|
29689
|
+
const [screen, setScreen] = useState37("start");
|
|
29690
|
+
const [importExitCode, setImportExitCode] = useState37();
|
|
28996
29691
|
const showImportResult = importExitCode !== void 0;
|
|
28997
|
-
const [projectPath, setProjectPath] =
|
|
28998
|
-
const [tokensPath, setTokensPath] =
|
|
28999
|
-
const [scannedFiles, setScannedFiles] =
|
|
29000
|
-
const [pendingLaunch, setPendingLaunch] =
|
|
29001
|
-
const [extractionRun, setExtractionRun] =
|
|
29692
|
+
const [projectPath, setProjectPath] = useState37();
|
|
29693
|
+
const [tokensPath, setTokensPath] = useState37();
|
|
29694
|
+
const [scannedFiles, setScannedFiles] = useState37();
|
|
29695
|
+
const [pendingLaunch, setPendingLaunch] = useState37();
|
|
29696
|
+
const [extractionRun, setExtractionRun] = useState37();
|
|
29002
29697
|
const extraction = useExtraction(extractionRun?.input);
|
|
29003
|
-
const [scopeRun, setScopeRun] =
|
|
29698
|
+
const [scopeRun, setScopeRun] = useState37();
|
|
29004
29699
|
const scopeFlow = useScopeGateFlow(
|
|
29005
29700
|
scopeRun && {
|
|
29006
29701
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -29015,12 +29710,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29015
29710
|
}
|
|
29016
29711
|
}
|
|
29017
29712
|
);
|
|
29018
|
-
const [generationInput, setGenerationInput] =
|
|
29713
|
+
const [generationInput, setGenerationInput] = useState37();
|
|
29019
29714
|
const generation = useGeneration(generationInput);
|
|
29020
|
-
const [flowStart, setFlowStart] =
|
|
29715
|
+
const [flowStart, setFlowStart] = useState37();
|
|
29021
29716
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
29022
|
-
const [importDefaults, setImportDefaults] =
|
|
29023
|
-
|
|
29717
|
+
const [importDefaults, setImportDefaults] = useState37();
|
|
29718
|
+
useEffect28(() => {
|
|
29024
29719
|
if (screen !== "import") {
|
|
29025
29720
|
setImportDefaults(void 0);
|
|
29026
29721
|
return;
|
|
@@ -29038,7 +29733,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29038
29733
|
const launch = { projectPath: projectPath2, tokens, filePaths, ...importOptions };
|
|
29039
29734
|
const state2 = await inspectTokens({
|
|
29040
29735
|
rawTokensPath: tokens,
|
|
29041
|
-
contentfulDir:
|
|
29736
|
+
contentfulDir: join26(resolveUserPath(projectPath2), ".contentful"),
|
|
29042
29737
|
cache: importOptions.cache
|
|
29043
29738
|
});
|
|
29044
29739
|
if (state2.kind === "cached") {
|
|
@@ -29080,12 +29775,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29080
29775
|
}
|
|
29081
29776
|
});
|
|
29082
29777
|
};
|
|
29083
|
-
|
|
29778
|
+
useEffect28(() => {
|
|
29084
29779
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
29085
29780
|
setExtractionRun(void 0);
|
|
29086
29781
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
29087
29782
|
}, [extraction, extractionRun]);
|
|
29088
|
-
|
|
29783
|
+
useEffect28(() => {
|
|
29089
29784
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
29090
29785
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29091
29786
|
setGenerationInput({
|
|
@@ -29103,7 +29798,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29103
29798
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
29104
29799
|
});
|
|
29105
29800
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
29106
|
-
|
|
29801
|
+
useEffect28(() => {
|
|
29107
29802
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
29108
29803
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
29109
29804
|
inkClear();
|
|
@@ -29146,9 +29841,9 @@ function App({ importOptions, inkClear }) {
|
|
|
29146
29841
|
};
|
|
29147
29842
|
switch (screen) {
|
|
29148
29843
|
case "import":
|
|
29149
|
-
if (showImportResult) return /* @__PURE__ */
|
|
29844
|
+
if (showImportResult) return /* @__PURE__ */ jsx64(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
29150
29845
|
if (flow && flowStart) {
|
|
29151
|
-
return /* @__PURE__ */
|
|
29846
|
+
return /* @__PURE__ */ jsx64(
|
|
29152
29847
|
FlowScreen,
|
|
29153
29848
|
{
|
|
29154
29849
|
state: flow.state,
|
|
@@ -29158,12 +29853,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29158
29853
|
}
|
|
29159
29854
|
);
|
|
29160
29855
|
}
|
|
29161
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
29856
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx64(Fragment21, {});
|
|
29162
29857
|
if (projectPath === void 0) {
|
|
29163
|
-
return /* @__PURE__ */
|
|
29858
|
+
return /* @__PURE__ */ jsx64(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
29164
29859
|
}
|
|
29165
29860
|
if (tokensPath === void 0) {
|
|
29166
|
-
return /* @__PURE__ */
|
|
29861
|
+
return /* @__PURE__ */ jsx64(
|
|
29167
29862
|
TokenInputScreen,
|
|
29168
29863
|
{
|
|
29169
29864
|
initialPath: importDefaults.tokenFile,
|
|
@@ -29173,7 +29868,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29173
29868
|
);
|
|
29174
29869
|
}
|
|
29175
29870
|
if (scannedFiles === void 0) {
|
|
29176
|
-
return /* @__PURE__ */
|
|
29871
|
+
return /* @__PURE__ */ jsx64(
|
|
29177
29872
|
PathValidationScreen,
|
|
29178
29873
|
{
|
|
29179
29874
|
projectPath,
|
|
@@ -29185,10 +29880,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29185
29880
|
}
|
|
29186
29881
|
if (extractionRun) {
|
|
29187
29882
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
29188
|
-
return /* @__PURE__ */
|
|
29883
|
+
return /* @__PURE__ */ jsx64(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
29189
29884
|
}
|
|
29190
29885
|
if (extraction?.status === "running") {
|
|
29191
|
-
return /* @__PURE__ */
|
|
29886
|
+
return /* @__PURE__ */ jsx64(
|
|
29192
29887
|
ExtractionScreen,
|
|
29193
29888
|
{
|
|
29194
29889
|
progress: extraction.progress,
|
|
@@ -29197,14 +29892,14 @@ function App({ importOptions, inkClear }) {
|
|
|
29197
29892
|
}
|
|
29198
29893
|
);
|
|
29199
29894
|
}
|
|
29200
|
-
return /* @__PURE__ */
|
|
29895
|
+
return /* @__PURE__ */ jsx64(Fragment21, {});
|
|
29201
29896
|
}
|
|
29202
29897
|
if (scopeRun && scopeFlow) {
|
|
29203
29898
|
if (scopeFlow.status === "failed") {
|
|
29204
|
-
return /* @__PURE__ */
|
|
29899
|
+
return /* @__PURE__ */ jsx64(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
29205
29900
|
}
|
|
29206
29901
|
if (scopeFlow.status === "deciding") {
|
|
29207
|
-
return /* @__PURE__ */
|
|
29902
|
+
return /* @__PURE__ */ jsx64(
|
|
29208
29903
|
ScopeGateScreen,
|
|
29209
29904
|
{
|
|
29210
29905
|
components: scopeFlow.load.components,
|
|
@@ -29214,7 +29909,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29214
29909
|
);
|
|
29215
29910
|
}
|
|
29216
29911
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
29217
|
-
return /* @__PURE__ */
|
|
29912
|
+
return /* @__PURE__ */ jsx64(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
29218
29913
|
}
|
|
29219
29914
|
if (generation?.status === "running") {
|
|
29220
29915
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -29222,7 +29917,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29222
29917
|
hasRawTokens,
|
|
29223
29918
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
29224
29919
|
});
|
|
29225
|
-
return /* @__PURE__ */
|
|
29920
|
+
return /* @__PURE__ */ jsx64(
|
|
29226
29921
|
GenerationScreen,
|
|
29227
29922
|
{
|
|
29228
29923
|
progress: generation.progress,
|
|
@@ -29234,10 +29929,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29234
29929
|
}
|
|
29235
29930
|
);
|
|
29236
29931
|
}
|
|
29237
|
-
return /* @__PURE__ */
|
|
29932
|
+
return /* @__PURE__ */ jsx64(Fragment21, {});
|
|
29238
29933
|
}
|
|
29239
29934
|
if (pendingLaunch?.cached) {
|
|
29240
|
-
return /* @__PURE__ */
|
|
29935
|
+
return /* @__PURE__ */ jsx64(
|
|
29241
29936
|
TokenReuseScreen,
|
|
29242
29937
|
{
|
|
29243
29938
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -29248,7 +29943,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29248
29943
|
}
|
|
29249
29944
|
);
|
|
29250
29945
|
}
|
|
29251
|
-
return /* @__PURE__ */
|
|
29946
|
+
return /* @__PURE__ */ jsx64(
|
|
29252
29947
|
CredentialsScreen,
|
|
29253
29948
|
{
|
|
29254
29949
|
initial: importDefaults.credentials,
|
|
@@ -29257,19 +29952,19 @@ function App({ importOptions, inkClear }) {
|
|
|
29257
29952
|
}
|
|
29258
29953
|
);
|
|
29259
29954
|
case "help":
|
|
29260
|
-
return /* @__PURE__ */
|
|
29955
|
+
return /* @__PURE__ */ jsx64(HelpScreen, { onDone: goToStart });
|
|
29261
29956
|
case "upgrade":
|
|
29262
|
-
return /* @__PURE__ */
|
|
29957
|
+
return /* @__PURE__ */ jsx64(UpgradeScreen, { onDone: goToStart });
|
|
29263
29958
|
case "settings":
|
|
29264
|
-
return /* @__PURE__ */
|
|
29959
|
+
return /* @__PURE__ */ jsx64(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
29265
29960
|
case "settings-configuration":
|
|
29266
|
-
return /* @__PURE__ */
|
|
29961
|
+
return /* @__PURE__ */ jsx64(ConfigurationScreen, { onDone: goToSettings });
|
|
29267
29962
|
case "settings-opt-in-analytics":
|
|
29268
|
-
return /* @__PURE__ */
|
|
29963
|
+
return /* @__PURE__ */ jsx64(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
29269
29964
|
case "settings-debug-mode":
|
|
29270
|
-
return /* @__PURE__ */
|
|
29965
|
+
return /* @__PURE__ */ jsx64(DebugModeScreen, { onDone: goToSettings });
|
|
29271
29966
|
case "start":
|
|
29272
|
-
return /* @__PURE__ */
|
|
29967
|
+
return /* @__PURE__ */ jsx64(HomeScreen, { onNavigate: setScreen });
|
|
29273
29968
|
}
|
|
29274
29969
|
}
|
|
29275
29970
|
async function runApp(renderApp, importOptions) {
|
|
@@ -29277,7 +29972,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
29277
29972
|
instance.clear?.();
|
|
29278
29973
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
29279
29974
|
};
|
|
29280
|
-
const instance = renderApp(/* @__PURE__ */
|
|
29975
|
+
const instance = renderApp(/* @__PURE__ */ jsx64(App, { importOptions, inkClear }));
|
|
29281
29976
|
await instance.waitUntilExit();
|
|
29282
29977
|
}
|
|
29283
29978
|
export {
|