@contentful/experience-design-system-cli 2.37.1-dev-build-1cd1ccfb.0 → 2.37.1-dev-build-0b786a83.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 +1182 -513
- package/dist/index.js +1323 -584
- 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/AgentDetail.d.ts +13 -0
- package/dist/src/tui/settings/agents/AgentScreens.d.ts +8 -0
- package/dist/src/tui/settings/agents/AgentStatusBadge.d.ts +9 -0
- package/dist/src/tui/settings/agents/agent-status.d.ts +44 -0
- package/dist/src/tui/settings/agents/agent-store.d.ts +17 -0
- package/dist/src/tui/settings/agents/apply-binary-overrides.d.ts +13 -0
- package/dist/src/tui/settings/contentful-configuration/ContentfulConfigScreen.d.ts +1 -0
- package/dist/src/tui/settings/contentful-configuration/ProjectConfigScreen.d.ts +5 -0
- package/dist/src/tui/settings/shared/FieldForm.d.ts +35 -0
- package/legacy/dist/src/index.js +1 -0
- package/legacy/package.json +1 -1
- package/package.json +3 -3
- package/dist/src/tui/theme.d.ts +0 -19
package/dist/index.js
CHANGED
|
@@ -1500,7 +1500,7 @@ async function runAgent(options) {
|
|
|
1500
1500
|
promptLen: prompt.length,
|
|
1501
1501
|
promptHead: prompt.slice(0, 500)
|
|
1502
1502
|
});
|
|
1503
|
-
return new Promise((
|
|
1503
|
+
return new Promise((resolve28) => {
|
|
1504
1504
|
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
1505
1505
|
const child = spawn(binary, args, {
|
|
1506
1506
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -1549,7 +1549,7 @@ async function runAgent(options) {
|
|
|
1549
1549
|
stderrLen: stderr.length,
|
|
1550
1550
|
stderrTail: stderr.slice(-1e3)
|
|
1551
1551
|
});
|
|
1552
|
-
|
|
1552
|
+
resolve28(result);
|
|
1553
1553
|
});
|
|
1554
1554
|
});
|
|
1555
1555
|
}
|
|
@@ -1571,7 +1571,7 @@ async function checkAgentAuth(agent) {
|
|
|
1571
1571
|
return "not-found";
|
|
1572
1572
|
if (agent !== "claude")
|
|
1573
1573
|
return "ok";
|
|
1574
|
-
return new Promise((
|
|
1574
|
+
return new Promise((resolve28) => {
|
|
1575
1575
|
const child = spawn2(binary, ["auth", "status", "--json"], { stdio: ["ignore", "pipe", "pipe"] });
|
|
1576
1576
|
let stdout = "";
|
|
1577
1577
|
let done = false;
|
|
@@ -1580,7 +1580,7 @@ async function checkAgentAuth(agent) {
|
|
|
1580
1580
|
return;
|
|
1581
1581
|
done = true;
|
|
1582
1582
|
child.kill("SIGTERM");
|
|
1583
|
-
|
|
1583
|
+
resolve28("unauthenticated");
|
|
1584
1584
|
}, 5e3);
|
|
1585
1585
|
child.stdout?.on("data", (chunk) => {
|
|
1586
1586
|
stdout += chunk.toString();
|
|
@@ -1591,14 +1591,14 @@ async function checkAgentAuth(agent) {
|
|
|
1591
1591
|
done = true;
|
|
1592
1592
|
clearTimeout(timer);
|
|
1593
1593
|
if (code !== 0) {
|
|
1594
|
-
|
|
1594
|
+
resolve28("unauthenticated");
|
|
1595
1595
|
return;
|
|
1596
1596
|
}
|
|
1597
1597
|
try {
|
|
1598
1598
|
const status = JSON.parse(stdout);
|
|
1599
|
-
|
|
1599
|
+
resolve28(status.loggedIn ? "ok" : "unauthenticated");
|
|
1600
1600
|
} catch {
|
|
1601
|
-
|
|
1601
|
+
resolve28("unauthenticated");
|
|
1602
1602
|
}
|
|
1603
1603
|
});
|
|
1604
1604
|
});
|
|
@@ -1608,9 +1608,9 @@ async function binaryIsOnPath(binary) {
|
|
|
1608
1608
|
const fs = await import("node:fs/promises");
|
|
1609
1609
|
return fs.access(binary).then(() => true, () => false);
|
|
1610
1610
|
}
|
|
1611
|
-
return new Promise((
|
|
1611
|
+
return new Promise((resolve28) => {
|
|
1612
1612
|
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
1613
|
-
child.on("close", (code) =>
|
|
1613
|
+
child.on("close", (code) => resolve28(code === 0));
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
1616
|
var init_check_agent_auth = __esm({
|
|
@@ -3426,9 +3426,9 @@ async function resolveRelativeImport(specifier, fromDir) {
|
|
|
3426
3426
|
async function resolveImportSpecifiers(sourceText, fromDir) {
|
|
3427
3427
|
const resolvedPaths = [];
|
|
3428
3428
|
for (const specifier of extractRelativeImportPaths(sourceText)) {
|
|
3429
|
-
const
|
|
3430
|
-
if (
|
|
3431
|
-
resolvedPaths.push(
|
|
3429
|
+
const resolvedPath2 = await resolveRelativeImport(specifier, fromDir);
|
|
3430
|
+
if (resolvedPath2)
|
|
3431
|
+
resolvedPaths.push(resolvedPath2);
|
|
3432
3432
|
}
|
|
3433
3433
|
return resolvedPaths;
|
|
3434
3434
|
}
|
|
@@ -3442,20 +3442,20 @@ async function loadSiblingFiles(sourceText, sourcePath, propNames, candidateType
|
|
|
3442
3442
|
if (discovered.length >= MAX_SIBLING_CANDIDATES_EXPLORED)
|
|
3443
3443
|
break;
|
|
3444
3444
|
const resolvedPaths = await resolveImportSpecifiers(node.text, node.dir);
|
|
3445
|
-
for (const
|
|
3446
|
-
if (visited.has(
|
|
3445
|
+
for (const resolvedPath2 of resolvedPaths) {
|
|
3446
|
+
if (visited.has(resolvedPath2))
|
|
3447
3447
|
continue;
|
|
3448
|
-
visited.add(
|
|
3448
|
+
visited.add(resolvedPath2);
|
|
3449
3449
|
if (discovered.length >= MAX_SIBLING_CANDIDATES_EXPLORED)
|
|
3450
3450
|
break;
|
|
3451
3451
|
let content;
|
|
3452
3452
|
try {
|
|
3453
|
-
content = await readFile4(
|
|
3453
|
+
content = await readFile4(resolvedPath2, "utf8");
|
|
3454
3454
|
} catch {
|
|
3455
3455
|
continue;
|
|
3456
3456
|
}
|
|
3457
|
-
discovered.push({ path:
|
|
3458
|
-
nextFrontier.push({ text: content, dir: dirname3(
|
|
3457
|
+
discovered.push({ path: resolvedPath2, content });
|
|
3458
|
+
nextFrontier.push({ text: content, dir: dirname3(resolvedPath2) });
|
|
3459
3459
|
}
|
|
3460
3460
|
}
|
|
3461
3461
|
frontier = nextFrontier;
|
|
@@ -4709,11 +4709,11 @@ function isBareModuleSpecifier(moduleSpecifier) {
|
|
|
4709
4709
|
return !moduleSpecifier.startsWith(".") && !moduleSpecifier.startsWith("/");
|
|
4710
4710
|
}
|
|
4711
4711
|
function findRepoLocalAliasSourceFile(originSourceFile, moduleSpecifier) {
|
|
4712
|
-
const
|
|
4713
|
-
if (!
|
|
4712
|
+
const resolvedPath2 = resolveRepoLocalAliasImportPath(originSourceFile.getFilePath(), moduleSpecifier);
|
|
4713
|
+
if (!resolvedPath2)
|
|
4714
4714
|
return void 0;
|
|
4715
4715
|
const project = originSourceFile.getProject();
|
|
4716
|
-
return findProjectSourceFileByImportPath(project,
|
|
4716
|
+
return findProjectSourceFileByImportPath(project, resolvedPath2);
|
|
4717
4717
|
}
|
|
4718
4718
|
function resolveRepoLocalAliasImportPath(importingFilePath, moduleSpecifier) {
|
|
4719
4719
|
const nearestTsConfigPath = findNearestTsConfigPath(importingFilePath);
|
|
@@ -4728,8 +4728,8 @@ function resolveRepoLocalAliasImportPath(importingFilePath, moduleSpecifier) {
|
|
|
4728
4728
|
continue;
|
|
4729
4729
|
for (const targetPattern of targets) {
|
|
4730
4730
|
const substitutedTarget = substituteTsConfigPathTarget(targetPattern, match2.wildcard);
|
|
4731
|
-
const
|
|
4732
|
-
const sourceFilePath = resolveImportSourcePath(
|
|
4731
|
+
const resolvedPath2 = resolve6(tsConfigPaths.baseUrl, substitutedTarget);
|
|
4732
|
+
const sourceFilePath = resolveImportSourcePath(resolvedPath2);
|
|
4733
4733
|
if (sourceFilePath)
|
|
4734
4734
|
return sourceFilePath;
|
|
4735
4735
|
}
|
|
@@ -4807,17 +4807,17 @@ function resolveImportSourcePath(basePath) {
|
|
|
4807
4807
|
];
|
|
4808
4808
|
return candidates.find((candidatePath) => existsSync2(candidatePath));
|
|
4809
4809
|
}
|
|
4810
|
-
function findProjectSourceFileByImportPath(project,
|
|
4810
|
+
function findProjectSourceFileByImportPath(project, resolvedPath2) {
|
|
4811
4811
|
const candidatePaths = [
|
|
4812
|
-
|
|
4813
|
-
`${
|
|
4814
|
-
`${
|
|
4815
|
-
`${
|
|
4816
|
-
`${
|
|
4817
|
-
join3(
|
|
4818
|
-
join3(
|
|
4819
|
-
join3(
|
|
4820
|
-
join3(
|
|
4812
|
+
resolvedPath2,
|
|
4813
|
+
`${resolvedPath2}.ts`,
|
|
4814
|
+
`${resolvedPath2}.tsx`,
|
|
4815
|
+
`${resolvedPath2}.js`,
|
|
4816
|
+
`${resolvedPath2}.jsx`,
|
|
4817
|
+
join3(resolvedPath2, "index.ts"),
|
|
4818
|
+
join3(resolvedPath2, "index.tsx"),
|
|
4819
|
+
join3(resolvedPath2, "index.js"),
|
|
4820
|
+
join3(resolvedPath2, "index.jsx")
|
|
4821
4821
|
];
|
|
4822
4822
|
for (const candidatePath of candidatePaths) {
|
|
4823
4823
|
const sourceFile = project.getSourceFile(candidatePath);
|
|
@@ -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,
|
|
@@ -9422,11 +9422,11 @@ function getElementTagNameFromFastDefinition(classDecl, project) {
|
|
|
9422
9422
|
}
|
|
9423
9423
|
function resolveImportSourcePath2(fromFilePath, specifier) {
|
|
9424
9424
|
if (specifier.startsWith(".")) {
|
|
9425
|
-
const
|
|
9426
|
-
if (
|
|
9427
|
-
return `${
|
|
9425
|
+
const resolvedPath2 = resolve9(dirname7(fromFilePath), specifier);
|
|
9426
|
+
if (resolvedPath2.endsWith(".js")) {
|
|
9427
|
+
return `${resolvedPath2.slice(0, -3)}.ts`;
|
|
9428
9428
|
}
|
|
9429
|
-
return
|
|
9429
|
+
return resolvedPath2;
|
|
9430
9430
|
}
|
|
9431
9431
|
const spectrumPrefix = "@spectrum-web-components/core/components/";
|
|
9432
9432
|
if (!specifier.startsWith(spectrumPrefix)) {
|
|
@@ -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();
|
|
@@ -20284,15 +20349,15 @@ function PathValidationScreen({
|
|
|
20284
20349
|
onChangePath,
|
|
20285
20350
|
onBack
|
|
20286
20351
|
}) {
|
|
20287
|
-
const
|
|
20352
|
+
const resolvedPath2 = useMemo(() => resolveUserPath(projectPath), [projectPath]);
|
|
20288
20353
|
const [scan, setScan] = useState5();
|
|
20289
20354
|
useEffect3(() => {
|
|
20290
|
-
setScan(scanFiles(
|
|
20291
|
-
}, [
|
|
20355
|
+
setScan(scanFiles(resolvedPath2));
|
|
20356
|
+
}, [resolvedPath2]);
|
|
20292
20357
|
const phase = phaseOf(scan);
|
|
20293
20358
|
usePathValidationControls(phase, {
|
|
20294
20359
|
onConfirm: () => {
|
|
20295
|
-
if (scan?.ok) onConfirm({ projectPath:
|
|
20360
|
+
if (scan?.ok) onConfirm({ projectPath: resolvedPath2, filePaths: scan.filePaths });
|
|
20296
20361
|
},
|
|
20297
20362
|
onChangePath,
|
|
20298
20363
|
onBack
|
|
@@ -20300,11 +20365,11 @@ function PathValidationScreen({
|
|
|
20300
20365
|
return /* @__PURE__ */ jsxs5(Box5, { flexDirection: "column", gap: 1, paddingX: 2, paddingY: 1, children: [
|
|
20301
20366
|
scan === void 0 && /* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
|
|
20302
20367
|
"Scanning ",
|
|
20303
|
-
/* @__PURE__ */ jsx6(Text6, { bold: true, children:
|
|
20368
|
+
/* @__PURE__ */ jsx6(Text6, { bold: true, children: resolvedPath2 }),
|
|
20304
20369
|
"..."
|
|
20305
20370
|
] }),
|
|
20306
|
-
scan?.ok === false && /* @__PURE__ */ jsx6(Failure, { scan, path:
|
|
20307
|
-
scan?.ok === true && /* @__PURE__ */ jsx6(Summary, { scan, path:
|
|
20371
|
+
scan?.ok === false && /* @__PURE__ */ jsx6(Failure, { scan, path: resolvedPath2 }),
|
|
20372
|
+
scan?.ok === true && /* @__PURE__ */ jsx6(Summary, { scan, path: resolvedPath2 }),
|
|
20308
20373
|
/* @__PURE__ */ jsx6(Box5, { marginTop: 1, gap: 3, children: controlsFor(phase).map((control) => /* @__PURE__ */ jsxs5(Text6, { dimColor: true, children: [
|
|
20309
20374
|
"[",
|
|
20310
20375
|
control.keys,
|
|
@@ -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,167 +33107,304 @@ var init_PageContainer3 = __esm({
|
|
|
32996
33107
|
}
|
|
32997
33108
|
});
|
|
32998
33109
|
|
|
32999
|
-
// packages/experience-design-system-cli/src/tui/settings/
|
|
33000
|
-
|
|
33001
|
-
|
|
33002
|
-
|
|
33003
|
-
|
|
33004
|
-
environmentId: store.environmentId || "",
|
|
33005
|
-
cmaToken: store.cmaToken || "",
|
|
33006
|
-
host: store.host || "",
|
|
33007
|
-
defaultComponentDir: store.defaultComponentDir || "",
|
|
33008
|
-
defaultTokenFile: store.defaultTokenFile || "",
|
|
33009
|
-
contentfulBaseDir: store.contentfulBaseDir || ""
|
|
33010
|
-
};
|
|
33110
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts
|
|
33111
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
33112
|
+
import { access as access6, constants } from "node:fs/promises";
|
|
33113
|
+
function effectiveBinary(name, savedBinary) {
|
|
33114
|
+
return savedBinary.trim() || AGENT_BINARIES[name];
|
|
33011
33115
|
}
|
|
33012
|
-
|
|
33013
|
-
const
|
|
33014
|
-
|
|
33015
|
-
|
|
33016
|
-
|
|
33017
|
-
|
|
33018
|
-
|
|
33019
|
-
|
|
33116
|
+
function defaultModelLabel(name) {
|
|
33117
|
+
const model = DEFAULT_MODELS[name];
|
|
33118
|
+
return model && model !== "Auto" ? model : "chosen by the agent";
|
|
33119
|
+
}
|
|
33120
|
+
function resolveOnPath(binary) {
|
|
33121
|
+
if (binary.includes("/")) {
|
|
33122
|
+
return access6(binary, constants.X_OK).then(
|
|
33123
|
+
() => binary,
|
|
33124
|
+
() => null
|
|
33125
|
+
);
|
|
33126
|
+
}
|
|
33127
|
+
return new Promise((resolve28) => {
|
|
33128
|
+
execFile2(
|
|
33129
|
+
process.platform === "win32" ? "where" : "which",
|
|
33130
|
+
[binary],
|
|
33131
|
+
(error, stdout) => resolve28(error ? null : stdout.split("\n")[0]?.trim() ?? null)
|
|
33132
|
+
);
|
|
33020
33133
|
});
|
|
33021
|
-
await writeV1Store(merged);
|
|
33022
33134
|
}
|
|
33023
|
-
|
|
33024
|
-
|
|
33135
|
+
function readVersion(binary) {
|
|
33136
|
+
return new Promise((resolve28) => {
|
|
33137
|
+
execFile2(binary, ["--version"], { timeout: VERSION_TIMEOUT_MS }, (error, stdout) => {
|
|
33138
|
+
const line = stdout.split("\n")[0]?.trim() ?? "";
|
|
33139
|
+
if (!error && line) resolve28(pass("version", line));
|
|
33140
|
+
else resolve28(fail3("version", "runs, but did not report a version"));
|
|
33141
|
+
});
|
|
33142
|
+
});
|
|
33143
|
+
}
|
|
33144
|
+
async function inspectAgent(name, binary) {
|
|
33145
|
+
const target = effectiveBinary(name, binary);
|
|
33146
|
+
const found = await resolveOnPath(target);
|
|
33147
|
+
if (!found) return [fail3("path", `\`${target}\` was not found or is not executable`)];
|
|
33148
|
+
const checks = [pass("path", found)];
|
|
33149
|
+
checks.push(await readVersion(found));
|
|
33150
|
+
if (name === "claude") {
|
|
33151
|
+
const auth = await withBinaryEnv(name, found, () => checkAgentAuth(name));
|
|
33152
|
+
checks.push(
|
|
33153
|
+
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
33154
|
+
);
|
|
33155
|
+
}
|
|
33156
|
+
return checks;
|
|
33157
|
+
}
|
|
33158
|
+
async function testAgent(name, binary, model) {
|
|
33159
|
+
const checks = await inspectAgent(name, binary);
|
|
33160
|
+
if (!checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
33161
|
+
const target = effectiveBinary(name, binary);
|
|
33162
|
+
const found = await resolveOnPath(target) ?? target;
|
|
33163
|
+
const started = Date.now();
|
|
33164
|
+
const result = await withBinaryEnv(
|
|
33165
|
+
name,
|
|
33166
|
+
found,
|
|
33167
|
+
() => createLocalCliAgentInvoker().invoke({
|
|
33168
|
+
agent: name,
|
|
33169
|
+
...model.trim() ? { model: model.trim() } : {},
|
|
33170
|
+
prompt: TEST_PROMPT,
|
|
33171
|
+
timeoutMs: PROMPT_TIMEOUT_MS
|
|
33172
|
+
})
|
|
33173
|
+
);
|
|
33174
|
+
const seconds = ((Date.now() - started) / 1e3).toFixed(1);
|
|
33175
|
+
if (result.timedOut) return [...checks, fail3("prompt", `no answer within ${PROMPT_TIMEOUT_MS / 1e3}s`)];
|
|
33176
|
+
if (result.exitCode !== 0) {
|
|
33177
|
+
const reason = result.stderr.trim().split("\n").pop()?.slice(0, 160) || `exited with code ${result.exitCode}`;
|
|
33178
|
+
return [...checks, fail3("prompt", reason)];
|
|
33179
|
+
}
|
|
33180
|
+
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
33181
|
+
}
|
|
33182
|
+
function statusFromChecks(name, checks, savedBinary) {
|
|
33183
|
+
if (checks.length === 0) return "checking";
|
|
33184
|
+
if (checks.some((check) => check.step === "path" && !check.ok)) {
|
|
33185
|
+
return savedBinary.trim() ? "not-found" : "not-configured";
|
|
33186
|
+
}
|
|
33187
|
+
const login = checks.find((check) => check.step === "login");
|
|
33188
|
+
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
33189
|
+
const prompt = checks.find((check) => check.step === "prompt");
|
|
33190
|
+
if (prompt) return prompt.ok ? "ready" : "not-logged-in";
|
|
33191
|
+
return name === "claude" ? "ready" : "unknown";
|
|
33192
|
+
}
|
|
33193
|
+
function nextStepHint(name, status) {
|
|
33194
|
+
if (status === "not-configured") return `${INSTALL_HINTS[name]}, or set the command path below`;
|
|
33195
|
+
if (status === "not-found") return `${INSTALL_HINTS[name]}, or fix the command path`;
|
|
33196
|
+
if (status === "not-logged-in") return LOGIN_HINTS[name];
|
|
33197
|
+
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
33198
|
+
return "";
|
|
33199
|
+
}
|
|
33200
|
+
function resolvedPath(checks) {
|
|
33201
|
+
const path5 = checks?.find((check) => check.step === "path");
|
|
33202
|
+
return path5?.ok ? path5.detail : "";
|
|
33203
|
+
}
|
|
33204
|
+
function statusRows(_name, checks, savedBinary) {
|
|
33205
|
+
if (!checks) return [{ label: "Command", value: "checking...", tone: "muted" }];
|
|
33206
|
+
const find = (step) => checks.find((check) => check.step === step);
|
|
33207
|
+
const path5 = find("path");
|
|
33208
|
+
if (!path5?.ok) {
|
|
33209
|
+
if (savedBinary.trim()) return [{ label: "Command", value: path5?.detail ?? "not found", tone: "bad" }];
|
|
33210
|
+
return [{ label: "Command", value: "not configured (not on the PATH)", tone: "muted" }];
|
|
33211
|
+
}
|
|
33212
|
+
const rows = [{ label: "Command", value: path5.detail, tone: "ok" }];
|
|
33213
|
+
const version = find("version");
|
|
33214
|
+
if (version) {
|
|
33215
|
+
rows.push({
|
|
33216
|
+
label: "Version",
|
|
33217
|
+
value: version.ok ? version.detail : "could not be read",
|
|
33218
|
+
tone: version.ok ? "ok" : "muted"
|
|
33219
|
+
});
|
|
33220
|
+
}
|
|
33221
|
+
const login = find("login");
|
|
33222
|
+
const prompt = find("prompt");
|
|
33223
|
+
if (login) {
|
|
33224
|
+
rows.push({ label: "Login", value: login.detail, tone: login.ok ? "ok" : "bad" });
|
|
33225
|
+
} else if (prompt) {
|
|
33226
|
+
rows.push({
|
|
33227
|
+
label: "Login",
|
|
33228
|
+
value: prompt.ok ? "confirmed by the test" : "see the test result",
|
|
33229
|
+
tone: prompt.ok ? "ok" : "bad"
|
|
33230
|
+
});
|
|
33231
|
+
} else {
|
|
33232
|
+
rows.push({ label: "Login", value: "not checked (use Run test)", tone: "muted" });
|
|
33233
|
+
}
|
|
33234
|
+
if (prompt) rows.push({ label: "Test", value: prompt.detail, tone: prompt.ok ? "ok" : "bad" });
|
|
33235
|
+
return rows;
|
|
33236
|
+
}
|
|
33237
|
+
async function withBinaryEnv(name, binary, run) {
|
|
33238
|
+
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
33239
|
+
const previous = process.env[key];
|
|
33240
|
+
process.env[key] = binary;
|
|
33241
|
+
try {
|
|
33242
|
+
return await run();
|
|
33243
|
+
} finally {
|
|
33244
|
+
if (previous === void 0) delete process.env[key];
|
|
33245
|
+
else process.env[key] = previous;
|
|
33246
|
+
}
|
|
33247
|
+
}
|
|
33248
|
+
var VERSION_TIMEOUT_MS, PROMPT_TIMEOUT_MS, TEST_PROMPT, INSTALL_HINTS, LOGIN_HINTS, fail3, pass;
|
|
33249
|
+
var init_agent_status = __esm({
|
|
33250
|
+
"packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts"() {
|
|
33025
33251
|
"use strict";
|
|
33026
|
-
|
|
33252
|
+
init_src4();
|
|
33253
|
+
VERSION_TIMEOUT_MS = 5e3;
|
|
33254
|
+
PROMPT_TIMEOUT_MS = 6e4;
|
|
33255
|
+
TEST_PROMPT = "Reply with the single word: ok";
|
|
33256
|
+
INSTALL_HINTS = {
|
|
33257
|
+
claude: "npm install -g @anthropic-ai/claude-code",
|
|
33258
|
+
codex: "npm install -g @openai/codex",
|
|
33259
|
+
opencode: "npm install -g opencode-ai",
|
|
33260
|
+
cursor: "install Cursor\u2019s `cursor-agent` command",
|
|
33261
|
+
copilot: "npm install -g @github/copilot"
|
|
33262
|
+
};
|
|
33263
|
+
LOGIN_HINTS = {
|
|
33264
|
+
claude: "run `claude login`",
|
|
33265
|
+
codex: "set OPENAI_API_KEY, or sign in with a ChatGPT account",
|
|
33266
|
+
opencode: "run `opencode auth`",
|
|
33267
|
+
cursor: "sign in from Cursor",
|
|
33268
|
+
copilot: "run `copilot` and sign in"
|
|
33269
|
+
};
|
|
33270
|
+
fail3 = (step, detail) => ({ step, ok: false, detail });
|
|
33271
|
+
pass = (step, detail) => ({ step, ok: true, detail });
|
|
33027
33272
|
}
|
|
33028
33273
|
});
|
|
33029
33274
|
|
|
33030
|
-
// packages/experience-design-system-cli/src/tui/settings/
|
|
33275
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentDetail.tsx
|
|
33031
33276
|
import { useEffect as useEffect22, useState as useState29 } from "react";
|
|
33032
33277
|
import { Box as Box44, Text as Text46, useInput as useInput11 } from "ink";
|
|
33033
33278
|
import TextInput4 from "ink-text-input";
|
|
33034
33279
|
import { Fragment as Fragment17, jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
33035
|
-
function
|
|
33036
|
-
return {
|
|
33037
|
-
|
|
33038
|
-
|
|
33039
|
-
|
|
33040
|
-
host: config?.host ?? "",
|
|
33041
|
-
default_component_dir: config?.defaultComponentDir ?? "",
|
|
33042
|
-
default_token_file: config?.defaultTokenFile ?? "",
|
|
33043
|
-
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
33044
|
-
};
|
|
33280
|
+
function Section2({ title, children }) {
|
|
33281
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", marginTop: 1, children: [
|
|
33282
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, color: PALETTE.muted, children: title }),
|
|
33283
|
+
children
|
|
33284
|
+
] });
|
|
33045
33285
|
}
|
|
33046
|
-
function
|
|
33047
|
-
|
|
33048
|
-
|
|
33049
|
-
|
|
33050
|
-
|
|
33051
|
-
|
|
33286
|
+
function AgentDetail({
|
|
33287
|
+
name,
|
|
33288
|
+
config,
|
|
33289
|
+
setConfig,
|
|
33290
|
+
onBack
|
|
33291
|
+
}) {
|
|
33292
|
+
const settings = config.agents[name];
|
|
33293
|
+
const [focusIndex, setFocusIndex] = useState29(0);
|
|
33052
33294
|
const [editing, setEditing] = useState29(false);
|
|
33053
33295
|
const [valueBeforeEdit, setValueBeforeEdit] = useState29("");
|
|
33296
|
+
const [saving, setSaving] = useState29(false);
|
|
33297
|
+
const [testing, setTesting] = useState29(false);
|
|
33298
|
+
const [notice, setNotice] = useState29(null);
|
|
33299
|
+
const [checks, setChecks] = useState29(void 0);
|
|
33054
33300
|
useEffect22(() => {
|
|
33055
|
-
|
|
33056
|
-
|
|
33057
|
-
|
|
33058
|
-
|
|
33059
|
-
|
|
33060
|
-
|
|
33061
|
-
|
|
33062
|
-
|
|
33063
|
-
|
|
33064
|
-
});
|
|
33065
|
-
}, []);
|
|
33066
|
-
function fieldValue(field) {
|
|
33067
|
-
if (!config) return "";
|
|
33068
|
-
return config[field] || "";
|
|
33069
|
-
}
|
|
33070
|
-
function setFieldValue(field, value) {
|
|
33071
|
-
if (!config) return;
|
|
33072
|
-
setConfig({ ...config, [field]: value });
|
|
33301
|
+
let active = true;
|
|
33302
|
+
setChecks(void 0);
|
|
33303
|
+
void inspectAgent(name, settings.binary).then((result) => active && setChecks(result));
|
|
33304
|
+
return () => {
|
|
33305
|
+
active = false;
|
|
33306
|
+
};
|
|
33307
|
+
}, [name, settings.binary]);
|
|
33308
|
+
const setField = (field, value) => {
|
|
33309
|
+
setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [field]: value } } });
|
|
33073
33310
|
setNotice(null);
|
|
33074
|
-
}
|
|
33075
|
-
|
|
33076
|
-
|
|
33077
|
-
setStage("saving");
|
|
33311
|
+
};
|
|
33312
|
+
const save = () => {
|
|
33313
|
+
setSaving(true);
|
|
33078
33314
|
setNotice(null);
|
|
33079
|
-
|
|
33080
|
-
|
|
33081
|
-
|
|
33082
|
-
|
|
33083
|
-
|
|
33084
|
-
|
|
33085
|
-
|
|
33086
|
-
|
|
33087
|
-
|
|
33088
|
-
|
|
33089
|
-
|
|
33090
|
-
|
|
33091
|
-
|
|
33092
|
-
);
|
|
33093
|
-
|
|
33094
|
-
|
|
33315
|
+
writeAgentConfig(config).then(() => {
|
|
33316
|
+
applyBinaryOverrides(config);
|
|
33317
|
+
setNotice({ kind: "success", text: `${AGENT_LABELS[name]} settings saved` });
|
|
33318
|
+
}).catch(
|
|
33319
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
33320
|
+
).finally(() => setSaving(false));
|
|
33321
|
+
};
|
|
33322
|
+
const runTest = () => {
|
|
33323
|
+
setTesting(true);
|
|
33324
|
+
setNotice(null);
|
|
33325
|
+
setChecks(void 0);
|
|
33326
|
+
testAgent(name, settings.binary, settings.model).then(setChecks).catch(
|
|
33327
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "The test could not run" })
|
|
33328
|
+
).finally(() => setTesting(false));
|
|
33329
|
+
};
|
|
33330
|
+
const focused = FOCUS_ORDER[focusIndex];
|
|
33331
|
+
const focusedField = focused === "test" ? null : focused;
|
|
33095
33332
|
useInput11((input, key) => {
|
|
33096
|
-
if (
|
|
33333
|
+
if (saving || testing) return;
|
|
33097
33334
|
if (editing) {
|
|
33098
|
-
if (key.escape) {
|
|
33099
|
-
|
|
33335
|
+
if (key.escape && focusedField) {
|
|
33336
|
+
setField(focusedField, valueBeforeEdit);
|
|
33100
33337
|
setEditing(false);
|
|
33101
33338
|
}
|
|
33102
33339
|
return;
|
|
33103
33340
|
}
|
|
33104
33341
|
if (key.escape || input === "q") {
|
|
33105
|
-
|
|
33342
|
+
onBack();
|
|
33106
33343
|
return;
|
|
33107
33344
|
}
|
|
33108
33345
|
if (input === "s") {
|
|
33109
|
-
|
|
33346
|
+
save();
|
|
33110
33347
|
return;
|
|
33111
33348
|
}
|
|
33112
|
-
if (
|
|
33113
|
-
|
|
33349
|
+
if (key.upArrow) {
|
|
33350
|
+
setFocusIndex((i) => (i - 1 + FOCUS_ORDER.length) % FOCUS_ORDER.length);
|
|
33114
33351
|
return;
|
|
33115
33352
|
}
|
|
33116
|
-
if (key.
|
|
33117
|
-
|
|
33118
|
-
setActiveField(FIELD_ORDER[(idx + 1) % FIELD_ORDER.length]);
|
|
33353
|
+
if (key.downArrow || key.tab) {
|
|
33354
|
+
setFocusIndex((i) => (i + 1) % FOCUS_ORDER.length);
|
|
33119
33355
|
return;
|
|
33120
33356
|
}
|
|
33121
|
-
if (
|
|
33122
|
-
|
|
33123
|
-
setActiveField(FIELD_ORDER[(idx - 1 + FIELD_ORDER.length) % FIELD_ORDER.length]);
|
|
33357
|
+
if (input === "c" && focusedField) {
|
|
33358
|
+
setField(focusedField, "");
|
|
33124
33359
|
return;
|
|
33125
33360
|
}
|
|
33126
33361
|
if (key.return) {
|
|
33127
|
-
|
|
33128
|
-
|
|
33362
|
+
if (focusedField) {
|
|
33363
|
+
setValueBeforeEdit(settings[focusedField]);
|
|
33364
|
+
setEditing(true);
|
|
33365
|
+
} else {
|
|
33366
|
+
runTest();
|
|
33367
|
+
}
|
|
33129
33368
|
}
|
|
33130
33369
|
});
|
|
33131
|
-
|
|
33132
|
-
|
|
33133
|
-
|
|
33134
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33135
|
-
/* @__PURE__ */ jsx55(Text46, { color: PALETTE.accent, children: "Loading..." })
|
|
33136
|
-
] });
|
|
33137
|
-
}
|
|
33370
|
+
const status = checks ? statusFromChecks(name, checks, settings.binary) : "checking";
|
|
33371
|
+
const hint = nextStepHint(name, status);
|
|
33372
|
+
const pointer = (isFocused) => /* @__PURE__ */ jsx55(Text46, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
33138
33373
|
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33139
|
-
/* @__PURE__ */ jsx55(Text46, { bold: true, children:
|
|
33140
|
-
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33141
|
-
/* @__PURE__ */
|
|
33142
|
-
|
|
33143
|
-
|
|
33144
|
-
|
|
33374
|
+
/* @__PURE__ */ jsx55(Text46, { bold: true, children: AGENT_LABELS[name] }),
|
|
33375
|
+
/* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: config.defaultAgent === name ? "This is the default agent." : `Runs the \`${AGENT_HINTS[name]}\` command.` }),
|
|
33376
|
+
/* @__PURE__ */ jsxs45(Section2, { title: "STATUS", children: [
|
|
33377
|
+
statusRows(name, checks, settings.binary).map((row) => /* @__PURE__ */ jsxs45(Box44, { gap: 1, paddingLeft: 2, children: [
|
|
33378
|
+
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: row.label }) }),
|
|
33379
|
+
/* @__PURE__ */ jsx55(Text46, { color: TONE_COLOR[row.tone], children: row.value })
|
|
33380
|
+
] }, row.label)),
|
|
33381
|
+
hint && /* @__PURE__ */ jsx55(Box44, { paddingLeft: 2, children: /* @__PURE__ */ jsxs45(Text46, { color: PALETTE.muted, children: [
|
|
33382
|
+
"Next: ",
|
|
33383
|
+
hint
|
|
33384
|
+
] }) })
|
|
33385
|
+
] }),
|
|
33386
|
+
/* @__PURE__ */ jsx55(Section2, { title: "SETTINGS", children: FIELDS2.map((field) => {
|
|
33387
|
+
const isFocused = focused === field;
|
|
33388
|
+
const value = settings[field];
|
|
33145
33389
|
return /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33146
|
-
|
|
33147
|
-
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold:
|
|
33148
|
-
|
|
33390
|
+
pointer(isFocused),
|
|
33391
|
+
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: FIELD_LABEL[field] }) }),
|
|
33392
|
+
isFocused && editing ? /* @__PURE__ */ jsx55(
|
|
33149
33393
|
TextInput4,
|
|
33150
33394
|
{
|
|
33151
33395
|
value,
|
|
33152
|
-
onChange: (next) =>
|
|
33153
|
-
onSubmit: () => setEditing(false)
|
|
33154
|
-
mask: field === "cmaToken" ? "\u2022" : void 0
|
|
33396
|
+
onChange: (next) => setField(field, next),
|
|
33397
|
+
onSubmit: () => setEditing(false)
|
|
33155
33398
|
}
|
|
33156
|
-
) : /* @__PURE__ */ jsx55(Text46, { bold:
|
|
33157
|
-
|
|
33399
|
+
) : /* @__PURE__ */ jsx55(Text46, { bold: true, children: value }),
|
|
33400
|
+
!value && /* @__PURE__ */ jsx55(Text46, { color: PALETTE.muted, children: fieldHint(name, field) })
|
|
33158
33401
|
] }, field);
|
|
33159
33402
|
}) }),
|
|
33403
|
+
/* @__PURE__ */ jsx55(Section2, { title: "ACTIONS", children: /* @__PURE__ */ jsxs45(Box44, { gap: 1, children: [
|
|
33404
|
+
pointer(focused === "test"),
|
|
33405
|
+
/* @__PURE__ */ jsx55(Box44, { width: LABEL_WIDTH, flexShrink: 0, children: /* @__PURE__ */ jsx55(Text46, { bold: focused === "test", color: focused === "test" ? PALETTE.accent : PALETTE.muted, children: "Run test" }) }),
|
|
33406
|
+
/* @__PURE__ */ jsx55(Text46, { color: testing ? PALETTE.accent : PALETTE.muted, children: testing ? "running..." : "sends one small prompt (uses a few tokens)" })
|
|
33407
|
+
] }) }),
|
|
33160
33408
|
notice && /* @__PURE__ */ jsxs45(Fragment17, { children: [
|
|
33161
33409
|
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33162
33410
|
/* @__PURE__ */ jsxs45(Text46, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
@@ -33167,6 +33415,329 @@ function ConfigurationScreen({ onDone }) {
|
|
|
33167
33415
|
] }),
|
|
33168
33416
|
/* @__PURE__ */ jsx55(Text46, { children: " " }),
|
|
33169
33417
|
/* @__PURE__ */ jsx55(
|
|
33418
|
+
ControlHints,
|
|
33419
|
+
{
|
|
33420
|
+
hints: editing ? [
|
|
33421
|
+
{ keys: "type", label: "edit" },
|
|
33422
|
+
{ keys: "\u2190/\u2192", label: "move cursor" },
|
|
33423
|
+
{ keys: "\u23CE", label: "done" },
|
|
33424
|
+
{ keys: "Esc", label: "cancel edit" }
|
|
33425
|
+
] : [
|
|
33426
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
33427
|
+
{ keys: "\u23CE", label: focusedField ? "edit" : "run test" },
|
|
33428
|
+
...focusedField ? [{ keys: "c", label: "clear" }] : [],
|
|
33429
|
+
{ keys: "s", label: "save" },
|
|
33430
|
+
{ keys: "Esc/q", label: "back without saving" }
|
|
33431
|
+
]
|
|
33432
|
+
}
|
|
33433
|
+
)
|
|
33434
|
+
] });
|
|
33435
|
+
}
|
|
33436
|
+
var FOCUS_ORDER, FIELDS2, FIELD_LABEL, LABEL_WIDTH, TONE_COLOR, fieldHint;
|
|
33437
|
+
var init_AgentDetail = __esm({
|
|
33438
|
+
"packages/experience-design-system-cli/src/tui/settings/agents/AgentDetail.tsx"() {
|
|
33439
|
+
"use strict";
|
|
33440
|
+
init_home_theme();
|
|
33441
|
+
init_control_hints();
|
|
33442
|
+
init_agent_store();
|
|
33443
|
+
init_agent_status();
|
|
33444
|
+
init_apply_binary_overrides();
|
|
33445
|
+
FOCUS_ORDER = ["binary", "model", "test"];
|
|
33446
|
+
FIELDS2 = ["binary", "model"];
|
|
33447
|
+
FIELD_LABEL = { binary: "Command path", model: "Model" };
|
|
33448
|
+
LABEL_WIDTH = "Command path".length;
|
|
33449
|
+
TONE_COLOR = {
|
|
33450
|
+
ok: PALETTE.success,
|
|
33451
|
+
bad: PALETTE.error,
|
|
33452
|
+
muted: PALETTE.muted
|
|
33453
|
+
};
|
|
33454
|
+
fieldHint = (name, field) => field === "binary" ? `(empty: \`${AGENT_HINTS[name]}\` from the PATH)` : `(empty: ${defaultModelLabel(name)})`;
|
|
33455
|
+
}
|
|
33456
|
+
});
|
|
33457
|
+
|
|
33458
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusBadge.tsx
|
|
33459
|
+
import { Text as Text47 } from "ink";
|
|
33460
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
33461
|
+
function AgentStatusBadge({
|
|
33462
|
+
name,
|
|
33463
|
+
checks,
|
|
33464
|
+
binary
|
|
33465
|
+
}) {
|
|
33466
|
+
const status = checks ? statusFromChecks(name, checks, binary) : "checking";
|
|
33467
|
+
return /* @__PURE__ */ jsx56(Text47, { color: STATUS_COLOR[status], children: STATUS_TEXT[status] });
|
|
33468
|
+
}
|
|
33469
|
+
var STATUS_TEXT, STATUS_COLOR;
|
|
33470
|
+
var init_AgentStatusBadge = __esm({
|
|
33471
|
+
"packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusBadge.tsx"() {
|
|
33472
|
+
"use strict";
|
|
33473
|
+
init_home_theme();
|
|
33474
|
+
init_agent_status();
|
|
33475
|
+
STATUS_TEXT = {
|
|
33476
|
+
checking: "checking...",
|
|
33477
|
+
ready: "ready",
|
|
33478
|
+
"not-configured": "not configured",
|
|
33479
|
+
"not-found": "not found",
|
|
33480
|
+
"not-logged-in": "not logged in",
|
|
33481
|
+
unknown: "found, login not checked"
|
|
33482
|
+
};
|
|
33483
|
+
STATUS_COLOR = {
|
|
33484
|
+
checking: PALETTE.muted,
|
|
33485
|
+
ready: PALETTE.success,
|
|
33486
|
+
"not-configured": PALETTE.muted,
|
|
33487
|
+
"not-found": PALETTE.error,
|
|
33488
|
+
"not-logged-in": PALETTE.error,
|
|
33489
|
+
unknown: PALETTE.muted
|
|
33490
|
+
};
|
|
33491
|
+
}
|
|
33492
|
+
});
|
|
33493
|
+
|
|
33494
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
33495
|
+
import { useEffect as useEffect23, useState as useState30 } from "react";
|
|
33496
|
+
import { Box as Box45, Text as Text48, useInput as useInput12 } from "ink";
|
|
33497
|
+
import { Fragment as Fragment18, jsx as jsx57, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
33498
|
+
function AgentsScreen({ onDone }) {
|
|
33499
|
+
const [config, setConfig] = useState30(null);
|
|
33500
|
+
const [focus, setFocus] = useState30(0);
|
|
33501
|
+
const [open, setOpen] = useState30(null);
|
|
33502
|
+
const [notice, setNotice] = useState30(null);
|
|
33503
|
+
const [checks, setChecks] = useState30({});
|
|
33504
|
+
const inspectAll = (loaded) => {
|
|
33505
|
+
for (const name of AGENT_NAMES) {
|
|
33506
|
+
void inspectAgent(name, loaded.agents[name].binary).then(
|
|
33507
|
+
(result) => setChecks((previous) => ({ ...previous, [name]: result }))
|
|
33508
|
+
);
|
|
33509
|
+
}
|
|
33510
|
+
};
|
|
33511
|
+
useEffect23(() => {
|
|
33512
|
+
void readAgentConfig().then((loaded) => {
|
|
33513
|
+
setConfig(loaded);
|
|
33514
|
+
inspectAll(loaded);
|
|
33515
|
+
startDebugRun({
|
|
33516
|
+
flow: "settings/agents",
|
|
33517
|
+
step: "01-agents",
|
|
33518
|
+
menuOption: "Configuration > Agents",
|
|
33519
|
+
inputs: { default_agent: loaded.defaultAgent }
|
|
33520
|
+
});
|
|
33521
|
+
});
|
|
33522
|
+
}, []);
|
|
33523
|
+
const cycleDefault = (step) => {
|
|
33524
|
+
if (!config) return;
|
|
33525
|
+
const index = AGENT_NAMES.indexOf(config.defaultAgent);
|
|
33526
|
+
const next = { ...config, defaultAgent: AGENT_NAMES[(index + step + AGENT_NAMES.length) % AGENT_NAMES.length] };
|
|
33527
|
+
setConfig(next);
|
|
33528
|
+
writeAgentConfig(next).then(() => setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[next.defaultAgent]}` })).catch(
|
|
33529
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
33530
|
+
);
|
|
33531
|
+
};
|
|
33532
|
+
useInput12((input, key) => {
|
|
33533
|
+
if (!config || open) return;
|
|
33534
|
+
const row = ROWS[focus];
|
|
33535
|
+
if (key.upArrow) {
|
|
33536
|
+
setFocus((i) => (i - 1 + ROWS.length) % ROWS.length);
|
|
33537
|
+
return;
|
|
33538
|
+
}
|
|
33539
|
+
if (key.downArrow || key.tab) {
|
|
33540
|
+
setFocus((i) => (i + 1) % ROWS.length);
|
|
33541
|
+
return;
|
|
33542
|
+
}
|
|
33543
|
+
if (row.kind === "default" && key.leftArrow) {
|
|
33544
|
+
cycleDefault(-1);
|
|
33545
|
+
return;
|
|
33546
|
+
}
|
|
33547
|
+
if (row.kind === "default" && key.rightArrow) {
|
|
33548
|
+
cycleDefault(1);
|
|
33549
|
+
return;
|
|
33550
|
+
}
|
|
33551
|
+
if (key.return) {
|
|
33552
|
+
if (row.kind === "default") cycleDefault(1);
|
|
33553
|
+
else setOpen(row.name);
|
|
33554
|
+
return;
|
|
33555
|
+
}
|
|
33556
|
+
if (key.escape || input === "q") {
|
|
33557
|
+
void finishDebugRun({ outputs: { default_agent: config.defaultAgent }, status: "success", exitMethod: "saved" });
|
|
33558
|
+
onDone();
|
|
33559
|
+
}
|
|
33560
|
+
});
|
|
33561
|
+
if (!config) {
|
|
33562
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33563
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
33564
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33565
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "Loading..." })
|
|
33566
|
+
] });
|
|
33567
|
+
}
|
|
33568
|
+
if (open) {
|
|
33569
|
+
return /* @__PURE__ */ jsx57(
|
|
33570
|
+
AgentDetail,
|
|
33571
|
+
{
|
|
33572
|
+
name: open,
|
|
33573
|
+
config,
|
|
33574
|
+
setConfig,
|
|
33575
|
+
onBack: () => {
|
|
33576
|
+
setOpen(null);
|
|
33577
|
+
void readAgentConfig().then((saved) => {
|
|
33578
|
+
setConfig(saved);
|
|
33579
|
+
inspectAll(saved);
|
|
33580
|
+
});
|
|
33581
|
+
}
|
|
33582
|
+
}
|
|
33583
|
+
);
|
|
33584
|
+
}
|
|
33585
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33586
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
33587
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "The coding agent the CLI runs, and what was found for each one." }),
|
|
33588
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33589
|
+
ROWS.map((row, index) => {
|
|
33590
|
+
const isFocused = index === focus;
|
|
33591
|
+
const pointer = /* @__PURE__ */ jsx57(Text48, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
33592
|
+
if (row.kind === "default") {
|
|
33593
|
+
return /* @__PURE__ */ jsx57(Box45, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
33594
|
+
pointer,
|
|
33595
|
+
/* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: "Default agent" }),
|
|
33596
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: `\u2039 ${AGENT_LABELS[config.defaultAgent]} \u203A` })
|
|
33597
|
+
] }) }, "default");
|
|
33598
|
+
}
|
|
33599
|
+
const saved = config.agents[row.name].binary;
|
|
33600
|
+
return /* @__PURE__ */ jsxs46(Box45, { gap: 1, children: [
|
|
33601
|
+
pointer,
|
|
33602
|
+
/* @__PURE__ */ jsx57(Box45, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[row.name] }) }),
|
|
33603
|
+
/* @__PURE__ */ jsx57(Box45, { width: 26, flexShrink: 0, children: /* @__PURE__ */ jsx57(AgentStatusBadge, { name: row.name, checks: checks[row.name], binary: saved }) }),
|
|
33604
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: shortenPath(resolvedPath(checks[row.name]) || saved) }),
|
|
33605
|
+
row.name === config.defaultAgent && /* @__PURE__ */ jsx57(Text48, { color: PALETTE.success, children: "(default)" })
|
|
33606
|
+
] }, row.name);
|
|
33607
|
+
}),
|
|
33608
|
+
notice && /* @__PURE__ */ jsxs46(Fragment18, { children: [
|
|
33609
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33610
|
+
/* @__PURE__ */ jsxs46(Text48, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33611
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33612
|
+
" ",
|
|
33613
|
+
notice.text
|
|
33614
|
+
] })
|
|
33615
|
+
] }),
|
|
33616
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
33617
|
+
/* @__PURE__ */ jsx57(
|
|
33618
|
+
ControlHints,
|
|
33619
|
+
{
|
|
33620
|
+
hints: ROWS[focus].kind === "default" ? [
|
|
33621
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
33622
|
+
{ keys: "\u2190/\u2192", label: "change default agent" },
|
|
33623
|
+
{ keys: "Esc/q", label: "back" }
|
|
33624
|
+
] : [
|
|
33625
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
33626
|
+
{ keys: "\u23CE", label: "open" },
|
|
33627
|
+
{ keys: "Esc/q", label: "back" }
|
|
33628
|
+
]
|
|
33629
|
+
}
|
|
33630
|
+
)
|
|
33631
|
+
] });
|
|
33632
|
+
}
|
|
33633
|
+
var ROWS, MAX_PATH_WIDTH, shortenPath;
|
|
33634
|
+
var init_AgentScreens = __esm({
|
|
33635
|
+
"packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx"() {
|
|
33636
|
+
"use strict";
|
|
33637
|
+
init_src4();
|
|
33638
|
+
init_home_theme();
|
|
33639
|
+
init_control_hints();
|
|
33640
|
+
init_debug_store();
|
|
33641
|
+
init_agent_store();
|
|
33642
|
+
init_agent_status();
|
|
33643
|
+
init_AgentDetail();
|
|
33644
|
+
init_AgentStatusBadge();
|
|
33645
|
+
ROWS = [{ kind: "default" }, ...AGENT_NAMES.map((name) => ({ kind: "agent", name }))];
|
|
33646
|
+
MAX_PATH_WIDTH = 44;
|
|
33647
|
+
shortenPath = (path5) => path5.length > MAX_PATH_WIDTH ? `\u2026${path5.slice(-(MAX_PATH_WIDTH - 1))}` : path5;
|
|
33648
|
+
}
|
|
33649
|
+
});
|
|
33650
|
+
|
|
33651
|
+
// packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx
|
|
33652
|
+
import { useState as useState31 } from "react";
|
|
33653
|
+
import { Box as Box46, Text as Text49, useInput as useInput13 } from "ink";
|
|
33654
|
+
import TextInput5 from "ink-text-input";
|
|
33655
|
+
import { Fragment as Fragment19, jsx as jsx58, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
33656
|
+
function FieldForm({
|
|
33657
|
+
title,
|
|
33658
|
+
subtitle,
|
|
33659
|
+
fields,
|
|
33660
|
+
values,
|
|
33661
|
+
onChange,
|
|
33662
|
+
onSave,
|
|
33663
|
+
onQuit,
|
|
33664
|
+
notice,
|
|
33665
|
+
busy = false,
|
|
33666
|
+
footer
|
|
33667
|
+
}) {
|
|
33668
|
+
const [active, setActive] = useState31(0);
|
|
33669
|
+
const [editing, setEditing] = useState31(false);
|
|
33670
|
+
const [valueBeforeEdit, setValueBeforeEdit] = useState31("");
|
|
33671
|
+
const labelWidth = Math.max(...fields.map((field) => field.label.length));
|
|
33672
|
+
const current = fields[active];
|
|
33673
|
+
useInput13((input, key) => {
|
|
33674
|
+
if (busy) return;
|
|
33675
|
+
if (editing) {
|
|
33676
|
+
if (key.escape) {
|
|
33677
|
+
onChange(current.key, valueBeforeEdit);
|
|
33678
|
+
setEditing(false);
|
|
33679
|
+
}
|
|
33680
|
+
return;
|
|
33681
|
+
}
|
|
33682
|
+
if (key.escape || input === "q") {
|
|
33683
|
+
onQuit();
|
|
33684
|
+
return;
|
|
33685
|
+
}
|
|
33686
|
+
if (input === "s") {
|
|
33687
|
+
onSave();
|
|
33688
|
+
return;
|
|
33689
|
+
}
|
|
33690
|
+
if (input === "c") {
|
|
33691
|
+
onChange(current.key, "");
|
|
33692
|
+
return;
|
|
33693
|
+
}
|
|
33694
|
+
if (key.tab || key.downArrow) {
|
|
33695
|
+
setActive((i) => (i + 1) % fields.length);
|
|
33696
|
+
return;
|
|
33697
|
+
}
|
|
33698
|
+
if (key.upArrow) {
|
|
33699
|
+
setActive((i) => (i - 1 + fields.length) % fields.length);
|
|
33700
|
+
return;
|
|
33701
|
+
}
|
|
33702
|
+
if (key.return) {
|
|
33703
|
+
setValueBeforeEdit(values[current.key]);
|
|
33704
|
+
setEditing(true);
|
|
33705
|
+
}
|
|
33706
|
+
});
|
|
33707
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33708
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, children: title }),
|
|
33709
|
+
subtitle && /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: subtitle }),
|
|
33710
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33711
|
+
/* @__PURE__ */ jsx58(Box46, { flexDirection: "column", children: fields.map((field, index) => {
|
|
33712
|
+
const isActive = index === active;
|
|
33713
|
+
const value = values[field.key];
|
|
33714
|
+
const display = field.masked ? "\u2022".repeat(value.length) : value;
|
|
33715
|
+
return /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
33716
|
+
/* @__PURE__ */ jsx58(Text49, { color: isActive ? PALETTE.accent : void 0, children: isActive ? "\u276F" : " " }),
|
|
33717
|
+
/* @__PURE__ */ jsx58(Box46, { width: labelWidth, flexShrink: 0, children: /* @__PURE__ */ jsx58(Text49, { bold: isActive, color: isActive ? PALETTE.accent : PALETTE.muted, children: field.label }) }),
|
|
33718
|
+
isActive && editing ? /* @__PURE__ */ jsx58(
|
|
33719
|
+
TextInput5,
|
|
33720
|
+
{
|
|
33721
|
+
value,
|
|
33722
|
+
onChange: (next) => onChange(field.key, next),
|
|
33723
|
+
onSubmit: () => setEditing(false),
|
|
33724
|
+
mask: field.masked ? "\u2022" : void 0
|
|
33725
|
+
}
|
|
33726
|
+
) : /* @__PURE__ */ jsx58(Text49, { bold: !!display, children: display || (field.hint ? "" : /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: "(empty)" })) }),
|
|
33727
|
+
field.hint && /* @__PURE__ */ jsx58(Text49, { color: PALETTE.muted, children: field.hint })
|
|
33728
|
+
] }, field.key);
|
|
33729
|
+
}) }),
|
|
33730
|
+
notice && /* @__PURE__ */ jsxs47(Fragment19, { children: [
|
|
33731
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33732
|
+
/* @__PURE__ */ jsxs47(Text49, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
33733
|
+
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
33734
|
+
" ",
|
|
33735
|
+
notice.text
|
|
33736
|
+
] })
|
|
33737
|
+
] }),
|
|
33738
|
+
footer,
|
|
33739
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33740
|
+
/* @__PURE__ */ jsx58(
|
|
33170
33741
|
ControlHints,
|
|
33171
33742
|
{
|
|
33172
33743
|
hints: editing ? [
|
|
@@ -33179,53 +33750,219 @@ function ConfigurationScreen({ onDone }) {
|
|
|
33179
33750
|
{ keys: "\u23CE", label: "edit" },
|
|
33180
33751
|
{ keys: "c", label: "clear" },
|
|
33181
33752
|
{ keys: "s", label: "save" },
|
|
33182
|
-
{ keys: "Esc/q", label: "
|
|
33753
|
+
{ keys: "Esc/q", label: "back without saving" }
|
|
33754
|
+
]
|
|
33755
|
+
}
|
|
33756
|
+
)
|
|
33757
|
+
] });
|
|
33758
|
+
}
|
|
33759
|
+
var init_FieldForm = __esm({
|
|
33760
|
+
"packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx"() {
|
|
33761
|
+
"use strict";
|
|
33762
|
+
init_home_theme();
|
|
33763
|
+
init_control_hints();
|
|
33764
|
+
}
|
|
33765
|
+
});
|
|
33766
|
+
|
|
33767
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
33768
|
+
async function readCredentials() {
|
|
33769
|
+
const store = await readV1Store();
|
|
33770
|
+
return {
|
|
33771
|
+
spaceId: store.spaceId || "",
|
|
33772
|
+
environmentId: store.environmentId || "",
|
|
33773
|
+
cmaToken: store.cmaToken || "",
|
|
33774
|
+
host: store.host || "",
|
|
33775
|
+
defaultComponentDir: store.defaultComponentDir || "",
|
|
33776
|
+
defaultTokenFile: store.defaultTokenFile || "",
|
|
33777
|
+
contentfulBaseDir: store.contentfulBaseDir || ""
|
|
33778
|
+
};
|
|
33779
|
+
}
|
|
33780
|
+
async function writeCredentials(config) {
|
|
33781
|
+
const existing = await readV1Store();
|
|
33782
|
+
const merged = {
|
|
33783
|
+
...existing,
|
|
33784
|
+
...config
|
|
33785
|
+
};
|
|
33786
|
+
Object.keys(merged).forEach((k) => {
|
|
33787
|
+
if (!merged[k]) delete merged[k];
|
|
33788
|
+
});
|
|
33789
|
+
await writeV1Store(merged);
|
|
33790
|
+
}
|
|
33791
|
+
var init_config_store = __esm({
|
|
33792
|
+
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts"() {
|
|
33793
|
+
"use strict";
|
|
33794
|
+
init_v1_store();
|
|
33795
|
+
}
|
|
33796
|
+
});
|
|
33797
|
+
|
|
33798
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
33799
|
+
import { useEffect as useEffect24, useState as useState32 } from "react";
|
|
33800
|
+
import { Box as Box47, Text as Text50 } from "ink";
|
|
33801
|
+
import { jsx as jsx59, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
33802
|
+
function debugFields(config) {
|
|
33803
|
+
return {
|
|
33804
|
+
space_id: config?.spaceId ?? "",
|
|
33805
|
+
environment_id: config?.environmentId ?? "",
|
|
33806
|
+
cma_token: config?.cmaToken ?? "",
|
|
33807
|
+
host: config?.host ?? "",
|
|
33808
|
+
default_component_dir: config?.defaultComponentDir ?? "",
|
|
33809
|
+
default_token_file: config?.defaultTokenFile ?? "",
|
|
33810
|
+
contentful_base_dir: config?.contentfulBaseDir ?? ""
|
|
33811
|
+
};
|
|
33812
|
+
}
|
|
33813
|
+
function ProjectConfigScreen({ onDone }) {
|
|
33814
|
+
const [config, setConfig] = useState32(null);
|
|
33815
|
+
const [saving, setSaving] = useState32(false);
|
|
33816
|
+
const [notice, setNotice] = useState32(null);
|
|
33817
|
+
const [lastSaved, setLastSaved] = useState32(null);
|
|
33818
|
+
useEffect24(() => {
|
|
33819
|
+
void readCredentials().then((cfg) => {
|
|
33820
|
+
setConfig(cfg);
|
|
33821
|
+
startDebugRun({
|
|
33822
|
+
flow: "settings/contentful-configuration",
|
|
33823
|
+
step: "01-configuration",
|
|
33824
|
+
menuOption: "Configuration > Project",
|
|
33825
|
+
inputs: debugFields(cfg)
|
|
33826
|
+
});
|
|
33827
|
+
});
|
|
33828
|
+
}, []);
|
|
33829
|
+
if (!config) {
|
|
33830
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33831
|
+
/* @__PURE__ */ jsx59(Text50, { bold: true, children: "Project" }),
|
|
33832
|
+
/* @__PURE__ */ jsx59(Text50, { children: " " }),
|
|
33833
|
+
/* @__PURE__ */ jsx59(Text50, { color: PALETTE.accent, children: "Loading..." })
|
|
33834
|
+
] });
|
|
33835
|
+
}
|
|
33836
|
+
const save = () => {
|
|
33837
|
+
setSaving(true);
|
|
33838
|
+
setNotice(null);
|
|
33839
|
+
writeCredentials(config).then(() => {
|
|
33840
|
+
setLastSaved(config);
|
|
33841
|
+
if (config.contentfulBaseDir) void startDebugSessionIn(config.contentfulBaseDir, { replace: true });
|
|
33842
|
+
setNotice({ kind: "success", text: "Project settings saved" });
|
|
33843
|
+
}).catch((err) => {
|
|
33844
|
+
setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" });
|
|
33845
|
+
}).finally(() => setSaving(false));
|
|
33846
|
+
};
|
|
33847
|
+
const quit = () => {
|
|
33848
|
+
void finishDebugRun(
|
|
33849
|
+
lastSaved ? { outputs: debugFields(lastSaved), status: "success", exitMethod: "saved" } : { outputs: {}, status: "success", exitMethod: "discarded" }
|
|
33850
|
+
);
|
|
33851
|
+
onDone();
|
|
33852
|
+
};
|
|
33853
|
+
return /* @__PURE__ */ jsx59(
|
|
33854
|
+
FieldForm,
|
|
33855
|
+
{
|
|
33856
|
+
title: "Project",
|
|
33857
|
+
subtitle: "The Contentful space and where the CLI keeps its files.",
|
|
33858
|
+
fields: FIELDS3,
|
|
33859
|
+
values: valuesOf(config),
|
|
33860
|
+
onChange: (key, value) => {
|
|
33861
|
+
setConfig({ ...config, [key]: value });
|
|
33862
|
+
setNotice(null);
|
|
33863
|
+
},
|
|
33864
|
+
onSave: save,
|
|
33865
|
+
onQuit: quit,
|
|
33866
|
+
notice,
|
|
33867
|
+
busy: saving
|
|
33868
|
+
}
|
|
33869
|
+
);
|
|
33870
|
+
}
|
|
33871
|
+
var FIELDS3, valuesOf;
|
|
33872
|
+
var init_ProjectConfigScreen = __esm({
|
|
33873
|
+
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx"() {
|
|
33874
|
+
"use strict";
|
|
33875
|
+
init_home_theme();
|
|
33876
|
+
init_debug_store();
|
|
33877
|
+
init_FieldForm();
|
|
33878
|
+
init_config_store();
|
|
33879
|
+
FIELDS3 = [
|
|
33880
|
+
{ key: "spaceId", label: "Space ID" },
|
|
33881
|
+
{ key: "environmentId", label: "Environment ID" },
|
|
33882
|
+
{ key: "cmaToken", label: "CMA Token", masked: true },
|
|
33883
|
+
{ key: "host", label: "API Host" },
|
|
33884
|
+
{ key: "defaultComponentDir", label: "Default component directory" },
|
|
33885
|
+
{ key: "defaultTokenFile", label: "Default token file" },
|
|
33886
|
+
{ key: "contentfulBaseDir", label: "Root Project Directory", hint: "(where .contentful goes)" }
|
|
33887
|
+
];
|
|
33888
|
+
valuesOf = (config) => Object.fromEntries(FIELDS3.map(({ key }) => [key, config[key] || ""]));
|
|
33889
|
+
}
|
|
33890
|
+
});
|
|
33891
|
+
|
|
33892
|
+
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
33893
|
+
import { useState as useState33 } from "react";
|
|
33894
|
+
import { Box as Box48, Text as Text51, useInput as useInput14 } from "ink";
|
|
33895
|
+
import { jsx as jsx60, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
33896
|
+
function ConfigurationScreen({ onDone }) {
|
|
33897
|
+
const [focus, setFocus] = useState33(0);
|
|
33898
|
+
const [open, setOpen] = useState33(null);
|
|
33899
|
+
const close = () => setOpen(null);
|
|
33900
|
+
useInput14((input, key) => {
|
|
33901
|
+
if (open) return;
|
|
33902
|
+
if (key.upArrow) {
|
|
33903
|
+
setFocus((i) => (i - 1 + SECTIONS.length) % SECTIONS.length);
|
|
33904
|
+
return;
|
|
33905
|
+
}
|
|
33906
|
+
if (key.downArrow || key.tab) {
|
|
33907
|
+
setFocus((i) => (i + 1) % SECTIONS.length);
|
|
33908
|
+
return;
|
|
33909
|
+
}
|
|
33910
|
+
if (key.return) {
|
|
33911
|
+
setOpen(SECTIONS[focus].id);
|
|
33912
|
+
return;
|
|
33913
|
+
}
|
|
33914
|
+
if (key.escape || input === "q") onDone();
|
|
33915
|
+
});
|
|
33916
|
+
if (open === "project") return /* @__PURE__ */ jsx60(ProjectConfigScreen, { onDone: close });
|
|
33917
|
+
if (open === "agents") return /* @__PURE__ */ jsx60(AgentsScreen, { onDone: close });
|
|
33918
|
+
return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33919
|
+
/* @__PURE__ */ jsx60(Text51, { bold: true, children: "Configuration" }),
|
|
33920
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
33921
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs49(Box48, { gap: 1, children: [
|
|
33922
|
+
/* @__PURE__ */ jsx60(Text51, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
33923
|
+
/* @__PURE__ */ jsx60(Box48, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx60(Text51, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
33924
|
+
/* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: section.description })
|
|
33925
|
+
] }, section.id)),
|
|
33926
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
33927
|
+
/* @__PURE__ */ jsx60(
|
|
33928
|
+
ControlHints,
|
|
33929
|
+
{
|
|
33930
|
+
hints: [
|
|
33931
|
+
{ keys: "\u2191/\u2193", label: "move" },
|
|
33932
|
+
{ keys: "\u23CE", label: "open" },
|
|
33933
|
+
{ keys: "Esc/q", label: "back" }
|
|
33183
33934
|
]
|
|
33184
33935
|
}
|
|
33185
33936
|
)
|
|
33186
33937
|
] });
|
|
33187
33938
|
}
|
|
33188
|
-
var
|
|
33939
|
+
var SECTIONS;
|
|
33189
33940
|
var init_ContentfulConfigScreen = __esm({
|
|
33190
33941
|
"packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx"() {
|
|
33191
33942
|
"use strict";
|
|
33192
|
-
|
|
33193
|
-
init_config_store();
|
|
33194
|
-
init_debug_store();
|
|
33943
|
+
init_home_theme();
|
|
33195
33944
|
init_control_hints();
|
|
33196
|
-
|
|
33197
|
-
|
|
33198
|
-
|
|
33199
|
-
|
|
33200
|
-
|
|
33201
|
-
|
|
33202
|
-
|
|
33203
|
-
|
|
33945
|
+
init_AgentScreens();
|
|
33946
|
+
init_ProjectConfigScreen();
|
|
33947
|
+
SECTIONS = [
|
|
33948
|
+
{
|
|
33949
|
+
id: "project",
|
|
33950
|
+
label: "Project",
|
|
33951
|
+
description: "Contentful space, credentials, defaults and where .contentful goes"
|
|
33952
|
+
},
|
|
33953
|
+
{ id: "agents", label: "Agents", description: "Which coding agent the CLI uses, and each agent\u2019s settings" }
|
|
33204
33954
|
];
|
|
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
33955
|
}
|
|
33219
33956
|
});
|
|
33220
33957
|
|
|
33221
33958
|
// 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
|
|
33959
|
+
import { useEffect as useEffect25, useState as useState34 } from "react";
|
|
33960
|
+
import { Box as Box49, Text as Text52, useInput as useInput15 } from "ink";
|
|
33961
|
+
import { Fragment as Fragment20, jsx as jsx61, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
33225
33962
|
function OptInAnalyticsScreen({ onDone }) {
|
|
33226
|
-
const [loading, setLoading] =
|
|
33227
|
-
const [enabled, setEnabled] =
|
|
33228
|
-
|
|
33963
|
+
const [loading, setLoading] = useState34(true);
|
|
33964
|
+
const [enabled, setEnabled] = useState34(true);
|
|
33965
|
+
useEffect25(() => {
|
|
33229
33966
|
readAnalyticsSetting().then((setting) => {
|
|
33230
33967
|
setEnabled(setting.enabled);
|
|
33231
33968
|
setLoading(false);
|
|
@@ -33237,7 +33974,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33237
33974
|
});
|
|
33238
33975
|
});
|
|
33239
33976
|
}, []);
|
|
33240
|
-
|
|
33977
|
+
useInput15((input, key) => {
|
|
33241
33978
|
if (loading) return;
|
|
33242
33979
|
if (key.return || input === " ") {
|
|
33243
33980
|
setEnabled((current) => {
|
|
@@ -33252,21 +33989,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33252
33989
|
onDone();
|
|
33253
33990
|
}
|
|
33254
33991
|
});
|
|
33255
|
-
return /* @__PURE__ */
|
|
33256
|
-
/* @__PURE__ */
|
|
33257
|
-
/* @__PURE__ */
|
|
33258
|
-
loading ? /* @__PURE__ */
|
|
33259
|
-
/* @__PURE__ */
|
|
33992
|
+
return /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33993
|
+
/* @__PURE__ */ jsx61(Text52, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
33994
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
33995
|
+
loading ? /* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs50(Fragment20, { children: [
|
|
33996
|
+
/* @__PURE__ */ jsxs50(Text52, { children: [
|
|
33260
33997
|
"Share anonymous usage data:",
|
|
33261
33998
|
" ",
|
|
33262
|
-
/* @__PURE__ */
|
|
33999
|
+
/* @__PURE__ */ jsx61(Text52, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
33263
34000
|
] }),
|
|
33264
|
-
/* @__PURE__ */
|
|
33265
|
-
/* @__PURE__ */
|
|
33266
|
-
/* @__PURE__ */
|
|
34001
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
34002
|
+
/* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
34003
|
+
/* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
33267
34004
|
] }),
|
|
33268
|
-
/* @__PURE__ */
|
|
33269
|
-
/* @__PURE__ */
|
|
34005
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
34006
|
+
/* @__PURE__ */ jsx61(
|
|
33270
34007
|
ControlHints,
|
|
33271
34008
|
{
|
|
33272
34009
|
hints: [
|
|
@@ -33280,7 +34017,7 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
33280
34017
|
var init_screen11 = __esm({
|
|
33281
34018
|
"packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx"() {
|
|
33282
34019
|
"use strict";
|
|
33283
|
-
|
|
34020
|
+
init_home_theme();
|
|
33284
34021
|
init_analytics_store();
|
|
33285
34022
|
init_debug_store();
|
|
33286
34023
|
init_control_hints();
|
|
@@ -33288,12 +34025,12 @@ var init_screen11 = __esm({
|
|
|
33288
34025
|
});
|
|
33289
34026
|
|
|
33290
34027
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
33291
|
-
import { useEffect as
|
|
33292
|
-
import { Box as
|
|
33293
|
-
import { jsx as
|
|
34028
|
+
import { useEffect as useEffect26, useState as useState35 } from "react";
|
|
34029
|
+
import { Box as Box50, Text as Text53, useInput as useInput16 } from "ink";
|
|
34030
|
+
import { jsx as jsx62, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
33294
34031
|
function UpgradeScreen({ onDone }) {
|
|
33295
|
-
const [upgradeCheck, setUpgradeCheck] =
|
|
33296
|
-
|
|
34032
|
+
const [upgradeCheck, setUpgradeCheck] = useState35();
|
|
34033
|
+
useEffect26(() => {
|
|
33297
34034
|
startDebugRun({
|
|
33298
34035
|
flow: "upgrade",
|
|
33299
34036
|
step: "01-upgrade",
|
|
@@ -33302,7 +34039,7 @@ function UpgradeScreen({ onDone }) {
|
|
|
33302
34039
|
});
|
|
33303
34040
|
checkForUpgrade().then(setUpgradeCheck).catch(() => setUpgradeCheck({ status: "error" }));
|
|
33304
34041
|
}, []);
|
|
33305
|
-
|
|
34042
|
+
useInput16((_input, key) => {
|
|
33306
34043
|
if (key.return) {
|
|
33307
34044
|
void finishDebugRun({
|
|
33308
34045
|
outputs: upgradeCheck ?? {},
|
|
@@ -33313,12 +34050,12 @@ function UpgradeScreen({ onDone }) {
|
|
|
33313
34050
|
return;
|
|
33314
34051
|
}
|
|
33315
34052
|
});
|
|
33316
|
-
return /* @__PURE__ */
|
|
33317
|
-
/* @__PURE__ */
|
|
33318
|
-
/* @__PURE__ */
|
|
34053
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
34054
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, children: "Upgrade" }),
|
|
34055
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
33319
34056
|
renderBody(upgradeCheck),
|
|
33320
|
-
/* @__PURE__ */
|
|
33321
|
-
/* @__PURE__ */
|
|
34057
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
34058
|
+
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.accent, children: [
|
|
33322
34059
|
FOCUS_MARKER,
|
|
33323
34060
|
" Go Back"
|
|
33324
34061
|
] })
|
|
@@ -33326,41 +34063,40 @@ function UpgradeScreen({ onDone }) {
|
|
|
33326
34063
|
}
|
|
33327
34064
|
function renderBody(upgradeCheck) {
|
|
33328
34065
|
if (!upgradeCheck) {
|
|
33329
|
-
return /* @__PURE__ */
|
|
34066
|
+
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
33330
34067
|
}
|
|
33331
34068
|
if (upgradeCheck.status === "error") {
|
|
33332
|
-
return /* @__PURE__ */
|
|
34069
|
+
return /* @__PURE__ */ jsx62(Text53, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
33333
34070
|
}
|
|
33334
34071
|
if (upgradeCheck.status === "up-to-date") {
|
|
33335
|
-
return /* @__PURE__ */
|
|
34072
|
+
return /* @__PURE__ */ jsxs51(Text53, { color: PALETTE.success, children: [
|
|
33336
34073
|
"You're already on the latest version (v",
|
|
33337
34074
|
upgradeCheck.current,
|
|
33338
34075
|
")."
|
|
33339
34076
|
] });
|
|
33340
34077
|
}
|
|
33341
|
-
return /* @__PURE__ */
|
|
33342
|
-
/* @__PURE__ */
|
|
33343
|
-
/* @__PURE__ */
|
|
34078
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", children: [
|
|
34079
|
+
/* @__PURE__ */ jsxs51(Text53, { color: PALETTE.muted, children: [
|
|
34080
|
+
/* @__PURE__ */ jsxs51(Text53, { bold: true, color: PALETTE.success, children: [
|
|
33344
34081
|
"v",
|
|
33345
34082
|
upgradeCheck.latest
|
|
33346
34083
|
] }),
|
|
33347
34084
|
" ",
|
|
33348
34085
|
"is available (you're on ",
|
|
33349
|
-
/* @__PURE__ */
|
|
34086
|
+
/* @__PURE__ */ jsxs51(Text53, { bold: true, children: [
|
|
33350
34087
|
"v",
|
|
33351
34088
|
upgradeCheck.current
|
|
33352
34089
|
] }),
|
|
33353
34090
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
33354
34091
|
] }),
|
|
33355
|
-
/* @__PURE__ */
|
|
33356
|
-
/* @__PURE__ */
|
|
34092
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
34093
|
+
/* @__PURE__ */ jsx62(Box50, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx62(Text53, { bold: true, children: cmd }, cmd)) })
|
|
33357
34094
|
] });
|
|
33358
34095
|
}
|
|
33359
34096
|
var UPGRADE_COMMANDS;
|
|
33360
34097
|
var init_PageContainer4 = __esm({
|
|
33361
34098
|
"packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx"() {
|
|
33362
34099
|
"use strict";
|
|
33363
|
-
init_theme();
|
|
33364
34100
|
init_home_theme();
|
|
33365
34101
|
init_version();
|
|
33366
34102
|
init_debug_store();
|
|
@@ -33369,13 +34105,13 @@ var init_PageContainer4 = __esm({
|
|
|
33369
34105
|
});
|
|
33370
34106
|
|
|
33371
34107
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
33372
|
-
import { useEffect as
|
|
33373
|
-
import { Box as
|
|
33374
|
-
import { jsx as
|
|
34108
|
+
import { useEffect as useEffect27, useState as useState36 } from "react";
|
|
34109
|
+
import { Box as Box51, Text as Text54, useInput as useInput17 } from "ink";
|
|
34110
|
+
import { jsx as jsx63, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
33375
34111
|
function DebugModeScreen({ onDone }) {
|
|
33376
|
-
const [loading, setLoading] =
|
|
33377
|
-
const [enabled, setEnabled] =
|
|
33378
|
-
|
|
34112
|
+
const [loading, setLoading] = useState36(true);
|
|
34113
|
+
const [enabled, setEnabled] = useState36(true);
|
|
34114
|
+
useEffect27(() => {
|
|
33379
34115
|
readDebugModeSetting().then((setting) => {
|
|
33380
34116
|
setEnabled(setting.enabled);
|
|
33381
34117
|
setLoading(false);
|
|
@@ -33387,7 +34123,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
33387
34123
|
});
|
|
33388
34124
|
});
|
|
33389
34125
|
}, []);
|
|
33390
|
-
|
|
34126
|
+
useInput17((input, key) => {
|
|
33391
34127
|
if (loading) return;
|
|
33392
34128
|
if (key.return || input === " ") {
|
|
33393
34129
|
setEnabled((current) => {
|
|
@@ -33402,16 +34138,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
33402
34138
|
onDone();
|
|
33403
34139
|
}
|
|
33404
34140
|
});
|
|
33405
|
-
return /* @__PURE__ */
|
|
33406
|
-
/* @__PURE__ */
|
|
33407
|
-
/* @__PURE__ */
|
|
33408
|
-
loading ? /* @__PURE__ */
|
|
34141
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
34142
|
+
/* @__PURE__ */ jsx63(Text54, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
34143
|
+
/* @__PURE__ */ jsx63(Text54, { children: " " }),
|
|
34144
|
+
loading ? /* @__PURE__ */ jsx63(Text54, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs52(Text54, { children: [
|
|
33409
34145
|
"Debug logging:",
|
|
33410
34146
|
" ",
|
|
33411
|
-
/* @__PURE__ */
|
|
34147
|
+
/* @__PURE__ */ jsx63(Text54, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
33412
34148
|
] }),
|
|
33413
|
-
/* @__PURE__ */
|
|
33414
|
-
/* @__PURE__ */
|
|
34149
|
+
/* @__PURE__ */ jsx63(Text54, { children: " " }),
|
|
34150
|
+
/* @__PURE__ */ jsx63(
|
|
33415
34151
|
ControlHints,
|
|
33416
34152
|
{
|
|
33417
34153
|
hints: [
|
|
@@ -33425,7 +34161,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
33425
34161
|
var init_screen12 = __esm({
|
|
33426
34162
|
"packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx"() {
|
|
33427
34163
|
"use strict";
|
|
33428
|
-
|
|
34164
|
+
init_home_theme();
|
|
33429
34165
|
init_debug_mode_store();
|
|
33430
34166
|
init_debug_store();
|
|
33431
34167
|
init_control_hints();
|
|
@@ -33437,20 +34173,20 @@ var app_exports = {};
|
|
|
33437
34173
|
__export(app_exports, {
|
|
33438
34174
|
runApp: () => runApp
|
|
33439
34175
|
});
|
|
33440
|
-
import { join as
|
|
33441
|
-
import { useEffect as
|
|
33442
|
-
import { Fragment as
|
|
34176
|
+
import { join as join28 } from "node:path";
|
|
34177
|
+
import { useEffect as useEffect28, useState as useState37 } from "react";
|
|
34178
|
+
import { Fragment as Fragment21, jsx as jsx64 } from "react/jsx-runtime";
|
|
33443
34179
|
function App({ importOptions, inkClear }) {
|
|
33444
|
-
const [screen, setScreen] =
|
|
33445
|
-
const [importExitCode, setImportExitCode] =
|
|
34180
|
+
const [screen, setScreen] = useState37("start");
|
|
34181
|
+
const [importExitCode, setImportExitCode] = useState37();
|
|
33446
34182
|
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] =
|
|
34183
|
+
const [projectPath, setProjectPath] = useState37();
|
|
34184
|
+
const [tokensPath, setTokensPath] = useState37();
|
|
34185
|
+
const [scannedFiles, setScannedFiles] = useState37();
|
|
34186
|
+
const [pendingLaunch, setPendingLaunch] = useState37();
|
|
34187
|
+
const [extractionRun, setExtractionRun] = useState37();
|
|
33452
34188
|
const extraction = useExtraction(extractionRun?.input);
|
|
33453
|
-
const [scopeRun, setScopeRun] =
|
|
34189
|
+
const [scopeRun, setScopeRun] = useState37();
|
|
33454
34190
|
const scopeFlow = useScopeGateFlow(
|
|
33455
34191
|
scopeRun && {
|
|
33456
34192
|
sessionId: scopeRun.extraction.sessionId,
|
|
@@ -33465,12 +34201,12 @@ function App({ importOptions, inkClear }) {
|
|
|
33465
34201
|
}
|
|
33466
34202
|
}
|
|
33467
34203
|
);
|
|
33468
|
-
const [generationInput, setGenerationInput] =
|
|
34204
|
+
const [generationInput, setGenerationInput] = useState37();
|
|
33469
34205
|
const generation = useGeneration(generationInput);
|
|
33470
|
-
const [flowStart, setFlowStart] =
|
|
34206
|
+
const [flowStart, setFlowStart] = useState37();
|
|
33471
34207
|
const flow = useFlow(flowStart, { beforeStepChange: inkClear });
|
|
33472
|
-
const [importDefaults, setImportDefaults] =
|
|
33473
|
-
|
|
34208
|
+
const [importDefaults, setImportDefaults] = useState37();
|
|
34209
|
+
useEffect28(() => {
|
|
33474
34210
|
if (screen !== "import") {
|
|
33475
34211
|
setImportDefaults(void 0);
|
|
33476
34212
|
return;
|
|
@@ -33488,7 +34224,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33488
34224
|
const launch = { projectPath: projectPath2, tokens, filePaths, ...importOptions };
|
|
33489
34225
|
const state2 = await inspectTokens({
|
|
33490
34226
|
rawTokensPath: tokens,
|
|
33491
|
-
contentfulDir:
|
|
34227
|
+
contentfulDir: join28(resolveUserPath(projectPath2), ".contentful"),
|
|
33492
34228
|
cache: importOptions.cache
|
|
33493
34229
|
});
|
|
33494
34230
|
if (state2.kind === "cached") {
|
|
@@ -33530,12 +34266,12 @@ function App({ importOptions, inkClear }) {
|
|
|
33530
34266
|
}
|
|
33531
34267
|
});
|
|
33532
34268
|
};
|
|
33533
|
-
|
|
34269
|
+
useEffect28(() => {
|
|
33534
34270
|
if (!extractionRun || extraction?.status !== "done" || !extraction.result.ok) return;
|
|
33535
34271
|
setExtractionRun(void 0);
|
|
33536
34272
|
setScopeRun({ ...extractionRun, extraction: extraction.result.extraction });
|
|
33537
34273
|
}, [extraction, extractionRun]);
|
|
33538
|
-
|
|
34274
|
+
useEffect28(() => {
|
|
33539
34275
|
if (!scopeRun || scopeFlow?.status !== "confirmed" || generationInput) return;
|
|
33540
34276
|
const { extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33541
34277
|
setGenerationInput({
|
|
@@ -33553,7 +34289,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33553
34289
|
...generatePromptPath ? { generatePromptPath } : {}
|
|
33554
34290
|
});
|
|
33555
34291
|
}, [scopeFlow, scopeRun, generationInput]);
|
|
33556
|
-
|
|
34292
|
+
useEffect28(() => {
|
|
33557
34293
|
if (!scopeRun || generation?.status !== "done" || !generation.result.ok) return;
|
|
33558
34294
|
const { credentialsSkipped, tokenStrategy, extraction: produced, input, generatePromptPath } = scopeRun;
|
|
33559
34295
|
inkClear();
|
|
@@ -33596,9 +34332,9 @@ function App({ importOptions, inkClear }) {
|
|
|
33596
34332
|
};
|
|
33597
34333
|
switch (screen) {
|
|
33598
34334
|
case "import":
|
|
33599
|
-
if (showImportResult) return /* @__PURE__ */
|
|
34335
|
+
if (showImportResult) return /* @__PURE__ */ jsx64(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
33600
34336
|
if (flow && flowStart) {
|
|
33601
|
-
return /* @__PURE__ */
|
|
34337
|
+
return /* @__PURE__ */ jsx64(
|
|
33602
34338
|
FlowScreen,
|
|
33603
34339
|
{
|
|
33604
34340
|
state: flow.state,
|
|
@@ -33608,12 +34344,12 @@ function App({ importOptions, inkClear }) {
|
|
|
33608
34344
|
}
|
|
33609
34345
|
);
|
|
33610
34346
|
}
|
|
33611
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
34347
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx64(Fragment21, {});
|
|
33612
34348
|
if (projectPath === void 0) {
|
|
33613
|
-
return /* @__PURE__ */
|
|
34349
|
+
return /* @__PURE__ */ jsx64(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
33614
34350
|
}
|
|
33615
34351
|
if (tokensPath === void 0) {
|
|
33616
|
-
return /* @__PURE__ */
|
|
34352
|
+
return /* @__PURE__ */ jsx64(
|
|
33617
34353
|
TokenInputScreen,
|
|
33618
34354
|
{
|
|
33619
34355
|
initialPath: importDefaults.tokenFile,
|
|
@@ -33623,7 +34359,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33623
34359
|
);
|
|
33624
34360
|
}
|
|
33625
34361
|
if (scannedFiles === void 0) {
|
|
33626
|
-
return /* @__PURE__ */
|
|
34362
|
+
return /* @__PURE__ */ jsx64(
|
|
33627
34363
|
PathValidationScreen,
|
|
33628
34364
|
{
|
|
33629
34365
|
projectPath,
|
|
@@ -33635,10 +34371,10 @@ function App({ importOptions, inkClear }) {
|
|
|
33635
34371
|
}
|
|
33636
34372
|
if (extractionRun) {
|
|
33637
34373
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
33638
|
-
return /* @__PURE__ */
|
|
34374
|
+
return /* @__PURE__ */ jsx64(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
33639
34375
|
}
|
|
33640
34376
|
if (extraction?.status === "running") {
|
|
33641
|
-
return /* @__PURE__ */
|
|
34377
|
+
return /* @__PURE__ */ jsx64(
|
|
33642
34378
|
ExtractionScreen,
|
|
33643
34379
|
{
|
|
33644
34380
|
progress: extraction.progress,
|
|
@@ -33647,14 +34383,14 @@ function App({ importOptions, inkClear }) {
|
|
|
33647
34383
|
}
|
|
33648
34384
|
);
|
|
33649
34385
|
}
|
|
33650
|
-
return /* @__PURE__ */
|
|
34386
|
+
return /* @__PURE__ */ jsx64(Fragment21, {});
|
|
33651
34387
|
}
|
|
33652
34388
|
if (scopeRun && scopeFlow) {
|
|
33653
34389
|
if (scopeFlow.status === "failed") {
|
|
33654
|
-
return /* @__PURE__ */
|
|
34390
|
+
return /* @__PURE__ */ jsx64(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
33655
34391
|
}
|
|
33656
34392
|
if (scopeFlow.status === "deciding") {
|
|
33657
|
-
return /* @__PURE__ */
|
|
34393
|
+
return /* @__PURE__ */ jsx64(
|
|
33658
34394
|
ScopeGateScreen,
|
|
33659
34395
|
{
|
|
33660
34396
|
components: scopeFlow.load.components,
|
|
@@ -33664,7 +34400,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33664
34400
|
);
|
|
33665
34401
|
}
|
|
33666
34402
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
33667
|
-
return /* @__PURE__ */
|
|
34403
|
+
return /* @__PURE__ */ jsx64(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
33668
34404
|
}
|
|
33669
34405
|
if (generation?.status === "running") {
|
|
33670
34406
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -33672,7 +34408,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33672
34408
|
hasRawTokens,
|
|
33673
34409
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
33674
34410
|
});
|
|
33675
|
-
return /* @__PURE__ */
|
|
34411
|
+
return /* @__PURE__ */ jsx64(
|
|
33676
34412
|
GenerationScreen,
|
|
33677
34413
|
{
|
|
33678
34414
|
progress: generation.progress,
|
|
@@ -33684,10 +34420,10 @@ function App({ importOptions, inkClear }) {
|
|
|
33684
34420
|
}
|
|
33685
34421
|
);
|
|
33686
34422
|
}
|
|
33687
|
-
return /* @__PURE__ */
|
|
34423
|
+
return /* @__PURE__ */ jsx64(Fragment21, {});
|
|
33688
34424
|
}
|
|
33689
34425
|
if (pendingLaunch?.cached) {
|
|
33690
|
-
return /* @__PURE__ */
|
|
34426
|
+
return /* @__PURE__ */ jsx64(
|
|
33691
34427
|
TokenReuseScreen,
|
|
33692
34428
|
{
|
|
33693
34429
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -33698,7 +34434,7 @@ function App({ importOptions, inkClear }) {
|
|
|
33698
34434
|
}
|
|
33699
34435
|
);
|
|
33700
34436
|
}
|
|
33701
|
-
return /* @__PURE__ */
|
|
34437
|
+
return /* @__PURE__ */ jsx64(
|
|
33702
34438
|
CredentialsScreen,
|
|
33703
34439
|
{
|
|
33704
34440
|
initial: importDefaults.credentials,
|
|
@@ -33707,19 +34443,19 @@ function App({ importOptions, inkClear }) {
|
|
|
33707
34443
|
}
|
|
33708
34444
|
);
|
|
33709
34445
|
case "help":
|
|
33710
|
-
return /* @__PURE__ */
|
|
34446
|
+
return /* @__PURE__ */ jsx64(HelpScreen, { onDone: goToStart });
|
|
33711
34447
|
case "upgrade":
|
|
33712
|
-
return /* @__PURE__ */
|
|
34448
|
+
return /* @__PURE__ */ jsx64(UpgradeScreen, { onDone: goToStart });
|
|
33713
34449
|
case "settings":
|
|
33714
|
-
return /* @__PURE__ */
|
|
34450
|
+
return /* @__PURE__ */ jsx64(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
33715
34451
|
case "settings-configuration":
|
|
33716
|
-
return /* @__PURE__ */
|
|
34452
|
+
return /* @__PURE__ */ jsx64(ConfigurationScreen, { onDone: goToSettings });
|
|
33717
34453
|
case "settings-opt-in-analytics":
|
|
33718
|
-
return /* @__PURE__ */
|
|
34454
|
+
return /* @__PURE__ */ jsx64(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
33719
34455
|
case "settings-debug-mode":
|
|
33720
|
-
return /* @__PURE__ */
|
|
34456
|
+
return /* @__PURE__ */ jsx64(DebugModeScreen, { onDone: goToSettings });
|
|
33721
34457
|
case "start":
|
|
33722
|
-
return /* @__PURE__ */
|
|
34458
|
+
return /* @__PURE__ */ jsx64(HomeScreen, { onNavigate: setScreen });
|
|
33723
34459
|
}
|
|
33724
34460
|
}
|
|
33725
34461
|
async function runApp(renderApp, importOptions) {
|
|
@@ -33727,7 +34463,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
33727
34463
|
instance.clear?.();
|
|
33728
34464
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
33729
34465
|
};
|
|
33730
|
-
const instance = renderApp(/* @__PURE__ */
|
|
34466
|
+
const instance = renderApp(/* @__PURE__ */ jsx64(App, { importOptions, inkClear }));
|
|
33731
34467
|
await instance.waitUntilExit();
|
|
33732
34468
|
}
|
|
33733
34469
|
var init_app = __esm({
|
|
@@ -33762,7 +34498,7 @@ var init_app = __esm({
|
|
|
33762
34498
|
// packages/experience-design-system-cli/program.ts
|
|
33763
34499
|
init_src4();
|
|
33764
34500
|
import { readFileSync as readFileSync9 } from "node:fs";
|
|
33765
|
-
import { join as
|
|
34501
|
+
import { join as join29 } from "node:path";
|
|
33766
34502
|
import { Command } from "commander";
|
|
33767
34503
|
|
|
33768
34504
|
// packages/experience-design-system-cli/src/legacy/run-legacy.ts
|
|
@@ -33866,14 +34602,14 @@ function runDevWatch(args) {
|
|
|
33866
34602
|
process.stderr.write("--watch only works from a checkout of the repo (scripts/dev.mjs is not in the package).\n");
|
|
33867
34603
|
return Promise.resolve(1);
|
|
33868
34604
|
}
|
|
33869
|
-
return new Promise((
|
|
34605
|
+
return new Promise((resolve28) => {
|
|
33870
34606
|
const child = spawn4(process.execPath, [script, ...args], { stdio: "inherit" });
|
|
33871
34607
|
process.on("SIGINT", () => void 0);
|
|
33872
|
-
child.on("exit", (code) =>
|
|
34608
|
+
child.on("exit", (code) => resolve28(code ?? 0));
|
|
33873
34609
|
child.on("error", (err) => {
|
|
33874
34610
|
process.stderr.write(`${err.message}
|
|
33875
34611
|
`);
|
|
33876
|
-
|
|
34612
|
+
resolve28(1);
|
|
33877
34613
|
});
|
|
33878
34614
|
});
|
|
33879
34615
|
}
|
|
@@ -33895,11 +34631,13 @@ function registerImportCommand(program, openTui) {
|
|
|
33895
34631
|
}
|
|
33896
34632
|
|
|
33897
34633
|
// packages/experience-design-system-cli/program.ts
|
|
34634
|
+
init_agent_store();
|
|
34635
|
+
init_apply_binary_overrides();
|
|
33898
34636
|
init_analytics_store();
|
|
33899
34637
|
init_package_root();
|
|
33900
34638
|
var pkg = JSON.parse(
|
|
33901
34639
|
readFileSync9(
|
|
33902
|
-
|
|
34640
|
+
join29(findPackageRoot(import.meta.url, "@contentful/experience-design-system-cli"), "package.json"),
|
|
33903
34641
|
"utf8"
|
|
33904
34642
|
)
|
|
33905
34643
|
);
|
|
@@ -33917,6 +34655,7 @@ function createProgram() {
|
|
|
33917
34655
|
const commandChain = chain.join(" ") || actionCommand.name();
|
|
33918
34656
|
const { enabled } = await readAnalyticsSetting();
|
|
33919
34657
|
setPersistedAnalyticsDisabled(!enabled);
|
|
34658
|
+
await readAgentConfig().then(applyBinaryOverrides, () => void 0);
|
|
33920
34659
|
setCliVersion(pkg.version);
|
|
33921
34660
|
noteCommandStart(commandChain);
|
|
33922
34661
|
});
|
|
@@ -33940,7 +34679,7 @@ init_config();
|
|
|
33940
34679
|
init_package_root();
|
|
33941
34680
|
import { existsSync as existsSync12 } from "node:fs";
|
|
33942
34681
|
import { mkdir as mkdir10, readFile as readFile19, rename as rename3, rmdir, unlink } from "node:fs/promises";
|
|
33943
|
-
import { dirname as dirname16, join as
|
|
34682
|
+
import { dirname as dirname16, join as join30 } from "node:path";
|
|
33944
34683
|
var PACKAGE_NAME4 = "@contentful/experience-design-system-cli";
|
|
33945
34684
|
async function readJson(path5) {
|
|
33946
34685
|
try {
|
|
@@ -33951,9 +34690,9 @@ async function readJson(path5) {
|
|
|
33951
34690
|
}
|
|
33952
34691
|
async function migrateOldConfig() {
|
|
33953
34692
|
try {
|
|
33954
|
-
const oldCredentials =
|
|
33955
|
-
const oldRuns =
|
|
33956
|
-
const oldDebugMode =
|
|
34693
|
+
const oldCredentials = join30(oldConfigDir2(), "credentials.json");
|
|
34694
|
+
const oldRuns = join30(oldConfigDir2(), "runs.json");
|
|
34695
|
+
const oldDebugMode = join30(
|
|
33957
34696
|
findPackageRoot(import.meta.url, PACKAGE_NAME4),
|
|
33958
34697
|
".contentful",
|
|
33959
34698
|
"config",
|