Skip to content

Function: dispatch()

agentmux


agentmux / agent-document-store / dispatch

dispatch(blockId, command, source?, opts?): AgentDocumentEvent[]

Defined in: agent-document-store.ts:162

Apply a command to a pane’s reducer state. Returns the audit events the command produced (typically zero or one event).

If the blockId isn’t registered the dispatch throws — silent drop is dangerous because it would mean a real reducer command (like SessionStart or an early StreamFlush) was lost, and the next StreamTruncate would then be honored against an uninitialized state cell, reintroducing the wipe class this whole module exists to prevent. Convention: panes call registerPane synchronously during component-body execution, before any hook can dispatch from its own onMount.

The throw is structurally safe — Solid components don’t unmount mid- dispatch (cleanup is synchronous and always runs after children).

string

AgentDocumentCommand

CommandSource = "system"

ReducerOptions

AgentDocumentEvent[]