@contentful/experience-design-system-cli 2.38.1-dev-build-6d903339.0 → 2.38.1-dev-build-962dbe22.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 (272) hide show
  1. package/dist/app.d.ts +2 -1
  2. package/dist/app.js +5778 -3809
  3. package/dist/index.js +13842 -12466
  4. package/dist/package.json +1 -1
  5. package/dist/src/commands/import-options.d.ts +0 -2
  6. package/dist/src/tui/debug-prune.d.ts +12 -0
  7. package/dist/src/tui/debug-store.d.ts +18 -1
  8. package/dist/src/tui/help/file-locations.d.ts +23 -0
  9. package/dist/src/tui/home/home.theme.d.ts +0 -8
  10. package/dist/src/tui/import/shared/gate-step/gate-step.d.ts +3 -1
  11. package/dist/src/tui/import/shared/index.d.ts +1 -0
  12. package/dist/src/tui/import/shared/overview-box/overview-box.d.ts +10 -0
  13. package/dist/src/tui/import/shared/running-step/logic.d.ts +0 -1
  14. package/dist/src/tui/import/shared/running-step/running-step.d.ts +3 -4
  15. package/dist/src/tui/import/steps/00-preflight/controls.d.ts +17 -0
  16. package/dist/src/tui/import/steps/00-preflight/logic.d.ts +45 -0
  17. package/dist/src/tui/import/steps/00-preflight/screen.d.ts +8 -0
  18. package/dist/src/tui/import/steps/01-welcome/controls.d.ts +4 -1
  19. package/dist/src/tui/import/steps/02-token-input/controls.d.ts +3 -0
  20. package/dist/src/tui/import/steps/03-path-validation/helpers/scan-files.d.ts +1 -9
  21. package/dist/src/tui/import/steps/03-path-validation/logic.d.ts +7 -5
  22. package/dist/src/tui/import/steps/03-path-validation/screen.d.ts +3 -1
  23. package/dist/src/tui/import/steps/04-credentials/logic.d.ts +6 -9
  24. package/dist/src/tui/import/steps/04-credentials/screen.d.ts +3 -1
  25. package/dist/src/tui/import/steps/06-extraction/logic.d.ts +1 -16
  26. package/dist/src/tui/import/steps/06-extraction/run-tokens-only.d.ts +31 -0
  27. package/dist/src/tui/import/steps/06-extraction/screen.d.ts +1 -3
  28. package/dist/src/tui/import/steps/06-extraction/types.d.ts +4 -5
  29. package/dist/src/tui/import/steps/06-extraction/use-tokens-only.d.ts +12 -0
  30. package/dist/src/tui/import/steps/07-scope-gate/cache-check.d.ts +0 -7
  31. package/dist/src/tui/import/steps/07-scope-gate/columns.d.ts +0 -2
  32. package/dist/src/tui/import/steps/07-scope-gate/graph/fuzzy-search.d.ts +0 -2
  33. package/dist/src/tui/import/steps/07-scope-gate/graph/lineage.d.ts +0 -22
  34. package/dist/src/tui/import/steps/07-scope-gate/sidebar/ai-flag.d.ts +0 -1
  35. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/GroupedSidebar.d.ts +1 -33
  36. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/windowed-panel.d.ts +4 -0
  37. package/dist/src/tui/import/steps/07-scope-gate/sidebar/lineage-layout.d.ts +0 -36
  38. package/dist/src/tui/import/steps/07-scope-gate/sidebar/step-filters.d.ts +4 -0
  39. package/dist/src/tui/import/steps/07-scope-gate/use-scope-gate.d.ts +1 -0
  40. package/dist/src/tui/import/steps/08-generation/logic.d.ts +0 -4
  41. package/dist/src/tui/import/steps/08-generation/run.d.ts +0 -10
  42. package/dist/src/tui/import/steps/08-generation/screen.d.ts +1 -3
  43. package/dist/src/tui/import/steps/09-review/components/FieldEditor.d.ts +1 -18
  44. package/dist/src/tui/import/steps/09-review/components/ReviewDialogs.d.ts +0 -14
  45. package/dist/src/tui/import/steps/09-review/components/TokenReviewPanel.d.ts +0 -6
  46. package/dist/src/tui/import/steps/09-review/generate-review-step.d.ts +1 -22
  47. package/dist/src/tui/import/steps/09-review/helpers/cycle-panel-scroll.d.ts +0 -4
  48. package/dist/src/tui/import/steps/09-review/run-live-preview.d.ts +0 -3
  49. package/dist/src/tui/import/steps/09-review/use-finalize-preview.d.ts +1 -11
  50. package/dist/src/tui/import/steps/10-flow/flow/build-flow-start.d.ts +1 -0
  51. package/dist/src/tui/import/steps/10-flow/flow/controller.d.ts +14 -8
  52. package/dist/src/tui/import/steps/10-flow/flow/preview.d.ts +3 -15
  53. package/dist/src/tui/import/steps/10-flow/flow/push.d.ts +2 -0
  54. package/dist/src/tui/import/steps/10-flow/flow/save.d.ts +1 -10
  55. package/dist/src/tui/import/steps/10-flow/flow/screen.d.ts +0 -4
  56. package/dist/src/tui/import/steps/10-flow/flow/use-flow.d.ts +4 -1
  57. package/dist/src/tui/import/steps/10-flow/screens/DoneStep.d.ts +6 -1
  58. package/dist/src/tui/import/steps/10-flow/screens/PushingStep.d.ts +3 -3
  59. package/dist/src/tui/import/steps/10-flow/screens/WizardPreviewStep.d.ts +1 -9
  60. package/dist/src/tui/import/steps/10-flow/support/path-utils.d.ts +0 -5
  61. package/dist/src/tui/import/steps/10-flow/support/preview-diff.d.ts +2 -5
  62. package/dist/src/tui/import/steps/10-flow/support/produced.d.ts +15 -0
  63. package/dist/src/tui/import/steps/index.d.ts +1 -1
  64. package/dist/src/tui/import/steps/preview-validation-error/logic.d.ts +0 -3
  65. package/dist/src/tui/settings/{contentful-configuration/ContentfulConfigScreen.d.ts → configuration/ConfigurationScreen.d.ts} +1 -0
  66. package/dist/src/tui/settings/configuration/agents/AgentDetail.d.ts +15 -0
  67. package/dist/src/tui/settings/configuration/agents/AgentStatusBadge.d.ts +10 -0
  68. package/dist/src/tui/settings/configuration/agents/AgentsScreen.d.ts +11 -0
  69. package/dist/src/tui/settings/configuration/agents/agent-debug.d.ts +25 -0
  70. package/dist/src/tui/settings/configuration/agents/agent-status.d.ts +63 -0
  71. package/dist/src/tui/settings/configuration/agents/agent-store.d.ts +21 -0
  72. package/dist/src/tui/settings/configuration/agents/apply-binary-overrides.d.ts +13 -0
  73. package/dist/src/tui/settings/configuration/project/ProjectScreen.d.ts +5 -0
  74. package/dist/src/tui/settings/{contentful-configuration/config-store.d.ts → configuration/project/project-store.d.ts} +1 -0
  75. package/dist/src/tui/settings/debug-mode/debug-mode-store.d.ts +7 -1
  76. package/dist/src/tui/settings/debug-mode/screen.d.ts +4 -0
  77. package/dist/src/tui/settings/shared/debug-trail.d.ts +35 -0
  78. package/dist/src/tui/shared/components/ClearableTextInput.d.ts +6 -0
  79. package/dist/src/tui/shared/components/ControlHints.d.ts +9 -0
  80. package/dist/src/tui/shared/components/FieldForm.d.ts +71 -0
  81. package/dist/src/tui/shared/components/StepHeader.d.ts +26 -0
  82. package/dist/src/tui/theme.d.ts +21 -0
  83. package/package.json +3 -3
  84. package/dist/src/commands/forwarded.d.ts +0 -2
  85. package/dist/src/legacy/forwarded-import-args.d.ts +0 -1
  86. package/dist/src/legacy/legacy-cli-path.d.ts +0 -1
  87. package/dist/src/legacy/run-legacy.d.ts +0 -1
  88. package/dist/src/tui/control-hints.d.ts +0 -7
  89. package/dist/src/tui/import/steps/04-credentials/controls.d.ts +0 -21
  90. package/dist/src/tui/import/steps/05-token-reuse/logic.d.ts +0 -21
  91. package/dist/src/tui/import/steps/05-token-reuse/screen.d.ts +0 -10
  92. package/dist/src/tui/import/steps/07-scope-gate/sidebar/components/LegendEntry.d.ts +0 -2
  93. package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +0 -8
  94. package/dist/src/tui/import/steps/09-review/theme.d.ts +0 -9
  95. package/dist/src/tui/import/steps/10-flow/components/StepHeader.d.ts +0 -8
  96. package/dist/src/tui/import/steps/10-flow/theme.d.ts +0 -13
  97. package/dist/src/tui/upgrade/PageContainer.d.ts +0 -4
  98. package/legacy/bin/cli.js +0 -58
  99. package/legacy/dist/package.json +0 -76
  100. package/legacy/dist/src/analytics/apply.d.ts +0 -6
  101. package/legacy/dist/src/analytics/client.d.ts +0 -8
  102. package/legacy/dist/src/analytics/constants.d.ts +0 -4
  103. package/legacy/dist/src/analytics/exit.d.ts +0 -4
  104. package/legacy/dist/src/analytics/index.d.ts +0 -6
  105. package/legacy/dist/src/analytics/normalize.d.ts +0 -3
  106. package/legacy/dist/src/analytics/os.d.ts +0 -2
  107. package/legacy/dist/src/analytics/session.d.ts +0 -3
  108. package/legacy/dist/src/analytics/tracker.d.ts +0 -16
  109. package/legacy/dist/src/analytics/types.d.ts +0 -28
  110. package/legacy/dist/src/analyze/composite-closure.d.ts +0 -26
  111. package/legacy/dist/src/analyze/composition/apply-mapping.d.ts +0 -22
  112. package/legacy/dist/src/analyze/composition/candidate-files.d.ts +0 -34
  113. package/legacy/dist/src/analyze/composition/composition-cache-key.d.ts +0 -18
  114. package/legacy/dist/src/analyze/composition/interchange-schema.d.ts +0 -17
  115. package/legacy/dist/src/analyze/composition/manifest-doc-evidence.d.ts +0 -49
  116. package/legacy/dist/src/analyze/composition/merge-edges.d.ts +0 -19
  117. package/legacy/dist/src/analyze/composition/parse-map-edges.d.ts +0 -16
  118. package/legacy/dist/src/analyze/composition/prompt-loader.d.ts +0 -3
  119. package/legacy/dist/src/analyze/composition/resolve-mapping-cli.d.ts +0 -10
  120. package/legacy/dist/src/analyze/composition/resolve-mapping.d.ts +0 -59
  121. package/legacy/dist/src/analyze/cycle-detection.d.ts +0 -27
  122. package/legacy/dist/src/analyze/extract-command.d.ts +0 -7
  123. package/legacy/dist/src/analyze/fuzzy-search.d.ts +0 -3
  124. package/legacy/dist/src/analyze/issue-inheritance.d.ts +0 -8
  125. package/legacy/dist/src/analyze/lineage.d.ts +0 -29
  126. package/legacy/dist/src/analyze/search-neighborhood.d.ts +0 -3
  127. package/legacy/dist/src/analyze/select/command.d.ts +0 -27
  128. package/legacy/dist/src/analyze/select/parser.d.ts +0 -6
  129. package/legacy/dist/src/analyze/select/persistence.d.ts +0 -22
  130. package/legacy/dist/src/analyze/select/preview-annotations.d.ts +0 -26
  131. package/legacy/dist/src/analyze/select/tui/LegacySelectApp.d.ts +0 -8
  132. package/legacy/dist/src/analyze/select/tui/components/ComponentDetail.d.ts +0 -19
  133. package/legacy/dist/src/analyze/select/tui/components/ComponentRationalePanel.d.ts +0 -10
  134. package/legacy/dist/src/analyze/select/tui/components/FieldEditor.d.ts +0 -67
  135. package/legacy/dist/src/analyze/select/tui/components/FinalizeDialog.d.ts +0 -22
  136. package/legacy/dist/src/analyze/select/tui/components/GotoBanner.d.ts +0 -31
  137. package/legacy/dist/src/analyze/select/tui/components/GroupedSidebar.d.ts +0 -94
  138. package/legacy/dist/src/analyze/select/tui/components/HelpOverlay.d.ts +0 -21
  139. package/legacy/dist/src/analyze/select/tui/components/HighlightedLine.d.ts +0 -9
  140. package/legacy/dist/src/analyze/select/tui/components/JsonEditor.d.ts +0 -10
  141. package/legacy/dist/src/analyze/select/tui/components/JsonPanel.d.ts +0 -11
  142. package/legacy/dist/src/analyze/select/tui/components/PreviewSummaryBar.d.ts +0 -8
  143. package/legacy/dist/src/analyze/select/tui/components/QuitDialog.d.ts +0 -8
  144. package/legacy/dist/src/analyze/select/tui/components/RationaleLine.d.ts +0 -21
  145. package/legacy/dist/src/analyze/select/tui/components/RationalePanel.d.ts +0 -15
  146. package/legacy/dist/src/analyze/select/tui/components/ScrollablePanel.d.ts +0 -14
  147. package/legacy/dist/src/analyze/select/tui/components/Sidebar.d.ts +0 -29
  148. package/legacy/dist/src/analyze/select/tui/components/SourcePanel.d.ts +0 -11
  149. package/legacy/dist/src/analyze/select/tui/components/StatusBar.d.ts +0 -11
  150. package/legacy/dist/src/analyze/select/tui/components/TokenReviewPanel.d.ts +0 -30
  151. package/legacy/dist/src/analyze/select/tui/components/TopBar.d.ts +0 -10
  152. package/legacy/dist/src/analyze/select/tui/components/removed-components-text.d.ts +0 -7
  153. package/legacy/dist/src/analyze/select/tui/components/wrap-text.d.ts +0 -1
  154. package/legacy/dist/src/analyze/select/tui/hooks/list-scroll-input.d.ts +0 -13
  155. package/legacy/dist/src/analyze/select/tui/hooks/scroll-offset.d.ts +0 -30
  156. package/legacy/dist/src/analyze/select/tui/hooks/useImmediateInput.d.ts +0 -19
  157. package/legacy/dist/src/analyze/select/tui/hooks/useKeymap.d.ts +0 -24
  158. package/legacy/dist/src/analyze/select/tui/hooks/useSession.d.ts +0 -19
  159. package/legacy/dist/src/analyze/select/tui/hooks/useUndo.d.ts +0 -8
  160. package/legacy/dist/src/analyze/select/tui/theme.d.ts +0 -18
  161. package/legacy/dist/src/analyze/select/types.d.ts +0 -54
  162. package/legacy/dist/src/analyze/selection-cascade.d.ts +0 -3
  163. package/legacy/dist/src/analyze/slot-graph.d.ts +0 -11
  164. package/legacy/dist/src/apply/api-client.d.ts +0 -64
  165. package/legacy/dist/src/apply/command.d.ts +0 -43
  166. package/legacy/dist/src/apply/preview-utils.d.ts +0 -12
  167. package/legacy/dist/src/apply/tokens.d.ts +0 -1
  168. package/legacy/dist/src/apply/tui/ServerApplyView.d.ts +0 -34
  169. package/legacy/dist/src/apply/tui/ServerPreviewView.d.ts +0 -9
  170. package/legacy/dist/src/credentials-store.d.ts +0 -18
  171. package/legacy/dist/src/doctor/checks.d.ts +0 -5
  172. package/legacy/dist/src/doctor/command.d.ts +0 -2
  173. package/legacy/dist/src/doctor/report.d.ts +0 -7
  174. package/legacy/dist/src/generate/command.d.ts +0 -2
  175. package/legacy/dist/src/generate/tui/GenerateView.d.ts +0 -12
  176. package/legacy/dist/src/helpers/build-contentful-management-client.d.ts +0 -7
  177. package/legacy/dist/src/helpers/fetch-and-persist-existing-contentful-entities.d.ts +0 -29
  178. package/legacy/dist/src/helpers/fetch-existing-contentful-entities.d.ts +0 -11
  179. package/legacy/dist/src/helpers/find-nearly-matching-component.d.ts +0 -7
  180. package/legacy/dist/src/helpers/read-existing-contentful-entities-from-session.d.ts +0 -7
  181. package/legacy/dist/src/helpers/summarize-existing-contentful-entities.d.ts +0 -50
  182. package/legacy/dist/src/host-utils.d.ts +0 -3
  183. package/legacy/dist/src/index.d.ts +0 -1
  184. package/legacy/dist/src/index.js +0 -25001
  185. package/legacy/dist/src/lib/agent-definitions.d.ts +0 -14
  186. package/legacy/dist/src/lib/agent-model-options.d.ts +0 -15
  187. package/legacy/dist/src/lib/agent-output.d.ts +0 -5
  188. package/legacy/dist/src/lib/cli-errors.d.ts +0 -2
  189. package/legacy/dist/src/lib/cli-path.d.ts +0 -4
  190. package/legacy/dist/src/lib/command-options.d.ts +0 -3
  191. package/legacy/dist/src/lib/component-patch.d.ts +0 -12
  192. package/legacy/dist/src/lib/contentful-urls.d.ts +0 -15
  193. package/legacy/dist/src/lib/debug-logger.d.ts +0 -39
  194. package/legacy/dist/src/lib/debug-preamble.d.ts +0 -7
  195. package/legacy/dist/src/lib/error-parser.d.ts +0 -40
  196. package/legacy/dist/src/lib/path-exists.d.ts +0 -1
  197. package/legacy/dist/src/lib/prompt-overrides.d.ts +0 -38
  198. package/legacy/dist/src/lib/terminal-capabilities.d.ts +0 -29
  199. package/legacy/dist/src/lib/user-agent.d.ts +0 -7
  200. package/legacy/dist/src/map-tokens/apply.d.ts +0 -12
  201. package/legacy/dist/src/map-tokens/command.d.ts +0 -2
  202. package/legacy/dist/src/map-tokens/resolve-defaults.d.ts +0 -32
  203. package/legacy/dist/src/map-tokens/tui/MapTokensView.d.ts +0 -13
  204. package/legacy/dist/src/output/format.d.ts +0 -23
  205. package/legacy/dist/src/print/command.d.ts +0 -11
  206. package/legacy/dist/src/print/validate/tui/ValidateView.d.ts +0 -15
  207. package/legacy/dist/src/print/validate/validators/cdf-validator.d.ts +0 -2
  208. package/legacy/dist/src/print/validate/validators/dtcg-validator.d.ts +0 -2
  209. package/legacy/dist/src/print/validate/validators/format-errors.d.ts +0 -12
  210. package/legacy/dist/src/print/validate/validators/read-json-file.d.ts +0 -10
  211. package/legacy/dist/src/program.d.ts +0 -25
  212. package/legacy/dist/src/runs/fingerprint.d.ts +0 -36
  213. package/legacy/dist/src/runs/save-path-resolver.d.ts +0 -11
  214. package/legacy/dist/src/runs/store.d.ts +0 -65
  215. package/legacy/dist/src/session/cache-keys.d.ts +0 -22
  216. package/legacy/dist/src/session/core/cdf/cdf-mappers.d.ts +0 -3
  217. package/legacy/dist/src/session/core/components/derive-component-id.d.ts +0 -1
  218. package/legacy/dist/src/session/core/components/hash-component-shape.d.ts +0 -5
  219. package/legacy/dist/src/session/core/shared/index-rows-by-key.d.ts +0 -1
  220. package/legacy/dist/src/session/core/tokens/build-dtcg-groups.d.ts +0 -12
  221. package/legacy/dist/src/session/core/tokens/build-dtcg-tokens.d.ts +0 -3
  222. package/legacy/dist/src/session/core/tokens/hash-token-content.d.ts +0 -1
  223. package/legacy/dist/src/session/db.d.ts +0 -200
  224. package/legacy/dist/src/session/migration.d.ts +0 -2
  225. package/legacy/dist/src/session/repositories/sessions/read.d.ts +0 -11
  226. package/legacy/dist/src/session/repositories/sessions/write.d.ts +0 -3
  227. package/legacy/dist/src/session/repositories/shared/with-transaction.d.ts +0 -2
  228. package/legacy/dist/src/session/repositories/steps/read.d.ts +0 -2
  229. package/legacy/dist/src/session/repositories/steps/write.d.ts +0 -5
  230. package/legacy/dist/src/session/repositories/tokens/read.d.ts +0 -15
  231. package/legacy/dist/src/session/repositories/tokens/write.d.ts +0 -16
  232. package/legacy/dist/src/session/resolve-session-id.d.ts +0 -1
  233. package/legacy/dist/src/session/services/session-resolver.d.ts +0 -9
  234. package/legacy/dist/src/session/services/tokens/apply-tool-calls.d.ts +0 -8
  235. package/legacy/dist/src/session/services/tokens/replace-raw-prop-token-paths.d.ts +0 -3
  236. package/legacy/dist/src/session/services/tokens/replace-raw-token-name-paths.d.ts +0 -3
  237. package/legacy/dist/src/session/services/tokens/store-dtcg-tokens.d.ts +0 -3
  238. package/legacy/dist/src/session/session-id.d.ts +0 -1
  239. package/legacy/dist/src/session/source-excerpt.d.ts +0 -26
  240. package/legacy/dist/src/setup/SetupScreen.d.ts +0 -28
  241. package/legacy/dist/src/setup/SetupStepper.d.ts +0 -7
  242. package/legacy/dist/src/setup/command.d.ts +0 -3
  243. package/legacy/dist/src/setup/lib/checks.d.ts +0 -57
  244. package/legacy/dist/src/setup/lib/shell.d.ts +0 -12
  245. package/legacy/dist/src/setup/steps/CodingAgentScreen.d.ts +0 -20
  246. package/legacy/dist/src/setup/steps/ContentfulCredentialsScreen.d.ts +0 -11
  247. package/legacy/dist/src/setup/steps/StepLayout.d.ts +0 -20
  248. package/legacy/dist/src/setup/steps/preferences/AnalyticsScreen.d.ts +0 -5
  249. package/legacy/dist/src/setup/steps/preferences/BooleanInput.d.ts +0 -21
  250. package/legacy/dist/src/setup/steps/preferences/ColorPreferenceScreen.d.ts +0 -5
  251. package/legacy/dist/src/setup/steps/preferences/CustomPromptScreen.d.ts +0 -14
  252. package/legacy/dist/src/setup/steps/preferences/DebugLogsScreen.d.ts +0 -5
  253. package/legacy/dist/src/setup/steps/preferences/PreferencesMenu.d.ts +0 -26
  254. package/legacy/dist/src/setup/steps/prerequisites/PrerequisitesScreen.d.ts +0 -16
  255. package/legacy/dist/src/setup/steps/prerequisites/build.d.ts +0 -2
  256. package/legacy/dist/src/setup/steps/prerequisites/deps.d.ts +0 -33
  257. package/legacy/dist/src/setup/steps/prerequisites/index.d.ts +0 -4
  258. package/legacy/dist/src/setup/steps/prerequisites/node.d.ts +0 -2
  259. package/legacy/dist/src/setup/steps/prerequisites/pnpm.d.ts +0 -2
  260. package/legacy/dist/src/tui/CommandCompletionView.d.ts +0 -13
  261. package/legacy/dist/src/tui/render-with-goodbye.d.ts +0 -7
  262. package/legacy/dist/src/tui/use-terminal-size.d.ts +0 -6
  263. package/legacy/dist/src/tui/windowed-panel.d.ts +0 -37
  264. package/legacy/dist/src/types.d.ts +0 -2
  265. package/legacy/package.json +0 -85
  266. package/legacy/prompts/composition-edges.md +0 -11
  267. package/legacy/skills/generate-components.md +0 -612
  268. package/legacy/skills/generate-tokens.md +0 -194
  269. package/legacy/skills/map-tokens.md +0 -102
  270. package/legacy/skills/select-components.md +0 -235
  271. /package/dist/src/tui/{upgrade → home}/version.d.ts +0 -0
  272. /package/dist/src/tui/settings/{utils → shared}/v1-store.d.ts +0 -0
