/**
 * SpecWeave Configuration Types
 *
 * Defines the structure for .specweave/config.json
 *
 * @module core/config/types
 */
import type { SyncOrchestrationConfig } from '../types/sync-config.js';
import type { PluginConfig } from '../types/plugin.js';
import { IncrementType } from '../types/increment-metadata.js';
/**
 * Repository provider types
 */
export type RepositoryProvider = 'local' | 'github' | 'bitbucket' | 'ado' | 'gitlab' | 'generic';
/**
 * Git URL format types (v1.0.7+)
 */
export type GitUrlFormat = 'ssh' | 'https';
/**
 * Issue tracker provider types
 */
export type IssueTrackerProvider = 'none' | 'jira' | 'github' | 'ado';
/**
 * Jira instance types
 */
export type JiraInstanceType = 'cloud' | 'server';
/**
 * Jira organization strategies
 */
export type JiraStrategy = 'single-project' | 'project-per-team' | 'component-based' | 'board-based';
/**
 * Sync direction types
 */
export type SyncDirection = 'import' | 'export' | 'bidirectional';
/**
 * Repository configuration
 */
export interface RepoConfig {
    name: string;
    url: string;
    path?: string;
    branch?: string;
    specweaveProject?: string;
}
/**
 * Jira project configuration
 */
export interface JiraProjectConfig {
    key: string;
    id?: string;
    name?: string;
    specweaveProject?: string;
}
/**
 * Jira board configuration
 */
export interface JiraBoardConfig {
    id: string;
    name?: string;
}
/**
 * Repository configuration section
 */
export interface RepositoryConfiguration {
    provider: RepositoryProvider;
    organization?: string;
    repos?: RepoConfig[];
    /** Git URL format preference (SSH or HTTPS) - v1.0.7+ */
    gitUrlFormat?: GitUrlFormat;
}
/**
 * Issue tracker configuration section
 */
export interface IssueTrackerConfiguration {
    provider: IssueTrackerProvider;
    domain?: string;
    instanceType?: JiraInstanceType;
    strategy?: JiraStrategy;
    projects?: JiraProjectConfig[];
    components?: string[];
    boards?: JiraBoardConfig[];
    owner?: string;
    repo?: string;
    repos?: string[];
    organization_ado?: string;
    project?: string;
}
/**
 * Sync profile configuration (simplified for config serialization)
 *
 * NOTE: This is a SIMPLIFIED type for config.json serialization.
 * For the full operational type with all fields (strategy, hierarchyMapping, etc.),
 * use `SyncProfile` from `../types/sync-profile.js` instead.
 *
 * @see ../types/sync-profile.ts for the full operational type
 */
export interface SyncProfile {
    provider: string;
    displayName: string;
    config: {
        owner?: string;
        repo?: string;
        domain?: string;
        projectKey?: string;
        projects?: string[];
        organization?: string;
        project?: string;
        monorepoProjects?: string[];
    };
    timeRange: {
        default: string;
        max: string;
    };
    rateLimits?: {
        maxItemsPerSync: number;
        warnThreshold: number;
    };
}
/**
 * Sync settings
 */
export interface SyncSettings {
    canUpsertInternalItems: boolean;
    canUpdateExternalItems: boolean;
    canUpdateStatus: boolean;
    /**
     * GATE 3: Controls automatic sync on increment completion
     * When true, sync happens automatically when increment completes
     * When false, user must manually trigger sync via sw:github-sync
     * @default true (opt-in UX, as per ADR-0065)
     */
    autoSyncOnCompletion?: boolean;
}
/**
 * GitHub-specific configuration
 */
export interface GitHubConfig {
    /**
     * GATE 4: Enable/disable GitHub sync specifically
     * @default true (when GitHub is configured)
     */
    enabled?: boolean;
    owner?: string;
    repo?: string;
}
/**
 * Jira-specific configuration
 */
export interface JiraConfig {
    /**
     * GATE 4: Enable/disable Jira sync specifically
     * @default false (opt-in)
     */
    enabled?: boolean;
    domain?: string;
    projectKey?: string;
}
/**
 * Azure DevOps-specific configuration
 */
