@contentful/experience-design-system-cli 2.37.1-dev-build-a2aef8c6.0 → 2.37.1-dev-build-75039ab7.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 +28 -11
- package/dist/index.js +30 -13
- package/dist/package.json +1 -1
- package/dist/src/tui/settings/configuration/agents/agent-store.d.ts +6 -1
- package/package.json +3 -3
package/dist/app.js
CHANGED
|
@@ -28593,7 +28593,6 @@ var readV1Store = readSettings2;
|
|
|
28593
28593
|
var writeV1Store = writeSettings2;
|
|
28594
28594
|
|
|
28595
28595
|
// packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-store.ts
|
|
28596
|
-
var DEFAULT_AGENT3 = "claude";
|
|
28597
28596
|
var AGENT_LABELS = {
|
|
28598
28597
|
claude: "Claude Code",
|
|
28599
28598
|
codex: "OpenAI Codex",
|
|
@@ -28608,7 +28607,8 @@ function emptyAgents() {
|
|
|
28608
28607
|
async function readAgentConfig() {
|
|
28609
28608
|
const store = await readV1Store();
|
|
28610
28609
|
const stored = asString(store["agent"]);
|
|
28611
|
-
const
|
|
28610
|
+
const defaultChosen = isAgentName(stored);
|
|
28611
|
+
const defaultAgent = defaultChosen ? stored : DEFAULT_AGENT_NAME;
|
|
28612
28612
|
const agents = emptyAgents();
|
|
28613
28613
|
const saved = store["agents"];
|
|
28614
28614
|
if (saved && typeof saved === "object") {
|
|
@@ -28623,7 +28623,7 @@ async function readAgentConfig() {
|
|
|
28623
28623
|
const legacyModel = asString(store["agentModel"]);
|
|
28624
28624
|
if (legacyModel && !agents[defaultAgent].model)
|
|
28625
28625
|
agents[defaultAgent] = { ...agents[defaultAgent], model: legacyModel };
|
|
28626
|
-
return { defaultAgent, agents };
|
|
28626
|
+
return { defaultAgent, defaultChosen, agents };
|
|
28627
28627
|
}
|
|
28628
28628
|
async function writeAgentConfig(config) {
|
|
28629
28629
|
const existing = await readV1Store();
|
|
@@ -28634,8 +28634,9 @@ async function writeAgentConfig(config) {
|
|
|
28634
28634
|
const binary = config.agents[name].binary.trim();
|
|
28635
28635
|
if (model || binary) agents[name] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
|
|
28636
28636
|
}
|
|
28637
|
-
|
|
28638
|
-
|
|
28637
|
+
const defaultModel = config.defaultChosen ? agents[config.defaultAgent]?.model : void 0;
|
|
28638
|
+
if (config.defaultChosen) merged["agent"] = config.defaultAgent;
|
|
28639
|
+
else delete merged["agent"];
|
|
28639
28640
|
if (defaultModel) merged["agentModel"] = defaultModel;
|
|
28640
28641
|
else delete merged["agentModel"];
|
|
28641
28642
|
if (Object.keys(agents).length > 0) merged["agents"] = agents;
|
|
@@ -29021,6 +29022,7 @@ var fields = (name) => [
|
|
|
29021
29022
|
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[name]}\` from the PATH)` },
|
|
29022
29023
|
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name)})` }
|
|
29023
29024
|
];
|
|
29025
|
+
var INSPECT_DELAY_MS = 400;
|
|
29024
29026
|
var LABEL_WIDTH = "Command path".length;
|
|
29025
29027
|
var LABEL_GAP = 2;
|
|
29026
29028
|
var POINTER_WIDTH = 2;
|
|
@@ -29050,9 +29052,12 @@ function AgentDetail({
|
|
|
29050
29052
|
useEffect22(() => {
|
|
29051
29053
|
let active = true;
|
|
29052
29054
|
setChecks(void 0);
|
|
29053
|
-
|
|
29055
|
+
const timer = setTimeout(() => {
|
|
29056
|
+
void inspectAgent(name, settings.binary).then((result) => active && setChecks(result));
|
|
29057
|
+
}, INSPECT_DELAY_MS);
|
|
29054
29058
|
return () => {
|
|
29055
29059
|
active = false;
|
|
29060
|
+
clearTimeout(timer);
|
|
29056
29061
|
};
|
|
29057
29062
|
}, [name, settings.binary]);
|
|
29058
29063
|
const save = () => {
|
|
@@ -29119,6 +29124,7 @@ function AgentsScreen({ onDone }) {
|
|
|
29119
29124
|
const [open, setOpen] = useState31(null);
|
|
29120
29125
|
const [notice, setNotice] = useState31(null);
|
|
29121
29126
|
const [saving, setSaving] = useState31(false);
|
|
29127
|
+
const [loadError, setLoadError] = useState31(null);
|
|
29122
29128
|
const [checks, setChecks] = useState31({});
|
|
29123
29129
|
const inspectAll = (loaded) => {
|
|
29124
29130
|
for (const name of AGENT_NAMES) {
|
|
@@ -29128,7 +29134,7 @@ function AgentsScreen({ onDone }) {
|
|
|
29128
29134
|
}
|
|
29129
29135
|
};
|
|
29130
29136
|
useEffect23(() => {
|
|
29131
|
-
|
|
29137
|
+
readAgentConfig().then((loaded) => {
|
|
29132
29138
|
setConfig(loaded);
|
|
29133
29139
|
inspectAll(loaded);
|
|
29134
29140
|
startDebugRun({
|
|
@@ -29137,7 +29143,7 @@ function AgentsScreen({ onDone }) {
|
|
|
29137
29143
|
menuOption: "Configuration > Agents",
|
|
29138
29144
|
inputs: { default_agent: loaded.defaultAgent }
|
|
29139
29145
|
});
|
|
29140
|
-
});
|
|
29146
|
+
}).catch((err) => setLoadError(err instanceof Error ? err.message : String(err)));
|
|
29141
29147
|
}, []);
|
|
29142
29148
|
const makeDefault = (name) => {
|
|
29143
29149
|
if (!config || saving) return;
|
|
@@ -29147,8 +29153,8 @@ function AgentsScreen({ onDone }) {
|
|
|
29147
29153
|
}
|
|
29148
29154
|
setSaving(true);
|
|
29149
29155
|
setNotice(null);
|
|
29150
|
-
writeAgentConfig({ ...config, defaultAgent: name }).then(() => {
|
|
29151
|
-
setConfig((current) => current ? { ...current, defaultAgent: name } : current);
|
|
29156
|
+
writeAgentConfig({ ...config, defaultAgent: name, defaultChosen: true }).then(() => {
|
|
29157
|
+
setConfig((current) => current ? { ...current, defaultAgent: name, defaultChosen: true } : current);
|
|
29152
29158
|
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[name]}` });
|
|
29153
29159
|
}).catch(
|
|
29154
29160
|
(err) => setNotice({
|
|
@@ -29158,6 +29164,10 @@ function AgentsScreen({ onDone }) {
|
|
|
29158
29164
|
).finally(() => setSaving(false));
|
|
29159
29165
|
};
|
|
29160
29166
|
useInput12((input, key) => {
|
|
29167
|
+
if (loadError && (key.escape || input === "q")) {
|
|
29168
|
+
onDone();
|
|
29169
|
+
return;
|
|
29170
|
+
}
|
|
29161
29171
|
if (!config || open || saving) return;
|
|
29162
29172
|
const focused = AGENT_NAMES[focus];
|
|
29163
29173
|
if (key.upArrow || key.downArrow || key.tab) setNotice(null);
|
|
@@ -29187,7 +29197,14 @@ function AgentsScreen({ onDone }) {
|
|
|
29187
29197
|
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
29188
29198
|
/* @__PURE__ */ jsx58(Text49, { bold: true, children: "Agents" }),
|
|
29189
29199
|
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
29190
|
-
/* @__PURE__ */
|
|
29200
|
+
loadError ? /* @__PURE__ */ jsxs47(Fragment18, { children: [
|
|
29201
|
+
/* @__PURE__ */ jsxs47(Text49, { color: PALETTE.error, children: [
|
|
29202
|
+
"\u2717 Could not read the settings: ",
|
|
29203
|
+
loadError
|
|
29204
|
+
] }),
|
|
29205
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
29206
|
+
/* @__PURE__ */ jsx58(ControlHints, { hints: [{ keys: "Esc/q", label: "back" }] })
|
|
29207
|
+
] }) : /* @__PURE__ */ jsx58(Text49, { color: PALETTE.accent, children: "Loading..." })
|
|
29191
29208
|
] });
|
|
29192
29209
|
}
|
|
29193
29210
|
if (open) {
|
package/dist/index.js
CHANGED
|
@@ -19573,7 +19573,8 @@ function emptyAgents() {
|
|
|
19573
19573
|
async function readAgentConfig() {
|
|
19574
19574
|
const store = await readV1Store();
|
|
19575
19575
|
const stored = asString(store["agent"]);
|
|
19576
|
-
const
|
|
19576
|
+
const defaultChosen = isAgentName(stored);
|
|
19577
|
+
const defaultAgent = defaultChosen ? stored : DEFAULT_AGENT_NAME;
|
|
19577
19578
|
const agents = emptyAgents();
|
|
19578
19579
|
const saved = store["agents"];
|
|
19579
19580
|
if (saved && typeof saved === "object") {
|
|
@@ -19588,7 +19589,7 @@ async function readAgentConfig() {
|
|
|
19588
19589
|
const legacyModel = asString(store["agentModel"]);
|
|
19589
19590
|
if (legacyModel && !agents[defaultAgent].model)
|
|
19590
19591
|
agents[defaultAgent] = { ...agents[defaultAgent], model: legacyModel };
|
|
19591
|
-
return { defaultAgent, agents };
|
|
19592
|
+
return { defaultAgent, defaultChosen, agents };
|
|
19592
19593
|
}
|
|
19593
19594
|
async function writeAgentConfig(config) {
|
|
19594
19595
|
const existing = await readV1Store();
|
|
@@ -19599,21 +19600,21 @@ async function writeAgentConfig(config) {
|
|
|
19599
19600
|
const binary = config.agents[name].binary.trim();
|
|
19600
19601
|
if (model || binary) agents[name] = { ...model ? { model } : {}, ...binary ? { binary } : {} };
|
|
19601
19602
|
}
|
|
19602
|
-
|
|
19603
|
-
|
|
19603
|
+
const defaultModel = config.defaultChosen ? agents[config.defaultAgent]?.model : void 0;
|
|
19604
|
+
if (config.defaultChosen) merged["agent"] = config.defaultAgent;
|
|
19605
|
+
else delete merged["agent"];
|
|
19604
19606
|
if (defaultModel) merged["agentModel"] = defaultModel;
|
|
19605
19607
|
else delete merged["agentModel"];
|
|
19606
19608
|
if (Object.keys(agents).length > 0) merged["agents"] = agents;
|
|
19607
19609
|
else delete merged["agents"];
|
|
19608
19610
|
await writeV1Store(merged);
|
|
19609
19611
|
}
|
|
19610
|
-
var
|
|
19612
|
+
var AGENT_LABELS, asString;
|
|
19611
19613
|
var init_agent_store = __esm({
|
|
19612
19614
|
"packages/experience-design-system-cli/src/tui/settings/configuration/agents/agent-store.ts"() {
|
|
19613
19615
|
"use strict";
|
|
19614
19616
|
init_src4();
|
|
19615
19617
|
init_v1_store();
|
|
19616
|
-
DEFAULT_AGENT3 = "claude";
|
|
19617
19618
|
AGENT_LABELS = {
|
|
19618
19619
|
claude: "Claude Code",
|
|
19619
19620
|
codex: "OpenAI Codex",
|
|
@@ -33500,9 +33501,12 @@ function AgentDetail({
|
|
|
33500
33501
|
useEffect22(() => {
|
|
33501
33502
|
let active = true;
|
|
33502
33503
|
setChecks(void 0);
|
|
33503
|
-
|
|
33504
|
+
const timer = setTimeout(() => {
|
|
33505
|
+
void inspectAgent(name, settings.binary).then((result) => active && setChecks(result));
|
|
33506
|
+
}, INSPECT_DELAY_MS);
|
|
33504
33507
|
return () => {
|
|
33505
33508
|
active = false;
|
|
33509
|
+
clearTimeout(timer);
|
|
33506
33510
|
};
|
|
33507
33511
|
}, [name, settings.binary]);
|
|
33508
33512
|
const save = () => {
|
|
@@ -33558,7 +33562,7 @@ function AgentDetail({
|
|
|
33558
33562
|
}
|
|
33559
33563
|
);
|
|
33560
33564
|
}
|
|
33561
|
-
var fields, LABEL_WIDTH, LABEL_GAP, POINTER_WIDTH;
|
|
33565
|
+
var fields, INSPECT_DELAY_MS, LABEL_WIDTH, LABEL_GAP, POINTER_WIDTH;
|
|
33562
33566
|
var init_AgentDetail = __esm({
|
|
33563
33567
|
"packages/experience-design-system-cli/src/tui/settings/configuration/agents/AgentDetail.tsx"() {
|
|
33564
33568
|
"use strict";
|
|
@@ -33573,6 +33577,7 @@ var init_AgentDetail = __esm({
|
|
|
33573
33577
|
{ key: "binary", label: "Command path", hint: `(empty: \`${AGENT_BINARIES[name]}\` from the PATH)` },
|
|
33574
33578
|
{ key: "model", label: "Model", hint: `(empty: ${defaultModelLabel(name)})` }
|
|
33575
33579
|
];
|
|
33580
|
+
INSPECT_DELAY_MS = 400;
|
|
33576
33581
|
LABEL_WIDTH = "Command path".length;
|
|
33577
33582
|
LABEL_GAP = 2;
|
|
33578
33583
|
POINTER_WIDTH = 2;
|
|
@@ -33589,6 +33594,7 @@ function AgentsScreen({ onDone }) {
|
|
|
33589
33594
|
const [open, setOpen] = useState31(null);
|
|
33590
33595
|
const [notice, setNotice] = useState31(null);
|
|
33591
33596
|
const [saving, setSaving] = useState31(false);
|
|
33597
|
+
const [loadError, setLoadError] = useState31(null);
|
|
33592
33598
|
const [checks, setChecks] = useState31({});
|
|
33593
33599
|
const inspectAll = (loaded) => {
|
|
33594
33600
|
for (const name of AGENT_NAMES) {
|
|
@@ -33598,7 +33604,7 @@ function AgentsScreen({ onDone }) {
|
|
|
33598
33604
|
}
|
|
33599
33605
|
};
|
|
33600
33606
|
useEffect23(() => {
|
|
33601
|
-
|
|
33607
|
+
readAgentConfig().then((loaded) => {
|
|
33602
33608
|
setConfig(loaded);
|
|
33603
33609
|
inspectAll(loaded);
|
|
33604
33610
|
startDebugRun({
|
|
@@ -33607,7 +33613,7 @@ function AgentsScreen({ onDone }) {
|
|
|
33607
33613
|
menuOption: "Configuration > Agents",
|
|
33608
33614
|
inputs: { default_agent: loaded.defaultAgent }
|
|
33609
33615
|
});
|
|
33610
|
-
});
|
|
33616
|
+
}).catch((err) => setLoadError(err instanceof Error ? err.message : String(err)));
|
|
33611
33617
|
}, []);
|
|
33612
33618
|
const makeDefault = (name) => {
|
|
33613
33619
|
if (!config || saving) return;
|
|
@@ -33617,8 +33623,8 @@ function AgentsScreen({ onDone }) {
|
|
|
33617
33623
|
}
|
|
33618
33624
|
setSaving(true);
|
|
33619
33625
|
setNotice(null);
|
|
33620
|
-
writeAgentConfig({ ...config, defaultAgent: name }).then(() => {
|
|
33621
|
-
setConfig((current) => current ? { ...current, defaultAgent: name } : current);
|
|
33626
|
+
writeAgentConfig({ ...config, defaultAgent: name, defaultChosen: true }).then(() => {
|
|
33627
|
+
setConfig((current) => current ? { ...current, defaultAgent: name, defaultChosen: true } : current);
|
|
33622
33628
|
setNotice({ kind: "success", text: `Default agent is now ${AGENT_LABELS[name]}` });
|
|
33623
33629
|
}).catch(
|
|
33624
33630
|
(err) => setNotice({
|
|
@@ -33628,6 +33634,10 @@ function AgentsScreen({ onDone }) {
|
|
|
33628
33634
|
).finally(() => setSaving(false));
|
|
33629
33635
|
};
|
|
33630
33636
|
useInput12((input, key) => {
|
|
33637
|
+
if (loadError && (key.escape || input === "q")) {
|
|
33638
|
+
onDone();
|
|
33639
|
+
return;
|
|
33640
|
+
}
|
|
33631
33641
|
if (!config || open || saving) return;
|
|
33632
33642
|
const focused = AGENT_NAMES[focus];
|
|
33633
33643
|
if (key.upArrow || key.downArrow || key.tab) setNotice(null);
|
|
@@ -33657,7 +33667,14 @@ function AgentsScreen({ onDone }) {
|
|
|
33657
33667
|
return /* @__PURE__ */ jsxs47(Box46, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
|
|
33658
33668
|
/* @__PURE__ */ jsx58(Text49, { bold: true, children: "Agents" }),
|
|
33659
33669
|
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33660
|
-
/* @__PURE__ */
|
|
33670
|
+
loadError ? /* @__PURE__ */ jsxs47(Fragment18, { children: [
|
|
33671
|
+
/* @__PURE__ */ jsxs47(Text49, { color: PALETTE.error, children: [
|
|
33672
|
+
"\u2717 Could not read the settings: ",
|
|
33673
|
+
loadError
|
|
33674
|
+
] }),
|
|
33675
|
+
/* @__PURE__ */ jsx58(Text49, { children: " " }),
|
|
33676
|
+
/* @__PURE__ */ jsx58(ControlHints, { hints: [{ keys: "Esc/q", label: "back" }] })
|
|
33677
|
+
] }) : /* @__PURE__ */ jsx58(Text49, { color: PALETTE.accent, children: "Loading..." })
|
|
33661
33678
|
] });
|
|
33662
33679
|
}
|
|
33663
33680
|
if (open) {
|
package/dist/package.json
CHANGED
|
@@ -6,8 +6,13 @@ export type AgentSettings = {
|
|
|
6
6
|
binary: string;
|
|
7
7
|
};
|
|
8
8
|
export type AgentConfig = {
|
|
9
|
-
/** The agent the CLI uses when `--agent` is not given. */
|
|
9
|
+
/** The agent the CLI uses when `--agent` is not given. Claude when nothing was chosen. */
|
|
10
10
|
defaultAgent: AgentName;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the user chose the default agent. Only then is `agent` written to config.json, so someone who never chose
|
|
13
|
+
* keeps the import's built-in default, including if that default changes in a later version.
|
|
14
|
+
*/
|
|
15
|
+
defaultChosen?: boolean;
|
|
11
16
|
agents: Record<AgentName, AgentSettings>;
|
|
12
17
|
};
|
|
13
18
|
export declare const AGENT_LABELS: Record<AgentName, string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.37.1-dev-build-
|
|
3
|
+
"version": "2.37.1-dev-build-75039ab7.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"ts-morph": "^27.0.2",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"zod": "^4.6.5",
|
|
48
|
-
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-
|
|
49
|
-
"@contentful/experience-design-system-types": "2.37.1-dev-build-
|
|
48
|
+
"@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-75039ab7.0",
|
|
49
|
+
"@contentful/experience-design-system-types": "2.37.1-dev-build-75039ab7.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@tsconfig/node24": "^24.0.4",
|