import { type Draft } from "../draft.js"; import { type Flags } from "../utils/cli.js"; export interface InitMetaPlan { meta: Record; draftId: string; draftName: string; /** true when draft_content.json had no usable id and we minted one. */ generatedId: boolean; } /** Pure: derive the sidecar object from the draft + its dir. Identity comes from * DISK (basename) and the content's draft.id, matching register's rules so the * two never fight. draft_root_path is the PARENT of the draft dir (pipeline's * semantics), never the projects-root. */ export declare function planInitMeta(draft: Draft, draftDir: string): InitMetaPlan; /** Write the sidecar to disk. If one already exists, back it up FIRST (bak-first, * like saveDraft) so a forced overwrite stays recoverable. CREATE path = exactly * one trailing write (a read-only dir throws here with nothing half-written). * Extracted from cmdInitMeta so the `validate --fix` umbrella can apply init-meta * without re-parsing or re-emitting an envelope. */ export declare function applyInitMeta(plan: InitMetaPlan, metaPath: string): void; export declare function cmdInitMeta(positional: string[], flags: Flags): void;