/**
 * Mesh init / onboarding helper.
 *
 * One-shot helper that onboards an existing git project into Repo Mesh:
 *   1. suggest + write `.adhdev/refine.json`           (Refinery validation config)
 *   2. suggest + write `.adhdev/worktree_bootstrap.json` (worktree bootstrap config)
 *   3. suggest + write `.adhdev/change-impact.json`     (change-impact classification)
 *   4. recommend a node providerPriority from the installed CLI providers
 *
 * mesh_init now covers all THREE repo-committed `.adhdev/*` config families that
 * carry a suggest→validate→write engine (refine + worktree_bootstrap +
 * change-impact). `.adhdev/mesh.json` (coordinator prompt + operating notes) has
 * its own dedicated export/write path (export_mesh_json_config / write_mesh_json_config).
 *
 * Design contract (matches the rest of the mesh tooling):
 *   - Heuristics are suggestion/scaffold only. The written files are the
 *     execution source of truth; Refinery/bootstrap only ever read the saved
 *     config. The suggestion functions never become the execution path.
 *   - Writing is opt-in (`write: true`) and never clobbers an existing config
 *     unless `overwrite: true` is set, so re-running init on an already-onboarded
 *     repo is safe.
 *   - The providerPriority recommendation is returned, not auto-applied to the
 *     node policy — applying it mutates mesh policy, which is the coordinator's
 *     decision.
 */
import { type RepoMeshRefineConfig, type RepoMeshRefineValidationCommandConfig } from './refine-config.js';
import { type RepoMeshWorktreeBootstrapConfig } from './worktree-bootstrap-config.js';
import { type ChangeImpactConfig } from '../git/change-impact-config.js';
import type { MagiKindPanelMap } from '@adhdev/mesh-shared';
import type { CLIInfo } from '../detection/cli-detector.js';
/** Canonical write targets — the first/preferred location for each config family. */
export declare const MESH_INIT_REFINE_CONFIG_PATH: string;
export declare const MESH_INIT_WORKTREE_BOOTSTRAP_CONFIG_PATH: string;
export declare const MESH_INIT_CHANGE_IMPACT_CONFIG_PATH: string;
export interface MeshInitConfigFileResult {
    path: string;
    relativePath: string;
    written: boolean;
    /** Why it was not written (already_exists / not_suggested / no change). */
    skippedReason?: 'already_exists' | 'no_suggestion';
    config?: RepoMeshRefineConfig | RepoMeshWorktreeBootstrapConfig | ChangeImpactConfig;
}
/**
 * Build a worktree_bootstrap scaffold from package scripts. Mirrors
 * suggestMeshRefineConfig's "scaffold only" posture: prefers an `install`/`ci`
 * style script, else falls back to `npm install`, and records existing
 * lockfiles as staleInputs so a base merge that changes them re-runs bootstrap.
 *
 * Returns undefined when there is nothing meaningful to scaffold.
 */
export declare function suggestMeshWorktreeBootstrapConfig(workspace: string): {
    commands: RepoMeshRefineValidationCommandConfig[];
    staleInputs: string[];
    suggestedConfig?: RepoMeshWorktreeBootstrapConfig;
};
export declare function suggestNodeProviderPriority(detected: CLIInfo[]): {
    providerPriority: string[];
    installedProviders: Array<{
        id: string;
        displayName: string;
        version?: string;
    }>;
};
export interface RunMeshInitOptions {
    /** When true, persist suggested configs to disk. Defaults to dry-run (false). */
    write?: boolean;
    /** When true, overwrite an existing config file. Defaults to false (never clobber). */
    overwrite?: boolean;
}
/**
 * A snapshot of the currently-saved config for each domain, so the coordinator can
 * render a current-vs-suggested diff to the user before an init/reinit overwrite.
 * This is READ-ONLY echo — every field is what is on disk / machine-local right now,
 * never a suggestion. Absent domains are reported as `undefined` config.
 */
export interface MeshInitCurrentConfigEcho {
    /** Currently-saved `.adhdev/refine.json` (repo-committed) — undefined when absent/invalid. */
    refine?: RepoMeshRefineConfig;
    /** Currently-saved `.adhdev/worktree_bootstrap.json` (repo-committed). */
    worktreeBootstrap?: RepoMeshWorktreeBootstrapConfig;
    /** Currently-saved `.adhdev/change-impact.json` (repo-committed). */
    changeImpact?: ChangeImpactConfig;
    /** Per-domain source type so the coordinator can tell "absent" from "invalid". */
    sourceTypes: {
        refine: string;
        worktreeBootstrap: string;
        changeImpact: string;
    };
    /**
     * Currently-configured MAGI kind→panel slot bindings (machine-local
     * ~/.adhdev/meshes.json). Empty object when none configured. This is a
     * machine-local echo — the coordinator labels it as such vs. the repo files.
     */
    magiKindPanels: MagiKindPanelMap;
}
export interface RunMeshInitResult {
    success: true;
    workspace: string;
    dryRun: boolean;
    refine: MeshInitConfigFileResult;
    worktreeBootstrap: MeshInitConfigFileResult;
    changeImpact: MeshInitConfigFileResult;
    providers: {
        providerPriority: string[];
        installedProviders: Array<{
            id: string;
            displayName: string;
            version?: string;
        }>;
    };
    /**
     * Read-only snapshot of the currently-saved config per domain (repo files +
     * machine-local kind panels). Lets the coordinator present a current-vs-suggested
     * diff to the user before any overwrite. Always populated (dry-run and write).
     */
    currentConfig: MeshInitCurrentConfigEcho;
    note: string;
}
/**
 * Orchestrate the full onboarding flow for one workspace:
 *   detect installed CLIs → suggest refine + bootstrap configs → (optionally)
 *   write them → recommend a node providerPriority.
 *
 * `detected` is injected (the caller resolves it via detectCLIs with its
 * ProviderLoader) so this module stays free of provider-loader wiring and is
 * trivially unit-testable.
 */
export declare function runMeshInit(mesh: any, workspace: string, detected: CLIInfo[], options?: RunMeshInitOptions): RunMeshInitResult;
