@contentful/experience-design-system-cli 2.32.1-dev-build-6b922ec.0 → 2.32.1-dev-build-b7d2d34.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 (49) hide show
  1. package/dist/package.json +1 -2
  2. package/dist/src/credentials-store.d.ts +23 -0
  3. package/dist/src/helpers/build-contentful-management-client.d.ts +7 -0
  4. package/dist/src/helpers/fetch-and-persist-existing-contentful-entities.d.ts +29 -0
  5. package/dist/src/helpers/fetch-existing-contentful-entities.d.ts +11 -0
  6. package/dist/src/helpers/find-nearly-matching-component.d.ts +7 -0
  7. package/dist/src/helpers/read-existing-contentful-entities-from-session.d.ts +7 -0
  8. package/dist/src/helpers/summarize-existing-contentful-entities.d.ts +50 -0
  9. package/dist/src/import/orchestrator.d.ts +0 -1
  10. package/dist/src/import/tui/WizardApp.d.ts +3 -0
  11. package/dist/src/index.js +1304 -1537
  12. package/dist/src/session/cache-keys.d.ts +1 -1
  13. package/dist/src/setup/analytics-prompt.d.ts +13 -0
  14. package/dist/src/setup/auto-filter-prompt.d.ts +13 -0
  15. package/dist/src/setup/command.d.ts +13 -4
  16. package/dist/src/setup/composition-mode-prompt.d.ts +14 -0
  17. package/dist/src/setup/debug-mode-prompt.d.ts +11 -0
  18. package/package.json +6 -7
  19. package/skills/generate-components.md +27 -0
  20. package/skills/map-tokens.md +12 -0
  21. package/skills/select-components.md +11 -0
  22. package/dist/src/doctor/checks.d.ts +0 -5
  23. package/dist/src/doctor/command.d.ts +0 -7
  24. package/dist/src/doctor/report.d.ts +0 -12
  25. package/dist/src/helpers/cma-client.d.ts +0 -17
  26. package/dist/src/helpers/fetch-existing-entities.d.ts +0 -16
  27. package/dist/src/lib/agent-definitions.d.ts +0 -7
  28. package/dist/src/setup/lib/checks.d.ts +0 -69
  29. package/dist/src/setup/lib/layout.d.ts +0 -34
  30. package/dist/src/setup/lib/prompt-input.d.ts +0 -17
  31. package/dist/src/setup/lib/shell.d.ts +0 -15
  32. package/dist/src/setup/lib/types.d.ts +0 -55
  33. package/dist/src/setup/lib/yes-no-prompt.d.ts +0 -8
  34. package/dist/src/setup/steps/coding-agent.d.ts +0 -2
  35. package/dist/src/setup/steps/contentful.d.ts +0 -2
  36. package/dist/src/setup/steps/preferences/analytics.d.ts +0 -5
  37. package/dist/src/setup/steps/preferences/auto-filter.d.ts +0 -4
  38. package/dist/src/setup/steps/preferences/concurrency.d.ts +0 -3
  39. package/dist/src/setup/steps/preferences/custom-prompts.d.ts +0 -8
  40. package/dist/src/setup/steps/preferences/debug.d.ts +0 -4
  41. package/dist/src/setup/steps/preferences/index.d.ts +0 -41
  42. package/dist/src/setup/steps/preferences/no-color.d.ts +0 -3
  43. package/dist/src/setup/steps/prerequisites/build.d.ts +0 -2
  44. package/dist/src/setup/steps/prerequisites/index.d.ts +0 -8
  45. package/dist/src/setup/steps/prerequisites/node.d.ts +0 -4
  46. package/dist/src/setup/steps/prerequisites/pnpm.d.ts +0 -2
  47. package/dist/src/setup/tui/SetupScreen.d.ts +0 -30
  48. package/dist/src/setup/tui/SetupStepper.d.ts +0 -7
  49. package/dist/src/setup/tui/usePromptInput.d.ts +0 -19
