import { mkdir, rename, rm, writeFile } from "fs/promises"; import { type SetupTeamMode } from "../config/team-mode.js"; export declare const SETUP_SCOPES: readonly ["user", "project"]; export type SetupScope = (typeof SETUP_SCOPES)[number]; export declare const SETUP_INSTALL_MODES: readonly ["legacy", "plugin"]; export type SetupInstallMode = (typeof SETUP_INSTALL_MODES)[number]; export declare const SETUP_MCP_MODES: readonly ["none", "compat"]; export type SetupMcpMode = (typeof SETUP_MCP_MODES)[number]; export interface PersistedSetupScope { scope: SetupScope; installMode?: SetupInstallMode; mcpMode?: SetupMcpMode; teamMode?: SetupTeamMode; mergeAgents?: boolean; } export type PartialPersistedSetupScope = Partial; export declare function isSetupScope(value: string): value is SetupScope; export declare function isSetupInstallMode(value: string): value is SetupInstallMode; export declare function isSetupMcpMode(value: string): value is SetupMcpMode; export declare function getSetupScopeFilePath(projectRoot: string): string; export declare function resolvePersistedSetupMergeAgents(preferences: PartialPersistedSetupScope | undefined, scope: SetupScope): boolean | undefined; export interface WritePersistedSetupPreferencesDependencies { mkdir?: typeof mkdir; writeFile?: typeof writeFile; rename?: typeof rename; rm?: typeof rm; createTempName?: () => string; } export declare function writePersistedSetupPreferences(projectRoot: string, preferences: PersistedSetupScope, dependencies?: WritePersistedSetupPreferencesDependencies): Promise; export declare function readPersistedSetupPreferences(projectRoot: string, options?: { warnOnLegacyScope?: boolean; }): Promise; export declare function readPersistedSetupPreferencesSync(projectRoot: string, options?: { warnOnError?: boolean; }): PartialPersistedSetupScope | undefined; export declare function readPersistedSetupScopeSync(projectRoot: string): SetupScope | undefined; export interface NearestPersistedSetupScope { projectRoot: string; scope: SetupScope; } /** * Resolve the nearest persisted setup scope by walking upward from `startDir`. * * Launch-time scope resolution is cwd-sensitive: a project-scoped setup must * keep launches inside its tree on the project-local Codex config, so the * walk stops at the first ancestor (including `startDir` itself) that has a * `.omx/setup-scope.json`. A marker that cannot be parsed stops the walk and * yields no scope rather than skipping a nearer setup marker. Returns * `undefined` when no marker exists anywhere above `startDir`. */ export declare function resolveNearestPersistedSetupScopeSync(startDir: string): NearestPersistedSetupScope | undefined; //# sourceMappingURL=setup-preferences.d.ts.map