@contentful/experience-design-system-cli 2.37.1-dev-build-1cd1ccfb.0 → 2.37.1-dev-build-8b3a1c07.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 +1021 -476
- package/dist/index.js +1152 -545
- 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 +4 -4
- package/dist/src/tui/import/steps/09-review/theme.d.ts +9 -0
- package/dist/src/tui/import/steps/10-flow/theme.d.ts +5 -14
- package/dist/src/tui/settings/agents/AgentScreens.d.ts +8 -0
- package/dist/src/tui/settings/agents/AgentStatusLine.d.ts +13 -0
- package/dist/src/tui/settings/agents/agent-status.d.ts +29 -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 +41 -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,48 +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
|
-
// gray/100
|
|
19602
|
-
muted: "#aec1cc",
|
|
19603
|
-
// gray/400
|
|
19604
|
-
border: "#aec1cc",
|
|
19605
|
-
// gray/400
|
|
19606
|
-
accent: "#40a0ff",
|
|
19607
|
-
// blue/400
|
|
19608
|
-
error: "#ff707d",
|
|
19609
|
-
// red/400
|
|
19610
|
-
success: "#00C459",
|
|
19611
|
-
warning: "#FFDA00"
|
|
19612
|
-
};
|
|
19613
|
-
LIGHT = {
|
|
19614
|
-
text: "#111b2b",
|
|
19615
|
-
// gray/900
|
|
19616
|
-
muted: "#5a657c",
|
|
19617
|
-
// gray/600
|
|
19618
|
-
border: "#5a657c",
|
|
19619
|
-
// gray/600
|
|
19620
|
-
accent: "#0059c8",
|
|
19621
|
-
// blue/600, semantic primary
|
|
19622
|
-
error: "#bd002a",
|
|
19623
|
-
// semantic negative
|
|
19624
|
-
success: "#00C459",
|
|
19625
|
-
warning: "#FFDA00"
|
|
19626
|
-
};
|
|
19627
|
-
PALETTE = detectColorMode() === "light" ? LIGHT : DARK;
|
|
19628
|
-
}
|
|
19629
|
-
});
|
|
19630
|
-
|
|
19631
19681
|
// packages/experience-design-system-cli/src/tui/home/home.theme.ts
|
|
19632
19682
|
function brandBar(width, ramp = BRAND_RAMP) {
|
|
19633
19683
|
if (width <= 0 || ramp.length === 0) return [];
|
|
@@ -19638,12 +19688,28 @@ function brandBar(width, ramp = BRAND_RAMP) {
|
|
|
19638
19688
|
color
|
|
19639
19689
|
})).filter((segment) => segment.text.length > 0);
|
|
19640
19690
|
}
|
|
19641
|
-
var BRAND_RAMP, BAR_CELL, FOCUS_MARKER;
|
|
19691
|
+
var BRAND, PALETTE, BRAND_RAMP, BAR_CELL, FOCUS_MARKER;
|
|
19642
19692
|
var init_home_theme = __esm({
|
|
19643
19693
|
"packages/experience-design-system-cli/src/tui/home/home.theme.ts"() {
|
|
19644
19694
|
"use strict";
|
|
19645
|
-
|
|
19646
|
-
|
|
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];
|
|
19647
19713
|
BAR_CELL = "\u2501";
|
|
19648
19714
|
FOCUS_MARKER = "\u276F";
|
|
19649
19715
|
}
|
|
@@ -19825,7 +19891,6 @@ var VERSION, HEADING, SUBTITLE, MIN_TERMINAL_WIDTH, START_ITEMS;
|
|
|
19825
19891
|
var init_home = __esm({
|
|
19826
19892
|
"packages/experience-design-system-cli/src/tui/home/home.tsx"() {
|
|
19827
19893
|
"use strict";
|
|
19828
|
-
init_theme();
|
|
19829
19894
|
init_home_theme();
|
|
19830
19895
|
init_version();
|
|
19831
19896
|
init_use_terminal_width();
|
|
@@ -19866,7 +19931,7 @@ function ImportScreen({ exitCode, onDone }) {
|
|
|
19866
19931
|
var init_PageContainer = __esm({
|
|
19867
19932
|
"packages/experience-design-system-cli/src/tui/import/PageContainer.tsx"() {
|
|
19868
19933
|
"use strict";
|
|
19869
|
-
|
|
19934
|
+
init_home_theme();
|
|
19870
19935
|
}
|
|
19871
19936
|
});
|
|
19872
19937
|
|
|
@@ -19946,7 +20011,7 @@ var RULE, OVERVIEW;
|
|
|
19946
20011
|
var init_screen = __esm({
|
|
19947
20012
|
"packages/experience-design-system-cli/src/tui/import/steps/01-welcome/screen.tsx"() {
|
|
19948
20013
|
"use strict";
|
|
19949
|
-
|
|
20014
|
+
init_home_theme();
|
|
19950
20015
|
init_controls();
|
|
19951
20016
|
init_logic();
|
|
19952
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";
|
|
@@ -20095,7 +20160,7 @@ function TokenInputScreen({ onConfirm, onBack, initialPath = "" }) {
|
|
|
20095
20160
|
var init_screen2 = __esm({
|
|
20096
20161
|
"packages/experience-design-system-cli/src/tui/import/steps/02-token-input/screen.tsx"() {
|
|
20097
20162
|
"use strict";
|
|
20098
|
-
|
|
20163
|
+
init_home_theme();
|
|
20099
20164
|
init_controls2();
|
|
20100
20165
|
init_logic2();
|
|
20101
20166
|
init_validate_path();
|
|
@@ -20316,7 +20381,7 @@ function PathValidationScreen({
|
|
|
20316
20381
|
var init_screen3 = __esm({
|
|
20317
20382
|
"packages/experience-design-system-cli/src/tui/import/steps/03-path-validation/screen.tsx"() {
|
|
20318
20383
|
"use strict";
|
|
20319
|
-
|
|
20384
|
+
init_home_theme();
|
|
20320
20385
|
init_resolve_user_path();
|
|
20321
20386
|
init_controls3();
|
|
20322
20387
|
init_scan_files();
|
|
@@ -20525,7 +20590,7 @@ var LABELS;
|
|
|
20525
20590
|
var init_screen4 = __esm({
|
|
20526
20591
|
"packages/experience-design-system-cli/src/tui/import/steps/04-credentials/screen.tsx"() {
|
|
20527
20592
|
"use strict";
|
|
20528
|
-
|
|
20593
|
+
init_home_theme();
|
|
20529
20594
|
init_controls4();
|
|
20530
20595
|
init_src4();
|
|
20531
20596
|
init_logic4();
|
|
@@ -20612,7 +20677,7 @@ function ErrorStep({
|
|
|
20612
20677
|
var init_error_step = __esm({
|
|
20613
20678
|
"packages/experience-design-system-cli/src/tui/import/shared/error-step/error-step.tsx"() {
|
|
20614
20679
|
"use strict";
|
|
20615
|
-
|
|
20680
|
+
init_home_theme();
|
|
20616
20681
|
init_controls5();
|
|
20617
20682
|
init_logic5();
|
|
20618
20683
|
}
|
|
@@ -20692,7 +20757,7 @@ function GateStep({
|
|
|
20692
20757
|
var init_gate_step = __esm({
|
|
20693
20758
|
"packages/experience-design-system-cli/src/tui/import/shared/gate-step/gate-step.tsx"() {
|
|
20694
20759
|
"use strict";
|
|
20695
|
-
|
|
20760
|
+
init_home_theme();
|
|
20696
20761
|
init_controls6();
|
|
20697
20762
|
init_logic6();
|
|
20698
20763
|
}
|
|
@@ -20720,7 +20785,7 @@ var init_logic7 = __esm({
|
|
|
20720
20785
|
// packages/experience-design-system-cli/src/tui/import/shared/running-step/theme.ts
|
|
20721
20786
|
import { defaultTheme, extendTheme } from "@inkjs/ui";
|
|
20722
20787
|
var PROGRESS_THEME;
|
|
20723
|
-
var
|
|
20788
|
+
var init_theme = __esm({
|
|
20724
20789
|
"packages/experience-design-system-cli/src/tui/import/shared/running-step/theme.ts"() {
|
|
20725
20790
|
"use strict";
|
|
20726
20791
|
PROGRESS_THEME = extendTheme(defaultTheme, {
|
|
@@ -20801,9 +20866,9 @@ var RULE2;
|
|
|
20801
20866
|
var init_running_step = __esm({
|
|
20802
20867
|
"packages/experience-design-system-cli/src/tui/import/shared/running-step/running-step.tsx"() {
|
|
20803
20868
|
"use strict";
|
|
20804
|
-
|
|
20869
|
+
init_home_theme();
|
|
20805
20870
|
init_logic7();
|
|
20806
|
-
|
|
20871
|
+
init_theme();
|
|
20807
20872
|
init_use_elapsed();
|
|
20808
20873
|
RULE2 = "\u2500".repeat(40);
|
|
20809
20874
|
}
|
|
@@ -21350,10 +21415,10 @@ var init_use_extraction = __esm({
|
|
|
21350
21415
|
|
|
21351
21416
|
// packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/theme.ts
|
|
21352
21417
|
var PALETTE2;
|
|
21353
|
-
var
|
|
21418
|
+
var init_theme2 = __esm({
|
|
21354
21419
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/theme.ts"() {
|
|
21355
21420
|
"use strict";
|
|
21356
|
-
|
|
21421
|
+
init_home_theme();
|
|
21357
21422
|
PALETTE2 = {
|
|
21358
21423
|
info: PALETTE.accent,
|
|
21359
21424
|
success: PALETTE.success,
|
|
@@ -21465,7 +21530,7 @@ var TWO_COLUMN_MIN_WIDTH, SCOPE_GATE_MAIN_COLUMN_WIDTH, ACCEPTED_COMPONENTS_COLU
|
|
|
21465
21530
|
var init_columns = __esm({
|
|
21466
21531
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/columns.ts"() {
|
|
21467
21532
|
"use strict";
|
|
21468
|
-
|
|
21533
|
+
init_theme2();
|
|
21469
21534
|
TWO_COLUMN_MIN_WIDTH = 100;
|
|
21470
21535
|
SCOPE_GATE_MAIN_COLUMN_WIDTH = 54;
|
|
21471
21536
|
ACCEPTED_COMPONENTS_COLUMN_WIDTH = 36;
|
|
@@ -21545,7 +21610,7 @@ var MIN_TERMINAL_PANEL_HEIGHT;
|
|
|
21545
21610
|
var init_windowed_panel = __esm({
|
|
21546
21611
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.tsx"() {
|
|
21547
21612
|
"use strict";
|
|
21548
|
-
|
|
21613
|
+
init_theme2();
|
|
21549
21614
|
MIN_TERMINAL_PANEL_HEIGHT = 5;
|
|
21550
21615
|
}
|
|
21551
21616
|
});
|
|
@@ -21596,7 +21661,7 @@ var init_added_column = __esm({
|
|
|
21596
21661
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/added-column.tsx"() {
|
|
21597
21662
|
"use strict";
|
|
21598
21663
|
init_columns();
|
|
21599
|
-
|
|
21664
|
+
init_theme2();
|
|
21600
21665
|
init_windowed_panel();
|
|
21601
21666
|
}
|
|
21602
21667
|
});
|
|
@@ -21631,7 +21696,7 @@ function CyclesPanel({ cycles, cursor }) {
|
|
|
21631
21696
|
var init_cycles_panel = __esm({
|
|
21632
21697
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/cycles-panel.tsx"() {
|
|
21633
21698
|
"use strict";
|
|
21634
|
-
|
|
21699
|
+
init_theme2();
|
|
21635
21700
|
}
|
|
21636
21701
|
});
|
|
21637
21702
|
|
|
@@ -21649,7 +21714,7 @@ function RejectPrompt({ pending }) {
|
|
|
21649
21714
|
var init_reject_prompt = __esm({
|
|
21650
21715
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/panels/reject-prompt.tsx"() {
|
|
21651
21716
|
"use strict";
|
|
21652
|
-
|
|
21717
|
+
init_theme2();
|
|
21653
21718
|
}
|
|
21654
21719
|
});
|
|
21655
21720
|
|
|
@@ -21665,7 +21730,7 @@ function legendEntry(keyBracket, label, active = false) {
|
|
|
21665
21730
|
var init_LegendEntry = __esm({
|
|
21666
21731
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/LegendEntry.tsx"() {
|
|
21667
21732
|
"use strict";
|
|
21668
|
-
|
|
21733
|
+
init_theme2();
|
|
21669
21734
|
}
|
|
21670
21735
|
});
|
|
21671
21736
|
|
|
@@ -21686,7 +21751,7 @@ function CompactControlBar({ hasGroupRoots, searchActive }) {
|
|
|
21686
21751
|
var init_CompactControlBar = __esm({
|
|
21687
21752
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CompactControlBar.tsx"() {
|
|
21688
21753
|
"use strict";
|
|
21689
|
-
|
|
21754
|
+
init_theme2();
|
|
21690
21755
|
init_LegendEntry();
|
|
21691
21756
|
}
|
|
21692
21757
|
});
|
|
@@ -21725,7 +21790,7 @@ function CounterStrip(props) {
|
|
|
21725
21790
|
var init_CounterStrip = __esm({
|
|
21726
21791
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/CounterStrip.tsx"() {
|
|
21727
21792
|
"use strict";
|
|
21728
|
-
|
|
21793
|
+
init_theme2();
|
|
21729
21794
|
}
|
|
21730
21795
|
});
|
|
21731
21796
|
|
|
@@ -21790,7 +21855,7 @@ var DEFAULT_MAX_ROWS;
|
|
|
21790
21855
|
var init_GotoBanner = __esm({
|
|
21791
21856
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.tsx"() {
|
|
21792
21857
|
"use strict";
|
|
21793
|
-
|
|
21858
|
+
init_theme2();
|
|
21794
21859
|
DEFAULT_MAX_ROWS = 15;
|
|
21795
21860
|
}
|
|
21796
21861
|
});
|
|
@@ -22169,7 +22234,7 @@ function PreviewBadge({
|
|
|
22169
22234
|
var init_badge = __esm({
|
|
22170
22235
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/badge.tsx"() {
|
|
22171
22236
|
"use strict";
|
|
22172
|
-
|
|
22237
|
+
init_theme2();
|
|
22173
22238
|
}
|
|
22174
22239
|
});
|
|
22175
22240
|
|
|
@@ -22664,7 +22729,7 @@ var init_GroupedSidebar = __esm({
|
|
|
22664
22729
|
"use strict";
|
|
22665
22730
|
init_composite_closure();
|
|
22666
22731
|
init_badge();
|
|
22667
|
-
|
|
22732
|
+
init_theme2();
|
|
22668
22733
|
init_windowed_panel();
|
|
22669
22734
|
GLYPH_EXPAND_COLLAPSED = "\u25B8";
|
|
22670
22735
|
GLYPH_EXPAND_EXPANDED = "\u25BE";
|
|
@@ -22959,7 +23024,7 @@ function SearchMatchSummary({
|
|
|
22959
23024
|
var init_SearchMatchSummary = __esm({
|
|
22960
23025
|
"packages/experience-design-system-cli/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.tsx"() {
|
|
22961
23026
|
"use strict";
|
|
22962
|
-
|
|
23027
|
+
init_theme2();
|
|
22963
23028
|
init_sidebar_input();
|
|
22964
23029
|
}
|
|
22965
23030
|
});
|
|
@@ -24327,7 +24392,7 @@ var init_screen7 = __esm({
|
|
|
24327
24392
|
init_HelpOverlay();
|
|
24328
24393
|
init_SearchMatchSummary();
|
|
24329
24394
|
init_sidebar_help();
|
|
24330
|
-
|
|
24395
|
+
init_theme2();
|
|
24331
24396
|
init_use_scope_gate();
|
|
24332
24397
|
HELP_SECTIONS = [
|
|
24333
24398
|
{
|
|
@@ -25215,6 +25280,24 @@ var init_screen9 = __esm({
|
|
|
25215
25280
|
}
|
|
25216
25281
|
});
|
|
25217
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
|
+
|
|
25218
25301
|
// packages/experience-design-system-cli/src/tui/import/steps/09-review/review-json-panel.ts
|
|
25219
25302
|
function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
25220
25303
|
if (!selected) return "";
|
|
@@ -25706,13 +25789,13 @@ function serializeState(state2, originalJson) {
|
|
|
25706
25789
|
}
|
|
25707
25790
|
function Picker({ value, active }) {
|
|
25708
25791
|
return /* @__PURE__ */ jsxs22(Box21, { children: [
|
|
25709
|
-
active && /* @__PURE__ */ jsx27(Text23, { color:
|
|
25710
|
-
/* @__PURE__ */ jsx27(Text23, { color: active ?
|
|
25711
|
-
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" })
|
|
25712
25795
|
] });
|
|
25713
25796
|
}
|
|
25714
25797
|
function Toggle({ value, active }) {
|
|
25715
|
-
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]" : "[ ]" }) });
|
|
25716
25799
|
}
|
|
25717
25800
|
function InlinePropField({
|
|
25718
25801
|
label,
|
|
@@ -25722,7 +25805,7 @@ function InlinePropField({
|
|
|
25722
25805
|
width
|
|
25723
25806
|
}) {
|
|
25724
25807
|
return /* @__PURE__ */ jsxs22(Box21, { width, gap: 1, flexShrink: flexible ? 1 : 0, flexGrow: flexible ? 1 : 0, flexWrap: "wrap", children: [
|
|
25725
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25808
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, wrap: "truncate-end", children: [
|
|
25726
25809
|
focused ? "\u203A " : " ",
|
|
25727
25810
|
label
|
|
25728
25811
|
] }),
|
|
@@ -25743,7 +25826,7 @@ function DefaultValueRow({
|
|
|
25743
25826
|
focused
|
|
25744
25827
|
}) {
|
|
25745
25828
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", flexShrink: 0, children: [
|
|
25746
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25829
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
25747
25830
|
focused ? "\u203A " : " ",
|
|
25748
25831
|
"default:"
|
|
25749
25832
|
] }),
|
|
@@ -25758,7 +25841,7 @@ function RowLabel({
|
|
|
25758
25841
|
return /* @__PURE__ */ jsxs22(
|
|
25759
25842
|
Text23,
|
|
25760
25843
|
{
|
|
25761
|
-
color: selected ?
|
|
25844
|
+
color: selected ? PALETTE3.inverse : PALETTE3.info,
|
|
25762
25845
|
bold: selected,
|
|
25763
25846
|
backgroundColor: selected ? "blue" : void 0,
|
|
25764
25847
|
wrap: "truncate-end",
|
|
@@ -25776,7 +25859,7 @@ function ValueInputRow({
|
|
|
25776
25859
|
cursorVisible
|
|
25777
25860
|
}) {
|
|
25778
25861
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, children: [
|
|
25779
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
25862
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.info, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
25780
25863
|
/* @__PURE__ */ jsx27(Text23, { children: valueText }),
|
|
25781
25864
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: " " })
|
|
25782
25865
|
] });
|
|
@@ -25793,7 +25876,7 @@ function EditableListItem({
|
|
|
25793
25876
|
if (isBeingEdited) {
|
|
25794
25877
|
return /* @__PURE__ */ jsx27(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
25795
25878
|
}
|
|
25796
|
-
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}` }) });
|
|
25797
25880
|
}
|
|
25798
25881
|
function EditableValueList({
|
|
25799
25882
|
values,
|
|
@@ -25807,7 +25890,7 @@ function EditableValueList({
|
|
|
25807
25890
|
showAddInput
|
|
25808
25891
|
}) {
|
|
25809
25892
|
return /* @__PURE__ */ jsxs22(Fragment5, { children: [
|
|
25810
|
-
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 }) })),
|
|
25811
25894
|
values.map((value, index) => /* @__PURE__ */ jsx27(
|
|
25812
25895
|
EditableListItem,
|
|
25813
25896
|
{
|
|
@@ -25833,11 +25916,11 @@ function DefaultSubRow({
|
|
|
25833
25916
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
25834
25917
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
25835
25918
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
25836
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25919
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
25837
25920
|
focused ? "\u203A " : " ",
|
|
25838
25921
|
"default:"
|
|
25839
25922
|
] }),
|
|
25840
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
25923
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE3.muted, children: "(not applicable)" })
|
|
25841
25924
|
] });
|
|
25842
25925
|
}
|
|
25843
25926
|
if (prop.type === "boolean") {
|
|
@@ -25847,11 +25930,11 @@ function DefaultSubRow({
|
|
|
25847
25930
|
if (prop.type === "enum") {
|
|
25848
25931
|
if (prop.values.length === 0) {
|
|
25849
25932
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
25850
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25933
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
25851
25934
|
focused ? "\u203A " : " ",
|
|
25852
25935
|
"default:"
|
|
25853
25936
|
] }),
|
|
25854
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 :
|
|
25937
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused ? void 0 : PALETTE3.muted, children: "(no values defined)" })
|
|
25855
25938
|
] });
|
|
25856
25939
|
}
|
|
25857
25940
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
@@ -25860,11 +25943,11 @@ function DefaultSubRow({
|
|
|
25860
25943
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
25861
25944
|
if (active) {
|
|
25862
25945
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "row", flexShrink: 0, children: [
|
|
25863
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25946
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
25864
25947
|
focused ? "\u203A " : " ",
|
|
25865
25948
|
"default:"
|
|
25866
25949
|
] }),
|
|
25867
|
-
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor:
|
|
25950
|
+
/* @__PURE__ */ jsxs22(Box21, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE3.warning, paddingX: 1, children: [
|
|
25868
25951
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(0, textCursor) }),
|
|
25869
25952
|
/* @__PURE__ */ jsx27(Text23, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
25870
25953
|
/* @__PURE__ */ jsx27(Text23, { children: value.slice(textCursor + 1) })
|
|
@@ -25872,11 +25955,11 @@ function DefaultSubRow({
|
|
|
25872
25955
|
] });
|
|
25873
25956
|
}
|
|
25874
25957
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexShrink: 0, children: [
|
|
25875
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25958
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
25876
25959
|
focused ? "\u203A " : " ",
|
|
25877
25960
|
"default:"
|
|
25878
25961
|
] }),
|
|
25879
|
-
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 :
|
|
25962
|
+
/* @__PURE__ */ jsx27(Text23, { color: focused || value ? void 0 : PALETTE3.muted, children: value || "(none)" })
|
|
25880
25963
|
] });
|
|
25881
25964
|
}
|
|
25882
25965
|
function DescriptionField({
|
|
@@ -25892,15 +25975,15 @@ function DescriptionField({
|
|
|
25892
25975
|
}) {
|
|
25893
25976
|
if (compact) {
|
|
25894
25977
|
return /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25895
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25978
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
25896
25979
|
focused ? "\u203A " : " ",
|
|
25897
25980
|
label
|
|
25898
25981
|
] }),
|
|
25899
|
-
/* @__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" })
|
|
25900
25983
|
] });
|
|
25901
25984
|
}
|
|
25902
25985
|
return /* @__PURE__ */ jsxs22(Box21, { paddingLeft, flexDirection: "column", width, flexShrink: 0, children: [
|
|
25903
|
-
/* @__PURE__ */ jsxs22(Text23, { color: focused ?
|
|
25986
|
+
/* @__PURE__ */ jsxs22(Text23, { color: focused ? PALETTE3.warning : PALETTE3.muted, bold: focused, children: [
|
|
25904
25987
|
focused ? "\u203A " : " ",
|
|
25905
25988
|
label
|
|
25906
25989
|
] }),
|
|
@@ -25964,7 +26047,7 @@ function PropRow({
|
|
|
25964
26047
|
] }),
|
|
25965
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" }) }),
|
|
25966
26049
|
prop.type === "enum" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25967
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ?
|
|
26050
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "values" ? PALETTE3.warning : PALETTE3.muted, bold: activeField === "values", children: [
|
|
25968
26051
|
activeField === "values" ? "\u203A " : " ",
|
|
25969
26052
|
"values:"
|
|
25970
26053
|
] }),
|
|
@@ -25985,27 +26068,27 @@ function PropRow({
|
|
|
25985
26068
|
}
|
|
25986
26069
|
),
|
|
25987
26070
|
prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs22(Box21, { gap: 1, flexWrap: "wrap", width, flexShrink: 0, children: [
|
|
25988
|
-
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ?
|
|
26071
|
+
/* @__PURE__ */ jsxs22(Text23, { color: activeField === "allowed" ? PALETTE3.warning : PALETTE3.muted, bold: activeField === "allowed", children: [
|
|
25989
26072
|
activeField === "allowed" ? "\u203A " : " ",
|
|
25990
26073
|
"allowed:"
|
|
25991
26074
|
] }),
|
|
25992
|
-
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(
|
|
25993
26076
|
Text23,
|
|
25994
26077
|
{
|
|
25995
|
-
color: activeField !== "allowed" && prop.allowed.length === 0 ?
|
|
26078
|
+
color: activeField !== "allowed" && prop.allowed.length === 0 ? PALETTE3.muted : void 0,
|
|
25996
26079
|
wrap: "wrap",
|
|
25997
26080
|
children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)"
|
|
25998
26081
|
}
|
|
25999
26082
|
)
|
|
26000
26083
|
] }),
|
|
26001
|
-
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: (() => {
|
|
26002
26085
|
const max = Math.max(8, width - 8);
|
|
26003
26086
|
const text = `~ ${rationale}`;
|
|
26004
26087
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
26005
26088
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
26006
26089
|
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs22(Box21, { paddingLeft: 2, flexDirection: "column", children: [
|
|
26007
26090
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
26008
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26091
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "values:" }),
|
|
26009
26092
|
activeField === "values" && /* @__PURE__ */ jsx27(Text23, { children: " [a] add [e] edit [r] remove [\u2191\u2193] navigate [K/J] reorder" })
|
|
26010
26093
|
] }),
|
|
26011
26094
|
/* @__PURE__ */ jsx27(
|
|
@@ -26066,7 +26149,7 @@ function SlotRow({
|
|
|
26066
26149
|
/* @__PURE__ */ jsxs22(
|
|
26067
26150
|
Text23,
|
|
26068
26151
|
{
|
|
26069
|
-
color: activeField === "allowedComponents" ?
|
|
26152
|
+
color: activeField === "allowedComponents" ? PALETTE3.warning : PALETTE3.muted,
|
|
26070
26153
|
bold: activeField === "allowedComponents",
|
|
26071
26154
|
children: [
|
|
26072
26155
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -26074,14 +26157,14 @@ function SlotRow({
|
|
|
26074
26157
|
]
|
|
26075
26158
|
}
|
|
26076
26159
|
),
|
|
26077
|
-
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(", ") })
|
|
26078
26161
|
] }),
|
|
26079
26162
|
selected && editingField && activeField === "allowedComponents" && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
26080
26163
|
/* @__PURE__ */ jsxs22(Box21, { children: [
|
|
26081
26164
|
/* @__PURE__ */ jsxs22(
|
|
26082
26165
|
Text23,
|
|
26083
26166
|
{
|
|
26084
|
-
color: activeField === "allowedComponents" ?
|
|
26167
|
+
color: activeField === "allowedComponents" ? PALETTE3.warning : PALETTE3.muted,
|
|
26085
26168
|
bold: activeField === "allowedComponents",
|
|
26086
26169
|
children: [
|
|
26087
26170
|
activeField === "allowedComponents" ? "\u203A " : " ",
|
|
@@ -26089,7 +26172,7 @@ function SlotRow({
|
|
|
26089
26172
|
]
|
|
26090
26173
|
}
|
|
26091
26174
|
),
|
|
26092
|
-
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" })
|
|
26093
26176
|
] }),
|
|
26094
26177
|
/* @__PURE__ */ jsx27(
|
|
26095
26178
|
EditableValueList,
|
|
@@ -26105,21 +26188,21 @@ function SlotRow({
|
|
|
26105
26188
|
showAddInput: editingField && activeField === "allowedComponents"
|
|
26106
26189
|
}
|
|
26107
26190
|
),
|
|
26108
|
-
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)" }) : (() => {
|
|
26109
26192
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
26110
26193
|
if (filtered.length === 0) {
|
|
26111
|
-
return /* @__PURE__ */ jsx27(Text23, { color:
|
|
26194
|
+
return /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
26112
26195
|
}
|
|
26113
26196
|
const cursor = pickerCursor % filtered.length;
|
|
26114
26197
|
const MAX_VISIBLE = 5;
|
|
26115
26198
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor - 2));
|
|
26116
26199
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
26117
26200
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", children: [
|
|
26118
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26201
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
26119
26202
|
slice.map((name, i) => {
|
|
26120
26203
|
const absIdx = start + i;
|
|
26121
26204
|
const isCursor = absIdx === cursor;
|
|
26122
|
-
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ?
|
|
26205
|
+
return /* @__PURE__ */ jsx27(Text23, { color: isCursor ? PALETTE3.info : PALETTE3.muted, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
|
|
26123
26206
|
})
|
|
26124
26207
|
] });
|
|
26125
26208
|
})() })
|
|
@@ -26947,18 +27030,18 @@ function FieldEditor({
|
|
|
26947
27030
|
});
|
|
26948
27031
|
const innerWidth = Math.max(1, width - 2);
|
|
26949
27032
|
if (parseErr) {
|
|
26950
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
26951
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
26952
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26953
|
-
/* @__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." })
|
|
26954
27037
|
] });
|
|
26955
27038
|
}
|
|
26956
27039
|
if (props.length === 0 && slots.length === 0) {
|
|
26957
|
-
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", width, borderStyle: "single", borderColor:
|
|
26958
|
-
/* @__PURE__ */ jsx27(Text23, { bold: true, color:
|
|
26959
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26960
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
26961
|
-
/* @__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" })
|
|
26962
27045
|
] });
|
|
26963
27046
|
}
|
|
26964
27047
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -27087,7 +27170,7 @@ function FieldEditor({
|
|
|
27087
27170
|
const renderRow = (row, index) => {
|
|
27088
27171
|
const key = rowKey(row, index);
|
|
27089
27172
|
if (row.kind === "header") {
|
|
27090
|
-
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);
|
|
27091
27174
|
}
|
|
27092
27175
|
if (row.kind === "component-description") {
|
|
27093
27176
|
const isSelected2 = inComponentDesc && active;
|
|
@@ -27169,9 +27252,9 @@ function FieldEditor({
|
|
|
27169
27252
|
...fixedHeight ? { height } : { minHeight: height },
|
|
27170
27253
|
clipOverflow: fixedHeight,
|
|
27171
27254
|
borderStyle: "single",
|
|
27172
|
-
borderColor: hasEmptyProperties ?
|
|
27255
|
+
borderColor: hasEmptyProperties ? PALETTE3.warning : active ? PALETTE3.info : PALETTE3.border,
|
|
27173
27256
|
children: [
|
|
27174
|
-
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." }),
|
|
27175
27258
|
header,
|
|
27176
27259
|
/* @__PURE__ */ jsx27(Box21, { flexDirection: "column", width: innerWidth, flexShrink: 0, children: focusLevel === "field" && !inComponentDesc && currentProp ? /* @__PURE__ */ jsx27(
|
|
27177
27260
|
PropRow,
|
|
@@ -27222,7 +27305,7 @@ function FieldEditor({
|
|
|
27222
27305
|
`visible-${key}`
|
|
27223
27306
|
);
|
|
27224
27307
|
}) }),
|
|
27225
|
-
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color:
|
|
27308
|
+
categoryBelow && /* @__PURE__ */ jsx27(Text23, { color: PALETTE3.success, bold: true, children: `(${categoryBelow} below)` }),
|
|
27226
27309
|
sourceOpen && !onToggleSourceExternal && (() => {
|
|
27227
27310
|
const propMeta = !inSlots && !inComponentDesc && currentProp ? metadata?.props?.[currentProp.name] : void 0;
|
|
27228
27311
|
const start = propMeta?.sourceStartLine ?? null;
|
|
@@ -27232,20 +27315,20 @@ function FieldEditor({
|
|
|
27232
27315
|
const headerPath = path5 ?? "<unknown source path>";
|
|
27233
27316
|
if (!start || !end2 || !src) {
|
|
27234
27317
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
27235
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27236
|
-
/* @__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)" }),
|
|
27237
27320
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close" })
|
|
27238
27321
|
] });
|
|
27239
27322
|
}
|
|
27240
27323
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end2);
|
|
27241
27324
|
return /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
27242
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27243
|
-
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}`)),
|
|
27244
27327
|
/* @__PURE__ */ jsx27(Text23, { children: "[s] close \xB7 [Esc] close" })
|
|
27245
27328
|
] });
|
|
27246
27329
|
})(),
|
|
27247
|
-
showHelp && /* @__PURE__ */ jsxs22(Box21, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
27248
|
-
/* @__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" }),
|
|
27249
27332
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
27250
27333
|
/* @__PURE__ */ jsx27(Text23, { bold: true, children: "Row navigation" }),
|
|
27251
27334
|
/* @__PURE__ */ jsx27(Text23, { children: " \u2191/\u2193 move between rows" }),
|
|
@@ -27270,10 +27353,10 @@ function FieldEditor({
|
|
|
27270
27353
|
/* @__PURE__ */ jsx27(Text23, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
27271
27354
|
/* @__PURE__ */ jsx27(Text23, { children: " ? toggle this overlay" }),
|
|
27272
27355
|
/* @__PURE__ */ jsx27(Text23, { children: " " }),
|
|
27273
|
-
/* @__PURE__ */ jsx27(Text23, { color:
|
|
27356
|
+
/* @__PURE__ */ jsx27(Text23, { color: PALETTE3.muted, children: "press ? or Esc to close" })
|
|
27274
27357
|
] }),
|
|
27275
|
-
validationError && /* @__PURE__ */ jsx27(Text23, { color:
|
|
27276
|
-
/* @__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 }) })
|
|
27277
27360
|
]
|
|
27278
27361
|
}
|
|
27279
27362
|
);
|
|
@@ -27282,7 +27365,7 @@ var SLOT_FIELDS;
|
|
|
27282
27365
|
var init_FieldEditor = __esm({
|
|
27283
27366
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FieldEditor.tsx"() {
|
|
27284
27367
|
"use strict";
|
|
27285
|
-
|
|
27368
|
+
init_theme3();
|
|
27286
27369
|
init_src5();
|
|
27287
27370
|
init_useImmediateInput();
|
|
27288
27371
|
init_scroll_offset();
|
|
@@ -27337,21 +27420,21 @@ function RationaleLine({ line, active }) {
|
|
|
27337
27420
|
return /* @__PURE__ */ jsx28(Box22, { children: /* @__PURE__ */ jsx28(Text24, { children: " " }) });
|
|
27338
27421
|
}
|
|
27339
27422
|
if (line.kind === "heading") {
|
|
27340
|
-
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 }) });
|
|
27341
27424
|
}
|
|
27342
27425
|
if (line.kind === "label") {
|
|
27343
27426
|
return /* @__PURE__ */ jsxs23(Box22, { children: [
|
|
27344
27427
|
line.prefix && /* @__PURE__ */ jsx28(Text24, { children: line.prefix }),
|
|
27345
|
-
/* @__PURE__ */ jsx28(Text24, { bold: true, color: active ? line.color :
|
|
27346
|
-
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 })
|
|
27347
27430
|
] });
|
|
27348
27431
|
}
|
|
27349
|
-
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 }) });
|
|
27350
27433
|
}
|
|
27351
27434
|
var init_RationaleLine = __esm({
|
|
27352
27435
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationaleLine.tsx"() {
|
|
27353
27436
|
"use strict";
|
|
27354
|
-
|
|
27437
|
+
init_theme3();
|
|
27355
27438
|
}
|
|
27356
27439
|
});
|
|
27357
27440
|
|
|
@@ -27431,9 +27514,9 @@ function ComponentRationalePanel({
|
|
|
27431
27514
|
width,
|
|
27432
27515
|
height: height + 2,
|
|
27433
27516
|
borderStyle: "single",
|
|
27434
|
-
borderColor: active ?
|
|
27517
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
27435
27518
|
children: [
|
|
27436
|
-
/* @__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}` }) }),
|
|
27437
27520
|
visible.map((line, i) => /* @__PURE__ */ jsx29(RationaleLine, { line, active }, i)),
|
|
27438
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" }) })
|
|
27439
27522
|
]
|
|
@@ -27444,7 +27527,7 @@ var PLACEHOLDER;
|
|
|
27444
27527
|
var init_ComponentRationalePanel = __esm({
|
|
27445
27528
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ComponentRationalePanel.tsx"() {
|
|
27446
27529
|
"use strict";
|
|
27447
|
-
|
|
27530
|
+
init_theme3();
|
|
27448
27531
|
init_wrap_text();
|
|
27449
27532
|
init_RationaleLine();
|
|
27450
27533
|
PLACEHOLDER = "(no rationale captured)";
|
|
@@ -27455,12 +27538,12 @@ var init_ComponentRationalePanel = __esm({
|
|
|
27455
27538
|
import { Text as Text26 } from "ink";
|
|
27456
27539
|
import { Fragment as Fragment6, jsx as jsx30 } from "react/jsx-runtime";
|
|
27457
27540
|
function HighlightedLine({ parts }) {
|
|
27458
|
-
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)) });
|
|
27459
27542
|
}
|
|
27460
27543
|
var init_HighlightedLine = __esm({
|
|
27461
27544
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/HighlightedLine.tsx"() {
|
|
27462
27545
|
"use strict";
|
|
27463
|
-
|
|
27546
|
+
init_theme3();
|
|
27464
27547
|
}
|
|
27465
27548
|
});
|
|
27466
27549
|
|
|
@@ -27481,10 +27564,10 @@ function ScrollablePanel({
|
|
|
27481
27564
|
const overflowed = totalLines > height;
|
|
27482
27565
|
return /* @__PURE__ */ jsxs25(Box24, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
27483
27566
|
/* @__PURE__ */ jsxs25(Box24, { children: [
|
|
27484
|
-
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 :
|
|
27567
|
+
/* @__PURE__ */ jsx31(Text27, { bold: true, color: active ? void 0 : PALETTE3.muted, children: title }),
|
|
27485
27568
|
overflowed && /* @__PURE__ */ jsxs25(Fragment7, { children: [
|
|
27486
27569
|
/* @__PURE__ */ jsx31(Box24, { flexGrow: 1 }),
|
|
27487
|
-
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 :
|
|
27570
|
+
/* @__PURE__ */ jsx31(Text27, { color: active ? void 0 : PALETTE3.muted, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
27488
27571
|
] })
|
|
27489
27572
|
] }),
|
|
27490
27573
|
children
|
|
@@ -27493,7 +27576,7 @@ function ScrollablePanel({
|
|
|
27493
27576
|
var init_ScrollablePanel = __esm({
|
|
27494
27577
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ScrollablePanel.tsx"() {
|
|
27495
27578
|
"use strict";
|
|
27496
|
-
|
|
27579
|
+
init_theme3();
|
|
27497
27580
|
}
|
|
27498
27581
|
});
|
|
27499
27582
|
|
|
@@ -27584,7 +27667,7 @@ function renderRationaleLines(rows, innerWidth) {
|
|
|
27584
27667
|
out.push({
|
|
27585
27668
|
kind: "label",
|
|
27586
27669
|
text: row.name,
|
|
27587
|
-
color:
|
|
27670
|
+
color: PALETTE3.info,
|
|
27588
27671
|
suffix: row.kind === "slot" ? " (slot)" : void 0
|
|
27589
27672
|
});
|
|
27590
27673
|
for (const line of wrapText(row.rationale, innerWidth)) {
|
|
@@ -27620,7 +27703,7 @@ function RationalePanel({
|
|
|
27620
27703
|
totalLines,
|
|
27621
27704
|
visibleStart,
|
|
27622
27705
|
visibleEnd,
|
|
27623
|
-
borderColor: active ?
|
|
27706
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
27624
27707
|
children: visible.map((line, i) => /* @__PURE__ */ jsx33(RationaleLine, { line, active }, i))
|
|
27625
27708
|
}
|
|
27626
27709
|
);
|
|
@@ -27628,7 +27711,7 @@ function RationalePanel({
|
|
|
27628
27711
|
var init_RationalePanel = __esm({
|
|
27629
27712
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/RationalePanel.tsx"() {
|
|
27630
27713
|
"use strict";
|
|
27631
|
-
|
|
27714
|
+
init_theme3();
|
|
27632
27715
|
init_wrap_text();
|
|
27633
27716
|
init_RationaleLine();
|
|
27634
27717
|
init_ScrollablePanel();
|
|
@@ -27664,29 +27747,21 @@ function TokenReviewPanel({
|
|
|
27664
27747
|
width,
|
|
27665
27748
|
height: height + 2,
|
|
27666
27749
|
borderStyle: "single",
|
|
27667
|
-
borderColor: active ?
|
|
27750
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
27668
27751
|
children: [
|
|
27669
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
27670
|
-
/* @__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})` }),
|
|
27671
27754
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
27672
|
-
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)" }),
|
|
27673
27756
|
visiblePaths.map((path5, i) => {
|
|
27674
27757
|
const pathIndex = scrollStart + i;
|
|
27675
27758
|
const checked = editSelection.has(path5);
|
|
27676
27759
|
const focused = pathIndex === editCursor;
|
|
27677
|
-
return /* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(
|
|
27678
|
-
Text28,
|
|
27679
|
-
{
|
|
27680
|
-
color: focused ? PALETTE.accent : active ? void 0 : PALETTE.muted,
|
|
27681
|
-
bold: focused,
|
|
27682
|
-
wrap: "truncate",
|
|
27683
|
-
children: ` [${checked ? "x" : " "}] ${path5}`
|
|
27684
|
-
}
|
|
27685
|
-
) }, 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);
|
|
27686
27761
|
}),
|
|
27687
27762
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
27688
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27689
|
-
/* @__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" })
|
|
27690
27765
|
]
|
|
27691
27766
|
}
|
|
27692
27767
|
);
|
|
@@ -27698,16 +27773,16 @@ function TokenReviewPanel({
|
|
|
27698
27773
|
width,
|
|
27699
27774
|
height: height + 2,
|
|
27700
27775
|
borderStyle: "single",
|
|
27701
|
-
borderColor: active ?
|
|
27776
|
+
borderColor: active ? PALETTE3.inverse : void 0,
|
|
27702
27777
|
children: [
|
|
27703
|
-
/* @__PURE__ */ jsx34(Text28, { bold: true, color: active ? void 0 :
|
|
27704
|
-
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)" }),
|
|
27705
27780
|
suggestions.map((s, i) => {
|
|
27706
27781
|
const focused = i === selectedRow;
|
|
27707
27782
|
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
27708
|
-
/* @__PURE__ */ jsx34(Box26, { children: /* @__PURE__ */ jsx34(Text28, { color: focused ?
|
|
27709
|
-
/* @__PURE__ */ jsx34(Text28, { color:
|
|
27710
|
-
/* @__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(", ")}` })
|
|
27711
27786
|
] }, s.propName);
|
|
27712
27787
|
}),
|
|
27713
27788
|
/* @__PURE__ */ jsx34(Text28, { children: " " }),
|
|
@@ -27719,7 +27794,7 @@ function TokenReviewPanel({
|
|
|
27719
27794
|
var init_TokenReviewPanel = __esm({
|
|
27720
27795
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/TokenReviewPanel.tsx"() {
|
|
27721
27796
|
"use strict";
|
|
27722
|
-
|
|
27797
|
+
init_theme3();
|
|
27723
27798
|
}
|
|
27724
27799
|
});
|
|
27725
27800
|
|
|
@@ -27799,9 +27874,9 @@ function ReviewDetailsPanel({
|
|
|
27799
27874
|
const sourceLineCount = Math.max(1, height - 4);
|
|
27800
27875
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + sourceLineCount) : [];
|
|
27801
27876
|
return /* @__PURE__ */ jsxs27(FixedPanel, { width, height, borderStyle: "single", borderColor: sourceBorderColor, paddingLeft: 1, children: [
|
|
27802
|
-
/* @__PURE__ */ jsx35(Text29, { color:
|
|
27803
|
-
source ? lines.map((line, index) => /* @__PURE__ */ jsx35(Text29, { color:
|
|
27804
|
-
/* @__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" })
|
|
27805
27880
|
] });
|
|
27806
27881
|
}
|
|
27807
27882
|
if (panelOpen === "token-review") {
|
|
@@ -27843,7 +27918,7 @@ var init_review_details_panel = __esm({
|
|
|
27843
27918
|
init_RationalePanel();
|
|
27844
27919
|
init_TokenReviewPanel();
|
|
27845
27920
|
init_windowed_panel();
|
|
27846
|
-
|
|
27921
|
+
init_theme3();
|
|
27847
27922
|
}
|
|
27848
27923
|
});
|
|
27849
27924
|
|
|
@@ -27970,17 +28045,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
27970
28045
|
hidden
|
|
27971
28046
|
}) {
|
|
27972
28047
|
if (hidden || count === 0) return null;
|
|
27973
|
-
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` });
|
|
27974
28049
|
}
|
|
27975
28050
|
function ReviewNoSelection() {
|
|
27976
|
-
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" }) });
|
|
27977
28052
|
}
|
|
27978
28053
|
function ReviewFinalizeError({
|
|
27979
28054
|
message,
|
|
27980
28055
|
hidden
|
|
27981
28056
|
}) {
|
|
27982
28057
|
if (hidden || !message) return null;
|
|
27983
|
-
return /* @__PURE__ */ jsx37(Text30, { color:
|
|
28058
|
+
return /* @__PURE__ */ jsx37(Text30, { color: PALETTE3.error, children: `\u26A0 ${message}` });
|
|
27984
28059
|
}
|
|
27985
28060
|
function ReviewPanelFooter({
|
|
27986
28061
|
reviewEditor,
|
|
@@ -28004,7 +28079,7 @@ function ReviewComponentTitle({
|
|
|
28004
28079
|
return /* @__PURE__ */ jsxs28(Box27, { paddingLeft: 2, paddingBottom: 1, children: [
|
|
28005
28080
|
/* @__PURE__ */ jsx37(Text30, { bold: true, wrap: "truncate-end", children: selectedKey }),
|
|
28006
28081
|
/* @__PURE__ */ jsx37(Box27, { flexGrow: 1 }),
|
|
28007
|
-
/* @__PURE__ */ jsxs28(Text30, { color:
|
|
28082
|
+
/* @__PURE__ */ jsxs28(Text30, { color: PALETTE3.muted, wrap: "truncate-end", children: [
|
|
28008
28083
|
propCount,
|
|
28009
28084
|
" prop",
|
|
28010
28085
|
propCount !== 1 ? "s" : "",
|
|
@@ -28060,8 +28135,8 @@ function ReviewComponentPanel({
|
|
|
28060
28135
|
)
|
|
28061
28136
|
}
|
|
28062
28137
|
) }),
|
|
28063
|
-
/* @__PURE__ */ jsx37(Box27, { width: contentWidth, height: 1, flexShrink: 0, children: /* @__PURE__ */ jsx37(Text30, { color: saveError ?
|
|
28064
|
-
/* @__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(
|
|
28065
28140
|
ReviewPanelFooter,
|
|
28066
28141
|
{
|
|
28067
28142
|
reviewEditor,
|
|
@@ -28076,7 +28151,7 @@ function ReviewComponentPanel({
|
|
|
28076
28151
|
var init_ReviewComponentPanel = __esm({
|
|
28077
28152
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewComponentPanel.tsx"() {
|
|
28078
28153
|
"use strict";
|
|
28079
|
-
|
|
28154
|
+
init_theme3();
|
|
28080
28155
|
init_review_json_panel();
|
|
28081
28156
|
init_ReviewDetailsEditor();
|
|
28082
28157
|
init_windowed_panel();
|
|
@@ -28098,11 +28173,11 @@ function countReviewStatuses(entries) {
|
|
|
28098
28173
|
);
|
|
28099
28174
|
}
|
|
28100
28175
|
function ReviewLoadingState() {
|
|
28101
|
-
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..." }) });
|
|
28102
28177
|
}
|
|
28103
28178
|
function ReviewLoadError({ message }) {
|
|
28104
28179
|
return /* @__PURE__ */ jsxs29(Box28, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
28105
|
-
/* @__PURE__ */ jsx38(Text31, { color:
|
|
28180
|
+
/* @__PURE__ */ jsx38(Text31, { color: PALETTE3.error, children: message }),
|
|
28106
28181
|
/* @__PURE__ */ jsx38(Text31, { children: " " }),
|
|
28107
28182
|
/* @__PURE__ */ jsx38(Text31, { children: "[q / Enter / Esc] Quit" })
|
|
28108
28183
|
] });
|
|
@@ -28110,7 +28185,7 @@ function ReviewLoadError({ message }) {
|
|
|
28110
28185
|
var init_ReviewStatus = __esm({
|
|
28111
28186
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewStatus.tsx"() {
|
|
28112
28187
|
"use strict";
|
|
28113
|
-
|
|
28188
|
+
init_theme3();
|
|
28114
28189
|
}
|
|
28115
28190
|
});
|
|
28116
28191
|
|
|
@@ -28360,41 +28435,41 @@ function FinalizeDialog({
|
|
|
28360
28435
|
/* @__PURE__ */ jsx39(Text32, { bold: true, children: "\u2500".repeat(22) + " Finalize " + "\u2500".repeat(22) }),
|
|
28361
28436
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
28362
28437
|
/* @__PURE__ */ jsxs30(Text32, { children: [
|
|
28363
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
28438
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.success, children: [
|
|
28364
28439
|
accepted,
|
|
28365
28440
|
" accepted"
|
|
28366
28441
|
] }),
|
|
28367
28442
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
28368
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
28443
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.error, children: [
|
|
28369
28444
|
rejected,
|
|
28370
28445
|
" rejected"
|
|
28371
28446
|
] }),
|
|
28372
28447
|
/* @__PURE__ */ jsx39(Text32, { children: " \xB7 " }),
|
|
28373
|
-
/* @__PURE__ */ jsxs30(Text32, { color:
|
|
28448
|
+
/* @__PURE__ */ jsxs30(Text32, { color: PALETTE3.muted, children: [
|
|
28374
28449
|
needsReview,
|
|
28375
28450
|
" unresolved"
|
|
28376
28451
|
] })
|
|
28377
28452
|
] }),
|
|
28378
28453
|
/* @__PURE__ */ jsx39(Text32, { children: " " }),
|
|
28379
28454
|
noneAccepted && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
28380
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
28381
|
-
/* @__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." }),
|
|
28382
28457
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28383
28458
|
] }),
|
|
28384
28459
|
!allResolved && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
28385
|
-
/* @__PURE__ */ jsx39(Text32, { color:
|
|
28386
|
-
/* @__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." }),
|
|
28387
28462
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28388
28463
|
] }),
|
|
28389
28464
|
/* @__PURE__ */ jsxs30(Box29, { flexDirection: "column", height: 2, children: [
|
|
28390
|
-
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: " " }),
|
|
28391
28466
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28392
28467
|
] }),
|
|
28393
28468
|
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs30(Fragment10, { children: [
|
|
28394
|
-
/* @__PURE__ */ jsx39(Text32, { bold: true, color:
|
|
28395
|
-
hasMoreAbove && /* @__PURE__ */ jsx39(Text32, { color:
|
|
28396
|
-
windowed.map((rc) => /* @__PURE__ */ jsx39(Text32, { color:
|
|
28397
|
-
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" }),
|
|
28398
28473
|
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx39(Text32, { children: "[\u2191\u2193] scroll deletions" }),
|
|
28399
28474
|
/* @__PURE__ */ jsx39(Text32, { children: " " })
|
|
28400
28475
|
] }),
|
|
@@ -28407,7 +28482,7 @@ var FINALIZE_REMOVED_WINDOW;
|
|
|
28407
28482
|
var init_FinalizeDialog = __esm({
|
|
28408
28483
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/FinalizeDialog.tsx"() {
|
|
28409
28484
|
"use strict";
|
|
28410
|
-
|
|
28485
|
+
init_theme3();
|
|
28411
28486
|
init_useImmediateInput();
|
|
28412
28487
|
init_removed_components_text();
|
|
28413
28488
|
FINALIZE_REMOVED_WINDOW = 6;
|
|
@@ -28935,8 +29010,8 @@ function ReviewStepDialogs({
|
|
|
28935
29010
|
}
|
|
28936
29011
|
function ReviewReloadDialog({ open }) {
|
|
28937
29012
|
if (!open) return null;
|
|
28938
|
-
return /* @__PURE__ */ jsxs32(Box31, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
28939
|
-
/* @__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?" }),
|
|
28940
29015
|
/* @__PURE__ */ jsx41(Text34, { children: "Unsaved in-memory changes will be lost." }),
|
|
28941
29016
|
/* @__PURE__ */ jsx41(Text34, { children: " " }),
|
|
28942
29017
|
/* @__PURE__ */ jsx41(Text34, { children: " [Enter] Confirm" }),
|
|
@@ -28946,7 +29021,7 @@ function ReviewReloadDialog({ open }) {
|
|
|
28946
29021
|
var init_ReviewDialogs = __esm({
|
|
28947
29022
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/ReviewDialogs.tsx"() {
|
|
28948
29023
|
"use strict";
|
|
28949
|
-
|
|
29024
|
+
init_theme3();
|
|
28950
29025
|
init_FinalizeDialog();
|
|
28951
29026
|
init_QuitDialog();
|
|
28952
29027
|
init_ReviewStatus();
|
|
@@ -29357,25 +29432,25 @@ function LivePreviewSummary({
|
|
|
29357
29432
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
29358
29433
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
29359
29434
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
29360
|
-
if (disabled) return /* @__PURE__ */ jsx42(Text35, { color:
|
|
29361
|
-
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...` });
|
|
29362
29437
|
if (!hasCounts) return null;
|
|
29363
29438
|
return /* @__PURE__ */ jsxs33(Box32, { children: [
|
|
29364
29439
|
/* @__PURE__ */ jsx42(Text35, { children: "Preview: " }),
|
|
29365
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29440
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.success, children: `${counts.new} new` }),
|
|
29366
29441
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
29367
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29442
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.warning, children: `${counts.changed} changed` }),
|
|
29368
29443
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
29369
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29444
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.muted, children: `${counts.removed} removed` }),
|
|
29370
29445
|
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx42(Text35, { children: " ([d] removed list)" }),
|
|
29371
29446
|
/* @__PURE__ */ jsx42(Text35, { children: " \xB7 " }),
|
|
29372
|
-
/* @__PURE__ */ jsx42(Text35, { color:
|
|
29447
|
+
/* @__PURE__ */ jsx42(Text35, { color: PALETTE3.error, bold: true, children: `${counts.breaking} breaking` })
|
|
29373
29448
|
] });
|
|
29374
29449
|
}
|
|
29375
29450
|
var init_LivePreviewSummary = __esm({
|
|
29376
29451
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/components/LivePreviewSummary.tsx"() {
|
|
29377
29452
|
"use strict";
|
|
29378
|
-
|
|
29453
|
+
init_theme3();
|
|
29379
29454
|
}
|
|
29380
29455
|
});
|
|
29381
29456
|
|
|
@@ -29424,10 +29499,10 @@ function CyclePathLine({
|
|
|
29424
29499
|
highlightComponents = false,
|
|
29425
29500
|
highlightLine = false
|
|
29426
29501
|
}) {
|
|
29427
|
-
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ?
|
|
29502
|
+
return /* @__PURE__ */ jsxs34(Text36, { color: highlightLine ? PALETTE3.warning : void 0, children: [
|
|
29428
29503
|
prefix,
|
|
29429
29504
|
segments.map(
|
|
29430
|
-
(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)
|
|
29431
29506
|
)
|
|
29432
29507
|
] });
|
|
29433
29508
|
}
|
|
@@ -29439,9 +29514,9 @@ function CycleDetailPanel({
|
|
|
29439
29514
|
height
|
|
29440
29515
|
}) {
|
|
29441
29516
|
const lines = [
|
|
29442
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
29443
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29444
|
-
/* @__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"),
|
|
29445
29520
|
/* @__PURE__ */ jsx43(Text36, { children: " " }, "cyc-space")
|
|
29446
29521
|
];
|
|
29447
29522
|
cycles.forEach((cycle, index) => {
|
|
@@ -29453,7 +29528,7 @@ function CycleDetailPanel({
|
|
|
29453
29528
|
);
|
|
29454
29529
|
if (cycle.suggestedBreak) {
|
|
29455
29530
|
lines.push(
|
|
29456
|
-
/* @__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}`)
|
|
29457
29532
|
);
|
|
29458
29533
|
}
|
|
29459
29534
|
lines.push(/* @__PURE__ */ jsx43(Text36, { children: " " }, `cyc-s-${index}`));
|
|
@@ -29461,9 +29536,9 @@ function CycleDetailPanel({
|
|
|
29461
29536
|
const footer = "[\u2191\u2193] move [Enter] fix cycle [c/q/Esc] close";
|
|
29462
29537
|
const viewportHeight = Math.max(1, height - 3);
|
|
29463
29538
|
const visible = lines.slice(scrollOffset, scrollOffset + viewportHeight - 1);
|
|
29464
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
29539
|
+
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor: PALETTE3.warning, paddingLeft: 1, children: [
|
|
29465
29540
|
visible,
|
|
29466
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
29541
|
+
/* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: footer })
|
|
29467
29542
|
] });
|
|
29468
29543
|
}
|
|
29469
29544
|
function BreakCyclePanel({
|
|
@@ -29474,14 +29549,14 @@ function BreakCyclePanel({
|
|
|
29474
29549
|
width,
|
|
29475
29550
|
height
|
|
29476
29551
|
}) {
|
|
29477
|
-
return /* @__PURE__ */ jsxs34(FixedPanel, { width, height, borderStyle: "round", borderColor:
|
|
29478
|
-
/* @__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" }),
|
|
29479
29554
|
cycle && /* @__PURE__ */ jsx43(CyclePathLine, { segments: formatCyclePathSegments2(cycle), prefix: " ", highlightComponents: true }),
|
|
29480
|
-
/* @__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." }),
|
|
29481
29556
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
29482
|
-
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
29557
|
+
edges.length > 0 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.muted, children: "remove slot edge:" }),
|
|
29483
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}`)),
|
|
29484
|
-
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" })
|
|
29485
29560
|
] });
|
|
29486
29561
|
}
|
|
29487
29562
|
function buildBreakingRows(breakingChanges) {
|
|
@@ -29527,7 +29602,7 @@ function deriveBreakingChanges(response) {
|
|
|
29527
29602
|
}
|
|
29528
29603
|
function GenerateReviewStep(props) {
|
|
29529
29604
|
if (!props.extractSessionId) {
|
|
29530
|
-
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." }) });
|
|
29531
29606
|
}
|
|
29532
29607
|
return /* @__PURE__ */ jsx43(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
29533
29608
|
}
|
|
@@ -30444,8 +30519,8 @@ function GenerateReviewStepView({
|
|
|
30444
30519
|
}
|
|
30445
30520
|
),
|
|
30446
30521
|
/* @__PURE__ */ jsx43(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
30447
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
30448
|
-
/* @__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) }),
|
|
30449
30524
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs34(Fragment13, { children: [
|
|
30450
30525
|
/* @__PURE__ */ jsx43(Text36, { children: " " }),
|
|
30451
30526
|
removedComponents.map((rc) => /* @__PURE__ */ jsx43(Text36, { children: removedComponentLine(rc) }, rc.id))
|
|
@@ -30454,7 +30529,7 @@ function GenerateReviewStepView({
|
|
|
30454
30529
|
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx43(Box33, { paddingX: 1, children: /* @__PURE__ */ jsx43(
|
|
30455
30530
|
Text36,
|
|
30456
30531
|
{
|
|
30457
|
-
color:
|
|
30532
|
+
color: PALETTE3.warning,
|
|
30458
30533
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
30459
30534
|
}
|
|
30460
30535
|
) }),
|
|
@@ -30462,10 +30537,10 @@ function GenerateReviewStepView({
|
|
|
30462
30537
|
const row = breakingRows[breakingCursor];
|
|
30463
30538
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
30464
30539
|
if (!comp) return null;
|
|
30465
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
30466
|
-
/* @__PURE__ */ jsx43(Text36, { bold: true, color:
|
|
30467
|
-
comp.impact && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30468
|
-
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}`)),
|
|
30469
30544
|
/* @__PURE__ */ jsx43(Text36, { children: "[D/Esc] close detail" })
|
|
30470
30545
|
] });
|
|
30471
30546
|
})(),
|
|
@@ -30488,11 +30563,11 @@ function GenerateReviewStepView({
|
|
|
30488
30563
|
const participantSet = cycleView.structural;
|
|
30489
30564
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
30490
30565
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
30491
|
-
return /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", borderStyle: "single", borderColor:
|
|
30492
|
-
/* @__PURE__ */ jsx43(Text36, { color:
|
|
30493
|
-
members.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30494
|
-
ancestors.length > 0 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30495
|
-
/* @__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" })
|
|
30496
30571
|
] });
|
|
30497
30572
|
})(),
|
|
30498
30573
|
/* @__PURE__ */ jsx43(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
@@ -30608,7 +30683,7 @@ function GenerateReviewStepView({
|
|
|
30608
30683
|
) : /* @__PURE__ */ jsx43(ReviewNoSelection, {})
|
|
30609
30684
|
] }),
|
|
30610
30685
|
!dialogOpen && cycleRows.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs34(Box33, { flexDirection: "column", children: [
|
|
30611
|
-
/* @__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` }),
|
|
30612
30687
|
cycleRows.slice(0, 3).map((cycle, idx) => {
|
|
30613
30688
|
return /* @__PURE__ */ jsx43(
|
|
30614
30689
|
CyclePathLine,
|
|
@@ -30621,7 +30696,7 @@ function GenerateReviewStepView({
|
|
|
30621
30696
|
`cyc-banner-${idx}`
|
|
30622
30697
|
);
|
|
30623
30698
|
}),
|
|
30624
|
-
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color:
|
|
30699
|
+
cycleRows.length > 3 && /* @__PURE__ */ jsx43(Text36, { color: PALETTE3.warning, children: ` \u2026${cycleRows.length - 3} more` }),
|
|
30625
30700
|
/* @__PURE__ */ jsx43(Text36, { children: " press [c] for detail" })
|
|
30626
30701
|
] }),
|
|
30627
30702
|
/* @__PURE__ */ jsx43(
|
|
@@ -30642,7 +30717,7 @@ var HELP_SECTIONS2;
|
|
|
30642
30717
|
var init_generate_review_step = __esm({
|
|
30643
30718
|
"packages/experience-design-system-cli/src/tui/import/steps/09-review/generate-review-step.tsx"() {
|
|
30644
30719
|
"use strict";
|
|
30645
|
-
|
|
30720
|
+
init_theme3();
|
|
30646
30721
|
init_review_json_panel();
|
|
30647
30722
|
init_GroupedSidebar();
|
|
30648
30723
|
init_composite_closure();
|
|
@@ -30751,13 +30826,13 @@ var init_generate_review_step = __esm({
|
|
|
30751
30826
|
|
|
30752
30827
|
// packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts
|
|
30753
30828
|
import { defaultTheme as defaultTheme2, extendTheme as extendTheme2 } from "@inkjs/ui";
|
|
30754
|
-
var
|
|
30829
|
+
var PALETTE4, INK_UI_THEME;
|
|
30755
30830
|
var init_theme4 = __esm({
|
|
30756
30831
|
"packages/experience-design-system-cli/src/tui/import/steps/10-flow/theme.ts"() {
|
|
30757
30832
|
"use strict";
|
|
30758
|
-
|
|
30759
|
-
|
|
30760
|
-
...
|
|
30833
|
+
init_theme3();
|
|
30834
|
+
PALETTE4 = {
|
|
30835
|
+
...PALETTE3,
|
|
30761
30836
|
link: "#58A6FF"
|
|
30762
30837
|
};
|
|
30763
30838
|
INK_UI_THEME = extendTheme2(defaultTheme2, {
|
|
@@ -30779,13 +30854,13 @@ import { Box as Box34, Text as Text37 } from "ink";
|
|
|
30779
30854
|
import { jsx as jsx44, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
30780
30855
|
function CustomPromptBanner({ generatePromptPath }) {
|
|
30781
30856
|
if (!generatePromptPath) return null;
|
|
30782
|
-
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", borderStyle: "round", borderColor:
|
|
30783
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
30784
|
-
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: [
|
|
30785
30860
|
"components: ",
|
|
30786
30861
|
generatePromptPath
|
|
30787
30862
|
] }) : null,
|
|
30788
|
-
/* @__PURE__ */ jsx44(Text37, { color:
|
|
30863
|
+
/* @__PURE__ */ jsx44(Text37, { color: PALETTE4.warning, children: "Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply." })
|
|
30789
30864
|
] });
|
|
30790
30865
|
}
|
|
30791
30866
|
var init_CustomPromptBanner = __esm({
|
|
@@ -30818,10 +30893,10 @@ import { Box as Box35, Text as Text38 } from "ink";
|
|
|
30818
30893
|
import { jsx as jsx45, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
30819
30894
|
function SpaceEnvironment({ spaceId, environmentId }) {
|
|
30820
30895
|
return /* @__PURE__ */ jsxs36(Box35, { gap: 1, marginTop: 1, children: [
|
|
30821
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
30896
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "Space:" }),
|
|
30822
30897
|
/* @__PURE__ */ jsx45(Text38, { children: spaceId }),
|
|
30823
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
30824
|
-
/* @__PURE__ */ jsx45(Text38, { color:
|
|
30898
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "/" }),
|
|
30899
|
+
/* @__PURE__ */ jsx45(Text38, { color: PALETTE4.muted, children: "Environment:" }),
|
|
30825
30900
|
/* @__PURE__ */ jsx45(Text38, { children: environmentId })
|
|
30826
30901
|
] });
|
|
30827
30902
|
}
|
|
@@ -30839,13 +30914,13 @@ function EntityRows({ entity, label }) {
|
|
|
30839
30914
|
const plural3 = (n) => `${n} ${label}${n !== 1 ? "s" : ""}`;
|
|
30840
30915
|
return /* @__PURE__ */ jsxs37(Fragment14, { children: [
|
|
30841
30916
|
ACTIONS.filter((action) => entity[action] > 0).map((action) => /* @__PURE__ */ jsxs37(Text39, { children: [
|
|
30842
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30917
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.success, children: "\u2713" }),
|
|
30843
30918
|
" ",
|
|
30844
30919
|
plural3(entity[action]),
|
|
30845
30920
|
" ",
|
|
30846
30921
|
action
|
|
30847
30922
|
] }, action)),
|
|
30848
|
-
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30923
|
+
entity.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
|
|
30849
30924
|
"\u2717 ",
|
|
30850
30925
|
plural3(entity.failed),
|
|
30851
30926
|
" failed \u2014 check logs above"
|
|
@@ -30854,8 +30929,8 @@ function EntityRows({ entity, label }) {
|
|
|
30854
30929
|
}
|
|
30855
30930
|
function LinkRow({ title, url }) {
|
|
30856
30931
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30857
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30858
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30932
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.muted, children: title }),
|
|
30933
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.link, children: url })
|
|
30859
30934
|
] });
|
|
30860
30935
|
}
|
|
30861
30936
|
function DoneStep({
|
|
@@ -30878,17 +30953,17 @@ function DoneStep({
|
|
|
30878
30953
|
const success = totalFailed === 0;
|
|
30879
30954
|
const urlArgs = { host: host ?? "api.contentful.com", spaceId, environmentId };
|
|
30880
30955
|
return /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
30881
|
-
success ? /* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
30882
|
-
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: [
|
|
30883
30958
|
/* @__PURE__ */ jsx46(EntityRows, { entity: componentTypes, label: "Component Type" }),
|
|
30884
30959
|
/* @__PURE__ */ jsx46(EntityRows, { entity: designTokens, label: "Design Token" }),
|
|
30885
|
-
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: [
|
|
30886
30961
|
"Push result: ",
|
|
30887
30962
|
summary.succeeded,
|
|
30888
30963
|
"/",
|
|
30889
30964
|
summary.total,
|
|
30890
30965
|
" succeeded",
|
|
30891
|
-
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color:
|
|
30966
|
+
summary.failed > 0 && /* @__PURE__ */ jsxs37(Text39, { color: PALETTE4.error, children: [
|
|
30892
30967
|
", ",
|
|
30893
30968
|
summary.failed,
|
|
30894
30969
|
" failed"
|
|
@@ -30896,8 +30971,8 @@ function DoneStep({
|
|
|
30896
30971
|
] }) })
|
|
30897
30972
|
] }),
|
|
30898
30973
|
failures.length > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", children: [
|
|
30899
|
-
/* @__PURE__ */ jsx46(Text39, { bold: true, color:
|
|
30900
|
-
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: [
|
|
30901
30976
|
failure.entityType,
|
|
30902
30977
|
" ",
|
|
30903
30978
|
failure.entityId,
|
|
@@ -30907,7 +30982,7 @@ function DoneStep({
|
|
|
30907
30982
|
] }),
|
|
30908
30983
|
/* @__PURE__ */ jsx46(SpaceEnvironment, { spaceId, environmentId }),
|
|
30909
30984
|
success && totalPushed > 0 && /* @__PURE__ */ jsxs37(Box36, { flexDirection: "column", gap: 1, children: [
|
|
30910
|
-
/* @__PURE__ */ jsx46(Text39, { color:
|
|
30985
|
+
/* @__PURE__ */ jsx46(Text39, { color: PALETTE4.success, children: "Your design system is now in Contentful Experiences." }),
|
|
30911
30986
|
/* @__PURE__ */ jsx46(LinkRow, { title: "View your components here:", url: buildPostPushUrl2(urlArgs) }),
|
|
30912
30987
|
/* @__PURE__ */ jsx46(
|
|
30913
30988
|
LinkRow,
|
|
@@ -31040,7 +31115,7 @@ function PathPrompt({
|
|
|
31040
31115
|
label,
|
|
31041
31116
|
":"
|
|
31042
31117
|
] }),
|
|
31043
|
-
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ?
|
|
31118
|
+
/* @__PURE__ */ jsx47(Text40, { color: isPlaceholder ? PALETTE4.muted : void 0, children: shown }),
|
|
31044
31119
|
/* @__PURE__ */ jsx47(Text40, { children: cursor })
|
|
31045
31120
|
] }),
|
|
31046
31121
|
/* @__PURE__ */ jsxs38(Box37, { gap: 3, children: [
|
|
@@ -31123,12 +31198,12 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
31123
31198
|
/* @__PURE__ */ jsx50(StepHeader, { stepNumber, totalSteps, title: "Push to Contentful" }),
|
|
31124
31199
|
/* @__PURE__ */ jsx50(Text42, { children: "Writing component types and design tokens to your Contentful space..." }),
|
|
31125
31200
|
operationId && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
31126
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
31201
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE4.muted, children: "Operation:" }),
|
|
31127
31202
|
/* @__PURE__ */ jsx50(Text42, { children: operationId })
|
|
31128
31203
|
] }),
|
|
31129
31204
|
showGlobal && progress && progress.kind === "progress" && /* @__PURE__ */ jsx50(Box39, { gap: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs40(Box39, { gap: 2, children: [
|
|
31130
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) }) }) }),
|
|
31131
|
-
/* @__PURE__ */ jsxs40(Text42, { color:
|
|
31206
|
+
/* @__PURE__ */ jsxs40(Text42, { color: PALETTE4.muted, children: [
|
|
31132
31207
|
progress.processed,
|
|
31133
31208
|
"/",
|
|
31134
31209
|
progress.total,
|
|
@@ -31136,10 +31211,10 @@ function PushingStep({ stepNumber, totalSteps, progress }) {
|
|
|
31136
31211
|
] })
|
|
31137
31212
|
] }) }),
|
|
31138
31213
|
showCurrent && /* @__PURE__ */ jsxs40(Box39, { gap: 1, children: [
|
|
31139
|
-
/* @__PURE__ */ jsx50(Text42, { color:
|
|
31214
|
+
/* @__PURE__ */ jsx50(Text42, { color: PALETTE4.muted, children: "Now processing:" }),
|
|
31140
31215
|
/* @__PURE__ */ jsx50(Text42, { children: showCurrent })
|
|
31141
31216
|
] }),
|
|
31142
|
-
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color:
|
|
31217
|
+
/* @__PURE__ */ jsx50(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs40(Text42, { color: PALETTE4.muted, children: [
|
|
31143
31218
|
"Elapsed: ",
|
|
31144
31219
|
elapsed
|
|
31145
31220
|
] }) })
|
|
@@ -31346,25 +31421,25 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31346
31421
|
if (components.new.length > 0) {
|
|
31347
31422
|
lines.push({
|
|
31348
31423
|
key: "summary-components-new",
|
|
31349
|
-
color:
|
|
31424
|
+
color: PALETTE4.success,
|
|
31350
31425
|
text: ` \uFF0B ${components.new.length} components will be created`
|
|
31351
31426
|
});
|
|
31352
31427
|
for (const [index, item] of components.new.entries()) {
|
|
31353
31428
|
const name = item.key ?? item.$name ?? "unknown";
|
|
31354
|
-
lines.push({ key: `summary-components-new-${index}`, color:
|
|
31429
|
+
lines.push({ key: `summary-components-new-${index}`, color: PALETTE4.success, text: ` + ${name}` });
|
|
31355
31430
|
}
|
|
31356
31431
|
}
|
|
31357
31432
|
if (components.changed.length > 0) {
|
|
31358
31433
|
lines.push({
|
|
31359
31434
|
key: "summary-components-changed",
|
|
31360
|
-
color:
|
|
31435
|
+
color: PALETTE4.warning,
|
|
31361
31436
|
text: ` \uFF5E ${components.changed.length} components will be updated`
|
|
31362
31437
|
});
|
|
31363
31438
|
for (const [index, item] of components.changed.entries()) {
|
|
31364
31439
|
const isBreaking = item.changeClassification?.classification === "breaking";
|
|
31365
31440
|
lines.push({
|
|
31366
31441
|
key: `summary-components-changed-${index}`,
|
|
31367
|
-
color: isBreaking ?
|
|
31442
|
+
color: isBreaking ? PALETTE4.error : PALETTE4.warning,
|
|
31368
31443
|
text: ` ${isBreaking ? "\u26A0" : "~"} ${item.current.name}`
|
|
31369
31444
|
});
|
|
31370
31445
|
}
|
|
@@ -31372,11 +31447,11 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31372
31447
|
if (components.removed.length > 0) {
|
|
31373
31448
|
lines.push({
|
|
31374
31449
|
key: "summary-components-removed",
|
|
31375
|
-
color:
|
|
31450
|
+
color: PALETTE4.warning,
|
|
31376
31451
|
text: ` \u2298 ${components.removed.length} components will be skipped`
|
|
31377
31452
|
});
|
|
31378
31453
|
for (const [index, item] of components.removed.entries()) {
|
|
31379
|
-
lines.push({ key: `summary-components-removed-${index}`, color:
|
|
31454
|
+
lines.push({ key: `summary-components-removed-${index}`, color: PALETTE4.warning, text: ` \u2298 ${item.name}` });
|
|
31380
31455
|
}
|
|
31381
31456
|
}
|
|
31382
31457
|
if (components.unchanged.length > 0) {
|
|
@@ -31389,21 +31464,21 @@ function buildPreviewSummaryLines(preview) {
|
|
|
31389
31464
|
if (tokens.new.length > 0) {
|
|
31390
31465
|
lines.push({
|
|
31391
31466
|
key: "summary-tokens-new",
|
|
31392
|
-
color:
|
|
31467
|
+
color: PALETTE4.success,
|
|
31393
31468
|
text: ` \uFF0B ${tokens.new.length} design tokens will be created`
|
|
31394
31469
|
});
|
|
31395
31470
|
}
|
|
31396
31471
|
if (tokens.changed.length > 0) {
|
|
31397
31472
|
lines.push({
|
|
31398
31473
|
key: "summary-tokens-changed",
|
|
31399
|
-
color:
|
|
31474
|
+
color: PALETTE4.warning,
|
|
31400
31475
|
text: ` \uFF5E ${tokens.changed.length} design tokens will be updated`
|
|
31401
31476
|
});
|
|
31402
31477
|
}
|
|
31403
31478
|
if (tokens.removed.length > 0) {
|
|
31404
31479
|
lines.push({
|
|
31405
31480
|
key: "summary-tokens-removed",
|
|
31406
|
-
color:
|
|
31481
|
+
color: PALETTE4.warning,
|
|
31407
31482
|
text: ` \u2298 ${tokens.removed.length} design tokens will be skipped`
|
|
31408
31483
|
});
|
|
31409
31484
|
}
|
|
@@ -31447,12 +31522,12 @@ function getPreviewScrollOffset(input, downArrow, upArrow, diffExpanded, current
|
|
|
31447
31522
|
function appendChangedPreviewLine(lines, keyPrefix, name, hasPendingDraftChanges, changeClassification) {
|
|
31448
31523
|
lines.push({
|
|
31449
31524
|
key: `${keyPrefix}-h-${name}`,
|
|
31450
|
-
color:
|
|
31525
|
+
color: PALETTE4.warning,
|
|
31451
31526
|
text: ` ~ ${name}${hasPendingDraftChanges ? " \u26A1 has pending draft changes" : ""}`
|
|
31452
31527
|
});
|
|
31453
31528
|
if (changeClassification?.classification !== "breaking") return;
|
|
31454
31529
|
const reasons = changeClassification.breakingChanges.map((bc) => `${"slotId" in bc ? bc.slotId : bc.propertyId}: ${bc.reason}`).join(", ");
|
|
31455
|
-
lines.push({ key: `${keyPrefix}-b-${name}`, color:
|
|
31530
|
+
lines.push({ key: `${keyPrefix}-b-${name}`, color: PALETTE4.error, text: ` \u26A0 BREAKING: ${reasons}` });
|
|
31456
31531
|
}
|
|
31457
31532
|
function buildPreviewDiffLines(preview) {
|
|
31458
31533
|
const lines = [];
|
|
@@ -31460,12 +31535,12 @@ function buildPreviewDiffLines(preview) {
|
|
|
31460
31535
|
for (const item of components.new) {
|
|
31461
31536
|
const raw = item;
|
|
31462
31537
|
const name = raw.key ?? raw.$name ?? "unknown";
|
|
31463
|
-
lines.push({ key: `comp-new-${name}`, color:
|
|
31538
|
+
lines.push({ key: `comp-new-${name}`, color: PALETTE4.success, text: ` + ${name}` });
|
|
31464
31539
|
const slots = raw.$slots ?? {};
|
|
31465
31540
|
for (const slotName of Object.keys(slots).sort()) {
|
|
31466
31541
|
lines.push({
|
|
31467
31542
|
key: `comp-new-${name}-slot-${slotName}`,
|
|
31468
|
-
color:
|
|
31543
|
+
color: PALETTE4.success,
|
|
31469
31544
|
text: ` slot: ${slotName}`
|
|
31470
31545
|
});
|
|
31471
31546
|
const allowed = slots[slotName]?.["$allowedComponents"];
|
|
@@ -31473,14 +31548,14 @@ function buildPreviewDiffLines(preview) {
|
|
|
31473
31548
|
const names = allowed.filter((n) => typeof n === "string");
|
|
31474
31549
|
lines.push({
|
|
31475
31550
|
key: `comp-new-${name}-slot-${slotName}-allow`,
|
|
31476
|
-
color:
|
|
31551
|
+
color: PALETTE4.success,
|
|
31477
31552
|
text: ` allowedComponents: [${names.join(", ")}]`
|
|
31478
31553
|
});
|
|
31479
31554
|
}
|
|
31480
31555
|
}
|
|
31481
31556
|
}
|
|
31482
31557
|
for (const item of components.removed) {
|
|
31483
|
-
lines.push({ key: `comp-rm-${item.name}`, color:
|
|
31558
|
+
lines.push({ key: `comp-rm-${item.name}`, color: PALETTE4.error, text: ` - ${item.name}` });
|
|
31484
31559
|
}
|
|
31485
31560
|
for (const item of components.changed) {
|
|
31486
31561
|
appendChangedPreviewLine(lines, "comp", item.current.name, item.hasPendingDraftChanges, item.changeClassification);
|
|
@@ -31511,10 +31586,10 @@ function buildPreviewDiffLines(preview) {
|
|
|
31511
31586
|
for (const item of tokens.new) {
|
|
31512
31587
|
const raw = item;
|
|
31513
31588
|
const name = raw.name ?? raw.path ?? "unknown";
|
|
31514
|
-
lines.push({ key: `tok-new-${name}`, color:
|
|
31589
|
+
lines.push({ key: `tok-new-${name}`, color: PALETTE4.success, text: ` + ${name}` });
|
|
31515
31590
|
}
|
|
31516
31591
|
for (const item of tokens.removed) {
|
|
31517
|
-
lines.push({ key: `tok-rm-${item.name}`, color:
|
|
31592
|
+
lines.push({ key: `tok-rm-${item.name}`, color: PALETTE4.error, text: ` - ${item.name}` });
|
|
31518
31593
|
}
|
|
31519
31594
|
for (const item of tokens.changed) {
|
|
31520
31595
|
const tokenName = item.current.name;
|
|
@@ -31605,13 +31680,13 @@ function WizardPreviewStep({
|
|
|
31605
31680
|
title: diffExpanded ? `Diff (${diffLines.length} lines)` : "",
|
|
31606
31681
|
focused: false,
|
|
31607
31682
|
children: [
|
|
31608
|
-
activeLines.slice(boundedScrollOffset, boundedScrollOffset + viewportHeight).map((line) => /* @__PURE__ */ jsx51(Text43, { color: line.color === "gray" ?
|
|
31609
|
-
/* @__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) })
|
|
31610
31685
|
]
|
|
31611
31686
|
}
|
|
31612
31687
|
)
|
|
31613
|
-
] }) : /* @__PURE__ */ jsx51(Text43, { color:
|
|
31614
|
-
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." }) }),
|
|
31615
31690
|
/* @__PURE__ */ jsx51(SpaceEnvironment, { spaceId, environmentId }),
|
|
31616
31691
|
/* @__PURE__ */ jsxs41(Box40, { gap: 3, marginTop: 1, children: [
|
|
31617
31692
|
/* @__PURE__ */ jsx51(Text43, { children: "[Enter] Push to Contentful" }),
|
|
@@ -32293,7 +32368,7 @@ var init_save = __esm({
|
|
|
32293
32368
|
writeFile: (path5, contents) => writeFile7(path5, contents),
|
|
32294
32369
|
appendRun,
|
|
32295
32370
|
buildSourceFingerprint,
|
|
32296
|
-
sleep: (ms) => new Promise((
|
|
32371
|
+
sleep: (ms) => new Promise((resolve28) => setTimeout(resolve28, ms)),
|
|
32297
32372
|
warn: (message) => process.stderr.write(message)
|
|
32298
32373
|
});
|
|
32299
32374
|
}
|
|
@@ -32844,13 +32919,48 @@ var init_debug_store = __esm({
|
|
|
32844
32919
|
}
|
|
32845
32920
|
});
|
|
32846
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
|
+
|
|
32847
32948
|
// packages/experience-design-system-cli/src/tui/help/help-info.ts
|
|
32848
32949
|
async function readHelpInfo() {
|
|
32849
|
-
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
|
+
});
|
|
32850
32957
|
return {
|
|
32851
32958
|
storage: [
|
|
32852
32959
|
{ label: "Config folder", value: configRoot2() },
|
|
32853
|
-
{ 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 }
|
|
32854
32964
|
],
|
|
32855
32965
|
troubleshooting: [
|
|
32856
32966
|
{ label: "CLI version", value: readPackageVersion() },
|
|
@@ -32871,6 +32981,7 @@ var init_help_info = __esm({
|
|
|
32871
32981
|
init_debug_store();
|
|
32872
32982
|
init_debug_mode_store();
|
|
32873
32983
|
init_version();
|
|
32984
|
+
init_file_locations();
|
|
32874
32985
|
}
|
|
32875
32986
|
});
|
|
32876
32987
|
|
|
@@ -32882,7 +32993,7 @@ function Section({ title, rows }) {
|
|
|
32882
32993
|
return /* @__PURE__ */ jsxs43(Box42, { flexDirection: "column", children: [
|
|
32883
32994
|
/* @__PURE__ */ jsx53(Text44, { bold: true, color: PALETTE.accent, children: title }),
|
|
32884
32995
|
rows.map((row) => /* @__PURE__ */ jsxs43(Box42, { gap: 1, children: [
|
|
32885
|
-
/* @__PURE__ */ jsx53(Box42, { width:
|
|
32996
|
+
/* @__PURE__ */ jsx53(Box42, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx53(Text44, { color: PALETTE.muted, children: row.label }) }),
|
|
32886
32997
|
/* @__PURE__ */ jsx53(Text44, { children: row.value })
|
|
32887
32998
|
] }, row.label))
|
|
32888
32999
|
] });
|
|
@@ -32928,7 +33039,7 @@ function HelpScreen({ onDone }) {
|
|
|
32928
33039
|
var init_PageContainer2 = __esm({
|
|
32929
33040
|
"packages/experience-design-system-cli/src/tui/help/PageContainer.tsx"() {
|
|
32930
33041
|
"use strict";
|
|
32931
|
-
|
|
33042
|
+
init_home_theme();
|
|
32932
33043
|
init_debug_store();
|
|
32933
33044
|
init_control_hints();
|
|
32934
33045
|
init_help_info();
|
|
@@ -32996,6 +33107,531 @@ var init_PageContainer3 = __esm({
|
|
|
32996
33107
|
}
|
|
32997
33108
|
});
|
|
32998
33109
|
|
|
33110
|
+
// packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx
|
|
33111
|
+
import { useState as useState29 } from "react";
|
|
33112
|
+
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
33113
|
+
import TextInput4 from "ink-text-input";
|
|
33114
|
+
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
33115
|
+
function FieldForm({
|
|
33116
|
+
title,
|
|
33117
|
+
subtitle,
|
|
33118
|
+
fields,
|
|
33119
|
+
values,
|
|
33120
|
+
onChange,
|
|
33121
|
+
onSave,
|
|
33122
|
+
onQuit,
|
|
33123
|
+
notice,
|
|
33124
|
+
busy = false,
|
|
33125
|
+
footer,
|
|
33126
|
+
actions = []
|
|
33127
|
+
}) {
|
|
33128
|
+
const [active, setActive] = useState29(0);
|
|
33129
|
+
const [editing, setEditing] = useState29(false);
|
|
33130
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
33131
|
+
const labelWidth = Math.max(...fields.map((field) => field.label.length));
|
|
33132
|
+
const current = fields[active];
|
|
33133
|
+
useInput11((input, key) => {
|
|
33134
|
+
if (busy) return;
|
|
33135
|
+
if (editing) {
|
|
33136
|
+
if (key.escape) {
|
|
33137
|
+
onChange(current.key, valueBeforeEdit);
|
|
33138
|
+
setEditing(false);
|
|
33139
|
+
}
|
|
33140
|
+
return;
|
|
33141
|
+
}
|
|
33142
|
+
if (key.escape || input === "q") {
|
|
33143
|
+
onQuit();
|
|
33144
|
+
return;
|
|
33145
|
+
}
|
|
33146
|
+
if (input === "s") {
|
|
33147
|
+
onSave();
|
|
33148
|
+
return;
|
|
33149
|
+
}
|
|
33150
|
+
if (input === "c") {
|
|
33151
|
+
onChange(current.key, "");
|
|
33152
|
+
return;
|
|
33153
|
+
}
|
|
33154
|
+
const action = actions.find((candidate) => candidate.key === input);
|
|
33155
|
+
if (action) {
|
|
33156
|
+
action.run();
|
|
33157
|
+
return;
|
|
33158
|
+
}
|
|
33159
|
+
if (key.tab || key.downArrow) {
|
|
33160
|
+
setActive((i) => (i + 1) % fields.length);
|
|
33161
|
+
return;
|
|
33162
|
+
}
|
|
33163
|
+
if (key.upArrow) {
|
|
33164
|
+
setActive((i) => (i - 1 + fields.length) % fields.length);
|
|
33165
|
+
return;
|
|
33166
|
+
}
|
|
33167
|
+
if (key.return) {
|
|
33168
|
+
setValueBeforeEdit(values[current.key]);
|
|
33169
|
+
setEditing(true);
|
|
33170
|
+
}
|
|
33171
|
+
});
|
|
33172
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33173
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: title }),
|
|
33174
|
+
subtitle && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: subtitle }),
|
|
33175
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33176
|
+
/* @__PURE__ */ jsx55(Box44, { flexDirection: "column", children: fields.map((field, index) => {
|
|
33177
|
+
const isActive = index === active;
|
|
33178
|
+
const value = values[field.key];
|
|
33179
|
+
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
33180
|
+
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33181
|
+
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
33182
|
+
/* @__PURE__ */ jsx55(Box44, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
33183
|
+
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
33184
|
+
TextInput4,
|
|
33185
|
+
{
|
|
33186
|
+
value,
|
|
33187
|
+
onChange: (next) => onChange(field.key, next),
|
|
33188
|
+
onSubmit: () => setEditing(false),
|
|
33189
|
+
mask: field.masked ? "\u2022" : void 0
|
|
33190
|
+
}
|
|
33191
|
+
) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (field.hint ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
33192
|
+
field.hint && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: field.hint })
|
|
33193
|
+
] }, field.key);
|
|
33194
|
+
}) }),
|
|
33195
|
+
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
33196
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33197
|
+
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33198
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33199
|
+
" ",
|
|
33200
|
+
notice.text
|
|
33201
|
+
] })
|
|
33202
|
+
] }),
|
|
33203
|
+
footer,
|
|
33204
|
+
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33205
|
+
/* @__PURE__ */ jsx55(
|
|
33206
|
+
ControlHints,
|
|
33207
|
+
{
|
|
33208
|
+
hints: editing ? [
|
|
33209
|
+
{ keys: "type", label: "edit" },
|
|
33210
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
33211
|
+
{ keys: "\u23CE", label: "done" },
|
|
33212
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
33213
|
+
] : [
|
|
33214
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
33215
|
+
{ keys: "\u23CE", label: "edit" },
|
|
33216
|
+
{ keys: "c", label: "clear" },
|
|
33217
|
+
{ keys: "s", label: "save" },
|
|
33218
|
+
...actions.map(({ key, label }) => ({ keys: key, label })),
|
|
33219
|
+
{ keys: "Esc/q", label: "back without saving" }
|
|
33220
|
+
]
|
|
33221
|
+
}
|
|
33222
|
+
)
|
|
33223
|
+
] });
|
|
33224
|
+
}
|
|
33225
|
+
var init_FieldForm = __esm({
|
|
33226
|
+
"packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx"() {
|
|
33227
|
+
"use strict";
|
|
33228
|
+
init_home_theme();
|
|
33229
|
+
init_control_hints();
|
|
33230
|
+
}
|
|
33231
|
+
});
|
|
33232
|
+
|
|
33233
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts
|
|
33234
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
33235
|
+
import { access as access6, constants } from "node:fs/promises";
|
|
33236
|
+
function effectiveBinary(name, savedBinary) {
|
|
33237
|
+
return savedBinary.trim() || AGENT_BINARIES[name];
|
|
33238
|
+
}
|
|
33239
|
+
function defaultModelLabel(name) {
|
|
33240
|
+
const model = DEFAULT_MODELS[name];
|
|
33241
|
+
return model && model !== "Auto" ? model : "chosen by the agent";
|
|
33242
|
+
}
|
|
33243
|
+
function resolveOnPath(binary) {
|
|
33244
|
+
if (binary.includes("/")) {
|
|
33245
|
+
return access6(binary, constants.X_OK).then(
|
|
33246
|
+
() => binary,
|
|
33247
|
+
() => null
|
|
33248
|
+
);
|
|
33249
|
+
}
|
|
33250
|
+
return new Promise((resolve28) => {
|
|
33251
|
+
execFile2(
|
|
33252
|
+
process.platform === "win32" ? "where" : "which",
|
|
33253
|
+
[binary],
|
|
33254
|
+
(error, stdout) => resolve28(error ? null : stdout.split("\n")[0]?.trim() ?? null)
|
|
33255
|
+
);
|
|
33256
|
+
});
|
|
33257
|
+
}
|
|
33258
|
+
function readVersion(binary) {
|
|
33259
|
+
return new Promise((resolve28) => {
|
|
33260
|
+
execFile2(binary, ["--version"], { timeout: VERSION_TIMEOUT_MS }, (error, stdout) => {
|
|
33261
|
+
const line = stdout.split("\n")[0]?.trim() ?? "";
|
|
33262
|
+
if (!error && line) resolve28(pass("version", line));
|
|
33263
|
+
else resolve28(fail3("version", "runs, but did not report a version"));
|
|
33264
|
+
});
|
|
33265
|
+
});
|
|
33266
|
+
}
|
|
33267
|
+
async function inspectAgent(name, binary) {
|
|
33268
|
+
const target = effectiveBinary(name, binary);
|
|
33269
|
+
const found = await resolveOnPath(target);
|
|
33270
|
+
if (!found) return [fail3("path", `\`${target}\` was not found or is not executable`)];
|
|
33271
|
+
const checks = [pass("path", found)];
|
|
33272
|
+
checks.push(await readVersion(found));
|
|
33273
|
+
if (name === "claude") {
|
|
33274
|
+
const auth = await withBinaryEnv(name, found, () => checkAgentAuth(name));
|
|
33275
|
+
checks.push(
|
|
33276
|
+
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
33277
|
+
);
|
|
33278
|
+
}
|
|
33279
|
+
return checks;
|
|
33280
|
+
}
|
|
33281
|
+
async function testAgent(name, binary, model) {
|
|
33282
|
+
const checks = await inspectAgent(name, binary);
|
|
33283
|
+
if (!checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
33284
|
+
const target = effectiveBinary(name, binary);
|
|
33285
|
+
const found = await resolveOnPath(target) ?? target;
|
|
33286
|
+
const started = Date.now();
|
|
33287
|
+
const result = await withBinaryEnv(
|
|
33288
|
+
name,
|
|
33289
|
+
found,
|
|
33290
|
+
() => createLocalCliAgentInvoker().invoke({
|
|
33291
|
+
agent: name,
|
|
33292
|
+
...model.trim() ? { model: model.trim() } : {},
|
|
33293
|
+
prompt: TEST_PROMPT,
|
|
33294
|
+
timeoutMs: PROMPT_TIMEOUT_MS
|
|
33295
|
+
})
|
|
33296
|
+
);
|
|
33297
|
+
const seconds = ((Date.now() - started) / 1e3).toFixed(1);
|
|
33298
|
+
if (result.timedOut) return [...checks, fail3("prompt", `no answer within ${PROMPT_TIMEOUT_MS / 1e3}s`)];
|
|
33299
|
+
if (result.exitCode !== 0) {
|
|
33300
|
+
const reason = result.stderr.trim().split("\n").pop()?.slice(0, 160) || `exited with code ${result.exitCode}`;
|
|
33301
|
+
return [...checks, fail3("prompt", reason)];
|
|
33302
|
+
}
|
|
33303
|
+
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
33304
|
+
}
|
|
33305
|
+
function statusFromChecks(name, checks) {
|
|
33306
|
+
if (checks.length === 0) return "checking";
|
|
33307
|
+
if (checks.some((check) => check.step === "path" && !check.ok)) return "not-found";
|
|
33308
|
+
const login = checks.find((check) => check.step === "login");
|
|
33309
|
+
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
33310
|
+
const prompt = checks.find((check) => check.step === "prompt");
|
|
33311
|
+
if (prompt) return prompt.ok ? "ready" : "not-logged-in";
|
|
33312
|
+
return name === "claude" ? "ready" : "unknown";
|
|
33313
|
+
}
|
|
33314
|
+
function nextStepHint(name, status) {
|
|
33315
|
+
if (status === "not-found") return INSTALL_HINTS[name];
|
|
33316
|
+
if (status === "not-logged-in") return LOGIN_HINTS[name];
|
|
33317
|
+
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
33318
|
+
return "";
|
|
33319
|
+
}
|
|
33320
|
+
async function withBinaryEnv(name, binary, run) {
|
|
33321
|
+
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
33322
|
+
const previous = process.env[key];
|
|
33323
|
+
process.env[key] = binary;
|
|
33324
|
+
try {
|
|
33325
|
+
return await run();
|
|
33326
|
+
} finally {
|
|
33327
|
+
if (previous === void 0) delete process.env[key];
|
|
33328
|
+
else process.env[key] = previous;
|
|
33329
|
+
}
|
|
33330
|
+
}
|
|
33331
|
+
var VERSION_TIMEOUT_MS, PROMPT_TIMEOUT_MS, TEST_PROMPT, INSTALL_HINTS, LOGIN_HINTS, fail3, pass;
|
|
33332
|
+
var init_agent_status = __esm({
|
|
33333
|
+
"packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts"() {
|
|
33334
|
+
"use strict";
|
|
33335
|
+
init_src4();
|
|
33336
|
+
VERSION_TIMEOUT_MS = 5e3;
|
|
33337
|
+
PROMPT_TIMEOUT_MS = 6e4;
|
|
33338
|
+
TEST_PROMPT = "Reply with the single word: ok";
|
|
33339
|
+
INSTALL_HINTS = {
|
|
33340
|
+
claude: "npm install -g @anthropic-ai/claude-code",
|
|
33341
|
+
codex: "npm install -g @openai/codex",
|
|
33342
|
+
opencode: "npm install -g opencode-ai",
|
|
33343
|
+
cursor: "install Cursor\u2019s `cursor-agent` command",
|
|
33344
|
+
copilot: "npm install -g @github/copilot"
|
|
33345
|
+
};
|
|
33346
|
+
LOGIN_HINTS = {
|
|
33347
|
+
claude: "run `claude login`",
|
|
33348
|
+
codex: "set OPENAI_API_KEY, or sign in with a ChatGPT account",
|
|
33349
|
+
opencode: "run `opencode auth`",
|
|
33350
|
+
cursor: "sign in from Cursor",
|
|
33351
|
+
copilot: "run `copilot` and sign in"
|
|
33352
|
+
};
|
|
33353
|
+
fail3 = (step, detail) => ({ step, ok: false, detail });
|
|
33354
|
+
pass = (step, detail) => ({ step, ok: true, detail });
|
|
33355
|
+
}
|
|
33356
|
+
});
|
|
33357
|
+
|
|
33358
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusLine.tsx
|
|
33359
|
+
import { Box as Box45, Text as Text47 } from "ink";
|
|
33360
|
+
import { jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33361
|
+
function AgentStatusBadge({
|
|
33362
|
+
name,
|
|
33363
|
+
checks
|
|
33364
|
+
}) {
|
|
33365
|
+
const status = checks ? statusFromChecks(name, checks) : "checking";
|
|
33366
|
+
return /* @__PURE__ */ jsx56(Text47, { color: STATUS_COLOR[status], children: STATUS_TEXT[status] });
|
|
33367
|
+
}
|
|
33368
|
+
function AgentChecks({
|
|
33369
|
+
name,
|
|
33370
|
+
checks
|
|
33371
|
+
}) {
|
|
33372
|
+
if (!checks) {
|
|
33373
|
+
return /* @__PURE__ */ jsx56(Box45, { marginTop: 1, children: /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Checking..." }) });
|
|
33374
|
+
}
|
|
33375
|
+
const status = statusFromChecks(name, checks);
|
|
33376
|
+
const hint = nextStepHint(name, status);
|
|
33377
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", marginTop: 1, children: [
|
|
33378
|
+
/* @__PURE__ */ jsxs46(Text47, { bold: true, children: [
|
|
33379
|
+
"Status: ",
|
|
33380
|
+
/* @__PURE__ */ jsx56(Text47, { color: STATUS_COLOR[status], children: STATUS_TEXT[status] })
|
|
33381
|
+
] }),
|
|
33382
|
+
checks.map((check) => /* @__PURE__ */ jsxs46(Text47, { color: check.ok ? PALETTE.success : PALETTE.muted, children: [
|
|
33383
|
+
check.ok ? "\u2713" : "\xB7",
|
|
33384
|
+
" ",
|
|
33385
|
+
check.step,
|
|
33386
|
+
": ",
|
|
33387
|
+
check.detail
|
|
33388
|
+
] }, check.step)),
|
|
33389
|
+
hint && /* @__PURE__ */ jsxs46(Text47, { color: PALETTE.muted, children: [
|
|
33390
|
+
"Next: ",
|
|
33391
|
+
hint
|
|
33392
|
+
] })
|
|
33393
|
+
] });
|
|
33394
|
+
}
|
|
33395
|
+
var STATUS_TEXT, STATUS_COLOR;
|
|
33396
|
+
var init_AgentStatusLine = __esm({
|
|
33397
|
+
"packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusLine.tsx"() {
|
|
33398
|
+
"use strict";
|
|
33399
|
+
init_home_theme();
|
|
33400
|
+
init_agent_status();
|
|
33401
|
+
STATUS_TEXT = {
|
|
33402
|
+
checking: "checking...",
|
|
33403
|
+
ready: "ready",
|
|
33404
|
+
"not-found": "not found",
|
|
33405
|
+
"not-logged-in": "not logged in",
|
|
33406
|
+
unknown: "found, login not checked"
|
|
33407
|
+
};
|
|
33408
|
+
STATUS_COLOR = {
|
|
33409
|
+
checking: PALETTE.muted,
|
|
33410
|
+
ready: PALETTE.success,
|
|
33411
|
+
"not-found": PALETTE.error,
|
|
33412
|
+
"not-logged-in": PALETTE.error,
|
|
33413
|
+
unknown: PALETTE.muted
|
|
33414
|
+
};
|
|
33415
|
+
}
|
|
33416
|
+
});
|
|
33417
|
+
|
|
33418
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
33419
|
+
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
33420
|
+
import { Box as Box46, Text as Text48, useInput as useInput12 } from "ink";
|
|
33421
|
+
import { Fragment as Fragment18, jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
33422
|
+
function AgentForm({
|
|
33423
|
+
name,
|
|
33424
|
+
config,
|
|
33425
|
+
setConfig,
|
|
33426
|
+
onBack
|
|
33427
|
+
}) {
|
|
33428
|
+
const [saving, setSaving] = useState30(false);
|
|
33429
|
+
const [testing, setTesting] = useState30(false);
|
|
33430
|
+
const [notice, setNotice] = useState30(null);
|
|
33431
|
+
const [checks, setChecks] = useState30(void 0);
|
|
33432
|
+
const settings = config.agents[name];
|
|
33433
|
+
useEffect22(() => {
|
|
33434
|
+
let current = true;
|
|
33435
|
+
setChecks(void 0);
|
|
33436
|
+
void inspectAgent(name, settings.binary).then((result) => current && setChecks(result));
|
|
33437
|
+
return () => {
|
|
33438
|
+
current = false;
|
|
33439
|
+
};
|
|
33440
|
+
}, [name, settings.binary]);
|
|
33441
|
+
const save = () => {
|
|
33442
|
+
setSaving(true);
|
|
33443
|
+
setNotice(null);
|
|
33444
|
+
writeAgentConfig(config).then(() => {
|
|
33445
|
+
applyBinaryOverrides(config);
|
|
33446
|
+
setNotice({ kind: "success", text: `${AGENT_LABELS[name]} settings saved` });
|
|
33447
|
+
}).catch(
|
|
33448
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
33449
|
+
).finally(() => setSaving(false));
|
|
33450
|
+
};
|
|
33451
|
+
const runFullTest = () => {
|
|
33452
|
+
setTesting(true);
|
|
33453
|
+
setNotice(null);
|
|
33454
|
+
setChecks(void 0);
|
|
33455
|
+
testAgent(name, settings.binary, settings.model).then(setChecks).catch(
|
|
33456
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "The test could not run" })
|
|
33457
|
+
).finally(() => setTesting(false));
|
|
33458
|
+
};
|
|
33459
|
+
return /* @__PURE__ */ jsx57(
|
|
33460
|
+
FieldForm,
|
|
33461
|
+
{
|
|
33462
|
+
title: AGENT_LABELS[name],
|
|
33463
|
+
subtitle: `Runs the \`${AGENT_HINTS[name]}\` command. ${config.defaultAgent === name ? "This is the default agent." : ""}`.trim(),
|
|
33464
|
+
fields: agentFields(name),
|
|
33465
|
+
values: { binary: settings.binary, model: settings.model },
|
|
33466
|
+
onChange: (key, value) => {
|
|
33467
|
+
setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [key]: value } } });
|
|
33468
|
+
setNotice(null);
|
|
33469
|
+
},
|
|
33470
|
+
onSave: save,
|
|
33471
|
+
onQuit: onBack,
|
|
33472
|
+
notice,
|
|
33473
|
+
busy: saving || testing,
|
|
33474
|
+
footer: /* @__PURE__ */ jsx57(AgentChecks, { name, checks }),
|
|
33475
|
+
actions: [{ key: "t", label: "full test (uses a few tokens)", run: runFullTest }]
|
|
33476
|
+
}
|
|
33477
|
+
);
|
|
33478
|
+
}
|
|
33479
|
+
function AgentsScreen({ onDone }) {
|
|
33480
|
+
const [config, setConfig] = useState30(null);
|
|
33481
|
+
const [focus, setFocus] = useState30(0);
|
|
33482
|
+
const [open, setOpen] = useState30(null);
|
|
33483
|
+
const [notice, setNotice] = useState30(null);
|
|
33484
|
+
const [checks, setChecks] = useState30({});
|
|
33485
|
+
const inspectAll = (loaded) => {
|
|
33486
|
+
for (const name of AGENT_NAMES) {
|
|
33487
|
+
void inspectAgent(name, loaded.agents[name].binary).then(
|
|
33488
|
+
(result) => setChecks((previous) => ({ ...previous, [name]: result }))
|
|
33489
|
+
);
|
|
33490
|
+
}
|
|
33491
|
+
};
|
|
33492
|
+
useEffect22(() => {
|
|
33493
|
+
void readAgentConfig().then((loaded) => {
|
|
33494
|
+
setConfig(loaded);
|
|
33495
|
+
inspectAll(loaded);
|
|
33496
|
+
startDebugRun({
|
|
33497
|
+
flow: "settings/agents",
|
|
33498
|
+
step: "01-agents",
|
|
33499
|
+
menuOption: "Configuration > Agents",
|
|
33500
|
+
inputs: { default_agent: loaded.defaultAgent }
|
|
33501
|
+
});
|
|
33502
|
+
});
|
|
33503
|
+
}, []);
|
|
33504
|
+
const cycleDefault = (step) => {
|
|
33505
|
+
if (!config) return;
|
|
33506
|
+
const index = AGENT_NAMES.indexOf(config.defaultAgent);
|
|
33507
|
+
const next = { ...config, defaultAgent: AGENT_NAMES[(index + step + AGENT_NAMES.length) % AGENT_NAMES.length] };
|
|
33508
|
+
setConfig(next);
|
|
33509
|
+
writeAgentConfig(next).then(() => setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[next.defaultAgent]}` })).catch(
|
|
33510
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
33511
|
+
);
|
|
33512
|
+
};
|
|
33513
|
+
useInput12((input, key) => {
|
|
33514
|
+
if (!config || open) return;
|
|
33515
|
+
const row = ROWS[focus];
|
|
33516
|
+
if (key.upArrow) {
|
|
33517
|
+
setFocus((i) => (i - 1 + ROWS.length) % ROWS.length);
|
|
33518
|
+
return;
|
|
33519
|
+
}
|
|
33520
|
+
if (key.downArrow || key.tab) {
|
|
33521
|
+
setFocus((i) => (i + 1) % ROWS.length);
|
|
33522
|
+
return;
|
|
33523
|
+
}
|
|
33524
|
+
if (row.kind === "default" && key.leftArrow) {
|
|
33525
|
+
cycleDefault(-1);
|
|
33526
|
+
return;
|
|
33527
|
+
}
|
|
33528
|
+
if (row.kind === "default" && key.rightArrow) {
|
|
33529
|
+
cycleDefault(1);
|
|
33530
|
+
return;
|
|
33531
|
+
}
|
|
33532
|
+
if (key.return) {
|
|
33533
|
+
if (row.kind === "default") cycleDefault(1);
|
|
33534
|
+
else setOpen(row.name);
|
|
33535
|
+
return;
|
|
33536
|
+
}
|
|
33537
|
+
if (key.escape || input === "q") {
|
|
33538
|
+
void finishDebugRun({ outputs: { default_agent: config.defaultAgent }, status: "success", exitMethod: "saved" });
|
|
33539
|
+
onDone();
|
|
33540
|
+
}
|
|
33541
|
+
});
|
|
33542
|
+
if (!config) {
|
|
33543
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33544
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
33545
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33546
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "Loading..." })
|
|
33547
|
+
] });
|
|
33548
|
+
}
|
|
33549
|
+
if (open) {
|
|
33550
|
+
return /* @__PURE__ */ jsx57(
|
|
33551
|
+
AgentForm,
|
|
33552
|
+
{
|
|
33553
|
+
name: open,
|
|
33554
|
+
config,
|
|
33555
|
+
setConfig,
|
|
33556
|
+
onBack: () => {
|
|
33557
|
+
setOpen(null);
|
|
33558
|
+
void readAgentConfig().then((saved) => {
|
|
33559
|
+
setConfig(saved);
|
|
33560
|
+
inspectAll(saved);
|
|
33561
|
+
});
|
|
33562
|
+
}
|
|
33563
|
+
}
|
|
33564
|
+
);
|
|
33565
|
+
}
|
|
33566
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33567
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
33568
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "The coding agent the CLI runs, and the settings for each one." }),
|
|
33569
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33570
|
+
ROWS.map((row, index) => {
|
|
33571
|
+
const isFocused = index === focus;
|
|
33572
|
+
const pointer = /* @__PURE__ */ jsx57(Text48, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
33573
|
+
if (row.kind === "default") {
|
|
33574
|
+
return /* @__PURE__ */ jsx57(Box46, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
33575
|
+
pointer,
|
|
33576
|
+
/* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: "Default agent" }),
|
|
33577
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: `\u2039 ${AGENT_LABELS[config.defaultAgent]} \u203A` })
|
|
33578
|
+
] }) }, "default");
|
|
33579
|
+
}
|
|
33580
|
+
const model = config.agents[row.name].model;
|
|
33581
|
+
return /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
33582
|
+
pointer,
|
|
33583
|
+
/* @__PURE__ */ jsx57(Box46, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[row.name] }) }),
|
|
33584
|
+
/* @__PURE__ */ jsx57(Box46, { width: 26, flexShrink: 0, children: /* @__PURE__ */ jsx57(AgentStatusBadge, { name: row.name, checks: checks[row.name] }) }),
|
|
33585
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: `model: ${model || defaultModelLabel(row.name)}` }),
|
|
33586
|
+
row.name === config.defaultAgent && /* @__PURE__ */ jsx57(Text48, { color: PALETTE.success, children: "(default)" })
|
|
33587
|
+
] }, row.name);
|
|
33588
|
+
}),
|
|
33589
|
+
notice && /* @__PURE__ */ jsxs47(Fragment18, { children: [
|
|
33590
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33591
|
+
/* @__PURE__ */ jsxs47(Text48, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33592
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33593
|
+
" ",
|
|
33594
|
+
notice.text
|
|
33595
|
+
] })
|
|
33596
|
+
] }),
|
|
33597
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33598
|
+
/* @__PURE__ */ jsx57(
|
|
33599
|
+
ControlHints,
|
|
33600
|
+
{
|
|
33601
|
+
hints: ROWS[focus].kind === "default" ? [
|
|
33602
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
33603
|
+
{ keys: "\u2190/\u2192", label: "change default agent" },
|
|
33604
|
+
{ keys: "Esc/q", label: "back" }
|
|
33605
|
+
] : [
|
|
33606
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
33607
|
+
{ keys: "\u23CE", label: "open" },
|
|
33608
|
+
{ keys: "Esc/q", label: "back" }
|
|
33609
|
+
]
|
|
33610
|
+
}
|
|
33611
|
+
)
|
|
33612
|
+
] });
|
|
33613
|
+
}
|
|
33614
|
+
var agentFields, ROWS;
|
|
33615
|
+
var init_AgentScreens = __esm({
|
|
33616
|
+
"packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx"() {
|
|
33617
|
+
"use strict";
|
|
33618
|
+
init_src4();
|
|
33619
|
+
init_home_theme();
|
|
33620
|
+
init_control_hints();
|
|
33621
|
+
init_debug_store();
|
|
33622
|
+
init_FieldForm();
|
|
33623
|
+
init_agent_store();
|
|
33624
|
+
init_agent_status();
|
|
33625
|
+
init_AgentStatusLine();
|
|
33626
|
+
init_apply_binary_overrides();
|
|
33627
|
+
agentFields = (name) => [
|
|
33628
|
+
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_HINTS[name]}\` from the PATH)` },
|
|
33629
|
+
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name)})` }
|
|
33630
|
+
];
|
|
33631
|
+
ROWS = [{ kind: "default" }, ...AGENT_NAMES.map((name) => ({ kind: "agent", name }))];
|
|
33632
|
+
}
|
|
33633
|
+
});
|
|
33634
|
+
|
|
32999
33635
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
33000
33636
|
async function readCredentials() {
|
|
33001
33637
|
const store = await readV1Store();
|
|
@@ -33027,11 +33663,10 @@ var init_config_store = __esm({
|
|
|
33027
33663
|
}
|
|
33028
33664
|
});
|
|
33029
33665
|
|
|
33030
|
-
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/
|
|
33031
|
-
import { useEffect as
|
|
33032
|
-
import { Box as
|
|
33033
|
-
import
|
|
33034
|
-
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
33666
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
33667
|
+
import { useEffect as useEffect23, useState as useState31 } from "react";
|
|
33668
|
+
import { Box as Box47, Text as Text49 } from "ink";
|
|
33669
|
+
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
33035
33670
|
function debugFields(config) {
|
|
33036
33671
|
return {
|
|
33037
33672
|
space_id: config?.spaceId ?? "",
|
|
@@ -33043,189 +33678,159 @@ function debugFields(config) {
|
|
|
33043
33678
|
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
33044
33679
|
};
|
|
33045
33680
|
}
|
|
33046
|
-
function
|
|
33047
|
-
const [
|
|
33048
|
-
const [
|
|
33049
|
-
const [
|
|
33050
|
-
const [
|
|
33051
|
-
|
|
33052
|
-
|
|
33053
|
-
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
33054
|
-
useEffect22(() => {
|
|
33055
|
-
readCredentials().then((cfg) => {
|
|
33681
|
+
function ProjectConfigScreen({ onDone }) {
|
|
33682
|
+
const [config, setConfig] = useState31(null);
|
|
33683
|
+
const [saving, setSaving] = useState31(false);
|
|
33684
|
+
const [notice, setNotice] = useState31(null);
|
|
33685
|
+
const [lastSaved, setLastSaved] = useState31(null);
|
|
33686
|
+
useEffect23(() => {
|
|
33687
|
+
void readCredentials().then((cfg) => {
|
|
33056
33688
|
setConfig(cfg);
|
|
33057
|
-
setStage("form");
|
|
33058
33689
|
startDebugRun({
|
|
33059
33690
|
flow: "settings/contentful-configuration",
|
|
33060
33691
|
step: "01-configuration",
|
|
33061
|
-
menuOption: "Configuration",
|
|
33692
|
+
menuOption: "Configuration > Project",
|
|
33062
33693
|
inputs: debugFields(cfg)
|
|
33063
33694
|
});
|
|
33064
33695
|
});
|
|
33065
33696
|
}, []);
|
|
33066
|
-
|
|
33067
|
-
|
|
33068
|
-
|
|
33069
|
-
|
|
33070
|
-
|
|
33071
|
-
|
|
33072
|
-
setConfig({ ...config, [field]: value });
|
|
33073
|
-
setNotice(null);
|
|
33697
|
+
if (!config) {
|
|
33698
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33699
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, children: "Project" }),
|
|
33700
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33701
|
+
/* @__PURE__ */ jsx58(Text49, { color: PALETTE.accent, children: "Loading..." })
|
|
33702
|
+
] });
|
|
33074
33703
|
}
|
|
33075
|
-
|
|
33076
|
-
|
|
33077
|
-
setStage("saving");
|
|
33704
|
+
const save = () => {
|
|
33705
|
+
setSaving(true);
|
|
33078
33706
|
setNotice(null);
|
|
33079
33707
|
writeCredentials(config).then(() => {
|
|
33080
33708
|
setLastSaved(config);
|
|
33081
33709
|
if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
|
|
33082
|
-
setNotice({ kind: "success", text: "
|
|
33083
|
-
setStage("form");
|
|
33710
|
+
setNotice({ kind: "success", text: "Project settings saved" });
|
|
33084
33711
|
}).catch((err) => {
|
|
33085
33712
|
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
33086
|
-
|
|
33087
|
-
|
|
33088
|
-
|
|
33089
|
-
function quit() {
|
|
33713
|
+
}).finally(() => setSaving(false));
|
|
33714
|
+
};
|
|
33715
|
+
const quit = () => {
|
|
33090
33716
|
void finishDebugRun(
|
|
33091
33717
|
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
33092
33718
|
);
|
|
33093
33719
|
onDone();
|
|
33094
|
-
}
|
|
33095
|
-
|
|
33096
|
-
|
|
33097
|
-
|
|
33098
|
-
|
|
33099
|
-
|
|
33100
|
-
|
|
33101
|
-
|
|
33102
|
-
|
|
33103
|
-
|
|
33104
|
-
|
|
33105
|
-
|
|
33106
|
-
|
|
33107
|
-
|
|
33108
|
-
|
|
33109
|
-
|
|
33110
|
-
return;
|
|
33111
|
-
}
|
|
33112
|
-
if (input === "c") {
|
|
33113
|
-
setFieldValue(activeField, "");
|
|
33114
|
-
return;
|
|
33720
|
+
};
|
|
33721
|
+
return /* @__PURE__ */ jsx58(
|
|
33722
|
+
FieldForm,
|
|
33723
|
+
{
|
|
33724
|
+
title: "Project",
|
|
33725
|
+
subtitle: "The Contentful space and where the CLI keeps its files.",
|
|
33726
|
+
fields: FIELDS2,
|
|
33727
|
+
values: valuesOf(config),
|
|
33728
|
+
onChange: (key, value) => {
|
|
33729
|
+
setConfig({ ...config, [key]: value });
|
|
33730
|
+
setNotice(null);
|
|
33731
|
+
},
|
|
33732
|
+
onSave: save,
|
|
33733
|
+
onQuit: quit,
|
|
33734
|
+
notice,
|
|
33735
|
+
busy: saving
|
|
33115
33736
|
}
|
|
33116
|
-
|
|
33117
|
-
|
|
33118
|
-
|
|
33737
|
+
);
|
|
33738
|
+
}
|
|
33739
|
+
var FIELDS2, valuesOf;
|
|
33740
|
+
var init_ProjectConfigScreen = __esm({
|
|
33741
|
+
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx"() {
|
|
33742
|
+
"use strict";
|
|
33743
|
+
init_home_theme();
|
|
33744
|
+
init_debug_store();
|
|
33745
|
+
init_FieldForm();
|
|
33746
|
+
init_config_store();
|
|
33747
|
+
FIELDS2 = [
|
|
33748
|
+
{ key: "spaceId", label: "Space ID" },
|
|
33749
|
+
{ key: "environmentId", label: "Environment ID" },
|
|
33750
|
+
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
33751
|
+
{ key: "host", label: "API Host" },
|
|
33752
|
+
{ key: "defaultComponentDir", label: "Default component directory" },
|
|
33753
|
+
{ key: "defaultTokenFile", label: "Default token file" },
|
|
33754
|
+
{ key: "contentfulBaseDir", label: "Root Project Directory", hint: "(where .contentful goes)" }
|
|
33755
|
+
];
|
|
33756
|
+
valuesOf = (config) => Object.fromEntries(FIELDS2.map(({ key }) => [key, config[key] || ""]));
|
|
33757
|
+
}
|
|
33758
|
+
});
|
|
33759
|
+
|
|
33760
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
33761
|
+
import { useState as useState32 } from "react";
|
|
33762
|
+
import { Box as Box48, Text as Text50, useInput as useInput13 } from "ink";
|
|
33763
|
+
import { jsx as jsx59, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
33764
|
+
function ConfigurationScreen({ onDone }) {
|
|
33765
|
+
const [focus, setFocus] = useState32(0);
|
|
33766
|
+
const [open, setOpen] = useState32(null);
|
|
33767
|
+
const close = () => setOpen(null);
|
|
33768
|
+
useInput13((input, key) => {
|
|
33769
|
+
if (open) return;
|
|
33770
|
+
if (key.upArrow) {
|
|
33771
|
+
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
33119
33772
|
return;
|
|
33120
33773
|
}
|
|
33121
|
-
if (key.
|
|
33122
|
-
|
|
33123
|
-
setActiveField(FIELD_ORDER[(idx - 1 + FIELD_ORDER.length) % FIELD_ORDER.length]);
|
|
33774
|
+
if (key.downArrow || key.tab) {
|
|
33775
|
+
setFocus((i) => (i + 1) % SECTIONS.length);
|
|
33124
33776
|
return;
|
|
33125
33777
|
}
|
|
33126
33778
|
if (key.return) {
|
|
33127
|
-
|
|
33128
|
-
|
|
33779
|
+
setOpen(SECTIONS[focus].id);
|
|
33780
|
+
return;
|
|
33129
33781
|
}
|
|
33782
|
+
if (key.escape || input === "q") onDone();
|
|
33130
33783
|
});
|
|
33131
|
-
if (
|
|
33132
|
-
|
|
33133
|
-
|
|
33134
|
-
|
|
33135
|
-
|
|
33136
|
-
|
|
33137
|
-
|
|
33138
|
-
|
|
33139
|
-
|
|
33140
|
-
|
|
33141
|
-
/* @__PURE__ */
|
|
33142
|
-
|
|
33143
|
-
const value = fieldValue(field);
|
|
33144
|
-
const display = field === "cmaToken" ? "\u2022".repeat(value.length) : value;
|
|
33145
|
-
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33146
|
-
/* @__PURE__ */ jsx55(Text46, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
33147
|
-
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: FIELD_LABELS[field] }) }),
|
|
33148
|
-
isActive && editing ? /* @__PURE__ */ jsx55(
|
|
33149
|
-
TextInput4,
|
|
33150
|
-
{
|
|
33151
|
-
value,
|
|
33152
|
-
onChange: (next) => setFieldValue(field, next),
|
|
33153
|
-
onSubmit: () => setEditing(false),
|
|
33154
|
-
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
33155
|
-
}
|
|
33156
|
-
) : /* @__PURE__ */ jsx55(Text46, { bold: !!display, children: display || (FIELD_HINTS[field] ? "" : /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
33157
|
-
FIELD_HINTS[field] && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: FIELD_HINTS[field] })
|
|
33158
|
-
] }, field);
|
|
33159
|
-
}) }),
|
|
33160
|
-
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
33161
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33162
|
-
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33163
|
-
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33164
|
-
" ",
|
|
33165
|
-
notice.text
|
|
33166
|
-
] })
|
|
33167
|
-
] }),
|
|
33168
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33169
|
-
/* @__PURE__ */ jsx55(
|
|
33784
|
+
if (open === "project") return /* @__PURE__ */ jsx59(ProjectConfigScreen, { onDone: close });
|
|
33785
|
+
if (open === "agents") return /* @__PURE__ */ jsx59(AgentsScreen, { onDone: close });
|
|
33786
|
+
return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33787
|
+
/* @__PURE__ */ jsx59(Text50, { bold: true, children: "Configuration" }),
|
|
33788
|
+
/* @__PURE__ */ jsx59(Text50, { children: " " }),
|
|
33789
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs49(Box48, { gap: 1, children: [
|
|
33790
|
+
/* @__PURE__ */ jsx59(Text50, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
33791
|
+
/* @__PURE__ */ jsx59(Box48, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx59(Text50, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
33792
|
+
/* @__PURE__ */ jsx59(Text50, { color: PALETTE.muted, children: section.description })
|
|
33793
|
+
] }, section.id)),
|
|
33794
|
+
/* @__PURE__ */ jsx59(Text50, { children: " " }),
|
|
33795
|
+
/* @__PURE__ */ jsx59(
|
|
33170
33796
|
ControlHints,
|
|
33171
33797
|
{
|
|
33172
|
-
hints:
|
|
33173
|
-
{ keys: "type", label: "edit" },
|
|
33174
|
-
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
33175
|
-
{ keys: "\u23CE", label: "done" },
|
|
33176
|
-
{ keys: "Esc", label: "cancel edit" }
|
|
33177
|
-
] : [
|
|
33798
|
+
hints: [
|
|
33178
33799
|
{ keys: "\u2191/\u2193", label: "move" },
|
|
33179
|
-
{ keys: "\u23CE", label: "
|
|
33180
|
-
{ keys: "
|
|
33181
|
-
{ keys: "s", label: "save" },
|
|
33182
|
-
{ keys: "Esc/q", label: "quit without saving" }
|
|
33800
|
+
{ keys: "\u23CE", label: "open" },
|
|
33801
|
+
{ keys: "Esc/q", label: "back" }
|
|
33183
33802
|
]
|
|
33184
33803
|
}
|
|
33185
33804
|
)
|
|
33186
33805
|
] });
|
|
33187
33806
|
}
|
|
33188
|
-
var
|
|
33807
|
+
var SECTIONS;
|
|
33189
33808
|
var init_ContentfulConfigScreen = __esm({
|
|
33190
33809
|
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx"() {
|
|
33191
33810
|
"use strict";
|
|
33192
|
-
|
|
33193
|
-
init_config_store();
|
|
33194
|
-
init_debug_store();
|
|
33811
|
+
init_home_theme();
|
|
33195
33812
|
init_control_hints();
|
|
33196
|
-
|
|
33197
|
-
|
|
33198
|
-
|
|
33199
|
-
|
|
33200
|
-
|
|
33201
|
-
|
|
33202
|
-
|
|
33203
|
-
|
|
33813
|
+
init_AgentScreens();
|
|
33814
|
+
init_ProjectConfigScreen();
|
|
33815
|
+
SECTIONS = [
|
|
33816
|
+
{
|
|
33817
|
+
id: "project",
|
|
33818
|
+
label: "Project",
|
|
33819
|
+
description: "Contentful space, credentials, defaults and where .contentful goes"
|
|
33820
|
+
},
|
|
33821
|
+
{ id: "agents", label: "Agents", description: "Which coding agent the CLI uses, and each agent\u2019s settings" }
|
|
33204
33822
|
];
|
|
33205
|
-
FIELD_LABELS = {
|
|
33206
|
-
spaceId: "Space ID",
|
|
33207
|
-
environmentId: "Environment ID",
|
|
33208
|
-
cmaToken: "CMA Token",
|
|
33209
|
-
host: "API Host",
|
|
33210
|
-
defaultComponentDir: "Default component directory",
|
|
33211
|
-
defaultTokenFile: "Default token file",
|
|
33212
|
-
contentfulBaseDir: "Root Project Directory"
|
|
33213
|
-
};
|
|
33214
|
-
FIELD_HINTS = {
|
|
33215
|
-
contentfulBaseDir: "(where .contentful goes)"
|
|
33216
|
-
};
|
|
33217
|
-
LABEL_WIDTH = Math.max(...Object.values(FIELD_LABELS).map((label) => label.length));
|
|
33218
33823
|
}
|
|
33219
33824
|
});
|
|
33220
33825
|
|
|
33221
33826
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
33222
|
-
import { useEffect as
|
|
33223
|
-
import { Box as
|
|
33224
|
-
import { Fragment as
|
|
33827
|
+
import { useEffect as useEffect24, useState as useState33 } from "react";
|
|
33828
|
+
import { Box as Box49, Text as Text51, useInput as useInput14 } from "ink";
|
|
33829
|
+
import { Fragment as Fragment19, jsx as jsx60, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
33225
33830
|
function OptInAnalyticsScreen({ onDone }) {
|
|
33226
|
-
const [loading, setLoading] =
|
|
33227
|
-
const [enabled, setEnabled] =
|
|
33228
|
-
|
|
33831
|
+
const [loading, setLoading] = useState33(true);
|
|
33832
|
+
const [enabled, setEnabled] = useState33(true);
|
|
33833
|
+
useEffect24(() => {
|
|
33229
33834
|
readAnalyticsSetting().then((setting) => {
|
|
33230
33835
|
setEnabled(setting.enabled);
|
|
33231
33836
|
setLoading(false);
|
|
@@ -33237,7 +33842,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33237
33842
|
});
|
|
33238
33843
|
});
|
|
33239
33844
|
}, []);
|
|
33240
|
-
|
|
33845
|
+
useInput14((input, key) => {
|
|
33241
33846
|
if (loading) return;
|
|
33242
33847
|
if (key.return || input === " ") {
|
|
33243
33848
|
setEnabled((current) => {
|
|
@@ -33252,21 +33857,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33252
33857
|
onDone();
|
|
33253
33858
|
}
|
|
33254
33859
|
});
|
|
33255
|
-
return /* @__PURE__ */
|
|
33256
|
-
/* @__PURE__ */
|
|
33257
|
-
/* @__PURE__ */
|
|
33258
|
-
loading ? /* @__PURE__ */
|
|
33259
|
-
/* @__PURE__ */
|
|
33860
|
+
return /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33861
|
+
/* @__PURE__ */ jsx60(Text51, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
33862
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
33863
|
+
loading ? /* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs50(Fragment19, { children: [
|
|
33864
|
+
/* @__PURE__ */ jsxs50(Text51, { children: [
|
|
33260
33865
|
"Share anonymous usage data:",
|
|
33261
33866
|
" ",
|
|
33262
|
-
/* @__PURE__ */
|
|
33867
|
+
/* @__PURE__ */ jsx60(Text51, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
33263
33868
|
] }),
|
|
33264
|
-
/* @__PURE__ */
|
|
33265
|
-
/* @__PURE__ */
|
|
33266
|
-
/* @__PURE__ */
|
|
33869
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
33870
|
+
/* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
33871
|
+
/* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
33267
33872
|
] }),
|
|
33268
|
-
/* @__PURE__ */
|
|
33269
|
-
/* @__PURE__ */
|
|
33873
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
33874
|
+
/* @__PURE__ */ jsx60(
|
|
33270
33875
|
ControlHints,
|
|
33271
33876
|
{
|
|
33272
33877
|
hints: [
|
|
@@ -33280,7 +33885,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33280
33885
|
var init_screen11 = __esm({
|
|
33281
33886
|
"packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx"() {
|
|
33282
33887
|
"use strict";
|
|
33283
|
-
|
|
33888
|
+
init_home_theme();
|
|
33284
33889
|
init_analytics_store();
|
|
33285
33890
|
init_debug_store();
|
|
33286
33891
|
init_control_hints();
|
|
@@ -33288,12 +33893,12 @@ var init_screen11 = __esm({
|
|
|
33288
33893
|
});
|
|
33289
33894
|
|
|
33290
33895
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
33291
|
-
import { useEffect as
|
|
33292
|
-
import { Box as
|
|
33293
|
-
import { jsx as
|
|
33896
|
+
import { useEffect as useEffect25, useState as useState34 } from "react";
|
|
33897
|
+
import { Box as Box50, Text as Text52, useInput as useInput15 } from "ink";
|
|
33898
|
+
import { jsx as jsx61, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
33294
33899
|
function UpgradeScreen({ onDone }) {
|
|
33295
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
33296
|
-
|
|
33900
|
+
const [upgradeCheck, setUpgradeCheck] = useState34();
|
|
33901
|
+
useEffect25(() => {
|
|
33297
33902
|
startDebugRun({
|
|
33298
33903
|
flow: "upgrade",
|
|
33299
33904
|
step: "01-upgrade",
|
|
@@ -33302,7 +33907,7 @@ function UpgradeScreen({ onDone }) {
|
|
|
33302
33907
|
});
|
|
33303
33908
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
33304
33909
|
}, []);
|
|
33305
|
-
|
|
33910
|
+
useInput15((_input, key) => {
|
|
33306
33911
|
if (key.return) {
|
|
33307
33912
|
void finishDebugRun({
|
|
33308
33913
|
outputs: upgradeCheck ?? {},
|
|
@@ -33313,12 +33918,12 @@ function UpgradeScreen({ onDone }) {
|
|
|
33313
33918
|
return;
|
|
33314
33919
|
}
|
|
33315
33920
|
});
|
|
33316
|
-
return /* @__PURE__ */
|
|
33317
|
-
/* @__PURE__ */
|
|
33318
|
-
/* @__PURE__ */
|
|
33921
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33922
|
+
/* @__PURE__ */ jsx61(Text52, { bold: true, children: "Upgrade" }),
|
|
33923
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
33319
33924
|
renderBody(upgradeCheck),
|
|
33320
|
-
/* @__PURE__ */
|
|
33321
|
-
/* @__PURE__ */
|
|
33925
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
33926
|
+
/* @__PURE__ */ jsxs51(Text52, { bold: true, color: PALETTE.accent, children: [
|
|
33322
33927
|
FOCUS_MARKER,
|
|
33323
33928
|
" Go Back"
|
|
33324
33929
|
] })
|
|
@@ -33326,41 +33931,40 @@ function UpgradeScreen({ onDone }) {
|
|
|
33326
33931
|
}
|
|
33327
33932
|
function renderBody(upgradeCheck) {
|
|
33328
33933
|
if (!upgradeCheck) {
|
|
33329
|
-
return /* @__PURE__ */
|
|
33934
|
+
return /* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
33330
33935
|
}
|
|
33331
33936
|
if (upgradeCheck.status === "error") {
|
|
33332
|
-
return /* @__PURE__ */
|
|
33937
|
+
return /* @__PURE__ */ jsx61(Text52, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
33333
33938
|
}
|
|
33334
33939
|
if (upgradeCheck.status === "up-to-date") {
|
|
33335
|
-
return /* @__PURE__ */
|
|
33940
|
+
return /* @__PURE__ */ jsxs51(Text52, { color: PALETTE.success, children: [
|
|
33336
33941
|
"You're already on the latest version (v",
|
|
33337
33942
|
upgradeCheck.current,
|
|
33338
33943
|
")."
|
|
33339
33944
|
] });
|
|
33340
33945
|
}
|
|
33341
|
-
return /* @__PURE__ */
|
|
33342
|
-
/* @__PURE__ */
|
|
33343
|
-
/* @__PURE__ */
|
|
33946
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", children: [
|
|
33947
|
+
/* @__PURE__ */ jsxs51(Text52, { color: PALETTE.muted, children: [
|
|
33948
|
+
/* @__PURE__ */ jsxs51(Text52, { bold: true, color: PALETTE.success, children: [
|
|
33344
33949
|
"v",
|
|
33345
33950
|
upgradeCheck.latest
|
|
33346
33951
|
] }),
|
|
33347
33952
|
" ",
|
|
33348
33953
|
"is available (you're on ",
|
|
33349
|
-
/* @__PURE__ */
|
|
33954
|
+
/* @__PURE__ */ jsxs51(Text52, { bold: true, children: [
|
|
33350
33955
|
"v",
|
|
33351
33956
|
upgradeCheck.current
|
|
33352
33957
|
] }),
|
|
33353
33958
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
33354
33959
|
] }),
|
|
33355
|
-
/* @__PURE__ */
|
|
33356
|
-
/* @__PURE__ */
|
|
33960
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
33961
|
+
/* @__PURE__ */ jsx61(Box50, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx61(Text52, { bold: true, children: cmd }, cmd)) })
|
|
33357
33962
|
] });
|
|
33358
33963
|
}
|
|
33359
33964
|
var UPGRADE_COMMANDS;
|
|
33360
33965
|
var init_PageContainer4 = __esm({
|
|
33361
33966
|
"packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx"() {
|
|
33362
33967
|
"use strict";
|
|
33363
|
-
init_theme();
|
|
33364
33968
|
init_home_theme();
|
|
33365
33969
|
init_version();
|
|
33366
33970
|
init_debug_store();
|
|
@@ -33369,13 +33973,13 @@ var init_PageContainer4 = __esm({
|
|
|
33369
33973
|
});
|
|
33370
33974
|
|
|
33371
33975
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
33372
|
-
import { useEffect as
|
|
33373
|
-
import { Box as
|
|
33374
|
-
import { jsx as
|
|
33976
|
+
import { useEffect as useEffect26, useState as useState35 } from "react";
|
|
33977
|
+
import { Box as Box51, Text as Text53, useInput as useInput16 } from "ink";
|
|
33978
|
+
import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
33375
33979
|
function DebugModeScreen({ onDone }) {
|
|
33376
|
-
const [loading, setLoading] =
|
|
33377
|
-
const [enabled, setEnabled] =
|
|
33378
|
-
|
|
33980
|
+
const [loading, setLoading] = useState35(true);
|
|
33981
|
+
const [enabled, setEnabled] = useState35(true);
|
|
33982
|
+
useEffect26(() => {
|
|
33379
33983
|
readDebugModeSetting().then((setting) => {
|
|
33380
33984
|
setEnabled(setting.enabled);
|
|
33381
33985
|
setLoading(false);
|
|
@@ -33387,7 +33991,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
33387
33991
|
});
|
|
33388
33992
|
});
|
|
33389
33993
|
}, []);
|
|
33390
|
-
|
|
33994
|
+
useInput16((input, key) => {
|
|
33391
33995
|
if (loading) return;
|
|
33392
33996
|
if (key.return || input === " ") {
|
|
33393
33997
|
setEnabled((current) => {
|
|
@@ -33402,16 +34006,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
33402
34006
|
onDone();
|
|
33403
34007
|
}
|
|
33404
34008
|
});
|
|
33405
|
-
return /* @__PURE__ */
|
|
33406
|
-
/* @__PURE__ */
|
|
33407
|
-
/* @__PURE__ */
|
|
33408
|
-
loading ? /* @__PURE__ */
|
|
34009
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
34010
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
34011
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
34012
|
+
loading ? /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs52(Text53, { children: [
|
|
33409
34013
|
"Debug logging:",
|
|
33410
34014
|
" ",
|
|
33411
|
-
/* @__PURE__ */
|
|
34015
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
33412
34016
|
] }),
|
|
33413
|
-
/* @__PURE__ */
|
|
33414
|
-
/* @__PURE__ */
|
|
34017
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
34018
|
+
/* @__PURE__ */ jsx62(
|
|
33415
34019
|
ControlHints,
|
|
33416
34020
|
{
|
|
33417
34021
|
hints: [
|
|
@@ -33425,7 +34029,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
33425
34029
|
var init_screen12 = __esm({
|
|
33426
34030
|
"packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx"() {
|
|
33427
34031
|
"use strict";
|
|
33428
|
-
|
|
34032
|
+
init_home_theme();
|
|
33429
34033
|
init_debug_mode_store();
|
|
33430
34034
|
init_debug_store();
|
|
33431
34035
|
init_control_hints();
|
|
@@ -33437,20 +34041,20 @@ var app_exports = {};
|
|
|
33437
34041
|
__export(app_exports, {
|
|
33438
34042
|
runApp: () => runApp
|
|
33439
34043
|
});
|
|
33440
|
-
import { join as
|
|
33441
|
-
import { useEffect as
|
|
33442
|
-
import { Fragment as
|
|
34044
|
+
import { join as join28 } from "node:path";
|
|
34045
|
+
import { useEffect as useEffect27, useState as useState36 } from "react";
|
|
34046
|
+
import { Fragment as Fragment20, jsx as jsx63 } from "react/jsx-runtime";
|
|
33443
34047
|
function App({ importOptions, inkClear }) {
|
|
33444
|
-
const [screen, setScreen] =
|
|
33445
|
-
const [importExitCode, setImportExitCode] =
|
|
34048
|
+
const [screen, setScreen] = useState36("start");
|
|
34049
|
+
const [importExitCode, setImportExitCode] = useState36();
|
|
33446
34050
|
const showImportResult = importExitCode !== void 0;
|
|
33447
|
-
const [projectPath, setProjectPath] =
|
|
33448
|
-
const [tokensPath, setTokensPath] =
|
|
33449
|
-
const [scannedFiles, setScannedFiles] =
|
|
33450
|
-
const [pendingLaunch, setPendingLaunch] =
|
|
33451
|
-
const [extractionRun, setExtractionRun] =
|
|
34051
|
+
const [projectPath, setProjectPath] = useState36();
|
|
34052
|
+
const [tokensPath, setTokensPath] = useState36();
|
|
34053
|
+
const [scannedFiles, setScannedFiles] = useState36();
|
|
34054
|
+
const [pendingLaunch, setPendingLaunch] = useState36();
|
|
34055
|
+
const [extractionRun, setExtractionRun] = useState36();
|
|
33452
34056
|
const extraction = useExtraction(extractionRun?.input);
|
|
33453
|
-
const [scopeRun, setScopeRun] =
|
|
34057
|
+
const [scopeRun, setScopeRun] = useState36();
|
|
33454
34058
|
const scopeFlow = useScopeGateFlow(
|
|
33455
34059
|
scopeRun && {
|
|
33456
34060
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -33465,12 +34069,12 @@ function App({ importOptions, inkClear }) {
|
|
|
33465
34069
|
}
|
|
33466
34070
|
}
|
|
33467
34071
|
);
|
|
33468
|
-
const [generationInput, setGenerationInput] =
|
|
34072
|
+
const [generationInput, setGenerationInput] = useState36();
|
|
33469
34073
|
const generation = useGeneration(generationInput);
|
|
33470
|
-
const [flowStart, setFlowStart] =
|
|
34074
|
+
const [flowStart, setFlowStart] = useState36();
|
|
33471
34075
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
33472
|
-
const [importDefaults, setImportDefaults] =
|
|
33473
|
-
|
|
34076
|
+
const [importDefaults, setImportDefaults] = useState36();
|
|
34077
|
+
useEffect27(() => {
|
|
33474
34078
|
if (screen !== "import") {
|
|
33475
34079
|
setImportDefaults(void 0);
|
|
33476
34080
|
return;
|
|
@@ -33488,7 +34092,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33488
34092
|
const launch = { projectPath: projectPath2, tokens, filePaths, ...importOptions };
|
|
33489
34093
|
const state2 = await inspectTokens({
|
|
33490
34094
|
rawTokensPath: tokens,
|
|
33491
|
-
contentfulDir:
|
|
34095
|
+
contentfulDir: join28(resolveUserPath(projectPath2), ".contentful"),
|
|
33492
34096
|
cache: importOptions.cache
|
|
33493
34097
|
});
|
|
33494
34098
|
if (state2.kind === "cached") {
|
|
@@ -33530,12 +34134,12 @@ function App({ importOptions, inkClear }) {
|
|
|
33530
34134
|
}
|
|
33531
34135
|
});
|
|
33532
34136
|
};
|
|
33533
|
-
|
|
34137
|
+
useEffect27(() => {
|
|
33534
34138
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
33535
34139
|
setExtractionRun(void 0);
|
|
33536
34140
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
33537
34141
|
}, [extraction, extractionRun]);
|
|
33538
|
-
|
|
34142
|
+
useEffect27(() => {
|
|
33539
34143
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
33540
34144
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33541
34145
|
setGenerationInput({
|
|
@@ -33553,7 +34157,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33553
34157
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
33554
34158
|
});
|
|
33555
34159
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
33556
|
-
|
|
34160
|
+
useEffect27(() => {
|
|
33557
34161
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
33558
34162
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33559
34163
|
inkClear();
|
|
@@ -33596,9 +34200,9 @@ function App({ importOptions, inkClear }) {
|
|
|
33596
34200
|
};
|
|
33597
34201
|
switch (screen) {
|
|
33598
34202
|
case "import":
|
|
33599
|
-
if (showImportResult) return /* @__PURE__ */
|
|
34203
|
+
if (showImportResult) return /* @__PURE__ */ jsx63(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
33600
34204
|
if (flow && flowStart) {
|
|
33601
|
-
return /* @__PURE__ */
|
|
34205
|
+
return /* @__PURE__ */ jsx63(
|
|
33602
34206
|
FlowScreen,
|
|
33603
34207
|
{
|
|
33604
34208
|
state: flow.state,
|
|
@@ -33608,12 +34212,12 @@ function App({ importOptions, inkClear }) {
|
|
|
33608
34212
|
}
|
|
33609
34213
|
);
|
|
33610
34214
|
}
|
|
33611
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
34215
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
33612
34216
|
if (projectPath === void 0) {
|
|
33613
|
-
return /* @__PURE__ */
|
|
34217
|
+
return /* @__PURE__ */ jsx63(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
33614
34218
|
}
|
|
33615
34219
|
if (tokensPath === void 0) {
|
|
33616
|
-
return /* @__PURE__ */
|
|
34220
|
+
return /* @__PURE__ */ jsx63(
|
|
33617
34221
|
TokenInputScreen,
|
|
33618
34222
|
{
|
|
33619
34223
|
initialPath: importDefaults.tokenFile,
|
|
@@ -33623,7 +34227,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33623
34227
|
);
|
|
33624
34228
|
}
|
|
33625
34229
|
if (scannedFiles === void 0) {
|
|
33626
|
-
return /* @__PURE__ */
|
|
34230
|
+
return /* @__PURE__ */ jsx63(
|
|
33627
34231
|
PathValidationScreen,
|
|
33628
34232
|
{
|
|
33629
34233
|
projectPath,
|
|
@@ -33635,10 +34239,10 @@ function App({ importOptions, inkClear }) {
|
|
|
33635
34239
|
}
|
|
33636
34240
|
if (extractionRun) {
|
|
33637
34241
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
33638
|
-
return /* @__PURE__ */
|
|
34242
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
33639
34243
|
}
|
|
33640
34244
|
if (extraction?.status === "running") {
|
|
33641
|
-
return /* @__PURE__ */
|
|
34245
|
+
return /* @__PURE__ */ jsx63(
|
|
33642
34246
|
ExtractionScreen,
|
|
33643
34247
|
{
|
|
33644
34248
|
progress: extraction.progress,
|
|
@@ -33647,14 +34251,14 @@ function App({ importOptions, inkClear }) {
|
|
|
33647
34251
|
}
|
|
33648
34252
|
);
|
|
33649
34253
|
}
|
|
33650
|
-
return /* @__PURE__ */
|
|
34254
|
+
return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
33651
34255
|
}
|
|
33652
34256
|
if (scopeRun && scopeFlow) {
|
|
33653
34257
|
if (scopeFlow.status === "failed") {
|
|
33654
|
-
return /* @__PURE__ */
|
|
34258
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
33655
34259
|
}
|
|
33656
34260
|
if (scopeFlow.status === "deciding") {
|
|
33657
|
-
return /* @__PURE__ */
|
|
34261
|
+
return /* @__PURE__ */ jsx63(
|
|
33658
34262
|
ScopeGateScreen,
|
|
33659
34263
|
{
|
|
33660
34264
|
components: scopeFlow.load.components,
|
|
@@ -33664,7 +34268,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33664
34268
|
);
|
|
33665
34269
|
}
|
|
33666
34270
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
33667
|
-
return /* @__PURE__ */
|
|
34271
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
33668
34272
|
}
|
|
33669
34273
|
if (generation?.status === "running") {
|
|
33670
34274
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -33672,7 +34276,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33672
34276
|
hasRawTokens,
|
|
33673
34277
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
33674
34278
|
});
|
|
33675
|
-
return /* @__PURE__ */
|
|
34279
|
+
return /* @__PURE__ */ jsx63(
|
|
33676
34280
|
GenerationScreen,
|
|
33677
34281
|
{
|
|
33678
34282
|
progress: generation.progress,
|
|
@@ -33684,10 +34288,10 @@ function App({ importOptions, inkClear }) {
|
|
|
33684
34288
|
}
|
|
33685
34289
|
);
|
|
33686
34290
|
}
|
|
33687
|
-
return /* @__PURE__ */
|
|
34291
|
+
return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
33688
34292
|
}
|
|
33689
34293
|
if (pendingLaunch?.cached) {
|
|
33690
|
-
return /* @__PURE__ */
|
|
34294
|
+
return /* @__PURE__ */ jsx63(
|
|
33691
34295
|
TokenReuseScreen,
|
|
33692
34296
|
{
|
|
33693
34297
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -33698,7 +34302,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33698
34302
|
}
|
|
33699
34303
|
);
|
|
33700
34304
|
}
|
|
33701
|
-
return /* @__PURE__ */
|
|
34305
|
+
return /* @__PURE__ */ jsx63(
|
|
33702
34306
|
CredentialsScreen,
|
|
33703
34307
|
{
|
|
33704
34308
|
initial: importDefaults.credentials,
|
|
@@ -33707,19 +34311,19 @@ function App({ importOptions, inkClear }) {
|
|
|
33707
34311
|
}
|
|
33708
34312
|
);
|
|
33709
34313
|
case "help":
|
|
33710
|
-
return /* @__PURE__ */
|
|
34314
|
+
return /* @__PURE__ */ jsx63(HelpScreen, { onDone: goToStart });
|
|
33711
34315
|
case "upgrade":
|
|
33712
|
-
return /* @__PURE__ */
|
|
34316
|
+
return /* @__PURE__ */ jsx63(UpgradeScreen, { onDone: goToStart });
|
|
33713
34317
|
case "settings":
|
|
33714
|
-
return /* @__PURE__ */
|
|
34318
|
+
return /* @__PURE__ */ jsx63(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
33715
34319
|
case "settings-configuration":
|
|
33716
|
-
return /* @__PURE__ */
|
|
34320
|
+
return /* @__PURE__ */ jsx63(ConfigurationScreen, { onDone: goToSettings });
|
|
33717
34321
|
case "settings-opt-in-analytics":
|
|
33718
|
-
return /* @__PURE__ */
|
|
34322
|
+
return /* @__PURE__ */ jsx63(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
33719
34323
|
case "settings-debug-mode":
|
|
33720
|
-
return /* @__PURE__ */
|
|
34324
|
+
return /* @__PURE__ */ jsx63(DebugModeScreen, { onDone: goToSettings });
|
|
33721
34325
|
case "start":
|
|
33722
|
-
return /* @__PURE__ */
|
|
34326
|
+
return /* @__PURE__ */ jsx63(HomeScreen, { onNavigate: setScreen });
|
|
33723
34327
|
}
|
|
33724
34328
|
}
|
|
33725
34329
|
async function runApp(renderApp, importOptions) {
|
|
@@ -33727,7 +34331,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
33727
34331
|
instance.clear?.();
|
|
33728
34332
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
33729
34333
|
};
|
|
33730
|
-
const instance = renderApp(/* @__PURE__ */
|
|
34334
|
+
const instance = renderApp(/* @__PURE__ */ jsx63(App, { importOptions, inkClear }));
|
|
33731
34335
|
await instance.waitUntilExit();
|
|
33732
34336
|
}
|
|
33733
34337
|
var init_app = __esm({
|
|
@@ -33762,7 +34366,7 @@ var init_app = __esm({
|
|
|
33762
34366
|
// packages/experience-design-system-cli/program.ts
|
|
33763
34367
|
init_src4();
|
|
33764
34368
|
import { readFileSync as readFileSync9 } from "node:fs";
|
|
33765
|
-
import { join as
|
|
34369
|
+
import { join as join29 } from "node:path";
|
|
33766
34370
|
import { Command } from "commander";
|
|
33767
34371
|
|
|
33768
34372
|
// packages/experience-design-system-cli/src/legacy/run-legacy.ts
|
|
@@ -33866,14 +34470,14 @@ function runDevWatch(args) {
|
|
|
33866
34470
|
process.stderr.write("--watch only works from a checkout of the repo (scripts/dev.mjs is not in the package).\n");
|
|
33867
34471
|
return Promise.resolve(1);
|
|
33868
34472
|
}
|
|
33869
|
-
return new Promise((
|
|
34473
|
+
return new Promise((resolve28) => {
|
|
33870
34474
|
const child = spawn4(process.execPath, [script, ...args], { stdio: "inherit" });
|
|
33871
34475
|
process.on("SIGINT", () => void 0);
|
|
33872
|
-
child.on("exit", (code) =>
|
|
34476
|
+
child.on("exit", (code) => resolve28(code ?? 0));
|
|
33873
34477
|
child.on("error", (err) => {
|
|
33874
34478
|
process.stderr.write(`${err.message}
|
|
33875
34479
|
`);
|
|
33876
|
-
|
|
34480
|
+
resolve28(1);
|
|
33877
34481
|
});
|
|
33878
34482
|
});
|
|
33879
34483
|
}
|
|
@@ -33895,11 +34499,13 @@ function registerImportCommand(program, openTui) {
|
|
|
33895
34499
|
}
|
|
33896
34500
|
|
|
33897
34501
|
// packages/experience-design-system-cli/program.ts
|
|
34502
|
+
init_agent_store();
|
|
34503
|
+
init_apply_binary_overrides();
|
|
33898
34504
|
init_analytics_store();
|
|
33899
34505
|
init_package_root();
|
|
33900
34506
|
var pkg = JSON.parse(
|
|
33901
34507
|
readFileSync9(
|
|
33902
|
-
|
|
34508
|
+
join29(findPackageRoot(import.meta.url, "@contentful/experience-design-system-cli"), "package.json"),
|
|
33903
34509
|
"utf8"
|
|
33904
34510
|
)
|
|
33905
34511
|
);
|
|
@@ -33917,6 +34523,7 @@ function createProgram() {
|
|
|
33917
34523
|
const commandChain = chain.join(" ") || actionCommand.name();
|
|
33918
34524
|
const { enabled } = await readAnalyticsSetting();
|
|
33919
34525
|
setPersistedAnalyticsDisabled(!enabled);
|
|
34526
|
+
await readAgentConfig().then(applyBinaryOverrides, () => void 0);
|
|
33920
34527
|
setCliVersion(pkg.version);
|
|
33921
34528
|
noteCommandStart(commandChain);
|
|
33922
34529
|
});
|
|
@@ -33940,7 +34547,7 @@ init_config();
|
|
|
33940
34547
|
init_package_root();
|
|
33941
34548
|
import { existsSync as existsSync12 } from "node:fs";
|
|
33942
34549
|
import { mkdir as mkdir10, readFile as readFile19, rename as rename3, rmdir, unlink } from "node:fs/promises";
|
|
33943
|
-
import { dirname as dirname16, join as
|
|
34550
|
+
import { dirname as dirname16, join as join30 } from "node:path";
|
|
33944
34551
|
var PACKAGE_NAME4 = "@contentful/experience-design-system-cli";
|
|
33945
34552
|
async function readJson(path5) {
|
|
33946
34553
|
try {
|
|
@@ -33951,9 +34558,9 @@ async function readJson(path5) {
|
|
|
33951
34558
|
}
|
|
33952
34559
|
async function migrateOldConfig() {
|
|
33953
34560
|
try {
|
|
33954
|
-
const oldCredentials =
|
|
33955
|
-
const oldRuns =
|
|
33956
|
-
const oldDebugMode =
|
|
34561
|
+
const oldCredentials = join30(oldConfigDir2(), "credentials.json");
|
|
34562
|
+
const oldRuns = join30(oldConfigDir2(), "runs.json");
|
|
34563
|
+
const oldDebugMode = join30(
|
|
33957
34564
|
findPackageRoot(import.meta.url, PACKAGE_NAME4),
|
|
33958
34565
|
".contentful",
|
|
33959
34566
|
"config",
|