refactor(hooks): split preemptive-compaction.ts to comply with 200 LOC module rule

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-18 01:50:41 +09:00
parent 963355d241
commit 1aebf39d23
3 changed files with 189 additions and 132 deletions
+41
View File
@@ -0,0 +1,41 @@
export interface TokenInfo {
input: number
output: number
reasoning: number
cache: { read: number; write: number }
}
export interface CachedCompactionState {
providerID: string
modelID: string
tokens: TokenInfo
}
export interface PreemptiveCompactionClient {
session: {
messages: (input: {
path: { id: string }
query?: { directory: string }
}) => Promise<unknown>
summarize: (input: {
path: { id: string }
body: { providerID: string; modelID: string; auto?: boolean }
query: { directory: string }
}) => Promise<unknown>
}
tui: {
showToast: (input: {
body: {
title: string
message: string
variant: "warning"
duration: number
}
}) => Promise<unknown>
}
}
export interface PreemptiveCompactionContext {
client: PreemptiveCompactionClient
directory: string
}