generated from nhcarrigan/template
feat: handle PostCompact hook event (#225)
Parses [PostCompact Hook] from stderr, emits claude:post-compact, shows a toast notification, and briefly sets the character to success state.
This commit is contained in:
@@ -10,6 +10,7 @@ import type {
|
||||
ConnectionStatus,
|
||||
ElicitationEvent,
|
||||
PermissionPromptEvent,
|
||||
PostCompactEvent,
|
||||
StopFailureEvent,
|
||||
UserQuestionEvent,
|
||||
} from "$lib/types/messages";
|
||||
@@ -659,6 +660,12 @@ export async function initializeTauriListeners() {
|
||||
toastStore.addError(message);
|
||||
});
|
||||
unlisteners.push(stopFailureUnlisten);
|
||||
|
||||
const postCompactUnlisten = await listen<PostCompactEvent>("claude:post-compact", () => {
|
||||
toastStore.addInfo("Context compacted", "🗜️");
|
||||
characterState.setTemporaryState("success", 2000);
|
||||
});
|
||||
unlisteners.push(postCompactUnlisten);
|
||||
}
|
||||
|
||||
export function cleanupTauriListeners() {
|
||||
|
||||
@@ -182,6 +182,11 @@ export interface StopFailureEvent {
|
||||
conversation_id?: string;
|
||||
}
|
||||
|
||||
export interface PostCompactEvent {
|
||||
session_id?: string;
|
||||
conversation_id?: string;
|
||||
}
|
||||
|
||||
export type ConnectionStatus = "disconnected" | "connecting" | "connected" | "error";
|
||||
|
||||
export interface Attachment {
|
||||
|
||||
Reference in New Issue
Block a user