/** Files scaffolded by `totem init` that are fully owned by Totem. * Exported for the sense-roster set-equality test (mmnto-ai/totem#2620) — * a sampled roster assertion cannot detect a dropped member. */ export declare const TOTEM_SCAFFOLDED_FILES: string[]; /** Deletion/scrub targets shared by the mutation steps AND the rule-2 sense * roster — one source, read by both sides and by the parity test (Tenet 20; * round 2, F5: a literal re-declared in the sense was a mirror that could * drift when `deleteArtifacts` gained a member). */ export declare const EJECT_ARTIFACT_DIRS: string[]; export declare const EJECT_CONFIG_FILE = "totem.config.ts"; export declare const CLAUDE_SETTINGS_LOCAL_FILE = ".claude/settings.local.json"; export declare const CLAUDE_SETTINGS_FILE = ".claude/settings.json"; export interface EjectSummary { removed: string[]; scrubbed: string[]; skipped: string[]; } /** * Resolved git-hook context for eject (mmnto-ai/totem#2426). * * `.git` is a DIRECTORY in a plain checkout / main working tree and a POINTER * FILE in a linked worktree (or submodule), where the hooks git actually runs * live in the SHARED common dir — so a blind `.git/hooks` join from `cwd` (the * pre-fix behavior) silently no-oped in a worktree AND missed the git root when * eject was run from a subdirectory. */ export interface EjectHooksContext { /** * The resolved git hooks directory (via the #2422 `resolveHooksDir` helper — * worktree/`commondir`/`core.hooksPath`-aware), or `null` when no repo/hooks * dir could be resolved (not-a-repo, unparseable `.git` pointer). */ hooksDir: string | null; /** * `.git` is a POINTER FILE — a linked worktree (or submodule) whose resolved * hooks dir is SHARED across every worktree of the repo. */ isLinkedWorktree: boolean; } /** * Resolve where eject should look for git hooks, reusing the SAME helpers every * `hook install` entry point uses (mmnto-ai/totem#2426, sibling of #2422): the * git root via `resolveGitRootForHookPath` (anchors from a subdirectory; maps an * unparseable pointer to a null root) and the hooks dir via `resolveHooksDir` * (git's own worktree/`commondir` walk — the rev-parse root resolution the * hardcode-`.git/hooks` lesson prescribes). Resolution is a READ, not the * mutation boundary: a genuine git failure degrades to an unresolvable-hooks * result that the caller reports as per-hook skip lines. No backstop rides * this path — nothing has been mutated when it fires. */ export declare function resolveEjectHooksContext(cwd: string): Promise; /** * Remove the Totem section from the post-merge git hook. * Deletes the file entirely if it only contains the Totem hook. * `hooksDir` is the resolved git hooks directory (mmnto-ai/totem#2426). */ export declare function scrubPostMergeHook(hooksDir: string, summary: EjectSummary): void; /** * Remove the Totem section from the post-checkout git hook. * Deletes the file entirely if it only contains the Totem hook. * `hooksDir` is the resolved git hooks directory (mmnto-ai/totem#2426). */ export declare function scrubPostCheckoutHook(hooksDir: string, summary: EjectSummary): void; /** Reflex files that predate the marker era and may carry a v1 marker-less * block. REFLEX_START shipped before GEMINI.md / .junie/guidelines.md / * .github/copilot-instructions.md joined the tool table, so on those files a * bare legacy heading can only be user-authored — never scrubbed. * `.gemini/gemini.md` is the RETIRED pre-marker Gemini target (replaced by * GEMINI.md when the tool table landed): init no longer injects there, but an * old block can still be sitting in it, so eject still visits it. */ export declare const LEGACY_REFLEX_FILES: string[]; /** * Remove the AI Integration block appended by `totem init` to reflex files. * * Exported for the summary-contract tests (mmnto-ai/totem#2602). */ export declare function scrubReflexFiles(cwd: string, summary: EjectSummary): Promise; /** Derived pre-consent VCS state for the files eject is about to mutate. */ export interface DirtyTreeSense { /** `git status --porcelain` lines for roster paths with uncommitted changes. */ dirty: string[]; /** * `!!` porcelain lines: gitignored roster paths. Git holds NO copy of these * at all — for a deletion target (`.totem/secrets.json`, `.lancedb/`) that * is the strongest no-revert-point class, and plain `git status` omits them * by design (2026-08-09 falsification round 1, finding 2). */ ignored: string[]; /** Human sense lines to print ahead of the consent prompt (empty = clean derivation). */ lines: string[]; } /** * Rule-2 sense of the User-File Mutation Contract (mmnto-ai/totem#2620): the * git-native form of backup-before-modify is knowing whether a commit exists * to diff against, so eject SAYS which of its mutation targets carry * uncommitted changes before asking consent. Sense-and-say only (Tenet 13): * never a block, never an exit-code change; `--force` skips the prompt, not * the sense. Deletions count — deleting a tracked-dirty file is the limiting * case of mutation with no revert point (author intent-read Q3). * * The roster derives from the SAME constants the scrub/removal steps consume * (Tenet 20 — a hand-mirrored sense list would be the prohibited mirror * inside the very rule built to prevent silent loss). `.git/hooks/*` never * appears here: git cannot see that surface — its recovery is scrubHook's * rule-3 `.totem-bak` artifact. * * Exported for the sense-contract tests. */ export declare function deriveDirtyTreeSense(cwd: string): Promise; export interface EjectOptions { force?: boolean; } export declare function ejectCommand(options: EjectOptions): Promise; //# sourceMappingURL=eject.d.ts.map