@contentful/experience-design-system-cli 2.37.1-dev-build-f0533497.0 → 2.37.1-dev-build-1c5cd11a.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-f0533497.0",
3
+ "version": "2.37.1-dev-build-1c5cd11a.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,7 +39,6 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@contentful/experience-design-system-backend-pipeline": "workspace:*",
42
- "@contentful/experience-design-system-generation": "workspace:*",
43
42
  "@contentful/experience-design-system-types": "workspace:*",
44
43
  "@inkjs/ui": "^2.0.0",
45
44
  "@segment/analytics-node": "^3.0.0",
@@ -7,23 +7,11 @@ export interface CacheCheckInput {
7
7
  existingEntitiesPath: string | null;
8
8
  noCache: boolean;
9
9
  }
10
- interface CacheCheckProcess {
11
- exitCode: number;
12
- stdout: string;
13
- stderr: string;
14
- }
15
- /** Runs the legacy CLI with these arguments and waits for it to exit. */
16
- export type RunLegacyCli = (args: string[]) => Promise<CacheCheckProcess>;
17
- /**
18
- * The arguments of `generate components --cache-status --restore-cache`, in the order the wizard built them: the
19
- * generate arguments first, then the two cache flags. Arguments are not shell-quoted; they go straight to `node`.
20
- */
21
- export declare function buildCacheCheckArgs(input: CacheCheckInput): string[];
22
- /** The names on the `cache-components=["A","B"]` line. Anything missing or unreadable is an empty list. */
23
- export declare function parseCacheComponents(stdout: string): string[];
24
10
  /**
25
- * Never throws: any failure (spawn error, non-zero exit, no output line, bad JSON) resolves to an empty list. With the
26
- * cache off there is nothing to restore, so the command is not run at all.
11
+ * Runs the generation cache check in-process while the scope gate is open.
12
+ * Restores cached CDF entries into the pipeline database as a side-effect so
13
+ * the generate run that follows can skip them. A failed check is
14
+ * indistinguishable from "nothing cached", as in legacy. INTEG-5050 tracks
15
+ * surfacing it.
27
16
  */
28
- export declare function checkGenerationCache(input: CacheCheckInput, run?: RunLegacyCli): Promise<string[]>;
29
- export {};
17
+ export declare function checkGenerationCache(input: CacheCheckInput): Promise<string[]>;
@@ -1,22 +1,5 @@
1
1
  import type { GenerationProgress } from './types.js';
2
2
  export declare function initialProgress(): GenerationProgress;
3
- /**
4
- * Folds a chunk of `__generate components` stderr into the progress. Two line shapes carry it:
5
- * 1. `progress=generate:<done>/<total>:<name>`, emitted when a component finishes. `done` is the count of finished
6
- * components and never goes down.
7
- * 2. `[<index>/<total>] <name>`, emitted when a component starts (and again on a retry). With more than one worker its
8
- * index is the worker's starting position, not a count of completions, so it must only change `current`.
9
- */
10
- export declare function applyGenerateStderr(chunk: string, previous: GenerationProgress['components']): GenerationProgress['components'];
11
- /** The session, the component count and the renamed-slot count from the command's output. */
12
- export declare function parseGenerateResult(output: {
13
- stdout: string;
14
- stderr: string;
15
- }, fallbackCount: number): {
16
- generateSessionId: string | null;
17
- generatedCount: number;
18
- renamedSlotsCount: number;
19
- };
20
3
  /** Token mapping runs only when there is something to map and tokens to map it from. */
