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. |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| package.json | ||
| pnpm-lock.yaml | ||
| tsconfig.json | ||