@contentful/experience-design-system-cli 2.32.1-dev-build-3e401c3.0 → 2.32.1-dev-build-10912f6.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/import/orchestrator.d.ts +0 -1
- package/dist/src/import/tui/WizardApp.d.ts +1 -4
- package/dist/src/index.js +15 -110
- package/dist/src/lib/agent-model-options.d.ts +2 -5
- package/dist/src/program.d.ts +0 -6
- package/dist/src/setup/command.d.ts +6 -0
- package/package.json +6 -6
package/dist/package.json
CHANGED
|
@@ -7,7 +7,6 @@ export declare function buildSelectAgentArgs(opts: {
|
|
|
7
7
|
sessionId: string;
|
|
8
8
|
agent: string;
|
|
9
9
|
model?: string;
|
|
10
|
-
bedrock?: boolean;
|
|
11
10
|
selectPromptPath?: string;
|
|
12
11
|
noCache?: boolean;
|
|
13
12
|
}): string[];
|
|
@@ -24,7 +23,6 @@ export declare function buildGenerateComponentsArgs(opts: {
|
|
|
24
23
|
tokensPath?: string;
|
|
25
24
|
agent: string;
|
|
26
25
|
model?: string;
|
|
27
|
-
bedrock?: boolean;
|
|
28
26
|
noCache?: boolean;
|
|
29
27
|
generatePromptPath?: string;
|
|
30
28
|
}): string[];
|
|
@@ -51,7 +49,6 @@ export type WizardAppProps = {
|
|
|
51
49
|
initialHost?: string;
|
|
52
50
|
initialAgent?: string;
|
|
53
51
|
initialModel?: string;
|
|
54
|
-
bedrock?: boolean;
|
|
55
52
|
initialProjectPath?: string;
|
|
56
53
|
host?: string;
|
|
57
54
|
autoAcceptScope?: boolean;
|
|
@@ -83,4 +80,4 @@ export type WizardAppProps = {
|
|
|
83
80
|
onRunPicked?: (selection: RunPickerSelection) => void;
|
|
84
81
|
allowDeletions?: boolean;
|
|
85
82
|
};
|
|
86
|
-
export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel,
|
|
83
|
+
export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, initialProjectPath, host, autoAcceptScope, autoRejectCycles, compositionMode, compositionMap, compositionAgent, compositionAgentMode, compositionRefresh, generateMap, promptOverrides, noCache, autoFilter, livePreview, noPush, noSave, outDirOverride, onConflictMode, selectPromptPath, generatePromptPath, skipMapTokens, seedExtractSessionId, seedGenerateSessionId, seedTokenSessionId, seedTokensPath, initialStep, initialRawTokensPath, initialRuns, onRunPicked, allowDeletions, }?: WizardAppProps): React.ReactElement;
|
package/dist/src/index.js
CHANGED
|
@@ -275,70 +275,51 @@ function resolveBinary(agent) {
|
|
|
275
275
|
return override.trim();
|
|
276
276
|
return AGENT_BINARIES[agent];
|
|
277
277
|
}
|
|
278
|
-
function
|
|
279
|
-
return BEDROCK_CAPABLE_AGENTS.has(agent);
|
|
280
|
-
}
|
|
281
|
-
function resolveAgentModel(agent, explicit, bedrock = false) {
|
|
278
|
+
function resolveAgentModel(agent, explicit) {
|
|
282
279
|
if (explicit && explicit.trim())
|
|
283
280
|
return explicit.trim();
|
|
284
281
|
const override = process.env[`EDS_AGENT_MODEL_${agent.toUpperCase()}`];
|
|
285
282
|
if (override && override.trim())
|
|
286
283
|
return override.trim();
|
|
287
|
-
if (bedrock && agent === "codex")
|
|
288
|
-
return DEFAULT_CODEX_BEDROCK_MODEL;
|
|
289
|
-
if (bedrock && agent === "opencode")
|
|
290
|
-
return withBedrockProviderPrefix(DEFAULT_MODELS.opencode);
|
|
291
284
|
return DEFAULT_MODELS[agent];
|
|
292
285
|
}
|
|
293
|
-
function
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
function codexBedrockConfigArgs() {
|
|
297
|
-
const region = process.env.AWS_REGION?.trim() || process.env.AWS_DEFAULT_REGION?.trim() || DEFAULT_CODEX_BEDROCK_REGION;
|
|
298
|
-
return ["-c", "model_provider=amazon-bedrock", "-c", `model_providers.amazon-bedrock.region=${region}`];
|
|
299
|
-
}
|
|
300
|
-
function buildArgs(agent, prompt2, model, promptViaStdin = false, bedrock = false) {
|
|
301
|
-
const modelArg = ["--model", resolveAgentModel(agent, model, bedrock)];
|
|
286
|
+
function buildArgs(agent, prompt2, model, promptViaStdin = false) {
|
|
287
|
+
const resolvedModel = resolveAgentModel(agent, model);
|
|
288
|
+
const modelArg = resolvedModel ? ["--model", resolvedModel] : [];
|
|
302
289
|
const promptArg = promptViaStdin ? [] : [prompt2];
|
|
303
290
|
switch (agent) {
|
|
304
291
|
case "claude":
|
|
305
292
|
return ["--print", ...modelArg, ...promptArg];
|
|
306
|
-
case "codex":
|
|
307
|
-
|
|
308
|
-
return ["exec", ...bedrockArgs, ...modelArg, "--dangerously-bypass-approvals-and-sandbox", ...promptArg];
|
|
309
|
-
}
|
|
293
|
+
case "codex":
|
|
294
|
+
return ["exec", ...modelArg, "--dangerously-bypass-approvals-and-sandbox", ...promptArg];
|
|
310
295
|
case "opencode":
|
|
311
296
|
return ["run", ...modelArg, ...promptArg];
|
|
312
297
|
case "cursor":
|
|
313
298
|
return ["--print", ...modelArg, ...promptArg];
|
|
314
299
|
case "copilot": {
|
|
315
300
|
const copilotModel = resolveAgentModel("copilot", model);
|
|
316
|
-
const copilotModelArg = copilotModel === "Auto" ? [] : ["--model", copilotModel];
|
|
301
|
+
const copilotModelArg = !copilotModel || copilotModel === "Auto" ? [] : ["--model", copilotModel];
|
|
317
302
|
return ["-p", ...promptArg, ...copilotModelArg, "--allow-all-tools"];
|
|
318
303
|
}
|
|
319
304
|
}
|
|
320
305
|
}
|
|
321
306
|
async function runAgent(options) {
|
|
322
307
|
const { agent, prompt: prompt2, timeoutMs, model, onOutput, promptViaStdin, onDebugEvent } = options;
|
|
323
|
-
const bedrock = options.bedrock ?? process.env.EDS_BEDROCK === "1";
|
|
324
308
|
const binary = resolveBinary(agent);
|
|
325
309
|
const useStdin2 = !!promptViaStdin;
|
|
326
|
-
const args = buildArgs(agent, prompt2, model, useStdin2
|
|
310
|
+
const args = buildArgs(agent, prompt2, model, useStdin2);
|
|
327
311
|
const startedAt = Date.now();
|
|
328
312
|
onDebugEvent?.("run.start", {
|
|
329
313
|
agent,
|
|
330
314
|
binary,
|
|
331
315
|
model,
|
|
332
|
-
bedrock: !!bedrock,
|
|
333
316
|
timeoutMs,
|
|
334
317
|
promptLen: prompt2.length,
|
|
335
318
|
promptHead: prompt2.slice(0, 500)
|
|
336
319
|
});
|
|
337
320
|
return new Promise((resolve27) => {
|
|
338
|
-
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
339
321
|
const child = spawn(binary, args, {
|
|
340
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
341
|
-
...bedrockEnv ? { env: { ...process.env, ...bedrockEnv } } : {}
|
|
322
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
342
323
|
});
|
|
343
324
|
if (useStdin2 && child.stdin) {
|
|
344
325
|
child.stdin.on("error", () => {
|
|
@@ -456,7 +437,7 @@ function extractSentinelOutput(stdout) {
|
|
|
456
437
|
return "multiple";
|
|
457
438
|
return stdout.slice(startIdx + START.length, endIdx).trim();
|
|
458
439
|
}
|
|
459
|
-
var VALID_SELECT_TOOL_NAMES, VALID_TOOL_NAMES, VALID_TOKEN_TOOL_NAMES, VALID_CDF_TYPES, VALID_CATEGORIES, AGENT_BINARIES,
|
|
440
|
+
var VALID_SELECT_TOOL_NAMES, VALID_TOOL_NAMES, VALID_TOKEN_TOOL_NAMES, VALID_CDF_TYPES, VALID_CATEGORIES, AGENT_BINARIES, DEFAULT_MODELS;
|
|
460
441
|
var init_agent_runner = __esm({
|
|
461
442
|
"packages/experience-design-system-generation/dist/src/agent-runner.js"() {
|
|
462
443
|
"use strict";
|
|
@@ -473,22 +454,14 @@ var init_agent_runner = __esm({
|
|
|
473
454
|
cursor: "cursor-agent",
|
|
474
455
|
copilot: "copilot"
|
|
475
456
|
};
|
|
476
|
-
BEDROCK_ENV_BY_AGENT = {
|
|
477
|
-
claude: { CLAUDE_CODE_USE_BEDROCK: "1" }
|
|
478
|
-
};
|
|
479
|
-
BEDROCK_CAPABLE_AGENTS = /* @__PURE__ */ new Set(["claude", "codex", "opencode"]);
|
|
480
|
-
DEFAULT_CODEX_BEDROCK_REGION = "us-east-1";
|
|
481
457
|
DEFAULT_MODELS = {
|
|
482
458
|
claude: "haiku",
|
|
483
|
-
codex: "gpt-5.6-luna",
|
|
484
|
-
// requires OPENAI_API_KEY; ChatGPT account users must pass --model
|
|
485
459
|
opencode: "claude-haiku-4-5",
|
|
486
460
|
cursor: "gpt-mini",
|
|
487
461
|
// cursor alias for gpt-5.4-mini-medium; haiku not in cursor's catalog
|
|
488
462
|
copilot: "Auto"
|
|
489
463
|
// the only model guaranteed on every Copilot plan (Free/Pro/Business/Enterprise); Pro+ users override via EDS_AGENT_MODEL_COPILOT
|
|
490
464
|
};
|
|
491
|
-
DEFAULT_CODEX_BEDROCK_MODEL = "openai.gpt-5.6-luna";
|
|
492
465
|
}
|
|
493
466
|
});
|
|
494
467
|
|
|
@@ -878,7 +851,6 @@ var src_exports = {};
|
|
|
878
851
|
__export(src_exports, {
|
|
879
852
|
AGENT_NAMES: () => AGENT_NAMES,
|
|
880
853
|
DEFAULT_AGENT_NAME: () => DEFAULT_AGENT_NAME,
|
|
881
|
-
agentSupportsBedrock: () => agentSupportsBedrock,
|
|
882
854
|
buildArgs: () => buildArgs,
|
|
883
855
|
buildPrompt: () => buildPrompt,
|
|
884
856
|
checkAgentAuth: () => checkAgentAuth,
|
|
@@ -27618,7 +27590,6 @@ import { jsx as jsx52, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
|
27618
27590
|
function buildSelectAgentArgs(opts) {
|
|
27619
27591
|
const args = ["analyze", "select-agent", "--agent", opts.agent, "--session", opts.sessionId, "--exclude-invalid"];
|
|
27620
27592
|
if (opts.model) args.push("--model", opts.model);
|
|
27621
|
-
if (opts.bedrock) args.push("--bedrock");
|
|
27622
27593
|
if (opts.selectPromptPath) args.push("--select-prompt-path", opts.selectPromptPath);
|
|
27623
27594
|
if (opts.noCache) args.push("--no-cache");
|
|
27624
27595
|
return args;
|
|
@@ -27654,7 +27625,6 @@ function buildGenerateComponentsArgs(opts) {
|
|
|
27654
27625
|
const args = ["generate", "components", "--agent", opts.agent, "--session", opts.sessionId];
|
|
27655
27626
|
if (opts.tokensPath) args.push("--tokens", opts.tokensPath);
|
|
27656
27627
|
if (opts.model) args.push("--model", opts.model);
|
|
27657
|
-
if (opts.bedrock) args.push("--bedrock");
|
|
27658
27628
|
if (opts.noCache) args.push("--no-cache");
|
|
27659
27629
|
if (opts.generatePromptPath) args.push("--generate-prompt-path", opts.generatePromptPath);
|
|
27660
27630
|
return args;
|
|
@@ -27697,7 +27667,6 @@ function WizardApp({
|
|
|
27697
27667
|
initialHost,
|
|
27698
27668
|
initialAgent,
|
|
27699
27669
|
initialModel,
|
|
27700
|
-
bedrock = false,
|
|
27701
27670
|
initialProjectPath,
|
|
27702
27671
|
host,
|
|
27703
27672
|
autoAcceptScope = false,
|
|
@@ -27759,7 +27728,6 @@ function WizardApp({
|
|
|
27759
27728
|
step: modifyEntryReady || rawTokensEntryReady || pushFromPickerReady ? initialStepResolved : initialRuns && initialRuns.length > 0 ? "run-picker" : initialStepResolved,
|
|
27760
27729
|
agent: initialAgent ?? "claude",
|
|
27761
27730
|
...initialModel ? { agentModel: initialModel } : {},
|
|
27762
|
-
...bedrock ? { bedrock: true } : {},
|
|
27763
27731
|
projectPath: initialProjectPath ?? "",
|
|
27764
27732
|
outDir: initialOutDir,
|
|
27765
27733
|
rawTokensPath: rawTokensEntryReady ? initialRawTokensPath : "",
|
|
@@ -27899,7 +27867,6 @@ If you are using AWS Bedrock, run:
|
|
|
27899
27867
|
const result = await new Promise((res) => {
|
|
27900
27868
|
const tokenArgs = [findCliPath(), "generate", "tokens", "--agent", state.agent, "--raw-tokens", rawTokensPath];
|
|
27901
27869
|
if (state.agentModel) tokenArgs.push("--model", state.agentModel);
|
|
27902
|
-
if (state.bedrock) tokenArgs.push("--bedrock");
|
|
27903
27870
|
const child = spawn4("node", tokenArgs);
|
|
27904
27871
|
let stdout2 = "";
|
|
27905
27872
|
let stderr = "";
|
|
@@ -28020,7 +27987,6 @@ If you are using AWS Bedrock, run:
|
|
|
28020
27987
|
if (generateMap) extractArgs.push("--generate-map", generateMap);
|
|
28021
27988
|
for (const p of promptOverrides ?? []) extractArgs.push("--prompt", p);
|
|
28022
27989
|
if (state.agent) extractArgs.push("--agent", state.agent);
|
|
28023
|
-
if (state.bedrock) extractArgs.push("--bedrock");
|
|
28024
27990
|
}
|
|
28025
27991
|
const child = spawn4("node", extractArgs);
|
|
28026
27992
|
let stdout2 = "";
|
|
@@ -28112,7 +28078,6 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
28112
28078
|
sessionId: sessionId2,
|
|
28113
28079
|
agent: state.agent,
|
|
28114
28080
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
28115
|
-
...state.bedrock ? { bedrock: true } : {},
|
|
28116
28081
|
selectPromptPath,
|
|
28117
28082
|
noCache
|
|
28118
28083
|
});
|
|
@@ -28211,7 +28176,6 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
28211
28176
|
tokensPath,
|
|
28212
28177
|
agent: state.agent,
|
|
28213
28178
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
28214
|
-
...state.bedrock ? { bedrock: true } : {},
|
|
28215
28179
|
noCache: effectiveNoCache
|
|
28216
28180
|
})
|
|
28217
28181
|
];
|
|
@@ -28281,7 +28245,6 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
28281
28245
|
tokensPath,
|
|
28282
28246
|
agent: state.agent,
|
|
28283
28247
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
28284
|
-
...state.bedrock ? { bedrock: true } : {},
|
|
28285
28248
|
noCache: effectiveNoCache,
|
|
28286
28249
|
generatePromptPath
|
|
28287
28250
|
})
|
|
@@ -29789,15 +29752,12 @@ import { isAbsolute as isAbsolute4, join as join15, relative as relative3, resol
|
|
|
29789
29752
|
init_src();
|
|
29790
29753
|
var AGENT_DESCRIPTION = `Agent to use: ${AGENT_NAMES.join(", ")} (defaults to value saved by experiences setup)`;
|
|
29791
29754
|
var MODEL_DESCRIPTION = "Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)";
|
|
29792
|
-
var BEDROCK_AGENTS = AGENT_NAMES.filter((agent) => agentSupportsBedrock(agent)).join(", ");
|
|
29793
|
-
var BEDROCK_DESCRIPTION = `Route the selected agent through AWS Bedrock instead of its default model provider (requires AWS credentials in the environment: AWS_PROFILE, or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN, plus AWS_REGION). Only supported by agents with a Bedrock routing mechanism (currently: ${BEDROCK_AGENTS}).`;
|
|
29794
29755
|
function addAgentModelOptions(cmd, config = {}) {
|
|
29795
29756
|
const { agentDescription = AGENT_DESCRIPTION, includeModel = true, modelDescription = MODEL_DESCRIPTION } = config;
|
|
29796
29757
|
cmd.option("--agent <name>", agentDescription);
|
|
29797
29758
|
if (includeModel) {
|
|
29798
29759
|
cmd.option("--model <name>", modelDescription);
|
|
29799
29760
|
}
|
|
29800
|
-
cmd.option("--bedrock", BEDROCK_DESCRIPTION);
|
|
29801
29761
|
return cmd;
|
|
29802
29762
|
}
|
|
29803
29763
|
|
|
@@ -30586,12 +30546,6 @@ function registerAnalyzeSelectAgentCommand(program) {
|
|
|
30586
30546
|
return;
|
|
30587
30547
|
}
|
|
30588
30548
|
const agent = agentName;
|
|
30589
|
-
if (opts.bedrock && !agentSupportsBedrock(agent)) {
|
|
30590
|
-
process.stderr.write(`Error: --bedrock is not supported for --agent ${agent}
|
|
30591
|
-
`);
|
|
30592
|
-
await exitWithAnalytics(1);
|
|
30593
|
-
return;
|
|
30594
|
-
}
|
|
30595
30549
|
const selectPromptPath = opts.selectPromptPath ?? savedCreds.selectPromptPath;
|
|
30596
30550
|
if (selectPromptPath) {
|
|
30597
30551
|
const resolvedPath = resolve12(selectPromptPath);
|
|
@@ -31835,14 +31789,6 @@ function registerAnalyzeCommand(program) {
|
|
|
31835
31789
|
}
|
|
31836
31790
|
return v;
|
|
31837
31791
|
})();
|
|
31838
|
-
if (opts.bedrock) {
|
|
31839
|
-
const bedrockAgent = resolveCompositionAgentName(opts.agent);
|
|
31840
|
-
if (!agentSupportsBedrock(bedrockAgent)) {
|
|
31841
|
-
process.stderr.write(`Error: --bedrock is not supported for --agent ${bedrockAgent}
|
|
31842
|
-
`);
|
|
31843
|
-
process.exit(1);
|
|
31844
|
-
}
|
|
31845
|
-
}
|
|
31846
31792
|
const projectRoot = resolve15(opts.project);
|
|
31847
31793
|
const outDir = join15(projectRoot, ".contentful");
|
|
31848
31794
|
let sourceDirectory;
|
|
@@ -32689,9 +32635,6 @@ async function runGenerateSkill(skill, opts, verbose = false) {
|
|
|
32689
32635
|
);
|
|
32690
32636
|
}
|
|
32691
32637
|
const agent = agentName;
|
|
32692
|
-
if (opts.bedrock && !agentSupportsBedrock(agent)) {
|
|
32693
|
-
die2(`Error: --bedrock is not supported for --agent ${agent}`);
|
|
32694
|
-
}
|
|
32695
32638
|
const generatePromptPath = skill === "components" ? opts.generatePromptPath ?? savedCreds.generatePromptPath : void 0;
|
|
32696
32639
|
if (generatePromptPath) {
|
|
32697
32640
|
if (!await pathExists3(resolve17(generatePromptPath))) {
|
|
@@ -34356,7 +34299,6 @@ function registerMapTokensCommand(program) {
|
|
|
34356
34299
|
}
|
|
34357
34300
|
|
|
34358
34301
|
// packages/experience-design-system-cli/src/import/command.ts
|
|
34359
|
-
init_src();
|
|
34360
34302
|
init_path_utils();
|
|
34361
34303
|
import { resolve as resolve25, join as join25 } from "node:path";
|
|
34362
34304
|
|
|
@@ -34512,7 +34454,6 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
|
|
|
34512
34454
|
if (opts.generateMap) analyzeArgs.push("--generate-map", opts.generateMap);
|
|
34513
34455
|
for (const p of opts.promptOverrides ?? []) analyzeArgs.push("--prompt", p);
|
|
34514
34456
|
if (opts.agent) analyzeArgs.push("--agent", opts.agent);
|
|
34515
|
-
if (opts.bedrock) analyzeArgs.push("--bedrock");
|
|
34516
34457
|
}
|
|
34517
34458
|
const r = await runStep(analyzeArgs, cliPath, sessionId2);
|
|
34518
34459
|
const durationMs = Date.now() - t0;
|
|
@@ -34563,7 +34504,6 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
|
|
|
34563
34504
|
if (useAgentSelect) {
|
|
34564
34505
|
editArgs = ["analyze", "select-agent", "--session", extractSessionId, "--agent", opts.agent];
|
|
34565
34506
|
if (opts.model) editArgs.push("--model", opts.model);
|
|
34566
|
-
if (opts.bedrock) editArgs.push("--bedrock");
|
|
34567
34507
|
if (opts.excludeInvalid) editArgs.push("--exclude-invalid");
|
|
34568
34508
|
if (opts.noCache) editArgs.push("--no-cache");
|
|
34569
34509
|
if (opts.selectPromptPath) editArgs.push("--select-prompt-path", opts.selectPromptPath);
|
|
@@ -34625,7 +34565,6 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
|
|
|
34625
34565
|
const generateLabel = stepLabel("Categorizing component props");
|
|
34626
34566
|
const generateArgs = ["generate", "components", "--agent", opts.agent];
|
|
34627
34567
|
if (opts.model) generateArgs.push("--model", opts.model);
|
|
34628
|
-
if (opts.bedrock) generateArgs.push("--bedrock");
|
|
34629
34568
|
if (extractSessionId) generateArgs.push("--session", extractSessionId);
|
|
34630
34569
|
if (opts.dryRun) generateArgs.push("--dry-run");
|
|
34631
34570
|
if (opts.verbose) generateArgs.push("--verbose");
|
|
@@ -35656,11 +35595,6 @@ function registerImportCommand(program) {
|
|
|
35656
35595
|
const resolvedAgent = resolveAgent(opts.agent, creds.agent);
|
|
35657
35596
|
const resolvedModel = resolveModel(opts.model, creds.agentModel);
|
|
35658
35597
|
const resolvedCompositionMode = resolveCompositionMode(opts, creds.compositionMode);
|
|
35659
|
-
if (opts.bedrock && !(isAgentName(resolvedAgent) && agentSupportsBedrock(resolvedAgent))) {
|
|
35660
|
-
process.stderr.write(`Error: --bedrock is not supported for --agent ${resolvedAgent}
|
|
35661
|
-
`);
|
|
35662
|
-
process.exit(1);
|
|
35663
|
-
}
|
|
35664
35598
|
const pickerDecision = await shouldShowRunPicker({
|
|
35665
35599
|
flags: {
|
|
35666
35600
|
...opts.pushFromRun !== void 0 ? { pushFromRun: opts.pushFromRun } : {},
|
|
@@ -35689,7 +35623,6 @@ function registerImportCommand(program) {
|
|
|
35689
35623
|
initialHost: toConfiguredHost(opts.host ?? creds.host) ?? DEFAULT_CONFIGURED_HOST,
|
|
35690
35624
|
initialAgent: resolvedAgent,
|
|
35691
35625
|
...resolvedModel ? { initialModel: resolvedModel } : {},
|
|
35692
|
-
...opts.bedrock ? { bedrock: true } : {},
|
|
35693
35626
|
initialProjectPath: opts.project !== "." ? normalizePath(opts.project) : void 0,
|
|
35694
35627
|
host: opts.host,
|
|
35695
35628
|
autoAcceptScope,
|
|
@@ -35753,11 +35686,6 @@ function registerImportCommand(program) {
|
|
|
35753
35686
|
const headlessAgent = resolveAgent(opts.agent, headlessCreds.agent);
|
|
35754
35687
|
const headlessModel = resolveModel(opts.model, headlessCreds.agentModel);
|
|
35755
35688
|
const headlessCompositionMode = resolveCompositionMode(opts, headlessCreds.compositionMode);
|
|
35756
|
-
if (opts.bedrock && !(isAgentName(headlessAgent) && agentSupportsBedrock(headlessAgent))) {
|
|
35757
|
-
process.stderr.write(`Error: --bedrock is not supported for --agent ${headlessAgent}
|
|
35758
|
-
`);
|
|
35759
|
-
process.exit(1);
|
|
35760
|
-
}
|
|
35761
35689
|
const result = await runPipeline(
|
|
35762
35690
|
{
|
|
35763
35691
|
project: projectRoot,
|
|
@@ -35767,7 +35695,6 @@ function registerImportCommand(program) {
|
|
|
35767
35695
|
cmaToken,
|
|
35768
35696
|
agent: headlessAgent,
|
|
35769
35697
|
model: headlessModel,
|
|
35770
|
-
...opts.bedrock ? { bedrock: true } : {},
|
|
35771
35698
|
tokens: opts.tokens,
|
|
35772
35699
|
selectAll: opts.selectAll,
|
|
35773
35700
|
select: opts.select.length > 0 ? opts.select : void 0,
|
|
@@ -36169,26 +36096,15 @@ function pick(items, defaultIdx = 0) {
|
|
|
36169
36096
|
process.stdout.write(` \x1B[2m[s] Skip\x1B[0m
|
|
36170
36097
|
`);
|
|
36171
36098
|
}
|
|
36172
|
-
async function promptCodexModel() {
|
|
36099
|
+
async function promptCodexModel(ask = prompt) {
|
|
36173
36100
|
if (process.env["OPENAI_API_KEY"]) return void 0;
|
|
36174
36101
|
info("");
|
|
36175
36102
|
process.stdout.write(` \x1B[33m\u26A0\x1B[0m No OPENAI_API_KEY \u2014 using ChatGPT account authentication.
|
|
36176
36103
|
`);
|
|
36177
|
-
info(" Tip: run \x1B[1mcodex\x1B[0m then type \x1B[1m/model\x1B[0m to browse
|
|
36178
|
-
|
|
36179
|
-
|
|
36180
|
-
|
|
36181
|
-
pick([
|
|
36182
|
-
{ label: "gpt-5.4-mini", description: "fast, lower cost" },
|
|
36183
|
-
{ label: "gpt-5.5", description: "most capable" },
|
|
36184
|
-
{ label: "gpt-5.4" }
|
|
36185
|
-
]);
|
|
36186
|
-
info("");
|
|
36187
|
-
const choice = await prompt(" \x1B[2m\u203A\x1B[0m Your choice [1]: ");
|
|
36188
|
-
if (choice === "1" || choice === "") return "gpt-5.4-mini";
|
|
36189
|
-
if (choice === "2") return "gpt-5.5";
|
|
36190
|
-
if (choice === "3") return "gpt-5.4";
|
|
36191
|
-
return void 0;
|
|
36104
|
+
info(" Tip: run \x1B[1mcodex\x1B[0m then type \x1B[1m/model\x1B[0m to browse the models available to your account.");
|
|
36105
|
+
const model = await ask(" Model name (optional - press Enter for Codex default): ");
|
|
36106
|
+
const trimmed = model.trim();
|
|
36107
|
+
return trimmed || void 0;
|
|
36192
36108
|
}
|
|
36193
36109
|
async function setupAgent() {
|
|
36194
36110
|
section("Step 4: Coding agent (claude, codex, opencode, or copilot)", "[required]");
|
|
@@ -36215,7 +36131,6 @@ async function setupAgent() {
|
|
|
36215
36131
|
const parsed = choice2 === "" ? 1 : parseInt(choice2, 10);
|
|
36216
36132
|
const idx = Number.isNaN(parsed) || parsed < 1 || parsed > found.length ? 0 : parsed - 1;
|
|
36217
36133
|
const selected = found[idx];
|
|
36218
|
-
ok(`${selected.name} \x1B[2m(${selected.binary})\x1B[0m selected`);
|
|
36219
36134
|
const agentModel = selected.binary === "codex" ? await promptCodexModel() : void 0;
|
|
36220
36135
|
return { agent: selected.binary, agentModel };
|
|
36221
36136
|
}
|
|
@@ -36905,13 +36820,6 @@ async function runBuild(opts) {
|
|
|
36905
36820
|
child.on("exit", (code) => settle(code ?? 1));
|
|
36906
36821
|
});
|
|
36907
36822
|
}
|
|
36908
|
-
function resolveBedrockFromAncestors(actionCommand) {
|
|
36909
|
-
for (let c2 = actionCommand; c2; c2 = c2.parent) {
|
|
36910
|
-
const opts = c2.opts();
|
|
36911
|
-
if (opts.bedrock) return true;
|
|
36912
|
-
}
|
|
36913
|
-
return false;
|
|
36914
|
-
}
|
|
36915
36823
|
function registerImportV2Command(program) {
|
|
36916
36824
|
program.command("importv2").description("Launch the v2 import TUI (experience-design-system-cli-v2)").action(async () => {
|
|
36917
36825
|
const { render: render7 } = await import("ink");
|
|
@@ -36959,9 +36867,6 @@ function createProgram() {
|
|
|
36959
36867
|
break;
|
|
36960
36868
|
}
|
|
36961
36869
|
}
|
|
36962
|
-
if (resolveBedrockFromAncestors(actionCommand)) {
|
|
36963
|
-
process.env.EDS_BEDROCK = "1";
|
|
36964
|
-
}
|
|
36965
36870
|
const chain = [];
|
|
36966
36871
|
for (let c2 = actionCommand; c2 && c2.parent; c2 = c2.parent) chain.unshift(c2.name());
|
|
36967
36872
|
const commandChain = chain.join(" ") || actionCommand.name();
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
2
|
export declare const AGENT_DESCRIPTION: string;
|
|
3
3
|
export declare const MODEL_DESCRIPTION = "Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)";
|
|
4
|
-
export declare const BEDROCK_DESCRIPTION: string;
|
|
5
4
|
export interface AgentModelOptionsConfig {
|
|
6
5
|
agentDescription?: string;
|
|
7
6
|
includeModel?: boolean;
|
|
8
7
|
modelDescription?: string;
|
|
9
8
|
}
|
|
10
9
|
/**
|
|
11
|
-
* Register --agent
|
|
12
|
-
*
|
|
13
|
-
* independent of model selection (it's a routing switch, not a model choice)
|
|
14
|
-
* and is always registered alongside --agent.
|
|
10
|
+
* Register --agent and optionally --model flags to a Commander command, with customizable descriptions.
|
|
11
|
+
* Pass `includeModel: false` for commands where the model dimension is not applicable (e.g., mapping-resolution agents that select an agent for logic, not model choice).
|
|
15
12
|
*/
|
|
16
13
|
export declare function addAgentModelOptions(cmd: Command, config?: AgentModelOptionsConfig): Command;
|
package/dist/src/program.d.ts
CHANGED
|
@@ -15,11 +15,5 @@ export declare function runBuild(opts: {
|
|
|
15
15
|
}): Promise<{
|
|
16
16
|
exitCode: number;
|
|
17
17
|
}>;
|
|
18
|
-
/**
|
|
19
|
-
* Walks `actionCommand` and its ancestors for a truthy `--bedrock`. --bedrock
|
|
20
|
-
* is registered per-subcommand (not at program scope, unlike --debug), so a
|
|
21
|
-
* root-level or subcommand-level setting can each carry it.
|
|
22
|
-
*/
|
|
23
|
-
export declare function resolveBedrockFromAncestors(actionCommand: Command): boolean;
|
|
24
18
|
export declare function createProgram(): Command;
|
|
25
19
|
export {};
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { Command } from 'commander';
|
|
2
|
+
import type { AgentName } from '@contentful/experience-design-system-generation';
|
|
3
|
+
export declare function promptCodexModel(ask?: (q: string) => Promise<string>): Promise<string | undefined>;
|
|
4
|
+
export declare function setupAgent(): Promise<{
|
|
5
|
+
agent: AgentName | undefined;
|
|
6
|
+
agentModel: string | undefined;
|
|
7
|
+
}>;
|
|
2
8
|
export type SkillPromptKind = 'select' | 'generate';
|
|
3
9
|
/**
|
|
4
10
|
* Prompt the operator for a custom skill prompt path. Returns the resolved
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.32.1-dev-build-
|
|
3
|
+
"version": "2.32.1-dev-build-10912f6.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"svelte": "^5.56.4",
|
|
40
40
|
"ts-morph": "^27.0.2",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
|
-
"@contentful/experience-design-system-cli-v2": "2.32.1-dev-build-
|
|
43
|
-
"@contentful/experience-design-system-types": "2.32.1-dev-build-
|
|
42
|
+
"@contentful/experience-design-system-cli-v2": "2.32.1-dev-build-10912f6.0",
|
|
43
|
+
"@contentful/experience-design-system-types": "2.32.1-dev-build-10912f6.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"ink-testing-library": "^4.0.0",
|
|
53
53
|
"typescript-eslint": "^8.67.0",
|
|
54
54
|
"vitest": "^4.0.16",
|
|
55
|
-
"@contentful/experience-design-system-client": "2.32.1-dev-build-
|
|
56
|
-
"@contentful/experience-design-system-
|
|
57
|
-
"@contentful/experience-design-system-
|
|
55
|
+
"@contentful/experience-design-system-client": "2.32.1-dev-build-10912f6.0",
|
|
56
|
+
"@contentful/experience-design-system-extraction": "2.32.1-dev-build-10912f6.0",
|
|
57
|
+
"@contentful/experience-design-system-generation": "2.32.1-dev-build-10912f6.0"
|
|
58
58
|
},
|
|
59
59
|
"repository": {
|
|
60
60
|
"type": "git",
|