Expand description
The conversation fold: wire messages in, where its turns sit out.
The fold walks the whole conversation in one pass and reports the message
each turn opens at, which is what a page is cut on, plus the task endings
it holds. The rules it folds by are not restated here: the row predicates
it opens a turn by (forge_workspace::conversation_turns) are the ones
the conversation window reads too, and the envelope parser
(crate::envelope) is the one the read path uses.
Re-exportsΒ§
use std::collections::HashMap;πuse forge_primitives::ContentBlock;πuse forge_primitives::Message;πuse forge_primitives::StopReason;πuse forge_primitives::ToolCallStatus;πuse forge_workspace::conversation_turns::claims_skill_call;πuse forge_workspace::conversation_turns::forge_minted;πuse forge_workspace::conversation_turns::is_continuation;πuse forge_workspace::conversation_turns::is_dispatched;πuse forge_workspace::conversation_turns::is_image_note;πuse forge_workspace::conversation_turns::is_interrupt_marker;πuse forge_workspace::conversation_turns::is_task_notice;πuse crate::envelope::detect_inbound;π
StructsΒ§
- Rendered
- A folded conversation: where its turns sit, and the endings it holds.
- Task
Ending - What a persisted task ending says, which is what the live wireβs
task_notificationframe says: the CLI writes the frameβs fields as XML into the transcript instead. - Turn
Span - Where one turn sits in the conversation it was folded from, and what names it.
- Turn
Trace π - The facts a turnβs own rows carry, gathered while the fold walks them.
FunctionsΒ§
- answered_
later π - Whether any of
openis answered later thanfrom. - close_
traced π - Name the turn a transcriptβs own rows support, then start the next turnβs trace. A turn the wire already settled is named by its own result frame and this one nothing, so the two never name one turn twice.
- is_
completion_ πnotice - Whether a queued block is the harnessβs background-completion notice rather than anything a person said.
- name_
open π - Name the turn the fold has open, if it has one: the report that closed a turn is what names it.
- notice_
block π - The notice as the block a view reads an ending from: the shape the scan
hoists an
attachmentrow into, so both carriers reach a client as one thing rather than as two the client has to know about. - notices_
as_ πblocks - Every task notice the conversation holds as that one block, whichever carrier the CLI persisted it in.
- open_
turn π - Open a turn, answering the span it opened: the one a page is cut on and the one a later report names.
- queued_
command_ text - The text a
queued_commandblock carries: a plain string for a typed prompt, or a content-block array for a multi-modal one, where only the text blocks are the words the user typed. An image or document is not text: a view draws it as an attachment row, from the block itself. Every other block renders as a[type]placeholder so the reader sees something rather than a blank. - render
- Fold a conversation into where its turns sit in the message list, and the task endings it holds.
- tag π
- The text between
<name>and</name>, trimmed. - take_
key π - What names a settled row: the instant the turnβs own first row carried, which survives an insertion above it where a count of the rows before it does not.
- task_
ending π - The ending a persisted notice carries, or
Nonewhen the text is not one or names no call to end. - task_
endings π - Every task ending the conversation holds, by the call each names.
- task_
status π - A taskβs own status word, as the frame carrying it draws the call.