import { t as AgentPermissionPolicy } from "./schema-BXTTXvJl.mjs"; import { AgentId } from "./compat/codecs.mjs"; import { UnsupportedCapabilityError } from "./compat/unsupported.mjs"; //#region src/sync.d.ts export interface SyncOptions { /** Starting directory. */ cwd: string; /** Number of parent directories to ascend (0 = cwd only). Infinity = root. */ up: number; /** Agents to include in bidirectional sync. Empty = all detected. */ with: AgentId[]; /** Agents to exclude from bidirectional sync. */ without: AgentId[]; /** Apply changes without prompting. */ yes: boolean; /** Show changes only, never write. */ dryRun: boolean; /** Create config files that don't exist. */ create: boolean; /** Show verbose output (rule provenance). */ verbose: boolean; /** Write .bak files before overwriting. Oh My Pi's config is always backed up. */ backup: boolean; /** Oh My Pi's agent directory, which holds its global config (see `defaultOmpAgentDir`). */ ompAgentDir: string; /** Also write Oh My Pi's global config, which every OMP session on the machine reads. */ ompGlobal: boolean; } export interface SyncResult { /** Per-file changes that would be applied. */ changes: FileChange[]; /** Whether changes were applied. */ applied: boolean; /** * Agents whose native format cannot enforce a rule in the merged policy. When any are listed * nothing is written, since a partial sync would leave the refused agents on a looser policy. */ refused: UnsupportedCapabilityError[]; } export interface FileChange { /** Absolute path to the file. */ path: string; /** Agent this file belongs to. */ agent: AgentId | "canonical"; /** "create" | "update" */ kind: "create" | "update"; /** Current content (null for new files). */ current: string | null; /** Proposed content. */ proposed: string; } interface AgentFile { agent: AgentId | "canonical"; /** Absolute path to the config file. */ path: string; /** Whether this is a local override (read-only, never written). */ local: boolean; } export interface DecodedSource { file: AgentFile; policy: AgentPermissionPolicy; } interface WriteTarget { agent: AgentId | "canonical"; path: string; /** The file's new content, given its current content (`null` for a new file). */ render: (current: string | null) => string; exists: boolean; } /** What sync needs from a codec, so the encoding step can be tested without real agent formats. */ interface Encoder { encode(canonical: AgentPermissionPolicy): unknown; } /** * Work out the files to write. An agent whose codec refuses the merged policy is reported in * `refused` and never skipped silently. * * @param ompGlobalPath Oh My Pi's global config, written as well when given. */ export declare function computeWriteTargets(cwd: string, merged: AgentPermissionPolicy, sources: DecodedSource[], agentFilter: Set | undefined, create: boolean, codecs?: Readonly>, ompGlobalPath?: string): { targets: WriteTarget[]; refused: UnsupportedCapabilityError[]; }; export declare function sync(options: SyncOptions): Promise; //#endregion //# sourceMappingURL=sync.d.mts.map