import { type PortableSkillOptions } from "./portable-skills.js"; export { LAYOUT_MIGRATION_RECORD, SKILLS_CACHE_DIRNAME, isOwnerLayoutMigrated } from "./config.js"; export declare const LOGS_DIRNAME = "logs"; export declare const OUTPUTS_DIRNAME = "outputs"; export declare const LEGACY_CUSTOM_DIRNAME = "custom"; export interface LayoutMigrationRecord { version: 1; /** ISO timestamp of the migration. */ migratedAt: string; /** The entries moved: "installed" for the old corpus dir, then each legacy flat dir name. */ moved: string[]; note: string; } export declare function layoutMigrationRecordPath(appDir: string): string; /** * Resolve the corpus the sync/fan-out reads from. * * The precedence lives in ONE place, getPortableSkillsRoot(): * 1. options.rootDir — named outright, no suffix (unchanged contract) * 2. migrated owner layout — /skills when a migration record exists * 3. the pre-migration corpus — installed/, with the legacy auto-copy migration * * The migration record is required: a skills/ directory someone created by hand * is not the corpus and never will be treated as one. * * This wrapper exists so pull/agent-sync and any future caller can name the * canonical resolver explicitly; delegating keeps a single implementation for * list/search/info/push/sync alike (bug 170b0e9b was exactly the opposite — a * second resolution that read installed/ while this one read skills/). */ export declare function resolveCorpusRoot(options?: PortableSkillOptions): string; export type LayoutMigrationStatus = "already-migrated" | "refused" | "migrated" | "nothing-to-do"; export interface LayoutMigrationResult { status: LayoutMigrationStatus; /** Why a run refused; absent otherwise. */ reason?: string; /** The source entries moved (or that a dry-run would move). */ moved: string[]; /** Directories created by the run. */ created: string[]; /** The record written, when a run actually migrated. */ record?: LayoutMigrationRecord; } export interface LayoutMigrationOptions { dryRun?: boolean; /** App-folder override for tests. */ homeDir?: string; } /** * Migrate the owner layout, idempotently. * * - already-migrated: the record exists; nothing happens. * - refused: skills/ exists with content and no record, or a legacy dir would * collide with an existing skills/; nothing happens. * - migrated: installed/ (when present) and every legacy flat dir moved into * skills/; logs/ and outputs/ created; the record written. * - nothing-to-do: no installed/ and no legacy dirs; logs/ and outputs/ are * still created (lazily) unless the run is a dry-run. */ export declare function migrateOwnerLayout(options?: LayoutMigrationOptions): LayoutMigrationResult;