@contentful/experience-design-system-cli 2.35.1-dev-build-35ec3f8d.0 → 2.35.1-dev-build-45d6c918.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/legacy/dist/src/index.js +181 -128
- package/legacy/package.json +1 -1
- package/package.json +2 -2
package/dist/package.json
CHANGED
package/legacy/dist/src/index.js
CHANGED
|
@@ -164,12 +164,19 @@ var init_render_with_goodbye = __esm({
|
|
|
164
164
|
function isAgentName(value) {
|
|
165
165
|
return AGENT_NAMES.includes(value);
|
|
166
166
|
}
|
|
167
|
-
var AGENT_NAMES, DEFAULT_AGENT_NAME;
|
|
167
|
+
var AGENT_NAMES, DEFAULT_AGENT_NAME, AGENT_BINARIES;
|
|
168
168
|
var init_agent_names = __esm({
|
|
169
169
|
"packages/experience-design-system-generation/dist/src/agent-names.js"() {
|
|
170
170
|
"use strict";
|
|
171
171
|
AGENT_NAMES = ["claude", "codex", "opencode", "cursor", "copilot"];
|
|
172
172
|
DEFAULT_AGENT_NAME = "claude";
|
|
173
|
+
AGENT_BINARIES = {
|
|
174
|
+
claude: "claude",
|
|
175
|
+
codex: "codex",
|
|
176
|
+
opencode: "opencode",
|
|
177
|
+
cursor: "cursor-agent",
|
|
178
|
+
copilot: "copilot"
|
|
179
|
+
};
|
|
173
180
|
}
|
|
174
181
|
});
|
|
175
182
|
|
|
@@ -198,6 +205,62 @@ var init_validate_generation_request = __esm({
|
|
|
198
205
|
}
|
|
199
206
|
});
|
|
200
207
|
|
|
208
|
+
// packages/experience-design-system-generation/dist/src/services/prompts/helpers/resolve-skill-file.js
|
|
209
|
+
import { existsSync } from "node:fs";
|
|
210
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
211
|
+
import { dirname, join as join2, resolve } from "node:path";
|
|
212
|
+
import { fileURLToPath } from "node:url";
|
|
213
|
+
function resolveSkillPath(skill) {
|
|
214
|
+
if (!(skill in SKILL_FILES))
|
|
215
|
+
throw new Error(`Invalid skill: ${skill}`);
|
|
216
|
+
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
217
|
+
let dir = thisDir;
|
|
218
|
+
for (; ; ) {
|
|
219
|
+
const candidate = join2(dir, "skills");
|
|
220
|
+
if (existsSync(candidate))
|
|
221
|
+
return join2(candidate, SKILL_FILES[skill]);
|
|
222
|
+
const parent = resolve(dir, "..");
|
|
223
|
+
if (parent === dir) {
|
|
224
|
+
throw new Error(`skill file missing from CLI installation (could not locate skills/ directory from: ${thisDir})`);
|
|
225
|
+
}
|
|
226
|
+
dir = parent;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function formatCustomPromptBanner(skill, path) {
|
|
230
|
+
return `WARNING: Custom prompt active for ${skill}: ${path}
|
|
231
|
+
Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply.
|
|
232
|
+
You are responsible for the prompt's correctness.
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
235
|
+
async function readSkillFile(skill, override) {
|
|
236
|
+
if (override) {
|
|
237
|
+
const skillPath2 = resolve(override);
|
|
238
|
+
try {
|
|
239
|
+
return await readFile2(skillPath2, "utf8");
|
|
240
|
+
} catch {
|
|
241
|
+
throw new Error(`custom prompt file not found (skill: ${skill}, path: ${skillPath2})`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const skillPath = resolveSkillPath(skill);
|
|
245
|
+
try {
|
|
246
|
+
return await readFile2(skillPath, "utf8");
|
|
247
|
+
} catch {
|
|
248
|
+
throw new Error(`skill file missing from CLI installation \u2014 try reinstalling the CLI (looked for: ${skillPath})`);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
var SKILL_FILES;
|
|
252
|
+
var init_resolve_skill_file = __esm({
|
|
253
|
+
"packages/experience-design-system-generation/dist/src/services/prompts/helpers/resolve-skill-file.js"() {
|
|
254
|
+
"use strict";
|
|
255
|
+
SKILL_FILES = {
|
|
256
|
+
components: "generate-components.md",
|
|
257
|
+
tokens: "generate-tokens.md",
|
|
258
|
+
select: "select-components.md",
|
|
259
|
+
"map-tokens": "map-tokens.md"
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
|
|
201
264
|
// packages/experience-design-system-generation/dist/src/services/prompts/helpers/format-token-candidates.js
|
|
202
265
|
import { flattenDTCG } from "@contentful/experience-design-system-types";
|
|
203
266
|
function inferFenceLang(filename) {
|
|
@@ -282,6 +345,51 @@ var init_format_token_candidates = __esm({
|
|
|
282
345
|
}
|
|
283
346
|
});
|
|
284
347
|
|
|
348
|
+
// packages/experience-design-system-generation/dist/src/services/prompts/helpers/format-source-refs.js
|
|
349
|
+
function formatSourceRefBlock(ref) {
|
|
350
|
+
const mainBlock = `#### ${ref.component} (\`${ref.sourcePath}\`)
|
|
351
|
+
\`\`\`${inferFenceLang(ref.sourcePath)}
|
|
352
|
+
${ref.content}
|
|
353
|
+
\`\`\``;
|
|
354
|
+
const siblingBlocks = (ref.siblingFiles ?? []).map((sibling) => `##### ${ref.component} \u2014 imported file \`${sibling.path}\`
|
|
355
|
+
\`\`\`${inferFenceLang(sibling.path)}
|
|
356
|
+
${sibling.content}
|
|
357
|
+
\`\`\``);
|
|
358
|
+
const truncationNote = ref.truncatedSiblingCount && ref.truncatedSiblingCount > 0 ? [
|
|
359
|
+
`##### ${ref.component} \u2014 +${ref.truncatedSiblingCount} more imported file${ref.truncatedSiblingCount === 1 ? "" : "s"} not shown (evidence may be incomplete)`
|
|
360
|
+
] : [];
|
|
361
|
+
const notShownNote = ref.usesNotShown && ref.usesNotShown.length > 0 ? [
|
|
362
|
+
`##### ${ref.component} \u2014 uses not shown: ${ref.usesNotShown.join(", ")}
|
|
363
|
+
|
|
364
|
+
The files above are excerpts, and each of these properties has at least one use that fell outside the excerpt budget. Treat their consumption as unknown, not absent: do not classify them \`token\` on what is shown, and do not conclude they are unread.`
|
|
365
|
+
] : [];
|
|
366
|
+
return [mainBlock, ...siblingBlocks, ...truncationNote, ...notShownNote].join("\n\n");
|
|
367
|
+
}
|
|
368
|
+
function formatSourceRefsSection(refs, skill) {
|
|
369
|
+
const sections = [];
|
|
370
|
+
const withContent = refs.filter((ref) => ref.content != null);
|
|
371
|
+
const withoutContent = refs.filter((ref) => ref.content == null);
|
|
372
|
+
if (withContent.length > 0) {
|
|
373
|
+
sections.push(`### Component source references
|
|
374
|
+
|
|
375
|
+
${withContent.map(formatSourceRefBlock).join("\n\n")}`);
|
|
376
|
+
}
|
|
377
|
+
if (withoutContent.length > 0) {
|
|
378
|
+
const guidance = skill === "components" ? "there is no consumption evidence for these, so `token` cannot be earned for any of their props \u2014 classify from the prop signature alone, and any prop that would otherwise be enum-versus-token is `enum` (or `string`)" : "there is no source evidence to narrow from \u2014 emit nothing for their props";
|
|
379
|
+
sections.push(`Component source unavailable for (JSON) \u2014 ${guidance}:
|
|
380
|
+
\`\`\`json
|
|
381
|
+
${JSON.stringify(withoutContent.map((ref) => ({ component: ref.component, sourcePath: ref.sourcePath })))}
|
|
382
|
+
\`\`\``);
|
|
383
|
+
}
|
|
384
|
+
return sections;
|
|
385
|
+
}
|
|
386
|
+
var init_format_source_refs = __esm({
|
|
387
|
+
"packages/experience-design-system-generation/dist/src/services/prompts/helpers/format-source-refs.js"() {
|
|
388
|
+
"use strict";
|
|
389
|
+
init_format_token_candidates();
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
|
|
285
393
|
// packages/experience-design-system-generation/dist/src/services/prompts/helpers/build-skill-preambles.js
|
|
286
394
|
function buildComponentsAutonomousPreamble(inputBlock) {
|
|
287
395
|
return `You are running as part of the experience-design-system-cli generate pipeline in AUTONOMOUS mode. The developer is not present to answer questions.
|
|
@@ -415,49 +523,7 @@ var init_build_skill_preambles = __esm({
|
|
|
415
523
|
}
|
|
416
524
|
});
|
|
417
525
|
|
|
418
|
-
// packages/experience-design-system-generation/dist/src/services/prompts/build-
|
|
419
|
-
import { existsSync } from "node:fs";
|
|
420
|
-
import { readFile as readFile2 } from "node:fs/promises";
|
|
421
|
-
import { dirname, join as join2, resolve } from "node:path";
|
|
422
|
-
import { fileURLToPath } from "node:url";
|
|
423
|
-
function resolveSkillPath(skill) {
|
|
424
|
-
if (!(skill in SKILL_FILES))
|
|
425
|
-
throw new Error(`Invalid skill: ${skill}`);
|
|
426
|
-
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
427
|
-
let dir = thisDir;
|
|
428
|
-
for (; ; ) {
|
|
429
|
-
const candidate = join2(dir, "skills");
|
|
430
|
-
if (existsSync(candidate))
|
|
431
|
-
return join2(candidate, SKILL_FILES[skill]);
|
|
432
|
-
const parent = resolve(dir, "..");
|
|
433
|
-
if (parent === dir) {
|
|
434
|
-
throw new Error(`skill file missing from CLI installation (could not locate skills/ directory from: ${thisDir})`);
|
|
435
|
-
}
|
|
436
|
-
dir = parent;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
function formatCustomPromptBanner(skill, path) {
|
|
440
|
-
return `WARNING: Custom prompt active for ${skill}: ${path}
|
|
441
|
-
Bundled invariants (utility-wrapper rejection, description content rules) do NOT apply.
|
|
442
|
-
You are responsible for the prompt's correctness.
|
|
443
|
-
`;
|
|
444
|
-
}
|
|
445
|
-
async function readSkillFile(skill, override) {
|
|
446
|
-
if (override) {
|
|
447
|
-
const skillPath2 = resolve(override);
|
|
448
|
-
try {
|
|
449
|
-
return await readFile2(skillPath2, "utf8");
|
|
450
|
-
} catch {
|
|
451
|
-
throw new Error(`custom prompt file not found (skill: ${skill}, path: ${skillPath2})`);
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
const skillPath = resolveSkillPath(skill);
|
|
455
|
-
try {
|
|
456
|
-
return await readFile2(skillPath, "utf8");
|
|
457
|
-
} catch {
|
|
458
|
-
throw new Error(`skill file missing from CLI installation \u2014 try reinstalling the CLI (looked for: ${skillPath})`);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
526
|
+
// packages/experience-design-system-generation/dist/src/services/prompts/helpers/build-preamble.js
|
|
461
527
|
function buildPreamble(options) {
|
|
462
528
|
const { skill, rawComponentsInline, rawTokensInline, rawTokensFilename, tokensInline, tokenMapInline, generatedCdf, tokenTree, componentSourceRefs, existingComponentsInline, existingTokensInline, componentAllowlistInline } = options;
|
|
463
529
|
const sections = [];
|
|
@@ -513,44 +579,10 @@ ${JSON.stringify(filteredTokenProps.filtered)}
|
|
|
513
579
|
\`\`\``);
|
|
514
580
|
}
|
|
515
581
|
if (tokenTree) {
|
|
516
|
-
|
|
517
|
-
sections.push(section2);
|
|
518
|
-
}
|
|
582
|
+
sections.push(...buildTokenCandidateSections(tokenTree, filteredTokenProps));
|
|
519
583
|
}
|
|
520
584
|
if (componentSourceRefs && componentSourceRefs.length > 0) {
|
|
521
|
-
|
|
522
|
-
const withoutContent = componentSourceRefs.filter((ref) => ref.content == null);
|
|
523
|
-
if (withContent.length > 0) {
|
|
524
|
-
const blocks = withContent.map((ref) => {
|
|
525
|
-
const mainBlock = `#### ${ref.component} (\`${ref.sourcePath}\`)
|
|
526
|
-
\`\`\`${inferFenceLang(ref.sourcePath)}
|
|
527
|
-
${ref.content}
|
|
528
|
-
\`\`\``;
|
|
529
|
-
const siblingBlocks = (ref.siblingFiles ?? []).map((sibling) => `##### ${ref.component} \u2014 imported file \`${sibling.path}\`
|
|
530
|
-
\`\`\`${inferFenceLang(sibling.path)}
|
|
531
|
-
${sibling.content}
|
|
532
|
-
\`\`\``);
|
|
533
|
-
const truncationNote = ref.truncatedSiblingCount && ref.truncatedSiblingCount > 0 ? [
|
|
534
|
-
`##### ${ref.component} \u2014 +${ref.truncatedSiblingCount} more imported file${ref.truncatedSiblingCount === 1 ? "" : "s"} not shown (evidence may be incomplete)`
|
|
535
|
-
] : [];
|
|
536
|
-
const notShownNote = ref.usesNotShown && ref.usesNotShown.length > 0 ? [
|
|
537
|
-
`##### ${ref.component} \u2014 uses not shown: ${ref.usesNotShown.join(", ")}
|
|
538
|
-
|
|
539
|
-
The files above are excerpts, and each of these properties has at least one use that fell outside the excerpt budget. Treat their consumption as unknown, not absent: do not classify them \`token\` on what is shown, and do not conclude they are unread.`
|
|
540
|
-
] : [];
|
|
541
|
-
return [mainBlock, ...siblingBlocks, ...truncationNote, ...notShownNote].join("\n\n");
|
|
542
|
-
});
|
|
543
|
-
sections.push(`### Component source references
|
|
544
|
-
|
|
545
|
-
${blocks.join("\n\n")}`);
|
|
546
|
-
}
|
|
547
|
-
if (withoutContent.length > 0) {
|
|
548
|
-
const guidance = skill === "components" ? "there is no consumption evidence for these, so `token` cannot be earned for any of their props \u2014 classify from the prop signature alone, and any prop that would otherwise be enum-versus-token is `enum` (or `string`)" : "there is no source evidence to narrow from \u2014 emit nothing for their props";
|
|
549
|
-
sections.push(`Component source unavailable for (JSON) \u2014 ${guidance}:
|
|
550
|
-
\`\`\`json
|
|
551
|
-
${JSON.stringify(withoutContent.map((ref) => ({ component: ref.component, sourcePath: ref.sourcePath })))}
|
|
552
|
-
\`\`\``);
|
|
553
|
-
}
|
|
585
|
+
sections.push(...formatSourceRefsSection(componentSourceRefs, skill));
|
|
554
586
|
}
|
|
555
587
|
const inputBlock = sections.length > 0 ? `
|
|
556
588
|
|
|
@@ -563,6 +595,16 @@ ${sections.join("\n\n")}` : "";
|
|
|
563
595
|
return buildMapTokensAutonomousPreamble(inputBlock);
|
|
564
596
|
return buildTokensAutonomousPreamble(inputBlock);
|
|
565
597
|
}
|
|
598
|
+
var init_build_preamble = __esm({
|
|
599
|
+
"packages/experience-design-system-generation/dist/src/services/prompts/helpers/build-preamble.js"() {
|
|
600
|
+
"use strict";
|
|
601
|
+
init_format_token_candidates();
|
|
602
|
+
init_format_source_refs();
|
|
603
|
+
init_build_skill_preambles();
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
|
|
607
|
+
// packages/experience-design-system-generation/dist/src/services/prompts/build-prompt.js
|
|
566
608
|
async function buildPrompt(options) {
|
|
567
609
|
const skillContent = options.skillContentOverride ?? await readSkillFile(options.skill, options.skillPathOverride);
|
|
568
610
|
const preamble = buildPreamble(options);
|
|
@@ -572,18 +614,12 @@ Skill instructions follow:
|
|
|
572
614
|
---
|
|
573
615
|
${skillContent}`;
|
|
574
616
|
}
|
|
575
|
-
var SKILL_FILES;
|
|
576
617
|
var init_build_prompt = __esm({
|
|
577
618
|
"packages/experience-design-system-generation/dist/src/services/prompts/build-prompt.js"() {
|
|
578
619
|
"use strict";
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
components: "generate-components.md",
|
|
583
|
-
tokens: "generate-tokens.md",
|
|
584
|
-
select: "select-components.md",
|
|
585
|
-
"map-tokens": "map-tokens.md"
|
|
586
|
-
};
|
|
620
|
+
init_resolve_skill_file();
|
|
621
|
+
init_build_preamble();
|
|
622
|
+
init_resolve_skill_file();
|
|
587
623
|
}
|
|
588
624
|
});
|
|
589
625
|
|
|
@@ -614,17 +650,10 @@ function resolveAgentBinary(agent) {
|
|
|
614
650
|
return override.trim();
|
|
615
651
|
return AGENT_BINARIES[agent];
|
|
616
652
|
}
|
|
617
|
-
var AGENT_BINARIES;
|
|
618
653
|
var init_resolve_agent_binary = __esm({
|
|
619
654
|
"packages/experience-design-system-generation/dist/src/services/agent/helpers/resolve-agent-binary.js"() {
|
|
620
655
|
"use strict";
|
|
621
|
-
|
|
622
|
-
claude: "claude",
|
|
623
|
-
codex: "codex",
|
|
624
|
-
opencode: "opencode",
|
|
625
|
-
cursor: "cursor-agent",
|
|
626
|
-
copilot: "copilot"
|
|
627
|
-
};
|
|
656
|
+
init_agent_names();
|
|
628
657
|
}
|
|
629
658
|
});
|
|
630
659
|
|
|
@@ -693,13 +722,19 @@ var init_build_agent_args = __esm({
|
|
|
693
722
|
}
|
|
694
723
|
});
|
|
695
724
|
|
|
696
|
-
// packages/experience-design-system-generation/dist/src/services/agent/
|
|
697
|
-
import { spawn } from "node:child_process";
|
|
725
|
+
// packages/experience-design-system-generation/dist/src/services/agent/helpers/describe-agent-failure.js
|
|
698
726
|
function describeAgentFailure(result, maxDetail = 800) {
|
|
699
727
|
const base = result.exitCode !== 0 ? `agent exited with code ${result.exitCode}` : "agent produced no tool calls";
|
|
700
728
|
const detail = (result.stderr.trim() || result.stdout.trim()).slice(-maxDetail).trim();
|
|
701
729
|
return detail ? `${base} \u2014 ${detail}` : base;
|
|
702
730
|
}
|
|
731
|
+
var init_describe_agent_failure = __esm({
|
|
732
|
+
"packages/experience-design-system-generation/dist/src/services/agent/helpers/describe-agent-failure.js"() {
|
|
733
|
+
"use strict";
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
// packages/experience-design-system-generation/dist/src/services/agent/helpers/extract-sentinel-output.js
|
|
703
738
|
function extractSentinelOutput(stdout) {
|
|
704
739
|
const START = "<<<EDS_OUTPUT_START>>>";
|
|
705
740
|
const END = "<<<EDS_OUTPUT_END>>>";
|
|
@@ -716,6 +751,14 @@ function extractSentinelOutput(stdout) {
|
|
|
716
751
|
return "multiple";
|
|
717
752
|
return stdout.slice(startIdx + START.length, endIdx).trim();
|
|
718
753
|
}
|
|
754
|
+
var init_extract_sentinel_output = __esm({
|
|
755
|
+
"packages/experience-design-system-generation/dist/src/services/agent/helpers/extract-sentinel-output.js"() {
|
|
756
|
+
"use strict";
|
|
757
|
+
}
|
|
758
|
+
});
|
|
759
|
+
|
|
760
|
+
// packages/experience-design-system-generation/dist/src/services/agent/run-agent.js
|
|
761
|
+
import { spawn } from "node:child_process";
|
|
719
762
|
async function runAgent(options) {
|
|
720
763
|
const { agent, prompt, timeoutMs, model, onOutput, promptViaStdin, onDebugEvent } = options;
|
|
721
764
|
const bedrock = options.bedrock ?? process.env.EDS_BEDROCK === "1";
|
|
@@ -764,12 +807,7 @@ async function runAgent(options) {
|
|
|
764
807
|
});
|
|
765
808
|
child.on("close", (code, signal) => {
|
|
766
809
|
clearTimeout(timer);
|
|
767
|
-
const result = {
|
|
768
|
-
exitCode: signal ? 1 : code ?? 1,
|
|
769
|
-
stdout,
|
|
770
|
-
stderr,
|
|
771
|
-
timedOut
|
|
772
|
-
};
|
|
810
|
+
const result = { exitCode: signal ? 1 : code ?? 1, stdout, stderr, timedOut };
|
|
773
811
|
onDebugEvent?.("run.end", {
|
|
774
812
|
agent,
|
|
775
813
|
model,
|
|
@@ -790,25 +828,14 @@ var init_run_agent = __esm({
|
|
|
790
828
|
"use strict";
|
|
791
829
|
init_resolve_agent_binary();
|
|
792
830
|
init_build_agent_args();
|
|
831
|
+
init_describe_agent_failure();
|
|
832
|
+
init_extract_sentinel_output();
|
|
793
833
|
}
|
|
794
834
|
});
|
|
795
835
|
|
|
796
|
-
// packages/experience-design-system-generation/dist/src/services/agent/helpers/check-
|
|
836
|
+
// packages/experience-design-system-generation/dist/src/services/agent/helpers/check-claude-auth.js
|
|
797
837
|
import { spawn as spawn2 } from "node:child_process";
|
|
798
|
-
|
|
799
|
-
const binary = resolveAgentBinary(agent);
|
|
800
|
-
const binaryExists2 = await new Promise((resolve21) => {
|
|
801
|
-
if (binary.startsWith("/")) {
|
|
802
|
-
import("node:fs/promises").then((fs2) => fs2.access(binary).then(() => resolve21(true), () => resolve21(false)));
|
|
803
|
-
return;
|
|
804
|
-
}
|
|
805
|
-
const child = spawn2(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
806
|
-
child.on("close", (code) => resolve21(code === 0));
|
|
807
|
-
});
|
|
808
|
-
if (!binaryExists2)
|
|
809
|
-
return "not-found";
|
|
810
|
-
if (agent !== "claude")
|
|
811
|
-
return "ok";
|
|
838
|
+
function checkClaudeAuth(binary) {
|
|
812
839
|
return new Promise((resolve21) => {
|
|
813
840
|
const child = spawn2(binary, ["auth", "status", "--json"], {
|
|
814
841
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -843,10 +870,35 @@ async function checkAgentAuth(agent) {
|
|
|
843
870
|
});
|
|
844
871
|
});
|
|
845
872
|
}
|
|
873
|
+
var init_check_claude_auth = __esm({
|
|
874
|
+
"packages/experience-design-system-generation/dist/src/services/agent/helpers/check-claude-auth.js"() {
|
|
875
|
+
"use strict";
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
// packages/experience-design-system-generation/dist/src/services/agent/helpers/check-agent-auth.js
|
|
880
|
+
import { spawn as spawn3 } from "node:child_process";
|
|
881
|
+
async function checkAgentAuth(agent) {
|
|
882
|
+
const binary = resolveAgentBinary(agent);
|
|
883
|
+
const binaryExists2 = await new Promise((resolve21) => {
|
|
884
|
+
if (binary.startsWith("/")) {
|
|
885
|
+
import("node:fs/promises").then((fs2) => fs2.access(binary).then(() => resolve21(true), () => resolve21(false)));
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
const child = spawn3(process.platform === "win32" ? "where" : "which", [binary], { stdio: "ignore" });
|
|
889
|
+
child.on("close", (code) => resolve21(code === 0));
|
|
890
|
+
});
|
|
891
|
+
if (!binaryExists2)
|
|
892
|
+
return "not-found";
|
|
893
|
+
if (agent !== "claude")
|
|
894
|
+
return "ok";
|
|
895
|
+
return checkClaudeAuth(binary);
|
|
896
|
+
}
|
|
846
897
|
var init_check_agent_auth = __esm({
|
|
847
898
|
"packages/experience-design-system-generation/dist/src/services/agent/helpers/check-agent-auth.js"() {
|
|
848
899
|
"use strict";
|
|
849
900
|
init_resolve_agent_binary();
|
|
901
|
+
init_check_claude_auth();
|
|
850
902
|
}
|
|
851
903
|
});
|
|
852
904
|
|
|
@@ -1182,6 +1234,7 @@ var init_progress = __esm({
|
|
|
1182
1234
|
// packages/experience-design-system-generation/dist/src/index.js
|
|
1183
1235
|
var src_exports = {};
|
|
1184
1236
|
__export(src_exports, {
|
|
1237
|
+
AGENT_BINARIES: () => AGENT_BINARIES,
|
|
1185
1238
|
AGENT_NAMES: () => AGENT_NAMES,
|
|
1186
1239
|
DEFAULT_AGENT_NAME: () => DEFAULT_AGENT_NAME,
|
|
1187
1240
|
agentSupportsBedrock: () => agentSupportsBedrock,
|
|
@@ -18890,9 +18943,9 @@ var init_wizard_generate_progress = __esm({
|
|
|
18890
18943
|
});
|
|
18891
18944
|
|
|
18892
18945
|
// packages/experience-design-system-cli-legacy/src/import/tui/spawn-generate.ts
|
|
18893
|
-
import { spawn as
|
|
18946
|
+
import { spawn as spawn4 } from "node:child_process";
|
|
18894
18947
|
function spawnGenerateChild(opts) {
|
|
18895
|
-
const child =
|
|
18948
|
+
const child = spawn4(opts.command, opts.args);
|
|
18896
18949
|
let stdout = "";
|
|
18897
18950
|
let stderr = "";
|
|
18898
18951
|
child.stdout?.on("data", (d) => {
|
|
@@ -27205,7 +27258,7 @@ import { join as join20, resolve as resolve17 } from "node:path";
|
|
|
27205
27258
|
import { appendFileSync as appendFileSync2, writeFileSync } from "node:fs";
|
|
27206
27259
|
import { access as access7, stat as stat5, writeFile as writeFile6 } from "node:fs/promises";
|
|
27207
27260
|
import { tmpdir } from "node:os";
|
|
27208
|
-
import { execFile as execFile2, spawn as
|
|
27261
|
+
import { execFile as execFile2, spawn as spawn5 } from "node:child_process";
|
|
27209
27262
|
import { mkdir as mkdir5 } from "node:fs/promises";
|
|
27210
27263
|
import { buildCDF as buildCDF3, validateCDF as validateCDF3, validateSlotReferences as validateSlotReferences2 } from "@contentful/experience-design-system-types";
|
|
27211
27264
|
import { jsx as jsx50, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
@@ -27267,7 +27320,7 @@ function runCli(args) {
|
|
|
27267
27320
|
}
|
|
27268
27321
|
function runSpawnedCli(args, onStderr, onStdout) {
|
|
27269
27322
|
return new Promise((res) => {
|
|
27270
|
-
const child =
|
|
27323
|
+
const child = spawn5("node", args);
|
|
27271
27324
|
let stdout = "";
|
|
27272
27325
|
let stderr = "";
|
|
27273
27326
|
child.stdout.on("data", (d) => {
|
|
@@ -29562,7 +29615,7 @@ var init_agent_definitions = __esm({
|
|
|
29562
29615
|
});
|
|
29563
29616
|
|
|
29564
29617
|
// packages/experience-design-system-cli-legacy/src/setup/lib/shell.ts
|
|
29565
|
-
import { execFile as execFile3, spawn as
|
|
29618
|
+
import { execFile as execFile3, spawn as spawn6 } from "node:child_process";
|
|
29566
29619
|
import { access as access8 } from "node:fs/promises";
|
|
29567
29620
|
import { promisify as promisify2 } from "node:util";
|
|
29568
29621
|
async function binaryExists(name) {
|
|
@@ -29578,7 +29631,7 @@ async function pathExists3(path) {
|
|
|
29578
29631
|
}
|
|
29579
29632
|
function runSpawn(cmd, args, opts = {}) {
|
|
29580
29633
|
return new Promise((resolve21) => {
|
|
29581
|
-
const child =
|
|
29634
|
+
const child = spawn6(cmd, args, {
|
|
29582
29635
|
cwd: opts.cwd,
|
|
29583
29636
|
env: opts.env ?? process.env,
|
|
29584
29637
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -32008,7 +32061,7 @@ __export(program_exports, {
|
|
|
32008
32061
|
resolveBedrockFromAncestors: () => resolveBedrockFromAncestors,
|
|
32009
32062
|
runBuild: () => runBuild
|
|
32010
32063
|
});
|
|
32011
|
-
import { spawn as
|
|
32064
|
+
import { spawn as spawn7 } from "node:child_process";
|
|
32012
32065
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
32013
32066
|
import { dirname as dirname13, join as join26, resolve as resolve20 } from "node:path";
|
|
32014
32067
|
import { readFileSync as readFileSync10 } from "node:fs";
|
|
@@ -32043,7 +32096,7 @@ function registerBuildCommand(program) {
|
|
|
32043
32096
|
const pkgRoot = resolve20(dirname13(fileURLToPath4(import.meta.url)), "..", "..");
|
|
32044
32097
|
process.stderr.write("\u2699 Building from source...\n");
|
|
32045
32098
|
const { exitCode } = await runBuild({
|
|
32046
|
-
spawnFn: () =>
|
|
32099
|
+
spawnFn: () => spawn7("pnpm", ["build"], { cwd: pkgRoot, stdio: "inherit" }),
|
|
32047
32100
|
stderrWrite: (s) => process.stderr.write(s)
|
|
32048
32101
|
});
|
|
32049
32102
|
process.exit(exitCode);
|
package/legacy/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.35.1-dev-build-
|
|
3
|
+
"version": "2.35.1-dev-build-45d6c918.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"svelte": "^5.56.4",
|
|
42
42
|
"ts-morph": "^27.0.2",
|
|
43
43
|
"typescript": "^5.9.3",
|
|
44
|
-
"@contentful/experience-design-system-types": "2.35.1-dev-build-
|
|
44
|
+
"@contentful/experience-design-system-types": "2.35.1-dev-build-45d6c918.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@tsconfig/node24": "^24.0.4",
|