@@ -19,4 +19,4 @@ export declare function hashFile(filePath: string): Promise<string>;
19
19
  * @param model — resolved model for this run (undefined resolves to the agent's default)
20
20
  * @param skillPathOverride — optional absolute/relative path to a custom prompt
21
21
  */
22
- export declare function hashPromptForSkill(skill: Skill, agent: string, model: string | undefined, skillPathOverride?: string): Promise<string>;
22
+ export declare function hashPromptForSkill(skill: Skill, agent: string, model: string | undefined, skillPathOverride?: string, extraInputs?: string[]): Promise<string>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Ask the operator whether to persist an opt-out of anonymous usage analytics.
3
+ *
4
+ * The helper is injectable so it can be unit-tested without a TTY. The caller
5
+ * provides an `ask` function that yields one line of input per call.
6
+ *
7
+ * Behavior:
8
+ * - Empty input returns `current` if defined, else `false` (default: enabled).
9
+ * - Input starting with 'y' or 'Y' returns `true` (disabled).
10
+ * - Input starting with 'n' or 'N' returns `false` (enabled).
11
+ * - Any other input falls back to the same rule as empty input.
12
+ */
13
+ export declare function promptAnalyticsPreference(ask: (q: string) => Promise<string>, current?: boolean): Promise<boolean>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Ask the operator whether to enable the AI auto-filter by default.
3
+ *
4
+ * The helper is injectable so it can be unit-tested without a TTY. The caller
5
+ * provides an `ask` function that yields one line of input per call.
6
+ *
7
+ * Behavior:
8
+ * - Empty input returns `current` if defined, else `true` (default ON).
9
+ * - Input starting with 'y' or 'Y' returns `true`.
10
+ * - Input starting with 'n' or 'N' returns `false`.
11
+ * - Any other input falls back to the same rule as empty input.
12
+ */
13
+ export declare function promptAutoFilterPreference(ask: (q: string) => Promise<string>, current?: boolean): Promise<boolean>;
@@ -1,6 +1,15 @@
1
1
  import type { Command } from 'commander';
2
- import type { SetupScreenDependencies } from './tui/SetupScreen.js';
3
- export declare const SETUP_REQUIRES_TTY_MESSAGE = "Error: experiences setup requires an interactive terminal.";
4
- export declare function getCliVersion(): string;
5
- export declare function createSetupScreenDependencies(): SetupScreenDependencies;
2
+ import type { AgentName } from '@contentful/experience-design-system-generation';
3
+ export declare function promptCodexModel(ask?: (q: string) => Promise<string>): Promise<string | undefined>;
4
+ export declare function setupAgent(): Promise<{
5
+ agent: AgentName | undefined;
6
+ agentModel: string | undefined;
7
+ }>;
8
+ export type SkillPromptKind = 'select' | 'generate';
9
+ /**
10
+ * Prompt the operator for a custom skill prompt path. Returns the resolved
11
+ * trimmed value, or `undefined` to leave the current value unchanged, or `null`
12
+ * to clear it. `ask` is injectable so tests can stub stdin.
13
+ */
14
+ export declare function promptCustomSkillPath(kind: SkillPromptKind, current: string | undefined, ask?: (q: string) => Promise<string>): Promise<string | undefined | null>;
6
15
  export declare function registerSetupCommand(program: Command): void;
@@ -0,0 +1,14 @@
1
+ import type { CompositionMode } from '../lib/composition-mode.js';
2
+ /**
3
+ * Setup prompts for composition (spec T10). Parallels `promptAutoFilterPreference`
4
+ * — injectable `ask` for TTY-free unit testing.
5
+ *
6
+ * (a) Composite-mode default. Default N → atomic (composition OFF); the
7
+ * low-surprise default. `--composite` opts in per invocation.
8
+ */
9
+ export declare function promptCompositeModePreference(ask: (q: string) => Promise<string>, current?: CompositionMode): Promise<CompositionMode>;
10
+ /**
11
+ * (b) Agentic mapping resolution. Default N — opt-in (it costs tokens and the
12
+ * output needs review), and only meaningful in composite mode.
13
+ */
14
+ export declare function promptAgenticResolutionPreference(ask: (q: string) => Promise<string>, current?: boolean): Promise<boolean>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Ask the operator whether to enable debug logging by default.
3
+ *
4
+ * When ON, every command writes a JSONL trace of its decisions to
5
+ * ~/.contentful/experience-design-system-cli/debug/. Off by default because
6
+ * the trace file grows quickly and contains verbose per-tool-call detail
7
+ * intended for developers debugging the CLI.
8
+ *
9
+ * Injectable `ask` so tests can drive without a TTY.
10
+ */
11
+ export declare function promptDebugModePreference(ask: (q: string) => Promise<string>, current?: boolean): Promise<boolean>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experience-design-system-cli",
3
- "version": "2.32.1-dev-build-6b922ec.0",
3
+ "version": "2.32.1-dev-build-b7d2d34.0",
4
4
  "description": "Contentful Experiences design system import CLI",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -29,7 +29,6 @@
29
29
  "skills/"
30
30
  ],
