ccmanager 3.1.2 → 3.1.4

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.
package/README.md CHANGED
@@ -43,13 +43,31 @@ Claude Squad doesn't show session states in its menu, making it hard to know whi
43
43
  ### 🎯 Simple and intuitive interface
44
44
  Following Claude Code's philosophy, CCManager keeps things minimal and intuitive. The interface is so simple you'll understand it in seconds - no manual needed.
45
45
 
46
+ ## Requirements
47
+
48
+ - **Node.js 22 or later** is required to run CCManager.
49
+
46
50
  ## Install
47
51
 
48
52
  ```bash
49
53
  npm install -g ccmanager
50
54
  ```
51
55
 
52
- Or for local development:
56
+ ### Using mise
57
+
58
+ If you use [mise](https://mise.jdx.dev/) as a version manager, you can install CCManager with:
59
+
60
+ ```bash
61
+ mise install npm:ccmanager && mise use -g npm:ccmanager
62
+ ```
63
+
64
+ To run CCManager with Node.js 22:
65
+
66
+ ```bash
67
+ mise exec node@22 -- ccmanager
68
+ ```
69
+
70
+ ### Local Development
53
71
 
54
72
  ```bash
55
73
  npm install
@@ -157,4 +157,25 @@ describe('SessionManager - Auto Approval Recovery', () => {
157
157
  expect(handler).toHaveBeenCalledWith(session);
158
158
  sessionManager.off('sessionStateChanged', handler);
159
159
  });
160
+ it('forces state to busy after auto-approval to prevent endless loop', async () => {
161
+ const session = await Effect.runPromise(sessionManager.createSessionWithPresetEffect('/test/path'));
162
+ const mockPty = mockPtyInstances.get('/test/path');
163
+ expect(mockPty).toBeDefined();
164
+ const handler = vi.fn();
165
+ sessionManager.on('sessionStateChanged', handler);
166
+ // Advance to pending_auto_approval state
167
+ vi.advanceTimersByTime(STATE_CHECK_INTERVAL_MS * 3 + STATE_PERSISTENCE_DURATION_MS);
168
+ expect(session.state).toBe('pending_auto_approval');
169
+ // Wait for handleAutoApproval promise chain to fully resolve
170
+ await vi.waitFor(() => {
171
+ expect(session.state).toBe('busy');
172
+ });
173
+ expect(session.pendingState).toBeUndefined();
174
+ expect(session.pendingStateStart).toBeUndefined();
175
+ // Verify Enter key was sent to approve
176
+ expect(mockPty.write).toHaveBeenCalledWith('\r');
177
+ // Verify sessionStateChanged was emitted
178
+ expect(handler).toHaveBeenCalledWith(expect.objectContaining({ state: 'busy' }));
179
+ sessionManager.off('sessionStateChanged', handler);
180
+ });
160
181
  });
@@ -91,6 +91,12 @@ export class SessionManager extends EventEmitter {
91
91
  logger.info(`[${session.id}] Auto-approval granted, simulating user permission`);
92
92
  session.autoApprovalReason = undefined;
93
93
  session.process.write('\r');
94
+ // Force state to busy to prevent endless auto-approval
95
+ // when the state detection still sees pending_auto_approval
96
+ session.state = 'busy';
97
+ session.pendingState = undefined;
98
+ session.pendingStateStart = undefined;
99
+ this.emit('sessionStateChanged', session);
94
100
  }
95
101
  })
96
102
  .catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccmanager",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "TUI application for managing multiple Claude Code sessions across Git worktrees",
5
5
  "license": "MIT",
6
6
  "author": "Kodai Kabasawa",