export interface AzureDevOpsConfig {
    /**
     * GATE 4: Enable/disable Azure DevOps sync specifically
     * @default false (opt-in)
     */
    enabled?: boolean;
    organization?: string;
    project?: string;
}
/**
 * Sync configuration section
 */
export interface SyncConfiguration {
    enabled: boolean;
    direction: SyncDirection;
    autoSync: boolean;
    includeStatus: boolean;
    autoApplyLabels: boolean;
    provider?: string;
    /**
     * Sync trigger mode (0618):
     * - "queued" (default): Triggers queue events to pending.jsonl; drained by CLI commands
     * - "immediate" (legacy): Triggers call LivingDocsSync/SyncCoordinator directly
     * @default 'queued'
     */
    mode?: 'queued' | 'immediate';
    /**
     * Default profile (fallback when increment doesn't specify one)
     */
    defaultProfile?: string;
    /**
     * GATE 5: Auto-create external issues on increment creation (v1.0.19+)
     *
     * When true, automatically creates GitHub/JIRA/ADO issues when:
     * - A new increment is created (post-increment-planning hook)
     * - sync-progress runs and no issue exists
     *
     * When false (default), user must manually run:
     * - sw-github:create for GitHub
     * - sw-jira:create for JIRA
     * - sw-ado:create for Azure DevOps
     *
     * @default false (opt-in for safety)
     */
    autoCreateOnIncrement?: boolean;
    settings?: SyncSettings;
    profiles?: Record<string, SyncProfile>;
    github?: GitHubConfig;
    jira?: JiraConfig;
    ado?: AzureDevOpsConfig;
    /**
     * Orchestration configuration (scheduler, permissions, discrepancy, notifications)
     * Added in v0.29.0 for Unified Sync Orchestration feature
     */
    orchestration?: SyncOrchestrationConfig;
}
/**
 * Hook configuration
 */
export interface HookConfiguration {
    post_task_completion?: {
        sync_tasks_md?: boolean;
        external_tracker_sync?: boolean;
    };
    post_increment_planning?: {
        auto_create_github_issue?: boolean;
        sync_living_docs?: boolean;
    };
    post_increment_done?: {
        sync_living_docs?: boolean;
        sync_to_github_project?: boolean;
        close_github_issue?: boolean;
        close_jira_issue?: boolean;
        close_ado_work_item?: boolean;
        /** Generic flag — applies to all providers as fallback */
        close_external_issue?: boolean;
        update_living_docs_first?: boolean;
    };
    /**
     * Session-start banner that surfaces plugin/skill update warnings
     * (increment 0796). The banner runs as a UserPromptSubmit hook on every
     * Claude Code prompt; results are throttled to once per the configured
     * window so it never spams the user.
     */
    banner?: BannerHookConfig;
}
export interface BannerHookConfig {
    /** Disable the session-start banner entirely. Default: false (enabled). */
    disabled?: boolean;
    /**
     * Throttle window in hours between banner re-checks. Allowed range
     * [1, 168] (1 hour to 1 week). Default: 24.
     */
    throttleHours?: number;
}
/**
 * Documentation configuration
 */
export interface DocumentationConfig {
    /** Directories to search for documentation (default: [".specweave/docs"]) */
    directories?: string[];
    preview?: {
        enabled?: boolean;
        autoInstall?: boolean;
        port?: number;
        openBrowser?: boolean;
        theme?: string;
        excludeFolders?: string[];
    };
}
/**
 * Project metadata
 */
export interface ProjectMetadata {
    name?: string;
    version?: string;
    description?: string;
    techStack?: string[];
    team?: string;
}
/**
 * Adapter configuration
 */
export interface AdapterConfiguration {
    default: string;
}
/**
 * Status line configuration
 */
