@contentful/experience-design-system-cli 2.37.1-dev-build-91ca3bb8.0 → 2.37.1-dev-build-a7704a7f.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 (183) hide show
  1. package/dist/app.js +248 -999
  2. package/dist/index.js +319 -1217
  3. package/dist/package.json +1 -1
  4. package/dist/src/tui/settings/contentful-configuration/ContentfulConfigScreen.d.ts +0 -1
  5. package/package.json +3 -3
  6. package/dist/src/commands/forwarded.d.ts +0 -2
  7. package/dist/src/legacy/forwarded-import-args.d.ts +0 -1
  8. package/dist/src/legacy/legacy-cli-path.d.ts +0 -1
  9. package/dist/src/legacy/run-legacy.d.ts +0 -1
  10. package/dist/src/tui/help/file-locations.d.ts +0 -23
  11. package/dist/src/tui/settings/agents/AgentDetail.d.ts +0 -13
  12. package/dist/src/tui/settings/agents/AgentScreens.d.ts +0 -11
  13. package/dist/src/tui/settings/agents/AgentStatusBadge.d.ts +0 -10
  14. package/dist/src/tui/settings/agents/agent-status.d.ts +0 -80
  15. package/dist/src/tui/settings/agents/agent-store.d.ts +0 -17
  16. package/dist/src/tui/settings/agents/apply-binary-overrides.d.ts +0 -13
  17. package/dist/src/tui/settings/contentful-configuration/ProjectConfigScreen.d.ts +0 -5
  18. package/dist/src/tui/settings/shared/FieldForm.d.ts +0 -35
  19. package/legacy/bin/cli.js +0 -58
  20. package/legacy/dist/package.json +0 -76
  21. package/legacy/dist/src/analytics/exit.d.ts +0 -4
  22. package/legacy/dist/src/analytics/index.d.ts +0 -3
  23. package/legacy/dist/src/analyze/composite-closure.d.ts +0 -26
  24. package/legacy/dist/src/analyze/composition/apply-mapping.d.ts +0 -22
  25. package/legacy/dist/src/analyze/composition/candidate-files.d.ts +0 -34
  26. package/legacy/dist/src/analyze/composition/composition-cache-key.d.ts +0 -18
  27. package/legacy/dist/src/analyze/composition/interchange-schema.d.ts +0 -17
  28. package/legacy/dist/src/analyze/composition/manifest-doc-evidence.d.ts +0 -49
  29. package/legacy/dist/src/analyze/composition/merge-edges.d.ts +0 -19
  30. package/legacy/dist/src/analyze/composition/parse-map-edges.d.ts +0 -16
  31. package/legacy/dist/src/analyze/composition/prompt-loader.d.ts +0 -3
  32. package/legacy/dist/src/analyze/composition/resolve-mapping-cli.d.ts +0 -10
  33. package/legacy/dist/src/analyze/composition/resolve-mapping.d.ts +0 -59
  34. package/legacy/dist/src/analyze/cycle-detection.d.ts +0 -27
  35. package/legacy/dist/src/analyze/extract-command.d.ts +0 -7
  36. package/legacy/dist/src/analyze/fuzzy-search.d.ts +0 -3
  37. package/legacy/dist/src/analyze/issue-inheritance.d.ts +0 -8
  38. package/legacy/dist/src/analyze/lineage.d.ts +0 -29
  39. package/legacy/dist/src/analyze/search-neighborhood.d.ts +0 -3
  40. package/legacy/dist/src/analyze/select/command.d.ts +0 -27
  41. package/legacy/dist/src/analyze/select/parser.d.ts +0 -6
  42. package/legacy/dist/src/analyze/select/persistence.d.ts +0 -22
  43. package/legacy/dist/src/analyze/select/preview-annotations.d.ts +0 -26
  44. package/legacy/dist/src/analyze/select/tui/LegacySelectApp.d.ts +0 -8
  45. package/legacy/dist/src/analyze/select/tui/components/ComponentDetail.d.ts +0 -19
  46. package/legacy/dist/src/analyze/select/tui/components/ComponentRationalePanel.d.ts +0 -10
  47. package/legacy/dist/src/analyze/select/tui/components/FieldEditor.d.ts +0 -67
  48. package/legacy/dist/src/analyze/select/tui/components/FinalizeDialog.d.ts +0 -22
  49. package/legacy/dist/src/analyze/select/tui/components/GotoBanner.d.ts +0 -31
  50. package/legacy/dist/src/analyze/select/tui/components/GroupedSidebar.d.ts +0 -94
  51. package/legacy/dist/src/analyze/select/tui/components/HelpOverlay.d.ts +0 -21
  52. package/legacy/dist/src/analyze/select/tui/components/HighlightedLine.d.ts +0 -9
  53. package/legacy/dist/src/analyze/select/tui/components/JsonEditor.d.ts +0 -10
  54. package/legacy/dist/src/analyze/select/tui/components/JsonPanel.d.ts +0 -11
  55. package/legacy/dist/src/analyze/select/tui/components/PreviewSummaryBar.d.ts +0 -8
  56. package/legacy/dist/src/analyze/select/tui/components/QuitDialog.d.ts +0 -8
  57. package/legacy/dist/src/analyze/select/tui/components/RationaleLine.d.ts +0 -21
  58. package/legacy/dist/src/analyze/select/tui/components/RationalePanel.d.ts +0 -15
  59. package/legacy/dist/src/analyze/select/tui/components/ScrollablePanel.d.ts +0 -14
  60. package/legacy/dist/src/analyze/select/tui/components/Sidebar.d.ts +0 -29
  61. package/legacy/dist/src/analyze/select/tui/components/SourcePanel.d.ts +0 -11
  62. package/legacy/dist/src/analyze/select/tui/components/StatusBar.d.ts +0 -11
  63. package/legacy/dist/src/analyze/select/tui/components/TokenReviewPanel.d.ts +0 -30
  64. package/legacy/dist/src/analyze/select/tui/components/TopBar.d.ts +0 -10
  65. package/legacy/dist/src/analyze/select/tui/components/removed-components-text.d.ts +0 -7
  66. package/legacy/dist/src/analyze/select/tui/components/wrap-text.d.ts +0 -1
  67. package/legacy/dist/src/analyze/select/tui/hooks/list-scroll-input.d.ts +0 -13
  68. package/legacy/dist/src/analyze/select/tui/hooks/scroll-offset.d.ts +0 -30
  69. package/legacy/dist/src/analyze/select/tui/hooks/useImmediateInput.d.ts +0 -19
  70. package/legacy/dist/src/analyze/select/tui/hooks/useKeymap.d.ts +0 -24
  71. package/legacy/dist/src/analyze/select/tui/hooks/useSession.d.ts +0 -19
  72. package/legacy/dist/src/analyze/select/tui/hooks/useUndo.d.ts +0 -8
  73. package/legacy/dist/src/analyze/select/tui/theme.d.ts +0 -18
  74. package/legacy/dist/src/analyze/select/types.d.ts +0 -54
  75. package/legacy/dist/src/analyze/selection-cascade.d.ts +0 -3
  76. package/legacy/dist/src/analyze/slot-graph.d.ts +0 -11
  77. package/legacy/dist/src/apply/api-client.d.ts +0 -64
  78. package/legacy/dist/src/apply/command.d.ts +0 -43
  79. package/legacy/dist/src/apply/preview-utils.d.ts +0 -12
  80. package/legacy/dist/src/apply/tokens.d.ts +0 -1
  81. package/legacy/dist/src/apply/tui/ServerApplyView.d.ts +0 -34
  82. package/legacy/dist/src/apply/tui/ServerPreviewView.d.ts +0 -9
  83. package/legacy/dist/src/credentials-store.d.ts +0 -18
  84. package/legacy/dist/src/doctor/checks.d.ts +0 -5
  85. package/legacy/dist/src/doctor/command.d.ts +0 -2
  86. package/legacy/dist/src/doctor/report.d.ts +0 -7
  87. package/legacy/dist/src/generate/command.d.ts +0 -2
  88. package/legacy/dist/src/generate/tui/GenerateView.d.ts +0 -12
  89. package/legacy/dist/src/helpers/build-contentful-management-client.d.ts +0 -7
  90. package/legacy/dist/src/helpers/fetch-and-persist-existing-contentful-entities.d.ts +0 -29
  91. package/legacy/dist/src/helpers/fetch-existing-contentful-entities.d.ts +0 -11
  92. package/legacy/dist/src/helpers/find-nearly-matching-component.d.ts +0 -7
  93. package/legacy/dist/src/helpers/read-existing-contentful-entities-from-session.d.ts +0 -7
  94. package/legacy/dist/src/helpers/summarize-existing-contentful-entities.d.ts +0 -50
  95. package/legacy/dist/src/host-utils.d.ts +0 -3
  96. package/legacy/dist/src/index.d.ts +0 -1
  97. package/legacy/dist/src/index.js +0 -25166
  98. package/legacy/dist/src/lib/agent-definitions.d.ts +0 -14
  99. package/legacy/dist/src/lib/agent-model-options.d.ts +0 -15
  100. package/legacy/dist/src/lib/agent-output.d.ts +0 -5
  101. package/legacy/dist/src/lib/cli-errors.d.ts +0 -2
  102. package/legacy/dist/src/lib/cli-path.d.ts +0 -4
  103. package/legacy/dist/src/lib/command-options.d.ts +0 -3
  104. package/legacy/dist/src/lib/component-patch.d.ts +0 -12
  105. package/legacy/dist/src/lib/contentful-urls.d.ts +0 -15
  106. package/legacy/dist/src/lib/debug-logger.d.ts +0 -39
  107. package/legacy/dist/src/lib/debug-preamble.d.ts +0 -7
  108. package/legacy/dist/src/lib/error-parser.d.ts +0 -40
  109. package/legacy/dist/src/lib/path-exists.d.ts +0 -1
  110. package/legacy/dist/src/lib/prompt-overrides.d.ts +0 -38
  111. package/legacy/dist/src/lib/terminal-capabilities.d.ts +0 -29
  112. package/legacy/dist/src/lib/user-agent.d.ts +0 -7
  113. package/legacy/dist/src/map-tokens/apply.d.ts +0 -12
  114. package/legacy/dist/src/map-tokens/command.d.ts +0 -2
  115. package/legacy/dist/src/map-tokens/resolve-defaults.d.ts +0 -32
  116. package/legacy/dist/src/map-tokens/tui/MapTokensView.d.ts +0 -13
  117. package/legacy/dist/src/output/format.d.ts +0 -23
  118. package/legacy/dist/src/print/command.d.ts +0 -11
  119. package/legacy/dist/src/print/validate/tui/ValidateView.d.ts +0 -15
  120. package/legacy/dist/src/print/validate/validators/cdf-validator.d.ts +0 -2
  121. package/legacy/dist/src/print/validate/validators/dtcg-validator.d.ts +0 -2
  122. package/legacy/dist/src/print/validate/validators/format-errors.d.ts +0 -12
  123. package/legacy/dist/src/print/validate/validators/read-json-file.d.ts +0 -10
  124. package/legacy/dist/src/program.d.ts +0 -25
  125. package/legacy/dist/src/runs/fingerprint.d.ts +0 -36
  126. package/legacy/dist/src/runs/save-path-resolver.d.ts +0 -11
  127. package/legacy/dist/src/runs/store.d.ts +0 -65
  128. package/legacy/dist/src/session/cache-keys.d.ts +0 -22
  129. package/legacy/dist/src/session/core/cdf/cdf-mappers.d.ts +0 -3
  130. package/legacy/dist/src/session/core/components/derive-component-id.d.ts +0 -1
  131. package/legacy/dist/src/session/core/components/hash-component-shape.d.ts +0 -5
  132. package/legacy/dist/src/session/core/shared/index-rows-by-key.d.ts +0 -1
  133. package/legacy/dist/src/session/core/tokens/build-dtcg-groups.d.ts +0 -12
  134. package/legacy/dist/src/session/core/tokens/build-dtcg-tokens.d.ts +0 -3
  135. package/legacy/dist/src/session/core/tokens/hash-token-content.d.ts +0 -1
  136. package/legacy/dist/src/session/db.d.ts +0 -200
  137. package/legacy/dist/src/session/migration.d.ts +0 -2
  138. package/legacy/dist/src/session/repositories/sessions/read.d.ts +0 -11
  139. package/legacy/dist/src/session/repositories/sessions/write.d.ts +0 -3
  140. package/legacy/dist/src/session/repositories/shared/with-transaction.d.ts +0 -2
  141. package/legacy/dist/src/session/repositories/steps/read.d.ts +0 -2
  142. package/legacy/dist/src/session/repositories/steps/write.d.ts +0 -5
  143. package/legacy/dist/src/session/repositories/tokens/read.d.ts +0 -15
  144. package/legacy/dist/src/session/repositories/tokens/write.d.ts +0 -16
  145. package/legacy/dist/src/session/resolve-session-id.d.ts +0 -1
  146. package/legacy/dist/src/session/services/session-resolver.d.ts +0 -9
  147. package/legacy/dist/src/session/services/tokens/apply-tool-calls.d.ts +0 -8
  148. package/legacy/dist/src/session/services/tokens/replace-raw-prop-token-paths.d.ts +0 -3
  149. package/legacy/dist/src/session/services/tokens/replace-raw-token-name-paths.d.ts +0 -3
  150. package/legacy/dist/src/session/services/tokens/store-dtcg-tokens.d.ts +0 -3
  151. package/legacy/dist/src/session/session-id.d.ts +0 -1
  152. package/legacy/dist/src/session/source-excerpt.d.ts +0 -26
  153. package/legacy/dist/src/setup/SetupScreen.d.ts +0 -28
  154. package/legacy/dist/src/setup/SetupStepper.d.ts +0 -7
  155. package/legacy/dist/src/setup/command.d.ts +0 -3
  156. package/legacy/dist/src/setup/lib/checks.d.ts +0 -57
  157. package/legacy/dist/src/setup/lib/shell.d.ts +0 -12
  158. package/legacy/dist/src/setup/steps/CodingAgentScreen.d.ts +0 -20
  159. package/legacy/dist/src/setup/steps/ContentfulCredentialsScreen.d.ts +0 -11
  160. package/legacy/dist/src/setup/steps/StepLayout.d.ts +0 -20
  161. package/legacy/dist/src/setup/steps/preferences/AnalyticsScreen.d.ts +0 -5
  162. package/legacy/dist/src/setup/steps/preferences/BooleanInput.d.ts +0 -21
  163. package/legacy/dist/src/setup/steps/preferences/ColorPreferenceScreen.d.ts +0 -5
  164. package/legacy/dist/src/setup/steps/preferences/CustomPromptScreen.d.ts +0 -14
  165. package/legacy/dist/src/setup/steps/preferences/DebugLogsScreen.d.ts +0 -5
  166. package/legacy/dist/src/setup/steps/preferences/PreferencesMenu.d.ts +0 -26
  167. package/legacy/dist/src/setup/steps/prerequisites/PrerequisitesScreen.d.ts +0 -16
  168. package/legacy/dist/src/setup/steps/prerequisites/build.d.ts +0 -2
  169. package/legacy/dist/src/setup/steps/prerequisites/deps.d.ts +0 -33
  170. package/legacy/dist/src/setup/steps/prerequisites/index.d.ts +0 -4
  171. package/legacy/dist/src/setup/steps/prerequisites/node.d.ts +0 -2
  172. package/legacy/dist/src/setup/steps/prerequisites/pnpm.d.ts +0 -2
  173. package/legacy/dist/src/tui/CommandCompletionView.d.ts +0 -13
  174. package/legacy/dist/src/tui/render-with-goodbye.d.ts +0 -7
  175. package/legacy/dist/src/tui/use-terminal-size.d.ts +0 -6
  176. package/legacy/dist/src/tui/windowed-panel.d.ts +0 -37
  177. package/legacy/dist/src/types.d.ts +0 -2
  178. package/legacy/package.json +0 -85
  179. package/legacy/prompts/composition-edges.md +0 -11
  180. package/legacy/skills/generate-components.md +0 -612
  181. package/legacy/skills/generate-tokens.md +0 -194
  182. package/legacy/skills/map-tokens.md +0 -102
  183. package/legacy/skills/select-components.md +0 -235
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-91ca3bb8.0",
3
+ "version": "2.37.1-dev-build-a7704a7f.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- /** Settings > Configuration: a short menu that opens the Project settings or the Agent settings. */
3
2
  export declare function ConfigurationScreen({ onDone }: {
4
3
  onDone: () => void;
5
4
  }): React.ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.37.1-dev-build-91ca3bb8.0",
