/** One-shot idempotent migrations. Each is guarded by an existence check so re-running is safe. */
export { foldLegacySystemRepo } from '../migrate-fold.js';
/** Migrate a legacy single-repo agents.yaml into ~/.agents/agents.yaml. Leaves the tracked system-mirror copy alone to avoid dirtying the npm-shipped defaults. */
export declare function migrateAgentsYaml(systemDir?: string, userDir?: string): void;
/**
 * Stop tracking the user repo's CHANGELOG.md. It duplicates the npm-shipped
 * `.system/CHANGELOG.md` (read the canonical copy from there), and as a tracked
 * file that upstream never carries it can only ever show as `M`/`??`
 * — dirtying the tree and, when a peer's publish commit arrives, tripping the
 * dirty-tree pull guard. De-track it into `.git/info/exclude` (per-clone,
 * uncommitted; never `.gitignore`, which would re-introduce the same failure).
 * Idempotent: a no-op once the path is untracked and excluded.
 */
export declare function detrackUserChangelog(userDir?: string): void;
/** Fold the legacy global browser/sessions/<task>/ tree into the per-profile browser/<profile>/sessions/<task>/ layout. Unclaimed tasks move under `_legacy`. */
export declare function foldBrowserSessionsIntoProfiles(browserDir?: string): void;
/** Repair node_modules/.bin/<cli> symlinks that resolve back into our own shims dir (infinite exec-loop fix). */
export declare function repairSelfReferentialBinShims(versionsRoot?: string, shimsDir?: string, historyDir?: string): void;
/** Move the auto-detected `default` browser profile from committed agents.yaml into the per-device file. The device file is written first so a crash cannot lose the profile; central is edited via yaml.Document to preserve comments. */
export declare function migrateMachineLocalBrowserProfileOutOfCentral(userDir?: string, machine?: string): void;
/** Rename the legacy `extras-extras/` plugin marketplace dir to `agents-extras/` in every installed version home, and rewrite cross-references in `known_marketplaces.json` and `settings.json`. */
export declare function migrateExtrasExtrasToAgentsExtras(historyDir?: string): void;
/**
 * Rewrite every routine YAML that carries the legacy singular `device: <value>`
 * field to the new plural `devices: [<value>]` format. Preserves all other
 * fields. Idempotent: a routine that already has `devices:` (or neither field)
 * is left untouched.
 *
 * Params default to the real routines dir; injectable for tests.
 */
export declare function migrateRoutineDeviceToDevices(routinesDir?: string): void;
/**
 * Fold the legacy host-placement `remoteCwd` field into the canonical portable
 * `cwd` (RUSH-2290). Host dispatch used to read `remoteCwd` while a local run
 * inferred its cwd from `repo` — two path semantics for one concept. The runner
 * now resolves every placement from `cwd`, so this idempotently rewrites the
 * field:
 *
 * - `remoteCwd` present, no `cwd`  → rename to `cwd`.
 * - both present and equal          → drop the duplicate `remoteCwd`.
 * - both present and DIFFERENT       → conflict: leave BOTH fields untouched so
 *   the migration never silently chooses one; `validateJob`/`doctor` then flag the
 *   pair and the routine stays paused rather than running against a guessed path.
 *
 * Idempotent: a file with only `cwd` (already migrated) is skipped.
 */
export declare function migrateRoutineRemoteCwdToCwd(routinesDir?: string): void;
/**
 * Pause every currently-active routine whose execution context no longer
 * resolves ready (RUSH-2290). An agent/workflow routine with no project/cwd, a
 * missing directory, or a non-portable path used to fire and fail every tick —
 * the mass auth_failed / untrusted-home storm this ticket exists to stop. After
 * the fold, such a routine is deactivated on THIS device (only), preventing it
 * from being scheduled until `agents routines doctor --all --fix` (or a repair +
 * `resume`) makes it ready. Never materializes a device manifest that does not
 * yet exist, and never touches command routines (they run in the target home).
 */
