WarUI

Structured Command API

GRID-A27-F02P0baselinePlanned

Every operation that AI can perform is expressed as a plain JSON command (for example sort, filter, group, hide column, select rows) dispatched through one entry point. The same API works without any AI, so commands are deterministic, testable and scriptable. AI never touches grid internals directly; it can only emit commands.

Planned. This page shows the specification from issue #207. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

Grid with product data and a JSON editor pre-filled with {"op":"sort","column":"price","direction":"desc"}.

Expected behavior

Executing applies the operation and shows a CommandResult with status, affected counts and timing. Dry-run returns the predicted result without changing grid state. Unknown ops return a failed result and leave the grid unchanged.

Planned API surface

grid.commands.execute(command)grid.commands.canExecute(command)onCommandExecutedonCommandFailedCommandResult

Acceptance criteria

  • execute() returns a CommandResult with status ok|rejected|failed (pending)
  • canExecute() never mutates state (pending)
  • Dry-run produces identical predicted counts to an actual run on the same state (pending)
  • Commands work with ai.enabled=false (pending)
  • onCommandExecuted fires exactly once per successful command (pending)