mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-06 15:39:41 +02:00
refactor: hybrid indicator+timeout detection in respawn controller
- Primary: Use '↵ send' indicator for immediate response when ready - Fallback: Use timeout-based detection for prompt patterns - Add working indicators: Synthesizing, Brewing, ✻, ✽ - Cleaner step completion handlers (checkUpdateComplete, etc.) The hybrid approach responds immediately when Claude shows the suggestion indicator, while still having timeout fallback for reliability. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,25 +26,31 @@ class MockSession extends EventEmitter {
|
||||
this.emit('terminal', data);
|
||||
}
|
||||
|
||||
// Simulate prompt appearing
|
||||
// Simulate prompt appearing (basic prompt character)
|
||||
simulatePrompt(): void {
|
||||
this.emit('terminal', '❯ ');
|
||||
}
|
||||
|
||||
// Simulate ready state with the definitive indicator
|
||||
simulateReady(): void {
|
||||
this.emit('terminal', '↵ send');
|
||||
}
|
||||
|
||||
// Simulate working state
|
||||
simulateWorking(): void {
|
||||
this.emit('terminal', 'Thinking... ⠋');
|
||||
}
|
||||
|
||||
// Simulate clear completion
|
||||
// Simulate clear completion (followed by ready indicator)
|
||||
simulateClearComplete(): void {
|
||||
this.emit('terminal', 'conversation cleared');
|
||||
setTimeout(() => this.simulateReady(), 50);
|
||||
}
|
||||
|
||||
// Simulate init completion
|
||||
// Simulate init completion (followed by ready indicator)
|
||||
simulateInitComplete(): void {
|
||||
this.emit('terminal', 'Analyzing CLAUDE.md...');
|
||||
setTimeout(() => this.simulatePrompt(), 100);
|
||||
setTimeout(() => this.simulateReady(), 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user