Commit 1b1fc0c
authored
refactor: functional Janitor architecture with unified notifications
* refactor: convert Janitor class and notifications to functional components
- Extract notification logic from Janitor into lib/notification.ts
- Convert Janitor class to pure functions with JanitorContext
- Extract message parsing and LLM analysis into separate functions
- Rename notification functions to match config (sendPruningSummary, sendMinimalSummary, sendDetailedSummary)
- Update callers (index.ts, hooks.ts, pruning-tool.ts) to use functional API
* refactor: make batch a protected tool, remove cascade pruning
- Add 'batch' to default protectedTools in config
- Remove batchToolChildren tracking from parseMessages()
- Remove expandBatchIds() function
- Batch children are now pruned individually by LLM decision
* chore: remove dead batch checks from notification.ts
* chore: remove batch display logic from display-utils
* refactor: reorganize lib/ into core/, state/, api-formats/, ui/ subdirectories
* refactor: add strategies infrastructure and migrate deduplication
* chore: update opencode-auth-provider to 0.1.7
* feat: unified notification system with GC tracking
- Add GCStats type and gcPending state to track deduplication activity
- Accumulate GC stats during fetch when runStrategies prunes duplicates
- Rewrite notification system to combine AI analysis and GC in one display
- Show GC-only notifications when AI prunes nothing but deduplication occurred
- Track totalGCTokens in session stats for lifetime GC contribution
- Display format: '🧹 DCP: ~20K saved (10 tools, ♻️ ~500) │ Session: ...'
- GC-only format: '♻️ DCP: ~500 collected │ Session: ...'
* fix: show combined AI + GC tokens in notification headline
* chore: change GC icon from recycle to wastebasket
* fix: include GC tokens in session total and improve icon placement1 parent ca2b7e3 commit 1b1fc0c
File tree
25 files changed
+1127
-881
lines changed- lib
- api-formats
- core
- strategies
- fetch-wrapper
- state
- ui
25 files changed
+1127
-881
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
| 90 | + | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments