@contentful/experience-design-system-cli 2.37.1-dev-build-c1d02862.0 → 2.37.1-dev-build-40c29bf0.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.
Files changed (51) hide show
  1. package/dist/app.js +3191 -317
  2. package/dist/index.js +3462 -316
  3. package/dist/package.json +1 -1
  4. package/dist/src/tui/import/steps/07-scope-gate/cache-check.d.ts +29 -0
  5. package/{legacy/dist/src/import/tui/scope-gate-columns.d.ts → dist/src/tui/import/steps/07-scope-gate/columns.d.ts} +22 -2
  6. package/dist/src/tui/import/steps/07-scope-gate/graph/composite-closure.d.ts +26 -0
  7. package/dist/src/tui/import/steps/07-scope-gate/graph/cycle-detection.d.ts +22 -0
  8. package/dist/src/tui/import/steps/07-scope-gate/graph/fuzzy-search.d.ts +3 -0
  9. package/dist/src/tui/import/steps/07-scope-gate/graph/index.d.ts +33 -0
  10. package/dist/src/tui/import/steps/07-scope-gate/graph/lineage.d.ts +29 -0
  11. package/dist/src/tui/import/steps/07-scope-gate/graph/search-neighborhood.d.ts +3 -0
  12. package/dist/src/tui/import/steps/07-scope-gate/graph/slot-graph.d.ts +11 -0
  13. package/dist/src/tui/import/steps/07-scope-gate/keymap.d.ts +84 -0
  14. package/dist/src/tui/import/steps/07-scope-gate/load.d.ts +8 -0
  15. package/dist/src/tui/import/steps/07-scope-gate/panels/added-column.d.ts +15 -0
  16. package/dist/src/tui/import/steps/07-scope-gate/panels/cycles-panel.d.ts +8 -0
  17. package/dist/src/tui/import/steps/07-scope-gate/panels/reject-prompt.d.ts +5 -0
  18. package/dist/src/tui/import/steps/07-scope-gate/screen.d.ts +9 -0
  19. package/dist/src/tui/import/steps/07-scope-gate/sidebar/autocomplete.d.ts +5 -0
  20. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/CompactControlBar.d.ts +4 -0
  21. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.d.ts +32 -0
  22. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.d.ts +93 -0
  23. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.d.ts +21 -0
  24. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/LegendEntry.d.ts +2 -0
  25. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/SearchMatchSummary.d.ts +11 -0
  26. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/badge.d.ts +13 -0
  27. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.d.ts +17 -0
  28. package/dist/src/tui/import/steps/07-scope-gate/sidebar/group-collapse.d.ts +2 -0
  29. package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/sidebar-search-state.d.ts +17 -0
  30. package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.d.ts +6 -0
  31. package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/useImmediateInput.d.ts +20 -0
  32. package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/useOverlayPanel.d.ts +13 -0
  33. package/dist/src/tui/import/steps/07-scope-gate/sidebar/lineage-layout.d.ts +68 -0
  34. package/dist/src/tui/import/steps/07-scope-gate/sidebar/sidebar-help.d.ts +2 -0
  35. package/dist/src/tui/import/steps/07-scope-gate/sidebar/sidebar-input.d.ts +13 -0
  36. package/dist/src/tui/import/steps/07-scope-gate/sidebar/sidebar-navigation.d.ts +18 -0
  37. package/dist/src/tui/import/steps/07-scope-gate/sidebar/step-filters.d.ts +19 -0
  38. package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +8 -0
  39. package/dist/src/tui/import/steps/07-scope-gate/sidebar/types.d.ts +7 -0
  40. package/dist/src/tui/import/steps/07-scope-gate/state.d.ts +19 -0
  41. package/dist/src/tui/import/steps/07-scope-gate/types.d.ts +24 -0
  42. package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.d.ts +31 -0
  43. package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +76 -0
  44. package/legacy/dist/src/import/tui/handoff.d.ts +11 -0
  45. package/legacy/dist/src/index.js +1511 -2733
  46. package/legacy/package.json +1 -1
  47. package/package.json +4 -4
  48. package/legacy/dist/src/import/tui/steps/ScopeGateStep.d.ts +0 -48
  49. /package/{legacy/dist/src/analyze → dist/src/tui/import/steps/07-scope-gate/graph}/scope-gate-cascade.d.ts +0 -0
  50. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/ai-flag.d.ts +0 -0
  51. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/components/CounterStrip.d.ts +0 -0
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-c1d02862.0",
3
+ "version": "2.37.1-dev-build-40c29bf0.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -0,0 +1,29 @@
1
+ export interface CacheCheckInput {
2
+ sessionId: string;
3
+ tokensPath: string;
4
+ agent: string;
5
+ agentModel?: string;
6
+ promptOverrides: string[];
7
+ existingEntitiesPath: string | null;
8
+ noCache: boolean;
9
+ }
10
+ interface CacheCheckProcess {
11
+ exitCode: number;
12
+ stdout: string;
13
+ stderr: string;
14
+ }
15
+ /** Runs the legacy CLI with these arguments and waits for it to exit. */
16
+ export type RunLegacyCli = (args: string[]) => Promise<CacheCheckProcess>;
17
+ /**
18
+ * The arguments of `generate components --cache-status --restore-cache`, in the order the wizard built them: the
19
+ * generate arguments first, then the two cache flags. Arguments are not shell-quoted; they go straight to `node`.
20
+ */
21
+ export declare function buildCacheCheckArgs(input: CacheCheckInput): string[];
22
+ /** The names on the `cache-components=["A","B"]` line. Anything missing or unreadable is an empty list. */
23
+ export declare function parseCacheComponents(stdout: string): string[];
24
+ /**
25
+ * Never throws: any failure (spawn error, non-zero exit, no output line, bad JSON) resolves to an empty list. With the
26
+ * cache off there is nothing to restore, so the command is not run at all.
27
+ */
28
+ export declare function checkGenerationCache(input: CacheCheckInput, run?: RunLegacyCli): Promise<string[]>;
29
+ export {};
@@ -1,9 +1,9 @@
1
- import type { Closure } from '../../analyze/composite-closure.js';
1
+ import type { Closure } from './graph/composite-closure.js';
2
2
  /** Structural subset of ScopeComponent needed by these helpers. */