export interface StatusLineConfiguration {
    /**
     * Enable status line display
     */
    enabled: boolean;
    /**
     * Maximum age of cache before showing stale warning (ms)
     */
    maxCacheAge: number;
    /**
     * Width of progress bar (characters)
     */
    progressBarWidth: number;
    /**
     * Maximum length for increment name
     */
    maxNameLength: number;
}
/**
 * Child repo configuration for umbrella mode
 *
 * ID STRATEGY (IMPORTANT):
 * The `id` field should match the canonical name from your source of truth:
 *
 * | Scenario              | ID Source                | Example                          |
 * |-----------------------|--------------------------|----------------------------------|
 * | 1:1 Repo Mapping      | Exact repo name          | `sw-qr-menu-fe`                  |
 * | JIRA Project          | Project key (lowercase)  | `WEBAPP` → `webapp`              |
 * | ADO Project           | Project name (kebab)     | `Frontend Team` → `frontend-team`|
 * | Area Path             | Last segment (kebab)     | `Product\Web` → `web`            |
 * | Monorepo Package      | Package name             | `@acme/frontend` → `frontend`    |
 *
 * RULE: ID should be predictable from source - no arbitrary abbreviations!
 * - ✅ `id: "sw-qr-menu-fe"` (matches repo name)
 * - ❌ `id: "fe"` (arbitrary, what if 2 frontend repos?)
 */
/**
 * Per-child-repo GitHub sync target
 */
export interface ChildRepoGitHubSync {
    owner: string;
    repo: string;
}
/**
 * Per-child-repo Jira sync target
 */
export interface ChildRepoJiraSync {
    projectKey: string;
}
/**
 * Per-child-repo Azure DevOps sync target
 */
export interface ChildRepoAdoSync {
    organization?: string;
    project: string;
}
/**
 * Sync configuration for a child repo in umbrella mode
 */
export interface ChildRepoSyncConfig {
    github?: ChildRepoGitHubSync;
    jira?: ChildRepoJiraSync;
    ado?: ChildRepoAdoSync;
}
export interface ChildRepoConfig {
    /**
     * Repo identifier - MUST match canonical source name:
     * - GitHub repo: exact repo name (e.g., 'sw-qr-menu-fe')
     * - JIRA: project key lowercase (e.g., 'webapp')
     * - ADO: project name kebab-case (e.g., 'frontend-team')
     */
    id: string;
    /** Path to repo (relative or absolute) */
    path: string;
    /** Display name (defaults to id if not set) */
    name?: string;
    /**
     * User story prefix for US-{PREFIX}-001 format.
     * Can be short (FE, BE) even if id is long.
     * Example: id='sw-qr-menu-fe', prefix='FE' → US-FE-001
     */
    prefix: string;
    /** GitHub URL for this repo */
    githubUrl?: string;
    /** JIRA project key (if JIRA is source of truth for this project) */
    jiraProject?: string;
    /** ADO project name (if ADO is source of truth for this project) */
    adoProject?: string;
    /** Tech stack keywords for story routing */
    techStack?: string[];
    /** Repository role (frontend, backend, mobile, infra, shared, other) */
    role?: string;
    /** Per-repo sync targets for distributed sync routing */
    sync?: ChildRepoSyncConfig;
}
/**
 * Umbrella/multi-repo configuration
 */
export interface UmbrellaConfig {
    /** Enable umbrella mode */
    enabled: boolean;
    /** Optional parent/coordination repo name */
    parentRepo?: string;
    /** Umbrella project name for umbrella-scoped increments (distinct from child repos) */
    projectName?: string;
    /** Child repos with their prefixes */
    childRepos: ChildRepoConfig[];
    /** Story routing configuration */
    storyRouting?: {
        /** Enable automatic story routing by keywords */
        enabled: boolean;
        /** Default repo for cross-cutting stories */
        defaultRepo: string;
    };
    /** Sync targets for the umbrella project itself (used when project matches umbrella.projectName) */
    sync?: ChildRepoSyncConfig;
}
/**
 * GitHub project mapping for per-US targeting
 * @since v0.34.0
 */
export interface GitHubProjectMapping {
    /** GitHub owner (org or user) */
    owner: string;
    /** GitHub repository name */
    repo: string;
}
/**
 * JIRA project mapping for per-US targeting
 * @since v0.34.0
 */
export interface JiraProjectMapping {
    /** JIRA project key (e.g., 'FE', 'BE', 'SECURITY') */
    project: string;
    /** Optional JIRA board name for 2-level structures */
    board?: string;
}
/**
 * ADO project mapping for per-US targeting
 * @since v0.34.0
 */
