ccmanager 3.3.2 → 3.5.0
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 +11 -5
- package/dist/components/App.js +17 -3
- package/dist/components/App.test.js +5 -5
- package/dist/components/Configuration.d.ts +2 -0
- package/dist/components/Configuration.js +6 -2
- package/dist/components/ConfigureCommand.js +34 -11
- package/dist/components/ConfigureOther.js +18 -4
- package/dist/components/ConfigureOther.test.js +48 -12
- package/dist/components/ConfigureShortcuts.js +27 -85
- package/dist/components/ConfigureStatusHooks.js +19 -4
- package/dist/components/ConfigureStatusHooks.test.js +46 -12
- package/dist/components/ConfigureWorktree.js +18 -4
- package/dist/components/ConfigureWorktreeHooks.js +19 -4
- package/dist/components/ConfigureWorktreeHooks.test.js +49 -14
- package/dist/components/Menu.js +72 -14
- package/dist/components/Menu.recent-projects.test.js +2 -0
- package/dist/components/Menu.test.js +2 -0
- package/dist/components/NewWorktree.js +2 -2
- package/dist/components/NewWorktree.test.js +6 -6
- package/dist/components/PresetSelector.js +2 -2
- package/dist/constants/statusIcons.d.ts +4 -1
- package/dist/constants/statusIcons.js +10 -1
- package/dist/constants/statusIcons.test.js +42 -0
- package/dist/contexts/ConfigEditorContext.d.ts +21 -0
- package/dist/contexts/ConfigEditorContext.js +25 -0
- package/dist/services/autoApprovalVerifier.js +3 -3
- package/dist/services/autoApprovalVerifier.test.js +2 -2
- package/dist/services/config/configEditor.d.ts +46 -0
- package/dist/services/{configurationManager.effect.test.js → config/configEditor.effect.test.js} +46 -49
- package/dist/services/config/configEditor.js +101 -0
- package/dist/services/{configurationManager.selectPresetOnStart.test.js → config/configEditor.selectPresetOnStart.test.js} +27 -19
- package/dist/services/config/configEditor.test.d.ts +1 -0
- package/dist/services/{configurationManager.test.js → config/configEditor.test.js} +60 -132
- package/dist/services/config/configReader.d.ts +28 -0
- package/dist/services/config/configReader.js +95 -0
- package/dist/services/config/configReader.multiProject.test.d.ts +1 -0
- package/dist/services/config/configReader.multiProject.test.js +136 -0
- package/dist/services/config/globalConfigManager.d.ts +30 -0
- package/dist/services/config/globalConfigManager.js +216 -0
- package/dist/services/config/index.d.ts +13 -0
- package/dist/services/config/index.js +13 -0
- package/dist/services/config/projectConfigManager.d.ts +41 -0
- package/dist/services/config/projectConfigManager.js +181 -0
- package/dist/services/config/projectConfigManager.test.d.ts +1 -0
- package/dist/services/config/projectConfigManager.test.js +105 -0
- package/dist/services/config/testUtils.d.ts +81 -0
- package/dist/services/config/testUtils.js +351 -0
- package/dist/services/sessionManager.autoApproval.test.js +9 -6
- package/dist/services/sessionManager.d.ts +2 -0
- package/dist/services/sessionManager.effect.test.js +27 -18
- package/dist/services/sessionManager.js +43 -40
- package/dist/services/sessionManager.statePersistence.test.js +5 -4
- package/dist/services/sessionManager.test.js +71 -49
- package/dist/services/shortcutManager.d.ts +0 -1
- package/dist/services/shortcutManager.js +5 -16
- package/dist/services/shortcutManager.test.js +2 -2
- package/dist/services/stateDetector/base.d.ts +1 -0
- package/dist/services/stateDetector/claude.d.ts +1 -0
- package/dist/services/stateDetector/claude.js +8 -0
- package/dist/services/stateDetector/claude.test.js +102 -0
- package/dist/services/stateDetector/cline.d.ts +1 -0
- package/dist/services/stateDetector/cline.js +3 -0
- package/dist/services/stateDetector/codex.d.ts +1 -0
- package/dist/services/stateDetector/codex.js +3 -0
- package/dist/services/stateDetector/cursor.d.ts +1 -0
- package/dist/services/stateDetector/cursor.js +3 -0
- package/dist/services/stateDetector/gemini.d.ts +1 -0
- package/dist/services/stateDetector/gemini.js +3 -0
- package/dist/services/stateDetector/github-copilot.d.ts +1 -0
- package/dist/services/stateDetector/github-copilot.js +3 -0
- package/dist/services/stateDetector/opencode.d.ts +1 -0
- package/dist/services/stateDetector/opencode.js +3 -0
- package/dist/services/stateDetector/types.d.ts +1 -0
- package/dist/services/worktreeService.d.ts +12 -0
- package/dist/services/worktreeService.js +24 -4
- package/dist/services/worktreeService.sort.test.js +105 -109
- package/dist/services/worktreeService.test.js +5 -5
- package/dist/types/index.d.ts +47 -7
- package/dist/utils/gitUtils.d.ts +8 -0
- package/dist/utils/gitUtils.js +32 -0
- package/dist/utils/hookExecutor.js +2 -2
- package/dist/utils/hookExecutor.test.js +13 -12
- package/dist/utils/mutex.d.ts +1 -0
- package/dist/utils/mutex.js +1 -0
- package/dist/utils/worktreeUtils.js +3 -2
- package/dist/utils/worktreeUtils.test.js +2 -1
- package/package.json +7 -7
- package/dist/services/configurationManager.d.ts +0 -121
- package/dist/services/configurationManager.js +0 -597
- /package/dist/{services/configurationManager.effect.test.d.ts → constants/statusIcons.test.d.ts} +0 -0
- /package/dist/services/{configurationManager.selectPresetOnStart.test.d.ts → config/configEditor.effect.test.d.ts} +0 -0
- /package/dist/services/{configurationManager.test.d.ts → config/configEditor.selectPresetOnStart.test.d.ts} +0 -0
package/dist/utils/mutex.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export interface SessionStateData {
|
|
|
47
47
|
autoApprovalFailed: boolean;
|
|
48
48
|
autoApprovalReason: string | undefined;
|
|
49
49
|
autoApprovalAbortController: AbortController | undefined;
|
|
50
|
+
hasBackgroundTask: boolean;
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
53
|
* Create initial session state data with default values.
|
package/dist/utils/mutex.js
CHANGED
|
@@ -71,8 +71,9 @@ export function extractBranchParts(branchName) {
|
|
|
71
71
|
export function prepareWorktreeItems(worktrees, sessions) {
|
|
72
72
|
return worktrees.map(wt => {
|
|
73
73
|
const session = sessions.find(s => s.worktreePath === wt.path);
|
|
74
|
-
const
|
|
75
|
-
|
|
74
|
+
const stateData = session?.stateMutex.getSnapshot();
|
|
75
|
+
const status = stateData
|
|
76
|
+
? ` [${getStatusDisplay(stateData.state, stateData.hasBackgroundTask)}]`
|
|
76
77
|
: '';
|
|
77
78
|
const fullBranchName = wt.branch
|
|
78
79
|
? wt.branch.replace('refs/heads/', '')
|
|
@@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
|
2
2
|
import { generateWorktreeDirectory, extractBranchParts, truncateString, prepareWorktreeItems, calculateColumnPositions, assembleWorktreeLabel, } from './worktreeUtils.js';
|
|
3
3
|
import { execSync } from 'child_process';
|
|
4
4
|
import { Mutex, createInitialSessionStateData } from './mutex.js';
|
|
5
|
+
import { createStateDetector } from '../services/stateDetector/index.js';
|
|
5
6
|
// Mock child_process module
|
|
6
7
|
vi.mock('child_process');
|
|
7
8
|
describe('generateWorktreeDirectory', () => {
|
|
@@ -130,13 +131,13 @@ describe('prepareWorktreeItems', () => {
|
|
|
130
131
|
terminal: {},
|
|
131
132
|
stateCheckInterval: undefined,
|
|
132
133
|
isPrimaryCommand: true,
|
|
133
|
-
commandConfig: undefined,
|
|
134
134
|
detectionStrategy: 'claude',
|
|
135
135
|
devcontainerConfig: undefined,
|
|
136
136
|
stateMutex: new Mutex({
|
|
137
137
|
...createInitialSessionStateData(),
|
|
138
138
|
state: 'idle',
|
|
139
139
|
}),
|
|
140
|
+
stateDetector: createStateDetector('claude'),
|
|
140
141
|
};
|
|
141
142
|
it('should prepare basic worktree without git status', () => {
|
|
142
143
|
const items = prepareWorktreeItems([mockWorktree], []);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccmanager",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
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.
|
|
45
|
-
"@kodaikabasawa/ccmanager-darwin-x64": "3.
|
|
46
|
-
"@kodaikabasawa/ccmanager-linux-arm64": "3.
|
|
47
|
-
"@kodaikabasawa/ccmanager-linux-x64": "3.
|
|
48
|
-
"@kodaikabasawa/ccmanager-win32-x64": "3.
|
|
44
|
+
"@kodaikabasawa/ccmanager-darwin-arm64": "3.5.0",
|
|
45
|
+
"@kodaikabasawa/ccmanager-darwin-x64": "3.5.0",
|
|
46
|
+
"@kodaikabasawa/ccmanager-linux-arm64": "3.5.0",
|
|
47
|
+
"@kodaikabasawa/ccmanager-linux-x64": "3.5.0",
|
|
48
|
+
"@kodaikabasawa/ccmanager-win32-x64": "3.5.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@eslint/js": "^9.28.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"ink": "5.2.1",
|
|
74
74
|
"ink-select-input": "^6.0.0",
|
|
75
75
|
"ink-text-input": "^6.0.0",
|
|
76
|
-
"meow": "^
|
|
76
|
+
"meow": "^14.0.0",
|
|
77
77
|
"react": "18.3.1",
|
|
78
78
|
"react-devtools-core": "^7.0.1",
|
|
79
79
|
"react-dom": "18.3.1",
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { Effect, Either } from 'effect';
|
|
2
|
-
import { ConfigurationData, StatusHookConfig, WorktreeHookConfig, ShortcutConfig, WorktreeConfig, CommandConfig, CommandPreset, CommandPresetsConfig } from '../types/index.js';
|
|
3
|
-
import { FileSystemError, ConfigError, ValidationError } from '../types/errors.js';
|
|
4
|
-
export declare class ConfigurationManager {
|
|
5
|
-
private configPath;
|
|
6
|
-
private legacyShortcutsPath;
|
|
7
|
-
private configDir;
|
|
8
|
-
private config;
|
|
9
|
-
private worktreeLastOpened;
|
|
10
|
-
constructor();
|
|
11
|
-
private loadConfig;
|
|
12
|
-
private migrateLegacyShortcuts;
|
|
13
|
-
private saveConfig;
|
|
14
|
-
getShortcuts(): ShortcutConfig;
|
|
15
|
-
setShortcuts(shortcuts: ShortcutConfig): void;
|
|
16
|
-
getStatusHooks(): StatusHookConfig;
|
|
17
|
-
setStatusHooks(hooks: StatusHookConfig): void;
|
|
18
|
-
getWorktreeHooks(): WorktreeHookConfig;
|
|
19
|
-
setWorktreeHooks(hooks: WorktreeHookConfig): void;
|
|
20
|
-
getConfiguration(): ConfigurationData;
|
|
21
|
-
setConfiguration(config: ConfigurationData): void;
|
|
22
|
-
getWorktreeConfig(): WorktreeConfig;
|
|
23
|
-
setWorktreeConfig(worktreeConfig: WorktreeConfig): void;
|
|
24
|
-
getAutoApprovalConfig(): NonNullable<ConfigurationData['autoApproval']>;
|
|
25
|
-
setAutoApprovalConfig(autoApproval: NonNullable<ConfigurationData['autoApproval']>): void;
|
|
26
|
-
setAutoApprovalEnabled(enabled: boolean): void;
|
|
27
|
-
setAutoApprovalTimeout(timeout: number): void;
|
|
28
|
-
getCommandConfig(): CommandConfig;
|
|
29
|
-
setCommandConfig(commandConfig: CommandConfig): void;
|
|
30
|
-
private migrateLegacyCommandToPresets;
|
|
31
|
-
getCommandPresets(): CommandPresetsConfig;
|
|
32
|
-
setCommandPresets(presets: CommandPresetsConfig): void;
|
|
33
|
-
getDefaultPreset(): CommandPreset;
|
|
34
|
-
getPresetById(id: string): CommandPreset | undefined;
|
|
35
|
-
addPreset(preset: CommandPreset): void;
|
|
36
|
-
deletePreset(id: string): void;
|
|
37
|
-
setDefaultPreset(id: string): void;
|
|
38
|
-
getSelectPresetOnStart(): boolean;
|
|
39
|
-
setSelectPresetOnStart(enabled: boolean): void;
|
|
40
|
-
getWorktreeLastOpened(): Record<string, number>;
|
|
41
|
-
setWorktreeLastOpened(worktreePath: string, timestamp: number): void;
|
|
42
|
-
getWorktreeLastOpenedTime(worktreePath: string): number | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* Load configuration from file with Effect-based error handling
|
|
45
|
-
*
|
|
46
|
-
* @returns {Effect.Effect<ConfigurationData, FileSystemError | ConfigError, never>} Configuration data on success, errors on failure
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
* const result = await Effect.runPromise(
|
|
51
|
-
* configManager.loadConfigEffect()
|
|
52
|
-
* );
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
loadConfigEffect(): Effect.Effect<ConfigurationData, FileSystemError | ConfigError, never>;
|
|
56
|
-
/**
|
|
57
|
-
* Save configuration to file with Effect-based error handling
|
|
58
|
-
*
|
|
59
|
-
* @returns {Effect.Effect<void, FileSystemError, never>} Void on success, FileSystemError on write failure
|
|
60
|
-
*
|
|
61
|
-
* @example
|
|
62
|
-
* ```typescript
|
|
63
|
-
* await Effect.runPromise(
|
|
64
|
-
* configManager.saveConfigEffect(config)
|
|
65
|
-
* );
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
saveConfigEffect(config: ConfigurationData): Effect.Effect<void, FileSystemError, never>;
|
|
69
|
-
/**
|
|
70
|
-
* Validate configuration structure
|
|
71
|
-
* Synchronous validation using Either
|
|
72
|
-
*/
|
|
73
|
-
validateConfig(config: unknown): Either.Either<ValidationError, ConfigurationData>;
|
|
74
|
-
/**
|
|
75
|
-
* Get preset by ID with Either-based error handling
|
|
76
|
-
* Synchronous lookup using Either
|
|
77
|
-
*/
|
|
78
|
-
getPresetByIdEffect(id: string): Either.Either<ValidationError, CommandPreset>;
|
|
79
|
-
/**
|
|
80
|
-
* Set shortcuts with Effect-based error handling
|
|
81
|
-
*
|
|
82
|
-
* @returns {Effect.Effect<void, FileSystemError, never>} Void on success, FileSystemError on save failure
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```typescript
|
|
86
|
-
* await Effect.runPromise(
|
|
87
|
-
* configManager.setShortcutsEffect(shortcuts)
|
|
88
|
-
* );
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
setShortcutsEffect(shortcuts: ShortcutConfig): Effect.Effect<void, FileSystemError, never>;
|
|
92
|
-
/**
|
|
93
|
-
* Set command presets with Effect-based error handling
|
|
94
|
-
*/
|
|
95
|
-
setCommandPresetsEffect(presets: CommandPresetsConfig): Effect.Effect<void, FileSystemError, never>;
|
|
96
|
-
/**
|
|
97
|
-
* Add or update preset with Effect-based error handling
|
|
98
|
-
*/
|
|
99
|
-
addPresetEffect(preset: CommandPreset): Effect.Effect<void, FileSystemError, never>;
|
|
100
|
-
/**
|
|
101
|
-
* Delete preset with Effect-based error handling
|
|
102
|
-
*/
|
|
103
|
-
deletePresetEffect(id: string): Effect.Effect<void, ValidationError | FileSystemError, never>;
|
|
104
|
-
/**
|
|
105
|
-
* Set default preset with Effect-based error handling
|
|
106
|
-
*/
|
|
107
|
-
setDefaultPresetEffect(id: string): Effect.Effect<void, ValidationError | FileSystemError, never>;
|
|
108
|
-
/**
|
|
109
|
-
* Apply default values to configuration
|
|
110
|
-
*/
|
|
111
|
-
private applyDefaults;
|
|
112
|
-
/**
|
|
113
|
-
* Synchronous legacy shortcuts migration helper
|
|
114
|
-
*/
|
|
115
|
-
private migrateLegacyShortcutsSync;
|
|
116
|
-
/**
|
|
117
|
-
* Get whether auto-approval is enabled
|
|
118
|
-
*/
|
|
119
|
-
isAutoApprovalEnabled(): boolean;
|
|
120
|
-
}
|
|
121
|
-
export declare const configurationManager: ConfigurationManager;
|