@contentful/experience-design-system-cli 2.26.1-dev-build-64063df.0 → 2.26.1-dev-build-f1d1f30.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 (204) hide show
  1. package/dist/package.json +13 -9
  2. package/dist/src/index.js +34937 -9
  3. package/dist/src/lib/cli-path.d.ts +4 -0
  4. package/dist/src/runs/export-helpers.d.ts +1 -12
  5. package/dist/src/runs/push-helpers.d.ts +1 -6
  6. package/package.json +12 -7
  7. package/skills/generate-components.md +427 -0
  8. package/skills/generate-tokens.md +194 -0
  9. package/skills/select-components.md +224 -0
  10. package/dist/src/analytics/apply.js +0 -30
  11. package/dist/src/analytics/client.js +0 -81
  12. package/dist/src/analytics/constants.js +0 -4
  13. package/dist/src/analytics/env.js +0 -14
  14. package/dist/src/analytics/exit.js +0 -24
  15. package/dist/src/analytics/index.js +0 -9
  16. package/dist/src/analytics/normalize.js +0 -18
  17. package/dist/src/analytics/os.js +0 -13
  18. package/dist/src/analytics/session.js +0 -15
  19. package/dist/src/analytics/tracker.js +0 -126
  20. package/dist/src/analytics/types.js +0 -1
  21. package/dist/src/analyze/build-analyze-view-rows.js +0 -63
  22. package/dist/src/analyze/command.js +0 -599
  23. package/dist/src/analyze/composite-closure.js +0 -0
  24. package/dist/src/analyze/composition/agent-parser/author-prompt.js +0 -22
  25. package/dist/src/analyze/composition/agent-parser/extract-parser.js +0 -44
  26. package/dist/src/analyze/composition/agent-parser/load-prompt.js +0 -31
  27. package/dist/src/analyze/composition/agent-parser/resolve-via-parser.js +0 -88
  28. package/dist/src/analyze/composition/agent-parser/sandbox.js +0 -187
  29. package/dist/src/analyze/composition/apply-mapping.js +0 -67
  30. package/dist/src/analyze/composition/candidate-critic-agent.js +0 -39
  31. package/dist/src/analyze/composition/candidate-critic.js +0 -63
  32. package/dist/src/analyze/composition/candidate-files.js +0 -131
  33. package/dist/src/analyze/composition/composition-cache-key.js +0 -19
  34. package/dist/src/analyze/composition/interchange-schema.js +0 -61
  35. package/dist/src/analyze/composition/manifest-doc-evidence.js +0 -136
  36. package/dist/src/analyze/composition/merge-edges.js +0 -70
  37. package/dist/src/analyze/composition/parse-map-edges.js +0 -55
  38. package/dist/src/analyze/composition/resolve-mapping-cli.js +0 -29
  39. package/dist/src/analyze/composition/resolve-mapping.js +0 -111
  40. package/dist/src/analyze/cycle-detection.js +0 -234
  41. package/dist/src/analyze/cycle-view.js +0 -28
  42. package/dist/src/analyze/fuzzy-search.js +0 -55
  43. package/dist/src/analyze/issue-inheritance.js +0 -108
  44. package/dist/src/analyze/lineage.js +0 -0
  45. package/dist/src/analyze/scope-gate-cascade.js +0 -170
  46. package/dist/src/analyze/search-neighborhood.js +0 -56
  47. package/dist/src/analyze/select/command.js +0 -484
  48. package/dist/src/analyze/select/index.js +0 -5
  49. package/dist/src/analyze/select/parser.js +0 -53
  50. package/dist/src/analyze/select/persistence.js +0 -80
  51. package/dist/src/analyze/select/preview-annotations.js +0 -62
  52. package/dist/src/analyze/select/stdout.js +0 -3
  53. package/dist/src/analyze/select/tui/App.js +0 -483
  54. package/dist/src/analyze/select/tui/components/ComponentDetail.js +0 -48
  55. package/dist/src/analyze/select/tui/components/ComponentRationalePanel.js +0 -125
  56. package/dist/src/analyze/select/tui/components/FieldEditor.js +0 -1131
  57. package/dist/src/analyze/select/tui/components/FinalizeDialog.js +0 -36
  58. package/dist/src/analyze/select/tui/components/GotoBanner.js +0 -30
  59. package/dist/src/analyze/select/tui/components/GroupedSidebar.js +0 -517
  60. package/dist/src/analyze/select/tui/components/HelpOverlay.js +0 -17
  61. package/dist/src/analyze/select/tui/components/JsonEditor.js +0 -131
  62. package/dist/src/analyze/select/tui/components/JsonPanel.js +0 -66
  63. package/dist/src/analyze/select/tui/components/LineagePanel.js +0 -22
  64. package/dist/src/analyze/select/tui/components/PreviewSummaryBar.js +0 -29
  65. package/dist/src/analyze/select/tui/components/QuitDialog.js +0 -14
  66. package/dist/src/analyze/select/tui/components/RationalePanel.js +0 -80
  67. package/dist/src/analyze/select/tui/components/Sidebar.js +0 -92
  68. package/dist/src/analyze/select/tui/components/SourcePanel.js +0 -52
  69. package/dist/src/analyze/select/tui/components/StatusBar.js +0 -7
  70. package/dist/src/analyze/select/tui/components/TopBar.js +0 -10
  71. package/dist/src/analyze/select/tui/components/removed-components-text.js +0 -11
  72. package/dist/src/analyze/select/tui/hooks/scroll-offset.js +0 -26
  73. package/dist/src/analyze/select/tui/hooks/useImmediateInput.js +0 -66
  74. package/dist/src/analyze/select/tui/hooks/useKeymap.js +0 -67
  75. package/dist/src/analyze/select/tui/hooks/useSession.js +0 -52
  76. package/dist/src/analyze/select/tui/hooks/useUndo.js +0 -26
  77. package/dist/src/analyze/select/tui/theme.js +0 -28
  78. package/dist/src/analyze/select/types.js +0 -39
  79. package/dist/src/analyze/select-agent/command.js +0 -558
  80. package/dist/src/analyze/select-agent/context-builder.js +0 -197
  81. package/dist/src/analyze/select-agent/show-rationale.js +0 -92
  82. package/dist/src/analyze/selection-cascade.js +0 -19
  83. package/dist/src/analyze/slot-graph.js +0 -17
  84. package/dist/src/analyze/tui/AnalyzeView.js +0 -64
  85. package/dist/src/apply/api-client.js +0 -440
  86. package/dist/src/apply/command.js +0 -845
  87. package/dist/src/apply/manifest.js +0 -1
  88. package/dist/src/apply/preview-utils.js +0 -26
  89. package/dist/src/apply/tui/SelectView.js +0 -34
  90. package/dist/src/apply/tui/ServerApplyView.js +0 -49
  91. package/dist/src/apply/tui/ServerPreviewView.js +0 -23
  92. package/dist/src/credentials-store.js +0 -74
  93. package/dist/src/generate/command.js +0 -597
  94. package/dist/src/generate/edit/command.js +0 -127
  95. package/dist/src/generate/tui/GenerateView.js +0 -10
  96. package/dist/src/host-utils.js +0 -26
  97. package/dist/src/import/agent-model-resolve.js +0 -35
  98. package/dist/src/import/auto-filter-resolve.js +0 -16
  99. package/dist/src/import/command.js +0 -380
  100. package/dist/src/import/cycle-auto-reject.js +0 -14
  101. package/dist/src/import/orchestrator.js +0 -603
  102. package/dist/src/import/path-utils.js +0 -30
  103. package/dist/src/import/picker-dispatch.js +0 -44
  104. package/dist/src/import/print-prompt.js +0 -31
  105. package/dist/src/import/strip-allowed-components.js +0 -22
  106. package/dist/src/import/tui/CustomPromptBanner.js +0 -8
  107. package/dist/src/import/tui/WizardApp.js +0 -1670
  108. package/dist/src/import/tui/ai-flag.js +0 -6
  109. package/dist/src/import/tui/auto-filter-error.js +0 -29
  110. package/dist/src/import/tui/autocomplete.js +0 -32
  111. package/dist/src/import/tui/components/AutoFilterBanner.js +0 -19
  112. package/dist/src/import/tui/components/CounterStrip.js +0 -12
  113. package/dist/src/import/tui/components/LegendEntry.js +0 -6
  114. package/dist/src/import/tui/cycle-panel-scroll.js +0 -33
  115. package/dist/src/import/tui/final-review-host.js +0 -25
  116. package/dist/src/import/tui/group-collapse.js +0 -11
  117. package/dist/src/import/tui/history.js +0 -53
  118. package/dist/src/import/tui/hooks/useLineage.js +0 -50
  119. package/dist/src/import/tui/hooks/useOverlayPanel.js +0 -27
  120. package/dist/src/import/tui/lineage-layout.js +0 -82
  121. package/dist/src/import/tui/merge-ai-decisions.js +0 -22
  122. package/dist/src/import/tui/push-decision-gate-helpers.js +0 -8
  123. package/dist/src/import/tui/push-progress.js +0 -1
  124. package/dist/src/import/tui/run-print-files-helpers.js +0 -8
  125. package/dist/src/import/tui/run-teaser.js +0 -9
  126. package/dist/src/import/tui/runLivePreview.js +0 -82
  127. package/dist/src/import/tui/runScopeGate.js +0 -28
  128. package/dist/src/import/tui/scope-gate-columns.js +0 -94
  129. package/dist/src/import/tui/scope-gate-host.js +0 -28
  130. package/dist/src/import/tui/sidebar-width.js +0 -3
  131. package/dist/src/import/tui/spawn-generate.js +0 -53
  132. package/dist/src/import/tui/step-filters.js +0 -42
  133. package/dist/src/import/tui/steps/AtomicGenerateReviewStep.js +0 -726
  134. package/dist/src/import/tui/steps/AtomicScopeGateStep.js +0 -210
  135. package/dist/src/import/tui/steps/CredentialsStep.js +0 -108
  136. package/dist/src/import/tui/steps/DoneStep.js +0 -24
  137. package/dist/src/import/tui/steps/ErrorStep.js +0 -16
  138. package/dist/src/import/tui/steps/GateStep.js +0 -22
  139. package/dist/src/import/tui/steps/GenerateReviewStep.js +0 -1618
  140. package/dist/src/import/tui/steps/PathValidationStep.js +0 -152
  141. package/dist/src/import/tui/steps/PreviewStep.js +0 -37
  142. package/dist/src/import/tui/steps/PreviewValidationErrorStep.js +0 -23
  143. package/dist/src/import/tui/steps/PushDecisionGateStep.js +0 -73
  144. package/dist/src/import/tui/steps/PushingStep.js +0 -24
  145. package/dist/src/import/tui/steps/RunningStep.js +0 -21
  146. package/dist/src/import/tui/steps/ScopeGateStep.js +0 -907
  147. package/dist/src/import/tui/steps/TokenInputStep.js +0 -88
  148. package/dist/src/import/tui/steps/WelcomeStep.js +0 -34
  149. package/dist/src/import/tui/steps/WizardPreviewStep.js +0 -169
  150. package/dist/src/import/tui/steps/auto-reject-decision.js +0 -9
  151. package/dist/src/import/tui/steps/breaking-change-format.js +0 -24
  152. package/dist/src/import/tui/steps/enumerate-cycle-breaks.js +0 -0
  153. package/dist/src/import/tui/steps/preview-diff.js +0 -175
  154. package/dist/src/import/tui/useFinalizePreview.js +0 -0
  155. package/dist/src/import/tui/useLivePreview.js +0 -122
  156. package/dist/src/import/tui/wizard-422-helpers.js +0 -60
  157. package/dist/src/import/tui/wizard-generate-progress.js +0 -25
  158. package/dist/src/import/tui/wizard-save-flow.js +0 -20
  159. package/dist/src/import/tui/wizard-state-transitions.js +0 -32
  160. package/dist/src/lib/agent-model-options.js +0 -15
  161. package/dist/src/lib/command-options.js +0 -30
  162. package/dist/src/lib/composition-mode.js +0 -39
  163. package/dist/src/lib/contentful-urls.js +0 -27
  164. package/dist/src/lib/debug-logger.js +0 -229
  165. package/dist/src/lib/debug-preamble.js +0 -33
  166. package/dist/src/lib/error-parser.js +0 -269
  167. package/dist/src/lib/prompt-overrides.js +0 -69
  168. package/dist/src/lib/terminal-capabilities.js +0 -51
  169. package/dist/src/lib/user-agent.js +0 -29
  170. package/dist/src/output/format.js +0 -110
  171. package/dist/src/print/command.js +0 -221
  172. package/dist/src/print/validate/tui/ValidateView.js +0 -37
  173. package/dist/src/print/validate/validators/cdf-validator.js +0 -104
  174. package/dist/src/print/validate/validators/dtcg-validator.js +0 -110
  175. package/dist/src/print/validate/validators/format-errors.js +0 -18
  176. package/dist/src/program.js +0 -105
  177. package/dist/src/runs/export-helpers.js +0 -59
  178. package/dist/src/runs/fingerprint.js +0 -75
  179. package/dist/src/runs/ls-command.js +0 -137
  180. package/dist/src/runs/modify-launcher.js +0 -42
  181. package/dist/src/runs/path-prompt.js +0 -72
  182. package/dist/src/runs/push-creds-prompt.js +0 -39
  183. package/dist/src/runs/push-helpers.js +0 -72
  184. package/dist/src/runs/push-launcher.js +0 -77
  185. package/dist/src/runs/replay-helpers.js +0 -164
  186. package/dist/src/runs/resolve-run-target.js +0 -45
  187. package/dist/src/runs/run-picker-mount.js +0 -72
  188. package/dist/src/runs/run-picker.js +0 -129
  189. package/dist/src/runs/save-conflict.js +0 -56
  190. package/dist/src/runs/save-path-resolver.js +0 -75
  191. package/dist/src/runs/staleness.js +0 -140
  192. package/dist/src/runs/store.js +0 -136
  193. package/dist/src/session/cache-keys.js +0 -44
  194. package/dist/src/session/command.js +0 -261
  195. package/dist/src/session/db.js +0 -1538
  196. package/dist/src/session/migration.js +0 -117
  197. package/dist/src/session/session-id.js +0 -212
  198. package/dist/src/session/stats.js +0 -89
  199. package/dist/src/setup/analytics-prompt.js +0 -24
  200. package/dist/src/setup/auto-filter-prompt.js +0 -24
  201. package/dist/src/setup/command.js +0 -966
  202. package/dist/src/setup/composition-mode-prompt.js +0 -37
  203. package/dist/src/setup/debug-mode-prompt.js +0 -22
  204. package/dist/src/types.js +0 -1