export interface AdoProjectMapping {
    /** ADO project name */
    project: string;
    /** Optional ADO area path (e.g., 'infrastructure/security') */
    areaPath?: string;
}
/**
 * External tool mappings for a single project
 * Each project can be mapped to multiple external tools
 * @since v0.34.0
 */
export interface ProjectMapping {
    /** GitHub repository mapping */
    github?: GitHubProjectMapping;
    /** JIRA project mapping */
    jira?: JiraProjectMapping;
    /** Azure DevOps project mapping */
    ado?: AdoProjectMapping;
}
/**
 * Project mappings for cross-project targeting
 * Maps SpecWeave project IDs to external tool targets
 * @since v0.34.0
 *
 * @example
 * ```json
 * {
 *   "frontend-app": {
 *     "github": { "owner": "myorg", "repo": "frontend-app" }
 *   },
 *   "backend-api": {
 *     "jira": { "project": "BE", "board": "api-team" }
 *   }
 * }
 * ```
 */
export type ProjectMappings = Record<string, ProjectMapping>;
/**
 * Backward-compatible aliases for mapping types
 * @deprecated Use GitHubProjectMapping, JiraProjectMapping, AdoProjectMapping
 */
export type GitHubMapping = GitHubProjectMapping;
export type JiraMapping = JiraProjectMapping;
export type AdoMapping = AdoProjectMapping;
/**
 * Supported languages for SpecWeave
 * Re-exported here for config type completeness
 */
export type SupportedLanguage = 'en' | 'ru' | 'es' | 'zh' | 'de' | 'fr' | 'ja' | 'ko' | 'pt';
/**
 * Translation scope - what gets auto-translated
 *
 * CRITICAL: Translation can ~2x token usage
 * User MUST explicitly opt-in during init
 */
export interface TranslationScope {
    /** Auto-translate spec.md, plan.md, tasks.md after creation */
    incrementSpecs: boolean;
    /** Auto-translate living docs on update */
    livingDocs: boolean;
    /** Auto-translate GitHub/JIRA/ADO issues on sync */
    externalSync: boolean;
}
/**
 * Translation configuration
 *
 * Controls automatic translation of SpecWeave content.
 * English is always the source language (for maintainability).
 * User's configured language is the output language.
 */
export interface TranslationConfiguration {
    /**
     * Master switch for auto-translation
     * When false, user must use sw:translate manually
     */
    enabled: boolean;
    /**
     * Enabled languages for this project
     * Always includes 'en' as source language
     */
    languages: SupportedLanguage[];
    /**
     * Primary output language for user
     * This is the language content will be translated TO
     */
    primary: SupportedLanguage;
    /**
     * Translation method
     * - 'auto': Hooks trigger translation automatically
     * - 'manual': User must run sw:translate
     * - 'none': Translation disabled entirely
     */
    method: 'auto' | 'manual' | 'none';
    /**
     * Keep SpecWeave framework terms in English
     * e.g., increment, spec.md, tasks.md, sw:*
     */
    preserveFrameworkTerms: boolean;
    /**
     * What to auto-translate (only when method='auto')
     */
    scope: TranslationScope;
    /**
     * Keep English originals as .en.md files
     * Safer option but uses more storage
     */
    keepEnglishOriginals: boolean;
}
/**
 * Per-repo sync targets for workspace repos
 * Structurally equivalent to ChildRepoSyncConfig but without legacy field names
 */
export interface WorkspaceRepoSync {
    github?: {
        owner: string;
        repo: string;
        direction?: string;
    };
    jira?: {
        projectKey: string;
        domain?: string;
    };
    ado?: {
        organization?: string;
        project: string;
    };
}
/**
 * A repository within a workspace
 */
export interface WorkspaceRepo {
    /** Repo identifier — MUST match canonical source name */
    id: string;
    /** Path to repo (relative or absolute). May be absent in configs parsed from JSON. */
    path?: string;
    /** User story prefix for US-{PREFIX}-001 format */
    prefix: string;
    /** Display name (defaults to id if not set) */
    name?: string;
    /** Tech stack keywords for story routing */
    techStack?: string[];
    /** Repository role (frontend, backend, mobile, infra, shared, other) */
    role?: string;
    /** Sync targets for this repo */
    sync?: WorkspaceRepoSync;
}
/**
 * Unified workspace configuration
 * Replaces umbrella, multiProject, and projectMappings
 */
