ccmanager 2.8.0 → 2.9.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.
Files changed (77) hide show
  1. package/dist/cli.test.js +13 -2
  2. package/dist/components/App.js +125 -50
  3. package/dist/components/App.test.js +270 -0
  4. package/dist/components/ConfigureShortcuts.js +82 -8
  5. package/dist/components/DeleteWorktree.js +39 -5
  6. package/dist/components/DeleteWorktree.test.d.ts +1 -0
  7. package/dist/components/DeleteWorktree.test.js +128 -0
  8. package/dist/components/LoadingSpinner.d.ts +8 -0
  9. package/dist/components/LoadingSpinner.js +37 -0
  10. package/dist/components/LoadingSpinner.test.d.ts +1 -0
  11. package/dist/components/LoadingSpinner.test.js +187 -0
  12. package/dist/components/Menu.js +64 -16
  13. package/dist/components/Menu.recent-projects.test.js +32 -11
  14. package/dist/components/Menu.test.js +136 -4
  15. package/dist/components/MergeWorktree.js +79 -18
  16. package/dist/components/MergeWorktree.test.d.ts +1 -0
  17. package/dist/components/MergeWorktree.test.js +227 -0
  18. package/dist/components/NewWorktree.js +88 -9
  19. package/dist/components/NewWorktree.test.d.ts +1 -0
  20. package/dist/components/NewWorktree.test.js +244 -0
  21. package/dist/components/ProjectList.js +44 -13
  22. package/dist/components/ProjectList.recent-projects.test.js +8 -3
  23. package/dist/components/ProjectList.test.js +105 -8
  24. package/dist/components/RemoteBranchSelector.test.js +3 -1
  25. package/dist/hooks/useGitStatus.d.ts +11 -0
  26. package/dist/hooks/useGitStatus.js +70 -12
  27. package/dist/hooks/useGitStatus.test.js +30 -23
  28. package/dist/services/configurationManager.d.ts +75 -0
  29. package/dist/services/configurationManager.effect.test.d.ts +1 -0
  30. package/dist/services/configurationManager.effect.test.js +407 -0
  31. package/dist/services/configurationManager.js +246 -0
  32. package/dist/services/globalSessionOrchestrator.test.js +0 -8
  33. package/dist/services/projectManager.d.ts +98 -2
  34. package/dist/services/projectManager.js +228 -59
  35. package/dist/services/projectManager.test.js +242 -2
  36. package/dist/services/sessionManager.d.ts +44 -2
  37. package/dist/services/sessionManager.effect.test.d.ts +1 -0
  38. package/dist/services/sessionManager.effect.test.js +321 -0
  39. package/dist/services/sessionManager.js +216 -65
  40. package/dist/services/sessionManager.statePersistence.test.js +18 -9
  41. package/dist/services/sessionManager.test.js +40 -36
  42. package/dist/services/worktreeService.d.ts +356 -26
  43. package/dist/services/worktreeService.js +793 -353
  44. package/dist/services/worktreeService.test.js +294 -313
  45. package/dist/types/errors.d.ts +74 -0
  46. package/dist/types/errors.js +31 -0
  47. package/dist/types/errors.test.d.ts +1 -0
  48. package/dist/types/errors.test.js +201 -0
  49. package/dist/types/index.d.ts +5 -17
  50. package/dist/utils/claudeDir.d.ts +58 -6
  51. package/dist/utils/claudeDir.js +103 -8
  52. package/dist/utils/claudeDir.test.d.ts +1 -0
  53. package/dist/utils/claudeDir.test.js +108 -0
  54. package/dist/utils/concurrencyLimit.d.ts +5 -0
  55. package/dist/utils/concurrencyLimit.js +11 -0
  56. package/dist/utils/concurrencyLimit.test.js +40 -1
  57. package/dist/utils/gitStatus.d.ts +36 -8
  58. package/dist/utils/gitStatus.js +170 -88
  59. package/dist/utils/gitStatus.test.js +12 -9
  60. package/dist/utils/hookExecutor.d.ts +41 -6
  61. package/dist/utils/hookExecutor.js +75 -32
  62. package/dist/utils/hookExecutor.test.js +73 -20
  63. package/dist/utils/terminalCapabilities.d.ts +18 -0
  64. package/dist/utils/terminalCapabilities.js +81 -0
  65. package/dist/utils/terminalCapabilities.test.d.ts +1 -0
  66. package/dist/utils/terminalCapabilities.test.js +104 -0
  67. package/dist/utils/testHelpers.d.ts +106 -0
  68. package/dist/utils/testHelpers.js +153 -0
  69. package/dist/utils/testHelpers.test.d.ts +1 -0
  70. package/dist/utils/testHelpers.test.js +114 -0
  71. package/dist/utils/worktreeConfig.d.ts +77 -2
  72. package/dist/utils/worktreeConfig.js +156 -16
  73. package/dist/utils/worktreeConfig.test.d.ts +1 -0
  74. package/dist/utils/worktreeConfig.test.js +39 -0
  75. package/package.json +4 -4
  76. package/dist/integration-tests/devcontainer.integration.test.js +0 -101
  77. /package/dist/{integration-tests/devcontainer.integration.test.d.ts → components/App.test.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccmanager",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "TUI application for managing multiple Claude Code sessions across Git worktrees",
5
5
  "license": "MIT",
6
6
  "author": "Kodai Kabasawa",
@@ -27,12 +27,11 @@
27
27
  "build": "tsc",
28
28
  "dev": "tsc --watch",
29
29
  "start": "node dist/cli.js",
30
- "test": "vitest",
31
- "test:run": "vitest run",
30
+ "test": "vitest --run",
32
31
  "lint": "eslint src",
33
32
  "lint:fix": "eslint src --fix",
34
33
  "typecheck": "tsc --noEmit",
35
- "prepublishOnly": "npm run lint && npm run typecheck && npm run test:run && npm run build",
34
+ "prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm run build",
36
35
  "prepare": "npm run build"
37
36
  },
