@akiojin/gwt 4.12.1 → 6.0.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 (860) hide show
  1. package/README.ja.md +173 -203
  2. package/README.md +170 -212
  3. package/bin/gwt +0 -0
  4. package/bin/gwt.js +42 -33
  5. package/package.json +20 -107
  6. package/scripts/postinstall.js +152 -0
  7. package/dist/claude-history.d.ts +0 -60
  8. package/dist/claude-history.d.ts.map +0 -1
  9. package/dist/claude-history.js +0 -606
  10. package/dist/claude-history.js.map +0 -1
  11. package/dist/claude.d.ts +0 -42
  12. package/dist/claude.d.ts.map +0 -1
  13. package/dist/claude.js +0 -429
  14. package/dist/claude.js.map +0 -1
  15. package/dist/cli/ui/App.solid.d.ts +0 -29
  16. package/dist/cli/ui/App.solid.d.ts.map +0 -1
  17. package/dist/cli/ui/App.solid.js +0 -1427
  18. package/dist/cli/ui/App.solid.js.map +0 -1
  19. package/dist/cli/ui/components/solid/Footer.d.ts +0 -10
  20. package/dist/cli/ui/components/solid/Footer.d.ts.map +0 -1
  21. package/dist/cli/ui/components/solid/Footer.js +0 -10
  22. package/dist/cli/ui/components/solid/Footer.js.map +0 -1
  23. package/dist/cli/ui/components/solid/Header.d.ts +0 -32
  24. package/dist/cli/ui/components/solid/Header.d.ts.map +0 -1
  25. package/dist/cli/ui/components/solid/Header.js +0 -13
  26. package/dist/cli/ui/components/solid/Header.js.map +0 -1
  27. package/dist/cli/ui/components/solid/HelpOverlay.d.ts +0 -8
  28. package/dist/cli/ui/components/solid/HelpOverlay.d.ts.map +0 -1
  29. package/dist/cli/ui/components/solid/HelpOverlay.js +0 -118
  30. package/dist/cli/ui/components/solid/HelpOverlay.js.map +0 -1
  31. package/dist/cli/ui/components/solid/QuickStartStep.d.ts +0 -17
  32. package/dist/cli/ui/components/solid/QuickStartStep.d.ts.map +0 -1
  33. package/dist/cli/ui/components/solid/QuickStartStep.js +0 -152
  34. package/dist/cli/ui/components/solid/QuickStartStep.js.map +0 -1
  35. package/dist/cli/ui/components/solid/SelectInput.d.ts +0 -22
  36. package/dist/cli/ui/components/solid/SelectInput.d.ts.map +0 -1
  37. package/dist/cli/ui/components/solid/SelectInput.js +0 -45
  38. package/dist/cli/ui/components/solid/SelectInput.js.map +0 -1
  39. package/dist/cli/ui/components/solid/TextInput.d.ts +0 -12
  40. package/dist/cli/ui/components/solid/TextInput.d.ts.map +0 -1
  41. package/dist/cli/ui/components/solid/TextInput.js +0 -9
  42. package/dist/cli/ui/components/solid/TextInput.js.map +0 -1
  43. package/dist/cli/ui/components/solid/WizardController.d.ts +0 -34
  44. package/dist/cli/ui/components/solid/WizardController.d.ts.map +0 -1
  45. package/dist/cli/ui/components/solid/WizardController.js +0 -269
  46. package/dist/cli/ui/components/solid/WizardController.js.map +0 -1
  47. package/dist/cli/ui/components/solid/WizardPopup.d.ts +0 -26
  48. package/dist/cli/ui/components/solid/WizardPopup.d.ts.map +0 -1
  49. package/dist/cli/ui/components/solid/WizardPopup.js +0 -68
  50. package/dist/cli/ui/components/solid/WizardPopup.js.map +0 -1
  51. package/dist/cli/ui/components/solid/WizardSteps.d.ts +0 -57
  52. package/dist/cli/ui/components/solid/WizardSteps.d.ts.map +0 -1
  53. package/dist/cli/ui/components/solid/WizardSteps.js +0 -442
  54. package/dist/cli/ui/components/solid/WizardSteps.js.map +0 -1
  55. package/dist/cli/ui/core/index.d.ts +0 -12
  56. package/dist/cli/ui/core/index.d.ts.map +0 -1
  57. package/dist/cli/ui/core/index.js +0 -15
  58. package/dist/cli/ui/core/index.js.map +0 -1
  59. package/dist/cli/ui/core/keybindings.d.ts +0 -106
  60. package/dist/cli/ui/core/keybindings.d.ts.map +0 -1
  61. package/dist/cli/ui/core/keybindings.js +0 -270
  62. package/dist/cli/ui/core/keybindings.js.map +0 -1
  63. package/dist/cli/ui/core/theme.d.ts +0 -123
  64. package/dist/cli/ui/core/theme.d.ts.map +0 -1
  65. package/dist/cli/ui/core/theme.js +0 -191
  66. package/dist/cli/ui/core/theme.js.map +0 -1
  67. package/dist/cli/ui/core/types.d.ts +0 -156
  68. package/dist/cli/ui/core/types.d.ts.map +0 -1
  69. package/dist/cli/ui/core/types.js +0 -10
  70. package/dist/cli/ui/core/types.js.map +0 -1
  71. package/dist/cli/ui/hooks/solid/useScrollableList.d.ts +0 -26
  72. package/dist/cli/ui/hooks/solid/useScrollableList.d.ts.map +0 -1
  73. package/dist/cli/ui/hooks/solid/useScrollableList.js +0 -89
  74. package/dist/cli/ui/hooks/solid/useScrollableList.js.map +0 -1
  75. package/dist/cli/ui/hooks/solid/useTerminalSize.d.ts +0 -10
  76. package/dist/cli/ui/hooks/solid/useTerminalSize.d.ts.map +0 -1
  77. package/dist/cli/ui/hooks/solid/useTerminalSize.js +0 -16
  78. package/dist/cli/ui/hooks/solid/useTerminalSize.js.map +0 -1
  79. package/dist/cli/ui/index.solid.d.ts +0 -5
  80. package/dist/cli/ui/index.solid.d.ts.map +0 -1
  81. package/dist/cli/ui/index.solid.js +0 -21
  82. package/dist/cli/ui/index.solid.js.map +0 -1
  83. package/dist/cli/ui/screens/solid/BranchListScreen.d.ts +0 -53
  84. package/dist/cli/ui/screens/solid/BranchListScreen.d.ts.map +0 -1
  85. package/dist/cli/ui/screens/solid/BranchListScreen.js +0 -829
  86. package/dist/cli/ui/screens/solid/BranchListScreen.js.map +0 -1
  87. package/dist/cli/ui/screens/solid/ConfirmScreen.d.ts +0 -11
  88. package/dist/cli/ui/screens/solid/ConfirmScreen.d.ts.map +0 -1
  89. package/dist/cli/ui/screens/solid/ConfirmScreen.js +0 -45
  90. package/dist/cli/ui/screens/solid/ConfirmScreen.js.map +0 -1
  91. package/dist/cli/ui/screens/solid/EnvironmentScreen.d.ts +0 -14
  92. package/dist/cli/ui/screens/solid/EnvironmentScreen.d.ts.map +0 -1
  93. package/dist/cli/ui/screens/solid/EnvironmentScreen.js +0 -90
  94. package/dist/cli/ui/screens/solid/EnvironmentScreen.js.map +0 -1
  95. package/dist/cli/ui/screens/solid/ErrorScreen.d.ts +0 -8
  96. package/dist/cli/ui/screens/solid/ErrorScreen.d.ts.map +0 -1
  97. package/dist/cli/ui/screens/solid/ErrorScreen.js +0 -18
  98. package/dist/cli/ui/screens/solid/ErrorScreen.js.map +0 -1
  99. package/dist/cli/ui/screens/solid/InputScreen.d.ts +0 -13
  100. package/dist/cli/ui/screens/solid/InputScreen.d.ts.map +0 -1
  101. package/dist/cli/ui/screens/solid/InputScreen.js +0 -17
  102. package/dist/cli/ui/screens/solid/InputScreen.js.map +0 -1
  103. package/dist/cli/ui/screens/solid/LoadingIndicator.d.ts +0 -9
  104. package/dist/cli/ui/screens/solid/LoadingIndicator.d.ts.map +0 -1
  105. package/dist/cli/ui/screens/solid/LoadingIndicator.js +0 -43
  106. package/dist/cli/ui/screens/solid/LoadingIndicator.js.map +0 -1
  107. package/dist/cli/ui/screens/solid/LogDetailScreen.d.ts +0 -14
  108. package/dist/cli/ui/screens/solid/LogDetailScreen.d.ts.map +0 -1
  109. package/dist/cli/ui/screens/solid/LogDetailScreen.js +0 -34
  110. package/dist/cli/ui/screens/solid/LogDetailScreen.js.map +0 -1
  111. package/dist/cli/ui/screens/solid/LogScreen.d.ts +0 -25
  112. package/dist/cli/ui/screens/solid/LogScreen.d.ts.map +0 -1
  113. package/dist/cli/ui/screens/solid/LogScreen.js +0 -333
  114. package/dist/cli/ui/screens/solid/LogScreen.js.map +0 -1
  115. package/dist/cli/ui/screens/solid/ProfileEnvScreen.d.ts +0 -17
  116. package/dist/cli/ui/screens/solid/ProfileEnvScreen.d.ts.map +0 -1
  117. package/dist/cli/ui/screens/solid/ProfileEnvScreen.js +0 -115
  118. package/dist/cli/ui/screens/solid/ProfileEnvScreen.js.map +0 -1
  119. package/dist/cli/ui/screens/solid/ProfileScreen.d.ts +0 -17
  120. package/dist/cli/ui/screens/solid/ProfileScreen.d.ts.map +0 -1
  121. package/dist/cli/ui/screens/solid/ProfileScreen.js +0 -50
  122. package/dist/cli/ui/screens/solid/ProfileScreen.js.map +0 -1
  123. package/dist/cli/ui/screens/solid/SelectorScreen.d.ts +0 -20
  124. package/dist/cli/ui/screens/solid/SelectorScreen.d.ts.map +0 -1
  125. package/dist/cli/ui/screens/solid/SelectorScreen.js +0 -98
  126. package/dist/cli/ui/screens/solid/SelectorScreen.js.map +0 -1
  127. package/dist/cli/ui/screens/solid/WorktreeCreateScreen.d.ts +0 -13
  128. package/dist/cli/ui/screens/solid/WorktreeCreateScreen.d.ts.map +0 -1
  129. package/dist/cli/ui/screens/solid/WorktreeCreateScreen.js +0 -59
  130. package/dist/cli/ui/screens/solid/WorktreeCreateScreen.js.map +0 -1
  131. package/dist/cli/ui/stores/appStore.d.ts +0 -143
  132. package/dist/cli/ui/stores/appStore.d.ts.map +0 -1
  133. package/dist/cli/ui/stores/appStore.js +0 -158
  134. package/dist/cli/ui/stores/appStore.js.map +0 -1
  135. package/dist/cli/ui/stores/branchStore.d.ts +0 -159
  136. package/dist/cli/ui/stores/branchStore.d.ts.map +0 -1
  137. package/dist/cli/ui/stores/branchStore.js +0 -275
  138. package/dist/cli/ui/stores/branchStore.js.map +0 -1
  139. package/dist/cli/ui/stores/index.d.ts +0 -11
  140. package/dist/cli/ui/stores/index.d.ts.map +0 -1
  141. package/dist/cli/ui/stores/index.js +0 -14
  142. package/dist/cli/ui/stores/index.js.map +0 -1
  143. package/dist/cli/ui/stores/uiStore.d.ts +0 -146
  144. package/dist/cli/ui/stores/uiStore.d.ts.map +0 -1
  145. package/dist/cli/ui/stores/uiStore.js +0 -166
  146. package/dist/cli/ui/stores/uiStore.js.map +0 -1
  147. package/dist/cli/ui/types.d.ts +0 -293
  148. package/dist/cli/ui/types.d.ts.map +0 -1
  149. package/dist/cli/ui/types.js +0 -2
  150. package/dist/cli/ui/types.js.map +0 -1
  151. package/dist/cli/ui/utils/baseBranch.d.ts +0 -4
  152. package/dist/cli/ui/utils/baseBranch.d.ts.map +0 -1
  153. package/dist/cli/ui/utils/baseBranch.js +0 -17
  154. package/dist/cli/ui/utils/baseBranch.js.map +0 -1
  155. package/dist/cli/ui/utils/branchFormatter.d.ts +0 -19
  156. package/dist/cli/ui/utils/branchFormatter.d.ts.map +0 -1
  157. package/dist/cli/ui/utils/branchFormatter.js +0 -199
  158. package/dist/cli/ui/utils/branchFormatter.js.map +0 -1
  159. package/dist/cli/ui/utils/clipboard.d.ts +0 -7
  160. package/dist/cli/ui/utils/clipboard.d.ts.map +0 -1
  161. package/dist/cli/ui/utils/clipboard.js +0 -21
  162. package/dist/cli/ui/utils/clipboard.js.map +0 -1
  163. package/dist/cli/ui/utils/continueSession.d.ts +0 -36
  164. package/dist/cli/ui/utils/continueSession.d.ts.map +0 -1
  165. package/dist/cli/ui/utils/continueSession.js +0 -155
  166. package/dist/cli/ui/utils/continueSession.js.map +0 -1
  167. package/dist/cli/ui/utils/installedVersionCache.d.ts +0 -33
  168. package/dist/cli/ui/utils/installedVersionCache.d.ts.map +0 -1
  169. package/dist/cli/ui/utils/installedVersionCache.js +0 -59
  170. package/dist/cli/ui/utils/installedVersionCache.js.map +0 -1
  171. package/dist/cli/ui/utils/modelOptions.d.ts +0 -10
  172. package/dist/cli/ui/utils/modelOptions.d.ts.map +0 -1
  173. package/dist/cli/ui/utils/modelOptions.js +0 -155
  174. package/dist/cli/ui/utils/modelOptions.js.map +0 -1
  175. package/dist/cli/ui/utils/statisticsCalculator.d.ts +0 -9
  176. package/dist/cli/ui/utils/statisticsCalculator.d.ts.map +0 -1
  177. package/dist/cli/ui/utils/statisticsCalculator.js +0 -37
  178. package/dist/cli/ui/utils/statisticsCalculator.js.map +0 -1
  179. package/dist/cli/ui/utils/versionCache.d.ts +0 -37
  180. package/dist/cli/ui/utils/versionCache.d.ts.map +0 -1
  181. package/dist/cli/ui/utils/versionCache.js +0 -70
  182. package/dist/cli/ui/utils/versionCache.js.map +0 -1
  183. package/dist/cli/ui/utils/versionFetcher.d.ts +0 -41
  184. package/dist/cli/ui/utils/versionFetcher.d.ts.map +0 -1
  185. package/dist/cli/ui/utils/versionFetcher.js +0 -89
  186. package/dist/cli/ui/utils/versionFetcher.js.map +0 -1
  187. package/dist/client/assets/index-BbfV7Wuj.css +0 -1
  188. package/dist/client/assets/index-CoAyq5x1.js +0 -78
  189. package/dist/client/index.html +0 -13
  190. package/dist/codex.d.ts +0 -55
  191. package/dist/codex.d.ts.map +0 -1
  192. package/dist/codex.js +0 -329
  193. package/dist/codex.js.map +0 -1
  194. package/dist/config/builtin-coding-agents.d.ts +0 -27
  195. package/dist/config/builtin-coding-agents.d.ts.map +0 -1
  196. package/dist/config/builtin-coding-agents.js +0 -78
  197. package/dist/config/builtin-coding-agents.js.map +0 -1
  198. package/dist/config/constants.d.ts +0 -76
  199. package/dist/config/constants.d.ts.map +0 -1
  200. package/dist/config/constants.js +0 -92
  201. package/dist/config/constants.js.map +0 -1
  202. package/dist/config/env-history.d.ts +0 -4
  203. package/dist/config/env-history.d.ts.map +0 -1
  204. package/dist/config/env-history.js +0 -34
  205. package/dist/config/env-history.js.map +0 -1
  206. package/dist/config/index.d.ts +0 -51
  207. package/dist/config/index.d.ts.map +0 -1
  208. package/dist/config/index.js +0 -225
  209. package/dist/config/index.js.map +0 -1
  210. package/dist/config/profiles.d.ts +0 -94
  211. package/dist/config/profiles.d.ts.map +0 -1
  212. package/dist/config/profiles.js +0 -284
  213. package/dist/config/profiles.js.map +0 -1
  214. package/dist/config/shared-env.d.ts +0 -41
  215. package/dist/config/shared-env.d.ts.map +0 -1
  216. package/dist/config/shared-env.js +0 -114
  217. package/dist/config/shared-env.js.map +0 -1
  218. package/dist/config/tools.d.ts +0 -50
  219. package/dist/config/tools.d.ts.map +0 -1
  220. package/dist/config/tools.js +0 -239
  221. package/dist/config/tools.js.map +0 -1
  222. package/dist/gemini.d.ts +0 -35
  223. package/dist/gemini.d.ts.map +0 -1
  224. package/dist/gemini.js +0 -299
  225. package/dist/gemini.js.map +0 -1
  226. package/dist/git.d.ts +0 -154
  227. package/dist/git.d.ts.map +0 -1
  228. package/dist/git.js +0 -1012
  229. package/dist/git.js.map +0 -1
  230. package/dist/github.d.ts +0 -14
  231. package/dist/github.d.ts.map +0 -1
  232. package/dist/github.js +0 -123
  233. package/dist/github.js.map +0 -1
  234. package/dist/index.d.ts +0 -16
  235. package/dist/index.d.ts.map +0 -1
  236. package/dist/index.js +0 -782
  237. package/dist/index.js.map +0 -1
  238. package/dist/launcher.d.ts +0 -30
  239. package/dist/launcher.d.ts.map +0 -1
  240. package/dist/launcher.js +0 -185
  241. package/dist/launcher.js.map +0 -1
  242. package/dist/logging/agentOutput.d.ts +0 -21
  243. package/dist/logging/agentOutput.d.ts.map +0 -1
  244. package/dist/logging/agentOutput.js +0 -164
  245. package/dist/logging/agentOutput.js.map +0 -1
  246. package/dist/logging/formatter.d.ts +0 -15
  247. package/dist/logging/formatter.d.ts.map +0 -1
  248. package/dist/logging/formatter.js +0 -95
  249. package/dist/logging/formatter.js.map +0 -1
  250. package/dist/logging/logger.d.ts +0 -24
  251. package/dist/logging/logger.d.ts.map +0 -1
  252. package/dist/logging/logger.js +0 -79
  253. package/dist/logging/logger.js.map +0 -1
  254. package/dist/logging/reader.d.ts +0 -34
  255. package/dist/logging/reader.d.ts.map +0 -1
  256. package/dist/logging/reader.js +0 -178
  257. package/dist/logging/reader.js.map +0 -1
  258. package/dist/logging/rotation.d.ts +0 -6
  259. package/dist/logging/rotation.d.ts.map +0 -1
  260. package/dist/logging/rotation.js +0 -26
  261. package/dist/logging/rotation.js.map +0 -1
  262. package/dist/opentui/highlights-eq9cgrbb.scm +0 -604
  263. package/dist/opentui/highlights-ghv9g403.scm +0 -205
  264. package/dist/opentui/highlights-hk7bwhj4.scm +0 -284
  265. package/dist/opentui/highlights-r812a2qc.scm +0 -150
  266. package/dist/opentui/highlights-x6tmsnaa.scm +0 -115
  267. package/dist/opentui/index.solid.d.ts +0 -2
  268. package/dist/opentui/index.solid.d.ts.map +0 -1
  269. package/dist/opentui/index.solid.js +0 -53721
  270. package/dist/opentui/index.solid.js.map +0 -1
  271. package/dist/opentui/injections-73j83es3.scm +0 -27
  272. package/dist/opentui/tree-sitter-javascript-nd0q4pe9.wasm +0 -0
  273. package/dist/opentui/tree-sitter-markdown-411r6y9b.wasm +0 -0
  274. package/dist/opentui/tree-sitter-markdown_inline-j5349f42.wasm +0 -0
  275. package/dist/opentui/tree-sitter-typescript-zxjzwt75.wasm +0 -0
  276. package/dist/opentui/tree-sitter-zig-e78zbjpm.wasm +0 -0
  277. package/dist/repositories/git.repository.d.ts +0 -38
  278. package/dist/repositories/git.repository.d.ts.map +0 -1
  279. package/dist/repositories/git.repository.js +0 -117
  280. package/dist/repositories/git.repository.js.map +0 -1
  281. package/dist/repositories/github.repository.d.ts +0 -16
  282. package/dist/repositories/github.repository.d.ts.map +0 -1
  283. package/dist/repositories/github.repository.js +0 -61
  284. package/dist/repositories/github.repository.js.map +0 -1
  285. package/dist/repositories/worktree.repository.d.ts +0 -19
  286. package/dist/repositories/worktree.repository.d.ts.map +0 -1
  287. package/dist/repositories/worktree.repository.js +0 -64
  288. package/dist/repositories/worktree.repository.js.map +0 -1
  289. package/dist/services/BatchMergeService.d.ts +0 -45
  290. package/dist/services/BatchMergeService.d.ts.map +0 -1
  291. package/dist/services/BatchMergeService.js +0 -197
  292. package/dist/services/BatchMergeService.js.map +0 -1
  293. package/dist/services/WorktreeOrchestrator.d.ts +0 -37
  294. package/dist/services/WorktreeOrchestrator.d.ts.map +0 -1
  295. package/dist/services/WorktreeOrchestrator.js +0 -74
  296. package/dist/services/WorktreeOrchestrator.js.map +0 -1
  297. package/dist/services/codingAgentCommandResolver.d.ts +0 -10
  298. package/dist/services/codingAgentCommandResolver.d.ts.map +0 -1
  299. package/dist/services/codingAgentCommandResolver.js +0 -81
  300. package/dist/services/codingAgentCommandResolver.js.map +0 -1
  301. package/dist/services/codingAgentResolver.d.ts +0 -43
  302. package/dist/services/codingAgentResolver.d.ts.map +0 -1
  303. package/dist/services/codingAgentResolver.js +0 -269
  304. package/dist/services/codingAgentResolver.js.map +0 -1
  305. package/dist/services/dependency-installer.d.ts +0 -26
  306. package/dist/services/dependency-installer.d.ts.map +0 -1
  307. package/dist/services/dependency-installer.js +0 -134
  308. package/dist/services/dependency-installer.js.map +0 -1
  309. package/dist/services/git.service.d.ts +0 -27
  310. package/dist/services/git.service.d.ts.map +0 -1
  311. package/dist/services/git.service.js +0 -97
  312. package/dist/services/git.service.js.map +0 -1
  313. package/dist/services/github.service.d.ts +0 -14
  314. package/dist/services/github.service.d.ts.map +0 -1
  315. package/dist/services/github.service.js +0 -52
  316. package/dist/services/github.service.js.map +0 -1
  317. package/dist/services/worktree.service.d.ts +0 -20
  318. package/dist/services/worktree.service.d.ts.map +0 -1
  319. package/dist/services/worktree.service.js +0 -52
  320. package/dist/services/worktree.service.js.map +0 -1
  321. package/dist/shared/codingAgentConstants.d.ts +0 -12
  322. package/dist/shared/codingAgentConstants.d.ts.map +0 -1
  323. package/dist/shared/codingAgentConstants.js +0 -95
  324. package/dist/shared/codingAgentConstants.js.map +0 -1
  325. package/dist/types/api.d.ts +0 -225
  326. package/dist/types/api.d.ts.map +0 -1
  327. package/dist/types/api.js +0 -8
  328. package/dist/types/api.js.map +0 -1
  329. package/dist/types/coding-agent.d.ts +0 -62
  330. package/dist/types/coding-agent.d.ts.map +0 -1
  331. package/dist/types/coding-agent.js +0 -29
  332. package/dist/types/coding-agent.js.map +0 -1
  333. package/dist/types/profiles.d.ts +0 -54
  334. package/dist/types/profiles.d.ts.map +0 -1
  335. package/dist/types/profiles.js +0 -33
  336. package/dist/types/profiles.js.map +0 -1
  337. package/dist/types/tools.d.ts +0 -230
  338. package/dist/types/tools.d.ts.map +0 -1
  339. package/dist/types/tools.js +0 -8
  340. package/dist/types/tools.js.map +0 -1
  341. package/dist/utils/bun-runtime.d.ts +0 -12
  342. package/dist/utils/bun-runtime.d.ts.map +0 -1
  343. package/dist/utils/bun-runtime.js +0 -13
  344. package/dist/utils/bun-runtime.js.map +0 -1
  345. package/dist/utils/coding-agent-colors.d.ts +0 -88
  346. package/dist/utils/coding-agent-colors.d.ts.map +0 -1
  347. package/dist/utils/coding-agent-colors.js +0 -137
  348. package/dist/utils/coding-agent-colors.js.map +0 -1
  349. package/dist/utils/command.d.ts +0 -62
  350. package/dist/utils/command.d.ts.map +0 -1
  351. package/dist/utils/command.js +0 -186
  352. package/dist/utils/command.js.map +0 -1
  353. package/dist/utils/error-utils.d.ts +0 -27
  354. package/dist/utils/error-utils.d.ts.map +0 -1
  355. package/dist/utils/error-utils.js +0 -98
  356. package/dist/utils/error-utils.js.map +0 -1
  357. package/dist/utils/npmRegistry.d.ts +0 -61
  358. package/dist/utils/npmRegistry.d.ts.map +0 -1
  359. package/dist/utils/npmRegistry.js +0 -180
  360. package/dist/utils/npmRegistry.js.map +0 -1
  361. package/dist/utils/prompt.d.ts +0 -18
  362. package/dist/utils/prompt.d.ts.map +0 -1
  363. package/dist/utils/prompt.js +0 -107
  364. package/dist/utils/prompt.js.map +0 -1
  365. package/dist/utils/session/common.d.ts +0 -108
  366. package/dist/utils/session/common.d.ts.map +0 -1
  367. package/dist/utils/session/common.js +0 -439
  368. package/dist/utils/session/common.js.map +0 -1
  369. package/dist/utils/session/index.d.ts +0 -16
  370. package/dist/utils/session/index.d.ts.map +0 -1
  371. package/dist/utils/session/index.js +0 -20
  372. package/dist/utils/session/index.js.map +0 -1
  373. package/dist/utils/session/parsers/claude.d.ts +0 -62
  374. package/dist/utils/session/parsers/claude.d.ts.map +0 -1
  375. package/dist/utils/session/parsers/claude.js +0 -224
  376. package/dist/utils/session/parsers/claude.js.map +0 -1
  377. package/dist/utils/session/parsers/codex.d.ts +0 -37
  378. package/dist/utils/session/parsers/codex.d.ts.map +0 -1
  379. package/dist/utils/session/parsers/codex.js +0 -139
  380. package/dist/utils/session/parsers/codex.js.map +0 -1
  381. package/dist/utils/session/parsers/gemini.d.ts +0 -22
  382. package/dist/utils/session/parsers/gemini.d.ts.map +0 -1
  383. package/dist/utils/session/parsers/gemini.js +0 -118
  384. package/dist/utils/session/parsers/gemini.js.map +0 -1
  385. package/dist/utils/session/parsers/index.d.ts +0 -8
  386. package/dist/utils/session/parsers/index.d.ts.map +0 -1
  387. package/dist/utils/session/parsers/index.js +0 -12
  388. package/dist/utils/session/parsers/index.js.map +0 -1
  389. package/dist/utils/session/parsers/opencode.d.ts +0 -23
  390. package/dist/utils/session/parsers/opencode.d.ts.map +0 -1
  391. package/dist/utils/session/parsers/opencode.js +0 -126
  392. package/dist/utils/session/parsers/opencode.js.map +0 -1
  393. package/dist/utils/session/types.d.ts +0 -49
  394. package/dist/utils/session/types.d.ts.map +0 -1
  395. package/dist/utils/session/types.js +0 -5
  396. package/dist/utils/session/types.js.map +0 -1
  397. package/dist/utils/session.d.ts +0 -16
  398. package/dist/utils/session.d.ts.map +0 -1
  399. package/dist/utils/session.js +0 -16
  400. package/dist/utils/session.js.map +0 -1
  401. package/dist/utils/spinner.d.ts +0 -6
  402. package/dist/utils/spinner.d.ts.map +0 -1
  403. package/dist/utils/spinner.js +0 -47
  404. package/dist/utils/spinner.js.map +0 -1
  405. package/dist/utils/terminal.d.ts +0 -64
  406. package/dist/utils/terminal.d.ts.map +0 -1
  407. package/dist/utils/terminal.js +0 -270
  408. package/dist/utils/terminal.js.map +0 -1
  409. package/dist/utils/webui.d.ts +0 -8
  410. package/dist/utils/webui.d.ts.map +0 -1
  411. package/dist/utils/webui.js +0 -35
  412. package/dist/utils/webui.js.map +0 -1
  413. package/dist/utils.d.ts +0 -18
  414. package/dist/utils.d.ts.map +0 -1
  415. package/dist/utils.js +0 -79
  416. package/dist/utils.js.map +0 -1
  417. package/dist/web/client/src/components/BranchGraph.d.ts +0 -13
  418. package/dist/web/client/src/components/BranchGraph.d.ts.map +0 -1
  419. package/dist/web/client/src/components/BranchGraph.js +0 -49
  420. package/dist/web/client/src/components/BranchGraph.js.map +0 -1
  421. package/dist/web/client/src/components/CodingAgentLaunchModal.d.ts +0 -9
  422. package/dist/web/client/src/components/CodingAgentLaunchModal.d.ts.map +0 -1
  423. package/dist/web/client/src/components/CodingAgentLaunchModal.js +0 -354
  424. package/dist/web/client/src/components/CodingAgentLaunchModal.js.map +0 -1
  425. package/dist/web/client/src/components/CustomCodingAgentForm.d.ts +0 -23
  426. package/dist/web/client/src/components/CustomCodingAgentForm.d.ts.map +0 -1
  427. package/dist/web/client/src/components/CustomCodingAgentForm.js +0 -209
  428. package/dist/web/client/src/components/CustomCodingAgentForm.js.map +0 -1
  429. package/dist/web/client/src/components/CustomCodingAgentList.d.ts +0 -10
  430. package/dist/web/client/src/components/CustomCodingAgentList.d.ts.map +0 -1
  431. package/dist/web/client/src/components/CustomCodingAgentList.js +0 -57
  432. package/dist/web/client/src/components/CustomCodingAgentList.js.map +0 -1
  433. package/dist/web/client/src/components/EnvEditor.d.ts +0 -20
  434. package/dist/web/client/src/components/EnvEditor.d.ts.map +0 -1
  435. package/dist/web/client/src/components/EnvEditor.js +0 -75
  436. package/dist/web/client/src/components/EnvEditor.js.map +0 -1
  437. package/dist/web/client/src/components/EnvironmentEditor.d.ts +0 -17
  438. package/dist/web/client/src/components/EnvironmentEditor.d.ts.map +0 -1
  439. package/dist/web/client/src/components/EnvironmentEditor.js +0 -22
  440. package/dist/web/client/src/components/EnvironmentEditor.js.map +0 -1
  441. package/dist/web/client/src/components/Terminal.d.ts +0 -15
  442. package/dist/web/client/src/components/Terminal.d.ts.map +0 -1
  443. package/dist/web/client/src/components/Terminal.js +0 -119
  444. package/dist/web/client/src/components/Terminal.js.map +0 -1
  445. package/dist/web/client/src/components/branch-detail/BranchInfoCards.d.ts +0 -10
  446. package/dist/web/client/src/components/branch-detail/BranchInfoCards.d.ts.map +0 -1
  447. package/dist/web/client/src/components/branch-detail/BranchInfoCards.js +0 -107
  448. package/dist/web/client/src/components/branch-detail/BranchInfoCards.js.map +0 -1
  449. package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts +0 -22
  450. package/dist/web/client/src/components/branch-detail/SessionHistoryTable.d.ts.map +0 -1
  451. package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js +0 -80
  452. package/dist/web/client/src/components/branch-detail/SessionHistoryTable.js.map +0 -1
  453. package/dist/web/client/src/components/branch-detail/TerminalPanel.d.ts +0 -11
  454. package/dist/web/client/src/components/branch-detail/TerminalPanel.d.ts.map +0 -1
  455. package/dist/web/client/src/components/branch-detail/TerminalPanel.js +0 -32
  456. package/dist/web/client/src/components/branch-detail/TerminalPanel.js.map +0 -1
  457. package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts +0 -40
  458. package/dist/web/client/src/components/branch-detail/ToolLauncher.d.ts.map +0 -1
  459. package/dist/web/client/src/components/branch-detail/ToolLauncher.js +0 -147
  460. package/dist/web/client/src/components/branch-detail/ToolLauncher.js.map +0 -1
  461. package/dist/web/client/src/components/branch-detail/index.d.ts +0 -5
  462. package/dist/web/client/src/components/branch-detail/index.d.ts.map +0 -1
  463. package/dist/web/client/src/components/branch-detail/index.js +0 -5
  464. package/dist/web/client/src/components/branch-detail/index.js.map +0 -1
  465. package/dist/web/client/src/components/common/BranchCard.d.ts +0 -17
  466. package/dist/web/client/src/components/common/BranchCard.d.ts.map +0 -1
  467. package/dist/web/client/src/components/common/BranchCard.js +0 -36
  468. package/dist/web/client/src/components/common/BranchCard.js.map +0 -1
  469. package/dist/web/client/src/components/common/MetricCard.d.ts +0 -10
  470. package/dist/web/client/src/components/common/MetricCard.d.ts.map +0 -1
  471. package/dist/web/client/src/components/common/MetricCard.js +0 -10
  472. package/dist/web/client/src/components/common/MetricCard.js.map +0 -1
  473. package/dist/web/client/src/components/common/PageHeader.d.ts +0 -12
  474. package/dist/web/client/src/components/common/PageHeader.d.ts.map +0 -1
  475. package/dist/web/client/src/components/common/PageHeader.js +0 -14
  476. package/dist/web/client/src/components/common/PageHeader.js.map +0 -1
  477. package/dist/web/client/src/components/common/SearchInput.d.ts +0 -14
  478. package/dist/web/client/src/components/common/SearchInput.d.ts.map +0 -1
  479. package/dist/web/client/src/components/common/SearchInput.js +0 -15
  480. package/dist/web/client/src/components/common/SearchInput.js.map +0 -1
  481. package/dist/web/client/src/components/common/StatusBadge.d.ts +0 -10
  482. package/dist/web/client/src/components/common/StatusBadge.d.ts.map +0 -1
  483. package/dist/web/client/src/components/common/StatusBadge.js +0 -15
  484. package/dist/web/client/src/components/common/StatusBadge.js.map +0 -1
  485. package/dist/web/client/src/components/common/index.d.ts +0 -6
  486. package/dist/web/client/src/components/common/index.d.ts.map +0 -1
  487. package/dist/web/client/src/components/common/index.js +0 -6
  488. package/dist/web/client/src/components/common/index.js.map +0 -1
  489. package/dist/web/client/src/components/graph/BranchDetailPanel.d.ts +0 -15
  490. package/dist/web/client/src/components/graph/BranchDetailPanel.d.ts.map +0 -1
  491. package/dist/web/client/src/components/graph/BranchDetailPanel.js +0 -57
  492. package/dist/web/client/src/components/graph/BranchDetailPanel.js.map +0 -1
  493. package/dist/web/client/src/components/graph/BranchNode.d.ts +0 -13
  494. package/dist/web/client/src/components/graph/BranchNode.d.ts.map +0 -1
  495. package/dist/web/client/src/components/graph/BranchNode.js +0 -103
  496. package/dist/web/client/src/components/graph/BranchNode.js.map +0 -1
  497. package/dist/web/client/src/components/graph/ClusterNode.d.ts +0 -13
  498. package/dist/web/client/src/components/graph/ClusterNode.d.ts.map +0 -1
  499. package/dist/web/client/src/components/graph/ClusterNode.js +0 -109
  500. package/dist/web/client/src/components/graph/ClusterNode.js.map +0 -1
  501. package/dist/web/client/src/components/graph/SynapticCanvas.d.ts +0 -17
  502. package/dist/web/client/src/components/graph/SynapticCanvas.d.ts.map +0 -1
  503. package/dist/web/client/src/components/graph/SynapticCanvas.js +0 -94
  504. package/dist/web/client/src/components/graph/SynapticCanvas.js.map +0 -1
  505. package/dist/web/client/src/components/graph/SynapticEdge.d.ts +0 -13
  506. package/dist/web/client/src/components/graph/SynapticEdge.d.ts.map +0 -1
  507. package/dist/web/client/src/components/graph/SynapticEdge.js +0 -113
  508. package/dist/web/client/src/components/graph/SynapticEdge.js.map +0 -1
  509. package/dist/web/client/src/components/graph/graphUtils.d.ts +0 -67
  510. package/dist/web/client/src/components/graph/graphUtils.d.ts.map +0 -1
  511. package/dist/web/client/src/components/graph/graphUtils.js +0 -175
  512. package/dist/web/client/src/components/graph/graphUtils.js.map +0 -1
  513. package/dist/web/client/src/components/graph/index.d.ts +0 -10
  514. package/dist/web/client/src/components/graph/index.d.ts.map +0 -1
  515. package/dist/web/client/src/components/graph/index.js +0 -10
  516. package/dist/web/client/src/components/graph/index.js.map +0 -1
  517. package/dist/web/client/src/components/ui/alert.d.ts +0 -9
  518. package/dist/web/client/src/components/ui/alert.d.ts.map +0 -1
  519. package/dist/web/client/src/components/ui/alert.js +0 -25
  520. package/dist/web/client/src/components/ui/alert.js.map +0 -1
  521. package/dist/web/client/src/components/ui/badge.d.ts +0 -10
  522. package/dist/web/client/src/components/ui/badge.d.ts.map +0 -1
  523. package/dist/web/client/src/components/ui/badge.js +0 -25
  524. package/dist/web/client/src/components/ui/badge.js.map +0 -1
  525. package/dist/web/client/src/components/ui/button.d.ts +0 -12
  526. package/dist/web/client/src/components/ui/button.d.ts.map +0 -1
  527. package/dist/web/client/src/components/ui/button.js +0 -33
  528. package/dist/web/client/src/components/ui/button.js.map +0 -1
  529. package/dist/web/client/src/components/ui/card.d.ts +0 -9
  530. package/dist/web/client/src/components/ui/card.d.ts.map +0 -1
  531. package/dist/web/client/src/components/ui/card.js +0 -16
  532. package/dist/web/client/src/components/ui/card.js.map +0 -1
  533. package/dist/web/client/src/components/ui/index.d.ts +0 -8
  534. package/dist/web/client/src/components/ui/index.d.ts.map +0 -1
  535. package/dist/web/client/src/components/ui/index.js +0 -8
  536. package/dist/web/client/src/components/ui/index.js.map +0 -1
  537. package/dist/web/client/src/components/ui/input.d.ts +0 -4
  538. package/dist/web/client/src/components/ui/input.d.ts.map +0 -1
  539. package/dist/web/client/src/components/ui/input.js +0 -8
  540. package/dist/web/client/src/components/ui/input.js.map +0 -1
  541. package/dist/web/client/src/components/ui/select.d.ts +0 -14
  542. package/dist/web/client/src/components/ui/select.d.ts.map +0 -1
  543. package/dist/web/client/src/components/ui/select.js +0 -39
  544. package/dist/web/client/src/components/ui/select.js.map +0 -1
  545. package/dist/web/client/src/components/ui/table.d.ts +0 -11
  546. package/dist/web/client/src/components/ui/table.d.ts.map +0 -1
  547. package/dist/web/client/src/components/ui/table.js +0 -21
  548. package/dist/web/client/src/components/ui/table.js.map +0 -1
  549. package/dist/web/client/src/hooks/useBranches.d.ts +0 -16
  550. package/dist/web/client/src/hooks/useBranches.d.ts.map +0 -1
  551. package/dist/web/client/src/hooks/useBranches.js +0 -35
  552. package/dist/web/client/src/hooks/useBranches.js.map +0 -1
  553. package/dist/web/client/src/hooks/useConfig.d.ts +0 -13
  554. package/dist/web/client/src/hooks/useConfig.d.ts.map +0 -1
  555. package/dist/web/client/src/hooks/useConfig.js +0 -27
  556. package/dist/web/client/src/hooks/useConfig.js.map +0 -1
  557. package/dist/web/client/src/hooks/useSessions.d.ts +0 -21
  558. package/dist/web/client/src/hooks/useSessions.d.ts.map +0 -1
  559. package/dist/web/client/src/hooks/useSessions.js +0 -54
  560. package/dist/web/client/src/hooks/useSessions.js.map +0 -1
  561. package/dist/web/client/src/hooks/useWorktrees.d.ts +0 -17
  562. package/dist/web/client/src/hooks/useWorktrees.d.ts.map +0 -1
  563. package/dist/web/client/src/hooks/useWorktrees.js +0 -41
  564. package/dist/web/client/src/hooks/useWorktrees.js.map +0 -1
  565. package/dist/web/client/src/lib/api.d.ts +0 -82
  566. package/dist/web/client/src/lib/api.d.ts.map +0 -1
  567. package/dist/web/client/src/lib/api.js +0 -147
  568. package/dist/web/client/src/lib/api.js.map +0 -1
  569. package/dist/web/client/src/lib/coding-agent-colors.d.ts +0 -86
  570. package/dist/web/client/src/lib/coding-agent-colors.d.ts.map +0 -1
  571. package/dist/web/client/src/lib/coding-agent-colors.js +0 -135
  572. package/dist/web/client/src/lib/coding-agent-colors.js.map +0 -1
  573. package/dist/web/client/src/lib/utils.d.ts +0 -7
  574. package/dist/web/client/src/lib/utils.d.ts.map +0 -1
  575. package/dist/web/client/src/lib/utils.js +0 -10
  576. package/dist/web/client/src/lib/utils.js.map +0 -1
  577. package/dist/web/client/src/lib/websocket.d.ts +0 -59
  578. package/dist/web/client/src/lib/websocket.d.ts.map +0 -1
  579. package/dist/web/client/src/lib/websocket.js +0 -182
  580. package/dist/web/client/src/lib/websocket.js.map +0 -1
  581. package/dist/web/client/src/main.d.ts +0 -2
  582. package/dist/web/client/src/main.d.ts.map +0 -1
  583. package/dist/web/client/src/main.js +0 -23
  584. package/dist/web/client/src/main.js.map +0 -1
  585. package/dist/web/client/src/pages/BranchDetailPage.d.ts +0 -3
  586. package/dist/web/client/src/pages/BranchDetailPage.d.ts.map +0 -1
  587. package/dist/web/client/src/pages/BranchDetailPage.js +0 -365
  588. package/dist/web/client/src/pages/BranchDetailPage.js.map +0 -1
  589. package/dist/web/client/src/pages/BranchListPage.d.ts +0 -3
  590. package/dist/web/client/src/pages/BranchListPage.d.ts.map +0 -1
  591. package/dist/web/client/src/pages/BranchListPage.js +0 -118
  592. package/dist/web/client/src/pages/BranchListPage.js.map +0 -1
  593. package/dist/web/client/src/pages/ConfigManagementPage.d.ts +0 -3
  594. package/dist/web/client/src/pages/ConfigManagementPage.d.ts.map +0 -1
  595. package/dist/web/client/src/pages/ConfigManagementPage.js +0 -132
  596. package/dist/web/client/src/pages/ConfigManagementPage.js.map +0 -1
  597. package/dist/web/client/src/pages/ConfigPage.d.ts +0 -3
  598. package/dist/web/client/src/pages/ConfigPage.d.ts.map +0 -1
  599. package/dist/web/client/src/pages/ConfigPage.js +0 -220
  600. package/dist/web/client/src/pages/ConfigPage.js.map +0 -1
  601. package/dist/web/client/src/router.d.ts +0 -9
  602. package/dist/web/client/src/router.d.ts.map +0 -1
  603. package/dist/web/client/src/router.js +0 -27
  604. package/dist/web/client/src/router.js.map +0 -1
  605. package/dist/web/client/vite.config.d.ts +0 -3
  606. package/dist/web/client/vite.config.d.ts.map +0 -1
  607. package/dist/web/client/vite.config.js +0 -28
  608. package/dist/web/client/vite.config.js.map +0 -1
  609. package/dist/web/server/env/importer.d.ts +0 -3
  610. package/dist/web/server/env/importer.d.ts.map +0 -1
  611. package/dist/web/server/env/importer.js +0 -51
  612. package/dist/web/server/env/importer.js.map +0 -1
  613. package/dist/web/server/index.d.ts +0 -33
  614. package/dist/web/server/index.d.ts.map +0 -1
  615. package/dist/web/server/index.js +0 -102
  616. package/dist/web/server/index.js.map +0 -1
  617. package/dist/web/server/pty/manager.d.ts +0 -54
  618. package/dist/web/server/pty/manager.d.ts.map +0 -1
  619. package/dist/web/server/pty/manager.js +0 -303
  620. package/dist/web/server/pty/manager.js.map +0 -1
  621. package/dist/web/server/routes/branches.d.ts +0 -11
  622. package/dist/web/server/routes/branches.d.ts.map +0 -1
  623. package/dist/web/server/routes/branches.js +0 -97
  624. package/dist/web/server/routes/branches.js.map +0 -1
  625. package/dist/web/server/routes/config.d.ts +0 -6
  626. package/dist/web/server/routes/config.d.ts.map +0 -1
  627. package/dist/web/server/routes/config.js +0 -162
  628. package/dist/web/server/routes/config.js.map +0 -1
  629. package/dist/web/server/routes/index.d.ts +0 -13
  630. package/dist/web/server/routes/index.d.ts.map +0 -1
  631. package/dist/web/server/routes/index.js +0 -29
  632. package/dist/web/server/routes/index.js.map +0 -1
  633. package/dist/web/server/routes/sessions.d.ts +0 -12
  634. package/dist/web/server/routes/sessions.d.ts.map +0 -1
  635. package/dist/web/server/routes/sessions.js +0 -176
  636. package/dist/web/server/routes/sessions.js.map +0 -1
  637. package/dist/web/server/routes/worktrees.d.ts +0 -11
  638. package/dist/web/server/routes/worktrees.d.ts.map +0 -1
  639. package/dist/web/server/routes/worktrees.js +0 -80
  640. package/dist/web/server/routes/worktrees.js.map +0 -1
  641. package/dist/web/server/services/branches.d.ts +0 -17
  642. package/dist/web/server/services/branches.d.ts.map +0 -1
  643. package/dist/web/server/services/branches.js +0 -275
  644. package/dist/web/server/services/branches.js.map +0 -1
  645. package/dist/web/server/services/worktrees.d.ts +0 -24
  646. package/dist/web/server/services/worktrees.d.ts.map +0 -1
  647. package/dist/web/server/services/worktrees.js +0 -66
  648. package/dist/web/server/services/worktrees.js.map +0 -1
  649. package/dist/web/server/tray.d.ts +0 -25
  650. package/dist/web/server/tray.d.ts.map +0 -1
  651. package/dist/web/server/tray.js +0 -116
  652. package/dist/web/server/tray.js.map +0 -1
  653. package/dist/web/server/types.d.ts +0 -4
  654. package/dist/web/server/types.d.ts.map +0 -1
  655. package/dist/web/server/types.js +0 -2
  656. package/dist/web/server/types.js.map +0 -1
  657. package/dist/web/server/websocket/handler.d.ts +0 -57
  658. package/dist/web/server/websocket/handler.d.ts.map +0 -1
  659. package/dist/web/server/websocket/handler.js +0 -220
  660. package/dist/web/server/websocket/handler.js.map +0 -1
  661. package/dist/worktree.d.ts +0 -117
  662. package/dist/worktree.d.ts.map +0 -1
  663. package/dist/worktree.js +0 -788
  664. package/dist/worktree.js.map +0 -1
  665. package/src/claude-history.ts +0 -717
  666. package/src/claude.ts +0 -557
  667. package/src/cli/ui/App.solid.tsx +0 -2145
  668. package/src/cli/ui/__tests__/solid/AppSolid.cleanup.test.tsx +0 -1175
  669. package/src/cli/ui/__tests__/solid/BranchListScreen.test.tsx +0 -343
  670. package/src/cli/ui/__tests__/solid/ConfirmScreen.test.tsx +0 -77
  671. package/src/cli/ui/__tests__/solid/LogScreen.test.tsx +0 -351
  672. package/src/cli/ui/__tests__/solid/components/QuickStartStep.test.tsx +0 -308
  673. package/src/cli/ui/__tests__/solid/components/WizardController.test.tsx +0 -71
  674. package/src/cli/ui/__tests__/solid/components/WizardPopup.test.tsx +0 -231
  675. package/src/cli/ui/__tests__/solid/components/WizardSteps.test.tsx +0 -331
  676. package/src/cli/ui/__tests__/utils/branchFormatter.test.ts +0 -702
  677. package/src/cli/ui/__tests__/utils/clipboard.test.ts +0 -65
  678. package/src/cli/ui/__tests__/utils/statisticsCalculator.test.ts +0 -243
  679. package/src/cli/ui/components/solid/Footer.tsx +0 -36
  680. package/src/cli/ui/components/solid/Header.tsx +0 -67
  681. package/src/cli/ui/components/solid/HelpOverlay.tsx +0 -194
  682. package/src/cli/ui/components/solid/QuickStartStep.tsx +0 -209
  683. package/src/cli/ui/components/solid/ScrollableList.tsx +0 -23
  684. package/src/cli/ui/components/solid/SearchInput.tsx +0 -42
  685. package/src/cli/ui/components/solid/SelectInput.tsx +0 -88
  686. package/src/cli/ui/components/solid/Stats.tsx +0 -92
  687. package/src/cli/ui/components/solid/TextInput.tsx +0 -49
  688. package/src/cli/ui/components/solid/WizardController.tsx +0 -457
  689. package/src/cli/ui/components/solid/WizardPopup.tsx +0 -135
  690. package/src/cli/ui/components/solid/WizardSteps.tsx +0 -781
  691. package/src/cli/ui/core/index.ts +0 -17
  692. package/src/cli/ui/core/keybindings.ts +0 -367
  693. package/src/cli/ui/core/theme.ts +0 -266
  694. package/src/cli/ui/core/types.ts +0 -235
  695. package/src/cli/ui/hooks/solid/useAsyncOperation.ts +0 -78
  696. package/src/cli/ui/hooks/solid/useFilter.ts +0 -86
  697. package/src/cli/ui/hooks/solid/useGitOperations.ts +0 -81
  698. package/src/cli/ui/hooks/solid/useKeyHandler.ts +0 -103
  699. package/src/cli/ui/hooks/solid/useScrollableList.ts +0 -149
  700. package/src/cli/ui/hooks/solid/useSelection.ts +0 -77
  701. package/src/cli/ui/hooks/solid/useTerminalSize.ts +0 -22
  702. package/src/cli/ui/index.solid.ts +0 -28
  703. package/src/cli/ui/screens/solid/BranchListScreen.tsx +0 -1153
  704. package/src/cli/ui/screens/solid/ConfirmScreen.tsx +0 -86
  705. package/src/cli/ui/screens/solid/EnvironmentScreen.tsx +0 -161
  706. package/src/cli/ui/screens/solid/ErrorScreen.tsx +0 -42
  707. package/src/cli/ui/screens/solid/InputScreen.tsx +0 -55
  708. package/src/cli/ui/screens/solid/LoadingIndicator.tsx +0 -77
  709. package/src/cli/ui/screens/solid/LogDetailScreen.tsx +0 -75
  710. package/src/cli/ui/screens/solid/LogScreen.tsx +0 -504
  711. package/src/cli/ui/screens/solid/ProfileEnvScreen.tsx +0 -196
  712. package/src/cli/ui/screens/solid/ProfileScreen.tsx +0 -98
  713. package/src/cli/ui/screens/solid/SelectorScreen.tsx +0 -181
  714. package/src/cli/ui/screens/solid/SettingsScreen.tsx +0 -52
  715. package/src/cli/ui/screens/solid/WorktreeCreateScreen.tsx +0 -136
  716. package/src/cli/ui/screens/solid/WorktreeDeleteScreen.tsx +0 -40
  717. package/src/cli/ui/stores/appStore.ts +0 -208
  718. package/src/cli/ui/stores/branchStore.ts +0 -357
  719. package/src/cli/ui/stores/index.ts +0 -31
  720. package/src/cli/ui/stores/uiStore.ts +0 -226
  721. package/src/cli/ui/types.ts +0 -371
  722. package/src/cli/ui/utils/__tests__/branchFormatter.test.ts +0 -227
  723. package/src/cli/ui/utils/__tests__/installedVersionCache.test.ts +0 -46
  724. package/src/cli/ui/utils/baseBranch.ts +0 -34
  725. package/src/cli/ui/utils/branchFormatter.ts +0 -222
  726. package/src/cli/ui/utils/clipboard.ts +0 -31
  727. package/src/cli/ui/utils/continueSession.ts +0 -231
  728. package/src/cli/ui/utils/installedVersionCache.ts +0 -84
  729. package/src/cli/ui/utils/modelOptions.test.ts +0 -98
  730. package/src/cli/ui/utils/modelOptions.ts +0 -169
  731. package/src/cli/ui/utils/statisticsCalculator.ts +0 -44
  732. package/src/cli/ui/utils/versionCache.ts +0 -93
  733. package/src/cli/ui/utils/versionFetcher.ts +0 -120
  734. package/src/codex.ts +0 -445
  735. package/src/config/__tests__/saveSession.test.ts +0 -143
  736. package/src/config/builtin-coding-agents.ts +0 -87
  737. package/src/config/constants.ts +0 -102
  738. package/src/config/env-history.ts +0 -45
  739. package/src/config/index.ts +0 -311
  740. package/src/config/profiles.ts +0 -359
  741. package/src/config/shared-env.ts +0 -139
  742. package/src/config/tools.ts +0 -319
  743. package/src/gemini.ts +0 -405
  744. package/src/git.ts +0 -1263
  745. package/src/github.ts +0 -158
  746. package/src/index.test.ts +0 -93
  747. package/src/index.ts +0 -1024
  748. package/src/launcher.ts +0 -235
  749. package/src/logging/agentOutput.ts +0 -216
  750. package/src/logging/formatter.ts +0 -125
  751. package/src/logging/logger.ts +0 -106
  752. package/src/logging/reader.ts +0 -240
  753. package/src/logging/rotation.ts +0 -25
  754. package/src/opentui/index.solid.ts +0 -1
  755. package/src/repositories/git.repository.ts +0 -129
  756. package/src/repositories/github.repository.ts +0 -83
  757. package/src/repositories/worktree.repository.ts +0 -77
  758. package/src/services/BatchMergeService.ts +0 -251
  759. package/src/services/WorktreeOrchestrator.ts +0 -115
  760. package/src/services/__tests__/BatchMergeService.test.ts +0 -534
  761. package/src/services/__tests__/WorktreeOrchestrator.test.ts +0 -259
  762. package/src/services/codingAgentCommandResolver.ts +0 -118
  763. package/src/services/codingAgentResolver.ts +0 -375
  764. package/src/services/dependency-installer.ts +0 -192
  765. package/src/services/git.service.ts +0 -115
  766. package/src/services/github.service.ts +0 -61
  767. package/src/services/worktree.service.ts +0 -66
  768. package/src/shared/codingAgentConstants.ts +0 -103
  769. package/src/trayicon.d.ts +0 -30
  770. package/src/types/api.ts +0 -256
  771. package/src/types/coding-agent.ts +0 -85
  772. package/src/types/profiles.ts +0 -64
  773. package/src/types/tools.ts +0 -269
  774. package/src/utils/__tests__/npmRegistry.test.ts +0 -250
  775. package/src/utils/__tests__/prompt.test.ts +0 -125
  776. package/src/utils/bun-runtime.ts +0 -29
  777. package/src/utils/coding-agent-colors.ts +0 -165
  778. package/src/utils/command.ts +0 -234
  779. package/src/utils/error-utils.ts +0 -133
  780. package/src/utils/npmRegistry.ts +0 -249
  781. package/src/utils/prompt.ts +0 -149
  782. package/src/utils/session/common.ts +0 -474
  783. package/src/utils/session/index.ts +0 -50
  784. package/src/utils/session/parsers/claude.ts +0 -283
  785. package/src/utils/session/parsers/codex.ts +0 -166
  786. package/src/utils/session/parsers/gemini.ts +0 -135
  787. package/src/utils/session/parsers/index.ts +0 -31
  788. package/src/utils/session/parsers/opencode.ts +0 -151
  789. package/src/utils/session/types.ts +0 -51
  790. package/src/utils/session.ts +0 -16
  791. package/src/utils/spinner.ts +0 -54
  792. package/src/utils/terminal.ts +0 -327
  793. package/src/utils/webui.ts +0 -43
  794. package/src/utils.test.ts +0 -43
  795. package/src/utils.ts +0 -93
  796. package/src/web/client/components.json +0 -21
  797. package/src/web/client/index.html +0 -12
  798. package/src/web/client/src/components/BranchGraph.tsx +0 -95
  799. package/src/web/client/src/components/CodingAgentLaunchModal.tsx +0 -570
  800. package/src/web/client/src/components/CustomCodingAgentForm.tsx +0 -386
  801. package/src/web/client/src/components/CustomCodingAgentList.tsx +0 -119
  802. package/src/web/client/src/components/EnvEditor.tsx +0 -188
  803. package/src/web/client/src/components/EnvironmentEditor.tsx +0 -97
  804. package/src/web/client/src/components/Terminal.tsx +0 -145
  805. package/src/web/client/src/components/branch-detail/BranchInfoCards.tsx +0 -193
  806. package/src/web/client/src/components/branch-detail/SessionHistoryTable.tsx +0 -187
  807. package/src/web/client/src/components/branch-detail/TerminalPanel.tsx +0 -92
  808. package/src/web/client/src/components/branch-detail/ToolLauncher.tsx +0 -332
  809. package/src/web/client/src/components/branch-detail/index.ts +0 -4
  810. package/src/web/client/src/components/common/BranchCard.tsx +0 -117
  811. package/src/web/client/src/components/common/MetricCard.tsx +0 -22
  812. package/src/web/client/src/components/common/PageHeader.tsx +0 -44
  813. package/src/web/client/src/components/common/SearchInput.tsx +0 -40
  814. package/src/web/client/src/components/common/StatusBadge.tsx +0 -37
  815. package/src/web/client/src/components/common/index.ts +0 -5
  816. package/src/web/client/src/components/graph/BranchDetailPanel.tsx +0 -152
  817. package/src/web/client/src/components/graph/BranchNode.tsx +0 -200
  818. package/src/web/client/src/components/graph/ClusterNode.tsx +0 -211
  819. package/src/web/client/src/components/graph/SynapticCanvas.tsx +0 -171
  820. package/src/web/client/src/components/graph/SynapticEdge.tsx +0 -311
  821. package/src/web/client/src/components/graph/graphUtils.ts +0 -265
  822. package/src/web/client/src/components/graph/index.ts +0 -10
  823. package/src/web/client/src/components/ui/alert.tsx +0 -63
  824. package/src/web/client/src/components/ui/badge.tsx +0 -44
  825. package/src/web/client/src/components/ui/button.tsx +0 -57
  826. package/src/web/client/src/components/ui/card.tsx +0 -82
  827. package/src/web/client/src/components/ui/index.ts +0 -32
  828. package/src/web/client/src/components/ui/input.tsx +0 -21
  829. package/src/web/client/src/components/ui/select.tsx +0 -156
  830. package/src/web/client/src/components/ui/table.tsx +0 -119
  831. package/src/web/client/src/hooks/useBranches.ts +0 -41
  832. package/src/web/client/src/hooks/useConfig.ts +0 -31
  833. package/src/web/client/src/hooks/useSessions.ts +0 -68
  834. package/src/web/client/src/hooks/useWorktrees.ts +0 -47
  835. package/src/web/client/src/index.css +0 -349
  836. package/src/web/client/src/lib/api.ts +0 -184
  837. package/src/web/client/src/lib/coding-agent-colors.ts +0 -149
  838. package/src/web/client/src/lib/utils.ts +0 -10
  839. package/src/web/client/src/lib/websocket.ts +0 -222
  840. package/src/web/client/src/main.tsx +0 -29
  841. package/src/web/client/src/pages/BranchDetailPage.tsx +0 -555
  842. package/src/web/client/src/pages/BranchListPage.tsx +0 -242
  843. package/src/web/client/src/pages/ConfigManagementPage.tsx +0 -248
  844. package/src/web/client/src/pages/ConfigPage.tsx +0 -368
  845. package/src/web/client/src/router.tsx +0 -27
  846. package/src/web/client/vite.config.ts +0 -28
  847. package/src/web/server/env/importer.ts +0 -62
  848. package/src/web/server/index.ts +0 -143
  849. package/src/web/server/pty/manager.ts +0 -443
  850. package/src/web/server/routes/branches.ts +0 -126
  851. package/src/web/server/routes/config.ts +0 -226
  852. package/src/web/server/routes/index.ts +0 -37
  853. package/src/web/server/routes/sessions.ts +0 -252
  854. package/src/web/server/routes/worktrees.ts +0 -108
  855. package/src/web/server/services/branches.ts +0 -387
  856. package/src/web/server/services/worktrees.ts +0 -93
  857. package/src/web/server/tray.ts +0 -136
  858. package/src/web/server/types.ts +0 -14
  859. package/src/web/server/websocket/handler.ts +0 -299
  860. package/src/worktree.ts +0 -1109
