ccmanager 3.3.1 → 3.3.2

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.
@@ -1,68 +1,9 @@
1
- import React, { useEffect, useMemo, useState } from 'react';
2
- import { Box, Text, useStdout } from 'ink';
1
+ import { useEffect, useState } from 'react';
2
+ import { useStdout } from 'ink';
3
3
  import { shortcutManager } from '../services/shortcutManager.js';
4
4
  const Session = ({ session, sessionManager, onReturnToMenu, }) => {
5
5
  const { stdout } = useStdout();
6
6
  const [isExiting, setIsExiting] = useState(false);
7
- const deriveStatus = (currentSession) => {
8
- const stateData = currentSession.stateMutex.getSnapshot();
9
- // Always prioritize showing the manual approval notice when verification failed
10
- if (stateData.autoApprovalFailed) {
11
- const reason = stateData.autoApprovalReason
12
- ? ` Reason: ${stateData.autoApprovalReason}.`
13
- : '';
14
- return {
15
- message: `Auto-approval failed.${reason} Manual approval required—respond to the prompt.`,
16
- variant: 'error',
17
- };
18
- }
19
- if (stateData.state === 'pending_auto_approval') {
20
- return {
21
- message: 'Auto-approval pending... verifying permissions (press any key to cancel)',
22
- variant: 'pending',
23
- };
24
- }
25
- return { message: null, variant: null };
26
- };
27
- const initialStatus = deriveStatus(session);
28
- const [statusMessage, setStatusMessage] = useState(initialStatus.message);
29
- const [statusVariant, setStatusVariant] = useState(initialStatus.variant);
30
- const [columns, setColumns] = useState(() => stdout?.columns ?? process.stdout.columns ?? 80);
31
- const { statusLineText, backgroundColor, textColor } = useMemo(() => {
32
- if (!statusMessage || !statusVariant) {
33
- return {
34
- statusLineText: null,
35
- backgroundColor: undefined,
36
- textColor: undefined,
37
- };
38
- }
39
- const maxContentWidth = Math.max(columns - 4, 0);
40
- const prefix = statusVariant === 'error'
41
- ? '[AUTO-APPROVAL REQUIRED]'
42
- : '[AUTO-APPROVAL]';
43
- const prefixed = `${prefix} ${statusMessage}`;
44
- const trimmed = prefixed.length > maxContentWidth
45
- ? prefixed.slice(0, maxContentWidth)
46
- : prefixed;
47
- return {
48
- statusLineText: ` ${trimmed}`.padEnd(columns, ' '),
49
- backgroundColor: statusVariant === 'error' ? '#d90429' : '#ffd166',
50
- textColor: statusVariant === 'error' ? 'white' : '#1c1c1c',
51
- };
52
- }, [columns, statusMessage, statusVariant]);
53
- useEffect(() => {
54
- const handleSessionStateChange = (updatedSession) => {
55
- if (updatedSession.id !== session.id)
56
- return;
57
- const { message, variant } = deriveStatus(updatedSession);
58
- setStatusMessage(message);
59
- setStatusVariant(variant);
60
- };
61
- sessionManager.on('sessionStateChanged', handleSessionStateChange);
62
- return () => {
63
- sessionManager.off('sessionStateChanged', handleSessionStateChange);
64
- };
65
- }, [session.id, sessionManager]);
66
7
  const stripOscColorSequences = (input) => {
67
8
  // Remove default foreground/background color OSC sequences that Codex emits
68
9
  // These sequences leak as literal text when replaying buffered output
@@ -168,7 +109,6 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
168
109
  const handleSessionExit = (exitedSession) => {
169
110
  if (exitedSession.id === session.id) {
170
111
  setIsExiting(true);
171
- setStatusMessage(null);
172
112
  // Don't call onReturnToMenu here - App component handles it
173
113
  }
174
114
  };
@@ -178,7 +118,6 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
178
118
  const handleResize = () => {
179
119
  const cols = process.stdout.columns || 80;
180
120
  const rows = process.stdout.rows || 24;
181
- setColumns(cols);
182
121
  session.process.resize(cols, rows);
183
122
  // Also resize the virtual terminal
184
123
  if (session.terminal) {
@@ -244,7 +183,6 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
244
183
  stdout.off('resize', handleResize);
245
184
  };
246
185
  }, [session, sessionManager, stdout, onReturnToMenu, isExiting]);
247
- return statusLineText ? (React.createElement(Box, { width: "100%" },
248
- React.createElement(Text, { backgroundColor: backgroundColor, color: textColor, bold: true }, statusLineText))) : null;
186
+ return null;
249
187
  };
250
188
  export default Session;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccmanager",
3
- "version": "3.3.1",
3
+ "version": "3.3.2",
4
4
  "description": "TUI application for managing multiple Claude Code sessions across Git worktrees",
5
5
  "license": "MIT",
6
6
  "author": "Kodai Kabasawa",
@@ -41,11 +41,11 @@
41
41
  "bin"
42
42
  ],
43
43
  "optionalDependencies": {
44
- "@kodaikabasawa/ccmanager-darwin-arm64": "3.3.1",
45
- "@kodaikabasawa/ccmanager-darwin-x64": "3.3.1",
46
- "@kodaikabasawa/ccmanager-linux-arm64": "3.3.1",
47
- "@kodaikabasawa/ccmanager-linux-x64": "3.3.1",
48
- "@kodaikabasawa/ccmanager-win32-x64": "3.3.1"
44
+ "@kodaikabasawa/ccmanager-darwin-arm64": "3.3.2",
45
+ "@kodaikabasawa/ccmanager-darwin-x64": "3.3.2",
46
+ "@kodaikabasawa/ccmanager-linux-arm64": "3.3.2",
47
+ "@kodaikabasawa/ccmanager-linux-x64": "3.3.2",
48
+ "@kodaikabasawa/ccmanager-win32-x64": "3.3.2"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@eslint/js": "^9.28.0",