@contentful/experience-design-system-cli 2.37.1-dev-build-d5797739.0 → 2.37.1-dev-build-8b3a1c07.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +374 -125
- package/dist/index.js +448 -171
- package/dist/package.json +1 -1
- package/dist/src/tui/settings/agents/AgentStatusLine.d.ts +13 -0
- package/dist/src/tui/settings/agents/agent-status.d.ts +29 -0
- package/dist/src/tui/settings/agents/agent-store.d.ts +3 -0
- package/dist/src/tui/settings/agents/apply-binary-overrides.d.ts +13 -0
- package/dist/src/tui/settings/shared/FieldForm.d.ts +7 -1
- package/legacy/dist/src/index.js +1 -0
- package/legacy/package.json +1 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -8431,10 +8431,10 @@ function extractVueSlotsFromSetup(options) {
|
|
|
8431
8431
|
if (!body)
|
|
8432
8432
|
return [];
|
|
8433
8433
|
const slotsByName = /* @__PURE__ */ new Map();
|
|
8434
|
-
for (const
|
|
8435
|
-
if (
|
|
8434
|
+
for (const access7 of body.getDescendantsOfKind(SyntaxKind5.PropertyAccessExpression)) {
|
|
8435
|
+
if (access7.getExpression().getText() !== slotsName)
|
|
8436
8436
|
continue;
|
|
8437
|
-
const slotName =
|
|
8437
|
+
const slotName = access7.getName();
|
|
8438
8438
|
if (!slotsByName.has(slotName)) {
|
|
8439
8439
|
slotsByName.set(slotName, {
|
|
8440
8440
|
name: slotName,
|
|
@@ -14550,6 +14550,7 @@ function readTokensFromPath2(request) {
|
|
|
14550
14550
|
init_agents();
|
|
14551
14551
|
init_agent_name();
|
|
14552
14552
|
init_models();
|
|
14553
|
+
init_binaries();
|
|
14553
14554
|
init_is_agent_name();
|
|
14554
14555
|
init_agent_supports_bedrock();
|
|
14555
14556
|
init_check_agent_auth();
|
|
@@ -28580,11 +28581,11 @@ function SettingsScreen({
|
|
|
28580
28581
|
|
|
28581
28582
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
28582
28583
|
import { useState as useState32 } from "react";
|
|
28583
|
-
import { Box as
|
|
28584
|
+
import { Box as Box48, Text as Text50, useInput as useInput13 } from "ink";
|
|
28584
28585
|
|
|
28585
28586
|
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
28586
28587
|
import { useEffect as useEffect22, useState as useState30 } from "react";
|
|
28587
|
-
import { Box as
|
|
28588
|
+
import { Box as Box46, Text as Text48, useInput as useInput12 } from "ink";
|
|
28588
28589
|
init_debug_store();
|
|
28589
28590
|
|
|
28590
28591
|
// packages/experience-design-system-cli/src/tui/settings/shared/FieldForm.tsx
|
|
@@ -28602,7 +28603,8 @@ function FieldForm({
|
|
|
28602
28603
|
onQuit,
|
|
28603
28604
|
notice,
|
|
28604
28605
|
busy = false,
|
|
28605
|
-
footer
|
|
28606
|
+
footer,
|
|
28607
|
+
actions = []
|
|
28606
28608
|
}) {
|
|
28607
28609
|
const [active, setActive] = useState29(0);
|
|
28608
28610
|
const [editing, setEditing] = useState29(false);
|
|
@@ -28630,6 +28632,11 @@ function FieldForm({
|
|
|
28630
28632
|
onChange(current.key, "");
|
|
28631
28633
|
return;
|
|
28632
28634
|
}
|
|
28635
|
+
const action = actions.find((candidate) => candidate.key === input);
|
|
28636
|
+
if (action) {
|
|
28637
|
+
action.run();
|
|
28638
|
+
return;
|
|
28639
|
+
}
|
|
28633
28640
|
if (key.tab || key.downArrow) {
|
|
28634
28641
|
setActive((i) => (i + 1) % fields.length);
|
|
28635
28642
|
return;
|
|
@@ -28689,6 +28696,7 @@ function FieldForm({
|
|
|
28689
28696
|
{ keys: "\u23CE", label: "edit" },
|
|
28690
28697
|
{ keys: "c", label: "clear" },
|
|
28691
28698
|
{ keys: "s", label: "save" },
|
|
28699
|
+
...actions.map(({ key, label }) => ({ keys: key, label })),
|
|
28692
28700
|
{ keys: "Esc/q", label: "back without saving" }
|
|
28693
28701
|
]
|
|
28694
28702
|
}
|
|
@@ -28719,7 +28727,7 @@ var AGENT_HINTS = {
|
|
|
28719
28727
|
};
|
|
28720
28728
|
var asString = (value) => typeof value === "string" ? value : "";
|
|
28721
28729
|
function emptyAgents() {
|
|
28722
|
-
return Object.fromEntries(AGENT_NAMES.map((name) => [name, { model: "" }]));
|
|
28730
|
+
return Object.fromEntries(AGENT_NAMES.map((name) => [name, { model: "", binary: "" }]));
|
|
28723
28731
|
}
|
|
28724
28732
|
async function readAgentConfig() {
|
|
28725
28733
|
const store = await readV1Store();
|
|
@@ -28730,12 +28738,15 @@ async function readAgentConfig() {
|
|
|
28730
28738
|
if (saved && typeof saved === "object") {
|
|
28731
28739
|
for (const name of AGENT_NAMES) {
|
|
28732
28740
|
const entry = saved[name];
|
|
28733
|
-
if (entry && typeof entry === "object")
|
|
28734
|
-
|
|
28741
|
+
if (entry && typeof entry === "object") {
|
|
28742
|
+
const fields = entry;
|
|
28743
|
+
agents[name] = { model: asString(fields["model"]), binary: asString(fields["binary"]) };
|
|
28744
|
+
}
|
|
28735
28745
|
}
|
|
28736
28746
|
}
|
|
28737
28747
|
const legacyModel = asString(store["agentModel"]);
|
|
28738
|
-
if (legacyModel && !agents[defaultAgent].model)
|
|
28748
|
+
if (legacyModel && !agents[defaultAgent].model)
|
|
28749
|
+
agents[defaultAgent] = { ...agents[defaultAgent], model: legacyModel };
|
|
28739
28750
|
return { defaultAgent, agents };
|
|
28740
28751
|
}
|
|
28741
28752
|
async function writeAgentConfig(config) {
|
|
@@ -28744,7 +28755,8 @@ async function writeAgentConfig(config) {
|
|
|
28744
28755
|
const agents = {};
|
|
28745
28756
|
for (const name of AGENT_NAMES) {
|
|
28746
28757
|
const model = config.agents[name].model.trim();
|
|
28747
|
-
|
|
28758
|
+
const binary = config.agents[name].binary.trim();
|
|
28759
|
+
if (model || binary) agents[name] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
|
|
28748
28760
|
}
|
|
28749
28761
|
merged["agent"] = config.defaultAgent;
|
|
28750
28762
|
const defaultModel = agents[config.defaultAgent]?.model;
|
|
@@ -28755,10 +28767,199 @@ async function writeAgentConfig(config) {
|
|
|
28755
28767
|
await writeV1Store(merged);
|
|
28756
28768
|
}
|
|
28757
28769
|
|
|
28770
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/agent-status.ts
|
|
28771
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
28772
|
+
import { access as access6, constants } from "node:fs/promises";
|
|
28773
|
+
var VERSION_TIMEOUT_MS = 5e3;
|
|
28774
|
+
var PROMPT_TIMEOUT_MS = 6e4;
|
|
28775
|
+
var TEST_PROMPT = "Reply with the single word: ok";
|
|
28776
|
+
var INSTALL_HINTS = {
|
|
28777
|
+
claude: "npm install -g @anthropic-ai/claude-code",
|
|
28778
|
+
codex: "npm install -g @openai/codex",
|
|
28779
|
+
opencode: "npm install -g opencode-ai",
|
|
28780
|
+
cursor: "install Cursor\u2019s `cursor-agent` command",
|
|
28781
|
+
copilot: "npm install -g @github/copilot"
|
|
28782
|
+
};
|
|
28783
|
+
var LOGIN_HINTS = {
|
|
28784
|
+
claude: "run `claude login`",
|
|
28785
|
+
codex: "set OPENAI_API_KEY, or sign in with a ChatGPT account",
|
|
28786
|
+
opencode: "run `opencode auth`",
|
|
28787
|
+
cursor: "sign in from Cursor",
|
|
28788
|
+
copilot: "run `copilot` and sign in"
|
|
28789
|
+
};
|
|
28790
|
+
function effectiveBinary(name, savedBinary) {
|
|
28791
|
+
return savedBinary.trim() || AGENT_BINARIES[name];
|
|
28792
|
+
}
|
|
28793
|
+
function defaultModelLabel(name) {
|
|
28794
|
+
const model = DEFAULT_MODELS[name];
|
|
28795
|
+
return model && model !== "Auto" ? model : "chosen by the agent";
|
|
28796
|
+
}
|
|
28797
|
+
var fail3 = (step, detail) => ({ step, ok: false, detail });
|
|
28798
|
+
var pass = (step, detail) => ({ step, ok: true, detail });
|
|
28799
|
+
function resolveOnPath(binary) {
|
|
28800
|
+
if (binary.includes("/")) {
|
|
28801
|
+
return access6(binary, constants.X_OK).then(
|
|
28802
|
+
() => binary,
|
|
28803
|
+
() => null
|
|
28804
|
+
);
|
|
28805
|
+
}
|
|
28806
|
+
return new Promise((resolve28) => {
|
|
28807
|
+
execFile2(
|
|
28808
|
+
process.platform === "win32" ? "where" : "which",
|
|
28809
|
+
[binary],
|
|
28810
|
+
(error, stdout) => resolve28(error ? null : stdout.split("\n")[0]?.trim() ?? null)
|
|
28811
|
+
);
|
|
28812
|
+
});
|
|
28813
|
+
}
|
|
28814
|
+
function readVersion(binary) {
|
|
28815
|
+
return new Promise((resolve28) => {
|
|
28816
|
+
execFile2(binary, ["--version"], { timeout: VERSION_TIMEOUT_MS }, (error, stdout) => {
|
|
28817
|
+
const line = stdout.split("\n")[0]?.trim() ?? "";
|
|
28818
|
+
if (!error && line) resolve28(pass("version", line));
|
|
28819
|
+
else resolve28(fail3("version", "runs, but did not report a version"));
|
|
28820
|
+
});
|
|
28821
|
+
});
|
|
28822
|
+
}
|
|
28823
|
+
async function inspectAgent(name, binary) {
|
|
28824
|
+
const target = effectiveBinary(name, binary);
|
|
28825
|
+
const found = await resolveOnPath(target);
|
|
28826
|
+
if (!found) return [fail3("path", `\`${target}\` was not found or is not executable`)];
|
|
28827
|
+
const checks = [pass("path", found)];
|
|
28828
|
+
checks.push(await readVersion(found));
|
|
28829
|
+
if (name === "claude") {
|
|
28830
|
+
const auth = await withBinaryEnv(name, found, () => checkAgentAuth(name));
|
|
28831
|
+
checks.push(
|
|
28832
|
+
auth === "ok" ? pass("login", "logged in") : fail3("login", auth === "not-found" ? "binary not found" : `not logged in: ${LOGIN_HINTS.claude}`)
|
|
28833
|
+
);
|
|
28834
|
+
}
|
|
28835
|
+
return checks;
|
|
28836
|
+
}
|
|
28837
|
+
async function testAgent(name, binary, model) {
|
|
28838
|
+
const checks = await inspectAgent(name, binary);
|
|
28839
|
+
if (!checks.every((check) => check.step === "version" || check.ok)) return checks;
|
|
28840
|
+
const target = effectiveBinary(name, binary);
|
|
28841
|
+
const found = await resolveOnPath(target) ?? target;
|
|
28842
|
+
const started = Date.now();
|
|
28843
|
+
const result = await withBinaryEnv(
|
|
28844
|
+
name,
|
|
28845
|
+
found,
|
|
28846
|
+
() => createLocalCliAgentInvoker().invoke({
|
|
28847
|
+
agent: name,
|
|
28848
|
+
...model.trim() ? { model: model.trim() } : {},
|
|
28849
|
+
prompt: TEST_PROMPT,
|
|
28850
|
+
timeoutMs: PROMPT_TIMEOUT_MS
|
|
28851
|
+
})
|
|
28852
|
+
);
|
|
28853
|
+
const seconds = ((Date.now() - started) / 1e3).toFixed(1);
|
|
28854
|
+
if (result.timedOut) return [...checks, fail3("prompt", `no answer within ${PROMPT_TIMEOUT_MS / 1e3}s`)];
|
|
28855
|
+
if (result.exitCode !== 0) {
|
|
28856
|
+
const reason = result.stderr.trim().split("\n").pop()?.slice(0, 160) || `exited with code ${result.exitCode}`;
|
|
28857
|
+
return [...checks, fail3("prompt", reason)];
|
|
28858
|
+
}
|
|
28859
|
+
return [...checks, pass("prompt", `answered in ${seconds}s`)];
|
|
28860
|
+
}
|
|
28861
|
+
function statusFromChecks(name, checks) {
|
|
28862
|
+
if (checks.length === 0) return "checking";
|
|
28863
|
+
if (checks.some((check) => check.step === "path" && !check.ok)) return "not-found";
|
|
28864
|
+
const login = checks.find((check) => check.step === "login");
|
|
28865
|
+
if (login) return login.ok ? "ready" : "not-logged-in";
|
|
28866
|
+
const prompt = checks.find((check) => check.step === "prompt");
|
|
28867
|
+
if (prompt) return prompt.ok ? "ready" : "not-logged-in";
|
|
28868
|
+
return name === "claude" ? "ready" : "unknown";
|
|
28869
|
+
}
|
|
28870
|
+
function nextStepHint(name, status) {
|
|
28871
|
+
if (status === "not-found") return INSTALL_HINTS[name];
|
|
28872
|
+
if (status === "not-logged-in") return LOGIN_HINTS[name];
|
|
28873
|
+
if (status === "unknown") return "run a full test to confirm it is logged in";
|
|
28874
|
+
return "";
|
|
28875
|
+
}
|
|
28876
|
+
async function withBinaryEnv(name, binary, run) {
|
|
28877
|
+
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
28878
|
+
const previous = process.env[key];
|
|
28879
|
+
process.env[key] = binary;
|
|
28880
|
+
try {
|
|
28881
|
+
return await run();
|
|
28882
|
+
} finally {
|
|
28883
|
+
if (previous === void 0) delete process.env[key];
|
|
28884
|
+
else process.env[key] = previous;
|
|
28885
|
+
}
|
|
28886
|
+
}
|
|
28887
|
+
|
|
28888
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/AgentStatusLine.tsx
|
|
28889
|
+
import { Box as Box45, Text as Text47 } from "ink";
|
|
28890
|
+
import { jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
28891
|
+
var STATUS_TEXT = {
|
|
28892
|
+
checking: "checking...",
|
|
28893
|
+
ready: "ready",
|
|
28894
|
+
"not-found": "not found",
|
|
28895
|
+
"not-logged-in": "not logged in",
|
|
28896
|
+
unknown: "found, login not checked"
|
|
28897
|
+
};
|
|
28898
|
+
var STATUS_COLOR = {
|
|
28899
|
+
checking: PALETTE.muted,
|
|
28900
|
+
ready: PALETTE.success,
|
|
28901
|
+
"not-found": PALETTE.error,
|
|
28902
|
+
"not-logged-in": PALETTE.error,
|
|
28903
|
+
unknown: PALETTE.muted
|
|
28904
|
+
};
|
|
28905
|
+
function AgentStatusBadge({
|
|
28906
|
+
name,
|
|
28907
|
+
checks
|
|
28908
|
+
}) {
|
|
28909
|
+
const status = checks ? statusFromChecks(name, checks) : "checking";
|
|
28910
|
+
return /* @__PURE__ */ jsx56(Text47, { color: STATUS_COLOR[status], children: STATUS_TEXT[status] });
|
|
28911
|
+
}
|
|
28912
|
+
function AgentChecks({
|
|
28913
|
+
name,
|
|
28914
|
+
checks
|
|
28915
|
+
}) {
|
|
28916
|
+
if (!checks) {
|
|
28917
|
+
return /* @__PURE__ */ jsx56(Box45, { marginTop: 1, children: /* @__PURE__ */ jsx56(Text47, { color: PALETTE.muted, children: "Checking..." }) });
|
|
28918
|
+
}
|
|
28919
|
+
const status = statusFromChecks(name, checks);
|
|
28920
|
+
const hint = nextStepHint(name, status);
|
|
28921
|
+
return /* @__PURE__ */ jsxs46(Box45, { flexDirection: "column", marginTop: 1, children: [
|
|
28922
|
+
/* @__PURE__ */ jsxs46(Text47, { bold: true, children: [
|
|
28923
|
+
"Status: ",
|
|
28924
|
+
/* @__PURE__ */ jsx56(Text47, { color: STATUS_COLOR[status], children: STATUS_TEXT[status] })
|
|
28925
|
+
] }),
|
|
28926
|
+
checks.map((check) => /* @__PURE__ */ jsxs46(Text47, { color: check.ok ? PALETTE.success : PALETTE.muted, children: [
|
|
28927
|
+
check.ok ? "\u2713" : "\xB7",
|
|
28928
|
+
" ",
|
|
28929
|
+
check.step,
|
|
28930
|
+
": ",
|
|
28931
|
+
check.detail
|
|
28932
|
+
] }, check.step)),
|
|
28933
|
+
hint && /* @__PURE__ */ jsxs46(Text47, { color: PALETTE.muted, children: [
|
|
28934
|
+
"Next: ",
|
|
28935
|
+
hint
|
|
28936
|
+
] })
|
|
28937
|
+
] });
|
|
28938
|
+
}
|
|
28939
|
+
|
|
28940
|
+
// packages/experience-design-system-cli/src/tui/settings/agents/apply-binary-overrides.ts
|
|
28941
|
+
var shellValues = /* @__PURE__ */ new Map();
|
|
28942
|
+
function applyBinaryOverrides(config) {
|
|
28943
|
+
for (const name of AGENT_NAMES) {
|
|
28944
|
+
const key = `EDS_AGENT_BINARY_${name.toUpperCase()}`;
|
|
28945
|
+
const binary = config.agents[name].binary.trim();
|
|
28946
|
+
if (binary) {
|
|
28947
|
+
if (!shellValues.has(key)) shellValues.set(key, process.env[key]);
|
|
28948
|
+
process.env[key] = binary;
|
|
28949
|
+
} else if (shellValues.has(key)) {
|
|
28950
|
+
const shellValue = shellValues.get(key);
|
|
28951
|
+
if (shellValue === void 0) delete process.env[key];
|
|
28952
|
+
else process.env[key] = shellValue;
|
|
28953
|
+
shellValues.delete(key);
|
|
28954
|
+
}
|
|
28955
|
+
}
|
|
28956
|
+
}
|
|
28957
|
+
|
|
28758
28958
|
// packages/experience-design-system-cli/src/tui/settings/agents/AgentScreens.tsx
|
|
28759
|
-
import { Fragment as Fragment18, jsx as
|
|
28760
|
-
var
|
|
28761
|
-
{ key: "
|
|
28959
|
+
import { Fragment as Fragment18, jsx as jsx57, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
28960
|
+
var agentFields = (name) => [
|
|
28961
|
+
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_HINTS[name]}\` from the PATH)` },
|
|
28962
|
+
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name)})` }
|
|
28762
28963
|
];
|
|
28763
28964
|
var ROWS = [{ kind: "default" }, ...AGENT_NAMES.map((name) => ({ kind: "agent", name }))];
|
|
28764
28965
|
function AgentForm({
|
|
@@ -28768,29 +28969,53 @@ function AgentForm({
|
|
|
28768
28969
|
onBack
|
|
28769
28970
|
}) {
|
|
28770
28971
|
const [saving, setSaving] = useState30(false);
|
|
28972
|
+
const [testing, setTesting] = useState30(false);
|
|
28771
28973
|
const [notice, setNotice] = useState30(null);
|
|
28974
|
+
const [checks, setChecks] = useState30(void 0);
|
|
28975
|
+
const settings = config.agents[name];
|
|
28976
|
+
useEffect22(() => {
|
|
28977
|
+
let current = true;
|
|
28978
|
+
setChecks(void 0);
|
|
28979
|
+
void inspectAgent(name, settings.binary).then((result) => current && setChecks(result));
|
|
28980
|
+
return () => {
|
|
28981
|
+
current = false;
|
|
28982
|
+
};
|
|
28983
|
+
}, [name, settings.binary]);
|
|
28772
28984
|
const save = () => {
|
|
28773
28985
|
setSaving(true);
|
|
28774
28986
|
setNotice(null);
|
|
28775
|
-
writeAgentConfig(config).then(() =>
|
|
28987
|
+
writeAgentConfig(config).then(() => {
|
|
28988
|
+
applyBinaryOverrides(config);
|
|
28989
|
+
setNotice({ kind: "success", text: `${AGENT_LABELS[name]} settings saved` });
|
|
28990
|
+
}).catch(
|
|
28776
28991
|
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "Failed to save" })
|
|
28777
28992
|
).finally(() => setSaving(false));
|
|
28778
28993
|
};
|
|
28779
|
-
|
|
28994
|
+
const runFullTest = () => {
|
|
28995
|
+
setTesting(true);
|
|
28996
|
+
setNotice(null);
|
|
28997
|
+
setChecks(void 0);
|
|
28998
|
+
testAgent(name, settings.binary, settings.model).then(setChecks).catch(
|
|
28999
|
+
(err) => setNotice({ kind: "error", text: err instanceof Error ? err.message : "The test could not run" })
|
|
29000
|
+
).finally(() => setTesting(false));
|
|
29001
|
+
};
|
|
29002
|
+
return /* @__PURE__ */ jsx57(
|
|
28780
29003
|
FieldForm,
|
|
28781
29004
|
{
|
|
28782
29005
|
title: AGENT_LABELS[name],
|
|
28783
29006
|
subtitle: `Runs the \`${AGENT_HINTS[name]}\` command. ${config.defaultAgent === name ? "This is the default agent." : ""}`.trim(),
|
|
28784
|
-
fields:
|
|
28785
|
-
values: { model:
|
|
28786
|
-
onChange: (
|
|
28787
|
-
setConfig({ ...config, agents: { ...config.agents, [name]: {
|
|
29007
|
+
fields: agentFields(name),
|
|
29008
|
+
values: { binary: settings.binary, model: settings.model },
|
|
29009
|
+
onChange: (key, value) => {
|
|
29010
|
+
setConfig({ ...config, agents: { ...config.agents, [name]: { ...settings, [key]: value } } });
|
|
28788
29011
|
setNotice(null);
|
|
28789
29012
|
},
|
|
28790
29013
|
onSave: save,
|
|
28791
29014
|
onQuit: onBack,
|
|
28792
29015
|
notice,
|
|
28793
|
-
busy: saving
|
|
29016
|
+
busy: saving || testing,
|
|
29017
|
+
footer: /* @__PURE__ */ jsx57(AgentChecks, { name, checks }),
|
|
29018
|
+
actions: [{ key: "t", label: "full test (uses a few tokens)", run: runFullTest }]
|
|
28794
29019
|
}
|
|
28795
29020
|
);
|
|
28796
29021
|
}
|
|
@@ -28799,9 +29024,18 @@ function AgentsScreen({ onDone }) {
|
|
|
28799
29024
|
const [focus, setFocus] = useState30(0);
|
|
28800
29025
|
const [open, setOpen] = useState30(null);
|
|
28801
29026
|
const [notice, setNotice] = useState30(null);
|
|
29027
|
+
const [checks, setChecks] = useState30({});
|
|
29028
|
+
const inspectAll = (loaded) => {
|
|
29029
|
+
for (const name of AGENT_NAMES) {
|
|
29030
|
+
void inspectAgent(name, loaded.agents[name].binary).then(
|
|
29031
|
+
(result) => setChecks((previous) => ({ ...previous, [name]: result }))
|
|
29032
|
+
);
|
|
29033
|
+
}
|
|
29034
|
+
};
|
|
28802
29035
|
useEffect22(() => {
|
|
28803
29036
|
void readAgentConfig().then((loaded) => {
|
|
28804
29037
|
setConfig(loaded);
|
|
29038
|
+
inspectAll(loaded);
|
|
28805
29039
|
startDebugRun({
|
|
28806
29040
|
flow: "settings/agents",
|
|
28807
29041
|
step: "01-agents",
|
|
@@ -28849,47 +29083,62 @@ function AgentsScreen({ onDone }) {
|
|
|
28849
29083
|
}
|
|
28850
29084
|
});
|
|
28851
29085
|
if (!config) {
|
|
28852
|
-
return /* @__PURE__ */
|
|
28853
|
-
/* @__PURE__ */
|
|
28854
|
-
/* @__PURE__ */
|
|
28855
|
-
/* @__PURE__ */
|
|
29086
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29087
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
29088
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29089
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.accent, children: "Loading..." })
|
|
28856
29090
|
] });
|
|
28857
29091
|
}
|
|
28858
29092
|
if (open) {
|
|
28859
|
-
return /* @__PURE__ */
|
|
29093
|
+
return /* @__PURE__ */ jsx57(
|
|
29094
|
+
AgentForm,
|
|
29095
|
+
{
|
|
29096
|
+
name: open,
|
|
29097
|
+
config,
|
|
29098
|
+
setConfig,
|
|
29099
|
+
onBack: () => {
|
|
29100
|
+
setOpen(null);
|
|
29101
|
+
void readAgentConfig().then((saved) => {
|
|
29102
|
+
setConfig(saved);
|
|
29103
|
+
inspectAll(saved);
|
|
29104
|
+
});
|
|
29105
|
+
}
|
|
29106
|
+
}
|
|
29107
|
+
);
|
|
28860
29108
|
}
|
|
28861
|
-
return /* @__PURE__ */
|
|
28862
|
-
/* @__PURE__ */
|
|
28863
|
-
/* @__PURE__ */
|
|
28864
|
-
/* @__PURE__ */
|
|
29109
|
+
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29110
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: "Agents" }),
|
|
29111
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: "The coding agent the CLI runs, and the settings for each one." }),
|
|
29112
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
28865
29113
|
ROWS.map((row, index) => {
|
|
28866
29114
|
const isFocused = index === focus;
|
|
28867
|
-
const pointer = /* @__PURE__ */
|
|
29115
|
+
const pointer = /* @__PURE__ */ jsx57(Text48, { color: isFocused ? PALETTE.accent : void 0, children: isFocused ? "\u276F" : " " });
|
|
28868
29116
|
if (row.kind === "default") {
|
|
28869
|
-
return /* @__PURE__ */
|
|
29117
|
+
return /* @__PURE__ */ jsx57(Box46, { flexDirection: "column", marginBottom: 1, children: /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
28870
29118
|
pointer,
|
|
28871
|
-
/* @__PURE__ */
|
|
28872
|
-
/* @__PURE__ */
|
|
29119
|
+
/* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : PALETTE.muted, children: "Default agent" }),
|
|
29120
|
+
/* @__PURE__ */ jsx57(Text48, { bold: true, children: `\u2039 ${AGENT_LABELS[config.defaultAgent]} \u203A` })
|
|
28873
29121
|
] }) }, "default");
|
|
28874
29122
|
}
|
|
28875
29123
|
const model = config.agents[row.name].model;
|
|
28876
|
-
return /* @__PURE__ */
|
|
29124
|
+
return /* @__PURE__ */ jsxs47(Box46, { gap: 1, children: [
|
|
28877
29125
|
pointer,
|
|
28878
|
-
/* @__PURE__ */
|
|
28879
|
-
/* @__PURE__ */
|
|
28880
|
-
|
|
29126
|
+
/* @__PURE__ */ jsx57(Box46, { width: 16, flexShrink: 0, children: /* @__PURE__ */ jsx57(Text48, { bold: isFocused, color: isFocused ? PALETTE.accent : void 0, children: AGENT_LABELS[row.name] }) }),
|
|
29127
|
+
/* @__PURE__ */ jsx57(Box46, { width: 26, flexShrink: 0, children: /* @__PURE__ */ jsx57(AgentStatusBadge, { name: row.name, checks: checks[row.name] }) }),
|
|
29128
|
+
/* @__PURE__ */ jsx57(Text48, { color: PALETTE.muted, children: `model: ${model || defaultModelLabel(row.name)}` }),
|
|
29129
|
+
row.name === config.defaultAgent && /* @__PURE__ */ jsx57(Text48, { color: PALETTE.success, children: "(default)" })
|
|
28881
29130
|
] }, row.name);
|
|
28882
29131
|
}),
|
|
28883
|
-
notice && /* @__PURE__ */
|
|
28884
|
-
/* @__PURE__ */
|
|
28885
|
-
/* @__PURE__ */
|
|
29132
|
+
notice && /* @__PURE__ */ jsxs47(Fragment18, { children: [
|
|
29133
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29134
|
+
/* @__PURE__ */ jsxs47(Text48, { color: notice.kind === "success" ? PALETTE.success : PALETTE.error, children: [
|
|
28886
29135
|
notice.kind === "success" ? "\u2713" : "\u2717",
|
|
28887
29136
|
" ",
|
|
28888
29137
|
notice.text
|
|
28889
29138
|
] })
|
|
28890
29139
|
] }),
|
|
28891
|
-
/* @__PURE__ */
|
|
28892
|
-
/* @__PURE__ */
|
|
29140
|
+
/* @__PURE__ */ jsx57(Text48, { children: " " }),
|
|
29141
|
+
/* @__PURE__ */ jsx57(
|
|
28893
29142
|
ControlHints,
|
|
28894
29143
|
{
|
|
28895
29144
|
hints: ROWS[focus].kind === "default" ? [
|
|
@@ -28908,7 +29157,7 @@ function AgentsScreen({ onDone }) {
|
|
|
28908
29157
|
|
|
28909
29158
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
28910
29159
|
import { useEffect as useEffect23, useState as useState31 } from "react";
|
|
28911
|
-
import { Box as
|
|
29160
|
+
import { Box as Box47, Text as Text49 } from "ink";
|
|
28912
29161
|
init_debug_store();
|
|
28913
29162
|
|
|
28914
29163
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/config-store.ts
|
|
@@ -28937,7 +29186,7 @@ async function writeCredentials(config) {
|
|
|
28937
29186
|
}
|
|
28938
29187
|
|
|
28939
29188
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ProjectConfigScreen.tsx
|
|
28940
|
-
import { jsx as
|
|
29189
|
+
import { jsx as jsx58, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
28941
29190
|
var FIELDS2 = [
|
|
28942
29191
|
{ key: "spaceId", label: "Space ID" },
|
|
28943
29192
|
{ key: "environmentId", label: "Environment ID" },
|
|
@@ -28976,10 +29225,10 @@ function ProjectConfigScreen({ onDone }) {
|
|
|
28976
29225
|
});
|
|
28977
29226
|
}, []);
|
|
28978
29227
|
if (!config) {
|
|
28979
|
-
return /* @__PURE__ */
|
|
28980
|
-
/* @__PURE__ */
|
|
28981
|
-
/* @__PURE__ */
|
|
28982
|
-
/* @__PURE__ */
|
|
29228
|
+
return /* @__PURE__ */ jsxs48(Box47, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29229
|
+
/* @__PURE__ */ jsx58(Text49, { bold: true, children: "Project" }),
|
|
29230
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
29231
|
+
/* @__PURE__ */ jsx58(Text49, { color: PALETTE.accent, children: "Loading..." })
|
|
28983
29232
|
] });
|
|
28984
29233
|
}
|
|
28985
29234
|
const save = () => {
|
|
@@ -28999,7 +29248,7 @@ function ProjectConfigScreen({ onDone }) {
|
|
|
28999
29248
|
);
|
|
29000
29249
|
onDone();
|
|
29001
29250
|
};
|
|
29002
|
-
return /* @__PURE__ */
|
|
29251
|
+
return /* @__PURE__ */ jsx58(
|
|
29003
29252
|
FieldForm,
|
|
29004
29253
|
{
|
|
29005
29254
|
title: "Project",
|
|
@@ -29019,7 +29268,7 @@ function ProjectConfigScreen({ onDone }) {
|
|
|
29019
29268
|
}
|
|
29020
29269
|
|
|
29021
29270
|
// packages/experience-design-system-cli/src/tui/settings/contentful-configuration/ContentfulConfigScreen.tsx
|
|
29022
|
-
import { jsx as
|
|
29271
|
+
import { jsx as jsx59, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
29023
29272
|
var SECTIONS = [
|
|
29024
29273
|
{
|
|
29025
29274
|
id: "project",
|
|
@@ -29048,18 +29297,18 @@ function ConfigurationScreen({ onDone }) {
|
|
|
29048
29297
|
}
|
|
29049
29298
|
if (key.escape || input === "q") onDone();
|
|
29050
29299
|
});
|
|
29051
|
-
if (open === "project") return /* @__PURE__ */
|
|
29052
|
-
if (open === "agents") return /* @__PURE__ */
|
|
29053
|
-
return /* @__PURE__ */
|
|
29054
|
-
/* @__PURE__ */
|
|
29055
|
-
/* @__PURE__ */
|
|
29056
|
-
SECTIONS.map((section, index) => /* @__PURE__ */
|
|
29057
|
-
/* @__PURE__ */
|
|
29058
|
-
/* @__PURE__ */
|
|
29059
|
-
/* @__PURE__ */
|
|
29300
|
+
if (open === "project") return /* @__PURE__ */ jsx59(ProjectConfigScreen, { onDone: close });
|
|
29301
|
+
if (open === "agents") return /* @__PURE__ */ jsx59(AgentsScreen, { onDone: close });
|
|
29302
|
+
return /* @__PURE__ */ jsxs49(Box48, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29303
|
+
/* @__PURE__ */ jsx59(Text50, { bold: true, children: "Configuration" }),
|
|
29304
|
+
/* @__PURE__ */ jsx59(Text50, { children: " " }),
|
|
29305
|
+
SECTIONS.map((section, index) => /* @__PURE__ */ jsxs49(Box48, { gap: 1, children: [
|
|
29306
|
+
/* @__PURE__ */ jsx59(Text50, { color: index === focus ? PALETTE.accent : void 0, children: index === focus ? "\u276F" : " " }),
|
|
29307
|
+
/* @__PURE__ */ jsx59(Box48, { width: 9, flexShrink: 0, children: /* @__PURE__ */ jsx59(Text50, { bold: index === focus, color: index === focus ? PALETTE.accent : void 0, children: section.label }) }),
|
|
29308
|
+
/* @__PURE__ */ jsx59(Text50, { color: PALETTE.muted, children: section.description })
|
|
29060
29309
|
] }, section.id)),
|
|
29061
|
-
/* @__PURE__ */
|
|
29062
|
-
/* @__PURE__ */
|
|
29310
|
+
/* @__PURE__ */ jsx59(Text50, { children: " " }),
|
|
29311
|
+
/* @__PURE__ */ jsx59(
|
|
29063
29312
|
ControlHints,
|
|
29064
29313
|
{
|
|
29065
29314
|
hints: [
|
|
@@ -29074,7 +29323,7 @@ function ConfigurationScreen({ onDone }) {
|
|
|
29074
29323
|
|
|
29075
29324
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
29076
29325
|
import { useEffect as useEffect24, useState as useState33 } from "react";
|
|
29077
|
-
import { Box as
|
|
29326
|
+
import { Box as Box49, Text as Text51, useInput as useInput14 } from "ink";
|
|
29078
29327
|
|
|
29079
29328
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/analytics-store.ts
|
|
29080
29329
|
async function readAnalyticsSetting() {
|
|
@@ -29093,7 +29342,7 @@ async function writeAnalyticsSetting(setting) {
|
|
|
29093
29342
|
|
|
29094
29343
|
// packages/experience-design-system-cli/src/tui/settings/opt-in-analytics/screen.tsx
|
|
29095
29344
|
init_debug_store();
|
|
29096
|
-
import { Fragment as Fragment19, jsx as
|
|
29345
|
+
import { Fragment as Fragment19, jsx as jsx60, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
29097
29346
|
function OptInAnalyticsScreen({ onDone }) {
|
|
29098
29347
|
const [loading, setLoading] = useState33(true);
|
|
29099
29348
|
const [enabled, setEnabled] = useState33(true);
|
|
@@ -29124,21 +29373,21 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29124
29373
|
onDone();
|
|
29125
29374
|
}
|
|
29126
29375
|
});
|
|
29127
|
-
return /* @__PURE__ */
|
|
29128
|
-
/* @__PURE__ */
|
|
29129
|
-
/* @__PURE__ */
|
|
29130
|
-
loading ? /* @__PURE__ */
|
|
29131
|
-
/* @__PURE__ */
|
|
29376
|
+
return /* @__PURE__ */ jsxs50(Box49, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29377
|
+
/* @__PURE__ */ jsx60(Text51, { bold: true, children: "Settings \u203A Opt-in Analytics" }),
|
|
29378
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
29379
|
+
loading ? /* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs50(Fragment19, { children: [
|
|
29380
|
+
/* @__PURE__ */ jsxs50(Text51, { children: [
|
|
29132
29381
|
"Share anonymous usage data:",
|
|
29133
29382
|
" ",
|
|
29134
|
-
/* @__PURE__ */
|
|
29383
|
+
/* @__PURE__ */ jsx60(Text51, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
29135
29384
|
] }),
|
|
29136
|
-
/* @__PURE__ */
|
|
29137
|
-
/* @__PURE__ */
|
|
29138
|
-
/* @__PURE__ */
|
|
29385
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
29386
|
+
/* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: "Shares which CLI commands are used and where imports succeed or fail." }),
|
|
29387
|
+
/* @__PURE__ */ jsx60(Text51, { color: PALETTE.muted, children: "Never includes source code, file paths, credentials, or authored content." })
|
|
29139
29388
|
] }),
|
|
29140
|
-
/* @__PURE__ */
|
|
29141
|
-
/* @__PURE__ */
|
|
29389
|
+
/* @__PURE__ */ jsx60(Text51, { children: " " }),
|
|
29390
|
+
/* @__PURE__ */ jsx60(
|
|
29142
29391
|
ControlHints,
|
|
29143
29392
|
{
|
|
29144
29393
|
hints: [
|
|
@@ -29152,10 +29401,10 @@ function OptInAnalyticsScreen({ onDone }) {
|
|
|
29152
29401
|
|
|
29153
29402
|
// packages/experience-design-system-cli/src/tui/upgrade/PageContainer.tsx
|
|
29154
29403
|
import { useEffect as useEffect25, useState as useState34 } from "react";
|
|
29155
|
-
import { Box as
|
|
29404
|
+
import { Box as Box50, Text as Text52, useInput as useInput15 } from "ink";
|
|
29156
29405
|
init_version();
|
|
29157
29406
|
init_debug_store();
|
|
29158
|
-
import { jsx as
|
|
29407
|
+
import { jsx as jsx61, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
29159
29408
|
var UPGRADE_COMMANDS = ["git pull", "pnpm install", "pnpm build"];
|
|
29160
29409
|
function UpgradeScreen({ onDone }) {
|
|
29161
29410
|
const [upgradeCheck, setUpgradeCheck] = useState34();
|
|
@@ -29179,12 +29428,12 @@ function UpgradeScreen({ onDone }) {
|
|
|
29179
29428
|
return;
|
|
29180
29429
|
}
|
|
29181
29430
|
});
|
|
29182
|
-
return /* @__PURE__ */
|
|
29183
|
-
/* @__PURE__ */
|
|
29184
|
-
/* @__PURE__ */
|
|
29431
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29432
|
+
/* @__PURE__ */ jsx61(Text52, { bold: true, children: "Upgrade" }),
|
|
29433
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
29185
29434
|
renderBody(upgradeCheck),
|
|
29186
|
-
/* @__PURE__ */
|
|
29187
|
-
/* @__PURE__ */
|
|
29435
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
29436
|
+
/* @__PURE__ */ jsxs51(Text52, { bold: true, color: PALETTE.accent, children: [
|
|
29188
29437
|
FOCUS_MARKER,
|
|
29189
29438
|
" Go Back"
|
|
29190
29439
|
] })
|
|
@@ -29192,43 +29441,43 @@ function UpgradeScreen({ onDone }) {
|
|
|
29192
29441
|
}
|
|
29193
29442
|
function renderBody(upgradeCheck) {
|
|
29194
29443
|
if (!upgradeCheck) {
|
|
29195
|
-
return /* @__PURE__ */
|
|
29444
|
+
return /* @__PURE__ */ jsx61(Text52, { color: PALETTE.muted, children: "Checking for updates\u2026" });
|
|
29196
29445
|
}
|
|
29197
29446
|
if (upgradeCheck.status === "error") {
|
|
29198
|
-
return /* @__PURE__ */
|
|
29447
|
+
return /* @__PURE__ */ jsx61(Text52, { color: PALETTE.warning, children: "Couldn't check for updates \u2014 check your network connection and try again." });
|
|
29199
29448
|
}
|
|
29200
29449
|
if (upgradeCheck.status === "up-to-date") {
|
|
29201
|
-
return /* @__PURE__ */
|
|
29450
|
+
return /* @__PURE__ */ jsxs51(Text52, { color: PALETTE.success, children: [
|
|
29202
29451
|
"You're already on the latest version (v",
|
|
29203
29452
|
upgradeCheck.current,
|
|
29204
29453
|
")."
|
|
29205
29454
|
] });
|
|
29206
29455
|
}
|
|
29207
|
-
return /* @__PURE__ */
|
|
29208
|
-
/* @__PURE__ */
|
|
29209
|
-
/* @__PURE__ */
|
|
29456
|
+
return /* @__PURE__ */ jsxs51(Box50, { flexDirection: "column", children: [
|
|
29457
|
+
/* @__PURE__ */ jsxs51(Text52, { color: PALETTE.muted, children: [
|
|
29458
|
+
/* @__PURE__ */ jsxs51(Text52, { bold: true, color: PALETTE.success, children: [
|
|
29210
29459
|
"v",
|
|
29211
29460
|
upgradeCheck.latest
|
|
29212
29461
|
] }),
|
|
29213
29462
|
" ",
|
|
29214
29463
|
"is available (you're on ",
|
|
29215
|
-
/* @__PURE__ */
|
|
29464
|
+
/* @__PURE__ */ jsxs51(Text52, { bold: true, children: [
|
|
29216
29465
|
"v",
|
|
29217
29466
|
upgradeCheck.current
|
|
29218
29467
|
] }),
|
|
29219
29468
|
"). Exit this program, cd into the root of your local clone of contentful/experience-design-system-sdk-public, then run:"
|
|
29220
29469
|
] }),
|
|
29221
|
-
/* @__PURE__ */
|
|
29222
|
-
/* @__PURE__ */
|
|
29470
|
+
/* @__PURE__ */ jsx61(Text52, { children: " " }),
|
|
29471
|
+
/* @__PURE__ */ jsx61(Box50, { flexDirection: "column", borderStyle: "round", borderColor: PALETTE.border, paddingX: 1, children: UPGRADE_COMMANDS.map((cmd) => /* @__PURE__ */ jsx61(Text52, { bold: true, children: cmd }, cmd)) })
|
|
29223
29472
|
] });
|
|
29224
29473
|
}
|
|
29225
29474
|
|
|
29226
29475
|
// packages/experience-design-system-cli/src/tui/settings/debug-mode/screen.tsx
|
|
29227
29476
|
import { useEffect as useEffect26, useState as useState35 } from "react";
|
|
29228
|
-
import { Box as
|
|
29477
|
+
import { Box as Box51, Text as Text53, useInput as useInput16 } from "ink";
|
|
29229
29478
|
init_debug_mode_store();
|
|
29230
29479
|
init_debug_store();
|
|
29231
|
-
import { jsx as
|
|
29480
|
+
import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
29232
29481
|
function DebugModeScreen({ onDone }) {
|
|
29233
29482
|
const [loading, setLoading] = useState35(true);
|
|
29234
29483
|
const [enabled, setEnabled] = useState35(true);
|
|
@@ -29259,16 +29508,16 @@ function DebugModeScreen({ onDone }) {
|
|
|
29259
29508
|
onDone();
|
|
29260
29509
|
}
|
|
29261
29510
|
});
|
|
29262
|
-
return /* @__PURE__ */
|
|
29263
|
-
/* @__PURE__ */
|
|
29264
|
-
/* @__PURE__ */
|
|
29265
|
-
loading ? /* @__PURE__ */
|
|
29511
|
+
return /* @__PURE__ */ jsxs52(Box51, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29512
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, children: "Settings \u203A Debug Mode" }),
|
|
29513
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29514
|
+
loading ? /* @__PURE__ */ jsx62(Text53, { color: PALETTE.muted, children: "Loading\u2026" }) : /* @__PURE__ */ jsxs52(Text53, { children: [
|
|
29266
29515
|
"Debug logging:",
|
|
29267
29516
|
" ",
|
|
29268
|
-
/* @__PURE__ */
|
|
29517
|
+
/* @__PURE__ */ jsx62(Text53, { bold: true, color: enabled ? PALETTE.success : PALETTE.muted, children: enabled ? "On" : "Off" })
|
|
29269
29518
|
] }),
|
|
29270
|
-
/* @__PURE__ */
|
|
29271
|
-
/* @__PURE__ */
|
|
29519
|
+
/* @__PURE__ */ jsx62(Text53, { children: " " }),
|
|
29520
|
+
/* @__PURE__ */ jsx62(
|
|
29272
29521
|
ControlHints,
|
|
29273
29522
|
{
|
|
29274
29523
|
hints: [
|
|
@@ -29281,7 +29530,7 @@ function DebugModeScreen({ onDone }) {
|
|
|
29281
29530
|
}
|
|
29282
29531
|
|
|
29283
29532
|
// packages/experience-design-system-cli/app.tsx
|
|
29284
|
-
import { Fragment as Fragment20, jsx as
|
|
29533
|
+
import { Fragment as Fragment20, jsx as jsx63 } from "react/jsx-runtime";
|
|
29285
29534
|
function App({ importOptions, inkClear }) {
|
|
29286
29535
|
const [screen, setScreen] = useState36("start");
|
|
29287
29536
|
const [importExitCode, setImportExitCode] = useState36();
|
|
@@ -29438,9 +29687,9 @@ function App({ importOptions, inkClear }) {
|
|
|
29438
29687
|
};
|
|
29439
29688
|
switch (screen) {
|
|
29440
29689
|
case "import":
|
|
29441
|
-
if (showImportResult) return /* @__PURE__ */
|
|
29690
|
+
if (showImportResult) return /* @__PURE__ */ jsx63(ImportScreen, { exitCode: importExitCode, onDone: finishImportResult });
|
|
29442
29691
|
if (flow && flowStart) {
|
|
29443
|
-
return /* @__PURE__ */
|
|
29692
|
+
return /* @__PURE__ */ jsx63(
|
|
29444
29693
|
FlowScreen,
|
|
29445
29694
|
{
|
|
29446
29695
|
state: flow.state,
|
|
@@ -29450,12 +29699,12 @@ function App({ importOptions, inkClear }) {
|
|
|
29450
29699
|
}
|
|
29451
29700
|
);
|
|
29452
29701
|
}
|
|
29453
|
-
if (importDefaults === void 0) return /* @__PURE__ */
|
|
29702
|
+
if (importDefaults === void 0) return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
29454
29703
|
if (projectPath === void 0) {
|
|
29455
|
-
return /* @__PURE__ */
|
|
29704
|
+
return /* @__PURE__ */ jsx63(WelcomeScreen, { onContinue: setProjectPath, onQuit: leaveImport, initialPath: importDefaults.componentDir });
|
|
29456
29705
|
}
|
|
29457
29706
|
if (tokensPath === void 0) {
|
|
29458
|
-
return /* @__PURE__ */
|
|
29707
|
+
return /* @__PURE__ */ jsx63(
|
|
29459
29708
|
TokenInputScreen,
|
|
29460
29709
|
{
|
|
29461
29710
|
initialPath: importDefaults.tokenFile,
|
|
@@ -29465,7 +29714,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29465
29714
|
);
|
|
29466
29715
|
}
|
|
29467
29716
|
if (scannedFiles === void 0) {
|
|
29468
|
-
return /* @__PURE__ */
|
|
29717
|
+
return /* @__PURE__ */ jsx63(
|
|
29469
29718
|
PathValidationScreen,
|
|
29470
29719
|
{
|
|
29471
29720
|
projectPath,
|
|
@@ -29477,10 +29726,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29477
29726
|
}
|
|
29478
29727
|
if (extractionRun) {
|
|
29479
29728
|
if (extraction?.status === "done" && !extraction.result.ok) {
|
|
29480
|
-
return /* @__PURE__ */
|
|
29729
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: extraction.result.step, message: extraction.result.message, onExit: leaveImport });
|
|
29481
29730
|
}
|
|
29482
29731
|
if (extraction?.status === "running") {
|
|
29483
|
-
return /* @__PURE__ */
|
|
29732
|
+
return /* @__PURE__ */ jsx63(
|
|
29484
29733
|
ExtractionScreen,
|
|
29485
29734
|
{
|
|
29486
29735
|
progress: extraction.progress,
|
|
@@ -29489,14 +29738,14 @@ function App({ importOptions, inkClear }) {
|
|
|
29489
29738
|
}
|
|
29490
29739
|
);
|
|
29491
29740
|
}
|
|
29492
|
-
return /* @__PURE__ */
|
|
29741
|
+
return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
29493
29742
|
}
|
|
29494
29743
|
if (scopeRun && scopeFlow) {
|
|
29495
29744
|
if (scopeFlow.status === "failed") {
|
|
29496
|
-
return /* @__PURE__ */
|
|
29745
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: "scope gate", message: scopeFlow.message, onExit: leaveImport });
|
|
29497
29746
|
}
|
|
29498
29747
|
if (scopeFlow.status === "deciding") {
|
|
29499
|
-
return /* @__PURE__ */
|
|
29748
|
+
return /* @__PURE__ */ jsx63(
|
|
29500
29749
|
ScopeGateScreen,
|
|
29501
29750
|
{
|
|
29502
29751
|
components: scopeFlow.load.components,
|
|
@@ -29506,7 +29755,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29506
29755
|
);
|
|
29507
29756
|
}
|
|
29508
29757
|
if (generation?.status === "done" && !generation.result.ok) {
|
|
29509
|
-
return /* @__PURE__ */
|
|
29758
|
+
return /* @__PURE__ */ jsx63(ErrorStep, { stepName: generation.result.step, message: generation.result.message, onExit: leaveImport });
|
|
29510
29759
|
}
|
|
29511
29760
|
if (generation?.status === "running") {
|
|
29512
29761
|
const hasRawTokens = scopeRun.input.rawTokensPath !== "";
|
|
@@ -29514,7 +29763,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29514
29763
|
hasRawTokens,
|
|
29515
29764
|
mapTokensEligible: generation.progress.mapTokensEligible
|
|
29516
29765
|
});
|
|
29517
|
-
return /* @__PURE__ */
|
|
29766
|
+
return /* @__PURE__ */ jsx63(
|
|
29518
29767
|
GenerationScreen,
|
|
29519
29768
|
{
|
|
29520
29769
|
progress: generation.progress,
|
|
@@ -29526,10 +29775,10 @@ function App({ importOptions, inkClear }) {
|
|
|
29526
29775
|
}
|
|
29527
29776
|
);
|
|
29528
29777
|
}
|
|
29529
|
-
return /* @__PURE__ */
|
|
29778
|
+
return /* @__PURE__ */ jsx63(Fragment20, {});
|
|
29530
29779
|
}
|
|
29531
29780
|
if (pendingLaunch?.cached) {
|
|
29532
|
-
return /* @__PURE__ */
|
|
29781
|
+
return /* @__PURE__ */ jsx63(
|
|
29533
29782
|
TokenReuseScreen,
|
|
29534
29783
|
{
|
|
29535
29784
|
tokensPath: pendingLaunch.cached.tokensPath,
|
|
@@ -29540,7 +29789,7 @@ function App({ importOptions, inkClear }) {
|
|
|
29540
29789
|
}
|
|
29541
29790
|
);
|
|
29542
29791
|
}
|
|
29543
|
-
return /* @__PURE__ */
|
|
29792
|
+
return /* @__PURE__ */ jsx63(
|
|
29544
29793
|
CredentialsScreen,
|
|
29545
29794
|
{
|
|
29546
29795
|
initial: importDefaults.credentials,
|
|
@@ -29549,19 +29798,19 @@ function App({ importOptions, inkClear }) {
|
|
|
29549
29798
|
}
|
|
29550
29799
|
);
|
|
29551
29800
|
case "help":
|
|
29552
|
-
return /* @__PURE__ */
|
|
29801
|
+
return /* @__PURE__ */ jsx63(HelpScreen, { onDone: goToStart });
|
|
29553
29802
|
case "upgrade":
|
|
29554
|
-
return /* @__PURE__ */
|
|
29803
|
+
return /* @__PURE__ */ jsx63(UpgradeScreen, { onDone: goToStart });
|
|
29555
29804
|
case "settings":
|
|
29556
|
-
return /* @__PURE__ */
|
|
29805
|
+
return /* @__PURE__ */ jsx63(SettingsScreen, { onNavigate: setScreen, onBack: goToStart });
|
|
29557
29806
|
case "settings-configuration":
|
|
29558
|
-
return /* @__PURE__ */
|
|
29807
|
+
return /* @__PURE__ */ jsx63(ConfigurationScreen, { onDone: goToSettings });
|
|
29559
29808
|
case "settings-opt-in-analytics":
|
|
29560
|
-
return /* @__PURE__ */
|
|
29809
|
+
return /* @__PURE__ */ jsx63(OptInAnalyticsScreen, { onDone: goToSettings });
|
|
29561
29810
|
case "settings-debug-mode":
|
|
29562
|
-
return /* @__PURE__ */
|
|
29811
|
+
return /* @__PURE__ */ jsx63(DebugModeScreen, { onDone: goToSettings });
|
|
29563
29812
|
case "start":
|
|
29564
|
-
return /* @__PURE__ */
|
|
29813
|
+
return /* @__PURE__ */ jsx63(HomeScreen, { onNavigate: setScreen });
|
|
29565
29814
|
}
|
|
29566
29815
|
}
|
|
29567
29816
|
async function runApp(renderApp, importOptions) {
|
|
@@ -29569,7 +29818,7 @@ async function runApp(renderApp, importOptions) {
|
|
|
29569
29818
|
instance.clear?.();
|
|
29570
29819
|
process.stdout.write("\x1B[H\x1B[0J");
|
|
29571
29820
|
};
|
|
29572
|
-
const instance = renderApp(/* @__PURE__ */
|
|
29821
|
+
const instance = renderApp(/* @__PURE__ */ jsx63(App, { importOptions, inkClear }));
|
|
29573
29822
|
await instance.waitUntilExit();
|
|
29574
29823
|
}
|
|
29575
29824
|
export {
|