@contentful/experience-design-system-cli 2.27.1-dev-build-a53b367.0 → 2.27.1-dev-build-887759e.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();
|
|
@@ -254,7 +257,7 @@ function buildArgs(agent, prompt2, model, promptViaStdin = false) {
|
|
|
254
257
|
}
|
|
255
258
|
}
|
|
256
259
|
async function runAgent(options) {
|
|
257
|
-
const { agent, prompt: prompt2, timeoutMs, model, onOutput, promptViaStdin, onDebugEvent } = options;
|
|
260
|
+
const { agent, prompt: prompt2, timeoutMs, model, bedrock, onOutput, promptViaStdin, onDebugEvent } = options;
|
|
258
261
|
const binary = resolveBinary(agent);
|
|
259
262
|
const useStdin2 = !!promptViaStdin;
|
|
260
263
|
const args = buildArgs(agent, prompt2, model, useStdin2);
|
|
@@ -263,13 +266,16 @@ async function runAgent(options) {
|
|
|
263
266
|
agent,
|
|
264
267
|
binary,
|
|
265
268
|
model,
|
|
269
|
+
bedrock: !!bedrock,
|
|
266
270
|
timeoutMs,
|
|
267
271
|
promptLen: prompt2.length,
|
|
268
272
|
promptHead: prompt2.slice(0, 500)
|
|
269
273
|
});
|
|
270
274
|
return new Promise((resolve27) => {
|
|
275
|
+
const bedrockEnv = bedrock ? BEDROCK_ENV_BY_AGENT[agent] : void 0;
|
|
271
276
|
const child = spawn(binary, args, {
|
|
272
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
277
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
278
|
+
...bedrockEnv ? { env: { ...process.env, ...bedrockEnv } } : {}
|
|
273
279
|
});
|
|
274
280
|
if (useStdin2 && child.stdin) {
|
|
275
281
|
child.stdin.on("error", () => {
|
|
@@ -387,7 +393,7 @@ function extractSentinelOutput(stdout) {
|
|
|
387
393
|
return "multiple";
|
|
388
394
|
return stdout.slice(startIdx + START.length, endIdx).trim();
|
|
389
395
|
}
|
|
390
|
-
var VALID_SELECT_TOOL_NAMES, VALID_TOOL_NAMES, VALID_TOKEN_TOOL_NAMES, VALID_CDF_TYPES, VALID_CATEGORIES, AGENT_BINARIES, DEFAULT_MODELS;
|
|
396
|
+
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
397
|
var init_agent_runner = __esm({
|
|
392
398
|
"packages/experience-design-system-generation/dist/src/agent-runner.js"() {
|
|
393
399
|
"use strict";
|
|
@@ -403,6 +409,9 @@ var init_agent_runner = __esm({
|
|
|
403
409
|
opencode: "opencode",
|
|
404
410
|
cursor: "cursor-agent"
|
|
405
411
|
};
|
|
412
|
+
BEDROCK_ENV_BY_AGENT = {
|
|
413
|
+
claude: { CLAUDE_CODE_USE_BEDROCK: "1" }
|
|
414
|
+
};
|
|
406
415
|
DEFAULT_MODELS = {
|
|
407
416
|
claude: "haiku",
|
|
408
417
|
codex: "gpt-5.4-mini",
|
|
@@ -671,6 +680,7 @@ var src_exports = {};
|
|
|
671
680
|
__export(src_exports, {
|
|
672
681
|
AGENT_NAMES: () => AGENT_NAMES,
|
|
673
682
|
DEFAULT_AGENT_NAME: () => DEFAULT_AGENT_NAME,
|
|
683
|
+
agentSupportsBedrock: () => agentSupportsBedrock,
|
|
674
684
|
buildArgs: () => buildArgs,
|
|
675
685
|
buildPrompt: () => buildPrompt,
|
|
676
686
|
checkAgentAuth: () => checkAgentAuth,
|
|
@@ -26409,6 +26419,7 @@ import { jsx as jsx50, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
|
26409
26419
|
function buildSelectAgentArgs(opts) {
|
|
26410
26420
|
const args = ["analyze", "select-agent", "--agent", opts.agent, "--session", opts.sessionId, "--exclude-invalid"];
|
|
26411
26421
|
if (opts.model) args.push("--model", opts.model);
|
|
26422
|
+
if (opts.bedrock) args.push("--bedrock");
|
|
26412
26423
|
if (opts.selectPromptPath) args.push("--select-prompt-path", opts.selectPromptPath);
|
|
26413
26424
|
if (opts.noCache) args.push("--no-cache");
|
|
26414
26425
|
return args;
|
|
@@ -26444,6 +26455,7 @@ function buildGenerateComponentsArgs(opts) {
|
|
|
26444
26455
|
const args = ["generate", "components", "--agent", opts.agent, "--session", opts.sessionId];
|
|
26445
26456
|
if (opts.tokensPath) args.push("--tokens", opts.tokensPath);
|
|
26446
26457
|
if (opts.model) args.push("--model", opts.model);
|
|
26458
|
+
if (opts.bedrock) args.push("--bedrock");
|
|
26447
26459
|
if (opts.noCache) args.push("--no-cache");
|
|
26448
26460
|
if (opts.generatePromptPath) args.push("--generate-prompt-path", opts.generatePromptPath);
|
|
26449
26461
|
return args;
|
|
@@ -26476,6 +26488,7 @@ function WizardApp({
|
|
|
26476
26488
|
initialHost,
|
|
26477
26489
|
initialAgent,
|
|
26478
26490
|
initialModel,
|
|
26491
|
+
bedrock = false,
|
|
26479
26492
|
initialProjectPath,
|
|
26480
26493
|
host,
|
|
26481
26494
|
autoAcceptScope = false,
|
|
@@ -26536,6 +26549,7 @@ function WizardApp({
|
|
|
26536
26549
|
step: modifyEntryReady || rawTokensEntryReady || pushFromPickerReady ? initialStepResolved : initialRuns && initialRuns.length > 0 ? "run-picker" : initialStepResolved,
|
|
26537
26550
|
agent: initialAgent ?? "claude",
|
|
26538
26551
|
...initialModel ? { agentModel: initialModel } : {},
|
|
26552
|
+
...bedrock ? { bedrock: true } : {},
|
|
26539
26553
|
projectPath: initialProjectPath ?? "",
|
|
26540
26554
|
outDir: initialOutDir,
|
|
26541
26555
|
rawTokensPath: rawTokensEntryReady ? initialRawTokensPath : "",
|
|
@@ -26674,6 +26688,7 @@ If you are using AWS Bedrock, run:
|
|
|
26674
26688
|
const result = await new Promise((res) => {
|
|
26675
26689
|
const tokenArgs = [findCliPath(), "generate", "tokens", "--agent", state.agent, "--raw-tokens", rawTokensPath];
|
|
26676
26690
|
if (state.agentModel) tokenArgs.push("--model", state.agentModel);
|
|
26691
|
+
if (state.bedrock) tokenArgs.push("--bedrock");
|
|
26677
26692
|
const child = spawn4("node", tokenArgs);
|
|
26678
26693
|
let stdout2 = "";
|
|
26679
26694
|
let stderr = "";
|
|
@@ -26831,6 +26846,7 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
26831
26846
|
sessionId: sessionId2,
|
|
26832
26847
|
agent: state.agent,
|
|
26833
26848
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
26849
|
+
...state.bedrock ? { bedrock: true } : {},
|
|
26834
26850
|
selectPromptPath,
|
|
26835
26851
|
noCache
|
|
26836
26852
|
});
|
|
@@ -26929,6 +26945,7 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
26929
26945
|
tokensPath,
|
|
26930
26946
|
agent: state.agent,
|
|
26931
26947
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
26948
|
+
...state.bedrock ? { bedrock: true } : {},
|
|
26932
26949
|
noCache: effectiveNoCache
|
|
26933
26950
|
})
|
|
26934
26951
|
];
|
|
@@ -26998,6 +27015,7 @@ Make sure this path contains TypeScript/React/Vue component files (.tsx, .ts, .v
|
|
|
26998
27015
|
tokensPath,
|
|
26999
27016
|
agent: state.agent,
|
|
27000
27017
|
...state.agentModel ? { model: state.agentModel } : {},
|
|
27018
|
+
...state.bedrock ? { bedrock: true } : {},
|
|
27001
27019
|
noCache: effectiveNoCache,
|
|
27002
27020
|
generatePromptPath
|
|
27003
27021
|
})
|
|
@@ -28473,11 +28491,13 @@ import { isAbsolute as isAbsolute4, join as join15, relative as relative3, resol
|
|
|
28473
28491
|
init_src();
|
|
28474
28492
|
var AGENT_DESCRIPTION = `Agent to use: ${AGENT_NAMES.join(", ")} (defaults to value saved by experiences setup)`;
|
|
28475
28493
|
var MODEL_DESCRIPTION = "Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)";
|
|
28494
|
+
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: claude).";
|
|
28476
28495
|
function addAgentModelOptions(cmd, config = {}) {
|
|
28477
28496
|
const { agentDescription = AGENT_DESCRIPTION, includeModel = true, modelDescription = MODEL_DESCRIPTION } = config;
|
|
28478
28497
|
cmd.option("--agent <name>", agentDescription);
|
|
28479
28498
|
if (includeModel) {
|
|
28480
28499
|
cmd.option("--model <name>", modelDescription);
|
|
28500
|
+
cmd.option("--bedrock", BEDROCK_DESCRIPTION);
|
|
28481
28501
|
}
|
|
28482
28502
|
return cmd;
|
|
28483
28503
|
}
|
|
@@ -29030,7 +29050,7 @@ function resolveProjectRoot(sessionId2, projectRootFlag) {
|
|
|
29030
29050
|
db.close();
|
|
29031
29051
|
}
|
|
29032
29052
|
}
|
|
29033
|
-
async function selectBatch(agent, model, batch, total, verbose, skillPathOverride) {
|
|
29053
|
+
async function selectBatch(agent, model, bedrock, batch, total, verbose, skillPathOverride) {
|
|
29034
29054
|
const prompt2 = await buildPrompt({
|
|
29035
29055
|
skill: "select",
|
|
29036
29056
|
mode: "autonomous",
|
|
@@ -29049,6 +29069,7 @@ async function selectBatch(agent, model, batch, total, verbose, skillPathOverrid
|
|
|
29049
29069
|
const result = await invoker.invoke({
|
|
29050
29070
|
agent,
|
|
29051
29071
|
model,
|
|
29072
|
+
bedrock,
|
|
29052
29073
|
prompt: prompt2,
|
|
29053
29074
|
timeoutMs: DEFAULT_TIMEOUT_MS,
|
|
29054
29075
|
onOutput: (chunk) => formatter.push(chunk)
|
|
@@ -29135,7 +29156,7 @@ ${outputBuf}`);
|
|
|
29135
29156
|
}
|
|
29136
29157
|
return results;
|
|
29137
29158
|
}
|
|
29138
|
-
async function selectAllComponents(agent, model, components, verbose, skillPathOverride, cacheConfig = { noCache: true }) {
|
|
29159
|
+
async function selectAllComponents(agent, model, bedrock, components, verbose, skillPathOverride, cacheConfig = { noCache: true }) {
|
|
29139
29160
|
const concurrency = Number(process.env.EDS_GENERATE_CONCURRENCY ?? DEFAULT_CONCURRENCY);
|
|
29140
29161
|
const batchSize = resolveBatchSize();
|
|
29141
29162
|
const total = components.length;
|
|
@@ -29200,7 +29221,7 @@ async function selectAllComponents(agent, model, components, verbose, skillPathO
|
|
|
29200
29221
|
while (nextBatch < batches.length) {
|
|
29201
29222
|
const b = nextBatch++;
|
|
29202
29223
|
const batch = batches[b];
|
|
29203
|
-
const batchResults = await selectBatch(agent, model, batch, total, verbose, skillPathOverride);
|
|
29224
|
+
const batchResults = await selectBatch(agent, model, bedrock, batch, total, verbose, skillPathOverride);
|
|
29204
29225
|
for (let k = 0; k < batch.length; k++) {
|
|
29205
29226
|
results[batch[k].index] = batchResults[k];
|
|
29206
29227
|
}
|
|
@@ -29264,6 +29285,12 @@ function registerAnalyzeSelectAgentCommand(program) {
|
|
|
29264
29285
|
return;
|
|
29265
29286
|
}
|
|
29266
29287
|
const agent = agentName;
|
|
29288
|
+
if (opts.bedrock && !agentSupportsBedrock(agent)) {
|
|
29289
|
+
process.stderr.write(`Error: --bedrock is not supported for --agent ${agent}
|
|
29290
|
+
`);
|
|
29291
|
+
await exitWithAnalytics(1);
|
|
29292
|
+
return;
|
|
29293
|
+
}
|
|
29267
29294
|
const selectPromptPath = opts.selectPromptPath ?? savedCreds.selectPromptPath;
|
|
29268
29295
|
if (selectPromptPath) {
|
|
29269
29296
|
const resolvedPath = resolve12(selectPromptPath);
|
|
@@ -29362,6 +29389,7 @@ function registerAnalyzeSelectAgentCommand(program) {
|
|
|
29362
29389
|
const selectResults = await selectAllComponents(
|
|
29363
29390
|
agent,
|
|
29364
29391
|
model,
|
|
29392
|
+
opts.bedrock,
|
|
29365
29393
|
selectionCandidates,
|
|
29366
29394
|
opts.verbose ?? false,
|
|
29367
29395
|
selectPromptPath ? resolve12(selectPromptPath) : void 0,
|
|
@@ -31121,7 +31149,7 @@ function printFallbackInstructions(options) {
|
|
|
31121
31149
|
lines.push(` Re-run the generate command with the agent available, or use --dry-run to inspect the prompt.`);
|
|
31122
31150
|
process.stderr.write(lines.join("\n") + "\n");
|
|
31123
31151
|
}
|
|
31124
|
-
async function runOneComponent(agent, model, db, sessionId2, component, tokensInline, tokenMapInline, index, total, verbose, noCache, skillPathOverride, promptHash) {
|
|
31152
|
+
async function runOneComponent(agent, model, bedrock, db, sessionId2, component, tokensInline, tokenMapInline, index, total, verbose, noCache, skillPathOverride, promptHash) {
|
|
31125
31153
|
const pos = c.dim(`[${index + 1}/${total}]`);
|
|
31126
31154
|
if (!noCache) {
|
|
31127
31155
|
const inputHash = computeComponentInputHash(component);
|
|
@@ -31206,6 +31234,7 @@ async function runOneComponent(agent, model, db, sessionId2, component, tokensIn
|
|
|
31206
31234
|
const result = await invoker2.invoke({
|
|
31207
31235
|
agent,
|
|
31208
31236
|
model,
|
|
31237
|
+
bedrock,
|
|
31209
31238
|
prompt: prompt2,
|
|
31210
31239
|
timeoutMs: DEFAULT_TIMEOUT_MS3,
|
|
31211
31240
|
onOutput: (chunk) => formatter.push(chunk)
|
|
@@ -31261,7 +31290,7 @@ ${outputBuf}`);
|
|
|
31261
31290
|
renamedSlotsCount: renames.length
|
|
31262
31291
|
};
|
|
31263
31292
|
}
|
|
31264
|
-
async function runAllComponents(agent, model, db, sessionId2, components, tokensInline, tokenMapInline, verbose, noCache, skillPathOverride, promptHash) {
|
|
31293
|
+
async function runAllComponents(agent, model, bedrock, db, sessionId2, components, tokensInline, tokenMapInline, verbose, noCache, skillPathOverride, promptHash) {
|
|
31265
31294
|
const concurrency = Number(process.env.EDS_GENERATE_CONCURRENCY ?? DEFAULT_COMPONENT_CONCURRENCY);
|
|
31266
31295
|
process.stderr.write(
|
|
31267
31296
|
`Categorizing ${c.bold(String(components.length))} component${components.length === 1 ? "" : "s"}` + c.dim(` (concurrency: ${concurrency})`) + "\n"
|
|
@@ -31275,6 +31304,7 @@ async function runAllComponents(agent, model, db, sessionId2, components, tokens
|
|
|
31275
31304
|
results[i] = await runOneComponent(
|
|
31276
31305
|
agent,
|
|
31277
31306
|
model,
|
|
31307
|
+
bedrock,
|
|
31278
31308
|
db,
|
|
31279
31309
|
sessionId2,
|
|
31280
31310
|
components[i],
|
|
@@ -31342,6 +31372,9 @@ async function runGenerateSkill(skill, opts, verbose = false) {
|
|
|
31342
31372
|
);
|
|
31343
31373
|
}
|
|
31344
31374
|
const agent = agentName;
|
|
31375
|
+
if (opts.bedrock && !agentSupportsBedrock(agent)) {
|
|
31376
|
+
die2(`Error: --bedrock is not supported for --agent ${agent}`);
|
|
31377
|
+
}
|
|
31345
31378
|
const generatePromptPath = skill === "components" ? opts.generatePromptPath ?? savedCreds.generatePromptPath : void 0;
|
|
31346
31379
|
if (generatePromptPath) {
|
|
31347
31380
|
if (!await pathExists3(resolve17(generatePromptPath))) {
|
|
@@ -31451,6 +31484,7 @@ async function runGenerateSkill(skill, opts, verbose = false) {
|
|
|
31451
31484
|
componentResults = await runAllComponents(
|
|
31452
31485
|
agent,
|
|
31453
31486
|
model,
|
|
31487
|
+
opts.bedrock,
|
|
31454
31488
|
db,
|
|
31455
31489
|
sessionId2,
|
|
31456
31490
|
allComponents,
|
|
@@ -31563,6 +31597,7 @@ session=${sessionId2 ?? ""}
|
|
|
31563
31597
|
const result = await invoker2.invoke({
|
|
31564
31598
|
agent,
|
|
31565
31599
|
model,
|
|
31600
|
+
bedrock: opts.bedrock,
|
|
31566
31601
|
prompt: prompt2,
|
|
31567
31602
|
timeoutMs: DEFAULT_TIMEOUT_MS3 * 5
|
|
31568
31603
|
});
|
|
@@ -32586,6 +32621,7 @@ function registerPrintCommand(program) {
|
|
|
32586
32621
|
}
|
|
32587
32622
|
|
|
32588
32623
|
// packages/experience-design-system-cli/src/import/command.ts
|
|
32624
|
+
init_src();
|
|
32589
32625
|
init_path_utils();
|
|
32590
32626
|
import { resolve as resolve25, join as join25 } from "node:path";
|
|
32591
32627
|
|
|
@@ -32790,6 +32826,7 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
|
|
|
32790
32826
|
if (useAgentSelect) {
|
|
32791
32827
|
editArgs = ["analyze", "select-agent", "--session", extractSessionId, "--agent", opts.agent];
|
|
32792
32828
|
if (opts.model) editArgs.push("--model", opts.model);
|
|
32829
|
+
if (opts.bedrock) editArgs.push("--bedrock");
|
|
32793
32830
|
if (opts.excludeInvalid) editArgs.push("--exclude-invalid");
|
|
32794
32831
|
if (opts.noCache) editArgs.push("--no-cache");
|
|
32795
32832
|
if (opts.selectPromptPath) editArgs.push("--select-prompt-path", opts.selectPromptPath);
|
|
@@ -32851,6 +32888,7 @@ async function runPipeline(opts, progressWriter, cliPathOverride) {
|
|
|
32851
32888
|
const generateLabel = stepLabel("Categorizing component props");
|
|
32852
32889
|
const generateArgs = ["generate", "components", "--agent", opts.agent];
|
|
32853
32890
|
if (opts.model) generateArgs.push("--model", opts.model);
|
|
32891
|
+
if (opts.bedrock) generateArgs.push("--bedrock");
|
|
32854
32892
|
if (extractSessionId) generateArgs.push("--session", extractSessionId);
|
|
32855
32893
|
if (opts.dryRun) generateArgs.push("--dry-run");
|
|
32856
32894
|
if (opts.verbose) generateArgs.push("--verbose");
|
|
@@ -33794,6 +33832,12 @@ function registerImportCommand(program) {
|
|
|
33794
33832
|
const resolvedAgent = resolveAgent(opts.agent, creds.agent);
|
|
33795
33833
|
const resolvedModel = resolveModel(opts.model, creds.agentModel);
|
|
33796
33834
|
const resolvedCompositionMode = resolveCompositionMode(opts, creds.compositionMode);
|
|
33835
|
+
if (opts.bedrock && !(isAgentName(resolvedAgent) && agentSupportsBedrock(resolvedAgent))) {
|
|
33836
|
+
process.stderr.write(`Error: --bedrock is not supported for --agent ${resolvedAgent}
|
|
33837
|
+
`);
|
|
33838
|
+
process.exit(1);
|
|
33839
|
+
return;
|
|
33840
|
+
}
|
|
33797
33841
|
const pickerDecision = await shouldShowRunPicker({
|
|
33798
33842
|
flags: {
|
|
33799
33843
|
...opts.pushFromRun !== void 0 ? { pushFromRun: opts.pushFromRun } : {},
|
|
@@ -33822,6 +33866,7 @@ function registerImportCommand(program) {
|
|
|
33822
33866
|
initialHost: toConfiguredHost(opts.host ?? creds.host) ?? DEFAULT_CONFIGURED_HOST,
|
|
33823
33867
|
initialAgent: resolvedAgent,
|
|
33824
33868
|
...resolvedModel ? { initialModel: resolvedModel } : {},
|
|
33869
|
+
...opts.bedrock ? { bedrock: true } : {},
|
|
33825
33870
|
initialProjectPath: opts.project !== "." ? normalizePath(opts.project) : void 0,
|
|
33826
33871
|
host: opts.host,
|
|
33827
33872
|
autoAcceptScope,
|
|
@@ -33884,6 +33929,12 @@ function registerImportCommand(program) {
|
|
|
33884
33929
|
const headlessAgent = resolveAgent(opts.agent, headlessCreds.agent);
|
|
33885
33930
|
const headlessModel = resolveModel(opts.model, headlessCreds.agentModel);
|
|
33886
33931
|
const headlessCompositionMode = resolveCompositionMode(opts, headlessCreds.compositionMode);
|
|
33932
|
+
if (opts.bedrock && !(isAgentName(headlessAgent) && agentSupportsBedrock(headlessAgent))) {
|
|
33933
|
+
process.stderr.write(`Error: --bedrock is not supported for --agent ${headlessAgent}
|
|
33934
|
+
`);
|
|
33935
|
+
process.exit(1);
|
|
33936
|
+
return;
|
|
33937
|
+
}
|
|
33887
33938
|
const result = await runPipeline(
|
|
33888
33939
|
{
|
|
33889
33940
|
project: projectRoot,
|
|
@@ -33893,6 +33944,7 @@ function registerImportCommand(program) {
|
|
|
33893
33944
|
cmaToken,
|
|
33894
33945
|
agent: headlessAgent,
|
|
33895
33946
|
model: headlessModel,
|
|
33947
|
+
...opts.bedrock ? { bedrock: true } : {},
|
|
33896
33948
|
tokens: opts.tokens,
|
|
33897
33949
|
selectAll: opts.selectAll,
|
|
33898
33950
|
select: opts.select.length > 0 ? opts.select : void 0,
|
|
@@ -1,13 +1,14 @@
|
|
|
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 = "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: claude).";
|
|
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 optionally --model flags to a Commander command, with customizable descriptions.
|
|
11
|
+
* Register --agent and optionally --model/--bedrock flags to a Commander command, with customizable descriptions.
|
|
11
12
|
* 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).
|
|
12
13
|
*/
|
|
13
14
|
export declare function addAgentModelOptions(cmd: Command, config?: AgentModelOptionsConfig): Command;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.27.1-dev-build-
|
|
3
|
+
"version": "2.27.1-dev-build-887759e.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.1-dev-build-
|
|
42
|
+
"@contentful/experience-design-system-types": "2.27.1-dev-build-887759e.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-client": "2.27.1-dev-build-
|
|
55
|
-
"@contentful/experience-design-system-
|
|
56
|
-
"@contentful/experience-design-system-
|
|
54
|
+
"@contentful/experience-design-system-client": "2.27.1-dev-build-887759e.0",
|
|
55
|
+
"@contentful/experience-design-system-generation": "2.27.1-dev-build-887759e.0",
|
|
56
|
+
"@contentful/experience-design-system-extraction": "2.27.1-dev-build-887759e.0"
|
|
57
57
|
},
|
|
58
58
|
"repository": {
|
|
59
59
|
"type": "git",
|