3
+ "version": "2.37.1-dev-build-a7704a7f.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,8 +45,8 @@
45
45
  "ts-morph": "^27.0.2",
46
46
  "typescript": "^5.9.3",
47
47
  "zod": "^4.6.5",
48
- "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-91ca3bb8.0",
49
- "@contentful/experience-design-system-types": "2.37.1-dev-build-91ca3bb8.0"
48
+ "@contentful/experience-design-system-backend-pipeline": "2.37.1-dev-build-a7704a7f.0",
49
+ "@contentful/experience-design-system-types": "2.37.1-dev-build-a7704a7f.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsconfig/node24": "^24.0.4",
@@ -1,2 +0,0 @@
1
- import type { Command } from 'commander';
2
- export declare function registerForwardedCommands(program: Command): void;
@@ -1 +0,0 @@
1
- export declare function forwardedImportArgs(argv: string[]): string[];
@@ -1 +0,0 @@
1
- export declare function findLegacyCliPath(): string;
@@ -1 +0,0 @@
1
- export declare function runLegacy(args: string[]): Promise<number>;
@@ -1,23 +0,0 @@
1
- export interface FileLocationInput {
2
- /** The Root Project Directory from Settings > Configuration > Project. Empty when not set. */
3
- contentfulBaseDir: string;
4
- /** Whether Debug Mode is on. Debug logs and the per-run folders only exist while it is. */
5
- debugModeEnabled: boolean;
6
- /** This terminal session's folder, once it has started. */
7
- currentSessionDir: string | undefined;
8
- }
9
- export interface FileLocations {
10
- debugLogs: string;
11
- importFiles: string;
12
- }
13
- /**
14
- * Where the CLI writes the files a user goes looking for, from the settings that decide it (see `startImportRun`).
15
- *
16
- * With Debug Mode on, everything goes in this terminal session's folder, `<base>/.contentful/<date>-session-N/`:
17
- * the debug logs in `debug/` and, for each import, a `dsi-import-N/` folder with `tokens.json` and `components.json`.
18
- * `<base>` is the Root Project Directory, or the project being imported when none is set. With Debug Mode off there is
19
- * no session folder and no logs, and the files go to `<project>/.contentful/`.
20
- *
21
- * Names that are only known when a session or an import starts are shown as patterns, never guessed.
22
- */
23
- export declare function describeFileLocations({ contentfulBaseDir, debugModeEnabled, currentSessionDir, }: FileLocationInput): FileLocations;
@@ -1,13 +0,0 @@
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, }: {
9
- name: AgentName;
10
- config: AgentConfig;
11
- setConfig: (config: AgentConfig) => void;
12
- onBack: () => void;
13
- }): React.ReactElement;
@@ -1,11 +0,0 @@
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;
@@ -1,10 +0,0 @@
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;
@@ -1,80 +0,0 @@
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
- /**
17
- * The binary the import will actually run for this agent: the saved path if there is one, otherwise the built-in
18
- * command name. Shown in the form so the user sees what is used when the field is empty.
19
- */
20
- export declare function effectiveBinary(name: AgentName, savedBinary: string): string;
21
- /** The model the agent runs with when none is saved ("haiku", "gpt-mini", or the agent's own pick), for the model row. */
22
- export declare function defaultModelLabel(name: AgentName): string;
23
- /**
24
- * Steps 1 to 3 against `binary`. Never throws and never spends tokens, so it is safe to run for every row on open.
25
- * Checks the path the user typed, not what is saved, so the form can test a value before it is written.
26
- */
27
- export declare function inspectAgent(name: AgentName, binary: string): Promise<AgentCheck[]>;
28
- /** Steps 1 to 4. The prompt step is the only way to verify login and model name for agents other than claude. */
29
- export declare function testAgent(name: AgentName, binary: string, model: string): Promise<AgentCheck[]>;
30
- /** Collapses a list of checks into the status shown on the row. */
31
- export declare function statusFromChecks(name: AgentName, checks: readonly AgentCheck[], savedBinary: string): AgentStatus;
32
- /**
33
- * What to tell a user whose agent is not ready: the install command, or the login command. Empty when nothing is needed.
34
- * Shown on the list's panel and on the agent's own screen, so it cannot say where the command path is ("below"): it
35
- * names the settings instead, which is the same place from both.
36
- */
37
- export declare function setupHint(name: AgentName, status: AgentStatus): string;
38
- export type StatusRow = {
39
- label: string;
40
- value: string;
41
- tone: 'ok' | 'bad' | 'muted';
42
- };
43
- /**
44
- * 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
45
- * alone are not a test), so the banner only appears after the user asked for one.
46
- */
47
- export declare function testOutcome(checks: readonly AgentCheck[] | undefined): {
48
- ok: boolean;
49
- text: string;
50
- } | undefined;
51
- /**
52
- * The short form of a status for the list, where every row has to be scannable at a glance. The wording is plainer than
53
- * the detail panel's: "not installed" covers both "nothing saved" and "saved path broken", which the panel tells apart.
54
- */
55
- export declare const LIST_STATUS: Record<AgentStatus, {
56
- symbol: string;
57
- text: string;
58
- tone: StatusRow['tone'];
59
- }>;
60
- /**
61
- * The model line for the detail panel: what is saved, or what the agent really runs with when nothing is. Says which of
62
- * the two it is, so a user can tell their own choice from the built-in default.
63
- */
64
- export declare function modelLine(name: AgentName, savedModel: string): string;
65
- /**
66
- * The rows of the detail panel under the list, for the focused agent. Everything here is read-only and comes from
67
- * checks already collected, so moving the cursor never runs anything.
68
- */
69
- export declare function panelRows(name: AgentName, checks: readonly AgentCheck[] | undefined, settings: {
70
- binary: string;
71
- model: string;
72
- }): StatusRow[];
73
- /** The resolved path of the command, when the checks found it. For the list, where the user wants to see what runs. */
74
- export declare function resolvedPath(checks: readonly AgentCheck[] | undefined): string;
75
- /**
76
- * What the Status section of an agent's screen shows, one row per thing that was checked. The login row is always
77
- * there once the command is found, because for most agents it has to say that login cannot be checked without a test.
78
- */
79
- export declare function statusRows(_name: AgentName, checks: readonly AgentCheck[] | undefined, savedBinary: string): StatusRow[];
80
- export {};
@@ -1,17 +0,0 @@
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. */
10
- defaultAgent: AgentName;
11
- agents: Record<AgentName, AgentSettings>;
12
- };
13
- export declare const AGENT_LABELS: Record<AgentName, string>;
14
- export declare const AGENT_HINTS: Record<AgentName, string>;
15
- export declare function emptyAgents(): Record<AgentName, AgentSettings>;
16
- export declare function readAgentConfig(): Promise<AgentConfig>;
17
- export declare function writeAgentConfig(config: AgentConfig): Promise<void>;
@@ -1,13 +0,0 @@
1
- import type { AgentConfig } from './agent-store.js';
2
- /**
3
- * The pipeline picks an agent's binary from `EDS_AGENT_BINARY_<AGENT>` and nowhere else. This copies each saved
4
- * `agents.<name>.binary` into that variable, so the saved path reaches every place that spawns an agent (the import,
5
- * the generation package and the legacy commands) without touching their call sites.
6
- *
7
- * Called once at startup, and again after Settings saves a binary so a change applies without a restart.
8
- *
9
- * Settings wins over a variable already in the shell, so a forgotten `EDS_AGENT_BINARY_CLAUDE` cannot silently override
10
- * what the user sees on screen. An agent with no saved path leaves the shell's variable alone, and clearing a path
11
- * puts the shell's value back.
12
- */
13
- export declare function applyBinaryOverrides(config: AgentConfig): void;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- /** The Contentful project settings: the space, credentials, defaults and where `.contentful` goes. */
3
- export declare function ProjectConfigScreen({ onDone }: {
4
- onDone: () => void;
5
- }): React.ReactElement;
@@ -1,35 +0,0 @@
1
- import React from 'react';
2
- export interface FormField<K extends string> {
3
- key: K;
4
- label: string;
5
- /** A short note shown dimmed after the value, so the label column stays narrow. */
6
- hint?: string;
7
- /** Shows dots instead of the value, for secrets. */
8
- masked?: boolean;
9
- }
10
- export type FormNotice = {
11
- kind: 'success' | 'error';
12
- text: string;
13
- };
14
- interface FieldFormProps<K extends string> {
15
- title: string;
16
- /** What this form is for, shown dimmed under the title. */
17
- subtitle?: string;
18
- fields: readonly FormField<K>[];
19
- values: Record<K, string>;
20
- onChange: (key: K, value: string) => void;
21
- onSave: () => void;
22
- /** Leaves without saving. */
23
- onQuit: () => void;
24
- notice?: FormNotice | null;
25
- /** Ignores keys while a load or save is in flight. */
26
- busy?: boolean;
27
- /** Shown above the controls, for a screen's own explanation. */
28
- footer?: React.ReactNode;
29
- }
30
- /**
31
- * The edit-in-place form the Configuration pages share. Fields are read-only until Enter opens one; Enter again closes it.
32
- * While one is open, keys type into it (so a "q" in a path is just a "q"), and Esc closes it and restores the old value.
33
- */
34
- export declare function FieldForm<K extends string>({ title, subtitle, fields, values, onChange, onSave, onQuit, notice, busy, footer, }: FieldFormProps<K>): React.ReactElement;
35
- export {};
package/legacy/bin/cli.js DELETED
@@ -1,58 +0,0 @@
1
- #!/usr/bin/env node
2
- // Suppress the SQLite ExperimentalWarning before any modules load.
3
- // Must use dynamic import so this handler registers before sqlite is imported.
4
- process.removeAllListeners("warning");
5
- process.on("warning", (w) => {
6
- if (w.name === "ExperimentalWarning" && w.message.includes("SQLite")) return;
7
- process.stderr.write(`${w.name}: ${w.message}\n`);
8
- });
9
-
10
- // Auto-rebuild when running from source (dev mode only).
11
- // Skipped when src/ doesn't exist (e.g. npm-installed users).
12
- import { existsSync, statSync, readdirSync } from "node:fs";
13
- import { execFileSync } from "node:child_process";
14
- import { fileURLToPath } from "node:url";
15
- import { dirname, resolve, join } from "node:path";
16
-
17
- function newestMtime(dir, depth = 0) {
18
- if (depth > 10) return 0;
19
- let max = 0;
20
- for (const entry of readdirSync(dir, { withFileTypes: true })) {
21
- if (entry.isSymbolicLink()) continue;
22
- const full = join(dir, entry.name);
23
- if (entry.isDirectory()) {
24
- max = Math.max(max, newestMtime(full, depth + 1));
25
- } else if (entry.name.endsWith(".ts") || entry.name.endsWith(".tsx")) {
26
- max = Math.max(max, statSync(full).mtimeMs);
27
- }
28
- }
29
- return max;
30
- }
31
-
32
- const __dirname = dirname(fileURLToPath(import.meta.url));
33
- const pkgRoot = resolve(__dirname, "..");
34
- const srcDir = join(pkgRoot, "src");
35
- const distEntry = join(pkgRoot, "dist", "src", "index.js");
36
-
37
- if (
38
- existsSync(srcDir) &&
39
- existsSync(distEntry) &&
40
- process.env.NODE_ENV !== "test"
41
- ) {
42
- const distMtime = statSync(distEntry).mtimeMs;
43
- if (newestMtime(srcDir) > distMtime) {
44
- process.stderr.write("⚙ Source changed — rebuilding...\n");
45
- const tsc = join(pkgRoot, "node_modules", ".bin", "tsc");
46
- try {
47
- execFileSync(tsc, ["-p", join(pkgRoot, "tsconfig.build.json")], {
48
- stdio: ["ignore", "ignore", "inherit"],
49
- cwd: pkgRoot,
50
- });
51
- process.stderr.write("✓ Build complete\n");
52
- } catch {
53
- process.stderr.write("✗ Build failed — running with existing dist\n");
54
- }
55
- }
56
- }
57
-
58
- await import("../dist/src/index.js");
@@ -1,76 +0,0 @@
1
- {
2
- "name": "@contentful/experience-design-system-cli-legacy",
3
- "version": "2.35.0",
4
- "description": "Legacy Contentful Experiences import CLI (internal, not published; used by @contentful/experience-design-system-cli)",
5
- "license": "MIT",
6
- "private": true,
7
- "type": "module",
8
- "main": "./dist/src/index.js",
9
- "types": "./dist/src/index.d.ts",
10
- "exports": {
11
- ".": {
12
- "types": "./dist/src/index.d.ts",
13
- "import": "./dist/src/index.js",
14
- "node": "./dist/src/index.js"
15
- }
16
- },
17
- "files": [
18
- "bin/",
19
- "dist/",
20
- "prompts/",
21
- "skills/"
22
- ],
23
- "scripts": {
24
- "build": "nx build experience-design-system-cli-legacy",
25
- "typecheck": "nx typecheck experience-design-system-cli-legacy",
26
- "clean": "nx clean experience-design-system-cli-legacy",
27
- "test": "nx test experience-design-system-cli-legacy",
28
- "test:watch": "nx test:watch experience-design-system-cli-legacy",
29
- "lint": "nx lint experience-design-system-cli-legacy",
30
- "lint:fix": "nx lint:fix experience-design-system-cli-legacy"
31
- },
32
- "dependencies": {
33
- "@contentful/experience-design-system-backend-pipeline": "workspace:*",
34
- "@contentful/experience-design-system-types": "workspace:*",
35
- "@inkjs/ui": "^2.0.0",
36
- "@segment/analytics-node": "^3.0.0",
37
- "@vue/compiler-sfc": "^3.5.31",
38
- "ajv": "^8.17.1",
39
- "commander": "^13.1.0",
40
- "contentful-management": "^12.17.0",
41
- "figures": "6.1.0",
42
- "ink": "^5.2.1",
43
- "react": "^18.3.1",
44
- "react-devtools-core": "^4.19.1",
45
- "svelte": "^5.56.4",
46
- "ts-morph": "^27.0.2",
47
- "typescript": "^5.9.3",
48
- "zod": "^4.3.6"
49
- },
50
- "devDependencies": {
51
- "@contentful/experience-design-system-client": "workspace:*",
52
- "@contentful/experience-design-system-extraction": "workspace:*",
53
- "@contentful/experience-design-system-generation": "workspace:*",
54
- "@tsconfig/node24": "^24.0.4",
55
- "@types/node": "^24.0.3",
56
- "@types/react": "^18.3.24",
57
- "eslint": "^9.39.5",
58
- "eslint-config-prettier": "^10.1.8",
59
- "eslint-plugin-prettier": "^5.5.6",
60
- "ink-testing-library": "^4.0.0",
61
- "typescript-eslint": "^8.67.0",
62
- "vitest": "^4.0.16"
63
- },
64
- "repository": {
65
- "type": "git",
66
- "url": "git+https://github.com/contentful/experience-design-system-sdk-public.git",
67
- "directory": "packages/experience-design-system-cli-legacy"
68
- },
69
- "homepage": "https://github.com/contentful/experience-design-system-sdk-public#readme",
70
- "bugs": {
71
- "url": "https://github.com/contentful/experience-design-system-sdk-public/issues"
72
- },
73
- "engines": {
74
- "node": ">=24"
75
- }
76
- }
@@ -1,4 +0,0 @@
1
- import { type CommandFailure } from '@contentful/experience-design-system-backend-pipeline';
2
- import type { ApiError } from '../apply/api-client.js';
3
- export declare function exitWithAnalytics(code: number, fields?: CommandFailure): Promise<never>;
4
- export declare function failureFromApiError(error: ApiError): CommandFailure;
@@ -1,3 +0,0 @@
1
- export { bindAnalyticsSessionId, completeActiveCommand, emitSessionStarted, enrichCommandResult, failActiveCommand, flushAnalytics, isPipelineAnalyticsChild, noteCommandStart, recordApplyOutcome, recordContentfulContext, setCliVersion, setPersistedAnalyticsDisabled, } from '@contentful/experience-design-system-backend-pipeline';
2
- export type { CommandFailure } from '@contentful/experience-design-system-backend-pipeline';
3
- export { exitWithAnalytics, failureFromApiError } from './exit.js';
@@ -1,26 +0,0 @@
1
- export interface ComponentGraphNode {
2
- name: string;
3
- slots: Array<{
4
- name: string;
5
- allowedComponents?: string[];
6
- }>;
7
- }
8
- interface ClosureNode {
9
- name: string;
10
- depth: number;
11
- path: string[];
12
- parents: string[];
13
- }
14
- export interface Closure {
15
- root: string;
16
- nodes: ClosureNode[];
17
- containsCycle: boolean;
18
- cyclePath?: string[];
19
- }
20
- export type NodeStatus = 'ok' | 'warning' | 'error';
21
- export declare function findRoots(components: ComponentGraphNode[], selected?: Set<string>): string[];
22
- export declare function computeClosure(root: string, components: ComponentGraphNode[]): Closure;
23
- export declare function computeAllClosures(components: ComponentGraphNode[], selected?: Set<string>): Map<string, Closure>;
24
- export declare function aggregateStatus(closure: Closure, perNodeStatus: Map<string, NodeStatus>): NodeStatus;
25
- export declare function findSharedDeps(closures: Map<string, Closure>): Map<string, string[]>;
26
- export {};
@@ -1,22 +0,0 @@
1
- import type { RawComponentDefinition } from '../../types.js';
2
- import type { CompositionEdge } from './interchange-schema.js';
3
- export type ApplyMappingResult = {
4
- components: RawComponentDefinition[];
5
- warnings: string[];
6
- };
7
- /**
8
- * Enrichment pass (spec T7): merge a resolved composition edge list into the
9
- * extracted components' `allowedComponents`. Runs AFTER extraction; it is the
10
- * mapping resolver's entire job — populating the one field every downstream
11
- * graph consumer reads.
12
- *
13
- * Slot targeting:
14
- * - edge.slot present + slot exists → write there.
15
- * - edge.slot present + slot missing → synthesize for high-trust
16
- * (typed-slot / adapter) edges; drop-and-warn for `agent` edges.
17
- * - edge.slot absent → default slot (isDefault), synthesized if none exists.
18
- *
19
- * Edges naming unknown parents/children are dropped-and-warned (§1.3). Inputs
20
- * are not mutated; a deep-enough clone of touched slots is returned.
21
- */
22
- export declare function applyMapping(components: RawComponentDefinition[], edges: CompositionEdge[]): ApplyMappingResult;
@@ -1,34 +0,0 @@
1
- export declare const CANDIDATE_NAME_PATTERNS: RegExp[];
2
- export declare const CANDIDATE_CONTENT_MARKERS: string[];
3
- export declare const CANDIDATE_TOKEN_BUDGET = 6000;
4
- /**
5
- * Token ceiling for the candidate set INLINED into a single agent prompt.
6
- * Sized to stay under a 200k-context model once the agent's own system prompt
7
- * + tool definitions (~105k observed) are added, so a large design system
8
- * (hundreds of components → many matched files) can't overflow the request and
9
- * fail resolution. Files beyond the budget are dropped (with a warning), not
10
- * silently truncated. Distinct from `CANDIDATE_TOKEN_BUDGET`, which sizes the
11
- * unused per-batch chunking.
12
- */
13
- export declare const PROMPT_CANDIDATE_TOKEN_BUDGET = 80000;
14
- export type CandidateFile = {
15
- path: string;
16
- content: string;
17
- };
18
- export type SelectedCandidate = CandidateFile & {
19
- reason: string;
20
- };
21
- export declare function selectCandidateFiles(files: CandidateFile[]): SelectedCandidate[];
22
- /**
23
- * Cap a candidate set to what fits in a single agent prompt (see
24
- * `PROMPT_CANDIDATE_TOKEN_BUDGET`). Files are kept smallest-first so the budget
25
- * admits the most declarations; deterministic tie-break by path. Returns the
26
- * kept files plus the paths dropped so the caller can warn (silent truncation
27
- * would read as "resolved everything" when it didn't).
28
- */
29
- export declare function capCandidatesToPromptBudget<T extends CandidateFile>(files: T[], budget?: number): {
30
- kept: T[];
31
- dropped: T[];
32
- };
33
- export declare function sliceDeclarationRegions(content: string, markers?: string[], window?: number): string[];
34
- export declare function batchCandidates(files: CandidateFile[], budget?: number): CandidateFile[][];
@@ -1,18 +0,0 @@
1
- /**
2
- * Derive the `input_hash` for a composition-cache entry (stored in the pipeline
3
- * DB's `composition_cache` table). Content-addresses the candidate file set
4
- * (order-independent) plus the producing agent, so a re-run over unchanged
5
- * files reuses the (token-costly) agent output.
6
- *
7
- * Content-hashing — not mtime — means a no-op `git checkout` that only bumps
8
- * mtime is still a hit. Prompt/skill changes are handled by the `cli_version`
9
- * column on the row (see `getCliCacheVersion`), so no separate resolver-version
10
- * constant is needed here.
11
- */
12
- export declare function buildCompositionInputHash(input: {
13
- files: Array<{
14
- path: string;
15
- content: string;
16
- }>;
17
- agent: string;
18
- }): string;
@@ -1,17 +0,0 @@
1
- /**
2
- * The CLI-owned composition interchange format (spec T1).
3
- *
4
- * `CompositionEdge[]` is the flat internal runtime view, one edge per
5
- * parent→child relationship, carrying optional `slot` (T7), `confidence`,
6
- * and `provenance`. It is easier to merge and dedupe across sources (T2).
7
- */
8
- export type EdgeProvenance = 'typed-slot' | 'structural' | 'manifest' | 'doc' | `adapter:${string}` | 'agent';
9
- export type CompositionEdge = {
10
- parent: string;
11
- child: string;
12
- /** Optional named slot (T7). Default slot when omitted. */
13
- slot?: string;
14
- /** 1–5 scale, same as select/reject agent tools. */
15
- confidence?: number;
16
- provenance: EdgeProvenance;
17
- };
@@ -1,49 +0,0 @@
1
- import type { CompositionEdge } from './interchange-schema.js';
2
- type CandidateFile = {
3
- path: string;
4
- content: string;
5
- };
6
- type ComponentRef = {
7
- name: string;
8
- sourcePath?: string;
9
- };
10
- /**
11
- * Prompt-injection safeguard for this signal: both parsers below are plain
12
- * deterministic code, never an LLM prompt. `manifest.json`/`AGENTS.md`
13
- * content is attacker-adjacent (Figma-authored / free-form prose respectively)
14
- * but it only ever flows through JSON field access and a fixed regex, then is
15
- * validated against the real `componentNames` allowlist before an edge is
16
- * emitted — there is no path from this file's content to model instructions.
17
- */
18
- /** Figma/manifest names are kebab-case (`blue-accordion-item`); React exports are PascalCase. */
19
- export declare function kebabToPascal(name: string): string;
20
- /**
21
- * Deterministic parse of a Figma-exported `manifest.json` — no LLM involved.
22
- * Schema (confirmed against a real design-system manifest):
23
- * { component: { name: "blue-accordion" },
24
- * variantsMeta: { componentPropertyDefinitions: {
25
- * "Slot#1533:33": { type: "SLOT", preferredValues: [{ name: "blue-accordion-item" }] }
26
- * } } }
27
- * The manifest's own `component.name` identifies its owning/parent component
28
- * (more robust than inferring from directory proximity, since manifest.json
29
- * typically lives one level below the component's source file, e.g. in a
30
- * sibling `design/` directory).
31
- */
32
- export declare function collectManifestEdges(files: CandidateFile[], componentNames: ReadonlySet<string>): CompositionEdge[];
33
- /**
34
- * Deterministic parse of a component-level `AGENTS.md` — no LLM involved.
35
- * Only a bold-backtick component mention (`` **`ComponentName`** ``) on a
36
- * line that ALSO carries a composition keyword is accepted, e.g. "Direct
37
- * **`AccordionItem`** children only." A bare cross-reference mention (no
38
- * composition keyword on the same line, e.g. "see `other-component`") is
39
- * rejected — it isn't asserting a parent-child relationship.
40
- *
41
- * The doc's owning component is resolved by directory colocation: the
42
- * component whose `sourcePath` sits in the same directory as the doc file
43
- * (the real-world convention — `<component>/AGENTS.md` next to
44
- * `<component>/Component.tsx`).
45
- */
46
- export declare function collectAgentsDocEdges(files: CandidateFile[], components: ComponentRef[], componentNames: ReadonlySet<string>): CompositionEdge[];
47
- /** Both deterministic sources, combined for the `extraEdges` wiring in command.ts. */
48
- export declare function collectManifestDocEdges(files: CandidateFile[], components: ComponentRef[], componentNames: ReadonlySet<string>): CompositionEdge[];
49
- export {};
@@ -1,19 +0,0 @@
1
- import type { CompositionEdge, EdgeProvenance } from './interchange-schema.js';
2
- export type EdgeConflict = {
3
- parent: string;
4
- child: string;
5
- winner: EdgeProvenance;
6
- loser: EdgeProvenance;
7
- };
8
- export type MergeResult = {
9
- edges: CompositionEdge[];
10
- conflicts: EdgeConflict[];
11
- };
12
- /**
13
- * Union all edges, resolving conflicts by provenance rank. A conflict is two
14
- * edges that share `parent::child` but disagree on existence-detail (here:
15
- * slot placement). The higher-ranked edge wins; the loser is recorded (never
16
- * silently dropped) so the review UI can surface it. Identical edges (same
17
- * parent/child/slot) collapse to the highest-ranked copy with no conflict.
18
- */
19
- export declare function mergeEdges(all: CompositionEdge[]): MergeResult;
@@ -1,16 +0,0 @@
1
- import type { CompositionEdge } from './interchange-schema.js';
2
- /**
3
- * Lenient JSONL parser for the composition-mapping agent's tool-call output
4
- * (spec T4). Mirrors `parseSelectToolCallLines` / `parseToolCallLines` in
5
- * `@contentful/experience-design-system-generation`'s `agent-runner.ts`: one JSON object per line, each with a `tool`
6
- * field from a fixed allowlist. A line that fails JSON.parse or validation is
7
- * DROPPED into `warnings[]` (with a reason) and parsing CONTINUES — no retry,
8
- * no throw. Non-`{` prose and blank lines are skipped silently.
9
- */
10
- export type ParseMapEdgesResult = {
11
- edges: CompositionEdge[];
12
- warnings: string[];
13
- };
14
- export declare function parseMapEdges(raw: string, opts: {
15
- componentNames: Set<string>;
16
- }): ParseMapEdgesResult;
@@ -1,3 +0,0 @@
1
- /** Resolve a bundled composition prompt from the package-root prompts directory. */
2
- export declare function resolvePromptPath(fileName: string): string;
3
- export declare function loadPrompt(fileName: string): string;
@@ -1,10 +0,0 @@
1
- export type CompositionCliOptions = {
2
- /** `--composition-refresh` — force edge emission to run even over resolved residue. */
3
- compositionRefresh?: boolean;
4
- /** `--no-cache` — force the composition agent to rerun with the rest of the pipeline. */
5
- noCache?: boolean;
6
- };
7
- export type ResolvedCompositionSources = {
8
- forceAgent: boolean;
9
- };
10
- export declare function resolveCompositionSources(opts: CompositionCliOptions): ResolvedCompositionSources;