import { Command } from 'commander';
import { ContextQLResult, IngestResult } from '@harness-engineering/graph';
import { Result, Violation, TimelineSnapshot, ConflictReport } from '@harness-engineering/core';
import { z } from 'zod';
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { Result as Result$1 } from '@harness-engineering/types';

interface Phase {
    name: string;
    description: string;
    required: boolean;
}
interface PreambleOptions {
    complexity?: 'fast' | 'thorough';
    phases?: Phase[];
    principles?: string;
    phase?: string;
    priorState?: string;
    stateWarning?: string;
    party?: boolean;
}
declare function buildPreamble(options: PreambleOptions): string;

declare function runScan(projectPath: string): Promise<{
    nodeCount: number;
    edgeCount: number;
    durationMs: number;
}>;

declare function runQuery(projectPath: string, rootNodeId: string, opts: {
    depth?: number;
    types?: string;
    edges?: string;
    bidirectional?: boolean;
}): Promise<ContextQLResult>;

declare function runIngest(projectPath: string, source: string, opts?: {
    full?: boolean;
    all?: boolean;
}): Promise<IngestResult>;

interface GraphStatusResult {
    status: string;
    message?: string;
    nodeCount?: number;
    edgeCount?: number;
    nodesByType?: Record<string, number>;
    lastScanTimestamp?: string;
    connectorSyncStatus?: Record<string, string>;
}
/**
 * Reports graph statistics. Reads `metadata.json` only — it carries node/edge
 * counts and per-type breakdowns (since schema v2). This avoids the streaming
 * graph.json read entirely, so `harness graph status` returns instantly even on
 * multi-GB graphs that would otherwise take seconds (or trip pre-v2 callers).
 *
 * Falls back to a full graph load only when the metadata file lacks `nodesByType`,
 * which happens for graphs written before that field was added.
 */
declare function runGraphStatus(projectPath: string): Promise<GraphStatusResult>;

declare function runGraphExport(projectPath: string, format: string): Promise<string>;

/**
 * Standard exit codes for the Harness CLI.
 */
declare const ExitCode: {
    /** Command completed successfully */
    readonly SUCCESS: 0;
    /** Command failed because of a validation error (e.g. check-docs found issues) */
    readonly VALIDATION_FAILED: 1;
    /** Command failed because of an unexpected error or misconfiguration */
    readonly ERROR: 2;
};
/**
 * Type representing one of the supported exit codes.
 */
type ExitCodeType = (typeof ExitCode)[keyof typeof ExitCode];
/**
 * Custom error class for CLI-specific failures.
 * Includes an exit code that should be used when terminating the process.
 */
declare class CLIError extends Error {
    /** The exit code associated with this error */
    readonly exitCode: ExitCodeType;
    /**
     * Creates a new CLIError.
     *
     * @param message - Human-readable error message.
     * @param exitCode - Exit code to use when process terminates. Defaults to ExitCode.ERROR.
     */
    constructor(message: string, exitCode?: ExitCodeType);
}
/**
 * Handles an error by logging it to stderr and exiting the process with the appropriate code.
 *
 * @param error - The error to handle.
 * @throws Never returns, as it terminates the process.
 */
declare function handleError(error: unknown): never;

interface CheckPhaseGateOptions {
    cwd?: string;
    configPath?: string;
    json?: boolean;
    verbose?: boolean;
    quiet?: boolean;
}
interface CheckPhaseGateResult {
    pass: boolean;
    skipped: boolean;
    severity?: 'error' | 'warning';
    missingSpecs: Array<{
        implFile: string;
        expectedSpec: string;
    }>;
    checkedFiles: number;
}
declare function runCheckPhaseGate(options: CheckPhaseGateOptions): Promise<Result<CheckPhaseGateResult, CLIError>>;

interface CrossCheckResult {
    specToPlan: string[];
    planToImpl: string[];
    staleness: string[];
    warnings: number;
}
interface CrossCheckOptions {
    specsDir: string;
    plansDir: string;
    projectPath: string;
}
declare function runCrossCheck(options: CrossCheckOptions): Promise<Result<CrossCheckResult, CLIError>>;

interface CreateSkillOptions {
    name: string;
    description: string;
    cognitiveMode?: string;
    reads?: string[];
    produces?: string;
    preChecks?: string[];
    postChecks?: string[];
    outputDir?: string;
}
interface GeneratedFiles {
    skillYamlPath: string;
    skillMdPath: string;
}
declare function generateSkillFiles(opts: CreateSkillOptions): GeneratedFiles;

type Platform = 'claude-code' | 'gemini-cli' | 'codex' | 'cursor';
/**
 * For the `cursor` platform, decides whether output is rendered as Cursor
 * rules (`.mdc` with description/globs/alwaysApply — for `~/.cursor/rules/`)
 * or as Cursor plugin commands (`.md` with name/description — for
 * `<plugin>/commands/`). Defaults to `rules` for backward compatibility
 * with `harness setup`.
 */
type CursorRenderMode = 'rules' | 'commands';
interface GenerateOptions {
    platforms: Platform[];
    global: boolean;
    includeGlobal: boolean;
    output?: string;
    skillsDir: string;
    dryRun: boolean;
    yes: boolean;
    cursorMode?: CursorRenderMode;
}

interface SkillSource {
    dir: string;
    source: 'project' | 'community' | 'global';
}

interface GenerateResult {
    platform: string;
    added: string[];
    updated: string[];
    removed: string[];
    unchanged: string[];
    outputDir: string;
}
declare function generateSlashCommands(opts: GenerateOptions): GenerateResult[];

interface ImpactPreviewOptions {
    detailed?: boolean;
    perFile?: boolean;
    path?: string;
}
declare function runImpactPreview(options: ImpactPreviewOptions): Promise<string>;

interface CheckArchOptions {
    cwd?: string;
    configPath?: string;
    updateBaseline?: boolean;
    json?: boolean;
    module?: string;
}
interface CheckArchResult {
    passed: boolean;
    mode: 'baseline' | 'threshold-only';
    totalViolations: number;
    newViolations: Violation[];
    resolvedViolations: string[];
    preExisting: string[];
    regressions: Array<{
        category: string;
        baselineValue: number;
        currentValue: number;
        delta: number;
    }>;
    thresholdViolations: Violation[];
    baselineUpdated?: boolean;
    warning?: string;
}
declare function runCheckArch(options: CheckArchOptions): Promise<Result<CheckArchResult, CLIError>>;

interface SnapshotCaptureResult {
    snapshot: TimelineSnapshot;
    previous: TimelineSnapshot | undefined;
}
declare function runSnapshotCapture(options: {
    cwd?: string;
    configPath?: string;
}): Promise<SnapshotCaptureResult>;

/**
 * Supported output modes for the CLI.
 */
declare const OutputMode: {
    /** Output as formatted JSON */
    readonly JSON: "json";
    /** Output as human-readable text */
    readonly TEXT: "text";
    /** Minimal output, only errors and successes */
    readonly QUIET: "quiet";
    /** Full output with detailed context and suggestions */
    readonly VERBOSE: "verbose";
};
/**
 * Type representing one of the supported output modes.
 */
type OutputModeType = (typeof OutputMode)[keyof typeof OutputMode];
/**
 * Represents a single issue discovered during validation.
 */
interface ValidationIssue {
    /** The file where the issue was found */
    file?: string;
    /** A human-readable description of the issue */
    message: string;
    /** The line number where the issue occurs */
    line?: number;
    /** A suggested fix or next step */
    suggestion?: string;
}
/**
 * The result of a validation operation.
 */
interface ValidationResult {
    /** Whether the validation passed overall */
    valid: boolean;
    /** A list of issues found during validation */
    issues: ValidationIssue[];
}
/**
 * Formats data and results for CLI output based on the selected mode.
 */
