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