@contentful/experience-design-system-cli 2.37.1-dev-build-ef8b693f.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 (177) hide show
  1. package/dist/app.js +262 -261
  2. package/dist/index.js +394 -467
  3. package/dist/package.json +1 -1
  4. package/dist/src/tui/home/home.theme.d.ts +8 -0
  5. package/dist/src/tui/import/steps/07-scope-gate/sidebar/theme.d.ts +6 -6
  6. package/dist/src/tui/import/steps/09-review/theme.d.ts +9 -0
  7. package/{legacy/dist/src/analyze/select/tui → dist/src/tui/import/steps/10-flow}/theme.d.ts +2 -7
  8. package/package.json +3 -3
  9. package/dist/src/commands/forwarded.d.ts +0 -2
  10. package/dist/src/legacy/forwarded-import-args.d.ts +0 -1
  11. package/dist/src/legacy/legacy-cli-path.d.ts +0 -1
  12. package/dist/src/legacy/run-legacy.d.ts +0 -1
  13. package/dist/src/tui/theme.d.ts +0 -19
  14. package/legacy/bin/cli.js +0 -58
  15. package/legacy/dist/package.json +0 -76
  16. package/legacy/dist/src/analytics/exit.d.ts +0 -4
  17. package/legacy/dist/src/analytics/index.d.ts +0 -3
  18. package/legacy/dist/src/analyze/composite-closure.d.ts +0 -26
  19. package/legacy/dist/src/analyze/composition/apply-mapping.d.ts +0 -22
  20. package/legacy/dist/src/analyze/composition/candidate-files.d.ts +0 -34
  21. package/legacy/dist/src/analyze/composition/composition-cache-key.d.ts +0 -18
  22. package/legacy/dist/src/analyze/composition/interchange-schema.d.ts +0 -17
  23. package/legacy/dist/src/analyze/composition/manifest-doc-evidence.d.ts +0 -49
  24. package/legacy/dist/src/analyze/composition/merge-edges.d.ts +0 -19
  25. package/legacy/dist/src/analyze/composition/parse-map-edges.d.ts +0 -16
  26. package/legacy/dist/src/analyze/composition/prompt-loader.d.ts +0 -3
  27. package/legacy/dist/src/analyze/composition/resolve-mapping-cli.d.ts +0 -10
  28. package/legacy/dist/src/analyze/composition/resolve-mapping.d.ts +0 -59
  29. package/legacy/dist/src/analyze/cycle-detection.d.ts +0 -27
  30. package/legacy/dist/src/analyze/extract-command.d.ts +0 -7
  31. package/legacy/dist/src/analyze/fuzzy-search.d.ts +0 -3
  32. package/legacy/dist/src/analyze/issue-inheritance.d.ts +0 -8
  33. package/legacy/dist/src/analyze/lineage.d.ts +0 -29
  34. package/legacy/dist/src/analyze/search-neighborhood.d.ts +0 -3
  35. package/legacy/dist/src/analyze/select/command.d.ts +0 -27
  36. package/legacy/dist/src/analyze/select/parser.d.ts +0 -6
  37. package/legacy/dist/src/analyze/select/persistence.d.ts +0 -22
  38. package/legacy/dist/src/analyze/select/preview-annotations.d.ts +0 -26
  39. package/legacy/dist/src/analyze/select/tui/LegacySelectApp.d.ts +0 -8
  40. package/legacy/dist/src/analyze/select/tui/components/ComponentDetail.d.ts +0 -19
  41. package/legacy/dist/src/analyze/select/tui/components/ComponentRationalePanel.d.ts +0 -10
  42. package/legacy/dist/src/analyze/select/tui/components/FieldEditor.d.ts +0 -67
  43. package/legacy/dist/src/analyze/select/tui/components/FinalizeDialog.d.ts +0 -22
  44. package/legacy/dist/src/analyze/select/tui/components/GotoBanner.d.ts +0 -31
  45. package/legacy/dist/src/analyze/select/tui/components/GroupedSidebar.d.ts +0 -94
  46. package/legacy/dist/src/analyze/select/tui/components/HelpOverlay.d.ts +0 -21
  47. package/legacy/dist/src/analyze/select/tui/components/HighlightedLine.d.ts +0 -9
  48. package/legacy/dist/src/analyze/select/tui/components/JsonEditor.d.ts +0 -10
  49. package/legacy/dist/src/analyze/select/tui/components/JsonPanel.d.ts +0 -11
  50. package/legacy/dist/src/analyze/select/tui/components/PreviewSummaryBar.d.ts +0 -8
  51. package/legacy/dist/src/analyze/select/tui/components/QuitDialog.d.ts +0 -8
  52. package/legacy/dist/src/analyze/select/tui/components/RationaleLine.d.ts +0 -21
  53. package/legacy/dist/src/analyze/select/tui/components/RationalePanel.d.ts +0 -15
  54. package/legacy/dist/src/analyze/select/tui/components/ScrollablePanel.d.ts +0 -14
  55. package/legacy/dist/src/analyze/select/tui/components/Sidebar.d.ts +0 -29
  56. package/legacy/dist/src/analyze/select/tui/components/SourcePanel.d.ts +0 -11
  57. package/legacy/dist/src/analyze/select/tui/components/StatusBar.d.ts +0 -11
  58. package/legacy/dist/src/analyze/select/tui/components/TokenReviewPanel.d.ts +0 -30
  59. package/legacy/dist/src/analyze/select/tui/components/TopBar.d.ts +0 -10
  60. package/legacy/dist/src/analyze/select/tui/components/removed-components-text.d.ts +0 -7
  61. package/legacy/dist/src/analyze/select/tui/components/wrap-text.d.ts +0 -1
  62. package/legacy/dist/src/analyze/select/tui/hooks/list-scroll-input.d.ts +0 -13
  63. package/legacy/dist/src/analyze/select/tui/hooks/scroll-offset.d.ts +0 -30
  64. package/legacy/dist/src/analyze/select/tui/hooks/useImmediateInput.d.ts +0 -19
  65. package/legacy/dist/src/analyze/select/tui/hooks/useKeymap.d.ts +0 -24
  66. package/legacy/dist/src/analyze/select/tui/hooks/useSession.d.ts +0 -19
  67. package/legacy/dist/src/analyze/select/tui/hooks/useUndo.d.ts +0 -8
  68. package/legacy/dist/src/analyze/select/types.d.ts +0 -54
  69. package/legacy/dist/src/analyze/selection-cascade.d.ts +0 -3
  70. package/legacy/dist/src/analyze/slot-graph.d.ts +0 -11
  71. package/legacy/dist/src/apply/api-client.d.ts +0 -64
  72. package/legacy/dist/src/apply/command.d.ts +0 -43
  73. package/legacy/dist/src/apply/preview-utils.d.ts +0 -12
  74. package/legacy/dist/src/apply/tokens.d.ts +0 -1
  75. package/legacy/dist/src/apply/tui/ServerApplyView.d.ts +0 -34
  76. package/legacy/dist/src/apply/tui/ServerPreviewView.d.ts +0 -9
  77. package/legacy/dist/src/credentials-store.d.ts +0 -18
  78. package/legacy/dist/src/doctor/checks.d.ts +0 -5
  79. package/legacy/dist/src/doctor/command.d.ts +0 -2
  80. package/legacy/dist/src/doctor/report.d.ts +0 -7
  81. package/legacy/dist/src/generate/command.d.ts +0 -2
  82. package/legacy/dist/src/generate/tui/GenerateView.d.ts +0 -12
  83. package/legacy/dist/src/helpers/build-contentful-management-client.d.ts +0 -7
  84. package/legacy/dist/src/helpers/fetch-and-persist-existing-contentful-entities.d.ts +0 -29
  85. package/legacy/dist/src/helpers/fetch-existing-contentful-entities.d.ts +0 -11
  86. package/legacy/dist/src/helpers/find-nearly-matching-component.d.ts +0 -7
  87. package/legacy/dist/src/helpers/read-existing-contentful-entities-from-session.d.ts +0 -7
  88. package/legacy/dist/src/helpers/summarize-existing-contentful-entities.d.ts +0 -50
  89. package/legacy/dist/src/host-utils.d.ts +0 -3
  90. package/legacy/dist/src/index.d.ts +0 -1
  91. package/legacy/dist/src/index.js +0 -25165
  92. package/legacy/dist/src/lib/agent-definitions.d.ts +0 -14
  93. package/legacy/dist/src/lib/agent-model-options.d.ts +0 -15
  94. package/legacy/dist/src/lib/agent-output.d.ts +0 -5
  95. package/legacy/dist/src/lib/cli-errors.d.ts +0 -2
  96. package/legacy/dist/src/lib/cli-path.d.ts +0 -4
  97. package/legacy/dist/src/lib/command-options.d.ts +0 -3
  98. package/legacy/dist/src/lib/component-patch.d.ts +0 -12
  99. package/legacy/dist/src/lib/contentful-urls.d.ts +0 -15
  100. package/legacy/dist/src/lib/debug-logger.d.ts +0 -39
  101. package/legacy/dist/src/lib/debug-preamble.d.ts +0 -7
  102. package/legacy/dist/src/lib/error-parser.d.ts +0 -40
  103. package/legacy/dist/src/lib/path-exists.d.ts +0 -1
  104. package/legacy/dist/src/lib/prompt-overrides.d.ts +0 -38
  105. package/legacy/dist/src/lib/terminal-capabilities.d.ts +0 -29
  106. package/legacy/dist/src/lib/user-agent.d.ts +0 -7
  107. package/legacy/dist/src/map-tokens/apply.d.ts +0 -12
  108. package/legacy/dist/src/map-tokens/command.d.ts +0 -2
  109. package/legacy/dist/src/map-tokens/resolve-defaults.d.ts +0 -32
  110. package/legacy/dist/src/map-tokens/tui/MapTokensView.d.ts +0 -13
  111. package/legacy/dist/src/output/format.d.ts +0 -23
  112. package/legacy/dist/src/print/command.d.ts +0 -11
  113. package/legacy/dist/src/print/validate/tui/ValidateView.d.ts +0 -15
  114. package/legacy/dist/src/print/validate/validators/cdf-validator.d.ts +0 -2
  115. package/legacy/dist/src/print/validate/validators/dtcg-validator.d.ts +0 -2
  116. package/legacy/dist/src/print/validate/validators/format-errors.d.ts +0 -12
  117. package/legacy/dist/src/print/validate/validators/read-json-file.d.ts +0 -10
  118. package/legacy/dist/src/program.d.ts +0 -25
  119. package/legacy/dist/src/runs/fingerprint.d.ts +0 -36
  120. package/legacy/dist/src/runs/save-path-resolver.d.ts +0 -11
  121. package/legacy/dist/src/runs/store.d.ts +0 -65
  122. package/legacy/dist/src/session/cache-keys.d.ts +0 -22
  123. package/legacy/dist/src/session/core/cdf/cdf-mappers.d.ts +0 -3
  124. package/legacy/dist/src/session/core/components/derive-component-id.d.ts +0 -1
  125. package/legacy/dist/src/session/core/components/hash-component-shape.d.ts +0 -5
  126. package/legacy/dist/src/session/core/shared/index-rows-by-key.d.ts +0 -1
  127. package/legacy/dist/src/session/core/tokens/build-dtcg-groups.d.ts +0 -12
  128. package/legacy/dist/src/session/core/tokens/build-dtcg-tokens.d.ts +0 -3
  129. package/legacy/dist/src/session/core/tokens/hash-token-content.d.ts +0 -1
  130. package/legacy/dist/src/session/db.d.ts +0 -200
  131. package/legacy/dist/src/session/migration.d.ts +0 -2
  132. package/legacy/dist/src/session/repositories/sessions/read.d.ts +0 -11
  133. package/legacy/dist/src/session/repositories/sessions/write.d.ts +0 -3
  134. package/legacy/dist/src/session/repositories/shared/with-transaction.d.ts +0 -2
  135. package/legacy/dist/src/session/repositories/steps/read.d.ts +0 -2
  136. package/legacy/dist/src/session/repositories/steps/write.d.ts +0 -5
  137. package/legacy/dist/src/session/repositories/tokens/read.d.ts +0 -15
  138. package/legacy/dist/src/session/repositories/tokens/write.d.ts +0 -16
  139. package/legacy/dist/src/session/resolve-session-id.d.ts +0 -1
  140. package/legacy/dist/src/session/services/session-resolver.d.ts +0 -9
  141. package/legacy/dist/src/session/services/tokens/apply-tool-calls.d.ts +0 -8
  142. package/legacy/dist/src/session/services/tokens/replace-raw-prop-token-paths.d.ts +0 -3
  143. package/legacy/dist/src/session/services/tokens/replace-raw-token-name-paths.d.ts +0 -3
  144. package/legacy/dist/src/session/services/tokens/store-dtcg-tokens.d.ts +0 -3
  145. package/legacy/dist/src/session/session-id.d.ts +0 -1
  146. package/legacy/dist/src/session/source-excerpt.d.ts +0 -26
  147. package/legacy/dist/src/setup/SetupScreen.d.ts +0 -28
  148. package/legacy/dist/src/setup/SetupStepper.d.ts +0 -7
  149. package/legacy/dist/src/setup/command.d.ts +0 -3
  150. package/legacy/dist/src/setup/lib/checks.d.ts +0 -57
  151. package/legacy/dist/src/setup/lib/shell.d.ts +0 -12
  152. package/legacy/dist/src/setup/steps/CodingAgentScreen.d.ts +0 -20
  153. package/legacy/dist/src/setup/steps/ContentfulCredentialsScreen.d.ts +0 -11
  154. package/legacy/dist/src/setup/steps/StepLayout.d.ts +0 -20
  155. package/legacy/dist/src/setup/steps/preferences/AnalyticsScreen.d.ts +0 -5
  156. package/legacy/dist/src/setup/steps/preferences/BooleanInput.d.ts +0 -21
  157. package/legacy/dist/src/setup/steps/preferences/ColorPreferenceScreen.d.ts +0 -5
  158. package/legacy/dist/src/setup/steps/preferences/CustomPromptScreen.d.ts +0 -14
  159. package/legacy/dist/src/setup/steps/preferences/DebugLogsScreen.d.ts +0 -5
  160. package/legacy/dist/src/setup/steps/preferences/PreferencesMenu.d.ts +0 -26
  161. package/legacy/dist/src/setup/steps/prerequisites/PrerequisitesScreen.d.ts +0 -16
  162. package/legacy/dist/src/setup/steps/prerequisites/build.d.ts +0 -2
  163. package/legacy/dist/src/setup/steps/prerequisites/deps.d.ts +0 -33
  164. package/legacy/dist/src/setup/steps/prerequisites/index.d.ts +0 -4
  165. package/legacy/dist/src/setup/steps/prerequisites/node.d.ts +0 -2
  166. package/legacy/dist/src/setup/steps/prerequisites/pnpm.d.ts +0 -2
  167. package/legacy/dist/src/tui/CommandCompletionView.d.ts +0 -13
  168. package/legacy/dist/src/tui/render-with-goodbye.d.ts +0 -7
  169. package/legacy/dist/src/tui/use-terminal-size.d.ts +0 -6
  170. package/legacy/dist/src/tui/windowed-panel.d.ts +0 -37
  171. package/legacy/dist/src/types.d.ts +0 -2
  172. package/legacy/package.json +0 -85
  173. package/legacy/prompts/composition-edges.md +0 -11
  174. package/legacy/skills/generate-components.md +0 -612
  175. package/legacy/skills/generate-tokens.md +0 -194
  176. package/legacy/skills/map-tokens.md +0 -102
  177. package/legacy/skills/select-components.md +0 -235
