feat: add auto-clear, timed respawn, and enable on existing sessions

- Add token tracking to Session class (input/output tokens)
- Add auto-clear feature that sends /clear when token threshold reached
- Add API endpoint to enable respawn on existing running sessions
- Add timed duration setting for respawn (auto-stops after N minutes)
- Add TaskTracker class for background task detection and tree display
- Update UI with duration input, auto-clear settings, and "Enable on Current" button
- Add respawn timer display in banner when timed run is active
- Add token count display in respawn banner

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-19 00:38:11 +01:00
co-authored by Claude Opus 4.5
parent fd9254d8e5
commit ad99fe5922
8 changed files with 2240 additions and 2779 deletions
+6
View File
@@ -70,6 +70,10 @@ export interface RespawnConfig {
interStepDelayMs: number;
/** Whether to enable respawn loop */
enabled: boolean;
/** Whether to send /clear after update prompt */
sendClear: boolean;
/** Whether to send /init after /clear */
sendInit: boolean;
}
export interface AppConfig {
@@ -211,6 +215,8 @@ export const DEFAULT_CONFIG: AppConfig = {
updatePrompt: 'update all the docs and CLAUDE.md',
interStepDelayMs: 1000, // 1 second between steps
enabled: false, // disabled by default
sendClear: true, // send /clear after update prompt
sendInit: true, // send /init after /clear
},
};