@contentful/experience-design-system-cli 2.34.5-dev-build-fcf31517.0 → 2.34.5-dev-build-04d687d.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/package.json +1 -1
- package/dist/src/analyze/composition/interchange-schema.d.ts +4 -24
- package/dist/src/analyze/composition/resolve-mapping-cli.d.ts +0 -11
- package/dist/src/analyze/composition/resolve-mapping.d.ts +5 -7
- package/dist/src/import/agent-model-resolve.d.ts +8 -4
- package/dist/src/import/composition-options.d.ts +0 -2
- package/dist/src/import/tui/WizardApp.d.ts +3 -2
- package/dist/src/import/tui/run-selection-agent.d.ts +8 -0
- package/dist/src/import/tui/steps/GenerateReviewStep.d.ts +14 -3
- package/dist/src/import/tui/steps/ScopeGateStep.d.ts +1 -1
- package/dist/src/index.js +845 -845
- package/dist/src/lib/agent-model-options.d.ts +4 -4
- package/dist/src/lib/debug-logger.d.ts +2 -3
- package/dist/src/program.d.ts +1 -1
- package/package.json +6 -6
- package/dist/src/import/tui/final-review-host.d.ts +0 -6
- package/dist/src/import/tui/review-step-props.d.ts +0 -13
- package/dist/src/import/tui/scope-gate-host.d.ts +0 -19
- package/dist/src/import/tui/steps/useTerminalColumns.d.ts +0 -1
package/dist/src/index.js
CHANGED
|
@@ -4146,12 +4146,17 @@ var init_persistence = __esm({
|
|
|
4146
4146
|
|
|
4147
4147
|
// packages/experience-design-system-cli/src/lib/agent-model-options.ts
|
|
4148
4148
|
function addAgentModelOptions(cmd, config = {}) {
|
|
4149
|
-
const {
|
|
4149
|
+
const {
|
|
4150
|
+
agentDescription = AGENT_DESCRIPTION,
|
|
4151
|
+
includeModel = true,
|
|
4152
|
+
includeBedrock = true,
|
|
4153
|
+
modelDescription = MODEL_DESCRIPTION
|
|
4154
|
+
} = config;
|
|
4150
4155
|
cmd.option("--agent <name>", agentDescription);
|
|
4151
4156
|
if (includeModel) {
|
|
4152
4157
|
cmd.option("--model <name>", modelDescription);
|
|
4153
4158
|
}
|
|
4154
|
-
cmd.option("--bedrock", BEDROCK_DESCRIPTION);
|
|
4159
|
+
if (includeBedrock) cmd.option("--bedrock", BEDROCK_DESCRIPTION);
|
|
4155
4160
|
return cmd;
|
|
4156
4161
|
}
|
|
4157
4162
|
var AGENT_DESCRIPTION, MODEL_DESCRIPTION, BEDROCK_AGENTS, BEDROCK_DESCRIPTION;
|
|
@@ -4910,7 +4915,8 @@ async function runGenerateSkill(skill, opts, verbose = false) {
|
|
|
4910
4915
|
const { overrides: promptOverrides, errors: promptErrors } = parsePromptOverrides(opts.prompt ?? []);
|
|
4911
4916
|
if (promptErrors.length > 0) die(`Error: ${promptErrors.join("; ")}`);
|
|
4912
4917
|
let generatePrompt;
|
|
4913
|
-
const
|
|
4918
|
+
const promptStage = skill === "tokens" ? "tokens" : "generate";
|
|
4919
|
+
const generateOverride = promptOverrides.get(promptStage);
|
|
4914
4920
|
if (generateOverride) {
|
|
4915
4921
|
try {
|
|
4916
4922
|
generatePrompt = await resolvePromptOverride(generateOverride);
|
|
@@ -5260,7 +5266,12 @@ function registerInternalGenerateCommand(program) {
|
|
|
5260
5266
|
addAgentFlags(componentsCmd).action(async (opts) => {
|
|
5261
5267
|
await runGenerateSkill("components", opts, opts.verbose ?? false);
|
|
5262
5268
|
});
|
|
5263
|
-
const tokensCmd = generate.command("tokens").description("Invoke a coding agent to produce tokens.json from raw token data").option("--raw-tokens <path>", "Path to raw token input file")
|
|
5269
|
+
const tokensCmd = generate.command("tokens").description("Invoke a coding agent to produce tokens.json from raw token data").option("--raw-tokens <path>", "Path to raw token input file").option(
|
|
5270
|
+
"--prompt <stage=value>",
|
|
5271
|
+
"Override a stage prompt (repeatable). Used here for the tokens stage.",
|
|
5272
|
+
(v, acc) => [...acc, v],
|
|
5273
|
+
[]
|
|
5274
|
+
);
|
|
5264
5275
|
addAgentFlags(tokensCmd).action(async (opts) => {
|
|
5265
5276
|
await runGenerateSkill("tokens", opts, opts.verbose ?? false);
|
|
5266
5277
|
});
|
|
@@ -7532,7 +7543,7 @@ function buildApplyOutput(operation, spaceId, environmentId, host) {
|
|
|
7532
7543
|
};
|
|
7533
7544
|
}
|
|
7534
7545
|
function registerApplyCommand(program) {
|
|
7535
|
-
const applyCmd = program.command("apply").description("Write component types and design tokens to Contentful ExO").argument("<file>", "CDF file containing all component and design token definitions");
|
|
7546
|
+
const applyCmd = program.command("apply").description("Write component types and design tokens to Contentful ExO").helpOption(false).argument("<file>", "CDF file containing all component and design token definitions");
|
|
7536
7547
|
applyCmd.action(async (file) => {
|
|
7537
7548
|
const isTTY = getInteractiveTerminalSupport().supported;
|
|
7538
7549
|
const inputs = await resolveSharedInputsOrDie(file);
|
|
@@ -8480,6 +8491,20 @@ async function runMapTokens(opts) {
|
|
|
8480
8491
|
);
|
|
8481
8492
|
}
|
|
8482
8493
|
const resultAgent = configuredAgent ?? "skipped";
|
|
8494
|
+
const { overrides: promptOverrides, errors: promptErrors } = parsePromptOverrides(opts.prompt ?? []);
|
|
8495
|
+
if (promptErrors.length > 0) die(`Error: ${promptErrors.join("; ")}`);
|
|
8496
|
+
const mapPromptOverride = promptOverrides.get("map-tokens");
|
|
8497
|
+
let mapPromptText;
|
|
8498
|
+
let mapPromptPath;
|
|
8499
|
+
if (mapPromptOverride?.kind === "text") mapPromptText = mapPromptOverride.value;
|
|
8500
|
+
if (mapPromptOverride?.kind === "path") {
|
|
8501
|
+
mapPromptPath = resolve8(mapPromptOverride.value);
|
|
8502
|
+
try {
|
|
8503
|
+
await resolvePromptOverride(mapPromptOverride);
|
|
8504
|
+
} catch (error) {
|
|
8505
|
+
die(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
8506
|
+
}
|
|
8507
|
+
}
|
|
8483
8508
|
const db = openPipelineDb();
|
|
8484
8509
|
try {
|
|
8485
8510
|
const sessionId2 = opts.session ?? findLatestSessionForCommand(db, "generate components");
|
|
@@ -8582,16 +8607,19 @@ ${defaultDiagnostics.map((diagnostic) => ` ${diagnostic}`).join("\n")}
|
|
|
8582
8607
|
);
|
|
8583
8608
|
}
|
|
8584
8609
|
}
|
|
8610
|
+
const buildMapPrompt = () => buildPrompt({
|
|
8611
|
+
skill: "map-tokens",
|
|
8612
|
+
mode: "autonomous",
|
|
8613
|
+
generatedCdf,
|
|
8614
|
+
tokenTree,
|
|
8615
|
+
componentSourceRefs,
|
|
8616
|
+
outDir: process.cwd(),
|
|
8617
|
+
existingTokensInline,
|
|
8618
|
+
...mapPromptText !== void 0 ? { skillContentOverride: mapPromptText } : {},
|
|
8619
|
+
...mapPromptText === void 0 && mapPromptPath ? { skillPathOverride: mapPromptPath } : {}
|
|
8620
|
+
});
|
|
8585
8621
|
if (opts.printPrompt) {
|
|
8586
|
-
const prompt2 = await
|
|
8587
|
-
skill: "map-tokens",
|
|
8588
|
-
mode: "autonomous",
|
|
8589
|
-
generatedCdf,
|
|
8590
|
-
tokenTree,
|
|
8591
|
-
componentSourceRefs,
|
|
8592
|
-
outDir: process.cwd(),
|
|
8593
|
-
existingTokensInline
|
|
8594
|
-
});
|
|
8622
|
+
const prompt2 = await buildMapPrompt();
|
|
8595
8623
|
process.stdout.write(prompt2 + "\n");
|
|
8596
8624
|
await exitWithAnalytics(0);
|
|
8597
8625
|
return;
|
|
@@ -8613,7 +8641,8 @@ ${defaultDiagnostics.map((diagnostic) => ` ${diagnostic}`).join("\n")}
|
|
|
8613
8641
|
agent,
|
|
8614
8642
|
model,
|
|
8615
8643
|
void 0,
|
|
8616
|
-
existingTokensInline ? [hashContent(existingTokensInline)] : []
|
|
8644
|
+
existingTokensInline ? [hashContent(existingTokensInline)] : [],
|
|
8645
|
+
mapPromptText
|
|
8617
8646
|
);
|
|
8618
8647
|
const inputHash = computeMapTokensInputHash(db, sessionId2, componentSourceRefs);
|
|
8619
8648
|
if (!noCache) {
|
|
@@ -8635,15 +8664,7 @@ Install it, choose another agent with --agent, or use --print-prompt to run the
|
|
|
8635
8664
|
);
|
|
8636
8665
|
}
|
|
8637
8666
|
const stepId = createStep(db, sessionId2, "map tokens", { agent, model: model ?? "" });
|
|
8638
|
-
const prompt = await
|
|
8639
|
-
skill: "map-tokens",
|
|
8640
|
-
mode: "autonomous",
|
|
8641
|
-
generatedCdf,
|
|
8642
|
-
tokenTree,
|
|
8643
|
-
componentSourceRefs,
|
|
8644
|
-
outDir: process.cwd(),
|
|
8645
|
-
existingTokensInline
|
|
8646
|
-
});
|
|
8667
|
+
const prompt = await buildMapPrompt();
|
|
8647
8668
|
const invoker2 = createLocalCliAgentInvoker();
|
|
8648
8669
|
const result = await invoker2.invoke({ agent, model, prompt, timeoutMs: DEFAULT_TIMEOUT_MS2 });
|
|
8649
8670
|
if (result.timedOut || result.exitCode !== 0) {
|
|
@@ -8669,7 +8690,12 @@ ${warnings.map((w) => ` ${w}`).join("\n")}
|
|
|
8669
8690
|
}
|
|
8670
8691
|
function registerMapTokensCommand(program) {
|
|
8671
8692
|
const map = program.command("map", { hidden: true }).description("Suggest token restrictions for generated design-token props");
|
|
8672
|
-
const tokensCmd = map.command("tokens").description("Invoke a coding agent to suggest $token.allowed for design-category token props").option("--session <id>", "Session ID from generate components (defaults to most recent)").option("--print-prompt", "Print the prompt without invoking the agent").option("--skip-agent", "Resolve token defaults without agentic $token.allowed inference").option("--no-cache", "Bypass the map-tokens cache and force a re-run").option(
|
|
8693
|
+
const tokensCmd = map.command("tokens").description("Invoke a coding agent to suggest $token.allowed for design-category token props").option("--session <id>", "Session ID from generate components (defaults to most recent)").option("--print-prompt", "Print the prompt without invoking the agent").option("--skip-agent", "Resolve token defaults without agentic $token.allowed inference").option("--no-cache", "Bypass the map-tokens cache and force a re-run").option(
|
|
8694
|
+
"--prompt <stage=value>",
|
|
8695
|
+
"Override a stage prompt (repeatable). Used here for the map-tokens stage.",
|
|
8696
|
+
(v, acc) => [...acc, v],
|
|
8697
|
+
[]
|
|
8698
|
+
).option("--token-map <path>", "Path to token-name-map.json sidecar").option(
|
|
8673
8699
|
"--existing-entities-path <path>",
|
|
8674
8700
|
"Path to the .existing-entities.json file written after CMA credentials are supplied. When present, the agent gets a list of the space's existing design tokens so it can prefer binding to them. Missing/malformed files are treated as no-op."
|
|
8675
8701
|
);
|
|
@@ -8694,6 +8720,7 @@ var init_command4 = __esm({
|
|
|
8694
8720
|
init_MapTokensView();
|
|
8695
8721
|
init_resolve_defaults();
|
|
8696
8722
|
init_cli_errors();
|
|
8723
|
+
init_prompt_overrides();
|
|
8697
8724
|
DEFAULT_TIMEOUT_MS2 = Number(process.env.EDS_AGENT_TIMEOUT_MS ?? 5 * 60 * 1e3);
|
|
8698
8725
|
}
|
|
8699
8726
|
});
|
|
@@ -8722,6 +8749,19 @@ var init_path_utils = __esm({
|
|
|
8722
8749
|
});
|
|
8723
8750
|
|
|
8724
8751
|
// packages/experience-design-system-cli/src/import/agent-model-resolve.ts
|
|
8752
|
+
function parseAgentModel(value) {
|
|
8753
|
+
if (!value?.trim()) return {};
|
|
8754
|
+
const trimmed = value.trim();
|
|
8755
|
+
const separator = trimmed.indexOf(":");
|
|
8756
|
+
if (separator >= 0) {
|
|
8757
|
+
return {
|
|
8758
|
+
agent: trimmed.slice(0, separator).trim() || void 0,
|
|
8759
|
+
model: trimmed.slice(separator + 1).trim() || void 0
|
|
8760
|
+
};
|
|
8761
|
+
}
|
|
8762
|
+
const [agent, ...modelParts] = trimmed.split(/\s+/);
|
|
8763
|
+
return { agent, ...modelParts.length > 0 ? { model: modelParts.join(" ") } : {} };
|
|
8764
|
+
}
|
|
8725
8765
|
function resolveAgent(flagValue, storedValue) {
|
|
8726
8766
|
if (flagValue && flagValue.length > 0) return flagValue;
|
|
8727
8767
|
if (storedValue && storedValue.length > 0) return storedValue;
|
|
@@ -8743,7 +8783,6 @@ var init_agent_model_resolve = __esm({
|
|
|
8743
8783
|
// packages/experience-design-system-cli/src/import/composition-options.ts
|
|
8744
8784
|
function buildCompositionForwardingOptions(options) {
|
|
8745
8785
|
return {
|
|
8746
|
-
...options.compositionMap ? { compositionMap: options.compositionMap } : {},
|
|
8747
8786
|
...options.prompt && options.prompt.length > 0 ? { promptOverrides: options.prompt } : {}
|
|
8748
8787
|
};
|
|
8749
8788
|
}
|
|
@@ -10279,13 +10318,6 @@ function WizardPreviewStep({
|
|
|
10279
10318
|
maxScroll > 0 && /* @__PURE__ */ jsx18(Text16, { dimColor: true, children: " \u2195 j/k to scroll, f/b to page" })
|
|
10280
10319
|
] })
|
|
10281
10320
|
] }) : /* @__PURE__ */ jsx18(Text16, { dimColor: true, children: "Nothing to push \u2014 everything is already up to date." }),
|
|
10282
|
-
/* @__PURE__ */ jsxs16(Box16, { gap: 1, marginTop: 1, children: [
|
|
10283
|
-
/* @__PURE__ */ jsx18(Text16, { dimColor: true, children: "Space:" }),
|
|
10284
|
-
/* @__PURE__ */ jsx18(Text16, { children: spaceId }),
|
|
10285
|
-
/* @__PURE__ */ jsx18(Text16, { dimColor: true, children: "/" }),
|
|
10286
|
-
/* @__PURE__ */ jsx18(Text16, { dimColor: true, children: "Environment:" }),
|
|
10287
|
-
/* @__PURE__ */ jsx18(Text16, { children: environmentId })
|
|
10288
|
-
] }),
|
|
10289
10321
|
breakingWithImpact && /* @__PURE__ */ jsx18(Box16, { marginTop: 1, children: /* @__PURE__ */ jsx18(Text16, { color: PALETTE.error, bold: true, children: "\u26A0 Breaking changes will affect downstream entities. Press Enter to acknowledge and apply." }) }),
|
|
10290
10322
|
/* @__PURE__ */ jsx18(SpaceEnvironment, { spaceId, environmentId }),
|
|
10291
10323
|
/* @__PURE__ */ jsxs16(Box16, { gap: 3, marginTop: 1, children: [
|
|
@@ -20023,7 +20055,17 @@ function toSidebarEntry(c2) {
|
|
|
20023
20055
|
if (Object.keys($slots).length > 0) entry.$slots = $slots;
|
|
20024
20056
|
return entry;
|
|
20025
20057
|
}
|
|
20026
|
-
function ScopeGateStep(
|
|
20058
|
+
function ScopeGateStep(props) {
|
|
20059
|
+
if (props.components.length === 0) {
|
|
20060
|
+
return /* @__PURE__ */ jsx32(Box28, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx32(Text29, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
20061
|
+
}
|
|
20062
|
+
return /* @__PURE__ */ jsx32(ScopeGateStepView, { ...props, components: [...props.components] });
|
|
20063
|
+
}
|
|
20064
|
+
function ScopeGateStepView({
|
|
20065
|
+
components,
|
|
20066
|
+
onConfirm,
|
|
20067
|
+
onQuit
|
|
20068
|
+
}) {
|
|
20027
20069
|
const { stdout } = useStdout2();
|
|
20028
20070
|
const totalWidth = stdout?.columns ?? 80;
|
|
20029
20071
|
const columnPlan = useMemo2(() => computeColumnWidths(totalWidth), [totalWidth]);
|
|
@@ -20986,23 +21028,6 @@ var init_ScopeGateStep = __esm({
|
|
|
20986
21028
|
}
|
|
20987
21029
|
});
|
|
20988
21030
|
|
|
20989
|
-
// packages/experience-design-system-cli/src/import/tui/scope-gate-host.tsx
|
|
20990
|
-
import { Box as Box29, Text as Text30 } from "ink";
|
|
20991
|
-
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
20992
|
-
function ScopeGateHost({ components, onConfirm, onQuit }) {
|
|
20993
|
-
if (components.length === 0) {
|
|
20994
|
-
return /* @__PURE__ */ jsx33(Box29, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx33(Text30, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) });
|
|
20995
|
-
}
|
|
20996
|
-
return /* @__PURE__ */ jsx33(ScopeGateStep, { components: [...components], onConfirm, onQuit });
|
|
20997
|
-
}
|
|
20998
|
-
var init_scope_gate_host = __esm({
|
|
20999
|
-
"packages/experience-design-system-cli/src/import/tui/scope-gate-host.tsx"() {
|
|
21000
|
-
"use strict";
|
|
21001
|
-
init_theme();
|
|
21002
|
-
init_ScopeGateStep();
|
|
21003
|
-
}
|
|
21004
|
-
});
|
|
21005
|
-
|
|
21006
21031
|
// packages/experience-design-system-cli/src/import/tui/steps/review-json-panel.ts
|
|
21007
21032
|
function getReviewJsonPanelValue(selected, showHiddenProps) {
|
|
21008
21033
|
if (!selected) return "";
|
|
@@ -21344,8 +21369,8 @@ var init_cycle_auto_reject = __esm({
|
|
|
21344
21369
|
|
|
21345
21370
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/LineagePanel.tsx
|
|
21346
21371
|
import figures4 from "figures";
|
|
21347
|
-
import { Text as
|
|
21348
|
-
import { jsx as
|
|
21372
|
+
import { Text as Text30 } from "ink";
|
|
21373
|
+
import { jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
21349
21374
|
function LineagePanel({
|
|
21350
21375
|
focusedComponentKey,
|
|
21351
21376
|
entries,
|
|
@@ -21360,7 +21385,7 @@ function LineagePanel({
|
|
|
21360
21385
|
kind: e.kind
|
|
21361
21386
|
}));
|
|
21362
21387
|
const cursorRowIndex = jumpables[cursor]?.i ?? 0;
|
|
21363
|
-
return /* @__PURE__ */
|
|
21388
|
+
return /* @__PURE__ */ jsx33(
|
|
21364
21389
|
GotoBanner,
|
|
21365
21390
|
{
|
|
21366
21391
|
title: `Lineage: ${focusedComponentKey}`,
|
|
@@ -21372,20 +21397,20 @@ function LineagePanel({
|
|
|
21372
21397
|
footerHint: LINEAGE_FOOTER_HINT,
|
|
21373
21398
|
renderRow: (row, i, isCursor) => {
|
|
21374
21399
|
if (row.kind === "section") {
|
|
21375
|
-
return /* @__PURE__ */ jsxs30(
|
|
21400
|
+
return /* @__PURE__ */ jsxs30(Text30, { bold: true, children: [
|
|
21376
21401
|
" ",
|
|
21377
21402
|
row.label
|
|
21378
21403
|
] }, i);
|
|
21379
21404
|
}
|
|
21380
21405
|
if (row.kind === "empty") {
|
|
21381
|
-
return /* @__PURE__ */ jsxs30(
|
|
21382
|
-
/* @__PURE__ */
|
|
21383
|
-
/* @__PURE__ */
|
|
21406
|
+
return /* @__PURE__ */ jsxs30(Text30, { children: [
|
|
21407
|
+
/* @__PURE__ */ jsx33(Text30, { children: " " }),
|
|
21408
|
+
/* @__PURE__ */ jsx33(Text30, { dimColor: true, children: " " + row.label })
|
|
21384
21409
|
] }, i);
|
|
21385
21410
|
}
|
|
21386
|
-
return /* @__PURE__ */ jsxs30(
|
|
21387
|
-
isCursor ? /* @__PURE__ */
|
|
21388
|
-
/* @__PURE__ */
|
|
21411
|
+
return /* @__PURE__ */ jsxs30(Text30, { children: [
|
|
21412
|
+
isCursor ? /* @__PURE__ */ jsx33(Text30, { color: PALETTE.info, bold: true, children: figures4.pointer }) : /* @__PURE__ */ jsx33(Text30, { children: " " }),
|
|
21413
|
+
/* @__PURE__ */ jsx33(Text30, { inverse: isCursor, children: " " + row.label })
|
|
21389
21414
|
] }, i);
|
|
21390
21415
|
}
|
|
21391
21416
|
}
|
|
@@ -21558,13 +21583,13 @@ var init_scroll_offset = __esm({
|
|
|
21558
21583
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/FieldEditor.tsx
|
|
21559
21584
|
import React15, { useState as useState15 } from "react";
|
|
21560
21585
|
import figures5 from "figures";
|
|
21561
|
-
import { Box as
|
|
21586
|
+
import { Box as Box29, Text as Text31 } from "ink";
|
|
21562
21587
|
import {
|
|
21563
21588
|
CDF_PROPERTY_TYPES,
|
|
21564
21589
|
CDF_PROPERTY_CATEGORIES,
|
|
21565
21590
|
DESIGN_TOKEN_TYPES as DESIGN_TOKEN_TYPES2
|
|
21566
21591
|
} from "@contentful/experience-design-system-types";
|
|
21567
|
-
import { Fragment as Fragment9, jsx as
|
|
21592
|
+
import { Fragment as Fragment9, jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
21568
21593
|
function removeAt(values, index) {
|
|
21569
21594
|
return values.filter((_, i) => i !== index);
|
|
21570
21595
|
}
|
|
@@ -21687,25 +21712,25 @@ function serializeState(state, originalJson) {
|
|
|
21687
21712
|
return JSON.stringify(entry, null, 2);
|
|
21688
21713
|
}
|
|
21689
21714
|
function Picker({ value, active }) {
|
|
21690
|
-
return /* @__PURE__ */ jsxs31(
|
|
21691
|
-
active && /* @__PURE__ */
|
|
21692
|
-
/* @__PURE__ */
|
|
21693
|
-
active && /* @__PURE__ */
|
|
21715
|
+
return /* @__PURE__ */ jsxs31(Box29, { children: [
|
|
21716
|
+
active && /* @__PURE__ */ jsx34(Text31, { color: PALETTE.info, children: "\u2039" }),
|
|
21717
|
+
/* @__PURE__ */ jsx34(Text31, { color: active ? PALETTE.info : PALETTE.inverse, bold: active, children: value }),
|
|
21718
|
+
active && /* @__PURE__ */ jsx34(Text31, { color: PALETTE.info, children: "\u203A" })
|
|
21694
21719
|
] });
|
|
21695
21720
|
}
|
|
21696
21721
|
function Toggle({ value, active }) {
|
|
21697
|
-
return /* @__PURE__ */
|
|
21722
|
+
return /* @__PURE__ */ jsx34(Box29, { children: /* @__PURE__ */ jsx34(Text31, { color: active ? PALETTE.info : value ? PALETTE.success : void 0, children: value ? "[\u2713]" : "[ ]" }) });
|
|
21698
21723
|
}
|
|
21699
21724
|
function DefaultValueRow({ display, active }) {
|
|
21700
|
-
return /* @__PURE__ */ jsxs31(
|
|
21701
|
-
/* @__PURE__ */
|
|
21702
|
-
active ? /* @__PURE__ */
|
|
21725
|
+
return /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21726
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "default:" }),
|
|
21727
|
+
active ? /* @__PURE__ */ jsx34(Picker, { value: display, active: true }) : /* @__PURE__ */ jsx34(Text31, { color: PALETTE.inverse, children: display })
|
|
21703
21728
|
] });
|
|
21704
21729
|
}
|
|
21705
21730
|
function RowLabel({ name, selected }) {
|
|
21706
21731
|
const nameDisplay = name.length > 14 ? name.slice(0, 13) + "\u2026" : name.padEnd(14);
|
|
21707
21732
|
return /* @__PURE__ */ jsxs31(
|
|
21708
|
-
|
|
21733
|
+
Text31,
|
|
21709
21734
|
{
|
|
21710
21735
|
color: selected ? PALETTE.inverse : PALETTE.info,
|
|
21711
21736
|
bold: selected,
|
|
@@ -21723,10 +21748,10 @@ function ValueInputRow({
|
|
|
21723
21748
|
valueText,
|
|
21724
21749
|
cursorVisible
|
|
21725
21750
|
}) {
|
|
21726
|
-
return /* @__PURE__ */ jsxs31(
|
|
21727
|
-
/* @__PURE__ */
|
|
21728
|
-
/* @__PURE__ */
|
|
21729
|
-
/* @__PURE__ */
|
|
21751
|
+
return /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, children: [
|
|
21752
|
+
/* @__PURE__ */ jsx34(Text31, { color: PALETTE.info, children: mode === "edit" ? "\u270E " : "+ " }),
|
|
21753
|
+
/* @__PURE__ */ jsx34(Text31, { children: valueText }),
|
|
21754
|
+
/* @__PURE__ */ jsx34(Text31, { inverse: cursorVisible, children: " " })
|
|
21730
21755
|
] });
|
|
21731
21756
|
}
|
|
21732
21757
|
function EditableListItem({
|
|
@@ -21739,9 +21764,9 @@ function EditableListItem({
|
|
|
21739
21764
|
}) {
|
|
21740
21765
|
const isBeingEdited = editingValue?.mode === "edit" && editingValue.index === index;
|
|
21741
21766
|
if (isBeingEdited) {
|
|
21742
|
-
return /* @__PURE__ */
|
|
21767
|
+
return /* @__PURE__ */ jsx34(ValueInputRow, { mode: "edit", valueText, cursorVisible });
|
|
21743
21768
|
}
|
|
21744
|
-
return /* @__PURE__ */
|
|
21769
|
+
return /* @__PURE__ */ jsx34(Box29, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx34(Text31, { color: active ? PALETTE.info : PALETTE.inverse, children: active ? `${figures5.pointer} ${value}` : ` ${value}` }) });
|
|
21745
21770
|
}
|
|
21746
21771
|
function EditableValueList({
|
|
21747
21772
|
values,
|
|
@@ -21755,8 +21780,8 @@ function EditableValueList({
|
|
|
21755
21780
|
showAddInput
|
|
21756
21781
|
}) {
|
|
21757
21782
|
return /* @__PURE__ */ jsxs31(Fragment9, { children: [
|
|
21758
|
-
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */
|
|
21759
|
-
values.map((value, index) => /* @__PURE__ */
|
|
21783
|
+
values.length === 0 && !editingValue && (emptyPaddingLeft === void 0 ? /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: emptyMessage }) : /* @__PURE__ */ jsx34(Box29, { paddingLeft: emptyPaddingLeft, children: /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: emptyMessage }) })),
|
|
21784
|
+
values.map((value, index) => /* @__PURE__ */ jsx34(
|
|
21760
21785
|
EditableListItem,
|
|
21761
21786
|
{
|
|
21762
21787
|
value,
|
|
@@ -21768,7 +21793,7 @@ function EditableValueList({
|
|
|
21768
21793
|
},
|
|
21769
21794
|
index
|
|
21770
21795
|
)),
|
|
21771
|
-
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */
|
|
21796
|
+
showAddInput && editingValue?.mode === "add" && /* @__PURE__ */ jsx34(ValueInputRow, { mode: "add", valueText, cursorVisible })
|
|
21772
21797
|
] });
|
|
21773
21798
|
}
|
|
21774
21799
|
function DefaultSubRow({
|
|
@@ -21779,39 +21804,39 @@ function DefaultSubRow({
|
|
|
21779
21804
|
}) {
|
|
21780
21805
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
21781
21806
|
if (prop.type === "richtext" || prop.type === "media" || prop.type === "link") {
|
|
21782
|
-
return /* @__PURE__ */ jsxs31(
|
|
21783
|
-
/* @__PURE__ */
|
|
21784
|
-
/* @__PURE__ */
|
|
21807
|
+
return /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21808
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "default:" }),
|
|
21809
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "(not applicable)" })
|
|
21785
21810
|
] });
|
|
21786
21811
|
}
|
|
21787
21812
|
if (prop.type === "boolean") {
|
|
21788
21813
|
const display = prop.default === true ? "true" : prop.default === false ? "false" : "(unset)";
|
|
21789
|
-
return /* @__PURE__ */
|
|
21814
|
+
return /* @__PURE__ */ jsx34(DefaultValueRow, { display, active });
|
|
21790
21815
|
}
|
|
21791
21816
|
if (prop.type === "enum") {
|
|
21792
21817
|
if (prop.values.length === 0) {
|
|
21793
|
-
return /* @__PURE__ */ jsxs31(
|
|
21794
|
-
/* @__PURE__ */
|
|
21795
|
-
/* @__PURE__ */
|
|
21818
|
+
return /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21819
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "default:" }),
|
|
21820
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "(no values defined)" })
|
|
21796
21821
|
] });
|
|
21797
21822
|
}
|
|
21798
21823
|
const display = typeof prop.default === "string" && prop.default !== "" ? prop.default : "(unset)";
|
|
21799
|
-
return /* @__PURE__ */
|
|
21824
|
+
return /* @__PURE__ */ jsx34(DefaultValueRow, { display, active });
|
|
21800
21825
|
}
|
|
21801
21826
|
const value = typeof prop.default === "string" ? prop.default : "";
|
|
21802
21827
|
if (active) {
|
|
21803
|
-
return /* @__PURE__ */ jsxs31(
|
|
21804
|
-
/* @__PURE__ */
|
|
21805
|
-
/* @__PURE__ */ jsxs31(
|
|
21806
|
-
/* @__PURE__ */
|
|
21807
|
-
/* @__PURE__ */
|
|
21808
|
-
/* @__PURE__ */
|
|
21828
|
+
return /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, flexDirection: "row", children: [
|
|
21829
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "default:" }),
|
|
21830
|
+
/* @__PURE__ */ jsxs31(Box29, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
21831
|
+
/* @__PURE__ */ jsx34(Text31, { children: value.slice(0, textCursor) }),
|
|
21832
|
+
/* @__PURE__ */ jsx34(Text31, { inverse: cursorVisible, children: value[textCursor] ?? cursor }),
|
|
21833
|
+
/* @__PURE__ */ jsx34(Text31, { children: value.slice(textCursor + 1) })
|
|
21809
21834
|
] })
|
|
21810
21835
|
] });
|
|
21811
21836
|
}
|
|
21812
|
-
return /* @__PURE__ */ jsxs31(
|
|
21813
|
-
/* @__PURE__ */
|
|
21814
|
-
/* @__PURE__ */
|
|
21837
|
+
return /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21838
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "default:" }),
|
|
21839
|
+
/* @__PURE__ */ jsx34(Text31, { color: value ? PALETTE.inverse : void 0, dimColor: !value, children: value || "(none)" })
|
|
21815
21840
|
] });
|
|
21816
21841
|
}
|
|
21817
21842
|
function PropRow({
|
|
@@ -21829,28 +21854,28 @@ function PropRow({
|
|
|
21829
21854
|
}) {
|
|
21830
21855
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
21831
21856
|
const descActive = activeField === "description";
|
|
21832
|
-
return /* @__PURE__ */ jsxs31(
|
|
21833
|
-
/* @__PURE__ */ jsxs31(
|
|
21834
|
-
/* @__PURE__ */
|
|
21835
|
-
/* @__PURE__ */
|
|
21836
|
-
activeField === "type" ? /* @__PURE__ */
|
|
21837
|
-
activeField === "category" && /* @__PURE__ */
|
|
21838
|
-
/* @__PURE__ */
|
|
21839
|
-
activeField === "required" ? /* @__PURE__ */
|
|
21857
|
+
return /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", width, children: [
|
|
21858
|
+
/* @__PURE__ */ jsxs31(Box29, { gap: 1, children: [
|
|
21859
|
+
/* @__PURE__ */ jsx34(RowLabel, { name: prop.name, selected }),
|
|
21860
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: !selected, children: "type:" }),
|
|
21861
|
+
activeField === "type" ? /* @__PURE__ */ jsx34(Picker, { value: prop.type, active: true }) : /* @__PURE__ */ jsx34(Text31, { color: selected ? PALETTE.warning : PALETTE.inverse, children: prop.type }),
|
|
21862
|
+
activeField === "category" && /* @__PURE__ */ jsx34(Picker, { value: prop.category, active: true }),
|
|
21863
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: !selected, children: "req:" }),
|
|
21864
|
+
activeField === "required" ? /* @__PURE__ */ jsx34(Toggle, { value: prop.required, active: true }) : /* @__PURE__ */ jsx34(Toggle, { value: prop.required, active: false }),
|
|
21840
21865
|
prop.type === "enum" && /* @__PURE__ */ jsxs31(Fragment9, { children: [
|
|
21841
|
-
/* @__PURE__ */
|
|
21842
|
-
/* @__PURE__ */ jsxs31(
|
|
21866
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: !selected, children: "values:" }),
|
|
21867
|
+
/* @__PURE__ */ jsxs31(Text31, { color: selected ? PALETTE.warning : PALETTE.inverse, children: [
|
|
21843
21868
|
"[",
|
|
21844
21869
|
prop.values.join(", "),
|
|
21845
21870
|
"]"
|
|
21846
21871
|
] })
|
|
21847
21872
|
] }),
|
|
21848
21873
|
prop.type === "token" && /* @__PURE__ */ jsxs31(Fragment9, { children: [
|
|
21849
|
-
/* @__PURE__ */
|
|
21850
|
-
activeField === "tokenKind" ? /* @__PURE__ */
|
|
21874
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: !selected, children: "kind:" }),
|
|
21875
|
+
activeField === "tokenKind" ? /* @__PURE__ */ jsx34(Picker, { value: prop.tokenKind || DESIGN_TOKEN_TYPES2[0], active: true }) : /* @__PURE__ */ jsx34(Text31, { color: selected ? PALETTE.success : PALETTE.inverse, children: prop.tokenKind || "\u2014" })
|
|
21851
21876
|
] })
|
|
21852
21877
|
] }),
|
|
21853
|
-
selected && /* @__PURE__ */
|
|
21878
|
+
selected && /* @__PURE__ */ jsx34(
|
|
21854
21879
|
DefaultSubRow,
|
|
21855
21880
|
{
|
|
21856
21881
|
prop,
|
|
@@ -21859,33 +21884,33 @@ function PropRow({
|
|
|
21859
21884
|
cursorVisible
|
|
21860
21885
|
}
|
|
21861
21886
|
),
|
|
21862
|
-
selected && descActive && /* @__PURE__ */ jsxs31(
|
|
21863
|
-
/* @__PURE__ */
|
|
21864
|
-
/* @__PURE__ */ jsxs31(
|
|
21865
|
-
/* @__PURE__ */
|
|
21866
|
-
/* @__PURE__ */
|
|
21867
|
-
/* @__PURE__ */
|
|
21887
|
+
selected && descActive && /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, flexDirection: "row", children: [
|
|
21888
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "desc:" }),
|
|
21889
|
+
/* @__PURE__ */ jsxs31(Box29, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
21890
|
+
/* @__PURE__ */ jsx34(Text31, { children: prop.description.slice(0, textCursor) }),
|
|
21891
|
+
/* @__PURE__ */ jsx34(Text31, { inverse: cursorVisible, children: prop.description[textCursor] ?? cursor }),
|
|
21892
|
+
/* @__PURE__ */ jsx34(Text31, { children: prop.description.slice(textCursor + 1) })
|
|
21868
21893
|
] })
|
|
21869
21894
|
] }),
|
|
21870
|
-
selected && !descActive && /* @__PURE__ */ jsxs31(
|
|
21871
|
-
/* @__PURE__ */
|
|
21872
|
-
/* @__PURE__ */
|
|
21895
|
+
selected && !descActive && /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21896
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "desc:" }),
|
|
21897
|
+
/* @__PURE__ */ jsx34(Text31, { color: PALETTE.success, children: prop.description || "\u2014" })
|
|
21873
21898
|
] }),
|
|
21874
|
-
selected && prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs31(
|
|
21875
|
-
/* @__PURE__ */
|
|
21876
|
-
activeField === "allowed" ? /* @__PURE__ */
|
|
21899
|
+
selected && prop.type === "token" && prop.category === "design" && /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, flexDirection: "row", gap: 1, children: [
|
|
21900
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "allowed:" }),
|
|
21901
|
+
activeField === "allowed" ? /* @__PURE__ */ jsx34(Box29, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "press [t] to edit allowed tokens" }) }) : /* @__PURE__ */ jsx34(Text31, { color: prop.allowed.length > 0 ? PALETTE.info : void 0, dimColor: prop.allowed.length === 0, children: prop.allowed.length > 0 ? prop.allowed.join(", ") : "(any)" })
|
|
21877
21902
|
] }),
|
|
21878
|
-
selected && rationale && rationale.trim().length > 0 && /* @__PURE__ */
|
|
21903
|
+
selected && rationale && rationale.trim().length > 0 && /* @__PURE__ */ jsx34(Box29, { paddingLeft: 2, children: /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: (() => {
|
|
21879
21904
|
const max = Math.max(8, width - 8);
|
|
21880
21905
|
const text = `~ ${rationale}`;
|
|
21881
21906
|
return text.length > max ? text.slice(0, max - 1) + "\u2026" : text;
|
|
21882
21907
|
})() }) }, rowKey ? `rationale-${rowKey}` : void 0),
|
|
21883
|
-
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs31(
|
|
21884
|
-
/* @__PURE__ */ jsxs31(
|
|
21885
|
-
/* @__PURE__ */
|
|
21886
|
-
activeField === "values" && /* @__PURE__ */
|
|
21908
|
+
selected && prop.type === "enum" && activeField === "values" && /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, flexDirection: "column", children: [
|
|
21909
|
+
/* @__PURE__ */ jsxs31(Box29, { children: [
|
|
21910
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "values:" }),
|
|
21911
|
+
activeField === "values" && /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: " [a]dd [e]dit [r]emove [\u2191\u2193] navigate [K/J] reorder" })
|
|
21887
21912
|
] }),
|
|
21888
|
-
/* @__PURE__ */
|
|
21913
|
+
/* @__PURE__ */ jsx34(
|
|
21889
21914
|
EditableValueList,
|
|
21890
21915
|
{
|
|
21891
21916
|
values: prop.values,
|
|
@@ -21915,22 +21940,22 @@ function SlotRow({
|
|
|
21915
21940
|
pickerCursor
|
|
21916
21941
|
}) {
|
|
21917
21942
|
const cursor = cursorVisible ? "\u2588" : " ";
|
|
21918
|
-
return /* @__PURE__ */ jsxs31(
|
|
21919
|
-
/* @__PURE__ */ jsxs31(
|
|
21920
|
-
/* @__PURE__ */
|
|
21921
|
-
/* @__PURE__ */
|
|
21922
|
-
activeField === "required" ? /* @__PURE__ */
|
|
21943
|
+
return /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", width, children: [
|
|
21944
|
+
/* @__PURE__ */ jsxs31(Box29, { gap: 1, children: [
|
|
21945
|
+
/* @__PURE__ */ jsx34(RowLabel, { name: slot.name, selected }),
|
|
21946
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: !selected, children: "req:" }),
|
|
21947
|
+
activeField === "required" ? /* @__PURE__ */ jsx34(Toggle, { value: slot.required, active: true }) : /* @__PURE__ */ jsx34(Toggle, { value: slot.required, active: false })
|
|
21923
21948
|
] }),
|
|
21924
|
-
!selected && /* @__PURE__ */ jsxs31(
|
|
21925
|
-
/* @__PURE__ */
|
|
21926
|
-
slot.allowedComponents.length === 0 ? /* @__PURE__ */
|
|
21949
|
+
!selected && /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
21950
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "allowed:" }),
|
|
21951
|
+
slot.allowedComponents.length === 0 ? /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "(any)" }) : /* @__PURE__ */ jsx34(Text31, { color: PALETTE.info, children: slot.allowedComponents.join(", ") })
|
|
21927
21952
|
] }),
|
|
21928
|
-
selected && /* @__PURE__ */ jsxs31(
|
|
21929
|
-
/* @__PURE__ */ jsxs31(
|
|
21930
|
-
/* @__PURE__ */
|
|
21931
|
-
activeField === "allowedComponents" && /* @__PURE__ */
|
|
21953
|
+
selected && /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, flexDirection: "column", children: [
|
|
21954
|
+
/* @__PURE__ */ jsxs31(Box29, { children: [
|
|
21955
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "allowed:" }),
|
|
21956
|
+
activeField === "allowedComponents" && /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: slot.allowedComponents.length > 0 ? " [a]dd [e]dit [r]emove [\u2190\u2192] cycle [\u2191\u2193] navigate [K/J] reorder" : " [a]dd [e]dit [r]emove [\u2191\u2193] navigate [K/J] reorder" })
|
|
21932
21957
|
] }),
|
|
21933
|
-
/* @__PURE__ */
|
|
21958
|
+
/* @__PURE__ */ jsx34(
|
|
21934
21959
|
EditableValueList,
|
|
21935
21960
|
{
|
|
21936
21961
|
values: slot.allowedComponents,
|
|
@@ -21944,36 +21969,36 @@ function SlotRow({
|
|
|
21944
21969
|
showAddInput: activeField === "allowedComponents"
|
|
21945
21970
|
}
|
|
21946
21971
|
),
|
|
21947
|
-
editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */
|
|
21972
|
+
editingValue?.mode === "add" && activeField === "allowedComponents" && pickerCandidates !== null && /* @__PURE__ */ jsx34(Box29, { paddingLeft: 2, flexDirection: "column", children: pickerCandidates.length === 0 ? /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "(no valid components to add \u2014 all remaining candidates would create cycles)" }) : (() => {
|
|
21948
21973
|
const filtered = valueText.length === 0 ? pickerCandidates : pickerCandidates.filter((n) => n.toLowerCase().includes(valueText.toLowerCase()));
|
|
21949
21974
|
if (filtered.length === 0) {
|
|
21950
|
-
return /* @__PURE__ */
|
|
21975
|
+
return /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "(no candidates match \u2014 Enter to add as free text)" });
|
|
21951
21976
|
}
|
|
21952
21977
|
const cursor2 = pickerCursor % filtered.length;
|
|
21953
21978
|
const MAX_VISIBLE = 5;
|
|
21954
21979
|
const start = Math.max(0, Math.min(filtered.length - MAX_VISIBLE, cursor2 - 2));
|
|
21955
21980
|
const slice = filtered.slice(start, start + MAX_VISIBLE);
|
|
21956
|
-
return /* @__PURE__ */ jsxs31(
|
|
21957
|
-
/* @__PURE__ */
|
|
21981
|
+
return /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", children: [
|
|
21982
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: " candidates (\u2191\u2193 cycle, Enter to add):" }),
|
|
21958
21983
|
slice.map((name, i) => {
|
|
21959
21984
|
const absIdx = start + i;
|
|
21960
21985
|
const isCursor = absIdx === cursor2;
|
|
21961
|
-
return /* @__PURE__ */
|
|
21986
|
+
return /* @__PURE__ */ jsx34(Text31, { color: isCursor ? PALETTE.info : void 0, dimColor: !isCursor, children: isCursor ? ` ${figures5.pointer} ${name}` : ` ${name}` }, name);
|
|
21962
21987
|
})
|
|
21963
21988
|
] });
|
|
21964
21989
|
})() })
|
|
21965
21990
|
] }),
|
|
21966
|
-
selected && activeField === "description" && /* @__PURE__ */ jsxs31(
|
|
21967
|
-
/* @__PURE__ */
|
|
21968
|
-
/* @__PURE__ */ jsxs31(
|
|
21969
|
-
/* @__PURE__ */
|
|
21970
|
-
/* @__PURE__ */
|
|
21971
|
-
/* @__PURE__ */
|
|
21991
|
+
selected && activeField === "description" && /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, flexDirection: "row", children: [
|
|
21992
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "desc:" }),
|
|
21993
|
+
/* @__PURE__ */ jsxs31(Box29, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
21994
|
+
/* @__PURE__ */ jsx34(Text31, { children: slot.description.slice(0, textCursor) }),
|
|
21995
|
+
/* @__PURE__ */ jsx34(Text31, { inverse: cursorVisible, children: slot.description[textCursor] ?? cursor }),
|
|
21996
|
+
/* @__PURE__ */ jsx34(Text31, { children: slot.description.slice(textCursor + 1) })
|
|
21972
21997
|
] })
|
|
21973
21998
|
] }),
|
|
21974
|
-
selected && activeField !== "description" && /* @__PURE__ */ jsxs31(
|
|
21975
|
-
/* @__PURE__ */
|
|
21976
|
-
/* @__PURE__ */
|
|
21999
|
+
selected && activeField !== "description" && /* @__PURE__ */ jsxs31(Box29, { paddingLeft: 2, gap: 1, children: [
|
|
22000
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "desc:" }),
|
|
22001
|
+
/* @__PURE__ */ jsx34(Text31, { color: PALETTE.success, children: slot.description || "\u2014" })
|
|
21977
22002
|
] })
|
|
21978
22003
|
] });
|
|
21979
22004
|
}
|
|
@@ -22757,18 +22782,18 @@ function FieldEditor({
|
|
|
22757
22782
|
});
|
|
22758
22783
|
const innerWidth = Math.max(1, width - 2);
|
|
22759
22784
|
if (parseErr) {
|
|
22760
|
-
return /* @__PURE__ */ jsxs31(
|
|
22761
|
-
/* @__PURE__ */
|
|
22762
|
-
/* @__PURE__ */
|
|
22763
|
-
/* @__PURE__ */
|
|
22785
|
+
return /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.error, children: [
|
|
22786
|
+
/* @__PURE__ */ jsx34(Text31, { bold: true, color: PALETTE.error, children: "FIELD EDITOR \u2014 parse error" }),
|
|
22787
|
+
/* @__PURE__ */ jsx34(Text31, { color: PALETTE.error, children: parseErr }),
|
|
22788
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "Cannot display structured editor. Fix the JSON first." })
|
|
22764
22789
|
] });
|
|
22765
22790
|
}
|
|
22766
22791
|
if (props.length === 0 && slots.length === 0) {
|
|
22767
|
-
return /* @__PURE__ */ jsxs31(
|
|
22768
|
-
/* @__PURE__ */
|
|
22769
|
-
/* @__PURE__ */
|
|
22770
|
-
/* @__PURE__ */
|
|
22771
|
-
/* @__PURE__ */
|
|
22792
|
+
return /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", width, borderStyle: "single", borderColor: PALETTE.warning, children: [
|
|
22793
|
+
/* @__PURE__ */ jsx34(Text31, { bold: true, color: PALETTE.warning, children: "FIELD EDITOR \u2014 no fields" }),
|
|
22794
|
+
/* @__PURE__ */ jsx34(Text31, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify." }),
|
|
22795
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "You can add fields manually below or reject this component." }),
|
|
22796
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "Ctrl+S to save \xB7 Esc to discard" })
|
|
22772
22797
|
] });
|
|
22773
22798
|
}
|
|
22774
22799
|
const hasEmptyProperties = props.length === 0 && slots.length === 0;
|
|
@@ -22820,25 +22845,25 @@ function FieldEditor({
|
|
|
22820
22845
|
const scrollStart = selectedRowIdx < 0 ? 0 : Math.max(0, Math.min(selectedRowIdx, rows.length - visibleRows));
|
|
22821
22846
|
const visibleRowSlice = rows.slice(scrollStart, scrollStart + visibleRows);
|
|
22822
22847
|
return /* @__PURE__ */ jsxs31(
|
|
22823
|
-
|
|
22848
|
+
Box29,
|
|
22824
22849
|
{
|
|
22825
22850
|
flexDirection: "column",
|
|
22826
22851
|
width,
|
|
22827
22852
|
borderStyle: "single",
|
|
22828
22853
|
borderColor: hasEmptyProperties ? PALETTE.warning : PALETTE.info,
|
|
22829
22854
|
children: [
|
|
22830
|
-
hasEmptyProperties && /* @__PURE__ */
|
|
22831
|
-
/* @__PURE__ */
|
|
22855
|
+
hasEmptyProperties && /* @__PURE__ */ jsx34(Text31, { color: PALETTE.warning, children: "\u26A0 No properties classified for this component. The LLM didn't find anything to classify. Reject this component or add fields manually." }),
|
|
22856
|
+
/* @__PURE__ */ jsx34(Box29, { flexDirection: "column", width: innerWidth, children: visibleRowSlice.map((row, i) => {
|
|
22832
22857
|
if (row.kind === "header") {
|
|
22833
|
-
return /* @__PURE__ */
|
|
22858
|
+
return /* @__PURE__ */ jsx34(Text31, { bold: true, color: PALETTE.success, children: row.label }, `header-${i}`);
|
|
22834
22859
|
}
|
|
22835
22860
|
if (row.kind === "component-description") {
|
|
22836
22861
|
const isSelected2 = inComponentDesc;
|
|
22837
22862
|
const isEditing = isSelected2 && focusLevel === "field" && activeField === "description";
|
|
22838
22863
|
const desc = editorState.componentDescription;
|
|
22839
|
-
return /* @__PURE__ */
|
|
22840
|
-
/* @__PURE__ */
|
|
22841
|
-
|
|
22864
|
+
return /* @__PURE__ */ jsx34(Box29, { flexDirection: "column", children: /* @__PURE__ */ jsxs31(Box29, { gap: 1, children: [
|
|
22865
|
+
/* @__PURE__ */ jsx34(
|
|
22866
|
+
Text31,
|
|
22842
22867
|
{
|
|
22843
22868
|
color: isSelected2 ? PALETTE.inverse : PALETTE.info,
|
|
22844
22869
|
bold: isSelected2,
|
|
@@ -22846,18 +22871,18 @@ function FieldEditor({
|
|
|
22846
22871
|
children: " description: "
|
|
22847
22872
|
}
|
|
22848
22873
|
),
|
|
22849
|
-
isEditing ? /* @__PURE__ */ jsxs31(
|
|
22850
|
-
/* @__PURE__ */
|
|
22851
|
-
/* @__PURE__ */
|
|
22852
|
-
/* @__PURE__ */
|
|
22853
|
-
] }) : /* @__PURE__ */
|
|
22874
|
+
isEditing ? /* @__PURE__ */ jsxs31(Box29, { flexGrow: 1, borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
22875
|
+
/* @__PURE__ */ jsx34(Text31, { children: desc.slice(0, textCursor) }),
|
|
22876
|
+
/* @__PURE__ */ jsx34(Text31, { inverse: cursorVisible, children: desc[textCursor] ?? (cursorVisible ? "\u2588" : " ") }),
|
|
22877
|
+
/* @__PURE__ */ jsx34(Text31, { children: desc.slice(textCursor + 1) })
|
|
22878
|
+
] }) : /* @__PURE__ */ jsx34(Text31, { color: isSelected2 ? PALETTE.warning : PALETTE.inverse, dimColor: !desc, children: desc || "(none \u2014 Return to edit)" })
|
|
22854
22879
|
] }) }, `component-description-${i}`);
|
|
22855
22880
|
}
|
|
22856
22881
|
if (row.kind === "prop") {
|
|
22857
22882
|
const p = props[row.idx];
|
|
22858
22883
|
const isSelected2 = !inSlots && !inComponentDesc && row.idx === propIdx;
|
|
22859
22884
|
const propMeta = metadata?.props?.[p.name];
|
|
22860
|
-
return /* @__PURE__ */
|
|
22885
|
+
return /* @__PURE__ */ jsx34(
|
|
22861
22886
|
PropRow,
|
|
22862
22887
|
{
|
|
22863
22888
|
prop: p,
|
|
@@ -22878,7 +22903,7 @@ function FieldEditor({
|
|
|
22878
22903
|
const s = slots[row.idx];
|
|
22879
22904
|
const isSelected = inSlots && row.idx === slotIdx;
|
|
22880
22905
|
const slotPickerCandidates = isSelected && editingValue?.mode === "add" && activeField === "allowedComponents" && projectSlotGraph && currentComponentName ? computeAllowedComponentCandidates(projectSlotGraph, currentComponentName, slots, s.name) : null;
|
|
22881
|
-
return /* @__PURE__ */
|
|
22906
|
+
return /* @__PURE__ */ jsx34(
|
|
22882
22907
|
SlotRow,
|
|
22883
22908
|
{
|
|
22884
22909
|
slot: s,
|
|
@@ -22904,50 +22929,50 @@ function FieldEditor({
|
|
|
22904
22929
|
const src = metadata?.componentSource ?? null;
|
|
22905
22930
|
const headerPath = path ?? "<unknown source path>";
|
|
22906
22931
|
if (!start || !end || !src) {
|
|
22907
|
-
return /* @__PURE__ */ jsxs31(
|
|
22908
|
-
/* @__PURE__ */
|
|
22909
|
-
/* @__PURE__ */
|
|
22910
|
-
/* @__PURE__ */
|
|
22932
|
+
return /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
22933
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, bold: true, children: `source: ${headerPath}` }),
|
|
22934
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "(no source location captured for this prop)" }),
|
|
22935
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "[s] close" })
|
|
22911
22936
|
] });
|
|
22912
22937
|
}
|
|
22913
22938
|
const lines = src.split("\n").slice(Math.max(0, start - 1), end);
|
|
22914
|
-
return /* @__PURE__ */ jsxs31(
|
|
22915
|
-
/* @__PURE__ */
|
|
22916
|
-
lines.map((ln, i) => /* @__PURE__ */
|
|
22917
|
-
/* @__PURE__ */
|
|
22939
|
+
return /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", borderStyle: "single", borderColor: "gray", paddingX: 1, children: [
|
|
22940
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, bold: true, children: `${headerPath}: lines ${start}\u2013${end}` }),
|
|
22941
|
+
lines.map((ln, i) => /* @__PURE__ */ jsx34(Text31, { dimColor: true, children: ln }, `source-line-${i}`)),
|
|
22942
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "[s] close \xB7 [Esc] close" })
|
|
22918
22943
|
] });
|
|
22919
22944
|
})(),
|
|
22920
|
-
showHelp && /* @__PURE__ */ jsxs31(
|
|
22921
|
-
/* @__PURE__ */
|
|
22922
|
-
/* @__PURE__ */
|
|
22923
|
-
/* @__PURE__ */
|
|
22924
|
-
/* @__PURE__ */
|
|
22925
|
-
/* @__PURE__ */
|
|
22926
|
-
/* @__PURE__ */
|
|
22927
|
-
/* @__PURE__ */
|
|
22928
|
-
/* @__PURE__ */
|
|
22929
|
-
/* @__PURE__ */
|
|
22930
|
-
/* @__PURE__ */
|
|
22931
|
-
/* @__PURE__ */
|
|
22932
|
-
/* @__PURE__ */
|
|
22933
|
-
/* @__PURE__ */
|
|
22934
|
-
/* @__PURE__ */
|
|
22935
|
-
/* @__PURE__ */
|
|
22936
|
-
/* @__PURE__ */
|
|
22937
|
-
/* @__PURE__ */
|
|
22938
|
-
/* @__PURE__ */
|
|
22939
|
-
/* @__PURE__ */
|
|
22940
|
-
/* @__PURE__ */
|
|
22941
|
-
/* @__PURE__ */
|
|
22942
|
-
/* @__PURE__ */
|
|
22943
|
-
/* @__PURE__ */
|
|
22944
|
-
/* @__PURE__ */
|
|
22945
|
-
/* @__PURE__ */
|
|
22946
|
-
/* @__PURE__ */
|
|
22947
|
-
/* @__PURE__ */
|
|
22945
|
+
showHelp && /* @__PURE__ */ jsxs31(Box29, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.info, paddingX: 1, children: [
|
|
22946
|
+
/* @__PURE__ */ jsx34(Text31, { bold: true, color: PALETTE.info, children: "Keybindings" }),
|
|
22947
|
+
/* @__PURE__ */ jsx34(Text31, { children: " " }),
|
|
22948
|
+
/* @__PURE__ */ jsx34(Text31, { bold: true, children: "Row navigation" }),
|
|
22949
|
+
/* @__PURE__ */ jsx34(Text31, { children: " \u2191/\u2193 or j/k move between rows" }),
|
|
22950
|
+
/* @__PURE__ */ jsx34(Text31, { children: " Enter edit fields on the current row" }),
|
|
22951
|
+
/* @__PURE__ */ jsx34(Text31, { children: " Esc exit the panel" }),
|
|
22952
|
+
/* @__PURE__ */ jsx34(Text31, { children: " " }),
|
|
22953
|
+
/* @__PURE__ */ jsx34(Text31, { bold: true, children: "Field editing" }),
|
|
22954
|
+
/* @__PURE__ */ jsx34(Text31, { children: " \u2191/\u2193 or j/k cycle through fields (j/k literal in text inputs)" }),
|
|
22955
|
+
/* @__PURE__ */ jsx34(Text31, { children: " \u2190/\u2192 cycle picker values \xB7 move cursor in text inputs" }),
|
|
22956
|
+
/* @__PURE__ */ jsx34(Text31, { children: " Space/Enter toggle required" }),
|
|
22957
|
+
/* @__PURE__ */ jsx34(Text31, { children: " Type edit description / string default" }),
|
|
22958
|
+
/* @__PURE__ */ jsx34(Text31, { children: " Ctrl+S save changes" }),
|
|
22959
|
+
/* @__PURE__ */ jsx34(Text31, { children: " Esc exit field-edit back to the row" }),
|
|
22960
|
+
/* @__PURE__ */ jsx34(Text31, { children: " " }),
|
|
22961
|
+
/* @__PURE__ */ jsx34(Text31, { bold: true, children: "Values / allowedComponents" }),
|
|
22962
|
+
/* @__PURE__ */ jsx34(Text31, { children: " a / e / r add \xB7 edit \xB7 remove" }),
|
|
22963
|
+
/* @__PURE__ */ jsx34(Text31, { children: " \u2191\u2193 or j/k navigate the list" }),
|
|
22964
|
+
/* @__PURE__ */ jsx34(Text31, { children: " K / J reorder up \xB7 down" }),
|
|
22965
|
+
/* @__PURE__ */ jsx34(Text31, { children: " " }),
|
|
22966
|
+
/* @__PURE__ */ jsx34(Text31, { bold: true, children: "Panels" }),
|
|
22967
|
+
/* @__PURE__ */ jsx34(Text31, { children: " s toggle source-view for the current prop" }),
|
|
22968
|
+
/* @__PURE__ */ jsx34(Text31, { children: " " + propRationaleKey.padEnd(16) + " toggle prop rationale panel" }),
|
|
22969
|
+
/* @__PURE__ */ jsx34(Text31, { children: " " + componentRationaleKey.padEnd(16) + " toggle component rationale panel" }),
|
|
22970
|
+
/* @__PURE__ */ jsx34(Text31, { children: " ? toggle this overlay" }),
|
|
22971
|
+
/* @__PURE__ */ jsx34(Text31, { children: " " }),
|
|
22972
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: "press ? or Esc to close" })
|
|
22948
22973
|
] }),
|
|
22949
|
-
validationError && /* @__PURE__ */
|
|
22950
|
-
/* @__PURE__ */
|
|
22974
|
+
validationError && /* @__PURE__ */ jsx34(Text31, { color: PALETTE.error, children: "\u2717 " + validationError }),
|
|
22975
|
+
/* @__PURE__ */ jsx34(Text31, { dimColor: true, children: modeLabel })
|
|
22951
22976
|
]
|
|
22952
22977
|
}
|
|
22953
22978
|
);
|
|
@@ -23002,23 +23027,23 @@ var init_wrap_text = __esm({
|
|
|
23002
23027
|
});
|
|
23003
23028
|
|
|
23004
23029
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/RationaleLine.tsx
|
|
23005
|
-
import { Box as
|
|
23006
|
-
import { jsx as
|
|
23030
|
+
import { Box as Box30, Text as Text32 } from "ink";
|
|
23031
|
+
import { jsx as jsx35, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
23007
23032
|
function RationaleLine({ line, active }) {
|
|
23008
23033
|
if (line.kind === "blank") {
|
|
23009
|
-
return /* @__PURE__ */
|
|
23034
|
+
return /* @__PURE__ */ jsx35(Box30, { children: /* @__PURE__ */ jsx35(Text32, { children: " " }) });
|
|
23010
23035
|
}
|
|
23011
23036
|
if (line.kind === "heading") {
|
|
23012
|
-
return /* @__PURE__ */
|
|
23037
|
+
return /* @__PURE__ */ jsx35(Box30, { children: /* @__PURE__ */ jsx35(Text32, { bold: true, color: PALETTE.info, dimColor: !active, children: line.text }) });
|
|
23013
23038
|
}
|
|
23014
23039
|
if (line.kind === "label") {
|
|
23015
|
-
return /* @__PURE__ */ jsxs32(
|
|
23016
|
-
line.prefix && /* @__PURE__ */
|
|
23017
|
-
/* @__PURE__ */
|
|
23018
|
-
line.suffix && /* @__PURE__ */
|
|
23040
|
+
return /* @__PURE__ */ jsxs32(Box30, { children: [
|
|
23041
|
+
line.prefix && /* @__PURE__ */ jsx35(Text32, { children: line.prefix }),
|
|
23042
|
+
/* @__PURE__ */ jsx35(Text32, { bold: true, color: line.color, dimColor: !active, children: line.text }),
|
|
23043
|
+
line.suffix && /* @__PURE__ */ jsx35(Text32, { dimColor: true, children: line.suffix })
|
|
23019
23044
|
] });
|
|
23020
23045
|
}
|
|
23021
|
-
return /* @__PURE__ */
|
|
23046
|
+
return /* @__PURE__ */ jsx35(Box30, { children: /* @__PURE__ */ jsx35(Text32, { dimColor: !active || line.dim, children: line.text }) });
|
|
23022
23047
|
}
|
|
23023
23048
|
var init_RationaleLine = __esm({
|
|
23024
23049
|
"packages/experience-design-system-cli/src/analyze/select/tui/components/RationaleLine.tsx"() {
|
|
@@ -23028,8 +23053,8 @@ var init_RationaleLine = __esm({
|
|
|
23028
23053
|
});
|
|
23029
23054
|
|
|
23030
23055
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/ComponentRationalePanel.tsx
|
|
23031
|
-
import { Box as
|
|
23032
|
-
import { jsx as
|
|
23056
|
+
import { Box as Box31, Text as Text33 } from "ink";
|
|
23057
|
+
import { jsx as jsx36, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
23033
23058
|
function renderComponentRationaleLines(data, innerWidth) {
|
|
23034
23059
|
const out = [];
|
|
23035
23060
|
const pushSection = (heading, body) => {
|
|
@@ -23097,7 +23122,7 @@ function ComponentRationalePanel({
|
|
|
23097
23122
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
23098
23123
|
const visibleEnd = Math.min(totalLines, scrollOffset + contentHeight);
|
|
23099
23124
|
return /* @__PURE__ */ jsxs33(
|
|
23100
|
-
|
|
23125
|
+
Box31,
|
|
23101
23126
|
{
|
|
23102
23127
|
flexDirection: "column",
|
|
23103
23128
|
width,
|
|
@@ -23105,9 +23130,9 @@ function ComponentRationalePanel({
|
|
|
23105
23130
|
borderStyle: "single",
|
|
23106
23131
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
23107
23132
|
children: [
|
|
23108
|
-
/* @__PURE__ */
|
|
23109
|
-
visible.map((line, i) => /* @__PURE__ */
|
|
23110
|
-
/* @__PURE__ */
|
|
23133
|
+
/* @__PURE__ */ jsx36(Box31, { children: /* @__PURE__ */ jsx36(Text33, { bold: true, dimColor: !active, children: `Component rationale: ${data.name}` }) }),
|
|
23134
|
+
visible.map((line, i) => /* @__PURE__ */ jsx36(RationaleLine, { line, active }, i)),
|
|
23135
|
+
/* @__PURE__ */ jsx36(Box31, { children: overflowed ? /* @__PURE__ */ jsx36(Text33, { dimColor: true, children: `${visibleStart}-${visibleEnd}/${totalLines} [j/k] scroll [I/Esc] close` }) : /* @__PURE__ */ jsx36(Text33, { dimColor: true, children: "[I/Esc] close" }) })
|
|
23111
23136
|
]
|
|
23112
23137
|
}
|
|
23113
23138
|
);
|
|
@@ -23124,10 +23149,10 @@ var init_ComponentRationalePanel = __esm({
|
|
|
23124
23149
|
});
|
|
23125
23150
|
|
|
23126
23151
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/HighlightedLine.tsx
|
|
23127
|
-
import { Text as
|
|
23128
|
-
import { Fragment as Fragment10, jsx as
|
|
23152
|
+
import { Text as Text34 } from "ink";
|
|
23153
|
+
import { Fragment as Fragment10, jsx as jsx37 } from "react/jsx-runtime";
|
|
23129
23154
|
function HighlightedLine({ parts }) {
|
|
23130
|
-
return /* @__PURE__ */
|
|
23155
|
+
return /* @__PURE__ */ jsx37(Fragment10, { children: parts.map((part, i) => /* @__PURE__ */ jsx37(Text34, { color: part.color, dimColor: part.dim, children: part.text }, i)) });
|
|
23131
23156
|
}
|
|
23132
23157
|
var init_HighlightedLine = __esm({
|
|
23133
23158
|
"packages/experience-design-system-cli/src/analyze/select/tui/components/HighlightedLine.tsx"() {
|
|
@@ -23136,8 +23161,8 @@ var init_HighlightedLine = __esm({
|
|
|
23136
23161
|
});
|
|
23137
23162
|
|
|
23138
23163
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/ScrollablePanel.tsx
|
|
23139
|
-
import { Box as
|
|
23140
|
-
import { Fragment as Fragment11, jsx as
|
|
23164
|
+
import { Box as Box32, Text as Text35 } from "ink";
|
|
23165
|
+
import { Fragment as Fragment11, jsx as jsx38, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
23141
23166
|
function ScrollablePanel({
|
|
23142
23167
|
header,
|
|
23143
23168
|
width,
|
|
@@ -23150,12 +23175,12 @@ function ScrollablePanel({
|
|
|
23150
23175
|
children
|
|
23151
23176
|
}) {
|
|
23152
23177
|
const overflowed = totalLines > height;
|
|
23153
|
-
return /* @__PURE__ */ jsxs34(
|
|
23154
|
-
/* @__PURE__ */ jsxs34(
|
|
23178
|
+
return /* @__PURE__ */ jsxs34(Box32, { flexDirection: "column", width, height: height + 2, borderStyle: "single", borderColor, children: [
|
|
23179
|
+
/* @__PURE__ */ jsxs34(Box32, { children: [
|
|
23155
23180
|
header,
|
|
23156
23181
|
overflowed && /* @__PURE__ */ jsxs34(Fragment11, { children: [
|
|
23157
|
-
/* @__PURE__ */
|
|
23158
|
-
/* @__PURE__ */
|
|
23182
|
+
/* @__PURE__ */ jsx38(Box32, { flexGrow: 1 }),
|
|
23183
|
+
/* @__PURE__ */ jsx38(Text35, { dimColor: !active, children: `\u2195 ${visibleStart}-${visibleEnd}/${totalLines}` })
|
|
23159
23184
|
] })
|
|
23160
23185
|
] }),
|
|
23161
23186
|
children
|
|
@@ -23168,8 +23193,8 @@ var init_ScrollablePanel = __esm({
|
|
|
23168
23193
|
});
|
|
23169
23194
|
|
|
23170
23195
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/JsonPanel.tsx
|
|
23171
|
-
import { Box as
|
|
23172
|
-
import { jsx as
|
|
23196
|
+
import { Box as Box33, Text as Text36 } from "ink";
|
|
23197
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
23173
23198
|
function highlightJson(line) {
|
|
23174
23199
|
const parts = [];
|
|
23175
23200
|
let remaining = line;
|
|
@@ -23207,7 +23232,7 @@ function highlightJson(line) {
|
|
|
23207
23232
|
parts.push({ text: remaining[0] });
|
|
23208
23233
|
remaining = remaining.slice(1);
|
|
23209
23234
|
}
|
|
23210
|
-
return /* @__PURE__ */
|
|
23235
|
+
return /* @__PURE__ */ jsx39(HighlightedLine, { parts });
|
|
23211
23236
|
}
|
|
23212
23237
|
function truncateLine(line, maxWidth) {
|
|
23213
23238
|
if (line.length <= maxWidth) return line;
|
|
@@ -23220,10 +23245,10 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
23220
23245
|
const totalLines = allLines.length;
|
|
23221
23246
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
23222
23247
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
23223
|
-
return /* @__PURE__ */
|
|
23248
|
+
return /* @__PURE__ */ jsx39(
|
|
23224
23249
|
ScrollablePanel,
|
|
23225
23250
|
{
|
|
23226
|
-
header: /* @__PURE__ */
|
|
23251
|
+
header: /* @__PURE__ */ jsx39(Text36, { bold: true, dimColor: !active, children: label }),
|
|
23227
23252
|
width,
|
|
23228
23253
|
height,
|
|
23229
23254
|
active,
|
|
@@ -23233,7 +23258,7 @@ function JsonPanel({ label, value, scrollOffset, width, height, active }) {
|
|
|
23233
23258
|
borderColor: active ? "white" : void 0,
|
|
23234
23259
|
children: visibleLines.map((line, i) => {
|
|
23235
23260
|
const truncated = truncateLine(line, innerWidth);
|
|
23236
|
-
return /* @__PURE__ */
|
|
23261
|
+
return /* @__PURE__ */ jsx39(Box33, { children: highlightJson(truncated) }, i);
|
|
23237
23262
|
})
|
|
23238
23263
|
}
|
|
23239
23264
|
);
|
|
@@ -23247,8 +23272,8 @@ var init_JsonPanel = __esm({
|
|
|
23247
23272
|
});
|
|
23248
23273
|
|
|
23249
23274
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/RationalePanel.tsx
|
|
23250
|
-
import { Text as
|
|
23251
|
-
import { jsx as
|
|
23275
|
+
import { Text as Text37 } from "ink";
|
|
23276
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
23252
23277
|
function renderRationaleLines(rows, innerWidth) {
|
|
23253
23278
|
const out = [];
|
|
23254
23279
|
rows.forEach((row, idx) => {
|
|
@@ -23281,10 +23306,10 @@ function RationalePanel({
|
|
|
23281
23306
|
const visible = allLines.slice(scrollOffset, scrollOffset + height);
|
|
23282
23307
|
const visibleStart = totalLines === 0 ? 0 : scrollOffset + 1;
|
|
23283
23308
|
const visibleEnd = Math.min(totalLines, scrollOffset + height);
|
|
23284
|
-
return /* @__PURE__ */
|
|
23309
|
+
return /* @__PURE__ */ jsx40(
|
|
23285
23310
|
ScrollablePanel,
|
|
23286
23311
|
{
|
|
23287
|
-
header: /* @__PURE__ */
|
|
23312
|
+
header: /* @__PURE__ */ jsx40(Text37, { bold: true, dimColor: !active, children: `RATIONALE \u2014 ${componentName}` }),
|
|
23288
23313
|
width,
|
|
23289
23314
|
height,
|
|
23290
23315
|
active,
|
|
@@ -23292,7 +23317,7 @@ function RationalePanel({
|
|
|
23292
23317
|
visibleStart,
|
|
23293
23318
|
visibleEnd,
|
|
23294
23319
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
23295
|
-
children: visible.map((line, i) => /* @__PURE__ */
|
|
23320
|
+
children: visible.map((line, i) => /* @__PURE__ */ jsx40(RationaleLine, { line, active }, i))
|
|
23296
23321
|
}
|
|
23297
23322
|
);
|
|
23298
23323
|
}
|
|
@@ -23308,8 +23333,8 @@ var init_RationalePanel = __esm({
|
|
|
23308
23333
|
|
|
23309
23334
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/TokenReviewPanel.tsx
|
|
23310
23335
|
import figures6 from "figures";
|
|
23311
|
-
import { Box as
|
|
23312
|
-
import { jsx as
|
|
23336
|
+
import { Box as Box34, Text as Text38 } from "ink";
|
|
23337
|
+
import { jsx as jsx41, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
23313
23338
|
function collectTokenSuggestions(entry, availableTokens = []) {
|
|
23314
23339
|
return Object.entries(entry.$properties).filter(([, def]) => {
|
|
23315
23340
|
const rawKind = def["$token.kind"];
|
|
@@ -23344,7 +23369,7 @@ function TokenReviewPanel({
|
|
|
23344
23369
|
const visiblePaths = current.paths.slice(scrollStart, scrollStart + visibleCount);
|
|
23345
23370
|
const rangeLabel = current.paths.length === 0 ? "no compatible tokens" : `${scrollStart + 1}-${scrollStart + visiblePaths.length} of ${current.paths.length}`;
|
|
23346
23371
|
return /* @__PURE__ */ jsxs35(
|
|
23347
|
-
|
|
23372
|
+
Box34,
|
|
23348
23373
|
{
|
|
23349
23374
|
flexDirection: "column",
|
|
23350
23375
|
width,
|
|
@@ -23352,25 +23377,25 @@ function TokenReviewPanel({
|
|
|
23352
23377
|
borderStyle: "single",
|
|
23353
23378
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
23354
23379
|
children: [
|
|
23355
|
-
/* @__PURE__ */
|
|
23356
|
-
/* @__PURE__ */
|
|
23357
|
-
/* @__PURE__ */
|
|
23358
|
-
current.paths.length === 0 && /* @__PURE__ */
|
|
23380
|
+
/* @__PURE__ */ jsx41(Text38, { bold: true, dimColor: !active, wrap: "truncate", children: `TOKEN REVIEW \u2014 ${componentName} \xB7 ${current.propName} (edit allowed)` }),
|
|
23381
|
+
/* @__PURE__ */ jsx41(Text38, { dimColor: true, wrap: "truncate", children: `select which tokens are allowed (${rangeLabel})` }),
|
|
23382
|
+
/* @__PURE__ */ jsx41(Text38, { children: " " }),
|
|
23383
|
+
current.paths.length === 0 && /* @__PURE__ */ jsx41(Text38, { dimColor: true, children: "(no compatible tokens found for this token kind)" }),
|
|
23359
23384
|
visiblePaths.map((path, i) => {
|
|
23360
23385
|
const pathIndex = scrollStart + i;
|
|
23361
23386
|
const checked = editSelection.has(path);
|
|
23362
23387
|
const focused = pathIndex === editCursor;
|
|
23363
|
-
return /* @__PURE__ */
|
|
23388
|
+
return /* @__PURE__ */ jsx41(Box34, { children: /* @__PURE__ */ jsx41(Text38, { color: focused ? PALETTE.info : void 0, bold: focused, dimColor: !active, wrap: "truncate", children: ` [${checked ? "x" : " "}] ${path}` }) }, path);
|
|
23364
23389
|
}),
|
|
23365
|
-
/* @__PURE__ */
|
|
23366
|
-
/* @__PURE__ */
|
|
23367
|
-
/* @__PURE__ */
|
|
23390
|
+
/* @__PURE__ */ jsx41(Text38, { children: " " }),
|
|
23391
|
+
/* @__PURE__ */ jsx41(Text38, { dimColor: true, wrap: "truncate", children: "[\u2191/\u2193] move [Space] toggle" }),
|
|
23392
|
+
/* @__PURE__ */ jsx41(Text38, { dimColor: true, wrap: "truncate", children: "[Ctrl+S] save [Esc] cancel" })
|
|
23368
23393
|
]
|
|
23369
23394
|
}
|
|
23370
23395
|
);
|
|
23371
23396
|
}
|
|
23372
23397
|
return /* @__PURE__ */ jsxs35(
|
|
23373
|
-
|
|
23398
|
+
Box34,
|
|
23374
23399
|
{
|
|
23375
23400
|
flexDirection: "column",
|
|
23376
23401
|
width,
|
|
@@ -23378,18 +23403,18 @@ function TokenReviewPanel({
|
|
|
23378
23403
|
borderStyle: "single",
|
|
23379
23404
|
borderColor: active ? PALETTE.inverse : void 0,
|
|
23380
23405
|
children: [
|
|
23381
|
-
/* @__PURE__ */
|
|
23382
|
-
suggestions.length === 0 && /* @__PURE__ */
|
|
23406
|
+
/* @__PURE__ */ jsx41(Text38, { bold: true, dimColor: !active, children: `TOKEN REVIEW \u2014 ${componentName}` }),
|
|
23407
|
+
suggestions.length === 0 && /* @__PURE__ */ jsx41(Text38, { dimColor: true, children: "(no token suggestions for this component)" }),
|
|
23383
23408
|
suggestions.map((s, i) => {
|
|
23384
23409
|
const focused = i === selectedRow;
|
|
23385
|
-
return /* @__PURE__ */ jsxs35(
|
|
23386
|
-
/* @__PURE__ */
|
|
23387
|
-
/* @__PURE__ */
|
|
23388
|
-
/* @__PURE__ */
|
|
23410
|
+
return /* @__PURE__ */ jsxs35(Box34, { flexDirection: "column", children: [
|
|
23411
|
+
/* @__PURE__ */ jsx41(Box34, { children: /* @__PURE__ */ jsx41(Text38, { color: focused ? PALETTE.info : void 0, bold: focused, dimColor: !active, children: `${focused ? figures6.pointer : " "} ${s.propName}` }) }),
|
|
23412
|
+
/* @__PURE__ */ jsx41(Text38, { dimColor: true, children: ` suggested: ${s.suggested.join(", ")}` }),
|
|
23413
|
+
/* @__PURE__ */ jsx41(Text38, { dimColor: true, children: ` allowed: ${s.allowed.join(", ")}` })
|
|
23389
23414
|
] }, s.propName);
|
|
23390
23415
|
}),
|
|
23391
|
-
/* @__PURE__ */
|
|
23392
|
-
/* @__PURE__ */
|
|
23416
|
+
/* @__PURE__ */ jsx41(Text38, { children: " " }),
|
|
23417
|
+
/* @__PURE__ */ jsx41(Text38, { dimColor: true, children: "[\u2191/\u2193] move [Enter] edit allowed [Esc] close" })
|
|
23393
23418
|
]
|
|
23394
23419
|
}
|
|
23395
23420
|
);
|
|
@@ -23402,8 +23427,8 @@ var init_TokenReviewPanel = __esm({
|
|
|
23402
23427
|
});
|
|
23403
23428
|
|
|
23404
23429
|
// packages/experience-design-system-cli/src/import/tui/steps/review-details-panel.tsx
|
|
23405
|
-
import { Box as
|
|
23406
|
-
import { Fragment as Fragment12, jsx as
|
|
23430
|
+
import { Box as Box35, Text as Text39 } from "ink";
|
|
23431
|
+
import { Fragment as Fragment12, jsx as jsx42, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
23407
23432
|
function ReviewDetailsPanel({
|
|
23408
23433
|
selectedKey,
|
|
23409
23434
|
panelOpen,
|
|
@@ -23437,7 +23462,7 @@ function ReviewDetailsPanel({
|
|
|
23437
23462
|
rationale: s.rationale ?? ""
|
|
23438
23463
|
}))
|
|
23439
23464
|
];
|
|
23440
|
-
return /* @__PURE__ */
|
|
23465
|
+
return /* @__PURE__ */ jsx42(
|
|
23441
23466
|
RationalePanel,
|
|
23442
23467
|
{
|
|
23443
23468
|
componentName: componentRationale?.name ?? selectedKey,
|
|
@@ -23450,7 +23475,7 @@ function ReviewDetailsPanel({
|
|
|
23450
23475
|
);
|
|
23451
23476
|
}
|
|
23452
23477
|
if (panelOpen === "component-rationale") {
|
|
23453
|
-
return /* @__PURE__ */
|
|
23478
|
+
return /* @__PURE__ */ jsx42(
|
|
23454
23479
|
ComponentRationalePanel,
|
|
23455
23480
|
{
|
|
23456
23481
|
data: componentRationale ?? {
|
|
@@ -23474,14 +23499,14 @@ function ReviewDetailsPanel({
|
|
|
23474
23499
|
const source = reviewMetadata?.componentSource ?? null;
|
|
23475
23500
|
const headerPath = path ?? "<unknown source path>";
|
|
23476
23501
|
const lines = source ? source.split("\n").slice(panelScrollOffset, panelScrollOffset + height) : [];
|
|
23477
|
-
return /* @__PURE__ */ jsxs36(
|
|
23478
|
-
/* @__PURE__ */
|
|
23479
|
-
source ? lines.map((line, index) => /* @__PURE__ */
|
|
23480
|
-
/* @__PURE__ */
|
|
23502
|
+
return /* @__PURE__ */ jsxs36(Box35, { flexDirection: "column", width, borderStyle: "single", borderColor: sourceBorderColor, paddingX: 1, children: [
|
|
23503
|
+
/* @__PURE__ */ jsx42(Text39, { dimColor: true, bold: true, children: `source: ${headerPath}` }),
|
|
23504
|
+
source ? lines.map((line, index) => /* @__PURE__ */ jsx42(Text39, { dimColor: true, children: line }, `source-line-${index}`)) : /* @__PURE__ */ jsx42(Text39, { dimColor: true, children: "(no source captured)" }),
|
|
23505
|
+
/* @__PURE__ */ jsx42(Text39, { dimColor: true, children: "[s/Esc] close" })
|
|
23481
23506
|
] });
|
|
23482
23507
|
}
|
|
23483
23508
|
if (panelOpen === "token-review") {
|
|
23484
|
-
return /* @__PURE__ */
|
|
23509
|
+
return /* @__PURE__ */ jsx42(
|
|
23485
23510
|
TokenReviewPanel,
|
|
23486
23511
|
{
|
|
23487
23512
|
componentName: selectedKey,
|
|
@@ -23497,7 +23522,7 @@ function ReviewDetailsPanel({
|
|
|
23497
23522
|
);
|
|
23498
23523
|
}
|
|
23499
23524
|
if (showJson) {
|
|
23500
|
-
return /* @__PURE__ */
|
|
23525
|
+
return /* @__PURE__ */ jsx42(
|
|
23501
23526
|
JsonPanel,
|
|
23502
23527
|
{
|
|
23503
23528
|
label: "GENERATED DEFINITION (read-only)",
|
|
@@ -23509,7 +23534,7 @@ function ReviewDetailsPanel({
|
|
|
23509
23534
|
}
|
|
23510
23535
|
);
|
|
23511
23536
|
}
|
|
23512
|
-
return /* @__PURE__ */
|
|
23537
|
+
return /* @__PURE__ */ jsx42(Fragment12, { children: editor });
|
|
23513
23538
|
}
|
|
23514
23539
|
var init_review_details_panel = __esm({
|
|
23515
23540
|
"packages/experience-design-system-cli/src/import/tui/steps/review-details-panel.tsx"() {
|
|
@@ -23522,7 +23547,7 @@ var init_review_details_panel = __esm({
|
|
|
23522
23547
|
});
|
|
23523
23548
|
|
|
23524
23549
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewDetailsEditor.tsx
|
|
23525
|
-
import { jsx as
|
|
23550
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
23526
23551
|
import { createElement as createElement5 } from "react";
|
|
23527
23552
|
function toFieldEditorMetadata(reviewMetadata) {
|
|
23528
23553
|
if (!reviewMetadata) return void 0;
|
|
@@ -23555,7 +23580,7 @@ function ReviewDetailsEditor({
|
|
|
23555
23580
|
jsonScrollOffset,
|
|
23556
23581
|
currentTokenSuggestions
|
|
23557
23582
|
} = reviewEditor;
|
|
23558
|
-
return /* @__PURE__ */
|
|
23583
|
+
return /* @__PURE__ */ jsx43(
|
|
23559
23584
|
ReviewDetailsPanel,
|
|
23560
23585
|
{
|
|
23561
23586
|
selectedKey,
|
|
@@ -23598,8 +23623,8 @@ var init_ReviewDetailsEditor = __esm({
|
|
|
23598
23623
|
});
|
|
23599
23624
|
|
|
23600
23625
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewComponentPanel.tsx
|
|
23601
|
-
import { Box as
|
|
23602
|
-
import { Fragment as Fragment13, jsx as
|
|
23626
|
+
import { Box as Box36, Text as Text40 } from "ink";
|
|
23627
|
+
import { Fragment as Fragment13, jsx as jsx44, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
23603
23628
|
function buildReviewFieldEditor(reviewEditor, selectedJson, onExit, overrides = {}) {
|
|
23604
23629
|
return {
|
|
23605
23630
|
value: reviewEditor.draftValue || selectedJson,
|
|
@@ -23639,17 +23664,17 @@ function ReviewEmptyComponentsWarning({
|
|
|
23639
23664
|
hidden
|
|
23640
23665
|
}) {
|
|
23641
23666
|
if (hidden || count === 0) return null;
|
|
23642
|
-
return /* @__PURE__ */
|
|
23667
|
+
return /* @__PURE__ */ jsx44(Text40, { color: PALETTE.warning, children: `\u26A0 ${count} component${count === 1 ? "" : "s"} had no classifiable props \u2014 review with care` });
|
|
23643
23668
|
}
|
|
23644
23669
|
function ReviewNoSelection() {
|
|
23645
|
-
return /* @__PURE__ */
|
|
23670
|
+
return /* @__PURE__ */ jsx44(Box36, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: /* @__PURE__ */ jsx44(Text40, { dimColor: true, children: "No component selected" }) });
|
|
23646
23671
|
}
|
|
23647
23672
|
function ReviewFinalizeError({
|
|
23648
23673
|
message,
|
|
23649
23674
|
hidden
|
|
23650
23675
|
}) {
|
|
23651
23676
|
if (hidden || !message) return null;
|
|
23652
|
-
return /* @__PURE__ */
|
|
23677
|
+
return /* @__PURE__ */ jsx44(Text40, { color: PALETTE.error, children: `\u26A0 ${message}` });
|
|
23653
23678
|
}
|
|
23654
23679
|
function ReviewPanelFooter({
|
|
23655
23680
|
reviewEditor,
|
|
@@ -23660,8 +23685,8 @@ function ReviewPanelFooter({
|
|
|
23660
23685
|
}) {
|
|
23661
23686
|
return /* @__PURE__ */ jsxs37(Fragment13, { children: [
|
|
23662
23687
|
reviewEditor.panelOpen === "token-review" ? " [\u2191/\u2193] move [Enter] edit allowed [Esc] close" : sidebarFocused ? sidebarFooter : reviewEditor.showJson ? " [j/k] scroll [Ctrl+u/d] half-page [gg/G] top/bottom [Tab] focus list" : " [Tab] focus list (edit fields)" + (reviewEditor.currentTokenSuggestions().length > 0 ? " [t] token review" : ""),
|
|
23663
|
-
livePreview.status === "running" && /* @__PURE__ */
|
|
23664
|
-
livePreview.disabled && /* @__PURE__ */
|
|
23688
|
+
livePreview.status === "running" && /* @__PURE__ */ jsx44(Text40, { children: ` ${livePreviewSpinner} live preview` }),
|
|
23689
|
+
livePreview.disabled && /* @__PURE__ */ jsx44(Text40, { children: " \xB7 live preview disabled" })
|
|
23665
23690
|
] });
|
|
23666
23691
|
}
|
|
23667
23692
|
function ReviewComponentPanel({
|
|
@@ -23683,11 +23708,11 @@ function ReviewComponentPanel({
|
|
|
23683
23708
|
}) {
|
|
23684
23709
|
const propCount = Object.keys(selectedEntry.$properties).length;
|
|
23685
23710
|
const slotCount = selectedEntry.$slots ? Object.keys(selectedEntry.$slots).length : 0;
|
|
23686
|
-
return /* @__PURE__ */ jsxs37(
|
|
23687
|
-
/* @__PURE__ */ jsxs37(
|
|
23688
|
-
/* @__PURE__ */
|
|
23689
|
-
/* @__PURE__ */
|
|
23690
|
-
/* @__PURE__ */ jsxs37(
|
|
23711
|
+
return /* @__PURE__ */ jsxs37(Box36, { flexGrow: 1, paddingLeft: 1, flexDirection: "column", children: [
|
|
23712
|
+
/* @__PURE__ */ jsxs37(Box36, { children: [
|
|
23713
|
+
/* @__PURE__ */ jsx44(Text40, { bold: true, children: selectedKey }),
|
|
23714
|
+
/* @__PURE__ */ jsx44(Box36, { flexGrow: 1 }),
|
|
23715
|
+
/* @__PURE__ */ jsxs37(Text40, { dimColor: true, children: [
|
|
23691
23716
|
propCount,
|
|
23692
23717
|
" prop",
|
|
23693
23718
|
propCount !== 1 ? "s" : "",
|
|
@@ -23696,7 +23721,7 @@ function ReviewComponentPanel({
|
|
|
23696
23721
|
sidebarFocused ? "[Tab] focus panel" : "[Tab] focus list"
|
|
23697
23722
|
] })
|
|
23698
23723
|
] }),
|
|
23699
|
-
/* @__PURE__ */
|
|
23724
|
+
/* @__PURE__ */ jsx44(
|
|
23700
23725
|
ReviewDetailsEditor,
|
|
23701
23726
|
{
|
|
23702
23727
|
selectedKey,
|
|
@@ -23711,8 +23736,8 @@ function ReviewComponentPanel({
|
|
|
23711
23736
|
fieldEditor
|
|
23712
23737
|
}
|
|
23713
23738
|
),
|
|
23714
|
-
saveError && /* @__PURE__ */
|
|
23715
|
-
/* @__PURE__ */
|
|
23739
|
+
saveError && /* @__PURE__ */ jsx44(Text40, { color: PALETTE.error, children: "\u2717 " + saveError }),
|
|
23740
|
+
/* @__PURE__ */ jsx44(Text40, { dimColor: true, children: /* @__PURE__ */ jsx44(
|
|
23716
23741
|
ReviewPanelFooter,
|
|
23717
23742
|
{
|
|
23718
23743
|
reviewEditor,
|
|
@@ -23734,30 +23759,30 @@ var init_ReviewComponentPanel = __esm({
|
|
|
23734
23759
|
});
|
|
23735
23760
|
|
|
23736
23761
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/StatusBar.tsx
|
|
23737
|
-
import { Box as
|
|
23738
|
-
import { jsx as
|
|
23762
|
+
import { Box as Box37, Text as Text41 } from "ink";
|
|
23763
|
+
import { jsx as jsx45, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
23739
23764
|
function StatusBar({ accepted, rejected, reviewed, needsReview }) {
|
|
23740
23765
|
const allResolved = needsReview === 0;
|
|
23741
|
-
return /* @__PURE__ */ jsxs38(
|
|
23742
|
-
/* @__PURE__ */ jsxs38(
|
|
23766
|
+
return /* @__PURE__ */ jsxs38(Box37, { gap: 2, flexWrap: "wrap", children: [
|
|
23767
|
+
/* @__PURE__ */ jsxs38(Text41, { color: PALETTE.success, children: [
|
|
23743
23768
|
accepted,
|
|
23744
23769
|
" accepted"
|
|
23745
23770
|
] }),
|
|
23746
|
-
/* @__PURE__ */ jsxs38(
|
|
23771
|
+
/* @__PURE__ */ jsxs38(Text41, { color: PALETTE.error, children: [
|
|
23747
23772
|
rejected,
|
|
23748
23773
|
" rejected"
|
|
23749
23774
|
] }),
|
|
23750
|
-
/* @__PURE__ */ jsxs38(
|
|
23775
|
+
/* @__PURE__ */ jsxs38(Text41, { dimColor: true, children: [
|
|
23751
23776
|
needsReview,
|
|
23752
23777
|
" pending"
|
|
23753
23778
|
] }),
|
|
23754
|
-
/* @__PURE__ */ jsxs38(
|
|
23779
|
+
/* @__PURE__ */ jsxs38(Text41, { color: PALETTE.info, children: [
|
|
23755
23780
|
reviewed,
|
|
23756
23781
|
" reviewed"
|
|
23757
23782
|
] }),
|
|
23758
|
-
/* @__PURE__ */
|
|
23759
|
-
/* @__PURE__ */
|
|
23760
|
-
/* @__PURE__ */
|
|
23783
|
+
/* @__PURE__ */ jsx45(Text41, { dimColor: true, children: "\xB7" }),
|
|
23784
|
+
/* @__PURE__ */ jsx45(Text41, { dimColor: true, children: "[A] accept all" }),
|
|
23785
|
+
/* @__PURE__ */ jsx45(Text41, { bold: allResolved, color: allResolved ? PALETTE.success : PALETTE.fg, children: "[F] finalize" })
|
|
23761
23786
|
] });
|
|
23762
23787
|
}
|
|
23763
23788
|
var init_StatusBar = __esm({
|
|
@@ -23768,8 +23793,8 @@ var init_StatusBar = __esm({
|
|
|
23768
23793
|
});
|
|
23769
23794
|
|
|
23770
23795
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewStatus.tsx
|
|
23771
|
-
import { Box as
|
|
23772
|
-
import { jsx as
|
|
23796
|
+
import { Box as Box38, Text as Text42 } from "ink";
|
|
23797
|
+
import { jsx as jsx46, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
23773
23798
|
function countReviewStatuses(entries) {
|
|
23774
23799
|
return entries.reduce(
|
|
23775
23800
|
(counts, entry) => {
|
|
@@ -23787,7 +23812,7 @@ function ReviewStatusBar({
|
|
|
23787
23812
|
onFinalize
|
|
23788
23813
|
}) {
|
|
23789
23814
|
const { accepted, rejected, needsReview } = countReviewStatuses(entries);
|
|
23790
|
-
return /* @__PURE__ */
|
|
23815
|
+
return /* @__PURE__ */ jsx46(
|
|
23791
23816
|
StatusBar,
|
|
23792
23817
|
{
|
|
23793
23818
|
accepted,
|
|
@@ -23800,13 +23825,13 @@ function ReviewStatusBar({
|
|
|
23800
23825
|
);
|
|
23801
23826
|
}
|
|
23802
23827
|
function ReviewLoadingState() {
|
|
23803
|
-
return /* @__PURE__ */
|
|
23828
|
+
return /* @__PURE__ */ jsx46(Box38, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx46(Text42, { dimColor: true, children: "Loading generated definitions..." }) });
|
|
23804
23829
|
}
|
|
23805
23830
|
function ReviewLoadError({ message }) {
|
|
23806
|
-
return /* @__PURE__ */ jsxs39(
|
|
23807
|
-
/* @__PURE__ */
|
|
23808
|
-
/* @__PURE__ */
|
|
23809
|
-
/* @__PURE__ */
|
|
23831
|
+
return /* @__PURE__ */ jsxs39(Box38, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
23832
|
+
/* @__PURE__ */ jsx46(Text42, { color: PALETTE.error, children: message }),
|
|
23833
|
+
/* @__PURE__ */ jsx46(Text42, { children: " " }),
|
|
23834
|
+
/* @__PURE__ */ jsx46(Text42, { dimColor: true, children: "[q / Enter / Esc] Quit" })
|
|
23810
23835
|
] });
|
|
23811
23836
|
}
|
|
23812
23837
|
var init_ReviewStatus = __esm({
|
|
@@ -23941,8 +23966,8 @@ var init_runLivePreview = __esm({
|
|
|
23941
23966
|
});
|
|
23942
23967
|
|
|
23943
23968
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/FinalizeDialog.tsx
|
|
23944
|
-
import { Box as
|
|
23945
|
-
import { Fragment as Fragment14, jsx as
|
|
23969
|
+
import { Box as Box39, Text as Text43 } from "ink";
|
|
23970
|
+
import { Fragment as Fragment14, jsx as jsx47, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
23946
23971
|
function FinalizeDialog({
|
|
23947
23972
|
accepted,
|
|
23948
23973
|
rejected,
|
|
@@ -23970,55 +23995,55 @@ function FinalizeDialog({
|
|
|
23970
23995
|
const windowed = removed.slice(offset, offset + FINALIZE_REMOVED_WINDOW);
|
|
23971
23996
|
const hasMoreBelow = offset + FINALIZE_REMOVED_WINDOW < removed.length;
|
|
23972
23997
|
const hasMoreAbove = offset > 0;
|
|
23973
|
-
return /* @__PURE__ */ jsxs40(
|
|
23974
|
-
/* @__PURE__ */
|
|
23975
|
-
/* @__PURE__ */
|
|
23976
|
-
/* @__PURE__ */ jsxs40(
|
|
23977
|
-
/* @__PURE__ */ jsxs40(
|
|
23998
|
+
return /* @__PURE__ */ jsxs40(Box39, { flexDirection: "column", borderStyle: "round", padding: 1, width: 58, children: [
|
|
23999
|
+
/* @__PURE__ */ jsx47(Text43, { bold: true, children: "\u2500".repeat(17) + " Finalize " + "\u2500".repeat(17) }),
|
|
24000
|
+
/* @__PURE__ */ jsx47(Text43, { children: " " }),
|
|
24001
|
+
/* @__PURE__ */ jsxs40(Text43, { children: [
|
|
24002
|
+
/* @__PURE__ */ jsxs40(Text43, { color: PALETTE.success, children: [
|
|
23978
24003
|
accepted,
|
|
23979
24004
|
" accepted"
|
|
23980
24005
|
] }),
|
|
23981
|
-
/* @__PURE__ */
|
|
23982
|
-
/* @__PURE__ */ jsxs40(
|
|
24006
|
+
/* @__PURE__ */ jsx47(Text43, { children: " \xB7 " }),
|
|
24007
|
+
/* @__PURE__ */ jsxs40(Text43, { color: PALETTE.error, children: [
|
|
23983
24008
|
rejected,
|
|
23984
24009
|
" rejected"
|
|
23985
24010
|
] }),
|
|
23986
|
-
/* @__PURE__ */
|
|
23987
|
-
/* @__PURE__ */ jsxs40(
|
|
24011
|
+
/* @__PURE__ */ jsx47(Text43, { children: " \xB7 " }),
|
|
24012
|
+
/* @__PURE__ */ jsxs40(Text43, { dimColor: true, children: [
|
|
23988
24013
|
needsReview,
|
|
23989
24014
|
" unresolved"
|
|
23990
24015
|
] })
|
|
23991
24016
|
] }),
|
|
23992
|
-
/* @__PURE__ */
|
|
24017
|
+
/* @__PURE__ */ jsx47(Text43, { children: " " }),
|
|
23993
24018
|
noneAccepted && /* @__PURE__ */ jsxs40(Fragment14, { children: [
|
|
23994
|
-
/* @__PURE__ */
|
|
23995
|
-
/* @__PURE__ */
|
|
23996
|
-
/* @__PURE__ */
|
|
24019
|
+
/* @__PURE__ */ jsx47(Text43, { bold: true, color: PALETTE.warning, children: "\u26A0 No components are accepted \u2014 nothing will be pushed." }),
|
|
24020
|
+
/* @__PURE__ */ jsx47(Text43, { color: PALETTE.warning, children: " Accept at least one component ([a] a row, [A] accept all) to push." }),
|
|
24021
|
+
/* @__PURE__ */ jsx47(Text43, { children: " " })
|
|
23997
24022
|
] }),
|
|
23998
24023
|
!allResolved && /* @__PURE__ */ jsxs40(Fragment14, { children: [
|
|
23999
|
-
/* @__PURE__ */
|
|
24000
|
-
/* @__PURE__ */
|
|
24001
|
-
/* @__PURE__ */
|
|
24024
|
+
/* @__PURE__ */ jsx47(Text43, { color: PALETTE.warning, children: "\u26A0 " + needsReview + " unresolved component" + (needsReview === 1 ? "" : "s") + " will not be pushed." }),
|
|
24025
|
+
/* @__PURE__ */ jsx47(Text43, { color: PALETTE.warning, children: " Only explicitly accepted components ship." }),
|
|
24026
|
+
/* @__PURE__ */ jsx47(Text43, { children: " " })
|
|
24002
24027
|
] }),
|
|
24003
24028
|
previewStatus === "running" && /* @__PURE__ */ jsxs40(Fragment14, { children: [
|
|
24004
|
-
/* @__PURE__ */
|
|
24005
|
-
/* @__PURE__ */
|
|
24029
|
+
/* @__PURE__ */ jsx47(Text43, { dimColor: true, children: "Previewing deletions against the target space\u2026" }),
|
|
24030
|
+
/* @__PURE__ */ jsx47(Text43, { children: " " })
|
|
24006
24031
|
] }),
|
|
24007
24032
|
previewStatus === "error" && /* @__PURE__ */ jsxs40(Fragment14, { children: [
|
|
24008
|
-
/* @__PURE__ */
|
|
24009
|
-
/* @__PURE__ */
|
|
24033
|
+
/* @__PURE__ */ jsx47(Text43, { color: PALETTE.warning, children: "\u26A0 Could not preview deletions (the push will still proceed)." }),
|
|
24034
|
+
/* @__PURE__ */ jsx47(Text43, { children: " " })
|
|
24010
24035
|
] }),
|
|
24011
24036
|
previewStatus === "done" && removed.length > 0 && /* @__PURE__ */ jsxs40(Fragment14, { children: [
|
|
24012
|
-
/* @__PURE__ */
|
|
24013
|
-
hasMoreAbove && /* @__PURE__ */
|
|
24014
|
-
windowed.map((rc) => /* @__PURE__ */
|
|
24015
|
-
hasMoreBelow && /* @__PURE__ */
|
|
24016
|
-
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */
|
|
24017
|
-
/* @__PURE__ */
|
|
24037
|
+
/* @__PURE__ */ jsx47(Text43, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removed.length, false) }),
|
|
24038
|
+
hasMoreAbove && /* @__PURE__ */ jsx47(Text43, { dimColor: true, children: " \u2191 more above" }),
|
|
24039
|
+
windowed.map((rc) => /* @__PURE__ */ jsx47(Text43, { color: PALETTE.error, children: removedComponentLine(rc) }, rc.id)),
|
|
24040
|
+
hasMoreBelow && /* @__PURE__ */ jsx47(Text43, { dimColor: true, children: " \u2193 more below" }),
|
|
24041
|
+
removed.length > FINALIZE_REMOVED_WINDOW && /* @__PURE__ */ jsx47(Text43, { dimColor: true, children: " [j/k] scroll deletions" }),
|
|
24042
|
+
/* @__PURE__ */ jsx47(Text43, { children: " " })
|
|
24018
24043
|
] }),
|
|
24019
|
-
/* @__PURE__ */
|
|
24020
|
-
/* @__PURE__ */
|
|
24021
|
-
/* @__PURE__ */
|
|
24044
|
+
/* @__PURE__ */ jsx47(Text43, { children: noneAccepted ? "Confirm exit with nothing accepted?" : allResolved ? "Save decisions and exit? All components resolved." : "Save decisions and exit?" }),
|
|
24045
|
+
/* @__PURE__ */ jsx47(Text43, { children: " " }),
|
|
24046
|
+
/* @__PURE__ */ jsx47(Text43, { children: " [y / Enter] Confirm [n / Esc] Cancel" })
|
|
24022
24047
|
] });
|
|
24023
24048
|
}
|
|
24024
24049
|
var FINALIZE_REMOVED_WINDOW;
|
|
@@ -24523,8 +24548,8 @@ var init_useReviewSurfaceState = __esm({
|
|
|
24523
24548
|
});
|
|
24524
24549
|
|
|
24525
24550
|
// packages/experience-design-system-cli/src/analyze/select/tui/components/QuitDialog.tsx
|
|
24526
|
-
import { Box as
|
|
24527
|
-
import { Fragment as Fragment15, jsx as
|
|
24551
|
+
import { Box as Box40, Text as Text44 } from "ink";
|
|
24552
|
+
import { Fragment as Fragment15, jsx as jsx48, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
24528
24553
|
function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
24529
24554
|
useImmediateInput((input, key) => {
|
|
24530
24555
|
if (input === "y" || key.return) {
|
|
@@ -24533,16 +24558,16 @@ function QuitDialog({ hasUnsavedDrafts, onConfirm, onCancel }) {
|
|
|
24533
24558
|
onCancel();
|
|
24534
24559
|
}
|
|
24535
24560
|
});
|
|
24536
|
-
return /* @__PURE__ */ jsxs41(
|
|
24537
|
-
/* @__PURE__ */
|
|
24538
|
-
/* @__PURE__ */
|
|
24561
|
+
return /* @__PURE__ */ jsxs41(Box40, { flexDirection: "column", borderStyle: "round", padding: 1, width: 50, children: [
|
|
24562
|
+
/* @__PURE__ */ jsx48(Text44, { bold: true, children: "\u2500".repeat(19) + " Quit " + "\u2500".repeat(19) }),
|
|
24563
|
+
/* @__PURE__ */ jsx48(Text44, { children: " " }),
|
|
24539
24564
|
hasUnsavedDrafts ? /* @__PURE__ */ jsxs41(Fragment15, { children: [
|
|
24540
|
-
/* @__PURE__ */
|
|
24541
|
-
/* @__PURE__ */
|
|
24542
|
-
/* @__PURE__ */
|
|
24543
|
-
] }) : /* @__PURE__ */
|
|
24544
|
-
/* @__PURE__ */
|
|
24545
|
-
/* @__PURE__ */
|
|
24565
|
+
/* @__PURE__ */ jsx48(Text44, { children: "You have unsaved draft edits." }),
|
|
24566
|
+
/* @__PURE__ */ jsx48(Text44, { children: "Session state is preserved \u2014 you can resume" }),
|
|
24567
|
+
/* @__PURE__ */ jsx48(Text44, { children: "by running the same review command again." })
|
|
24568
|
+
] }) : /* @__PURE__ */ jsx48(Text44, { children: "Session is saved. Quit without finalizing?" }),
|
|
24569
|
+
/* @__PURE__ */ jsx48(Text44, { children: " " }),
|
|
24570
|
+
/* @__PURE__ */ jsx48(Text44, { children: " [y / Enter] Quit [n / Esc] Stay" })
|
|
24546
24571
|
] });
|
|
24547
24572
|
}
|
|
24548
24573
|
var init_QuitDialog = __esm({
|
|
@@ -24553,8 +24578,8 @@ var init_QuitDialog = __esm({
|
|
|
24553
24578
|
});
|
|
24554
24579
|
|
|
24555
24580
|
// packages/experience-design-system-cli/src/import/tui/components/ReviewDialogs.tsx
|
|
24556
|
-
import { Box as
|
|
24557
|
-
import { Fragment as Fragment16, jsx as
|
|
24581
|
+
import { Box as Box41, Text as Text45 } from "ink";
|
|
24582
|
+
import { Fragment as Fragment16, jsx as jsx49, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
24558
24583
|
function ReviewFinalizeDialogs({
|
|
24559
24584
|
showFinalize,
|
|
24560
24585
|
showQuit,
|
|
@@ -24569,7 +24594,7 @@ function ReviewFinalizeDialogs({
|
|
|
24569
24594
|
}) {
|
|
24570
24595
|
const { accepted, rejected, needsReview } = countReviewStatuses(components);
|
|
24571
24596
|
return /* @__PURE__ */ jsxs42(Fragment16, { children: [
|
|
24572
|
-
showFinalize && /* @__PURE__ */
|
|
24597
|
+
showFinalize && /* @__PURE__ */ jsx49(
|
|
24573
24598
|
FinalizeDialog,
|
|
24574
24599
|
{
|
|
24575
24600
|
accepted,
|
|
@@ -24582,7 +24607,7 @@ function ReviewFinalizeDialogs({
|
|
|
24582
24607
|
onCancel: onFinalizeCancel
|
|
24583
24608
|
}
|
|
24584
24609
|
),
|
|
24585
|
-
showQuit && /* @__PURE__ */
|
|
24610
|
+
showQuit && /* @__PURE__ */ jsx49(QuitDialog, { hasUnsavedDrafts: false, onConfirm: onQuitConfirm, onCancel: onQuitCancel })
|
|
24586
24611
|
] });
|
|
24587
24612
|
}
|
|
24588
24613
|
function ReviewStepDialogs({
|
|
@@ -24592,7 +24617,7 @@ function ReviewStepDialogs({
|
|
|
24592
24617
|
onFinalize,
|
|
24593
24618
|
onQuit
|
|
24594
24619
|
}) {
|
|
24595
|
-
return /* @__PURE__ */
|
|
24620
|
+
return /* @__PURE__ */ jsx49(
|
|
24596
24621
|
ReviewFinalizeDialogs,
|
|
24597
24622
|
{
|
|
24598
24623
|
showFinalize: surfaceState.showFinalize,
|
|
@@ -24610,12 +24635,12 @@ function ReviewStepDialogs({
|
|
|
24610
24635
|
}
|
|
24611
24636
|
function ReviewReloadDialog({ open }) {
|
|
24612
24637
|
if (!open) return null;
|
|
24613
|
-
return /* @__PURE__ */ jsxs42(
|
|
24614
|
-
/* @__PURE__ */
|
|
24615
|
-
/* @__PURE__ */
|
|
24616
|
-
/* @__PURE__ */
|
|
24617
|
-
/* @__PURE__ */
|
|
24618
|
-
/* @__PURE__ */
|
|
24638
|
+
return /* @__PURE__ */ jsxs42(Box41, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
24639
|
+
/* @__PURE__ */ jsx49(Text45, { bold: true, color: PALETTE.warning, children: "Reload from saved state?" }),
|
|
24640
|
+
/* @__PURE__ */ jsx49(Text45, { children: "Unsaved in-memory changes will be lost." }),
|
|
24641
|
+
/* @__PURE__ */ jsx49(Text45, { children: " " }),
|
|
24642
|
+
/* @__PURE__ */ jsx49(Text45, { children: " [Enter] Confirm" }),
|
|
24643
|
+
/* @__PURE__ */ jsx49(Text45, { children: " [Esc] Cancel" })
|
|
24619
24644
|
] });
|
|
24620
24645
|
}
|
|
24621
24646
|
var init_ReviewDialogs = __esm({
|
|
@@ -25023,8 +25048,8 @@ var init_useReviewPreview = __esm({
|
|
|
25023
25048
|
});
|
|
25024
25049
|
|
|
25025
25050
|
// packages/experience-design-system-cli/src/import/tui/components/LivePreviewSummary.tsx
|
|
25026
|
-
import { Box as
|
|
25027
|
-
import { jsx as
|
|
25051
|
+
import { Box as Box42, Text as Text46 } from "ink";
|
|
25052
|
+
import { jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
25028
25053
|
function LivePreviewSummary({
|
|
25029
25054
|
enabled,
|
|
25030
25055
|
previewAnnotations,
|
|
@@ -25038,19 +25063,19 @@ function LivePreviewSummary({
|
|
|
25038
25063
|
const counts = { new: 0, changed: 0, removed: 0, breaking: 0 };
|
|
25039
25064
|
for (const annotation of previewAnnotations.values()) counts[annotation] += 1;
|
|
25040
25065
|
const hasCounts = counts.new + counts.changed + counts.removed + counts.breaking > 0;
|
|
25041
|
-
if (disabled) return /* @__PURE__ */
|
|
25042
|
-
if (status === "running" && !hasCounts) return /* @__PURE__ */
|
|
25066
|
+
if (disabled) return /* @__PURE__ */ jsx50(Text46, { dimColor: true, children: "Preview: disabled (creds rejected)" });
|
|
25067
|
+
if (status === "running" && !hasCounts) return /* @__PURE__ */ jsx50(Text46, { dimColor: true, children: `Preview: ${spinner} running...` });
|
|
25043
25068
|
if (!hasCounts) return null;
|
|
25044
|
-
return /* @__PURE__ */ jsxs43(
|
|
25045
|
-
/* @__PURE__ */
|
|
25046
|
-
/* @__PURE__ */
|
|
25047
|
-
/* @__PURE__ */
|
|
25048
|
-
/* @__PURE__ */
|
|
25049
|
-
/* @__PURE__ */
|
|
25050
|
-
/* @__PURE__ */
|
|
25051
|
-
showRemovedListHint && removedCount > 0 && /* @__PURE__ */
|
|
25052
|
-
/* @__PURE__ */
|
|
25053
|
-
/* @__PURE__ */
|
|
25069
|
+
return /* @__PURE__ */ jsxs43(Box42, { children: [
|
|
25070
|
+
/* @__PURE__ */ jsx50(Text46, { children: "Preview: " }),
|
|
25071
|
+
/* @__PURE__ */ jsx50(Text46, { color: PALETTE.success, children: `${counts.new} new` }),
|
|
25072
|
+
/* @__PURE__ */ jsx50(Text46, { children: " \xB7 " }),
|
|
25073
|
+
/* @__PURE__ */ jsx50(Text46, { color: PALETTE.warning, children: `${counts.changed} changed` }),
|
|
25074
|
+
/* @__PURE__ */ jsx50(Text46, { children: " \xB7 " }),
|
|
25075
|
+
/* @__PURE__ */ jsx50(Text46, { dimColor: true, children: `${counts.removed} removed` }),
|
|
25076
|
+
showRemovedListHint && removedCount > 0 && /* @__PURE__ */ jsx50(Text46, { dimColor: true, children: " ([d] removed list)" }),
|
|
25077
|
+
/* @__PURE__ */ jsx50(Text46, { children: " \xB7 " }),
|
|
25078
|
+
/* @__PURE__ */ jsx50(Text46, { color: PALETTE.error, bold: true, children: `${counts.breaking} breaking` })
|
|
25054
25079
|
] });
|
|
25055
25080
|
}
|
|
25056
25081
|
var init_LivePreviewSummary = __esm({
|
|
@@ -25063,8 +25088,8 @@ var init_LivePreviewSummary = __esm({
|
|
|
25063
25088
|
// packages/experience-design-system-cli/src/import/tui/steps/GenerateReviewStep.tsx
|
|
25064
25089
|
import { useCallback as useCallback6, useEffect as useEffect10, useMemo as useMemo4, useRef as useRef8, useState as useState22 } from "react";
|
|
25065
25090
|
import figures7 from "figures";
|
|
25066
|
-
import { Box as
|
|
25067
|
-
import { Fragment as Fragment17, jsx as
|
|
25091
|
+
import { Box as Box43, Text as Text47, useStdout as useStdout3 } from "ink";
|
|
25092
|
+
import { Fragment as Fragment17, jsx as jsx51, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
25068
25093
|
function sortComponentsForSidebar(components, cycleParticipants) {
|
|
25069
25094
|
const isEmpty2 = (entry) => Object.keys(entry.$properties ?? {}).length === 0 && Object.keys(entry.$slots ?? {}).length === 0;
|
|
25070
25095
|
const tier = (c2) => {
|
|
@@ -25105,10 +25130,10 @@ function CyclePathLine({
|
|
|
25105
25130
|
highlightComponents = false,
|
|
25106
25131
|
highlightLine = false
|
|
25107
25132
|
}) {
|
|
25108
|
-
return /* @__PURE__ */ jsxs44(
|
|
25133
|
+
return /* @__PURE__ */ jsxs44(Text47, { color: highlightLine ? PALETTE.warning : void 0, children: [
|
|
25109
25134
|
prefix,
|
|
25110
25135
|
segments.map(
|
|
25111
|
-
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */
|
|
25136
|
+
(segment, index) => segment.kind === "slot" ? /* @__PURE__ */ jsx51(Text47, { color: PALETTE.info, children: segment.text }, index) : segment.kind === "arrow" ? /* @__PURE__ */ jsx51(Text47, { dimColor: true, children: segment.text }, index) : /* @__PURE__ */ jsx51(Text47, { color: highlightComponents ? PALETTE.warning : void 0, children: segment.text }, index)
|
|
25112
25137
|
)
|
|
25113
25138
|
] });
|
|
25114
25139
|
}
|
|
@@ -25153,7 +25178,13 @@ function deriveBreakingChanges(response) {
|
|
|
25153
25178
|
}
|
|
25154
25179
|
return out;
|
|
25155
25180
|
}
|
|
25156
|
-
function GenerateReviewStep({
|
|
25181
|
+
function GenerateReviewStep(props) {
|
|
25182
|
+
if (!props.extractSessionId) {
|
|
25183
|
+
return /* @__PURE__ */ jsx51(Box43, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx51(Text47, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
25184
|
+
}
|
|
25185
|
+
return /* @__PURE__ */ jsx51(GenerateReviewStepView, { ...props, extractSessionId: props.extractSessionId });
|
|
25186
|
+
}
|
|
25187
|
+
function GenerateReviewStepView({
|
|
25157
25188
|
extractSessionId,
|
|
25158
25189
|
tokenSessionId,
|
|
25159
25190
|
onFinalize,
|
|
@@ -26019,30 +26050,30 @@ function GenerateReviewStep({
|
|
|
26019
26050
|
}
|
|
26020
26051
|
});
|
|
26021
26052
|
if (loading) {
|
|
26022
|
-
return /* @__PURE__ */
|
|
26053
|
+
return /* @__PURE__ */ jsx51(ReviewLoadingState, {});
|
|
26023
26054
|
}
|
|
26024
26055
|
if (loadError) {
|
|
26025
|
-
return /* @__PURE__ */
|
|
26056
|
+
return /* @__PURE__ */ jsx51(ReviewLoadError, { message: loadError });
|
|
26026
26057
|
}
|
|
26027
26058
|
if (showHelp) {
|
|
26028
|
-
return /* @__PURE__ */
|
|
26059
|
+
return /* @__PURE__ */ jsx51(HelpOverlay, { sections: HELP_SECTIONS2, onClose: () => setShowHelp(false) });
|
|
26029
26060
|
}
|
|
26030
26061
|
const renderBreakOverlay = (width) => {
|
|
26031
26062
|
const highlightedCycle = slotCycles[cyclesCursor];
|
|
26032
|
-
return /* @__PURE__ */ jsxs44(
|
|
26033
|
-
/* @__PURE__ */
|
|
26034
|
-
highlightedCycle && /* @__PURE__ */
|
|
26035
|
-
/* @__PURE__ */
|
|
26036
|
-
/* @__PURE__ */
|
|
26037
|
-
breakEdges.length > 0 && /* @__PURE__ */
|
|
26063
|
+
return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, width, children: [
|
|
26064
|
+
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.warning, children: `BREAK CYCLE ${cyclesCursor + 1} \u2014 remove a slot edge or reject a member` }),
|
|
26065
|
+
highlightedCycle && /* @__PURE__ */ jsx51(CyclePathLine, { segments: formatCyclePathSegments(highlightedCycle), prefix: " ", highlightComponents: true }),
|
|
26066
|
+
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: highlightedCycle ? "Deleting an edge removes it from $allowedComponents (undo with Ctrl+Z)." : "No cycle highlighted." }),
|
|
26067
|
+
/* @__PURE__ */ jsx51(Text47, { children: " " }),
|
|
26068
|
+
breakEdges.length > 0 && /* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "remove slot edge:" }),
|
|
26038
26069
|
breakEdges.map((edge, idx) => {
|
|
26039
26070
|
const isCursor = idx === breakCursor;
|
|
26040
|
-
return /* @__PURE__ */
|
|
26071
|
+
return /* @__PURE__ */ jsx51(Text47, { inverse: isCursor, children: `${isCursor ? figures7.pointer : " "} remove '${edge.toComponent}' from ${edge.fromComponent}.$slots.${edge.slotName}.$allowedComponents` }, `break-${idx}`);
|
|
26041
26072
|
}),
|
|
26042
26073
|
breakConfirm ? /* @__PURE__ */ jsxs44(Fragment17, { children: [
|
|
26043
|
-
/* @__PURE__ */
|
|
26044
|
-
/* @__PURE__ */
|
|
26045
|
-
] }) : /* @__PURE__ */
|
|
26074
|
+
/* @__PURE__ */ jsx51(Text47, { children: " " }),
|
|
26075
|
+
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.warning, children: "Delete this slot edge? [y] confirm [n] cancel" })
|
|
26076
|
+
] }) : /* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "[\u2191\u2193/j/k] move [Enter] delete [x/Esc] close" })
|
|
26046
26077
|
] });
|
|
26047
26078
|
};
|
|
26048
26079
|
const breakOverlayFullScreen = breakPanel.isOpen && shouldBreakOverlayGoFullScreen({
|
|
@@ -26086,8 +26117,8 @@ function GenerateReviewStep({
|
|
|
26086
26117
|
for (const c2 of closures.values()) if (c2.nodes.length > 1) return true;
|
|
26087
26118
|
return false;
|
|
26088
26119
|
})();
|
|
26089
|
-
return /* @__PURE__ */ jsxs44(
|
|
26090
|
-
/* @__PURE__ */
|
|
26120
|
+
return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", children: [
|
|
26121
|
+
/* @__PURE__ */ jsx51(
|
|
26091
26122
|
ReviewStepDialogs,
|
|
26092
26123
|
{
|
|
26093
26124
|
surfaceState: reviewSurface,
|
|
@@ -26097,24 +26128,24 @@ function GenerateReviewStep({
|
|
|
26097
26128
|
onQuit
|
|
26098
26129
|
}
|
|
26099
26130
|
),
|
|
26100
|
-
showUnsavedWarning && !dialogOpen && /* @__PURE__ */ jsxs44(
|
|
26101
|
-
/* @__PURE__ */
|
|
26102
|
-
/* @__PURE__ */
|
|
26103
|
-
/* @__PURE__ */
|
|
26104
|
-
/* @__PURE__ */
|
|
26105
|
-
/* @__PURE__ */
|
|
26106
|
-
/* @__PURE__ */
|
|
26131
|
+
showUnsavedWarning && !dialogOpen && /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26132
|
+
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.warning, children: "Unsaved changes" }),
|
|
26133
|
+
/* @__PURE__ */ jsx51(Text47, { children: "You have unsaved edits in the current field editor." }),
|
|
26134
|
+
/* @__PURE__ */ jsx51(Text47, { children: " " }),
|
|
26135
|
+
/* @__PURE__ */ jsx51(Text47, { children: " [Enter] Save and continue" }),
|
|
26136
|
+
/* @__PURE__ */ jsx51(Text47, { children: " [Esc] Discard changes and continue" }),
|
|
26137
|
+
/* @__PURE__ */ jsx51(Text47, { children: " [Tab] Stay in the panel" })
|
|
26107
26138
|
] }),
|
|
26108
|
-
/* @__PURE__ */
|
|
26109
|
-
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs44(
|
|
26110
|
-
/* @__PURE__ */
|
|
26139
|
+
/* @__PURE__ */ jsx51(ReviewReloadDialog, { open: showReloadDialog && !dialogOpen }),
|
|
26140
|
+
removedComponents.length > 0 && !dialogOpen && /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26141
|
+
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.error, children: removedComponentsHeader(removedComponents.length, true) }),
|
|
26111
26142
|
!removedBannerCollapsed && /* @__PURE__ */ jsxs44(Fragment17, { children: [
|
|
26112
|
-
/* @__PURE__ */
|
|
26113
|
-
removedComponents.map((rc) => /* @__PURE__ */
|
|
26143
|
+
/* @__PURE__ */ jsx51(Text47, { children: " " }),
|
|
26144
|
+
removedComponents.map((rc) => /* @__PURE__ */ jsx51(Text47, { children: removedComponentLine(rc) }, rc.id))
|
|
26114
26145
|
] })
|
|
26115
26146
|
] }),
|
|
26116
|
-
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */
|
|
26117
|
-
|
|
26147
|
+
breakingChanges.length > 0 && !dialogOpen && /* @__PURE__ */ jsx51(Box43, { paddingX: 1, children: /* @__PURE__ */ jsx51(
|
|
26148
|
+
Text47,
|
|
26118
26149
|
{
|
|
26119
26150
|
color: PALETTE.warning,
|
|
26120
26151
|
children: `[b] ${breakingChanges.length} breaking change${breakingChanges.length === 1 ? "" : "s"}`
|
|
@@ -26124,32 +26155,32 @@ function GenerateReviewStep({
|
|
|
26124
26155
|
const row = breakingRows[breakingCursor];
|
|
26125
26156
|
const comp = row ? breakingChanges.find((b) => b.componentName === row.componentName) : void 0;
|
|
26126
26157
|
if (!comp) return null;
|
|
26127
|
-
return /* @__PURE__ */ jsxs44(
|
|
26128
|
-
/* @__PURE__ */
|
|
26129
|
-
comp.impact && /* @__PURE__ */
|
|
26130
|
-
comp.changes.length === 0 ? /* @__PURE__ */
|
|
26131
|
-
/* @__PURE__ */
|
|
26158
|
+
return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26159
|
+
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.warning, children: `Breaking changes \u2014 ${comp.componentName}` }),
|
|
26160
|
+
comp.impact && /* @__PURE__ */ jsx51(Text47, { dimColor: true, children: ` affects ${comp.impact.affectedExperiences} experience${comp.impact.affectedExperiences === 1 ? "" : "s"}, ${comp.impact.affectedFragments} fragment${comp.impact.affectedFragments === 1 ? "" : "s"}` }),
|
|
26161
|
+
comp.changes.length === 0 ? /* @__PURE__ */ jsx51(Text47, { dimColor: true, children: " (no enumerated changes)" }) : comp.changes.map((change, ci) => /* @__PURE__ */ jsx51(Text47, { children: ` \u2022 ${formatBreakingChange(change, comp.current)}` }, `bd-detail-${ci}`)),
|
|
26162
|
+
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "[D/Esc] close detail" })
|
|
26132
26163
|
] });
|
|
26133
26164
|
})(),
|
|
26134
26165
|
cyclePanel.isOpen && !dialogOpen && (() => {
|
|
26135
26166
|
const PANEL_H = 20;
|
|
26136
26167
|
const lines = [];
|
|
26137
26168
|
lines.push(
|
|
26138
|
-
/* @__PURE__ */
|
|
26169
|
+
/* @__PURE__ */ jsx51(Text47, { bold: true, color: PALETTE.warning, children: `SLOT DEPENDENCY CYCLES (${slotCycles.length})` }, "cyc-title")
|
|
26139
26170
|
);
|
|
26140
26171
|
lines.push(
|
|
26141
|
-
/* @__PURE__ */
|
|
26172
|
+
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "push will fail until these are resolved" }, "cyc-sub")
|
|
26142
26173
|
);
|
|
26143
26174
|
lines.push(
|
|
26144
|
-
/* @__PURE__ */
|
|
26175
|
+
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "To fix: reject a cycle member, or break the cycle by removing a slot edge." }, "cyc-guide")
|
|
26145
26176
|
);
|
|
26146
|
-
lines.push(/* @__PURE__ */
|
|
26177
|
+
lines.push(/* @__PURE__ */ jsx51(Text47, { children: " " }, "cyc-space"));
|
|
26147
26178
|
slotCycles.forEach((cycle, idx) => {
|
|
26148
26179
|
const nodeCount = new Set(cycle.path).size;
|
|
26149
26180
|
const isCursor = idx === cyclesCursor;
|
|
26150
26181
|
lines.push(
|
|
26151
|
-
/* @__PURE__ */
|
|
26152
|
-
|
|
26182
|
+
/* @__PURE__ */ jsx51(
|
|
26183
|
+
Text47,
|
|
26153
26184
|
{
|
|
26154
26185
|
bold: true,
|
|
26155
26186
|
inverse: isCursor,
|
|
@@ -26159,23 +26190,23 @@ function GenerateReviewStep({
|
|
|
26159
26190
|
)
|
|
26160
26191
|
);
|
|
26161
26192
|
lines.push(
|
|
26162
|
-
/* @__PURE__ */
|
|
26193
|
+
/* @__PURE__ */ jsx51(CyclePathLine, { segments: formatCyclePathSegments(cycle, 16), prefix: " " }, `cyc-p-${idx}`)
|
|
26163
26194
|
);
|
|
26164
26195
|
if (cycle.suggestedBreak) {
|
|
26165
26196
|
const b = cycle.suggestedBreak;
|
|
26166
26197
|
lines.push(
|
|
26167
|
-
/* @__PURE__ */
|
|
26198
|
+
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: ` Suggested fix: remove '${b.toComponent}' from ${b.fromComponent}.$slots.${b.slotName}.$allowedComponents` }, `cyc-f-${idx}`)
|
|
26168
26199
|
);
|
|
26169
26200
|
}
|
|
26170
|
-
lines.push(/* @__PURE__ */
|
|
26201
|
+
lines.push(/* @__PURE__ */ jsx51(Text47, { children: " " }, `cyc-s-${idx}`));
|
|
26171
26202
|
});
|
|
26172
26203
|
const visible = lines.slice(cyclePanelScroll, cyclePanelScroll + PANEL_H);
|
|
26173
|
-
return /* @__PURE__ */ jsxs44(
|
|
26204
|
+
return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.warning, paddingX: 1, children: [
|
|
26174
26205
|
visible,
|
|
26175
|
-
/* @__PURE__ */
|
|
26206
|
+
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: "[\u2191\u2193/j/k] move [Enter] jump [x] break cycle [c/q/Esc] close" })
|
|
26176
26207
|
] });
|
|
26177
26208
|
})(),
|
|
26178
|
-
!dialogOpen && /* @__PURE__ */
|
|
26209
|
+
!dialogOpen && /* @__PURE__ */ jsx51(
|
|
26179
26210
|
LivePreviewSummary,
|
|
26180
26211
|
{
|
|
26181
26212
|
enabled: livePreview,
|
|
@@ -26194,17 +26225,17 @@ function GenerateReviewStep({
|
|
|
26194
26225
|
const participantSet = cycleView.structural;
|
|
26195
26226
|
const members = stillRejected.filter((n) => participantSet.has(n)).sort();
|
|
26196
26227
|
const ancestors = stillRejected.filter((n) => !participantSet.has(n)).sort();
|
|
26197
|
-
return /* @__PURE__ */ jsxs44(
|
|
26198
|
-
/* @__PURE__ */
|
|
26199
|
-
members.length > 0 && /* @__PURE__ */
|
|
26200
|
-
ancestors.length > 0 && /* @__PURE__ */
|
|
26201
|
-
/* @__PURE__ */
|
|
26228
|
+
return /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", borderStyle: "single", borderColor: PALETTE.error, paddingX: 1, children: [
|
|
26229
|
+
/* @__PURE__ */ jsx51(Text47, { color: PALETTE.error, bold: true, children: `Cyclic component graph \u2014 auto-rejected ${stillRejected.length} component${stillRejected.length === 1 ? "" : "s"}:` }),
|
|
26230
|
+
members.length > 0 && /* @__PURE__ */ jsx51(Text47, { color: PALETTE.error, children: ` Cycle members: ${members.join(", ")}` }),
|
|
26231
|
+
ancestors.length > 0 && /* @__PURE__ */ jsx51(Text47, { color: PALETTE.error, children: ` Ancestors: ${ancestors.join(", ")}` }),
|
|
26232
|
+
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: undoSnapshot ? " [Ctrl+Z] undo \xB7 [r]/[a] manually toggle \xB7 [F] continue" : " [r]/[a] manually toggle \xB7 [F] continue" })
|
|
26202
26233
|
] });
|
|
26203
26234
|
})(),
|
|
26204
|
-
/* @__PURE__ */
|
|
26205
|
-
/* @__PURE__ */
|
|
26206
|
-
!dialogOpen && /* @__PURE__ */ jsxs44(
|
|
26207
|
-
breakingPanel.isOpen ? /* @__PURE__ */
|
|
26235
|
+
/* @__PURE__ */ jsx51(ReviewEmptyComponentsWarning, { count: emptyCount, hidden: dialogOpen }),
|
|
26236
|
+
/* @__PURE__ */ jsx51(ReviewFinalizeError, { message: finalizeError, hidden: dialogOpen }),
|
|
26237
|
+
!dialogOpen && /* @__PURE__ */ jsxs44(Box43, { children: [
|
|
26238
|
+
breakingPanel.isOpen ? /* @__PURE__ */ jsx51(
|
|
26208
26239
|
GotoBanner,
|
|
26209
26240
|
{
|
|
26210
26241
|
title: "Breaking changes",
|
|
@@ -26217,7 +26248,7 @@ function GenerateReviewStep({
|
|
|
26217
26248
|
width: sidebarWidth,
|
|
26218
26249
|
footerHint: "[\u2191/\u2193] move \xB7 [Enter] jump \xB7 [D] detail \xB7 [Esc] close"
|
|
26219
26250
|
}
|
|
26220
|
-
) : lineagePanel.isOpen && focusedComponentKey ? /* @__PURE__ */
|
|
26251
|
+
) : lineagePanel.isOpen && focusedComponentKey ? /* @__PURE__ */ jsx51(
|
|
26221
26252
|
LineagePanel,
|
|
26222
26253
|
{
|
|
26223
26254
|
focusedComponentKey,
|
|
@@ -26227,7 +26258,7 @@ function GenerateReviewStep({
|
|
|
26227
26258
|
maxRows: panelMaxRows,
|
|
26228
26259
|
width: sidebarWidth
|
|
26229
26260
|
}
|
|
26230
|
-
) : /* @__PURE__ */
|
|
26261
|
+
) : /* @__PURE__ */ jsx51(
|
|
26231
26262
|
GroupedSidebar,
|
|
26232
26263
|
{
|
|
26233
26264
|
items: groupedItems,
|
|
@@ -26265,7 +26296,7 @@ function GenerateReviewStep({
|
|
|
26265
26296
|
graph: sidebarGraph
|
|
26266
26297
|
}
|
|
26267
26298
|
),
|
|
26268
|
-
selected ? /* @__PURE__ */
|
|
26299
|
+
selected ? /* @__PURE__ */ jsx51(
|
|
26269
26300
|
ReviewComponentPanel,
|
|
26270
26301
|
{
|
|
26271
26302
|
selectedKey: selected.key,
|
|
@@ -26292,13 +26323,13 @@ function GenerateReviewStep({
|
|
|
26292
26323
|
livePreview: livePreviewHook,
|
|
26293
26324
|
livePreviewSpinner
|
|
26294
26325
|
}
|
|
26295
|
-
) : /* @__PURE__ */
|
|
26326
|
+
) : /* @__PURE__ */ jsx51(ReviewNoSelection, {})
|
|
26296
26327
|
] }),
|
|
26297
26328
|
breakPanel.isOpen && !breakOverlayFullScreen && !dialogOpen && renderBreakOverlay(),
|
|
26298
|
-
!dialogOpen && slotCycles.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs44(
|
|
26299
|
-
/* @__PURE__ */
|
|
26329
|
+
!dialogOpen && slotCycles.length > 0 && !cyclePanel.isOpen && !breakPanel.isOpen && /* @__PURE__ */ jsxs44(Box43, { flexDirection: "column", children: [
|
|
26330
|
+
/* @__PURE__ */ jsx51(Text47, { color: PALETTE.warning, children: `\u26A0 ${slotCycles.length} slot dependency cycle${slotCycles.length === 1 ? "" : "s"} detected \u2014 push will fail` }),
|
|
26300
26331
|
slotCycles.slice(0, 3).map((cycle, idx) => {
|
|
26301
|
-
return /* @__PURE__ */
|
|
26332
|
+
return /* @__PURE__ */ jsx51(
|
|
26302
26333
|
CyclePathLine,
|
|
26303
26334
|
{
|
|
26304
26335
|
segments: formatCyclePathSegments(cycle),
|
|
@@ -26309,10 +26340,10 @@ function GenerateReviewStep({
|
|
|
26309
26340
|
`cyc-banner-${idx}`
|
|
26310
26341
|
);
|
|
26311
26342
|
}),
|
|
26312
|
-
slotCycles.length > 3 && /* @__PURE__ */
|
|
26313
|
-
/* @__PURE__ */
|
|
26343
|
+
slotCycles.length > 3 && /* @__PURE__ */ jsx51(Text47, { color: PALETTE.warning, children: ` \u2026${slotCycles.length - 3} more` }),
|
|
26344
|
+
/* @__PURE__ */ jsx51(Text47, { dimColor: true, children: " press [c] for detail" })
|
|
26314
26345
|
] }),
|
|
26315
|
-
/* @__PURE__ */
|
|
26346
|
+
/* @__PURE__ */ jsx51(
|
|
26316
26347
|
SearchMatchSummary,
|
|
26317
26348
|
{
|
|
26318
26349
|
open: searchOpen,
|
|
@@ -26323,7 +26354,7 @@ function GenerateReviewStep({
|
|
|
26323
26354
|
hidden: dialogOpen
|
|
26324
26355
|
}
|
|
26325
26356
|
),
|
|
26326
|
-
!dialogOpen && sidebarFocused && /* @__PURE__ */
|
|
26357
|
+
!dialogOpen && sidebarFocused && /* @__PURE__ */ jsx51(Box43, { columnGap: 2, flexWrap: "wrap", children: reviewEditor.panelOpen === "token-review" ? /* @__PURE__ */ jsxs44(Fragment17, { children: [
|
|
26327
26358
|
legendEntry("[\u2191/\u2193]", "move"),
|
|
26328
26359
|
legendEntry("[Enter]", "edit allowed"),
|
|
26329
26360
|
legendEntry("[Esc]", "close")
|
|
@@ -26359,7 +26390,7 @@ function GenerateReviewStep({
|
|
|
26359
26390
|
legendEntry("[?]", "help"),
|
|
26360
26391
|
legendEntry("[q]", "quit")
|
|
26361
26392
|
] }) }),
|
|
26362
|
-
!dialogOpen && /* @__PURE__ */
|
|
26393
|
+
!dialogOpen && /* @__PURE__ */ jsx51(
|
|
26363
26394
|
ReviewStatusBar,
|
|
26364
26395
|
{
|
|
26365
26396
|
entries: components,
|
|
@@ -26425,7 +26456,7 @@ var init_GenerateReviewStep = __esm({
|
|
|
26425
26456
|
{
|
|
26426
26457
|
title: "Navigation",
|
|
26427
26458
|
entries: [
|
|
26428
|
-
{ keys: "
|
|
26459
|
+
{ keys: "\u2191 / \u2193", label: "Move cursor" },
|
|
26429
26460
|
{ keys: "Tab", label: "Toggle sidebar/panel" },
|
|
26430
26461
|
{ keys: "Enter", label: "Drill to source" }
|
|
26431
26462
|
]
|
|
@@ -26482,50 +26513,6 @@ var init_GenerateReviewStep = __esm({
|
|
|
26482
26513
|
}
|
|
26483
26514
|
});
|
|
26484
26515
|
|
|
26485
|
-
// packages/experience-design-system-cli/src/import/tui/final-review-host.tsx
|
|
26486
|
-
import { Box as Box45, Text as Text49 } from "ink";
|
|
26487
|
-
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
26488
|
-
function FinalReviewHost({
|
|
26489
|
-
extractSessionId,
|
|
26490
|
-
tokenSessionId,
|
|
26491
|
-
onFinalize,
|
|
26492
|
-
onQuit,
|
|
26493
|
-
livePreview,
|
|
26494
|
-
spaceId,
|
|
26495
|
-
environmentId,
|
|
26496
|
-
cmaToken,
|
|
26497
|
-
host,
|
|
26498
|
-
tokensPath,
|
|
26499
|
-
initialFinalizeError
|
|
26500
|
-
}) {
|
|
26501
|
-
if (!extractSessionId) {
|
|
26502
|
-
return /* @__PURE__ */ jsx53(Box45, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx53(Text49, { color: PALETTE.error, children: "Error: no session ID \u2014 cannot load generated definitions." }) });
|
|
26503
|
-
}
|
|
26504
|
-
return /* @__PURE__ */ jsx53(
|
|
26505
|
-
GenerateReviewStep,
|
|
26506
|
-
{
|
|
26507
|
-
extractSessionId,
|
|
26508
|
-
tokenSessionId,
|
|
26509
|
-
onFinalize,
|
|
26510
|
-
onQuit,
|
|
26511
|
-
livePreview,
|
|
26512
|
-
spaceId,
|
|
26513
|
-
environmentId,
|
|
26514
|
-
cmaToken,
|
|
26515
|
-
host,
|
|
26516
|
-
tokensPath,
|
|
26517
|
-
initialFinalizeError
|
|
26518
|
-
}
|
|
26519
|
-
);
|
|
26520
|
-
}
|
|
26521
|
-
var init_final_review_host = __esm({
|
|
26522
|
-
"packages/experience-design-system-cli/src/import/tui/final-review-host.tsx"() {
|
|
26523
|
-
"use strict";
|
|
26524
|
-
init_theme();
|
|
26525
|
-
init_GenerateReviewStep();
|
|
26526
|
-
}
|
|
26527
|
-
});
|
|
26528
|
-
|
|
26529
26516
|
// packages/experience-design-system-cli/src/import/tui/runScopeGate.ts
|
|
26530
26517
|
async function runScopeGate(opts) {
|
|
26531
26518
|
const db = openPipelineDb();
|
|
@@ -26650,6 +26637,70 @@ var init_wizard_state_transitions = __esm({
|
|
|
26650
26637
|
}
|
|
26651
26638
|
});
|
|
26652
26639
|
|
|
26640
|
+
// packages/experience-design-system-cli/src/import/tui/run-selection-agent.ts
|
|
26641
|
+
async function runSelectionAgent(options) {
|
|
26642
|
+
const db = openPipelineDb();
|
|
26643
|
+
let components;
|
|
26644
|
+
try {
|
|
26645
|
+
components = loadRawComponents(db, options.sessionId);
|
|
26646
|
+
} finally {
|
|
26647
|
+
db.close();
|
|
26648
|
+
}
|
|
26649
|
+
if (components.length === 0) return;
|
|
26650
|
+
const invoker2 = createLocalCliAgentInvoker({
|
|
26651
|
+
onDebugEvent: (name, payload) => getDebugLogger().event("agent", name, payload)
|
|
26652
|
+
});
|
|
26653
|
+
const prompt = await buildPrompt({
|
|
26654
|
+
skill: "select",
|
|
26655
|
+
mode: "autonomous",
|
|
26656
|
+
rawComponentsInline: JSON.stringify(components, null, 2),
|
|
26657
|
+
outDir: process.cwd(),
|
|
26658
|
+
...options.promptText !== void 0 ? { skillContentOverride: options.promptText } : {},
|
|
26659
|
+
...options.promptText === void 0 && options.promptPath ? { skillPathOverride: options.promptPath } : {}
|
|
26660
|
+
});
|
|
26661
|
+
const { result } = await invokeAgentWithOutput(
|
|
26662
|
+
invoker2,
|
|
26663
|
+
{ agent: options.agent, model: options.model, prompt, timeoutMs: DEFAULT_TIMEOUT_MS4 },
|
|
26664
|
+
false
|
|
26665
|
+
);
|
|
26666
|
+
if (result.timedOut) throw new Error("selection agent timed out");
|
|
26667
|
+
if (result.exitCode !== 0) throw new Error(`selection agent exited with code ${result.exitCode}`);
|
|
26668
|
+
const { calls, warnings } = parseSelectToolCallLines(result.stdout);
|
|
26669
|
+
for (const warning of warnings) process.stderr.write(`Warning: selection agent: ${warning}
|
|
26670
|
+
`);
|
|
26671
|
+
const byName = new Map(calls.map((call) => [call.name, call]));
|
|
26672
|
+
const writeDb = openPipelineDb();
|
|
26673
|
+
try {
|
|
26674
|
+
const update = writeDb.prepare(
|
|
26675
|
+
`UPDATE raw_components SET status = ?, reject_reason = ? WHERE session_id = ? AND component_id = ?`
|
|
26676
|
+
);
|
|
26677
|
+
for (const component of components) {
|
|
26678
|
+
const call = byName.get(component.name);
|
|
26679
|
+
if (!call) continue;
|
|
26680
|
+
const rejected = call.tool === "reject_component";
|
|
26681
|
+
update.run(
|
|
26682
|
+
rejected ? "rejected" : "accepted",
|
|
26683
|
+
rejected ? call.reason ?? null : null,
|
|
26684
|
+
options.sessionId,
|
|
26685
|
+
component.component_id
|
|
26686
|
+
);
|
|
26687
|
+
}
|
|
26688
|
+
} finally {
|
|
26689
|
+
writeDb.close();
|
|
26690
|
+
}
|
|
26691
|
+
}
|
|
26692
|
+
var DEFAULT_TIMEOUT_MS4;
|
|
26693
|
+
var init_run_selection_agent = __esm({
|
|
26694
|
+
"packages/experience-design-system-cli/src/import/tui/run-selection-agent.ts"() {
|
|
26695
|
+
"use strict";
|
|
26696
|
+
init_src();
|
|
26697
|
+
init_debug_logger();
|
|
26698
|
+
init_agent_output();
|
|
26699
|
+
init_db();
|
|
26700
|
+
DEFAULT_TIMEOUT_MS4 = Number(process.env.EDS_AGENT_TIMEOUT_MS ?? 5 * 60 * 1e3);
|
|
26701
|
+
}
|
|
26702
|
+
});
|
|
26703
|
+
|
|
26653
26704
|
// packages/experience-design-system-cli/src/import/tui/WizardApp.tsx
|
|
26654
26705
|
var WizardApp_exports = {};
|
|
26655
26706
|
__export(WizardApp_exports, {
|
|
@@ -26663,7 +26714,7 @@ __export(WizardApp_exports, {
|
|
|
26663
26714
|
shouldRunMapTokens: () => shouldRunMapTokens
|
|
26664
26715
|
});
|
|
26665
26716
|
import { useEffect as useEffect11, useRef as useRef9, useState as useState23 } from "react";
|
|
26666
|
-
import { Box as
|
|
26717
|
+
import { Box as Box44, Text as Text48, useStdout as useStdout4 } from "ink";
|
|
26667
26718
|
import { join as join20, resolve as resolve17 } from "node:path";
|
|
26668
26719
|
import { appendFileSync as appendFileSync2, writeFileSync } from "node:fs";
|
|
26669
26720
|
import { access as access7, stat as stat5, writeFile as writeFile6 } from "node:fs/promises";
|
|
@@ -26671,7 +26722,7 @@ import { tmpdir } from "node:os";
|
|
|
26671
26722
|
import { execFile as execFile2, spawn as spawn3 } from "node:child_process";
|
|
26672
26723
|
import { mkdir as mkdir5 } from "node:fs/promises";
|
|
26673
26724
|
import { buildCDF as buildCDF3, validateCDF as validateCDF3, validateSlotReferences as validateSlotReferences2 } from "@contentful/experience-design-system-types";
|
|
26674
|
-
import { jsx as
|
|
26725
|
+
import { jsx as jsx52, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
26675
26726
|
function buildGenerateComponentsArgs(opts) {
|
|
26676
26727
|
const args = ["__generate", "components", "--agent", opts.agent, "--session", opts.sessionId];
|
|
26677
26728
|
if (opts.tokensPath) args.push("--tokens", opts.tokensPath);
|
|
@@ -26688,6 +26739,7 @@ function buildGenerateTokensArgs(opts) {
|
|
|
26688
26739
|
if (opts.model) args.push("--model", opts.model);
|
|
26689
26740
|
if (opts.bedrock) args.push("--bedrock");
|
|
26690
26741
|
if (opts.noCache) args.push("--no-cache");
|
|
26742
|
+
for (const prompt of opts.promptOverrides ?? []) args.push("--prompt", prompt);
|
|
26691
26743
|
return args;
|
|
26692
26744
|
}
|
|
26693
26745
|
function buildMapTokensArgs(opts) {
|
|
@@ -26695,6 +26747,7 @@ function buildMapTokensArgs(opts) {
|
|
|
26695
26747
|
if (opts.model) args.push("--model", opts.model);
|
|
26696
26748
|
if (opts.noCache) args.push("--no-cache");
|
|
26697
26749
|
if (opts.skipAgent) args.push("--skip-agent");
|
|
26750
|
+
for (const prompt of opts.promptOverrides ?? []) args.push("--prompt", prompt);
|
|
26698
26751
|
if (opts.existingEntitiesPath) args.push("--existing-entities-path", opts.existingEntitiesPath);
|
|
26699
26752
|
return args;
|
|
26700
26753
|
}
|
|
@@ -26770,7 +26823,6 @@ function WizardApp({
|
|
|
26770
26823
|
bedrock = false,
|
|
26771
26824
|
initialProjectPath,
|
|
26772
26825
|
host,
|
|
26773
|
-
compositionMap,
|
|
26774
26826
|
promptOverrides,
|
|
26775
26827
|
noCache = false,
|
|
26776
26828
|
livePreview = true,
|
|
@@ -26940,7 +26992,8 @@ If you are using AWS Bedrock, run:
|
|
|
26940
26992
|
agent: state.agent,
|
|
26941
26993
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
26942
26994
|
...state.bedrock ? { bedrock: true } : {},
|
|
26943
|
-
noCache: effectiveNoCache
|
|
26995
|
+
noCache: effectiveNoCache,
|
|
26996
|
+
promptOverrides
|
|
26944
26997
|
});
|
|
26945
26998
|
const result = await runSpawnedCli(tokenArgs);
|
|
26946
26999
|
if (result.exitCode !== 0) {
|
|
@@ -27020,6 +27073,7 @@ If you are using AWS Bedrock, run:
|
|
|
27020
27073
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
27021
27074
|
noCache: effectiveNoCache,
|
|
27022
27075
|
skipAgent: skipMapTokens,
|
|
27076
|
+
promptOverrides,
|
|
27023
27077
|
...state.existingEntitiesPath ? { existingEntitiesPath: state.existingEntitiesPath } : {}
|
|
27024
27078
|
});
|
|
27025
27079
|
const result = await runCli(args);
|
|
@@ -27038,7 +27092,6 @@ If you are using AWS Bedrock, run:
|
|
|
27038
27092
|
update({ step: "extracting", outDir, extractProgress: null, compositionPhase: null });
|
|
27039
27093
|
const extractArgs = [findCliPath(), "__extract", "--project", projectPath];
|
|
27040
27094
|
if (noCache) extractArgs.push("--composition-refresh");
|
|
27041
|
-
if (compositionMap) extractArgs.push("--composition-map", compositionMap);
|
|
27042
27095
|
for (const p of promptOverrides ?? []) extractArgs.push("--prompt", p);
|
|
27043
27096
|
if (state.agent) extractArgs.push("--agent", state.agent);
|
|
27044
27097
|
if (state.bedrock) extractArgs.push("--bedrock");
|
|
@@ -27103,6 +27156,34 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
27103
27156
|
});
|
|
27104
27157
|
return;
|
|
27105
27158
|
}
|
|
27159
|
+
try {
|
|
27160
|
+
const { overrides, errors } = parsePromptOverrides(promptOverrides ?? []);
|
|
27161
|
+
if (errors.length > 0) throw new Error(errors.join("; "));
|
|
27162
|
+
const selectOverride = overrides.get("select");
|
|
27163
|
+
let promptText;
|
|
27164
|
+
let promptPath;
|
|
27165
|
+
if (selectOverride?.kind === "text") promptText = selectOverride.value;
|
|
27166
|
+
if (selectOverride?.kind === "path") {
|
|
27167
|
+
promptPath = resolve17(selectOverride.value);
|
|
27168
|
+
await resolvePromptOverride(selectOverride);
|
|
27169
|
+
}
|
|
27170
|
+
if (state.agent) {
|
|
27171
|
+
await runSelectionAgent({
|
|
27172
|
+
sessionId: extractSessionId ?? "",
|
|
27173
|
+
agent: state.agent,
|
|
27174
|
+
...state.agentModel ? { model: state.agentModel } : {},
|
|
27175
|
+
...promptText !== void 0 ? { promptText } : {},
|
|
27176
|
+
...promptPath ? { promptPath } : {}
|
|
27177
|
+
});
|
|
27178
|
+
}
|
|
27179
|
+
} catch (error) {
|
|
27180
|
+
update({
|
|
27181
|
+
step: "error",
|
|
27182
|
+
errorStep: "selection agent",
|
|
27183
|
+
errorMessage: error instanceof Error ? error.message : String(error)
|
|
27184
|
+
});
|
|
27185
|
+
return;
|
|
27186
|
+
}
|
|
27106
27187
|
update({
|
|
27107
27188
|
step: "scope-gate",
|
|
27108
27189
|
extractSessionId
|
|
@@ -27828,7 +27909,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27828
27909
|
const stepContent = (() => {
|
|
27829
27910
|
switch (state.step) {
|
|
27830
27911
|
case "welcome":
|
|
27831
|
-
return /* @__PURE__ */
|
|
27912
|
+
return /* @__PURE__ */ jsx52(
|
|
27832
27913
|
WelcomeStep,
|
|
27833
27914
|
{
|
|
27834
27915
|
onContinue: (path) => {
|
|
@@ -27840,7 +27921,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27840
27921
|
}
|
|
27841
27922
|
);
|
|
27842
27923
|
case "token-input":
|
|
27843
|
-
return /* @__PURE__ */
|
|
27924
|
+
return /* @__PURE__ */ jsx52(
|
|
27844
27925
|
TokenInputStep,
|
|
27845
27926
|
{
|
|
27846
27927
|
onConfirm: (rawTokensPath) => {
|
|
@@ -27851,7 +27932,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27851
27932
|
}
|
|
27852
27933
|
);
|
|
27853
27934
|
case "token-reuse-gate":
|
|
27854
|
-
return /* @__PURE__ */
|
|
27935
|
+
return /* @__PURE__ */ jsx52(
|
|
27855
27936
|
GateStep,
|
|
27856
27937
|
{
|
|
27857
27938
|
successMessage: "Existing tokens.json found",
|
|
@@ -27873,7 +27954,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27873
27954
|
}
|
|
27874
27955
|
);
|
|
27875
27956
|
case "checking-claude-auth":
|
|
27876
|
-
return /* @__PURE__ */
|
|
27957
|
+
return /* @__PURE__ */ jsx52(
|
|
27877
27958
|
RunningStep,
|
|
27878
27959
|
{
|
|
27879
27960
|
stepNumber: state.authCheckStepNumber,
|
|
@@ -27883,7 +27964,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27883
27964
|
}
|
|
27884
27965
|
);
|
|
27885
27966
|
case "generating-tokens":
|
|
27886
|
-
return /* @__PURE__ */
|
|
27967
|
+
return /* @__PURE__ */ jsx52(
|
|
27887
27968
|
RunningStep,
|
|
27888
27969
|
{
|
|
27889
27970
|
stepNumber: 1,
|
|
@@ -27893,7 +27974,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27893
27974
|
}
|
|
27894
27975
|
);
|
|
27895
27976
|
case "path-validation":
|
|
27896
|
-
return /* @__PURE__ */
|
|
27977
|
+
return /* @__PURE__ */ jsx52(
|
|
27897
27978
|
PathValidationStep,
|
|
27898
27979
|
{
|
|
27899
27980
|
projectPath: state.projectPath,
|
|
@@ -27928,7 +28009,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27928
28009
|
if (phase === "done") return "Composition mapping resolved \u2713";
|
|
27929
28010
|
return `Composition: ${phase}`;
|
|
27930
28011
|
})();
|
|
27931
|
-
return /* @__PURE__ */
|
|
28012
|
+
return /* @__PURE__ */ jsx52(
|
|
27932
28013
|
RunningStep,
|
|
27933
28014
|
{
|
|
27934
28015
|
stepNumber: hasTokens ? 2 : 1,
|
|
@@ -27942,7 +28023,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27942
28023
|
}
|
|
27943
28024
|
case "scope-gate": {
|
|
27944
28025
|
if (!state.extractSessionId) {
|
|
27945
|
-
return /* @__PURE__ */
|
|
28026
|
+
return /* @__PURE__ */ jsx52(Box44, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ jsx52(Text48, { color: PALETTE.error, children: "Error: extract session ID missing \u2014 please re-run." }) });
|
|
27946
28027
|
}
|
|
27947
28028
|
const sessionId2 = state.extractSessionId;
|
|
27948
28029
|
const db = openPipelineDb();
|
|
@@ -27952,8 +28033,8 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27952
28033
|
} finally {
|
|
27953
28034
|
db.close();
|
|
27954
28035
|
}
|
|
27955
|
-
return /* @__PURE__ */
|
|
27956
|
-
|
|
28036
|
+
return /* @__PURE__ */ jsx52(
|
|
28037
|
+
ScopeGateStep,
|
|
27957
28038
|
{
|
|
27958
28039
|
components,
|
|
27959
28040
|
onConfirm: (decisions) => {
|
|
@@ -27985,7 +28066,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27985
28066
|
const p = state.generateProgress;
|
|
27986
28067
|
const stepNum = hasTokens ? 4 : 3;
|
|
27987
28068
|
const progressDetail = p ? `[${p.done}/${p.total}] ${p.current} \u2014 this can take 10\u201330 minutes for large libraries` : `Starting up ${state.agent}... (this can take 10\u201330 minutes for large libraries \u2014 grab a coffee)`;
|
|
27988
|
-
return /* @__PURE__ */
|
|
28069
|
+
return /* @__PURE__ */ jsx52(
|
|
27989
28070
|
RunningStep,
|
|
27990
28071
|
{
|
|
27991
28072
|
stepNumber: stepNum,
|
|
@@ -27998,7 +28079,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
27998
28079
|
}
|
|
27999
28080
|
case "mapping-tokens": {
|
|
28000
28081
|
const stepNum = hasTokens ? 5 : 4;
|
|
28001
|
-
return /* @__PURE__ */
|
|
28082
|
+
return /* @__PURE__ */ jsx52(
|
|
28002
28083
|
RunningStep,
|
|
28003
28084
|
{
|
|
28004
28085
|
stepNumber: stepNum,
|
|
@@ -28010,8 +28091,8 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28010
28091
|
);
|
|
28011
28092
|
}
|
|
28012
28093
|
case "final-review": {
|
|
28013
|
-
return /* @__PURE__ */
|
|
28014
|
-
|
|
28094
|
+
return /* @__PURE__ */ jsx52(
|
|
28095
|
+
GenerateReviewStep,
|
|
28015
28096
|
{
|
|
28016
28097
|
extractSessionId: state.extractSessionId,
|
|
28017
28098
|
tokenSessionId: state.tokenSessionId,
|
|
@@ -28069,7 +28150,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28069
28150
|
const files = hasComponents || hasTokens ? "components.json" : null;
|
|
28070
28151
|
const count = state.generatedAcceptedCount > 0 ? state.generatedAcceptedCount : state.generatedCount;
|
|
28071
28152
|
const summary = hasComponents ? `${count} component definition${count !== 1 ? "s" : ""} ready${hasTokens ? ", design tokens ready" : ""}.` : hasTokens ? "Design tokens ready." : "Ready to continue.";
|
|
28072
|
-
return /* @__PURE__ */
|
|
28153
|
+
return /* @__PURE__ */ jsx52(
|
|
28073
28154
|
PushDecisionGateStep,
|
|
28074
28155
|
{
|
|
28075
28156
|
summary,
|
|
@@ -28101,7 +28182,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28101
28182
|
);
|
|
28102
28183
|
}
|
|
28103
28184
|
case "credentials":
|
|
28104
|
-
return /* @__PURE__ */
|
|
28185
|
+
return /* @__PURE__ */ jsx52(
|
|
28105
28186
|
CredentialsStep,
|
|
28106
28187
|
{
|
|
28107
28188
|
initialSpaceId: state.spaceId,
|
|
@@ -28133,7 +28214,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28133
28214
|
}
|
|
28134
28215
|
);
|
|
28135
28216
|
case "previewing":
|
|
28136
|
-
return /* @__PURE__ */
|
|
28217
|
+
return /* @__PURE__ */ jsx52(
|
|
28137
28218
|
RunningStep,
|
|
28138
28219
|
{
|
|
28139
28220
|
stepNumber: totalSteps,
|
|
@@ -28144,7 +28225,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28144
28225
|
);
|
|
28145
28226
|
case "preview-gate": {
|
|
28146
28227
|
const editableComponentCount = extractComponents(state.cdf).length;
|
|
28147
|
-
return /* @__PURE__ */
|
|
28228
|
+
return /* @__PURE__ */ jsx52(
|
|
28148
28229
|
WizardPreviewStep,
|
|
28149
28230
|
{
|
|
28150
28231
|
preview: state.serverPreview,
|
|
@@ -28172,9 +28253,9 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28172
28253
|
);
|
|
28173
28254
|
}
|
|
28174
28255
|
case "pushing":
|
|
28175
|
-
return /* @__PURE__ */
|
|
28256
|
+
return /* @__PURE__ */ jsx52(PushingStep, { stepNumber: totalSteps, totalSteps, progress: state.pushProgress });
|
|
28176
28257
|
case "path-prompt":
|
|
28177
|
-
return /* @__PURE__ */
|
|
28258
|
+
return /* @__PURE__ */ jsx52(
|
|
28178
28259
|
PathPrompt,
|
|
28179
28260
|
{
|
|
28180
28261
|
defaultPath: state.outDir,
|
|
@@ -28193,7 +28274,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28193
28274
|
}
|
|
28194
28275
|
);
|
|
28195
28276
|
case "save-conflict-gate":
|
|
28196
|
-
return /* @__PURE__ */
|
|
28277
|
+
return /* @__PURE__ */ jsx52(
|
|
28197
28278
|
SaveConflictGate,
|
|
28198
28279
|
{
|
|
28199
28280
|
path: state.outDir,
|
|
@@ -28211,7 +28292,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28211
28292
|
}
|
|
28212
28293
|
);
|
|
28213
28294
|
case "printing":
|
|
28214
|
-
return /* @__PURE__ */
|
|
28295
|
+
return /* @__PURE__ */ jsx52(
|
|
28215
28296
|
RunningStep,
|
|
28216
28297
|
{
|
|
28217
28298
|
stepNumber: totalSteps,
|
|
@@ -28222,7 +28303,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28222
28303
|
);
|
|
28223
28304
|
case "print-gate": {
|
|
28224
28305
|
const teaser = buildRunTeaserLine(state.lastRunId);
|
|
28225
|
-
return /* @__PURE__ */
|
|
28306
|
+
return /* @__PURE__ */ jsx52(
|
|
28226
28307
|
GateStep,
|
|
28227
28308
|
{
|
|
28228
28309
|
successMessage: "Files saved",
|
|
@@ -28240,7 +28321,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28240
28321
|
case "done": {
|
|
28241
28322
|
const totalFailed = state.pushResult.componentTypes.failed + state.pushResult.designTokens.failed;
|
|
28242
28323
|
const teaser = buildRunTeaserLine(state.lastRunId);
|
|
28243
|
-
return /* @__PURE__ */
|
|
28324
|
+
return /* @__PURE__ */ jsx52(
|
|
28244
28325
|
DoneStep,
|
|
28245
28326
|
{
|
|
28246
28327
|
componentTypes: state.pushResult.componentTypes,
|
|
@@ -28256,7 +28337,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28256
28337
|
);
|
|
28257
28338
|
}
|
|
28258
28339
|
case "preview-validation-error": {
|
|
28259
|
-
return /* @__PURE__ */
|
|
28340
|
+
return /* @__PURE__ */ jsx52(
|
|
28260
28341
|
PreviewValidationErrorStep,
|
|
28261
28342
|
{
|
|
28262
28343
|
errors: state.previewValidationErrors,
|
|
@@ -28272,7 +28353,7 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28272
28353
|
);
|
|
28273
28354
|
}
|
|
28274
28355
|
case "error":
|
|
28275
|
-
return /* @__PURE__ */
|
|
28356
|
+
return /* @__PURE__ */ jsx52(
|
|
28276
28357
|
ErrorStep,
|
|
28277
28358
|
{
|
|
28278
28359
|
stepName: state.errorStep,
|
|
@@ -28294,9 +28375,9 @@ If using a custom host configuration, make sure the space exists on that host.`
|
|
|
28294
28375
|
return null;
|
|
28295
28376
|
}
|
|
28296
28377
|
})();
|
|
28297
|
-
return /* @__PURE__ */ jsxs45(
|
|
28298
|
-
/* @__PURE__ */
|
|
28299
|
-
/* @__PURE__ */
|
|
28378
|
+
return /* @__PURE__ */ jsxs45(Box44, { flexDirection: "column", width: terminalWidth, children: [
|
|
28379
|
+
/* @__PURE__ */ jsx52(TopBar, { subcommand: "import", hints }),
|
|
28380
|
+
/* @__PURE__ */ jsx52(CustomPromptBanner, { generatePromptPath }),
|
|
28300
28381
|
stepContent
|
|
28301
28382
|
] });
|
|
28302
28383
|
}
|
|
@@ -28339,8 +28420,8 @@ var init_WizardApp = __esm({
|
|
|
28339
28420
|
init_tokens();
|
|
28340
28421
|
init_preview_utils();
|
|
28341
28422
|
init_db();
|
|
28342
|
-
|
|
28343
|
-
|
|
28423
|
+
init_ScopeGateStep();
|
|
28424
|
+
init_GenerateReviewStep();
|
|
28344
28425
|
init_runScopeGate();
|
|
28345
28426
|
init_src();
|
|
28346
28427
|
init_path_utils();
|
|
@@ -28349,6 +28430,8 @@ var init_WizardApp = __esm({
|
|
|
28349
28430
|
init_fetch_and_persist_existing_contentful_entities();
|
|
28350
28431
|
init_wizard_state_transitions();
|
|
28351
28432
|
init_cli_path();
|
|
28433
|
+
init_prompt_overrides();
|
|
28434
|
+
init_run_selection_agent();
|
|
28352
28435
|
WIZARD_LOG = join20(tmpdir(), "experiences-import-wizard.log");
|
|
28353
28436
|
}
|
|
28354
28437
|
});
|
|
@@ -28356,80 +28439,71 @@ var init_WizardApp = __esm({
|
|
|
28356
28439
|
// packages/experience-design-system-cli/src/import/command.ts
|
|
28357
28440
|
function registerImportCommand(program) {
|
|
28358
28441
|
const cmd = program.command("import").description("Run the full pipeline: analyze \u2192 select \u2192 generate \u2192 push").option("--project <path>", "Path to the project root to analyze", ".");
|
|
28359
|
-
|
|
28360
|
-
|
|
28361
|
-
modelDescription: "Model to use for generate components (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)"
|
|
28362
|
-
}).option(
|
|
28363
|
-
"--raw-tokens <path>",
|
|
28442
|
+
cmd.option(
|
|
28443
|
+
"--tokens <path>",
|
|
28364
28444
|
"Path to a raw token source file (SCSS, CSS variables, JS/TS, Style Dictionary, etc.) to classify and import alongside components. Bypasses the interactive token prompt."
|
|
28365
|
-
)
|
|
28366
|
-
|
|
28367
|
-
|
|
28368
|
-
|
|
28369
|
-
|
|
28445
|
+
);
|
|
28446
|
+
addAgentModelOptions(cmd, {
|
|
28447
|
+
agentDescription: 'Agent and optional model as agent:model or "agent model" (overrides credentials.json; falls back to "claude")',
|
|
28448
|
+
includeModel: false,
|
|
28449
|
+
includeBedrock: false
|
|
28450
|
+
});
|
|
28451
|
+
cmd.option(
|
|
28370
28452
|
"--prompt <stage=value>",
|
|
28371
|
-
"Override a
|
|
28453
|
+
"Override a composition, selection, token, generation, or token-mapping prompt (repeatable). value is a file path or literal text, e.g. --prompt select=./p.md",
|
|
28372
28454
|
(v, acc) => [...acc, v],
|
|
28373
28455
|
[]
|
|
28374
|
-
).action(
|
|
28375
|
-
|
|
28376
|
-
|
|
28377
|
-
|
|
28378
|
-
|
|
28379
|
-
|
|
28380
|
-
|
|
28381
|
-
|
|
28382
|
-
process.stderr.write(`Error: --raw-tokens: file not found: ${opts.rawTokens}
|
|
28383
|
-
`);
|
|
28384
|
-
process.exit(1);
|
|
28385
|
-
return;
|
|
28386
|
-
}
|
|
28387
|
-
}
|
|
28388
|
-
if (!interactiveTerminalSupported) {
|
|
28389
|
-
requireInteractiveTerminal({
|
|
28390
|
-
alternative: "run experiences import in an interactive terminal"
|
|
28391
|
-
});
|
|
28392
|
-
}
|
|
28393
|
-
{
|
|
28394
|
-
const { render: render5 } = await import("ink");
|
|
28395
|
-
const { createElement: createElement6 } = await import("react");
|
|
28396
|
-
const { WizardApp: WizardApp2 } = await Promise.resolve().then(() => (init_WizardApp(), WizardApp_exports));
|
|
28397
|
-
const creds = await readExperiencesCredentials();
|
|
28398
|
-
const resolvedAgent = resolveAgent(opts.agent, creds.agent);
|
|
28399
|
-
const resolvedModel = resolveModel(opts.model, creds.agentModel);
|
|
28400
|
-
if (opts.bedrock && !(isAgentName(resolvedAgent) && agentSupportsBedrock(resolvedAgent))) {
|
|
28401
|
-
process.stderr.write(`Error: --bedrock is not supported for --agent ${resolvedAgent}
|
|
28456
|
+
).option("--no-cache", "Re-run all steps even if output already exists").action(async (opts) => {
|
|
28457
|
+
const interactiveTerminalSupported = getInteractiveTerminalSupport().supported;
|
|
28458
|
+
if (opts.tokens !== void 0) {
|
|
28459
|
+
const { access: access9 } = await import("node:fs/promises");
|
|
28460
|
+
try {
|
|
28461
|
+
await access9(normalizePath(opts.tokens));
|
|
28462
|
+
} catch {
|
|
28463
|
+
process.stderr.write(`Error: --tokens: file not found: ${opts.tokens}
|
|
28402
28464
|
`);
|
|
28403
|
-
|
|
28404
|
-
}
|
|
28405
|
-
const { waitUntilExit } = render5(
|
|
28406
|
-
createElement6(WizardApp2, {
|
|
28407
|
-
initialSpaceId: creds.spaceId,
|
|
28408
|
-
initialEnvironmentId: creds.environmentId || "master",
|
|
28409
|
-
initialCmaToken: creds.cmaToken,
|
|
28410
|
-
initialHost: toConfiguredHost(creds.host) ?? DEFAULT_CONFIGURED_HOST,
|
|
28411
|
-
initialAgent: resolvedAgent,
|
|
28412
|
-
...resolvedModel ? { initialModel: resolvedModel } : {},
|
|
28413
|
-
...opts.bedrock ? { bedrock: true } : {},
|
|
28414
|
-
initialProjectPath: opts.project !== "." ? normalizePath(opts.project) : void 0,
|
|
28415
|
-
...buildCompositionForwardingOptions(opts),
|
|
28416
|
-
noCache: opts.cache === false,
|
|
28417
|
-
skipMapTokens: opts.skipMapTokens ?? false,
|
|
28418
|
-
livePreview: true,
|
|
28419
|
-
generatePromptPath: creds.generatePromptPath,
|
|
28420
|
-
...opts.rawTokens ? { initialRawTokensPath: normalizePath(opts.rawTokens) } : {}
|
|
28421
|
-
})
|
|
28422
|
-
);
|
|
28423
|
-
await waitUntilExit();
|
|
28465
|
+
process.exit(1);
|
|
28424
28466
|
return;
|
|
28425
28467
|
}
|
|
28426
28468
|
}
|
|
28427
|
-
|
|
28469
|
+
if (!interactiveTerminalSupported) {
|
|
28470
|
+
requireInteractiveTerminal({
|
|
28471
|
+
alternative: "run experiences import in an interactive terminal"
|
|
28472
|
+
});
|
|
28473
|
+
}
|
|
28474
|
+
{
|
|
28475
|
+
const { render: render5 } = await import("ink");
|
|
28476
|
+
const { createElement: createElement6 } = await import("react");
|
|
28477
|
+
const { WizardApp: WizardApp2 } = await Promise.resolve().then(() => (init_WizardApp(), WizardApp_exports));
|
|
28478
|
+
const creds = await readExperiencesCredentials();
|
|
28479
|
+
const parsedAgentModel = parseAgentModel(opts.agent);
|
|
28480
|
+
const resolvedAgent = resolveAgent(parsedAgentModel.agent, creds.agent);
|
|
28481
|
+
const resolvedModel = resolveModel(parsedAgentModel.model, creds.agentModel);
|
|
28482
|
+
const { waitUntilExit } = render5(
|
|
28483
|
+
createElement6(WizardApp2, {
|
|
28484
|
+
initialSpaceId: creds.spaceId,
|
|
28485
|
+
initialEnvironmentId: creds.environmentId || "master",
|
|
28486
|
+
initialCmaToken: creds.cmaToken,
|
|
28487
|
+
initialHost: toConfiguredHost(creds.host) ?? DEFAULT_CONFIGURED_HOST,
|
|
28488
|
+
initialAgent: resolvedAgent,
|
|
28489
|
+
...resolvedModel ? { initialModel: resolvedModel } : {},
|
|
28490
|
+
initialProjectPath: opts.project !== "." ? normalizePath(opts.project) : void 0,
|
|
28491
|
+
...buildCompositionForwardingOptions(opts),
|
|
28492
|
+
noCache: opts.cache === false,
|
|
28493
|
+
skipMapTokens: false,
|
|
28494
|
+
livePreview: true,
|
|
28495
|
+
generatePromptPath: creds.generatePromptPath,
|
|
28496
|
+
...opts.tokens ? { initialRawTokensPath: normalizePath(opts.tokens) } : {}
|
|
28497
|
+
})
|
|
28498
|
+
);
|
|
28499
|
+
await waitUntilExit();
|
|
28500
|
+
return;
|
|
28501
|
+
}
|
|
28502
|
+
});
|
|
28428
28503
|
}
|
|
28429
28504
|
var init_command6 = __esm({
|
|
28430
28505
|
"packages/experience-design-system-cli/src/import/command.ts"() {
|
|
28431
28506
|
"use strict";
|
|
28432
|
-
init_src();
|
|
28433
28507
|
init_path_utils();
|
|
28434
28508
|
init_agent_model_resolve();
|
|
28435
28509
|
init_agent_model_options();
|
|
@@ -28742,7 +28816,7 @@ var init_checks2 = __esm({
|
|
|
28742
28816
|
});
|
|
28743
28817
|
|
|
28744
28818
|
// packages/experience-design-system-cli/src/doctor/command.ts
|
|
28745
|
-
async function runChecks(
|
|
28819
|
+
async function runChecks() {
|
|
28746
28820
|
const pkgRoot = findPkgRoot();
|
|
28747
28821
|
const results = [];
|
|
28748
28822
|
const record = (name, passed, required = true) => {
|
|
@@ -28751,13 +28825,11 @@ async function runChecks(opts) {
|
|
|
28751
28825
|
};
|
|
28752
28826
|
if (record("Node.js version", await reportNode())) {
|
|
28753
28827
|
const pnpmOk = record("pnpm", await reportPnpm(pkgRoot));
|
|
28754
|
-
if (
|
|
28755
|
-
info("\nSkipping install + build (--skip-build)");
|
|
28756
|
-
} else if (pnpmOk && record("dependencies", await reportDependencies(pkgRoot))) {
|
|
28828
|
+
if (pnpmOk && record("dependencies", await reportDependencies(pkgRoot))) {
|
|
28757
28829
|
record("build", await reportBuild(pkgRoot));
|
|
28758
28830
|
}
|
|
28759
28831
|
}
|
|
28760
|
-
|
|
28832
|
+
record("coding agent", await reportAgent(), false);
|
|
28761
28833
|
return results;
|
|
28762
28834
|
}
|
|
28763
28835
|
function printSummary(results) {
|
|
@@ -28797,13 +28869,13 @@ ${c.red(c.bold(`\u2717 ${requiredFailed} required check${requiredFailed === 1 ?
|
|
|
28797
28869
|
`);
|
|
28798
28870
|
return 1;
|
|
28799
28871
|
}
|
|
28800
|
-
async function runDoctor(
|
|
28872
|
+
async function runDoctor() {
|
|
28801
28873
|
process.stderr.write(`${c.bold("experiences doctor")} \u2014 checking your environment
|
|
28802
28874
|
`);
|
|
28803
|
-
process.exitCode = printSummary(await runChecks(
|
|
28875
|
+
process.exitCode = printSummary(await runChecks());
|
|
28804
28876
|
}
|
|
28805
28877
|
function registerDoctorCommand(program) {
|
|
28806
|
-
program.command("doctor").description("Check prerequisites so experiences import runs without errors").
|
|
28878
|
+
program.command("doctor").description("Check prerequisites so experiences import runs without errors").helpOption(false).action(() => runDoctor());
|
|
28807
28879
|
}
|
|
28808
28880
|
var init_command7 = __esm({
|
|
28809
28881
|
"packages/experience-design-system-cli/src/doctor/command.ts"() {
|
|
@@ -28817,8 +28889,8 @@ var init_command7 = __esm({
|
|
|
28817
28889
|
|
|
28818
28890
|
// packages/experience-design-system-cli/src/setup/SetupStepper.tsx
|
|
28819
28891
|
import React18 from "react";
|
|
28820
|
-
import { Box as
|
|
28821
|
-
import { jsx as
|
|
28892
|
+
import { Box as Box45, Text as Text49 } from "ink";
|
|
28893
|
+
import { jsx as jsx53, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
28822
28894
|
function stepLabel(step, title, state, wide) {
|
|
28823
28895
|
if (state === "complete") return wide ? `\u2713 ${title}` : "\u2713";
|
|
28824
28896
|
if (state === "active") return wide ? `[${step} ${title}]` : `[${step}]`;
|
|
@@ -28831,12 +28903,12 @@ function stepColor(state) {
|
|
|
28831
28903
|
}
|
|
28832
28904
|
function SetupStepper({ activeStep, columns }) {
|
|
28833
28905
|
const wide = columns !== void 0 && columns >= WIDE_MIN_COLUMNS;
|
|
28834
|
-
return /* @__PURE__ */
|
|
28906
|
+
return /* @__PURE__ */ jsx53(Box45, { columnGap: wide ? 0 : COMPACT_GAP, children: SETUP_SCREENS.map((title, index) => {
|
|
28835
28907
|
const step = index + 1;
|
|
28836
28908
|
const state = step < activeStep ? "complete" : step === activeStep ? "active" : "pending";
|
|
28837
28909
|
return /* @__PURE__ */ jsxs46(React18.Fragment, { children: [
|
|
28838
|
-
wide && index > 0 && /* @__PURE__ */
|
|
28839
|
-
/* @__PURE__ */
|
|
28910
|
+
wide && index > 0 && /* @__PURE__ */ jsx53(Text49, { dimColor: true, children: WIDE_SEPARATOR }),
|
|
28911
|
+
/* @__PURE__ */ jsx53(Text49, { bold: state === "active", dimColor: state === "pending", color: stepColor(state), children: stepLabel(step, title, state, wide) })
|
|
28840
28912
|
] }, step);
|
|
28841
28913
|
}) });
|
|
28842
28914
|
}
|
|
@@ -28855,33 +28927,33 @@ var init_SetupStepper = __esm({
|
|
|
28855
28927
|
});
|
|
28856
28928
|
|
|
28857
28929
|
// packages/experience-design-system-cli/src/setup/steps/StepLayout.tsx
|
|
28858
|
-
import { Box as
|
|
28859
|
-
import { jsx as
|
|
28930
|
+
import { Box as Box46, Text as Text50 } from "ink";
|
|
28931
|
+
import { jsx as jsx54, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
28860
28932
|
function StepLayout({ helpText, children, prompt }) {
|
|
28861
|
-
return /* @__PURE__ */ jsxs47(
|
|
28933
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", children: [
|
|
28862
28934
|
children,
|
|
28863
|
-
prompt && /* @__PURE__ */
|
|
28864
|
-
helpText && /* @__PURE__ */
|
|
28935
|
+
prompt && /* @__PURE__ */ jsx54(Box46, { marginTop: 1, children: prompt }),
|
|
28936
|
+
helpText && /* @__PURE__ */ jsx54(Box46, { marginTop: 1, children: /* @__PURE__ */ jsx54(Text50, { dimColor: true, children: helpText }) })
|
|
28865
28937
|
] });
|
|
28866
28938
|
}
|
|
28867
28939
|
function StepSuccess({ children }) {
|
|
28868
|
-
return /* @__PURE__ */ jsxs47(
|
|
28940
|
+
return /* @__PURE__ */ jsxs47(Text50, { color: PALETTE.success, children: [
|
|
28869
28941
|
"\u2713 ",
|
|
28870
28942
|
children
|
|
28871
28943
|
] });
|
|
28872
28944
|
}
|
|
28873
28945
|
function StepWarning({ children }) {
|
|
28874
|
-
return /* @__PURE__ */ jsxs47(
|
|
28946
|
+
return /* @__PURE__ */ jsxs47(Text50, { color: PALETTE.warning, children: [
|
|
28875
28947
|
"\u26A0 ",
|
|
28876
28948
|
children
|
|
28877
28949
|
] });
|
|
28878
28950
|
}
|
|
28879
28951
|
function StepValue({ label, value }) {
|
|
28880
28952
|
const color = value ? void 0 : PALETTE.warning;
|
|
28881
|
-
return /* @__PURE__ */ jsxs47(
|
|
28882
|
-
/* @__PURE__ */
|
|
28883
|
-
/* @__PURE__ */
|
|
28884
|
-
/* @__PURE__ */
|
|
28953
|
+
return /* @__PURE__ */ jsxs47(Box46, { children: [
|
|
28954
|
+
/* @__PURE__ */ jsx54(Box46, { width: 2, children: /* @__PURE__ */ jsx54(Text50, { color, children: value ? "" : "\u26A0" }) }),
|
|
28955
|
+
/* @__PURE__ */ jsx54(Box46, { width: 20, flexShrink: 0, children: /* @__PURE__ */ jsx54(Text50, { color, children: label }) }),
|
|
28956
|
+
/* @__PURE__ */ jsx54(Text50, { color, children: value || "(not set)" })
|
|
28885
28957
|
] });
|
|
28886
28958
|
}
|
|
28887
28959
|
var init_StepLayout = __esm({
|
|
@@ -28893,9 +28965,9 @@ var init_StepLayout = __esm({
|
|
|
28893
28965
|
|
|
28894
28966
|
// packages/experience-design-system-cli/src/setup/steps/CodingAgentScreen.tsx
|
|
28895
28967
|
import { useEffect as useEffect12, useRef as useRef10, useState as useState24 } from "react";
|
|
28896
|
-
import { Box as
|
|
28968
|
+
import { Box as Box47, Text as Text51 } from "ink";
|
|
28897
28969
|
import { Select, TextInput } from "@inkjs/ui";
|
|
28898
|
-
import { jsx as
|
|
28970
|
+
import { jsx as jsx55, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
28899
28971
|
async function detectAgents(exists = binaryExists) {
|
|
28900
28972
|
const found = await Promise.all(AGENT_DEFS.map(async (agent) => await exists(agent.binary) ? agent : void 0));
|
|
28901
28973
|
return found.filter((agent) => agent !== void 0);
|
|
@@ -28928,7 +29000,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
28928
29000
|
const found = await detectAgents(exists);
|
|
28929
29001
|
if (found.length === 1) {
|
|
28930
29002
|
const only = found[0];
|
|
28931
|
-
setNotes([/* @__PURE__ */
|
|
29003
|
+
setNotes([/* @__PURE__ */ jsx55(StepSuccess, { children: `${only.name} (${only.binary}) found` }, "found")]);
|
|
28932
29004
|
afterSelection(only);
|
|
28933
29005
|
return;
|
|
28934
29006
|
}
|
|
@@ -28936,7 +29008,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
28936
29008
|
setPhase({ kind: "choose", found });
|
|
28937
29009
|
return;
|
|
28938
29010
|
}
|
|
28939
|
-
setNotes([/* @__PURE__ */
|
|
29011
|
+
setNotes([/* @__PURE__ */ jsx55(StepWarning, { children: "No coding agent found on PATH" }, "none")]);
|
|
28940
29012
|
setPhase({ kind: "install-choice" });
|
|
28941
29013
|
})();
|
|
28942
29014
|
}, []);
|
|
@@ -28948,12 +29020,12 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
28948
29020
|
onDone("failed");
|
|
28949
29021
|
return;
|
|
28950
29022
|
}
|
|
28951
|
-
setNotes((current) => [...current, /* @__PURE__ */
|
|
29023
|
+
setNotes((current) => [...current, /* @__PURE__ */ jsx55(StepSuccess, { children: `${agent.name} installed` }, "installed")]);
|
|
28952
29024
|
afterSelection(agent);
|
|
28953
29025
|
};
|
|
28954
|
-
const chooser = (question, options, describe, onPick) => /* @__PURE__ */ jsxs48(
|
|
28955
|
-
/* @__PURE__ */
|
|
28956
|
-
/* @__PURE__ */
|
|
29026
|
+
const chooser = (question, options, describe, onPick) => /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", children: [
|
|
29027
|
+
/* @__PURE__ */ jsx55(Text51, { children: question }),
|
|
29028
|
+
/* @__PURE__ */ jsx55(Box47, { marginTop: 1, children: /* @__PURE__ */ jsx55(
|
|
28957
29029
|
Select,
|
|
28958
29030
|
{
|
|
28959
29031
|
options: [
|
|
@@ -28965,7 +29037,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
28965
29037
|
) })
|
|
28966
29038
|
] });
|
|
28967
29039
|
if (phase.kind === "choose") {
|
|
28968
|
-
return /* @__PURE__ */
|
|
29040
|
+
return /* @__PURE__ */ jsx55(
|
|
28969
29041
|
StepLayout,
|
|
28970
29042
|
{
|
|
28971
29043
|
helpText: AGENT_HELP,
|
|
@@ -28980,7 +29052,7 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
28980
29052
|
);
|
|
28981
29053
|
}
|
|
28982
29054
|
if (phase.kind === "install-choice") {
|
|
28983
|
-
return /* @__PURE__ */
|
|
29055
|
+
return /* @__PURE__ */ jsx55(
|
|
28984
29056
|
StepLayout,
|
|
28985
29057
|
{
|
|
28986
29058
|
helpText: AGENT_HELP,
|
|
@@ -28995,13 +29067,13 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
28995
29067
|
);
|
|
28996
29068
|
}
|
|
28997
29069
|
if (phase.kind === "model") {
|
|
28998
|
-
return /* @__PURE__ */
|
|
29070
|
+
return /* @__PURE__ */ jsx55(
|
|
28999
29071
|
StepLayout,
|
|
29000
29072
|
{
|
|
29001
29073
|
helpText: AGENT_HELP,
|
|
29002
|
-
prompt: /* @__PURE__ */ jsxs48(
|
|
29003
|
-
/* @__PURE__ */
|
|
29004
|
-
/* @__PURE__ */
|
|
29074
|
+
prompt: /* @__PURE__ */ jsxs48(Box47, { children: [
|
|
29075
|
+
/* @__PURE__ */ jsx55(Text51, { children: "Model name (optional - press Enter for Codex default): " }),
|
|
29076
|
+
/* @__PURE__ */ jsx55(
|
|
29005
29077
|
TextInput,
|
|
29006
29078
|
{
|
|
29007
29079
|
onSubmit: (value) => void save(phase.agent.binary, value.trim() || void 0)
|
|
@@ -29011,19 +29083,19 @@ function CodingAgentScreen({ onDone, deps }) {
|
|
|
29011
29083
|
] }),
|
|
29012
29084
|
children: [
|
|
29013
29085
|
...notes,
|
|
29014
|
-
/* @__PURE__ */
|
|
29015
|
-
/* @__PURE__ */
|
|
29086
|
+
/* @__PURE__ */ jsx55(StepWarning, { children: "No OPENAI_API_KEY \u2014 using ChatGPT account authentication." }, "no-key"),
|
|
29087
|
+
/* @__PURE__ */ jsx55(Text51, { dimColor: true, children: "Tip: run codex then type /model to browse all available models." }, "tip")
|
|
29016
29088
|
]
|
|
29017
29089
|
}
|
|
29018
29090
|
);
|
|
29019
29091
|
}
|
|
29020
29092
|
if (phase.kind === "installing") {
|
|
29021
|
-
return /* @__PURE__ */
|
|
29093
|
+
return /* @__PURE__ */ jsx55(StepLayout, { helpText: AGENT_HELP, children: [...notes, /* @__PURE__ */ jsx55(Text51, { children: `Installing ${phase.agent.name}\u2026` }, "installing")] });
|
|
29022
29094
|
}
|
|
29023
29095
|
if (phase.kind === "failed") {
|
|
29024
|
-
return /* @__PURE__ */
|
|
29096
|
+
return /* @__PURE__ */ jsx55(StepLayout, { helpText: AGENT_HELP, children: [...notes, /* @__PURE__ */ jsx55(Text51, { children: `\u2717 ${phase.message}` }, "failed")] });
|
|
29025
29097
|
}
|
|
29026
|
-
return /* @__PURE__ */
|
|
29098
|
+
return /* @__PURE__ */ jsx55(Text51, { dimColor: true, children: "Looking for a coding agent\u2026" });
|
|
29027
29099
|
}
|
|
29028
29100
|
var AGENT_HELP, SKIP_VALUE;
|
|
29029
29101
|
var init_CodingAgentScreen = __esm({
|
|
@@ -29040,9 +29112,9 @@ var init_CodingAgentScreen = __esm({
|
|
|
29040
29112
|
|
|
29041
29113
|
// packages/experience-design-system-cli/src/setup/steps/ContentfulCredentialsScreen.tsx
|
|
29042
29114
|
import { useEffect as useEffect13, useRef as useRef11, useState as useState25 } from "react";
|
|
29043
|
-
import { Box as
|
|
29115
|
+
import { Box as Box48, Text as Text52 } from "ink";
|
|
29044
29116
|
import { PasswordInput, Select as Select2, TextInput as TextInput2 } from "@inkjs/ui";
|
|
29045
|
-
import { Fragment as Fragment18, jsx as
|
|
29117
|
+
import { Fragment as Fragment18, jsx as jsx56, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
29046
29118
|
function envShadowingWarning(env) {
|
|
29047
29119
|
const set = ENV_KEYS.filter((key) => env[key]);
|
|
29048
29120
|
if (set.length === 0) return null;
|
|
@@ -29059,21 +29131,21 @@ function ContentfulCredentialsScreen({ onDone }) {
|
|
|
29059
29131
|
useEffect13(() => {
|
|
29060
29132
|
void readExperiencesCredentials().then(setStored);
|
|
29061
29133
|
}, []);
|
|
29062
|
-
if (!stored) return /* @__PURE__ */
|
|
29134
|
+
if (!stored) return /* @__PURE__ */ jsx56(Text52, { dimColor: true, children: "Reading saved credentials\u2026" });
|
|
29063
29135
|
const currentHost = stored.host ?? DEFAULT_CONFIGURED_HOST;
|
|
29064
29136
|
const hasAny = Boolean(stored.spaceId || stored.environmentId || stored.cmaToken);
|
|
29065
29137
|
const allSet = Boolean(stored.spaceId && stored.environmentId && stored.cmaToken);
|
|
29066
29138
|
const shadowing = envShadowingWarning(process.env);
|
|
29067
29139
|
const summary = /* @__PURE__ */ jsxs49(Fragment18, { children: [
|
|
29068
|
-
shadowing && /* @__PURE__ */
|
|
29069
|
-
hasAny && /* @__PURE__ */ jsxs49(
|
|
29070
|
-
/* @__PURE__ */
|
|
29071
|
-
/* @__PURE__ */
|
|
29072
|
-
/* @__PURE__ */
|
|
29073
|
-
/* @__PURE__ */
|
|
29074
|
-
/* @__PURE__ */
|
|
29140
|
+
shadowing && /* @__PURE__ */ jsx56(StepWarning, { children: shadowing }),
|
|
29141
|
+
hasAny && /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", marginTop: shadowing ? 1 : 0, children: [
|
|
29142
|
+
/* @__PURE__ */ jsx56(Text52, { children: "Current values:" }),
|
|
29143
|
+
/* @__PURE__ */ jsx56(StepValue, { label: "Space ID", value: stored.spaceId }),
|
|
29144
|
+
/* @__PURE__ */ jsx56(StepValue, { label: "Environment ID", value: stored.environmentId }),
|
|
29145
|
+
/* @__PURE__ */ jsx56(StepValue, { label: "CMA Token", value: stored.cmaToken ? maskToken(stored.cmaToken) : void 0 }),
|
|
29146
|
+
/* @__PURE__ */ jsx56(StepValue, { label: "API Host", value: currentHost })
|
|
29075
29147
|
] }),
|
|
29076
|
-
error && /* @__PURE__ */
|
|
29148
|
+
error && /* @__PURE__ */ jsx56(StepWarning, { children: error })
|
|
29077
29149
|
] });
|
|
29078
29150
|
const helpText = `Saved to ${experiencesCredentialsPath()} \u2014 loaded automatically by experiences import.`;
|
|
29079
29151
|
if (field === "confirm") {
|
|
@@ -29081,13 +29153,13 @@ function ContentfulCredentialsScreen({ onDone }) {
|
|
|
29081
29153
|
{ label: hasAny ? "Update the saved credentials" : "Enter credentials now", value: ENTER },
|
|
29082
29154
|
{ label: allSet ? "Keep them as they are" : "Skip for now", value: KEEP }
|
|
29083
29155
|
];
|
|
29084
|
-
return /* @__PURE__ */
|
|
29156
|
+
return /* @__PURE__ */ jsx56(
|
|
29085
29157
|
StepLayout,
|
|
29086
29158
|
{
|
|
29087
29159
|
helpText,
|
|
29088
|
-
prompt: /* @__PURE__ */ jsxs49(
|
|
29089
|
-
/* @__PURE__ */
|
|
29090
|
-
/* @__PURE__ */
|
|
29160
|
+
prompt: /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", children: [
|
|
29161
|
+
/* @__PURE__ */ jsx56(Text52, { children: "Contentful credentials" }),
|
|
29162
|
+
/* @__PURE__ */ jsx56(Box48, { marginTop: 1, children: /* @__PURE__ */ jsx56(
|
|
29091
29163
|
Select2,
|
|
29092
29164
|
{
|
|
29093
29165
|
options: allSet ? [...options].reverse() : options,
|
|
@@ -29128,24 +29200,24 @@ function ContentfulCredentialsScreen({ onDone }) {
|
|
|
29128
29200
|
onDone("completed");
|
|
29129
29201
|
};
|
|
29130
29202
|
const prompts = {
|
|
29131
|
-
spaceId: /* @__PURE__ */ jsxs49(
|
|
29132
|
-
/* @__PURE__ */
|
|
29133
|
-
/* @__PURE__ */
|
|
29203
|
+
spaceId: /* @__PURE__ */ jsxs49(Box48, { children: [
|
|
29204
|
+
/* @__PURE__ */ jsx56(Text52, { children: `Space ID${stored.spaceId ? ` [${stored.spaceId}]` : ""}: ` }),
|
|
29205
|
+
/* @__PURE__ */ jsx56(TextInput2, { onSubmit: (v) => advance("spaceId", v) }, "spaceId")
|
|
29134
29206
|
] }),
|
|
29135
|
-
environmentId: /* @__PURE__ */ jsxs49(
|
|
29136
|
-
/* @__PURE__ */
|
|
29137
|
-
/* @__PURE__ */
|
|
29207
|
+
environmentId: /* @__PURE__ */ jsxs49(Box48, { children: [
|
|
29208
|
+
/* @__PURE__ */ jsx56(Text52, { children: `Environment ID [${stored.environmentId || "master"}]: ` }),
|
|
29209
|
+
/* @__PURE__ */ jsx56(TextInput2, { onSubmit: (v) => advance("environmentId", v) }, "environmentId")
|
|
29138
29210
|
] }),
|
|
29139
|
-
cmaToken: /* @__PURE__ */ jsxs49(
|
|
29140
|
-
/* @__PURE__ */
|
|
29141
|
-
/* @__PURE__ */
|
|
29211
|
+
cmaToken: /* @__PURE__ */ jsxs49(Box48, { children: [
|
|
29212
|
+
/* @__PURE__ */ jsx56(Text52, { children: `CMA token${stored.cmaToken ? " [press Enter to keep existing]" : " (paste here)"}: ` }),
|
|
29213
|
+
/* @__PURE__ */ jsx56(PasswordInput, { onSubmit: (v) => advance("cmaToken", v) }, "cmaToken")
|
|
29142
29214
|
] }),
|
|
29143
|
-
host: /* @__PURE__ */ jsxs49(
|
|
29144
|
-
/* @__PURE__ */
|
|
29145
|
-
/* @__PURE__ */
|
|
29215
|
+
host: /* @__PURE__ */ jsxs49(Box48, { children: [
|
|
29216
|
+
/* @__PURE__ */ jsx56(Text52, { children: `API host [${currentHost}]: ` }),
|
|
29217
|
+
/* @__PURE__ */ jsx56(TextInput2, { onSubmit: (v) => advance("host", v) }, "host")
|
|
29146
29218
|
] })
|
|
29147
29219
|
};
|
|
29148
|
-
return /* @__PURE__ */
|
|
29220
|
+
return /* @__PURE__ */ jsx56(StepLayout, { helpText, prompt: prompts[field], children: summary });
|
|
29149
29221
|
}
|
|
29150
29222
|
var ENV_KEYS, ENTER, KEEP, FIELD_ORDER;
|
|
29151
29223
|
var init_ContentfulCredentialsScreen = __esm({
|
|
@@ -29163,9 +29235,9 @@ var init_ContentfulCredentialsScreen = __esm({
|
|
|
29163
29235
|
|
|
29164
29236
|
// packages/experience-design-system-cli/src/setup/steps/preferences/BooleanInput.tsx
|
|
29165
29237
|
import { useEffect as useEffect14, useState as useState26 } from "react";
|
|
29166
|
-
import { Box as
|
|
29238
|
+
import { Box as Box49, Text as Text53 } from "ink";
|
|
29167
29239
|
import { Select as Select3 } from "@inkjs/ui";
|
|
29168
|
-
import { jsx as
|
|
29240
|
+
import { jsx as jsx57, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
29169
29241
|
function tick(labels, forOn, current) {
|
|
29170
29242
|
const label = forOn ? labels.on : labels.off;
|
|
29171
29243
|
return forOn === current ? `${label} \u2713` : label;
|
|
@@ -29183,7 +29255,7 @@ function BooleanInput({
|
|
|
29183
29255
|
useEffect14(() => {
|
|
29184
29256
|
void readExperiencesCredentials().then(setStored);
|
|
29185
29257
|
}, []);
|
|
29186
|
-
if (!stored) return /* @__PURE__ */
|
|
29258
|
+
if (!stored) return /* @__PURE__ */ jsx57(Text53, { dimColor: true, children: "Reading saved preferences\u2026" });
|
|
29187
29259
|
const current = read(stored) ?? fallback;
|
|
29188
29260
|
const submit = (value) => {
|
|
29189
29261
|
if (value === current) {
|
|
@@ -29192,13 +29264,13 @@ function BooleanInput({
|
|
|
29192
29264
|
}
|
|
29193
29265
|
void writeExperiencesCredentials(write2(stored, value)).then(() => onDone("completed"));
|
|
29194
29266
|
};
|
|
29195
|
-
return /* @__PURE__ */
|
|
29267
|
+
return /* @__PURE__ */ jsx57(
|
|
29196
29268
|
StepLayout,
|
|
29197
29269
|
{
|
|
29198
29270
|
helpText,
|
|
29199
|
-
prompt: /* @__PURE__ */ jsxs50(
|
|
29200
|
-
/* @__PURE__ */
|
|
29201
|
-
/* @__PURE__ */
|
|
29271
|
+
prompt: /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", children: [
|
|
29272
|
+
/* @__PURE__ */ jsx57(Text53, { children: question }),
|
|
29273
|
+
/* @__PURE__ */ jsx57(Box49, { marginTop: 1, children: /* @__PURE__ */ jsx57(
|
|
29202
29274
|
Select3,
|
|
29203
29275
|
{
|
|
29204
29276
|
options: [
|
|
@@ -29223,9 +29295,9 @@ var init_BooleanInput = __esm({
|
|
|
29223
29295
|
});
|
|
29224
29296
|
|
|
29225
29297
|
// packages/experience-design-system-cli/src/setup/steps/preferences/AnalyticsScreen.tsx
|
|
29226
|
-
import { jsx as
|
|
29298
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
29227
29299
|
function AnalyticsScreen({ onDone }) {
|
|
29228
|
-
return /* @__PURE__ */
|
|
29300
|
+
return /* @__PURE__ */ jsx58(
|
|
29229
29301
|
BooleanInput,
|
|
29230
29302
|
{
|
|
29231
29303
|
helpText: "Shares anonymous usage data about which CLI commands are used and where imports succeed or fail. Never includes source code, file paths, credentials, or authored content",
|
|
@@ -29246,9 +29318,9 @@ var init_AnalyticsScreen = __esm({
|
|
|
29246
29318
|
});
|
|
29247
29319
|
|
|
29248
29320
|
// packages/experience-design-system-cli/src/setup/steps/preferences/ColorPreferenceScreen.tsx
|
|
29249
|
-
import { jsx as
|
|
29321
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
29250
29322
|
function ColorPreferenceScreen({ onDone }) {
|
|
29251
|
-
return /* @__PURE__ */
|
|
29323
|
+
return /* @__PURE__ */ jsx59(
|
|
29252
29324
|
BooleanInput,
|
|
29253
29325
|
{
|
|
29254
29326
|
helpText: `Prints plain text with no color, which suits CI logs and basic terminals.`,
|
|
@@ -29270,9 +29342,9 @@ var init_ColorPreferenceScreen = __esm({
|
|
|
29270
29342
|
|
|
29271
29343
|
// packages/experience-design-system-cli/src/setup/steps/preferences/CustomPromptScreen.tsx
|
|
29272
29344
|
import { useEffect as useEffect15, useState as useState27 } from "react";
|
|
29273
|
-
import { Box as
|
|
29345
|
+
import { Box as Box50, Text as Text54 } from "ink";
|
|
29274
29346
|
import { ConfirmInput, TextInput as TextInput3 } from "@inkjs/ui";
|
|
29275
|
-
import { jsx as
|
|
29347
|
+
import { jsx as jsx60, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
29276
29348
|
function parseCustomSkillPath(answer) {
|
|
29277
29349
|
const trimmed = answer.trim();
|
|
29278
29350
|
if (trimmed === "") return void 0;
|
|
@@ -29294,19 +29366,19 @@ function CustomPromptsScreen({ onDone }) {
|
|
|
29294
29366
|
useEffect15(() => {
|
|
29295
29367
|
void readExperiencesCredentials().then(setStored);
|
|
29296
29368
|
}, []);
|
|
29297
|
-
if (!stored) return /* @__PURE__ */
|
|
29369
|
+
if (!stored) return /* @__PURE__ */ jsx60(Text54, { dimColor: true, children: "Reading saved prompt paths\u2026" });
|
|
29298
29370
|
const submit = (answer) => {
|
|
29299
29371
|
const next = applyCustomSkillPath(stored, parseCustomSkillPath(answer));
|
|
29300
29372
|
void writeExperiencesCredentials(next).then(() => onDone("completed"));
|
|
29301
29373
|
};
|
|
29302
29374
|
if (phase === "confirm") {
|
|
29303
|
-
return /* @__PURE__ */
|
|
29375
|
+
return /* @__PURE__ */ jsx60(
|
|
29304
29376
|
StepLayout,
|
|
29305
29377
|
{
|
|
29306
29378
|
helpText: CUSTOM_PROMPTS_HELP,
|
|
29307
|
-
prompt: /* @__PURE__ */ jsxs51(
|
|
29308
|
-
/* @__PURE__ */
|
|
29309
|
-
/* @__PURE__ */
|
|
29379
|
+
prompt: /* @__PURE__ */ jsxs51(Box50, { children: [
|
|
29380
|
+
/* @__PURE__ */ jsx60(Text54, { children: "Use your own prompt file instead of the built-in one? " }),
|
|
29381
|
+
/* @__PURE__ */ jsx60(
|
|
29310
29382
|
ConfirmInput,
|
|
29311
29383
|
{
|
|
29312
29384
|
defaultChoice: "cancel",
|
|
@@ -29318,13 +29390,13 @@ function CustomPromptsScreen({ onDone }) {
|
|
|
29318
29390
|
}
|
|
29319
29391
|
);
|
|
29320
29392
|
}
|
|
29321
|
-
return /* @__PURE__ */
|
|
29393
|
+
return /* @__PURE__ */ jsx60(
|
|
29322
29394
|
StepLayout,
|
|
29323
29395
|
{
|
|
29324
29396
|
helpText: CUSTOM_PROMPTS_HELP,
|
|
29325
|
-
prompt: /* @__PURE__ */ jsxs51(
|
|
29326
|
-
/* @__PURE__ */
|
|
29327
|
-
/* @__PURE__ */
|
|
29397
|
+
prompt: /* @__PURE__ */ jsxs51(Box50, { children: [
|
|
29398
|
+
/* @__PURE__ */ jsx60(Text54, { children: customSkillPathQuestion(stored.generatePromptPath) }),
|
|
29399
|
+
/* @__PURE__ */ jsx60(TextInput3, { onSubmit: submit })
|
|
29328
29400
|
] })
|
|
29329
29401
|
}
|
|
29330
29402
|
);
|
|
@@ -29340,9 +29412,9 @@ var init_CustomPromptScreen = __esm({
|
|
|
29340
29412
|
});
|
|
29341
29413
|
|
|
29342
29414
|
// packages/experience-design-system-cli/src/setup/steps/preferences/DebugLogsScreen.tsx
|
|
29343
|
-
import { jsx as
|
|
29415
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
29344
29416
|
function DebugLogsScreen({ onDone }) {
|
|
29345
|
-
return /* @__PURE__ */
|
|
29417
|
+
return /* @__PURE__ */ jsx61(
|
|
29346
29418
|
BooleanInput,
|
|
29347
29419
|
{
|
|
29348
29420
|
helpText: `Writes a verbose trace of every command decision, for troubleshooting.`,
|
|
@@ -29364,16 +29436,16 @@ var init_DebugLogsScreen = __esm({
|
|
|
29364
29436
|
|
|
29365
29437
|
// packages/experience-design-system-cli/src/setup/steps/preferences/PreferencesMenu.tsx
|
|
29366
29438
|
import { useState as useState28 } from "react";
|
|
29367
|
-
import { Box as
|
|
29439
|
+
import { Box as Box51, Text as Text55 } from "ink";
|
|
29368
29440
|
import { Select as Select4 } from "@inkjs/ui";
|
|
29369
|
-
import { jsx as
|
|
29441
|
+
import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
29370
29442
|
function PreferencesMenu({ onDone }) {
|
|
29371
29443
|
const [open, setOpen] = useState28(null);
|
|
29372
29444
|
const [changed, setChanged] = useState28(/* @__PURE__ */ new Set());
|
|
29373
29445
|
const entry = open === null ? void 0 : PREFERENCE_OPTIONS.find((option) => option.key === open);
|
|
29374
|
-
if (!entry) return /* @__PURE__ */
|
|
29446
|
+
if (!entry) return /* @__PURE__ */ jsx62(PreferenceList, { changed, onOpen: setOpen, onDone });
|
|
29375
29447
|
const { key, Screen } = entry;
|
|
29376
|
-
return /* @__PURE__ */
|
|
29448
|
+
return /* @__PURE__ */ jsx62(
|
|
29377
29449
|
Screen,
|
|
29378
29450
|
{
|
|
29379
29451
|
onDone: (status) => {
|
|
@@ -29390,13 +29462,13 @@ function PreferenceList({ changed, onOpen, onDone }) {
|
|
|
29390
29462
|
...PREFERENCE_OPTIONS.map((option) => ({ label: option.label, value: option.key })),
|
|
29391
29463
|
{ label: "Done", value: DONE_VALUE }
|
|
29392
29464
|
];
|
|
29393
|
-
return /* @__PURE__ */
|
|
29465
|
+
return /* @__PURE__ */ jsx62(
|
|
29394
29466
|
StepLayout,
|
|
29395
29467
|
{
|
|
29396
29468
|
helpText: PREFERENCES_MENU_HELP,
|
|
29397
|
-
prompt: /* @__PURE__ */ jsxs52(
|
|
29398
|
-
/* @__PURE__ */
|
|
29399
|
-
/* @__PURE__ */
|
|
29469
|
+
prompt: /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", children: [
|
|
29470
|
+
/* @__PURE__ */ jsx62(Text55, { children: "Preferences" }),
|
|
29471
|
+
/* @__PURE__ */ jsx62(Box51, { marginTop: 1, children: /* @__PURE__ */ jsx62(
|
|
29400
29472
|
Select4,
|
|
29401
29473
|
{
|
|
29402
29474
|
options,
|
|
@@ -29429,22 +29501,22 @@ var init_PreferencesMenu = __esm({
|
|
|
29429
29501
|
{
|
|
29430
29502
|
key: "customPrompts",
|
|
29431
29503
|
label: "Custom prompts",
|
|
29432
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
29504
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx62(CustomPromptsScreen, { onDone })
|
|
29433
29505
|
},
|
|
29434
29506
|
{
|
|
29435
29507
|
key: "debug",
|
|
29436
29508
|
label: "Debug logging",
|
|
29437
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
29509
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx62(DebugLogsScreen, { onDone })
|
|
29438
29510
|
},
|
|
29439
29511
|
{
|
|
29440
29512
|
key: "analytics",
|
|
29441
29513
|
label: "Usage analytics",
|
|
29442
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
29514
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx62(AnalyticsScreen, { onDone })
|
|
29443
29515
|
},
|
|
29444
29516
|
{
|
|
29445
29517
|
key: "noColor",
|
|
29446
29518
|
label: "Terminal colors",
|
|
29447
|
-
Screen: ({ onDone }) => /* @__PURE__ */
|
|
29519
|
+
Screen: ({ onDone }) => /* @__PURE__ */ jsx62(ColorPreferenceScreen, { onDone })
|
|
29448
29520
|
}
|
|
29449
29521
|
];
|
|
29450
29522
|
DONE_VALUE = "menu:done";
|
|
@@ -29660,23 +29732,23 @@ var init_prerequisites = __esm({
|
|
|
29660
29732
|
|
|
29661
29733
|
// packages/experience-design-system-cli/src/setup/steps/prerequisites/PrerequisitesScreen.tsx
|
|
29662
29734
|
import { useEffect as useEffect16, useRef as useRef12, useState as useState29 } from "react";
|
|
29663
|
-
import { Box as
|
|
29735
|
+
import { Box as Box52, Text as Text56 } from "ink";
|
|
29664
29736
|
import { ConfirmInput as ConfirmInput2 } from "@inkjs/ui";
|
|
29665
|
-
import { jsx as
|
|
29737
|
+
import { jsx as jsx63, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
29666
29738
|
function EventLine({ event }) {
|
|
29667
|
-
if (event.kind === "success") return /* @__PURE__ */ jsxs53(
|
|
29739
|
+
if (event.kind === "success") return /* @__PURE__ */ jsxs53(Text56, { color: PALETTE.success, children: [
|
|
29668
29740
|
"\u2713 ",
|
|
29669
29741
|
event.message
|
|
29670
29742
|
] });
|
|
29671
|
-
if (event.kind === "failure") return /* @__PURE__ */ jsxs53(
|
|
29743
|
+
if (event.kind === "failure") return /* @__PURE__ */ jsxs53(Text56, { color: PALETTE.error, children: [
|
|
29672
29744
|
"\u2717 ",
|
|
29673
29745
|
event.message
|
|
29674
29746
|
] });
|
|
29675
|
-
if (event.kind === "warning") return /* @__PURE__ */ jsxs53(
|
|
29747
|
+
if (event.kind === "warning") return /* @__PURE__ */ jsxs53(Text56, { color: PALETTE.warning, children: [
|
|
29676
29748
|
"\u26A0 ",
|
|
29677
29749
|
event.message
|
|
29678
29750
|
] });
|
|
29679
|
-
return /* @__PURE__ */
|
|
29751
|
+
return /* @__PURE__ */ jsx63(Text56, { children: event.message });
|
|
29680
29752
|
}
|
|
29681
29753
|
function PrerequisitesScreen({
|
|
29682
29754
|
repoRoot,
|
|
@@ -29715,15 +29787,15 @@ function PrerequisitesScreen({
|
|
|
29715
29787
|
...skipBuild !== void 0 ? { skipBuild } : {}
|
|
29716
29788
|
}).then(onDone);
|
|
29717
29789
|
}, []);
|
|
29718
|
-
return /* @__PURE__ */
|
|
29790
|
+
return /* @__PURE__ */ jsx63(
|
|
29719
29791
|
StepLayout,
|
|
29720
29792
|
{
|
|
29721
|
-
prompt: confirm ? /* @__PURE__ */ jsxs53(
|
|
29722
|
-
/* @__PURE__ */ jsxs53(
|
|
29793
|
+
prompt: confirm ? /* @__PURE__ */ jsxs53(Box52, { children: [
|
|
29794
|
+
/* @__PURE__ */ jsxs53(Text56, { children: [
|
|
29723
29795
|
confirm.question,
|
|
29724
29796
|
" "
|
|
29725
29797
|
] }),
|
|
29726
|
-
/* @__PURE__ */
|
|
29798
|
+
/* @__PURE__ */ jsx63(
|
|
29727
29799
|
ConfirmInput2,
|
|
29728
29800
|
{
|
|
29729
29801
|
defaultChoice: confirm.defaultYes ? "confirm" : "cancel",
|
|
@@ -29732,8 +29804,8 @@ function PrerequisitesScreen({
|
|
|
29732
29804
|
},
|
|
29733
29805
|
confirm.question
|
|
29734
29806
|
)
|
|
29735
|
-
] }) : /* @__PURE__ */
|
|
29736
|
-
children: /* @__PURE__ */
|
|
29807
|
+
] }) : /* @__PURE__ */ jsx63(Text56, { color: PALETTE.info, children: "\u27F3 Checking prerequisites\u2026" }),
|
|
29808
|
+
children: /* @__PURE__ */ jsx63(Box52, { flexDirection: "column", children: events.map((event, index) => /* @__PURE__ */ jsx63(EventLine, { event }, `${index}-${event.message}`)) })
|
|
29737
29809
|
}
|
|
29738
29810
|
);
|
|
29739
29811
|
}
|
|
@@ -29754,8 +29826,8 @@ __export(SetupScreen_exports, {
|
|
|
29754
29826
|
formatSetupCompletionMessage: () => formatSetupCompletionMessage
|
|
29755
29827
|
});
|
|
29756
29828
|
import { useEffect as useEffect17, useRef as useRef13, useState as useState30 } from "react";
|
|
29757
|
-
import { Box as
|
|
29758
|
-
import { jsx as
|
|
29829
|
+
import { Box as Box53, Text as Text57, useStdout as useStdout5 } from "ink";
|
|
29830
|
+
import { jsx as jsx64, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
29759
29831
|
function countRequiredFailures(results) {
|
|
29760
29832
|
return results.filter((result) => result.required && result.status === "failed").length;
|
|
29761
29833
|
}
|
|
@@ -29786,7 +29858,7 @@ function SetupScreen({
|
|
|
29786
29858
|
});
|
|
29787
29859
|
void (async () => {
|
|
29788
29860
|
const results = [];
|
|
29789
|
-
const prerequisites = await runScreen((done) => /* @__PURE__ */
|
|
29861
|
+
const prerequisites = await runScreen((done) => /* @__PURE__ */ jsx64(
|
|
29790
29862
|
PrerequisitesScreen,
|
|
29791
29863
|
{
|
|
29792
29864
|
repoRoot,
|
|
@@ -29820,21 +29892,21 @@ function SetupScreen({
|
|
|
29820
29892
|
if (skip.skipAgent) {
|
|
29821
29893
|
results.push({ name: "Coding agent", status: "skipped", required: false });
|
|
29822
29894
|
} else {
|
|
29823
|
-
const status = await runScreen((done) => /* @__PURE__ */
|
|
29895
|
+
const status = await runScreen((done) => /* @__PURE__ */ jsx64(CodingAgentScreen, { onDone: done }));
|
|
29824
29896
|
results.push({ name: "Coding agent", status, required: true });
|
|
29825
29897
|
}
|
|
29826
29898
|
setActiveStep(3);
|
|
29827
29899
|
if (skip.skipCredentials) {
|
|
29828
29900
|
results.push({ name: "Contentful credentials", status: "skipped", required: false });
|
|
29829
29901
|
} else {
|
|
29830
|
-
const status = await runScreen((done) => /* @__PURE__ */
|
|
29902
|
+
const status = await runScreen((done) => /* @__PURE__ */ jsx64(ContentfulCredentialsScreen, { onDone: done }));
|
|
29831
29903
|
results.push({ name: "Contentful credentials", status, required: false });
|
|
29832
29904
|
}
|
|
29833
29905
|
setActiveStep(4);
|
|
29834
29906
|
if (skip.skipOptional) {
|
|
29835
29907
|
results.push({ name: "Preferences", status: "skipped", required: false });
|
|
29836
29908
|
} else {
|
|
29837
|
-
const status = await runScreen((done) => /* @__PURE__ */
|
|
29909
|
+
const status = await runScreen((done) => /* @__PURE__ */ jsx64(PreferencesMenu, { onDone: done }));
|
|
29838
29910
|
results.push({ name: "Preferences", status, required: false });
|
|
29839
29911
|
}
|
|
29840
29912
|
const exitCode = countRequiredFailures(results) === 0 ? 0 : 1;
|
|
@@ -29843,37 +29915,37 @@ function SetupScreen({
|
|
|
29843
29915
|
onComplete(finalOutcome);
|
|
29844
29916
|
})();
|
|
29845
29917
|
}, []);
|
|
29846
|
-
return /* @__PURE__ */ jsxs54(
|
|
29847
|
-
/* @__PURE__ */ jsxs54(
|
|
29848
|
-
/* @__PURE__ */
|
|
29849
|
-
/* @__PURE__ */
|
|
29918
|
+
return /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", paddingX: 1, children: [
|
|
29919
|
+
/* @__PURE__ */ jsxs54(Box53, { justifyContent: "space-between", columnGap: 1, ...columns !== void 0 ? { width: columns - 2 } : {}, children: [
|
|
29920
|
+
/* @__PURE__ */ jsx64(Box53, { flexShrink: 0, children: /* @__PURE__ */ jsx64(Text57, { bold: true, children: "experiences setup" }) }),
|
|
29921
|
+
/* @__PURE__ */ jsx64(Box53, { flexShrink: 0, children: /* @__PURE__ */ jsxs54(Text57, { dimColor: true, children: [
|
|
29850
29922
|
"v",
|
|
29851
29923
|
version
|
|
29852
29924
|
] }) })
|
|
29853
29925
|
] }),
|
|
29854
|
-
/* @__PURE__ */
|
|
29855
|
-
outcome ? /* @__PURE__ */
|
|
29926
|
+
/* @__PURE__ */ jsx64(Box53, { marginTop: 1, children: /* @__PURE__ */ jsx64(SetupStepper, { activeStep, columns }) }),
|
|
29927
|
+
outcome ? /* @__PURE__ */ jsx64(SetupSummary, { outcome, notice }) : screen && /* @__PURE__ */ jsx64(Box53, { marginTop: 1, children: screen })
|
|
29856
29928
|
] });
|
|
29857
29929
|
}
|
|
29858
29930
|
function SetupSummary({ outcome, notice }) {
|
|
29859
29931
|
const requiredFailed = countRequiredFailures(outcome.results);
|
|
29860
|
-
return /* @__PURE__ */ jsxs54(
|
|
29861
|
-
/* @__PURE__ */
|
|
29932
|
+
return /* @__PURE__ */ jsxs54(Box53, { flexDirection: "column", marginTop: 1, children: [
|
|
29933
|
+
/* @__PURE__ */ jsx64(Text57, { bold: true, children: "Summary" }),
|
|
29862
29934
|
outcome.results.map((result) => {
|
|
29863
29935
|
if (result.status === "completed") {
|
|
29864
|
-
return /* @__PURE__ */ jsxs54(
|
|
29936
|
+
return /* @__PURE__ */ jsxs54(Text57, { color: PALETTE.success, children: [
|
|
29865
29937
|
"\u2713 ",
|
|
29866
29938
|
result.name
|
|
29867
29939
|
] }, result.name);
|
|
29868
29940
|
}
|
|
29869
29941
|
if (result.status === "skipped") {
|
|
29870
|
-
return /* @__PURE__ */ jsxs54(
|
|
29942
|
+
return /* @__PURE__ */ jsxs54(Text57, { dimColor: true, children: [
|
|
29871
29943
|
"\u2013 ",
|
|
29872
29944
|
result.name,
|
|
29873
29945
|
" \u2014 skipped"
|
|
29874
29946
|
] }, result.name);
|
|
29875
29947
|
}
|
|
29876
|
-
return /* @__PURE__ */ jsxs54(
|
|
29948
|
+
return /* @__PURE__ */ jsxs54(Text57, { color: result.required ? PALETTE.error : PALETTE.warning, children: [
|
|
29877
29949
|
result.required ? "\u2717" : "\u26A0",
|
|
29878
29950
|
" ",
|
|
29879
29951
|
result.name,
|
|
@@ -29881,10 +29953,10 @@ function SetupSummary({ outcome, notice }) {
|
|
|
29881
29953
|
result.required ? "required" : "optional"
|
|
29882
29954
|
] }, result.name);
|
|
29883
29955
|
}),
|
|
29884
|
-
notice && /* @__PURE__ */
|
|
29885
|
-
/* @__PURE__ */
|
|
29886
|
-
requiredFailed > 0 && /* @__PURE__ */
|
|
29887
|
-
/* @__PURE__ */
|
|
29956
|
+
notice && /* @__PURE__ */ jsx64(Box53, { marginTop: 1, children: /* @__PURE__ */ jsx64(Text57, { color: PALETTE.warning, children: notice }) }),
|
|
29957
|
+
/* @__PURE__ */ jsx64(Box53, { marginTop: 1, children: /* @__PURE__ */ jsx64(Text57, { bold: true, color: requiredFailed === 0 ? PALETTE.success : PALETTE.warning, children: formatSetupCompletionMessage(outcome.results) }) }),
|
|
29958
|
+
requiredFailed > 0 && /* @__PURE__ */ jsx64(Text57, { dimColor: true, children: "Complete the steps above, then re-run experiences setup." }),
|
|
29959
|
+
/* @__PURE__ */ jsx64(Text57, { dimColor: true, children: "Run experiences doctor any time to re-check." })
|
|
29888
29960
|
] });
|
|
29889
29961
|
}
|
|
29890
29962
|
var init_SetupScreen = __esm({
|
|
@@ -29943,7 +30015,7 @@ async function runSetup(opts) {
|
|
|
29943
30015
|
process.exit(finished.exitCode);
|
|
29944
30016
|
}
|
|
29945
30017
|
function registerSetupCommand(program) {
|
|
29946
|
-
program.command("setup").description("Interactive setup: installs prerequisites and configures credentials for experiences import").
|
|
30018
|
+
program.command("setup").description("Interactive setup: installs prerequisites and configures credentials for experiences import").helpOption(false).action(() => runSetup({}));
|
|
29947
30019
|
}
|
|
29948
30020
|
var SETUP_REQUIRES_TTY_MESSAGE;
|
|
29949
30021
|
var init_command8 = __esm({
|
|
@@ -29955,57 +30027,14 @@ var init_command8 = __esm({
|
|
|
29955
30027
|
}
|
|
29956
30028
|
});
|
|
29957
30029
|
|
|
29958
|
-
// packages/experience-design-system-cli/src/analyze/composition/interchange-schema.ts
|
|
29959
|
-
function validateInterchangeMap(input) {
|
|
29960
|
-
const errors = [];
|
|
29961
|
-
if (typeof input !== "object" || input === null || Array.isArray(input)) {
|
|
29962
|
-
return { valid: false, errors: ["interchange map must be a JSON object"] };
|
|
29963
|
-
}
|
|
29964
|
-
const obj = input;
|
|
29965
|
-
if (obj.version !== 1) {
|
|
29966
|
-
errors.push(`unsupported interchange version: expected 1, got ${JSON.stringify(obj.version)}`);
|
|
29967
|
-
}
|
|
29968
|
-
if (typeof obj.groups !== "object" || obj.groups === null || Array.isArray(obj.groups)) {
|
|
29969
|
-
errors.push("interchange map must have a `groups` object");
|
|
29970
|
-
return { valid: false, errors };
|
|
29971
|
-
}
|
|
29972
|
-
const groups = obj.groups;
|
|
29973
|
-
for (const [parent, children] of Object.entries(groups)) {
|
|
29974
|
-
if (!Array.isArray(children) || !children.every((c2) => typeof c2 === "string")) {
|
|
29975
|
-
errors.push(`groups["${parent}"] must be an array of strings`);
|
|
29976
|
-
}
|
|
29977
|
-
}
|
|
29978
|
-
if (errors.length > 0) return { valid: false, errors };
|
|
29979
|
-
return { valid: true, map: { version: 1, groups } };
|
|
29980
|
-
}
|
|
29981
|
-
function groupsToEdges(map, provenance) {
|
|
29982
|
-
const seen = /* @__PURE__ */ new Set();
|
|
29983
|
-
const edges = [];
|
|
29984
|
-
for (const [parent, children] of Object.entries(map.groups)) {
|
|
29985
|
-
for (const child of children) {
|
|
29986
|
-
const key = `${parent}::${child}`;
|
|
29987
|
-
if (seen.has(key)) continue;
|
|
29988
|
-
seen.add(key);
|
|
29989
|
-
edges.push({ parent, child, provenance });
|
|
29990
|
-
}
|
|
29991
|
-
}
|
|
29992
|
-
return edges;
|
|
29993
|
-
}
|
|
29994
|
-
var init_interchange_schema = __esm({
|
|
29995
|
-
"packages/experience-design-system-cli/src/analyze/composition/interchange-schema.ts"() {
|
|
29996
|
-
"use strict";
|
|
29997
|
-
}
|
|
29998
|
-
});
|
|
29999
|
-
|
|
30000
30030
|
// packages/experience-design-system-cli/src/analyze/composition/merge-edges.ts
|
|
30001
30031
|
function rank(p) {
|
|
30002
|
-
if (p === "
|
|
30003
|
-
if (p === "
|
|
30004
|
-
if (p === "
|
|
30005
|
-
if (p === "
|
|
30006
|
-
if (p
|
|
30007
|
-
|
|
30008
|
-
return 7;
|
|
30032
|
+
if (p === "typed-slot") return 1;
|
|
30033
|
+
if (p === "structural") return 2;
|
|
30034
|
+
if (p === "manifest") return 3;
|
|
30035
|
+
if (p === "doc") return 4;
|
|
30036
|
+
if (p.startsWith("adapter:")) return 5;
|
|
30037
|
+
return 6;
|
|
30009
30038
|
}
|
|
30010
30039
|
function mergeEdges(all) {
|
|
30011
30040
|
const byKey = /* @__PURE__ */ new Map();
|
|
@@ -30111,7 +30140,7 @@ function applyMapping(components, edges) {
|
|
|
30111
30140
|
}))
|
|
30112
30141
|
}));
|
|
30113
30142
|
const byName = new Map(cloned.map((c2) => [c2.name, c2]));
|
|
30114
|
-
const isHighTrust = (p) => p === "
|
|
30143
|
+
const isHighTrust = (p) => p === "typed-slot" || p.startsWith("adapter:");
|
|
30115
30144
|
const addAllowed = (slot, child) => {
|
|
30116
30145
|
const set = new Set(slot.allowedComponents ?? []);
|
|
30117
30146
|
set.add(child);
|
|
@@ -30210,7 +30239,6 @@ async function resolveMapping(input) {
|
|
|
30210
30239
|
}
|
|
30211
30240
|
}
|
|
30212
30241
|
}
|
|
30213
|
-
if (input.userMap) collected.push(...groupsToEdges(input.userMap, "user"));
|
|
30214
30242
|
if (input.extraEdges) {
|
|
30215
30243
|
collected.push(...input.extraEdges);
|
|
30216
30244
|
}
|
|
@@ -30258,7 +30286,6 @@ ${f.content}`).join("\n\n");
|
|
|
30258
30286
|
var init_resolve_mapping = __esm({
|
|
30259
30287
|
"packages/experience-design-system-cli/src/analyze/composition/resolve-mapping.ts"() {
|
|
30260
30288
|
"use strict";
|
|
30261
|
-
init_interchange_schema();
|
|
30262
30289
|
init_merge_edges();
|
|
30263
30290
|
init_parse_map_edges();
|
|
30264
30291
|
init_apply_mapping();
|
|
@@ -30267,24 +30294,6 @@ var init_resolve_mapping = __esm({
|
|
|
30267
30294
|
});
|
|
30268
30295
|
|
|
30269
30296
|
// packages/experience-design-system-cli/src/analyze/composition/resolve-mapping-cli.ts
|
|
30270
|
-
import { readFile as readFile18 } from "node:fs/promises";
|
|
30271
|
-
async function loadUserMap(path) {
|
|
30272
|
-
let text;
|
|
30273
|
-
try {
|
|
30274
|
-
text = await readFile18(path, "utf8");
|
|
30275
|
-
} catch {
|
|
30276
|
-
return { ok: false, error: `--composition-map: file not found: ${path}` };
|
|
30277
|
-
}
|
|
30278
|
-
let parsed;
|
|
30279
|
-
try {
|
|
30280
|
-
parsed = JSON.parse(text);
|
|
30281
|
-
} catch {
|
|
30282
|
-
return { ok: false, error: `--composition-map: not valid JSON: ${path}` };
|
|
30283
|
-
}
|
|
30284
|
-
const result = validateInterchangeMap(parsed);
|
|
30285
|
-
if (!result.valid) return { ok: false, error: `--composition-map: ${result.errors.join("; ")}` };
|
|
30286
|
-
return { ok: true, map: result.map };
|
|
30287
|
-
}
|
|
30288
30297
|
function resolveCompositionSources(opts) {
|
|
30289
30298
|
return {
|
|
30290
30299
|
forceAgent: !!opts.compositionRefresh
|
|
@@ -30293,7 +30302,6 @@ function resolveCompositionSources(opts) {
|
|
|
30293
30302
|
var init_resolve_mapping_cli = __esm({
|
|
30294
30303
|
"packages/experience-design-system-cli/src/analyze/composition/resolve-mapping-cli.ts"() {
|
|
30295
30304
|
"use strict";
|
|
30296
|
-
init_interchange_schema();
|
|
30297
30305
|
}
|
|
30298
30306
|
});
|
|
30299
30307
|
|
|
@@ -30455,7 +30463,7 @@ var init_manifest_doc_evidence = __esm({
|
|
|
30455
30463
|
});
|
|
30456
30464
|
|
|
30457
30465
|
// packages/experience-design-system-cli/src/analyze/extract-command.ts
|
|
30458
|
-
import { mkdir as mkdir6, readdir as readdir3, readFile as
|
|
30466
|
+
import { mkdir as mkdir6, readdir as readdir3, readFile as readFile18, stat as stat6 } from "node:fs/promises";
|
|
30459
30467
|
import { isAbsolute as isAbsolute2, join as join25, relative as relative2, resolve as resolve19 } from "node:path";
|
|
30460
30468
|
function isDenylistedNoiseFile(name) {
|
|
30461
30469
|
return DENYLISTED_EXACT_FILE_NAMES.has(name) || DENYLISTED_FILE_NAME_PATTERNS.some((pattern) => pattern.test(name));
|
|
@@ -30522,7 +30530,7 @@ async function readCandidateFiles(components, extraFiles = []) {
|
|
|
30522
30530
|
await Promise.all(
|
|
30523
30531
|
[...paths].map(async (p) => {
|
|
30524
30532
|
try {
|
|
30525
|
-
const content = await
|
|
30533
|
+
const content = await readFile18(p, "utf8");
|
|
30526
30534
|
out.push({ path: p, content });
|
|
30527
30535
|
} catch {
|
|
30528
30536
|
}
|
|
@@ -30535,7 +30543,7 @@ function registerInternalExtractCommand(program) {
|
|
|
30535
30543
|
"--resolve-unreachable <mode>",
|
|
30536
30544
|
"Retry pass for unresolved Svelte Props types: 'auto' (default), 'always', or 'never'",
|
|
30537
30545
|
"auto"
|
|
30538
|
-
).option("--composition-refresh", "Force the mapping agent to run even where deterministic sources answered").option(
|
|
30546
|
+
).option("--composition-refresh", "Force the mapping agent to run even where deterministic sources answered").option(
|
|
30539
30547
|
"--prompt <stage=value>",
|
|
30540
30548
|
"Override a stage prompt (repeatable). value is a file path or literal text, e.g. --prompt composition=./p.md",
|
|
30541
30549
|
(v, acc) => [...acc, v],
|
|
@@ -30651,16 +30659,6 @@ function registerInternalExtractCommand(program) {
|
|
|
30651
30659
|
let validatedComponents = validateExtractedComponents(filteredComponents);
|
|
30652
30660
|
{
|
|
30653
30661
|
const sources = resolveCompositionSources(opts);
|
|
30654
|
-
let userMap;
|
|
30655
|
-
if (opts.compositionMap) {
|
|
30656
|
-
const loaded = await loadUserMap(opts.compositionMap);
|
|
30657
|
-
if (!loaded.ok) {
|
|
30658
|
-
process.stderr.write(`Error: ${loaded.error}
|
|
30659
|
-
`);
|
|
30660
|
-
process.exit(1);
|
|
30661
|
-
}
|
|
30662
|
-
userMap = loaded.map;
|
|
30663
|
-
}
|
|
30664
30662
|
const { overrides: promptOverrides, errors: promptErrors } = parsePromptOverrides(opts.prompt ?? []);
|
|
30665
30663
|
for (const err of promptErrors) {
|
|
30666
30664
|
process.stderr.write(`Error: ${err}
|
|
@@ -30722,7 +30720,6 @@ function registerInternalExtractCommand(program) {
|
|
|
30722
30720
|
});
|
|
30723
30721
|
const result = await resolveMapping({
|
|
30724
30722
|
components: validatedComponents,
|
|
30725
|
-
...userMap ? { userMap } : {},
|
|
30726
30723
|
...extraEdges.length > 0 ? { extraEdges } : {},
|
|
30727
30724
|
forceAgent: sources.forceAgent,
|
|
30728
30725
|
files: promptFiles,
|
|
@@ -30929,7 +30926,7 @@ function resolveBedrockFromAncestors(actionCommand) {
|
|
|
30929
30926
|
return false;
|
|
30930
30927
|
}
|
|
30931
30928
|
function registerImportV2Command(program) {
|
|
30932
|
-
program.command("importv2").description("Launch the v2 import TUI (experience-design-system-cli-v2)").action(async () => {
|
|
30929
|
+
program.command("importv2").description("Launch the v2 import TUI (experience-design-system-cli-v2)").helpOption(false).action(async () => {
|
|
30933
30930
|
const { render: render5 } = await import("ink");
|
|
30934
30931
|
const { createElement: createElement6 } = await import("react");
|
|
30935
30932
|
const { App } = await import("@contentful/experience-design-system-cli-v2/app");
|
|
@@ -30938,7 +30935,7 @@ function registerImportV2Command(program) {
|
|
|
30938
30935
|
});
|
|
30939
30936
|
}
|
|
30940
30937
|
function registerBuildCommand(program) {
|
|
30941
|
-
program.command("build").description("Rebuild from source and re-link exo/experiences binaries to this build").action(async () => {
|
|
30938
|
+
program.command("build").description("Rebuild from source and re-link exo/experiences binaries to this build").helpOption(false).action(async () => {
|
|
30942
30939
|
const pkgRoot = resolve20(dirname13(fileURLToPath4(import.meta.url)), "..", "..");
|
|
30943
30940
|
process.stderr.write("\u2699 Building from source...\n");
|
|
30944
30941
|
const { exitCode } = await runBuild({
|
|
@@ -30948,32 +30945,35 @@ function registerBuildCommand(program) {
|
|
|
30948
30945
|
process.exit(exitCode);
|
|
30949
30946
|
});
|
|
30950
30947
|
}
|
|
30948
|
+
function configureRootHelpOrder(program) {
|
|
30949
|
+
const order = ["build", "help", "import", "apply", "importv2", "setup", "doctor"];
|
|
30950
|
+
const rank2 = new Map(order.map((name, index) => [name, index]));
|
|
30951
|
+
program.configureHelp({
|
|
30952
|
+
visibleCommands(command) {
|
|
30953
|
+
const internals = command;
|
|
30954
|
+
const visible = command.commands.filter((entry) => !entry._hidden);
|
|
30955
|
+
const helpCommand = internals._getHelpCommand?.();
|
|
30956
|
+
if (helpCommand && !helpCommand._hidden) visible.push(helpCommand);
|
|
30957
|
+
if (command !== program) return visible;
|
|
30958
|
+
return visible.sort((a, b) => (rank2.get(a.name()) ?? order.length) - (rank2.get(b.name()) ?? order.length));
|
|
30959
|
+
}
|
|
30960
|
+
});
|
|
30961
|
+
}
|
|
30951
30962
|
function createProgram() {
|
|
30952
30963
|
const program = new Command().name("experience-design-system-cli").description("Static analysis, validation, generation, and import of Contentful design system artifacts").version(pkg3.version, "--version", "Print version number");
|
|
30953
30964
|
registerInternalGenerateCommand(program);
|
|
30954
30965
|
registerInternalExtractCommand(program);
|
|
30955
30966
|
registerPrintCommand(program);
|
|
30956
30967
|
registerMapTokensCommand(program);
|
|
30957
|
-
|
|
30968
|
+
registerBuildCommand(program);
|
|
30969
|
+
program.helpCommand("help [command]", "display help for command");
|
|
30958
30970
|
registerImportCommand(program);
|
|
30971
|
+
registerApplyCommand(program);
|
|
30959
30972
|
registerImportV2Command(program);
|
|
30960
|
-
registerDoctorCommand(program);
|
|
30961
30973
|
registerSetupCommand(program);
|
|
30962
|
-
|
|
30963
|
-
program
|
|
30964
|
-
"--debug",
|
|
30965
|
-
"Write a JSONL trace of every decision to ~/.contentful/experience-design-system-cli/debug/"
|
|
30966
|
-
);
|
|
30967
|
-
program.option("--no-debug", "Force debug logging off (overrides EDSI_DEBUG and persisted setup preference)");
|
|
30974
|
+
registerDoctorCommand(program);
|
|
30975
|
+
configureRootHelpOrder(program);
|
|
30968
30976
|
program.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
30969
|
-
let debug;
|
|
30970
|
-
for (let c2 = actionCommand; c2; c2 = c2.parent) {
|
|
30971
|
-
const opts = c2.opts();
|
|
30972
|
-
if (opts.debug !== void 0) {
|
|
30973
|
-
debug = opts.debug;
|
|
30974
|
-
break;
|
|
30975
|
-
}
|
|
30976
|
-
}
|
|
30977
30977
|
if (resolveBedrockFromAncestors(actionCommand)) {
|
|
30978
30978
|
process.env.EDS_BEDROCK = "1";
|
|
30979
30979
|
}
|
|
@@ -30983,7 +30983,7 @@ function createProgram() {
|
|
|
30983
30983
|
const { analyticsDisabled } = await readExperiencesCredentials();
|
|
30984
30984
|
setPersistedAnalyticsDisabled(analyticsDisabled ?? false);
|
|
30985
30985
|
noteCommandStart(commandChain);
|
|
30986
|
-
await beginCommand(commandChain, {
|
|
30986
|
+
await beginCommand(commandChain, {});
|
|
30987
30987
|
});
|
|
30988
30988
|
program.hook("postAction", async () => {
|
|
30989
30989
|
await completeActiveCommand();
|