@@ -1,14 +0,0 @@
1
- import type { AgentName } from '@contentful/experience-design-system-generation';
2
- export interface AgentDefinition {
3
- name: string;
4
- binary: AgentName;
5
- /** The npm package that installs this agent, so callers never spell it out again. */
6
- packageName: string;
7
- installSuffix?: string;
8
- /** Whether `experiences setup` offers to install it. Copilot is detect-only. */
9
- installable: boolean;
10
- }
11
- export declare const AGENT_DEFS: readonly AgentDefinition[];
12
- export declare function installCommand(agent: AgentDefinition): string;
13
- export declare function installHint(agent: AgentDefinition): string;
14
- export declare const INSTALLABLE_AGENTS: AgentDefinition[];
@@ -1,15 +0,0 @@
1
- import type { Command } from 'commander';
2
- export declare const AGENT_DESCRIPTION: string;
3
- export declare const MODEL_DESCRIPTION = "Model to use (defaults to a lightweight per-agent model; override with EDS_AGENT_MODEL_<AGENT>)";
4
- export interface AgentModelOptionsConfig {
5
- agentDescription?: string;
6
- includeModel?: boolean;
7
- includeBedrock?: boolean;
8
- modelDescription?: string;
9
- }
10
- /**
11
- * Register --agent plus optional --model and --bedrock flags with a Commander
12
- * command. The optional flags can be omitted for commands with a narrower
13
- * public surface.
14
- */
15
- export declare function addAgentModelOptions(cmd: Command, config?: AgentModelOptionsConfig): Command;
@@ -1,5 +0,0 @@
1
- import type { AgentInvoker, InvokeAgentOptions } from '@contentful/experience-design-system-generation';
2
- export declare function invokeAgentWithOutput(invoker: AgentInvoker, options: Omit<InvokeAgentOptions, 'onOutput'>, verbose: boolean): Promise<{
3
- result: Awaited<ReturnType<AgentInvoker['invoke']>>;
4
- output: string;
5
- }>;
@@ -1,2 +0,0 @@
1
- export declare function die(message: string): never;
2
- export declare function assertBinaryInPath(binary: string): Promise<boolean>;
@@ -1,4 +0,0 @@
1
- /** Path to `<pkg>/bin/cli.js`. Walks up rather than hardcoding depth, so it survives src/dist/bundled layout changes. */
2
- export declare function findCliPath(): string;
3
- /** Package root (contains bin/, dist/, package.json). Derived from findCliPath's anchor. */
4
- export declare function findPkgRoot(): string;
@@ -1,3 +0,0 @@
1
- import type { Command } from 'commander';
2
- export declare function addArtifactInputOptions(cmd: Command): Command;
3
- export declare function addContentfulTargetOptions(cmd: Command): Command;
@@ -1,12 +0,0 @@
1
- export type ComponentPatchOperation = {
2
- component: string;
3
- status?: string;
4
- set?: Record<string, unknown>;
5
- };
6
- export declare function applyDotPath(obj: Record<string, unknown>, path: string, value: unknown): void;
7
- export declare function applyComponentPatch<T extends {
8
- name: string;
9
- }>(components: T[], operations: ComponentPatchOperation[], applySet: (component: T, values: Record<string, unknown>) => T): T[];
10
- export declare function warnOnUnknownPatchComponents<T extends {
11
- name: string;
12
- }>(components: T[], operations: ComponentPatchOperation[]): void;
@@ -1,15 +0,0 @@
1
- /**
2
- * Shared Contentful webapp URL builders.
3
- *
4
- * This module centralizes the formatter so the wizard and `apply` emit
5
- * the same URL shape.
6
- */
7
- type PostPushView = 'components' | 'design_tokens';
8
- export interface BuildPostPushUrlInput {
9
- host: string;
10
- spaceId: string;
11
- environmentId: string;
12
- view?: PostPushView;
13
- }
14
- export declare function buildPostPushUrl({ host, spaceId, environmentId, view }: BuildPostPushUrlInput): string;
15
- export {};
@@ -1,39 +0,0 @@
1
- export type DebugCategory = 'config' | 'agent' | 'apply' | 'import' | 'analyze' | 'filter' | 'session' | 'runs' | 'tui' | 'wizard' | 'setup' | 'output' | 'other';
2
- export interface DebugLogger {
3
- readonly enabled: boolean;
4
- readonly path: string | null;
5
- event(category: DebugCategory, name: string, payload?: Record<string, unknown>): void;
6
- }
7
- export declare function redactForDebug(payload: unknown): unknown;
8
- export interface InitDebugLoggerOptions {
9
- /** Effective on/off decision (flag > env > config, resolved by caller). */
10
- enabled: boolean;
11
- /** Command name — recorded in the session-open event for filtering. */
12
- command?: string;
13
- /** Override log root (defaults to ~/.contentful/experience-design-system-cli/debug/). */
14
- root?: string;
15
- }
16
- /**
17
- * Initialize the process-wide debug logger. Safe to call multiple times —
18
- * subsequent calls return the existing instance.
19
- *
20
- * If EDSI_DEBUG_LOG is already set in the environment, this process joins
21
- * that log file (used by spawned subprocesses so a whole `experiences import`
22
- * flow lands in a single file).
23
- */
24
- export declare function initDebugLogger(opts: InitDebugLoggerOptions): DebugLogger;
25
- export declare function getDebugLogger(): DebugLogger;
26
- /** Test-only: reset the singleton. */
27
- export declare function __resetDebugLoggerForTest(): void;
28
- /** Resolve debug mode from an explicit option, environment, or saved settings. */
29
- export declare function resolveDebugMode(opts: {
30
- debug?: boolean;
31
- }, configDebug?: boolean): boolean;
32
- /**
33
- * Emit the bright-green "debug logs at <path>" banner to stderr.
34
- * No-op when debug is disabled or stderr is not a TTY-friendly stream.
35
- * Callers should invoke this once at start and once at end of the command.
36
- */
37
- export declare function printDebugBanner(logger: DebugLogger, phase: 'start' | 'end'): void;
38
- /** Directory that contains the current process's debug log, if any. */
39
- export declare function debugLogPath(): string | null;
@@ -1,7 +0,0 @@
1
- import { type DebugLogger } from './debug-logger.js';
2
- /**
3
- * Resolve and initialize the debug logger before a top-level command runs.
4
- */
5
- export declare function beginCommand(command: string, opts: {
6
- debug?: boolean;
7
- }): Promise<DebugLogger>;
@@ -1,40 +0,0 @@
1
- export interface ParsedEdsiError {
2
- /** Server-side error code, if we could extract one. */
3
- code: string | null;
4
- /** Human-readable message, stripped of log/trace decoration. */
5
- message: string;
6
- /** Cycle participants, when `code === 'TopoSortCycleError'`. */
7
- cycle: string[] | null;
8
- /** True when the message survived cleaning as-is (no parseable structure). */
9
- raw: boolean;
10
- /** Validation details supplied by the API, normalized for terminal output. */
11
- diagnostics?: ErrorDiagnostic[];
12
- }
13
- interface ErrorDiagnostic {
14
- message: string;
15
- component?: string;
16
- /**
17
- * A null path means that the API supplied a location but it contained no
18
- * usable segments. An undefined path means the API did not provide one.
19
- */
20
- path?: string | null;
21
- /** The API field that supplied the diagnostic message, for verbose output. */
22
- messageSource?: 'message' | 'details' | 'error' | 'name';
23
- }
24
- export interface ApiErrorLike {
25
- body?: string;
26
- guidance?: string;
27
- message: string;
28
- }
29
- export declare function stripLambdaLogPrefix(body: string): string;
30
- export declare function parseEdsiError(rawInput: string | undefined | null): ParsedEdsiError;
31
- export declare function formatParsedEdsiError(parsed: ParsedEdsiError, opts?: {
32
- verbose?: boolean;
33
- raw?: string;
34
- }): string;
35
- export declare function formatEdsiError(raw: unknown, opts?: {
36
- verbose?: boolean;
37
- raw?: string;
38
- }): string;
39
- export declare function formatApiError(error: ApiErrorLike, verbose?: boolean): string;
40
- export {};
@@ -1 +0,0 @@
1
- export declare function pathExists(path: string): Promise<boolean>;
@@ -1,38 +0,0 @@
1
- /**
2
- * Generic `--prompt <stage>=<value>` override parser.
3
- *
4
- * One repeatable flag overrides the prompt for any named pipeline stage
5
- * (e.g. `composition`, `select`, `generate`). The value is classified by
6
- * string SHAPE only — no filesystem access here: a value that looks like a
7
- * path is resolved+read by the consumer; otherwise it is treated as the
8
- * literal prompt text. This keeps the parser pure and testable.
9
- */
10
- export type PromptOverride = {
11
- kind: 'path';
12
- value: string;
13
- } | {
14
- kind: 'text';
15
- value: string;
16
- };
17
- /**
18
- * Heuristic: does this value look like a file path (vs. literal prompt text)?
19
- * Path if it contains a path separator, starts with `~`, or ends with a known
20
- * prompt-file extension. Deliberately does NOT touch the filesystem.
21
- */
22
- export declare function looksLikePath(value: string): boolean;
23
- export type ParsePromptOverridesResult = {
24
- overrides: Map<string, PromptOverride>;
25
- errors: string[];
26
- };
27
- /**
28
- * Parse repeated `stage=value` flag inputs into a stage→override map. Splits on
29
- * the FIRST `=` so values may contain `=`. Last write wins for a repeated
30
- * stage. Malformed entries are collected in `errors` (caller decides fatality).
31
- */
32
- export declare function parsePromptOverrides(inputs: string[]): ParsePromptOverridesResult;
33
- /**
34
- * Resolve an override to its prompt text: read the file for a `path` override
35
- * (resolved against cwd), or return the literal `text` value. Throws with a
36
- * clear message if a path override can't be read.
37
- */
38
- export declare function resolvePromptOverride(override: PromptOverride): Promise<string>;
@@ -1,29 +0,0 @@
1
- type TerminalInput = {
2
- isTTY?: boolean;
3
- isRaw?: boolean;
4
- setRawMode?: (enabled: boolean) => unknown;
5
- };
6
- type TerminalOutput = {
7
- isTTY?: boolean;
8
- };
9
- export type InteractiveTerminalSupport = {
10
- supported: true;
11
- } | {
12
- supported: false;
13
- reason: 'input-not-tty' | 'output-not-tty' | 'raw-mode-unavailable';
14
- };
15
- export type TerminalCapabilityOptions = {
16
- stdin?: TerminalInput;
17
- stdout?: TerminalOutput;
18
- };
19
- /**
20
- * Check the capabilities Ink's interactive input hooks require before the UI
21
- * mounts. A stream can report itself as a TTY while its terminal host still
22
- * rejects raw mode, so the check briefly enables and restores raw mode.
23
- */
24
- export declare function getInteractiveTerminalSupport(options?: TerminalCapabilityOptions): InteractiveTerminalSupport;
25
- export type RequireInteractiveTerminalOptions = TerminalCapabilityOptions & {
26
- alternative?: string;
27
- };
28
- export declare function requireInteractiveTerminal(options?: RequireInteractiveTerminalOptions): void;
29
- export {};
@@ -1,7 +0,0 @@
1
- /**
2
- * X-Contentful-User-Agent for the CLI's CMA requests, so writes are
3
- * attributable to the DSI CLI as their origin. Format follows CEP-0056:
4
- * `app <name>/<ver>; platform node.js/<ver>; os <name>/<ver>;`. Carries only
5
- * the app/platform/os segments — no user- or content-identifying data.
6
- */
7
- export declare function buildUserAgent(version?: string): string;
@@ -1,12 +0,0 @@
1
- import type { DatabaseSync } from 'node:sqlite';
2
- import type { MapTokenPropCall } from '@contentful/experience-design-system-generation';
3
- export interface ApplyMapTokenPropCallsResult {
4
- applied: number;
5
- warnings: string[];
6
- }
7
- /**
8
- * Applies parsed `map_token_prop` calls to the session database. Each call is
9
- * validated against session state — unlike parseMapTokenPropToolCallLines,
10
- * which only checks the call's own shape — before any write happens.
11
- */
12
- export declare function applyMapTokenPropCalls(db: DatabaseSync, sessionId: string, calls: MapTokenPropCall[], incomingWarnings: string[]): ApplyMapTokenPropCallsResult;
@@ -1,2 +0,0 @@
1
- import type { Command } from 'commander';
2
- export declare function registerMapTokensCommand(program: Command): void;
@@ -1,32 +0,0 @@
1
- /** A token default extracted from a design-category token property. */
2
- export interface RawDesignTokenDefault {
3
- /** The source default, retained verbatim for persistence and review. */
4
- rawDefault: string;
5
- /** The property's expected DTCG token type. */
6
- tokenKind: string | null;
7
- }
8
- /** The path and type of one DTCG token leaf. Values are intentionally absent. */
9
- export interface DTCGTokenLeaf {
10
- path: string;
11
- type: string;
12
- }
13
- type UnresolvedTokenDefaultReason = 'no_match' | 'ambiguous' | 'type_mismatch';
14
- interface UnresolvedTokenDefault {
15
- rawDefault: string;
16
- tokenKind: string | null;
17
- reason: UnresolvedTokenDefaultReason;
18
- candidatePaths: string[];
19
- message: string;
20
- }
21
- export interface ResolveTokenDefaultsResult {
22
- /** Exact source defaults mapped to their one compatible DTCG path. */
23
- mappings: Record<string, string>;
24
- diagnostics: UnresolvedTokenDefault[];
25
- }
26
- /**
27
- * Resolves extracted source defaults without inspecting token values or changing
28
- * the source defaults. A normalised leaf-key match is accepted only when it
29
- * identifies exactly one leaf compatible with the property's token kind.
30
- */
31
- export declare function resolveTokenDefaults(defaults: readonly RawDesignTokenDefault[], leaves: readonly DTCGTokenLeaf[]): ResolveTokenDefaultsResult;
32
- export {};
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- export interface MapTokensViewResult {
3
- agent: string;
4
- sessionId: string;
5
- applied: number;
6
- cached: boolean;
7
- }
8
- interface MapTokensViewProps {
9
- result: MapTokensViewResult;
10
- onExit: () => void;
11
- }
12
- export declare function MapTokensView({ result, onExit }: MapTokensViewProps): React.ReactElement;
13
- export {};
@@ -1,23 +0,0 @@
1
- export declare const c: {
2
- green: (s: string) => string;
3
- red: (s: string) => string;
4
- cyan: (s: string) => string;
5
- yellow: (s: string) => string;
6
- dim: (s: string) => string;
7
- bold: (s: string) => string;
8
- };
9
- /**
10
- * Processes streaming agent output line by line.
11
- *
12
- * Tool-call JSON lines are translated into human-readable summaries.
13
- * Prose (reasoning text) is shown only when verbose=true.
14
- */
15
- export declare class OutputFormatter {
16
- private _buf;
17
- private _verbose;
18
- private _write;
19
- constructor(verbose: boolean, write?: (s: string) => void);
20
- push(chunk: string): void;
21
- flush(): void;
22
- private _processLine;
23
- }
@@ -1,11 +0,0 @@
1
- import type { Command } from 'commander';
2
- export declare function rebuildDTCGTree(groups: Array<{
3
- path: string;
4
- $description?: string;
5
- }>, tokens: Array<{
6
- path: string;
7
- $type: string;
8
- $value: unknown;
9
- $description?: string;
10
- }>): Record<string, unknown>;
11
- export declare function registerPrintCommand(program: Command): void;
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import type { ValidationDiagnostic } from '../validators/format-errors.js';
3
- export type ValidateViewEntry = {
4
- filePath: string;
5
- format: 'CDF v1' | 'DTCG';
6
- valid: boolean;
7
- summary?: string;
8
- diagnostics: ValidationDiagnostic[];
9
- };
10
- type ValidateViewProps = {
11
- results: ValidateViewEntry[];
12
- onExit: () => void;
13
- };
14
- export declare function ValidateView({ results, onExit }: ValidateViewProps): React.ReactElement;
15
- export {};
@@ -1,2 +0,0 @@
1
- import type { ValidationResult } from './format-errors.js';
2
- export declare function validateCDFFile(filePath: string): Promise<ValidationResult>;
@@ -1,2 +0,0 @@
1
- import type { ValidationResult } from './format-errors.js';
2
- export declare function validateDTCGTokenFile(filePath: string): Promise<ValidationResult>;
@@ -1,12 +0,0 @@
1
- export interface ValidationDiagnostic {
2
- path: string;
3
- message: string;
4
- expected?: string;
5
- actual?: string;
6
- }
7
- export interface ValidationResult {
8
- valid: boolean;
9
- summary: string;
10
- diagnostics: ValidationDiagnostic[];
11
- }
12
- export declare function formatDiagnostics(result: ValidationResult): string;
@@ -1,10 +0,0 @@
1
- import type { ValidationResult } from './format-errors.js';
2
- type ReadJsonFileResult = {
3
- ok: true;
4
- value: unknown;
5
- } | {
6
- ok: false;
7
- result: ValidationResult;
8
- };
9
- export declare function readJsonFile(filePath: string): Promise<ReadJsonFileResult>;
10
- export {};
@@ -1,25 +0,0 @@
1
- import { Command } from 'commander';
2
- type SpawnedChild = {
3
- on(event: 'error', listener: (err: unknown) => void): unknown;
4
- on(event: 'exit', listener: (code: number | null) => void): unknown;
5
- };
6
- /**
7
- * Run the spawn lifecycle for the build command. Extracted so the
8
- * error-surfacing path is testable: previously `child.on('error', ...)`
9
- * silently returned exit code 1 with no context, leaving the user
10
- * staring at a generic non-zero exit when `pnpm` wasn't on PATH.
11
- */
12
- export declare function runBuild(opts: {
13
- spawnFn: () => SpawnedChild;
14
- stderrWrite: (chunk: string) => void;
15
- }): Promise<{
16
- exitCode: number;
17
- }>;
18
- /**
19
- * Walks `actionCommand` and its ancestors for a truthy `--bedrock`.
20
- * --bedrock is registered per-subcommand, so a root-level or
21
- * subcommand-level setting can each carry it.
22
- */
23
- export declare function resolveBedrockFromAncestors(actionCommand: Command): boolean;
24
- export declare function createProgram(): Command;
25
- export {};
@@ -1,36 +0,0 @@
1
- type SourceFileEntry = {
2
- mtime: string;
3
- componentName?: string;
4
- };
5
- export type SourceFingerprint = {
6
- files: Record<string, SourceFileEntry>;
7
- rawTokensPath: string | null;
8
- rawTokensMtime: string | null;
9
- rawTokensContentHash: string | null;
10
- };
11
- /**
12
- * Minimal duck-typed sqlite interface; we don't depend on better-sqlite3
13
- * directly from this module (the wizard already opens the DB and passes it
14
- * in). `name` may be null in the DB; we filter those rows out.
15
- */
16
- export interface RawComponentsDb {
17
- prepare(sql: string): {
18
- all(sessionId: string): Array<Record<string, unknown>>;
19
- };
20
- }
21
- export declare function sha256Hex(buf: Buffer | string): string;
22
- /**
23
- * Build a per-file fingerprint of every source file that contributed to a
24
- * run. Stats each unique source_path once (first-seen component name wins),
25
- * and (optionally) hashes the raw tokens file too.
26
- *
27
- * Missing files do NOT throw — they're simply omitted. The read-side
28
- * staleness check re-stats from disk and surfaces missing files there so we
29
- * can report which one disappeared.
30
- */
31
- export declare function buildSourceFingerprint(opts: {
32
- db: RawComponentsDb;
33
- extractSessionId: string;
34
- rawTokensPath?: string | null;
35
- }): Promise<SourceFingerprint>;
36
- export {};
@@ -1,11 +0,0 @@
1
- /**
2
- * Returns true if `components.json` or `tokens.json` already exists at `path`.
3
- * Used by the wizard to decide whether to render the save-conflict gate before
4
- * writing.
5
- */
6
- export declare function detectSaveConflict(path: string): Promise<boolean>;
7
- /**
8
- * Build a timestamped subdirectory under `base` for the "new" branch of the
9
- * save-conflict gate. Format: `<base>/dsi-YYYYMMDD-HHMMSS` (local time).
10
- */
11
- export declare function buildTimestampedSubdir(base: string, now?: Date): string;
@@ -1,65 +0,0 @@
1
- import { runsFilePath } from '@contentful/experience-design-system-types/config';
2
- export declare const RUNS_FILE_VERSION: 3;
3
- /** Versions this CLI can read. v1 / v2 files are auto-migrated in memory;
4
- * new writes always use the latest version. */
5
- export declare const READABLE_VERSIONS: Set<number>;
6
- /** Per-file source fingerprint captured at save time. `files` is keyed by
7
- * absolute (path.resolve'd) source path; each entry records the file's
8
- * mtime (ISO 8601) at the moment the run record was written and, when
9
- * known, the component name extracted from it (first-seen wins on
10
- * collisions). */
11
- type SourceFingerprint = {
12
- files: Record<string, {
13
- mtime: string;
14
- componentName?: string;
15
- }>;
16
- rawTokensPath: string | null;
17
- rawTokensMtime: string | null;
18
- rawTokensContentHash: string | null;
19
- };
20
- export type RunRecord = {
21
- id: string;
22
- createdAt: string;
23
- projectPath: string;
24
- savePath: string;
25
- componentCount: number;
26
- tokenCount: number;
27
- /** Filesystem path of the saved tokens.json. Null when no tokens were
28
- * generated for the run. Added in runs.json v2. */
29
- tokensPath: string | null;
30
- /** Pipeline.db session id for the generated tokens. Null when no tokens
31
- * step ran. Added in runs.json v2 so replay and push can re-emit or
32
- * re-push tokens. */
33
- tokenSessionId: string | null;
34
- agent: string;
35
- pushedTo: {
36
- spaceId: string;
37
- environmentId: string;
38
- host: string;
39
- } | null;
40
- extractSessionId: string;
41
- generateSessionId: string | null;
42
- /** Per-file source fingerprint. Null on v1/v2 records read from disk; v3
43
- * writers always populate. Added in runs.json v3. Optional in the type
44
- * so callers that don't compute it (e.g. older test fixtures) still
45
- * satisfy `RunRecord`; `appendRun` always normalizes a missing value to
46
- * null on the way to disk. */
47
- sourceFingerprint?: SourceFingerprint | null;
48
- notes?: string;
49
- };
50
- export type RunsFile = {
51
- version: typeof RUNS_FILE_VERSION;
52
- runs: RunRecord[];
53
- };
54
- export { runsFilePath };
55
- export type AppendInput = Omit<RunRecord, 'id' | 'createdAt'> & Partial<Pick<RunRecord, 'id' | 'createdAt'>>;
56
- export declare function appendRun(input: AppendInput): Promise<RunRecord>;
57
- export type ListOptions = {
58
- limit?: number;
59
- projectPath?: string;
60
- before?: string;
61
- after?: string;
62
- };
63
- export declare function listRuns(opts?: ListOptions): Promise<RunRecord[]>;
64
- export declare function getRun(id: string): Promise<RunRecord>;
65
- export declare function updateRun(id: string, patch: Partial<Omit<RunRecord, 'id'>>): Promise<RunRecord>;
@@ -1,22 +0,0 @@
1
- import { type Skill } from '@contentful/experience-design-system-generation';
2
- /** sha256 hex of a string. Stable across runs. */
3
- export declare function hashContent(content: string): string;
4
- /** sha256 hex of a file's UTF-8 content. */
5
- export declare function hashFile(filePath: string): Promise<string>;
6
- /**
7
- * Hash the prompt content for a skill — either the bundled skill file shipped
8
- * with the CLI, or a custom override path. Used to key the select_cache and
9
- * generation_cache so cache entries invalidate when the prompt itself changes
10
- * (including bundled-skill updates across CLI versions).
11
- *
12
- * Also folds in the resolved agent and model: a cache hit must not stand in
13
- * for an agent run that was never made with the currently requested
14
- * agent/model, or `--agent`/`--model` overrides would appear to be ignored
15
- * whenever a prior cache entry already exists for the same input/prompt.
16
- *
17
- * @param skill — which skill (matches resolveSkillPath in prompt-builder)
18
- * @param agent — resolved agent name for this run
19
- * @param model — resolved model for this run (undefined resolves to the agent's default)
20
- * @param skillPathOverride — optional absolute/relative path to a custom prompt
21
- */
22
- export declare function hashPromptForSkill(skill: Skill, agent: string, model: string | undefined, skillPathOverride?: string, extraInputs?: string[], skillContentOverride?: string): Promise<string>;
@@ -1,3 +0,0 @@
1
- export type CdfCategory = 'content' | 'design' | 'state';
2
- export declare function mapContentfulTypeToCdfType(contentfulType: string): string;
3
- export declare function resolveCdfCategory(contentfulCategory: string | null | undefined, propName: string, contentProps: Set<string>, designProps: Set<string>): CdfCategory;
@@ -1 +0,0 @@
1
- export declare function deriveComponentId(name: string, source: string): string;
@@ -1,5 +0,0 @@
1
- import type { RawComponentDefinition } from '../../../types.js';
2
- export type RawComponentForHash = RawComponentDefinition & {
3
- component_id?: string;
4
- };
5
- export declare function hashComponentShape(component: RawComponentForHash): string;
@@ -1 +0,0 @@
1
- export declare function indexRowsByKey<T>(items: T[], key: (item: T) => string): Map<string, T[]>;
@@ -1,12 +0,0 @@
1
- import type { DTCGTokenGroup } from '@contentful/experience-design-system-types';
2
- export interface GroupRow {
3
- path: string;
4
- description: string | null;
5
- }
6
- export interface TokenRow {
7
- path: string;
8
- type: string;
9
- value: string;
10
- description: string | null;
11
- }
12
- export declare function buildDtcgGroups(groupRows: GroupRow[], tokenRows: TokenRow[]): DTCGTokenGroup[];
@@ -1,3 +0,0 @@
1
- import type { DTCGTokenEntry } from '@contentful/experience-design-system-types';
2
- import type { TokenRow } from './build-dtcg-groups.js';
3
- export declare function buildDtcgTokens(tokenRows: TokenRow[]): DTCGTokenEntry[];
@@ -1 +0,0 @@
1
- export declare function hashTokenContent(rawTokenContent: string): string;