mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 15:09:42 +02:00
feat: track Ralph Wiggum loops and todo lists in Claude sessions
Add InnerLoopTracker to detect and expose internal Claude Code state running inside claudeman sessions by parsing terminal output patterns. Detection patterns: - Completion phrases: <promise>PHRASE</promise> - Todo items: checkbox format, indicator icons, status parentheses - Loop status: cycle counts, elapsed time, start/completion New features: - Inner state panel UI (collapsible, below session tabs) - SSE events: innerLoopUpdate, innerTodoUpdate, innerCompletionDetected - API endpoint: GET /api/sessions/:id/inner-state - State persistence to ~/.claudeman/state-inner.json Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -245,6 +245,58 @@ export const DEFAULT_CONFIG: AppConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
// ========== Inner Loop Tracking Types ==========
|
||||
// Track Ralph Wiggum loops and todo lists running inside Claude Code sessions
|
||||
|
||||
export type InnerTodoStatus = 'pending' | 'in_progress' | 'completed';
|
||||
|
||||
export interface InnerLoopState {
|
||||
active: boolean;
|
||||
completionPhrase: string | null;
|
||||
startedAt: number | null;
|
||||
cycleCount: number;
|
||||
lastActivity: number;
|
||||
elapsedHours: number | null;
|
||||
}
|
||||
|
||||
export interface InnerTodoItem {
|
||||
id: string;
|
||||
content: string;
|
||||
status: InnerTodoStatus;
|
||||
detectedAt: number;
|
||||
}
|
||||
|
||||
export interface InnerSessionState {
|
||||
sessionId: string;
|
||||
loop: InnerLoopState;
|
||||
todos: InnerTodoItem[];
|
||||
lastUpdated: number;
|
||||
}
|
||||
|
||||
export interface InnerStateRecord {
|
||||
[sessionId: string]: InnerSessionState;
|
||||
}
|
||||
|
||||
export function createInitialInnerLoopState(): InnerLoopState {
|
||||
return {
|
||||
active: false,
|
||||
completionPhrase: null,
|
||||
startedAt: null,
|
||||
cycleCount: 0,
|
||||
lastActivity: Date.now(),
|
||||
elapsedHours: null,
|
||||
};
|
||||
}
|
||||
|
||||
export function createInitialInnerSessionState(sessionId: string): InnerSessionState {
|
||||
return {
|
||||
sessionId,
|
||||
loop: createInitialInnerLoopState(),
|
||||
todos: [],
|
||||
lastUpdated: Date.now(),
|
||||
};
|
||||
}
|
||||
|
||||
export function createInitialState(): AppState {
|
||||
return {
|
||||
sessions: {},
|
||||
|
||||
Reference in New Issue
Block a user