export declare function pauseUnreadyEnabledRoutines(): void;
/**
 * Fold the legacy watchdog enable sentinel into the `watchdog.enabled` config.
 *
 * The always-on watchdog used to be gated by a presence sentinel at
 * `<runtime-state>/watchdog/enabled`; it is now a daemon-owned timer (RUSH-2495)
 * gated by the `watchdog.enabled` device-config flag — the same flag
 * `agents watchdog enable` writes. A user who had run `agents watchdog enable`
 * under the old build has that file on disk; without this, upgrading would
 * silently drop them back to OFF (the nudge just stops), the worst failure mode
 * for a "survives reboots" feature. If the sentinel exists, set
 * `watchdog.enabled: true`, then delete the sentinel so this runs exactly once.
 * If setting it fails, the sentinel is left in place so a later run retries
 * rather than silently losing the opt-in.
 *
 * The setter seam is injectable so the migration is unit-testable without
 * touching the real device config.
 */
export declare function migrateWatchdogSentinelToConfig(sentinelPath?: string, enable?: (value: boolean) => void): void;
/**
 * Rename cli/ → clis/ in each of the given `.agents/` directories.
 *
 * One-way, idempotent: no-op when src is absent. Throws when both
 * `<dir>/cli` and `<dir>/clis` exist — the user must resolve the conflict
 * manually before proceeding. Exported for unit-testing with temp dirs.
 */
export declare function migrateCliDirToClis(agentsDirs: string[]): void;
/**
 * An earlier agents-cli release put Cursor's file-backed OAuth token at
 * ~/.config/cursor/auth.json. Current Cursor actually writes the file store to
 * HOME-relative ~/.cursor/auth.json. Copy that legacy token into the active
 * account's version home. The active account
 * is the home the ~/.cursor symlink currently targets. Idempotent: skips when
 * the home already has its own token, and a no-op for unmanaged Cursor installs
 * (where ~/.cursor is a real dir, not a symlink into a version home).
 */
export declare function seedActiveCursorLoginPerVersion(): void;
/**
 * Fold the pre-markdown Kimi subagent layout out of every kimi version home.
 *
 * agents-cli used to write each Kimi subagent as a `<name>.yaml` +
 * `<name>.system.md` pair plus a managed `_agents-cli.yaml` index, against the
 * agentspec of `kimi-cli` — a different product from the `kimi-code` harness we
 * install, which never read any of it. Those files are inert, but not harmless:
 * `<name>.system.md` ends in `.md`, so the subagent enumerator would surface it
 * as a phantom subagent named `<name>.system`, and kimi-code logs
 * `Missing frontmatter` for it once per session.
 *
 * This is the ONE place that knows about the old layout — the registry target
 * describes only the current `<name>.md` shape. A pair is identified by its
 * signature (a `<name>.yaml` with a sibling `<name>.system.md`), so a subagent a
 * user legitimately named e.g. `foo.system` is never touched: it has no
 * `foo.yaml` beside it. Idempotent; a no-op once the dirs are clean.
 */
export declare function migrateKimiSubagentsToMarkdown(versionsDir?: string): void;
/**
 * Remove the compiled "project" ruleset the compiler used to write into $HOME
 * (RUSH-2725). `compileRulesForProject` treated any cwd with `.agents/rules`
 * as a project — and the user layer at ~/.agents satisfies that test — so it
 * wrote ~/AGENTS.md plus per-agent symlinks, and every session under $HOME
 * then loaded the entire ruleset twice (global memory + "project" memory).
 * The compiler now refuses reserved roots; this removes the artifact already
 * on disk. Only files we provably own are touched: an AGENTS.md carrying the
 * compiled-project header, symlinks pointing at it, and copy-fallback files
 * (symlink-less filesystems) carrying the same header.
 */
export declare function removeHomeCompiledProjectRules(homeDir?: string): void;
/** Run all idempotent migrations. Safe to call multiple times. */
export declare function runMigration(): Promise<void>;
