@contentful/experience-design-system-cli 2.34.5-dev-build-ea694b2.0 → 2.34.5-dev-build-57e4802.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.34.5-dev-build-ea694b2.0",
3
+ "version": "2.34.5-dev-build-57e4802.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,11 +1,17 @@
1
1
  /**
2
2
  * The CLI-owned composition interchange format (spec T1).
3
3
  *
4
- * `CompositionEdge[]` is the flat internal runtime view, one edge per
5
- * parent→child relationship, carrying optional `slot` (T7), `confidence`,
6
- * and `provenance`. It is easier to merge and dedupe across sources (T2).
4
+ * Two views of the same data:
5
+ * - `InterchangeMap` — the human-authored / on-disk `{ version, groups }`
6
+ * shape (parent → children), consumed by the composition-map option.
7
+ * `--composition-map` consumes and the resolver can emit.
8
+ * - `CompositionEdge[]` — the flat internal runtime view, one edge per
9
+ * parent→child relationship, carrying optional `slot` (T7), `confidence`,
10
+ * and `provenance`. Easier to merge/dedupe across sources (T2).
11
+ *
12
+ * This module owns both shapes and the converters between them.
7
13
  */
8
- export type EdgeProvenance = 'typed-slot' | 'structural' | 'manifest' | 'doc' | `adapter:${string}` | 'agent';
14
+ export type EdgeProvenance = 'user' | 'typed-slot' | 'structural' | 'manifest' | 'doc' | `adapter:${string}` | 'agent';
9
15
  export type CompositionEdge = {
10
16
  parent: string;
11
17
  child: string;
@@ -15,3 +21,17 @@ export type CompositionEdge = {
15
21
  confidence?: number;
16
22
  provenance: EdgeProvenance;
17
23
  };
24
+ export type InterchangeMap = {
25
+ version: 1;
26
+ groups: Record<string, string[]>;
27
+ };
28
+ export type ValidateResult = {
29
+ valid: true;
30
+ map: InterchangeMap;
31
+ } | {
32
+ valid: false;
33
+ errors: string[];
34
+ };
35
+ export declare function validateInterchangeMap(input: unknown): ValidateResult;
36
+ export declare function groupsToEdges(map: InterchangeMap, provenance: EdgeProvenance): CompositionEdge[];
37
+ export declare function edgesToGroups(edges: CompositionEdge[]): InterchangeMap;
@@ -1,7 +1,18 @@
1
+ import { type InterchangeMap } from './interchange-schema.js';
1
2
  export type CompositionCliOptions = {
3
+ /** `--composition-map <path>` — hand-authored interchange file. */
4
+ compositionMap?: string;
2
5
  /** `--composition-refresh` — force edge emission to run even over resolved residue. */
3
6
  compositionRefresh?: boolean;
4
7
  };
8
+ export type LoadUserMapResult = {
9
+ ok: true;
10
+ map: InterchangeMap;
11
+ } | {
12
+ ok: false;
13
+ error: string;
14
+ };
15
+ export declare function loadUserMap(path: string): Promise<LoadUserMapResult>;
5
16
  export type ResolvedCompositionSources = {
6
17
  forceAgent: boolean;
7
18
  };
@@ -1,8 +1,9 @@
1
1
  import type { RawComponentDefinition } from '../../types.js';
2
- import type { CompositionEdge } from './interchange-schema.js';
2
+ import { type CompositionEdge, type InterchangeMap } from './interchange-schema.js';
3
3
  import { type EdgeConflict } from './merge-edges.js';
4
4
  export type ResolveMappingResult = {
5
5
  components: RawComponentDefinition[];
6
+ userMap?: InterchangeMap;
6
7
  edges: CompositionEdge[];
7
8
  conflicts: EdgeConflict[];
8
9
  warnings: string[];
@@ -10,9 +11,9 @@ export type ResolveMappingResult = {
10
11
  /**
11
12
  * Orchestrate composition-edge acquisition and enrichment.
12
13
  *
13
- * Sources by rank: typed-slot / "code slots" (2) > structural usage evidence
14
- * (3) > manifest (4) > doc (5) > adapter-resolved / extraEdges (6) >
15
- * edge-emitting agent (7). Manifest/doc edges are computed deterministically outside
14
+ * Sources by rank: user map (1) > typed-slot / "code slots" (2) > structural
15
+ * usage evidence (3) > manifest (4) > doc (5) > adapter-resolved / extraEdges
16
+ * (6) > edge-emitting agent (7). Manifest/doc edges are computed deterministically outside
16
17
  * this function (see manifest-doc-evidence.ts) and joined via `extraEdges`.
17
18
  * ALL sources — including the code slots already on the incoming components —
18
19
  * are fed into one ranked merge and unioned; non-conflicting edges from every
@@ -27,6 +28,7 @@ export type ResolveMappingResult = {
27
28
  */
28
29
  export declare function resolveMapping(input: {
29
30
  components: RawComponentDefinition[];
31
+ userMap?: InterchangeMap;
30
32
  forceAgent?: boolean;
31
33
  files: Array<{
32
34
  path: string;
@@ -53,7 +55,7 @@ export declare function resolveMapping(input: {
53
55
  /**
54
56
  * Pre-resolved edges from an external source (e.g. manifest or documentation)
55
57
  * path). They join the ranked merge at their own provenance rank alongside
56
- * code slots and other automatic mapping sources.
58
+ * code slots and the user map.
57
59
  */
58
60
  extraEdges?: CompositionEdge[];
59
61
  }): Promise<ResolveMappingResult>;
@@ -1,7 +1,9 @@
1
1
  export type CompositionOptionInput = {
2
+ compositionMap?: string;
2
3
  prompt?: string[];
3
4
  };
4
5
  export type CompositionForwardingOptions = {
6
+ compositionMap?: string;
5
7
  promptOverrides?: string[];
6
8
  };
7
9
  export declare function buildCompositionForwardingOptions(options: CompositionOptionInput): CompositionForwardingOptions;
@@ -17,7 +17,6 @@ export declare function buildGenerateTokensArgs(opts: {
17
17
  model?: string;
18
18
  bedrock?: boolean;
19
19
  noCache?: boolean;
20
- promptOverrides?: string[];
21
20
  }): string[];
22
21
  export declare function buildMapTokensArgs(opts: {
23
22
  sessionId: string;
@@ -25,7 +24,6 @@ export declare function buildMapTokensArgs(opts: {
25
24
  model?: string;
26
25
  noCache?: boolean;
27
26
  skipAgent?: boolean;
28
- promptOverrides?: string[];
29
27
  existingEntitiesPath?: string;
30
28
  }): string[];
31
29
  export declare function shouldRunMapTokens(opts: {
@@ -53,6 +51,7 @@ export type WizardAppProps = {
53
51
  bedrock?: boolean;
54
52
  initialProjectPath?: string;
55
53
  host?: string;
54
+ compositionMap?: string;
56
55
  promptOverrides?: string[];
57
56
  noCache?: boolean;
58
57
  livePreview?: boolean;
@@ -60,4 +59,4 @@ export type WizardAppProps = {
60
59
  skipMapTokens?: boolean;
61
60
  initialRawTokensPath?: string;
62
61
  };
63
- export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, bedrock, initialProjectPath, host, promptOverrides, noCache, livePreview, generatePromptPath, skipMapTokens, initialRawTokensPath, }?: WizardAppProps): React.ReactElement;
62
+ export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, bedrock, initialProjectPath, host, compositionMap, promptOverrides, noCache, livePreview, generatePromptPath, skipMapTokens, initialRawTokensPath, }?: WizardAppProps): React.ReactElement;
@@ -1,7 +1,18 @@
1
1
  import React from 'react';
2
2
  import type { BreakingChange, CDFComponentEntry, ComponentTypeSummary, DownstreamImpact, ServerPreviewResponse } from '@contentful/experience-design-system-types';
3
- import type { ReviewStepProps } from '../review-step-props.js';
4
- type GenerateReviewStepProps = ReviewStepProps;
3
+ type GenerateReviewStepProps = {
4
+ extractSessionId: string | null;
5
+ tokenSessionId?: string | null;
6
+ onFinalize: (accepted: number, rejected: number, unresolved: number) => void;
7
+ onQuit: () => void;
8
+ livePreview?: boolean;
9
+ spaceId?: string;
10
+ environmentId?: string;
11
+ cmaToken?: string;
12
+ host?: string;
13
+ tokensPath?: string;
14
+ initialFinalizeError?: string | null;
15
+ };
5
16
  export declare function sortComponentsForSidebar<T extends {
6
17
  key: string;
7
18
  entry: CDFComponentEntry;
@@ -23,4 +34,4 @@ export interface BreakingRow {
23
34
  }
24
35
  export declare function buildBreakingRows(breakingChanges: BreakingComponent[]): BreakingRow[];
25
36
  export declare function deriveBreakingChanges(response: ServerPreviewResponse): BreakingComponent[];
26
- export declare function GenerateReviewStep({ extractSessionId, tokenSessionId, onFinalize, onQuit, livePreview, spaceId, environmentId, cmaToken, host, tokensPath, initialFinalizeError, }: GenerateReviewStepProps): React.ReactElement;
37
+ export declare function GenerateReviewStep(props: GenerateReviewStepProps): React.ReactElement;
@@ -25,7 +25,7 @@ export type ScopeGateStepProps = {
25
25
  aiFilterError?: string | null;
26
26
  onCancelAutoFilter?: () => void;
27
27
  };
28
- export declare function ScopeGateStep({ components, onConfirm, onQuit }: ScopeGateStepProps): React.ReactElement;
28
+ export declare function ScopeGateStep(props: ScopeGateStepProps): React.ReactElement;
29
29
  export declare function sideColumnLabelStyle(input: {
30
30
  isCycle: boolean;
31
31
  isSelected: boolean;