@contentful/experience-design-system-cli 2.40.1-dev-build-46595419.0 → 2.40.1-dev-build-d17741e4.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.40.1-dev-build-46595419.0",
3
+ "version": "2.40.1-dev-build-d17741e4.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -7,6 +7,28 @@ export type CredentialValues = Record<CredentialField, string>;
7
7
  */
8
8
  export declare function credentialsPurpose(tokensOnly: boolean): string;
9
9
  export declare function normalize(values: CredentialValues): CredentialValues;
10
- export declare function missingField(values: CredentialValues): boolean;
10
+ /** The required fields that are still empty, by name. */
11
+ export declare function missingFields(values: CredentialValues): CredentialField[];
11
12
  export declare function isUnchanged(current: CredentialValues, initial: CredentialValues): boolean;
13
+ export type CredentialAttempt = {
14
+ host: string;
15
+ reason: string;
16
+ };
17
+ /**
18
+ * One rejected attempt as the log records it. The reason is scrubbed of the token first: an API error can echo what it
19
+ * was sent, so the message the user saw may contain it.
20
+ */
21
+ export declare function rejectedAttempt(reason: string, credentials: CredentialValues): CredentialAttempt;
22
+ /**
23
+ * The credentials as the log shows them. `cma_token` is the only key the token may be under: the logger reduces it to
24
+ * "present, N chars", which is enough to spot a truncated paste without writing the secret.
25
+ */
26
+ export declare function credentialsLog(credentials: CredentialValues): Record<string, unknown>;
27
+ /** The log's outputs: where the user ended up, the credentials, which fields they changed (names only), and the rejections. */
28
+ export declare function credentialsOutputs({ outcome, credentials, initial, attempts, }: {
29
+ outcome: 'validated' | 'back';
30
+ credentials: CredentialValues;
31
+ initial: CredentialValues;
32
+ attempts: readonly CredentialAttempt[];
33
+ }): Record<string, unknown>;
12
34
  export {};
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { ImportTarget } from '../00-preflight/logic.js';
2
3
  import { type CredentialValues } from './logic.js';
3
4
  import { type ValidationResult } from './validate.js';
