@contentful/experience-design-system-cli 2.32.1-dev-build-6b922ec.0 → 2.32.1-dev-build-b7d2d34.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.
Files changed (49) hide show
  1. package/dist/package.json +1 -2
  2. package/dist/src/credentials-store.d.ts +23 -0
  3. package/dist/src/helpers/build-contentful-management-client.d.ts +7 -0
  4. package/dist/src/helpers/fetch-and-persist-existing-contentful-entities.d.ts +29 -0
  5. package/dist/src/helpers/fetch-existing-contentful-entities.d.ts +11 -0
  6. package/dist/src/helpers/find-nearly-matching-component.d.ts +7 -0
  7. package/dist/src/helpers/read-existing-contentful-entities-from-session.d.ts +7 -0
  8. package/dist/src/helpers/summarize-existing-contentful-entities.d.ts +50 -0
  9. package/dist/src/import/orchestrator.d.ts +0 -1
  10. package/dist/src/import/tui/WizardApp.d.ts +3 -0
  11. package/dist/src/index.js +1304 -1537
  12. package/dist/src/session/cache-keys.d.ts +1 -1
  13. package/dist/src/setup/analytics-prompt.d.ts +13 -0
  14. package/dist/src/setup/auto-filter-prompt.d.ts +13 -0
  15. package/dist/src/setup/command.d.ts +13 -4
  16. package/dist/src/setup/composition-mode-prompt.d.ts +14 -0
  17. package/dist/src/setup/debug-mode-prompt.d.ts +11 -0
  18. package/package.json +6 -7
  19. package/skills/generate-components.md +27 -0
  20. package/skills/map-tokens.md +12 -0
  21. package/skills/select-components.md +11 -0
  22. package/dist/src/doctor/checks.d.ts +0 -5
  23. package/dist/src/doctor/command.d.ts +0 -7
  24. package/dist/src/doctor/report.d.ts +0 -12
  25. package/dist/src/helpers/cma-client.d.ts +0 -17
  26. package/dist/src/helpers/fetch-existing-entities.d.ts +0 -16
  27. package/dist/src/lib/agent-definitions.d.ts +0 -7
  28. package/dist/src/setup/lib/checks.d.ts +0 -69
  29. package/dist/src/setup/lib/layout.d.ts +0 -34
  30. package/dist/src/setup/lib/prompt-input.d.ts +0 -17
  31. package/dist/src/setup/lib/shell.d.ts +0 -15
  32. package/dist/src/setup/lib/types.d.ts +0 -55
  33. package/dist/src/setup/lib/yes-no-prompt.d.ts +0 -8
  34. package/dist/src/setup/steps/coding-agent.d.ts +0 -2
  35. package/dist/src/setup/steps/contentful.d.ts +0 -2
  36. package/dist/src/setup/steps/preferences/analytics.d.ts +0 -5
  37. package/dist/src/setup/steps/preferences/auto-filter.d.ts +0 -4
  38. package/dist/src/setup/steps/preferences/concurrency.d.ts +0 -3
  39. package/dist/src/setup/steps/preferences/custom-prompts.d.ts +0 -8
  40. package/dist/src/setup/steps/preferences/debug.d.ts +0 -4
  41. package/dist/src/setup/steps/preferences/index.d.ts +0 -41
  42. package/dist/src/setup/steps/preferences/no-color.d.ts +0 -3
  43. package/dist/src/setup/steps/prerequisites/build.d.ts +0 -2
  44. package/dist/src/setup/steps/prerequisites/index.d.ts +0 -8
  45. package/dist/src/setup/steps/prerequisites/node.d.ts +0 -4
  46. package/dist/src/setup/steps/prerequisites/pnpm.d.ts +0 -2
  47. package/dist/src/setup/tui/SetupScreen.d.ts +0 -30
  48. package/dist/src/setup/tui/SetupStepper.d.ts +0 -7
  49. package/dist/src/setup/tui/usePromptInput.d.ts +0 -19
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.32.1-dev-build-6b922ec.0",
3
+ "version": "2.32.1-dev-build-b7d2d34.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,7 +40,6 @@
40
40
  "dependencies": {
41
41
  "@contentful/experience-design-system-cli-v2": "workspace:*",
42
42
  "@contentful/experience-design-system-types": "workspace:*",
43
- "@inkjs/ui": "^2.0.0",
44
43
  "@segment/analytics-node": "^3.0.0",
45
44
  "@vue/compiler-sfc": "^3.5.31",
46
45
  "commander": "^13.1.0",
@@ -6,13 +6,36 @@ export type ExperiencesCredentials = {
6
6
  host?: string;
7
7
  agent?: string;
8
8
  agentModel?: string;
9
+ /** Feature 8: persisted custom prompt path for `analyze select-agent`. */
9
10
  selectPromptPath?: string;
11
+ /** Feature 8: persisted custom prompt path for `generate components`. */
10
12
  generatePromptPath?: string;
11
13
  autoFilter?: boolean;
14
+ /** Feature: default debug-mode (writes JSONL trace of every decision) for all commands. */
12
15
  debug?: boolean;
16
+ /** Persisted opt-out for anonymous CLI usage analytics, set via `experiences setup`. */
13
17
  analyticsDisabled?: boolean;
18
+ /**
19
+ * Feature (atomic mode): default composition mode. `atomic` (default) imports
20
+ * flat components with no embedded-component hierarchy; `composite` opts into
21
+ * the slot-graph machinery. Resolved `flag > env > this > default`.
22
+ */
14
23
  compositionMode?: CompositionMode;
15
24
  };
25
+ /**
26
+ * Read persisted Contentful credentials.
27
+ *
28
+ * Precedence (INTEG-4410): what the operator saved on disk via
29
+ * `experiences setup` or the wizard's credentials step wins over ambient
30
+ * `CONTENTFUL_*` / `EDS_HOST` env vars. Env vars are still consulted as a
31
+ * fallback when the field on disk is missing or empty — this preserves
32
+ * back-compat for CI / scripts that only export env and never call setup.
33
+ *
34
+ * The pre-INTEG-4410 order (env-first) silently shadowed saved values, so
35
+ * operators who saved a different space via setup kept seeing the env one
36
+ * pre-filled in the wizard. The saved value now wins; the env fallback only
37
+ * fires when the on-disk field is empty.
38
+ */
16
39
  export declare function readExperiencesCredentials(): Promise<ExperiencesCredentials>;
17
40
  export declare function writeExperiencesCredentials(creds: ExperiencesCredentials): Promise<void>;
18
41
  export declare function experiencesCredentialsPath(): string;
@@ -0,0 +1,7 @@
1
+ import { type PlainClientAPI } from 'contentful-management';
2
+ interface BuildContentfulManagementClientOptions {
3
+ cmaToken: string;
4
+ host?: string;
5
+ }
6
+ export declare function buildContentfulManagementClient(opts: BuildContentfulManagementClientOptions): PlainClientAPI;
7
+ export {};
@@ -0,0 +1,29 @@
1
+ import { type ExistingContentfulEntities } from './fetch-existing-contentful-entities.js';
2
+ export interface FetchAndPersistParams {
3
+ spaceId: string;
4
+ environmentId: string;
5
+ cmaToken: string;
6
+ host?: string;
7
+ outDir: string;
8
+ }
9
+ export interface FetchAndPersistSuccess {
10
+ ok: true;
11
+ path: string;
12
+ durationMs: number;
13
+ entities: ExistingContentfulEntities;
14
+ }
15
+ export interface FetchAndPersistFailure {
16
+ ok: false;
17
+ durationMs: number;
18
+ error: string;
19
+ }
20
+ export type FetchAndPersistResult = FetchAndPersistSuccess | FetchAndPersistFailure;
21
+ /**
22
+ * Build the Contentful management client, fetch the target space's Components
23
+ * and DesignTokens, and write the raw payload to `<outDir>/.existing-entities.json`.
24
+ *
25
+ * Never throws — a failure is reported via `ok: false`. Callers own the
26
+ * user-facing step/progress reporting. This helper only handles the mechanical
27
+ * fetch-then-write and returns a structured result.
28
+ */
29
+ export declare function fetchAndPersistExistingContentfulEntities(params: FetchAndPersistParams): Promise<FetchAndPersistResult>;
@@ -0,0 +1,11 @@
1
+ import { type ComponentProps, type DesignTokenProps, type PlainClientAPI } from 'contentful-management';
2
+ export interface ExistingContentfulEntities {
3
+ components: ComponentProps[];
4
+ tokens: DesignTokenProps[];
5
+ }
6
+ interface FetchExistingContentfulEntitiesParams {
7
+ spaceId: string;
8
+ environmentId: string;
9
+ }
10
+ export declare function fetchExistingContentfulEntitiesFromContentful(client: PlainClientAPI, params: FetchExistingContentfulEntitiesParams): Promise<ExistingContentfulEntities>;
11
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { ComponentProps } from 'contentful-management';
2
+ /**
3
+ * Find the space component whose name is closest to the codebase component name,
4
+ * within a small edit budget. Handles case, punctuation, and plural differences
5
+ * so `Btn-Primary` matches `btnPrimary`, and `Cards` matches `Card`.
6
+ */
7
+ export declare function findNearlyMatchingComponent(components: ComponentProps[], codebaseName: string): ComponentProps | undefined;
@@ -0,0 +1,7 @@
1
+ import type { ExistingContentfulEntities } from './fetch-existing-contentful-entities.js';
2
+ /**
3
+ * Read the session file the orchestrator writes after
4
+ * `fetchExistingContentfulEntitiesFromContentful()`. Returns undefined on
5
+ * any failure — this is optional enrichment and must never block the step.
6
+ */
7
+ export declare function readExistingContentfulEntitiesFromSession(path: string | undefined): Promise<ExistingContentfulEntities | undefined>;
@@ -0,0 +1,50 @@
1
+ import type { ExistingContentfulEntities } from './fetch-existing-contentful-entities.js';
2
+ export interface SelectAgentSummary {
3
+ components: Array<{
4
+ id: string;
5
+ name: string;
6
+ description: string;
7
+ }>;
8
+ tokens: {
9
+ count: number;
10
+ kinds: string[];
11
+ };
12
+ }
13
+ export interface GenerateAgentSummary {
14
+ likelyMatch?: {
15
+ id: string;
16
+ name: string;
17
+ designProperties: Array<{
18
+ id: string;
19
+ name: string;
20
+ type: string;
21
+ }>;
22
+ contentProperties: Array<{
23
+ id: string;
24
+ name: string;
25
+ type: string;
26
+ }>;
27
+ slots: Array<{
28
+ id: string;
29
+ name: string;
30
+ }>;
31
+ };
32
+ otherComponents: Array<{
33
+ id: string;
34
+ name: string;
35
+ }>;
36
+ tokens: {
37
+ count: number;
38
+ kinds: string[];
39
+ };
40
+ }
41
+ export interface MapTokensSummary {
42
+ tokens: Array<{
43
+ id: string;
44
+ name: string;
45
+ type: string;
46
+ }>;
47
+ }
48
+ export declare function summarizeForSelectAgent(entities: ExistingContentfulEntities): SelectAgentSummary;
49
+ export declare function summarizeForGenerateAgent(entities: ExistingContentfulEntities, codebaseComponentName: string): GenerateAgentSummary;
50
+ export declare function summarizeForMapTokens(entities: ExistingContentfulEntities): MapTokensSummary;
@@ -28,7 +28,6 @@ export interface PipelineOptions {
28
28
  /** When true, auto-reject cycle participants and retry push instead of surfacing an error. */
29
29
  autoRejectCycles?: boolean;
30
30
  allowDeletions?: boolean;
31
- withSpaceContext?: boolean;
32
31
  compositionMode?: CompositionMode;
33
32
  compositionMap?: string;
34
33
  compositionAgent?: boolean;
@@ -10,6 +10,7 @@ export declare function buildSelectAgentArgs(opts: {
10
10
  bedrock?: boolean;
11
11
  selectPromptPath?: string;
12
12
  noCache?: boolean;
13
+ existingEntitiesPath?: string;
13
14
  }): string[];
14
15
  export type AutoFilterProgress = {
15
16
  n: number;
@@ -27,6 +28,7 @@ export declare function buildGenerateComponentsArgs(opts: {
27
28
  bedrock?: boolean;
28
29
  noCache?: boolean;
29
30
  generatePromptPath?: string;
31
+ existingEntitiesPath?: string;
30
32
  }): string[];
31
33
  export declare function buildMapTokensArgs(opts: {
32
34
  sessionId: string;
@@ -34,6 +36,7 @@ export declare function buildMapTokensArgs(opts: {
34
36
  model?: string;
35
37
  noCache?: boolean;
36
38
  skipAgent?: boolean;
39
+ existingEntitiesPath?: string;
37
40
  }): string[];
38
41
  export declare function shouldRunMapTokens(opts: {
39
42
  mappablePropCount: number;