@contentful/experience-design-system-cli 2.35.1-dev-build-925d6206.0 → 2.35.1-dev-build-c518de8c.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.35.1-dev-build-925d6206.0",
3
+ "version": "2.35.1-dev-build-c518de8c.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -5,7 +5,7 @@
5
5
  * parent→child relationship, carrying optional `slot` (T7), `confidence`,
6
6
  * and `provenance`. It is easier to merge and dedupe across sources (T2).
7
7
  */
8
- export type EdgeProvenance = 'typed-slot' | 'structural' | 'manifest' | 'doc' | `adapter:${string}` | 'agent';
8
+ export type EdgeProvenance = 'typed-slot' | 'structural' | 'call-site' | 'manifest' | 'doc' | `adapter:${string}`;
9
9
  export type CompositionEdge = {
10
10
  parent: string;
11
11
  child: string;
@@ -13,5 +13,11 @@ export type CompositionEdge = {
13
13
  slot?: string;
14
14
  /** 1–5 scale, same as select/reject agent tools. */
15
15
  confidence?: number;
16
+ citation?: CompositionCitation;
16
17
  provenance: EdgeProvenance;
17
18
  };
19
+ export type CompositionCitation = {
20
+ sourcePath: string;
21
+ startLine: number;
22
+ endLine: number;
23
+ };
@@ -1,59 +1,36 @@
1
1
  import type { RawComponentDefinition } from '../../types.js';
2
2
  import type { CompositionEdge } from './interchange-schema.js';
3
3
  import { type EdgeConflict } from './merge-edges.js';
4
+ import type { SourceCallSiteEvidence, SourceCallSiteRejection } from './source-call-site-evidence.js';
4
5
  export type ResolveMappingResult = {
5
6
  components: RawComponentDefinition[];
6
7
  edges: CompositionEdge[];
7
8
  conflicts: EdgeConflict[];
8
9
  warnings: string[];
10
+ sourceCallSiteEvidence: SourceCallSiteEvidence[];
11
+ sourceCallSiteRejections: SourceCallSiteRejection[];
9
12
  };
10
13
  /**
11
14
  * Orchestrate composition-edge acquisition and enrichment.
12
15
  *
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
16
+ * Sources by rank: typed-slot / "code slots" (1) > structural usage evidence
17
+ * (2) > cited source call sites (3) > manifest (4) > doc (5) > adapter-resolved
18
+ * / extraEdges (6). Manifest/doc edges are computed deterministically outside
16
19
  * this function (see manifest-doc-evidence.ts) and joined via `extraEdges`.
17
20
  * ALL sources — including the code slots already on the incoming components —
18
21
  * are fed into one ranked merge and unioned; non-conflicting edges from every
19
22
  * source survive, and on a conflict (same parent+child, different slot) the
20
- * higher-rank source wins and the loser is recorded. The edge-emitting agent runs only when
21
- * `forceAgent` is set OR there is residue a higher-rank source
22
- * didn't cover (routing/cost optimization) — `forceAgent` bypasses that
23
- * suppression but never changes rank.
24
- *
25
- * `runAgentFn` is injected (returns the agent's raw stdout) so this is
26
- * testable without spawning a subprocess.
23
+ * higher-rank source wins and the loser is recorded. No agent contributes
24
+ * edges: every edge is backed by code, a manifest or documentation.
27
25
  */
28
26
  export declare function resolveMapping(input: {
29
27
  components: RawComponentDefinition[];
30
- forceAgent?: boolean;
31
- files: Array<{
32
- path: string;
33
- content: string;
34
- }>;
35
- runAgentFn: (opts: {
36
- prompt: string;
37
- files: Array<{
38
- path: string;
39
- content: string;
40
- }>;
41
- }) => Promise<string>;
42
- buildPrompt?: (files: Array<{
43
- path: string;
44
- content: string;
45
- }>, componentNames: string[]) => string;
46
- /**
47
- * Custom instruction preamble (from `--prompt composition=...`). Replaces the
48
- * default guidance line ONLY; the machine-readable output contract + the
49
- * component-name allowlist + candidate files are always appended so the
50
- * JSONL parser keeps working regardless of the override.
51
- */
52
- promptOverride?: string;
53
28
  /**
54
29
  * Pre-resolved edges from an external source (e.g. manifest or documentation)
55
30
  * path). They join the ranked merge at their own provenance rank alongside
56
31
  * code slots and other automatic mapping sources.
57
32
  */
58
33
  extraEdges?: CompositionEdge[];
59
- }): Promise<ResolveMappingResult>;
34
+ sourceCallSiteEvidence?: SourceCallSiteEvidence[];
35
+ sourceCallSiteRejections?: SourceCallSiteRejection[];
36
+ }): ResolveMappingResult;
@@ -0,0 +1,30 @@
1
+ import type { RawComponentDefinition } from '../../types.js';
2
+ export type SourceCallSiteEvidence = {
3
+ parent: string;
4
+ child: string;
5
+ slot?: string;
6
+ sourcePath: string;
7
+ startLine: number;
8
+ endLine: number;
9
+ excerpt: string;
10
+ kind: 'jsx-render';
11
+ };
12
+ export type SourceCallSiteRejection = {
13
+ parent: string;
14
+ candidate: string;
15
+ sourcePath: string;
16
+ startLine?: number;
17
+ endLine?: number;
18
+ excerpt?: string;
19
+ reason: 'unknown-component' | 'unbound-component' | 'text-only-child' | 'no-call-site';
20
+ };
21
+ export type SourceCallSiteEvidenceResult = {
22
+ accepted: SourceCallSiteEvidence[];
23
+ rejected: SourceCallSiteRejection[];
24
+ };
25
+ type SourceFileInput = {
26
+ path: string;
27
+ content: string;
28
+ };
29
+ export declare function collectSourceCallSiteEvidence(files: readonly SourceFileInput[], components: readonly RawComponentDefinition[]): SourceCallSiteEvidenceResult;
30
+ export {};
@@ -1,7 +1,3 @@
1
1
  import type { Command } from 'commander';
