ccmanager 3.4.0 → 3.5.1

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.
Files changed (89) hide show
  1. package/README.md +11 -5
  2. package/dist/components/App.js +17 -3
  3. package/dist/components/App.test.js +5 -5
  4. package/dist/components/Configuration.d.ts +2 -0
  5. package/dist/components/Configuration.js +6 -2
  6. package/dist/components/ConfigureCommand.js +34 -11
  7. package/dist/components/ConfigureOther.js +18 -4
  8. package/dist/components/ConfigureOther.test.js +48 -12
  9. package/dist/components/ConfigureShortcuts.js +27 -85
  10. package/dist/components/ConfigureStatusHooks.js +19 -4
  11. package/dist/components/ConfigureStatusHooks.test.js +46 -12
  12. package/dist/components/ConfigureWorktree.js +18 -4
  13. package/dist/components/ConfigureWorktreeHooks.js +19 -4
  14. package/dist/components/ConfigureWorktreeHooks.test.js +49 -14
  15. package/dist/components/Menu.js +72 -14
  16. package/dist/components/NewWorktree.js +2 -2
  17. package/dist/components/NewWorktree.test.js +6 -6
  18. package/dist/components/PresetSelector.js +2 -2
  19. package/dist/constants/statusIcons.d.ts +2 -1
  20. package/dist/constants/statusIcons.js +13 -4
  21. package/dist/constants/statusIcons.test.js +41 -11
  22. package/dist/contexts/ConfigEditorContext.d.ts +21 -0
  23. package/dist/contexts/ConfigEditorContext.js +25 -0
  24. package/dist/services/autoApprovalVerifier.js +3 -3
  25. package/dist/services/autoApprovalVerifier.test.js +2 -2
  26. package/dist/services/config/configEditor.d.ts +46 -0
  27. package/dist/services/{configurationManager.effect.test.js → config/configEditor.effect.test.js} +46 -49
  28. package/dist/services/config/configEditor.js +101 -0
  29. package/dist/services/{configurationManager.selectPresetOnStart.test.js → config/configEditor.selectPresetOnStart.test.js} +27 -19
  30. package/dist/services/{configurationManager.test.js → config/configEditor.test.js} +60 -132
  31. package/dist/services/config/configReader.d.ts +28 -0
  32. package/dist/services/config/configReader.js +95 -0
  33. package/dist/services/config/configReader.multiProject.test.d.ts +1 -0
  34. package/dist/services/config/configReader.multiProject.test.js +136 -0
  35. package/dist/services/config/globalConfigManager.d.ts +30 -0
  36. package/dist/services/config/globalConfigManager.js +216 -0
  37. package/dist/services/config/index.d.ts +13 -0
  38. package/dist/services/config/index.js +13 -0
  39. package/dist/services/config/projectConfigManager.d.ts +41 -0
  40. package/dist/services/config/projectConfigManager.js +181 -0
  41. package/dist/services/config/projectConfigManager.test.d.ts +1 -0
  42. package/dist/services/config/projectConfigManager.test.js +105 -0
  43. package/dist/services/config/testUtils.d.ts +81 -0
  44. package/dist/services/config/testUtils.js +351 -0
  45. package/dist/services/sessionManager.autoApproval.test.js +5 -5
  46. package/dist/services/sessionManager.d.ts +1 -1
  47. package/dist/services/sessionManager.effect.test.js +27 -18
  48. package/dist/services/sessionManager.js +26 -44
  49. package/dist/services/sessionManager.statePersistence.test.js +5 -4
  50. package/dist/services/sessionManager.test.js +91 -50
  51. package/dist/services/shortcutManager.d.ts +0 -1
  52. package/dist/services/shortcutManager.js +5 -16
  53. package/dist/services/shortcutManager.test.js +2 -2
  54. package/dist/services/stateDetector/base.d.ts +1 -1
  55. package/dist/services/stateDetector/claude.d.ts +1 -1
  56. package/dist/services/stateDetector/claude.js +11 -4
  57. package/dist/services/stateDetector/claude.test.js +47 -24
  58. package/dist/services/stateDetector/cline.d.ts +1 -1
  59. package/dist/services/stateDetector/cline.js +1 -1
  60. package/dist/services/stateDetector/codex.d.ts +1 -1
  61. package/dist/services/stateDetector/codex.js +1 -1
  62. package/dist/services/stateDetector/cursor.d.ts +1 -1
  63. package/dist/services/stateDetector/cursor.js +1 -1
  64. package/dist/services/stateDetector/gemini.d.ts +1 -1
  65. package/dist/services/stateDetector/gemini.js +1 -1
  66. package/dist/services/stateDetector/github-copilot.d.ts +1 -1
  67. package/dist/services/stateDetector/github-copilot.js +1 -1
  68. package/dist/services/stateDetector/opencode.d.ts +1 -1
  69. package/dist/services/stateDetector/opencode.js +1 -1
  70. package/dist/services/stateDetector/types.d.ts +1 -1
  71. package/dist/services/worktreeService.d.ts +12 -0
  72. package/dist/services/worktreeService.js +24 -4
  73. package/dist/services/worktreeService.sort.test.js +105 -109
  74. package/dist/services/worktreeService.test.js +5 -5
  75. package/dist/types/index.d.ts +41 -7
  76. package/dist/utils/gitUtils.d.ts +8 -0
  77. package/dist/utils/gitUtils.js +32 -0
  78. package/dist/utils/hookExecutor.js +2 -2
  79. package/dist/utils/hookExecutor.test.js +8 -12
  80. package/dist/utils/mutex.d.ts +1 -1
  81. package/dist/utils/mutex.js +1 -1
  82. package/dist/utils/worktreeUtils.js +1 -1
  83. package/dist/utils/worktreeUtils.test.js +0 -1
  84. package/package.json +7 -7
  85. package/dist/services/configurationManager.d.ts +0 -121
  86. package/dist/services/configurationManager.js +0 -597
  87. /package/dist/services/{configurationManager.effect.test.d.ts → config/configEditor.effect.test.d.ts} +0 -0
  88. /package/dist/services/{configurationManager.selectPresetOnStart.test.d.ts → config/configEditor.selectPresetOnStart.test.d.ts} +0 -0
  89. /package/dist/services/{configurationManager.test.d.ts → config/configEditor.test.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { configurationManager } from './configurationManager.js';
1
+ import { configReader } from './config/configReader.js';
2
2
  export class ShortcutManager {
3
3
  constructor() {
4
4
  Object.defineProperty(this, "reservedKeys", {
@@ -46,19 +46,8 @@ export class ShortcutManager {
46
46
  reserved.alt === shortcut.alt &&
47
47
  reserved.shift === shortcut.shift);
48
48
  }
49
- saveShortcuts(shortcuts) {
50
- // Validate all shortcuts
51
- const currentShortcuts = configurationManager.getShortcuts();
52
- const validated = {
53
- returnToMenu: this.validateShortcut(shortcuts.returnToMenu) ||
54
- currentShortcuts.returnToMenu,
55
- cancel: this.validateShortcut(shortcuts.cancel) || currentShortcuts.cancel,
56
- };
57
- configurationManager.setShortcuts(validated);
58
- return true;
59
- }
60
49
  getShortcuts() {
61
- return configurationManager.getShortcuts();
50
+ return configReader.getShortcuts();
62
51
  }
63
52
  getRawShortcutCodes(shortcut) {
64
53
  const codes = new Set();
@@ -106,7 +95,7 @@ export class ShortcutManager {
106
95
  return Array.from(codes);
107
96
  }
108
97
  matchesShortcut(shortcutName, input, key) {
109
- const shortcuts = configurationManager.getShortcuts();
98
+ const shortcuts = configReader.getShortcuts();
110
99
  const shortcut = shortcuts[shortcutName];
111
100
  if (!shortcut)
112
101
  return false;
@@ -125,7 +114,7 @@ export class ShortcutManager {
125
114
  return input.toLowerCase() === shortcut.key.toLowerCase();
126
115
  }
127
116
  getShortcutDisplay(shortcutName) {
128
- const shortcuts = configurationManager.getShortcuts();
117
+ const shortcuts = configReader.getShortcuts();
129
118
  const shortcut = shortcuts[shortcutName];
130
119
  if (!shortcut)
131
120
  return '';
@@ -161,7 +150,7 @@ export class ShortcutManager {
161
150
  return null;
162
151
  }
163
152
  matchesRawInput(shortcutName, input) {
164
- const shortcuts = configurationManager.getShortcuts();
153
+ const shortcuts = configReader.getShortcuts();
165
154
  const shortcut = shortcuts[shortcutName];
166
155
  if (!shortcut)
167
156
  return false;
@@ -1,13 +1,13 @@
1
1
  import { describe, expect, it, beforeEach, afterEach, vi } from 'vitest';
2
2
  import { shortcutManager } from './shortcutManager.js';
3
- import { configurationManager } from './configurationManager.js';
3
+ import { configReader } from './config/configReader.js';
4
4
  describe('shortcutManager.matchesRawInput', () => {
5
5
  const shortcuts = {
6
6
  returnToMenu: { ctrl: true, key: 'e', alt: false, shift: false },
7
7
  cancel: { ctrl: true, key: 'c', alt: false, shift: false },
8
8
  };
9
9
  beforeEach(() => {
10
- vi.spyOn(configurationManager, 'getShortcuts').mockReturnValue(shortcuts);
10
+ vi.spyOn(configReader, 'getShortcuts').mockReturnValue(shortcuts);
11
11
  });
12
12
  afterEach(() => {
13
13
  vi.restoreAllMocks();
@@ -4,5 +4,5 @@ export declare abstract class BaseStateDetector implements StateDetector {
4
4
  abstract detectState(terminal: Terminal, currentState: SessionState): SessionState;
5
5
  protected getTerminalLines(terminal: Terminal, maxLines?: number): string[];
6
6
  protected getTerminalContent(terminal: Terminal, maxLines?: number): string;
7
- abstract detectBackgroundTask(terminal: Terminal): boolean;
7
+ abstract detectBackgroundTask(terminal: Terminal): number;
8
8
  }
@@ -2,5 +2,5 @@ import { SessionState, Terminal } from '../../types/index.js';
2
2
  import { BaseStateDetector } from './base.js';
3
3
  export declare class ClaudeStateDetector extends BaseStateDetector {
4
4
  detectState(terminal: Terminal, currentState: SessionState): SessionState;
5
- detectBackgroundTask(terminal: Terminal): boolean;
5
+ detectBackgroundTask(terminal: Terminal): number;
6
6
  }
@@ -27,9 +27,16 @@ export class ClaudeStateDetector extends BaseStateDetector {
27
27
  detectBackgroundTask(terminal) {
28
28
  const lines = this.getTerminalLines(terminal, 3);
29
29
  const content = lines.join('\n').toLowerCase();
30
- // Detect background task patterns:
31
- // - "N background task(s)" in status bar
32
- // - "(running)" in status bar for active background commands
33
- return content.includes('background task') || content.includes('(running)');
30
+ // Check for "N background task(s)" pattern first (content already lowercased)
31
+ const countMatch = content.match(/(\d+)\s+background\s+task/);
32
+ if (countMatch?.[1]) {
33
+ return parseInt(countMatch[1], 10);
34
+ }
35
+ // Check for "(running)" pattern - indicates at least 1 background task
36
+ if (content.includes('(running)')) {
37
+ return 1;
38
+ }
39
+ // No background task detected
40
+ return 0;
34
41
  }
35
42
  }
@@ -223,7 +223,7 @@ describe('ClaudeStateDetector', () => {
223
223
  });
224
224
  });
225
225
  describe('detectBackgroundTask', () => {
226
- it('should detect background task when pattern is in last 3 lines (status bar)', () => {
226
+ it('should return count 1 when "1 background task" is in status bar', () => {
227
227
  // Arrange
228
228
  terminal = createMockTerminal([
229
229
  'Previous conversation content',
@@ -232,11 +232,11 @@ describe('ClaudeStateDetector', () => {
232
232
  '1 background task | api-call',
233
233
  ]);
234
234
  // Act
235
- const hasBackgroundTask = detector.detectBackgroundTask(terminal);
235
+ const count = detector.detectBackgroundTask(terminal);
236
236
  // Assert
237
- expect(hasBackgroundTask).toBe(true);
237
+ expect(count).toBe(1);
238
238
  });
239
- it('should detect background task with plural "background tasks"', () => {
239
+ it('should return count 2 when "2 background tasks" is in status bar', () => {
240
240
  // Arrange
241
241
  terminal = createMockTerminal([
242
242
  'Some output',
@@ -244,11 +244,23 @@ describe('ClaudeStateDetector', () => {
244
244
  '2 background tasks running',
245
245
  ]);
246
246
  // Act
247
- const hasBackgroundTask = detector.detectBackgroundTask(terminal);
247
+ const count = detector.detectBackgroundTask(terminal);
248
248
  // Assert
249
- expect(hasBackgroundTask).toBe(true);
249
+ expect(count).toBe(2);
250
250
  });
251
- it('should detect background task case-insensitively', () => {
251
+ it('should return count 3 when "3 background tasks" is in status bar', () => {
252
+ // Arrange
253
+ terminal = createMockTerminal([
254
+ 'Some output',
255
+ 'More output',
256
+ '3 background tasks | build, test, lint',
257
+ ]);
258
+ // Act
259
+ const count = detector.detectBackgroundTask(terminal);
260
+ // Assert
261
+ expect(count).toBe(3);
262
+ });
263
+ it('should detect background task count case-insensitively', () => {
252
264
  // Arrange
253
265
  terminal = createMockTerminal([
254
266
  'Output line 1',
@@ -256,11 +268,11 @@ describe('ClaudeStateDetector', () => {
256
268
  '1 BACKGROUND TASK running',
257
269
  ]);
258
270
  // Act
259
- const hasBackgroundTask = detector.detectBackgroundTask(terminal);
271
+ const count = detector.detectBackgroundTask(terminal);
260
272
  // Assert
261
- expect(hasBackgroundTask).toBe(true);
273
+ expect(count).toBe(1);
262
274
  });
263
- it('should return false when no background task pattern in last 3 lines', () => {
275
+ it('should return 0 when no background task pattern in last 3 lines', () => {
264
276
  // Arrange
265
277
  terminal = createMockTerminal([
266
278
  'Command completed successfully',
@@ -268,9 +280,9 @@ describe('ClaudeStateDetector', () => {
268
280
  '> ',
269
281
  ]);
270
282
  // Act
271
- const hasBackgroundTask = detector.detectBackgroundTask(terminal);
283
+ const count = detector.detectBackgroundTask(terminal);
272
284
  // Assert
273
- expect(hasBackgroundTask).toBe(false);
285
+ expect(count).toBe(0);
274
286
  });
275
287
  it('should not detect background task when pattern is in conversation content (not status bar)', () => {
276
288
  // Arrange - "background task" mentioned earlier in conversation, but not in last 3 lines
@@ -283,27 +295,27 @@ describe('ClaudeStateDetector', () => {
283
295
  'Ready',
284
296
  ]);
285
297
  // Act
286
- const hasBackgroundTask = detector.detectBackgroundTask(terminal);
298
+ const count = detector.detectBackgroundTask(terminal);
287
299
  // Assert - should only check last 3 lines, not the conversation content
288
- expect(hasBackgroundTask).toBe(false);
300
+ expect(count).toBe(0);
289
301
  });
290
- it('should handle empty terminal', () => {
302
+ it('should return 0 for empty terminal', () => {
291
303
  // Arrange
292
304
  terminal = createMockTerminal([]);
293
305
  // Act
294
- const hasBackgroundTask = detector.detectBackgroundTask(terminal);
306
+ const count = detector.detectBackgroundTask(terminal);
295
307
  // Assert
296
- expect(hasBackgroundTask).toBe(false);
308
+ expect(count).toBe(0);
297
309
  });
298
310
  it('should handle terminal with fewer than 3 lines', () => {
299
311
  // Arrange
300
312
  terminal = createMockTerminal(['1 background task']);
301
313
  // Act
302
- const hasBackgroundTask = detector.detectBackgroundTask(terminal);
314
+ const count = detector.detectBackgroundTask(terminal);
303
315
  // Assert
304
- expect(hasBackgroundTask).toBe(true);
316
+ expect(count).toBe(1);
305
317
  });
306
- it('should detect "(running)" status bar indicator', () => {
318
+ it('should return 1 when "(running)" status bar indicator is present', () => {
307
319
  // Arrange
308
320
  terminal = createMockTerminal([
309
321
  'Some conversation output',
@@ -311,17 +323,28 @@ describe('ClaudeStateDetector', () => {
311
323
  'bypass permissions on - uv run pytest tests/integration/e2e/tes... (running)',
312
324
  ]);
313
325
  // Act
314
- const hasBackgroundTask = detector.detectBackgroundTask(terminal);
326
+ const count = detector.detectBackgroundTask(terminal);
315
327
  // Assert
316
- expect(hasBackgroundTask).toBe(true);
328
+ expect(count).toBe(1);
317
329
  });
318
330
  it('should detect "(running)" case-insensitively', () => {
319
331
  // Arrange
320
332
  terminal = createMockTerminal(['Some output', 'command name (RUNNING)']);
321
333
  // Act
322
- const hasBackgroundTask = detector.detectBackgroundTask(terminal);
334
+ const count = detector.detectBackgroundTask(terminal);
335
+ // Assert
336
+ expect(count).toBe(1);
337
+ });
338
+ it('should prioritize count from "N background task" over "(running)"', () => {
339
+ // Arrange - both patterns present, count should be from explicit pattern
340
+ terminal = createMockTerminal([
341
+ 'Some output',
342
+ '3 background tasks | task1, task2 (running)',
343
+ ]);
344
+ // Act
345
+ const count = detector.detectBackgroundTask(terminal);
323
346
  // Assert
324
- expect(hasBackgroundTask).toBe(true);
347
+ expect(count).toBe(3);
325
348
  });
326
349
  });
327
350
  });
@@ -2,5 +2,5 @@ import { SessionState, Terminal } from '../../types/index.js';
2
2
  import { BaseStateDetector } from './base.js';
3
3
  export declare class ClineStateDetector extends BaseStateDetector {
4
4
  detectState(terminal: Terminal, _currentState: SessionState): SessionState;
5
- detectBackgroundTask(_terminal: Terminal): boolean;
5
+ detectBackgroundTask(_terminal: Terminal): number;
6
6
  }
@@ -22,6 +22,6 @@ export class ClineStateDetector extends BaseStateDetector {
22
22
  return 'busy';
23
23
  }
24
24
  detectBackgroundTask(_terminal) {
25
- return false;
25
+ return 0;
26
26
  }
27
27
  }
@@ -2,5 +2,5 @@ import { SessionState, Terminal } from '../../types/index.js';
2
2
  import { BaseStateDetector } from './base.js';
3
3
  export declare class CodexStateDetector extends BaseStateDetector {
4
4
  detectState(terminal: Terminal, _currentState: SessionState): SessionState;
5
- detectBackgroundTask(_terminal: Terminal): boolean;
5
+ detectBackgroundTask(_terminal: Terminal): number;
6
6
  }
@@ -25,6 +25,6 @@ export class CodexStateDetector extends BaseStateDetector {
25
25
  return 'idle';
26
26
  }
27
27
  detectBackgroundTask(_terminal) {
28
- return false;
28
+ return 0;
29
29
  }
30
30
  }
@@ -2,5 +2,5 @@ import { SessionState, Terminal } from '../../types/index.js';
2
2
  import { BaseStateDetector } from './base.js';
3
3
  export declare class CursorStateDetector extends BaseStateDetector {
4
4
  detectState(terminal: Terminal, _currentState: SessionState): SessionState;
5
- detectBackgroundTask(_terminal: Terminal): boolean;
5
+ detectBackgroundTask(_terminal: Terminal): number;
6
6
  }
@@ -17,6 +17,6 @@ export class CursorStateDetector extends BaseStateDetector {
17
17
  return 'idle';
18
18
  }
19
19
  detectBackgroundTask(_terminal) {
20
- return false;
20
+ return 0;
21
21
  }
22
22
  }
@@ -2,5 +2,5 @@ import { SessionState, Terminal } from '../../types/index.js';
2
2
  import { BaseStateDetector } from './base.js';
3
3
  export declare class GeminiStateDetector extends BaseStateDetector {
4
4
  detectState(terminal: Terminal, _currentState: SessionState): SessionState;
5
- detectBackgroundTask(_terminal: Terminal): boolean;
5
+ detectBackgroundTask(_terminal: Terminal): number;
6
6
  }
@@ -26,6 +26,6 @@ export class GeminiStateDetector extends BaseStateDetector {
26
26
  return 'idle';
27
27
  }
28
28
  detectBackgroundTask(_terminal) {
29
- return false;
29
+ return 0;
30
30
  }
31
31
  }
@@ -2,5 +2,5 @@ import { SessionState, Terminal } from '../../types/index.js';
2
2
  import { BaseStateDetector } from './base.js';
3
3
  export declare class GitHubCopilotStateDetector extends BaseStateDetector {
4
4
  detectState(terminal: Terminal, _currentState: SessionState): SessionState;
5
- detectBackgroundTask(_terminal: Terminal): boolean;
5
+ detectBackgroundTask(_terminal: Terminal): number;
6
6
  }
@@ -19,6 +19,6 @@ export class GitHubCopilotStateDetector extends BaseStateDetector {
19
19
  return 'idle';
20
20
  }
21
21
  detectBackgroundTask(_terminal) {
22
- return false;
22
+ return 0;
23
23
  }
24
24
  }
@@ -2,5 +2,5 @@ import { SessionState, Terminal } from '../../types/index.js';
2
2
  import { BaseStateDetector } from './base.js';
3
3
  export declare class OpenCodeStateDetector extends BaseStateDetector {
4
4
  detectState(terminal: Terminal, _currentState: SessionState): SessionState;
5
- detectBackgroundTask(_terminal: Terminal): boolean;
5
+ detectBackgroundTask(_terminal: Terminal): number;
6
6
  }
@@ -15,6 +15,6 @@ export class OpenCodeStateDetector extends BaseStateDetector {
15
15
  return 'idle';
16
16
  }
17
17
  detectBackgroundTask(_terminal) {
18
- return false;
18
+ return 0;
19
19
  }
20
20
  }
@@ -1,5 +1,5 @@
1
1
  import { SessionState, Terminal } from '../../types/index.js';
2
2
  export interface StateDetector {
3
3
  detectState(terminal: Terminal, currentState: SessionState): SessionState;
4
- detectBackgroundTask(terminal: Terminal): boolean;
4
+ detectBackgroundTask(terminal: Terminal): number;
5
5
  }
@@ -1,6 +1,18 @@
1
1
  import { Effect } from 'effect';
2
2
  import { Worktree } from '../types/index.js';
3
3
  import { GitError, FileSystemError } from '../types/errors.js';
4
+ /**
5
+ * Get all worktree last opened timestamps
6
+ */
7
+ export declare function getWorktreeLastOpened(): Record<string, number>;
8
+ /**
9
+ * Set the last opened timestamp for a worktree
10
+ */
11
+ export declare function setWorktreeLastOpened(worktreePath: string, timestamp: number): void;
12
+ /**
13
+ * Get the last opened timestamp for a specific worktree
14
+ */
15
+ export declare function getWorktreeLastOpenedTime(worktreePath: string): number | undefined;
4
16
  /**
5
17
  * WorktreeService - Git worktree management with Effect-based error handling
6
18
  *
@@ -7,8 +7,28 @@ import { GitError, FileSystemError } from '../types/errors.js';
7
7
  import { setWorktreeParentBranch } from '../utils/worktreeConfig.js';
8
8
  import { getClaudeProjectsDir, pathToClaudeProjectName, } from '../utils/claudeDir.js';
9
9
  import { executeWorktreePostCreationHook } from '../utils/hookExecutor.js';
10
- import { configurationManager } from './configurationManager.js';
10
+ import { configReader } from './config/configReader.js';
11
11
  const CLAUDE_DIR = '.claude';
12
+ // Module-level state for worktree last opened tracking (runtime state, not persisted)
13
+ const worktreeLastOpened = new Map();
14
+ /**
15
+ * Get all worktree last opened timestamps
16
+ */
17
+ export function getWorktreeLastOpened() {
18
+ return Object.fromEntries(worktreeLastOpened);
19
+ }
20
+ /**
21
+ * Set the last opened timestamp for a worktree
22
+ */
23
+ export function setWorktreeLastOpened(worktreePath, timestamp) {
24
+ worktreeLastOpened.set(worktreePath, timestamp);
25
+ }
26
+ /**
27
+ * Get the last opened timestamp for a specific worktree
28
+ */
29
+ export function getWorktreeLastOpenedTime(worktreePath) {
30
+ return worktreeLastOpened.get(worktreePath);
31
+ }
12
32
  /**
13
33
  * WorktreeService - Git worktree management with Effect-based error handling
14
34
  *
@@ -641,8 +661,8 @@ export class WorktreeService {
641
661
  if (sortByLastSession) {
642
662
  worktrees.sort((a, b) => {
643
663
  // Get last opened timestamps for both worktrees
644
- const timeA = configurationManager.getWorktreeLastOpenedTime(a.path);
645
- const timeB = configurationManager.getWorktreeLastOpenedTime(b.path);
664
+ const timeA = getWorktreeLastOpenedTime(a.path);
665
+ const timeB = getWorktreeLastOpenedTime(b.path);
646
666
  // If both timestamps are undefined, preserve original order
647
667
  if (timeA === undefined && timeB === undefined) {
648
668
  return 0;
@@ -804,7 +824,7 @@ export class WorktreeService {
804
824
  });
805
825
  }
806
826
  // Execute post-creation hook if configured
807
- const worktreeHooks = configurationManager.getWorktreeHooks();
827
+ const worktreeHooks = configReader.getWorktreeHooks();
808
828
  if (worktreeHooks.post_creation?.enabled &&
809
829
  worktreeHooks.post_creation?.command) {
810
830
  const newWorktree = {