@contentful/experience-design-system-cli 2.37.1-dev-build-aa3ffe6f.0 → 2.37.1-dev-build-a029dc0a.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/app.js +14777 -6540
- package/dist/index.js +18212 -8925
- package/dist/package.json +1 -1
- package/dist/src/tui/import/steps/06-extraction/find-skill-path.d.ts +1 -0
- package/dist/src/tui/import/steps/06-extraction/logic.d.ts +4 -25
- package/dist/src/tui/import/steps/06-extraction/run.d.ts +13 -11
- package/dist/src/tui/import/steps/06-extraction/selection.d.ts +1 -1
- package/dist/src/tui/import/steps/06-extraction/types.d.ts +3 -1
- package/dist/src/tui/import/steps/07-scope-gate/keymap.d.ts +2 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.d.ts +2 -0
- package/dist/src/tui/import/steps/07-scope-gate/state.d.ts +3 -2
- package/dist/src/tui/import/steps/07-scope-gate/types.d.ts +7 -0
- package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +1 -1
- package/dist/src/tui/import/steps/08-generation/types.d.ts +2 -4
- package/legacy/dist/package.json +4 -1
- package/legacy/dist/src/index.js +13294 -7837
- package/legacy/package.json +1 -1
- package/package.json +4 -4
- package/dist/src/tui/import/steps/06-extraction/processes.d.ts +0 -45
package/dist/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findSkillPath(fileName: string): string;
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
scanned: number;
|
|
6
|
-
} | {
|
|
7
|
-
kind: 'scan-done';
|
|
8
|
-
total: number;
|
|
9
|
-
} | {
|
|
10
|
-
kind: 'extract';
|
|
11
|
-
totalFiles: number;
|
|
12
|
-
} | {
|
|
13
|
-
kind: 'composition';
|
|
14
|
-
phase: CompositionPhase;
|
|
15
|
-
};
|
|
16
|
-
/** `progress=scan:12`, `progress=scan-done:40`, `progress=extract:3/40:7`, `progress=composition:cache-hit`. */
|
|
17
|
-
export declare function parseProgressLine(line: string): ProgressEvent | null;
|
|
18
|
-
/** `session=<id>` on the extract subprocess's stdout. It arrives before composition finishes, which is when selection starts. */
|
|
19
|
-
export declare function parseSessionLine(line: string): string | null;
|
|
20
|
-
/** The first `session=<id>` anywhere in a command's stdout. */
|
|
21
|
-
export declare function findSession(stdout: string): string | null;
|
|
22
|
-
/** `Extracted 7 components` in the extract command's stderr; 0 when it never printed one. */
|
|
23
|
-
export declare function parseExtractedCount(stderr: string): number;
|
|
24
|
-
/** `(12 tokens` in the output of `print tokens`. */
|
|
25
|
-
export declare function parsePrintTokensCount(stdout: string): number;
|
|
1
|
+
import type { ExtractAndComposeProgress } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
|
+
import type { ExtractionProgress } from './types.js';
|
|
3
|
+
/** Structured progress events emitted by the orchestrator (extraction + composition). */
|
|
4
|
+
export type ProgressEvent = ExtractAndComposeProgress;
|
|
26
5
|
/**
|
|
27
6
|
* Every job the stage will run starts on the first frame, so no row appears later as a surprise. A job that does not
|
|
28
7
|
* apply stays 'idle' and has no row: existing entities need credentials, token definitions need a raw tokens file, and
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { checkAgentAuth } from '@contentful/experience-design-system-
|
|
2
|
-
import { runTokenGeneration, spawnExtract } from './processes.js';
|
|
1
|
+
import { checkAgentAuth, runExtractAndComposeSession, runGenerateTokensSession } from '@contentful/experience-design-system-backend-pipeline';
|
|
3
2
|
import { runSelection } from './selection.js';
|
|
4
3
|
import type { ExtractionInput, ExtractionProgress, ExtractionResult } from './types.js';
|
|
5
4
|
/** The outside world the stage talks to, so the order of events can be tested without a network, an agent or a CLI. */
|
|
6
5
|
export interface ExtractionDeps {
|
|
7
6
|
checkAgentAuth: typeof checkAgentAuth;
|
|
8
7
|
fetchEntities: (credentials: NonNullable<ExtractionInput['credentials']>, outDir: string) => Promise<string | null>;
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
runExtractAndComposeSession: typeof runExtractAndComposeSession;
|
|
9
|
+
runGenerateTokensSession: typeof runGenerateTokensSession;
|
|
11
10
|
runSelection: typeof runSelection;
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
14
|
-
* Runs the stage. The jobs overlap exactly as they
|
|
13
|
+
* Runs the stage. The jobs overlap exactly as they did when extract was a
|
|
14
|
+
* subprocess:
|
|
15
15
|
*
|
|
16
|
-
* entities fetch
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
16
|
+
* entities fetch ───────────────────┐
|
|
17
|
+
* extract + compose (in-process) │
|
|
18
|
+
* └─ onSessionCreated(id) ────────┴─ selection agent (waits for fetch) ──┐
|
|
19
|
+
* └──────────────────────── returns (composition done) ─────────────────┴─ result
|
|
20
|
+
* token generation (only when the tokens are not being reused)
|
|
20
21
|
*
|
|
21
|
-
* Selection starts the moment the
|
|
22
|
-
*
|
|
22
|
+
* Selection starts the moment the orchestrator mints the sessionId, so it
|
|
23
|
+
* overlaps with composition. When more than one job fails, the error reported
|
|
24
|
+
* is the first of: extract, no components, selection, token generation.
|
|
23
25
|
*/
|
|
24
26
|
export declare function runExtraction(input: ExtractionInput, onProgress: (progress: ExtractionProgress) => void, deps?: ExtractionDeps): Promise<ExtractionResult>;
|
|
@@ -2,6 +2,8 @@ import type { ExtractionHandoff, ImportHandoff } from '@contentful/experience-de
|
|
|
2
2
|
export type TokenStrategy = ImportHandoff['tokens']['strategy'];
|
|
3
3
|
export interface ExtractionInput {
|
|
4
4
|
projectPath: string;
|
|
5
|
+
/** Absolute source files from the path-validation step (collectFiles output). */
|
|
6
|
+
filePaths: string[];
|
|
5
7
|
/** Raw tokens file the user pointed at (always set: v2 asks for one). */
|
|
6
8
|
rawTokensPath: string;
|
|
7
9
|
/** From the token reuse step. 'reuse' skips token generation entirely. */
|
|
@@ -18,7 +20,7 @@ export interface ExtractionInput {
|
|
|
18
20
|
promptOverrides: string[];
|
|
19
21
|
noCache: boolean;
|
|
20
22
|
}
|
|
21
|
-
|
|
23
|
+
type CompositionPhase = 'resolving' | 'cache-hit' | 'done' | `agent:${string}`;
|
|
22
24
|
type JobStatus = 'idle' | 'running' | 'complete' | 'failed';
|
|
23
25
|
/** Everything the extracting screen shows. One field per row. */
|
|
24
26
|
export interface ExtractionProgress {
|
|
@@ -45,6 +45,8 @@ export interface VisibleRow {
|
|
|
45
45
|
cycleChild?: boolean;
|
|
46
46
|
itemIdx: number;
|
|
47
47
|
rootName?: string;
|
|
48
|
+
/** The parent whose slot the nested row sits in. */
|
|
49
|
+
parentName?: string;
|
|
48
50
|
}
|
|
49
51
|
export declare function buildVisibleRows(props: {
|
|
50
52
|
items: GroupedSidebarItem[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ScopeGraph } from './graph/index.js';
|
|
2
|
-
import type { Decision, ScopeComponent, ScopeDecisions } from './types.js';
|
|
2
|
+
import type { Decision, ParentChildEdge, ScopeComponent, ScopeDecisions } from './types.js';
|
|
3
3
|
export type DecisionState = Map<string, Decision>;
|
|
4
4
|
export type DecisionAction = {
|
|
5
5
|
type: 'accept';
|
|
@@ -15,5 +15,6 @@ export type DecisionAction = {
|
|
|
15
15
|
export declare function reduceDecisions(state: DecisionState, action: DecisionAction, components: ScopeComponent[], graph: ScopeGraph): DecisionState;
|
|
16
16
|
/** Whether rejecting `name` touches 2 or more other components, so the screen has to ask first. */
|
|
17
17
|
export declare function rejectNeedsConfirmation(graph: ScopeGraph, name: string, state: DecisionState): boolean;
|
|
18
|
+
export declare function withoutSlotChildren(components: ScopeComponent[], removedEdges: ParentChildEdge[]): ScopeComponent[];
|
|
18
19
|
/** Everything not accepted counts as rejected, as legacy's `partition` did. */
|
|
19
|
-
export declare function partitionDecisions(components: ScopeComponent[], state: DecisionState): ScopeDecisions;
|
|
20
|
+
export declare function partitionDecisions(components: ScopeComponent[], state: DecisionState, removedEdges: ParentChildEdge[]): ScopeDecisions;
|
|
@@ -10,10 +10,17 @@ export type ScopeComponent = Omit<ScopeComponentRow, 'aiDecision' | 'aiReason' |
|
|
|
10
10
|
slots?: ScopeComponentRow['slots'];
|
|
11
11
|
};
|
|
12
12
|
export type Decision = 'accepted' | 'rejected' | 'undecided';
|
|
13
|
+
/** One slot edge: `parent` allows `child` in a slot. */
|
|
14
|
+
export interface ParentChildEdge {
|
|
15
|
+
parent: string;
|
|
16
|
+
child: string;
|
|
17
|
+
}
|
|
13
18
|
/** What the user confirmed. Becomes `ImportHandoff.scope`; the legacy wizard saves it and starts generation. */
|
|
14
19
|
export interface ScopeDecisions {
|
|
15
20
|
accepted: string[];
|
|
16
21
|
rejected: string[];
|
|
22
|
+
/** Slot edges removed at the gate. The child keeps its own decision. Missing means none were removed. */
|
|
23
|
+
excludedSlotEdges?: ParentChildEdge[];
|
|
17
24
|
}
|
|
18
25
|
export type ScopeGateLoad = {
|
|
19
26
|
ok: true;
|
|
@@ -10,7 +10,7 @@ export interface PendingRejectCascade {
|
|
|
10
10
|
ancestors: string[];
|
|
11
11
|
descendants: string[];
|
|
12
12
|
}
|
|
13
|
-
export declare function useScopeGate({ components, onConfirm, onQuit }: UseScopeGateOptions): {
|
|
13
|
+
export declare function useScopeGate({ components: loadedComponents, onConfirm, onQuit }: UseScopeGateOptions): {
|
|
14
14
|
totalWidth: number;
|
|
15
15
|
columnPlan: {
|
|
16
16
|
layout: "single" | "two-column";
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { GenerationHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
2
|
+
import type { ScopeDecisions } from '../07-scope-gate/types.js';
|
|
2
3
|
export interface GenerationInput {
|
|
3
4
|
/** The extraction session the scope was decided on. */
|
|
4
5
|
sessionId: string;
|
|
5
|
-
decisions:
|
|
6
|
-
accepted: string[];
|
|
7
|
-
rejected: string[];
|
|
8
|
-
};
|
|
6
|
+
decisions: ScopeDecisions;
|
|
9
7
|
/**
|
|
10
8
|
* The cache check that ran while the scope gate was open, which restores cached definitions into the pipeline
|
|
11
9
|
* database. The stage waits for it before saving the decisions, since both write to that database.
|
package/legacy/dist/package.json
CHANGED
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"lint:fix": "nx lint:fix experience-design-system-cli-legacy"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@contentful/experience-design-system-backend-pipeline": "workspace:*",
|
|
33
34
|
"@contentful/experience-design-system-types": "workspace:*",
|
|
34
35
|
"@inkjs/ui": "^2.0.0",
|
|
35
36
|
"@segment/analytics-node": "^3.0.0",
|
|
36
37
|
"@vue/compiler-sfc": "^3.5.31",
|
|
38
|
+
"ajv": "^8.17.1",
|
|
37
39
|
"commander": "^13.1.0",
|
|
38
40
|
"contentful-management": "^12.17.0",
|
|
39
41
|
"figures": "6.1.0",
|
|
@@ -42,7 +44,8 @@
|
|
|
42
44
|
"react-devtools-core": "^4.19.1",
|
|
43
45
|
"svelte": "^5.56.4",
|
|
44
46
|
"ts-morph": "^27.0.2",
|
|
45
|
-
"typescript": "^5.9.3"
|
|
47
|
+
"typescript": "^5.9.3",
|
|
48
|
+
"zod": "^4.3.6"
|
|
46
49
|
},
|
|
47
50
|
"devDependencies": {
|
|
48
51
|
"@contentful/experience-design-system-client": "workspace:*",
|