3
3
  export interface ScopeComponentLike {
4
4
  name: string;
5
5
  }
6
- export type Decision = 'accepted' | 'rejected' | 'undecided';
6
+ import type { Decision } from './types.js';
7
7
  export declare const SCOPE_GATE_MAIN_COLUMN_WIDTH = 54;
8
8
  export declare const ACCEPTED_COMPONENTS_COLUMN_WIDTH = 36;
9
9
  export interface ScopeGatePanelLayout {
@@ -34,3 +34,23 @@ export declare function computeCounters(components: ScopeComponentLike[], closur
34
34
  groups: number;
35
35
  total: number;
36
36
  };
37
+ export declare function sideColumnLabelStyle(input: {
38
+ isCycle: boolean;
39
+ isSelected: boolean;
40
+ focused: boolean;
41
+ }): {
42
+ nameColor: string | undefined;
43
+ nameBold: boolean;
44
+ nameInverse: boolean;
45
+ nameUnderline: boolean;
46
+ suffixColor: string | undefined;
47
+ suffixDim: boolean;
48
+ suffixInverse: boolean;
49
+ suffixUnderline: boolean;
50
+ };
51
+ export declare function computeColumnWindow(total: number, cursor: number, visibleCount: number): {
52
+ start: number;
53
+ end: number;
54
+ above: number;
55
+ below: number;
56
+ };
@@ -0,0 +1,26 @@
1
+ export interface ComponentGraphNode {
2
+ name: string;
3
+ slots: Array<{
4
+ name: string;
5
+ allowedComponents?: string[];
6
+ }>;
7
+ }
8
+ interface ClosureNode {
9
+ name: string;
10
+ depth: number;
11
+ path: string[];
12
+ parents: string[];
13
+ }
14
+ export interface Closure {
15
+ root: string;
16
+ nodes: ClosureNode[];
17
+ containsCycle: boolean;
18
+ cyclePath?: string[];
19
+ }
20
+ export type NodeStatus = 'ok' | 'warning' | 'error';
21
+ export declare function findRoots(components: ComponentGraphNode[], selected?: Set<string>): string[];
22
+ export declare function computeClosure(root: string, components: ComponentGraphNode[]): Closure;
23
+ export declare function computeAllClosures(components: ComponentGraphNode[], selected?: Set<string>): Map<string, Closure>;
24
+ export declare function aggregateStatus(closure: Closure, perNodeStatus: Map<string, NodeStatus>): NodeStatus;
25
+ export declare function findSharedDeps(closures: Map<string, Closure>): Map<string, string[]>;
26
+ export {};
@@ -0,0 +1,22 @@
1
+ /** A directed edge in the slot-dependency graph. */
2
+ export interface SlotEdge {
3
+ fromComponent: string;
4
+ slotName: string;
5
+ toComponent: string;
6
+ }
7
+ /** A single elementary cycle, with `path[0] === path[path.length - 1]`. */
8
+ export interface SlotCycle {
9
+ path: string[];
10
+ edges: SlotEdge[];
11
+ }
12
+ /** Input shape mirroring the slot definition on CDFComponentEntry. */
13
+ export interface ComponentSlotInfo {
14
+ name: string;
15
+ slots: Array<{
16
+ name: string;
17
+ allowedComponents?: string[];
18
+ }>;
19
+ }
20
+ export declare function findSlotCycles(components: ComponentSlotInfo[]): SlotCycle[];
21
+ export declare function suggestCycleBreakEdge(cycle: SlotCycle, allCycles: SlotCycle[]): SlotEdge;
22
+ export declare function formatCyclePath(cycle: SlotCycle, maxHops?: number): string;
@@ -0,0 +1,3 @@
1
+ export declare function fuzzyMatches(query: string, text: string): boolean;
2
+ export declare function fuzzyScore(query: string, text: string): number | null;
3
+ export declare function fuzzyFilter(query: string, candidates: string[]): string[];
@@ -0,0 +1,33 @@
1
+ import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
2
+ import type { ScopeComponent } from '../types.js';
3
+ import { type Closure, type ComponentGraphNode, type NodeStatus } from './composite-closure.js';
4
+ import { type SlotCycle } from './cycle-detection.js';
5
+ export interface ScopeGraph {
6
+ /** The slot dependency graph, one node per component. */
7
+ nodes: ComponentGraphNode[];
8
+ /** Every slot cycle. A graph that cannot be searched for cycles has none, as in legacy. */
9
+ cycles: SlotCycle[];
10
+ /** Names in at least one cycle. */
11
+ cycleParticipants: Set<string>;
12
+ /** For each cycle member, the whole set of members that has to be accepted or rejected with it. */
13
+ cycleUnits: Map<string, Set<string>>;
14
+ /** For each root, what it needs. A root with more than one node is a group. */
15
+ closures: Map<string, Closure>;
16
+ }
17
+ export interface SidebarItem {
18
+ key: string;
19
+ entry: CDFComponentEntry;
20
+ status: NodeStatus;
21
+ }
22
+ /** What the sidebar draws a row from: an entry standing in for the component (its slots are what matter), and its status. */
23
+ export declare function sidebarItems(components: ScopeComponent[]): SidebarItem[];
24
+ export declare function buildScopeGraph(components: ScopeComponent[]): ScopeGraph;
25
+ /** Names that change when `target` is accepted. Pulls in everything it needs, whole cycles together. */
26
+ export declare function acceptCascade(graph: ScopeGraph, target: string): string[];
27
+ /** Rejecting rejects every ancestor and deselects the descendants. The screen asks first when it is 2 or more. */
28
+ export declare function rejectCascade(graph: ScopeGraph, target: string): {
29
+ toReject: string[];
30
+ toDeselect: string[];
31
+ };
32
+ /** Everything reachable from the seeds, including the cycles they depend on. Used by "toggle all" and "accept non-flagged". */
33
+ export declare function reachableCycleMembers(graph: ScopeGraph, seeds: string[]): string[];
@@ -0,0 +1,29 @@
1
+ import type { ComponentGraphNode } from './composite-closure.js';
2
+ export interface LineageParentEdge {
3
+ parent: string;
4
+ slotName: string;
5
+ }
6
+ export interface LineageEdge {
7
+ from: string;
8
+ slotName: string;
9
+ to: string;
10
+ }
11
+ export type LineageChain = LineageEdge[];
12
+ export declare function findDirectParents(target: string, components: ComponentGraphNode[]): LineageParentEdge[];
13
+ export declare function findAllAncestors(target: string, components: ComponentGraphNode[]): Set<string>;
14
+ export declare function findAllAncestorChains(target: string, components: ComponentGraphNode[]): LineageChain[];
15
+ export interface AncestorTreeNode {
16
+ name: string;
17
+ incomingSlotName?: string;
18
+ depth: number;
19
+ shared: boolean;
20
+ cycle: boolean;
21
+ parents: AncestorTreeNode[];
22
+ }
23
+ export declare function buildAncestorTree(target: string, components: ComponentGraphNode[]): AncestorTreeNode;
24
+ export interface AncestorTreeLine {
25
+ text: string;
26
+ jumpTarget?: string;
27
+ depth: number;
28
+ }
29
+ export declare function renderAncestorTree(node: AncestorTreeNode): AncestorTreeLine[];
@@ -0,0 +1,3 @@
1
+ import type { ComponentGraphNode } from './composite-closure.js';
2
+ export declare function computeDirectNeighborhood(matches: Iterable<string>, graph: ComponentGraphNode[]): Set<string>;
3
+ export declare function findAllAncestors(target: string, graph: ComponentGraphNode[]): Set<string>;
@@ -0,0 +1,11 @@
1
+ import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
2
+ import type { ComponentGraphNode } from './composite-closure.js';
3
+ export interface SlotGraphInput {
4
+ key: string;
5
+ entry: CDFComponentEntry;
6
+ status?: string;
7
+ }
8
+ export interface BuildOptions {
9
+ stripRejectedEdges?: boolean;
10
+ }
11
+ export declare function buildComponentGraph(components: SlotGraphInput[], opts?: BuildOptions): ComponentGraphNode[];
@@ -0,0 +1,84 @@
1
+ export type GateMode = 'help' | 'reject-prompt' | 'search' | 'cycles' | 'flags' | 'main';
2
+ export interface KeyPress {
3
+ input: string;
4
+ upArrow?: boolean;
5
+ downArrow?: boolean;
6
+ return?: boolean;
7
+ escape?: boolean;
8
+ tab?: boolean;
9
+ shiftTab?: boolean;
10
+ ctrl?: boolean;
11
+ }
12
+ /** What legacy looked at besides the key and the open panel. */
13
+ export interface GateContext {
14
+ focusedColumn: 'main' | 'added-components';
15
+ /** The layout has only the main column, so Tab has nowhere to go. */
16
+ singleColumn: boolean;
17
+ hasCycles: boolean;
18
+ /** Some component was flagged by the AI with a reason to show. */
19
+ hasFlagReasons: boolean;
20
+ /** A jump filter is on, so Esc clears it before it quits. */
21
+ jumpFilterActive: boolean;
22
+ /** Search text is set, so Esc clears it before it quits. */
23
+ searchActive: boolean;
24
+ /** The list in the focused column has no rows, so the arrows have nothing to move. */
25
+ focusedListEmpty: boolean;
26
+ }
27
+ export type GateAction = {
28
+ type: 'none';
29
+ } | {
30
+ type: 'quit';
31
+ } | {
32
+ type: 'confirm';
33
+ } | {
34
+ type: 'close-help';
35
+ } | {
36
+ type: 'answer-reject-prompt';
37
+ confirm: boolean;
38
+ } | {
39
+ type: 'close-panel';
40
+ } | {
41
+ type: 'close-search';
42
+ } | {
43
+ type: 'submit-search';
44
+ } | {
45
+ type: 'search-input';
46
+ } | {
47
+ type: 'clear-jump-filter';
48
+ } | {
49
+ type: 'clear-search';
50
+ } | {
51
+ type: 'move';
52
+ delta: -1 | 1;
53
+ } | {
54
+ type: 'jump-to-selected';
55
+ } | {
56
+ type: 'accept';
57
+ } | {
58
+ type: 'reject';
59
+ } | {
60
+ type: 'toggle-all';
61
+ } | {
62
+ type: 'accept-unflagged';
63
+ } | {
64
+ type: 'toggle-group';
65
+ } | {
66
+ type: 'expand-all';
67
+ } | {
68
+ type: 'collapse-all';
69
+ } | {
70
+ type: 'switch-column';
71
+ delta: -1 | 1;
72
+ } | {
73
+ type: 'open-panel';
74
+ panel: 'cycles' | 'flags' | 'help' | 'search';
75
+ } | {
76
+ type: 'toggle-dependencies';
77
+ } | {
78
+ type: 'toggle-cycle-filter';
79
+ } | {
80
+ type: 'toggle-jump-filter';
81
+ } | {
82
+ type: 'toggle-view';
83
+ };
84
+ export declare function resolveKey(mode: GateMode, key: KeyPress, ctx: GateContext): GateAction;
@@ -0,0 +1,8 @@
1
+ import type { ScopeGateLoad } from './types.js';
2
+ /**
3
+ * Reads the components for the gate, once, before the screen renders. Replaces legacy's database read inside render
4
+ * (and its "remember the last list" workaround for the resize that happened after confirming): with nothing written
5
+ * until the wizard saves the decisions, the list cannot change under the screen.
6
+ * Uses `loadScopeComponents` from backend-pipeline, which is identical to legacy's.
7
+ */
8
+ export declare function loadScopeGate(sessionId: string): ScopeGateLoad;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { type AddedComponentEntry } from '../columns.js';
3
+ interface AddedColumnProps {
4
+ title: string;
5
+ width: number;
6
+ height: number;
7
+ entries: AddedComponentEntry[];
8
+ cursor: number;
9
+ focused: boolean;
10
+ aiFlaggedByKey?: Map<string, boolean>;
11
+ visibleCount: number;
12
+ }
13
+ /** The accepted components, cycle members first. Rejecting from here is the only decision it allows. */
14
+ export declare function AddedColumn(props: AddedColumnProps): React.ReactElement;
15
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import type { SlotCycle } from '../graph/cycle-detection.js';
3
+ interface CyclesPanelProps {
4
+ cycles: SlotCycle[];
5
+ cursor: number;
6
+ }
7
+ export declare function CyclesPanel({ cycles, cursor }: CyclesPanelProps): React.ReactElement;
8
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { PendingRejectCascade } from '../use-scope-gate.js';
3
+ export declare function RejectPrompt({ pending }: {
4
+ pending: PendingRejectCascade;
5
+ }): React.ReactElement;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { ScopeComponent, ScopeDecisions } from './types.js';
3
+ interface ScopeGateScreenProps {
4
+ components: ScopeComponent[];
5
+ onConfirm: (decisions: ScopeDecisions) => void;
6
+ onQuit: () => void;
7
+ }
8
+ export declare function ScopeGateScreen(props: ScopeGateScreenProps): React.ReactElement;
9
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface AutocompleteResult {
2
+ completion: string;
3
+ candidates: string[];
4
+ }
5
+ export declare function computeAutocomplete(query: string, names: string[]): AutocompleteResult;
@@ -0,0 +1,4 @@
1
+ export declare function CompactControlBar({ hasGroupRoots, searchActive }: {
2
+ hasGroupRoots: boolean;
3
+ searchActive: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -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,2 @@
1
+ import React from 'react';
2
+ export declare function legendEntry(keyBracket: string, label: string, active?: boolean): React.ReactElement;
@@ -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,2 @@
1
+ import type { Closure } from '../graph/composite-closure.js';
2
+ export declare function resolveGroupRoot(key: string, closures: Map<string, Closure>, cycleSet: Set<string>): string | undefined;
@@ -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,6 @@
1
+ export type TerminalSize = {
2
+ columns: number;
3
+ rows: number;
4
+ };
5
+ /** Keep layout consumers synchronized with terminal resize events. */
6
+ export declare function useTerminalSize(): TerminalSize;
@@ -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;