/**
 * "Change Impact" — config-driven classification of which git changes between the
 * live daemon's build commit and the workspace HEAD actually require a daemon
 * rebuild/restart (vs. a web-only redeploy, vs. nothing).
 *
 * The daemon-core git surface only knows the FACTS (which files / packages changed
 * between buildCommit..HEAD). The POLICY — which packages are daemon-runtime, which
 * are web-only, which root files are non-runtime, and what command to recommend —
 * is declarative config injected from outside. This keeps git-status.ts repo-agnostic
 * while preserving ADHDev's exact built-in behavior when no config is present.
 *
 * SECURITY: config is declarative only. JSON/YAML are parsed; arbitrary JS config
 * (.js) is intentionally NOT supported, so loading a config can never execute code.
 */
/** A change-impact classification bucket. */
export type ChangeImpactKind = 'daemon' | 'web' | 'none';
/**
 * Recommended action for a given impact classification. `recommendedAction` is the
 * stable classification key (always one of daemon|web|none, NOT config-overridable);
 * config customizes only the human-facing `recommendedCommand` recipe.
 */
export interface ChangeImpactTarget {
    /** Human-facing command/recipe to act on the impact (e.g. deploy + restart). */
    recommendedCommand: string;
}
export interface ChangeImpactConfig {
    /**
     * Package names (the `<name>` in `packages/<name>/`) whose change means the
     * daemon runtime is stale and must be rebuilt/redeployed + restarted. When
     * provided, this REPLACES the built-in daemon-runtime set.
     */
    daemonRuntimePackages?: string[];
    /**
     * Package names that are web-only — a change to one does not require a daemon
     * restart, only a web redeploy. When provided, this REPLACES the built-in
     * web-only set.
     */
    webOnlyPackages?: string[];
    /**
     * Glob patterns for root-level (non-package) files that demonstrably cannot
     * change what the daemon runtime executes (markers, docs, license text). These
     * are added on top of the built-in non-runtime root-file detection.
     */
    nonRuntimeRootFilePatterns?: string[];
    /** Recommended action/command per impact classification. Missing keys fall back to built-in defaults. */
    impactTargets?: Partial<Record<ChangeImpactKind, ChangeImpactTarget>>;
}
export interface ChangeImpactConfigLoadResult {
    config?: ChangeImpactConfig;
    source: string;
    sourceType: 'repo_file' | 'unavailable' | 'invalid';
    path?: string;
    error?: string;
    /**
     * Stable identity of the config SOURCE, used as part of a cache key so a config
     * edit invalidates any cached impact evaluation. Combines the resolved path and
     * its mtime (or the path for the unavailable/invalid case).
     */
    sourceKey: string;
}
export declare const CHANGE_IMPACT_CONFIG_LOCATIONS: string[];
export declare const CHANGE_IMPACT_CONFIG_SCHEMA: {
    readonly $schema: "https://json-schema.org/draft/2020-12/schema";
    readonly title: "ADHDev Change Impact Config";
    readonly type: "object";
    readonly additionalProperties: false;
    readonly properties: {
        readonly daemonRuntimePackages: {
            readonly type: "array";
            readonly items: {
                readonly type: "string";
                readonly minLength: 1;
            };
        };
        readonly webOnlyPackages: {
            readonly type: "array";
            readonly items: {
                readonly type: "string";
                readonly minLength: 1;
            };
        };
        readonly nonRuntimeRootFilePatterns: {
            readonly type: "array";
            readonly items: {
                readonly type: "string";
                readonly minLength: 1;
            };
        };
        readonly impactTargets: {
            readonly type: "object";
            readonly additionalProperties: false;
            readonly properties: {
                readonly daemon: {
                    readonly $ref: "#/$defs/target";
                };
                readonly web: {
                    readonly $ref: "#/$defs/target";
                };
                readonly none: {
                    readonly $ref: "#/$defs/target";
                };
            };
        };
    };
    readonly $defs: {
        readonly target: {
            readonly type: "object";
            readonly additionalProperties: false;
            readonly required: readonly ["recommendedCommand"];
            readonly properties: {
                readonly recommendedCommand: {
                    readonly type: "string";
                    readonly minLength: 1;
                };
            };
        };
    };
};
export declare function validateChangeImpactConfig(raw: unknown, source?: string): {
    valid: boolean;
    errors: string[];
    config?: ChangeImpactConfig;
};
/**
 * Locate and load the Change Impact config for a repo root. Declarative only —
 * never executes config. Returns a sourceKey suitable for cache invalidation:
 * config path + mtime, or the sentinel for the missing/invalid case.
 */
export declare function loadChangeImpactConfig(repoRoot: string): ChangeImpactConfigLoadResult;
/**
 * Translate a config glob pattern into a RegExp matched against a forward-slash
 * file path. Supports `**` (any path segments), `*` (any chars except `/`), and
 * `?` (single non-slash char). No brace/character-class expansion — declarative,
 * minimal, predictable. All other characters are matched literally.
 */
export declare function globToRegExp(pattern: string): RegExp;
export interface ChangeImpactConfigSuggestion {
    /** A non-executable, declarative config draft a human can save verbatim. */
    suggestedConfig: ChangeImpactConfig;
    /** Per-field human-facing rationale for the proposed classification. */
    notes: string[];
    /** Package directories discovered under `packages/` (and `oss/packages/`). */
    discoveredPackages: {
        daemon: string[];
        web: string[];
        unclassified: string[];
    };
}
/**
 * Inspect a repo's package layout and propose a reasonable, declarative Change
 * Impact config draft. This is heuristic scaffold ONLY — it never executes
 * anything and the draft must be reviewed/saved by a human before it takes
 * effect. The heuristic mirrors ADHDev's own conventions:
 *   - `web-*` / `*-web` packages → web-only (web redeploy, no daemon restart)
 *   - everything else under packages/ → daemon-runtime (rebuild + restart)
 *   - docs/license/marker root files → non-runtime
 * Callers are expected to prune the draft to their actual runtime topology.
 */
export declare function suggestChangeImpactConfig(repoRoot: string): ChangeImpactConfigSuggestion;