21
4
  export declare function shouldRunMapTokens(counts: {
22
5
  mappablePropCount: number;
@@ -1,24 +1,20 @@
1
- import { checkAgentAuth } from '@contentful/experience-design-system-generation';
2
- import { type CacheCheckInput } from '../07-scope-gate/cache-check.js';
1
+ import { checkAgentAuth, runGenerateComponentsSession, runMapTokens } from '@contentful/experience-design-system-backend-pipeline';
3
2
  import { prepareMapTokens } from './map-tokens.js';
4
- import { runMapTokens, spawnGenerate } from './processes.js';
5
3
  import { saveDecisions } from './save-decisions.js';
6
4
  import type { GenerationInput, GenerationProgress, GenerationResult } from './types.js';
7
- /** The outside world the stage talks to, so the order of events can be tested without a database, an agent or a CLI. */
8
5
  export interface GenerationDeps {
9
6
  checkAgentAuth: typeof checkAgentAuth;
10
7
  saveDecisions: typeof saveDecisions;
11
- checkCache: (input: CacheCheckInput) => Promise<string[]>;
12
- spawnGenerate: typeof spawnGenerate;
13
- prepareMapTokens: typeof prepareMapTokens;
8
+ runGenerate: typeof runGenerateComponentsSession;
14
9
  runMapTokens: typeof runMapTokens;
10
+ prepareMapTokens: typeof prepareMapTokens;
15
11
  }
16
12
  /**
17
13
  * The whole stage, in the order the wizard ran it:
18
14
  * 1. Wait for the cache check that ran while the scope gate was open, then save the decisions. Both write to the
19
- * pipeline database and the cache has to be restored first. With nothing accepted the stage ends here, as the wizard's did.
20
- * 2. If every accepted component is in the cache, take them all from it. Otherwise look at the cache again, because the
21
- * earlier answer was read before the decisions were saved, and generate only what is still missing.
15
+ * pipeline database and the cache has to be restored first. With nothing accepted the stage ends here.
16
+ * 2. Generate the accepted components in-process. The orchestrator handles per-component cache lookup, so the names
17
+ * from the cache check are forwarded as `precomputedCachedNames` to skip a redundant lookup.
22
18
  * 3. Map tokens onto the generated session. Skipped when there is nothing to map.
23
19
  * A failed token mapping after a successful generation is an error to show. It neither retries nor throws away what was
24
20
  * generated.
@@ -24413,6 +24413,107 @@ var init_run_generate_tokens_session = __esm({
24413
24413
  }
24414
24414
  });
24415
24415
 
24416
+ // packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/build-empty-session-response.js
24417
+ var init_build_empty_session_response = __esm({
24418
+ "packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/build-empty-session-response.js"() {
24419
+ "use strict";
24420
+ }
24421
+ });
24422
+
24423
+ // packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/collect-duplicate-names.js
24424
+ var init_collect_duplicate_names = __esm({
24425
+ "packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/collect-duplicate-names.js"() {
24426
+ "use strict";
24427
+ }
24428
+ });
24429
+
24430
+ // packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/filter-dropped-allowed-components.js
24431
+ var init_filter_dropped_allowed_components = __esm({
24432
+ "packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/filter-dropped-allowed-components.js"() {
24433
+ "use strict";
24434
+ init_db2();
24435
+ }
24436
+ });
24437
+
24438
+ // packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/read-existing-entities.js
24439
+ var init_read_existing_entities = __esm({
24440
+ "packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/read-existing-entities.js"() {
24441
+ "use strict";
24442
+ init_read_from_session();
24443
+ }
24444
+ });
24445
+
24446
+ // packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/resolve-generate-prompt.js
24447
+ var init_resolve_generate_prompt = __esm({
24448
+ "packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/resolve-generate-prompt.js"() {
24449
+ "use strict";
24450
+ init_parse_prompt_overrides();
24451
+ init_resolve_prompt_override();
24452
+ }
24453
+ });
24454
+
24455
+ // packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/run-one-generate-component.js
24456
+ var DEFAULT_TIMEOUT_MS6, RETRY_BACKOFF_MS2;
24457
+ var init_run_one_generate_component = __esm({
24458
+ "packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/run-one-generate-component.js"() {
24459
+ "use strict";
24460
+ init_build_prompt2();
24461
+ init_describe_agent_failure2();
24462
+ init_invoke_agent_with_output();
24463
+ init_parse_tool_calls();
24464
+ init_db2();
24465
+ init_normalize_component_for_cache();
24466
+ init_resolve_component_cache();
24467
+ init_summarize_for_generate();
24468
+ DEFAULT_TIMEOUT_MS6 = Number(process.env["EDS_AGENT_TIMEOUT_MS"] ?? 5 * 60 * 1e3);
24469
+ RETRY_BACKOFF_MS2 = Number(process.env["EDS_RETRY_BACKOFF_MS"] ?? 5e3);
24470
+ }
24471
+ });
24472
+
24473
+ // packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/run-with-pool.js
24474
+ var init_run_with_pool = __esm({
24475
+ "packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/helpers/run-with-pool.js"() {
24476
+ "use strict";
24477
+ }
24478
+ });
24479
+
24480
+ // packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/check-generate-components-cache.js
24481
+ var init_check_generate_components_cache = __esm({
24482
+ "packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/check-generate-components-cache.js"() {
24483
+ "use strict";
24484
+ init_summarize_for_map_tokens();
24485
+ init_resolve_component_cache();
24486
+ init_normalize_component_for_cache();
24487
+ init_db2();
24488
+ init_cache_keys2();
24489
+ init_src3();
24490
+ init_read_existing_entities();
24491
+ init_resolve_generate_prompt();
24492
+ }
24493
+ });
24494
+
24495
+ // packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/run-generate-components-session.js
24496
+ var DEFAULT_COMPONENT_CONCURRENCY2;
24497
+ var init_run_generate_components_session = __esm({
24498
+ "packages/experience-design-system-backend-pipeline/dist/src/orchestrators/run-generate-components-session/run-generate-components-session.js"() {
24499
+ "use strict";
24500
+ init_create_local_cli_agent_invoker();
24501
+ init_db2();
24502
+ init_cache_keys2();
24503
+ init_src3();
24504
+ init_summarize_for_map_tokens();
24505
+ init_build_empty_session_response();
24506
+ init_collect_duplicate_names();
24507
+ init_filter_dropped_allowed_components();
24508
+ init_read_existing_entities();
24509
+ init_resolve_generate_prompt();
24510
+ init_run_one_generate_component();
24511
+ init_run_with_pool();
24512
+ init_check_generate_components_cache();
24513
+ DEFAULT_COMPONENT_CONCURRENCY2 = Number(process.env["EDS_GENERATE_CONCURRENCY"] ?? 10);
24514
+ }
24515
+ });
24516
+
24416
24517
  // packages/experience-design-system-backend-pipeline/dist/src/index.js
24417
24518
  var init_src5 = __esm({
24418
24519
  "packages/experience-design-system-backend-pipeline/dist/src/index.js"() {
@@ -24528,6 +24629,7 @@ var init_src5 = __esm({
24528
24629
  init_component();
24529
24630
  init_run_extract_and_compose_session();
24530
24631
  init_run_generate_tokens_session();
24632
+ init_run_generate_components_session();
24531
24633
  }
24532
24634
  });
24533
24635
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-f0533497.0",
3
+ "version": "2.37.1-dev-build-1c5cd11a.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -39,7 +39,6 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@contentful/experience-design-system-backend-pipeline": "workspace:*",
42
- "@contentful/experience-design-system-generation": "workspace:*",
43
42
  "@contentful/experience-design-system-types": "workspace:*",
44
43
  "@inkjs/ui": "^2.0.0",
45
44
  "@segment/analytics-node": "^3.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-f0533497.0",
3
+ "version": "2.37.1-dev-build-1c5cd11a.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,9 +45,8 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-types": "2.37.1-dev-build-f0533497.0",
49
- "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-f0533497.0",
50
- "@contentful/experience-design-system-generation": "2.37.1-dev-build-f0533497.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-1c5cd11a.0",
49
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-1c5cd11a.0"
51
50
  },
52
51
  "devDependencies": {
53
52
  "@tsconfig/node24": "^24.0.4",
@@ -1,42 +0,0 @@
1
- export interface GenerateCommand {
2
- sessionId: string;
3
- tokensPath: string;
4
- agent: string;
5
- agentModel?: string;
6
- promptOverrides: string[];
7
- generatePromptPath?: string;
8
- noCache: boolean;
9
- existingEntitiesPath: string | null;
10
- /** Accepted components the cache already holds, so the command skips them. */
11
- cachedComponents: string[];
12
- }
13
- export interface MapTokensCommand {
14
- sessionId: string;
15
- agent: string;
16
- agentModel?: string;
17
- promptOverrides: string[];
18
- noCache: boolean;
19
- existingEntitiesPath: string | null;
20
- }
21
- export interface SpawnedResult {
22
- exitCode: number;
23
- stdout: string;
24
- stderr: string;
25
- }
26
- /**
27
- * `__generate components …`, in the order the wizard builds the arguments. The cache was already restored by the check
28
- * that ran while the scope gate was open, so `--restore-cache` is not passed here; what the cache holds goes in
29
- * `--cached-components` instead.
30
- */
31
- export declare function buildGenerateArgs(cliPath: string, command: GenerateCommand): string[];
32
- /** `map tokens …`, in the order the wizard builds the arguments. */
33
- export declare function buildMapTokensArgs(command: MapTokensCommand): string[];
34
- /**
35
- * Runs `__generate components`, delivering stderr as it arrives. Resolves on close, not exit, so the child's stdio and
36
- * any file handles it inherited (the pipeline database's WAL and SHM files) are released before anything else touches
37
- * the database.
38
- */
39
- export declare function spawnGenerate(command: GenerateCommand, handlers: {
40
- onStderr: (chunk: string) => void;
41
- }): Promise<SpawnedResult>;
42
- export declare function runMapTokens(command: MapTokensCommand): Promise<SpawnedResult>;