@@ -1,22 +1,18 @@
1
1
  import type { GenerationProgress } from './types.js';
2
2
  export declare function initialProgress(): GenerationProgress;
3
- /** Token mapping runs only when there is something to map and tokens to map it from. */
4
3
  export declare function shouldRunMapTokens(counts: {
5
4
  mappablePropCount: number;
6
5
  rawTokenCount: number;
7
6
  }): boolean;
8
- /** "5 components accepted." or, with some left out, "5 components accepted, 2 excluded due to validation errors." */
9
7
  export declare function formatAcceptanceSummary(counts: {
10
8
  accepted: number;
11
9
  autoRejected: number;
12
10
  }): string;
13
- /** The screen's description: what was accepted, what is happening to it, and whether the tokens are used. */
14
11
  export declare function describeGeneration(input: {
15
12
  acceptedCount: number;
16
13
  agent: string;
17
14
  hasTokens: boolean;
18
15
  }): string;
19
- /** The rows the generating screen shows for this progress. */
20
16
  export declare function progressRows(progress: GenerationProgress, agent: string): Array<{
21
17
  text: string;
22
18
  complete: boolean;
@@ -9,14 +9,4 @@ export interface GenerationDeps {
9
9
  runMapTokens: typeof runMapTokens;
10
10
  prepareMapTokens: typeof prepareMapTokens;
11
11
  }
12
- /**
13
- * The whole stage, in the order the wizard ran it:
14
- * 1. Wait for the cache check that ran while the scope gate was open, then save the decisions. Both write to the
15
- * pipeline database and the cache has to be restored first. With nothing accepted the stage ends here.
16
- * 2. Generate the accepted components in-process. The orchestrator handles per-component cache lookup, so the names
17
- * from the cache check are forwarded as `precomputedCachedNames` to skip a redundant lookup.
18
- * 3. Map tokens onto the generated session. Skipped when there is nothing to map.
19
- * A failed token mapping after a successful generation is an error to show. It neither retries nor throws away what was
20
- * generated.
21
- */
22
12
  export declare function runGeneration(input: GenerationInput, onProgress: (progress: GenerationProgress) => void, deps?: GenerationDeps): Promise<GenerationResult>;
@@ -5,8 +5,6 @@ interface GenerationScreenProps {
5
5
  agent: string;
6
6
  acceptedCount: number;
7
7
  hasTokens: boolean;
8
- stepNumber: number;
9
- totalSteps: number;
10
8
  }
11
- export declare function GenerationScreen({ progress, agent, acceptedCount, hasTokens, stepNumber, totalSteps, }: GenerationScreenProps): React.ReactElement;
9
+ export declare function GenerationScreen({ progress, agent, acceptedCount, hasTokens, }: GenerationScreenProps): React.ReactElement;
12
10
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { findSlotCycles, type ComponentSlotInfo } from '../../07-scope-gate/graph/cycle-detection.js';
2
+ import { type ComponentSlotInfo } from '../../07-scope-gate/graph/cycle-detection.js';
3
3
  type PropMetadata = {
4
4
  rationale?: string | null;
5
5
  sourceStartLine?: number | null;
@@ -46,22 +46,5 @@ export type FieldEditorProps = {
46
46
  header?: React.ReactNode;
47
47
  headerHeight?: number;
48
48
  };
49
- export declare function simulateGraphWithCandidate(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
50
- name: string;
51
- allowedComponents: string[];
52
- }[], targetSlotName: string, candidate: string): ComponentSlotInfo[];
53
- export declare function introducesNewCycle(before: ReturnType<typeof findSlotCycles>, next: ReturnType<typeof findSlotCycles>): boolean;
54
- export declare function computeAllowedComponentCandidates(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
55
- name: string;
56
- allowedComponents: string[];
57
- }[], targetSlotName: string): string[];
58
- export declare function simulateGraphWithReplacement(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
59
- name: string;
60
- allowedComponents: string[];
61
- }[], targetSlotName: string, replaceIndex: number, candidate: string): ComponentSlotInfo[];
62
- export declare function computeAllowedComponentReplacementCandidates(projectSlotGraph: ComponentSlotInfo[], selfName: string, currentSlots: {
63
- name: string;
64
- allowedComponents: string[];
65
- }[], targetSlotName: string, replaceIndex: number): string[];
66
49
  export declare function FieldEditor({ value, width, height, fixedHeight, active, onChange, onSave, onDiscard, onExit, metadata, onTogglePropRationale, propRationaleKey, onToggleComponentRationale, componentRationaleKey, onToggleSourceExternal, onTextEntryActiveChange, projectSlotGraph, currentComponentName, onDirtyChange, discardTrigger, initialFocusTarget, showHiddenProps, showInlineRationales, header, headerHeight, }: FieldEditorProps): React.ReactElement;
