@contentful/experience-design-system-cli 2.26.1-dev-build-a852362.0 → 2.26.1-dev-build-f03f014.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 +14 -10
  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,94 +0,0 @@
1
- import { computeSidebarWidth } from './sidebar-width.js';
2
- export const THREE_COLUMN_MIN_WIDTH = 120;
3
- export function computeColumnWidths(totalWidth) {
4
- if (totalWidth < THREE_COLUMN_MIN_WIDTH) {
5
- return { layout: 'single', main: computeSidebarWidth(totalWidth), added: 0, groups: 0 };
6
- }
7
- const main = computeSidebarWidth(totalWidth);
8
- const remaining = Math.max(0, totalWidth - main - 4);
9
- const added = Math.floor(remaining * 0.45);
10
- const groups = Math.max(0, remaining - added - 2);
11
- return { layout: 'three-column', main, added, groups };
12
- }
13
- export function buildAddedComponentsList(components, stateByKey, cycleParticipants = new Set()) {
14
- const cycleTier = [];
15
- const restTier = [];
16
- // Selection state is keyed by name, so components sharing a name (real
17
- // collisions across files) collapse to one accepted entry — dedupe by name
18
- // to avoid duplicate rows and non-unique React keys downstream.
19
- const seen = new Set();
20
- for (const c of components) {
21
- if (stateByKey.get(c.name) !== 'accepted')
22
- continue;
23
- if (seen.has(c.name))
24
- continue;
25
- seen.add(c.name);
26
- if (cycleParticipants.has(c.name))
27
- cycleTier.push({ name: c.name, isCycle: true });
28
- else
29
- restTier.push({ name: c.name, isCycle: false });
30
- }
31
- cycleTier.sort((a, b) => a.name.localeCompare(b.name));
32
- restTier.sort((a, b) => a.name.localeCompare(b.name));
33
- return [...cycleTier, ...restTier];
34
- }
35
- export function buildAddedGroupsList(closures, stateByKey, cycleParticipants = new Set(), cycleUnits = new Map()) {
36
- const cycleTier = [];
37
- const restTier = [];
38
- const seenNames = new Set();
39
- for (const [root, closure] of closures.entries()) {
40
- if (closure.nodes.length <= 1)
41
- continue;
42
- if (stateByKey.get(root) !== 'accepted')
43
- continue;
44
- const entry = {
45
- name: root,
46
- depCount: closure.nodes.length - 1,
47
- isCycle: cycleParticipants.has(root),
48
- };
49
- if (entry.isCycle)
50
- cycleTier.push(entry);
51
- else
52
- restTier.push(entry);
53
- seenNames.add(root);
54
- }
55
- const seenUnits = new Set();
56
- for (const unit of cycleUnits.values()) {
57
- if (seenUnits.has(unit))
58
- continue;
59
- seenUnits.add(unit);
60
- for (const member of unit) {
61
- if (stateByKey.get(member) !== 'accepted')
62
- continue;
63
- if (seenNames.has(member))
64
- continue;
65
- seenNames.add(member);
66
- cycleTier.push({ name: member, depCount: unit.size - 1, isCycle: true });
67
- }
68
- }
69
- cycleTier.sort((a, b) => a.name.localeCompare(b.name));
70
- restTier.sort((a, b) => a.name.localeCompare(b.name));
71
- return [...cycleTier, ...restTier];
72
- }
73
- export function computeCounters(components, closures, stateByKey) {
74
- let accepted = 0;
75
- let rejected = 0;
76
- let undecided = 0;
77
- for (const c of components) {
78
- const s = stateByKey.get(c.name) ?? 'undecided';
79
- if (s === 'accepted')
80
- accepted++;
81
- else if (s === 'rejected')
82
- rejected++;
83
- else
84
- undecided++;
85
- }
86
- let groups = 0;
87
- for (const [root, closure] of closures.entries()) {
88
- if (closure.nodes.length <= 1)
89
- continue;
90
- if (stateByKey.get(root) === 'accepted')
91
- groups++;
92
- }
93
- return { accepted, rejected, undecided, groups, total: components.length };
94
- }
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from 'ink';
3
- import { PALETTE } from '../../analyze/select/tui/theme.js';
4
- import React from 'react';
5
- import { ScopeGateStep } from './steps/ScopeGateStep.js';
6
- import { AtomicScopeGateStep } from './steps/AtomicScopeGateStep.js';
7
- export function ScopeGateHost({ components, autoAccept, compositionMode = 'atomic', onConfirm, onQuit, aiFilterStatus = 'idle', aiFilterProgress = null, aiFilterError = null, onCancelAutoFilter, }) {
8
- if (components.length === 0) {
9
- return (_jsx(Box, { paddingX: 2, paddingY: 1, children: _jsx(Text, { color: PALETTE.error, children: "Error: no components found for this session \u2014 please re-run analyze extract." }) }));
10
- }
11
- if (autoAccept) {
12
- return _jsx(ScopeGateAutoAccept, { components: components, onConfirm: onConfirm });
13
- }
14
- // Atomic mode (spec T9): render the pre-composite flat step. It never imports
15
- // the graph/closures/cycles/cascade primitives, so this host fork is the
16
- // single point where "atomic bypasses the graph" is guaranteed on the
17
- // interactive path.
18
- if (compositionMode === 'atomic') {
19
- return (_jsx(AtomicScopeGateStep, { components: [...components], onConfirm: onConfirm, onQuit: onQuit, aiFilterStatus: aiFilterStatus, aiFilterProgress: aiFilterProgress, aiFilterError: aiFilterError, onCancelAutoFilter: onCancelAutoFilter }));
20
- }
21
- return (_jsx(ScopeGateStep, { components: [...components], onConfirm: onConfirm, onQuit: onQuit, aiFilterStatus: aiFilterStatus, aiFilterProgress: aiFilterProgress, aiFilterError: aiFilterError, onCancelAutoFilter: onCancelAutoFilter }));
22
- }
23
- function ScopeGateAutoAccept({ components, onConfirm, }) {
24
- React.useEffect(() => {
25
- onConfirm({ accepted: components.map((c) => c.name), rejected: [] });
26
- }, []);
27
- return (_jsx(Box, { paddingX: 2, paddingY: 1, children: _jsxs(Text, { dimColor: true, children: ["Auto-accepting ", components.length, " components..."] }) }));
28
- }
@@ -1,3 +0,0 @@
1
- export function computeSidebarWidth(terminalWidth) {
2
- return Math.min(60, Math.max(36, Math.floor(terminalWidth * 0.45)));
3
- }
@@ -1,53 +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 { spawn } from 'node:child_process';
18
- export function spawnGenerateChild(opts) {
19
- const child = spawn(opts.command, opts.args);
20
- let stdout = '';
21
- let stderr = '';
22
- child.stdout?.on('data', (d) => {
23
- const chunk = String(d);
24
- stdout += chunk;
25
- opts.onStdout?.(chunk);
26
- });
27
- child.stderr?.on('data', (d) => {
28
- const chunk = String(d);
29
- stderr += chunk;
30
- opts.onStderr?.(chunk);
31
- });
32
- const donePromise = new Promise((resolve) => {
33
- // Use 'close' rather than 'exit' so stdio drains and any inherited file
34
- // handles are released before downstream code reacts.
35
- child.on('close', (code, signal) => {
36
- resolve({
37
- exitCode: code ?? 0,
38
- signal: signal ?? null,
39
- stdout,
40
- stderr,
41
- });
42
- });
43
- child.on('error', (err) => {
44
- resolve({
45
- exitCode: 1,
46
- signal: null,
47
- stdout,
48
- stderr: stderr + (err.message ?? String(err)),
49
- });
50
- });
51
- });
52
- return { child, donePromise };
53
- }
@@ -1,42 +0,0 @@
1
- import { fuzzyMatches } from '../../analyze/fuzzy-search.js';
2
- export function computeFilterKeys(input) {
3
- const active = new Set(input.filters);
4
- if (active.size === 0)
5
- return undefined;
6
- const out = new Set();
7
- if (active.has('cycles'))
8
- for (const k of input.data.cycles ?? [])
9
- out.add(k);
10
- if (active.has('broken'))
11
- for (const k of input.data.broken ?? [])
12
- out.add(k);
13
- if (active.has('deleted'))
14
- for (const k of input.data.deleted ?? [])
15
- out.add(k);
16
- return out;
17
- }
18
- export function intersectFilterKeys(a, b) {
19
- if (a === undefined)
20
- return b;
21
- if (b === undefined)
22
- return a;
23
- const out = new Set();
24
- for (const k of a)
25
- if (b.has(k))
26
- out.add(k);
27
- return out;
28
- }
29
- export function buildFlatDimPredicate(input) {
30
- const hasSearch = input.searchQuery.length > 0;
31
- const isFlat = input.viewMode === 'flat';
32
- const keys = isFlat ? input.filterVisibleKeys : undefined;
33
- if (!hasSearch && keys === undefined)
34
- return undefined;
35
- return (name) => {
36
- if (hasSearch && !fuzzyMatches(input.searchQuery, name))
37
- return true;
38
- if (keys !== undefined && !keys.has(name))
39
- return true;
40
- return false;
41
- };
42
- }