31
31
  "dependencies": {
32
- "@inkjs/ui": "^2.0.0",
33
32
  "@segment/analytics-node": "^3.0.0",
34
33
  "@vue/compiler-sfc": "^3.5.31",
35
34
  "commander": "^13.1.0",
@@ -41,8 +40,8 @@
41
40
  "svelte": "^5.56.4",
42
41
  "ts-morph": "^27.0.2",
43
42
  "typescript": "^5.9.3",
44
- "@contentful/experience-design-system-cli-v2": "2.32.1-dev-build-6b922ec.0",
45
- "@contentful/experience-design-system-types": "2.32.1-dev-build-6b922ec.0"
43
+ "@contentful/experience-design-system-cli-v2": "2.32.1-dev-build-b7d2d34.0",
44
+ "@contentful/experience-design-system-types": "2.32.1-dev-build-b7d2d34.0"
46
45
  },
47
46
  "devDependencies": {
48
47
  "@tsconfig/node24": "^24.0.4",
@@ -54,9 +53,9 @@
54
53
  "ink-testing-library": "^4.0.0",
55
54
  "typescript-eslint": "^8.67.0",
56
55
  "vitest": "^4.0.16",
57
- "@contentful/experience-design-system-extraction": "2.32.1-dev-build-6b922ec.0",
58
- "@contentful/experience-design-system-generation": "2.32.1-dev-build-6b922ec.0",
59
- "@contentful/experience-design-system-client": "2.32.1-dev-build-6b922ec.0"
56
+ "@contentful/experience-design-system-client": "2.32.1-dev-build-b7d2d34.0",
57
+ "@contentful/experience-design-system-generation": "2.32.1-dev-build-b7d2d34.0",
58
+ "@contentful/experience-design-system-extraction": "2.32.1-dev-build-b7d2d34.0"
60
59
  },
