generated from nhcarrigan/template
feat: add PreCompact hook support (#267)
Parses [PreCompact Hook] events from the CLI stream and emits a claude:pre-compact Tauri event. Shows a "Compacting context..." toast and thinking state on the frontend, complementing the existing PostCompact handling.
This commit is contained in:
@@ -11,6 +11,7 @@ import type {
|
||||
ElicitationEvent,
|
||||
PermissionPromptEvent,
|
||||
PostCompactEvent,
|
||||
PreCompactEvent,
|
||||
StopFailureEvent,
|
||||
UserQuestionEvent,
|
||||
} from "$lib/types/messages";
|
||||
@@ -661,6 +662,12 @@ export async function initializeTauriListeners() {
|
||||
});
|
||||
unlisteners.push(stopFailureUnlisten);
|
||||
|
||||
const preCompactUnlisten = await listen<PreCompactEvent>("claude:pre-compact", () => {
|
||||
toastStore.addInfo("Compacting context...", "🗜️");
|
||||
characterState.setTemporaryState("thinking", 3000);
|
||||
});
|
||||
unlisteners.push(preCompactUnlisten);
|
||||
|
||||
const postCompactUnlisten = await listen<PostCompactEvent>("claude:post-compact", () => {
|
||||
toastStore.addInfo("Context compacted", "🗜️");
|
||||
characterState.setTemporaryState("success", 2000);
|
||||
|
||||
Reference in New Issue
Block a user