67
50
  export {};
@@ -1,21 +1,7 @@
1
1
  import React from 'react';
2
- import type { ComponentTypeSummary } from '@contentful/experience-design-system-types';
3
2
  import type { UseFinalizePreviewReturn } from '../use-finalize-preview.js';
4
3
  import type { UseReviewSurfaceStateResult } from '../use-review-surface-state.js';
5
4
  import { type ReviewStatusEntry } from './ReviewStatus.js';
6
- export type ReviewFinalizeDialogsProps = {
7
- showFinalize: boolean;
8
- showQuit: boolean;
9
- components: ReadonlyArray<ReviewStatusEntry>;
10
- removed?: ComponentTypeSummary[];
11
- previewStatus?: 'idle' | 'running' | 'done' | 'error';
12
- removedScrollOffset?: number;
13
- onFinalizeConfirm: () => void;
14
- onFinalizeCancel: () => void;
15
- onQuitConfirm: () => void;
16
- onQuitCancel: () => void;
17
- };
18
- export declare function ReviewFinalizeDialogs({ showFinalize, showQuit, components, removed, previewStatus, removedScrollOffset, onFinalizeConfirm, onFinalizeCancel, onQuitConfirm, onQuitCancel, }: ReviewFinalizeDialogsProps): React.ReactElement;
19
5
  export declare function ReviewStepDialogs({ surfaceState, components, finalizePreview, onFinalize, onQuit, }: {
20
6
  surfaceState: UseReviewSurfaceStateResult;
21
7
  components: ReadonlyArray<ReviewStatusEntry>;
@@ -1,21 +1,15 @@
1
1
  import React from 'react';
2
- import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
3
2
  export type TokenPropSuggestion = {
4
3
  propName: string;
5
4
  paths: string[];
6
5
  suggested: string[];
7
6
  allowed: string[];
8
7
  };
9
- export type TokenReviewToken = {
10
- path: string;
11
- kind: string;
12
- };
13
8
  /**
14
9
  * Design-token props on `entry` with a declared token kind. `paths` is the
15
10
  * full compatible token universe when a token catalog is available; `allowed`
16
11
  * remains the current subset.
17
12
  */
18
- export declare function collectTokenSuggestions(entry: CDFComponentEntry, availableTokens?: TokenReviewToken[]): TokenPropSuggestion[];
19
13
  export type TokenReviewPanelProps = {
20
14
  componentName: string;
21
15
  suggestions: TokenPropSuggestion[];
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import type { BreakingChange, CDFComponentEntry, ComponentTypeSummary, DownstreamImpact, ServerPreviewResponse } from '@contentful/experience-design-system-types';
3
2
  type GenerateReviewStepProps = {
4
3
  extractSessionId: string | null;
5
4
  tokenSessionId?: string | null;
@@ -13,25 +12,5 @@ type GenerateReviewStepProps = {
13
12
  tokensPath?: string;
14
13
  initialFinalizeError?: string | null;
15
14
  };
16
- export declare function sortComponentsForSidebar<T extends {
17
- key: string;
18
- entry: CDFComponentEntry;
19
- }>(components: T[], cycleParticipants?: Set<string>): T[];
20
- export { computeCycleAutoRejectTargets } from './graph/cycle-auto-reject.js';
21
- export interface BreakingComponent {
22
- componentName: string;
23
- changes: BreakingChange[];
24
- impact?: DownstreamImpact;
25
- current?: ComponentTypeSummary;
26
- }
27
- export interface BreakingRow {
28
- label: string;
29
- componentName: string;
30
- focusTarget?: {
31
- kind: 'prop' | 'slot';
32
- name: string;
33
- };
34
- }
35
- export declare function buildBreakingRows(breakingChanges: BreakingComponent[]): BreakingRow[];
36
- export declare function deriveBreakingChanges(response: ServerPreviewResponse): BreakingComponent[];
37
15
  export declare function GenerateReviewStep(props: GenerateReviewStepProps): React.ReactElement;
16
+ export {};
@@ -1,8 +1,4 @@
1
- export declare const CYCLE_PANEL_PREAMBLE_LINES = 4;
2
1
  export interface CyclePanelLineCountable {
3
2
  suggestedBreak?: unknown;
4
3
  }
5
- export declare function cycleLineCount(cycle: CyclePanelLineCountable): number;
6
- export declare function cycleLineOffsets(cycles: readonly CyclePanelLineCountable[], preamble?: number): number[];
7
- export declare function totalCyclePanelLines(cycles: readonly CyclePanelLineCountable[], preamble?: number): number;
8
4
  export declare function followCycleScroll(currentScroll: number, cursorIdx: number, cycles: readonly CyclePanelLineCountable[], panelHeight: number, preamble?: number): number;
@@ -1,7 +1,4 @@
1
1
  import type { ServerPreviewResponse } from '@contentful/experience-design-system-types';
2
- export declare class TimeoutError extends Error {
3
- constructor(message?: string);
4
- }
5
2
  export type LivePreviewResult = {
6
3
  generation: number;
7
4
  response: ServerPreviewResponse | null;
@@ -1,6 +1,6 @@
1
1
  import type { ComponentTypeSummary } from '@contentful/experience-design-system-types';
2
2
  type FinalizePreviewStatus = 'idle' | 'running' | 'done' | 'error';
3
- export type UseFinalizePreviewOptions = {
3
+ type UseFinalizePreviewOptions = {
4
4
  /** True while the Finalize dialog is open. Toggling true (re)fires the preview. */
5
5
  open: boolean;
6
6
  extractSessionId: string | null;
@@ -26,14 +26,4 @@ export type UseReviewFinalizePreviewOptions = Omit<UseFinalizePreviewOptions, 'a
26
26
  }>;
27
27
  };
28
28
  export declare function useReviewFinalizePreview({ components, ...options }: UseReviewFinalizePreviewOptions): UseFinalizePreviewReturn;
29
- /**
30
- * Shared Finalize-dialog preview, used by both the composite and atomic
31
- * generate-review steps.
32
- *
33
- * When the dialog opens it fires a preview scoped to the ACCEPTED set (so the
34
- * result reflects exactly what the push does, independent of the session's
35
- * not-yet-reclassified generated rows), tracks loading/error, and owns the
36
- * scroll offset for the preview list.
37
- */
38
- export declare function useFinalizePreview(opts: UseFinalizePreviewOptions): UseFinalizePreviewReturn;
39
29
  export {};
@@ -17,5 +17,6 @@ export declare function buildFlowStart(input: {
17
17
  handoff: ImportHandoff;
18
18
  saved?: SavedCredentials;
19
19
  generatePromptPath?: string;
20
+ tokensOnly?: FlowStart['tokensOnly'];
20
21
  }): FlowStart;
21
22
  export {};
@@ -1,9 +1,8 @@
1
- import { type PreviewValidationError } from '@contentful/experience-design-system-backend-pipeline';
2
1
  import type { ImportHandoff } from '@contentful/experience-design-system-types/handoff';
3
2
  import { type PreviewDeps } from './preview.js';
4
3
  import { type PushDeps } from './push.js';
5
4
  import { type SaveDeps } from './save.js';
6
- import { type FlowPatch, type FlowState } from './types.js';
5
+ import { type FlowState } from './types.js';
7
6
  /** What the flow starts from: what the earlier stages produced, and the user's saved settings. */
8
7
  export interface FlowStart {
9
8
  handoff: ImportHandoff;
@@ -18,6 +17,13 @@ export interface FlowStart {
18
17
  cmaToken: string;
19
18
  host: string;
20
19
  };
20
+ /** Set when the import only generates tokens: there is no extraction or generation, so the flow starts at saving. */
21
+ tokensOnly?: {
22
+ tokensPath: string;
23
+ tokenSessionId: string | null;
24
+ tokenCount: number;
25
+ outDir: string;
26
+ };
21
27
  /** A custom prompt for `generate components`, shown as a warning above every step. */
22
28
  generatePromptPath?: string;
23
29
  }
@@ -38,15 +44,15 @@ export interface FlowDeps {
38
44
  /** Writes one line of the wizard's step log. */
39
45
  log: (entry: Record<string, unknown>) => void;
40
46
  stderr: (text: string) => void;
47
+ /**
48
+ * Called when the step is about to change, before anything is told about the new one. The host clears the terminal
49
+ * here so the next screen is drawn on a clean one. It has to be before: Ink paints as soon as it is told, and a clear
50
+ * after the paint wipes a static screen like the done step, which nothing draws again.
51
+ */
52
+ beforeStepChange?: () => void;
41
53
  }
42
54
  export declare function startWizardLog(): void;
43
55
  export declare function realFlowDeps(): FlowDeps;
44
- /** The state the flow begins in, from what the earlier stages handed over. */
45
- export declare function initialFlowState(start: FlowStart): FlowState;
46
- /** What the log gets: the state change without the token, the document, or the whole of a large server response. */
47
- export declare function sanitizeForLog(partial: FlowPatch): Record<string, unknown>;
48
- /** The names of the components the errors are about, once each. */
49
- export declare function namesToSkip(errors: readonly PreviewValidationError[]): string[];
50
56
  export interface FlowController {
51
57
  getState(): FlowState;
52
58
  subscribe(listener: () => void): () => void;
@@ -1,9 +1,11 @@
1
1
  import type { DatabaseSync } from 'node:sqlite';
2
- import { ApiError, patchReviewStateWithValidationErrors, type PreviewValidationError } from '@contentful/experience-design-system-backend-pipeline';
2
+ import { patchReviewStateWithValidationErrors } from '@contentful/experience-design-system-backend-pipeline';
3
3
  import { type CDFDocument, type DTCGTokenEntry, type ServerPreviewResponse } from '@contentful/experience-design-system-types';
4
4
  import type { FlowPatch, FlowState } from './types.js';
5
5
  type PreviewClient = {
6
6
  previewImport(cdf: CDFDocument): Promise<ServerPreviewResponse>;
7
+ /** Request id of the most recent response, used by `recordContentfulContext` for analytics correlation. */
8
+ getLastRequestId(): string | undefined;
7
9
  };
8
10
  /** The outside world `runPreview` talks to, so each branch can be tested without a database or a network. */
9
11
  export interface PreviewDeps {
@@ -30,20 +32,6 @@ export interface RunPreviewInput {
30
32
  /** Set when nothing was accepted, so the document is present but empty and the server shows what would be deleted. */
31
33
  deleteAll: boolean;
32
34
  }
33
- /** What to do with a 422 from the preview: show the components that failed, or fall through to the generic error. */
34
- type Preview422Outcome = {
35
- kind: 'validation-error';
36
- errors: PreviewValidationError[];
37
- missingNames: string[];
38
- } | {
39
- kind: 'unparseable';
40
- message: string;
41
- } | {
42
- kind: 'not-422';
43
- };
44
- export declare function handlePreview422(err: ApiError, extractSessionId: string | null, patchFn: PreviewDeps['patchReviewState']): Promise<Preview422Outcome>;
45
- /** The patch to spread into any update that leaves the validation error step, so stale errors do not linger. */
46
- export declare function clearedValidationErrorState(): Pick<FlowState, 'previewValidationErrors' | 'previewValidationMissingNames'>;
47
35
  /**
48
36
  * Loads what would be pushed and asks the server what that would change. Returns the patch the wizard applied: the
49
37
  * preview gate, a terminal "done" when nothing would change, the validation error step for a 422, or an error.
@@ -8,6 +8,8 @@ type PushClient = {
8
8
  pollOperation(operationId: string, options: {
9
9
  onProgress?: (operation: ApplyOperationResponse) => void;
10
10
  }): Promise<ApplyOperationResponse>;
11
+ /** Request id of the most recent response, used by `recordApplyOutcome` for analytics correlation. */
12
+ getLastRequestId(): string | undefined;
11
13
  };
12
14
  /** The outside world `runPush` talks to, so each branch can be tested without a network or a run history. */
13
15
  export interface PushDeps {
@@ -1,16 +1,7 @@
1
1
  import type { DatabaseSync } from 'node:sqlite';
2
2
  import { appendRun, buildSourceFingerprint } from '@contentful/experience-design-system-backend-pipeline';
3
- import { type CDFComponentEntry, type CDFDocument, type DTCGTokenEntry } from '@contentful/experience-design-system-types';
3
+ import { type DTCGTokenEntry } from '@contentful/experience-design-system-types';
4
4
  import type { FlowPatch, FlowState } from './types.js';
5
- /** How long the confirmation of a written file stays up before the flow moves on to the preview. */
6
- export declare const SAVE_CONFIRMATION_DELAY_MS = 1000;
7
- /** The document written to `components.json`: the components and tokens as one schema-valid CDF. */
8
- export declare function buildSavedCDF(components: Array<{
9
- key: string;
10
- entry: CDFComponentEntry;
11
- }>, tokens: DTCGTokenEntry[], opts?: {
12
- deleteAll?: boolean;
13
- }): CDFDocument;
14
5
  /** The outside world saving talks to, so each branch can be tested without a disk, a database or a clock. */
15
6
  export interface SaveDeps {
16
7
  openDb: () => DatabaseSync;
@@ -9,9 +9,5 @@ interface FlowScreenProps {
9
9
  /** Leaves the import with the exit code the wizard would have exited with. */
10
10
  onExit: (exitCode: number) => void;
11
11
  }
12
- /** How many steps the import has, as the wizard counted them. */
13
- export declare function totalStepsFor(state: Pick<FlowState, 'tokensPath' | 'rawTokensPath' | 'mapTokensEligible'>): number;
14
- /** Whether the preview gate offers "[e] Edit definitions": only when the document has components to edit. */
15
- export declare function canEditFromPreview(cdf: FlowState['cdf']): boolean;
16
12
  export declare function FlowScreen({ state, controller, livePreview, generatePromptPath, onExit, }: FlowScreenProps): React.ReactElement;
17
13
  export {};
@@ -3,7 +3,10 @@ import { type FlowController, type FlowDeps, type FlowStart } from './controller
3
3
  * The flow for a start, once. `start` is undefined until the generation stage has finished, so the hook can be called
4
4
  * unconditionally; the step log is started with the controller, as the wizard started it with its first render.
5
5
  */
6
- export declare function useFlow(start: FlowStart | undefined, deps?: () => FlowDeps): {
6
+ export declare function useFlow(start: FlowStart | undefined, options?: {
7
+ beforeStepChange?: () => void;
8
+ deps?: () => FlowDeps;
9
+ }): {
7
10
  controller: FlowController;
8
11
  state: ReturnType<FlowController['getState']>;
9
12
  } | undefined;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import type { Produced } from '../support/produced.js';
2
3
  type EntityResult = {
3
4
  created: number;
4
5
  updated: number;
@@ -16,6 +17,10 @@ type DoneStepProps = {
16
17
  spaceId: string;
17
18
  environmentId: string;
18
19
  host?: string;
20
+ /** What the import produced, so only the links to those things are offered. */
21
+ produced: Produced;
22
+ /** The user skipped the credentials, so nothing could be pushed: the files were only saved. */
23
+ credentialsSkipped?: boolean;
19
24
  runTeaser?: string;
20
25
  failures?: Array<{
21
26
  entityType: string;
@@ -24,5 +29,5 @@ type DoneStepProps = {
24
29
  }>;
25
30
  onExit: () => void;
26
31
  };
27
- export declare function DoneStep({ componentTypes, designTokens, summary, spaceId, environmentId, host, failures, onExit, }: DoneStepProps): React.ReactElement;
32
+ export declare function DoneStep({ componentTypes, designTokens, summary, spaceId, environmentId, host, produced, credentialsSkipped, failures, onExit, }: DoneStepProps): React.ReactElement;
28
33
  export {};
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import type { PushProgress } from '../support/push-progress.js';
3
+ import { type Produced } from '../support/produced.js';
3
4
  type PushingStepProps = {
4
- stepNumber: number;
5
- totalSteps: number;
6
5
  progress: PushProgress;
6
+ produced: Produced;
7
7
  };
8
- export declare function PushingStep({ stepNumber, totalSteps, progress }: PushingStepProps): React.ReactElement;
8
+ export declare function PushingStep({ progress, produced }: PushingStepProps): React.ReactElement;
9
9
  export {};
@@ -1,20 +1,12 @@
1
1
  import React from 'react';
2
2
  import type { ServerPreviewResponse } from '@contentful/experience-design-system-types';
3
- export interface PreviewDiffLine {
4
- key: string;
5
- color: string;
6
- text: string;
7
- }
8
- export declare function buildPreviewSummaryLines(preview: ServerPreviewResponse): PreviewDiffLine[];
9
3
  type WizardPreviewStepProps = {
10
4
  preview: ServerPreviewResponse;
11
5
  spaceId: string;
12
6
  environmentId: string;
13
- stepNumber: number;
14
- totalSteps: number;
15
7
  onConfirm: (acknowledge: boolean) => void;
16
8
  onEdit?: () => void;
17
9
  onQuit: () => void;
18
10
  };
19
- export declare function WizardPreviewStep({ preview, spaceId, environmentId, stepNumber, totalSteps, onConfirm, onEdit, onQuit, }: WizardPreviewStepProps): React.ReactElement;
11
+ export declare function WizardPreviewStep({ preview, spaceId, environmentId, onConfirm, onEdit, onQuit, }: WizardPreviewStepProps): React.ReactElement;
20
12
  export {};
@@ -1,8 +1,3 @@
1
- /**
2
- * Expands a leading `~` to the user's home directory.
3
- * Exported separately so it can be unit-tested and reused.
4
- */
5
- export declare function expandTilde(input: string): string;
6
1
  /**
7
2
  * Normalizes a user-entered path to an absolute path, handling all common
8
3
  * terminal path styles:
@@ -1,10 +1,7 @@
1
- import type { ChangeClassification, ComponentTypeSummary, PropertySummary } from '@contentful/experience-design-system-types';
1
+ import type { ChangeClassification, ComponentTypeSummary } from '@contentful/experience-design-system-types';
2
2
  export interface PropertyDiffLine {
3
3
  key: string;
4
- color: 'green' | 'red' | 'yellow';
4
+ color: string;
5
5
  text: string;
6
6
  }
7
7
  export declare function computeComponentDiffLines(current: ComponentTypeSummary, proposed: Record<string, unknown>, changeClassification?: ChangeClassification): PropertyDiffLine[];
8
- export declare function diffProperty(name: string, old: PropertySummary, newDef: Record<string, unknown>): PropertyDiffLine[];
9
- export declare function formatOldProp(prop: PropertySummary): string;
10
- export declare function formatPropDef(def: Record<string, unknown>): string;
@@ -0,0 +1,15 @@
1
+ import type { FlowState } from '../flow/types.js';
2
+ /** What an import produced, so the screens after the work can describe what happened and not a fixed pair. */
3
+ export interface Produced {
4
+ components: boolean;
5
+ tokens: boolean;
6
+ }
7
+ /** Components exist when extraction ran; tokens exist when the token stage left a catalog or a session behind. */
8
+ export declare function producedOf(state: Pick<FlowState, 'extractSessionId' | 'tokensPath' | 'tokenSessionId'>): Produced;
9
+ /**
10
+ * How the saved file is described: the file is always named `components.json`, but when only tokens were generated it
11
+ * holds just the tokens, and calling it a components file would mislead.
12
+ */
13
+ export declare function fileSummaryLabel({ components }: Produced): string;
14
+ /** "component types and design tokens", "design tokens", or "component types": the things this run writes. */
15
+ export declare function writtenThings({ components, tokens }: Produced): string;
@@ -1,6 +1,6 @@
1
+ export { PreflightScreen } from './00-preflight/screen.js';
1
2
  export { WelcomeScreen } from './01-welcome/screen.js';
2
3
  export { TokenInputScreen } from './02-token-input/screen.js';
3
4
  export { PathValidationScreen } from './03-path-validation/screen.js';
4
5
  export { CredentialsScreen } from './04-credentials/screen.js';
5
- export { TokenReuseScreen } from './05-token-reuse/screen.js';
6
6
  export { ExtractionScreen } from './06-extraction/screen.js';
@@ -3,10 +3,7 @@ export interface PreviewValidationError {
3
3
  path: string;
4
4
  message: string;
5
5
  }
6
- export declare function failedComponentNames(errors: readonly PreviewValidationError[]): string[];
7
6
  export declare function matchedComponentNames(errors: readonly PreviewValidationError[], missingNames: readonly string[]): string[];
8
- export declare function formatErrorLine(error: PreviewValidationError): string;
9
7
  export declare function formatErrorLines(errors: readonly PreviewValidationError[]): string;
10
- export declare function missingNote(missingNames: readonly string[]): string;
11
8
  export declare function contextText(errors: readonly PreviewValidationError[], missingNames: readonly string[]): string;
12
9
  export declare function skipLabel(matchedNames: readonly string[]): string;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ /** Settings > Configuration: a short menu that opens the Project settings or the Agent settings. */
2
3
  export declare function ConfigurationScreen({ onDone }: {
3
4
  onDone: () => void;
4
5
  }): React.ReactElement;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { type AgentName } from '@contentful/experience-design-system-backend-pipeline';
3
+ import { type AgentConfig } from './agent-store.js';
4
+ /**
5
+ * One agent's screen: what was found for it, its two settings, and the test. Saving writes the whole agent config, so the
6
+ * default agent and the other agents are kept. The test uses the values on screen, saved or not.
7
+ */
8
+ export declare function AgentDetail({ name, config, setConfig, onBack, record, }: {
9
+ name: AgentName;
10
+ config: AgentConfig;
11
+ setConfig: (config: AgentConfig) => void;
12
+ onBack: () => void;
13
+ /** Adds a line to the debug log of this visit. The Agents list owns the log, since it is the screen that is open. */
14
+ record: (action: string, error?: unknown) => void;
15
+ }): React.ReactElement;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { AgentName } from '@contentful/experience-design-system-backend-pipeline';
3
+ import { type AgentCheck, type StatusRow } from './agent-status.js';
4
+ export declare const TONE_COLOR: Record<StatusRow['tone'], string>;
5
+ /** The symbol and one-word state for an agent, shown on its row in the list. `binary` is the saved path, empty when none is saved. */
6
+ export declare function AgentStatusBadge({ name, checks, binary, }: {
7
+ name: AgentName;
8
+ checks: AgentCheck[] | undefined;
9
+ binary: string;
10
+ }): React.ReactElement;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ /**
3
+ * Settings > Configuration > Agents. The list holds only what is needed to pick an agent: the name, a star on the default,
4
+ * and a one-word status. Below it, a panel shows the full detail for the focused agent and follows the cursor, so nothing
5
+ * has to be opened to read it. The "Default agent" line at the top is read-only: ↑/↓ move through the agents, Enter makes
6
+ * the focused one the default (saved at once), and → opens its own screen, where its path and model are edited and the
7
+ * test is run.
8
+ */
9
+ export declare function AgentsScreen({ onDone }: {
10
+ onDone: () => void;
11
+ }): React.ReactElement;
@@ -0,0 +1,25 @@
1
+ import { type AgentName } from '@contentful/experience-design-system-backend-pipeline';
2
+ import type { Snapshot } from '../../shared/debug-trail.js';
3
+ import type { AgentConfig } from './agent-store.js';
4
+ /**
5
+ * The agent settings as flat text, for `diffSnapshots`: `default_agent`, then `<agent>.model` and `<agent>.binary` for
6
+ * every agent. Taken on entry and on exit, so the log shows what a visit changed.
7
+ */
8
+ export declare function agentSnapshot(config: AgentConfig): Snapshot;
9
+ export type AgentEnvironment = {
10
+ /** Whether the command was found, and the path it resolved to. */
11
+ found: boolean;
12
+ resolved_path: string;
13
+ version: string;
14
+ /**
15
+ * The `EDS_AGENT_BINARY_<AGENT>` variable when it points somewhere other than the saved path. Settings copies a saved
16
+ * path into that variable at startup, so a value equal to the saved path is not an override and is left out.
17
+ */
18
+ env_override: string;
19
+ };
20
+ /**
21
+ * What is true about each agent on this machine, so "my agent does not work" can be read from the log: found or not,
22
+ * where, its version, and whether a shell variable is overriding the saved path. Uses the quick checks only, so it never
23
+ * spends a prompt.
24
+ */
25
+ export declare function describeAgents(config: AgentConfig): Promise<Record<AgentName, AgentEnvironment>>;
@@ -0,0 +1,63 @@
1
+ import { type AgentName } from '@contentful/experience-design-system-backend-pipeline';
2
+ type AgentCheckStep = 'path' | 'version' | 'login' | 'prompt';
3
+ export type AgentCheck = {
4
+ step: AgentCheckStep;
5
+ ok: boolean;
6
+ /** One line for the user: the version string, the reason it failed, or what to run next. */
7
+ detail: string;
8
+ /** Only on the prompt step: the agent did not answer in time. That is not the same as a failure or a missing login. */
9
+ timedOut?: boolean;
10
+ };
11
+ /**
12
+ * The one-word state shown on an agent's row. `not-configured` means no path is saved and the command is not on the
13
+ * PATH; `not-found` means a saved path does not work. `unknown` means it runs but its login cannot be checked.
14
+ */
15
+ export type AgentStatus = 'checking' | 'ready' | 'not-configured' | 'not-found' | 'not-logged-in' | 'test-failed' | 'timed-out' | 'unknown';
16
+ /** The model the agent runs with when none is saved ("haiku", "gpt-mini", or the agent's own pick), for the model row. */
17
+ export declare function defaultModelLabel(name: AgentName): string;
18
+ /**
19
+ * Steps 1 to 3 against `binary`. Never throws and never spends tokens, so it is safe to run for every row on open.
20
+ * Checks the path the user typed, not what is saved, so the form can test a value before it is written.
21
+ */
22
+ export declare function inspectAgent(name: AgentName, binary: string): Promise<AgentCheck[]>;
23
+ /** Steps 1 to 4. The prompt step is the only way to verify login and model name for agents other than claude. */
24
+ export declare function testAgent(name: AgentName, binary: string, model: string): Promise<AgentCheck[]>;
25
+ /** Collapses a list of checks into the status shown on the row. */
26
+ export declare function statusFromChecks(name: AgentName, checks: readonly AgentCheck[], savedBinary: string): AgentStatus;
27
+ export type StatusRow = {
28
+ label: string;
29
+ value: string;
30
+ tone: 'ok' | 'bad' | 'muted';
31
+ };
32
+ /**
33
+ * How a full test went, in one line for a banner on the agent's screen. Undefined when no test has run (the quick checks
34
+ * alone are not a test), so the banner only appears after the user asked for one.
35
+ */
36
+ export declare function testOutcome(checks: readonly AgentCheck[] | undefined): {
37
+ ok: boolean;
38
+ text: string;
39
+ } | undefined;
40
+ /**
41
+ * The short form of a status for the list, where every row has to be scannable at a glance. The wording is plainer than
42
+ * the detail panel's: "not installed" covers both "nothing saved" and "saved path broken", which the panel tells apart.
43
+ */
44
+ export declare const LIST_STATUS: Record<AgentStatus, {
45
+ symbol: string;
46
+ text: string;
47
+ tone: StatusRow['tone'];
48
+ }>;
49
+ /**
50
+ * The rows of the detail panel under the list, for the focused agent. Everything here is read-only and comes from
51
+ * checks already collected, so moving the cursor never runs anything.
52
+ */
53
+ export declare function panelRows(name: AgentName, checks: readonly AgentCheck[] | undefined, settings: {
54
+ binary: string;
55
+ model: string;
56
+ }): StatusRow[];
57
+ /**
58
+ * What the Status section of an agent's screen shows: the shared rows, then the login and the test, which only this
59
+ * view has. The login row is always there once the command is found, because for most agents it has to say that login
60
+ * cannot be checked without a test.
61
+ */
62
+ export declare function statusRows(name: AgentName, checks: readonly AgentCheck[] | undefined, savedBinary: string): StatusRow[];
63
+ export {};
@@ -0,0 +1,21 @@
1
+ import { type AgentName } from '@contentful/experience-design-system-backend-pipeline';
2
+ export type AgentSettings = {
3
+ /** Passed as --model. Empty: the agent's built-in default (see defaultModelLabel). */
4
+ model: string;
5
+ /** Path to the agent's command. Empty: the command name is looked up on the PATH. */
6
+ binary: string;
7
+ };
8
+ export type AgentConfig = {
9
+ /** The agent the CLI uses when `--agent` is not given. Claude when nothing was chosen. */
10
+ defaultAgent: AgentName;
11
+ /**
12
+ * Whether the user chose the default agent. Only then is `agent` written to config.json, so someone who never chose
13
+ * keeps the import's built-in default, including if that default changes in a later version.
14
+ */
15
+ defaultChosen?: boolean;
16
+ agents: Record<AgentName, AgentSettings>;
17
+ };
18
+ export declare const AGENT_LABELS: Record<AgentName, string>;
19
+ export declare function emptyAgents(): Record<AgentName, AgentSettings>;
20
+ export declare function readAgentConfig(): Promise<AgentConfig>;
21
+ export declare function writeAgentConfig(config: AgentConfig): Promise<void>;