export interface WorkspaceConfig {
    /** Workspace display name */
    name: string;
    /** Sync targets for the root/umbrella repo itself */
    rootRepo?: WorkspaceRepoSync;
    /** All repos in this workspace */
    repos: WorkspaceRepo[];
}
/**
 * Testing mode options
 */
export type TestMode = 'TDD' | 'test-after' | 'manual' | 'none';
/**
 * TDD Enforcement Level
 * @since 1.0.111
 */
export type TDDEnforcement = 'strict' | 'warn' | 'off';
/**
 * Coverage target configuration.
 *
 * unit/integration: Istanbul/c8 line coverage percentage (0–100).
 * e2e: percentage of written e2e tests that must pass (not line coverage —
 *      Playwright does not produce Istanbul reports). 100 = all written
 *      e2e tests must pass; lower values are not meaningful in practice.
 */
export interface CoverageTargets {
    /** Istanbul/c8 line coverage % for unit tests */
    unit: number;
    /** Istanbul/c8 line coverage % for integration tests */
    integration: number;
    /** Pass-rate % for written e2e tests (not line coverage) */
    e2e: number;
}
/**
 * Playwright browser automation configuration
 */
export interface PlaywrightConfig {
    preferCli?: boolean;
    cliFlags?: string[];
}
/**
 * Testing configuration
 */
export interface TestingConfig {
    defaultTestMode: TestMode;
    defaultCoverageTarget: number;
    coverageTargets: CoverageTargets;
    tddEnforcement?: TDDEnforcement;
    playwright?: PlaywrightConfig;
}
/**
 * WIP Limits Configuration (v0.7.0+)
 */
export interface LimitsConfig {
    maxActiveIncrements?: number;
    hardCap?: number;
    allowEmergencyInterrupt?: boolean;
    typeBehaviors?: {
        canInterrupt?: (IncrementType | string)[];
        autoAbandonDays?: {
            experiment?: number;
        };
    };
    staleness?: {
        paused?: number;
        active?: number;
    };
}
/**
 * Global command deduplication configuration (v0.17.18+)
 */
export interface DeduplicationConfig {
    enabled?: boolean;
    windowMs?: number;
    maxCacheSize?: number;
    debug?: boolean;
    cleanupIntervalMs?: number;
}
/**
 * Archiving Configuration
 */
export interface ArchivingConfig {
    keepLast?: number;
    autoArchive?: boolean;
    autoArchiveThreshold?: number;
    archiveAfterDays?: number;
    preserveActive?: boolean;
    archiveCompleted?: boolean;
    archivePatterns?: string[];
    preserveList?: string[];
}
/**
 * Living Docs Configuration (v0.21.4+)
 */
export interface LivingDocsConfig {
    copyBasedSync?: {
        enabled?: boolean;
        autoGenerate?: boolean;
    };
    threeLayerSync?: {
        enabled?: boolean;
        autoSync?: boolean;
    };
}
/**
 * API Documentation Configuration (v1.0.58+)
 */
export interface ApiDocsConfig {
    enabled?: boolean;
    openApiPath?: string;
    autoGenerateOpenApi?: boolean;
    generatePostman?: boolean;
    postmanPath?: string;
    postmanEnvPath?: string;
    generateOn?: 'on-increment-done' | 'on-api-change' | 'manual';
    watchPatterns?: string[];
    baseUrl?: string;
}
/**
 * Plugin Auto-Load Configuration (v1.0.140+)
 */
export interface PluginAutoLoadConfig {
    enabled?: boolean;
    suggestOnly?: boolean;
}
/**
 * Increment Assist Configuration (v1.0.141+)
 */
export interface IncrementAssistConfig {
    enabled?: boolean;
    suggestNewIncrement?: boolean;
    suggestReopen?: boolean;
    confidenceThreshold?: number;
    mandatory?: boolean;
}
/**
 * Deep Interview Mode Configuration (v1.0.195+)
 */
