Type Alias: AgentDocumentEvent
agentmux / agent-document-store / AgentDocumentEvent
AgentDocumentEvent = {
at:number;type:"session-started"; } | {at:number;type:"session-ended"; } | {addedCount:number;duplicatesDropped:number;type:"history-loaded"; } | {fromSnapshot:true;restoredCount:number;type:"history-restored"; } | {appendedNew:number;collidedAndUpdated:number;type:"stream-flushed";updateApplied:number;updateDropped:number; } | {clearedCount:number;reason:string;type:"truncate-applied"; } | {activeForMs:number;nodeCount:number;reason:string;type:"truncate-suppressed"; } | {chunkCount:number;toolId:string;type:"tool-chunk-appended"; } | {reason:"unknown-tool-id"|"node-not-tool"|"duplicate";toolId:string;type:"tool-chunk-dropped"; } | {clearedCount:number;type:"user-cleared"; } | {bytes:number;count:number;type:"tool-results-unloaded"; } | {nodeId:string;type:"tool-result-loaded"; } | {blockedTurns:number;gapsBefore:string[];prefixTurns:number;removedCount:number;turns:number;type:"turns-rolled-off"; } | {markdownCanceled:number;resolvedToolNodes:object[];toolsCanceled:number;type:"orphans-scrubbed"; } | {nodeId:string;type:"tool-force-canceled"; } | {nodeId:string;reason:"unknown-tool-id"|"node-not-tool";type:"tool-force-cancel-skipped"; }
Defined in: agent-document/types.ts:196
Audit events emitted by the reducer. v1 logs them via the dispatcher’s onEvent callback. The diagnostics panel surface is a follow-up.
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ at: number; type: "session-started"; }
Type Literal
Section titled “Type Literal”{ at: number; type: "session-ended"; }
Type Literal
Section titled “Type Literal”{ addedCount: number; duplicatesDropped: number; type: "history-loaded"; }
Type Literal
Section titled “Type Literal”{ fromSnapshot: true; restoredCount: number; type: "history-restored"; }
Type Literal
Section titled “Type Literal”{ appendedNew: number; collidedAndUpdated: number; type: "stream-flushed"; updateApplied: number; updateDropped: number; }
appendedNew
Section titled “appendedNew”appendedNew:
number
collidedAndUpdated
Section titled “collidedAndUpdated”collidedAndUpdated:
number
New nodes whose ID already existed → routed to in-place update.
type:
"stream-flushed"
updateApplied
Section titled “updateApplied”updateApplied:
number
Updates targeting known IDs.
updateDropped
Section titled “updateDropped”updateDropped:
number
Updates targeting unknown IDs — dropped.
Type Literal
Section titled “Type Literal”{ clearedCount: number; reason: string; type: "truncate-applied"; }
Type Literal
Section titled “Type Literal”{ activeForMs: number; nodeCount: number; reason: string; type: "truncate-suppressed"; }
activeForMs
Section titled “activeForMs”activeForMs:
number
ms since SessionStart.
nodeCount
Section titled “nodeCount”nodeCount:
number
Nodes that would have been wiped.
reason
Section titled “reason”reason:
string
type:
"truncate-suppressed"
Type Literal
Section titled “Type Literal”{ chunkCount: number; toolId: string; type: "tool-chunk-appended"; }
chunkCount
Section titled “chunkCount”chunkCount:
number
Chunks attached to this tool AFTER the append (>=1).
toolId
Section titled “toolId”toolId:
string
type:
"tool-chunk-appended"
Type Literal
Section titled “Type Literal”{ reason: "unknown-tool-id" | "node-not-tool" | "duplicate"; toolId: string; type: "tool-chunk-dropped"; }
reason
Section titled “reason”reason:
"unknown-tool-id"|"node-not-tool"|"duplicate"
Reason the chunk was rejected without touching state.
toolId
Section titled “toolId”toolId:
string
type:
"tool-chunk-dropped"
Type Literal
Section titled “Type Literal”{ clearedCount: number; type: "user-cleared"; }
Type Literal
Section titled “Type Literal”{ bytes: number; count: number; type: "tool-results-unloaded"; }
bytes:
number
count:
number
type:
"tool-results-unloaded"
Collapsed tool results left memory (UnloadToolResults).
Type Literal
Section titled “Type Literal”{ nodeId: string; type: "tool-result-loaded"; }
Type Literal
Section titled “Type Literal”{ blockedTurns: number; gapsBefore: string[]; prefixTurns: number; removedCount: number; turns: number; type: "turns-rolled-off"; }
blockedTurns
Section titled “blockedTurns”blockedTurns:
number
Older turns kept only because the transcript can’t rebuild them.
gapsBefore
Section titled “gapsBefore”gapsBefore:
string[]
For each range removed from the MIDDLE (around a kept turn), the id of the first node after it — where the pane shows a “turns in History” row.
prefixTurns
Section titled “prefixTurns”prefixTurns:
number
Turns removed from the very front of the feed.
removedCount
Section titled “removedCount”removedCount:
number
turns:
number
type:
"turns-rolled-off"
Finished turns left the live feed (RollOff, spec §6.9).
Type Literal
Section titled “Type Literal”{ markdownCanceled: number; resolvedToolNodes: object[]; toolsCanceled: number; type: "orphans-scrubbed"; }
markdownCanceled
Section titled “markdownCanceled”markdownCanceled:
number
Thinking-markdown nodes flipped to canceled.
resolvedToolNodes
Section titled “resolvedToolNodes”resolvedToolNodes:
object[]
Every tool node whose status this scrub actually changed —
agent-document-store.ts’s dispatch() pushes a final
docknodestatus delta for each so the srv-side muxspect dock
cache learns about the resolution instead of reporting an
already-resolved node as stuck forever (reagentx P1, PR #2432).
toolsCanceled
Section titled “toolsCanceled”toolsCanceled:
number
Tool nodes whose status flipped from “running” → “canceled”.
type:
"orphans-scrubbed"
Type Literal
Section titled “Type Literal”{ nodeId: string; type: "tool-force-canceled"; }
Type Literal
Section titled “Type Literal”{ nodeId: string; reason: "unknown-tool-id" | "node-not-tool"; type: "tool-force-cancel-skipped"; }
nodeId
Section titled “nodeId”nodeId:
string
reason
Section titled “reason”reason:
"unknown-tool-id"|"node-not-tool"
Reason the target node wasn’t found — same taxonomy as tool-chunk-dropped.
type:
"tool-force-cancel-skipped"