ccmanager 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,8 @@ export class SessionManager extends EventEmitter {
18
18
  }
19
19
  detectSessionState(cleanData, currentState, sessionId) {
20
20
  const hasBottomBorder = includesPromptBoxBottomBorder(cleanData);
21
- const hasWaitingPrompt = cleanData.includes('│ Do you want');
21
+ const hasWaitingPrompt = cleanData.includes('│ Do you want') ||
22
+ cleanData.includes('│ Would you like');
22
23
  const wasWaitingWithBottomBorder = this.waitingWithBottomBorder.get(sessionId) || false;
23
24
  const hasEscToInterrupt = cleanData
24
25
  .toLowerCase()
@@ -20,6 +20,13 @@ describe('SessionManager', () => {
20
20
  const newState = sessionManager.detectSessionState(cleanData, currentState, mockSessionId);
21
21
  expect(newState).toBe('waiting_input');
22
22
  });
23
+ it('should detect waiting_input state when "Would you like" prompt is present', () => {
24
+ const cleanData = '│ Would you like to proceed?';
25
+ const currentState = 'idle';
26
+ vi.mocked(includesPromptBoxBottomBorder).mockReturnValue(false);
27
+ const newState = sessionManager.detectSessionState(cleanData, currentState, mockSessionId);
28
+ expect(newState).toBe('waiting_input');
29
+ });
23
30
  it('should set waitingWithBottomBorder when waiting prompt and bottom border are both present', () => {
24
31
  const cleanData = '│ Do you want to continue?\n└───────────────────────┘';
25
32
  const currentState = 'idle';
@@ -62,27 +69,6 @@ describe('SessionManager', () => {
62
69
  const newState = sessionManager.detectSessionState(cleanData, currentState, mockSessionId);
63
70
  expect(newState).toBe('busy');
64
71
  });
65
- // it('should not change from waiting_input when bottom border was already seen', () => {
66
- // const cleanData = '└───────────────────────┘';
67
- // const currentState: SessionState = 'waiting_input';
68
- // vi.mocked(includesPromptBoxBottomBorder).mockReturnValue(true);
69
- //
70
- // // First, simulate seeing waiting prompt with bottom border
71
- // sessionManager.detectSessionState(
72
- // '│ Do you want to continue?\n└───────────────────────┘',
73
- // 'idle',
74
- // mockSessionId,
75
- // );
76
- //
77
- // // Now another bottom border appears
78
- // const newState = sessionManager.detectSessionState(
79
- // cleanData,
80
- // currentState,
81
- // mockSessionId,
82
- // );
83
- //
84
- // expect(newState).toBe('idle'); // Should change to idle since we already saw the bottom border
85
- // });
86
72
  it('should clear waitingWithBottomBorder flag when transitioning to busy', () => {
87
73
  const cleanData = 'Processing... Press ESC to interrupt';
88
74
  const currentState = 'waiting_input';
@@ -95,29 +81,6 @@ describe('SessionManager', () => {
95
81
  const newState = sessionManager.detectSessionState(cleanData, currentState, mockSessionId);
96
82
  expect(newState).toBe('busy');
97
83
  });
98
- // it('should clear waitingWithBottomBorder flag when transitioning to idle', () => {
99
- // const cleanData = 'Task completed successfully';
100
- // const currentState: SessionState = 'waiting_input';
101
- // vi.mocked(includesPromptBoxBottomBorder).mockReturnValue(false);
102
- //
103
- // // First set up waiting state with bottom border
104
- // vi.mocked(includesPromptBoxBottomBorder).mockReturnValue(true);
105
- // sessionManager.detectSessionState(
106
- // '│ Do you want to continue?\n└───────────────────────┘',
107
- // 'idle',
108
- // mockSessionId,
109
- // );
110
- //
111
- // // Now transition to idle
112
- // vi.mocked(includesPromptBoxBottomBorder).mockReturnValue(false);
113
- // const newState = sessionManager.detectSessionState(
114
- // cleanData,
115
- // currentState,
116
- // mockSessionId,
117
- // );
118
- //
119
- // expect(newState).toBe('idle');
120
- // });
121
84
  it('should transition from busy to idle after 500ms timer when no "esc to interrupt"', async () => {
122
85
  // Create a mock session for the timer test
123
86
  const mockWorktreePath = '/test/worktree';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccmanager",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "TUI application for managing multiple Claude Code sessions across Git worktrees",
5
5
  "license": "MIT",
6
6
  "author": "Kodai Kabasawa",