Skip to main content

Module view

Module view 

Source
Expand description

experimental/pi-session-view.ts: Pi’s read-side views (tree, context messages, last assistant text, stats) over a format-4 session converted to Pi entries ([super::pi_view]), with the shapes and numbers Pi reports.

Functions§

entries
The entries, without the header, in session order.
fork_messages
get_fork_messages: every user message entry (any branch) with its text, when it has text.
last_assistant_text
getLastAssistantText(): the newest assistant message that is not an empty abort, its text blocks joined.
messages
Pi’s session.messages: the model context at the leaf.
stats
getSessionStats(): totals over every entry, compacted and abandoned history included.
tree
Pi’s getTree(): {entry, children, label?, labelTimestamp?} nodes.