export interface DeepInterviewConfig {
    enabled?: boolean;
    minQuestions?: number;
    categories?: Array<'architecture' | 'integrations' | 'ui-ux' | 'performance' | 'security' | 'edge-cases'>;
}
/**
 * Planning Configuration (v1.0.195+)
 */
export interface PlanningConfig {
    deepInterview?: DeepInterviewConfig;
}
/**
 * Git branching configuration for pr-based push strategy (v1.0.437+)
 */
export interface GitConfig {
    /** Branch name prefix for increment branches. Default: 'sw/' */
    branchPrefix?: string;
    /** Target branch for pull requests. Default: 'main' */
    targetBranch?: string;
    /** Auto-delete branch after PR merge. Default: true */
    deleteOnMerge?: boolean;
    /** Include external ticket key (JIRA/ADO) as branch prefix. Default: false */
    includeExternalKey?: boolean;
}
/**
 * Environment definition for release promotion (v1.0.437+, enterprise)
 */
export interface EnvironmentConfig {
    /** Environment name (e.g., 'dev', 'staging', 'prod') */
    name: string;
    /** Target branch for this environment */
    branch?: string;
    /** Whether manual approval is required to promote to this env */
    requiresApproval?: boolean;
}
/**
 * Release strategy configuration (v1.0.437+, enterprise)
 */
export interface ReleaseConfig {
    /** Release strategy: 'trunk' (default), 'gitflow', 'env-promotion' */
    strategy?: 'trunk' | 'gitflow' | 'env-promotion';
    /** Ordered list of environments for env-promotion strategy */
    environments?: EnvironmentConfig[];
}
/**
 * CI/CD Configuration (v1.0.231+)
 * Controls push strategy, auto-fix behavior, and monitoring defaults.
 * The cicd config-loader reads from this section first, then falls back to env vars.
 */
export interface CiCdConfig {
    /** Push strategy: 'direct' pushes to branch, 'pr-based' creates pull requests */
    pushStrategy: 'direct' | 'pr-based';
    /** Git branching configuration for pr-based push strategy (v1.0.437+) */
    git?: GitConfig;
    /** Release strategy and environment promotion (v1.0.437+, enterprise) */
    release?: ReleaseConfig;
    /** Auto-fix configuration for CI failures */
    autoFix: {
        /** Enable automatic fix attempts on CI failure */
        enabled: boolean;
        /** Maximum retry attempts before giving up */
        maxRetries: number;
        /** Branches where auto-fix is allowed */
        allowedBranches: string[];
    };
    /** Monitoring configuration (optional, overrides env vars) */
    monitoring?: {
        /** Poll interval in milliseconds */
        pollInterval: number;
        /** Auto-notify on workflow completion */
        autoNotify: boolean;
    };
}
/**
 * Multi-Project Configuration (v1.0.0+)
 */
export interface MultiProjectConfig {
    enabled?: boolean;
    projects?: Record<string, ProjectConfig>;
}
/**
 * Individual Project Configuration
 */
export interface ProjectConfig {
    id?: string;
    name: string;
    description?: string;
    keywords?: string[];
    techStack?: string[];
    team?: string;
    externalTools?: {
        github?: {
            repository?: string;
        };
        jira?: {
            project?: string;
        };
        ado?: {
            project?: string;
        };
    };
}
/**
 * Adapter configuration (rich version from types/config.ts)
 */
export interface AdapterConfig {
    default?: 'claude' | 'cursor' | 'generic';
    [key: string]: any;
}
/**
 * Context budget level for hook output size
 */
export type ContextBudgetLevel = 'full' | 'compact' | 'minimal' | 'off';
/**
 * Context budget configuration (v1.0.262+)
 *
 * Controls how much context the UserPromptSubmit hook injects per turn.
 * Reduces "Prompt is too long" errors, especially with image attachments.
 */
export interface ContextBudgetConfig {
    /** Base context budget level. Default: 'full' (2500 chars) */
    level?: ContextBudgetLevel;
    /** Auto-reduce budget when PreCompact fires (context pressure). Default: true */
    autoAdapt?: boolean;
}
/**
 * Grill quality gate configuration
 * Controls whether a grill report is required before increment closure.
 * @since v1.0.337
 */