package/src/worktree.ts DELETED
@@ -1,1109 +0,0 @@
1
- import { execa } from "execa";
2
- import { lstat, mkdir, readFile, rm } from "node:fs/promises";
3
- import path from "node:path";
4
- import chalk from "chalk";
5
- import { createLogger } from "./logging/logger.js";
6
-
7
- const logger = createLogger({ category: "worktree" });
8
- import {
9
- WorktreeConfig,
10
- WorktreeWithPR,
11
- CleanupTarget,
12
- CleanupReason,
13
- CleanupStatus,
14
- } from "./cli/ui/types.js";
15
- import { getPullRequestByBranch } from "./github.js";
16
- import {
17
- hasUncommittedChanges,
18
- hasUnpushedCommits,
19
- hasUnpushedCommitsInRepo,
20
- getLocalBranches,
21
- checkRemoteBranchExists,
22
- branchHasUniqueCommitsComparedToBase,
23
- getRepositoryRoot,
24
- getWorktreeRoot,
25
- ensureGitignoreEntry,
26
- branchExists,
27
- getCurrentBranch,
28
- getCurrentBranchName,
29
- } from "./git.js";
30
- import { getConfig } from "./config/index.js";
31
- import { GIT_CONFIG } from "./config/constants.js";
32
- import { startSpinner } from "./utils/spinner.js";
33
-
34
- async function getUpstreamBranch(branch: string): Promise<string | null> {
35
- try {
36
- const result = await execa("git", [
37
- "rev-parse",
38
- "--abbrev-ref",
39
- `${branch}@{upstream}`,
40
- ]);
41
- const stdout =
42
- typeof (result as { stdout?: unknown })?.stdout === "string"
43
- ? (result as { stdout: string }).stdout.trim()
44
- : "";
45
- return stdout.length ? stdout : null;
46
- } catch {
47
- return null;
48
- }
49
- }
50
-
51
- const parseRemoteRef = (
52
- ref: string,
53
- ): { remote: string; branch: string } | null => {
54
- const segments = ref.split("/");
55
- if (segments.length < 2) {
56
- return null;
57
- }
58
- const [remote, ...rest] = segments;
59
- const branch = rest.join("/");
60
- if (!remote || !branch) {
61
- return null;
62
- }
63
- return { remote, branch };
64
- };
65
-
66
- async function resolveUpstreamStatus(
67
- branch: string,
68
- repoRoot: string,
69
- ): Promise<{ upstream: string | null; hasUpstream: boolean }> {
70
- const upstream = await getUpstreamBranch(branch);
71
- if (!upstream) {
72
- return { upstream: null, hasUpstream: false };
73
- }
74
- const parsed = parseRemoteRef(upstream);
75
- if (!parsed) {
76
- return { upstream, hasUpstream: false };
77
- }
78
- if (parsed.branch !== branch) {
79
- return { upstream, hasUpstream: false };
80
- }
81
- const exists = await checkRemoteBranchExists(parsed.branch, parsed.remote, {
82
- cwd: repoRoot,
83
- });
84
- return { upstream, hasUpstream: exists };
85
- }
86
-
87
- const buildCleanupReasons = ({
88
- hasUniqueCommits,
89
- hasUncommitted,
90
- hasUnpushed,
91
- hasUpstream,
92
- }: {
93
- hasUniqueCommits: boolean;
94
- hasUncommitted: boolean;
95
- hasUnpushed: boolean;
96
- hasUpstream: boolean;
97
- }): CleanupReason[] => {
98
- if (!hasUpstream) {
99
- return [];
100
- }
101
- if (!hasUniqueCommits && !hasUncommitted && !hasUnpushed) {
102
- return ["no-diff-with-base"];
103
- }
104
- if (hasUniqueCommits && !hasUncommitted && !hasUnpushed) {
105
- return ["remote-synced"];
106
- }
107
- return [];
108
- };
109
-
110
- // Re-export WorktreeConfig for external use
111
- export type { WorktreeConfig };
112
-
113
- // 保護対象のブランチ(クリーンアップから除外)
114
- export const PROTECTED_BRANCHES = ["main", "master", "develop"];
115
-
116
- export function isProtectedBranchName(branchName: string): boolean {
117
- const normalized = branchName
118
- .replace(/^refs\/heads\//, "")
119
- .replace(/^origin\//, "");
120
- return PROTECTED_BRANCHES.includes(normalized);
121
- }
122
-
123
- export async function switchToProtectedBranch({
124
- branchName,
125
- repoRoot,
126
- remoteRef,
127
- }: {
128
- branchName: string;
129
- repoRoot: string;
130
- remoteRef?: string | null;
131
- }): Promise<"none" | "local" | "remote"> {
132
- const currentBranch = await getCurrentBranch();
133
- if (currentBranch === branchName) {
134
- return "none";
135
- }
136
-
137
- const runGit = async (args: string[]) => {
138
- try {
139
- await execa("git", args, { cwd: repoRoot });
140
- } catch (error) {
141
- throw new WorktreeError(
142
- `Failed to execute git ${args.join(" ")} for protected branch ${branchName}`,
143
- error,
144
- );
145
- }
146
- };
147
-
148
- if (await branchExists(branchName)) {
149
- await runGit(["checkout", branchName]);
150
- return "local";
151
- }
152
-
153
- const targetRemote = remoteRef ?? `origin/${branchName}`;
154
- const fetchRef = targetRemote.replace(/^origin\//, "");
155
-
156
- await runGit(["fetch", "origin", fetchRef]);
157
- await runGit(["checkout", "-b", branchName, targetRemote]);
158
-
159
- return "remote";
160
- }
161
- export class WorktreeError extends Error {
162
- constructor(
163
- message: string,
164
- public cause?: unknown,
165
- ) {
166
- super(message);
167
- this.name = "WorktreeError";
168
- }
169
- }
170
-
171
- export interface WorktreeInfo {
172
- path: string;
173
- branch: string;
174
- head: string;
175
- locked?: boolean;
176
- prunable?: boolean;
177
- isAccessible?: boolean;
178
- invalidReason?: string;
179
- hasUncommittedChanges?: boolean;
180
- isLocked?: boolean;
181
- isPrunable?: boolean;
182
- }
183
-
184
- async function listWorktrees(): Promise<WorktreeInfo[]> {
185
- try {
186
- const { getRepositoryRoot } = await import("./git.js");
187
- const repoRoot = await getRepositoryRoot();
188
- const { stdout } = await execa("git", ["worktree", "list", "--porcelain"], {
189
- cwd: repoRoot,
190
- });
191
- const worktrees: WorktreeInfo[] = [];
192
- const lines = stdout.split("\n");
193
-
194
- let currentWorktree: Partial<WorktreeInfo> = {};
195
-
196
- for (const line of lines) {
197
- if (line.startsWith("worktree ")) {
198
- if (currentWorktree.path) {
199
- worktrees.push(currentWorktree as WorktreeInfo);
200
- }
201
- currentWorktree = {
202
- path: line.substring(9),
203
- locked: false,
204
- prunable: false,
205
- isLocked: false,
206
- isPrunable: false,
207
- };
208
- } else if (line.startsWith("HEAD ")) {
209
- currentWorktree.head = line.substring(5);
210
- } else if (line.startsWith("branch ")) {
211
- currentWorktree.branch = line.substring(7).replace("refs/heads/", "");
212
- } else if (line === "locked" || line.startsWith("locked ")) {
213
- currentWorktree.locked = true;
214
- currentWorktree.isLocked = true;
215
- if (line.startsWith("locked ")) {
216
- const reason = line.substring(7).trim();
217
- if (reason) {
218
- currentWorktree.invalidReason ??= reason;
219
- }
220
- }
221
- } else if (line === "prunable" || line.startsWith("prunable ")) {
222
- currentWorktree.prunable = true;
223
- currentWorktree.isPrunable = true;
224
- if (line.startsWith("prunable ")) {
225
- const reason = line.substring(9).trim();
226
- if (reason) {
227
- currentWorktree.invalidReason ??= reason;
228
- }
229
- }
230
- } else if (line.startsWith("reason ")) {
231
- currentWorktree.invalidReason = line.substring(7);
232
- } else if (line === "") {
233
- if (currentWorktree.path) {
234
- worktrees.push(currentWorktree as WorktreeInfo);
235
- currentWorktree = {};
236
- }
237
- }
238
- }
239
-
240
- if (currentWorktree.path) {
241
- worktrees.push(currentWorktree as WorktreeInfo);
242
- }
243
-
244
- return worktrees;
245
- } catch (error) {
246
- throw new WorktreeError("Failed to list worktrees", error);
247
- }
248
- }
249
-
250
- export async function listAllWorktrees(): Promise<WorktreeInfo[]> {
251
- return listWorktrees();
252
- }
253
-
254
- /**
255
- * 追加のworktree(メインworktreeを除く)の一覧を取得
256
- * @returns {Promise<WorktreeInfo[]>} worktree情報の配列
257
- * @throws {WorktreeError} worktree一覧の取得に失敗した場合
258
- */
259
- export async function listAdditionalWorktrees(): Promise<WorktreeInfo[]> {
260
- try {
261
- const [allWorktrees, repoRoot] = await Promise.all([
262
- listWorktrees(),
263
- import("./git.js").then((m) => m.getRepositoryRoot()),
264
- ]);
265
-
266
- const fs = await import("node:fs");
267
-
268
- // Filter out the main worktree (repository root) and add accessibility info
269
- const additionalWorktrees = allWorktrees
270
- .filter((worktree) => worktree.path !== repoRoot)
271
- .map((worktree) => {
272
- // パスの存在を確認
273
- const exists = fs.existsSync(worktree.path);
274
- const isAccessible = exists && !worktree.prunable;
275
-
276
- const result: WorktreeInfo = {
277
- ...worktree,
278
- isAccessible,
279
- };
280
-
281
- if (!isAccessible) {
282
- if (!exists) {
283
- result.invalidReason = "Path not accessible in current environment";
284
- } else if (worktree.prunable && !result.invalidReason) {
285
- result.invalidReason = "Worktree is marked prunable";
286
- }
287
- }
288
-
289
- return result;
290
- });
291
-
292
- return additionalWorktrees;
293
- } catch (error) {
294
- throw new WorktreeError("Failed to list additional worktrees", error);
295
- }
296
- }
297
-
298
- export async function worktreeExists(
299
- branchName: string,
300
- ): Promise<string | null> {
301
- const resolution = await resolveWorktreePathForBranch(branchName);
302
- return resolution.path;
303
- }
304
-
305
- /**
306
- * Resolution result for a branch-associated worktree path.
307
- */
308
- export interface WorktreePathResolution {
309
- path: string | null;
310
- mismatch?: {
311
- path: string;
312
- actualBranch: string | null;
313
- };
314
- }
315
-
316
- /**
317
- * Resolve a worktree path for the selected branch and verify the actual checkout.
318
- */
319
- export async function resolveWorktreePathForBranch(
320
- branchName: string,
321
- ): Promise<WorktreePathResolution> {
322
- const worktrees = await listWorktrees();
323
- const worktree = worktrees.find((w) => w.branch === branchName);
324
- if (!worktree) {
325
- return { path: null };
326
- }
327
-
328
- try {
329
- const actualBranch = (await getCurrentBranchName(worktree.path)).trim();
330
- if (!actualBranch || actualBranch !== branchName) {
331
- return {
332
- path: null,
333
- mismatch: {
334
- path: worktree.path,
335
- actualBranch: actualBranch || null,
336
- },
337
- };
338
- }
339
- } catch {
340
- return {
341
- path: null,
342
- mismatch: {
343
- path: worktree.path,
344
- actualBranch: null,
345
- },
346
- };
347
- }
348
-
349
- return { path: worktree.path };
350
- }
351
-
352
- export async function generateWorktreePath(
353
- repoRoot: string,
354
- branchName: string,
355
- ): Promise<string> {
356
- const sanitizedBranchName = branchName.replace(/[/\\:*?"<>|]/g, "-");
357
- const worktreeDir = path.join(repoRoot, ".worktrees");
358
- return path.join(worktreeDir, sanitizedBranchName);
359
- }
360
-
361
- /**
362
- * 指定されたパスに既存のworktreeが存在するか確認
363
- * @param {string} targetPath - 確認するパス
364
- * @returns {Promise<WorktreeInfo | null>} 既存のworktree情報、または存在しない場合はnull
365
- */
366
- export async function checkWorktreePathConflict(
367
- targetPath: string,
368
- ): Promise<WorktreeInfo | null> {
369
- const worktrees = await listWorktrees();
370
- const existingWorktree = worktrees.find((w) => w.path === targetPath);
371
- return existingWorktree || null;
372
- }
373
-
374
- /**
375
- * 衝突を避けるため、代替のworktreeパスを生成
376
- * @param {string} basePath - 元のパス
377
- * @returns {Promise<string>} 利用可能な代替パス
378
- */
379
- export async function generateAlternativeWorktreePath(
380
- basePath: string,
381
- ): Promise<string> {
382
- let counter = 2;
383
- let alternativePath = `${basePath}-${counter}`;
384
-
385
- // 衝突しないパスが見つかるまで試行
386
- while (await checkWorktreePathConflict(alternativePath)) {
387
- counter++;
388
- alternativePath = `${basePath}-${counter}`;
389
- }
390
-
391
- return alternativePath;
392
- }
393
-
394
- type StaleWorktreeAssessment = {
395
- status: "absent" | "registered" | "stale" | "unknown";
396
- reason?: string;
397
- };
398
-
399
- async function assessStaleWorktreeDirectory(
400
- targetPath: string,
401
- ): Promise<StaleWorktreeAssessment> {
402
- const fsSync = await import("node:fs");
403
-
404
- if (!fsSync.existsSync(targetPath)) {
405
- return { status: "absent" };
406
- }
407
-
408
- const registered = await checkWorktreePathConflict(targetPath);
409
- if (registered) {
410
- return { status: "registered" };
411
- }
412
-
413
- const gitMetaPath = path.join(targetPath, ".git");
414
- if (!fsSync.existsSync(gitMetaPath)) {
415
- return { status: "stale", reason: "missing .git" };
416
- }
417
-
418
- let gitMetaStat: Awaited<ReturnType<typeof lstat>>;
419
- try {
420
- gitMetaStat = await lstat(gitMetaPath);
421
- } catch {
422
- return { status: "unknown", reason: "unable to stat .git" };
423
- }
424
-
425
- if (gitMetaStat.isDirectory()) {
426
- return { status: "unknown", reason: ".git is a directory" };
427
- }
428
-
429
- if (!gitMetaStat.isFile()) {
430
- return { status: "unknown", reason: ".git is not a file" };
431
- }
432
-
433
- let gitMetaContents = "";
434
- try {
435
- gitMetaContents = await readFile(gitMetaPath, "utf8");
436
- } catch {
437
- return { status: "unknown", reason: "unable to read .git" };
438
- }
439
-
440
- const gitdirMatch = gitMetaContents.match(/^\s*gitdir:\s*(.+)\s*$/m);
441
- if (!gitdirMatch) {
442
- return { status: "unknown", reason: "missing gitdir entry" };
443
- }
444
-
445
- const rawGitdir = gitdirMatch[1]?.trim();
446
- if (!rawGitdir) {
447
- return { status: "unknown", reason: "empty gitdir entry" };
448
- }
449
-
450
- const gitdirPath = path.isAbsolute(rawGitdir)
451
- ? rawGitdir
452
- : path.resolve(targetPath, rawGitdir);
453
-
454
- if (!fsSync.existsSync(gitdirPath)) {
455
- return { status: "stale", reason: "missing gitdir path" };
456
- }
457
-
458
- return { status: "unknown", reason: "gitdir exists" };
459
- }
460
-
461
- /**
462
- * 新しいworktreeを作成
463
- * @param {WorktreeConfig} config - worktreeの設定
464
- * @throws {WorktreeError} worktreeの作成に失敗した場合
465
- */
466
- export async function createWorktree(config: WorktreeConfig): Promise<void> {
467
- if (isProtectedBranchName(config.branchName)) {
468
- throw new WorktreeError(
469
- `Branch "${config.branchName}" is protected and cannot be used to create a worktree`,
470
- );
471
- }
472
-
473
- try {
474
- const staleness = await assessStaleWorktreeDirectory(config.worktreePath);
475
- if (staleness.status === "stale") {
476
- await rm(config.worktreePath, { recursive: true, force: true });
477
- } else if (staleness.status === "unknown") {
478
- const reason = staleness.reason ? ` (${staleness.reason})` : "";
479
- throw new WorktreeError(
480
- `Worktree path already exists but is not registered as a git worktree, and stale status could not be confirmed${reason}. Remove the directory manually and retry: ${config.worktreePath}`,
481
- );
482
- }
483
-
484
- const worktreeParentDir = path.dirname(config.worktreePath);
485
-
486
- try {
487
- await mkdir(worktreeParentDir, { recursive: true });
488
- } catch (error: unknown) {
489
- const errorWithCode = error as { code?: unknown; message?: unknown };
490
- const code =
491
- errorWithCode && typeof errorWithCode.code === "string"
492
- ? errorWithCode.code
493
- : undefined;
494
- const message =
495
- error instanceof Error
496
- ? error.message
497
- : typeof errorWithCode?.message === "string"
498
- ? errorWithCode.message
499
- : String(error);
500
- const reason =
501
- code === "EEXIST"
502
- ? `${worktreeParentDir} already exists and is not a directory`
503
- : message;
504
-
505
- throw new WorktreeError(
506
- `Failed to prepare worktree directory for ${config.branchName}: ${reason}`,
507
- error,
508
- );
509
- }
510
-
511
- const args = ["worktree", "add"];
512
-
513
- if (config.isNewBranch) {
514
- args.push("-b", config.branchName);
515
- }
516
-
517
- args.push(config.worktreePath);
518
-
519
- if (config.isNewBranch) {
520
- args.push(config.baseBranch);
521
- } else {
522
- args.push(config.branchName);
523
- }
524
-
525
- const spinnerMessage = `Creating worktree for ${config.branchName}`;
526
- let stopSpinner: (() => void) | undefined;
527
-
528
- try {
529
- stopSpinner = startSpinner(spinnerMessage);
530
- } catch {
531
- stopSpinner = undefined;
532
- }
533
-
534
- const stopActiveSpinner = () => {
535
- if (stopSpinner) {
536
- stopSpinner();
537
- stopSpinner = undefined;
538
- }
539
- };
540
-
541
- const gitProcess = execa("git", args);
542
-
543
- // パイプでリアルタイムに進捗を表示する
544
- const childProcess = gitProcess as typeof gitProcess & {
545
- stdout?: NodeJS.ReadableStream;
546
- stderr?: NodeJS.ReadableStream;
547
- };
548
-
549
- const attachStream = (
550
- stream: NodeJS.ReadableStream | undefined,
551
- pipeTarget: NodeJS.WriteStream,
552
- ) => {
553
- if (!stream) return;
554
- if (typeof stream.once === "function") {
555
- stream.once("data", stopActiveSpinner);
556
- }
557
- if (typeof stream.pipe === "function") {
558
- stream.pipe(pipeTarget);
559
- }
560
- };
561
-
562
- attachStream(childProcess.stdout, process.stdout);
563
- attachStream(childProcess.stderr, process.stderr);
564
-
565
- try {
566
- await gitProcess;
567
- } finally {
568
- stopActiveSpinner();
569
- }
570
-
571
- // 新規ブランチの場合、ベースブランチを追跡ブランチとして設定
572
- if (config.isNewBranch && config.baseBranch) {
573
- try {
574
- await execa(
575
- "git",
576
- ["branch", "--set-upstream-to", config.baseBranch, config.branchName],
577
- { cwd: config.worktreePath },
578
- );
579
- } catch (error) {
580
- const message = error instanceof Error ? error.message : String(error);
581
- console.warn(`Warning: Failed to set upstream branch: ${message}`);
582
- }
583
- }
584
-
585
- // .gitignoreに.worktrees/を追加(エラーは警告として扱う)
586
- try {
587
- let gitignoreRoot = config.repoRoot;
588
- try {
589
- gitignoreRoot = await getWorktreeRoot();
590
- } catch (resolveError) {
591
- if (process.env.DEBUG) {
592
- const reason =
593
- resolveError instanceof Error
594
- ? resolveError.message
595
- : String(resolveError);
596
- console.warn(
597
- `Debug: Failed to resolve current worktree root for .gitignore update. Falling back to ${gitignoreRoot}. Reason: ${reason}`,
598
- );
599
- }
600
- }
601
-
602
- await ensureGitignoreEntry(gitignoreRoot, ".worktrees/");
603
- } catch (error: unknown) {
604
- const message = error instanceof Error ? error.message : String(error);
605
- // .gitignoreの更新失敗は警告としてログに出すが、worktree作成は成功とする
606
- console.warn(`Warning: Failed to update .gitignore: ${message}`);
607
- }
608
- } catch (error: unknown) {
609
- // Extract more detailed error information from git command
610
- const errorOutput = (value: unknown) =>
611
- typeof value === "string" && value.trim().length > 0 ? value : null;
612
- const gitError =
613
- errorOutput((error as { stderr?: unknown })?.stderr) ??
614
- errorOutput((error as { stdout?: unknown })?.stdout) ??
615
- (error instanceof Error ? error.message : String(error));
616
- const errorMessage = `Failed to create worktree for ${config.branchName}\nGit error: ${gitError}`;
617
- throw new WorktreeError(errorMessage, error);
618
- }
619
- }
620
-
621
- export async function removeWorktree(
622
- worktreePath: string,
623
- force = false,
624
- ): Promise<void> {
625
- try {
626
- const args = ["worktree", "remove"];
627
- if (force) {
628
- args.push("--force");
629
- }
630
- args.push(worktreePath);
631
-
632
- await execa("git", args);
633
- } catch (error) {
634
- throw new WorktreeError(
635
- `Failed to remove worktree at ${worktreePath}`,
636
- error,
637
- );
638
- }
639
- }
640
-
641
- export interface RepairResult {
642
- repairedCount: number;
643
- failedCount: number;
644
- failures: Array<{ path: string; error: string }>;
645
- }
646
-
647
- /**
648
- * Worktreeパス修復の結果
649
- */
650
- export interface RepairPathResult {
651
- /** 修復成功 (git worktree repair) */
652
- repaired: boolean;
653
- /** 古いメタデータ削除成功 (git worktree remove --force) */
654
- removed: boolean;
655
- /** 修復後の新しいパス (repaired=trueの場合のみ) */
656
- newPath?: string;
657
- }
658
-
659
- /**
660
- * 単一のworktreeパスを修復する共通関数
661
- *
662
- * パターンA: 期待されるパスにディレクトリが存在する
663
- * → git worktree repair <expectedPath> で修復
664
- *
665
- * パターンB: ディレクトリが存在しない(リモート環境で作成されたメタデータのみ残っている)
666
- * → git worktree remove --force <currentPath> でメタデータを削除
667
- *
668
- * @param branch ブランチ名
669
- * @param currentPath 現在gitメタデータに記録されているパス
670
- * @param repoRoot リポジトリルートパス
671
- * @returns 修復結果
672
- */
673
- export async function repairWorktreePath(
674
- branch: string,
675
- currentPath: string,
676
- repoRoot: string,
677
- ): Promise<RepairPathResult> {
678
- const expectedPath = await generateWorktreePath(repoRoot, branch);
679
- const fsSync = await import("node:fs");
680
-
681
- if (fsSync.existsSync(expectedPath)) {
682
- // パターンA: ディレクトリが存在する → repair
683
- logger.info(
684
- { branch, expectedPath, currentPath },
685
- "repairWorktreePath: directory exists, attempting repair",
686
- );
687
- try {
688
- await execa("git", ["worktree", "repair", expectedPath], {
689
- cwd: repoRoot,
690
- });
691
- return { repaired: true, removed: false, newPath: expectedPath };
692
- } catch (error) {
693
- logger.warn(
694
- { branch, expectedPath, error },
695
- "repairWorktreePath: repair failed",
696
- );
697
- return { repaired: false, removed: false };
698
- }
699
- } else {
700
- // パターンB: ディレクトリが存在しない → 古いメタデータを削除
701
- logger.info(
702
- { branch, currentPath, expectedPath },
703
- "repairWorktreePath: directory not found, removing stale metadata",
704
- );
705
- try {
706
- await execa("git", ["worktree", "remove", "--force", currentPath], {
707
- cwd: repoRoot,
708
- });
709
- return { repaired: false, removed: true };
710
- } catch (error) {
711
- logger.warn(
712
- { branch, currentPath, error },
713
- "repairWorktreePath: remove failed",
714
- );
715
- return { repaired: false, removed: false };
716
- }
717
- }
718
- }
719
-
720
- /**
721
- * Worktreeのパス不整合を修復
722
- * 共通関数repairWorktreePathを使用して各ブランチを修復
723
- * @param targetBranches 修復対象のブランチ名配列
724
- * @returns 修復結果(成功数、失敗数、失敗詳細)
725
- */
726
- export async function repairWorktrees(
727
- targetBranches: string[],
728
- ): Promise<RepairResult> {
729
- const result: RepairResult = {
730
- repairedCount: 0,
731
- failedCount: 0,
732
- failures: [],
733
- };
734
-
735
- if (targetBranches.length === 0) {
736
- return result;
737
- }
738
-
739
- // 修復前のworktree一覧を取得(現在のパスを知るため)
740
- const beforeWorktrees = await listAdditionalWorktrees();
741
- const worktreePathMap = new Map(
742
- beforeWorktrees.map((w) => [w.branch, w.path]),
743
- );
744
-
745
- // デバッグログ: worktreeリストのブランチ名を出力
746
- logger.info(
747
- {
748
- targetBranches,
749
- worktreeBranches: beforeWorktrees.map((w) => ({
750
- branch: w.branch,
751
- path: w.path,
752
- isAccessible: w.isAccessible,
753
- })),
754
- },
755
- "repairWorktrees: before state",
756
- );
757
-
758
- const repoRoot = await getRepositoryRoot();
759
-
760
- // 対象ブランチごとに共通関数を使用して修復
761
- for (const branch of targetBranches) {
762
- const currentPath = worktreePathMap.get(branch);
763
- if (!currentPath) {
764
- logger.warn({ branch }, "repairWorktrees: branch not found in worktrees");
765
- result.failedCount++;
766
- result.failures.push({
767
- path: branch,
768
- error: "Branch not found in worktrees",
769
- });
770
- continue;
771
- }
772
-
773
- const repairResult = await repairWorktreePath(
774
- branch,
775
- currentPath,
776
- repoRoot,
777
- );
778
-
779
- if (repairResult.repaired) {
780
- result.repairedCount++;
781
- } else if (repairResult.removed) {
782
- // メタデータ削除は「修復」としてカウント(新規作成が可能になるため)
783
- result.repairedCount++;
784
- } else {
785
- result.failedCount++;
786
- result.failures.push({
787
- path: branch,
788
- error: "Worktree repair failed",
789
- });
790
- }
791
- }
792
-
793
- // 修復後のアクセス可能性を確認(デバッグログ用)
794
- const afterWorktrees = await listAdditionalWorktrees();
795
- logger.info(
796
- {
797
- afterWorktrees: afterWorktrees.map((w) => ({
798
- branch: w.branch,
799
- path: w.path,
800
- isAccessible: w.isAccessible,
801
- })),
802
- },
803
- "repairWorktrees: after state",
804
- );
805
-
806
- return result;
807
- }
808
-
809
- async function getWorktreesWithPRStatus(): Promise<WorktreeWithPR[]> {
810
- const worktrees = await listAdditionalWorktrees();
811
- const worktreesWithPR: WorktreeWithPR[] = [];
812
-
813
- for (const worktree of worktrees) {
814
- if (worktree.branch) {
815
- const pullRequest = await getPullRequestByBranch(worktree.branch);
816
- worktreesWithPR.push({
817
- worktreePath: worktree.path,
818
- branch: worktree.branch,
819
- pullRequest,
820
- });
821
- }
822
- }
823
-
824
- return worktreesWithPR;
825
- }
826
-
827
- /**
828
- * worktreeに存在しないローカルブランチのクリーンアップ候補を取得
829
- * @returns {Promise<CleanupTarget[]>} クリーンアップ候補の配列
830
- */
831
- async function getOrphanedLocalBranchStatuses({
832
- baseBranch,
833
- repoRoot,
834
- onProgress,
835
- }: {
836
- baseBranch: string;
837
- repoRoot: string;
838
- onProgress?: (status: CleanupStatus) => void;
839
- }): Promise<CleanupStatus[]> {
840
- try {
841
- // 並列実行で高速化
842
- const [localBranches, worktrees] = await Promise.all([
843
- getLocalBranches(),
844
- listAdditionalWorktrees(),
845
- ]);
846
-
847
- const statuses: CleanupStatus[] = [];
848
- const worktreeBranches = new Set(
849
- worktrees.map((w) => w.branch).filter(Boolean),
850
- );
851
-
852
- if (process.env.DEBUG_CLEANUP) {
853
- console.log(
854
- chalk.cyan("Debug: Orphaned branch scan - Available local branches:"),
855
- );
856
- localBranches.forEach((b) =>
857
- console.log(` ${b.name} (type: ${b.type})`),
858
- );
859
- console.log(
860
- chalk.cyan(
861
- `Debug: Worktree branches: ${Array.from(worktreeBranches).join(", ")}`,
862
- ),
863
- );
864
- }
865
-
866
- for (const localBranch of localBranches) {
867
- // 保護対象ブランチはスキップ
868
- if (isProtectedBranchName(localBranch.name)) {
869
- if (process.env.DEBUG_CLEANUP) {
870
- console.log(
871
- chalk.yellow(
872
- `Debug: Skipping protected branch ${localBranch.name}`,
873
- ),
874
- );
875
- }
876
- continue;
877
- }
878
-
879
- // worktreeに存在しないローカルブランチのみ対象
880
- if (!worktreeBranches.has(localBranch.name)) {
881
- let hasUnpushed = false;
882
- try {
883
- hasUnpushed = await hasUnpushedCommitsInRepo(
884
- localBranch.name,
885
- repoRoot,
886
- );
887
- } catch {
888
- hasUnpushed = true;
889
- }
890
-
891
- const { upstream, hasUpstream } = await resolveUpstreamStatus(
892
- localBranch.name,
893
- repoRoot,
894
- );
895
-
896
- const hasUniqueCommits = await branchHasUniqueCommitsComparedToBase(
897
- localBranch.name,
898
- baseBranch,
899
- repoRoot,
900
- );
901
-
902
- const reasons = buildCleanupReasons({
903
- hasUniqueCommits,
904
- hasUncommitted: false,
905
- hasUnpushed,
906
- hasUpstream,
907
- });
908
-
909
- if (process.env.DEBUG_CLEANUP) {
910
- console.log(
911
- chalk.gray(
912
- `Debug: Checking orphaned branch ${localBranch.name} -> reasons: ${reasons.join(", ")}`,
913
- ),
914
- );
915
- }
916
-
917
- const status: CleanupStatus = {
918
- worktreePath: null, // worktreeは存在しない
919
- branch: localBranch.name,
920
- hasUncommittedChanges: false, // worktreeが存在しないため常にfalse
921
- hasUnpushedCommits: hasUnpushed,
922
- cleanupType: "branch-only",
923
- hasRemoteBranch: hasUpstream,
924
- hasUniqueCommits,
925
- hasUpstream,
926
- upstream,
927
- reasons,
928
- };
929
- statuses.push(status);
930
- onProgress?.(status);
931
- }
932
- }
933
-
934
- if (process.env.DEBUG_CLEANUP) {
935
- console.log(
936
- chalk.cyan(`Debug: Found ${statuses.length} orphaned branch statuses`),
937
- );
938
- }
939
-
940
- return statuses;
941
- } catch (error) {
942
- console.error(chalk.red("Error: Failed to get orphaned local branches"));
943
- if (process.env.DEBUG_CLEANUP) {
944
- console.error(chalk.red("Debug: Full error details:"), error);
945
- }
946
- return [];
947
- }
948
- }
949
-
950
- export async function getCleanupStatus({
951
- onProgress,
952
- }: {
953
- onProgress?: (status: CleanupStatus) => void;
954
- } = {}): Promise<CleanupStatus[]> {
955
- const [config, repoRoot, worktreesWithPR] = await Promise.all([
956
- getConfig(),
957
- getRepositoryRoot(),
958
- getWorktreesWithPRStatus(),
959
- ]);
960
- const baseBranch = config.defaultBaseBranch || GIT_CONFIG.DEFAULT_BASE_BRANCH;
961
-
962
- const orphanedStatuses = await getOrphanedLocalBranchStatuses({
963
- baseBranch,
964
- repoRoot,
965
- ...(onProgress ? { onProgress } : {}),
966
- });
967
- const statuses: CleanupStatus[] = [];
968
-
969
- if (process.env.DEBUG_CLEANUP) {
970
- console.log(chalk.cyan("Debug: Available worktrees:"));
971
- worktreesWithPR.forEach((w) =>
972
- console.log(` ${w.branch} -> ${w.worktreePath}`),
973
- );
974
- }
975
-
976
- for (const worktree of worktreesWithPR) {
977
- if (process.env.DEBUG_CLEANUP) {
978
- console.log(chalk.gray(`Debug: Checking worktree ${worktree.branch}`));
979
- }
980
-
981
- // worktreeパスの存在を確認
982
- const fsSync = await import("node:fs");
983
- const existsSync =
984
- typeof fsSync.existsSync === "function"
985
- ? fsSync.existsSync
986
- : typeof (fsSync as { default?: { existsSync?: unknown } }).default
987
- ?.existsSync === "function"
988
- ? (fsSync as { default: { existsSync: (p: string) => boolean } })
989
- .default.existsSync
990
- : null;
991
-
992
- const isAccessible = existsSync ? existsSync(worktree.worktreePath) : false;
993
-
994
- let hasUncommitted = false;
995
- let hasUnpushed = false;
996
-
997
- if (isAccessible) {
998
- try {
999
- [hasUncommitted, hasUnpushed] = await Promise.all([
1000
- hasUncommittedChanges(worktree.worktreePath),
1001
- hasUnpushedCommits(worktree.worktreePath, worktree.branch),
1002
- ]);
1003
- } catch (error) {
1004
- if (process.env.DEBUG_CLEANUP) {
1005
- console.log(
1006
- chalk.yellow(
1007
- `Debug: Failed to check status for worktree ${worktree.worktreePath}: ${error instanceof Error ? error.message : String(error)}`,
1008
- ),
1009
- );
1010
- }
1011
- }
1012
- }
1013
-
1014
- const { upstream, hasUpstream } = await resolveUpstreamStatus(
1015
- worktree.branch,
1016
- repoRoot,
1017
- );
1018
-
1019
- const hasUniqueCommits = await branchHasUniqueCommitsComparedToBase(
1020
- worktree.branch,
1021
- baseBranch,
1022
- repoRoot,
1023
- );
1024
-
1025
- const reasons = buildCleanupReasons({
1026
- hasUniqueCommits,
1027
- hasUncommitted,
1028
- hasUnpushed,
1029
- hasUpstream,
1030
- });
1031
-
1032
- if (process.env.DEBUG_CLEANUP) {
1033
- console.log(
1034
- chalk.gray(
1035
- `Debug: Cleanup reasons for ${worktree.branch}: ${reasons.length > 0 ? reasons.join(", ") : "none"}`,
1036
- ),
1037
- );
1038
- }
1039
-
1040
- const status: CleanupStatus = {
1041
- worktreePath: worktree.worktreePath,
1042
- branch: worktree.branch,
1043
- hasUncommittedChanges: hasUncommitted,
1044
- hasUnpushedCommits: hasUnpushed,
1045
- cleanupType: "worktree-and-branch",
1046
- hasRemoteBranch: hasUpstream,
1047
- hasUniqueCommits,
1048
- hasUpstream,
1049
- upstream,
1050
- isAccessible,
1051
- reasons,
1052
- ...(isAccessible
1053
- ? {}
1054
- : { invalidReason: "Path not accessible in current environment" }),
1055
- };
1056
- statuses.push(status);
1057
- onProgress?.(status);
1058
- }
1059
-
1060
- statuses.push(...orphanedStatuses);
1061
-
1062
- if (process.env.DEBUG_CLEANUP) {
1063
- const worktreeTargets = statuses.filter(
1064
- (t) => t.cleanupType === "worktree-and-branch" && t.reasons.length > 0,
1065
- ).length;
1066
- const branchOnlyTargets = statuses.filter(
1067
- (t) => t.cleanupType === "branch-only" && t.reasons.length > 0,
1068
- ).length;
1069
- console.log(
1070
- chalk.cyan(
1071
- `Debug: Found ${worktreeTargets + branchOnlyTargets} cleanup targets (${worktreeTargets} worktree+branch, ${branchOnlyTargets} branch-only)`,
1072
- ),
1073
- );
1074
- }
1075
-
1076
- return statuses;
1077
- }
1078
-
1079
- /**
1080
- * マージ済みPRに関連するworktreeおよびローカルブランチのクリーンアップ候補を取得
1081
- * @returns {Promise<CleanupTarget[]>} クリーンアップ候補の配列
1082
- */
1083
- export async function getMergedPRWorktrees(): Promise<CleanupTarget[]> {
1084
- const statuses = await getCleanupStatus();
1085
- const cleanupTargets = statuses
1086
- .filter((status) => status.reasons.length > 0)
1087
- .filter((status) => !isProtectedBranchName(status.branch))
1088
- .map((status) => {
1089
- const target: CleanupTarget = {
1090
- worktreePath: status.worktreePath,
1091
- branch: status.branch,
1092
- pullRequest: null,
1093
- hasUncommittedChanges: status.hasUncommittedChanges,
1094
- hasUnpushedCommits: status.hasUnpushedCommits,
1095
- cleanupType: status.cleanupType,
1096
- hasRemoteBranch: status.hasRemoteBranch,
1097
- reasons: status.reasons,
1098
- };
1099
- if (status.isAccessible !== undefined) {
1100
- target.isAccessible = status.isAccessible;
1101
- }
1102
- if (status.invalidReason) {
1103
- target.invalidReason = status.invalidReason;
1104
- }
1105
- return target;
1106
- });
1107
-
1108
- return cleanupTargets;
1109
- }