4
5
  export type CredentialsResult = {
@@ -8,6 +9,8 @@ export type CredentialsResult = {
8
9
  skipped: true;
9
10
  };
10
11
  interface CredentialsScreenProps {
12
+ /** What the user chose to import at Preflight; it decides which steps run, so every log notes it. */
13
+ mode: ImportTarget;
11
14
  onDone: (result: CredentialsResult) => void;
12
15
  onBack: () => void;
13
16
  initial?: Partial<CredentialValues>;
@@ -15,5 +18,5 @@ interface CredentialsScreenProps {
15
18
  /** The import only generates tokens, so there are no components to look up in the space. */
16
19
  tokensOnly?: boolean;
17
20
  }
18
- export declare function CredentialsScreen({ onDone, onBack, initial, validate, tokensOnly, }: CredentialsScreenProps): React.ReactElement;
21
+ export declare function CredentialsScreen({ mode, onDone, onBack, initial, validate, tokensOnly, }: CredentialsScreenProps): React.ReactElement;
19
22
  export {};
@@ -1,7 +1,20 @@
1
1
  import type { ExtractAndComposeProgress } from '@contentful/experience-design-system-backend-pipeline';
2
- import type { ExtractionProgress } from './types.js';
2
+ import type { ExtractionInput, ExtractionProgress, ExtractionResult } from './types.js';
3
3
  /** Structured progress events emitted by the orchestrator (extraction + composition). */
4
4
  export type ProgressEvent = ExtractAndComposeProgress;
5
+ /**
6
+ * What the debug log says the stage started with. The credentials come with the input, so the CMA token is only ever put
7
+ * under `cma_token`, which the logger reduces to "present, N chars" (or "not set" when the credentials were skipped).
8
+ */
9
+ export declare function extractionLogInputs(input: ExtractionInput): Record<string, unknown>;
10
+ /**
11
+ * How the stage ended. A failure names the step that failed and its message, scrubbed of the CMA token; the last progress
12
+ * says which of the parallel jobs had finished, failed or was still running.
13
+ */
14
+ export declare function extractionLogOutputs(result: ExtractionResult, progress: ExtractionProgress | undefined, cmaToken: string): {
15
+ outputs: Record<string, unknown>;
16
+ status: 'success' | 'error';
17
+ };
5
18
  /**
6
19
  * Every job the stage will run starts on the first frame, so no row appears later as a surprise. A job that does not
7
20
  * apply stays 'idle' and has no row: existing entities need credentials, and token definitions need a raw tokens file.
@@ -0,0 +1,8 @@
1
+ import type { ScopeComponent, ScopeDecisions } from './types.js';
2
+ /** What the gate starts with: how many components, and what the AI suggested for them. */
3
+ export declare function scopeGateLogInputs(components: ScopeComponent[], tokenCount: number): Record<string, unknown>;
4
+ /**
5
+ * What the user decided. Everything not accepted counts as rejected, so a component the AI accepted and the user never
6
+ * touched shows as left out. Components with the same name share one decision, so names are counted once.
7
+ */
8
+ export declare function scopeGateLogOutputs(components: ScopeComponent[], decisions: ScopeDecisions): Record<string, unknown>;
@@ -1,4 +1,11 @@
1
- import type { GenerationProgress } from './types.js';
1
+ import type { GenerationInput, GenerationProgress, GenerationResult } from './types.js';
2
+ /** What the debug log says the stage started with. The counts are logged, not the lists of names. */
3
+ export declare function generationLogInputs(input: GenerationInput): Record<string, unknown>;
4
+ /** How the stage ended. A failure names the step that failed (save decisions, generate components, map tokens). */
5
+ export declare function generationLogOutputs(result: GenerationResult, progress: GenerationProgress | undefined): {
6
+ outputs: Record<string, unknown>;
7
+ status: 'success' | 'error';
8
+ };
2
9
  export declare function initialProgress(): GenerationProgress;
3
10
  export declare function shouldRunMapTokens(counts: {
4
11
  mappablePropCount: number;
@@ -0,0 +1,21 @@
1
+ import type { FlowState } from './types.js';
2
+ type FlowStep = FlowState['step'];
3
+ /** Where a step's log goes and what it is called. */
4
+ export declare function flowStepRun(step: FlowStep): {
5
+ flow: string;
6
+ step: string;
7
+ menuOption: string;
8
+ };
9
+ /** What a step started with. The token is only ever under `cma_token`, which the logger reduces to "present, N chars". */
10
+ export declare function flowStepInputs(state: FlowState): Record<string, unknown>;
11
+ /**
12
+ * How a step ended. `to` is the state it moved to, or undefined when the import was left while the step was open. A step
13
+ * that ended by moving to the error screen is itself an error, with that screen's step and message, so a failed push or
14
+ * preview names its cause in its own log.
15
+ */
16
+ export declare function flowStepOutputs(from: FlowState, to: FlowState | undefined): {
17
+ outputs: Record<string, unknown>;
18
+ status: 'success' | 'error';
19
+ exitMethod: 'saved' | 'discarded';
20
+ };
21
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { FlowState } from './types.js';
2
+ /**
3
+ * Writes a debug log for every step of the flow. When the step changes it finishes the log of the step that ended, with
4
+ * where it went next, and starts the next one; leaving the import finishes whichever step was open. One hook covers every
5
+ * screen after the review, so none of them has to log for itself.
6
+ */
7
+ export declare function useFlowLog(state: FlowState): void;
@@ -1,5 +1,5 @@
1
1
  import { type AgentName } from '@contentful/experience-design-system-backend-pipeline';
2
- import type { Snapshot } from '../../shared/debug-trail.js';
2
+ import type { Snapshot } from '@tui/shared/debug-trail.js';
3
3
  import type { AgentConfig } from './agent-store.js';
4
4
  /**
5
5
  * The agent settings as flat text, for `diffSnapshots`: `default_agent`, then `<agent>.model` and `<agent>.binary` for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.40.1-dev-build-46595419.0",
3
+ "version": "2.40.1-dev-build-d17741e4.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,7 +45,7 @@
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.40.1-dev-build-46595419.0"
48
+ "@contentful/experience-design-system-types": "2.40.1-dev-build-d17741e4.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@tsconfig/node24": "^24.0.4",
@@ -59,7 +59,7 @@
59
59
  "ink-testing-library": "^4.0.0",
60
60
  "typescript-eslint": "^8.67.0",
61
61
  "vitest": "^4.0.16",
62
- "@contentful/experience-design-system-backend-pipeline": "2.40.1-dev-build-46595419.0"
62
+ "@contentful/experience-design-system-backend-pipeline": "2.40.1-dev-build-d17741e4.0"
63
63
  },
64
64
  "repository": {
65
65
  "type": "git",