61
60
  "repository": {
62
61
  "type": "git",
@@ -549,3 +549,30 @@ If you are genuinely uncertain about every prop, classify each as:
549
549
  An imperfect classification is infinitely better than no classification. That is
550
550
  about **classifying a prop rather than dropping it** — it is not a licence to
551
551
  invent a `values` list. The uncertain answer is `cdf_type: "string"`, every time.
552
+
553
+ ---
554
+
555
+ ## Existing entities in the target space
556
+
557
+ The preamble may include an "Existing components in the target Contentful space" JSON block with a `likelyMatch` (a fuzzy-matched space component that likely corresponds to the codebase component you're classifying), an `otherComponents` list, and a rolled-up token summary. Use it to align your classifications with what the customer already has.
558
+
559
+ ### When `likelyMatch` is present — align prop names, categories, and slot names
560
+
561
+ Your goal is **consistency**: the customer will see the diff between what you propose and what already exists, and every unnecessary rename or category flip becomes review friction.
562
+
563
+ 1. **Prop names**: if the codebase has a prop whose meaning matches a `likelyMatch` design/content property (e.g. codebase `kind` ↔ space `variant`, codebase `text` ↔ space `label`), emit `classify_prop` with the **space's prop name** rather than the codebase name. In the `reason` field, always explain the rename explicitly, e.g. `"renamed from codebase prop 'kind' to match existing space prop 'variant'"`. If you can't confidently identify the correspondence, keep the codebase name.
564
+ 2. **Categories**: match the space's category (`design` / `content`) for equivalent props, even if you'd normally categorize differently. Note the alignment in `reason`.
565
+ 3. **Slot names**: match slot IDs / names when the shape is equivalent.
566
+ 4. **Enum values**: never invent new values to bridge a mismatch. If the codebase's enum diverges from the space's, classify against your best-effort mapping and cite the divergence in `reason` — this is a signal for human review, not a green light to rewrite the space's enum.
567
+ 5. **Never rename or realign silently.** Every classification influenced by the `likelyMatch` MUST cite it in `reason`.
568
+
569
+ ### When only `otherComponents` is present (no direct match)
570
+
571
+ Use the list to constrain slot `allowedComponents` — do not propose a slot that accepts component types the space doesn't have.
572
+
573
+ ### Token binding
574
+
575
+ The preamble's "Existing design tokens" section lists tokens (by name + DTCG type) already in the space.
576
+
577
+ 1. When classifying a `design`-category, `token`-typed prop, prefer binding to an existing token name over inventing a new one. Cite the target token in `reason`.
578
+ 2. If no existing token semantically matches, proceed with the current rules — propose a new token. The diff surfaces this for review.
@@ -88,3 +88,15 @@ Before emitting any tool calls, verify:
88
88
  3. `token_allowed` is never empty.
89
89
  4. Every emitted list includes the prop's own default token when it has one.
90
90
  5. No list was emitted on the strength of a default alone, and none targets a prop whose type is a union of variant names.
91
+
92
+ ---
93
+
94
+ ## Existing entities in the target space
95
+
96
+ The preamble may include an "Existing design tokens in the target Contentful space" JSON block listing tokens already present in the target space (by name + DTCG type).
97
+
98
+ Prefer restricting to existing tokens over proposing new ones:
99
+
100
+ 1. When the source has restriction evidence AND a candidate maps semantically to an existing token by name/type, favor the existing token in the emitted `token_allowed` list.
101
+ 2. Never emit a `token_allowed` entry that contradicts the "path exists verbatim" rule above — the existing-tokens block is guidance, not a substitute for the token path index. If a token appears in the existing-entities list but not in the token path index, do not use it.
102
+ 3. If none of the existing tokens fit and the source's evidence is specific, proceed as usual — the diff will surface the new proposal.
@@ -222,3 +222,14 @@ TextImageCard — card with rich text and background image
222
222
  SearchInput — search field with dropdown
223
223
  {"tool":"select_component","name":"SearchInput","reason":"search UI — configurable placeholder and state"}
224
224
  ```
225
+
226
+ ---
227
+
228
+ ## Existing entities in the target space
229
+
230
+ The preamble may include an "Existing components in the target Contentful space" JSON block and a rolled-up token summary. Use them as **signal, not as a filter**. Rules:
231
+
232
+ 1. Never let a name overlap force a decision. Acceptance is still driven purely by "does the codebase component render visible, authorable UI?" — a name match does not auto-accept, and a name conflict does not auto-reject.
233
+ 2. When a codebase component appears to correspond to an existing space component (name overlap, semantic overlap in the description), note it in your `reason` — e.g. `"accepted; likely maps to existing space component 'Button'"`. This surfaces the mapping for downstream review.
234
+ 3. When the space is mature (many existing components, dozens of tokens) and the codebase has thin wrappers with no visible UI difference, lean harder toward rejecting the wrappers. Extra noise in a mature space is more costly than in an empty one.
235
+ 4. When no overlap exists, the acceptance decision is unchanged from the rules above.
@@ -1,5 +0,0 @@
1
- export declare function reportNode(): Promise<boolean>;
2
- export declare function reportPnpm(pkgRoot: string): Promise<boolean>;
3
- export declare function reportDependencies(pkgRoot: string): Promise<boolean>;
4
- export declare function reportBuild(pkgRoot: string): Promise<boolean>;
5
- export declare function reportAgent(): Promise<boolean>;
@@ -1,7 +0,0 @@
1
- import type { Command } from 'commander';
2
- export interface DoctorOptions {
3
- skipBuild?: boolean;
4
- skipAgent?: boolean;
5
- }
6
- export declare function runDoctor(opts: DoctorOptions): Promise<void>;
7
- export declare function registerDoctorCommand(program: Command): void;
@@ -1,12 +0,0 @@
1
- /**
2
- * `experiences doctor` streams its findings as each check runs rather than
3
- * repainting a screen, so it writes ANSI directly instead of mounting the Ink
4
- * setup UI.
5
- */
6
- export declare function ok(msg: string): void;
7
- export declare function fail(msg: string): void;
8
- export declare function warn(msg: string): void;
9
- export declare function info(msg: string): void;
10
- export declare function section(title: string): void;
11
- /** Echo the first `limit` lines of a failed command's stderr. */
12
- export declare function infoStderr(stderr: string, limit: number): void;
@@ -1,17 +0,0 @@
1
- import { type PlainClientAPI } from 'contentful-management';
2
- interface CreateCmaClientOptions {
3
- cmaToken: string;
4
- /**
5
- * Optional CMA host override. Accepts either a full URL
6
- * (`https://api.contentful.com`) or a bare hostname (`api.contentful.com`);
7
- * contentful-management wants the bare form so we normalize here.
8
- */
9
- host?: string;
10
- }
11
- /**
12
- * Build a plain contentful-management client. Single place that picks the
13
- * `{ type: 'plain' }` overload so callers never have to think about it,
14
- * and normalizes host into the bare-hostname shape the SDK expects.
15
- */
16
- export declare function createCmaClient(opts: CreateCmaClientOptions): PlainClientAPI;
17
- export {};
@@ -1,16 +0,0 @@
1
- import { type ComponentProps, type DesignTokenProps, type PlainClientAPI } from 'contentful-management';
2
- export interface ExistingEntities {
3
- components: ComponentProps[];
4
- tokens: DesignTokenProps[];
5
- }
6
- interface FetchExistingEntitiesParams {
7
- spaceId: string;
8
- environmentId: string;
9
- }
10
- /**
11
- * Fetch all existing Components + DesignTokens for a space+env. Pagination
12
- * is delegated to the SDK's `fetchAll()` helper. Caller supplies the
13
- * pre-built plain client (see `createCmaClient()`).
14
- */
15
- export declare function fetchExistingEntities(client: PlainClientAPI, params: FetchExistingEntitiesParams): Promise<ExistingEntities>;
16
- export {};
@@ -1,7 +0,0 @@
1
- import type { AgentName } from '@contentful/experience-design-system-generation';
2
- export interface AgentDefinition {
3
- name: string;
4
- binary: AgentName;
5
- installHint: string;
6
- }
7
- export declare const AGENT_DEFS: readonly AgentDefinition[];
@@ -1,69 +0,0 @@
1
- import { binaryExists, pathExists, runSpawn, type ShellCommandResult } from './shell.js';
2
- /**
3
- * The decision half of each prerequisite check, shared by `experiences doctor`
4
- * and the setup wizard's Prerequisites step. Neither writes output from here:
5
- * doctor streams ANSI, setup emits events for Ink, and both need the same
6
- * verdict. Anything a caller needs for its own wording is returned rather than
7
- * printed.
8
- */
9
- export interface NodeVersionCheck {
10
- passed: boolean;
11
- version: string;
12
- major: number;
13
- required: number;
14
- }
15
- export declare function checkNodeVersion(nodeVersion?: string): NodeVersionCheck;
16
- /** Which Node version manager is available, so callers can offer the right fix. */
17
- export interface NodeVersionManagers {
18
- nvm: boolean;
19
- fnm: boolean;
20
- nvmScript: string;
21
- }
22
- export declare function detectNodeVersionManagers(homeDir: string, deps?: {
23
- binaryExists: typeof binaryExists;
24
- pathExists: typeof pathExists;
25
- }): Promise<NodeVersionManagers>;
26
- export type PnpmCheck = {
27
- status: 'missing';
28
- } | {
29
- status: 'broken';
30
- } | {
31
- status: 'unusable-in-repo';
32
- version: string;
33
- } | {
34
- status: 'ok';
35
- version: string;
36
- };
37
- type PnpmDeps = {
38
- binaryExists: typeof binaryExists;
39
- run: typeof runSpawn;
40
- };
41
- /** Whether pnpm is on PATH and reports a version. */
42
- export declare function detectPnpm(deps?: PnpmDeps): Promise<Extract<PnpmCheck, {
43
- status: 'missing' | 'broken' | 'ok';
44
- }>>;
45
- /**
46
- * `detectPnpm` plus proof that pnpm can execute inside the repo. A store built
47
- * against a different Node version still passes `--version` but fails there,
48
- * which is the failure operators actually hit — so doctor checks it, while the
49
- * setup wizard only needs to know pnpm exists before it installs.
50
- */
51
- export declare function checkPnpm(pkgRoot: string, deps?: PnpmDeps): Promise<PnpmCheck>;
52
- export interface InstallCheck {
53
- passed: boolean;
54
- /** Whether `node_modules` was already present, which changes doctor's wording. */
55
- hadNodeModules: boolean;
56
- result: ShellCommandResult;
57
- }
58
- export declare function installDependencies(pkgRoot: string, deps?: {
59
- pathExists: typeof pathExists;
60
- run: typeof runSpawn;
61
- }): Promise<InstallCheck>;
62
- export interface BuildCheck {
63
- passed: boolean;
64
- result: ShellCommandResult;
65
- }
66
- export declare function buildCli(repoRoot: string, deps?: {
67
- run: typeof runSpawn;
68
- }): Promise<BuildCheck>;
69
- export {};
@@ -1,34 +0,0 @@
1
- export declare const SETUP_SCREENS: readonly [{
2
- readonly title: "Prerequisites";
3
- readonly kind: "required";
4
- }, {
5
- readonly title: "Coding agent";
6
- readonly kind: "required";
7
- }, {
8
- readonly title: "Contentful";
9
- readonly kind: "optional";
10
- }, {
11
- readonly title: "Preferences";
12
- readonly kind: "optional";
13
- }];
14
- export declare const SETUP_TITLE = "experiences setup";
15
- export declare const WIDE_STEPPER_MIN_COLUMNS: number;
16
- export type SetupStepState = 'complete' | 'active' | 'pending';
17
- export interface SetupStepperEntry {
18
- step: number;
19
- title: string;
20
- state: SetupStepState;
21
- label: string;
22
- }
23
- export declare function shouldUseWideStepper(columns?: number): boolean;
24
- export declare function setupStepperSeparator(columns?: number): string;
25
- export declare function setupStepperEntries(activeStep: number, columns?: number): SetupStepperEntry[];
26
- export declare function shouldAlignVersionRight(version: string, columns?: number): boolean;
27
- export type SetupResultStatus = 'completed' | 'skipped' | 'failed';
28
- export interface SetupResultEntry {
29
- name: string;
30
- status: SetupResultStatus;
31
- required: boolean;
32
- }
33
- export declare function countRequiredFailures(results: readonly SetupResultEntry[]): number;
34
- export declare function formatSetupCompletionMessage(results: readonly SetupResultEntry[]): string;
@@ -1,17 +0,0 @@
1
- /**
2
- * A terminal coalesces fast input, so a pasted value and the Enter that follows
3
- * it arrive in a single chunk (`"my-token\r"`). Only the first line is kept, so
4
- * a multi-line paste submits its first value instead of filling one field with
5
- * all of them.
6
- *
7
- * This is why setup reads raw chunks instead of using @inkjs/ui's TextInput.
8
- * Ink's `parseKeypress` reports `key.return` only for a bare `"\r"`, so a
9
- * coalesced chunk arrives as text with `key.return === false`; TextInput then
10
- * inserts the whole thing — trailing CR and all — and never submits. Verified
11
- * against @inkjs/ui 2 on Ink 5, where PasswordInput behaves the same way and
12
- * ConfirmInput ignores `"y\r"` outright.
13
- */
14
- export declare function splitPromptInput(input: string): {
15
- text: string;
16
- submitted: boolean;
17
- };
@@ -1,15 +0,0 @@
1
- export declare const REQUIRED_NODE_MAJOR = 24;
2
- export interface ShellCommandResult {
3
- exitCode: number;
4
- stdout: string;
5
- stderr: string;
6
- }
7
- export declare function binaryExists(name: string): Promise<boolean>;
8
- export declare function pathExists(path: string): Promise<boolean>;
9
- export declare function runSpawn(cmd: string, args: string[], opts?: {
10
- cwd?: string;
11
- env?: NodeJS.ProcessEnv;
12
- }): Promise<ShellCommandResult>;
13
- export declare function detectShellProfile(): Promise<string>;
14
- export declare function profileContains(profilePath: string, value: string): Promise<boolean>;
15
- export declare function appendToProfile(profilePath: string, lines: string): Promise<void>;
@@ -1,55 +0,0 @@
1
- import type { AgentName } from '@contentful/experience-design-system-generation';
2
- import type { ExperiencesCredentials } from '../../credentials-store.js';
3
- import type { ShellCommandResult } from './shell.js';
4
- export type SetupActionEventKind = 'success' | 'failure' | 'warning' | 'info' | 'value' | 'help' | 'page';
5
- export interface SetupActionEvent {
6
- kind: SetupActionEventKind;
7
- message: string;
8
- }
9
- export interface SetupChoice {
10
- label: string;
11
- description?: string;
12
- }
13
- /**
14
- * Everything a setup step needs from the outside world. Prompts and output are
15
- * supplied by whatever renders the step — the Ink screen in production, stubs in
16
- * tests — so the steps hold the business rules and none of the presentation.
17
- */
18
- export interface SetupActionDependencies {
19
- nodeVersion: string;
20
- homeDir: string;
21
- env: NodeJS.ProcessEnv;
22
- ask(question: string): Promise<string>;
23
- askSecret(question: string): Promise<string>;
24
- confirm(question: string, defaultYes?: boolean): Promise<boolean>;
25
- /** Resolves the chosen index, or `undefined` when the operator skips. */
26
- choose(question: string, options: readonly SetupChoice[]): Promise<number | undefined>;
27
- write(event: SetupActionEvent): void;
28
- binaryExists(binary: string): Promise<boolean>;
29
- run(command: string, args: string[], options?: {
30
- cwd?: string;
31
- env?: NodeJS.ProcessEnv;
32
- }): Promise<ShellCommandResult>;
33
- pathExists(path: string): Promise<boolean>;
34
- profileContains(profilePath: string, value: string): Promise<boolean>;
35
- appendToProfile(profilePath: string, lines: string): Promise<void>;
36
- readCredentials(): Promise<ExperiencesCredentials>;
37
- writeCredentials(credentials: ExperiencesCredentials): Promise<void>;
38
- credentialsPath(): string;
39
- }
40
- export interface SetupCheckResult {
41
- passed: boolean;
42
- }
43
- export interface PrerequisitesSetupResult {
44
- node: SetupCheckResult & {
45
- restartRequired?: boolean;
46
- };
47
- pnpm?: SetupCheckResult;
48
- build?: SetupCheckResult;
49
- }
50
- export interface AgentSetupResult {
51
- agent: AgentName | undefined;
52
- agentModel: string | undefined;
53
- passed: boolean;
54
- }
55
- export declare function emit(dependencies: SetupActionDependencies, kind: SetupActionEventKind, message: string): void;
@@ -1,8 +0,0 @@
1
- import type { SetupActionDependencies } from './types.js';
2
- /**
3
- * Ask a yes/no question that defaults to the operator's current setting.
4
- *
5
- * Empty input — and anything that is not a yes or a no — keeps the current
6
- * value, so pressing Enter through the wizard never silently changes a setting.
7
- */
8
- export declare function askYesNo(ask: SetupActionDependencies['ask'], question: string, defaultValue: boolean): Promise<boolean>;
@@ -1,2 +0,0 @@
1
- import { type AgentSetupResult, type SetupActionDependencies } from '../lib/types.js';
2
- export declare function runAgentSetup(dependencies: SetupActionDependencies): Promise<AgentSetupResult>;
@@ -1,2 +0,0 @@
1
- import { type SetupActionDependencies, type SetupCheckResult } from '../lib/types.js';
2
- export declare function runCredentialsSetup(dependencies: SetupActionDependencies): Promise<SetupCheckResult>;
@@ -1,5 +0,0 @@
1
- import { type SetupActionDependencies } from '../../lib/types.js';
2
- export declare const ANALYTICS_HELP = "Shares anonymous usage data about which CLI commands run.";
3
- /** Returns whether analytics should be *disabled*, matching the stored field. */
4
- export declare function promptAnalyticsPreference(ask: SetupActionDependencies['ask'], current?: boolean): Promise<boolean>;
5
- export declare function configureAnalytics(dependencies: SetupActionDependencies): Promise<void>;
@@ -1,4 +0,0 @@
1
- import { type SetupActionDependencies } from '../../lib/types.js';
2
- export declare const AUTO_FILTER_HELP = "Filters out components irrelevant to experience orchestration during extraction.";
3
- export declare function promptAutoFilterPreference(ask: SetupActionDependencies['ask'], current?: boolean): Promise<boolean>;
4
- export declare function configureAutoFilter(dependencies: SetupActionDependencies): Promise<void>;
@@ -1,3 +0,0 @@
1
- import { type SetupActionDependencies } from '../../lib/types.js';
2
- export declare const CONCURRENCY_HELP = "Analyzes more components at once, which is faster on machines with spare cores.";
3
- export declare function configureConcurrency(dependencies: SetupActionDependencies, profilePath: string): Promise<void>;
@@ -1,8 +0,0 @@
1
- import { type SetupActionDependencies } from '../../lib/types.js';
2
- export declare const CUSTOM_PROMPTS_HELP = "Replaces the built-in instructions the coding agent follows when it selects and generates components.";
3
- /**
4
- * Ask for one custom prompt path. Returns the trimmed path, `undefined` to leave
5
- * the stored value alone, or `null` to clear it.
6
- */
7
- export declare function promptCustomSkillPathAction(kind: 'select' | 'generate', current: string | undefined, ask: SetupActionDependencies['ask']): Promise<string | undefined | null>;
8
- export declare function configureCustomPrompts(dependencies: SetupActionDependencies): Promise<void>;
@@ -1,4 +0,0 @@
1
- import { type SetupActionDependencies } from '../../lib/types.js';
2
- export declare const DEBUG_HELP = "Writes a verbose trace of every command decision, for troubleshooting.";
3
- export declare function promptDebugModePreference(ask: SetupActionDependencies['ask'], current?: boolean): Promise<boolean>;
4
- export declare function configureDebug(dependencies: SetupActionDependencies): Promise<void>;
@@ -1,41 +0,0 @@
1
- import type { SetupActionDependencies } from '../../lib/types.js';
2
- import { configureAnalytics } from './analytics.js';
3
- import { configureAutoFilter } from './auto-filter.js';
4
- import { configureConcurrency } from './concurrency.js';
5
- import { configureCustomPrompts } from './custom-prompts.js';
6
- import { configureDebug } from './debug.js';
7
- import { configureNoColor } from './no-color.js';
8
- /**
9
- * The preferences the wizard walks, in the order it presents them. Each entry
10
- * pairs its label with the function that owns that setting's help text, prompt,
11
- * and persistence — so adding a preference means adding a file and a row here.
12
- */
13
- export declare const PREFERENCE_OPTIONS: readonly [{
14
- readonly key: "autoFilter";
15
- readonly label: "AI auto-filter";
16
- readonly configure: typeof configureAutoFilter;
17
- }, {
18
- readonly key: "concurrency";
19
- readonly label: "Performance concurrency";
20
- readonly configure: typeof configureConcurrency;
21
- }, {
22
- readonly key: "customPrompts";
23
- readonly label: "Custom prompts";
24
- readonly configure: typeof configureCustomPrompts;
25
- }, {
26
- readonly key: "debug";
27
- readonly label: "Debug logging";
28
- readonly configure: typeof configureDebug;
29
- }, {
30
- readonly key: "analytics";
31
- readonly label: "Usage analytics";
32
- readonly configure: typeof configureAnalytics;
33
- }, {
34
- readonly key: "noColor";
35
- readonly label: "Disable terminal colors";
36
- readonly configure: typeof configureNoColor;
37
- }];
38
- export type PreferenceKey = (typeof PREFERENCE_OPTIONS)[number]['key'];
39
- export declare function runPreferenceSetupAction(dependencies: SetupActionDependencies, profilePath: string): Promise<{
40
- selected: PreferenceKey[];
41
- }>;
@@ -1,3 +0,0 @@
1
- import { type SetupActionDependencies } from '../../lib/types.js';
2
- export declare const NO_COLOR_HELP = "Prints plain text with no color, which suits CI logs and basic terminals.";
3
- export declare function configureNoColor(dependencies: SetupActionDependencies, profilePath: string): Promise<void>;
@@ -1,2 +0,0 @@
1
- import { type SetupActionDependencies, type SetupCheckResult } from '../../lib/types.js';
2
- export declare function runBuildSetup(dependencies: SetupActionDependencies, repoRoot: string): Promise<SetupCheckResult>;
@@ -1,8 +0,0 @@
1
- import type { PrerequisitesSetupResult, SetupActionDependencies } from '../../lib/types.js';
2
- import { runBuildSetup } from './build.js';
3
- import { runNodeSetup } from './node.js';
4
- import { runPnpmSetup } from './pnpm.js';
5
- export { runBuildSetup, runNodeSetup, runPnpmSetup };
6
- export declare function runPrerequisitesSetup(dependencies: SetupActionDependencies, repoRoot: string, options?: {
7
- skipBuild?: boolean;
8
- }): Promise<PrerequisitesSetupResult>;
@@ -1,4 +0,0 @@
1
- import { type SetupActionDependencies, type SetupCheckResult } from '../../lib/types.js';
2
- export declare function runNodeSetup(dependencies: SetupActionDependencies): Promise<SetupCheckResult & {
3
- restartRequired?: boolean;
4
- }>;
@@ -1,2 +0,0 @@
1
- import { type SetupActionDependencies, type SetupCheckResult } from '../../lib/types.js';
2
- export declare function runPnpmSetup(dependencies: SetupActionDependencies): Promise<SetupCheckResult>;
@@ -1,30 +0,0 @@
1
- import React from 'react';
2
- import { type SetupResultEntry } from '../lib/layout.js';
3
- import type { SetupActionDependencies } from '../lib/types.js';
4
- /** Prompts and output are UI-owned; the screen supplies the rest itself. */
5
- export type SetupScreenDependencies = Omit<SetupActionDependencies, 'ask' | 'askSecret' | 'confirm' | 'choose' | 'write'>;
6
- export type SetupSkipFlags = {
7
- skipBuild?: boolean;
8
- skipAgent?: boolean;
9
- skipCredentials?: boolean;
10
- skipOptional?: boolean;
11
- };
12
- export type SetupOutcome = {
13
- results: SetupResultEntry[];
14
- exitCode: number;
15
- restartRequired: boolean;
16
- runDoctor: boolean;
17
- };
18
- type SetupScreenProps = {
19
- version: string;
20
- repoRoot: string;
21
- profilePath: string;
22
- dependencies: SetupScreenDependencies;
23
- skip?: SetupSkipFlags;
24
- /** Defaults to the live Ink stdout columns. */
25
- columns?: number;
26
- offerDoctor?: boolean;
27
- onComplete: (outcome: SetupOutcome) => void;
28
- };
29
- export declare function SetupScreen({ version, repoRoot, profilePath, dependencies, skip, columns: columnsOverride, offerDoctor, onComplete, }: SetupScreenProps): React.ReactElement;
30
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- type SetupStepperProps = {
3
- activeStep: number;
4
- columns?: number;
5
- };
6
- export declare function SetupStepper({ activeStep, columns }: SetupStepperProps): React.ReactElement;
7
- export {};