@contentful/experience-design-system-cli 2.37.1-dev-build-8b3a1c07.0 → 2.37.1-dev-build-35e4cab1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +482 -1023
- package/dist/index.js +552 -1154
- package/dist/package.json +1 -1
- package/dist/src/tui/home/home.theme.d.ts +0 -8
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +6 -6
- package/dist/src/tui/import/steps/10-flow/theme.d.ts +16 -7
- package/dist/src/tui/settings/contentful-configuration/ContentfulConfigScreen.d.ts +0 -1
- package/dist/src/tui/theme.d.ts +19 -0
- package/legacy/dist/src/index.js +0 -1
- package/legacy/package.json +1 -1
- package/package.json +3 -3
- package/dist/src/tui/help/file-locations.d.ts +0 -23
- package/dist/src/tui/import/steps/09-review/theme.d.ts +0 -9
- package/dist/src/tui/settings/agents/AgentScreens.d.ts +0 -8
- package/dist/src/tui/settings/agents/AgentStatusLine.d.ts +0 -13
- package/dist/src/tui/settings/agents/agent-status.d.ts +0 -29
- package/dist/src/tui/settings/agents/agent-store.d.ts +0 -17
- package/dist/src/tui/settings/agents/apply-binary-overrides.d.ts +0 -13
- package/dist/src/tui/settings/contentful-configuration/ProjectConfigScreen.d.ts +0 -5
- package/dist/src/tui/settings/shared/FieldForm.d.ts +0 -41
package/dist/index.js
CHANGED
|
@@ -1500,7 +1500,7 @@ async function runAgent(options) {
|
|
|
1500
1500
|
promptLen: prompt.length,
|
|
1501
1501
|
promptHead: prompt.slice(0, 500)
|
|
1502
1502
|
});
|
|
1503
|
-
return new Promise((
|
|
1503
|
+
return new Promise((resolve27) => {
|
|
1504
1504
|
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
1505
1505
|
const child = spawn(binary, args, {
|
|
1506
1506
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -1549,7 +1549,7 @@ async function runAgent(options) {
|
|
|
1549
1549
|
stderrLen: stderr.length,
|
|
1550
1550
|
stderrTail: stderr.slice(-1e3)
|
|
1551
1551
|
});
|
|
1552
|
-
|
|
1552
|
+
resolve27(result);
|
|
1553
1553
|
});
|
|
1554
1554
|
});
|
|
1555
1555
|
}
|
|
@@ -1571,7 +1571,7 @@ async function checkAgentAuth(agent) {
|
|
|
1571
1571
|
return "not-found";
|
|
1572
1572
|
if (agent !== "claude")
|
|
1573
1573
|
return "ok";
|
|
1574
|
-
return new Promise((
|
|
1574
|
+
return new Promise((resolve27) => {
|
|
1575
1575
|
const child = spawn2(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
1576
1576
|
let stdout = "";
|
|
1577
1577
|
let done = false;
|
|
@@ -1580,7 +1580,7 @@ async function checkAgentAuth(agent) {
|
|
|
1580
1580
|
return;
|
|
1581
1581
|
done = true;
|
|
1582
1582
|
child.kill("SIGTERM");
|
|
1583
|
-
|
|
1583
|
+
resolve27("unauthenticated");
|
|
1584
1584
|
}, 5e3);
|
|
1585
1585
|
child.stdout?.on("data", (chunk) => {
|
|
1586
1586
|
stdout += chunk.toString();
|
|
@@ -1591,14 +1591,14 @@ async function checkAgentAuth(agent) {
|
|
|
1591
1591
|
done = true;
|
|
1592
1592
|
clearTimeout(timer);
|
|
1593
1593
|
if (code !== 0) {
|
|
1594
|
-
|
|
1594
|
+
resolve27("unauthenticated");
|
|
1595
1595
|
return;
|
|
1596
1596
|
}
|
|
1597
1597
|
try {
|
|
1598
1598
|
const status = JSON.parse(stdout);
|
|
1599
|
-
|
|
1599
|
+
resolve27(status.loggedIn ? "ok" : "unauthenticated");
|
|
1600
1600
|
} catch {
|
|
1601
|
-
|
|
1601
|
+
resolve27("unauthenticated");
|
|
1602
1602
|
}
|
|
1603
1603
|
});
|
|
1604
1604
|
});
|
|
@@ -1608,9 +1608,9 @@ async function binaryIsOnPath(binary) {
|
|
|
1608
1608
|
const fs = await import("node:fs/promises");
|
|
1609
1609
|
return fs.access(binary).then(() => true, () => false);
|
|
1610
1610
|
}
|
|
1611
|
-
return new Promise((
|
|
1611
|
+
return new Promise((resolve27) => {
|
|
1612
1612
|
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
1613
|
-
child.on("close", (code) =>
|
|
1613
|
+
child.on("close", (code) => resolve27(code === 0));
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
1616
|
var init_check_agent_auth = __esm({
|
|
@@ -7916,10 +7916,10 @@ function extractVueSlotsFromSetup(options) {
|
|
|
7916
7916
|
if (!body)
|
|
7917
7917
|
return [];
|
|
7918
7918
|
const slotsByName = /* @__PURE__ */ new Map();
|
|
7919
|
-
for (const
|
|
7920
|
-
if (
|
|
7919
|
+
for (const access6 of body.getDescendantsOfKind(SyntaxKind5.PropertyAccessExpression)) {
|
|
7920
|
+
if (access6.getExpression().getText() !== slotsName)
|
|
7921
7921
|
continue;
|
|
7922
|
-
const slotName =
|
|
7922
|
+
const slotName = access6.getName();
|
|
7923
7923
|
if (!slotsByName.has(slotName)) {
|
|
7924
7924
|
slotsByName.set(slotName, {
|
|
7925
7925
|
name: slotName,
|
|
@@ -14333,7 +14333,7 @@ function errorMessage(error) {
|
|
|
14333
14333
|
return error instanceof Error && error.message ? error.message : String(error);
|
|
14334
14334
|
}
|
|
14335
14335
|
function defaultSleep(delayMs) {
|
|
14336
|
-
return new Promise((
|
|
14336
|
+
return new Promise((resolve27) => setTimeout(resolve27, delayMs));
|
|
14337
14337
|
}
|
|
14338
14338
|
var MAX_RETRY_AFTER_MS;
|
|
14339
14339
|
var init_http_utils = __esm({
|
|
@@ -14609,7 +14609,7 @@ var init_api_client = __esm({
|
|
|
14609
14609
|
const progress = maxAttempts > 1 ? attempt / (maxAttempts - 1) : 0;
|
|
14610
14610
|
const baseDelay = intervalMs + (maxIntervalMs - intervalMs) * progress;
|
|
14611
14611
|
const jitter = Math.random() * baseDelay * 0.15;
|
|
14612
|
-
await new Promise((
|
|
14612
|
+
await new Promise((resolve27) => setTimeout(resolve27, baseDelay + jitter));
|
|
14613
14613
|
}
|
|
14614
14614
|
}
|
|
14615
14615
|
throw new Error(`Operation ${operationId} timed out after ${maxAttempts} attempts`);
|
|
@@ -18527,7 +18527,7 @@ async function retryDatabaseWrite(operation, attempts = 8) {
|
|
|
18527
18527
|
const message = error instanceof Error ? error.message : String(error);
|
|
18528
18528
|
if (!/database is locked|database is busy/i.test(message) || attempt >= attempts)
|
|
18529
18529
|
throw error;
|
|
18530
|
-
await new Promise((
|
|
18530
|
+
await new Promise((resolve27) => setTimeout(resolve27, Math.min(250 * attempt, 2e3)));
|
|
18531
18531
|
}
|
|
18532
18532
|
}
|
|
18533
18533
|
}
|
|
@@ -19446,7 +19446,6 @@ var init_src4 = __esm({
|
|
|
19446
19446
|
init_agents();
|
|
19447
19447
|
init_agent_name();
|
|
19448
19448
|
init_models();
|
|
19449
|
-
init_binaries();
|
|
19450
19449
|
init_is_agent_name();
|
|
19451
19450
|
init_agent_supports_bedrock();
|
|
19452
19451
|
init_check_agent_auth();
|
|
@@ -19566,97 +19565,6 @@ var init_v1_store = __esm({
|
|
|
19566
19565
|
}
|
|
19567
19566
|
});
|
|
19568
19567
|
|
|
19569
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/agent-store.ts
|
|
19570
|
-
function emptyAgents() {
|
|
19571
|
-
return Object.fromEntries(AGENT_NAMES.map((name) => [name, { model: "", binary: "" }]));
|
|
19572
|
-
}
|
|
19573
|
-
async function readAgentConfig() {
|
|
19574
|
-
const store = await readV1Store();
|
|
19575
|
-
const stored = asString(store["agent"]);
|
|
19576
|
-
const defaultAgent = isAgentName(stored) ? stored : DEFAULT_AGENT3;
|
|
19577
|
-
const agents = emptyAgents();
|
|
19578
|
-
const saved = store["agents"];
|
|
19579
|
-
if (saved && typeof saved === "object") {
|
|
19580
|
-
for (const name of AGENT_NAMES) {
|
|
19581
|
-
const entry = saved[name];
|
|
19582
|
-
if (entry && typeof entry === "object") {
|
|
19583
|
-
const fields = entry;
|
|
19584
|
-
agents[name] = { model: asString(fields["model"]), binary: asString(fields["binary"]) };
|
|
19585
|
-
}
|
|
19586
|
-
}
|
|
19587
|
-
}
|
|
19588
|
-
const legacyModel = asString(store["agentModel"]);
|
|
19589
|
-
if (legacyModel && !agents[defaultAgent].model)
|
|
19590
|
-
agents[defaultAgent] = { ...agents[defaultAgent], model: legacyModel };
|
|
19591
|
-
return { defaultAgent, agents };
|
|
19592
|
-
}
|
|
19593
|
-
async function writeAgentConfig(config) {
|
|
19594
|
-
const existing = await readV1Store();
|
|
19595
|
-
const merged = { ...existing };
|
|
19596
|
-
const agents = {};
|
|
19597
|
-
for (const name of AGENT_NAMES) {
|
|
19598
|
-
const model = config.agents[name].model.trim();
|
|
19599
|
-
const binary = config.agents[name].binary.trim();
|
|
19600
|
-
if (model || binary) agents[name] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
|
|
19601
|
-
}
|
|
19602
|
-
merged["agent"] = config.defaultAgent;
|
|
19603
|
-
const defaultModel = agents[config.defaultAgent]?.model;
|
|
19604
|
-
if (defaultModel) merged["agentModel"] = defaultModel;
|
|
19605
|
-
else delete merged["agentModel"];
|
|
19606
|
-
if (Object.keys(agents).length > 0) merged["agents"] = agents;
|
|
19607
|
-
else delete merged["agents"];
|
|
19608
|
-
await writeV1Store(merged);
|
|
19609
|
-
}
|
|
19610
|
-
var DEFAULT_AGENT3, AGENT_LABELS, AGENT_HINTS, asString;
|
|
19611
|
-
var init_agent_store = __esm({
|
|
19612
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/agent-store.ts"() {
|
|
19613
|
-
"use strict";
|
|
19614
|
-
init_src4();
|
|
19615
|
-
init_v1_store();
|
|
19616
|
-
DEFAULT_AGENT3 = "claude";
|
|
19617
|
-
AGENT_LABELS = {
|
|
19618
|
-
claude: "Claude Code",
|
|
19619
|
-
codex: "OpenAI Codex",
|
|
19620
|
-
opencode: "OpenCode",
|
|
19621
|
-
cursor: "Cursor",
|
|
19622
|
-
copilot: "GitHub Copilot"
|
|
19623
|
-
};
|
|
19624
|
-
AGENT_HINTS = {
|
|
19625
|
-
claude: "claude",
|
|
19626
|
-
codex: "codex",
|
|
19627
|
-
opencode: "opencode",
|
|
19628
|
-
cursor: "cursor-agent",
|
|
19629
|
-
copilot: "copilot"
|
|
19630
|
-
};
|
|
19631
|
-
asString = (value) => typeof value === "string" ? value : "";
|
|
19632
|
-
}
|
|
19633
|
-
});
|
|
19634
|
-
|
|
19635
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/apply-binary-overrides.ts
|
|
19636
|
-
function applyBinaryOverrides(config) {
|
|
19637
|
-
for (const name of AGENT_NAMES) {
|
|
19638
|
-
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
19639
|
-
const binary = config.agents[name].binary.trim();
|
|
19640
|
-
if (binary) {
|
|
19641
|
-
if (!shellValues.has(key)) shellValues.set(key, process.env[key]);
|
|
19642
|
-
process.env[key] = binary;
|
|
19643
|
-
} else if (shellValues.has(key)) {
|
|
19644
|
-
const shellValue = shellValues.get(key);
|
|
19645
|
-
if (shellValue === void 0) delete process.env[key];
|
|
19646
|
-
else process.env[key] = shellValue;
|
|
19647
|
-
shellValues.delete(key);
|
|
19648
|
-
}
|
|
19649
|
-
}
|
|
19650
|
-
}
|
|
19651
|
-
var shellValues;
|
|
19652
|
-
var init_apply_binary_overrides = __esm({
|
|
19653
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/apply-binary-overrides.ts"() {
|
|
19654
|
-
"use strict";
|
|
19655
|
-
init_src4();
|
|
19656
|
-
shellValues = /* @__PURE__ */ new Map();
|
|
19657
|
-
}
|
|
19658
|
-
});
|
|
19659
|
-
|
|
19660
19568
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
19661
19569
|
async function readAnalyticsSetting() {
|
|
19662
19570
|
const store = await readV1Store();
|
|
@@ -19678,6 +19586,52 @@ var init_analytics_store = __esm({
|
|
|
19678
19586
|
}
|
|
19679
19587
|
});
|
|
19680
19588
|
|
|
19589
|
+
// packages/experience-design-system-cli/src/tui/theme.ts
|
|
19590
|
+
function detectColorMode(env = process.env) {
|
|
19591
|
+
const bg = env.COLORFGBG?.split(";").pop();
|
|
19592
|
+
if (bg === "7" || bg === "15") return "light";
|
|
19593
|
+
return "dark";
|
|
19594
|
+
}
|
|
19595
|
+
var DARK, LIGHT, PALETTE;
|
|
19596
|
+
var init_theme = __esm({
|
|
19597
|
+
"packages/experience-design-system-cli/src/tui/theme.ts"() {
|
|
19598
|
+
"use strict";
|
|
19599
|
+
DARK = {
|
|
19600
|
+
text: "#f7f9fa",
|
|
19601
|
+
// gray100
|
|
19602
|
+
muted: "#aec1cc",
|
|
19603
|
+
// gray400
|
|
19604
|
+
border: "#aec1cc",
|
|
19605
|
+
// gray400
|
|
19606
|
+
accent: "#40a0ff",
|
|
19607
|
+
// blue400
|
|
19608
|
+
error: "#ff707d",
|
|
19609
|
+
// red400
|
|
19610
|
+
success: "#5DB057",
|
|
19611
|
+
// green400
|
|
19612
|
+
warning: "#FFC835"
|
|
19613
|
+
// yellow500
|
|
19614
|
+
};
|
|
19615
|
+
LIGHT = {
|
|
19616
|
+
text: "#111b2b",
|
|
19617
|
+
// gray900
|
|
19618
|
+
muted: "#5a657c",
|
|
19619
|
+
// gray600
|
|
19620
|
+
border: "#5a657c",
|
|
19621
|
+
// gray600
|
|
19622
|
+
accent: "#0059c8",
|
|
19623
|
+
// semantic primary
|
|
19624
|
+
error: "#bd002a",
|
|
19625
|
+
// semantic negative
|
|
19626
|
+
success: "#006D23",
|
|
19627
|
+
// semantic positive
|
|
19628
|
+
warning: "#CC4500"
|
|
19629
|
+
// semantic warning
|
|
19630
|
+
};
|
|
19631
|
+
PALETTE = detectColorMode() === "light" ? LIGHT : DARK;
|
|
19632
|
+
}
|
|
19633
|
+
});
|
|
19634
|
+
|
|
19681
19635
|
// packages/experience-design-system-cli/src/tui/home/home.theme.ts
|
|
19682
19636
|
function brandBar(width, ramp = BRAND_RAMP) {
|
|
19683
19637
|
if (width <= 0 || ramp.length === 0) return [];
|
|
@@ -19688,28 +19642,12 @@ function brandBar(width, ramp = BRAND_RAMP) {
|
|
|
19688
19642
|
color
|
|
19689
19643
|
})).filter((segment) => segment.text.length > 0);
|
|
19690
19644
|
}
|
|
19691
|
-
var
|
|
19645
|
+
var BRAND_RAMP, BAR_CELL, FOCUS_MARKER;
|
|
19692
19646
|
var init_home_theme = __esm({
|
|
19693
19647
|
"packages/experience-design-system-cli/src/tui/home/home.theme.ts"() {
|
|
19694
19648
|
"use strict";
|
|
19695
|
-
|
|
19696
|
-
|
|
19697
|
-
green: "#00C459",
|
|
19698
|
-
orange: "#E44F20",
|
|
19699
|
-
yellow: "#FFDA00",
|
|
19700
|
-
white: "#FFFFFF",
|
|
19701
|
-
slate: "#8B8D91",
|
|
19702
|
-
steel: "#C4D1DE"
|
|
19703
|
-
};
|
|
19704
|
-
PALETTE = {
|
|
19705
|
-
accent: BRAND.blue,
|
|
19706
|
-
success: BRAND.green,
|
|
19707
|
-
error: BRAND.orange,
|
|
19708
|
-
warning: BRAND.yellow,
|
|
19709
|
-
muted: BRAND.slate,
|
|
19710
|
-
border: BRAND.steel
|
|
19711
|
-
};
|
|
19712
|
-
BRAND_RAMP = [BRAND.blue, BRAND.orange, BRAND.yellow];
|
|
19649
|
+
init_theme();
|
|
19650
|
+
BRAND_RAMP = [PALETTE.accent, PALETTE.error, PALETTE.warning];
|
|
19713
19651
|
BAR_CELL = "\u2501";
|
|
19714
19652
|
FOCUS_MARKER = "\u276F";
|
|
19715
19653
|
}
|
|
@@ -19891,6 +19829,7 @@ var VERSION, HEADING, SUBTITLE, MIN_TERMINAL_WIDTH, START_ITEMS;
|
|
|
19891
19829
|
var init_home = __esm({
|
|
19892
19830
|
"packages/experience-design-system-cli/src/tui/home/home.tsx"() {
|
|
19893
19831
|
"use strict";
|
|
19832
|
+
init_theme();
|
|
19894
19833
|
init_home_theme();
|
|
19895
19834
|
init_version();
|
|
19896
19835
|
init_use_terminal_width();
|
|
@@ -19931,7 +19870,7 @@ function ImportScreen({ exitCode, onDone }) {
|
|
|
19931
19870
|
var init_PageContainer = __esm({
|
|
19932
19871
|
"packages/experience-design-system-cli/src/tui/import/PageContainer.tsx"() {
|
|
19933
19872
|
"use strict";
|
|
19934
|
-
|
|
19873
|
+
init_theme();
|
|
19935
19874
|
}
|
|
19936
19875
|
});
|
|
19937
19876
|
|
|
@@ -20011,7 +19950,7 @@ var RULE, OVERVIEW;
|
|
|
20011
19950
|
var init_screen = __esm({
|
|
20012
19951
|
"packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx"() {
|
|
20013
19952
|
"use strict";
|
|
20014
|
-
|
|
19953
|
+
init_theme();
|
|
20015
19954
|
init_controls();
|
|
20016
19955
|
init_logic();
|
|
20017
19956
|
RULE = "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500";
|
|
@@ -20160,7 +20099,7 @@ function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
|
|
|
20160
20099
|
var init_screen2 = __esm({
|
|
20161
20100
|
"packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx"() {
|
|
20162
20101
|
"use strict";
|
|
20163
|
-
|
|
20102
|
+
init_theme();
|
|
20164
20103
|
init_controls2();
|
|
20165
20104
|
init_logic2();
|
|
20166
20105
|
init_validate_path();
|
|
@@ -20381,7 +20320,7 @@ function PathValidationScreen({
|
|
|
20381
20320
|
var init_screen3 = __esm({
|
|
20382
20321
|
"packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx"() {
|
|
20383
20322
|
"use strict";
|
|
20384
|
-
|
|
20323
|
+
init_theme();
|
|
20385
20324
|
init_resolve_user_path();
|
|
20386
20325
|
init_controls3();
|
|
20387
20326
|
init_scan_files();
|
|
@@ -20590,7 +20529,7 @@ var LABELS;
|
|
|
20590
20529
|
var init_screen4 = __esm({
|
|
20591
20530
|
"packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx"() {
|
|
20592
20531
|
"use strict";
|
|
20593
|
-
|
|
20532
|
+
init_theme();
|
|
20594
20533
|
init_controls4();
|
|
20595
20534
|
init_src4();
|
|
20596
20535
|
init_logic4();
|
|
@@ -20677,7 +20616,7 @@ function ErrorStep({
|
|
|
20677
20616
|
var init_error_step = __esm({
|
|
20678
20617
|
"packages/experience-design-system-cli/src/tui/import/shared/error-step/error-step.tsx"() {
|
|
20679
20618
|
"use strict";
|
|
20680
|
-
|
|
20619
|
+
init_theme();
|
|
20681
20620
|
init_controls5();
|
|
20682
20621
|
init_logic5();
|
|
20683
20622
|
}
|
|
@@ -20757,7 +20696,7 @@ function GateStep({
|
|
|
20757
20696
|
var init_gate_step = __esm({
|
|
20758
20697
|
"packages/experience-design-system-cli/src/tui/import/shared/gate-step/gate-step.tsx"() {
|
|
20759
20698
|
"use strict";
|
|
20760
|
-
|
|
20699
|
+
init_theme();
|
|
20761
20700
|
init_controls6();
|
|
20762
20701
|
init_logic6();
|
|
20763
20702
|
}
|
|
@@ -20785,14 +20724,15 @@ var init_logic7 = __esm({
|
|
|
20785
20724
|
// packages/experience-design-system-cli/src/tui/import/shared/running-step/theme.ts
|
|
20786
20725
|
import { defaultTheme, extendTheme } from "@inkjs/ui";
|
|
20787
20726
|
var PROGRESS_THEME;
|
|
20788
|
-
var
|
|
20727
|
+
var init_theme2 = __esm({
|
|
20789
20728
|
"packages/experience-design-system-cli/src/tui/import/shared/running-step/theme.ts"() {
|
|
20790
20729
|
"use strict";
|
|
20730
|
+
init_theme();
|
|
20791
20731
|
PROGRESS_THEME = extendTheme(defaultTheme, {
|
|
20792
20732
|
components: {
|
|
20793
20733
|
ProgressBar: {
|
|
20794
20734
|
styles: {
|
|
20795
|
-
completed: () => ({ color:
|
|
20735
|
+
completed: () => ({ color: PALETTE.accent })
|
|
20796
20736
|
}
|
|
20797
20737
|
}
|
|
20798
20738
|
}
|
|
@@ -20866,9 +20806,9 @@ var RULE2;
|
|
|
20866
20806
|
var init_running_step = __esm({
|
|
20867
20807
|
"packages/experience-design-system-cli/src/tui/import/shared/running-step/running-step.tsx"() {
|
|
20868
20808
|
"use strict";
|
|
20869
|
-
init_home_theme();
|
|
20870
|
-
init_logic7();
|
|
20871
20809
|
init_theme();
|
|
20810
|
+
init_logic7();
|
|
20811
|
+
init_theme2();
|
|
20872
20812
|
init_use_elapsed();
|
|
20873
20813
|
RULE2 = "\u2500".repeat(40);
|
|
20874
20814
|
}
|
|
@@ -21415,10 +21355,10 @@ var init_use_extraction = __esm({
|
|
|
21415
21355
|
|
|
21416
21356
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/theme.ts
|
|
21417
21357
|
var PALETTE2;
|
|
21418
|
-
var
|
|
21358
|
+
var init_theme3 = __esm({
|
|
21419
21359
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/theme.ts"() {
|
|
21420
21360
|
"use strict";
|
|
21421
|
-
|
|
21361
|
+
init_theme();
|
|
21422
21362
|
PALETTE2 = {
|
|
21423
21363
|
info: PALETTE.accent,
|
|
21424
21364
|
success: PALETTE.success,
|
|
@@ -21530,7 +21470,7 @@ var TWO_COLUMN_MIN_WIDTH, SCOPE_GATE_MAIN_COLUMN_WIDTH, ACCEPTED_COMPONENTS_COLU
|
|
|
21530
21470
|
var init_columns = __esm({
|
|
21531
21471
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/columns.ts"() {
|
|
21532
21472
|
"use strict";
|
|
21533
|
-
|
|
21473
|
+
init_theme3();
|
|
21534
21474
|
TWO_COLUMN_MIN_WIDTH = 100;
|
|
21535
21475
|
SCOPE_GATE_MAIN_COLUMN_WIDTH = 54;
|
|
21536
21476
|
ACCEPTED_COMPONENTS_COLUMN_WIDTH = 36;
|
|
@@ -21610,7 +21550,7 @@ var MIN_TERMINAL_PANEL_HEIGHT;
|
|
|
21610
21550
|
var init_windowed_panel = __esm({
|
|
21611
21551
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.tsx"() {
|
|
21612
21552
|
"use strict";
|
|
21613
|
-
|
|
21553
|
+
init_theme3();
|
|
21614
21554
|
MIN_TERMINAL_PANEL_HEIGHT = 5;
|
|
21615
21555
|
}
|
|
21616
21556
|
});
|
|
@@ -21661,7 +21601,7 @@ var init_added_column = __esm({
|
|
|
21661
21601
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx"() {
|
|
21662
21602
|
"use strict";
|
|
21663
21603
|
init_columns();
|
|
21664
|
-
|
|
21604
|
+
init_theme3();
|
|
21665
21605
|
init_windowed_panel();
|
|
21666
21606
|
}
|
|
21667
21607
|
});
|
|
@@ -21696,7 +21636,7 @@ function CyclesPanel({ cycles, cursor }) {
|
|
|
21696
21636
|
var init_cycles_panel = __esm({
|
|
21697
21637
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/cycles-panel.tsx"() {
|
|
21698
21638
|
"use strict";
|
|
21699
|
-
|
|
21639
|
+
init_theme3();
|
|
21700
21640
|
}
|
|
21701
21641
|
});
|
|
21702
21642
|
|
|
@@ -21714,7 +21654,7 @@ function RejectPrompt({ pending }) {
|
|
|
21714
21654
|
var init_reject_prompt = __esm({
|
|
21715
21655
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/reject-prompt.tsx"() {
|
|
21716
21656
|
"use strict";
|
|
21717
|
-
|
|
21657
|
+
init_theme3();
|
|
21718
21658
|
}
|
|
21719
21659
|
});
|
|
21720
21660
|
|
|
@@ -21730,7 +21670,7 @@ function legendEntry(keyBracket, label, active = false) {
|
|
|
21730
21670
|
var init_LegendEntry = __esm({
|
|
21731
21671
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/LegendEntry.tsx"() {
|
|
21732
21672
|
"use strict";
|
|
21733
|
-
|
|
21673
|
+
init_theme3();
|
|
21734
21674
|
}
|
|
21735
21675
|
});
|
|
21736
21676
|
|
|
@@ -21751,7 +21691,7 @@ function CompactControlBar({ hasGroupRoots, searchActive }) {
|
|
|
21751
21691
|
var init_CompactControlBar = __esm({
|
|
21752
21692
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CompactControlBar.tsx"() {
|
|
21753
21693
|
"use strict";
|
|
21754
|
-
|
|
21694
|
+
init_theme3();
|
|
21755
21695
|
init_LegendEntry();
|
|
21756
21696
|
}
|
|
21757
21697
|
});
|
|
@@ -21790,7 +21730,7 @@ function CounterStrip(props) {
|
|
|
21790
21730
|
var init_CounterStrip = __esm({
|
|
21791
21731
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CounterStrip.tsx"() {
|
|
21792
21732
|
"use strict";
|
|
21793
|
-
|
|
21733
|
+
init_theme3();
|
|
21794
21734
|
}
|
|
21795
21735
|
});
|
|
21796
21736
|
|
|
@@ -21855,7 +21795,7 @@ var DEFAULT_MAX_ROWS;
|
|
|
21855
21795
|
var init_GotoBanner = __esm({
|
|
21856
21796
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.tsx"() {
|
|
21857
21797
|
"use strict";
|
|
21858
|
-
|
|
21798
|
+
init_theme3();
|
|
21859
21799
|
DEFAULT_MAX_ROWS = 15;
|
|
21860
21800
|
}
|
|
21861
21801
|
});
|
|
@@ -22234,7 +22174,7 @@ function PreviewBadge({
|
|
|
22234
22174
|
var init_badge = __esm({
|
|
22235
22175
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/badge.tsx"() {
|
|
22236
22176
|
"use strict";
|
|
22237
|
-
|
|
22177
|
+
init_theme3();
|
|
22238
22178
|
}
|
|
22239
22179
|
});
|
|
22240
22180
|
|
|
@@ -22729,7 +22669,7 @@ var init_GroupedSidebar = __esm({
|
|
|
22729
22669
|
"use strict";
|
|
22730
22670
|
init_composite_closure();
|
|
22731
22671
|
init_badge();
|
|
22732
|
-
|
|
22672
|
+
init_theme3();
|
|
22733
22673
|
init_windowed_panel();
|
|
22734
22674
|
GLYPH_EXPAND_COLLAPSED = "\u25B8";
|
|
22735
22675
|
GLYPH_EXPAND_EXPANDED = "\u25BE";
|
|
@@ -23024,7 +22964,7 @@ function SearchMatchSummary({
|
|
|
23024
22964
|
var init_SearchMatchSummary = __esm({
|
|
23025
22965
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.tsx"() {
|
|
23026
22966
|
"use strict";
|
|
23027
|
-
|
|
22967
|
+
init_theme3();
|
|
23028
22968
|
init_sidebar_input();
|
|
23029
22969
|
}
|
|
23030
22970
|
});
|
|
@@ -24392,7 +24332,7 @@ var init_screen7 = __esm({
|
|
|
24392
24332
|
init_HelpOverlay();
|
|
24393
24333
|
init_SearchMatchSummary();
|
|
24394
24334
|
init_sidebar_help();
|
|
24395
|
-
|
|
24335
|
+
init_theme3();
|
|
24396
24336
|
init_use_scope_gate();
|
|
24397
24337
|
HELP_SECTIONS = [
|
|
24398
24338
|
{
|
|
@@ -25280,24 +25220,6 @@ var init_screen9 = __esm({
|
|
|
25280
25220
|
}
|
|
25281
25221
|
});
|
|
25282
25222
|
|
|
25283
|
-
// packages/experience-design-system-cli/src/tui/import/steps/09-review/theme.ts
|
|
25284
|
-
var PALETTE3;
|
|
25285
|
-
var init_theme3 = __esm({
|
|
25286
|
-
"packages/experience-design-system-cli/src/tui/import/steps/09-review/theme.ts"() {
|
|
25287
|
-
"use strict";
|
|
25288
|
-
init_home_theme();
|
|
25289
|
-
PALETTE3 = {
|
|
25290
|
-
info: PALETTE.accent,
|
|
25291
|
-
success: PALETTE.success,
|
|
25292
|
-
error: PALETTE.error,
|
|
25293
|
-
warning: PALETTE.warning,
|
|
25294
|
-
muted: PALETTE.muted,
|
|
25295
|
-
border: PALETTE.border,
|
|
25296
|
-
inverse: "#FFFFFF"
|
|
25297
|
-
};
|
|
25298
|
-
}
|
|
25299
|
-
});
|
|
25300
|
-
|
|
25301
25223
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
|
|
25302
25224
|
function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
25303
25225
|
if (!selected) return "";
|
|
@@ -25789,13 +25711,13 @@ function serializeState(state2, originalJson) {
|
|
|
25789
25711
|
}
|
|
25790
25712
|
function Picker({ value, active }) {
|
|
25791
25713
|
return /* @__PURE__ */ jsxs22(Box21, { children: [
|
|
25792
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
25793
|
-
/* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
25794
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
25714
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u2039" }),
|
|
25715
|
+
/* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : void 0, bold: active, children: value }),
|
|
25716
|
+
active && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u203A" })
|
|
25795
25717
|
] });
|
|
25796
25718
|
}
|
|
25797
25719
|
function Toggle({ value, active }) {
|
|
25798
|
-
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
25720
|
+
return /* @__PURE__ */ jsx27(Box21, { children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.warning : value ? PALETTE.success : PALETTE.border, children: value ? "[\u2713]" : "[ ]" }) });
|
|
25799
25721
|
}
|
|
25800
25722
|
function InlinePropField({
|
|
25801
25723
|
label,
|
|
@@ -25805,7 +25727,7 @@ function InlinePropField({
|
|
|
25805
25727
|
width
|
|
25806
25728
|
}) {
|
|
25807
25729
|
return /* @__PURE__ */ jsxs22(Box21, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
25808
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25730
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, wrap: "truncate-end", children: [
|
|
25809
25731
|
focused ? "\u203A " : " ",
|
|
25810
25732
|
label
|
|
25811
25733
|
] }),
|
|
@@ -25826,7 +25748,7 @@ function DefaultValueRow({
|
|
|
25826
25748
|
focused
|
|
25827
25749
|
}) {
|
|
25828
25750
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
25829
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25751
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25830
25752
|
focused ? "\u203A " : " ",
|
|
25831
25753
|
"default:"
|
|
25832
25754
|
] }),
|
|
@@ -25841,7 +25763,7 @@ function RowLabel({
|
|
|
25841
25763
|
return /* @__PURE__ */ jsxs22(
|
|
25842
25764
|
Text23,
|
|
25843
25765
|
{
|
|
25844
|
-
color: selected ?
|
|
25766
|
+
color: selected ? PALETTE.text : PALETTE.accent,
|
|
25845
25767
|
bold: selected,
|
|
25846
25768
|
backgroundColor: selected ? "blue" : void 0,
|
|
25847
25769
|
wrap: "truncate-end",
|
|
@@ -25859,7 +25781,7 @@ function ValueInputRow({
|
|
|
25859
25781
|
cursorVisible
|
|
25860
25782
|
}) {
|
|
25861
25783
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, children: [
|
|
25862
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
25784
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.accent, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
25863
25785
|
/* @__PURE__ */ jsx27(Text23, { children: valueText }),
|
|
25864
25786
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: " " })
|
|
25865
25787
|
] });
|
|
@@ -25876,7 +25798,7 @@ function EditableListItem({
|
|
|
25876
25798
|
if (isBeingEdited) {
|
|
25877
25799
|
return /* @__PURE__ */ jsx27(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
25878
25800
|
}
|
|
25879
|
-
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
25801
|
+
return /* @__PURE__ */ jsx27(Box21, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: active ? PALETTE.accent : void 0, children: active ? `${figures5.pointer} ${value}` : ` ${value}` }) });
|
|
25880
25802
|
}
|
|
25881
25803
|
function EditableValueList({
|
|
25882
25804
|
values,
|
|
@@ -25890,7 +25812,7 @@ function EditableValueList({
|
|
|
25890
25812
|
showAddInput
|
|
25891
25813
|
}) {
|
|
25892
25814
|
return /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
25893
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
25815
|
+
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 }) })),
|
|
25894
25816
|
values.map((value, index) => /* @__PURE__ */ jsx27(
|
|
25895
25817
|
EditableListItem,
|
|
25896
25818
|
{
|
|
@@ -25916,11 +25838,11 @@ function DefaultSubRow({
|
|
|
25916
25838
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
25917
25839
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
25918
25840
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
25919
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25841
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25920
25842
|
focused ? "\u203A " : " ",
|
|
25921
25843
|
"default:"
|
|
25922
25844
|
] }),
|
|
25923
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
25845
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(not applicable)" })
|
|
25924
25846
|
] });
|
|
25925
25847
|
}
|
|
25926
25848
|
if (prop.type === "boolean") {
|
|
@@ -25930,11 +25852,11 @@ function DefaultSubRow({
|
|
|
25930
25852
|
if (prop.type === "enum") {
|
|
25931
25853
|
if (prop.values.length === 0) {
|
|
25932
25854
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
25933
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25855
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25934
25856
|
focused ? "\u203A " : " ",
|
|
25935
25857
|
"default:"
|
|
25936
25858
|
] }),
|
|
25937
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
25859
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE.muted, children: "(no values defined)" })
|
|
25938
25860
|
] });
|
|
25939
25861
|
}
|
|
25940
25862
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
@@ -25943,11 +25865,11 @@ function DefaultSubRow({
|
|
|
25943
25865
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
25944
25866
|
if (active) {
|
|
25945
25867
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "row", flexShrink: 0, children: [
|
|
25946
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25868
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25947
25869
|
focused ? "\u203A " : " ",
|
|
25948
25870
|
"default:"
|
|
25949
25871
|
] }),
|
|
25950
|
-
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor:
|
|
25872
|
+
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
25951
25873
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(0, textCursor) }),
|
|
25952
25874
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
25953
25875
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(textCursor + 1) })
|
|
@@ -25955,11 +25877,11 @@ function DefaultSubRow({
|
|
|
25955
25877
|
] });
|
|
25956
25878
|
}
|
|
25957
25879
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
25958
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25880
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25959
25881
|
focused ? "\u203A " : " ",
|
|
25960
25882
|
"default:"
|
|
25961
25883
|
] }),
|
|
25962
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 :
|
|
25884
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 : PALETTE.muted, children: value || "(none)" })
|
|
25963
25885
|
] });
|
|
25964
25886
|
}
|
|
25965
25887
|
function DescriptionField({
|
|
@@ -25975,15 +25897,15 @@ function DescriptionField({
|
|
|
25975
25897
|
}) {
|
|
25976
25898
|
if (compact) {
|
|
25977
25899
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25978
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25900
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25979
25901
|
focused ? "\u203A " : " ",
|
|
25980
25902
|
label
|
|
25981
25903
|
] }),
|
|
25982
|
-
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 :
|
|
25904
|
+
/* @__PURE__ */ jsx27(Text23, { wrap: "truncate-end", color: value ? void 0 : PALETTE.muted, children: value || "\u2014" })
|
|
25983
25905
|
] });
|
|
25984
25906
|
}
|
|
25985
25907
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
25986
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25908
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE.warning : PALETTE.muted, bold: focused, children: [
|
|
25987
25909
|
focused ? "\u203A " : " ",
|
|
25988
25910
|
label
|
|
25989
25911
|
] }),
|
|
@@ -26047,7 +25969,7 @@ function PropRow({
|
|
|
26047
25969
|
] }),
|
|
26048
25970
|
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" }) }),
|
|
26049
25971
|
prop.type === "enum" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
26050
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ?
|
|
25972
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ? PALETTE.warning : PALETTE.muted, bold: activeField === "values", children: [
|
|
26051
25973
|
activeField === "values" ? "\u203A " : " ",
|
|
26052
25974
|
"values:"
|
|
26053
25975
|
] }),
|
|
@@ -26068,27 +25990,27 @@ function PropRow({
|
|
|
26068
25990
|
}
|
|
26069
25991
|
),
|
|
26070
25992
|
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
26071
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ?
|
|
25993
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ? PALETTE.warning : PALETTE.muted, bold: activeField === "allowed", children: [
|
|
26072
25994
|
activeField === "allowed" ? "\u203A " : " ",
|
|
26073
25995
|
"allowed:"
|
|
26074
25996
|
] }),
|
|
26075
|
-
editingField && activeField === "allowed" ? /* @__PURE__ */ jsx27(Box21, { width: Math.max(1, width - 4), borderStyle: "round", borderColor:
|
|
25997
|
+
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(
|
|
26076
25998
|
Text23,
|
|
26077
25999
|
{
|
|
26078
|
-
color: activeField !== "allowed" && prop.allowed.length === 0 ?
|
|
26000
|
+
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE.muted : void 0,
|
|
26079
26001
|
wrap: "wrap",
|
|
26080
26002
|
children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)"
|
|
26081
26003
|
}
|
|
26082
26004
|
)
|
|
26083
26005
|
] }),
|
|
26084
|
-
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
26006
|
+
selected && showRationale && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: (() => {
|
|
26085
26007
|
const max = Math.max(8, width - 8);
|
|
26086
26008
|
const text = `~ ${rationale}`;
|
|
26087
26009
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
26088
26010
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
26089
26011
|
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, flexDirection: "column", children: [
|
|
26090
26012
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
26091
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26013
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "values:" }),
|
|
26092
26014
|
activeField === "values" && /* @__PURE__ */ jsx27(Text23, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
26093
26015
|
] }),
|
|
26094
26016
|
/* @__PURE__ */ jsx27(
|
|
@@ -26149,7 +26071,7 @@ function SlotRow({
|
|
|
26149
26071
|
/* @__PURE__ */ jsxs22(
|
|
26150
26072
|
Text23,
|
|
26151
26073
|
{
|
|
26152
|
-
color: activeField === "allowedComponents" ?
|
|
26074
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
26153
26075
|
bold: activeField === "allowedComponents",
|
|
26154
26076
|
children: [
|
|
26155
26077
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -26157,14 +26079,14 @@ function SlotRow({
|
|
|
26157
26079
|
]
|
|
26158
26080
|
}
|
|
26159
26081
|
),
|
|
26160
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
26082
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(any)" }) : /* @__PURE__ */ jsx27(Text23, { wrap: "wrap", children: slot.allowedComponents.join(", ") })
|
|
26161
26083
|
] }),
|
|
26162
26084
|
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
26163
26085
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
26164
26086
|
/* @__PURE__ */ jsxs22(
|
|
26165
26087
|
Text23,
|
|
26166
26088
|
{
|
|
26167
|
-
color: activeField === "allowedComponents" ?
|
|
26089
|
+
color: activeField === "allowedComponents" ? PALETTE.warning : PALETTE.muted,
|
|
26168
26090
|
bold: activeField === "allowedComponents",
|
|
26169
26091
|
children: [
|
|
26170
26092
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -26172,7 +26094,7 @@ function SlotRow({
|
|
|
26172
26094
|
]
|
|
26173
26095
|
}
|
|
26174
26096
|
),
|
|
26175
|
-
editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsx27(Text23, { color:
|
|
26097
|
+
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" })
|
|
26176
26098
|
] }),
|
|
26177
26099
|
/* @__PURE__ */ jsx27(
|
|
26178
26100
|
EditableValueList,
|
|
@@ -26188,21 +26110,21 @@ function SlotRow({
|
|
|
26188
26110
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
26189
26111
|
}
|
|
26190
26112
|
),
|
|
26191
|
-
editingField && editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx27(Box21, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx27(Text23, { color:
|
|
26113
|
+
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)" }) : (() => {
|
|
26192
26114
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
26193
26115
|
if (filtered.length === 0) {
|
|
26194
|
-
return /* @__PURE__ */ jsx27(Text23, { color:
|
|
26116
|
+
return /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
26195
26117
|
}
|
|
26196
26118
|
const cursor = pickerCursor % filtered.length;
|
|
26197
26119
|
const MAX_VISIBLE = 5;
|
|
26198
26120
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
26199
26121
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
26200
26122
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
26201
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26123
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
26202
26124
|
slice.map((name, i) => {
|
|
26203
26125
|
const absIdx = start + i;
|
|
26204
26126
|
const isCursor = absIdx === cursor;
|
|
26205
|
-
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ?
|
|
26127
|
+
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ? PALETTE.accent : PALETTE.muted, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
|
|
26206
26128
|
})
|
|
26207
26129
|
] });
|
|
26208
26130
|
})() })
|
|
@@ -27030,18 +26952,18 @@ function FieldEditor({
|
|
|
27030
26952
|
});
|
|
27031
26953
|
const innerWidth = Math.max(1, width - 2);
|
|
27032
26954
|
if (parseErr) {
|
|
27033
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
27034
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
27035
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27036
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26955
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
26956
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
26957
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: parseErr }),
|
|
26958
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Cannot display structured editor. Fix the JSON first." })
|
|
27037
26959
|
] });
|
|
27038
26960
|
}
|
|
27039
26961
|
if (props.length === 0 && slots.length === 0) {
|
|
27040
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
27041
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
27042
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27043
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27044
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26962
|
+
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
26963
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
26964
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
26965
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "You can add fields manually below or reject this component." }),
|
|
26966
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "Enter to save \xB7 Esc to discard" })
|
|
27045
26967
|
] });
|
|
27046
26968
|
}
|
|
27047
26969
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -27170,7 +27092,7 @@ function FieldEditor({
|
|
|
27170
27092
|
const renderRow = (row, index) => {
|
|
27171
27093
|
const key = rowKey(row, index);
|
|
27172
27094
|
if (row.kind === "header") {
|
|
27173
|
-
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
27095
|
+
return /* @__PURE__ */ jsx27(Box21, { flexDirection: "column", paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.success, children: row.label }) }, key);
|
|
27174
27096
|
}
|
|
27175
27097
|
if (row.kind === "component-description") {
|
|
27176
27098
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -27252,9 +27174,9 @@ function FieldEditor({
|
|
|
27252
27174
|
...fixedHeight ? { height } : { minHeight: height },
|
|
27253
27175
|
clipOverflow: fixedHeight,
|
|
27254
27176
|
borderStyle: "single",
|
|
27255
|
-
borderColor: hasEmptyProperties ?
|
|
27177
|
+
borderColor: hasEmptyProperties ? PALETTE.warning : active ? PALETTE.accent : PALETTE.border,
|
|
27256
27178
|
children: [
|
|
27257
|
-
hasEmptyProperties && /* @__PURE__ */ jsx27(Text23, { color:
|
|
27179
|
+
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." }),
|
|
27258
27180
|
header,
|
|
27259
27181
|
/* @__PURE__ */ jsx27(Box21, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx27(
|
|
27260
27182
|
PropRow,
|
|
@@ -27305,7 +27227,7 @@ function FieldEditor({
|
|
|
27305
27227
|
`visible-${key}`
|
|
27306
27228
|
);
|
|
27307
27229
|
}) }),
|
|
27308
|
-
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color:
|
|
27230
|
+
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
27309
27231
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
27310
27232
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
27311
27233
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -27315,20 +27237,20 @@ function FieldEditor({
|
|
|
27315
27237
|
const headerPath = path5 ?? "<unknown source path>";
|
|
27316
27238
|
if (!start || !end2 || !src) {
|
|
27317
27239
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
27318
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27319
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27240
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `source: ${headerPath}` }),
|
|
27241
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "(no source location captured for this prop)" }),
|
|
27320
27242
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close" })
|
|
27321
27243
|
] });
|
|
27322
27244
|
}
|
|
27323
27245
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
27324
27246
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
27325
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27326
|
-
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color:
|
|
27247
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, bold: true, children: `${headerPath}: lines ${start}\u2013${end2}` }),
|
|
27248
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: ln }, `source-line-${i}`)),
|
|
27327
27249
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close \xB7 [Esc] close" })
|
|
27328
27250
|
] });
|
|
27329
27251
|
})(),
|
|
27330
|
-
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
27331
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
27252
|
+
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.accent, paddingX: 1, children: [
|
|
27253
|
+
/* @__PURE__ */ jsx27(Text23, { bold: true, color: PALETTE.accent, children: "Keybindings" }),
|
|
27332
27254
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
27333
27255
|
/* @__PURE__ */ jsx27(Text23, { bold: true, children: "Row navigation" }),
|
|
27334
27256
|
/* @__PURE__ */ jsx27(Text23, { children: " \u2191/\u2193 move between rows" }),
|
|
@@ -27353,10 +27275,10 @@ function FieldEditor({
|
|
|
27353
27275
|
/* @__PURE__ */ jsx27(Text23, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
27354
27276
|
/* @__PURE__ */ jsx27(Text23, { children: " ? toggle this overlay" }),
|
|
27355
27277
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
27356
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27278
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: "press ? or Esc to close" })
|
|
27357
27279
|
] }),
|
|
27358
|
-
validationError && /* @__PURE__ */ jsx27(Text23, { color:
|
|
27359
|
-
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color:
|
|
27280
|
+
validationError && /* @__PURE__ */ jsx27(Text23, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
27281
|
+
/* @__PURE__ */ jsx27(Box21, { paddingTop: 1, children: /* @__PURE__ */ jsx27(Text23, { color: PALETTE.muted, children: modeLabel }) })
|
|
27360
27282
|
]
|
|
27361
27283
|
}
|
|
27362
27284
|
);
|
|
@@ -27365,7 +27287,7 @@ var SLOT_FIELDS;
|
|
|
27365
27287
|
var init_FieldEditor = __esm({
|
|
27366
27288
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx"() {
|
|
27367
27289
|
"use strict";
|
|
27368
|
-
|
|
27290
|
+
init_theme();
|
|
27369
27291
|
init_src5();
|
|
27370
27292
|
init_useImmediateInput();
|
|
27371
27293
|
init_scroll_offset();
|
|
@@ -27420,21 +27342,21 @@ function RationaleLine({ line, active }) {
|
|
|
27420
27342
|
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { children: " " }) });
|
|
27421
27343
|
}
|
|
27422
27344
|
if (line.kind === "heading") {
|
|
27423
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ?
|
|
27345
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? PALETTE.accent : PALETTE.muted, children: line.text }) });
|
|
27424
27346
|
}
|
|
27425
27347
|
if (line.kind === "label") {
|
|
27426
27348
|
return /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
27427
27349
|
line.prefix && /* @__PURE__ */ jsx28(Text24, { children: line.prefix }),
|
|
27428
|
-
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color :
|
|
27429
|
-
line.suffix && /* @__PURE__ */ jsx28(Text24, { color:
|
|
27350
|
+
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color : PALETTE.muted, children: line.text }),
|
|
27351
|
+
line.suffix && /* @__PURE__ */ jsx28(Text24, { color: PALETTE.muted, children: line.suffix })
|
|
27430
27352
|
] });
|
|
27431
27353
|
}
|
|
27432
|
-
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ?
|
|
27354
|
+
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { color: !active || line.dim ? PALETTE.muted : void 0, children: line.text }) });
|
|
27433
27355
|
}
|
|
27434
27356
|
var init_RationaleLine = __esm({
|
|
27435
27357
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx"() {
|
|
27436
27358
|
"use strict";
|
|
27437
|
-
|
|
27359
|
+
init_theme();
|
|
27438
27360
|
}
|
|
27439
27361
|
});
|
|
27440
27362
|
|
|
@@ -27514,9 +27436,9 @@ function ComponentRationalePanel({
|
|
|
27514
27436
|
width,
|
|
27515
27437
|
height: height + 2,
|
|
27516
27438
|
borderStyle: "single",
|
|
27517
|
-
borderColor: active ?
|
|
27439
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
27518
27440
|
children: [
|
|
27519
|
-
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 :
|
|
27441
|
+
/* @__PURE__ */ jsx29(Box23, { children: /* @__PURE__ */ jsx29(Text25, { bold: true, color: active ? void 0 : PALETTE.muted, children: `Component rationale: ${data.name}` }) }),
|
|
27520
27442
|
visible.map((line, i) => /* @__PURE__ */ jsx29(RationaleLine, { line, active }, i)),
|
|
27521
27443
|
/* @__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" }) })
|
|
27522
27444
|
]
|
|
@@ -27527,7 +27449,7 @@ var PLACEHOLDER;
|
|
|
27527
27449
|
var init_ComponentRationalePanel = __esm({
|
|
27528
27450
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx"() {
|
|
27529
27451
|
"use strict";
|
|
27530
|
-
|
|
27452
|
+
init_theme();
|
|
27531
27453
|
init_wrap_text();
|
|
27532
27454
|
init_RationaleLine();
|
|
27533
27455
|
PLACEHOLDER = "(no rationale captured)";
|
|
@@ -27538,12 +27460,12 @@ var init_ComponentRationalePanel = __esm({
|
|
|
27538
27460
|
import { Text as Text26 } from "ink";
|
|
27539
27461
|
import { Fragment as Fragment6, jsx as jsx30 } from "react/jsx-runtime";
|
|
27540
27462
|
function HighlightedLine({ parts }) {
|
|
27541
|
-
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ?
|
|
27463
|
+
return /* @__PURE__ */ jsx30(Fragment6, { children: parts.map((part, i) => /* @__PURE__ */ jsx30(Text26, { color: part.dim ? PALETTE.muted : part.color, children: part.text }, i)) });
|
|
27542
27464
|
}
|
|
27543
27465
|
var init_HighlightedLine = __esm({
|
|
27544
27466
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/HighlightedLine.tsx"() {
|
|
27545
27467
|
"use strict";
|
|
27546
|
-
|
|
27468
|
+
init_theme();
|
|
27547
27469
|
}
|
|
27548
27470
|
});
|
|
27549
27471
|
|
|
@@ -27564,10 +27486,10 @@ function ScrollablePanel({
|
|
|
27564
27486
|
const overflowed = totalLines > height;
|
|
27565
27487
|
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
27566
27488
|
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
27567
|
-
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 :
|
|
27489
|
+
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 : PALETTE.muted, children: title }),
|
|
27568
27490
|
overflowed && /* @__PURE__ */ jsxs25(Fragment7, { children: [
|
|
27569
27491
|
/* @__PURE__ */ jsx31(Box24, { flexGrow: 1 }),
|
|
27570
|
-
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 :
|
|
27492
|
+
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 : PALETTE.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
27571
27493
|
] })
|
|
27572
27494
|
] }),
|
|
27573
27495
|
children
|
|
@@ -27576,7 +27498,7 @@ function ScrollablePanel({
|
|
|
27576
27498
|
var init_ScrollablePanel = __esm({
|
|
27577
27499
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx"() {
|
|
27578
27500
|
"use strict";
|
|
27579
|
-
|
|
27501
|
+
init_theme();
|
|
27580
27502
|
}
|
|
27581
27503
|
});
|
|
27582
27504
|
|
|
@@ -27667,7 +27589,7 @@ function renderRationaleLines(rows, innerWidth) {
|
|
|
27667
27589
|
out.push({
|
|
27668
27590
|
kind: "label",
|
|
27669
27591
|
text: row.name,
|
|
27670
|
-
color:
|
|
27592
|
+
color: PALETTE.accent,
|
|
27671
27593
|
suffix: row.kind === "slot" ? " (slot)" : void 0
|
|
27672
27594
|
});
|
|
27673
27595
|
for (const line of wrapText(row.rationale, innerWidth)) {
|
|
@@ -27703,7 +27625,7 @@ function RationalePanel({
|
|
|
27703
27625
|
totalLines,
|
|
27704
27626
|
visibleStart,
|
|
27705
27627
|
visibleEnd,
|
|
27706
|
-
borderColor: active ?
|
|
27628
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
27707
27629
|
children: visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i))
|
|
27708
27630
|
}
|
|
27709
27631
|
);
|
|
@@ -27711,7 +27633,7 @@ function RationalePanel({
|
|
|
27711
27633
|
var init_RationalePanel = __esm({
|
|
27712
27634
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationalePanel.tsx"() {
|
|
27713
27635
|
"use strict";
|
|
27714
|
-
|
|
27636
|
+
init_theme();
|
|
27715
27637
|
init_wrap_text();
|
|
27716
27638
|
init_RationaleLine();
|
|
27717
27639
|
init_ScrollablePanel();
|
|
@@ -27747,21 +27669,29 @@ function TokenReviewPanel({
|
|
|
27747
27669
|
width,
|
|
27748
27670
|
height: height + 2,
|
|
27749
27671
|
borderStyle: "single",
|
|
27750
|
-
borderColor: active ?
|
|
27672
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
27751
27673
|
children: [
|
|
27752
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
27753
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27674
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
27675
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
27754
27676
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
27755
|
-
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
27677
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no compatible tokens found for this token kind)" }),
|
|
27756
27678
|
visiblePaths.map((path5, i) => {
|
|
27757
27679
|
const pathIndex = scrollStart + i;
|
|
27758
27680
|
const checked = editSelection.has(path5);
|
|
27759
27681
|
const focused = pathIndex === editCursor;
|
|
27760
|
-
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
27682
|
+
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
27683
|
+
Text28,
|
|
27684
|
+
{
|
|
27685
|
+
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
27686
|
+
bold: focused,
|
|
27687
|
+
wrap: "truncate",
|
|
27688
|
+
children: ` [${checked ? "x" : " "}] ${path5}`
|
|
27689
|
+
}
|
|
27690
|
+
) }, path5);
|
|
27761
27691
|
}),
|
|
27762
27692
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
27763
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27764
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27693
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
27694
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
27765
27695
|
]
|
|
27766
27696
|
}
|
|
27767
27697
|
);
|
|
@@ -27773,16 +27703,16 @@ function TokenReviewPanel({
|
|
|
27773
27703
|
width,
|
|
27774
27704
|
height: height + 2,
|
|
27775
27705
|
borderStyle: "single",
|
|
27776
|
-
borderColor: active ?
|
|
27706
|
+
borderColor: active ? PALETTE.text : void 0,
|
|
27777
27707
|
children: [
|
|
27778
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
27779
|
-
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color:
|
|
27708
|
+
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 : PALETTE.muted, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
27709
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: "(no token suggestions for this component)" }),
|
|
27780
27710
|
suggestions.map((s, i) => {
|
|
27781
27711
|
const focused = i === selectedRow;
|
|
27782
27712
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
27783
|
-
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ?
|
|
27784
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27785
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27713
|
+
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted, bold: focused, children: `${focused ? figures6.pointer : " "} ${s.propName}` }) }),
|
|
27714
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
27715
|
+
/* @__PURE__ */ jsx34(Text28, { color: PALETTE.muted, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
27786
27716
|
] }, s.propName);
|
|
27787
27717
|
}),
|
|
27788
27718
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
@@ -27794,7 +27724,7 @@ function TokenReviewPanel({
|
|
|
27794
27724
|
var init_TokenReviewPanel = __esm({
|
|
27795
27725
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/TokenReviewPanel.tsx"() {
|
|
27796
27726
|
"use strict";
|
|
27797
|
-
|
|
27727
|
+
init_theme();
|
|
27798
27728
|
}
|
|
27799
27729
|
});
|
|
27800
27730
|
|
|
@@ -27874,9 +27804,9 @@ function ReviewDetailsPanel({
|
|
|
27874
27804
|
const sourceLineCount = Math.max(1, height - 4);
|
|
27875
27805
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
27876
27806
|
return /* @__PURE__ */ jsxs27(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
27877
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
27878
|
-
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color:
|
|
27879
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
27807
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, bold: true, wrap: "truncate-end", children: `source: ${headerPath}` }),
|
|
27808
|
+
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)" }),
|
|
27809
|
+
/* @__PURE__ */ jsx35(Text29, { color: PALETTE.muted, wrap: "truncate-end", children: "[s/Esc] close" })
|
|
27880
27810
|
] });
|
|
27881
27811
|
}
|
|
27882
27812
|
if (panelOpen === "token-review") {
|
|
@@ -27918,7 +27848,7 @@ var init_review_details_panel = __esm({
|
|
|
27918
27848
|
init_RationalePanel();
|
|
27919
27849
|
init_TokenReviewPanel();
|
|
27920
27850
|
init_windowed_panel();
|
|
27921
|
-
|
|
27851
|
+
init_theme();
|
|
27922
27852
|
}
|
|
27923
27853
|
});
|
|
27924
27854
|
|
|
@@ -28045,17 +27975,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
28045
27975
|
hidden
|
|
28046
27976
|
}) {
|
|
28047
27977
|
if (hidden || count === 0) return null;
|
|
28048
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
27978
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
28049
27979
|
}
|
|
28050
27980
|
function ReviewNoSelection() {
|
|
28051
|
-
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
27981
|
+
return /* @__PURE__ */ jsx37(Box27, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, children: "No component selected" }) });
|
|
28052
27982
|
}
|
|
28053
27983
|
function ReviewFinalizeError({
|
|
28054
27984
|
message,
|
|
28055
27985
|
hidden
|
|
28056
27986
|
}) {
|
|
28057
27987
|
if (hidden || !message) return null;
|
|
28058
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
27988
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
28059
27989
|
}
|
|
28060
27990
|
function ReviewPanelFooter({
|
|
28061
27991
|
reviewEditor,
|
|
@@ -28079,7 +28009,7 @@ function ReviewComponentTitle({
|
|
|
28079
28009
|
return /* @__PURE__ */ jsxs28(Box27, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
28080
28010
|
/* @__PURE__ */ jsx37(Text30, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
28081
28011
|
/* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
|
|
28082
|
-
/* @__PURE__ */ jsxs28(Text30, { color:
|
|
28012
|
+
/* @__PURE__ */ jsxs28(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: [
|
|
28083
28013
|
propCount,
|
|
28084
28014
|
" prop",
|
|
28085
28015
|
propCount !== 1 ? "s" : "",
|
|
@@ -28135,8 +28065,8 @@ function ReviewComponentPanel({
|
|
|
28135
28065
|
)
|
|
28136
28066
|
}
|
|
28137
28067
|
) }),
|
|
28138
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ?
|
|
28139
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color:
|
|
28068
|
+
/* @__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 : " " }) }),
|
|
28069
|
+
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: PALETTE.muted, wrap: "truncate-end", children: /* @__PURE__ */ jsx37(
|
|
28140
28070
|
ReviewPanelFooter,
|
|
28141
28071
|
{
|
|
28142
28072
|
reviewEditor,
|
|
@@ -28151,7 +28081,7 @@ function ReviewComponentPanel({
|
|
|
28151
28081
|
var init_ReviewComponentPanel = __esm({
|
|
28152
28082
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewComponentPanel.tsx"() {
|
|
28153
28083
|
"use strict";
|
|
28154
|
-
|
|
28084
|
+
init_theme();
|
|
28155
28085
|
init_review_json_panel();
|
|
28156
28086
|
init_ReviewDetailsEditor();
|
|
28157
28087
|
init_windowed_panel();
|
|
@@ -28173,11 +28103,11 @@ function countReviewStatuses(entries) {
|
|
|
28173
28103
|
);
|
|
28174
28104
|
}
|
|
28175
28105
|
function ReviewLoadingState() {
|
|
28176
|
-
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color:
|
|
28106
|
+
return /* @__PURE__ */ jsx38(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx38(Text31, { color: PALETTE.muted, children: "Loading generated definitions..." }) });
|
|
28177
28107
|
}
|
|
28178
28108
|
function ReviewLoadError({ message }) {
|
|
28179
28109
|
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28180
|
-
/* @__PURE__ */ jsx38(Text31, { color:
|
|
28110
|
+
/* @__PURE__ */ jsx38(Text31, { color: PALETTE.error, children: message }),
|
|
28181
28111
|
/* @__PURE__ */ jsx38(Text31, { children: " " }),
|
|
28182
28112
|
/* @__PURE__ */ jsx38(Text31, { children: "[q / Enter / Esc] Quit" })
|
|
28183
28113
|
] });
|
|
@@ -28185,7 +28115,7 @@ function ReviewLoadError({ message }) {
|
|
|
28185
28115
|
var init_ReviewStatus = __esm({
|
|
28186
28116
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewStatus.tsx"() {
|
|
28187
28117
|
"use strict";
|
|
28188
|
-
|
|
28118
|
+
init_theme();
|
|
28189
28119
|
}
|
|
28190
28120
|
});
|
|
28191
28121
|
|
|
@@ -28435,41 +28365,41 @@ function FinalizeDialog({
|
|
|
28435
28365
|
/* @__PURE__ */ jsx39(Text32, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
|
|
28436
28366
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
28437
28367
|
/* @__PURE__ */ jsxs30(Text32, { children: [
|
|
28438
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
28368
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.success, children: [
|
|
28439
28369
|
accepted,
|
|
28440
28370
|
" accepted"
|
|
28441
28371
|
] }),
|
|
28442
28372
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
28443
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
28373
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.error, children: [
|
|
28444
28374
|
rejected,
|
|
28445
28375
|
" rejected"
|
|
28446
28376
|
] }),
|
|
28447
28377
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
28448
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
28378
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE.muted, children: [
|
|
28449
28379
|
needsReview,
|
|
28450
28380
|
" unresolved"
|
|
28451
28381
|
] })
|
|
28452
28382
|
] }),
|
|
28453
28383
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
28454
28384
|
noneAccepted && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
28455
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
28456
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
28385
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
28386
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
28457
28387
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28458
28388
|
] }),
|
|
28459
28389
|
!allResolved && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
28460
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
28461
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
28390
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
28391
|
+
/* @__PURE__ */ jsx39(Text32, { color: PALETTE.warning, children: "Only explicitly accepted components ship." }),
|
|
28462
28392
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28463
28393
|
] }),
|
|
28464
28394
|
/* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", height: 2, children: [
|
|
28465
|
-
previewStatus === "running" ? /* @__PURE__ */ jsx39(Text32, { color:
|
|
28395
|
+
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: " " }),
|
|
28466
28396
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28467
28397
|
] }),
|
|
28468
28398
|
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
28469
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
28470
|
-
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color:
|
|
28471
|
-
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color:
|
|
28472
|
-
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color:
|
|
28399
|
+
/* @__PURE__ */ jsx39(Text32, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
28400
|
+
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2191 more above" }),
|
|
28401
|
+
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
28402
|
+
hasMoreBelow && /* @__PURE__ */ jsx39(Text32, { color: PALETTE.muted, children: "\u2193 more below" }),
|
|
28473
28403
|
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx39(Text32, { children: "[\u2191\u2193] scroll deletions" }),
|
|
28474
28404
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28475
28405
|
] }),
|
|
@@ -28482,7 +28412,7 @@ var FINALIZE_REMOVED_WINDOW;
|
|
|
28482
28412
|
var init_FinalizeDialog = __esm({
|
|
28483
28413
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FinalizeDialog.tsx"() {
|
|
28484
28414
|
"use strict";
|
|
28485
|
-
|
|
28415
|
+
init_theme();
|
|
28486
28416
|
init_useImmediateInput();
|
|
28487
28417
|
init_removed_components_text();
|
|
28488
28418
|
FINALIZE_REMOVED_WINDOW = 6;
|
|
@@ -29010,8 +28940,8 @@ function ReviewStepDialogs({
|
|
|
29010
28940
|
}
|
|
29011
28941
|
function ReviewReloadDialog({ open }) {
|
|
29012
28942
|
if (!open) return null;
|
|
29013
|
-
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
29014
|
-
/* @__PURE__ */ jsx41(Text34, { bold: true, color:
|
|
28943
|
+
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
28944
|
+
/* @__PURE__ */ jsx41(Text34, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
29015
28945
|
/* @__PURE__ */ jsx41(Text34, { children: "Unsaved in-memory changes will be lost." }),
|
|
29016
28946
|
/* @__PURE__ */ jsx41(Text34, { children: " " }),
|
|
29017
28947
|
/* @__PURE__ */ jsx41(Text34, { children: " [Enter] Confirm" }),
|
|
@@ -29021,7 +28951,7 @@ function ReviewReloadDialog({ open }) {
|
|
|
29021
28951
|
var init_ReviewDialogs = __esm({
|
|
29022
28952
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDialogs.tsx"() {
|
|
29023
28953
|
"use strict";
|
|
29024
|
-
|
|
28954
|
+
init_theme();
|
|
29025
28955
|
init_FinalizeDialog();
|
|
29026
28956
|
init_QuitDialog();
|
|
29027
28957
|
init_ReviewStatus();
|
|
@@ -29432,25 +29362,25 @@ function LivePreviewSummary({
|
|
|
29432
29362
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
29433
29363
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
29434
29364
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
29435
|
-
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
29436
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
29365
|
+
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: "Preview: disabled (creds rejected)" });
|
|
29366
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `Preview: ${spinner} running...` });
|
|
29437
29367
|
if (!hasCounts) return null;
|
|
29438
29368
|
return /* @__PURE__ */ jsxs33(Box32, { children: [
|
|
29439
29369
|
/* @__PURE__ */ jsx42(Text35, { children: "Preview: " }),
|
|
29440
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29370
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
29441
29371
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
29442
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29372
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
29443
29373
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
29444
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29374
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.muted, children: `${counts.removed} removed` }),
|
|
29445
29375
|
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx42(Text35, { children: " ([d] removed list)" }),
|
|
29446
29376
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
29447
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29377
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
29448
29378
|
] });
|
|
29449
29379
|
}
|
|
29450
29380
|
var init_LivePreviewSummary = __esm({
|
|
29451
29381
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/LivePreviewSummary.tsx"() {
|
|
29452
29382
|
"use strict";
|
|
29453
|
-
|
|
29383
|
+
init_theme();
|
|
29454
29384
|
}
|
|
29455
29385
|
});
|
|
29456
29386
|
|
|
@@ -29499,10 +29429,10 @@ function CyclePathLine({
|
|
|
29499
29429
|
highlightComponents = false,
|
|
29500
29430
|
highlightLine = false
|
|
29501
29431
|
}) {
|
|
29502
|
-
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ?
|
|
29432
|
+
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
29503
29433
|
prefix,
|
|
29504
29434
|
segments.map(
|
|
29505
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
29435
|
+
(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)
|
|
29506
29436
|
)
|
|
29507
29437
|
] });
|
|
29508
29438
|
}
|
|
@@ -29514,9 +29444,9 @@ function CycleDetailPanel({
|
|
|
29514
29444
|
height
|
|
29515
29445
|
}) {
|
|
29516
29446
|
const lines = [
|
|
29517
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
29518
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29519
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29447
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${cycles.length})` }, "cyc-title"),
|
|
29448
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "push will fail until these are resolved" }, "cyc-sub"),
|
|
29449
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "Reject a cycle member or remove a slot edge to break the cycle." }, "cyc-guidance"),
|
|
29520
29450
|
/* @__PURE__ */ jsx43(Text36, { children: " " }, "cyc-space")
|
|
29521
29451
|
];
|
|
29522
29452
|
cycles.forEach((cycle, index) => {
|
|
@@ -29528,7 +29458,7 @@ function CycleDetailPanel({
|
|
|
29528
29458
|
);
|
|
29529
29459
|
if (cycle.suggestedBreak) {
|
|
29530
29460
|
lines.push(
|
|
29531
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29461
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: ` Suggested fix: remove [${cycle.suggestedBreak.slotName}] from ${cycle.suggestedBreak.fromComponent}` }, `cyc-fix-${index}`)
|
|
29532
29462
|
);
|
|
29533
29463
|
}
|
|
29534
29464
|
lines.push(/* @__PURE__ */ jsx43(Text36, { children: " " }, `cyc-s-${index}`));
|
|
@@ -29536,9 +29466,9 @@ function CycleDetailPanel({
|
|
|
29536
29466
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
29537
29467
|
const viewportHeight = Math.max(1, height - 3);
|
|
29538
29468
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
29539
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
29469
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
29540
29470
|
visible,
|
|
29541
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29471
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: footer })
|
|
29542
29472
|
] });
|
|
29543
29473
|
}
|
|
29544
29474
|
function BreakCyclePanel({
|
|
@@ -29549,14 +29479,14 @@ function BreakCyclePanel({
|
|
|
29549
29479
|
width,
|
|
29550
29480
|
height
|
|
29551
29481
|
}) {
|
|
29552
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
29553
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
29482
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE.warning, paddingLeft: 1, children: [
|
|
29483
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: "BREAK CYCLE \u2014 remove a slot edge" }),
|
|
29554
29484
|
cycle && /* @__PURE__ */ jsx43(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
|
|
29555
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29485
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: cycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
29556
29486
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
29557
|
-
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
29487
|
+
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.muted, children: "remove slot edge:" }),
|
|
29558
29488
|
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}`)),
|
|
29559
|
-
confirming ? /* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
29489
|
+
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" })
|
|
29560
29490
|
] });
|
|
29561
29491
|
}
|
|
29562
29492
|
function buildBreakingRows(breakingChanges) {
|
|
@@ -29602,7 +29532,7 @@ function deriveBreakingChanges(response) {
|
|
|
29602
29532
|
}
|
|
29603
29533
|
function GenerateReviewStep(props) {
|
|
29604
29534
|
if (!props.extractSessionId) {
|
|
29605
|
-
return /* @__PURE__ */ jsx43(Box33, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx43(Text36, { color:
|
|
29535
|
+
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." }) });
|
|
29606
29536
|
}
|
|
29607
29537
|
return /* @__PURE__ */ jsx43(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
29608
29538
|
}
|
|
@@ -30519,8 +30449,8 @@ function GenerateReviewStepView({
|
|
|
30519
30449
|
}
|
|
30520
30450
|
),
|
|
30521
30451
|
/* @__PURE__ */ jsx43(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
30522
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
30523
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
30452
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
30453
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
30524
30454
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs34(Fragment13, { children: [
|
|
30525
30455
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
30526
30456
|
removedComponents.map((rc) => /* @__PURE__ */ jsx43(Text36, { children: removedComponentLine(rc) }, rc.id))
|
|
@@ -30529,7 +30459,7 @@ function GenerateReviewStepView({
|
|
|
30529
30459
|
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx43(Box33, { paddingX: 1, children: /* @__PURE__ */ jsx43(
|
|
30530
30460
|
Text36,
|
|
30531
30461
|
{
|
|
30532
|
-
color:
|
|
30462
|
+
color: PALETTE.warning,
|
|
30533
30463
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
30534
30464
|
}
|
|
30535
30465
|
) }),
|
|
@@ -30537,10 +30467,10 @@ function GenerateReviewStepView({
|
|
|
30537
30467
|
const row = breakingRows[breakingCursor];
|
|
30538
30468
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
30539
30469
|
if (!comp) return null;
|
|
30540
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
30541
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
30542
|
-
comp.impact && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30543
|
-
comp.changes.length === 0 ? /* @__PURE__ */ jsx43(Text36, { color:
|
|
30470
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
30471
|
+
/* @__PURE__ */ jsx43(Text36, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
30472
|
+
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"}` }),
|
|
30473
|
+
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}`)),
|
|
30544
30474
|
/* @__PURE__ */ jsx43(Text36, { children: "[D/Esc] close detail" })
|
|
30545
30475
|
] });
|
|
30546
30476
|
})(),
|
|
@@ -30563,11 +30493,11 @@ function GenerateReviewStepView({
|
|
|
30563
30493
|
const participantSet = cycleView.structural;
|
|
30564
30494
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
30565
30495
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
30566
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor:
|
|
30567
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
30568
|
-
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30569
|
-
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30570
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
30496
|
+
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
30497
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
30498
|
+
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
30499
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
30500
|
+
/* @__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" })
|
|
30571
30501
|
] });
|
|
30572
30502
|
})(),
|
|
30573
30503
|
/* @__PURE__ */ jsx43(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
@@ -30683,7 +30613,7 @@ function GenerateReviewStepView({
|
|
|
30683
30613
|
) : /* @__PURE__ */ jsx43(ReviewNoSelection, {})
|
|
30684
30614
|
] }),
|
|
30685
30615
|
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", children: [
|
|
30686
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
30616
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: `\u26A0 ${cycleRows.length} slot dependency cycle${cycleRows.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
30687
30617
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
30688
30618
|
return /* @__PURE__ */ jsx43(
|
|
30689
30619
|
CyclePathLine,
|
|
@@ -30696,7 +30626,7 @@ function GenerateReviewStepView({
|
|
|
30696
30626
|
`cyc-banner-${idx}`
|
|
30697
30627
|
);
|
|
30698
30628
|
}),
|
|
30699
|
-
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30629
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
30700
30630
|
/* @__PURE__ */ jsx43(Text36, { children: " press [c] for detail" })
|
|
30701
30631
|
] }),
|
|
30702
30632
|
/* @__PURE__ */ jsx43(
|
|
@@ -30717,7 +30647,7 @@ var HELP_SECTIONS2;
|
|
|
30717
30647
|
var init_generate_review_step = __esm({
|
|
30718
30648
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx"() {
|
|
30719
30649
|
"use strict";
|
|
30720
|
-
|
|
30650
|
+
init_theme();
|
|
30721
30651
|
init_review_json_panel();
|
|
30722
30652
|
init_GroupedSidebar();
|
|
30723
30653
|
init_composite_closure();
|
|
@@ -30826,13 +30756,13 @@ var init_generate_review_step = __esm({
|
|
|
30826
30756
|
|
|
30827
30757
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts
|
|
30828
30758
|
import { defaultTheme as defaultTheme2, extendTheme as extendTheme2 } from "@inkjs/ui";
|
|
30829
|
-
var
|
|
30759
|
+
var PALETTE3, INK_UI_THEME;
|
|
30830
30760
|
var init_theme4 = __esm({
|
|
30831
30761
|
"packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts"() {
|
|
30832
30762
|
"use strict";
|
|
30833
|
-
|
|
30834
|
-
|
|
30835
|
-
...
|
|
30763
|
+
init_theme();
|
|
30764
|
+
PALETTE3 = {
|
|
30765
|
+
...PALETTE,
|
|
30836
30766
|
link: "#58A6FF"
|
|
30837
30767
|
};
|
|
30838
30768
|
INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
@@ -30840,7 +30770,7 @@ var init_theme4 = __esm({
|
|
|
30840
30770
|
ProgressBar: {
|
|
30841
30771
|
styles: {
|
|
30842
30772
|
completed: () => ({
|
|
30843
|
-
color:
|
|
30773
|
+
color: PALETTE3.accent
|
|
30844
30774
|
})
|
|
30845
30775
|
}
|
|
30846
30776
|
}
|
|
@@ -30854,13 +30784,13 @@ import { Box as Box34, Text as Text37 } from "ink";
|
|
|
30854
30784
|
import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
30855
30785
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
30856
30786
|
if (!generatePromptPath) return null;
|
|
30857
|
-
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
30858
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
30859
|
-
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color:
|
|
30787
|
+
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
|
|
30788
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE3.warning, bold: true, children: "WARNING: Custom prompt active" }),
|
|
30789
|
+
generatePromptPath ? /* @__PURE__ */ jsxs35(Text37, { color: PALETTE3.warning, children: [
|
|
30860
30790
|
"components: ",
|
|
30861
30791
|
generatePromptPath
|
|
30862
30792
|
] }) : null,
|
|
30863
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
30793
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE3.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
|
|
30864
30794
|
] });
|
|
30865
30795
|
}
|
|
30866
30796
|
var init_CustomPromptBanner = __esm({
|
|
@@ -30893,10 +30823,10 @@ import { Box as Box35, Text as Text38 } from "ink";
|
|
|
30893
30823
|
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
30894
30824
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
30895
30825
|
return /* @__PURE__ */ jsxs36(Box35, { gap: 1, marginTop: 1, children: [
|
|
30896
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
30826
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE3.muted, children: "Space:" }),
|
|
30897
30827
|
/* @__PURE__ */ jsx45(Text38, { children: spaceId }),
|
|
30898
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
30899
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
30828
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE3.muted, children: "/" }),
|
|
30829
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE3.muted, children: "Environment:" }),
|
|
30900
30830
|
/* @__PURE__ */ jsx45(Text38, { children: environmentId })
|
|
30901
30831
|
] });
|
|
30902
30832
|
}
|
|
@@ -30914,13 +30844,13 @@ function EntityRows({ entity, label }) {
|
|
|
30914
30844
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
30915
30845
|
return /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
30916
30846
|
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs37(Text39, { children: [
|
|
30917
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30847
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.success, children: "\u2713" }),
|
|
30918
30848
|
" ",
|
|
30919
30849
|
plural3(entity[action]),
|
|
30920
30850
|
" ",
|
|
30921
30851
|
action
|
|
30922
30852
|
] }, action)),
|
|
30923
|
-
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30853
|
+
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.error, children: [
|
|
30924
30854
|
"\u2717 ",
|
|
30925
30855
|
plural3(entity.failed),
|
|
30926
30856
|
" failed \u2014 check logs above"
|
|
@@ -30929,8 +30859,8 @@ function EntityRows({ entity, label }) {
|
|
|
30929
30859
|
}
|
|
30930
30860
|
function LinkRow({ title, url }) {
|
|
30931
30861
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30932
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30933
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30862
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.muted, children: title }),
|
|
30863
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.link, children: url })
|
|
30934
30864
|
] });
|
|
30935
30865
|
}
|
|
30936
30866
|
function DoneStep({
|
|
@@ -30953,17 +30883,17 @@ function DoneStep({
|
|
|
30953
30883
|
const success = totalFailed === 0;
|
|
30954
30884
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
30955
30885
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
30956
|
-
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
30957
|
-
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color:
|
|
30886
|
+
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE3.success, children: "Done!" }) : /* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE3.warning, children: "\u26A0 Finished with errors" }),
|
|
30887
|
+
totalPushed === 0 && totalFailed === 0 && !summary ? /* @__PURE__ */ jsx46(Text39, { color: PALETTE3.muted, children: "Nothing was pushed \u2014 everything was already up to date." }) : /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30958
30888
|
/* @__PURE__ */ jsx46(EntityRows, { entity: componentTypes, label: "Component Type" }),
|
|
30959
30889
|
/* @__PURE__ */ jsx46(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
30960
|
-
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30890
|
+
summary && /* @__PURE__ */ jsx46(Box36, { marginTop: 1, children: /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.muted, children: [
|
|
30961
30891
|
"Push result: ",
|
|
30962
30892
|
summary.succeeded,
|
|
30963
30893
|
"/",
|
|
30964
30894
|
summary.total,
|
|
30965
30895
|
" succeeded",
|
|
30966
|
-
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30896
|
+
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.error, children: [
|
|
30967
30897
|
", ",
|
|
30968
30898
|
summary.failed,
|
|
30969
30899
|
" failed"
|
|
@@ -30971,8 +30901,8 @@ function DoneStep({
|
|
|
30971
30901
|
] }) })
|
|
30972
30902
|
] }),
|
|
30973
30903
|
failures.length > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30974
|
-
/* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
30975
|
-
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30904
|
+
/* @__PURE__ */ jsx46(Text39, { bold: true, color: PALETTE3.error, children: "Failure details" }),
|
|
30905
|
+
failures.map((failure) => /* @__PURE__ */ jsxs37(Text39, { color: PALETTE3.error, children: [
|
|
30976
30906
|
failure.entityType,
|
|
30977
30907
|
" ",
|
|
30978
30908
|
failure.entityId,
|
|
@@ -30982,7 +30912,7 @@ function DoneStep({
|
|
|
30982
30912
|
] }),
|
|
30983
30913
|
/* @__PURE__ */ jsx46(SpaceEnvironment, { spaceId, environmentId }),
|
|
30984
30914
|
success && totalPushed > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, children: [
|
|
30985
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30915
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE3.success, children: "Your design system is now in Contentful Experiences." }),
|
|
30986
30916
|
/* @__PURE__ */ jsx46(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
30987
30917
|
/* @__PURE__ */ jsx46(
|
|
30988
30918
|
LinkRow,
|
|
@@ -31115,7 +31045,7 @@ function PathPrompt({
|
|
|
31115
31045
|
label,
|
|
31116
31046
|
":"
|
|
31117
31047
|
] }),
|
|
31118
|
-
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ?
|
|
31048
|
+
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ? PALETTE3.muted : void 0, children: shown }),
|
|
31119
31049
|
/* @__PURE__ */ jsx47(Text40, { children: cursor })
|
|
31120
31050
|
] }),
|
|
31121
31051
|
/* @__PURE__ */ jsxs38(Box37, { gap: 3, children: [
|
|
@@ -31198,12 +31128,12 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
31198
31128
|
/* @__PURE__ */ jsx50(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
|
|
31199
31129
|
/* @__PURE__ */ jsx50(Text42, { children: "Writing component types and design tokens to your Contentful space..." }),
|
|
31200
31130
|
operationId && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
31201
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
31131
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE3.muted, children: "Operation:" }),
|
|
31202
31132
|
/* @__PURE__ */ jsx50(Text42, { children: operationId })
|
|
31203
31133
|
] }),
|
|
31204
31134
|
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx50(Box39, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs40(Box39, { gap: 2, children: [
|
|
31205
31135
|
/* @__PURE__ */ jsx50(Box39, { width: 40, children: /* @__PURE__ */ jsx50(ThemeProvider2, { theme: INK_UI_THEME, children: /* @__PURE__ */ jsx50(ProgressBar2, { value: Math.round(progress.processed / progress.total * 100) }) }) }),
|
|
31206
|
-
/* @__PURE__ */ jsxs40(Text42, { color:
|
|
31136
|
+
/* @__PURE__ */ jsxs40(Text42, { color: PALETTE3.muted, children: [
|
|
31207
31137
|
progress.processed,
|
|
31208
31138
|
"/",
|
|
31209
31139
|
progress.total,
|
|
@@ -31211,10 +31141,10 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
31211
31141
|
] })
|
|
31212
31142
|
] }) }),
|
|
31213
31143
|
showCurrent && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
31214
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
31144
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE3.muted, children: "Now processing:" }),
|
|
31215
31145
|
/* @__PURE__ */ jsx50(Text42, { children: showCurrent })
|
|
31216
31146
|
] }),
|
|
31217
|
-
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color:
|
|
31147
|
+
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE3.muted, children: [
|
|
31218
31148
|
"Elapsed: ",
|
|
31219
31149
|
elapsed
|
|
31220
31150
|
] }) })
|
|
@@ -31421,25 +31351,25 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31421
31351
|
if (components.new.length > 0) {
|
|
31422
31352
|
lines.push({
|
|
31423
31353
|
key: "summary-components-new",
|
|
31424
|
-
color:
|
|
31354
|
+
color: PALETTE3.success,
|
|
31425
31355
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
31426
31356
|
});
|
|
31427
31357
|
for (const [index, item] of components.new.entries()) {
|
|
31428
31358
|
const name = item.key ?? item.$name ?? "unknown";
|
|
31429
|
-
lines.push({ key: `summary-components-new-${index}`, color:
|
|
31359
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE3.success, text: ` + ${name}` });
|
|
31430
31360
|
}
|
|
31431
31361
|
}
|
|
31432
31362
|
if (components.changed.length > 0) {
|
|
31433
31363
|
lines.push({
|
|
31434
31364
|
key: "summary-components-changed",
|
|
31435
|
-
color:
|
|
31365
|
+
color: PALETTE3.warning,
|
|
31436
31366
|
text: ` \uFF5E ${components.changed.length} components will be updated`
|
|
31437
31367
|
});
|
|
31438
31368
|
for (const [index, item] of components.changed.entries()) {
|
|
31439
31369
|
const isBreaking = item.changeClassification?.classification === "breaking";
|
|
31440
31370
|
lines.push({
|
|
31441
31371
|
key: `summary-components-changed-${index}`,
|
|
31442
|
-
color: isBreaking ?
|
|
31372
|
+
color: isBreaking ? PALETTE3.error : PALETTE3.warning,
|
|
31443
31373
|
text: ` ${isBreaking ? "\u26A0" : "~"} ${item.current.name}`
|
|
31444
31374
|
});
|
|
31445
31375
|
}
|
|
@@ -31447,11 +31377,11 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31447
31377
|
if (components.removed.length > 0) {
|
|
31448
31378
|
lines.push({
|
|
31449
31379
|
key: "summary-components-removed",
|
|
31450
|
-
color:
|
|
31380
|
+
color: PALETTE3.warning,
|
|
31451
31381
|
text: ` \u2298 ${components.removed.length} components will be skipped`
|
|
31452
31382
|
});
|
|
31453
31383
|
for (const [index, item] of components.removed.entries()) {
|
|
31454
|
-
lines.push({ key: `summary-components-removed-${index}`, color:
|
|
31384
|
+
lines.push({ key: `summary-components-removed-${index}`, color: PALETTE3.warning, text: ` \u2298 ${item.name}` });
|
|
31455
31385
|
}
|
|
31456
31386
|
}
|
|
31457
31387
|
if (components.unchanged.length > 0) {
|
|
@@ -31464,21 +31394,21 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31464
31394
|
if (tokens.new.length > 0) {
|
|
31465
31395
|
lines.push({
|
|
31466
31396
|
key: "summary-tokens-new",
|
|
31467
|
-
color:
|
|
31397
|
+
color: PALETTE3.success,
|
|
31468
31398
|
text: ` \uFF0B ${tokens.new.length} design tokens will be created`
|
|
31469
31399
|
});
|
|
31470
31400
|
}
|
|
31471
31401
|
if (tokens.changed.length > 0) {
|
|
31472
31402
|
lines.push({
|
|
31473
31403
|
key: "summary-tokens-changed",
|
|
31474
|
-
color:
|
|
31404
|
+
color: PALETTE3.warning,
|
|
31475
31405
|
text: ` \uFF5E ${tokens.changed.length} design tokens will be updated`
|
|
31476
31406
|
});
|
|
31477
31407
|
}
|
|
31478
31408
|
if (tokens.removed.length > 0) {
|
|
31479
31409
|
lines.push({
|
|
31480
31410
|
key: "summary-tokens-removed",
|
|
31481
|
-
color:
|
|
31411
|
+
color: PALETTE3.warning,
|
|
31482
31412
|
text: ` \u2298 ${tokens.removed.length} design tokens will be skipped`
|
|
31483
31413
|
});
|
|
31484
31414
|
}
|
|
@@ -31522,12 +31452,12 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
31522
31452
|
function appendChangedPreviewLine(lines, keyPrefix, name, hasPendingDraftChanges, changeClassification) {
|
|
31523
31453
|
lines.push({
|
|
31524
31454
|
key: `${keyPrefix}-h-${name}`,
|
|
31525
|
-
color:
|
|
31455
|
+
color: PALETTE3.warning,
|
|
31526
31456
|
text: ` ~ ${name}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
31527
31457
|
});
|
|
31528
31458
|
if (changeClassification?.classification !== "breaking") return;
|
|
31529
31459
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
31530
|
-
lines.push({ key: `${keyPrefix}-b-${name}`, color:
|
|
31460
|
+
lines.push({ key: `${keyPrefix}-b-${name}`, color: PALETTE3.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
31531
31461
|
}
|
|
31532
31462
|
function buildPreviewDiffLines(preview) {
|
|
31533
31463
|
const lines = [];
|
|
@@ -31535,12 +31465,12 @@ function buildPreviewDiffLines(preview) {
|
|
|
31535
31465
|
for (const item of components.new) {
|
|
31536
31466
|
const raw = item;
|
|
31537
31467
|
const name = raw.key ?? raw.$name ?? "unknown";
|
|
31538
|
-
lines.push({ key: `comp-new-${name}`, color:
|
|
31468
|
+
lines.push({ key: `comp-new-${name}`, color: PALETTE3.success, text: ` + ${name}` });
|
|
31539
31469
|
const slots = raw.$slots ?? {};
|
|
31540
31470
|
for (const slotName of Object.keys(slots).sort()) {
|
|
31541
31471
|
lines.push({
|
|
31542
31472
|
key: `comp-new-${name}-slot-${slotName}`,
|
|
31543
|
-
color:
|
|
31473
|
+
color: PALETTE3.success,
|
|
31544
31474
|
text: ` slot: ${slotName}`
|
|
31545
31475
|
});
|
|
31546
31476
|
const allowed = slots[slotName]?.["$allowedComponents"];
|
|
@@ -31548,14 +31478,14 @@ function buildPreviewDiffLines(preview) {
|
|
|
31548
31478
|
const names = allowed.filter((n) => typeof n === "string");
|
|
31549
31479
|
lines.push({
|
|
31550
31480
|
key: `comp-new-${name}-slot-${slotName}-allow`,
|
|
31551
|
-
color:
|
|
31481
|
+
color: PALETTE3.success,
|
|
31552
31482
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
31553
31483
|
});
|
|
31554
31484
|
}
|
|
31555
31485
|
}
|
|
31556
31486
|
}
|
|
31557
31487
|
for (const item of components.removed) {
|
|
31558
|
-
lines.push({ key: `comp-rm-${item.name}`, color:
|
|
31488
|
+
lines.push({ key: `comp-rm-${item.name}`, color: PALETTE3.error, text: ` - ${item.name}` });
|
|
31559
31489
|
}
|
|
31560
31490
|
for (const item of components.changed) {
|
|
31561
31491
|
appendChangedPreviewLine(lines, "comp", item.current.name, item.hasPendingDraftChanges, item.changeClassification);
|
|
@@ -31586,10 +31516,10 @@ function buildPreviewDiffLines(preview) {
|
|
|
31586
31516
|
for (const item of tokens.new) {
|
|
31587
31517
|
const raw = item;
|
|
31588
31518
|
const name = raw.name ?? raw.path ?? "unknown";
|
|
31589
|
-
lines.push({ key: `tok-new-${name}`, color:
|
|
31519
|
+
lines.push({ key: `tok-new-${name}`, color: PALETTE3.success, text: ` + ${name}` });
|
|
31590
31520
|
}
|
|
31591
31521
|
for (const item of tokens.removed) {
|
|
31592
|
-
lines.push({ key: `tok-rm-${item.name}`, color:
|
|
31522
|
+
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE3.error, text: ` - ${item.name}` });
|
|
31593
31523
|
}
|
|
31594
31524
|
for (const item of tokens.changed) {
|
|
31595
31525
|
const tokenName = item.current.name;
|
|
@@ -31680,13 +31610,13 @@ function WizardPreviewStep({
|
|
|
31680
31610
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
31681
31611
|
focused: false,
|
|
31682
31612
|
children: [
|
|
31683
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ?
|
|
31684
|
-
/* @__PURE__ */ jsx51(Text43, { color:
|
|
31613
|
+
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ? PALETTE3.muted : line.color, wrap: "truncate-end", children: line.text }, line.key)),
|
|
31614
|
+
/* @__PURE__ */ jsx51(Text43, { color: PALETTE3.muted, wrap: "truncate-end", children: formatPreviewScrollIndicator(activeLines.length, boundedScrollOffset, viewportHeight) })
|
|
31685
31615
|
]
|
|
31686
31616
|
}
|
|
31687
31617
|
)
|
|
31688
|
-
] }) : /* @__PURE__ */ jsx51(Text43, { color:
|
|
31689
|
-
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color:
|
|
31618
|
+
] }) : /* @__PURE__ */ jsx51(Text43, { color: PALETTE3.muted, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
31619
|
+
breakingWithImpact && /* @__PURE__ */ jsx51(Box40, { marginTop: 1, children: /* @__PURE__ */ jsx51(Text43, { color: PALETTE3.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
31690
31620
|
/* @__PURE__ */ jsx51(SpaceEnvironment, { spaceId, environmentId }),
|
|
31691
31621
|
/* @__PURE__ */ jsxs41(Box40, { gap: 3, marginTop: 1, children: [
|
|
31692
31622
|
/* @__PURE__ */ jsx51(Text43, { children: "[Enter] Push to Contentful" }),
|
|
@@ -32368,7 +32298,7 @@ var init_save = __esm({
|
|
|
32368
32298
|
writeFile: (path5, contents) => writeFile7(path5, contents),
|
|
32369
32299
|
appendRun,
|
|
32370
32300
|
buildSourceFingerprint,
|
|
32371
|
-
sleep: (ms) => new Promise((
|
|
32301
|
+
sleep: (ms) => new Promise((resolve27) => setTimeout(resolve27, ms)),
|
|
32372
32302
|
warn: (message) => process.stderr.write(message)
|
|
32373
32303
|
});
|
|
32374
32304
|
}
|
|
@@ -32919,48 +32849,13 @@ var init_debug_store = __esm({
|
|
|
32919
32849
|
}
|
|
32920
32850
|
});
|
|
32921
32851
|
|
|
32922
|
-
// packages/experience-design-system-cli/src/tui/help/file-locations.ts
|
|
32923
|
-
import { join as join27, resolve as resolve27 } from "node:path";
|
|
32924
|
-
function describeFileLocations({
|
|
32925
|
-
contentfulBaseDir,
|
|
32926
|
-
debugModeEnabled,
|
|
32927
|
-
currentSessionDir: currentSessionDir2
|
|
32928
|
-
}) {
|
|
32929
|
-
if (!debugModeEnabled) {
|
|
32930
|
-
return {
|
|
32931
|
-
debugLogs: "none while Debug Mode is off",
|
|
32932
|
-
importFiles: `${join27("<project>", ".contentful")}/ (tokens.json, components.json)`
|
|
32933
|
-
};
|
|
32934
|
-
}
|
|
32935
|
-
const base = contentfulBaseDir ? resolve27(contentfulBaseDir) : "<project>";
|
|
32936
|
-
const session = currentSessionDir2 ?? join27(base, ".contentful", "<date>-session-<n>");
|
|
32937
|
-
return {
|
|
32938
|
-
debugLogs: join27(session, "debug"),
|
|
32939
|
-
importFiles: `${join27(session, "dsi-import-<n>")}/ (tokens.json, components.json)`
|
|
32940
|
-
};
|
|
32941
|
-
}
|
|
32942
|
-
var init_file_locations = __esm({
|
|
32943
|
-
"packages/experience-design-system-cli/src/tui/help/file-locations.ts"() {
|
|
32944
|
-
"use strict";
|
|
32945
|
-
}
|
|
32946
|
-
});
|
|
32947
|
-
|
|
32948
32852
|
// packages/experience-design-system-cli/src/tui/help/help-info.ts
|
|
32949
32853
|
async function readHelpInfo() {
|
|
32950
|
-
const
|
|
32951
|
-
const base = settings["contentfulBaseDir"];
|
|
32952
|
-
const locations = describeFileLocations({
|
|
32953
|
-
contentfulBaseDir: typeof base === "string" ? base : "",
|
|
32954
|
-
debugModeEnabled: debugMode.enabled,
|
|
32955
|
-
currentSessionDir: currentSessionDir()
|
|
32956
|
-
});
|
|
32854
|
+
const debugMode = await readDebugModeSetting();
|
|
32957
32855
|
return {
|
|
32958
32856
|
storage: [
|
|
32959
32857
|
{ label: "Config folder", value: configRoot2() },
|
|
32960
|
-
{ label: "Settings file", value: configFilePath2() }
|
|
32961
|
-
{ label: "Agent settings", value: `${configFilePath2()} (keys: agent, agentModel, agents)` },
|
|
32962
|
-
{ label: "Debug logs", value: locations.debugLogs },
|
|
32963
|
-
{ label: "Import files", value: locations.importFiles }
|
|
32858
|
+
{ label: "Settings file", value: configFilePath2() }
|
|
32964
32859
|
],
|
|
32965
32860
|
troubleshooting: [
|
|
32966
32861
|
{ label: "CLI version", value: readPackageVersion() },
|
|
@@ -32981,7 +32876,6 @@ var init_help_info = __esm({
|
|
|
32981
32876
|
init_debug_store();
|
|
32982
32877
|
init_debug_mode_store();
|
|
32983
32878
|
init_version();
|
|
32984
|
-
init_file_locations();
|
|
32985
32879
|
}
|
|
32986
32880
|
});
|
|
32987
32881
|
|
|
@@ -32993,7 +32887,7 @@ function Section({ title, rows }) {
|
|
|
32993
32887
|
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
32994
32888
|
/* @__PURE__ */ jsx53(Text44, { bold: true, color: PALETTE.accent, children: title }),
|
|
32995
32889
|
rows.map((row) => /* @__PURE__ */ jsxs43(Box42, { gap: 1, children: [
|
|
32996
|
-
/* @__PURE__ */ jsx53(Box42, { width:
|
|
32890
|
+
/* @__PURE__ */ jsx53(Box42, { width: 14, flexShrink: 0, children: /* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: row.label }) }),
|
|
32997
32891
|
/* @__PURE__ */ jsx53(Text44, { children: row.value })
|
|
32998
32892
|
] }, row.label))
|
|
32999
32893
|
] });
|
|
@@ -33039,7 +32933,7 @@ function HelpScreen({ onDone }) {
|
|
|
33039
32933
|
var init_PageContainer2 = __esm({
|
|
33040
32934
|
"packages/experience-design-system-cli/src/tui/help/PageContainer.tsx"() {
|
|
33041
32935
|
"use strict";
|
|
33042
|
-
|
|
32936
|
+
init_theme();
|
|
33043
32937
|
init_debug_store();
|
|
33044
32938
|
init_control_hints();
|
|
33045
32939
|
init_help_info();
|
|
@@ -33107,531 +33001,6 @@ var init_PageContainer3 = __esm({
|
|
|
33107
33001
|
}
|
|
33108
33002
|
});
|
|
33109
33003
|
|
|
33110
|
-
// packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx
|
|
33111
|
-
import { useState as useState29 } from "react";
|
|
33112
|
-
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
33113
|
-
import TextInput4 from "ink-text-input";
|
|
33114
|
-
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
33115
|
-
function FieldForm({
|
|
33116
|
-
title,
|
|
33117
|
-
subtitle,
|
|
33118
|
-
fields,
|
|
33119
|
-
values,
|
|
33120
|
-
onChange,
|
|
33121
|
-
onSave,
|
|
33122
|
-
onQuit,
|
|
33123
|
-
notice,
|
|
33124
|
-
busy = false,
|
|
33125
|
-
footer,
|
|
33126
|
-
actions = []
|
|
33127
|
-
}) {
|
|
33128
|
-
const [active, setActive] = useState29(0);
|
|
33129
|
-
const [editing, setEditing] = useState29(false);
|
|
33130
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
33131
|
-
const labelWidth = Math.max(...fields.map((field) => field.label.length));
|
|
33132
|
-
const current = fields[active];
|
|
33133
|
-
useInput11((input, key) => {
|
|
33134
|
-
if (busy) return;
|
|
33135
|
-
if (editing) {
|
|
33136
|
-
if (key.escape) {
|
|
33137
|
-
onChange(current.key, valueBeforeEdit);
|
|
33138
|
-
setEditing(false);
|
|
33139
|
-
}
|
|
33140
|
-
return;
|
|
33141
|
-
}
|
|
33142
|
-
if (key.escape || input === "q") {
|
|
33143
|
-
onQuit();
|
|
33144
|
-
return;
|
|
33145
|
-
}
|
|
33146
|
-
if (input === "s") {
|
|
33147
|
-
onSave();
|
|
33148
|
-
return;
|
|
33149
|
-
}
|
|
33150
|
-
if (input === "c") {
|
|
33151
|
-
onChange(current.key, "");
|
|
33152
|
-
return;
|
|
33153
|
-
}
|
|
33154
|
-
const action = actions.find((candidate) => candidate.key === input);
|
|
33155
|
-
if (action) {
|
|
33156
|
-
action.run();
|
|
33157
|
-
return;
|
|
33158
|
-
}
|
|
33159
|
-
if (key.tab || key.downArrow) {
|
|
33160
|
-
setActive((i) => (i + 1) % fields.length);
|
|
33161
|
-
return;
|
|
33162
|
-
}
|
|
33163
|
-
if (key.upArrow) {
|
|
33164
|
-
setActive((i) => (i - 1 + fields.length) % fields.length);
|
|
33165
|
-
return;
|
|
33166
|
-
}
|
|
33167
|
-
if (key.return) {
|
|
33168
|
-
setValueBeforeEdit(values[current.key]);
|
|
33169
|
-
setEditing(true);
|
|
33170
|
-
}
|
|
33171
|
-
});
|
|
33172
|
-
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33173
|
-
/* @__PURE__ */ jsx55(Text46, { bold: true, children: title }),
|
|
33174
|
-
subtitle && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: subtitle }),
|
|
33175
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33176
|
-
/* @__PURE__ */ jsx55(Box44, { flexDirection: "column", children: fields.map((field, index) => {
|
|
33177
|
-
const isActive = index === active;
|
|
33178
|
-
const value = values[field.key];
|
|
33179
|
-
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
33180
|
-
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33181
|
-
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
33182
|
-
/* @__PURE__ */ jsx55(Box44, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
33183
|
-
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
33184
|
-
TextInput4,
|
|
33185
|
-
{
|
|
33186
|
-
value,
|
|
33187
|
-
onChange: (next) => onChange(field.key, next),
|
|
33188
|
-
onSubmit: () => setEditing(false),
|
|
33189
|
-
mask: field.masked ? "\u2022" : void 0
|
|
33190
|
-
}
|
|
33191
|
-
) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (field.hint ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
33192
|
-
field.hint && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: field.hint })
|
|
33193
|
-
] }, field.key);
|
|
33194
|
-
}) }),
|
|
33195
|
-
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
33196
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33197
|
-
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33198
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33199
|
-
" ",
|
|
33200
|
-
notice.text
|
|
33201
|
-
] })
|
|
33202
|
-
] }),
|
|
33203
|
-
footer,
|
|
33204
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33205
|
-
/* @__PURE__ */ jsx55(
|
|
33206
|
-
ControlHints,
|
|
33207
|
-
{
|
|
33208
|
-
hints: editing ? [
|
|
33209
|
-
{ keys: "type", label: "edit" },
|
|
33210
|
-
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
33211
|
-
{ keys: "\u23CE", label: "done" },
|
|
33212
|
-
{ keys: "Esc", label: "cancel edit" }
|
|
33213
|
-
] : [
|
|
33214
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
33215
|
-
{ keys: "\u23CE", label: "edit" },
|
|
33216
|
-
{ keys: "c", label: "clear" },
|
|
33217
|
-
{ keys: "s", label: "save" },
|
|
33218
|
-
...actions.map(({ key, label }) => ({ keys: key, label })),
|
|
33219
|
-
{ keys: "Esc/q", label: "back without saving" }
|
|
33220
|
-
]
|
|
33221
|
-
}
|
|
33222
|
-
)
|
|
33223
|
-
] });
|
|
33224
|
-
}
|
|
33225
|
-
var init_FieldForm = __esm({
|
|
33226
|
-
"packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx"() {
|
|
33227
|
-
"use strict";
|
|
33228
|
-
init_home_theme();
|
|
33229
|
-
init_control_hints();
|
|
33230
|
-
}
|
|
33231
|
-
});
|
|
33232
|
-
|
|
33233
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts
|
|
33234
|
-
import { execFile as execFile2 } from "node:child_process";
|
|
33235
|
-
import { access as access6, constants } from "node:fs/promises";
|
|
33236
|
-
function effectiveBinary(name, savedBinary) {
|
|
33237
|
-
return savedBinary.trim() || AGENT_BINARIES[name];
|
|
33238
|
-
}
|
|
33239
|
-
function defaultModelLabel(name) {
|
|
33240
|
-
const model = DEFAULT_MODELS[name];
|
|
33241
|
-
return model && model !== "Auto" ? model : "chosen by the agent";
|
|
33242
|
-
}
|
|
33243
|
-
function resolveOnPath(binary) {
|
|
33244
|
-
if (binary.includes("/")) {
|
|
33245
|
-
return access6(binary, constants.X_OK).then(
|
|
33246
|
-
() => binary,
|
|
33247
|
-
() => null
|
|
33248
|
-
);
|
|
33249
|
-
}
|
|
33250
|
-
return new Promise((resolve28) => {
|
|
33251
|
-
execFile2(
|
|
33252
|
-
process.platform === "win32" ? "where" : "which",
|
|
33253
|
-
[binary],
|
|
33254
|
-
(error, stdout) => resolve28(error ? null : stdout.split("\n")[0]?.trim() ?? null)
|
|
33255
|
-
);
|
|
33256
|
-
});
|
|
33257
|
-
}
|
|
33258
|
-
function readVersion(binary) {
|
|
33259
|
-
return new Promise((resolve28) => {
|
|
33260
|
-
execFile2(binary, ["--version"], { timeout: VERSION_TIMEOUT_MS }, (error, stdout) => {
|
|
33261
|
-
const line = stdout.split("\n")[0]?.trim() ?? "";
|
|
33262
|
-
if (!error && line) resolve28(pass("version", line));
|
|
33263
|
-
else resolve28(fail3("version", "runs, but did not report a version"));
|
|
33264
|
-
});
|
|
33265
|
-
});
|
|
33266
|
-
}
|
|
33267
|
-
async function inspectAgent(name, binary) {
|
|
33268
|
-
const target = effectiveBinary(name, binary);
|
|
33269
|
-
const found = await resolveOnPath(target);
|
|
33270
|
-
if (!found) return [fail3("path", `\`${target}\` was not found or is not executable`)];
|
|
33271
|
-
const checks = [pass("path", found)];
|
|
33272
|
-
checks.push(await readVersion(found));
|
|
33273
|
-
if (name === "claude") {
|
|
33274
|
-
const auth = await withBinaryEnv(name, found, () => checkAgentAuth(name));
|
|
33275
|
-
checks.push(
|
|
33276
|
-
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
33277
|
-
);
|
|
33278
|
-
}
|
|
33279
|
-
return checks;
|
|
33280
|
-
}
|
|
33281
|
-
async function testAgent(name, binary, model) {
|
|
33282
|
-
const checks = await inspectAgent(name, binary);
|
|
33283
|
-
if (!checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
33284
|
-
const target = effectiveBinary(name, binary);
|
|
33285
|
-
const found = await resolveOnPath(target) ?? target;
|
|
33286
|
-
const started = Date.now();
|
|
33287
|
-
const result = await withBinaryEnv(
|
|
33288
|
-
name,
|
|
33289
|
-
found,
|
|
33290
|
-
() => createLocalCliAgentInvoker().invoke({
|
|
33291
|
-
agent: name,
|
|
33292
|
-
...model.trim() ? { model: model.trim() } : {},
|
|
33293
|
-
prompt: TEST_PROMPT,
|
|
33294
|
-
timeoutMs: PROMPT_TIMEOUT_MS
|
|
33295
|
-
})
|
|
33296
|
-
);
|
|
33297
|
-
const seconds = ((Date.now() - started) / 1e3).toFixed(1);
|
|
33298
|
-
if (result.timedOut) return [...checks, fail3("prompt", `no answer within ${PROMPT_TIMEOUT_MS / 1e3}s`)];
|
|
33299
|
-
if (result.exitCode !== 0) {
|
|
33300
|
-
const reason = result.stderr.trim().split("\n").pop()?.slice(0, 160) || `exited with code ${result.exitCode}`;
|
|
33301
|
-
return [...checks, fail3("prompt", reason)];
|
|
33302
|
-
}
|
|
33303
|
-
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
33304
|
-
}
|
|
33305
|
-
function statusFromChecks(name, checks) {
|
|
33306
|
-
if (checks.length === 0) return "checking";
|
|
33307
|
-
if (checks.some((check) => check.step === "path" && !check.ok)) return "not-found";
|
|
33308
|
-
const login = checks.find((check) => check.step === "login");
|
|
33309
|
-
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
33310
|
-
const prompt = checks.find((check) => check.step === "prompt");
|
|
33311
|
-
if (prompt) return prompt.ok ? "ready" : "not-logged-in";
|
|
33312
|
-
return name === "claude" ? "ready" : "unknown";
|
|
33313
|
-
}
|
|
33314
|
-
function nextStepHint(name, status) {
|
|
33315
|
-
if (status === "not-found") return INSTALL_HINTS[name];
|
|
33316
|
-
if (status === "not-logged-in") return LOGIN_HINTS[name];
|
|
33317
|
-
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
33318
|
-
return "";
|
|
33319
|
-
}
|
|
33320
|
-
async function withBinaryEnv(name, binary, run) {
|
|
33321
|
-
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
33322
|
-
const previous = process.env[key];
|
|
33323
|
-
process.env[key] = binary;
|
|
33324
|
-
try {
|
|
33325
|
-
return await run();
|
|
33326
|
-
} finally {
|
|
33327
|
-
if (previous === void 0) delete process.env[key];
|
|
33328
|
-
else process.env[key] = previous;
|
|
33329
|
-
}
|
|
33330
|
-
}
|
|
33331
|
-
var VERSION_TIMEOUT_MS, PROMPT_TIMEOUT_MS, TEST_PROMPT, INSTALL_HINTS, LOGIN_HINTS, fail3, pass;
|
|
33332
|
-
var init_agent_status = __esm({
|
|
33333
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts"() {
|
|
33334
|
-
"use strict";
|
|
33335
|
-
init_src4();
|
|
33336
|
-
VERSION_TIMEOUT_MS = 5e3;
|
|
33337
|
-
PROMPT_TIMEOUT_MS = 6e4;
|
|
33338
|
-
TEST_PROMPT = "Reply with the single word: ok";
|
|
33339
|
-
INSTALL_HINTS = {
|
|
33340
|
-
claude: "npm install -g @anthropic-ai/claude-code",
|
|
33341
|
-
codex: "npm install -g @openai/codex",
|
|
33342
|
-
opencode: "npm install -g opencode-ai",
|
|
33343
|
-
cursor: "install Cursor\u2019s `cursor-agent` command",
|
|
33344
|
-
copilot: "npm install -g @github/copilot"
|
|
33345
|
-
};
|
|
33346
|
-
LOGIN_HINTS = {
|
|
33347
|
-
claude: "run `claude login`",
|
|
33348
|
-
codex: "set OPENAI_API_KEY, or sign in with a ChatGPT account",
|
|
33349
|
-
opencode: "run `opencode auth`",
|
|
33350
|
-
cursor: "sign in from Cursor",
|
|
33351
|
-
copilot: "run `copilot` and sign in"
|
|
33352
|
-
};
|
|
33353
|
-
fail3 = (step, detail) => ({ step, ok: false, detail });
|
|
33354
|
-
pass = (step, detail) => ({ step, ok: true, detail });
|
|
33355
|
-
}
|
|
33356
|
-
});
|
|
33357
|
-
|
|
33358
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusLine.tsx
|
|
33359
|
-
import { Box as Box45, Text as Text47 } from "ink";
|
|
33360
|
-
import { jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33361
|
-
function AgentStatusBadge({
|
|
33362
|
-
name,
|
|
33363
|
-
checks
|
|
33364
|
-
}) {
|
|
33365
|
-
const status = checks ? statusFromChecks(name, checks) : "checking";
|
|
33366
|
-
return /* @__PURE__ */ jsx56(Text47, { color: STATUS_COLOR[status], children: STATUS_TEXT[status] });
|
|
33367
|
-
}
|
|
33368
|
-
function AgentChecks({
|
|
33369
|
-
name,
|
|
33370
|
-
checks
|
|
33371
|
-
}) {
|
|
33372
|
-
if (!checks) {
|
|
33373
|
-
return /* @__PURE__ */ jsx56(Box45, { marginTop: 1, children: /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Checking..." }) });
|
|
33374
|
-
}
|
|
33375
|
-
const status = statusFromChecks(name, checks);
|
|
33376
|
-
const hint = nextStepHint(name, status);
|
|
33377
|
-
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", marginTop: 1, children: [
|
|
33378
|
-
/* @__PURE__ */ jsxs46(Text47, { bold: true, children: [
|
|
33379
|
-
"Status: ",
|
|
33380
|
-
/* @__PURE__ */ jsx56(Text47, { color: STATUS_COLOR[status], children: STATUS_TEXT[status] })
|
|
33381
|
-
] }),
|
|
33382
|
-
checks.map((check) => /* @__PURE__ */ jsxs46(Text47, { color: check.ok ? PALETTE.success : PALETTE.muted, children: [
|
|
33383
|
-
check.ok ? "\u2713" : "\xB7",
|
|
33384
|
-
" ",
|
|
33385
|
-
check.step,
|
|
33386
|
-
": ",
|
|
33387
|
-
check.detail
|
|
33388
|
-
] }, check.step)),
|
|
33389
|
-
hint && /* @__PURE__ */ jsxs46(Text47, { color: PALETTE.muted, children: [
|
|
33390
|
-
"Next: ",
|
|
33391
|
-
hint
|
|
33392
|
-
] })
|
|
33393
|
-
] });
|
|
33394
|
-
}
|
|
33395
|
-
var STATUS_TEXT, STATUS_COLOR;
|
|
33396
|
-
var init_AgentStatusLine = __esm({
|
|
33397
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusLine.tsx"() {
|
|
33398
|
-
"use strict";
|
|
33399
|
-
init_home_theme();
|
|
33400
|
-
init_agent_status();
|
|
33401
|
-
STATUS_TEXT = {
|
|
33402
|
-
checking: "checking...",
|
|
33403
|
-
ready: "ready",
|
|
33404
|
-
"not-found": "not found",
|
|
33405
|
-
"not-logged-in": "not logged in",
|
|
33406
|
-
unknown: "found, login not checked"
|
|
33407
|
-
};
|
|
33408
|
-
STATUS_COLOR = {
|
|
33409
|
-
checking: PALETTE.muted,
|
|
33410
|
-
ready: PALETTE.success,
|
|
33411
|
-
"not-found": PALETTE.error,
|
|
33412
|
-
"not-logged-in": PALETTE.error,
|
|
33413
|
-
unknown: PALETTE.muted
|
|
33414
|
-
};
|
|
33415
|
-
}
|
|
33416
|
-
});
|
|
33417
|
-
|
|
33418
|
-
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
33419
|
-
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
33420
|
-
import { Box as Box46, Text as Text48, useInput as useInput12 } from "ink";
|
|
33421
|
-
import { Fragment as Fragment18, jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
33422
|
-
function AgentForm({
|
|
33423
|
-
name,
|
|
33424
|
-
config,
|
|
33425
|
-
setConfig,
|
|
33426
|
-
onBack
|
|
33427
|
-
}) {
|
|
33428
|
-
const [saving, setSaving] = useState30(false);
|
|
33429
|
-
const [testing, setTesting] = useState30(false);
|
|
33430
|
-
const [notice, setNotice] = useState30(null);
|
|
33431
|
-
const [checks, setChecks] = useState30(void 0);
|
|
33432
|
-
const settings = config.agents[name];
|
|
33433
|
-
useEffect22(() => {
|
|
33434
|
-
let current = true;
|
|
33435
|
-
setChecks(void 0);
|
|
33436
|
-
void inspectAgent(name, settings.binary).then((result) => current && setChecks(result));
|
|
33437
|
-
return () => {
|
|
33438
|
-
current = false;
|
|
33439
|
-
};
|
|
33440
|
-
}, [name, settings.binary]);
|
|
33441
|
-
const save = () => {
|
|
33442
|
-
setSaving(true);
|
|
33443
|
-
setNotice(null);
|
|
33444
|
-
writeAgentConfig(config).then(() => {
|
|
33445
|
-
applyBinaryOverrides(config);
|
|
33446
|
-
setNotice({ kind: "success", text: `${AGENT_LABELS[name]} settings saved` });
|
|
33447
|
-
}).catch(
|
|
33448
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
33449
|
-
).finally(() => setSaving(false));
|
|
33450
|
-
};
|
|
33451
|
-
const runFullTest = () => {
|
|
33452
|
-
setTesting(true);
|
|
33453
|
-
setNotice(null);
|
|
33454
|
-
setChecks(void 0);
|
|
33455
|
-
testAgent(name, settings.binary, settings.model).then(setChecks).catch(
|
|
33456
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "The test could not run" })
|
|
33457
|
-
).finally(() => setTesting(false));
|
|
33458
|
-
};
|
|
33459
|
-
return /* @__PURE__ */ jsx57(
|
|
33460
|
-
FieldForm,
|
|
33461
|
-
{
|
|
33462
|
-
title: AGENT_LABELS[name],
|
|
33463
|
-
subtitle: `Runs the \`${AGENT_HINTS[name]}\` command. ${config.defaultAgent === name ? "This is the default agent." : ""}`.trim(),
|
|
33464
|
-
fields: agentFields(name),
|
|
33465
|
-
values: { binary: settings.binary, model: settings.model },
|
|
33466
|
-
onChange: (key, value) => {
|
|
33467
|
-
setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [key]: value } } });
|
|
33468
|
-
setNotice(null);
|
|
33469
|
-
},
|
|
33470
|
-
onSave: save,
|
|
33471
|
-
onQuit: onBack,
|
|
33472
|
-
notice,
|
|
33473
|
-
busy: saving || testing,
|
|
33474
|
-
footer: /* @__PURE__ */ jsx57(AgentChecks, { name, checks }),
|
|
33475
|
-
actions: [{ key: "t", label: "full test (uses a few tokens)", run: runFullTest }]
|
|
33476
|
-
}
|
|
33477
|
-
);
|
|
33478
|
-
}
|
|
33479
|
-
function AgentsScreen({ onDone }) {
|
|
33480
|
-
const [config, setConfig] = useState30(null);
|
|
33481
|
-
const [focus, setFocus] = useState30(0);
|
|
33482
|
-
const [open, setOpen] = useState30(null);
|
|
33483
|
-
const [notice, setNotice] = useState30(null);
|
|
33484
|
-
const [checks, setChecks] = useState30({});
|
|
33485
|
-
const inspectAll = (loaded) => {
|
|
33486
|
-
for (const name of AGENT_NAMES) {
|
|
33487
|
-
void inspectAgent(name, loaded.agents[name].binary).then(
|
|
33488
|
-
(result) => setChecks((previous) => ({ ...previous, [name]: result }))
|
|
33489
|
-
);
|
|
33490
|
-
}
|
|
33491
|
-
};
|
|
33492
|
-
useEffect22(() => {
|
|
33493
|
-
void readAgentConfig().then((loaded) => {
|
|
33494
|
-
setConfig(loaded);
|
|
33495
|
-
inspectAll(loaded);
|
|
33496
|
-
startDebugRun({
|
|
33497
|
-
flow: "settings/agents",
|
|
33498
|
-
step: "01-agents",
|
|
33499
|
-
menuOption: "Configuration > Agents",
|
|
33500
|
-
inputs: { default_agent: loaded.defaultAgent }
|
|
33501
|
-
});
|
|
33502
|
-
});
|
|
33503
|
-
}, []);
|
|
33504
|
-
const cycleDefault = (step) => {
|
|
33505
|
-
if (!config) return;
|
|
33506
|
-
const index = AGENT_NAMES.indexOf(config.defaultAgent);
|
|
33507
|
-
const next = { ...config, defaultAgent: AGENT_NAMES[(index + step + AGENT_NAMES.length) % AGENT_NAMES.length] };
|
|
33508
|
-
setConfig(next);
|
|
33509
|
-
writeAgentConfig(next).then(() => setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[next.defaultAgent]}` })).catch(
|
|
33510
|
-
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
33511
|
-
);
|
|
33512
|
-
};
|
|
33513
|
-
useInput12((input, key) => {
|
|
33514
|
-
if (!config || open) return;
|
|
33515
|
-
const row = ROWS[focus];
|
|
33516
|
-
if (key.upArrow) {
|
|
33517
|
-
setFocus((i) => (i - 1 + ROWS.length) % ROWS.length);
|
|
33518
|
-
return;
|
|
33519
|
-
}
|
|
33520
|
-
if (key.downArrow || key.tab) {
|
|
33521
|
-
setFocus((i) => (i + 1) % ROWS.length);
|
|
33522
|
-
return;
|
|
33523
|
-
}
|
|
33524
|
-
if (row.kind === "default" && key.leftArrow) {
|
|
33525
|
-
cycleDefault(-1);
|
|
33526
|
-
return;
|
|
33527
|
-
}
|
|
33528
|
-
if (row.kind === "default" && key.rightArrow) {
|
|
33529
|
-
cycleDefault(1);
|
|
33530
|
-
return;
|
|
33531
|
-
}
|
|
33532
|
-
if (key.return) {
|
|
33533
|
-
if (row.kind === "default") cycleDefault(1);
|
|
33534
|
-
else setOpen(row.name);
|
|
33535
|
-
return;
|
|
33536
|
-
}
|
|
33537
|
-
if (key.escape || input === "q") {
|
|
33538
|
-
void finishDebugRun({ outputs: { default_agent: config.defaultAgent }, status: "success", exitMethod: "saved" });
|
|
33539
|
-
onDone();
|
|
33540
|
-
}
|
|
33541
|
-
});
|
|
33542
|
-
if (!config) {
|
|
33543
|
-
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33544
|
-
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
33545
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33546
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "Loading..." })
|
|
33547
|
-
] });
|
|
33548
|
-
}
|
|
33549
|
-
if (open) {
|
|
33550
|
-
return /* @__PURE__ */ jsx57(
|
|
33551
|
-
AgentForm,
|
|
33552
|
-
{
|
|
33553
|
-
name: open,
|
|
33554
|
-
config,
|
|
33555
|
-
setConfig,
|
|
33556
|
-
onBack: () => {
|
|
33557
|
-
setOpen(null);
|
|
33558
|
-
void readAgentConfig().then((saved) => {
|
|
33559
|
-
setConfig(saved);
|
|
33560
|
-
inspectAll(saved);
|
|
33561
|
-
});
|
|
33562
|
-
}
|
|
33563
|
-
}
|
|
33564
|
-
);
|
|
33565
|
-
}
|
|
33566
|
-
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33567
|
-
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
33568
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "The coding agent the CLI runs, and the settings for each one." }),
|
|
33569
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33570
|
-
ROWS.map((row, index) => {
|
|
33571
|
-
const isFocused = index === focus;
|
|
33572
|
-
const pointer = /* @__PURE__ */ jsx57(Text48, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
33573
|
-
if (row.kind === "default") {
|
|
33574
|
-
return /* @__PURE__ */ jsx57(Box46, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
33575
|
-
pointer,
|
|
33576
|
-
/* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: "Default agent" }),
|
|
33577
|
-
/* @__PURE__ */ jsx57(Text48, { bold: true, children: `\u2039 ${AGENT_LABELS[config.defaultAgent]} \u203A` })
|
|
33578
|
-
] }) }, "default");
|
|
33579
|
-
}
|
|
33580
|
-
const model = config.agents[row.name].model;
|
|
33581
|
-
return /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
33582
|
-
pointer,
|
|
33583
|
-
/* @__PURE__ */ jsx57(Box46, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[row.name] }) }),
|
|
33584
|
-
/* @__PURE__ */ jsx57(Box46, { width: 26, flexShrink: 0, children: /* @__PURE__ */ jsx57(AgentStatusBadge, { name: row.name, checks: checks[row.name] }) }),
|
|
33585
|
-
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: `model: ${model || defaultModelLabel(row.name)}` }),
|
|
33586
|
-
row.name === config.defaultAgent && /* @__PURE__ */ jsx57(Text48, { color: PALETTE.success, children: "(default)" })
|
|
33587
|
-
] }, row.name);
|
|
33588
|
-
}),
|
|
33589
|
-
notice && /* @__PURE__ */ jsxs47(Fragment18, { children: [
|
|
33590
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33591
|
-
/* @__PURE__ */ jsxs47(Text48, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33592
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33593
|
-
" ",
|
|
33594
|
-
notice.text
|
|
33595
|
-
] })
|
|
33596
|
-
] }),
|
|
33597
|
-
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33598
|
-
/* @__PURE__ */ jsx57(
|
|
33599
|
-
ControlHints,
|
|
33600
|
-
{
|
|
33601
|
-
hints: ROWS[focus].kind === "default" ? [
|
|
33602
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
33603
|
-
{ keys: "\u2190/\u2192", label: "change default agent" },
|
|
33604
|
-
{ keys: "Esc/q", label: "back" }
|
|
33605
|
-
] : [
|
|
33606
|
-
{ keys: "\u2191/\u2193", label: "move" },
|
|
33607
|
-
{ keys: "\u23CE", label: "open" },
|
|
33608
|
-
{ keys: "Esc/q", label: "back" }
|
|
33609
|
-
]
|
|
33610
|
-
}
|
|
33611
|
-
)
|
|
33612
|
-
] });
|
|
33613
|
-
}
|
|
33614
|
-
var agentFields, ROWS;
|
|
33615
|
-
var init_AgentScreens = __esm({
|
|
33616
|
-
"packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx"() {
|
|
33617
|
-
"use strict";
|
|
33618
|
-
init_src4();
|
|
33619
|
-
init_home_theme();
|
|
33620
|
-
init_control_hints();
|
|
33621
|
-
init_debug_store();
|
|
33622
|
-
init_FieldForm();
|
|
33623
|
-
init_agent_store();
|
|
33624
|
-
init_agent_status();
|
|
33625
|
-
init_AgentStatusLine();
|
|
33626
|
-
init_apply_binary_overrides();
|
|
33627
|
-
agentFields = (name) => [
|
|
33628
|
-
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_HINTS[name]}\` from the PATH)` },
|
|
33629
|
-
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name)})` }
|
|
33630
|
-
];
|
|
33631
|
-
ROWS = [{ kind: "default" }, ...AGENT_NAMES.map((name) => ({ kind: "agent", name }))];
|
|
33632
|
-
}
|
|
33633
|
-
});
|
|
33634
|
-
|
|
33635
33004
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
33636
33005
|
async function readCredentials() {
|
|
33637
33006
|
const store = await readV1Store();
|
|
@@ -33663,10 +33032,11 @@ var init_config_store = __esm({
|
|
|
33663
33032
|
}
|
|
33664
33033
|
});
|
|
33665
33034
|
|
|
33666
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/
|
|
33667
|
-
import { useEffect as
|
|
33668
|
-
import { Box as
|
|
33669
|
-
import
|
|
33035
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
33036
|
+
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
33037
|
+
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
33038
|
+
import TextInput4 from "ink-text-input";
|
|
33039
|
+
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
33670
33040
|
function debugFields(config) {
|
|
33671
33041
|
return {
|
|
33672
33042
|
space_id: config?.spaceId ?? "",
|
|
@@ -33678,159 +33048,189 @@ function debugFields(config) {
|
|
|
33678
33048
|
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
33679
33049
|
};
|
|
33680
33050
|
}
|
|
33681
|
-
function
|
|
33682
|
-
const [
|
|
33683
|
-
const [
|
|
33684
|
-
const [
|
|
33685
|
-
const [
|
|
33686
|
-
|
|
33687
|
-
|
|
33051
|
+
function ConfigurationScreen({ onDone }) {
|
|
33052
|
+
const [stage, setStage] = useState29("loading");
|
|
33053
|
+
const [config, setConfig] = useState29(null);
|
|
33054
|
+
const [activeField, setActiveField] = useState29("spaceId");
|
|
33055
|
+
const [notice, setNotice] = useState29(null);
|
|
33056
|
+
const [lastSaved, setLastSaved] = useState29(null);
|
|
33057
|
+
const [editing, setEditing] = useState29(false);
|
|
33058
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
33059
|
+
useEffect22(() => {
|
|
33060
|
+
readCredentials().then((cfg) => {
|
|
33688
33061
|
setConfig(cfg);
|
|
33062
|
+
setStage("form");
|
|
33689
33063
|
startDebugRun({
|
|
33690
33064
|
flow: "settings/contentful-configuration",
|
|
33691
33065
|
step: "01-configuration",
|
|
33692
|
-
menuOption: "Configuration
|
|
33066
|
+
menuOption: "Configuration",
|
|
33693
33067
|
inputs: debugFields(cfg)
|
|
33694
33068
|
});
|
|
33695
33069
|
});
|
|
33696
33070
|
}, []);
|
|
33697
|
-
|
|
33698
|
-
|
|
33699
|
-
|
|
33700
|
-
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33701
|
-
/* @__PURE__ */ jsx58(Text49, { color: PALETTE.accent, children: "Loading..." })
|
|
33702
|
-
] });
|
|
33071
|
+
function fieldValue(field) {
|
|
33072
|
+
if (!config) return "";
|
|
33073
|
+
return config[field] || "";
|
|
33703
33074
|
}
|
|
33704
|
-
|
|
33705
|
-
|
|
33075
|
+
function setFieldValue(field, value) {
|
|
33076
|
+
if (!config) return;
|
|
33077
|
+
setConfig({ ...config, [field]: value });
|
|
33078
|
+
setNotice(null);
|
|
33079
|
+
}
|
|
33080
|
+
function handleSave() {
|
|
33081
|
+
if (!config) return;
|
|
33082
|
+
setStage("saving");
|
|
33706
33083
|
setNotice(null);
|
|
33707
33084
|
writeCredentials(config).then(() => {
|
|
33708
33085
|
setLastSaved(config);
|
|
33709
33086
|
if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
|
|
33710
|
-
setNotice({ kind: "success", text: "
|
|
33087
|
+
setNotice({ kind: "success", text: "Configuration saved" });
|
|
33088
|
+
setStage("form");
|
|
33711
33089
|
}).catch((err) => {
|
|
33712
33090
|
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
33713
|
-
|
|
33714
|
-
|
|
33715
|
-
|
|
33091
|
+
setStage("form");
|
|
33092
|
+
});
|
|
33093
|
+
}
|
|
33094
|
+
function quit() {
|
|
33716
33095
|
void finishDebugRun(
|
|
33717
33096
|
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
33718
33097
|
);
|
|
33719
33098
|
onDone();
|
|
33720
|
-
};
|
|
33721
|
-
return /* @__PURE__ */ jsx58(
|
|
33722
|
-
FieldForm,
|
|
33723
|
-
{
|
|
33724
|
-
title: "Project",
|
|
33725
|
-
subtitle: "The Contentful space and where the CLI keeps its files.",
|
|
33726
|
-
fields: FIELDS2,
|
|
33727
|
-
values: valuesOf(config),
|
|
33728
|
-
onChange: (key, value) => {
|
|
33729
|
-
setConfig({ ...config, [key]: value });
|
|
33730
|
-
setNotice(null);
|
|
33731
|
-
},
|
|
33732
|
-
onSave: save,
|
|
33733
|
-
onQuit: quit,
|
|
33734
|
-
notice,
|
|
33735
|
-
busy: saving
|
|
33736
|
-
}
|
|
33737
|
-
);
|
|
33738
|
-
}
|
|
33739
|
-
var FIELDS2, valuesOf;
|
|
33740
|
-
var init_ProjectConfigScreen = __esm({
|
|
33741
|
-
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx"() {
|
|
33742
|
-
"use strict";
|
|
33743
|
-
init_home_theme();
|
|
33744
|
-
init_debug_store();
|
|
33745
|
-
init_FieldForm();
|
|
33746
|
-
init_config_store();
|
|
33747
|
-
FIELDS2 = [
|
|
33748
|
-
{ key: "spaceId", label: "Space ID" },
|
|
33749
|
-
{ key: "environmentId", label: "Environment ID" },
|
|
33750
|
-
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
33751
|
-
{ key: "host", label: "API Host" },
|
|
33752
|
-
{ key: "defaultComponentDir", label: "Default component directory" },
|
|
33753
|
-
{ key: "defaultTokenFile", label: "Default token file" },
|
|
33754
|
-
{ key: "contentfulBaseDir", label: "Root Project Directory", hint: "(where .contentful goes)" }
|
|
33755
|
-
];
|
|
33756
|
-
valuesOf = (config) => Object.fromEntries(FIELDS2.map(({ key }) => [key, config[key] || ""]));
|
|
33757
33099
|
}
|
|
33758
|
-
|
|
33759
|
-
|
|
33760
|
-
|
|
33761
|
-
|
|
33762
|
-
|
|
33763
|
-
|
|
33764
|
-
|
|
33765
|
-
const [focus, setFocus] = useState32(0);
|
|
33766
|
-
const [open, setOpen] = useState32(null);
|
|
33767
|
-
const close = () => setOpen(null);
|
|
33768
|
-
useInput13((input, key) => {
|
|
33769
|
-
if (open) return;
|
|
33770
|
-
if (key.upArrow) {
|
|
33771
|
-
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
33100
|
+
useInput11((input, key) => {
|
|
33101
|
+
if (stage === "loading" || stage === "saving") return;
|
|
33102
|
+
if (editing) {
|
|
33103
|
+
if (key.escape) {
|
|
33104
|
+
setFieldValue(activeField, valueBeforeEdit);
|
|
33105
|
+
setEditing(false);
|
|
33106
|
+
}
|
|
33772
33107
|
return;
|
|
33773
33108
|
}
|
|
33774
|
-
if (key.
|
|
33775
|
-
|
|
33109
|
+
if (key.escape || input === "q") {
|
|
33110
|
+
quit();
|
|
33776
33111
|
return;
|
|
33777
33112
|
}
|
|
33778
|
-
if (
|
|
33779
|
-
|
|
33113
|
+
if (input === "s") {
|
|
33114
|
+
handleSave();
|
|
33115
|
+
return;
|
|
33116
|
+
}
|
|
33117
|
+
if (input === "c") {
|
|
33118
|
+
setFieldValue(activeField, "");
|
|
33119
|
+
return;
|
|
33120
|
+
}
|
|
33121
|
+
if (key.tab || key.downArrow) {
|
|
33122
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
33123
|
+
setActiveField(FIELD_ORDER[(idx + 1) % FIELD_ORDER.length]);
|
|
33124
|
+
return;
|
|
33125
|
+
}
|
|
33126
|
+
if (key.upArrow) {
|
|
33127
|
+
const idx = FIELD_ORDER.indexOf(activeField);
|
|
33128
|
+
setActiveField(FIELD_ORDER[(idx - 1 + FIELD_ORDER.length) % FIELD_ORDER.length]);
|
|
33780
33129
|
return;
|
|
33781
33130
|
}
|
|
33782
|
-
if (key.
|
|
33131
|
+
if (key.return) {
|
|
33132
|
+
setValueBeforeEdit(fieldValue(activeField));
|
|
33133
|
+
setEditing(true);
|
|
33134
|
+
}
|
|
33783
33135
|
});
|
|
33784
|
-
if (
|
|
33785
|
-
|
|
33786
|
-
|
|
33787
|
-
|
|
33788
|
-
|
|
33789
|
-
|
|
33790
|
-
|
|
33791
|
-
|
|
33792
|
-
|
|
33793
|
-
|
|
33794
|
-
/* @__PURE__ */
|
|
33795
|
-
|
|
33136
|
+
if (stage === "loading") {
|
|
33137
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33138
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
|
|
33139
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33140
|
+
/* @__PURE__ */ jsx55(Text46, { color: PALETTE.accent, children: "Loading..." })
|
|
33141
|
+
] });
|
|
33142
|
+
}
|
|
33143
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33144
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: "Configuration" }),
|
|
33145
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33146
|
+
/* @__PURE__ */ jsx55(Box44, { flexDirection: "column", children: FIELD_ORDER.map((field) => {
|
|
33147
|
+
const isActive = activeField === field;
|
|
33148
|
+
const value = fieldValue(field);
|
|
33149
|
+
const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
|
|
33150
|
+
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33151
|
+
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
33152
|
+
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
|
|
33153
|
+
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
33154
|
+
TextInput4,
|
|
33155
|
+
{
|
|
33156
|
+
value,
|
|
33157
|
+
onChange: (next) => setFieldValue(field, next),
|
|
33158
|
+
onSubmit: () => setEditing(false),
|
|
33159
|
+
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
33160
|
+
}
|
|
33161
|
+
) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (FIELD_HINTS[field] ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
33162
|
+
FIELD_HINTS[field] && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: FIELD_HINTS[field] })
|
|
33163
|
+
] }, field);
|
|
33164
|
+
}) }),
|
|
33165
|
+
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
33166
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33167
|
+
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33168
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33169
|
+
" ",
|
|
33170
|
+
notice.text
|
|
33171
|
+
] })
|
|
33172
|
+
] }),
|
|
33173
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33174
|
+
/* @__PURE__ */ jsx55(
|
|
33796
33175
|
ControlHints,
|
|
33797
33176
|
{
|
|
33798
|
-
hints: [
|
|
33177
|
+
hints: editing ? [
|
|
33178
|
+
{ keys: "type", label: "edit" },
|
|
33179
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
33180
|
+
{ keys: "\u23CE", label: "done" },
|
|
33181
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
33182
|
+
] : [
|
|
33799
33183
|
{ keys: "\u2191/\u2193", label: "move" },
|
|
33800
|
-
{ keys: "\u23CE", label: "
|
|
33801
|
-
{ keys: "
|
|
33184
|
+
{ keys: "\u23CE", label: "edit" },
|
|
33185
|
+
{ keys: "c", label: "clear" },
|
|
33186
|
+
{ keys: "s", label: "save" },
|
|
33187
|
+
{ keys: "Esc/q", label: "quit without saving" }
|
|
33802
33188
|
]
|
|
33803
33189
|
}
|
|
33804
33190
|
)
|
|
33805
33191
|
] });
|
|
33806
33192
|
}
|
|
33807
|
-
var
|
|
33193
|
+
var FIELD_ORDER, FIELD_LABELS, FIELD_HINTS, LABEL_WIDTH;
|
|
33808
33194
|
var init_ContentfulConfigScreen = __esm({
|
|
33809
33195
|
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx"() {
|
|
33810
33196
|
"use strict";
|
|
33811
|
-
|
|
33197
|
+
init_theme();
|
|
33198
|
+
init_config_store();
|
|
33199
|
+
init_debug_store();
|
|
33812
33200
|
init_control_hints();
|
|
33813
|
-
|
|
33814
|
-
|
|
33815
|
-
|
|
33816
|
-
|
|
33817
|
-
|
|
33818
|
-
|
|
33819
|
-
|
|
33820
|
-
|
|
33821
|
-
{ id: "agents", label: "Agents", description: "Which coding agent the CLI uses, and each agent\u2019s settings" }
|
|
33201
|
+
FIELD_ORDER = [
|
|
33202
|
+
"spaceId",
|
|
33203
|
+
"environmentId",
|
|
33204
|
+
"cmaToken",
|
|
33205
|
+
"host",
|
|
33206
|
+
"defaultComponentDir",
|
|
33207
|
+
"defaultTokenFile",
|
|
33208
|
+
"contentfulBaseDir"
|
|
33822
33209
|
];
|
|
33210
|
+
FIELD_LABELS = {
|
|
33211
|
+
spaceId: "Space ID",
|
|
33212
|
+
environmentId: "Environment ID",
|
|
33213
|
+
cmaToken: "CMA Token",
|
|
33214
|
+
host: "API Host",
|
|
33215
|
+
defaultComponentDir: "Default component directory",
|
|
33216
|
+
defaultTokenFile: "Default token file",
|
|
33217
|
+
contentfulBaseDir: "Root Project Directory"
|
|
33218
|
+
};
|
|
33219
|
+
FIELD_HINTS = {
|
|
33220
|
+
contentfulBaseDir: "(where .contentful goes)"
|
|
33221
|
+
};
|
|
33222
|
+
LABEL_WIDTH = Math.max(...Object.values(FIELD_LABELS).map((label) => label.length));
|
|
33823
33223
|
}
|
|
33824
33224
|
});
|
|
33825
33225
|
|
|
33826
33226
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
33827
|
-
import { useEffect as
|
|
33828
|
-
import { Box as
|
|
33829
|
-
import { Fragment as
|
|
33227
|
+
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
33228
|
+
import { Box as Box45, Text as Text47, useInput as useInput12 } from "ink";
|
|
33229
|
+
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33830
33230
|
function OptInAnalyticsScreen({ onDone }) {
|
|
33831
|
-
const [loading, setLoading] =
|
|
33832
|
-
const [enabled, setEnabled] =
|
|
33833
|
-
|
|
33231
|
+
const [loading, setLoading] = useState30(true);
|
|
33232
|
+
const [enabled, setEnabled] = useState30(true);
|
|
33233
|
+
useEffect23(() => {
|
|
33834
33234
|
readAnalyticsSetting().then((setting) => {
|
|
33835
33235
|
setEnabled(setting.enabled);
|
|
33836
33236
|
setLoading(false);
|
|
@@ -33842,7 +33242,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33842
33242
|
});
|
|
33843
33243
|
});
|
|
33844
33244
|
}, []);
|
|
33845
|
-
|
|
33245
|
+
useInput12((input, key) => {
|
|
33846
33246
|
if (loading) return;
|
|
33847
33247
|
if (key.return || input === " ") {
|
|
33848
33248
|
setEnabled((current) => {
|
|
@@ -33857,21 +33257,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33857
33257
|
onDone();
|
|
33858
33258
|
}
|
|
33859
33259
|
});
|
|
33860
|
-
return /* @__PURE__ */
|
|
33861
|
-
/* @__PURE__ */
|
|
33862
|
-
/* @__PURE__ */
|
|
33863
|
-
loading ? /* @__PURE__ */
|
|
33864
|
-
/* @__PURE__ */
|
|
33260
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33261
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
33262
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
33263
|
+
loading ? /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
33264
|
+
/* @__PURE__ */ jsxs46(Text47, { children: [
|
|
33865
33265
|
"Share anonymous usage data:",
|
|
33866
33266
|
" ",
|
|
33867
|
-
/* @__PURE__ */
|
|
33267
|
+
/* @__PURE__ */ jsx56(Text47, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
33868
33268
|
] }),
|
|
33869
|
-
/* @__PURE__ */
|
|
33870
|
-
/* @__PURE__ */
|
|
33871
|
-
/* @__PURE__ */
|
|
33269
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
33270
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
33271
|
+
/* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
33872
33272
|
] }),
|
|
33873
|
-
/* @__PURE__ */
|
|
33874
|
-
/* @__PURE__ */
|
|
33273
|
+
/* @__PURE__ */ jsx56(Text47, { children: " " }),
|
|
33274
|
+
/* @__PURE__ */ jsx56(
|
|
33875
33275
|
ControlHints,
|
|
33876
33276
|
{
|
|
33877
33277
|
hints: [
|
|
@@ -33885,7 +33285,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33885
33285
|
var init_screen11 = __esm({
|
|
33886
33286
|
"packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx"() {
|
|
33887
33287
|
"use strict";
|
|
33888
|
-
|
|
33288
|
+
init_theme();
|
|
33889
33289
|
init_analytics_store();
|
|
33890
33290
|
init_debug_store();
|
|
33891
33291
|
init_control_hints();
|
|
@@ -33893,12 +33293,12 @@ var init_screen11 = __esm({
|
|
|
33893
33293
|
});
|
|
33894
33294
|
|
|
33895
33295
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
33896
|
-
import { useEffect as
|
|
33897
|
-
import { Box as
|
|
33898
|
-
import { jsx as
|
|
33296
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
33297
|
+
import { Box as Box46, Text as Text48, useInput as useInput13 } from "ink";
|
|
33298
|
+
import { jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
33899
33299
|
function UpgradeScreen({ onDone }) {
|
|
33900
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
33901
|
-
|
|
33300
|
+
const [upgradeCheck, setUpgradeCheck] = useState31();
|
|
33301
|
+
useEffect24(() => {
|
|
33902
33302
|
startDebugRun({
|
|
33903
33303
|
flow: "upgrade",
|
|
33904
33304
|
step: "01-upgrade",
|
|
@@ -33907,7 +33307,7 @@ function UpgradeScreen({ onDone }) {
|
|
|
33907
33307
|
});
|
|
33908
33308
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
33909
33309
|
}, []);
|
|
33910
|
-
|
|
33310
|
+
useInput13((_input, key) => {
|
|
33911
33311
|
if (key.return) {
|
|
33912
33312
|
void finishDebugRun({
|
|
33913
33313
|
outputs: upgradeCheck ?? {},
|
|
@@ -33918,12 +33318,12 @@ function UpgradeScreen({ onDone }) {
|
|
|
33918
33318
|
return;
|
|
33919
33319
|
}
|
|
33920
33320
|
});
|
|
33921
|
-
return /* @__PURE__ */
|
|
33922
|
-
/* @__PURE__ */
|
|
33923
|
-
/* @__PURE__ */
|
|
33321
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33322
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Upgrade" }),
|
|
33323
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33924
33324
|
renderBody(upgradeCheck),
|
|
33925
|
-
/* @__PURE__ */
|
|
33926
|
-
/* @__PURE__ */
|
|
33325
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33326
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.accent, children: [
|
|
33927
33327
|
FOCUS_MARKER,
|
|
33928
33328
|
" Go Back"
|
|
33929
33329
|
] })
|
|
@@ -33931,40 +33331,41 @@ function UpgradeScreen({ onDone }) {
|
|
|
33931
33331
|
}
|
|
33932
33332
|
function renderBody(upgradeCheck) {
|
|
33933
33333
|
if (!upgradeCheck) {
|
|
33934
|
-
return /* @__PURE__ */
|
|
33334
|
+
return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
33935
33335
|
}
|
|
33936
33336
|
if (upgradeCheck.status === "error") {
|
|
33937
|
-
return /* @__PURE__ */
|
|
33337
|
+
return /* @__PURE__ */ jsx57(Text48, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
33938
33338
|
}
|
|
33939
33339
|
if (upgradeCheck.status === "up-to-date") {
|
|
33940
|
-
return /* @__PURE__ */
|
|
33340
|
+
return /* @__PURE__ */ jsxs47(Text48, { color: PALETTE.success, children: [
|
|
33941
33341
|
"You're already on the latest version (v",
|
|
33942
33342
|
upgradeCheck.current,
|
|
33943
33343
|
")."
|
|
33944
33344
|
] });
|
|
33945
33345
|
}
|
|
33946
|
-
return /* @__PURE__ */
|
|
33947
|
-
/* @__PURE__ */
|
|
33948
|
-
/* @__PURE__ */
|
|
33346
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", children: [
|
|
33347
|
+
/* @__PURE__ */ jsxs47(Text48, { color: PALETTE.muted, children: [
|
|
33348
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, color: PALETTE.success, children: [
|
|
33949
33349
|
"v",
|
|
33950
33350
|
upgradeCheck.latest
|
|
33951
33351
|
] }),
|
|
33952
33352
|
" ",
|
|
33953
33353
|
"is available (you're on ",
|
|
33954
|
-
/* @__PURE__ */
|
|
33354
|
+
/* @__PURE__ */ jsxs47(Text48, { bold: true, children: [
|
|
33955
33355
|
"v",
|
|
33956
33356
|
upgradeCheck.current
|
|
33957
33357
|
] }),
|
|
33958
33358
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
33959
33359
|
] }),
|
|
33960
|
-
/* @__PURE__ */
|
|
33961
|
-
/* @__PURE__ */
|
|
33360
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33361
|
+
/* @__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)) })
|
|
33962
33362
|
] });
|
|
33963
33363
|
}
|
|
33964
33364
|
var UPGRADE_COMMANDS;
|
|
33965
33365
|
var init_PageContainer4 = __esm({
|
|
33966
33366
|
"packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx"() {
|
|
33967
33367
|
"use strict";
|
|
33368
|
+
init_theme();
|
|
33968
33369
|
init_home_theme();
|
|
33969
33370
|
init_version();
|
|
33970
33371
|
init_debug_store();
|
|
@@ -33973,13 +33374,13 @@ var init_PageContainer4 = __esm({
|
|
|
33973
33374
|
});
|
|
33974
33375
|
|
|
33975
33376
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
33976
|
-
import { useEffect as
|
|
33977
|
-
import { Box as
|
|
33978
|
-
import { jsx as
|
|
33377
|
+
import { useEffect as useEffect25, useState as useState32 } from "react";
|
|
33378
|
+
import { Box as Box47, Text as Text49, useInput as useInput14 } from "ink";
|
|
33379
|
+
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
33979
33380
|
function DebugModeScreen({ onDone }) {
|
|
33980
|
-
const [loading, setLoading] =
|
|
33981
|
-
const [enabled, setEnabled] =
|
|
33982
|
-
|
|
33381
|
+
const [loading, setLoading] = useState32(true);
|
|
33382
|
+
const [enabled, setEnabled] = useState32(true);
|
|
33383
|
+
useEffect25(() => {
|
|
33983
33384
|
readDebugModeSetting().then((setting) => {
|
|
33984
33385
|
setEnabled(setting.enabled);
|
|
33985
33386
|
setLoading(false);
|
|
@@ -33991,7 +33392,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
33991
33392
|
});
|
|
33992
33393
|
});
|
|
33993
33394
|
}, []);
|
|
33994
|
-
|
|
33395
|
+
useInput14((input, key) => {
|
|
33995
33396
|
if (loading) return;
|
|
33996
33397
|
if (key.return || input === " ") {
|
|
33997
33398
|
setEnabled((current) => {
|
|
@@ -34006,16 +33407,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
34006
33407
|
onDone();
|
|
34007
33408
|
}
|
|
34008
33409
|
});
|
|
34009
|
-
return /* @__PURE__ */
|
|
34010
|
-
/* @__PURE__ */
|
|
34011
|
-
/* @__PURE__ */
|
|
34012
|
-
loading ? /* @__PURE__ */
|
|
33410
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33411
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
33412
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33413
|
+
loading ? /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs48(Text49, { children: [
|
|
34013
33414
|
"Debug logging:",
|
|
34014
33415
|
" ",
|
|
34015
|
-
/* @__PURE__ */
|
|
33416
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
34016
33417
|
] }),
|
|
34017
|
-
/* @__PURE__ */
|
|
34018
|
-
/* @__PURE__ */
|
|
33418
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33419
|
+
/* @__PURE__ */ jsx58(
|
|
34019
33420
|
ControlHints,
|
|
34020
33421
|
{
|
|
34021
33422
|
hints: [
|
|
@@ -34029,7 +33430,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
34029
33430
|
var init_screen12 = __esm({
|
|
34030
33431
|
"packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx"() {
|
|
34031
33432
|
"use strict";
|
|
34032
|
-
|
|
33433
|
+
init_theme();
|
|
34033
33434
|
init_debug_mode_store();
|
|
34034
33435
|
init_debug_store();
|
|
34035
33436
|
init_control_hints();
|
|
@@ -34041,20 +33442,20 @@ var app_exports = {};
|
|
|
34041
33442
|
__export(app_exports, {
|
|
34042
33443
|
runApp: () => runApp
|
|
34043
33444
|
});
|
|
34044
|
-
import { join as
|
|
34045
|
-
import { useEffect as
|
|
34046
|
-
import { Fragment as
|
|
33445
|
+
import { join as join27 } from "node:path";
|
|
33446
|
+
import { useEffect as useEffect26, useState as useState33 } from "react";
|
|
33447
|
+
import { Fragment as Fragment19, jsx as jsx59 } from "react/jsx-runtime";
|
|
34047
33448
|
function App({ importOptions, inkClear }) {
|
|
34048
|
-
const [screen, setScreen] =
|
|
34049
|
-
const [importExitCode, setImportExitCode] =
|
|
33449
|
+
const [screen, setScreen] = useState33("start");
|
|
33450
|
+
const [importExitCode, setImportExitCode] = useState33();
|
|
34050
33451
|
const showImportResult = importExitCode !== void 0;
|
|
34051
|
-
const [projectPath, setProjectPath] =
|
|
34052
|
-
const [tokensPath, setTokensPath] =
|
|
34053
|
-
const [scannedFiles, setScannedFiles] =
|
|
34054
|
-
const [pendingLaunch, setPendingLaunch] =
|
|
34055
|
-
const [extractionRun, setExtractionRun] =
|
|
33452
|
+
const [projectPath, setProjectPath] = useState33();
|
|
33453
|
+
const [tokensPath, setTokensPath] = useState33();
|
|
33454
|
+
const [scannedFiles, setScannedFiles] = useState33();
|
|
33455
|
+
const [pendingLaunch, setPendingLaunch] = useState33();
|
|
33456
|
+
const [extractionRun, setExtractionRun] = useState33();
|
|
34056
33457
|
const extraction = useExtraction(extractionRun?.input);
|
|
34057
|
-
const [scopeRun, setScopeRun] =
|
|
33458
|
+
const [scopeRun, setScopeRun] = useState33();
|
|
34058
33459
|
const scopeFlow = useScopeGateFlow(
|
|
34059
33460
|
scopeRun && {
|
|
34060
33461
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -34069,12 +33470,12 @@ function App({ importOptions, inkClear }) {
|
|
|
34069
33470
|
}
|
|
34070
33471
|
}
|
|
34071
33472
|
);
|
|
34072
|
-
const [generationInput, setGenerationInput] =
|
|
33473
|
+
const [generationInput, setGenerationInput] = useState33();
|
|
34073
33474
|
const generation = useGeneration(generationInput);
|
|
34074
|
-
const [flowStart, setFlowStart] =
|
|
33475
|
+
const [flowStart, setFlowStart] = useState33();
|
|
34075
33476
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
34076
|
-
const [importDefaults, setImportDefaults] =
|
|
34077
|
-
|
|
33477
|
+
const [importDefaults, setImportDefaults] = useState33();
|
|
33478
|
+
useEffect26(() => {
|
|
34078
33479
|
if (screen !== "import") {
|
|
34079
33480
|
setImportDefaults(void 0);
|
|
34080
33481
|
return;
|
|
@@ -34092,7 +33493,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34092
33493
|
const launch = { projectPath: projectPath2, tokens, filePaths, ...importOptions };
|
|
34093
33494
|
const state2 = await inspectTokens({
|
|
34094
33495
|
rawTokensPath: tokens,
|
|
34095
|
-
contentfulDir:
|
|
33496
|
+
contentfulDir: join27(resolveUserPath(projectPath2), ".contentful"),
|
|
34096
33497
|
cache: importOptions.cache
|
|
34097
33498
|
});
|
|
34098
33499
|
if (state2.kind === "cached") {
|
|
@@ -34134,12 +33535,12 @@ function App({ importOptions, inkClear }) {
|
|
|
34134
33535
|
}
|
|
34135
33536
|
});
|
|
34136
33537
|
};
|
|
34137
|
-
|
|
33538
|
+
useEffect26(() => {
|
|
34138
33539
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
34139
33540
|
setExtractionRun(void 0);
|
|
34140
33541
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
34141
33542
|
}, [extraction, extractionRun]);
|
|
34142
|
-
|
|
33543
|
+
useEffect26(() => {
|
|
34143
33544
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
34144
33545
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
34145
33546
|
setGenerationInput({
|
|
@@ -34157,7 +33558,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34157
33558
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
34158
33559
|
});
|
|
34159
33560
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
34160
|
-
|
|
33561
|
+
useEffect26(() => {
|
|
34161
33562
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
34162
33563
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
34163
33564
|
inkClear();
|
|
@@ -34200,9 +33601,9 @@ function App({ importOptions, inkClear }) {
|
|
|
34200
33601
|
};
|
|
34201
33602
|
switch (screen) {
|
|
34202
33603
|
case "import":
|
|
34203
|
-
if (showImportResult) return /* @__PURE__ */
|
|
33604
|
+
if (showImportResult) return /* @__PURE__ */ jsx59(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
34204
33605
|
if (flow && flowStart) {
|
|
34205
|
-
return /* @__PURE__ */
|
|
33606
|
+
return /* @__PURE__ */ jsx59(
|
|
34206
33607
|
FlowScreen,
|
|
34207
33608
|
{
|
|
34208
33609
|
state: flow.state,
|
|
@@ -34212,12 +33613,12 @@ function App({ importOptions, inkClear }) {
|
|
|
34212
33613
|
}
|
|
34213
33614
|
);
|
|
34214
33615
|
}
|
|
34215
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
33616
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
34216
33617
|
if (projectPath === void 0) {
|
|
34217
|
-
return /* @__PURE__ */
|
|
33618
|
+
return /* @__PURE__ */ jsx59(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
34218
33619
|
}
|
|
34219
33620
|
if (tokensPath === void 0) {
|
|
34220
|
-
return /* @__PURE__ */
|
|
33621
|
+
return /* @__PURE__ */ jsx59(
|
|
34221
33622
|
TokenInputScreen,
|
|
34222
33623
|
{
|
|
34223
33624
|
initialPath: importDefaults.tokenFile,
|
|
@@ -34227,7 +33628,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34227
33628
|
);
|
|
34228
33629
|
}
|
|
34229
33630
|
if (scannedFiles === void 0) {
|
|
34230
|
-
return /* @__PURE__ */
|
|
33631
|
+
return /* @__PURE__ */ jsx59(
|
|
34231
33632
|
PathValidationScreen,
|
|
34232
33633
|
{
|
|
34233
33634
|
projectPath,
|
|
@@ -34239,10 +33640,10 @@ function App({ importOptions, inkClear }) {
|
|
|
34239
33640
|
}
|
|
34240
33641
|
if (extractionRun) {
|
|
34241
33642
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
34242
|
-
return /* @__PURE__ */
|
|
33643
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
34243
33644
|
}
|
|
34244
33645
|
if (extraction?.status === "running") {
|
|
34245
|
-
return /* @__PURE__ */
|
|
33646
|
+
return /* @__PURE__ */ jsx59(
|
|
34246
33647
|
ExtractionScreen,
|
|
34247
33648
|
{
|
|
34248
33649
|
progress: extraction.progress,
|
|
@@ -34251,14 +33652,14 @@ function App({ importOptions, inkClear }) {
|
|
|
34251
33652
|
}
|
|
34252
33653
|
);
|
|
34253
33654
|
}
|
|
34254
|
-
return /* @__PURE__ */
|
|
33655
|
+
return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
34255
33656
|
}
|
|
34256
33657
|
if (scopeRun && scopeFlow) {
|
|
34257
33658
|
if (scopeFlow.status === "failed") {
|
|
34258
|
-
return /* @__PURE__ */
|
|
33659
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
34259
33660
|
}
|
|
34260
33661
|
if (scopeFlow.status === "deciding") {
|
|
34261
|
-
return /* @__PURE__ */
|
|
33662
|
+
return /* @__PURE__ */ jsx59(
|
|
34262
33663
|
ScopeGateScreen,
|
|
34263
33664
|
{
|
|
34264
33665
|
components: scopeFlow.load.components,
|
|
@@ -34268,7 +33669,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34268
33669
|
);
|
|
34269
33670
|
}
|
|
34270
33671
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
34271
|
-
return /* @__PURE__ */
|
|
33672
|
+
return /* @__PURE__ */ jsx59(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
34272
33673
|
}
|
|
34273
33674
|
if (generation?.status === "running") {
|
|
34274
33675
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -34276,7 +33677,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34276
33677
|
hasRawTokens,
|
|
34277
33678
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
34278
33679
|
});
|
|
34279
|
-
return /* @__PURE__ */
|
|
33680
|
+
return /* @__PURE__ */ jsx59(
|
|
34280
33681
|
GenerationScreen,
|
|
34281
33682
|
{
|
|
34282
33683
|
progress: generation.progress,
|
|
@@ -34288,10 +33689,10 @@ function App({ importOptions, inkClear }) {
|
|
|
34288
33689
|
}
|
|
34289
33690
|
);
|
|
34290
33691
|
}
|
|
34291
|
-
return /* @__PURE__ */
|
|
33692
|
+
return /* @__PURE__ */ jsx59(Fragment19, {});
|
|
34292
33693
|
}
|
|
34293
33694
|
if (pendingLaunch?.cached) {
|
|
34294
|
-
return /* @__PURE__ */
|
|
33695
|
+
return /* @__PURE__ */ jsx59(
|
|
34295
33696
|
TokenReuseScreen,
|
|
34296
33697
|
{
|
|
34297
33698
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -34302,7 +33703,7 @@ function App({ importOptions, inkClear }) {
|
|
|
34302
33703
|
}
|
|
34303
33704
|
);
|
|
34304
33705
|
}
|
|
34305
|
-
return /* @__PURE__ */
|
|
33706
|
+
return /* @__PURE__ */ jsx59(
|
|
34306
33707
|
CredentialsScreen,
|
|
34307
33708
|
{
|
|
34308
33709
|
initial: importDefaults.credentials,
|
|
@@ -34311,19 +33712,19 @@ function App({ importOptions, inkClear }) {
|
|
|
34311
33712
|
}
|
|
34312
33713
|
);
|
|
34313
33714
|
case "help":
|
|
34314
|
-
return /* @__PURE__ */
|
|
33715
|
+
return /* @__PURE__ */ jsx59(HelpScreen, { onDone: goToStart });
|
|
34315
33716
|
case "upgrade":
|
|
34316
|
-
return /* @__PURE__ */
|
|
33717
|
+
return /* @__PURE__ */ jsx59(UpgradeScreen, { onDone: goToStart });
|
|
34317
33718
|
case "settings":
|
|
34318
|
-
return /* @__PURE__ */
|
|
33719
|
+
return /* @__PURE__ */ jsx59(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
34319
33720
|
case "settings-configuration":
|
|
34320
|
-
return /* @__PURE__ */
|
|
33721
|
+
return /* @__PURE__ */ jsx59(ConfigurationScreen, { onDone: goToSettings });
|
|
34321
33722
|
case "settings-opt-in-analytics":
|
|
34322
|
-
return /* @__PURE__ */
|
|
33723
|
+
return /* @__PURE__ */ jsx59(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
34323
33724
|
case "settings-debug-mode":
|
|
34324
|
-
return /* @__PURE__ */
|
|
33725
|
+
return /* @__PURE__ */ jsx59(DebugModeScreen, { onDone: goToSettings });
|
|
34325
33726
|
case "start":
|
|
34326
|
-
return /* @__PURE__ */
|
|
33727
|
+
return /* @__PURE__ */ jsx59(HomeScreen, { onNavigate: setScreen });
|
|
34327
33728
|
}
|
|
34328
33729
|
}
|
|
34329
33730
|
async function runApp(renderApp, importOptions) {
|
|
@@ -34331,7 +33732,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
34331
33732
|
instance.clear?.();
|
|
34332
33733
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
34333
33734
|
};
|
|
34334
|
-
const instance = renderApp(/* @__PURE__ */
|
|
33735
|
+
const instance = renderApp(/* @__PURE__ */ jsx59(App, { importOptions, inkClear }));
|
|
34335
33736
|
await instance.waitUntilExit();
|
|
34336
33737
|
}
|
|
34337
33738
|
var init_app = __esm({
|
|
@@ -34366,7 +33767,7 @@ var init_app = __esm({
|
|
|
34366
33767
|
// packages/experience-design-system-cli/program.ts
|
|
34367
33768
|
init_src4();
|
|
34368
33769
|
import { readFileSync as readFileSync9 } from "node:fs";
|
|
34369
|
-
import { join as
|
|
33770
|
+
import { join as join28 } from "node:path";
|
|
34370
33771
|
import { Command } from "commander";
|
|
34371
33772
|
|
|
34372
33773
|
// packages/experience-design-system-cli/src/legacy/run-legacy.ts
|
|
@@ -34470,14 +33871,14 @@ function runDevWatch(args) {
|
|
|
34470
33871
|
process.stderr.write("--watch only works from a checkout of the repo (scripts/dev.mjs is not in the package).\n");
|
|
34471
33872
|
return Promise.resolve(1);
|
|
34472
33873
|
}
|
|
34473
|
-
return new Promise((
|
|
33874
|
+
return new Promise((resolve27) => {
|
|
34474
33875
|
const child = spawn4(process.execPath, [script, ...args], { stdio: "inherit" });
|
|
34475
33876
|
process.on("SIGINT", () => void 0);
|
|
34476
|
-
child.on("exit", (code) =>
|
|
33877
|
+
child.on("exit", (code) => resolve27(code ?? 0));
|
|
34477
33878
|
child.on("error", (err) => {
|
|
34478
33879
|
process.stderr.write(`${err.message}
|
|
34479
33880
|
`);
|
|
34480
|
-
|
|
33881
|
+
resolve27(1);
|
|
34481
33882
|
});
|
|
34482
33883
|
});
|
|
34483
33884
|
}
|
|
@@ -34499,13 +33900,11 @@ function registerImportCommand(program, openTui) {
|
|
|
34499
33900
|
}
|
|
34500
33901
|
|
|
34501
33902
|
// packages/experience-design-system-cli/program.ts
|
|
34502
|
-
init_agent_store();
|
|
34503
|
-
init_apply_binary_overrides();
|
|
34504
33903
|
init_analytics_store();
|
|
34505
33904
|
init_package_root();
|
|
34506
33905
|
var pkg = JSON.parse(
|
|
34507
33906
|
readFileSync9(
|
|
34508
|
-
|
|
33907
|
+
join28(findPackageRoot(import.meta.url, "@contentful/experience-design-system-cli"), "package.json"),
|
|
34509
33908
|
"utf8"
|
|
34510
33909
|
)
|
|
34511
33910
|
);
|
|
@@ -34523,7 +33922,6 @@ function createProgram() {
|
|
|
34523
33922
|
const commandChain = chain.join(" ") || actionCommand.name();
|
|
34524
33923
|
const { enabled } = await readAnalyticsSetting();
|
|
34525
33924
|
setPersistedAnalyticsDisabled(!enabled);
|
|
34526
|
-
await readAgentConfig().then(applyBinaryOverrides, () => void 0);
|
|
34527
33925
|
setCliVersion(pkg.version);
|
|
34528
33926
|
noteCommandStart(commandChain);
|
|
34529
33927
|
});
|
|
@@ -34547,7 +33945,7 @@ init_config();
|
|
|
34547
33945
|
init_package_root();
|
|
34548
33946
|
import { existsSync as existsSync12 } from "node:fs";
|
|
34549
33947
|
import { mkdir as mkdir10, readFile as readFile19, rename as rename3, rmdir, unlink } from "node:fs/promises";
|
|
34550
|
-
import { dirname as dirname16, join as
|
|
33948
|
+
import { dirname as dirname16, join as join29 } from "node:path";
|
|
34551
33949
|
var PACKAGE_NAME4 = "@contentful/experience-design-system-cli";
|
|
34552
33950
|
async function readJson(path5) {
|
|
34553
33951
|
try {
|
|
@@ -34558,9 +33956,9 @@ async function readJson(path5) {
|
|
|
34558
33956
|
}
|
|
34559
33957
|
async function migrateOldConfig() {
|
|
34560
33958
|
try {
|
|
34561
|
-
const oldCredentials =
|
|
34562
|
-
const oldRuns =
|
|
34563
|
-
const oldDebugMode =
|
|
33959
|
+
const oldCredentials = join29(oldConfigDir2(), "credentials.json");
|
|
33960
|
+
const oldRuns = join29(oldConfigDir2(), "runs.json");
|
|
33961
|
+
const oldDebugMode = join29(
|
|
34564
33962
|
findPackageRoot(import.meta.url, PACKAGE_NAME4),
|
|
34565
33963
|
".contentful",
|
|
34566
33964
|
"config",
|