@@ -1,126 +0,0 @@
1
- import { cliVersion, trackEvent } from './client.js';
2
- import { IMPORT_PIPELINE_ENV } from './constants.js';
3
- import { normalizeCommand } from './normalize.js';
4
- import { getOsName } from './os.js';
5
- import { resolveAnalyticsSessionId } from './session.js';
6
- let pending = null;
7
- let sessionId;
8
- let sessionStartedEmitted = false;
9
- function isPipelineStep() {
10
- return process.env[IMPORT_PIPELINE_ENV] === '1';
11
- }
12
- function buildBaseProps(command) {
13
- return {
14
- dsi_session_id: sessionId,
15
- command,
16
- ...(isPipelineStep() ? { is_pipeline_step: true } : {}),
17
- };
18
- }
19
- function mergeContext(target, source) {
20
- if (source.space_key !== undefined)
21
- target.space_key = source.space_key;
22
- if (source.environment_key !== undefined)
23
- target.environment_key = source.environment_key;
24
- if (source.x_contentful_request_id !== undefined) {
25
- target.x_contentful_request_id = source.x_contentful_request_id;
26
- }
27
- }
28
- /** Record the start of a tracked command. Invoked is deferred until a session is bound. */
29
- export function noteCommandStart(commandChain) {
30
- const command = normalizeCommand(commandChain);
31
- if (!command)
32
- return;
33
- pending = {
34
- command,
35
- startedAt: Date.now(),
36
- invoked: false,
37
- terminalEmitted: false,
38
- context: {},
39
- completion: {},
40
- };
41
- }
42
- /** Bind a session id, preferring a pipeline parent id when present. */
43
- export async function bindAnalyticsSessionId(sessionId, context) {
44
- const id = resolveAnalyticsSessionId(sessionId);
45
- await bindAnalyticsSession(id, context);
46
- return id;
47
- }
48
- /** Attach Contentful target context for the active command. */
49
- export function setCommandContext(context) {
50
- if (!pending)
51
- return;
52
- mergeContext(pending.context, context);
53
- mergeContext(pending.completion, context);
54
- }
55
- /** Merge optional completion fields before the terminal event fires. */
56
- export function enrichCommandResult(fields) {
57
- if (!pending)
58
- return;
59
- Object.assign(pending.completion, fields);
60
- mergeContext(pending.context, fields);
61
- }
62
- export function getBoundSessionId() {
63
- return sessionId;
64
- }
65
- /** Bind the pipeline session and emit invoked once both command and session are known. */
66
- export async function bindAnalyticsSession(id, context) {
67
- sessionId = id;
68
- if (context)
69
- setCommandContext(context);
70
- await emitInvokedIfReady();
71
- }
72
- /** Emit session_started once per new pipeline head. */
73
- export async function emitSessionStarted(entryCommand) {
74
- if (!sessionId || sessionStartedEmitted)
75
- return;
76
- sessionStartedEmitted = true;
77
- await trackEvent('dsi_cli_session_started', {
78
- dsi_session_id: sessionId,
79
- entry_command: entryCommand,
80
- cli_version: cliVersion(),
81
- node_version: process.version,
82
- os_name: getOsName(),
83
- }, sessionId, { flush: true });
84
- await emitInvokedIfReady();
85
- }
86
- async function emitInvokedIfReady() {
87
- if (!pending || pending.invoked || !sessionId)
88
- return;
89
- pending.invoked = true;
90
- await trackEvent('dsi_cli_command_invoked', {
91
- ...buildBaseProps(pending.command),
92
- ...pending.context,
93
- }, sessionId, { flush: true });
94
- }
95
- export async function completeActiveCommand() {
96
- if (!pending || pending.terminalEmitted || !sessionId || !pending.invoked)
97
- return;
98
- pending.terminalEmitted = true;
99
- const durationMs = Date.now() - pending.startedAt;
100
- await trackEvent('dsi_cli_command_completed', {
101
- ...buildBaseProps(pending.command),
102
- ...pending.context,
103
- ...pending.completion,
104
- outcome: 'ok',
105
- duration_ms: durationMs,
106
- }, sessionId, { flush: true });
107
- }
108
- export async function failActiveCommand(fields = {}) {
109
- if (!pending || pending.terminalEmitted || !sessionId || !pending.invoked)
110
- return;
111
- pending.terminalEmitted = true;
112
- const durationMs = Date.now() - pending.startedAt;
113
- const outcome = fields.exit_code === 130 ? 'interrupted' : 'error';
114
- await trackEvent('dsi_cli_command_failed', {
115
- ...buildBaseProps(pending.command),
116
- ...pending.context,
117
- ...fields,
118
- outcome,
119
- duration_ms: durationMs,
120
- }, sessionId, { flush: true });
121
- }
122
- export function resetAnalyticsStateForTests() {
123
- pending = null;
124
- sessionId = undefined;
125
- sessionStartedEmitted = false;
126
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,63 +0,0 @@
1
- /**
2
- * Convention used by both halves of the warnings split:
3
- * per-component warnings start with `<ComponentName>:` and are attached to
4
- * the matching row by `buildAnalyzeViewRows` below; everything else falls
5
- * through to `partitionGlobalWarnings` and renders at the top of the panel.
6
- *
7
- * Centralized so the two halves can't drift. If the prefix shape ever changes
8
- * (e.g. requiring a space after the colon), update `WARNING_PREFIX_SUFFIX`
9
- * and both call sites pick it up.
10
- */
11
- export const WARNING_PREFIX_SUFFIX = ':';
12
- export function isWarningForComponent(warning, componentName) {
13
- return warning.startsWith(componentName + WARNING_PREFIX_SUFFIX);
14
- }
15
- /**
16
- * Split warnings into "global" (none of the surviving component-name prefixes
17
- * match) and per-component (everything else, attached to rows by
18
- * `buildAnalyzeViewRows`). The two halves MUST stay symmetric: every warning
19
- * attached to a row must be excluded from globals (no double-render); every
20
- * warning not attached to any row must fall through to globals (no silent drop).
21
- */
22
- export function partitionGlobalWarnings(allWarnings, componentNames) {
23
- return allWarnings.filter((w) => !componentNames.some((name) => isWarningForComponent(w, name)));
24
- }
25
- /**
26
- * Build the per-component rows shown in the analyze TUI / non-TTY summary,
27
- * pairing each filtered component with its corresponding validation result.
28
- *
29
- * IMPORTANT — positional indexing is intentional and load-bearing.
30
- * `validateExtractedComponents` is implemented as `.map()` over its input,
31
- * so `validatedComponents[i]` always corresponds to `filteredComponents[i]`.
32
- *
33
- * We previously keyed validated components by `name` to "avoid a positional
34
- * dependency" — that got the tradeoff exactly backwards. `Map.set` overwrites
35
- * by key, so for two components named "Button" only the second's
36
- * `validationIssues` survived in the Map. The first row's errors then
37
- * disappeared from `analyzeResult` entirely: no Errors-section entry, no
38
- * row badge, no count. Pairing by index restores correctness.
39
- */
40
- export function buildAnalyzeViewRows(filteredComponents, validatedComponents, allWarnings) {
41
- if (validatedComponents.length !== filteredComponents.length) {
42
- // Defensive: caller must pass aligned arrays. If this ever fires we want
43
- // to know loudly rather than silently mis-pair rows with their issues.
44
- throw new Error(`buildAnalyzeViewRows: validatedComponents length (${validatedComponents.length}) does not match filteredComponents length (${filteredComponents.length})`);
45
- }
46
- let totalErrors = 0;
47
- const rows = filteredComponents.map((c, i) => {
48
- const validated = validatedComponents[i];
49
- const errorIssues = (validated.validationIssues ?? []).filter((issue) => issue.severity === 'error');
50
- totalErrors += errorIssues.length;
51
- return {
52
- name: c.name,
53
- framework: c.framework,
54
- propCount: c.props.length,
55
- slotCount: c.slots.length,
56
- warnings: allWarnings.filter((w) => isWarningForComponent(w, c.name)),
57
- errors: errorIssues.map((issue) => issue.message),
58
- extractionConfidence: c.extractionConfidence ?? null,
59
- needsReview: c.needsReview ?? false,
60
- };
61
- });
62
- return { rows, totalErrors };
63
- }