@contentful/experience-design-system-cli 2.38.0 → 2.38.1-dev-build-6d903339.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 (189) hide show
  1. package/dist/app.d.ts +3 -6
  2. package/dist/app.js +28155 -642
  3. package/dist/index.js +32060 -421
  4. package/dist/package.json +8 -3
  5. package/dist/src/commands/import-options.d.ts +12 -0
  6. package/dist/src/commands/import.d.ts +2 -1
  7. package/dist/src/tui/home/home.theme.d.ts +1 -2
  8. package/dist/src/tui/import/resolve-user-path.d.ts +1 -0
  9. package/dist/src/tui/import/shared/error-step/controls.d.ts +7 -0
  10. package/{legacy/dist/src/import/tui/steps/ErrorStep.d.ts → dist/src/tui/import/shared/error-step/error-step.d.ts} +2 -2
  11. package/dist/src/tui/import/shared/error-step/logic.d.ts +15 -0
  12. package/dist/src/tui/import/shared/gate-step/controls.d.ts +8 -0
  13. package/dist/src/tui/import/shared/gate-step/gate-step.d.ts +14 -0
  14. package/dist/src/tui/import/shared/gate-step/logic.d.ts +11 -0
  15. package/dist/src/tui/import/shared/index.d.ts +3 -0
  16. package/dist/src/tui/import/shared/running-step/logic.d.ts +12 -0
  17. package/dist/src/tui/import/shared/running-step/running-step.d.ts +11 -0
  18. package/dist/src/tui/import/shared/running-step/theme.d.ts +3 -0
  19. package/dist/src/tui/import/shared/running-step/use-elapsed.d.ts +1 -0
  20. package/dist/src/tui/import/steps/03-path-validation/controls.d.ts +13 -0
  21. package/dist/src/tui/import/steps/03-path-validation/helpers/scan-files.d.ts +10 -0
  22. package/dist/src/tui/import/steps/03-path-validation/logic.d.ts +43 -0
  23. package/dist/src/tui/import/steps/03-path-validation/screen.d.ts +12 -0
  24. package/dist/src/tui/import/steps/04-credentials/controls.d.ts +21 -0
  25. package/dist/src/tui/import/steps/04-credentials/logic.d.ts +15 -0
  26. package/dist/src/tui/import/steps/04-credentials/screen.d.ts +17 -0
  27. package/dist/src/tui/import/steps/04-credentials/validate.d.ts +8 -0
  28. package/dist/src/tui/import/steps/05-token-reuse/logic.d.ts +21 -0
  29. package/dist/src/tui/import/steps/05-token-reuse/screen.d.ts +10 -0
  30. package/dist/src/tui/import/steps/06-extraction/find-skill-path.d.ts +1 -0
  31. package/dist/src/tui/import/steps/06-extraction/logic.d.ts +48 -0
  32. package/dist/src/tui/import/steps/06-extraction/run.d.ts +26 -0
  33. package/dist/src/tui/import/steps/06-extraction/screen.d.ts +10 -0
  34. package/dist/src/tui/import/steps/06-extraction/selection.d.ts +18 -0
  35. package/dist/src/tui/import/steps/06-extraction/types.d.ts +46 -0
  36. package/dist/src/tui/import/steps/06-extraction/use-extraction.d.ts +14 -0
  37. package/dist/src/tui/import/steps/07-scope-gate/cache-check.d.ts +17 -0
  38. package/{legacy/dist/src/import/tui/scope-gate-columns.d.ts → dist/src/tui/import/steps/07-scope-gate/columns.d.ts} +22 -2
  39. package/dist/src/tui/import/steps/07-scope-gate/graph/composite-closure.d.ts +26 -0
  40. package/dist/src/tui/import/steps/07-scope-gate/graph/cycle-detection.d.ts +27 -0
  41. package/dist/src/tui/import/steps/07-scope-gate/graph/fuzzy-search.d.ts +3 -0
  42. package/dist/src/tui/import/steps/07-scope-gate/graph/index.d.ts +33 -0
  43. package/dist/src/tui/import/steps/07-scope-gate/graph/lineage.d.ts +29 -0
  44. package/dist/src/tui/import/steps/07-scope-gate/graph/search-neighborhood.d.ts +3 -0
  45. package/dist/src/tui/import/steps/07-scope-gate/graph/slot-graph.d.ts +11 -0
  46. package/dist/src/tui/import/steps/07-scope-gate/keymap.d.ts +84 -0
  47. package/dist/src/tui/import/steps/07-scope-gate/load.d.ts +8 -0
  48. package/dist/src/tui/import/steps/07-scope-gate/panels/added-column.d.ts +15 -0
  49. package/dist/src/tui/import/steps/07-scope-gate/panels/cycles-panel.d.ts +8 -0
  50. package/dist/src/tui/import/steps/07-scope-gate/panels/reject-prompt.d.ts +5 -0
  51. package/dist/src/tui/import/steps/07-scope-gate/screen.d.ts +9 -0
  52. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GotoBanner.d.ts +32 -0
  53. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.d.ts +93 -0
  54. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/HelpOverlay.d.ts +21 -0
  55. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/badge.d.ts +13 -0
  56. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.d.ts +31 -0
  57. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/group-collapse.d.ts +1 -1
  58. package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/use-terminal-size.d.ts +6 -0
  59. package/dist/src/tui/import/steps/07-scope-gate/sidebar/hooks/useImmediateInput.d.ts +19 -0
  60. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/sidebar-help.d.ts +1 -1
  61. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/sidebar-navigation.d.ts +2 -2
  62. package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +8 -0
  63. package/dist/src/tui/import/steps/07-scope-gate/sidebar/types.d.ts +7 -0
  64. package/dist/src/tui/import/steps/07-scope-gate/state.d.ts +19 -0
  65. package/dist/src/tui/import/steps/07-scope-gate/types.d.ts +24 -0
  66. package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate-flow.d.ts +27 -0
  67. package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +76 -0
  68. package/dist/src/tui/import/steps/08-generation/logic.d.ts +27 -0
  69. package/dist/src/tui/import/steps/08-generation/map-tokens.d.ts +14 -0
  70. package/dist/src/tui/import/steps/08-generation/run.d.ts +22 -0
  71. package/dist/src/tui/import/steps/08-generation/save-decisions.d.ts +8 -0
  72. package/dist/src/tui/import/steps/08-generation/screen.d.ts +12 -0
  73. package/dist/src/tui/import/steps/08-generation/types.d.ts +47 -0
  74. package/dist/src/tui/import/steps/08-generation/use-generation.d.ts +14 -0
  75. package/dist/src/tui/import/steps/09-review/components/ComponentRationalePanel.d.ts +10 -0
  76. package/dist/src/tui/import/steps/09-review/components/FieldEditor.d.ts +67 -0
  77. package/dist/src/tui/import/steps/09-review/components/FinalizeDialog.d.ts +22 -0
  78. package/dist/src/tui/import/steps/09-review/components/HighlightedLine.d.ts +9 -0
  79. package/dist/src/tui/import/steps/09-review/components/JsonPanel.d.ts +11 -0
  80. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/09-review}/components/LivePreviewSummary.d.ts +2 -2
  81. package/dist/src/tui/import/steps/09-review/components/QuitDialog.d.ts +8 -0
  82. package/dist/src/tui/import/steps/09-review/components/RationaleLine.d.ts +21 -0
  83. package/dist/src/tui/import/steps/09-review/components/RationalePanel.d.ts +15 -0
  84. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/09-review}/components/ReviewComponentPanel.d.ts +3 -3
  85. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/09-review}/components/ReviewDetailsEditor.d.ts +3 -3
  86. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/09-review}/components/ReviewDialogs.d.ts +2 -2
  87. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/09-review}/components/ReviewStatus.d.ts +1 -1
  88. package/dist/src/tui/import/steps/09-review/components/ScrollablePanel.d.ts +14 -0
  89. package/dist/src/tui/import/steps/09-review/components/TokenReviewPanel.d.ts +30 -0
  90. package/dist/src/tui/import/steps/09-review/components/removed-components-text.d.ts +7 -0
  91. package/dist/src/tui/import/steps/09-review/components/wrap-text.d.ts +1 -0
  92. package/{legacy/dist/src/import/tui/steps/GenerateReviewStep.d.ts → dist/src/tui/import/steps/09-review/generate-review-step.d.ts} +1 -1
  93. package/{legacy/dist/src/import → dist/src/tui/import/steps/09-review/graph}/cycle-auto-reject.d.ts +1 -1
  94. package/{legacy/dist/src/analyze → dist/src/tui/import/steps/09-review/graph}/cycle-view.d.ts +2 -2
  95. package/dist/src/tui/import/steps/09-review/graph/issue-inheritance.d.ts +8 -0
  96. package/dist/src/tui/import/steps/09-review/graph/selection-cascade.d.ts +3 -0
  97. package/{legacy/dist/src/import/tui/steps → dist/src/tui/import/steps/09-review/helpers}/enumerate-cycle-breaks.d.ts +1 -1
  98. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/09-review}/history.d.ts +1 -1
  99. package/dist/src/tui/import/steps/09-review/preview-annotations.d.ts +26 -0
  100. package/{legacy/dist/src/import/tui/steps → dist/src/tui/import/steps/09-review}/review-details-panel.d.ts +2 -2
  101. package/{legacy/dist/src/import/tui/hooks → dist/src/tui/import/steps/09-review}/review-input.d.ts +2 -2
  102. package/{legacy/dist/src/import/tui/runLivePreview.d.ts → dist/src/tui/import/steps/09-review/run-live-preview.d.ts} +2 -3
  103. package/dist/src/tui/import/steps/09-review/scroll-offset.d.ts +30 -0
  104. package/dist/src/tui/import/steps/09-review/session.d.ts +26 -0
  105. package/dist/src/tui/import/steps/09-review/theme.d.ts +9 -0
  106. package/dist/src/tui/import/steps/09-review/token-suggestions.d.ts +8 -0
  107. package/dist/src/tui/import/steps/09-review/types.d.ts +19 -0
  108. package/{legacy/dist/src/import/tui/hooks/useReviewEditor.d.ts → dist/src/tui/import/steps/09-review/use-review-editor.d.ts} +1 -3
  109. package/{legacy/dist/src/import/tui/hooks/useReviewPreview.d.ts → dist/src/tui/import/steps/09-review/use-review-preview.d.ts} +2 -2
  110. package/{legacy/dist/src/import/tui/hooks/useReviewSession.d.ts → dist/src/tui/import/steps/09-review/use-review-session.d.ts} +5 -35
  111. package/dist/src/tui/import/steps/10-flow/flow/build-flow-start.d.ts +21 -0
  112. package/dist/src/tui/import/steps/10-flow/flow/controller.d.ts +65 -0
  113. package/dist/src/tui/import/steps/10-flow/flow/preview.d.ts +56 -0
  114. package/dist/src/tui/import/steps/10-flow/flow/push.d.ts +43 -0
  115. package/dist/src/tui/import/steps/10-flow/flow/save.d.ts +50 -0
  116. package/dist/src/tui/import/steps/10-flow/flow/screen.d.ts +17 -0
  117. package/dist/src/tui/import/steps/10-flow/flow/types.d.ts +71 -0
  118. package/dist/src/tui/import/steps/10-flow/flow/use-flow.d.ts +9 -0
  119. package/{legacy/dist/src/import/tui/steps → dist/src/tui/import/steps/10-flow/screens}/PushingStep.d.ts +1 -1
  120. package/{legacy/dist/src/import/tui/steps → dist/src/tui/import/steps/10-flow/screens}/WizardPreviewStep.d.ts +0 -1
  121. package/dist/src/tui/import/steps/10-flow/support/contentful-urls.d.ts +15 -0
  122. package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/10-flow/support}/wizard-state-transitions.d.ts +0 -13
  123. package/dist/src/tui/import/steps/10-flow/theme.d.ts +13 -0
  124. package/dist/src/tui/import/steps/index.d.ts +4 -0
  125. package/dist/src/tui/import/steps/preview-validation-error/logic.d.ts +12 -0
  126. package/dist/src/tui/import/steps/preview-validation-error/screen.d.ts +11 -0
  127. package/dist/src/tui/user-agent.d.ts +5 -0
  128. package/legacy/dist/package.json +4 -1
  129. package/legacy/dist/src/analyze/select/tui/components/ScrollablePanel.d.ts +2 -2
  130. package/legacy/dist/src/analyze/select/tui/theme.d.ts +1 -1
  131. package/legacy/dist/src/index.js +15073 -23076
  132. package/legacy/package.json +8 -3
  133. package/package.json +8 -3
  134. package/skills/generate-components.md +612 -0
  135. package/skills/generate-tokens.md +194 -0
  136. package/skills/map-tokens.md +102 -0
  137. package/skills/select-components.md +235 -0
  138. package/dist/src/tui/import/spawn-v1-import.d.ts +0 -29
  139. package/dist/src/tui/import/terminal-input.d.ts +0 -2
  140. package/legacy/dist/src/import/agent-model-resolve.d.ts +0 -27
  141. package/legacy/dist/src/import/command.d.ts +0 -2
  142. package/legacy/dist/src/import/composition-options.d.ts +0 -7
  143. package/legacy/dist/src/import/tui/WizardApp.d.ts +0 -67
  144. package/legacy/dist/src/import/tui/run-selection-agent.d.ts +0 -9
  145. package/legacy/dist/src/import/tui/runScopeGate.d.ts +0 -12
  146. package/legacy/dist/src/import/tui/spawn-generate.d.ts +0 -33
  147. package/legacy/dist/src/import/tui/steps/CredentialsStep.d.ts +0 -43
  148. package/legacy/dist/src/import/tui/steps/GateStep.d.ts +0 -15
  149. package/legacy/dist/src/import/tui/steps/PathValidationStep.d.ts +0 -10
  150. package/legacy/dist/src/import/tui/steps/PreviewValidationErrorStep.d.ts +0 -11
  151. package/legacy/dist/src/import/tui/steps/RunningStep.d.ts +0 -32
  152. package/legacy/dist/src/import/tui/steps/ScopeGateStep.d.ts +0 -48
  153. package/legacy/dist/src/import/tui/steps/TokenInputStep.d.ts +0 -8
  154. package/legacy/dist/src/import/tui/steps/WelcomeStep.d.ts +0 -7
  155. package/legacy/dist/src/import/tui/wizard-422-helpers.d.ts +0 -48
  156. package/legacy/dist/src/import/tui/wizard-generate-progress.d.ts +0 -21
  157. /package/{legacy/dist/src/analyze → dist/src/tui/import/steps/07-scope-gate/graph}/scope-gate-cascade.d.ts +0 -0
  158. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/ai-flag.d.ts +0 -0
  159. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/autocomplete.d.ts +0 -0
  160. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/components/CompactControlBar.d.ts +0 -0
  161. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/components/CounterStrip.d.ts +0 -0
  162. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/components/LegendEntry.d.ts +0 -0
  163. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/components/SearchMatchSummary.d.ts +0 -0
  164. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/hooks/sidebar-search-state.d.ts +0 -0
  165. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/hooks/useOverlayPanel.d.ts +0 -0
  166. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/lineage-layout.d.ts +0 -0
  167. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/sidebar-input.d.ts +0 -0
  168. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/07-scope-gate/sidebar}/step-filters.d.ts +0 -0
  169. /package/{legacy/dist/src/import/tui/steps → dist/src/tui/import/steps/09-review/helpers}/auto-reject-decision.d.ts +0 -0
  170. /package/{legacy/dist/src/import/tui/steps → dist/src/tui/import/steps/09-review/helpers}/breaking-change-format.d.ts +0 -0
  171. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/09-review/helpers}/cycle-panel-scroll.d.ts +0 -0
  172. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/09-review/helpers}/sidebar-width.d.ts +0 -0
  173. /package/{legacy/dist/src/import/tui/steps → dist/src/tui/import/steps/09-review}/review-json-panel.d.ts +0 -0
  174. /package/{legacy/dist/src/import/tui/useFinalizePreview.d.ts → dist/src/tui/import/steps/09-review/use-finalize-preview.d.ts} +0 -0
  175. /package/{legacy/dist/src/import/tui/useLivePreview.d.ts → dist/src/tui/import/steps/09-review/use-live-preview.d.ts} +0 -0
  176. /package/{legacy/dist/src/import/tui/hooks/useReviewSurfaceState.d.ts → dist/src/tui/import/steps/09-review/use-review-surface-state.d.ts} +0 -0
  177. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/10-flow/components}/CustomPromptBanner.d.ts +0 -0
  178. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/10-flow}/components/SpaceEnvironment.d.ts +0 -0
  179. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/10-flow}/components/StepHeader.d.ts +0 -0
  180. /package/{legacy/dist/src/import/tui/steps → dist/src/tui/import/steps/10-flow/screens}/DoneStep.d.ts +0 -0
  181. /package/{legacy/dist/src/runs/path-prompt.d.ts → dist/src/tui/import/steps/10-flow/screens/PathPrompt.d.ts} +0 -0
  182. /package/{legacy/dist/src/import → dist/src/tui/import/steps/10-flow/support}/path-utils.d.ts +0 -0
  183. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/10-flow/support}/preview-confirmation-input.d.ts +0 -0
  184. /package/{legacy/dist/src/import/tui/steps → dist/src/tui/import/steps/10-flow/support}/preview-diff.d.ts +0 -0
  185. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/10-flow/support}/push-progress.d.ts +0 -0
  186. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/10-flow/support}/run-print-files-helpers.d.ts +0 -0
  187. /package/{legacy/dist/src/import/tui → dist/src/tui/import/steps/10-flow/support}/run-teaser.d.ts +0 -0
  188. /package/{legacy/dist/src/tui → dist/src/tui/import/steps/10-flow/support}/use-blinking-cursor.d.ts +0 -0
  189. /package/{legacy/dist/src/tui → dist/src/tui/import/steps/10-flow/support}/use-timed-spinner.d.ts +0 -0
