Expand description
ConversationProvider bridge: map Pi sessions to toolpath_convo::ConversationView.
Walks PiSession.entries in file order. Each Entry::Message becomes a
Turn; metadata-only entries like ModelChange / ThinkingLevelChange /
Label buffer and attach to the next message’s extra["pi"]. Compaction,
BranchSummary, Custom, and CustomMessage emit synthetic turns with
appropriate roles.
Tool-result correlation is a two-pass process: we record tool-call ids as
assistant turns are built, then in a second pass populate matching tool
invocations’ .result fields (and any sibling DelegatedWork.result).
Functions§
- classify_
tool - Classify a Pi tool name into toolpath’s category ontology.
- native_
name - Reverse of
classify_tool: pick Pi’s preferred native tool name for a genericToolCategory, disambiguating by call args when multiple Pi tools share the same category. - session_
to_ view - Convert a PiSession into a provider-agnostic ConversationView.