Improve branch summarization with preparation and file ops extraction

- Add prepareBranchEntries() to extract messages and file operations
- Extract read/write/edit operations from tool calls
- Append static file operations section to summary
- Improve prompt for branch summarization
- Skip toolResult messages (context already in assistant message)
- Export new types: BranchPreparation, FileOperations
This commit is contained in:
Mario Zechner 2025-12-29 21:05:23 +01:00
parent fd13b53b1c
commit 5cbaf2be88
2 changed files with 190 additions and 31 deletions

View file

@ -12,6 +12,7 @@ export {
export { type ApiKeyCredential, type AuthCredential, AuthStorage, type OAuthCredential } from "./core/auth-storage.js";
// Compaction
export {
type BranchPreparation,
type BranchSummaryResult,
type CompactionResult,
type CutPointResult,
@ -19,11 +20,13 @@ export {
compact,
DEFAULT_COMPACTION_SETTINGS,
estimateTokens,
type FileOperations,
findCutPoint,
findTurnStartIndex,
generateBranchSummary,
generateSummary,
getLastAssistantUsage,
prepareBranchEntries,
shouldCompact,
} from "./core/compaction/index.js";
// Custom tools