import type { WorldJsonModification } from '@bitmagic/world-forger/pipeline/index.js'; export interface ApplyModificationsOutcome { applied: number; /** One human-readable line per modification, for the command to print. */ summary: string[]; /** * How many entries each modification actually changed, in the same order. * * Reported from the write itself rather than counted off an earlier read. A caller that counts * beforehand — "removing this asset will take 3 placed instances with it" — is describing a * document that may not be the one written: `bitmagic dev`'s whole premise is that the creator's * agent edits world.json concurrently, and the applier re-reads it under its own atomic write. */ changed: number[]; } /** * Read world.json, apply every modification in order, write once. * * ORDER IS THE CONTRACT: `placeAndPersistLevel` returns the starter-scatter removals ahead of the * level's own upserts, and applying them in any other order changes the result. * * Atomicity: nothing is written until every modification has been applied to the in-memory * document, and the write itself goes through a temp file in the same directory then a rename, so * a crash mid-command leaves world.json either wholly old or wholly new. A half-written world is * worse than an unchanged one — the creator has no way to tell which half landed, and a forge is * expensive enough that "run it again" is not an acceptable recovery. */ export interface ApplyModificationsOptions { /** * What the batch IS, for the schema-gate message: "The forged level" by default, since the forge * was this applier's first caller — `bitmagic assets add` says "The uploaded asset" instead, so * a refusal names the thing the creator just did rather than one they did not. */ subject?: string; } export declare function applyModificationsToWorld(worldPath: string, modifications: WorldJsonModification[], options?: ApplyModificationsOptions): ApplyModificationsOutcome;