/** * omx setup - Automated installation of oh-my-codex * Installs skills, prompts, MCP servers config, and AGENTS.md */ import { type Stats } from "fs"; import { type NativeHookClaimJournalDurability } from "./native-hook-claim-journal.js"; import { type SetupTeamMode } from "../config/team-mode.js"; import { SETUP_INSTALL_MODES, SETUP_MCP_MODES, SETUP_SCOPES, type PersistedSetupScope, type SetupInstallMode, type SetupMcpMode, type SetupScope } from "./setup-preferences.js"; interface SetupOptions { codexFeaturesProbe?: () => string | null; codexVersionProbe?: () => string | null; force?: boolean; mergeAgents?: boolean; mergeAgentsPolicy?: { kind: "set"; value: boolean; } | { kind: "clear"; }; dryRun?: boolean; installMode?: SetupInstallMode; mcpMode?: SetupMcpMode; teamMode?: SetupTeamMode; scope?: SetupScope; verbose?: boolean; agentsOverwritePrompt?: (destinationPath: string) => Promise; skipNativeAgentRefresh?: boolean; setupScopePrompt?: (defaultScope: SetupScope) => Promise; persistedSetupReviewPrompt?: (preferences: Partial) => Promise; installModePrompt?: (defaultMode: SetupInstallMode) => Promise; modelUpgradePrompt?: (currentModel: string, targetModel: string) => Promise; pluginAgentsMdPrompt?: (destinationPath: string) => Promise; pluginDeveloperInstructionsPrompt?: (configPath: string) => Promise; firstPartyMcpRemovalPrompt?: (configPath: string, registrationKinds: string[]) => Promise; mcpRegistryCandidates?: string[]; } export { SETUP_INSTALL_MODES, SETUP_MCP_MODES, SETUP_SCOPES }; export { SETUP_TEAM_MODES, type SetupTeamMode } from "../config/team-mode.js"; export type { SetupInstallMode, SetupMcpMode, SetupScope }; export interface ScopeDirectories { codexConfigFile: string; codexHomeDir: string; codexHooksFile: string; nativeAgentsDir: string; promptsDir: string; skillsDir: string; } interface SetupCategorySummary { updated: number; unchanged: number; backedUp: number; skipped: number; removed: number; } interface SetupBackupContext { backupRoot: string; baseRoot: string; } export interface SkillFrontmatterMetadata { name: string; description: string; } type PersistedSetupReviewDecision = "keep" | "review" | "reset"; type NativeHookTransactionArtifactKind = "shim" | "hooks" | "config" | "metadata"; type NativeHookTransactionFailureStage = "before_precondition" | "before_backup" | "before_temp_write" | "before_rename" | "after_final_rename_validation" | "after_rename" | "before_remove" | "after_final_remove_validation" | "after_remove" | "before_readback" | "before_rollback" | "before_rollback_rename" | "after_final_restore_validation" | "before_rollback_remove" | "before_staged_cleanup" | "after_staged_cleanup"; type NativeHookTransactionTopology = { kind: "absent"; } | { kind: "regular_file"; mode: number; }; interface NativeHookTransactionArtifactSnapshot { bytes: Buffer | null; topology: NativeHookTransactionTopology; device?: number; inode?: number; links?: number; } interface NativeHookTransactionArtifact { kind: NativeHookTransactionArtifactKind; path: string; label: string; before: NativeHookTransactionArtifactSnapshot; after: Buffer | null; afterTopology: NativeHookTransactionTopology; hookPlatform?: NodeJS.Platform; } interface NativeHookTransactionPrecondition { kind: NativeHookTransactionArtifactKind; path: string; label: string; before: NativeHookTransactionArtifactSnapshot; } /** @internal Test seam for deterministic atomic-write and rollback coverage. */ export declare function setNativeHookTransactionFailureInjectorForTest(injector: ((stage: NativeHookTransactionFailureStage, target: NativeHookTransactionArtifact | NativeHookTransactionPrecondition) => void) | undefined): () => void; /** @internal Test seam proving native artifacts commit only after later setup phases. */ export declare function setSetupLatePhaseFailureInjectorForTest(injector: (() => void) | undefined): () => void; /** @internal Test seam for deterministic Windows transaction coverage. */ export declare function setNativeHookTransactionPlatformForTest(platform: NodeJS.Platform | undefined): () => void; /** @internal Test seam for deterministic native transaction temporary-path coverage. */ export declare function setNativeHookTransactionTemporaryPathForTest(resolver: ((path: string, purpose: "write" | "delete") => string) | undefined): () => void; /** @internal Test seam for deterministic regular-file fsync coverage. */ export declare function setNativeHookTransactionRegularFileSyncForTest(sync: ((platform: NodeJS.Platform) => Promise) | undefined): () => void; /** @internal Test seam for deterministic artifact read-back coverage. */ export declare function setNativeHookTransactionArtifactLstatForTest(artifactLstat: ((path: string) => Promise) | undefined): () => void; /** @internal Test seam for deterministic claim-journal durability coverage. */ export declare function setNativeHookClaimJournalDurabilityForTest(durability: NativeHookClaimJournalDurability | undefined): () => void; type WindowsNativeHookShimReferenceDecision = "not_referenced" | "referenced" | "ambiguous"; /** * Decides whether a proof-owned Windows shim must remain after a hooks.json * transition. JSON is strictly validated and decoded before inspection so * escaped paths are handled semantically. Unknown future event members are * scanned only through the established executable group/command shape; prompt * and agent payloads remain inert metadata. */ export declare function decideWindowsNativeHookShimReference(finalHooksContent: string | null, shimPath: string): WindowsNativeHookShimReferenceDecision; export declare function parseSkillFrontmatter(content: string, filePath?: string): SkillFrontmatterMetadata; export declare function validateSkillFile(skillMdPath: string): Promise; export declare function resolveScopeDirectories(scope: SetupScope, projectRoot: string): ScopeDirectories; export declare function setup(options?: SetupOptions): Promise; export declare function installSkills(srcDir: string, dstDir: string, backupContext: SetupBackupContext, options: SetupOptions): Promise; //# sourceMappingURL=setup.d.ts.map