export interface GrillConfig {
    /** Whether grill report is required before closure. Default: true */
    required?: boolean;
}
/**
 * Code review quality gate configuration
 * Controls whether a code-review report is required before increment closure
 * and configures the fix loop behavior within sw:done.
 * @since v1.0.646
 */
export interface CodeReviewConfig {
    /** Whether code-review report is required before closure. Default: true */
    required?: boolean;
    /** Maximum fix-and-rerun iterations in the sw:done pipeline. Default: 3 */
    maxFixIterations?: number;
    /** Severity levels that block closure. Default: ["critical", "high", "medium"] */
    blockingSeverities?: string[];
}
/**
 * Thinking-budget level for Opus 4.7+ adaptive thinking (0669 Wave 2).
 *
 * - "low" / "medium" / "high" / "xhigh" / "max": adaptive-thinking tiers,
 *   mapped to prompt-hint strength by each skill. "xhigh" is the default
 *   for high-stakes skills (judge-llm, grill).
 * - "legacy": pre-4.7 behavior — passes the retired `thinking` API param
 *   on models that still accept it. Emergency escape hatch only.
 */
export type ThinkingBudgetLevel = 'low' | 'medium' | 'high' | 'xhigh' | 'max' | 'legacy';
/**
 * Quality-gate configuration (0669 Wave 2).
 *
 * Governs how SpecWeave's quality gates (judge-llm, grill, PM interview)
 * spend thinking tokens and interpret model confidence.
 */
export interface QualityConfig {
    /**
     * Default thinking-budget tier for 4.7-family skills.
     * Skills override per-call when a specific tier is required.
     * @default "xhigh"
     */
    thinkingBudget?: ThinkingBudgetLevel;
    /**
     * Minimum model-reported confidence (0–100) a grill finding must clear
     * before it blocks closure. Values below the threshold are demoted to
     * warnings.
     * @default 50
     */
    grillConfidenceThreshold?: number;
    /**
     * Per-stage token budgets keyed by stage ID
     * (e.g., "pm.interview", "brainstorm.idea"). Callers read this map to
     * size their `max_tokens` request field.
     * @default { "pm.interview": 1500, "brainstorm.idea": 1800 }
     */
    tokenBudgets?: Record<string, number>;
}
/**
 * Prompt-caching configuration (0669 Wave 2).
 *
 * Lists the long-lived project files that should be wrapped in an
 * Anthropic SDK `cache_control: { type: "ephemeral" }` block when
 * building API requests. See `src/core/cache/static-context-loader.ts`.
 */
export interface CacheConfig {
    /**
     * Paths (relative to project root) of static files to include in the
     * prompt-cache breakpoint. Missing files are silently skipped. The
     * token `<active>` in a path is expanded to the currently-active
     * increment ID by the caller when appropriate.
     * @default ["CLAUDE.md", ".specweave/config.json",
     *           ".specweave/increments/<active>/spec.md",
     *           ".specweave/increments/<active>/rubric.md"]
     */
    staticContextFiles?: string[];
}
/**
 * Skill generation configuration (v1.0.XXX+)
 *
 * Controls automatic detection of recurring patterns from living docs
 * and on-demand generation of project-local skills.
 */
export interface SkillGenConfig {
    /** Pattern detection trigger: "on-close" runs on increment completion, "off" disables. Default: "on-close" */
    detection?: 'on-close' | 'off';
    /** Whether to print suggestions when patterns qualify. Default: true */
    suggest?: boolean;
    /** Minimum number of increments a pattern must appear in before qualifying. Default: 3 */
    minSignalCount?: number;
    /** Pattern IDs permanently excluded from suggestions (still visible in sw:skill-gen). Default: [] */
    declinedSuggestions?: string[];
    /** Maximum number of signals to retain (prunes lowest-confidence when exceeded). Default: 100 */
    maxSignals?: number;
}
/**
 * Main SpecWeave configuration
 */