declare class OutputFormatter {
    private mode;
    /**
     * Creates a new OutputFormatter.
     *
     * @param mode - The output mode to use. Defaults to TEXT.
     */
    constructor(mode?: OutputModeType);
    /**
     * Formats raw data for output.
     *
     * @param data - The data to format.
     * @returns A string representation of the data based on the current mode.
     */
    format(data: unknown): string;
    /**
     * Formats a validation result into a user-friendly string.
     *
     * @param result - The validation result to format.
     * @returns A formatted string containing the validation status and any issues.
     */
    formatValidation(result: ValidationResult): string;
    /**
     * Formats a summary line with a success/failure icon and label.
     *
     * @param label - The name of the field to summarize.
     * @param value - The value to display.
     * @param success - Whether the summary represents a success or failure state.
     * @returns A formatted summary string, or an empty string in JSON or QUIET modes.
     */
    formatSummary(label: string, value: string | number, success: boolean): string;
}

/**
 * Simple logger for CLI output with color-coded icons.
 */
declare const logger: {
    /**
     * Logs an informational message with a blue 'i' icon.
     * @param message - The message to log.
     */
    info: (message: string) => void;
    /**
     * Logs a success message with a green 'v' icon.
     * @param message - The message to log.
     */
    success: (message: string) => void;
    /**
     * Logs a warning message with a yellow '!' icon.
     * @param message - The message to log.
     */
    warn: (message: string) => void;
    /**
     * Logs an error message with a red 'x' icon to stderr.
     * @param message - The message to log.
     */
    error: (message: string) => void;
    /**
     * Logs a dimmed message.
     * @param message - The message to log.
     */
    dim: (message: string) => void;
    /**
     * Logs raw data as a formatted JSON string.
     * Useful for JSON output mode.
     * @param data - The data to log.
     */
    raw: (data: unknown) => void;
};

