@contentful/experience-design-system-cli 2.37.1-dev-build-799db3ac.0 → 2.37.1-dev-build-e5882940.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 +6717 -574
- package/dist/index.js +7971 -1380
- package/dist/package.json +4 -2
- package/dist/src/tui/import/spawn-v1-import.d.ts +3 -3
- package/dist/src/tui/import/steps/05-token-reuse/logic.d.ts +1 -2
- package/dist/src/tui/import/steps/06-extraction/logic.d.ts +69 -0
- package/dist/src/tui/import/steps/06-extraction/processes.d.ts +45 -0
- package/dist/src/tui/import/steps/06-extraction/run.d.ts +24 -0
- package/dist/src/tui/import/steps/06-extraction/screen.d.ts +10 -0
- package/dist/src/tui/import/steps/06-extraction/selection.d.ts +18 -0
- package/dist/src/tui/import/steps/06-extraction/types.d.ts +44 -0
- package/dist/src/tui/import/steps/06-extraction/use-extraction.d.ts +14 -0
- package/dist/src/tui/import/steps/07-scope-gate/cache-check.d.ts +29 -0
- package/{legacy/dist/src/import/tui/scope-gate-columns.d.ts → dist/src/tui/import/steps/07-scope-gate/columns.d.ts} +22 -2
- package/dist/src/tui/import/steps/07-scope-gate/graph/composite-closure.d.ts +26 -0
- package/dist/src/tui/import/steps/07-scope-gate/graph/cycle-detection.d.ts +22 -0
- package/dist/src/tui/import/steps/07-scope-gate/graph/fuzzy-search.d.ts +3 -0
- package/dist/src/tui/import/steps/07-scope-gate/graph/index.d.ts +33 -0
- package/dist/src/tui/import/steps/07-scope-gate/graph/lineage.d.ts +29 -0
- package/dist/src/tui/import/steps/07-scope-gate/graph/search-neighborhood.d.ts +3 -0
- package/dist/src/tui/import/steps/07-scope-gate/graph/slot-graph.d.ts +11 -0
- package/dist/src/tui/import/steps/07-scope-gate/keymap.d.ts +84 -0
- package/dist/src/tui/import/steps/07-scope-gate/load.d.ts +8 -0
- package/dist/src/tui/import/steps/07-scope-gate/panels/added-column.d.ts +15 -0
- package/dist/src/tui/import/steps/07-scope-gate/panels/cycles-panel.d.ts +8 -0
- package/dist/src/tui/import/steps/07-scope-gate/panels/reject-prompt.d.ts +5 -0
- package/dist/src/tui/import/steps/07-scope-gate/screen.d.ts +9 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/autocomplete.d.ts +5 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/CompactControlBar.d.ts +4 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.d.ts +32 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.d.ts +93 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.d.ts +21 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/LegendEntry.d.ts +2 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.d.ts +11 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/badge.d.ts +13 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.d.ts +17 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/group-collapse.d.ts +2 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/sidebar-search-state.d.ts +17 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.d.ts +6 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/useImmediateInput.d.ts +20 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/useOverlayPanel.d.ts +13 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/lineage-layout.d.ts +68 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/sidebar-help.d.ts +2 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/sidebar-input.d.ts +13 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/sidebar-navigation.d.ts +18 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/step-filters.d.ts +19 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +8 -0
- package/dist/src/tui/import/steps/07-scope-gate/sidebar/types.d.ts +7 -0
- package/dist/src/tui/import/steps/07-scope-gate/state.d.ts +19 -0
- package/dist/src/tui/import/steps/07-scope-gate/types.d.ts +24 -0
- package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.d.ts +31 -0
- package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +76 -0
- package/dist/src/tui/import/steps/index.d.ts +1 -0
- package/legacy/dist/src/import/tui/WizardApp.d.ts +0 -8
- package/legacy/dist/src/import/tui/handoff.d.ts +37 -0
- package/legacy/dist/src/index.js +1635 -3407
- package/legacy/package.json +4 -2
- package/package.json +6 -4
- package/skills/generate-components.md +612 -0
- package/skills/generate-tokens.md +194 -0
- package/skills/map-tokens.md +102 -0
- package/skills/select-components.md +235 -0
- package/legacy/dist/src/import/tui/run-selection-agent.d.ts +0 -9
- package/legacy/dist/src/import/tui/steps/ScopeGateStep.d.ts +0 -48
- /package/{legacy/dist/src/analyze → dist/src/tui/import/steps/07-scope-gate/graph}/scope-gate-cascade.d.ts +0 -0
- /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/ai-flag.d.ts +0 -0
- /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/components/CounterStrip.d.ts +0 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface GotoRow {
|
|
3
|
+
label: string;
|
|
4
|
+
jumpTarget: string;
|
|
5
|
+
kind?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GotoBannerProps {
|
|
8
|
+
title: string;
|
|
9
|
+
rows: GotoRow[];
|
|
10
|
+
/** Index used to highlight + window. Indexes `rows` directly by default. */
|
|
11
|
+
cursor: number;
|
|
12
|
+
/**
|
|
13
|
+
* Override the row index the cursor sits on, when `cursor` indexes a subset
|
|
14
|
+
* (e.g. a jumpable projection) rather than `rows`. Windowing and the default
|
|
15
|
+
* highlight center on this instead of `cursor` when provided.
|
|
16
|
+
*/
|
|
17
|
+
cursorRowIndex?: number;
|
|
18
|
+
/** Max rows rendered at once. Larger lists window around the cursor. */
|
|
19
|
+
maxRows?: number;
|
|
20
|
+
/** Constrain the box to a fixed column width (e.g. the sidebar slot). */
|
|
21
|
+
width?: number;
|
|
22
|
+
/** Footer keybinding hint. Rendered dim below the list when given. */
|
|
23
|
+
footerHint?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Escape hatch for feature-specific row rendering. Receives the row, its
|
|
26
|
+
* index into `rows`, and whether the cursor is on it. Falls back to a
|
|
27
|
+
* generic pointer row.
|
|
28
|
+
*/
|
|
29
|
+
renderRow?: (row: GotoRow, index: number, isCursor: boolean) => React.ReactElement;
|
|
30
|
+
}
|
|
31
|
+
export declare function GotoBanner({ title, rows, cursor, cursorRowIndex, maxRows, width, footerHint, renderRow, }: GotoBannerProps): React.ReactElement;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
3
|
+
import { type ComponentGraphNode, type NodeStatus } from '../../graph/composite-closure.js';
|
|
4
|
+
import type { PreviewAnnotation, RenderStatus } from '../types.js';
|
|
5
|
+
export interface GroupedSidebarItem {
|
|
6
|
+
key: string;
|
|
7
|
+
entry: CDFComponentEntry;
|
|
8
|
+
status: NodeStatus;
|
|
9
|
+
}
|
|
10
|
+
export interface GroupedSidebarProps {
|
|
11
|
+
items: GroupedSidebarItem[];
|
|
12
|
+
cycleParticipants?: Set<string>;
|
|
13
|
+
selectedIdx: number;
|
|
14
|
+
selectedRowIdx?: number;
|
|
15
|
+
onSelect: (idx: number) => void;
|
|
16
|
+
expandedGroups: Set<string>;
|
|
17
|
+
onToggleExpanded: (rootName: string) => void;
|
|
18
|
+
width: number;
|
|
19
|
+
height?: number;
|
|
20
|
+
title?: string;
|
|
21
|
+
wrapLabels?: boolean;
|
|
22
|
+
focused: boolean;
|
|
23
|
+
renderStatusByKey?: Map<string, RenderStatus>;
|
|
24
|
+
previewAnnotationByKey?: Map<string, PreviewAnnotation>;
|
|
25
|
+
scrollOffset?: number;
|
|
26
|
+
visibleCount?: number;
|
|
27
|
+
alwaysExpanded?: boolean;
|
|
28
|
+
showFlatTier?: boolean;
|
|
29
|
+
selectionStateByKey?: Map<string, 'accepted' | 'rejected' | 'undecided'>;
|
|
30
|
+
aiFlaggedByKey?: Map<string, boolean>;
|
|
31
|
+
dimPredicate?: (componentKey: string) => boolean;
|
|
32
|
+
viewMode?: 'grouped' | 'flat';
|
|
33
|
+
visibleRows?: VisibleRow[];
|
|
34
|
+
graph: ComponentGraphNode[];
|
|
35
|
+
filterVisibleKeys?: Set<string>;
|
|
36
|
+
}
|
|
37
|
+
type RowKind = 'cycle' | 'empty' | 'group-root' | 'group-child' | 'standalone' | 'flat' | 'flat-header';
|
|
38
|
+
export interface VisibleRow {
|
|
39
|
+
kind: RowKind;
|
|
40
|
+
key: string;
|
|
41
|
+
label: string;
|
|
42
|
+
indent: number;
|
|
43
|
+
aggregateGlyph?: string | null;
|
|
44
|
+
sharedSuffix?: boolean;
|
|
45
|
+
cycleChild?: boolean;
|
|
46
|
+
itemIdx: number;
|
|
47
|
+
rootName?: string;
|
|
48
|
+
}
|
|
49
|
+
export declare function buildVisibleRows(props: {
|
|
50
|
+
items: GroupedSidebarItem[];
|
|
51
|
+
cycleParticipants: Set<string>;
|
|
52
|
+
expandedGroups: Set<string>;
|
|
53
|
+
alwaysExpanded?: boolean;
|
|
54
|
+
showFlatTier?: boolean;
|
|
55
|
+
viewMode?: 'grouped' | 'flat';
|
|
56
|
+
graph: ComponentGraphNode[];
|
|
57
|
+
filterVisibleKeys?: Set<string>;
|
|
58
|
+
}): VisibleRow[];
|
|
59
|
+
export declare function visibleItemOrder(props: {
|
|
60
|
+
items: GroupedSidebarItem[];
|
|
61
|
+
cycleParticipants: Set<string>;
|
|
62
|
+
expandedGroups: Set<string>;
|
|
63
|
+
alwaysExpanded?: boolean;
|
|
64
|
+
showFlatTier?: boolean;
|
|
65
|
+
graph: ComponentGraphNode[];
|
|
66
|
+
}): number[];
|
|
67
|
+
export declare function labelStyleFor(input: {
|
|
68
|
+
row: VisibleRow;
|
|
69
|
+
isCursor: boolean;
|
|
70
|
+
wouldDim: boolean;
|
|
71
|
+
}): {
|
|
72
|
+
color: string | undefined;
|
|
73
|
+
bold: boolean;
|
|
74
|
+
dim: boolean;
|
|
75
|
+
};
|
|
76
|
+
export declare function selectionGlyphStyleFor(selState: 'accepted' | 'rejected' | 'undecided' | undefined, isCycleRow: boolean): {
|
|
77
|
+
glyph: string | null;
|
|
78
|
+
color: string | undefined;
|
|
79
|
+
dim: boolean;
|
|
80
|
+
bold: boolean;
|
|
81
|
+
};
|
|
82
|
+
export declare function inheritanceGlyphStyleFor(input: {
|
|
83
|
+
status: RenderStatus['status'] | undefined;
|
|
84
|
+
isOwn: boolean;
|
|
85
|
+
isCursor: boolean;
|
|
86
|
+
}): {
|
|
87
|
+
glyph: string | null;
|
|
88
|
+
color: string | undefined;
|
|
89
|
+
dim: boolean;
|
|
90
|
+
bold: boolean;
|
|
91
|
+
};
|
|
92
|
+
export declare function GroupedSidebar(props: GroupedSidebarProps): React.ReactElement;
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type HelpSection = {
|
|
3
|
+
title: string;
|
|
4
|
+
entries: {
|
|
5
|
+
keys: string;
|
|
6
|
+
label: string;
|
|
7
|
+
}[];
|
|
8
|
+
};
|
|
9
|
+
type HelpOverlayProps = {
|
|
10
|
+
mode: 'analyze' | 'validate' | 'review';
|
|
11
|
+
sections?: undefined;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
handleInput?: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
mode?: undefined;
|
|
16
|
+
sections: HelpSection[];
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
handleInput?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare function HelpOverlay(props: HelpOverlayProps): React.ReactElement;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type SearchMatchSummaryProps = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
query: string;
|
|
5
|
+
matches: number;
|
|
6
|
+
total: number;
|
|
7
|
+
autocompleteCandidates: string[];
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
marginTop?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function SearchMatchSummary({ open, query, matches, total, autocompleteCandidates, hidden, marginTop, }: SearchMatchSummaryProps): React.ReactElement | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PreviewAnnotation } from '../types.js';
|
|
3
|
+
export type PreviewBadgeValue = {
|
|
4
|
+
char: string;
|
|
5
|
+
color: string;
|
|
6
|
+
bold?: boolean;
|
|
7
|
+
dim?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function previewBadge(annotation: PreviewAnnotation | undefined): PreviewBadgeValue | null;
|
|
10
|
+
export declare function PreviewBadge({ badge, highlighted, }: {
|
|
11
|
+
badge: PreviewBadgeValue | null;
|
|
12
|
+
highlighted?: boolean;
|
|
13
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
export type WindowDirection = 'up' | 'down';
|
|
3
|
+
/** Size a standalone panel to the terminal while reserving a small safety margin. */
|
|
4
|
+
export declare function terminalPanelHeight(rows: number, reservedRows?: number): number;
|
|
5
|
+
export interface WindowedPanelProps {
|
|
6
|
+
width: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
title?: string;
|
|
9
|
+
focused: boolean;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** Shared frame for panels whose viewport must not change with their contents. */
|
|
13
|
+
export declare function WindowedPanel({ width, height, title, focused, children }: WindowedPanelProps): ReactElement;
|
|
14
|
+
export declare function WindowIndicator({ direction, count }: {
|
|
15
|
+
direction: WindowDirection;
|
|
16
|
+
count: number;
|
|
17
|
+
}): ReactElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FilterCategory } from '../step-filters.js';
|
|
2
|
+
export declare function useSidebarSearchState(): {
|
|
3
|
+
searchOpen: boolean;
|
|
4
|
+
setSearchOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
|
+
searchQuery: string;
|
|
6
|
+
setSearchQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
7
|
+
autocompleteCandidates: string[];
|
|
8
|
+
setAutocompleteCandidates: import("react").Dispatch<import("react").SetStateAction<string[]>>;
|
|
9
|
+
jumpFilterTarget: string | null;
|
|
10
|
+
setJumpFilterTarget: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
11
|
+
columnOneView: "flat" | "grouped";
|
|
12
|
+
setColumnOneView: import("react").Dispatch<import("react").SetStateAction<"flat" | "grouped">>;
|
|
13
|
+
activeFilters: Set<FilterCategory>;
|
|
14
|
+
setActiveFilters: import("react").Dispatch<import("react").SetStateAction<Set<FilterCategory>>>;
|
|
15
|
+
showHelp: boolean;
|
|
16
|
+
setShowHelp: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type ImmediateInputKey = {
|
|
2
|
+
upArrow: boolean;
|
|
3
|
+
downArrow: boolean;
|
|
4
|
+
leftArrow: boolean;
|
|
5
|
+
rightArrow: boolean;
|
|
6
|
+
pageDown: boolean;
|
|
7
|
+
pageUp: boolean;
|
|
8
|
+
return: boolean;
|
|
9
|
+
escape: boolean;
|
|
10
|
+
ctrl: boolean;
|
|
11
|
+
shift: boolean;
|
|
12
|
+
tab: boolean;
|
|
13
|
+
shiftTab: boolean;
|
|
14
|
+
backspace: boolean;
|
|
15
|
+
delete: boolean;
|
|
16
|
+
meta: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type ImmediateInputHandler = (input: string, key: ImmediateInputKey) => void;
|
|
19
|
+
export declare function useImmediateInput(handler: ImmediateInputHandler, enabled?: boolean): void;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UseOverlayPanelOptions {
|
|
2
|
+
toggleKey: string;
|
|
3
|
+
onClose?: () => void;
|
|
4
|
+
}
|
|
5
|
+
export interface UseOverlayPanelResult {
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
open: () => void;
|
|
8
|
+
close: () => void;
|
|
9
|
+
handleInput: (input: string, key: {
|
|
10
|
+
escape?: boolean;
|
|
11
|
+
}) => boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function useOverlayPanel(opts: UseOverlayPanelOptions): UseOverlayPanelResult;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** Maximum layout rows; the active terminal height determines the actual budget. */
|
|
2
|
+
export declare const VISIBLE_COUNT = 200;
|
|
3
|
+
/** Maximum supported panel window; normal terminals remain terminal-sized. */
|
|
4
|
+
export declare const MAX_PANEL_ROWS = 200;
|
|
5
|
+
/** Floors — both surfaces stay usable even on a small terminal. */
|
|
6
|
+
export declare const SIDEBAR_MIN = 4;
|
|
7
|
+
export declare const MIN_PANEL_ROWS = 4;
|
|
8
|
+
/**
|
|
9
|
+
* Fallback when `stdout.rows` is unavailable (piped output, tests). No TTY
|
|
10
|
+
* means Ink is not interactively repainting, so there is no flicker risk — we
|
|
11
|
+
* assume enough height for a terminal-sized sidebar so the non-interactive
|
|
12
|
+
* render is complete and unclipped.
|
|
13
|
+
*/
|
|
14
|
+
export declare const FALLBACK_ROWS = 40;
|
|
15
|
+
/**
|
|
16
|
+
* Vertical space consumed by everything ABOVE/BELOW the columns row. The panel
|
|
17
|
+
* shares the columns row, so the fit constraint while open is simply
|
|
18
|
+
* `FIXED_OVERHEAD + panelBoxHeight <= rows`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const FIXED_OVERHEAD: number;
|
|
21
|
+
export declare const PANEL_BOX_CHROME = 6;
|
|
22
|
+
/**
|
|
23
|
+
* L2e — fixed vertical chrome around the sidebar in the BASE (no-panel) case,
|
|
24
|
+
* counting EVERYTHING that is not a variable sidebar entry row: the wizard
|
|
25
|
+
* header bar, the counter strip (with its blank separator), the cycle banner,
|
|
26
|
+
* the nothing-selected /
|
|
27
|
+
* AI-exclusion hint, the GroupedSidebar box borders + scroll indicator, the
|
|
28
|
+
* focused-detail block, and the wrapping legend region. The value intentionally
|
|
29
|
+
* leaves a small safety margin so resize-induced wrapping does not overflow.
|
|
30
|
+
*/
|
|
31
|
+
export declare const BASE_CHROME_OVERHEAD = 18;
|
|
32
|
+
export interface LineageLayoutInput {
|
|
33
|
+
/** Terminal height in rows (`stdout.rows`, or the fallback). */
|
|
34
|
+
rows: number;
|
|
35
|
+
/** Whether the lineage panel is currently open. */
|
|
36
|
+
panelOpen: boolean;
|
|
37
|
+
/** Number of lineage entries — caps the panel window so it never over-allocates. */
|
|
38
|
+
entryCount?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface LineageLayout {
|
|
41
|
+
/** Rows the sidebar should render (`visibleCount`). Constant across open/closed. */
|
|
42
|
+
sidebarVisible: number;
|
|
43
|
+
/** Rows a sidebar replacement panel should window to (`maxRows`). */
|
|
44
|
+
panelMaxRows: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The sidebar height is constant (the panel replaces it in the same slot, so
|
|
48
|
+
* there is nothing to shrink). Both values are derived from the terminal so
|
|
49
|
+
* resizing grows or shrinks the viewport without content-driven layout changes.
|
|
50
|
+
*/
|
|
51
|
+
export declare function computeLineageLayout({ rows, panelOpen, entryCount }: LineageLayoutInput): LineageLayout;
|
|
52
|
+
export interface SidebarBudget {
|
|
53
|
+
/** Rows the GroupedSidebar should render (`visibleCount`). */
|
|
54
|
+
sidebarVisibleCount: number;
|
|
55
|
+
/** Rows a sidebar replacement panel should window to (`maxRows`). */
|
|
56
|
+
panelMaxRows: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* L2e — autoscale the BASE frame to the terminal height. Even with the lineage
|
|
60
|
+
* panel closed, the visible-row budget follows `stdout.rows` minus
|
|
61
|
+
* `BASE_CHROME_OVERHEAD` so the whole frame stays within the terminal while
|
|
62
|
+
* preserving the shared panel-open sizing behavior.
|
|
63
|
+
*
|
|
64
|
+
* Floor: `BASE_CHROME_OVERHEAD + SIDEBAR_MIN`. Below it `SIDEBAR_MIN`
|
|
65
|
+
* (usability) intentionally wins over the fit — a terminal that small can't
|
|
66
|
+
* host the chrome regardless.
|
|
67
|
+
*/
|
|
68
|
+
export declare function computeSidebarBudget({ rows, panelOpen, entryCount }: LineageLayoutInput): SidebarBudget;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type SearchInputKey = {
|
|
2
|
+
tab: boolean;
|
|
3
|
+
backspace: boolean;
|
|
4
|
+
};
|
|
5
|
+
type SearchInputOptions = {
|
|
6
|
+
query: string;
|
|
7
|
+
names: string[];
|
|
8
|
+
setQuery: (value: string | ((current: string) => string)) => void;
|
|
9
|
+
setCandidates: (value: string[]) => void;
|
|
10
|
+
};
|
|
11
|
+
export declare function handleSidebarSearchInput(input: string, key: SearchInputKey, { query, names, setQuery, setCandidates }: SearchInputOptions): boolean;
|
|
12
|
+
export declare function formatSearchMatchSummary(matches: number, total: number): string;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentGraphNode, Closure } from '../graph/composite-closure.js';
|
|
2
|
+
import { type GroupedSidebarItem } from './components/GroupedSidebar.js';
|
|
3
|
+
export declare function collectExpandedGroupRoots(closures: Map<string, Closure>, cycleParticipants: Iterable<string>): Set<string>;
|
|
4
|
+
export declare function computeSidebarViewToggle({ currentView, currentKey, currentScroll, visibleCount, items, cycleParticipants, expandedGroups, graph, showFlatTier, }: {
|
|
5
|
+
currentView: 'grouped' | 'flat';
|
|
6
|
+
currentKey: string | null | undefined;
|
|
7
|
+
currentScroll: number;
|
|
8
|
+
visibleCount: number;
|
|
9
|
+
items: GroupedSidebarItem[];
|
|
10
|
+
cycleParticipants: Set<string>;
|
|
11
|
+
expandedGroups: Set<string>;
|
|
12
|
+
graph: ComponentGraphNode[];
|
|
13
|
+
showFlatTier?: boolean;
|
|
14
|
+
}): {
|
|
15
|
+
view: 'grouped' | 'flat';
|
|
16
|
+
cursor: number;
|
|
17
|
+
scroll: number;
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type FilterCategory = 'broken' | 'cycles' | 'deleted';
|
|
2
|
+
export interface FilterDataSources {
|
|
3
|
+
/** Component keys that participate in a slot cycle. */
|
|
4
|
+
cycles?: Iterable<string>;
|
|
5
|
+
/** Component keys the step considers "broken" (issue/warning/AI-flagged). */
|
|
6
|
+
broken?: Iterable<string>;
|
|
7
|
+
/** Component keys marked for deletion (GenerateReview only). */
|
|
8
|
+
deleted?: Iterable<string>;
|
|
9
|
+
}
|
|
10
|
+
export declare function computeFilterKeys(input: {
|
|
11
|
+
filters: Iterable<FilterCategory>;
|
|
12
|
+
data: FilterDataSources;
|
|
13
|
+
}): Set<string> | undefined;
|
|
14
|
+
export declare function intersectFilterKeys(a: Set<string> | undefined, b: Set<string> | undefined): Set<string> | undefined;
|
|
15
|
+
export declare function buildFlatDimPredicate(input: {
|
|
16
|
+
viewMode: 'grouped' | 'flat';
|
|
17
|
+
searchQuery: string;
|
|
18
|
+
filterVisibleKeys: Set<string> | undefined;
|
|
19
|
+
}): ((componentKey: string) => boolean) | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ScopeGraph } from './graph/index.js';
|
|
2
|
+
import type { Decision, ScopeComponent, ScopeDecisions } from './types.js';
|
|
3
|
+
export type DecisionState = Map<string, Decision>;
|
|
4
|
+
export type DecisionAction = {
|
|
5
|
+
type: 'accept';
|
|
6
|
+
name: string;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'reject';
|
|
9
|
+
name: string;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'toggle-all';
|
|
12
|
+
} | {
|
|
13
|
+
type: 'accept-unflagged';
|
|
14
|
+
};
|
|
15
|
+
export declare function reduceDecisions(state: DecisionState, action: DecisionAction, components: ScopeComponent[], graph: ScopeGraph): DecisionState;
|
|
16
|
+
/** Whether rejecting `name` touches 2 or more other components, so the screen has to ask first. */
|
|
17
|
+
export declare function rejectNeedsConfirmation(graph: ScopeGraph, name: string, state: DecisionState): boolean;
|
|
18
|
+
/** Everything not accepted counts as rejected, as legacy's `partition` did. */
|
|
19
|
+
export declare function partitionDecisions(components: ScopeComponent[], state: DecisionState): ScopeDecisions;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ScopeComponentRow } from '@contentful/experience-design-system-backend-pipeline';
|
|
2
|
+
/**
|
|
3
|
+
* One row of the gate. The loader always fills in the slots, but the screen is handed whatever the caller has, and
|
|
4
|
+
* legacy's screen accepted rows without them (and without the AI fields), so those stay optional here.
|
|
5
|
+
*/
|
|
6
|
+
export type ScopeComponent = Omit<ScopeComponentRow, 'aiDecision' | 'aiReason' | 'needsReview' | 'slots'> & {
|
|
7
|
+
aiDecision?: 'accepted' | 'rejected' | 'failed' | null;
|
|
8
|
+
aiReason?: string | null;
|
|
9
|
+
needsReview?: boolean;
|
|
10
|
+
slots?: ScopeComponentRow['slots'];
|
|
11
|
+
};
|
|
12
|
+
export type Decision = 'accepted' | 'rejected' | 'undecided';
|
|
13
|
+
/** What the user confirmed. Becomes `ImportHandoff.scope`; the legacy wizard saves it and starts generation. */
|
|
14
|
+
export interface ScopeDecisions {
|
|
15
|
+
accepted: string[];
|
|
16
|
+
rejected: string[];
|
|
17
|
+
}
|
|
18
|
+
export type ScopeGateLoad = {
|
|
19
|
+
ok: true;
|
|
20
|
+
components: ScopeComponent[];
|
|
21
|
+
} | {
|
|
22
|
+
ok: false;
|
|
23
|
+
message: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ScopeHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
2
|
+
import { type CacheCheckInput } from './cache-check.js';
|
|
3
|
+
import { loadScopeGate } from './load.js';
|
|
4
|
+
import type { ScopeDecisions, ScopeGateLoad } from './types.js';
|
|
5
|
+
export type ScopeGateFlow = {
|
|
6
|
+
status: 'failed';
|
|
7
|
+
message: string;
|
|
8
|
+
} | {
|
|
9
|
+
status: 'deciding';
|
|
10
|
+
load: Extract<ScopeGateLoad, {
|
|
11
|
+
ok: true;
|
|
12
|
+
}>;
|
|
13
|
+
confirm: (decisions: ScopeDecisions) => void;
|
|
14
|
+
}
|
|
15
|
+
/** Confirmed before the cache check finished. */
|
|
16
|
+
| {
|
|
17
|
+
status: 'preparing';
|
|
18
|
+
} | {
|
|
19
|
+
status: 'confirmed';
|
|
20
|
+
scope: ScopeHandoff;
|
|
21
|
+
};
|
|
22
|
+
interface Deps {
|
|
23
|
+
load: typeof loadScopeGate;
|
|
24
|
+
checkCache: (input: CacheCheckInput) => Promise<string[]>;
|
|
25
|
+
}
|
|
26
|
+
/** `input` is undefined until the extraction stage has produced a session, so the hook can be called unconditionally. */
|
|
27
|
+
export declare function useScopeGateFlow(input: {
|
|
28
|
+
sessionId: string;
|
|
29
|
+
cache: CacheCheckInput;
|
|
30
|
+
} | undefined, deps?: Deps): ScopeGateFlow | undefined;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ScopeComponent, ScopeDecisions } from './types.js';
|
|
2
|
+
interface UseScopeGateOptions {
|
|
3
|
+
components: ScopeComponent[];
|
|
4
|
+
onConfirm: (decisions: ScopeDecisions) => void;
|
|
5
|
+
onQuit: () => void;
|
|
6
|
+
}
|
|
7
|
+
type FocusedColumn = 'main' | 'added-components';
|
|
8
|
+
export interface PendingRejectCascade {
|
|
9
|
+
target: string;
|
|
10
|
+
ancestors: string[];
|
|
11
|
+
descendants: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function useScopeGate({ components, onConfirm, onQuit }: UseScopeGateOptions): {
|
|
14
|
+
totalWidth: number;
|
|
15
|
+
columnPlan: {
|
|
16
|
+
layout: "single" | "two-column";
|
|
17
|
+
main: number;
|
|
18
|
+
added: number;
|
|
19
|
+
};
|
|
20
|
+
panelLayout: import("./columns.js").ScopeGatePanelLayout;
|
|
21
|
+
visibleCount: number;
|
|
22
|
+
panelMaxRows: number;
|
|
23
|
+
groupedItems: import("./graph/index.js").SidebarItem[];
|
|
24
|
+
graph: import("./graph/index.js").ScopeGraph;
|
|
25
|
+
hasGroupRoots: boolean;
|
|
26
|
+
expandedGroups: Set<string>;
|
|
27
|
+
toggleExpanded: (rootName: string) => void;
|
|
28
|
+
visibleRows: import("./sidebar/components/GroupedSidebar.js").VisibleRow[];
|
|
29
|
+
safeCursor: number;
|
|
30
|
+
scrollOffset: number;
|
|
31
|
+
selectionStateByKey: Map<string, "accepted" | "rejected" | "undecided">;
|
|
32
|
+
aiFlaggedByKey: Map<string, boolean>;
|
|
33
|
+
dimPredicate: ((componentKey: string) => boolean) | undefined;
|
|
34
|
+
columnOneView: "flat" | "grouped";
|
|
35
|
+
focusedColumn: FocusedColumn;
|
|
36
|
+
showHelp: boolean;
|
|
37
|
+
closeHelp: () => void;
|
|
38
|
+
cyclesPanelOpen: boolean;
|
|
39
|
+
cyclesCursor: number;
|
|
40
|
+
slotCycles: import("./graph/cycle-detection.js").SlotCycle[];
|
|
41
|
+
aiRationalePanelOpen: boolean;
|
|
42
|
+
aiCursor: number;
|
|
43
|
+
aiRows: {
|
|
44
|
+
label: string;
|
|
45
|
+
jumpTarget: string;
|
|
46
|
+
}[];
|
|
47
|
+
aiExcludedCount: number;
|
|
48
|
+
pendingRejectCascade: PendingRejectCascade | null;
|
|
49
|
+
addedComponents: import("./columns.js").AddedComponentEntry[];
|
|
50
|
+
safeAddedComponentsCursor: number;
|
|
51
|
+
counters: {
|
|
52
|
+
accepted: number;
|
|
53
|
+
rejected: number;
|
|
54
|
+
undecided: number;
|
|
55
|
+
groups: number;
|
|
56
|
+
total: number;
|
|
57
|
+
};
|
|
58
|
+
search: {
|
|
59
|
+
searchOpen: boolean;
|
|
60
|
+
setSearchOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
61
|
+
searchQuery: string;
|
|
62
|
+
setSearchQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
63
|
+
autocompleteCandidates: string[];
|
|
64
|
+
setAutocompleteCandidates: import("react").Dispatch<import("react").SetStateAction<string[]>>;
|
|
65
|
+
jumpFilterTarget: string | null;
|
|
66
|
+
setJumpFilterTarget: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
67
|
+
columnOneView: "flat" | "grouped";
|
|
68
|
+
setColumnOneView: import("react").Dispatch<import("react").SetStateAction<"flat" | "grouped">>;
|
|
69
|
+
activeFilters: Set<import("./sidebar/step-filters.js").FilterCategory>;
|
|
70
|
+
setActiveFilters: import("react").Dispatch<import("react").SetStateAction<Set<import("./sidebar/step-filters.js").FilterCategory>>>;
|
|
71
|
+
showHelp: boolean;
|
|
72
|
+
setShowHelp: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
73
|
+
};
|
|
74
|
+
searchMatches: string[];
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
@@ -3,3 +3,4 @@ export { TokenInputScreen } from './02-token-input/screen.js';
|
|
|
3
3
|
export { PathValidationScreen } from './03-path-validation/screen.js';
|
|
4
4
|
export { CredentialsScreen } from './04-credentials/screen.js';
|
|
5
5
|
export { TokenReuseScreen } from './05-token-reuse/screen.js';
|
|
6
|
+
export { ExtractionScreen } from './06-extraction/screen.js';
|
|
@@ -14,14 +14,6 @@ export declare function buildGenerateComponentsArgs(opts: {
|
|
|
14
14
|
restoreCache?: boolean;
|
|
15
15
|
cachedComponents?: string[];
|
|
16
16
|
}): string[];
|
|
17
|
-
export declare function buildGenerateTokensArgs(opts: {
|
|
18
|
-
rawTokensPath: string;
|
|
19
|
-
agent: string;
|
|
20
|
-
model?: string;
|
|
21
|
-
bedrock?: boolean;
|
|
22
|
-
noCache?: boolean;
|
|
23
|
-
promptOverrides?: string[];
|
|
24
|
-
}): string[];
|
|
25
17
|
export declare function buildMapTokensArgs(opts: {
|
|
26
18
|
sessionId: string;
|
|
27
19
|
agent: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ImportHandoff } from '@contentful/experience-design-system-types/handoff';
|
|
2
|
+
/** The wizard state the early stages produce. Every field is one the stage used to write. */
|
|
3
|
+
export interface HandoffState {
|
|
4
|
+
credentialsSkipped: boolean;
|
|
5
|
+
tokensPath?: string;
|
|
6
|
+
tokenSessionId?: string | null;
|
|
7
|
+
tokenCount?: number;
|
|
8
|
+
tokenGenerationStatus?: 'complete';
|
|
9
|
+
outDir?: string;
|
|
10
|
+
extractSessionId?: string;
|
|
11
|
+
compositionPhase?: 'done' | 'cache-hit';
|
|
12
|
+
selectionAgentStatus?: 'complete';
|
|
13
|
+
existingEntitiesStatus?: 'idle' | 'complete' | 'failed';
|
|
14
|
+
existingEntitiesPath?: string | null;
|
|
15
|
+
}
|
|
16
|
+
/** What the user confirmed at the scope gate, which the CLI now shows. The wizard saves it, then generates. */
|
|
17
|
+
export interface HandoffScope {
|
|
18
|
+
decisions: {
|
|
19
|
+
accepted: string[];
|
|
20
|
+
rejected: string[];
|
|
21
|
+
};
|
|
22
|
+
/** Components the cache check (finished and restored before the wizard started) found already generated. */
|
|
23
|
+
cachedNames: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare function scopeFromHandoff(handoff: ImportHandoff): HandoffScope | null;
|
|
26
|
+
export declare function stateFromHandoff(handoff: ImportHandoff): HandoffState;
|
|
27
|
+
export type StartFromHandoff = {
|
|
28
|
+
ok: true;
|
|
29
|
+
handoff: ImportHandoff;
|
|
30
|
+
state: HandoffState;
|
|
31
|
+
scope: HandoffScope | null;
|
|
32
|
+
} | {
|
|
33
|
+
ok: false;
|
|
34
|
+
error: string;
|
|
35
|
+
};
|
|
36
|
+
/** Reads the handoff the CLI passed. A missing or broken one is an error to show, never a guess at a start. */
|
|
37
|
+
export declare function readHandoff(env?: NodeJS.ProcessEnv): StartFromHandoff;
|