/** * Backend migration — upgrades state backend across allowed transitions. * * Supported migrations: * - local → orphan * - local → two-layer * - worktree → orphan * - worktree → two-layer * - orphan ↔ two-layer (both write to the squad-state orphan branch via different layers) * * In addition to flipping the `stateBackend` key in `.squad/config.json`, this * function MIGRATES pre-existing working-tree state (`decisions.md`, * `agents//history.md`) onto the squad-state orphan branch when moving * from a working-tree backend to an orphan-storage backend, so post-upgrade * agents can read pre-upgrade content (UPGRADE-NO-MIGRATION fix). */ /** Best-effort: ensure the squad-state orphan branch exists. Returns true on success. */ export declare function ensureOrphanBranch(dest: string): boolean; /** * Migrate the state backend for an existing squad project. * * Fixes: * - UPGRADE-FLAG-IGNORED: writes the new `stateBackend` value into config.json * via JSON-aware merge (never textual append → avoids Bug E duplicates). * - UPGRADE-NO-MIGRATION: when moving from a working-tree backend to an * orphan-storage backend, carries existing decisions.md and agent histories * onto the squad-state orphan branch so post-upgrade agents see prior state. * - WI-1: re-installs the full hook set (including new pre-commit/post-commit). */ export declare function migrateStateBackend(dest: string, target: string): Promise; /** * INSIDER3-INIT-LEAK fix: when `squad init --state-backend orphan|two-layer` * runs, the SDK still hand-writes mutable state files (decisions.md and each * agent's history.md) into the working tree because it has no knowledge of the * future backend choice. This helper, invoked by the CLI immediately after the * orphan branch is created, lifts those mutable files onto the squad-state * orphan branch and removes them from the working tree so post-init agents * read state exclusively through the runtime bridge. * * Source-of-truth hierarchy preserved: static files (team.md, charters, * ceremonies.md, casting/*, templates/*) are NEVER touched — only mutable * state (decisions.md, agents//history.md) migrates. * * Returns the relative paths of files that were migrated + removed. */ export declare function liftInitMutableStateOntoOrphan(dest: string): string[]; //# sourceMappingURL=migrate-backend.d.ts.map