@contentful/experience-design-system-cli 2.34.5-dev-build-d08439d.0 → 2.34.5-dev-build-5e798cb1.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.
- package/README.md +35 -276
- package/dist/package.json +2 -1
- package/dist/src/analytics/constants.d.ts +2 -2
- package/dist/src/analytics/index.d.ts +1 -1
- package/dist/src/analytics/normalize.d.ts +1 -1
- package/dist/src/analytics/types.d.ts +1 -1
- package/dist/src/analyze/composition/composition-cache-key.d.ts +2 -3
- package/dist/src/analyze/composition/interchange-schema.d.ts +2 -2
- package/dist/src/analyze/composition/prompt-loader.d.ts +3 -0
- package/dist/src/analyze/composition/resolve-mapping-cli.d.ts +1 -5
- package/dist/src/analyze/composition/resolve-mapping.d.ts +7 -8
- package/dist/src/analyze/extract-command.d.ts +3 -0
- package/dist/src/analyze/select/command.d.ts +3 -25
- package/dist/src/analyze/select/preview-annotations.d.ts +6 -6
- package/dist/src/analyze/select/tui/components/GotoBanner.d.ts +1 -1
- package/dist/src/apply/api-client.d.ts +4 -6
- package/dist/src/apply/command.d.ts +25 -4
- package/dist/src/apply/preview-utils.d.ts +2 -6
- package/dist/src/apply/tokens.d.ts +1 -0
- package/dist/src/apply/tui/ServerApplyView.d.ts +3 -6
- package/dist/src/apply/tui/ServerPreviewView.d.ts +1 -2
- package/dist/src/credentials-store.d.ts +0 -10
- package/dist/src/generate/command.d.ts +1 -1
- package/dist/src/helpers/read-existing-contentful-entities-from-session.d.ts +1 -1
- package/dist/src/import/agent-model-resolve.d.ts +1 -1
- package/dist/src/import/composition-options.d.ts +0 -8
- package/dist/src/import/tui/CustomPromptBanner.d.ts +1 -2
- package/dist/src/import/tui/WizardApp.d.ts +14 -41
- package/dist/src/import/tui/final-review-host.d.ts +1 -5
- package/dist/src/import/tui/hooks/useReviewPreview.d.ts +1 -2
- package/dist/src/import/tui/hooks/useReviewSession.d.ts +21 -0
- package/dist/src/import/tui/lineage-input.d.ts +2 -2
- package/dist/src/import/tui/preview-confirmation-input.d.ts +1 -2
- package/dist/src/import/tui/review-step-props.d.ts +0 -1
- package/dist/src/import/tui/runLivePreview.d.ts +0 -3
- package/dist/src/import/tui/runScopeGate.d.ts +0 -10
- package/dist/src/import/tui/scope-gate-host.d.ts +3 -7
- package/dist/src/import/tui/steps/ErrorStep.d.ts +2 -1
- package/dist/src/import/tui/steps/GenerateReviewStep.d.ts +1 -1
- package/dist/src/import/tui/steps/ScopeGateStep.d.ts +1 -1
- package/dist/src/import/tui/steps/WizardPreviewStep.d.ts +2 -6
- package/dist/src/import/tui/useFinalizePreview.d.ts +3 -8
- package/dist/src/import/tui/useLivePreview.d.ts +2 -4
- package/dist/src/import/tui/wizard-422-helpers.d.ts +1 -1
- package/dist/src/import/tui/wizard-state-transitions.d.ts +2 -4
- package/dist/src/index.js +22009 -29339
- package/dist/src/lib/command-options.d.ts +0 -3
- package/dist/src/lib/contentful-urls.d.ts +2 -4
- package/dist/src/lib/debug-logger.d.ts +0 -2
- package/dist/src/runs/fingerprint.d.ts +0 -12
- package/dist/src/runs/save-path-resolver.d.ts +0 -46
- package/dist/src/runs/store.d.ts +2 -18
- package/dist/src/session/cache-keys.d.ts +1 -1
- package/dist/src/session/db.d.ts +3 -6
- package/dist/src/setup/command.d.ts +1 -2
- package/package.json +7 -6
- package/skills/generate-components.md +1 -1
- package/dist/src/analytics/env.d.ts +0 -2
- package/dist/src/analyze/build-analyze-view-rows.d.ts +0 -32
- package/dist/src/analyze/command.d.ts +0 -14
- package/dist/src/analyze/composition/agent-parser/author-prompt.d.ts +0 -4
- package/dist/src/analyze/composition/agent-parser/extract-parser.d.ts +0 -8
- package/dist/src/analyze/composition/agent-parser/load-prompt.d.ts +0 -7
- package/dist/src/analyze/composition/agent-parser/resolve-via-parser.d.ts +0 -46
- package/dist/src/analyze/composition/agent-parser/sandbox.d.ts +0 -45
- package/dist/src/analyze/composition/candidate-critic-agent.d.ts +0 -7
- package/dist/src/analyze/composition/candidate-critic.d.ts +0 -32
- package/dist/src/analyze/select-agent/command.d.ts +0 -4
- package/dist/src/analyze/select-agent/context-builder.d.ts +0 -50
- package/dist/src/analyze/select-agent/show-rationale.d.ts +0 -9
- package/dist/src/analyze/tui/AnalyzeView.d.ts +0 -39
- package/dist/src/apply/manifest.d.ts +0 -1
- package/dist/src/apply/tui/SelectView.d.ts +0 -18
- package/dist/src/generate/edit/command.d.ts +0 -2
- package/dist/src/import/auto-filter-resolve.d.ts +0 -3
- package/dist/src/import/orchestrator.d.ts +0 -76
- package/dist/src/import/picker-dispatch.d.ts +0 -28
- package/dist/src/import/print-prompt.d.ts +0 -34
- package/dist/src/import/strip-allowed-components.d.ts +0 -18
- package/dist/src/import/tui/auto-filter-error.d.ts +0 -1
- package/dist/src/import/tui/components/AutoFilterBanner.d.ts +0 -10
- package/dist/src/import/tui/merge-ai-decisions.d.ts +0 -5
- package/dist/src/import/tui/steps/AtomicGenerateReviewStep.d.ts +0 -28
- package/dist/src/import/tui/steps/AtomicScopeGateStep.d.ts +0 -3
- package/dist/src/import/tui/wizard-save-flow.d.ts +0 -37
- package/dist/src/lib/composition-mode.d.ts +0 -30
- package/dist/src/runs/export-helpers.d.ts +0 -5
- package/dist/src/runs/ls-command.d.ts +0 -12
- package/dist/src/runs/modify-launcher.d.ts +0 -34
- package/dist/src/runs/picker-labels.d.ts +0 -24
- package/dist/src/runs/push-creds-prompt.d.ts +0 -25
- package/dist/src/runs/push-helpers.d.ts +0 -20
- package/dist/src/runs/push-launcher.d.ts +0 -52
- package/dist/src/runs/replay-helpers.d.ts +0 -71
- package/dist/src/runs/resolve-run-target.d.ts +0 -12
- package/dist/src/runs/run-picker-mount.d.ts +0 -46
- package/dist/src/runs/run-picker.d.ts +0 -18
- package/dist/src/runs/staleness.d.ts +0 -38
- package/dist/src/runs/wizard-launcher.d.ts +0 -2
- package/dist/src/runs/wizard-seed.d.ts +0 -20
- package/dist/src/session/cli.d.ts +0 -2
- package/dist/src/session/stats.d.ts +0 -26
- package/dist/src/setup/auto-filter-prompt.d.ts +0 -13
- package/dist/src/setup/composition-mode-prompt.d.ts +0 -14
- package/prompts/composition-dir-critic.md +0 -7
- package/prompts/composition-parser-repair-empty.md +0 -1
- package/prompts/composition-parser-repair-error.md +0 -2
- package/prompts/composition-parser.md +0 -49
- /package/dist/src/analyze/select/tui/{App.d.ts → LegacySelectApp.d.ts} +0 -0
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { CompositionMode } from '../lib/composition-mode.js';
|
|
2
|
-
export interface PipelineOptions {
|
|
3
|
-
project: string;
|
|
4
|
-
out: string;
|
|
5
|
-
spaceId?: string;
|
|
6
|
-
environmentId?: string;
|
|
7
|
-
cmaToken?: string;
|
|
8
|
-
agent: string;
|
|
9
|
-
model?: string;
|
|
10
|
-
bedrock?: boolean;
|
|
11
|
-
skipAnalyze: boolean;
|
|
12
|
-
skipGenerate: boolean;
|
|
13
|
-
print: boolean;
|
|
14
|
-
skipApply: boolean;
|
|
15
|
-
noCache: boolean;
|
|
16
|
-
yes: boolean;
|
|
17
|
-
verbose: boolean;
|
|
18
|
-
tokens?: string;
|
|
19
|
-
viewports?: string;
|
|
20
|
-
host?: string;
|
|
21
|
-
dryRun?: boolean;
|
|
22
|
-
excludeInvalid?: boolean;
|
|
23
|
-
selectAll?: boolean;
|
|
24
|
-
select?: string[];
|
|
25
|
-
deselect?: string[];
|
|
26
|
-
/** Forwarded to the spawned `analyze select-agent` subprocess. */
|
|
27
|
-
selectPromptPath?: string;
|
|
28
|
-
/** When true, auto-reject cycle participants and retry push instead of surfacing an error. */
|
|
29
|
-
autoRejectCycles?: boolean;
|
|
30
|
-
allowDeletions?: boolean;
|
|
31
|
-
compositionMode?: CompositionMode;
|
|
32
|
-
compositionMap?: string;
|
|
33
|
-
compositionAgent?: boolean;
|
|
34
|
-
compositionAgentMode?: string;
|
|
35
|
-
compositionRefresh?: boolean;
|
|
36
|
-
generateMap?: string;
|
|
37
|
-
promptOverrides?: string[];
|
|
38
|
-
skipMapTokens?: boolean;
|
|
39
|
-
}
|
|
40
|
-
export interface StepResult {
|
|
41
|
-
step: string;
|
|
42
|
-
status: 'complete' | 'failed' | 'skipped';
|
|
43
|
-
durationMs?: number;
|
|
44
|
-
reason?: string;
|
|
45
|
-
detail?: Record<string, unknown>;
|
|
46
|
-
error?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface PipelineResult {
|
|
49
|
-
session: string;
|
|
50
|
-
project: string;
|
|
51
|
-
steps: StepResult[];
|
|
52
|
-
cycleError?: {
|
|
53
|
-
report: string[];
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export declare function isSlotCycleError(result: {
|
|
57
|
-
exitCode: number;
|
|
58
|
-
stderr: string;
|
|
59
|
-
}): boolean;
|
|
60
|
-
export declare function extractCycleReport(stderr: string): string[];
|
|
61
|
-
export declare function parseCycleComponentNames(report: string[]): string[];
|
|
62
|
-
export declare function isPreviewValidationError(result: {
|
|
63
|
-
exitCode: number;
|
|
64
|
-
stderr: string;
|
|
65
|
-
}): boolean;
|
|
66
|
-
export declare function parseOffendingComponentNames(output: string): string[];
|
|
67
|
-
export declare function buildPushStepResult(args: {
|
|
68
|
-
created: number;
|
|
69
|
-
updated: number;
|
|
70
|
-
failed: number;
|
|
71
|
-
durationMs: number;
|
|
72
|
-
stderr: string;
|
|
73
|
-
excludedByRetry: string[];
|
|
74
|
-
totalFailure?: boolean;
|
|
75
|
-
}): StepResult;
|
|
76
|
-
export declare function runPipeline(opts: PipelineOptions, progressWriter: (line: string) => void, cliPathOverride?: string): Promise<PipelineResult>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { RunPickerSelection } from '../runs/run-picker.js';
|
|
2
|
-
import type { replayRun as replayRunFn, modifyRun as modifyRunFn } from '../runs/replay-helpers.js';
|
|
3
|
-
import type { pickerPushRun as pickerPushRunFn } from '../runs/push-launcher.js';
|
|
4
|
-
export type PickerDispatchOptions = {
|
|
5
|
-
spaceId?: string;
|
|
6
|
-
environmentId?: string;
|
|
7
|
-
cmaToken?: string;
|
|
8
|
-
host?: string;
|
|
9
|
-
interactive?: boolean;
|
|
10
|
-
outDir?: string;
|
|
11
|
-
overwrite?: boolean;
|
|
12
|
-
saveAsNew?: boolean;
|
|
13
|
-
force?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export type PickerDispatchDeps = {
|
|
16
|
-
replayRun: typeof replayRunFn;
|
|
17
|
-
modifyRun: typeof modifyRunFn;
|
|
18
|
-
/**
|
|
19
|
-
* Interactive picker-Push launcher — mounts the wizard so the operator sees
|
|
20
|
-
* preview + push progress + view URL rather than a single-line summary.
|
|
21
|
-
* Optional so existing test fixtures that only stub {replayRun, modifyRun}
|
|
22
|
-
* still type-check; when omitted, picker-Push falls back to replayRun.
|
|
23
|
-
*/
|
|
24
|
-
pickerPushRun?: typeof pickerPushRunFn;
|
|
25
|
-
};
|
|
26
|
-
export declare function buildPickerCredentialOptions(opts: Pick<PickerDispatchOptions, 'spaceId' | 'environmentId' | 'cmaToken' | 'host' | 'force'>): Pick<PickerDispatchOptions, 'spaceId' | 'environmentId' | 'cmaToken' | 'host' | 'force'>;
|
|
27
|
-
export declare function buildPickerModifyOptions(opts: Pick<PickerDispatchOptions, 'outDir' | 'overwrite' | 'saveAsNew' | 'force'>): Pick<PickerDispatchOptions, 'outDir' | 'overwrite' | 'saveAsNew' | 'force'>;
|
|
28
|
-
export declare function dispatchPickerSelection(selection: RunPickerSelection, opts: PickerDispatchOptions, deps: PickerDispatchDeps): Promise<void>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `experiences import --print-prompt` / `--dry-run` — prompt-print helpers.
|
|
3
|
-
*
|
|
4
|
-
* Both flags currently surface the same behaviour: print the generate-prompt
|
|
5
|
-
* (delegated downstream by the orchestrator via `generate components --dry-run`)
|
|
6
|
-
* and exit before invoking the agent. `--print-prompt` is the new, explicit
|
|
7
|
-
* name. `--dry-run` is preserved for one deprecation cycle: it keeps working
|
|
8
|
-
* but emits a stderr notice signalling that its semantics will change in a
|
|
9
|
-
* future release (to "manifest preview, no push", matching `apply push`'s
|
|
10
|
-
* `--dry-run`).
|
|
11
|
-
*
|
|
12
|
-
* Keeping the routing in a small pure module lets the command surface stay
|
|
13
|
-
* declarative and lets the deprecation notice be asserted from tests without
|
|
14
|
-
* spawning the full pipeline.
|
|
15
|
-
*/
|
|
16
|
-
export type PromptFlags = {
|
|
17
|
-
/** True when the user passed --dry-run. */
|
|
18
|
-
dryRun?: boolean;
|
|
19
|
-
/** True when the user passed --print-prompt. */
|
|
20
|
-
printPrompt?: boolean;
|
|
21
|
-
};
|
|
22
|
-
export type PromptFlagsResolution = {
|
|
23
|
-
/** Whether to forward `--dry-run` semantics to the downstream generate step. */
|
|
24
|
-
forwardDryRun: boolean;
|
|
25
|
-
/** Stderr message to emit, or null when the flags need no warning. */
|
|
26
|
-
deprecationNotice: string | null;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Resolve the user's `--dry-run` / `--print-prompt` choice into the
|
|
30
|
-
* downstream-forwarded dry-run boolean plus an optional deprecation message.
|
|
31
|
-
* Pure (no IO) so it's trivially unit-testable; the caller writes the notice
|
|
32
|
-
* to stderr.
|
|
33
|
-
*/
|
|
34
|
-
export declare function resolvePromptFlags(flags: PromptFlags): PromptFlagsResolution;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { CDFComponentEntry } from '@contentful/experience-design-system-types';
|
|
2
|
-
/**
|
|
3
|
-
* Atomic-mode normalization (spec T8, option a): keep every slot's structure
|
|
4
|
-
* but drop its `$allowedComponents` composition constraint. Applied over the
|
|
5
|
-
* loaded component array regardless of source (`--session` or `--components`),
|
|
6
|
-
* so the atomic bypass cannot leak a live composition link into the pushed
|
|
7
|
-
* manifest. Starving `$allowedComponents` at this single point also makes
|
|
8
|
-
* slot-cycle detection structurally return zero (see T12).
|
|
9
|
-
*
|
|
10
|
-
* Returns a new array with cloned entries; inputs are not mutated.
|
|
11
|
-
*/
|
|
12
|
-
export declare function stripAllowedComponents(components: Array<{
|
|
13
|
-
key: string;
|
|
14
|
-
entry: CDFComponentEntry;
|
|
15
|
-
}>): Array<{
|
|
16
|
-
key: string;
|
|
17
|
-
entry: CDFComponentEntry;
|
|
18
|
-
}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function buildAutoFilterErrorTail(raw: string): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export type AutoFilterStatus = 'idle' | 'running' | 'complete' | 'cancelled' | 'failed';
|
|
3
|
-
export declare function AutoFilterBanner(props: {
|
|
4
|
-
status?: AutoFilterStatus;
|
|
5
|
-
progress?: {
|
|
6
|
-
done: number;
|
|
7
|
-
total: number;
|
|
8
|
-
} | null;
|
|
9
|
-
error?: string | null;
|
|
10
|
-
}): React.ReactElement | null;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type GenerateReviewStepProps = {
|
|
3
|
-
extractSessionId: string;
|
|
4
|
-
tokenSessionId?: string | null;
|
|
5
|
-
onFinalize: (accepted: number, rejected: number, unresolved: number) => void;
|
|
6
|
-
onQuit: () => void;
|
|
7
|
-
/**
|
|
8
|
-
* Feature 2 (live preview after every save). When `true` (default), the
|
|
9
|
-
* wizard re-runs `previewImport` after each successful FieldEditor Ctrl+S
|
|
10
|
-
* (debounced 500ms) and refreshes the sidebar's previewAnnotation badges.
|
|
11
|
-
* Operator opts out via `experiences import --no-live-preview`.
|
|
12
|
-
*/
|
|
13
|
-
livePreview?: boolean;
|
|
14
|
-
spaceId?: string;
|
|
15
|
-
environmentId?: string;
|
|
16
|
-
cmaToken?: string;
|
|
17
|
-
host?: string;
|
|
18
|
-
tokensPath?: string;
|
|
19
|
-
/**
|
|
20
|
-
* INTEG-4411 refined: initial value for the inline `finalizeError` banner.
|
|
21
|
-
* The wizard sets this when it routes back to `final-review` after the
|
|
22
|
-
* preview API returned an empty diff (pure no-op push). Cleared on the
|
|
23
|
-
* next `a` / `A` keystroke.
|
|
24
|
-
*/
|
|
25
|
-
initialFinalizeError?: string | null;
|
|
26
|
-
};
|
|
27
|
-
export declare function AtomicGenerateReviewStep({ extractSessionId, tokenSessionId, onFinalize, onQuit, livePreview, spaceId, environmentId, cmaToken, host, tokensPath, initialFinalizeError, }: GenerateReviewStepProps): React.ReactElement;
|
|
28
|
-
export {};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ScopeGateStepProps } from './ScopeGateStep.js';
|
|
3
|
-
export declare function AtomicScopeGateStep({ components, onConfirm, onQuit, aiFilterStatus, aiFilterProgress, aiFilterError, onCancelAutoFilter, }: ScopeGateStepProps): React.ReactElement;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { type RunRecord } from '../../runs/store.js';
|
|
2
|
-
import { type ConflictMode } from '../../runs/save-path-resolver.js';
|
|
3
|
-
/**
|
|
4
|
-
* Wizard save-flow orchestration helpers (Task 4 / spec part 1+2).
|
|
5
|
-
*
|
|
6
|
-
* Kept as a separate module so the logic is testable without rendering the
|
|
7
|
-
* full Ink WizardApp.
|
|
8
|
-
*/
|
|
9
|
-
export type PlanSaveFlowInput = {
|
|
10
|
-
/** Resolved default save path (e.g. `${project}/.contentful`). */
|
|
11
|
-
defaultPath: string;
|
|
12
|
-
/** When set, bypass the inline prompt entirely (`--out-dir` flag). */
|
|
13
|
-
outDirOverride?: string | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Headless conflict-resolution mode (`--on-conflict`). Only meaningful when
|
|
16
|
-
* `outDirOverride` is also set — otherwise we still need to prompt for the
|
|
17
|
-
* path interactively. When provided alongside an override, the conflict
|
|
18
|
-
* gate is bypassed and the mode is applied via `resolveSavePath`.
|
|
19
|
-
*/
|
|
20
|
-
onConflict?: ConflictMode | undefined;
|
|
21
|
-
};
|
|
22
|
-
export type PlanSaveFlowOutput = {
|
|
23
|
-
kind: 'write';
|
|
24
|
-
path: string;
|
|
25
|
-
} | {
|
|
26
|
-
kind: 'prompt';
|
|
27
|
-
defaultPath: string;
|
|
28
|
-
} | {
|
|
29
|
-
kind: 'fail';
|
|
30
|
-
conflict: {
|
|
31
|
-
path: string;
|
|
32
|
-
files: string[];
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export declare function planSaveFlow(input: PlanSaveFlowInput): Promise<PlanSaveFlowOutput>;
|
|
36
|
-
export type RecordRunAfterSaveInput = Omit<RunRecord, 'id' | 'createdAt'>;
|
|
37
|
-
export declare function recordRunAfterSave(input: RecordRunAfterSaveInput): Promise<RunRecord>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export declare const COMPOSITION_MODES: readonly ["composite", "atomic"];
|
|
2
|
-
export type CompositionMode = (typeof COMPOSITION_MODES)[number];
|
|
3
|
-
export declare function isCompositionMode(value: string): value is CompositionMode;
|
|
4
|
-
/**
|
|
5
|
-
* Options that, when present, IMPLY composite mode — passing any of them is a
|
|
6
|
-
* clear opt-in, so requiring an explicit `--composite` alongside is redundant.
|
|
7
|
-
*/
|
|
8
|
-
export type CompositionSourceOptions = {
|
|
9
|
-
compositionMap?: string;
|
|
10
|
-
compositionAgent?: boolean;
|
|
11
|
-
compositionRefresh?: boolean;
|
|
12
|
-
generateMap?: string;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Resolve the effective composition mode with precedence
|
|
16
|
-
* `explicit flag > implied source > env > persisted config > default`.
|
|
17
|
-
* Default is `atomic` (composition OFF); `--composite` opts into the hierarchy
|
|
18
|
-
* machinery.
|
|
19
|
-
*
|
|
20
|
-
* `--atomic` is accepted for symmetry and wins when passed — even alongside a
|
|
21
|
-
* composition source, since it's an explicit "no" that overrides the implicit
|
|
22
|
-
* opt-in. If both `--composite` and `--atomic` are present, `--composite`
|
|
23
|
-
* wins. Passing a composition source (`--composition-map/-agent`,
|
|
24
|
-
* `--composition-refresh`, or `--generate-map`) implies composite without a
|
|
25
|
-
* separate `--composite`.
|
|
26
|
-
*/
|
|
27
|
-
export declare function resolveCompositionMode(opts: {
|
|
28
|
-
composite?: boolean;
|
|
29
|
-
atomic?: boolean;
|
|
30
|
-
} & CompositionSourceOptions, configMode?: CompositionMode): CompositionMode;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Command } from 'commander';
|
|
2
|
-
export type RunLsOptions = {
|
|
3
|
-
write?: (chunk: string) => void;
|
|
4
|
-
projectPath?: string;
|
|
5
|
-
limit?: number;
|
|
6
|
-
target?: string;
|
|
7
|
-
json?: boolean;
|
|
8
|
-
pushed?: boolean;
|
|
9
|
-
notPushed?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export declare function runLsCommand(opts?: RunLsOptions): Promise<void>;
|
|
12
|
-
export declare function registerRunsCommand(program: Command): void;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Thin indirection so `runModifyCommand` can be unit-tested without spinning
|
|
3
|
-
* up the real Ink wizard. The production implementation lives here.
|
|
4
|
-
*/
|
|
5
|
-
import type { CompositionMode } from '../lib/composition-mode.js';
|
|
6
|
-
export type ModifyLauncherInput = {
|
|
7
|
-
extractSessionId: string;
|
|
8
|
-
generateSessionId: string | null;
|
|
9
|
-
/** Token session id from the run record; null when no tokens were
|
|
10
|
-
* generated. Forwarded to the wizard so the modify entry pre-loads
|
|
11
|
-
* tokens alongside the extract/generate sessions. */
|
|
12
|
-
tokenSessionId?: string | null;
|
|
13
|
-
/** Absolute path to the complete DTCG token catalog written for this run. */
|
|
14
|
-
tokensPath?: string | null;
|
|
15
|
-
projectPath: string;
|
|
16
|
-
savePath: string;
|
|
17
|
-
entryStep: 'scope-gate' | 'final-review';
|
|
18
|
-
saveMode: 'overwrite' | 'new' | 'prompt';
|
|
19
|
-
/** Composition mode from the run record, so the modify wizard resumes in the
|
|
20
|
-
* same mode. Omitted → the wizard's default (`atomic`). */
|
|
21
|
-
compositionMode?: CompositionMode;
|
|
22
|
-
outDirOverride?: string;
|
|
23
|
-
/** Pre-fill space id (from the run record's pushedTo). */
|
|
24
|
-
initialSpaceId?: string;
|
|
25
|
-
/** Pre-fill environment id (from the run record's pushedTo). */
|
|
26
|
-
initialEnvironmentId?: string;
|
|
27
|
-
/** Pre-fill host (from the run record's pushedTo). */
|
|
28
|
-
initialHost?: string;
|
|
29
|
-
/** Pre-fill CMA token (from credentials.json / env). */
|
|
30
|
-
initialCmaToken?: string;
|
|
31
|
-
/** From `--allow-deletions` flag. Forwarded to wizard's push step. */
|
|
32
|
-
allowDeletions?: boolean;
|
|
33
|
-
};
|
|
34
|
-
export declare function launchModifyWizard(input: ModifyLauncherInput): Promise<void>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type LabelInput = {
|
|
2
|
-
id: string;
|
|
3
|
-
projectPath: string;
|
|
4
|
-
};
|
|
5
|
-
/**
|
|
6
|
-
* Map each run to a display label. Labels start as the project path's leaf
|
|
7
|
-
* directory and expand one segment at a time (`<parent>/<leaf>`,
|
|
8
|
-
* `<gp>/<parent>/<leaf>`, …) until every label in the input set is unique.
|
|
9
|
-
* When two rows share the exact same absolute path, the collision is broken
|
|
10
|
-
* with numeric suffixes (`(#1)`, `(#2)`, …) in input order.
|
|
11
|
-
*/
|
|
12
|
-
export declare function disambiguateLabels(runs: readonly LabelInput[]): Map<string, string>;
|
|
13
|
-
/**
|
|
14
|
-
* Format an ISO-8601 timestamp relative to `now`. Buckets:
|
|
15
|
-
* < 60s → "just now"
|
|
16
|
-
* < 60 min → "Nm ago"
|
|
17
|
-
* < 24 h → "Nh ago"
|
|
18
|
-
* < 7 days → "Nd ago"
|
|
19
|
-
* otherwise → "YYYY-MM-DD HH:MM" (local time)
|
|
20
|
-
*
|
|
21
|
-
* Future timestamps (created after `now`) also render as "just now" — they
|
|
22
|
-
* only occur with clock skew and the delta is not worth surfacing.
|
|
23
|
-
*/
|
|
24
|
-
export declare function formatRelativeTime(iso: string, now?: Date): string;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interactive credentials fallback for `experiences import --push-from-run`.
|
|
3
|
-
*
|
|
4
|
-
* The wizard ships a full `CredentialsStep` Ink component already — rather
|
|
5
|
-
* than reimplementing the field-entry UI, we mount that step in a tiny Ink
|
|
6
|
-
* app that resolves a promise once the operator confirms.
|
|
7
|
-
*
|
|
8
|
-
* Returns the four credential values (host comes back as a configured host
|
|
9
|
-
* string, e.g. `api.contentful.com`).
|
|
10
|
-
*/
|
|
11
|
-
export type CollectedCredentials = {
|
|
12
|
-
spaceId: string;
|
|
13
|
-
environmentId: string;
|
|
14
|
-
cmaToken: string;
|
|
15
|
-
host: string;
|
|
16
|
-
};
|
|
17
|
-
export type PromptForCredentialsOptions = {
|
|
18
|
-
initialSpaceId?: string;
|
|
19
|
-
initialEnvironmentId?: string;
|
|
20
|
-
initialCmaToken?: string;
|
|
21
|
-
initialHost?: string;
|
|
22
|
-
/** Short summary line rendered above the form. */
|
|
23
|
-
summary?: string;
|
|
24
|
-
};
|
|
25
|
-
export declare function promptForPushCredentials(opts?: PromptForCredentialsOptions): Promise<CollectedCredentials>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export type PushSessionResult = {
|
|
2
|
-
ok: true;
|
|
3
|
-
} | {
|
|
4
|
-
ok: false;
|
|
5
|
-
error: string;
|
|
6
|
-
};
|
|
7
|
-
export type PushSessionOptions = {
|
|
8
|
-
sessionId: string;
|
|
9
|
-
spaceId: string;
|
|
10
|
-
environmentId: string;
|
|
11
|
-
cmaToken: string;
|
|
12
|
-
host?: string;
|
|
13
|
-
allowDeletions?: boolean;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Push a recorded pipeline.db session's components + tokens to Contentful by
|
|
17
|
-
* shelling out to `experiences apply push --session <id>`. Does no local
|
|
18
|
-
* file I/O — that is the whole point of --push-from-run.
|
|
19
|
-
*/
|
|
20
|
-
export declare function pushRunSession(opts: PushSessionOptions): Promise<PushSessionResult>;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Push-from-picker launcher. When the operator selects "Push" from the
|
|
3
|
-
* interactive run-picker, we mount the wizard with seeded session IDs and
|
|
4
|
-
* `initialStep: 'push-from-picker'` so they see the same preview + push UX
|
|
5
|
-
* as a fresh `experiences import` (preview → diff review → pushing progress
|
|
6
|
-
* bars → done with view URL).
|
|
7
|
-
*
|
|
8
|
-
* This is deliberately parallel to `modify-launcher.ts`. The `--push-from-run`
|
|
9
|
-
* CLI flag path (headless shell-out via `replayRun`) is preserved for
|
|
10
|
-
* scripted / non-TTY use.
|
|
11
|
-
*/
|
|
12
|
-
export type PushLauncherInput = {
|
|
13
|
-
extractSessionId: string;
|
|
14
|
-
generateSessionId: string | null;
|
|
15
|
-
/** Token session id from the run record; null when no tokens were
|
|
16
|
-
* generated. Forwarded to the wizard so preview picks up tokens too. */
|
|
17
|
-
tokenSessionId?: string | null;
|
|
18
|
-
projectPath: string;
|
|
19
|
-
savePath: string;
|
|
20
|
-
/** Absolute path to the run's tokens.json on disk (from the run record).
|
|
21
|
-
* Forwarded to the wizard so runPreview can hydrate DTCG tokens without
|
|
22
|
-
* re-emitting them to disk. Null when the run had no tokens. */
|
|
23
|
-
tokensPath?: string | null;
|
|
24
|
-
/** Pre-fill space id (from the run record's pushedTo or credentials.json). */
|
|
25
|
-
initialSpaceId?: string;
|
|
26
|
-
/** Pre-fill environment id (from the run record's pushedTo or credentials.json). */
|
|
27
|
-
initialEnvironmentId?: string;
|
|
28
|
-
/** Pre-fill host (from the run record's pushedTo or credentials.json). */
|
|
29
|
-
initialHost?: string;
|
|
30
|
-
/** Pre-fill CMA token (from credentials.json / env). */
|
|
31
|
-
initialCmaToken?: string;
|
|
32
|
-
};
|
|
33
|
-
export declare function launchPushWizard(input: PushLauncherInput): Promise<void>;
|
|
34
|
-
export type PickerPushRunOptions = {
|
|
35
|
-
runIdOrPath: string;
|
|
36
|
-
/** From `--space-id` flag. */
|
|
37
|
-
spaceId?: string;
|
|
38
|
-
/** From `--environment-id` flag. */
|
|
39
|
-
environmentId?: string;
|
|
40
|
-
/** From `--cma-token` flag. */
|
|
41
|
-
cmaToken?: string;
|
|
42
|
-
/** From `--host` flag. */
|
|
43
|
-
host?: string;
|
|
44
|
-
/** When true, bypass the source/saved-file staleness check. */
|
|
45
|
-
force?: boolean;
|
|
46
|
-
};
|
|
47
|
-
/**
|
|
48
|
-
* Interactive picker-Push entry point. Resolves the run record, applies the
|
|
49
|
-
* staleness gate, layers credentials (flag → pushedTo → credentials.json),
|
|
50
|
-
* and mounts the wizard via `launchPushWizard`.
|
|
51
|
-
*/
|
|
52
|
-
export declare function pickerPushRun(opts: PickerPushRunOptions): Promise<void>;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export type ReplayRunOptions = {
|
|
2
|
-
runIdOrPath: string;
|
|
3
|
-
/** From `--space-id` flag. */
|
|
4
|
-
spaceId?: string;
|
|
5
|
-
/** From `--environment-id` flag. */
|
|
6
|
-
environmentId?: string;
|
|
7
|
-
/** From `--cma-token` flag (or CONTENTFUL_MANAGEMENT_TOKEN env). */
|
|
8
|
-
cmaToken?: string;
|
|
9
|
-
/** From `--host` flag. */
|
|
10
|
-
host?: string;
|
|
11
|
-
/**
|
|
12
|
-
* When true (interactive TTY), prompt for missing credentials via the
|
|
13
|
-
* wizard's CredentialsStep. When false (non-TTY / CI), throw with the
|
|
14
|
-
* pinned error string from the spec.
|
|
15
|
-
*/
|
|
16
|
-
interactive?: boolean;
|
|
17
|
-
/** When true, bypass the source/saved-file staleness check. */
|
|
18
|
-
force?: boolean;
|
|
19
|
-
/** From `--allow-deletions` flag. Forwarded verbatim to the pushed session's apply request. */
|
|
20
|
-
allowDeletions?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Test seam: replace the interactive prompt with a deterministic resolver.
|
|
23
|
-
* The CLI surface never sets this; only used by tests.
|
|
24
|
-
*/
|
|
25
|
-
promptForCredentials?: (need: {
|
|
26
|
-
spaceId?: string;
|
|
27
|
-
environmentId?: string;
|
|
28
|
-
cmaToken?: string;
|
|
29
|
-
host?: string;
|
|
30
|
-
}) => Promise<{
|
|
31
|
-
spaceId: string;
|
|
32
|
-
environmentId: string;
|
|
33
|
-
cmaToken: string;
|
|
34
|
-
host: string;
|
|
35
|
-
}>;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Push a prior run's recorded pipeline.db session directly to Contentful
|
|
39
|
-
* without re-running extraction or generation, and without writing any
|
|
40
|
-
* components.json / tokens.json to disk.
|
|
41
|
-
*
|
|
42
|
-
* Exposed as `experiences import --push-from-run <id-or-path>`.
|
|
43
|
-
*
|
|
44
|
-
* Credentials resolution order:
|
|
45
|
-
* 1. Flags on the command (`--space-id`, `--environment-id`, `--cma-token`,
|
|
46
|
-
* `--host`).
|
|
47
|
-
* 2. The run record's `pushedTo` field (space / env / host only — the
|
|
48
|
-
* CMA token is never persisted).
|
|
49
|
-
* 3. `~/.config/experiences/credentials.json` (the `experiences setup`
|
|
50
|
-
* store) and matching env vars.
|
|
51
|
-
* 4. If still incomplete and interactive: open the wizard's existing
|
|
52
|
-
* credentials step. If non-TTY: error.
|
|
53
|
-
*/
|
|
54
|
-
export declare function replayRun(opts: ReplayRunOptions): Promise<void>;
|
|
55
|
-
export type ModifyRunOptions = {
|
|
56
|
-
runIdOrPath: string;
|
|
57
|
-
saveAsNew?: boolean;
|
|
58
|
-
overwrite?: boolean;
|
|
59
|
-
outDir?: string;
|
|
60
|
-
/** When true, bypass the source/saved-file staleness check. */
|
|
61
|
-
force?: boolean;
|
|
62
|
-
/** From `--allow-deletions` flag. Forwarded through the modify wizard's push step. */
|
|
63
|
-
allowDeletions?: boolean;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Re-open the wizard with a prior run's extract/generate session pre-populated
|
|
67
|
-
* so the operator can tweak fields. Exposed as
|
|
68
|
-
* `experiences import --modify <id-or-path>`. Default entry step is
|
|
69
|
-
* `final-review`.
|
|
70
|
-
*/
|
|
71
|
-
export declare function modifyRun(opts: ModifyRunOptions): Promise<void>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type RunRecord } from './store.js';
|
|
2
|
-
/**
|
|
3
|
-
* Decide whether a positional CLI arg refers to a run-id or a filesystem path,
|
|
4
|
-
* then look up the corresponding RunRecord.
|
|
5
|
-
*
|
|
6
|
-
* Mirrors `git checkout` accepting either a sha or a ref: anything that *looks
|
|
7
|
-
* like* a path is treated as one; otherwise we fall back to a run-id lookup.
|
|
8
|
-
*
|
|
9
|
-
* Path detection: arg starts with `/`, `./`, `../`, or `~/`, OR equals `.`,
|
|
10
|
-
* OR equals `~`.
|
|
11
|
-
*/
|
|
12
|
-
export declare function resolveRunTarget(arg: string): Promise<RunRecord>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { type RunRecord } from './store.js';
|
|
2
|
-
/**
|
|
3
|
-
* Flags whose presence suppresses the run-picker. The picker is meant for the
|
|
4
|
-
* fresh interactive `experiences import` entry point; any flag that already
|
|
5
|
-
* routes the wizard down a non-default path means the operator has been
|
|
6
|
-
* specific about intent, so we honor that and skip silently.
|
|
7
|
-
*
|
|
8
|
-
* Flag names match the camelCase option object commander hands to the action
|
|
9
|
-
* handler (see `command.ts`).
|
|
10
|
-
*/
|
|
11
|
-
export type RunPickerFlags = {
|
|
12
|
-
pushFromRun?: string;
|
|
13
|
-
modify?: string;
|
|
14
|
-
/** Set only when the operator explicitly passed `--project`. */
|
|
15
|
-
project?: string;
|
|
16
|
-
autoAcceptScope?: boolean;
|
|
17
|
-
printPrompt?: boolean;
|
|
18
|
-
dryRun?: boolean;
|
|
19
|
-
};
|
|
20
|
-
export type ShouldShowRunPickerInput = {
|
|
21
|
-
flags: RunPickerFlags;
|
|
22
|
-
isTTY: boolean;
|
|
23
|
-
/** Absolute path to runs.json. Defaults to the platform-standard path. */
|
|
24
|
-
runsJsonPath?: string;
|
|
25
|
-
};
|
|
26
|
-
export type ShouldShowRunPickerResult = {
|
|
27
|
-
shouldShow: boolean;
|
|
28
|
-
runs: RunRecord[];
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Pure decision helper for whether the wizard should open with the run picker.
|
|
32
|
-
*
|
|
33
|
-
* Picker shows iff ALL hold:
|
|
34
|
-
* 1. `~/.config/experiences/runs.json` exists
|
|
35
|
-
* 2. The file has >=1 run entry
|
|
36
|
-
* 3. None of `--push-from-run`, `--modify`, `--project`,
|
|
37
|
-
* `--auto-accept-scope`, `--print-prompt`, or `--dry-run` were passed
|
|
38
|
-
* 4. stdin is a TTY
|
|
39
|
-
*
|
|
40
|
-
* On any failure (including ENOENT or a parse error), the helper returns
|
|
41
|
-
* `{ shouldShow: false, runs: [] }`. We deliberately swallow parse errors
|
|
42
|
-
* here: the wizard's normal entry point is more important than surfacing a
|
|
43
|
-
* malformed runs.json — the operator can still use `experiences runs ls` to
|
|
44
|
-
* diagnose later.
|
|
45
|
-
*/
|
|
46
|
-
export declare function shouldShowRunPicker(input: ShouldShowRunPickerInput): Promise<ShouldShowRunPickerResult>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { RunRecord } from './store.js';
|
|
3
|
-
type RunPickerAction = 'push' | 'modify' | 'new';
|
|
4
|
-
export type RunPickerSelection = {
|
|
5
|
-
/** null only when `action === 'new'`. */
|
|
6
|
-
runId: string | null;
|
|
7
|
-
action: RunPickerAction;
|
|
8
|
-
};
|
|
9
|
-
export type RunPickerProps = {
|
|
10
|
-
runs: RunRecord[];
|
|
11
|
-
/** Optional set of run ids that have been classified stale by the
|
|
12
|
-
* invalidation check. Rows in this set render with a dim "(stale)" tag. */
|
|
13
|
-
staleRunIds?: ReadonlySet<string>;
|
|
14
|
-
onSelect: (selection: RunPickerSelection) => void;
|
|
15
|
-
onCancel: () => void;
|
|
16
|
-
};
|
|
17
|
-
export declare function RunPicker({ runs, staleRunIds, onSelect, onCancel }: RunPickerProps): React.ReactElement;
|
|
18
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { RunRecord } from './store.js';
|
|
2
|
-
export type Staleness = {
|
|
3
|
-
stale: boolean;
|
|
4
|
-
/** Component names whose source file's mtime no longer matches the
|
|
5
|
-
* recorded fingerprint. */
|
|
6
|
-
staleComponents: string[];
|
|
7
|
-
/** True when the raw tokens file's mtime OR content hash drifted (or the
|
|
8
|
-
* file went missing). */
|
|
9
|
-
staleTokens: boolean;
|
|
10
|
-
/** True when components.json on disk differs from the hash recorded at
|
|
11
|
-
* save time, OR the file is missing. */
|
|
12
|
-
savedComponentsEdited: boolean;
|
|
13
|
-
/** True when tokens.json on disk differs from the hash recorded at save
|
|
14
|
-
* time, OR the file is missing while a hash was recorded. */
|
|
15
|
-
savedTokensEdited: boolean;
|
|
16
|
-
/** Absolute paths of source files that were fingerprinted but have since
|
|
17
|
-
* disappeared. Empty when nothing is missing. */
|
|
18
|
-
missingSourceFiles: string[];
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Re-stat the source files and re-hash the saved artifacts captured by a
|
|
22
|
-
* run record's fingerprints, and report what (if anything) drifted.
|
|
23
|
-
*
|
|
24
|
-
* Returns `stale: false` when the run is missing a source fingerprint
|
|
25
|
-
* entirely (v2 records pre-dating runs.json v3 — treat as UNKNOWN, not
|
|
26
|
-
* stale, so existing runs keep replaying).
|
|
27
|
-
*/
|
|
28
|
-
export declare function checkRunStaleness(run: RunRecord): Promise<Staleness>;
|
|
29
|
-
/**
|
|
30
|
-
* Render a short human-readable summary of a Staleness result, e.g.
|
|
31
|
-
* `src: 3, tokens, saved`. Returns the empty string when not stale.
|
|
32
|
-
*/
|
|
33
|
-
export declare function shortStalenessSummary(s: Staleness): string;
|
|
34
|
-
/**
|
|
35
|
-
* Render a multi-line detail block for staleness output (used by `runs <id>`
|
|
36
|
-
* detail view and replay refusals). Caps long lists at 5 entries.
|
|
37
|
-
*/
|
|
38
|
-
export declare function formatStalenessDetail(s: Staleness): string[];
|