/** * Release configuration loader and validator. * * Loads release configuration with the following precedence (highest wins): * 1. .cleo/release-config.json (project-specific, T820 RELEASE-01) * 2. .cleo/config.json release section * 3. Built-in defaults * * This enables downstream CLEO-using projects to configure their own release * pipeline without touching the parent config.json. * * @task T4454 * @task T820 * @epic T4454 */ /** * Flat project-level release config shape as read from `.cleo/release-config.json`. * * Schema is deliberately flat to keep the file readable and diff-friendly. * All fields are optional — only override what differs from the defaults. * * @task T820 RELEASE-01 * @task T9095 — PR-required flow + branch model config */ export interface ProjectReleaseConfig { /** Versioning scheme: 'calver' | 'semver' | 'custom'. Default: 'calver'. */ versionScheme?: string; /** Git tag prefix. Default: 'v'. */ tagPrefix?: string; /** * Git workflow mode. * - 'direct': push commit+tag directly to remote (default) * - 'pr': open a draft PR, await review, merge, then tag */ gitWorkflow?: 'direct' | 'pr'; /** * Branch model for release flow (T9095). * - 'feat-to-main': release branch is cut from main, PR targets main (default) * - 'feat-to-develop-to-main': PR targets develop; develop→main is a separate merge */ branchModel?: 'feat-to-main' | 'feat-to-develop-to-main'; /** * Whether every release MUST go through a PR (T9095). * Default: true. There is NO override flag — use this field to opt out (not recommended). */ prRequired?: boolean; /** * Prefix for automatically-created release branches (T9095). * Default: 'release/'. Example: 'release/v2026.5.43' */ releaseBranchPrefix?: string; /** Registries to publish to: 'npm' | 'crates' | 'docker' | 'none'. Default: []. */ registries?: Array<'npm' | 'crates' | 'docker' | 'none'>; /** Pre-release channel suffix (e.g. 'alpha', 'beta', 'rc'). */ prereleaseChannel?: string; /** Changelog file path relative to project root. Default: 'CHANGELOG.md'. */ changelogFile?: string; /** Changelog format: 'keepachangelog' | 'conventional' | 'custom'. Default: 'keepachangelog'. */ changelogFormat?: string; /** Artifact type for composition chain. Default: 'generic-tarball'. */ artifactType?: string; /** * Paths to check for build artifacts, relative to project root. * If empty, defaults to ['dist', 'build', 'out']. * Set to [] to skip the build artifact gate entirely. */ buildArtifactPaths?: string[]; /** Whether to skip the build artifact gate. Default: false. */ skipBuildArtifactGate?: boolean; /** Extra release gates to run as shell commands. */ gates?: Array<{ name: string; command: string; required?: boolean; }>; /** Version bump file targets. */ versionBump?: { files: Array<{ file: string; strategy: 'plain' | 'json' | 'toml' | 'sed'; field?: string; }>; }; /** Security settings. */ security?: { enableProvenance?: boolean; slsaLevel?: number; requireSignedCommits?: boolean; }; /** * Maximum milliseconds to wait for a PR to reach MERGED state after * `gh pr merge` is called (T9504). Default: 300_000 (5 minutes). */ mergeWaitMs?: number; } /** Release configuration shape. */ export interface ReleaseConfig { versioningScheme: string; tagPrefix: string; changelogFormat: string; changelogFile: string; artifactType: string; /** * Git workflow mode — project-agnostic override from release-config.json. * 'direct' | 'pr'. Mirrors ProjectReleaseConfig.gitWorkflow. * @task T820 RELEASE-01 */ gitWorkflow?: 'direct' | 'pr'; /** * Branch model for the PR-required release flow (T9095). * 'feat-to-main' | 'feat-to-develop-to-main'. Default: 'feat-to-main'. */ branchModel?: 'feat-to-main' | 'feat-to-develop-to-main'; /** * Whether releases must go through a PR. Default: true (T9095). * Set to false only when the branch model doesn't support PRs (uncommon). */ prRequired?: boolean; /** * Prefix for auto-created release branches (T9095). Default: 'release/'. */ releaseBranchPrefix?: string; /** * Registries to publish to after tagging. * @task T820 RELEASE-01 */ registries?: Array<'npm' | 'crates' | 'docker' | 'none'>; /** * Pre-release channel suffix. * @task T820 RELEASE-01 */ prereleaseChannel?: string; /** * Paths to check for build artifacts, relative to project root. * Empty array means use defaults (['dist', 'build', 'out']). * @task T820 RELEASE-01 */ buildArtifactPaths?: string[]; /** * Skip the build artifact gate entirely. * Useful for source-only or documentation releases. * @task T820 RELEASE-01 */ skipBuildArtifactGate?: boolean; gates: ReleaseGate[]; versionBump: { files: Array<{ file: string; strategy: string; field?: string; }>; }; security: { enableProvenance: boolean; slsaLevel: number; requireSignedCommits: boolean; }; gitflow?: GitFlowConfig; channels?: ChannelConfig; push?: { mode?: PushMode; }; /** * Maximum milliseconds to wait for a PR to reach MERGED state after * `gh pr merge` is called (T9504). Default: 300_000 (5 minutes). */ mergeWaitMs?: number; } /** Release gate definition. */ export interface ReleaseGate { name: string; type: 'tests' | 'lint' | 'audit' | 'custom'; command: string; required: boolean; } /** * Load release configuration with defaults. * * Merges configuration from three sources (highest precedence first): * 1. `.cleo/release-config.json` — project-specific override (T820 RELEASE-01) * 2. `.cleo/config.json` release section — legacy config location * 3. Built-in defaults * * @task T820 RELEASE-01 */ export declare function loadReleaseConfig(cwd?: string): ReleaseConfig; /** Validate release configuration. */ export declare function validateReleaseConfig(config: ReleaseConfig): { valid: boolean; errors: string[]; warnings: string[]; }; /** Get artifact type from config. */ export declare function getArtifactType(cwd?: string): string; /** Get release gates from config. */ export declare function getReleaseGates(cwd?: string): ReleaseGate[]; /** Get changelog configuration. */ export declare function getChangelogConfig(cwd?: string): { format: string; file: string; }; /** GitFlow branch configuration. */ export interface GitFlowConfig { enabled: boolean; branches: { main: string; develop: string; featurePrefix: string; hotfixPrefix: string; releasePrefix: string; }; } /** Channel-to-branch mapping for npm dist-tag resolution. */ export interface ChannelConfig { main: string; develop: string; feature: string; custom?: Record; } /** Push mode: direct push vs PR creation vs auto-detect. */ export type PushMode = 'direct' | 'pr' | 'auto'; /** Return the default GitFlow branch configuration. */ export declare function getDefaultGitFlowConfig(): GitFlowConfig; /** Merge caller-supplied GitFlow config with defaults. */ export declare function getGitFlowConfig(config: ReleaseConfig): GitFlowConfig; /** Return the default channel configuration. */ export declare function getDefaultChannelConfig(): ChannelConfig; /** Merge caller-supplied channel config with defaults. */ export declare function getChannelConfig(config: ReleaseConfig): ChannelConfig; /** * Return the configured push mode, defaulting to 'auto'. * * Precedence: * 1. release-config.json gitWorkflow ('direct' → 'direct', 'pr' → 'pr') * 2. config.json release.push.mode * 3. 'auto' (detect from branch protection) * * @task T820 RELEASE-01 */ export declare function getPushMode(config: ReleaseConfig): PushMode; /** * Result of loading branch model config for the PR-required release flow. * * @task T9095 */ export interface ReleaseBranchConfig { /** Branch model in use. Default: 'feat-to-main'. */ branchModel: 'feat-to-main' | 'feat-to-develop-to-main'; /** Whether every release must go through a PR. Default: true. */ prRequired: boolean; /** Prefix for release branches. Default: 'release/'. */ releaseBranchPrefix: string; /** * The PR target branch determined by the branch model. * - 'feat-to-main': 'main' * - 'feat-to-develop-to-main': 'develop' */ prTargetBranch: string; } /** * Derive the PR target branch from the branch model and gitflow config. * * @task T9095 */ export declare function getReleaseBranchConfig(config: ReleaseConfig, cwd?: string): ReleaseBranchConfig; //# sourceMappingURL=release-config.d.ts.map