38
37
  "files": [
@@ -40,6 +39,7 @@
40
39
  ],
41
40
  "dependencies": {
42
41
  "@xterm/headless": "^5.5.0",
42
+ "effect": "^3.18.2",
43
43
  "ink": "^4.1.0",
44
44
  "ink-select-input": "^5.0.0",
45
45
  "ink-text-input": "^5.0.1",
@@ -1,101 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from 'vitest';
2
- import { SessionManager } from '../services/sessionManager.js';
3
- import { spawn } from 'node-pty';
4
- import { exec } from 'child_process';
5
- // Mock modules
6
- vi.mock('node-pty');
7
- vi.mock('child_process');
8
- vi.mock('util', () => ({
9
- promisify: vi.fn((fn) => {
10
- return (cmd, options) => {
11
- return new Promise((resolve, reject) => {
12
- const callback = (err, stdout, stderr) => {
13
- if (err) {
14
- reject(err);
15
- }
16
- else {
17
- resolve({ stdout, stderr });
18
- }
19
- };
20
- // Call the original function with the promisified callback
21
- fn(cmd, options, callback);
22
- });
23
- };
24
- }),
25
- }));
26
- vi.mock('../services/configurationManager.js', () => ({
27
- configurationManager: {
28
- getDefaultPreset: vi.fn(() => ({
29
- id: 'claude',
30
- name: 'Claude',
31
- command: 'claude',
32
- args: [],
33
- })),
34
- getPresetById: vi.fn(),
35
- },
36
- }));
37
- vi.mock('../services/worktreeService.js', () => ({
38
- WorktreeService: vi.fn(),
39
- }));
40
- const mockSpawn = vi.mocked(spawn);
41
- const mockExec = vi.mocked(exec);
42
- describe('Devcontainer Integration', () => {
43
- let sessionManager;
44
- let mockPty;
45
- beforeEach(() => {
46
- vi.clearAllMocks();
47
- sessionManager = new SessionManager();
48
- // Mock PTY process
49
- mockPty = {
50
- onData: vi.fn(),
51
- onExit: vi.fn(),
52
- write: vi.fn(),
53
- resize: vi.fn(),
54
- kill: vi.fn(),
55
- pid: 12345,
56
- cols: 80,
57
- rows: 24,
58
- process: 'claude',
59
- };
60
- mockSpawn.mockReturnValue(mockPty);
61
- });
62
- it('should execute devcontainer up command before creating session', async () => {
63
- const devcontainerConfig = {
64
- upCommand: 'devcontainer up --workspace-folder .',
65
- execCommand: 'devcontainer exec --workspace-folder .',
66
- };
67
- mockExec.mockImplementation((cmd, options, callback) => {
68
- if (typeof options === 'function') {
69
- callback = options;
70
- options = undefined;
71
- }
72
- if (callback && typeof callback === 'function') {
73
- callback(null, 'Container started', '');
74
- }
75
- return {};
76
- });
77
- await sessionManager.createSessionWithDevcontainer('/test/worktree', devcontainerConfig);
78
- expect(mockExec).toHaveBeenCalledWith(devcontainerConfig.upCommand, { cwd: '/test/worktree' }, expect.any(Function));
79
- });
80
- it('should handle devcontainer command execution with presets', async () => {
81
- const devcontainerConfig = {
82
- upCommand: 'devcontainer up --workspace-folder .',
83
- execCommand: 'devcontainer exec --workspace-folder .',
84
- };
85
- mockExec.mockImplementation((cmd, options, callback) => {
86
- if (typeof options === 'function') {
87
- callback = options;
88
- options = undefined;
89
- }
90
- if (callback && typeof callback === 'function') {
91
- callback(null, 'Container started', '');
92
- }
93
- return {};
94
- });
95
- await sessionManager.createSessionWithDevcontainer('/test/worktree', devcontainerConfig);
96
- // Should spawn with devcontainer exec command
97
- expect(mockSpawn).toHaveBeenCalledWith('devcontainer', ['exec', '--workspace-folder', '.', '--', 'claude'], expect.objectContaining({
98
- cwd: '/test/worktree',
99
- }));
100
- });
101
- });