declare const HarnessConfigSchema: z.ZodObject<{
    /** Configuration schema version */
    version: z.ZodLiteral<1>;
    /** Human-readable name of the project */
    name: z.ZodOptional<z.ZodString>;
    /** Root directory of the project, relative to the config file */
    rootDir: z.ZodDefault<z.ZodString>;
    /** Layered architecture definitions */
    layers: z.ZodOptional<z.ZodArray<z.ZodObject<{
        /** Human-readable name of the layer */
        name: z.ZodString;
        /** Glob pattern matching files in this layer */
        pattern: z.ZodString;
        /** Names of other layers this layer is allowed to import from */
        allowedDependencies: z.ZodArray<z.ZodString, "many">;
    }, "strip", z.ZodTypeAny, {
        name: string;
        pattern: string;
        allowedDependencies: string[];
    }, {
        name: string;
        pattern: string;
        allowedDependencies: string[];
    }>, "many">>;
    /** Rules for forbidden cross-module imports */
    forbiddenImports: z.ZodOptional<z.ZodArray<z.ZodObject<{
        /** Glob pattern matching source files this rule applies to */
        from: z.ZodString;
        /** List of modules or patterns that are not allowed to be imported */
        disallow: z.ZodArray<z.ZodString, "many">;
        /** Optional custom message to display on violation */
        message: z.ZodOptional<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        from: string;
        disallow: string[];
        message?: string | undefined;
    }, {
        from: string;
        disallow: string[];
        message?: string | undefined;
    }>, "many">>;
    /** Boundary enforcement settings */
    boundaries: z.ZodOptional<z.ZodObject<{
        /** List of globs where files MUST have a corresponding schema/definition */
        requireSchema: z.ZodArray<z.ZodString, "many">;
    }, "strip", z.ZodTypeAny, {
        requireSchema: string[];
    }, {
        requireSchema: string[];
    }>>;
    /** Path to the project's knowledge map (AGENTS.md) */
    agentsMapPath: z.ZodDefault<z.ZodString>;
    /** Directory containing project documentation */
    docsDir: z.ZodDefault<z.ZodString>;
    /** Agent orchestration settings */
    agent: z.ZodOptional<z.ZodObject<{
        /** The execution environment for agents */
        executor: z.ZodDefault<z.ZodEnum<["subprocess", "cloud", "noop"]>>;
        /** Maximum execution time in milliseconds */
        timeout: z.ZodDefault<z.ZodNumber>;
        /** Optional list of skill IDs pre-authorized for the agent */
        skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        executor: "subprocess" | "cloud" | "noop";
        timeout: number;
        skills?: string[] | undefined;
    }, {
        executor?: "subprocess" | "cloud" | "noop" | undefined;
        timeout?: number | undefined;
        skills?: string[] | undefined;
    }>>;
    /** Source-file ingestion controls (skip-dirs, exclude patterns, gitignore handling) */
    ingest: z.ZodOptional<z.ZodObject<{
        skipDirs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
        additionalSkipDirs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
        excludePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
        respectGitignore: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
    }, "strip", z.ZodTypeAny, {
        respectGitignore: boolean;
        skipDirs?: string[] | undefined;
        additionalSkipDirs?: string[] | undefined;
        excludePatterns?: string[] | undefined;
    }, {
        skipDirs?: string[] | undefined;
        additionalSkipDirs?: string[] | undefined;
        excludePatterns?: string[] | undefined;
        respectGitignore?: boolean | undefined;
    }>>;
    /** Drift and stale code management settings */
    entropy: z.ZodOptional<z.ZodObject<{
        /** Explicit entry points for reachability analysis (overrides auto-detection) */
        entryPoints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
        /** Patterns to exclude from entropy analysis */
        excludePatterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** Whether to automatically attempt to fix simple entropy issues */
        autoFix: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        excludePatterns: string[];
        autoFix: boolean;
        entryPoints?: string[] | undefined;
    }, {
        excludePatterns?: string[] | undefined;
        entryPoints?: string[] | undefined;
        autoFix?: boolean | undefined;
    }>>;
    /** Security scanning configuration */
    security: z.ZodOptional<z.ZodObject<{
        /** Whether security scanning is enabled */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Whether to fail on any security warning */
        strict: z.ZodDefault<z.ZodBoolean>;
        /** Rule-specific severity overrides */
        rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["off", "error", "warning", "info"]>>>;
        /** Patterns to exclude from security scans */
        exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
        /** Whether security scanning is enabled */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Whether to fail on any security warning */
        strict: z.ZodDefault<z.ZodBoolean>;
        /** Rule-specific severity overrides */
        rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["off", "error", "warning", "info"]>>>;
        /** Patterns to exclude from security scans */
        exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
        /** Whether security scanning is enabled */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Whether to fail on any security warning */
        strict: z.ZodDefault<z.ZodBoolean>;
        /** Rule-specific severity overrides */
        rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["off", "error", "warning", "info"]>>>;
        /** Patterns to exclude from security scans */
        exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, z.ZodTypeAny, "passthrough">>>;
    /** Performance and complexity budget settings */
    performance: z.ZodOptional<z.ZodObject<{
        /** Complexity thresholds per module or pattern */
        complexity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Coupling limits between modules */
        coupling: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Size budget for bundles or directories */
        sizeBudget: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
        /** Complexity thresholds per module or pattern */
        complexity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Coupling limits between modules */
        coupling: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Size budget for bundles or directories */
        sizeBudget: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
        /** Complexity thresholds per module or pattern */
        complexity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Coupling limits between modules */
        coupling: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Size budget for bundles or directories */
        sizeBudget: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.ZodTypeAny, "passthrough">>>;
    /** Project template settings (used by 'harness init') */
    template: z.ZodOptional<z.ZodObject<{
        /** Complexity level of the template (JS/TS only) */
        level: z.ZodOptional<z.ZodEnum<["basic", "intermediate", "advanced"]>>;
        /** Target language */
        language: z.ZodOptional<z.ZodEnum<["typescript", "python", "go", "rust", "java"]>>;
        /** Primary technology framework */
        framework: z.ZodOptional<z.ZodString>;
        /** Template version */
        version: z.ZodNumber;
        /** Language-specific tooling configuration */
        tooling: z.ZodOptional<z.ZodObject<{
            packageManager: z.ZodOptional<z.ZodString>;
            linter: z.ZodOptional<z.ZodString>;
            formatter: z.ZodOptional<z.ZodString>;
            buildTool: z.ZodOptional<z.ZodString>;
            testRunner: z.ZodOptional<z.ZodString>;
            lockFile: z.ZodOptional<z.ZodString>;
        }, "strip", z.ZodTypeAny, {
            packageManager?: string | undefined;
            linter?: string | undefined;
            formatter?: string | undefined;
            buildTool?: string | undefined;
            testRunner?: string | undefined;
            lockFile?: string | undefined;
        }, {
            packageManager?: string | undefined;
            linter?: string | undefined;
            formatter?: string | undefined;
            buildTool?: string | undefined;
            testRunner?: string | undefined;
            lockFile?: string | undefined;
        }>>;
    }, "strip", z.ZodTypeAny, {
        version: number;
        framework?: string | undefined;
        level?: "basic" | "intermediate" | "advanced" | undefined;
        language?: "typescript" | "python" | "go" | "rust" | "java" | undefined;
        tooling?: {
            packageManager?: string | undefined;
            linter?: string | undefined;
            formatter?: string | undefined;
            buildTool?: string | undefined;
            testRunner?: string | undefined;
            lockFile?: string | undefined;
        } | undefined;
    }, {
        version: number;
        framework?: string | undefined;
        level?: "basic" | "intermediate" | "advanced" | undefined;
        language?: "typescript" | "python" | "go" | "rust" | "java" | undefined;
        tooling?: {
            packageManager?: string | undefined;
            linter?: string | undefined;
            formatter?: string | undefined;
            buildTool?: string | undefined;
            testRunner?: string | undefined;
            lockFile?: string | undefined;
        } | undefined;
    }>>;
    /** Phase gate and readiness check configuration */
    phaseGates: z.ZodOptional<z.ZodObject<{
        /** Whether phase gate checks are enabled */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Severity level when a phase gate check fails */
        severity: z.ZodDefault<z.ZodEnum<["error", "warning"]>>;
        /** List of implementation-to-spec mappings */
        mappings: z.ZodDefault<z.ZodArray<z.ZodObject<{
            /** Pattern for implementation files */
            implPattern: z.ZodString;
            /** Pattern for corresponding specification files */
            specPattern: z.ZodString;
            /** When true, validate that the spec file contains a numbered requirements section */
            contentValidation: z.ZodDefault<z.ZodBoolean>;
        }, "strip", z.ZodTypeAny, {
            implPattern: string;
            specPattern: string;
            contentValidation: boolean;
        }, {
            implPattern: string;
            specPattern: string;
            contentValidation?: boolean | undefined;
        }>, "many">>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        severity: "error" | "warning";
        mappings: {
            implPattern: string;
            specPattern: string;
            contentValidation: boolean;
        }[];
    }, {
        enabled?: boolean | undefined;
        severity?: "error" | "warning" | undefined;
        mappings?: {
            implPattern: string;
            specPattern: string;
            contentValidation?: boolean | undefined;
        }[] | undefined;
    }>>;
    /** Design system consistency settings */
    design: z.ZodOptional<z.ZodEffects<z.ZodObject<{
        /**
         * Whether design-system tooling is enabled for this project. Set during init.
         * Tri-state semantics: omit the field to indicate "not configured."
         * Do NOT add a `.default(...)` — preserving "absent" is required by the spec.
         */
        enabled: z.ZodOptional<z.ZodBoolean>;
        /** Strictness of design system enforcement */
        strictness: z.ZodDefault<z.ZodEnum<["strict", "standard", "permissive"]>>;
        /** Supported target platforms */
        platforms: z.ZodDefault<z.ZodArray<z.ZodEnum<["web", "mobile"]>, "many">>;
        /** Path to design tokens (e.g. JSON or CSS) */
        tokenPath: z.ZodOptional<z.ZodString>;
        /** Brief description of the intended aesthetic direction */
        aestheticIntent: z.ZodOptional<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        strictness: "strict" | "standard" | "permissive";
        platforms: ("web" | "mobile")[];
        enabled?: boolean | undefined;
        tokenPath?: string | undefined;
        aestheticIntent?: string | undefined;
    }, {
        enabled?: boolean | undefined;
        strictness?: "strict" | "standard" | "permissive" | undefined;
        platforms?: ("web" | "mobile")[] | undefined;
        tokenPath?: string | undefined;
        aestheticIntent?: string | undefined;
    }>, {
        strictness: "strict" | "standard" | "permissive";
        platforms: ("web" | "mobile")[];
        enabled?: boolean | undefined;
        tokenPath?: string | undefined;
        aestheticIntent?: string | undefined;
    }, {
        enabled?: boolean | undefined;
        strictness?: "strict" | "standard" | "permissive" | undefined;
        platforms?: ("web" | "mobile")[] | undefined;
        tokenPath?: string | undefined;
        aestheticIntent?: string | undefined;
    }>>;
    /** Internationalization (i18n) settings */
    i18n: z.ZodOptional<z.ZodObject<{
        /** Whether i18n management is enabled */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Strictness of i18n rule enforcement */
        strictness: z.ZodDefault<z.ZodEnum<["strict", "standard", "permissive"]>>;
        /** The primary language used for development */
        sourceLocale: z.ZodDefault<z.ZodString>;
        /** List of locales that translations are required for */
        targetLocales: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** The i18n framework in use */
        framework: z.ZodDefault<z.ZodEnum<["auto", "i18next", "react-intl", "vue-i18n", "flutter-intl", "apple", "android", "custom"]>>;
        /** Storage format for translation files */
        format: z.ZodDefault<z.ZodString>;
        /** Syntax used for message formatting */
        messageFormat: z.ZodDefault<z.ZodEnum<["icu", "i18next", "custom"]>>;
        /** Convention for translation keys */
        keyConvention: z.ZodDefault<z.ZodEnum<["dot-notation", "snake_case", "camelCase", "custom"]>>;
        /** Mapping of locales to their file paths */
        translationPaths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
        /** Platforms targeted by this configuration */
        platforms: z.ZodDefault<z.ZodArray<z.ZodEnum<["web", "mobile", "backend"]>, "many">>;
        /** Industry vertical (for contextual translations) */
        industry: z.ZodOptional<z.ZodString>;
        /** Translation coverage requirements */
        coverage: z.ZodOptional<z.ZodObject<{
            /** Minimum required translation percentage */
            minimumPercent: z.ZodDefault<z.ZodNumber>;
            /** Whether plural forms are required for all keys */
            requirePlurals: z.ZodDefault<z.ZodBoolean>;
            /** Whether to detect untranslated strings in source code */
            detectUntranslated: z.ZodDefault<z.ZodBoolean>;
        }, "strip", z.ZodTypeAny, {
            minimumPercent: number;
            requirePlurals: boolean;
            detectUntranslated: boolean;
        }, {
            minimumPercent?: number | undefined;
            requirePlurals?: boolean | undefined;
            detectUntranslated?: boolean | undefined;
        }>>;
        /** Locale used for pseudo-localization testing */
        pseudoLocale: z.ZodOptional<z.ZodString>;
        /** MCP server for AI-assisted translation */
        mcp: z.ZodOptional<z.ZodObject<{
            /** Name or URL of the MCP server */
            server: z.ZodString;
            /** Project ID on the remote i18n platform */
            projectId: z.ZodOptional<z.ZodString>;
        }, "strip", z.ZodTypeAny, {
            server: string;
            projectId?: string | undefined;
        }, {
            server: string;
            projectId?: string | undefined;
        }>>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        strictness: "strict" | "standard" | "permissive";
        platforms: ("web" | "mobile" | "backend")[];
        sourceLocale: string;
        targetLocales: string[];
        framework: "custom" | "auto" | "i18next" | "react-intl" | "vue-i18n" | "flutter-intl" | "apple" | "android";
        format: string;
        messageFormat: "custom" | "i18next" | "icu";
        keyConvention: "custom" | "dot-notation" | "snake_case" | "camelCase";
        translationPaths?: Record<string, string> | undefined;
        industry?: string | undefined;
        coverage?: {
            minimumPercent: number;
            requirePlurals: boolean;
            detectUntranslated: boolean;
        } | undefined;
        pseudoLocale?: string | undefined;
        mcp?: {
            server: string;
            projectId?: string | undefined;
        } | undefined;
    }, {
        enabled?: boolean | undefined;
        strictness?: "strict" | "standard" | "permissive" | undefined;
        platforms?: ("web" | "mobile" | "backend")[] | undefined;
        sourceLocale?: string | undefined;
        targetLocales?: string[] | undefined;
        framework?: "custom" | "auto" | "i18next" | "react-intl" | "vue-i18n" | "flutter-intl" | "apple" | "android" | undefined;
        format?: string | undefined;
        messageFormat?: "custom" | "i18next" | "icu" | undefined;
        keyConvention?: "custom" | "dot-notation" | "snake_case" | "camelCase" | undefined;
        translationPaths?: Record<string, string> | undefined;
        industry?: string | undefined;
        coverage?: {
            minimumPercent?: number | undefined;
            requirePlurals?: boolean | undefined;
            detectUntranslated?: boolean | undefined;
        } | undefined;
        pseudoLocale?: string | undefined;
        mcp?: {
            server: string;
            projectId?: string | undefined;
        } | undefined;
    }>>;
    /** Code review settings */
    review: z.ZodOptional<z.ZodObject<{
        /** Custom model tier mappings for reviewers */
        model_tiers: z.ZodOptional<z.ZodObject<{
            /** Model ID to use for fast/cheap operations */
            fast: z.ZodOptional<z.ZodString>;
            /** Model ID to use for standard reasoning tasks */
            standard: z.ZodOptional<z.ZodString>;
            /** Model ID to use for complex/critical analysis */
            strong: z.ZodOptional<z.ZodString>;
        }, "strip", z.ZodTypeAny, {
            standard?: string | undefined;
            fast?: string | undefined;
            strong?: string | undefined;
        }, {
            standard?: string | undefined;
            fast?: string | undefined;
            strong?: string | undefined;
        }>>;
    }, "strip", z.ZodTypeAny, {
        model_tiers?: {
            standard?: string | undefined;
            fast?: string | undefined;
            strong?: string | undefined;
        } | undefined;
    }, {
        model_tiers?: {
            standard?: string | undefined;
            fast?: string | undefined;
            strong?: string | undefined;
        } | undefined;
    }>>;
    /** MCP peer integration enablement and dismissal */
    integrations: z.ZodOptional<z.ZodObject<{
        /** Tier 1 integrations explicitly enabled by the user */
        enabled: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** Integrations the user does not want doctor to suggest */
        dismissed: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        enabled: string[];
        dismissed: string[];
    }, {
        enabled?: string[] | undefined;
        dismissed?: string[] | undefined;
    }>>;
    /** General architectural enforcement settings */
    architecture: z.ZodOptional<z.ZodObject<{
        enabled: z.ZodDefault<z.ZodBoolean>;
        baselinePath: z.ZodDefault<z.ZodString>;
        thresholds: z.ZodDefault<z.ZodRecord<z.ZodEnum<["circular-deps", "layer-violations", "complexity", "coupling", "forbidden-imports", "module-size", "dependency-depth"]>, z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>>;
        modules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodEnum<["circular-deps", "layer-violations", "complexity", "coupling", "forbidden-imports", "module-size", "dependency-depth"]>, z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>>>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        thresholds: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>;
        modules: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>>;
        baselinePath: string;
    }, {
        enabled?: boolean | undefined;
        thresholds?: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>> | undefined;
        modules?: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>> | undefined;
        baselinePath?: string | undefined;
    }>>;
    /** Skill loading, suggestion, and tier override settings */
    skills: z.ZodOptional<z.ZodObject<{
        /** Skills to always suggest in the dispatcher, regardless of scoring */
        alwaysSuggest: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** Skills to never suggest in the dispatcher, even if they score highly */
        neverSuggest: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** Override the tier of specific skills (e.g., promote a Tier 3 skill to Tier 2) */
        tierOverrides: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
    }, "strip", z.ZodTypeAny, {
        alwaysSuggest: string[];
        neverSuggest: string[];
        tierOverrides: Record<string, number>;
    }, {
        alwaysSuggest?: string[] | undefined;
        neverSuggest?: string[] | undefined;
        tierOverrides?: Record<string, number> | undefined;
    }>>;
    /** Spec-to-implementation traceability check settings */
    traceability: z.ZodOptional<z.ZodObject<{
        /** Whether traceability checks are enabled */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Severity level when traceability coverage is below threshold */
        severity: z.ZodDefault<z.ZodEnum<["error", "warning"]>>;
        /** Minimum required coverage percentage (0-100) */
        minCoverage: z.ZodDefault<z.ZodNumber>;
        /** Glob patterns for specs to include in traceability checks */
        includeSpecs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
        /** Glob patterns for specs to exclude from traceability checks */
        excludeSpecs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
        severity: "error" | "warning";
        minCoverage: number;
        includeSpecs: string[];
        excludeSpecs: string[];
    }, {
        enabled?: boolean | undefined;
        severity?: "error" | "warning" | undefined;
        minCoverage?: number | undefined;
        includeSpecs?: string[] | undefined;
        excludeSpecs?: string[] | undefined;
    }>>;
    /** Roadmap sync and tracker integration settings */
    roadmap: z.ZodOptional<z.ZodObject<{
        /** Roadmap storage mode. Defaults to `"file-backed"` (today's behavior). */
        mode: z.ZodDefault<z.ZodEnum<["file-backed", "file-less"]>>;
        /** External tracker sync settings */
        tracker: z.ZodOptional<z.ZodObject<{
            /** Tracker kind — currently only 'github' is supported for `roadmap.tracker`. */
            kind: z.ZodLiteral<"github">;
            /** Repository in "owner/repo" format */
            repo: z.ZodOptional<z.ZodString>;
            /** Labels auto-applied to synced issues for filtering */
            labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
            /** Maps roadmap status -> external status */
            statusMap: z.ZodRecord<z.ZodEnum<["backlog", "planned", "in-progress", "done", "blocked", "needs-human"]>, z.ZodString>;
            /** Maps external status (optionally with label) -> roadmap status */
            reverseStatusMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
        }, "strip", z.ZodTypeAny, {
            kind: "github";
            statusMap: Partial<Record<"backlog" | "planned" | "in-progress" | "done" | "blocked" | "needs-human", string>>;
            repo?: string | undefined;
            labels?: string[] | undefined;
            reverseStatusMap?: Record<string, string> | undefined;
        }, {
            kind: "github";
            statusMap: Partial<Record<"backlog" | "planned" | "in-progress" | "done" | "blocked" | "needs-human", string>>;
            repo?: string | undefined;
            labels?: string[] | undefined;
            reverseStatusMap?: Record<string, string> | undefined;
        }>>;
    }, "strip", z.ZodTypeAny, {
        mode: "file-backed" | "file-less";
        tracker?: {
            kind: "github";
            statusMap: Partial<Record<"backlog" | "planned" | "in-progress" | "done" | "blocked" | "needs-human", string>>;
            repo?: string | undefined;
            labels?: string[] | undefined;
            reverseStatusMap?: Record<string, string> | undefined;
        } | undefined;
    }, {
        mode?: "file-backed" | "file-less" | undefined;
        tracker?: {
            kind: "github";
            statusMap: Partial<Record<"backlog" | "planned" | "in-progress" | "done" | "blocked" | "needs-human", string>>;
            repo?: string | undefined;
            labels?: string[] | undefined;
            reverseStatusMap?: Record<string, string> | undefined;
        } | undefined;
    }>>;
    /** Knowledge-pipeline domain-inference settings */
    knowledge: z.ZodOptional<z.ZodObject<{
        /** Caller-supplied domain patterns (e.g. `["agents/<dir>"]`). Extends defaults. */
        domainPatterns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
        /** Caller-supplied blocklisted path segments (e.g. `["scratch", "fixtures"]`). Extends defaults. */
        domainBlocklist: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
    }, "strip", z.ZodTypeAny, {
        domainPatterns: string[];
        domainBlocklist: string[];
    }, {
        domainPatterns?: string[] | undefined;
        domainBlocklist?: string[] | undefined;
    }>>;
    /** Adoption telemetry settings */
    adoption: z.ZodOptional<z.ZodObject<{
        /** Whether adoption tracking is enabled (default: true) */
        enabled: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
    }, {
        enabled?: boolean | undefined;
    }>>;
    /** Central telemetry collection settings */
    telemetry: z.ZodOptional<z.ZodObject<{
        /** Whether anonymous telemetry is enabled (default: true) */
        enabled: z.ZodDefault<z.ZodBoolean>;
    }, "strip", z.ZodTypeAny, {
        enabled: boolean;
    }, {
        enabled?: boolean | undefined;
    }>>;
    /** How often (in ms) to check for CLI updates */
    updateCheckInterval: z.ZodOptional<z.ZodNumber>;
    /** Graph ingest and connector settings */
    graph: z.ZodOptional<z.ZodObject<{
        /** Per-connector configuration (keyed by connector name: jira, slack, ci, confluence, figma, miro) */
        connectors: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
    }, "strip", z.ZodTypeAny, {
        connectors: Record<string, Record<string, unknown>>;
    }, {
        connectors?: Record<string, Record<string, unknown>> | undefined;
    }>>;
}, "strip", z.ZodTypeAny, {
    version: 1;
    rootDir: string;
    agentsMapPath: string;
    docsDir: string;
    name?: string | undefined;
    skills?: {
        alwaysSuggest: string[];
        neverSuggest: string[];
        tierOverrides: Record<string, number>;
    } | undefined;
    layers?: {
        name: string;
        pattern: string;
        allowedDependencies: string[];
    }[] | undefined;
    forbiddenImports?: {
        from: string;
        disallow: string[];
        message?: string | undefined;
    }[] | undefined;
    boundaries?: {
        requireSchema: string[];
    } | undefined;
    agent?: {
        executor: "subprocess" | "cloud" | "noop";
        timeout: number;
        skills?: string[] | undefined;
    } | undefined;
    ingest?: {
        respectGitignore: boolean;
        skipDirs?: string[] | undefined;
        additionalSkipDirs?: string[] | undefined;
        excludePatterns?: string[] | undefined;
    } | undefined;
    entropy?: {
        excludePatterns: string[];
        autoFix: boolean;
        entryPoints?: string[] | undefined;
    } | undefined;
    security?: z.objectOutputType<{
        /** Whether security scanning is enabled */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Whether to fail on any security warning */
        strict: z.ZodDefault<z.ZodBoolean>;
        /** Rule-specific severity overrides */
        rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["off", "error", "warning", "info"]>>>;
        /** Patterns to exclude from security scans */
        exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, z.ZodTypeAny, "passthrough"> | undefined;
    performance?: z.objectOutputType<{
        /** Complexity thresholds per module or pattern */
        complexity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Coupling limits between modules */
        coupling: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Size budget for bundles or directories */
        sizeBudget: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.ZodTypeAny, "passthrough"> | undefined;
    template?: {
        version: number;
        framework?: string | undefined;
        level?: "basic" | "intermediate" | "advanced" | undefined;
        language?: "typescript" | "python" | "go" | "rust" | "java" | undefined;
        tooling?: {
            packageManager?: string | undefined;
            linter?: string | undefined;
            formatter?: string | undefined;
            buildTool?: string | undefined;
            testRunner?: string | undefined;
            lockFile?: string | undefined;
        } | undefined;
    } | undefined;
    phaseGates?: {
        enabled: boolean;
        severity: "error" | "warning";
        mappings: {
            implPattern: string;
            specPattern: string;
            contentValidation: boolean;
        }[];
    } | undefined;
    design?: {
        strictness: "strict" | "standard" | "permissive";
        platforms: ("web" | "mobile")[];
        enabled?: boolean | undefined;
        tokenPath?: string | undefined;
        aestheticIntent?: string | undefined;
    } | undefined;
    i18n?: {
        enabled: boolean;
        strictness: "strict" | "standard" | "permissive";
        platforms: ("web" | "mobile" | "backend")[];
        sourceLocale: string;
        targetLocales: string[];
        framework: "custom" | "auto" | "i18next" | "react-intl" | "vue-i18n" | "flutter-intl" | "apple" | "android";
        format: string;
        messageFormat: "custom" | "i18next" | "icu";
        keyConvention: "custom" | "dot-notation" | "snake_case" | "camelCase";
        translationPaths?: Record<string, string> | undefined;
        industry?: string | undefined;
        coverage?: {
            minimumPercent: number;
            requirePlurals: boolean;
            detectUntranslated: boolean;
        } | undefined;
        pseudoLocale?: string | undefined;
        mcp?: {
            server: string;
            projectId?: string | undefined;
        } | undefined;
    } | undefined;
    review?: {
        model_tiers?: {
            standard?: string | undefined;
            fast?: string | undefined;
            strong?: string | undefined;
        } | undefined;
    } | undefined;
    integrations?: {
        enabled: string[];
        dismissed: string[];
    } | undefined;
    architecture?: {
        enabled: boolean;
        thresholds: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>;
        modules: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>>;
        baselinePath: string;
    } | undefined;
    traceability?: {
        enabled: boolean;
        severity: "error" | "warning";
        minCoverage: number;
        includeSpecs: string[];
        excludeSpecs: string[];
    } | undefined;
    roadmap?: {
        mode: "file-backed" | "file-less";
        tracker?: {
            kind: "github";
            statusMap: Partial<Record<"backlog" | "planned" | "in-progress" | "done" | "blocked" | "needs-human", string>>;
            repo?: string | undefined;
            labels?: string[] | undefined;
            reverseStatusMap?: Record<string, string> | undefined;
        } | undefined;
    } | undefined;
    knowledge?: {
        domainPatterns: string[];
        domainBlocklist: string[];
    } | undefined;
    adoption?: {
        enabled: boolean;
    } | undefined;
    telemetry?: {
        enabled: boolean;
    } | undefined;
    updateCheckInterval?: number | undefined;
    graph?: {
        connectors: Record<string, Record<string, unknown>>;
    } | undefined;
}, {
    version: 1;
    name?: string | undefined;
    skills?: {
        alwaysSuggest?: string[] | undefined;
        neverSuggest?: string[] | undefined;
        tierOverrides?: Record<string, number> | undefined;
    } | undefined;
    rootDir?: string | undefined;
    layers?: {
        name: string;
        pattern: string;
        allowedDependencies: string[];
    }[] | undefined;
    forbiddenImports?: {
        from: string;
        disallow: string[];
        message?: string | undefined;
    }[] | undefined;
    boundaries?: {
        requireSchema: string[];
    } | undefined;
    agentsMapPath?: string | undefined;
    docsDir?: string | undefined;
    agent?: {
        executor?: "subprocess" | "cloud" | "noop" | undefined;
        timeout?: number | undefined;
        skills?: string[] | undefined;
    } | undefined;
    ingest?: {
        skipDirs?: string[] | undefined;
        additionalSkipDirs?: string[] | undefined;
        excludePatterns?: string[] | undefined;
        respectGitignore?: boolean | undefined;
    } | undefined;
    entropy?: {
        excludePatterns?: string[] | undefined;
        entryPoints?: string[] | undefined;
        autoFix?: boolean | undefined;
    } | undefined;
    security?: z.objectInputType<{
        /** Whether security scanning is enabled */
        enabled: z.ZodDefault<z.ZodBoolean>;
        /** Whether to fail on any security warning */
        strict: z.ZodDefault<z.ZodBoolean>;
        /** Rule-specific severity overrides */
        rules: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["off", "error", "warning", "info"]>>>;
        /** Patterns to exclude from security scans */
        exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, z.ZodTypeAny, "passthrough"> | undefined;
    performance?: z.objectInputType<{
        /** Complexity thresholds per module or pattern */
        complexity: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Coupling limits between modules */
        coupling: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
        /** Size budget for bundles or directories */
        sizeBudget: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
    }, z.ZodTypeAny, "passthrough"> | undefined;
    template?: {
        version: number;
        framework?: string | undefined;
        level?: "basic" | "intermediate" | "advanced" | undefined;
        language?: "typescript" | "python" | "go" | "rust" | "java" | undefined;
        tooling?: {
            packageManager?: string | undefined;
            linter?: string | undefined;
            formatter?: string | undefined;
            buildTool?: string | undefined;
            testRunner?: string | undefined;
            lockFile?: string | undefined;
        } | undefined;
    } | undefined;
    phaseGates?: {
        enabled?: boolean | undefined;
        severity?: "error" | "warning" | undefined;
        mappings?: {
            implPattern: string;
            specPattern: string;
            contentValidation?: boolean | undefined;
        }[] | undefined;
    } | undefined;
    design?: {
        enabled?: boolean | undefined;
        strictness?: "strict" | "standard" | "permissive" | undefined;
        platforms?: ("web" | "mobile")[] | undefined;
        tokenPath?: string | undefined;
        aestheticIntent?: string | undefined;
    } | undefined;
    i18n?: {
        enabled?: boolean | undefined;
        strictness?: "strict" | "standard" | "permissive" | undefined;
        platforms?: ("web" | "mobile" | "backend")[] | undefined;
        sourceLocale?: string | undefined;
        targetLocales?: string[] | undefined;
        framework?: "custom" | "auto" | "i18next" | "react-intl" | "vue-i18n" | "flutter-intl" | "apple" | "android" | undefined;
        format?: string | undefined;
        messageFormat?: "custom" | "i18next" | "icu" | undefined;
        keyConvention?: "custom" | "dot-notation" | "snake_case" | "camelCase" | undefined;
        translationPaths?: Record<string, string> | undefined;
        industry?: string | undefined;
        coverage?: {
            minimumPercent?: number | undefined;
            requirePlurals?: boolean | undefined;
            detectUntranslated?: boolean | undefined;
        } | undefined;
        pseudoLocale?: string | undefined;
        mcp?: {
            server: string;
            projectId?: string | undefined;
        } | undefined;
    } | undefined;
    review?: {
        model_tiers?: {
            standard?: string | undefined;
            fast?: string | undefined;
            strong?: string | undefined;
        } | undefined;
    } | undefined;
    integrations?: {
        enabled?: string[] | undefined;
        dismissed?: string[] | undefined;
    } | undefined;
    architecture?: {
        enabled?: boolean | undefined;
        thresholds?: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>> | undefined;
        modules?: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>> | undefined;
        baselinePath?: string | undefined;
    } | undefined;
    traceability?: {
        enabled?: boolean | undefined;
        severity?: "error" | "warning" | undefined;
        minCoverage?: number | undefined;
        includeSpecs?: string[] | undefined;
        excludeSpecs?: string[] | undefined;
    } | undefined;
    roadmap?: {
        mode?: "file-backed" | "file-less" | undefined;
        tracker?: {
            kind: "github";
            statusMap: Partial<Record<"backlog" | "planned" | "in-progress" | "done" | "blocked" | "needs-human", string>>;
            repo?: string | undefined;
            labels?: string[] | undefined;
            reverseStatusMap?: Record<string, string> | undefined;
        } | undefined;
    } | undefined;
    knowledge?: {
        domainPatterns?: string[] | undefined;
        domainBlocklist?: string[] | undefined;
    } | undefined;
    adoption?: {
        enabled?: boolean | undefined;
    } | undefined;
    telemetry?: {
        enabled?: boolean | undefined;
    } | undefined;
    updateCheckInterval?: number | undefined;
    graph?: {
        connectors?: Record<string, Record<string, unknown>> | undefined;
    } | undefined;
}>;
/**
 * Type representing the full Harness configuration.
 */
type HarnessConfig = z.infer<typeof HarnessConfigSchema>;

/**
 * Searches for a Harness configuration file starting from the given directory
 * and moving up the directory tree until the root is reached.
 *
 * @param startDir - The directory to start searching from. Defaults to current working directory.
 * @returns An Ok result containing the absolute path to the config file, or an Err with a CLIError if not found.
 */
declare function findConfigFile(startDir?: string): Result<string, CLIError>;
/**
 * Loads and validates a Harness configuration from a JSON file.
 *
 * @param configPath - The path to the configuration file.
 * @returns An Ok result with the validated HarnessConfig, or an Err with a CLIError if loading or validation fails.
 */
declare function loadConfig(configPath: string): Result<HarnessConfig, CLIError>;
/**
 * Resolves the Harness configuration by either loading from a specified path
 * or searching for the default config file in the current directory tree.
 *
 * @param configPath - Optional path to a specific configuration file.
 * @returns An Ok result with the resolved configuration, or an Err with a CLIError.
 */
declare function resolveConfig(configPath?: string): Result<HarnessConfig, CLIError>;

declare const TemplateMetadataSchema: z.ZodObject<{
    name: z.ZodString;
    description: z.ZodString;
    level: z.ZodOptional<z.ZodEnum<["basic", "intermediate", "advanced"]>>;
    framework: z.ZodOptional<z.ZodString>;
    extends: z.ZodOptional<z.ZodString>;
    mergeStrategy: z.ZodDefault<z.ZodObject<{
        json: z.ZodDefault<z.ZodEnum<["deep-merge", "overlay-wins"]>>;
        files: z.ZodDefault<z.ZodLiteral<"overlay-wins">>;
    }, "strip", z.ZodTypeAny, {
        json: "deep-merge" | "overlay-wins";
        files: "overlay-wins";
    }, {
        json?: "deep-merge" | "overlay-wins" | undefined;
        files?: "overlay-wins" | undefined;
    }>>;
    version: z.ZodLiteral<1>;
    language: z.ZodOptional<z.ZodEnum<["typescript", "python", "go", "rust", "java"]>>;
    tooling: z.ZodOptional<z.ZodObject<{
        packageManager: z.ZodOptional<z.ZodString>;
        linter: z.ZodOptional<z.ZodString>;
        formatter: z.ZodOptional<z.ZodString>;
        buildTool: z.ZodOptional<z.ZodString>;
        testRunner: z.ZodOptional<z.ZodString>;
        lockFile: z.ZodOptional<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        packageManager?: string | undefined;
        linter?: string | undefined;
        formatter?: string | undefined;
        buildTool?: string | undefined;
        testRunner?: string | undefined;
        lockFile?: string | undefined;
    }, {
        packageManager?: string | undefined;
        linter?: string | undefined;
        formatter?: string | undefined;
        buildTool?: string | undefined;
        testRunner?: string | undefined;
        lockFile?: string | undefined;
    }>>;
    detect: z.ZodOptional<z.ZodArray<z.ZodObject<{
        file: z.ZodString;
        contains: z.ZodOptional<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        file: string;
        contains?: string | undefined;
    }, {
        file: string;
        contains?: string | undefined;
    }>, "many">>;
}, "strip", z.ZodTypeAny, {
    name: string;
    version: 1;
    description: string;
    mergeStrategy: {
        json: "deep-merge" | "overlay-wins";
        files: "overlay-wins";
    };
    framework?: string | undefined;
    level?: "basic" | "intermediate" | "advanced" | undefined;
    language?: "typescript" | "python" | "go" | "rust" | "java" | undefined;
    tooling?: {
        packageManager?: string | undefined;
        linter?: string | undefined;
        formatter?: string | undefined;
        buildTool?: string | undefined;
        testRunner?: string | undefined;
        lockFile?: string | undefined;
    } | undefined;
    extends?: string | undefined;
    detect?: {
        file: string;
        contains?: string | undefined;
    }[] | undefined;
}, {
    name: string;
    version: 1;
    description: string;
    framework?: string | undefined;
    level?: "basic" | "intermediate" | "advanced" | undefined;
    language?: "typescript" | "python" | "go" | "rust" | "java" | undefined;
    tooling?: {
        packageManager?: string | undefined;
        linter?: string | undefined;
        formatter?: string | undefined;
        buildTool?: string | undefined;
        testRunner?: string | undefined;
        lockFile?: string | undefined;
    } | undefined;
    extends?: string | undefined;
    mergeStrategy?: {
        json?: "deep-merge" | "overlay-wins" | undefined;
        files?: "overlay-wins" | undefined;
    } | undefined;
    detect?: {
        file: string;
        contains?: string | undefined;
    }[] | undefined;
}>;
type TemplateMetadata = z.infer<typeof TemplateMetadataSchema>;

interface TemplateContext {
    projectName: string;
    level?: string;
    framework?: string;
    language?: string;
    goModulePath?: string;
    pythonMinVersion?: string;
    javaGroupId?: string;
    rustEdition?: string;
}
interface TemplateFile {
    relativePath: string;
    absolutePath: string;
    isHandlebars: boolean;
    sourceTemplate: string;
}
interface ResolvedTemplate {
    metadata: TemplateMetadata;
    files: TemplateFile[];
    overlayMetadata?: TemplateMetadata;
}
interface RenderedFile {
    relativePath: string;
    content: string;
}
interface RenderedFiles {
    files: RenderedFile[];
}
interface DetectedFramework {
    framework: string;
    language: string;
    score: number;
    templateName: string;
}
interface WriteOptions {
    overwrite: boolean;
    language?: string;
    existingProject?: boolean;
}
interface WriteResult {
    written: string[];
    skippedConfigs: string[];
}
declare class TemplateEngine {
    private templatesDir;
    constructor(templatesDir: string);
    listTemplates(): Result<TemplateMetadata[], Error>;
    resolveTemplate(level?: string, framework?: string, language?: string): Result<ResolvedTemplate, Error>;
    render(template: ResolvedTemplate, context: TemplateContext): Result<RenderedFiles, Error>;
    private renderFile;
    write(files: RenderedFiles, targetDir: string, options: WriteOptions): Result<WriteResult, Error>;
    /**
     * Check whether the target directory already contains a project by looking for
     * common build/package configuration files. Returns true if any marker is found.
     */
    isExistingProject(targetDir: string): boolean;
    detectFramework(targetDir: string): Result<DetectedFramework[], Error>;
    private resolveLanguageTemplate;
    private findTemplateDir;
    private collectFiles;
    private mergeFileLists;
}

declare const TriggerContextSchema: z.ZodDefault<z.ZodEnum<["always", "on_pr", "on_commit", "on_review", "scheduled", "manual", "on_plan_approved"]>>;
type TriggerContext = z.infer<typeof TriggerContextSchema>;
declare const CommandStepSchema: z.ZodObject<{
    command: z.ZodString;
    when: z.ZodDefault<z.ZodEnum<["always", "on_pr", "on_commit", "on_review", "scheduled", "manual", "on_plan_approved"]>>;
}, "strip", z.ZodTypeAny, {
    command: string;
    when: "manual" | "on_pr" | "on_commit" | "on_review" | "always" | "scheduled" | "on_plan_approved";
}, {
    command: string;
    when?: "manual" | "on_pr" | "on_commit" | "on_review" | "always" | "scheduled" | "on_plan_approved" | undefined;
}>;
declare const SkillStepSchema: z.ZodObject<{
    skill: z.ZodString;
    when: z.ZodDefault<z.ZodEnum<["always", "on_pr", "on_commit", "on_review", "scheduled", "manual", "on_plan_approved"]>>;
    output: z.ZodDefault<z.ZodEnum<["inline", "artifact", "auto"]>>;
}, "strip", z.ZodTypeAny, {
    skill: string;
    when: "manual" | "on_pr" | "on_commit" | "on_review" | "always" | "scheduled" | "on_plan_approved";
    output: "auto" | "inline" | "artifact";
}, {
    skill: string;
    when?: "manual" | "on_pr" | "on_commit" | "on_review" | "always" | "scheduled" | "on_plan_approved" | undefined;
    output?: "auto" | "inline" | "artifact" | undefined;
}>;
declare const StepSchema: z.ZodUnion<[z.ZodObject<{
    command: z.ZodString;
    when: z.ZodDefault<z.ZodEnum<["always", "on_pr", "on_commit", "on_review", "scheduled", "manual", "on_plan_approved"]>>;
}, "strip", z.ZodTypeAny, {
    command: string;
    when: "manual" | "on_pr" | "on_commit" | "on_review" | "always" | "scheduled" | "on_plan_approved";
}, {
    command: string;
    when?: "manual" | "on_pr" | "on_commit" | "on_review" | "always" | "scheduled" | "on_plan_approved" | undefined;
}>, z.ZodObject<{
    skill: z.ZodString;
    when: z.ZodDefault<z.ZodEnum<["always", "on_pr", "on_commit", "on_review", "scheduled", "manual", "on_plan_approved"]>>;
    output: z.ZodDefault<z.ZodEnum<["inline", "artifact", "auto"]>>;
}, "strip", z.ZodTypeAny, {
    skill: string;
    when: "manual" | "on_pr" | "on_commit" | "on_review" | "always" | "scheduled" | "on_plan_approved";
    output: "auto" | "inline" | "artifact";
}, {
    skill: string;
    when?: "manual" | "on_pr" | "on_commit" | "on_review" | "always" | "scheduled" | "on_plan_approved" | undefined;
    output?: "auto" | "inline" | "artifact" | undefined;
}>]>;
type CommandStep = z.infer<typeof CommandStepSchema>;
type SkillStep = z.infer<typeof SkillStepSchema>;
type Step = z.infer<typeof StepSchema>;
declare const PersonaTriggerSchema: z.ZodDiscriminatedUnion<"event", [z.ZodObject<{
    event: z.ZodLiteral<"on_pr">;
    conditions: z.ZodOptional<z.ZodObject<{
        paths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
        min_files: z.ZodOptional<z.ZodNumber>;
    }, "strip", z.ZodTypeAny, {
        paths?: string[] | undefined;
        min_files?: number | undefined;
    }, {
        paths?: string[] | undefined;
        min_files?: number | undefined;
    }>>;
}, "strip", z.ZodTypeAny, {
    event: "on_pr";
    conditions?: {
        paths?: string[] | undefined;
        min_files?: number | undefined;
    } | undefined;
}, {
    event: "on_pr";
    conditions?: {
        paths?: string[] | undefined;
        min_files?: number | undefined;
    } | undefined;
}>, z.ZodObject<{
    event: z.ZodLiteral<"on_commit">;
    conditions: z.ZodOptional<z.ZodObject<{
        branches: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
    }, "strip", z.ZodTypeAny, {
        branches?: string[] | undefined;
    }, {
        branches?: string[] | undefined;
    }>>;
}, "strip", z.ZodTypeAny, {
    event: "on_commit";
    conditions?: {
        branches?: string[] | undefined;
    } | undefined;
}, {
    event: "on_commit";
    conditions?: {
        branches?: string[] | undefined;
    } | undefined;
}>, z.ZodObject<{
    event: z.ZodLiteral<"scheduled">;
    cron: z.ZodString;
}, "strip", z.ZodTypeAny, {
    event: "scheduled";
    cron: string;
}, {
    event: "scheduled";
    cron: string;
}>, z.ZodObject<{
    event: z.ZodLiteral<"manual">;
}, "strip", z.ZodTypeAny, {
    event: "manual";
}, {
    event: "manual";
}>]>;
declare const PersonaConfigSchema: z.ZodObject<{
    severity: z.ZodDefault<z.ZodEnum<["error", "warning"]>>;
    autoFix: z.ZodDefault<z.ZodBoolean>;
    timeout: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
    timeout: number;
    autoFix: boolean;
    severity: "error" | "warning";
}, {
    timeout?: number | undefined;
    autoFix?: boolean | undefined;
    severity?: "error" | "warning" | undefined;
}>;
declare const PersonaOutputsSchema: z.ZodObject<{
    'agents-md': z.ZodDefault<z.ZodBoolean>;
    'ci-workflow': z.ZodDefault<z.ZodBoolean>;
    'runtime-config': z.ZodDefault<z.ZodBoolean>;
}, "strip", z.ZodTypeAny, {
    'agents-md': boolean;
    'ci-workflow': boolean;
    'runtime-config': boolean;
}, {
    'agents-md'?: boolean | undefined;
    'ci-workflow'?: boolean | undefined;
    'runtime-config'?: boolean | undefined;
}>;
interface Persona {
    version: 1 | 2;
    name: string;
    description: string;
    role: string;
    skills: string[];
    steps: Step[];
    commands?: string[];
    triggers: z.infer<typeof PersonaTriggerSchema>[];
    config: z.infer<typeof PersonaConfigSchema>;
    outputs: z.infer<typeof PersonaOutputsSchema>;
}

interface PersonaMetadata {
    name: string;
    description: string;
    filePath: string;
}
declare function loadPersona(filePath: string): Result<Persona, Error>;
declare function listPersonas(dir: string): Result<PersonaMetadata[], Error>;

declare function generateRuntime(persona: Persona): Result<string, Error>;

declare function generateAgentsMd(persona: Persona): Result<string, Error>;

declare function generateCIWorkflow(persona: Persona, platform: 'github' | 'gitlab'): Result<string, Error>;

interface HandoffContext {
    fromSkill: string;
    summary: string;
    pending: string[];
    planPath?: string;
}
interface TriggerDetectionResult {
    trigger: TriggerContext;
    handoff?: HandoffContext;
}
/**
 * Detect the appropriate trigger context by inspecting project state.
 * Returns `on_plan_approved` when a planning handoff with pending tasks exists.
 * Falls back to `manual` otherwise.
 */
declare function detectTrigger(projectPath: string): TriggerDetectionResult;

interface SkillExecutionContext {
    trigger: TriggerContext;
    projectPath: string;
    outputMode: 'inline' | 'artifact' | 'auto';
    baseSha?: string;
    headSha?: string;
    handoff?: HandoffContext;
}
interface SkillExecutionResult {
    status: 'pass' | 'fail';
    output: string;
    artifactPath?: string;
    durationMs: number;
}
declare function executeSkill(skillName: string, context: SkillExecutionContext): Promise<SkillExecutionResult>;

interface StepReport {
    name: string;
    type: 'command' | 'skill';
    status: 'pass' | 'fail' | 'skipped';
    result?: unknown;
    artifactPath?: string;
    error?: string;
    durationMs: number;
}
interface PersonaRunReport {
    persona: string;
    status: 'pass' | 'fail' | 'partial';
    steps: StepReport[];
    totalDurationMs: number;
}
type CommandExecutor = (command: string) => Promise<Result<unknown, Error>>;
type SkillExecutor = (skillName: string, context: SkillExecutionContext) => Promise<SkillExecutionResult>;
interface StepExecutionContext {
    trigger: TriggerContext | 'auto';
    commandExecutor: CommandExecutor;
    skillExecutor: SkillExecutor;
    projectPath: string;
    handoff?: HandoffContext;
}
declare function runPersona(persona: Persona, context: StepExecutionContext): Promise<PersonaRunReport>;

/**
 * Commands that the persona runner is allowed to execute via shell.
 * Shared between CLI agent run command and MCP handler.
 */
declare const ALLOWED_PERSONA_COMMANDS: Set<string>;

interface GenerateAgentDefsOptions {
    platforms: Platform[];
    global: boolean;
    output?: string;
    dryRun: boolean;
}
interface GenerateAgentDefsResult {
    platform: string;
    added: string[];
    updated: string[];
    removed: string[];
    unchanged: string[];
    outputDir: string;
}
declare function generateAgentDefinitions(opts: GenerateAgentDefsOptions): GenerateAgentDefsResult[];

interface AgentDefinition {
    name: string;
    description: string;
    tools: string[];
    role: string;
    skills: string[];
    steps: Step[];
    methodology: string;
}
declare const AGENT_DESCRIPTIONS: Record<string, string>;
declare const DEFAULT_TOOLS: readonly ["Bash", "Read", "Write", "Edit", "Glob", "Grep"];
/**
 * Map Claude Code tool names to Gemini CLI tool names.
 * Gemini CLI validates tool names and rejects unknown ones.
 *
 * Co-located with DEFAULT_TOOLS so adding a new default tool
 * is a clear prompt to add its Gemini equivalent here.
 */
declare const GEMINI_TOOL_MAP: Record<string, string>;
declare function generateAgentDefinition(persona: Persona, skillContents: Map<string, string>): AgentDefinition;

declare function renderClaudeCodeAgent(def: AgentDefinition): string;

declare function renderGeminiAgent(def: AgentDefinition): string;

type ToolDefinition = {
    name: string;
    description: string;
    inputSchema: Record<string, unknown>;
    /** When true, output scanning is skipped for this tool (internal content, not external). */
    trustedOutput?: boolean;
};
declare function getToolDefinitions(): ToolDefinition[];
declare function createHarnessServer(projectRoot?: string, toolFilter?: string[]): Server;
declare function startServer(toolFilter?: string[]): Promise<void>;

interface InstallOptions {
    version?: string;
    force?: boolean;
    from?: string;
    registry?: string;
    global?: boolean;
    /** Internal: tracks which package triggered this install (for transitive deps) */
    _dependencyOf?: string | null;
}
interface InstallResult {
    installed: boolean;
    skipped?: boolean;
    upgraded?: boolean;
    name: string;
    version: string;
    previousVersion?: string;
    warnings?: string[];
}
declare function runInstall(skillName: string, options: InstallOptions): Promise<InstallResult>;

interface InstallConstraintsOptions {
    source: string;
    configPath: string;
    lockfilePath: string;
    forceLocal?: boolean;
    forcePackage?: boolean;
    dryRun?: boolean;
}
interface InstallConstraintsSuccess {
    installed: boolean;
    packageName: string;
    version: string;
    contributionsCount: number;
    conflicts: ConflictReport[];
    alreadyInstalled?: boolean;
    dryRun?: boolean;
}
declare function runInstallConstraints(options: InstallConstraintsOptions): Promise<Result$1<InstallConstraintsSuccess, string>>;

interface UninstallConstraintsOptions {
    packageName: string;
    configPath: string;
    lockfilePath: string;
}
interface UninstallConstraintsSuccess {
    removed: boolean;
    packageName: string;
    version: string;
    sectionsRemoved: string[];
}
declare function runUninstallConstraints(options: UninstallConstraintsOptions): Promise<Result$1<UninstallConstraintsSuccess, string>>;

interface UninstallOptions {
    force?: boolean;
}
interface UninstallResult {
    removed: boolean;
    name: string;
    version: string;
    warnings?: string[];
}
declare function runUninstall(skillName: string, options: UninstallOptions): Promise<UninstallResult>;

/**
 * @harness-engineering/cli
 *
 * Command-line interface for the Harness Engineering toolkit.
 *
 * This package provides a unified `harness` command with subcommands for
 * validation, documentation management, dependency checking, and agent
 * orchestration.
 */

/**
 * Creates and configures the main Harness CLI program.
 *
 * Commands are auto-discovered from the commands/ directory via _registry.ts.
 * To add a new command: create it in commands/, export a createXXXCommand()
 * function, then run `pnpm run generate-barrel-exports` to regenerate the registry.
 *
 * @returns A Commander instance with all subcommands registered.
 */
declare function createProgram(): Command;

export { AGENT_DESCRIPTIONS, ALLOWED_PERSONA_COMMANDS, type AgentDefinition, CLIError, type CheckArchResult, type CommandExecutor, type CommandStep, type CreateSkillOptions, DEFAULT_TOOLS, ExitCode, GEMINI_TOOL_MAP, type GenerateAgentDefsOptions, type GenerateAgentDefsResult, type GenerateResult, type HandoffContext, type HarnessConfig, type InstallConstraintsOptions, type InstallConstraintsSuccess, type InstallResult, OutputFormatter, OutputMode, type Persona, type PersonaMetadata, type PersonaRunReport, type RenderedFiles, type SkillExecutionContext, type SkillExecutionResult, type SkillExecutor, type SkillSource, type SkillStep, type SnapshotCaptureResult, type Step, type StepExecutionContext, type StepReport, type TemplateContext, TemplateEngine, type TriggerContext, type TriggerDetectionResult, type UninstallConstraintsOptions, type UninstallConstraintsSuccess, type UninstallResult, buildPreamble, createHarnessServer, createProgram, detectTrigger, executeSkill, findConfigFile, generateAgentDefinition, generateAgentDefinitions, generateAgentsMd, generateCIWorkflow, generateRuntime, generateSkillFiles, generateSlashCommands, getToolDefinitions, handleError, listPersonas, loadConfig, loadPersona, logger, renderClaudeCodeAgent, renderGeminiAgent, resolveConfig, runCheckArch, runCheckPhaseGate, runCrossCheck, runGraphExport, runGraphStatus, runImpactPreview, runIngest, runInstall, runInstallConstraints, runPersona, runQuery, runScan, runSnapshotCapture, runUninstall, runUninstallConstraints, startServer };
