Skip to content

Interface: AgentDocumentState

agentmux


agentmux / agent-document-store / AgentDocumentState

Defined in: agent-document/types.ts:17

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: 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: SessionPhase

Defined in: agent-document/types.ts:19


sessionStartedAt: number

Defined in: agent-document/types.ts:21

ms epoch of the most recent SessionStart, or null if never started.