@akiojin/gwt 2.2.0 → 2.3.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 (149) hide show
  1. package/README.ja.md +4 -4
  2. package/README.md +4 -4
  3. package/dist/cli/ui/components/App.d.ts +4 -4
  4. package/dist/cli/ui/components/App.d.ts.map +1 -1
  5. package/dist/cli/ui/components/App.js +144 -105
  6. package/dist/cli/ui/components/App.js.map +1 -1
  7. package/dist/cli/ui/components/common/Confirm.d.ts +1 -1
  8. package/dist/cli/ui/components/common/Confirm.d.ts.map +1 -1
  9. package/dist/cli/ui/components/common/Confirm.js +7 -7
  10. package/dist/cli/ui/components/common/Confirm.js.map +1 -1
  11. package/dist/cli/ui/components/common/ErrorBoundary.d.ts +1 -1
  12. package/dist/cli/ui/components/common/ErrorBoundary.d.ts.map +1 -1
  13. package/dist/cli/ui/components/common/ErrorBoundary.js +4 -4
  14. package/dist/cli/ui/components/common/ErrorBoundary.js.map +1 -1
  15. package/dist/cli/ui/components/common/Input.d.ts +2 -2
  16. package/dist/cli/ui/components/common/Input.d.ts.map +1 -1
  17. package/dist/cli/ui/components/common/Input.js +4 -4
  18. package/dist/cli/ui/components/common/Input.js.map +1 -1
  19. package/dist/cli/ui/components/common/LoadingIndicator.d.ts +1 -1
  20. package/dist/cli/ui/components/common/LoadingIndicator.d.ts.map +1 -1
  21. package/dist/cli/ui/components/common/LoadingIndicator.js +4 -4
  22. package/dist/cli/ui/components/common/LoadingIndicator.js.map +1 -1
  23. package/dist/cli/ui/components/common/Select.d.ts +1 -1
  24. package/dist/cli/ui/components/common/Select.d.ts.map +1 -1
  25. package/dist/cli/ui/components/common/Select.js +11 -12
  26. package/dist/cli/ui/components/common/Select.js.map +1 -1
  27. package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts +2 -2
  28. package/dist/cli/ui/components/screens/AIToolSelectorScreen.d.ts.map +1 -1
  29. package/dist/cli/ui/components/screens/AIToolSelectorScreen.js +11 -11
  30. package/dist/cli/ui/components/screens/AIToolSelectorScreen.js.map +1 -1
  31. package/dist/cli/ui/components/screens/BranchCreatorScreen.d.ts +1 -1
  32. package/dist/cli/ui/components/screens/BranchCreatorScreen.d.ts.map +1 -1
  33. package/dist/cli/ui/components/screens/BranchCreatorScreen.js +39 -36
  34. package/dist/cli/ui/components/screens/BranchCreatorScreen.js.map +1 -1
  35. package/dist/cli/ui/components/screens/BranchListScreen.d.ts +3 -3
  36. package/dist/cli/ui/components/screens/BranchListScreen.d.ts.map +1 -1
  37. package/dist/cli/ui/components/screens/BranchListScreen.js +55 -50
  38. package/dist/cli/ui/components/screens/BranchListScreen.js.map +1 -1
  39. package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.d.ts +2 -2
  40. package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.d.ts.map +1 -1
  41. package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.js +25 -25
  42. package/dist/cli/ui/components/screens/ExecutionModeSelectorScreen.js.map +1 -1
  43. package/dist/cli/ui/components/screens/PRCleanupScreen.d.ts +2 -2
  44. package/dist/cli/ui/components/screens/PRCleanupScreen.js +21 -21
  45. package/dist/cli/ui/components/screens/SessionSelectorScreen.d.ts +1 -1
  46. package/dist/cli/ui/components/screens/SessionSelectorScreen.js +8 -8
  47. package/dist/cli/ui/components/screens/WorktreeManagerScreen.d.ts +1 -1
  48. package/dist/cli/ui/components/screens/WorktreeManagerScreen.js +8 -8
  49. package/dist/cli/ui/screens/BranchActionSelectorScreen.d.ts.map +1 -1
  50. package/dist/cli/ui/screens/BranchActionSelectorScreen.js +7 -4
  51. package/dist/cli/ui/screens/BranchActionSelectorScreen.js.map +1 -1
  52. package/dist/cli/ui/types.d.ts.map +1 -1
  53. package/dist/client/assets/{index-V6hDu9KS.js → index-Difv1Hwu.js} +2 -2
  54. package/dist/client/index.html +1 -1
  55. package/dist/config/builtin-tools.d.ts +10 -2
  56. package/dist/config/builtin-tools.d.ts.map +1 -1
  57. package/dist/config/builtin-tools.js +40 -4
  58. package/dist/config/builtin-tools.js.map +1 -1
  59. package/dist/config/index.d.ts.map +1 -1
  60. package/dist/config/index.js.map +1 -1
  61. package/dist/config/tools.d.ts.map +1 -1
  62. package/dist/config/tools.js +4 -3
  63. package/dist/config/tools.js.map +1 -1
  64. package/dist/gemini.d.ts +12 -0
  65. package/dist/gemini.d.ts.map +1 -0
  66. package/dist/gemini.js +154 -0
  67. package/dist/gemini.js.map +1 -0
  68. package/dist/git.d.ts.map +1 -1
  69. package/dist/git.js.map +1 -1
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +30 -0
  72. package/dist/index.js.map +1 -1
  73. package/dist/qwen.d.ts +12 -0
  74. package/dist/qwen.d.ts.map +1 -0
  75. package/dist/qwen.js +154 -0
  76. package/dist/qwen.js.map +1 -0
  77. package/dist/services/git.service.d.ts.map +1 -1
  78. package/dist/services/git.service.js.map +1 -1
  79. package/dist/web/client/src/components/BranchGraph.d.ts.map +1 -1
  80. package/dist/web/client/src/components/BranchGraph.js +1 -1
  81. package/dist/web/client/src/components/BranchGraph.js.map +1 -1
  82. package/dist/web/client/src/components/EnvEditor.d.ts.map +1 -1
  83. package/dist/web/client/src/components/EnvEditor.js +7 -4
  84. package/dist/web/client/src/components/EnvEditor.js.map +1 -1
  85. package/dist/web/client/src/pages/BranchDetailPage.d.ts.map +1 -1
  86. package/dist/web/client/src/pages/BranchDetailPage.js +55 -18
  87. package/dist/web/client/src/pages/BranchDetailPage.js.map +1 -1
  88. package/dist/web/client/src/pages/BranchListPage.d.ts.map +1 -1
  89. package/dist/web/client/src/pages/BranchListPage.js +10 -4
  90. package/dist/web/client/src/pages/BranchListPage.js.map +1 -1
  91. package/dist/web/client/src/pages/ConfigManagementPage.d.ts.map +1 -1
  92. package/dist/web/client/src/pages/ConfigManagementPage.js +4 -2
  93. package/dist/web/client/src/pages/ConfigManagementPage.js.map +1 -1
  94. package/package.json +2 -1
  95. package/src/cli/ui/__tests__/acceptance/navigation.acceptance.test.tsx +69 -50
  96. package/src/cli/ui/__tests__/components/App.protected-branch.test.tsx +67 -45
  97. package/src/cli/ui/__tests__/components/App.shortcuts.test.tsx +117 -75
  98. package/src/cli/ui/__tests__/components/App.test.tsx +45 -37
  99. package/src/cli/ui/__tests__/components/common/Confirm.test.tsx +35 -22
  100. package/src/cli/ui/__tests__/components/common/ErrorBoundary.test.tsx +22 -22
  101. package/src/cli/ui/__tests__/components/common/Input.test.tsx +29 -22
  102. package/src/cli/ui/__tests__/components/common/LoadingIndicator.test.tsx +40 -34
  103. package/src/cli/ui/__tests__/components/common/Select.memo.test.tsx +57 -66
  104. package/src/cli/ui/__tests__/components/common/Select.test.tsx +121 -91
  105. package/src/cli/ui/__tests__/components/parts/Footer.test.tsx +18 -16
  106. package/src/cli/ui/__tests__/components/parts/Header.test.tsx +13 -13
  107. package/src/cli/ui/__tests__/components/parts/ScrollableList.test.tsx +20 -20
  108. package/src/cli/ui/__tests__/components/parts/Stats.test.tsx +38 -26
  109. package/src/cli/ui/__tests__/components/screens/AIToolSelectorScreen.test.tsx +31 -31
  110. package/src/cli/ui/__tests__/components/screens/BranchCreatorScreen.test.tsx +73 -37
  111. package/src/cli/ui/__tests__/components/screens/BranchListScreen.test.tsx +261 -153
  112. package/src/cli/ui/__tests__/components/screens/ExecutionModeSelectorScreen.test.tsx +38 -32
  113. package/src/cli/ui/__tests__/components/screens/PRCleanupScreen.test.tsx +39 -39
  114. package/src/cli/ui/__tests__/components/screens/SessionSelectorScreen.test.tsx +49 -21
  115. package/src/cli/ui/__tests__/components/screens/WorktreeManagerScreen.test.tsx +52 -28
  116. package/src/cli/ui/__tests__/integration/edgeCases.test.tsx +84 -48
  117. package/src/cli/ui/__tests__/integration/navigation.test.tsx +111 -83
  118. package/src/cli/ui/__tests__/integration/realtimeUpdate.test.tsx +111 -108
  119. package/src/cli/ui/__tests__/performance/branchList.performance.test.tsx +50 -37
  120. package/src/cli/ui/__tests__/performance/useMemoOptimization.test.tsx +75 -76
  121. package/src/cli/ui/components/App.tsx +247 -150
  122. package/src/cli/ui/components/common/Confirm.tsx +13 -9
  123. package/src/cli/ui/components/common/ErrorBoundary.tsx +8 -5
  124. package/src/cli/ui/components/common/Input.tsx +12 -4
  125. package/src/cli/ui/components/common/LoadingIndicator.tsx +8 -5
  126. package/src/cli/ui/components/common/Select.tsx +28 -17
  127. package/src/cli/ui/components/parts/Header.test.tsx +5 -15
  128. package/src/cli/ui/components/screens/AIToolSelectorScreen.tsx +19 -13
  129. package/src/cli/ui/components/screens/BranchCreatorScreen.tsx +74 -54
  130. package/src/cli/ui/components/screens/BranchListScreen.tsx +92 -75
  131. package/src/cli/ui/components/screens/ExecutionModeSelectorScreen.tsx +35 -28
  132. package/src/cli/ui/components/screens/PRCleanupScreen.tsx +22 -22
  133. package/src/cli/ui/components/screens/SessionSelectorScreen.tsx +8 -8
  134. package/src/cli/ui/components/screens/WorktreeManagerScreen.tsx +8 -8
  135. package/src/cli/ui/screens/BranchActionSelectorScreen.tsx +9 -4
  136. package/src/cli/ui/types.ts +8 -1
  137. package/src/config/builtin-tools.ts +42 -4
  138. package/src/config/index.ts +2 -12
  139. package/src/config/tools.ts +16 -6
  140. package/src/gemini.ts +202 -0
  141. package/src/git.ts +2 -1
  142. package/src/index.ts +30 -0
  143. package/src/qwen.ts +208 -0
  144. package/src/services/git.service.ts +2 -1
  145. package/src/web/client/src/components/BranchGraph.tsx +3 -2
  146. package/src/web/client/src/components/EnvEditor.tsx +44 -11
  147. package/src/web/client/src/pages/BranchDetailPage.tsx +165 -54
  148. package/src/web/client/src/pages/BranchListPage.tsx +37 -13
  149. package/src/web/client/src/pages/ConfigManagementPage.tsx +28 -9
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * @vitest-environment happy-dom
3
3
  */