@@ -1,67 +0,0 @@
1
- import React from 'react';
2
- import type { CDFDocument, CDFComponentEntry, DTCGTokenEntry } from '@contentful/experience-design-system-types';
3
- import { type AgentAuthStatus } from '@contentful/experience-design-system-generation';
4
- export declare function buildGenerateComponentsArgs(opts: {
5
- sessionId: string;
6
- tokensPath?: string;
7
- agent: string;
8
- model?: string;
9
- bedrock?: boolean;
10
- noCache?: boolean;
11
- generatePromptPath?: string;
12
- promptOverrides?: string[];
13
- existingEntitiesPath?: string;
14
- restoreCache?: boolean;
15
- cachedComponents?: string[];
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
- export declare function buildMapTokensArgs(opts: {
26
- sessionId: string;
27
- agent: string;
28
- model?: string;
29
- noCache?: boolean;
30
- skipAgent?: boolean;
31
- promptOverrides?: string[];
32
- existingEntitiesPath?: string;
33
- }): string[];
34
- export declare function shouldRunMapTokens(opts: {
35
- mappablePropCount: number;
36
- rawTokenCount: number;
37
- }): boolean;
38
- export declare function buildSavedCDF(components: Array<{
39
- key: string;
40
- entry: CDFComponentEntry;
41
- }>, tokens: DTCGTokenEntry[], opts?: {
42
- deleteAll?: boolean;
43
- }): CDFDocument;
44
- export declare function formatAcceptanceSummary(opts: {
45
- accepted: number;
46
- autoRejected: number;
47
- }): string;
48
- export declare function parsePrintTokensCount(stdout: string): number;
49
- export type WizardAppProps = {
50
- initialSpaceId?: string;
51
- initialEnvironmentId?: string;
52
- initialCmaToken?: string;
53
- initialHost?: string;
54
- initialAgent?: string;
55
- initialModel?: string;
56
- bedrock?: boolean;
57
- initialProjectPath?: string;
58
- host?: string;
59
- promptOverrides?: string[];
60
- noCache?: boolean;
61
- livePreview?: boolean;
62
- generatePromptPath?: string;
63
- skipMapTokens?: boolean;
64
- initialRawTokensPath?: string;
65
- initialAgentAuth?: Promise<AgentAuthStatus>;
66
- };
67
- export declare function WizardApp({ initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, initialAgent, initialModel, bedrock, initialProjectPath, host, promptOverrides, noCache, livePreview, generatePromptPath, skipMapTokens, initialRawTokensPath, initialAgentAuth, }?: WizardAppProps): React.ReactElement;
@@ -1,9 +0,0 @@
1
- import { type AgentName } from '@contentful/experience-design-system-generation';
2
- export declare function runSelectionAgent(options: {
3
- sessionId: string;
4
- agent: AgentName;
5
- model?: string;
6
- promptText?: string;
7
- promptPath?: string;
8
- noCache?: boolean;
9
- }): Promise<void>;
@@ -1,12 +0,0 @@
1
- export declare function runScopeGate(opts: {
2
- sessionId: string;
3
- decisions: {
4
- accepted: string[];
5
- rejected: string[];
6
- };
7
- onAdvanceToGenerate: (info: {
8
- sessionId: string;
9
- acceptedCount: number;
10
- }) => Promise<void> | void;
11
- onAdvanceToPushFlow: (acceptedCount: number) => Promise<void> | void;
12
- }): Promise<void>;
@@ -1,33 +0,0 @@
1
- /**
2
- * Extracted spawn helper for the `generate components` subprocess.
3
- *
4
- * Why this exists: the wizard now kicks off generation from TWO call sites —
5
- * the post-credentials path (`runGenerate`) AND a pre-fetch from scope-gate
6
- * confirm (Change 2 in the prefetch spec). Both need the same spawn-and-stream
7
- * behavior but the await-on-exit happens at different times. Keeping `runGenerate`
8
- * as a thin wrapper around this helper lets the pre-fetch path stash the
9
- * `donePromise` in a ref and resolve it later.
10
- *
11
- * Subprocess hygiene: we listen for 'close' (not 'exit') when surfacing the
12
- * final result so the child's stdio + any inherited file handles (e.g. the
13
- * pipeline SQLite WAL/SHM) have been fully released by the OS before the
14
- * wizard re-enters that path. This applies the same lesson as
15
- * fix/auto-filter-db-lock.
16
- */
17
- import { type ChildProcess } from 'node:child_process';
18
- export type SpawnGenerateResult = {
19
- exitCode: number;
20
- signal: NodeJS.Signals | null;
21
- stdout: string;
22
- stderr: string;
23
- };
24
- export type SpawnGenerateOpts = {
25
- command: string;
26
- args: string[];
27
- onStderr?: (chunk: string) => void;
28
- onStdout?: (chunk: string) => void;
29
- };
30
- export declare function spawnGenerateChild(opts: SpawnGenerateOpts): {
31
- child: ChildProcess;
32
- donePromise: Promise<SpawnGenerateResult>;
33
- };
@@ -1,43 +0,0 @@
1
- import React from 'react';
2
- type CredentialsStepProps = {
3
- summary?: string;
4
- error?: string;
5
- initialSpaceId?: string;
6
- initialEnvironmentId?: string;
7
- initialCmaToken?: string;
8
- initialHost?: string;
9
- /**
10
- * When true, the credentials screen stays mounted but locks input and shows
11
- * an inline "Validating credentials..." status. Replaces the previous
12
- * dedicated `validating-credentials` render screen so the operator sees a
13
- * continuous credentials surface instead of a transient loading screen
14
- * (Change 1 of the wizard prefetch refactor).
15
- */
16
- validating?: boolean;
17
- /** Background validation of unchanged prefilled credentials; input remains editable. */
18
- backgroundValidating?: boolean;
19
- /** Inline status describing in-flight background generation prefetch. */
20
- generatePrefetchStatus?: 'idle' | 'running' | 'complete' | 'failed';
21
- /** Error message from a failed generation prefetch (rendered as a banner). */
22
- generatePrefetchError?: string | null;
23
- /** Called when the user submits with any field changed from its initial value */
24
- onConfirm: (spaceId: string, environmentId: string, cmaToken: string, host: string) => void;
25
- onValuesChange?: (spaceId: string, environmentId: string, cmaToken: string, host: string) => void;
26
- /** Called when the user submits without changing any field (use existing creds as-is) */
27
- onContinue?: (spaceId: string, environmentId: string, cmaToken: string, host: string) => void;
28
- onQuit: () => void;
29
- /**
30
- * Optional retry callback wired up when a background generation prefetch
31
- * failed mid-credentials-entry. The operator presses R to re-trigger.
32
- */
33
- onRetryPrefetch?: () => void;
34
- /**
35
- * Skip-credentials escape hatch. When pressed (via `s` keybind, gated
36
- * against text-entry mode), the wizard advances without validating
37
- * credentials and disables push downstream. See dsi-tui-skip-credentials
38
- * spec.
39
- */
40
- onSkip?: () => void;
41
- };
42
- export declare function CredentialsStep({ summary, error: externalError, initialSpaceId, initialEnvironmentId, initialCmaToken, initialHost, validating, backgroundValidating, generatePrefetchStatus, generatePrefetchError, onConfirm, onValuesChange, onContinue, onQuit, onRetryPrefetch, onSkip, }: CredentialsStepProps): React.ReactElement;
43
- export {};
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- type GateStepProps = {
3
- successMessage: string;
4
- summary?: string;
5
- context?: string;
6
- continueLabel?: string;
7
- skipLabel?: string;
8
- onContinue: () => void;
9
- onSkip?: () => void;
10
- onQuit: () => void;
11
- showSkip?: boolean;
12
- intent?: 'success' | 'error';
13
- };
14
- export declare function GateStep({ successMessage, summary, context, continueLabel, skipLabel, onContinue, onSkip, onQuit, showSkip, intent, }: GateStepProps): React.ReactElement;
15
- export {};
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- type PathValidationStepProps = {
3
- projectPath: string;
4
- onConfirm: (projectPath: string) => void;
5
- onSkipComponents: () => void;
6
- onChangePath: () => void;
7
- onQuit: () => void;
8
- };
9
- export declare function PathValidationStep({ projectPath, onConfirm, onSkipComponents, onChangePath, onQuit, }: PathValidationStepProps): React.ReactElement;
10
- export {};
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { PreviewValidationError } from '../../../apply/api-client.js';
3
- type PreviewValidationErrorStepProps = {
4
- errors: PreviewValidationError[];
5
- missingNames: string[];
6
- onEdit: () => void;
7
- onSkip: () => void;
8
- onQuit: () => void;
9
- };
10
- export declare function PreviewValidationErrorStep({ errors, missingNames, onEdit, onSkip, onQuit, }: PreviewValidationErrorStepProps): React.ReactElement;
11
- export {};
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- type Progress = {
3
- done: number;
4
- total: number;
5
- };
6
- type RunningStepProps = {
7
- stepNumber: number;
8
- totalSteps: number;
9
- title: string;
10
- description: string;
11
- detail?: string;
12
- detailComplete?: boolean;
13
- /** Progress for the detail row (displays as progress bar + ratio). */
14
- detailProgress?: Progress;
15
- /** Optional second progress line (own spinner) — e.g. composition resolution
16
- * running after the file scan on the extracting screen. */
17
- secondaryDetail?: string;
18
- secondaryComplete?: boolean;
19
- /** Progress for the secondary detail row (displays as progress bar + ratio). */
20
- secondaryProgress?: Progress;
21
- /** Optional third progress line for another concurrent stage. */
22
- tertiaryDetail?: string;
23
- tertiaryComplete?: boolean;
24
- /** Optional fourth progress line for another concurrent stage. */
25
- quaternaryDetail?: string;
26
- quaternaryComplete?: boolean;
27
- /** Optional fifth progress line for another concurrent stage. */
28
- quinaryDetail?: string;
29
- quinaryComplete?: boolean;
30
- };
31
- export declare function RunningStep({ stepNumber, totalSteps, title, description, detail, detailComplete, detailProgress, secondaryDetail, secondaryComplete, secondaryProgress, tertiaryDetail, tertiaryComplete, quaternaryDetail, quaternaryComplete, quinaryDetail, quinaryComplete, }: RunningStepProps): React.ReactElement;
32
- export {};
@@ -1,48 +0,0 @@
1
- import React from 'react';
2
- export type ScopeComponent = {
3
- name: string;
4
- componentId: string;
5
- aiDecision?: 'accepted' | 'rejected' | 'failed' | null;
6
- aiReason?: string | null;
7
- needsReview?: boolean;
8
- slots?: Array<{
9
- name: string;
10
- allowedComponents: string[];
11
- }>;
12
- };
13
- export type ScopeGateStepProps = {
14
- components: ScopeComponent[];
15
- onConfirm: (decisions: {
16
- accepted: string[];
17
- rejected: string[];
18
- }) => void;
19
- onQuit: () => void;
20
- aiFilterStatus?: 'idle' | 'running' | 'complete' | 'cancelled' | 'failed';
21
- aiFilterProgress?: {
22
- done: number;
23
- total: number;
24
- } | null;
25
- aiFilterError?: string | null;
26
- onCancelAutoFilter?: () => void;
27
- };
28
- export declare function ScopeGateStep(props: ScopeGateStepProps): React.ReactElement;
29
- export declare function sideColumnLabelStyle(input: {
30
- isCycle: boolean;
31
- isSelected: boolean;
32
- focused: boolean;
33
- }): {
34
- nameColor: string | undefined;
35
- nameBold: boolean;
36
- nameInverse: boolean;
37
- nameUnderline: boolean;
38
- suffixColor: string | undefined;
39
- suffixDim: boolean;
40
- suffixInverse: boolean;
41
- suffixUnderline: boolean;
42
- };
43
- export declare function computeColumnWindow(total: number, cursor: number, visibleCount: number): {
44
- start: number;
45
- end: number;
46
- above: number;
47
- below: number;
48
- };
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- type TokenInputStepProps = {
3
- onConfirm: (rawTokensPath: string) => void;
4
- onSkip: () => void;
5
- onQuit: () => void;
6
- };
7
- export declare function TokenInputStep({ onConfirm, onSkip, onQuit }: TokenInputStepProps): React.ReactElement;
8
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- type WelcomeStepProps = {
3
- onContinue: (projectPath: string) => void;
4
- onQuit: () => void;
5
- };
6
- export declare function WelcomeStep({ onContinue, onQuit }: WelcomeStepProps): React.ReactElement;
7
- export {};
@@ -1,48 +0,0 @@
1
- import { ApiError, type PreviewValidationError } from '../../apply/api-client.js';
2
- import { patchReviewStateWithValidationErrors, rejectComponentsByName } from '../../analyze/select/command.js';
3
- export type Preview422Outcome = {
4
- kind: 'validation-error';
5
- errors: PreviewValidationError[];
6
- missingNames: string[];
7
- } | {
8
- kind: 'unparseable';
9
- message: string;
10
- } | {
11
- kind: 'not-422';
12
- };
13
- /**
14
- * Decide what to do with an `ApiError` raised by `previewImport()`.
15
- * Returns `not-422` if the caller should fall through to its other branches
16
- * (404 / 401 / 403 / generic), `unparseable` if the body cannot be parsed
17
- * into structured component-level errors (caller should route to the generic
18
- * error step), or `validation-error` with the patched-state side effects
19
- * already applied.
20
- *
21
- * Pure decision logic + a single delegated side effect to
22
- * `patchReviewStateWithValidationErrors`. Extracted from `WizardApp.runPreview`
23
- * so the routing is unit-testable without driving the full TUI.
24
- */
25
- export declare function handlePreview422(err: ApiError, extractSessionId: string | null, patchFn?: typeof patchReviewStateWithValidationErrors): Promise<Preview422Outcome>;
26
- /**
27
- * The WizardState patch the wizard should spread into any update that
28
- * transitions OUT of the preview-validation-error step (e.g. into
29
- * preview-gate after a successful retry). Without this, the validation-error
30
- * arrays linger in state and any future code path that reads them sees stale
31
- * data from a prior failed attempt.
32
- */
33
- export declare function clearedValidationErrorState(): {
34
- previewValidationErrors: PreviewValidationError[];
35
- previewValidationMissingNames: string[];
36
- };
37
- /**
38
- * Run the "skip and retry" side effect: dedup the offending component
39
- * names from a list of errors and call `rejectComponentsByName`. Returns
40
- * the deduped names so the caller can log them or include them in test
41
- * assertions. No-op when sessionId is null or errors are empty.
42
- *
43
- * The DB update inside `rejectComponentsByName` is what makes the next
44
- * preview see a CDF document with the offenders excluded — see SP-3 retro
45
- * Bug 1: writing to the JSON state file alone is not enough because
46
- * `loadCDFComponents` reads from the pipeline DB.
47
- */
48
- export declare function applySkipValidationErrors(sessionId: string | null, errors: PreviewValidationError[], rejectFn?: typeof rejectComponentsByName): Promise<string[]>;
@@ -1,21 +0,0 @@
1
- /**
2
- * Pure parser for the generate-step stderr stream.
3
- *
4
- * Two line shapes can carry progress info:
5
- *
6
- * 1. `progress=generate:<done>/<total>:<name>` — emitted at terminal completion
7
- * of each component in `runAllComponents`. `done` is the count of completed
8
- * components and is monotonically non-decreasing.
9
- * 2. `[<index+1>/<total>] <name>` — legacy line emitted at the START of each
10
- * component (and again on retry). With concurrency > 1, the index reflects
11
- * the worker's starting position, not completions, so it MUST NOT drive
12
- * `done` — only `current` (the name shown to the user).
13
- *
14
- * Given a chunk and the previous state, returns the updated state.
15
- */
16
- export type GenerateProgressState = {
17
- done: number;
18
- total: number;
19
- current: string;
20
- } | null;
21
- export declare function parseGenerateStderrChunk(chunk: string, prev: GenerateProgressState): GenerateProgressState;