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