@contentful/experience-design-system-cli 2.27.4 → 2.27.5-dev-build-fa61a4f.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
CHANGED
|
@@ -7,6 +7,7 @@ export declare function buildSelectAgentArgs(opts: {
|
|
|
7
7
|
sessionId: string;
|
|
8
8
|
agent: string;
|
|
9
9
|
model?: string;
|
|
10
|
+
bedrock?: boolean;
|
|
10
11
|
selectPromptPath?: string;
|
|
11
12
|
noCache?: boolean;
|
|
12
13
|
}): string[];
|
|
@@ -23,6 +24,7 @@ export declare function buildGenerateComponentsArgs(opts: {
|
|
|
23
24
|
tokensPath?: string;
|
|
24
25
|
agent: string;
|
|
25
26
|
model?: string;
|
|
27
|
+
bedrock?: boolean;
|
|
26
28
|
noCache?: boolean;
|
|
27
29
|
generatePromptPath?: string;
|
|
28
30
|
}): string[];
|
|
@@ -38,6 +40,7 @@ export type WizardAppProps = {
|
|
|
38
40
|
initialHost?: string;
|
|
39
41
|
initialAgent?: string;
|
|
40
42
|
initialModel?: string;
|
|
43
|
+
bedrock?: boolean;
|
|
41
44
|
initialProjectPath?: string;
|
|
42
45
|
host?: string;
|
|
43
46
|
autoAcceptScope?: boolean;
|
|
@@ -68,4 +71,4 @@ export type WizardAppProps = {
|
|
|
68
71
|
onRunPicked?: (selection: RunPickerSelection) => void;
|
|
69
72
|
allowDeletions?: boolean;
|
|
70
73
|
};
|
|
71
|
-
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, seedExtractSessionId, seedGenerateSessionId, seedTokenSessionId, seedTokensPath, initialStep, initialRawTokensPath, initialRuns, onRunPicked, allowDeletions, }?: WizardAppProps): React.ReactElement;
|
|
74
|
+
export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, bedrock, initialProjectPath, host, autoAcceptScope, autoRejectCycles, compositionMode, compositionMap, compositionAgent, compositionAgentMode, compositionRefresh, generateMap, promptOverrides, noCache, autoFilter, livePreview, noPush, noSave, outDirOverride, onConflictMode, selectPromptPath, generatePromptPath, seedExtractSessionId, seedGenerateSessionId, seedTokenSessionId, seedTokensPath, initialStep, initialRawTokensPath, initialRuns, onRunPicked, allowDeletions, }?: WizardAppProps): React.ReactElement;
|
package/dist/src/index.js
CHANGED
|
@@ -231,6 +231,9 @@ function resolveBinary(agent) {
|
|
|
231
231
|
return override.trim();
|
|
232
232
|
return AGENT_BINARIES[agent];
|
|
233
233
|
}
|
|
234
|
+
function agentSupportsBedrock(agent) {
|
|
235
|
+
return agent in BEDROCK_ENV_BY_AGENT;
|
|
236
|
+
}
|
|
234
237
|
function resolveAgentModel(agent, explicit) {
|
|
235
238
|
if (explicit && explicit.trim())
|
|
236
239
|
return explicit.trim();
|
|
@@ -255,6 +258,7 @@ function buildArgs(agent, prompt2, model, promptViaStdin = false) {
|
|
|
255
258
|
}
|
|
256
259
|
async function runAgent(options) {
|
|
257
260
|
const { agent, prompt: prompt2, timeoutMs, model, onOutput, promptViaStdin, onDebugEvent } = options;
|
|
261
|
+
const bedrock = options.bedrock ?? process.env.EDS_BEDROCK === "1";
|
|
258
262
|
const binary = resolveBinary(agent);
|
|
259
263
|
const useStdin2 = !!promptViaStdin;
|
|
260
264
|
const args = buildArgs(agent, prompt2, model, useStdin2);
|
|
@@ -263,13 +267,16 @@ async function runAgent(options) {
|
|
|
263
267
|
agent,
|
|
264
268
|
binary,
|
|
265
269
|
model,
|
|
270
|
+
bedrock: !!bedrock,
|
|
266
271
|
timeoutMs,
|
|
267
272
|
promptLen: prompt2.length,
|
|
268
273
|
promptHead: prompt2.slice(0, 500)
|
|
269
274
|
});
|
|
270
275
|
return new Promise((resolve27) => {
|
|
276
|
+
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
271
277
|
const child = spawn(binary, args, {
|
|
272
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
278
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
279
|
+
...bedrockEnv ? { env: { ...process.env, ...bedrockEnv } } : {}
|
|
273
280
|
});
|
|
274
281
|
if (useStdin2 && child.stdin) {
|
|
275
282
|
child.stdin.on("error", () => {
|
|
@@ -387,7 +394,7 @@ function extractSentinelOutput(stdout) {
|
|
|
387
394
|
return "multiple";
|
|
388
395
|
return stdout.slice(startIdx + START.length, endIdx).trim();
|
|
389
396
|
}
|
|
390
|
-
var VALID_SELECT_TOOL_NAMES, VALID_TOOL_NAMES, VALID_TOKEN_TOOL_NAMES, VALID_CDF_TYPES, VALID_CATEGORIES, AGENT_BINARIES, DEFAULT_MODELS;
|
|
397
|
+
var VALID_SELECT_TOOL_NAMES, VALID_TOOL_NAMES, VALID_TOKEN_TOOL_NAMES, VALID_CDF_TYPES, VALID_CATEGORIES, AGENT_BINARIES, BEDROCK_ENV_BY_AGENT, DEFAULT_MODELS;
|
|
391
398
|
var init_agent_runner = __esm({
|
|
392
399
|
"packages/experience-design-system-generation/dist/src/agent-runner.js"() {
|
|
393
400
|
"use strict";
|
|
@@ -403,6 +410,9 @@ var init_agent_runner = __esm({
|
|
|
403
410
|
opencode: "opencode",
|
|
404
411
|
cursor: "cursor-agent"
|
|
405
412
|
};
|
|
413
|
+
BEDROCK_ENV_BY_AGENT = {
|
|
414
|
+
claude: { CLAUDE_CODE_USE_BEDROCK: "1" }
|
|
415
|
+
};
|
|
406
416
|
DEFAULT_MODELS = {
|
|
407
417
|
claude: "haiku",
|
|
408
418
|
codex: "gpt-5.4-mini",
|
|
@@ -671,6 +681,7 @@ var src_exports = {};
|
|
|
671
681
|
__export(src_exports, {
|
|
672
682
|
AGENT_NAMES: () => AGENT_NAMES,
|
|
673
683
|
DEFAULT_AGENT_NAME: () => DEFAULT_AGENT_NAME,
|
|
684
|
+
agentSupportsBedrock: () => agentSupportsBedrock,
|
|
674
685
|
buildArgs: () => buildArgs,
|
|
675
686
|
buildPrompt: () => buildPrompt,
|
|
676
687
|
checkAgentAuth: () => checkAgentAuth,
|
|
@@ -26539,6 +26550,7 @@ import { jsx as jsx50, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
|
26539
26550
|
function buildSelectAgentArgs(opts) {
|
|
26540
26551
|
const args = ["analyze", "select-agent", "--agent", opts.agent, "--session", opts.sessionId, "--exclude-invalid"];
|
|
26541
26552
|
if (opts.model) args.push("--model", opts.model);
|
|
26553
|
+
if (opts.bedrock) args.push("--bedrock");
|
|
26542
26554
|
if (opts.selectPromptPath) args.push("--select-prompt-path", opts.selectPromptPath);
|
|
26543
26555
|
if (opts.noCache) args.push("--no-cache");
|
|
26544
26556
|
return args;
|
|
@@ -26574,6 +26586,7 @@ function buildGenerateComponentsArgs(opts) {
|
|
|
26574
26586
|
const args = ["generate", "components", "--agent", opts.agent, "--session", opts.sessionId];
|
|
26575
26587
|
if (opts.tokensPath) args.push("--tokens", opts.tokensPath);
|
|
26576
26588
|
if (opts.model) args.push("--model", opts.model);
|
|
26589
|
+
if (opts.bedrock) args.push("--bedrock");
|
|
26577
26590
|
if (opts.noCache) args.push("--no-cache");
|
|
26578
26591
|
if (opts.generatePromptPath) args.push("--generate-prompt-path", opts.generatePromptPath);
|
|
26579
26592
|
return args;
|
|
@@ -26606,6 +26619,7 @@ function WizardApp({
|
|
|
26606
26619
|
initialHost,
|
|
26607
26620
|
initialAgent,
|
|
26608
26621
|
initialModel,
|
|
26622
|
+
bedrock = false,
|
|
26609
26623
|
initialProjectPath,
|
|
26610
26624
|
host,
|
|
26611
26625
|
autoAcceptScope = false,
|
|
@@ -26666,6 +26680,7 @@ function WizardApp({
|
|
|
26666
26680
|
step: modifyEntryReady || rawTokensEntryReady || pushFromPickerReady ? initialStepResolved : initialRuns && initialRuns.length > 0 ? "run-picker" : initialStepResolved,
|
|
26667
26681
|
agent: initialAgent ?? "claude",
|
|
26668
26682
|
...initialModel ? { agentModel: initialModel } : {},
|
|
26683
|
+
...bedrock ? { bedrock: true } : {},
|
|
26669
26684
|
projectPath: initialProjectPath ?? "",
|
|
26670
26685
|
outDir: initialOutDir,
|
|
26671
26686
|
rawTokensPath: rawTokensEntryReady ? initialRawTokensPath : "",
|
|
@@ -26804,6 +26819,7 @@ If you are using AWS Bedrock, run:
|
|
|
26804
26819
|
const result = await new Promise((res) => {
|
|
26805
26820
|
const tokenArgs = [findCliPath(), "generate", "tokens", "--agent", state.agent, "--raw-tokens", rawTokensPath];
|
|
26806
26821
|
if (state.agentModel) tokenArgs.push("--model", state.agentModel);
|
|
26822
|
+
if (state.bedrock) tokenArgs.push("--bedrock");
|
|
26807
26823
|
const child = spawn4("node", tokenArgs);
|
|
26808
26824
|
let stdout2 = "";
|
|
26809
26825
|
let stderr = "";
|
|
@@ -26870,6 +26886,7 @@ If you are using AWS Bedrock, run:
|
|
|
26870
26886
|
if (generateMap) extractArgs.push("--generate-map", generateMap);
|
|
26871
26887
|
for (const p of promptOverrides ?? []) extractArgs.push("--prompt", p);
|
|
26872
26888
|
if (state.agent) extractArgs.push("--agent", state.agent);
|
|
26889
|
+
if (state.bedrock) extractArgs.push("--bedrock");
|
|
26873
26890
|
}
|
|
26874
26891
|
const child = spawn4("node", extractArgs);
|
|
26875
26892
|
let stdout2 = "";
|
|
@@ -26961,6 +26978,7 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
26961
26978
|
sessionId: sessionId2,
|
|
26962
26979
|
agent: state.agent,
|
|
26963
26980
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
26981
|
+
...state.bedrock ? { bedrock: true } : {},
|
|
26964
26982
|
selectPromptPath,
|
|
26965
26983
|
noCache
|
|
26966
26984
|
});
|
|
@@ -27059,6 +27077,7 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
27059
27077
|
tokensPath,
|
|
27060
27078
|
agent: state.agent,
|
|
27061
27079
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
27080
|
+
...state.bedrock ? { bedrock: true } : {},
|
|
27062
27081
|
noCache: effectiveNoCache
|
|
27063
27082
|
})
|
|
27064
27083
|
];
|
|
@@ -27128,6 +27147,7 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
27128
27147
|
tokensPath,
|
|
27129
27148
|
agent: state.agent,
|
|
27130
27149
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
27150
|
+
...state.bedrock ? { bedrock: true } : {},
|
|
27131
27151
|
noCache: effectiveNoCache,
|
|
27132
27152
|
generatePromptPath
|
|
27133
27153
|
})
|
|
@@ -28616,12 +28636,15 @@ import { isAbsolute as isAbsolute4, join as join15, relative as relative3, resol
|
|
|
28616
28636
|
init_src();
|
|
28617
28637
|
var AGENT_DESCRIPTION = `Agent to use: ${AGENT_NAMES.join(", ")} (defaults to value saved by experiences setup)`;
|
|
28618
28638
|
var MODEL_DESCRIPTION = "Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)";
|
|
28639
|
+
var BEDROCK_AGENTS = AGENT_NAMES.filter((agent) => agentSupportsBedrock(agent)).join(", ");
|
|
28640
|
+
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}).`;
|
|
28619
28641
|
function addAgentModelOptions(cmd, config = {}) {
|
|
28620
28642
|
const { agentDescription = AGENT_DESCRIPTION, includeModel = true, modelDescription = MODEL_DESCRIPTION } = config;
|
|
28621
28643
|
cmd.option("--agent <name>", agentDescription);
|
|
28622
28644
|
if (includeModel) {
|
|
28623
28645
|
cmd.option("--model <name>", modelDescription);
|
|
28624
28646
|
}
|
|
28647
|
+
cmd.option("--bedrock", BEDROCK_DESCRIPTION);
|
|
28625
28648
|
return cmd;
|
|
28626
28649
|
}
|
|
28627
28650
|
|
|
@@ -29176,7 +29199,7 @@ function resolveProjectRoot(sessionId2, projectRootFlag) {
|
|
|
29176
29199
|
db.close();
|
|
29177
29200
|
}
|
|
29178
29201
|
}
|
|
29179
|
-
async function selectBatch(agent, model, batch, total, verbose, skillPathOverride) {
|
|
29202
|
+
async function selectBatch(agent, model, bedrock, batch, total, verbose, skillPathOverride) {
|
|
29180
29203
|
const prompt2 = await buildPrompt({
|
|
29181
29204
|
skill: "select",
|
|
29182
29205
|
mode: "autonomous",
|
|
@@ -29195,6 +29218,7 @@ async function selectBatch(agent, model, batch, total, verbose, skillPathOverrid
|
|
|
29195
29218
|
const result = await invoker.invoke({
|
|
29196
29219
|
agent,
|
|
29197
29220
|
model,
|
|
29221
|
+
bedrock,
|
|
29198
29222
|
prompt: prompt2,
|
|
29199
29223
|
timeoutMs: DEFAULT_TIMEOUT_MS,
|
|
29200
29224
|
onOutput: (chunk) => formatter.push(chunk)
|
|
@@ -29281,7 +29305,7 @@ ${outputBuf}`);
|
|
|
29281
29305
|
}
|
|
29282
29306
|
return results;
|
|
29283
29307
|
}
|
|
29284
|
-
async function selectAllComponents(agent, model, components, verbose, skillPathOverride, cacheConfig = { noCache: true }) {
|
|
29308
|
+
async function selectAllComponents(agent, model, bedrock, components, verbose, skillPathOverride, cacheConfig = { noCache: true }) {
|
|
29285
29309
|
const concurrency = Number(process.env.EDS_GENERATE_CONCURRENCY ?? DEFAULT_CONCURRENCY);
|
|
29286
29310
|
const batchSize = resolveBatchSize();
|
|
29287
29311
|
const total = components.length;
|
|
@@ -29346,7 +29370,7 @@ async function selectAllComponents(agent, model, components, verbose, skillPathO
|
|
|
29346
29370
|
while (nextBatch < batches.length) {
|
|
29347
29371
|
const b = nextBatch++;
|
|
29348
29372
|
const batch = batches[b];
|
|
29349
|
-
const batchResults = await selectBatch(agent, model, batch, total, verbose, skillPathOverride);
|
|
29373
|
+
const batchResults = await selectBatch(agent, model, bedrock, batch, total, verbose, skillPathOverride);
|
|
29350
29374
|
for (let k = 0; k < batch.length; k++) {
|
|
29351
29375
|
results[batch[k].index] = batchResults[k];
|
|
29352
29376
|
}
|
|
@@ -29410,6 +29434,12 @@ function registerAnalyzeSelectAgentCommand(program) {
|
|
|
29410
29434
|
return;
|
|
29411
29435
|
}
|
|
29412
29436
|
const agent = agentName;
|
|
29437
|
+
if (opts.bedrock && !agentSupportsBedrock(agent)) {
|
|
29438
|
+
process.stderr.write(`Error: --bedrock is not supported for --agent ${agent}
|
|
29439
|
+
`);
|
|
29440
|
+
await exitWithAnalytics(1);
|
|
29441
|
+
return;
|
|
29442
|
+
}
|
|
29413
29443
|
const selectPromptPath = opts.selectPromptPath ?? savedCreds.selectPromptPath;
|
|
29414
29444
|
if (selectPromptPath) {
|
|
29415
29445
|
const resolvedPath = resolve12(selectPromptPath);
|
|
@@ -29508,6 +29538,7 @@ function registerAnalyzeSelectAgentCommand(program) {
|
|
|
29508
29538
|
const selectResults = await selectAllComponents(
|
|
29509
29539
|
agent,
|
|
29510
29540
|
model,
|
|
29541
|
+
opts.bedrock,
|
|
29511
29542
|
selectionCandidates,
|
|
29512
29543
|
opts.verbose ?? false,
|
|
29513
29544
|
selectPromptPath ? resolve12(selectPromptPath) : void 0,
|
|
@@ -30653,6 +30684,14 @@ function registerAnalyzeCommand(program) {
|
|
|
30653
30684
|
}
|
|
30654
30685
|
return v;
|
|
30655
30686
|
})();
|
|
30687
|
+
if (opts.bedrock) {
|
|
30688
|
+
const bedrockAgent = resolveCompositionAgentName(opts.agent);
|
|
30689
|
+
if (!agentSupportsBedrock(bedrockAgent)) {
|
|
30690
|
+
process.stderr.write(`Error: --bedrock is not supported for --agent ${bedrockAgent}
|
|
30691
|
+
`);
|
|
30692
|
+
process.exit(1);
|
|
30693
|
+
}
|
|
30694
|
+
}
|
|
30656
30695
|
const projectRoot = resolve15(opts.project);
|
|
30657
30696
|
const outDir = join15(projectRoot, ".contentful");
|
|
30658
30697
|
let sourceDirectory;
|
|
@@ -30799,6 +30838,7 @@ function registerAnalyzeCommand(program) {
|
|
|
30799
30838
|
prompt: prompt2,
|
|
30800
30839
|
timeoutMs: 12e4,
|
|
30801
30840
|
promptViaStdin: true,
|
|
30841
|
+
bedrock: opts.bedrock,
|
|
30802
30842
|
onDebugEvent: (name, payload) => getDebugLogger().event("agent", name, payload)
|
|
30803
30843
|
});
|
|
30804
30844
|
lastAgentExitCode = res.exitCode;
|
|
@@ -31267,7 +31307,7 @@ function printFallbackInstructions(options) {
|
|
|
31267
31307
|
lines.push(` Re-run the generate command with the agent available, or use --dry-run to inspect the prompt.`);
|
|
31268
31308
|
process.stderr.write(lines.join("\n") + "\n");
|
|
31269
31309
|
}
|
|
31270
|
-
async function runOneComponent(agent, model, db, sessionId2, component, tokensInline, tokenMapInline, index, total, verbose, noCache, skillPathOverride, promptHash) {
|
|
31310
|
+
async function runOneComponent(agent, model, bedrock, db, sessionId2, component, tokensInline, tokenMapInline, index, total, verbose, noCache, skillPathOverride, promptHash) {
|
|
31271
31311
|
const pos = c.dim(`[${index + 1}/${total}]`);
|
|
31272
31312
|
if (!noCache) {
|
|
31273
31313
|
const inputHash = computeComponentInputHash(component);
|
|
@@ -31352,6 +31392,7 @@ async function runOneComponent(agent, model, db, sessionId2, component, tokensIn
|
|
|
31352
31392
|
const result = await invoker2.invoke({
|
|
31353
31393
|
agent,
|
|
31354
31394
|
model,
|
|
31395
|
+
bedrock,
|
|
31355
31396
|
prompt: prompt2,
|
|
31356
31397
|
timeoutMs: DEFAULT_TIMEOUT_MS3,
|
|
31357
31398
|
onOutput: (chunk) => formatter.push(chunk)
|
|
@@ -31407,7 +31448,7 @@ ${outputBuf}`);
|
|
|
31407
31448
|
renamedSlotsCount: renames.length
|
|
31408
31449
|
};
|
|
31409
31450
|
}
|
|
31410
|
-
async function runAllComponents(agent, model, db, sessionId2, components, tokensInline, tokenMapInline, verbose, noCache, skillPathOverride, promptHash) {
|
|
31451
|
+
async function runAllComponents(agent, model, bedrock, db, sessionId2, components, tokensInline, tokenMapInline, verbose, noCache, skillPathOverride, promptHash) {
|
|
31411
31452
|
const concurrency = Number(process.env.EDS_GENERATE_CONCURRENCY ?? DEFAULT_COMPONENT_CONCURRENCY);
|
|
31412
31453
|
process.stderr.write(
|
|
31413
31454
|
`Categorizing ${c.bold(String(components.length))} component${components.length === 1 ? "" : "s"}` + c.dim(` (concurrency: ${concurrency})`) + "\n"
|
|
@@ -31421,6 +31462,7 @@ async function runAllComponents(agent, model, db, sessionId2, components, tokens
|
|
|
31421
31462
|
results[i] = await runOneComponent(
|
|
31422
31463
|
agent,
|
|
31423
31464
|
model,
|
|
31465
|
+
bedrock,
|
|
31424
31466
|
db,
|
|
31425
31467
|
sessionId2,
|
|
31426
31468
|
components[i],
|
|
@@ -31488,6 +31530,9 @@ async function runGenerateSkill(skill, opts, verbose = false) {
|
|
|
31488
31530
|
);
|
|
31489
31531
|
}
|
|
31490
31532
|
const agent = agentName;
|
|
31533
|
+
if (opts.bedrock && !agentSupportsBedrock(agent)) {
|
|
31534
|
+
die2(`Error: --bedrock is not supported for --agent ${agent}`);
|
|
31535
|
+
}
|
|
31491
31536
|
const generatePromptPath = skill === "components" ? opts.generatePromptPath ?? savedCreds.generatePromptPath : void 0;
|
|
31492
31537
|
if (generatePromptPath) {
|
|
31493
31538
|
if (!await pathExists3(resolve17(generatePromptPath))) {
|
|
@@ -31597,6 +31642,7 @@ async function runGenerateSkill(skill, opts, verbose = false) {
|
|
|
31597
31642
|
componentResults = await runAllComponents(
|
|
31598
31643
|
agent,
|
|
31599
31644
|
model,
|
|
31645
|
+
opts.bedrock,
|
|
31600
31646
|
db,
|
|
31601
31647
|
sessionId2,
|
|
31602
31648
|
allComponents,
|
|
@@ -31709,6 +31755,7 @@ session=${sessionId2 ?? ""}
|
|
|
31709
31755
|
const result = await invoker2.invoke({
|
|
31710
31756
|
agent,
|
|
31711
31757
|
model,
|
|
31758
|
+
bedrock: opts.bedrock,
|
|
31712
31759
|
prompt: prompt2,
|
|
31713
31760
|
timeoutMs: DEFAULT_TIMEOUT_MS3 * 5
|
|
31714
31761
|
});
|
|
@@ -32732,6 +32779,7 @@ function registerPrintCommand(program) {
|
|
|
32732
32779
|
}
|
|
32733
32780
|
|
|
32734
32781
|
// packages/experience-design-system-cli/src/import/command.ts
|
|
32782
|
+
init_src();
|
|
32735
32783
|
init_path_utils();
|
|
32736
32784
|
import { resolve as resolve25, join as join25 } from "node:path";
|
|
32737
32785
|
|
|
@@ -32886,6 +32934,7 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
|
|
|
32886
32934
|
if (opts.generateMap) analyzeArgs.push("--generate-map", opts.generateMap);
|
|
32887
32935
|
for (const p of opts.promptOverrides ?? []) analyzeArgs.push("--prompt", p);
|
|
32888
32936
|
if (opts.agent) analyzeArgs.push("--agent", opts.agent);
|
|
32937
|
+
if (opts.bedrock) analyzeArgs.push("--bedrock");
|
|
32889
32938
|
}
|
|
32890
32939
|
const r = await runStep(analyzeArgs, cliPath, sessionId2);
|
|
32891
32940
|
const durationMs = Date.now() - t0;
|
|
@@ -32936,6 +32985,7 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
|
|
|
32936
32985
|
if (useAgentSelect) {
|
|
32937
32986
|
editArgs = ["analyze", "select-agent", "--session", extractSessionId, "--agent", opts.agent];
|
|
32938
32987
|
if (opts.model) editArgs.push("--model", opts.model);
|
|
32988
|
+
if (opts.bedrock) editArgs.push("--bedrock");
|
|
32939
32989
|
if (opts.excludeInvalid) editArgs.push("--exclude-invalid");
|
|
32940
32990
|
if (opts.noCache) editArgs.push("--no-cache");
|
|
32941
32991
|
if (opts.selectPromptPath) editArgs.push("--select-prompt-path", opts.selectPromptPath);
|
|
@@ -32997,6 +33047,7 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
|
|
|
32997
33047
|
const generateLabel = stepLabel("Categorizing component props");
|
|
32998
33048
|
const generateArgs = ["generate", "components", "--agent", opts.agent];
|
|
32999
33049
|
if (opts.model) generateArgs.push("--model", opts.model);
|
|
33050
|
+
if (opts.bedrock) generateArgs.push("--bedrock");
|
|
33000
33051
|
if (extractSessionId) generateArgs.push("--session", extractSessionId);
|
|
33001
33052
|
if (opts.dryRun) generateArgs.push("--dry-run");
|
|
33002
33053
|
if (opts.verbose) generateArgs.push("--verbose");
|
|
@@ -33940,6 +33991,11 @@ function registerImportCommand(program) {
|
|
|
33940
33991
|
const resolvedAgent = resolveAgent(opts.agent, creds.agent);
|
|
33941
33992
|
const resolvedModel = resolveModel(opts.model, creds.agentModel);
|
|
33942
33993
|
const resolvedCompositionMode = resolveCompositionMode(opts, creds.compositionMode);
|
|
33994
|
+
if (opts.bedrock && !(isAgentName(resolvedAgent) && agentSupportsBedrock(resolvedAgent))) {
|
|
33995
|
+
process.stderr.write(`Error: --bedrock is not supported for --agent ${resolvedAgent}
|
|
33996
|
+
`);
|
|
33997
|
+
process.exit(1);
|
|
33998
|
+
}
|
|
33943
33999
|
const pickerDecision = await shouldShowRunPicker({
|
|
33944
34000
|
flags: {
|
|
33945
34001
|
...opts.pushFromRun !== void 0 ? { pushFromRun: opts.pushFromRun } : {},
|
|
@@ -33968,6 +34024,7 @@ function registerImportCommand(program) {
|
|
|
33968
34024
|
initialHost: toConfiguredHost(opts.host ?? creds.host) ?? DEFAULT_CONFIGURED_HOST,
|
|
33969
34025
|
initialAgent: resolvedAgent,
|
|
33970
34026
|
...resolvedModel ? { initialModel: resolvedModel } : {},
|
|
34027
|
+
...opts.bedrock ? { bedrock: true } : {},
|
|
33971
34028
|
initialProjectPath: opts.project !== "." ? normalizePath(opts.project) : void 0,
|
|
33972
34029
|
host: opts.host,
|
|
33973
34030
|
autoAcceptScope,
|
|
@@ -34030,6 +34087,11 @@ function registerImportCommand(program) {
|
|
|
34030
34087
|
const headlessAgent = resolveAgent(opts.agent, headlessCreds.agent);
|
|
34031
34088
|
const headlessModel = resolveModel(opts.model, headlessCreds.agentModel);
|
|
34032
34089
|
const headlessCompositionMode = resolveCompositionMode(opts, headlessCreds.compositionMode);
|
|
34090
|
+
if (opts.bedrock && !(isAgentName(headlessAgent) && agentSupportsBedrock(headlessAgent))) {
|
|
34091
|
+
process.stderr.write(`Error: --bedrock is not supported for --agent ${headlessAgent}
|
|
34092
|
+
`);
|
|
34093
|
+
process.exit(1);
|
|
34094
|
+
}
|
|
34033
34095
|
const result = await runPipeline(
|
|
34034
34096
|
{
|
|
34035
34097
|
project: projectRoot,
|
|
@@ -34039,6 +34101,7 @@ function registerImportCommand(program) {
|
|
|
34039
34101
|
cmaToken,
|
|
34040
34102
|
agent: headlessAgent,
|
|
34041
34103
|
model: headlessModel,
|
|
34104
|
+
...opts.bedrock ? { bedrock: true } : {},
|
|
34042
34105
|
tokens: opts.tokens,
|
|
34043
34106
|
selectAll: opts.selectAll,
|
|
34044
34107
|
select: opts.select.length > 0 ? opts.select : void 0,
|
|
@@ -35174,6 +35237,13 @@ async function runBuild(opts) {
|
|
|
35174
35237
|
child.on("exit", (code) => settle(code ?? 1));
|
|
35175
35238
|
});
|
|
35176
35239
|
}
|
|
35240
|
+
function resolveBedrockFromAncestors(actionCommand) {
|
|
35241
|
+
for (let c2 = actionCommand; c2; c2 = c2.parent) {
|
|
35242
|
+
const opts = c2.opts();
|
|
35243
|
+
if (opts.bedrock) return true;
|
|
35244
|
+
}
|
|
35245
|
+
return false;
|
|
35246
|
+
}
|
|
35177
35247
|
function registerBuildCommand(program) {
|
|
35178
35248
|
program.command("build").description("Rebuild from source and re-link exo/experiences binaries to this build").action(async () => {
|
|
35179
35249
|
const pkgRoot = resolve26(dirname14(fileURLToPath5(import.meta.url)), "..", "..");
|
|
@@ -35210,6 +35280,9 @@ function createProgram() {
|
|
|
35210
35280
|
break;
|
|
35211
35281
|
}
|
|
35212
35282
|
}
|
|
35283
|
+
if (resolveBedrockFromAncestors(actionCommand)) {
|
|
35284
|
+
process.env.EDS_BEDROCK = "1";
|
|
35285
|
+
}
|
|
35213
35286
|
const chain = [];
|
|
35214
35287
|
for (let c2 = actionCommand; c2 && c2.parent; c2 = c2.parent) chain.unshift(c2.name());
|
|
35215
35288
|
const commandChain = chain.join(" ") || actionCommand.name();
|
|
@@ -1,13 +1,16 @@
|
|
|
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;
|
|
4
5
|
export interface AgentModelOptionsConfig {
|
|
5
6
|
agentDescription?: string;
|
|
6
7
|
includeModel?: boolean;
|
|
7
8
|
modelDescription?: string;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
|
-
* Register --agent and
|
|
11
|
-
* Pass
|
|
11
|
+
* Register --agent, --bedrock, and optional --model flags with a Commander
|
|
12
|
+
* command. Pass includeModel: false to omit --model only — --bedrock is
|
|
13
|
+
* independent of model selection (it's a routing switch, not a model choice)
|
|
14
|
+
* and is always registered alongside --agent.
|
|
12
15
|
*/
|
|
13
16
|
export declare function addAgentModelOptions(cmd: Command, config?: AgentModelOptionsConfig): Command;
|
package/dist/src/program.d.ts
CHANGED
|
@@ -15,5 +15,11 @@ 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;
|
|
18
24
|
export declare function createProgram(): Command;
|
|
19
25
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.27.
|
|
3
|
+
"version": "2.27.5-dev-build-fa61a4f.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"svelte": "^5.56.4",
|
|
40
40
|
"ts-morph": "^27.0.2",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
|
-
"@contentful/experience-design-system-types": "2.27.
|
|
42
|
+
"@contentful/experience-design-system-types": "2.27.5-dev-build-fa61a4f.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@tsconfig/node24": "^24.0.4",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"ink-testing-library": "^4.0.0",
|
|
52
52
|
"typescript-eslint": "^8.67.0",
|
|
53
53
|
"vitest": "^4.0.16",
|
|
54
|
-
"@contentful/experience-design-system-
|
|
55
|
-
"@contentful/experience-design-system-
|
|
56
|
-
"@contentful/experience-design-system-
|
|
54
|
+
"@contentful/experience-design-system-client": "2.27.5-dev-build-fa61a4f.0",
|
|
55
|
+
"@contentful/experience-design-system-extraction": "2.27.5-dev-build-fa61a4f.0",
|
|
56
|
+
"@contentful/experience-design-system-generation": "2.27.5-dev-build-fa61a4f.0"
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
|
59
59
|
"type": "git",
|