Interface: AgentDocumentState
agentmux / agent-document-store / AgentDocumentState
Defined in: agent-document/types.ts:17
Properties
Section titled “Properties”nodeIdSet
Section titled “nodeIdSet”nodeIdSet:
Set<string>
Defined in: agent-document/types.ts:29
Authoritative dedup index, kept in lockstep with nodes. Replaces
the per-mount rebuild in useAgentStream that scanned nodes[] and
could miss in-flight events arriving between mount and scan. The
stream-side cache still exists for in-batch dedup but is now seeded
from this set rather than rebuilt. Issue #728 gap 4.
nodeIndexById
Section titled “nodeIndexById”nodeIndexById:
Map<string,number>
Defined in: agent-document/types.ts:41
id -> current index in nodes, kept in lockstep with nodes
(same lifecycle as nodeIdSet). Lets StreamFlush resolve
collisions/updates and ToolChunkAppend / ShellChunkAppend /
ShellStatusUpdate locate their target node in O(1) instead of
scanning the full array on every streamed chunk — task #39. Any
command that reorders or prepends nodes (HistoryLoaded,
HistoryRestored) must rebuild this map to match; a command that
only mutates node CONTENT in place (scrub, truncate-status flips)
leaves indices untouched and can pass the same map through.
nodes:
DocumentNode[]
Defined in: agent-document/types.ts:18
sessionPhase
Section titled “sessionPhase”sessionPhase:
SessionPhase
Defined in: agent-document/types.ts:19
sessionStartedAt
Section titled “sessionStartedAt”sessionStartedAt:
number
Defined in: agent-document/types.ts:21
ms epoch of the most recent SessionStart, or null if never started.