2
- export declare function resolveExtractNoCache(opts: {
3
- cache?: boolean;
4
- noCache?: boolean;
5
- }): boolean;
6
2
  export declare function collectSourceFiles(directory: string, onProgress?: (scannedCount: number) => void): Promise<string[]>;
7
3
  export declare function registerInternalExtractCommand(program: Command): void;
@@ -7,26 +7,21 @@ export declare function buildGenerateComponentsArgs(opts: {
7
7
  agent: string;
8
8
  model?: string;
9
9
  bedrock?: boolean;
10
- noCache?: boolean;
11
10
  generatePromptPath?: string;
12
11
  promptOverrides?: string[];
13
12
  existingEntitiesPath?: string;
14
- restoreCache?: boolean;
15
- cachedComponents?: string[];
16
13
  }): string[];
17
14
  export declare function buildGenerateTokensArgs(opts: {
18
15
  rawTokensPath: string;
19
16
  agent: string;
20
17
  model?: string;
21
18
  bedrock?: boolean;
22
- noCache?: boolean;
23
19
  promptOverrides?: string[];
24
20
  }): string[];
25
21
  export declare function buildMapTokensArgs(opts: {
26
22
  sessionId: string;
27
23
  agent: string;
28
24
  model?: string;
29
- noCache?: boolean;
30
25
  skipAgent?: boolean;
31
26
  promptOverrides?: string[];
32
27
  existingEntitiesPath?: string;
@@ -57,11 +52,10 @@ export type WizardAppProps = {
57
52
  initialProjectPath?: string;
58
53
  host?: string;
59
54
  promptOverrides?: string[];
60
- noCache?: boolean;
61
55
  livePreview?: boolean;
62
56
  generatePromptPath?: string;
63
57
  skipMapTokens?: boolean;
64
58
  initialRawTokensPath?: string;
65
59
  initialAgentAuth?: Promise<AgentAuthStatus>;
66
60
  };
67
- export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, bedrock, initialProjectPath, host, promptOverrides, noCache, livePreview, generatePromptPath, skipMapTokens, initialRawTokensPath, initialAgentAuth, }?: WizardAppProps): React.ReactElement;
61
+ export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, bedrock, initialProjectPath, host, promptOverrides, livePreview, generatePromptPath, skipMapTokens, initialRawTokensPath, initialAgentAuth, }?: WizardAppProps): React.ReactElement;
@@ -5,5 +5,4 @@ export declare function runSelectionAgent(options: {
5
5
  model?: string;
6
6
  promptText?: string;
7
7
  promptPath?: string;
8
- noCache?: boolean;
9
8
  }): Promise<void>;
@@ -8,9 +8,6 @@ export declare function shouldSkipFinalReviewAfterCredentials(state: {
8
8
  generateSessionId: string | null;
9
9
  finalReviewPassed: boolean;
10
10
  }): boolean;
11
- export declare function resolveNoCacheForGenerate(opts: {
12
- cliNoCache: boolean;
13
- }): boolean;
14
11
  export declare function shouldBypassPreview(state: {
15
12
  credentialsSkipped: boolean;
16
13
  }): boolean;