4
- import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
5
- import { render as rtlRender, act } from '@testing-library/react';
6
- import React from 'react';
7
- import { BranchCreatorScreen } from '../../../components/screens/BranchCreatorScreen.js';
8
- import { Window } from 'happy-dom';
9
- import { render as inkRender } from 'ink-testing-library';
10
-
11
- describe('BranchCreatorScreen', () => {
4
+ import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
5
+ import { render as rtlRender, act } from "@testing-library/react";
6
+ import React from "react";
7
+ import { BranchCreatorScreen } from "../../../components/screens/BranchCreatorScreen.js";
8
+ import { Window } from "happy-dom";
9
+ import { render as inkRender } from "ink-testing-library";
10
+
11
+ describe("BranchCreatorScreen", () => {
12
12
  beforeEach(() => {
13
13
  vi.useFakeTimers();
14
14
  // Setup happy-dom
@@ -21,21 +21,29 @@ describe('BranchCreatorScreen', () => {
21
21
  vi.useRealTimers();
22
22
  });
23
23
 
24
- it('should render header with title', () => {
24
+ it("should render header with title", () => {
25
25
  const onBack = vi.fn();
26
26
  const onCreate = vi.fn().mockResolvedValue(undefined);
27
27
  const { getByText } = rtlRender(
28
- <BranchCreatorScreen onBack={onBack} onCreate={onCreate} disableAnimation />
28
+ <BranchCreatorScreen
29
+ onBack={onBack}
30
+ onCreate={onCreate}
31
+ disableAnimation
32
+ />,
29
33
  );
30
34
 
31
35
  expect(getByText(/New Branch/i)).toBeDefined();
32
36
  });
33
37
 
34
- it('should render branch type selection initially', () => {
38
+ it("should render branch type selection initially", () => {
35
39
  const onBack = vi.fn();
36
40
  const onCreate = vi.fn().mockResolvedValue(undefined);
37
41
  const { getByText } = rtlRender(
38
- <BranchCreatorScreen onBack={onBack} onCreate={onCreate} disableAnimation />
42
+ <BranchCreatorScreen
43
+ onBack={onBack}
44
+ onCreate={onCreate}
45
+ disableAnimation
46
+ />,
39
47
  );
40
48
 
41
49
  expect(getByText(/Select branch type/i)).toBeDefined();
@@ -45,47 +53,63 @@ describe('BranchCreatorScreen', () => {
45
53
  expect(getByText(/release/i)).toBeDefined();
46
54
  });
47
55
 
48
- it('should render footer with actions', () => {
56
+ it("should render footer with actions", () => {
49
57
  const onBack = vi.fn();
50
58
  const onCreate = vi.fn().mockResolvedValue(undefined);
51
59
  const { getAllByText } = rtlRender(
52
- <BranchCreatorScreen onBack={onBack} onCreate={onCreate} disableAnimation />
60
+ <BranchCreatorScreen
61
+ onBack={onBack}
62
+ onCreate={onCreate}
63
+ disableAnimation
64
+ />,
53
65
  );
54
66
 
55
67
  expect(getAllByText(/enter/i).length).toBeGreaterThan(0);
56
68
  expect(getAllByText(/esc/i).length).toBeGreaterThan(0);
57
69
  });
58
70
 
59
- it('should show branch name input after type selection', () => {
71
+ it("should show branch name input after type selection", () => {
60
72
  const onBack = vi.fn();
61
73
  const onCreate = vi.fn().mockResolvedValue(undefined);
62
74
  const { container } = rtlRender(
63
- <BranchCreatorScreen onBack={onBack} onCreate={onCreate} disableAnimation />
75
+ <BranchCreatorScreen
76
+ onBack={onBack}
77
+ onCreate={onCreate}
78
+ disableAnimation
79
+ />,
64
80
  );
65
81
 
66
82
  // Test will verify the screen transitions from type selection to name input
67
83
  expect(container).toBeDefined();
68
84
  });
69
85
 
70
- it('should handle branch creation', () => {
86
+ it("should handle branch creation", () => {
71
87
  const onBack = vi.fn();
72
88
  const onCreate = vi.fn().mockResolvedValue(undefined);
73
89
  const { container } = rtlRender(
74
- <BranchCreatorScreen onBack={onBack} onCreate={onCreate} disableAnimation />
90
+ <BranchCreatorScreen
91
+ onBack={onBack}
92
+ onCreate={onCreate}
93
+ disableAnimation
94
+ />,
75
95
  );
76
96
 
77
97
  // Test will verify onCreate is called with correct branch name
78
98
  expect(container).toBeDefined();
79
99
  });
80
100
 
81
- it('should use terminal height for layout calculation', () => {
101
+ it("should use terminal height for layout calculation", () => {
82
102
  const originalRows = process.stdout.rows;
83
103
  process.stdout.rows = 30;
84
104
 
85
105
  const onBack = vi.fn();
86
106
  const onCreate = vi.fn().mockResolvedValue(undefined);
87
107
  const { container } = rtlRender(
88
- <BranchCreatorScreen onBack={onBack} onCreate={onCreate} disableAnimation />
108
+ <BranchCreatorScreen
109
+ onBack={onBack}
110
+ onCreate={onCreate}
111
+ disableAnimation
112
+ />,
89
113
  );
90
114
 
91
115
  expect(container).toBeDefined();
@@ -93,18 +117,22 @@ describe('BranchCreatorScreen', () => {
93
117
  process.stdout.rows = originalRows;
94
118
  });
95
119
 
96
- it('should handle back navigation with ESC key', () => {
120
+ it("should handle back navigation with ESC key", () => {
97
121
  const onBack = vi.fn();
98
122
  const onCreate = vi.fn().mockResolvedValue(undefined);
99
123
  const { container } = rtlRender(
100
- <BranchCreatorScreen onBack={onBack} onCreate={onCreate} disableAnimation />
124
+ <BranchCreatorScreen
125
+ onBack={onBack}
126
+ onCreate={onCreate}
127
+ disableAnimation
128
+ />,
101
129
  );
102
130
 
103
131
  // Test will verify onBack is called when ESC is pressed
104
132
  expect(container).toBeDefined();
105
133
  });
106
134
 
107
- it('should display creating state while waiting for branch creation', async () => {
135
+ it("should display creating state while waiting for branch creation", async () => {
108
136
  expect.assertions(3);
109
137
  const onBack = vi.fn();
110
138
  let resolveCreate: (() => void) | null = null;
@@ -112,21 +140,25 @@ describe('BranchCreatorScreen', () => {
112
140
  () =>
113
141
  new Promise<void>((resolve) => {
114
142
  resolveCreate = resolve;
115
- })
143
+ }),
116
144
  );
117
145
  const { stdin, lastFrame } = inkRender(
118
- <BranchCreatorScreen onBack={onBack} onCreate={onCreate} disableAnimation />
146
+ <BranchCreatorScreen
147
+ onBack={onBack}
148
+ onCreate={onCreate}
149
+ disableAnimation
150
+ />,
119
151
  );
120
152
 
121
153
  // Select default branch type (feature)
122
154
  await act(async () => {
123
- stdin.write('\r');
155
+ stdin.write("\r");
124
156
  });
125
157
  await act(async () => {
126
158
  await Promise.resolve();
127
159
  });
128
160
 
129
- const branchName = 'new-branch';
161
+ const branchName = "new-branch";
130
162
  for (const char of branchName) {
131
163
  await act(async () => {
132
164
  stdin.write(char);
@@ -138,14 +170,14 @@ describe('BranchCreatorScreen', () => {
138
170
 
139
171
  // Submit branch name
140
172
  await act(async () => {
141
- stdin.write('\r');
173
+ stdin.write("\r");
142
174
  });
143
175
  await act(async () => {
144
176
  await Promise.resolve();
145
177
  });
146
178
 
147
179
  expect(onCreate).toHaveBeenCalledWith(`feature/${branchName}`);
148
- expect(lastFrame()).toContain('Creating branch');
180
+ expect(lastFrame()).toContain("Creating branch");
149
181
  expect(lastFrame()).toContain(`feature/${branchName}`);
150
182
 
151
183
  await act(async () => {
@@ -156,7 +188,7 @@ describe('BranchCreatorScreen', () => {
156
188
  });
157
189
  });
158
190
 
159
- it('should ignore ESC input while branch creation is in progress', async () => {
191
+ it("should ignore ESC input while branch creation is in progress", async () => {
160
192
  expect.assertions(2);
161
193
  const onBack = vi.fn();
162
194
  let resolveCreate: (() => void) | null = null;
@@ -164,21 +196,25 @@ describe('BranchCreatorScreen', () => {
164
196
  () =>
165
197
  new Promise<void>((resolve) => {
166
198
  resolveCreate = resolve;
167
- })
199
+ }),
168
200
  );
169
201
  const { stdin, lastFrame } = inkRender(
170
- <BranchCreatorScreen onBack={onBack} onCreate={onCreate} disableAnimation />
202
+ <BranchCreatorScreen
203
+ onBack={onBack}
204
+ onCreate={onCreate}
205
+ disableAnimation
206
+ />,
171
207
  );
172
208
 
173
209
  // Move to name input
174
210
  await act(async () => {
175
- stdin.write('\r');
211
+ stdin.write("\r");
176
212
  });
177
213
  await act(async () => {
178
214
  await Promise.resolve();
179
215
  });
180
216
 
181
- const branchName = 'blocking-branch';
217
+ const branchName = "blocking-branch";
182
218
  for (const char of branchName) {
183
219
  await act(async () => {
184
220
  stdin.write(char);
@@ -189,7 +225,7 @@ describe('BranchCreatorScreen', () => {
189
225
  });
190
226
 
191
227
  await act(async () => {
192
- stdin.write('\r');
228
+ stdin.write("\r");
193
229
  });
194
230
  await act(async () => {
195
231
  await Promise.resolve();
@@ -197,14 +233,14 @@ describe('BranchCreatorScreen', () => {
197
233
 
198
234
  // Attempt to cancel with ESC during creation
199
235
  await act(async () => {
200
- stdin.write('\u001B');
236
+ stdin.write("\u001B");
201
237
  });
202
238
  await act(async () => {
203
239
  await Promise.resolve();
204
240
  });
205
241
 
206
242
  expect(onBack).not.toHaveBeenCalled();
207
- expect(lastFrame()).toContain('Creating branch');
243
+ expect(lastFrame()).toContain("Creating branch");
208
244
 
209
245
  await act(async () => {
210
246
  resolveCreate?.();