Move duplicated patterns from compaction.ts and branch-summarization.ts into shared utilities in utils.ts: - getMessageFromEntry(): unified entry-to-message conversion with optional toolResult skipping for branch summarization - collectMessages(): replaces three identical for-loops that collect AgentMessages from entry ranges - extractTextContent(): replaces five instances of the .filter(text).map(text).join() pattern - createSummarizationMessage(): replaces three identical user-message construction blocks for LLM summarization calls Net reduction of ~90 lines of duplication. |
||
|---|---|---|
| .. | ||
| native | ||
| pi-agent-core | ||
| pi-ai | ||
| pi-coding-agent | ||
| pi-tui | ||