import type { AppState } from "@editor/state"; export type CommandContext = { state: AppState; }; export type CommandHistoryPolicy = | { mode: "auto" } | { mode: "ignore" } | { mode: "deferred"; phase: "begin" | "update" | "commit" }; export type Command = { id: string; name: string; history?: CommandHistoryPolicy; execute(context: CommandContext, payload: TPayload): AppState; };