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