ccmanager 2.11.4 → 2.11.5
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.
|
@@ -34,6 +34,26 @@ describe('CodexStateDetector', () => {
|
|
|
34
34
|
// Assert
|
|
35
35
|
expect(state).toBe('waiting_input');
|
|
36
36
|
});
|
|
37
|
+
it('should detect waiting_input state for multiline do you want prompt with yes', () => {
|
|
38
|
+
// Arrange
|
|
39
|
+
terminal = createMockTerminal([
|
|
40
|
+
'Would you like to run the following command?',
|
|
41
|
+
'',
|
|
42
|
+
'Reason: Need to write to .git/worktrees metadata to stage changes for the requested commi',
|
|
43
|
+
'',
|
|
44
|
+
'$ git add test.ts',
|
|
45
|
+
'',
|
|
46
|
+
'› 1. Yes, proceed (y)',
|
|
47
|
+
" 2. Yes, and don't ask again for this command (a)",
|
|
48
|
+
' 3. No, and tell Codex what to do differently (esc)',
|
|
49
|
+
'',
|
|
50
|
+
'Press enter to confirm or esc to cancel',
|
|
51
|
+
]);
|
|
52
|
+
// Act
|
|
53
|
+
const state = detector.detectState(terminal, 'idle');
|
|
54
|
+
// Assert
|
|
55
|
+
expect(state).toBe('waiting_input');
|
|
56
|
+
});
|
|
37
57
|
it('should detect busy state for Esc to interrupt pattern', () => {
|
|
38
58
|
// Arrange
|
|
39
59
|
terminal = createMockTerminal([
|
|
@@ -44,6 +44,18 @@ describe('GeminiStateDetector', () => {
|
|
|
44
44
|
// Assert
|
|
45
45
|
expect(state).toBe('waiting_input');
|
|
46
46
|
});
|
|
47
|
+
it('should detect waiting_input for multiline confirmation ending with "yes"', () => {
|
|
48
|
+
// Arrange
|
|
49
|
+
terminal = createMockTerminal([
|
|
50
|
+
'Apply this change to the workspace?',
|
|
51
|
+
'The operation will modify several files.',
|
|
52
|
+
' yes',
|
|
53
|
+
]);
|
|
54
|
+
// Act
|
|
55
|
+
const state = detector.detectState(terminal, 'idle');
|
|
56
|
+
// Assert
|
|
57
|
+
expect(state).toBe('waiting_input');
|
|
58
|
+
});
|
|
47
59
|
it('should detect busy when "esc to cancel" is present', () => {
|
|
48
60
|
// Arrange
|
|
49
61
|
terminal = createMockTerminal([
|
|
@@ -83,6 +83,10 @@ export class GeminiStateDetector extends BaseStateDetector {
|
|
|
83
83
|
content.includes('│ Do you want to proceed?')) {
|
|
84
84
|
return 'waiting_input';
|
|
85
85
|
}
|
|
86
|
+
// Check for multiline confirmation prompts ending with "yes"
|
|
87
|
+
if (/(allow execution|do you want to|apply this change)[\s\S]*?\n+[\s\S]*?\byes\b/.test(lowerContent)) {
|
|
88
|
+
return 'waiting_input';
|
|
89
|
+
}
|
|
86
90
|
// Check for busy state
|
|
87
91
|
if (lowerContent.includes('esc to cancel')) {
|
|
88
92
|
return 'busy';
|
|
@@ -101,6 +105,9 @@ export class CodexStateDetector extends BaseStateDetector {
|
|
|
101
105
|
lowerContent.includes('yes (y)')) {
|
|
102
106
|
return 'waiting_input';
|
|
103
107
|
}
|
|
108
|
+
if (/(do you want|would you like)[\s\S]*?\n+[\s\S]*?\byes\b/.test(lowerContent)) {
|
|
109
|
+
return 'waiting_input';
|
|
110
|
+
}
|
|
104
111
|
// Check for busy state
|
|
105
112
|
if (/esc.*interrupt/i.test(lowerContent)) {
|
|
106
113
|
return 'busy';
|