export interface SpecWeaveConfig {
    /**
     * Config version for migration support
     */
    version: string;
    /**
     * Project display language
     * Content will be translated TO this language if translation is enabled
     * @default 'en'
     */
    language?: SupportedLanguage;
    /**
     * Translation configuration
     * Controls automatic translation of specs, living docs, and external sync
     *
     * CRITICAL: Translation can ~2x token usage
     * User MUST explicitly opt-in during init
     */
    translation?: TranslationConfiguration;
    /**
     * Project metadata (optional, for backward compatibility)
     */
    project?: ProjectMetadata;
    /**
     * Adapter configuration (optional, for backward compatibility)
     */
    adapters?: AdapterConfiguration;
    /**
     * Hook configuration (optional)
     */
    hooks?: HookConfiguration;
    /**
     * Repository provider configuration
     */
    repository?: RepositoryConfiguration;
    /**
     * Issue tracker configuration
     */
    issueTracker?: IssueTrackerConfiguration;
    /**
     * Sync configuration
     */
    sync?: SyncConfiguration;
    /**
     * Status line configuration (optional)
     */
    statusLine?: StatusLineConfiguration;
    /**
     * Unified workspace configuration (v3.0+)
     * Replaces umbrella, multiProject, and projectMappings
     */
    workspace?: WorkspaceConfig;
    /**
     * Umbrella/multi-repo configuration (optional)
     * @deprecated Use `workspace` instead. Will be auto-migrated on load.
     */
    umbrella?: UmbrellaConfig;
    /**
     * Project mappings for cross-project targeting (v0.34.0+)
     * @deprecated Use `workspace.repos[].sync` instead. Will be auto-migrated on load.
     */
    projectMappings?: ProjectMappings;
    /** Plugin configuration */
    plugins?: PluginConfig;
    /**
     * Multi-project configuration (v1.0.0+)
     * @deprecated Use `workspace` instead. Will be auto-migrated on load.
     */
    multiProject?: MultiProjectConfig;
    /** Testing configuration */
    testing?: TestingConfig;
    /** WIP limits configuration */
    limits?: LimitsConfig;
    /** Global command deduplication configuration (v0.17.18+) */
    deduplication?: DeduplicationConfig;
    /** Archiving configuration for increment management */
    archiving?: ArchivingConfig;
    /** Living docs configuration (v0.21.4+) */
    livingDocs?: LivingDocsConfig;
    /** API documentation configuration (v1.0.58+) */
    apiDocs?: ApiDocsConfig;
    /** Documentation configuration — directories, preview (v1.0.258+) */
    documentation?: DocumentationConfig;
    /** Plugin auto-load configuration (v1.0.140+) */
    pluginAutoLoad?: PluginAutoLoadConfig;
    /** Increment assist configuration (v1.0.141+) */
    incrementAssist?: IncrementAssistConfig;
    /** Planning configuration including deep interview mode (v1.0.195+) */
    planning?: PlanningConfig;
    /** CI/CD configuration (v1.0.231+) */
    cicd?: CiCdConfig;
    /** Context budget configuration for hook output size (v1.0.262+) */
    contextBudget?: ContextBudgetConfig;
    /** Grill quality gate configuration (v1.0.337+) */
    grill?: GrillConfig;
    /** Code review quality gate configuration (v1.0.646+) */
    codeReview?: CodeReviewConfig;
    /** Skill generation configuration — pattern detection + on-demand skill creation (v1.0.XXX+) */
    skillGen?: SkillGenConfig;
    /** Quality-gate configuration — thinking budget, grill threshold, per-stage token budgets (0669 Wave 2) */
    quality?: QualityConfig;
    /** Prompt-caching configuration — list of static files to wrap in cache_control blocks (0669 Wave 2) */
    cache?: CacheConfig;
    /** Allow additional properties for forward compatibility */
    [key: string]: any;
}
/**
 * Backward-compatible alias for SpecWeaveConfig
 * @deprecated Use SpecWeaveConfig from src/core/config/types.ts instead
 */
export type SpecweaveConfig = SpecWeaveConfig;
/**
 * Default configuration values
 */
export declare const DEFAULT_CONFIG: SpecWeaveConfig;
/**
 * Validation error
 */
export interface ValidationError {
    path: string;
    message: string;
    value?: any;
}
/**
 * Validation result
 */
export interface ValidationResult {
    valid: boolean;
    errors: ValidationError[];
}
//# sourceMappingURL=types.d.ts.map