dmux 3.2.0 → 3.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (655) hide show
  1. package/dist/DmuxApp.d.ts.map +1 -1
  2. package/dist/DmuxApp.js +270 -1606
  3. package/dist/DmuxApp.js.map +1 -1
  4. package/dist/actions/implementations/closeAction.d.ts +10 -0
  5. package/dist/actions/implementations/closeAction.d.ts.map +1 -0
  6. package/dist/actions/implementations/closeAction.js +201 -0
  7. package/dist/actions/implementations/closeAction.js.map +1 -0
  8. package/dist/actions/implementations/copyPathAction.d.ts +10 -0
  9. package/dist/actions/implementations/copyPathAction.d.ts.map +1 -0
  10. package/dist/actions/implementations/copyPathAction.js +34 -0
  11. package/dist/actions/implementations/copyPathAction.js.map +1 -0
  12. package/dist/actions/implementations/duplicateAction.d.ts +10 -0
  13. package/dist/actions/implementations/duplicateAction.d.ts.map +1 -0
  14. package/dist/actions/implementations/duplicateAction.js +25 -0
  15. package/dist/actions/implementations/duplicateAction.js.map +1 -0
  16. package/dist/actions/implementations/index.d.ts +14 -0
  17. package/dist/actions/implementations/index.d.ts.map +1 -0
  18. package/dist/actions/implementations/index.js +14 -0
  19. package/dist/actions/implementations/index.js.map +1 -0
  20. package/dist/actions/implementations/mergeAction.d.ts +14 -0
  21. package/dist/actions/implementations/mergeAction.d.ts.map +1 -0
  22. package/dist/actions/implementations/mergeAction.js +84 -0
  23. package/dist/actions/implementations/mergeAction.js.map +1 -0
  24. package/dist/actions/implementations/openInEditorAction.d.ts +12 -0
  25. package/dist/actions/implementations/openInEditorAction.d.ts.map +1 -0
  26. package/dist/actions/implementations/openInEditorAction.js +33 -0
  27. package/dist/actions/implementations/openInEditorAction.js.map +1 -0
  28. package/dist/actions/implementations/renameAction.d.ts +13 -0
  29. package/dist/actions/implementations/renameAction.d.ts.map +1 -0
  30. package/dist/actions/implementations/renameAction.js +18 -0
  31. package/dist/actions/implementations/renameAction.js.map +1 -0
  32. package/dist/actions/implementations/toggleAutopilotAction.d.ts +10 -0
  33. package/dist/actions/implementations/toggleAutopilotAction.d.ts.map +1 -0
  34. package/dist/actions/implementations/toggleAutopilotAction.js +33 -0
  35. package/dist/actions/implementations/toggleAutopilotAction.js.map +1 -0
  36. package/dist/actions/implementations/viewAction.d.ts +10 -0
  37. package/dist/actions/implementations/viewAction.d.ts.map +1 -0
  38. package/dist/actions/implementations/viewAction.js +26 -0
  39. package/dist/actions/implementations/viewAction.js.map +1 -0
  40. package/dist/actions/merge/commitMessageHandler.d.ts +27 -0
  41. package/dist/actions/merge/commitMessageHandler.d.ts.map +1 -0
  42. package/dist/actions/merge/commitMessageHandler.js +123 -0
  43. package/dist/actions/merge/commitMessageHandler.js.map +1 -0
  44. package/dist/actions/merge/conflictResolution.d.ts +13 -0
  45. package/dist/actions/merge/conflictResolution.d.ts.map +1 -0
  46. package/dist/actions/merge/conflictResolution.js +134 -0
  47. package/dist/actions/merge/conflictResolution.js.map +1 -0
  48. package/dist/actions/merge/issueHandlers/index.d.ts +11 -0
  49. package/dist/actions/merge/issueHandlers/index.d.ts.map +1 -0
  50. package/dist/actions/merge/issueHandlers/index.js +8 -0
  51. package/dist/actions/merge/issueHandlers/index.js.map +1 -0
  52. package/dist/actions/merge/issueHandlers/mainDirtyHandler.d.ts +13 -0
  53. package/dist/actions/merge/issueHandlers/mainDirtyHandler.d.ts.map +1 -0
  54. package/dist/actions/merge/issueHandlers/mainDirtyHandler.js +72 -0
  55. package/dist/actions/merge/issueHandlers/mainDirtyHandler.js.map +1 -0
  56. package/dist/actions/merge/issueHandlers/mergeConflictHandler.d.ts +13 -0
  57. package/dist/actions/merge/issueHandlers/mergeConflictHandler.d.ts.map +1 -0
  58. package/dist/actions/merge/issueHandlers/mergeConflictHandler.js +52 -0
  59. package/dist/actions/merge/issueHandlers/mergeConflictHandler.js.map +1 -0
  60. package/dist/actions/merge/issueHandlers/nothingToMergeHandler.d.ts +7 -0
  61. package/dist/actions/merge/issueHandlers/nothingToMergeHandler.d.ts.map +1 -0
  62. package/dist/actions/merge/issueHandlers/nothingToMergeHandler.js +12 -0
  63. package/dist/actions/merge/issueHandlers/nothingToMergeHandler.js.map +1 -0
  64. package/dist/actions/merge/issueHandlers/worktreeUncommittedHandler.d.ts +13 -0
  65. package/dist/actions/merge/issueHandlers/worktreeUncommittedHandler.d.ts.map +1 -0
  66. package/dist/actions/merge/issueHandlers/worktreeUncommittedHandler.js +49 -0
  67. package/dist/actions/merge/issueHandlers/worktreeUncommittedHandler.js.map +1 -0
  68. package/dist/actions/merge/mergeExecution.d.ts +22 -0
  69. package/dist/actions/merge/mergeExecution.d.ts.map +1 -0
  70. package/dist/actions/merge/mergeExecution.js +184 -0
  71. package/dist/actions/merge/mergeExecution.js.map +1 -0
  72. package/dist/actions/paneActions.d.ts +3 -40
  73. package/dist/actions/paneActions.d.ts.map +1 -1
  74. package/dist/actions/paneActions.js +4 -1038
  75. package/dist/actions/paneActions.js.map +1 -1
  76. package/dist/actions/types.d.ts +1 -0
  77. package/dist/actions/types.d.ts.map +1 -1
  78. package/dist/actions/types.js.map +1 -1
  79. package/dist/components/{ActionChoiceDialog.d.ts → dialogs/ActionChoiceDialog.d.ts} +1 -1
  80. package/dist/components/dialogs/ActionChoiceDialog.d.ts.map +1 -0
  81. package/dist/components/dialogs/ActionChoiceDialog.js.map +1 -0
  82. package/dist/components/dialogs/ActionConfirmDialog.d.ts.map +1 -0
  83. package/dist/components/dialogs/ActionConfirmDialog.js.map +1 -0
  84. package/dist/components/dialogs/ActionInputDialog.d.ts.map +1 -0
  85. package/dist/components/{ActionInputDialog.js → dialogs/ActionInputDialog.js} +2 -2
  86. package/dist/components/dialogs/ActionInputDialog.js.map +1 -0
  87. package/dist/components/dialogs/ActionProgressDialog.d.ts.map +1 -0
  88. package/dist/components/dialogs/ActionProgressDialog.js.map +1 -0
  89. package/dist/components/dialogs/AgentChoiceDialog.d.ts.map +1 -0
  90. package/dist/components/dialogs/AgentChoiceDialog.js.map +1 -0
  91. package/dist/components/{CloseOptionsDialog.d.ts → dialogs/CloseOptionsDialog.d.ts} +1 -1
  92. package/dist/components/dialogs/CloseOptionsDialog.d.ts.map +1 -0
  93. package/dist/components/dialogs/CloseOptionsDialog.js.map +1 -0
  94. package/dist/components/dialogs/CommandPromptDialog.d.ts.map +1 -0
  95. package/dist/components/{CommandPromptDialog.js → dialogs/CommandPromptDialog.js} +1 -1
  96. package/dist/components/dialogs/CommandPromptDialog.js.map +1 -0
  97. package/dist/components/dialogs/DialogBox.d.ts.map +1 -0
  98. package/dist/components/dialogs/DialogBox.js.map +1 -0
  99. package/dist/components/dialogs/HooksDialog.d.ts.map +1 -0
  100. package/dist/components/dialogs/HooksDialog.js.map +1 -0
  101. package/dist/components/{MergeConfirmationDialog.d.ts → dialogs/MergeConfirmationDialog.d.ts} +1 -1
  102. package/dist/components/dialogs/MergeConfirmationDialog.d.ts.map +1 -0
  103. package/dist/components/dialogs/MergeConfirmationDialog.js.map +1 -0
  104. package/dist/components/{SettingsDialog.d.ts → dialogs/SettingsDialog.d.ts} +1 -1
  105. package/dist/components/dialogs/SettingsDialog.d.ts.map +1 -0
  106. package/dist/components/dialogs/SettingsDialog.js.map +1 -0
  107. package/dist/components/dialogs/UpdateDialog.d.ts.map +1 -0
  108. package/dist/components/dialogs/UpdateDialog.js.map +1 -0
  109. package/dist/components/indicators/CreatingIndicator.d.ts.map +1 -0
  110. package/dist/components/indicators/CreatingIndicator.js.map +1 -0
  111. package/dist/components/indicators/LoadingIndicator.d.ts.map +1 -0
  112. package/dist/components/indicators/LoadingIndicator.js.map +1 -0
  113. package/dist/components/indicators/RunningIndicator.d.ts.map +1 -0
  114. package/dist/components/indicators/RunningIndicator.js.map +1 -0
  115. package/dist/components/indicators/Spinner.d.ts.map +1 -0
  116. package/dist/components/indicators/Spinner.js.map +1 -0
  117. package/dist/components/indicators/UpdatingIndicator.d.ts.map +1 -0
  118. package/dist/components/indicators/UpdatingIndicator.js.map +1 -0
  119. package/dist/components/indicators/index.d.ts +6 -0
  120. package/dist/components/indicators/index.d.ts.map +1 -0
  121. package/dist/components/indicators/index.js +6 -0
  122. package/dist/components/indicators/index.js.map +1 -0
  123. package/dist/components/inputs/CleanTextInput.d.ts.map +1 -0
  124. package/dist/{CleanTextInput.js → components/inputs/CleanTextInput.js} +2 -144
  125. package/dist/components/inputs/CleanTextInput.js.map +1 -0
  126. package/dist/components/inputs/StyledTextInput.d.ts.map +1 -0
  127. package/dist/components/inputs/StyledTextInput.js.map +1 -0
  128. package/dist/components/inputs/index.d.ts +3 -0
  129. package/dist/components/inputs/index.d.ts.map +1 -0
  130. package/dist/components/inputs/index.js +3 -0
  131. package/dist/components/inputs/index.js.map +1 -0
  132. package/dist/components/{KebabMenu.d.ts → panes/KebabMenu.d.ts} +1 -1
  133. package/dist/components/panes/KebabMenu.d.ts.map +1 -0
  134. package/dist/components/panes/KebabMenu.js.map +1 -0
  135. package/dist/components/panes/MergePane.d.ts.map +1 -0
  136. package/dist/{MergePane.js → components/panes/MergePane.js} +1 -1
  137. package/dist/components/panes/MergePane.js.map +1 -0
  138. package/dist/components/{PaneCard.d.ts → panes/PaneCard.d.ts} +1 -1
  139. package/dist/components/panes/PaneCard.d.ts.map +1 -0
  140. package/dist/components/{PaneCard.js → panes/PaneCard.js} +1 -1
  141. package/dist/components/panes/PaneCard.js.map +1 -0
  142. package/dist/components/{PanesGrid.d.ts → panes/PanesGrid.d.ts} +2 -2
  143. package/dist/components/panes/PanesGrid.d.ts.map +1 -0
  144. package/dist/components/{PanesGrid.js → panes/PanesGrid.js} +1 -1
  145. package/dist/components/panes/PanesGrid.js.map +1 -0
  146. package/dist/components/panes/index.d.ts +5 -0
  147. package/dist/components/panes/index.d.ts.map +1 -0
  148. package/dist/components/panes/index.js +5 -0
  149. package/dist/components/panes/index.js.map +1 -0
  150. package/dist/components/popups/agentChoicePopup.d.ts.map +1 -0
  151. package/dist/{popups → components/popups}/agentChoicePopup.js +1 -1
  152. package/dist/components/popups/agentChoicePopup.js.map +1 -0
  153. package/dist/components/popups/choicePopup.d.ts.map +1 -0
  154. package/dist/{popups → components/popups}/choicePopup.js +3 -3
  155. package/dist/components/popups/choicePopup.js.map +1 -0
  156. package/dist/components/popups/config.d.ts.map +1 -0
  157. package/dist/{popups → components/popups}/config.js +1 -1
  158. package/dist/components/popups/config.js.map +1 -0
  159. package/dist/components/popups/confirmPopup.d.ts.map +1 -0
  160. package/dist/{popups → components/popups}/confirmPopup.js +2 -3
  161. package/dist/components/popups/confirmPopup.js.map +1 -0
  162. package/dist/components/popups/hooksPopup.d.ts.map +1 -0
  163. package/dist/{popups → components/popups}/hooksPopup.js +1 -1
  164. package/dist/components/popups/hooksPopup.js.map +1 -0
  165. package/dist/components/popups/inputPopup.d.ts.map +1 -0
  166. package/dist/{popups → components/popups}/inputPopup.js +3 -4
  167. package/dist/components/popups/inputPopup.js.map +1 -0
  168. package/dist/components/popups/kebabMenuPopup.d.ts.map +1 -0
  169. package/dist/{popups → components/popups}/kebabMenuPopup.js +1 -1
  170. package/dist/components/popups/kebabMenuPopup.js.map +1 -0
  171. package/dist/components/popups/logsPopup.d.ts.map +1 -0
  172. package/dist/{popups → components/popups}/logsPopup.js +15 -7
  173. package/dist/components/popups/logsPopup.js.map +1 -0
  174. package/dist/components/popups/mergePopup.d.ts.map +1 -0
  175. package/dist/{popups → components/popups}/mergePopup.js +6 -6
  176. package/dist/components/popups/mergePopup.js.map +1 -0
  177. package/dist/components/popups/newPanePopup.d.ts.map +1 -0
  178. package/dist/{popups → components/popups}/newPanePopup.js +3 -3
  179. package/dist/components/popups/newPanePopup.js.map +1 -0
  180. package/dist/components/popups/progressPopup.d.ts.map +1 -0
  181. package/dist/{popups → components/popups}/progressPopup.js +1 -2
  182. package/dist/components/popups/progressPopup.js.map +1 -0
  183. package/dist/components/popups/remotePopup.d.ts.map +1 -0
  184. package/dist/{popups → components/popups}/remotePopup.js +1 -1
  185. package/dist/components/popups/remotePopup.js.map +1 -0
  186. package/dist/components/popups/settingsPopup.d.ts.map +1 -0
  187. package/dist/{popups → components/popups}/settingsPopup.js +1 -1
  188. package/dist/components/popups/settingsPopup.js.map +1 -0
  189. package/dist/components/popups/shared/FileList.d.ts.map +1 -0
  190. package/dist/components/popups/shared/FileList.js.map +1 -0
  191. package/dist/components/popups/shared/PopupContainer.d.ts.map +1 -0
  192. package/dist/components/popups/shared/PopupContainer.js.map +1 -0
  193. package/dist/components/popups/shared/PopupInputBox.d.ts.map +1 -0
  194. package/dist/components/popups/shared/PopupInputBox.js.map +1 -0
  195. package/dist/components/popups/shared/PopupWrapper.d.ts.map +1 -0
  196. package/dist/components/popups/shared/PopupWrapper.js.map +1 -0
  197. package/dist/components/popups/shared/index.d.ts.map +1 -0
  198. package/dist/components/popups/shared/index.js.map +1 -0
  199. package/dist/components/popups/shortcutsPopup.d.ts.map +1 -0
  200. package/dist/{popups → components/popups}/shortcutsPopup.js +1 -1
  201. package/dist/components/popups/shortcutsPopup.js.map +1 -0
  202. package/dist/components/popups/templates/SimpleInputPopup.d.ts.map +1 -0
  203. package/dist/{popups → components/popups}/templates/SimpleInputPopup.js +2 -2
  204. package/dist/components/popups/templates/SimpleInputPopup.js.map +1 -0
  205. package/dist/components/ui/FileCopyPrompt.d.ts.map +1 -0
  206. package/dist/components/ui/FileCopyPrompt.js.map +1 -0
  207. package/dist/components/{FooterHelp.d.ts → ui/FooterHelp.d.ts} +4 -0
  208. package/dist/components/ui/FooterHelp.d.ts.map +1 -0
  209. package/dist/components/{FooterHelp.js → ui/FooterHelp.js} +45 -1
  210. package/dist/components/ui/FooterHelp.js.map +1 -0
  211. package/dist/components/ui/QRCode.d.ts.map +1 -0
  212. package/dist/components/ui/QRCode.js.map +1 -0
  213. package/dist/components/ui/ToastNotification.d.ts +13 -0
  214. package/dist/components/ui/ToastNotification.d.ts.map +1 -0
  215. package/dist/components/ui/ToastNotification.js +22 -0
  216. package/dist/components/ui/ToastNotification.js.map +1 -0
  217. package/dist/components/ui/index.d.ts +4 -0
  218. package/dist/components/ui/index.d.ts.map +1 -0
  219. package/dist/components/ui/index.js +4 -0
  220. package/dist/components/ui/index.js.map +1 -0
  221. package/dist/constants/timing.d.ts +22 -0
  222. package/dist/constants/timing.d.ts.map +1 -0
  223. package/dist/constants/timing.js +26 -0
  224. package/dist/constants/timing.js.map +1 -0
  225. package/dist/dashboard.js +2 -2
  226. package/dist/hooks/useActionSystem.d.ts +5 -4
  227. package/dist/hooks/useActionSystem.d.ts.map +1 -1
  228. package/dist/hooks/useActionSystem.js +105 -114
  229. package/dist/hooks/useActionSystem.js.map +1 -1
  230. package/dist/hooks/useDebugInfo.d.ts +11 -0
  231. package/dist/hooks/useDebugInfo.d.ts.map +1 -0
  232. package/dist/hooks/useDebugInfo.js +34 -0
  233. package/dist/hooks/useDebugInfo.js.map +1 -0
  234. package/dist/hooks/useDialogState.d.ts +22 -0
  235. package/dist/hooks/useDialogState.d.ts.map +1 -0
  236. package/dist/hooks/useDialogState.js +62 -0
  237. package/dist/hooks/useDialogState.js.map +1 -0
  238. package/dist/hooks/useInputHandling.d.ts +60 -0
  239. package/dist/hooks/useInputHandling.d.ts.map +1 -0
  240. package/dist/hooks/useInputHandling.js +294 -0
  241. package/dist/hooks/useInputHandling.js.map +1 -0
  242. package/dist/hooks/useLayoutManagement.d.ts +12 -0
  243. package/dist/hooks/useLayoutManagement.d.ts.map +1 -0
  244. package/dist/hooks/useLayoutManagement.js +63 -0
  245. package/dist/hooks/useLayoutManagement.js.map +1 -0
  246. package/dist/hooks/usePaneCreation.d.ts.map +1 -1
  247. package/dist/hooks/usePaneCreation.js +4 -9
  248. package/dist/hooks/usePaneCreation.js.map +1 -1
  249. package/dist/hooks/usePaneLoading.d.ts +45 -0
  250. package/dist/hooks/usePaneLoading.d.ts.map +1 -0
  251. package/dist/hooks/usePaneLoading.js +208 -0
  252. package/dist/hooks/usePaneLoading.js.map +1 -0
  253. package/dist/hooks/usePaneRunner.d.ts.map +1 -1
  254. package/dist/hooks/usePaneRunner.js +9 -6
  255. package/dist/hooks/usePaneRunner.js.map +1 -1
  256. package/dist/hooks/usePaneSync.d.ts +34 -0
  257. package/dist/hooks/usePaneSync.d.ts.map +1 -0
  258. package/dist/hooks/usePaneSync.js +186 -0
  259. package/dist/hooks/usePaneSync.js.map +1 -0
  260. package/dist/hooks/usePanes.d.ts.map +1 -1
  261. package/dist/hooks/usePanes.js +68 -406
  262. package/dist/hooks/usePanes.js.map +1 -1
  263. package/dist/hooks/useServices.d.ts +24 -0
  264. package/dist/hooks/useServices.d.ts.map +1 -0
  265. package/dist/hooks/useServices.js +39 -0
  266. package/dist/hooks/useServices.js.map +1 -0
  267. package/dist/hooks/useShellDetection.d.ts +10 -0
  268. package/dist/hooks/useShellDetection.d.ts.map +1 -0
  269. package/dist/hooks/useShellDetection.js +67 -0
  270. package/dist/hooks/useShellDetection.js.map +1 -0
  271. package/dist/hooks/useStatusMessages.d.ts +11 -0
  272. package/dist/hooks/useStatusMessages.d.ts.map +1 -0
  273. package/dist/hooks/useStatusMessages.js +32 -0
  274. package/dist/hooks/useStatusMessages.js.map +1 -0
  275. package/dist/hooks/useTemporaryStatus.d.ts +13 -0
  276. package/dist/hooks/useTemporaryStatus.d.ts.map +1 -0
  277. package/dist/hooks/useTemporaryStatus.js +30 -0
  278. package/dist/hooks/useTemporaryStatus.js.map +1 -0
  279. package/dist/hooks/useTerminalWidth.d.ts.map +1 -1
  280. package/dist/hooks/useTerminalWidth.js +7 -12
  281. package/dist/hooks/useTerminalWidth.js.map +1 -1
  282. package/dist/hooks/useTunnelManagement.d.ts +18 -0
  283. package/dist/hooks/useTunnelManagement.d.ts.map +1 -0
  284. package/dist/hooks/useTunnelManagement.js +55 -0
  285. package/dist/hooks/useTunnelManagement.js.map +1 -0
  286. package/dist/hooks/useWorktreeActions.d.ts.map +1 -1
  287. package/dist/hooks/useWorktreeActions.js +18 -13
  288. package/dist/hooks/useWorktreeActions.js.map +1 -1
  289. package/dist/index.js +124 -94
  290. package/dist/index.js.map +1 -1
  291. package/dist/layout/LayoutCalculator.d.ts +62 -0
  292. package/dist/layout/LayoutCalculator.d.ts.map +1 -0
  293. package/dist/layout/LayoutCalculator.js +140 -0
  294. package/dist/layout/LayoutCalculator.js.map +1 -0
  295. package/dist/layout/SpacerManager.d.ts +64 -0
  296. package/dist/layout/SpacerManager.d.ts.map +1 -0
  297. package/dist/layout/SpacerManager.js +156 -0
  298. package/dist/layout/SpacerManager.js.map +1 -0
  299. package/dist/layout/TmuxLayoutApplier.d.ts +62 -0
  300. package/dist/layout/TmuxLayoutApplier.d.ts.map +1 -0
  301. package/dist/layout/TmuxLayoutApplier.js +147 -0
  302. package/dist/layout/TmuxLayoutApplier.js.map +1 -0
  303. package/dist/panes/decorative-pane.d.ts.map +1 -0
  304. package/dist/{decorative-pane.js → panes/decorative-pane.js} +1 -1
  305. package/dist/panes/decorative-pane.js.map +1 -0
  306. package/dist/panes/spacer-pane.d.ts.map +1 -0
  307. package/dist/panes/spacer-pane.js.map +1 -0
  308. package/dist/server/embedded-assets.d.ts.map +1 -1
  309. package/dist/server/embedded-assets.js +727 -5677
  310. package/dist/server/embedded-assets.js.map +1 -1
  311. package/dist/server/routes/actionsRoutes.d.ts +2 -0
  312. package/dist/server/routes/actionsRoutes.d.ts.map +1 -0
  313. package/dist/server/routes/actionsRoutes.js +110 -0
  314. package/dist/server/routes/actionsRoutes.js.map +1 -0
  315. package/dist/server/routes/healthRoutes.d.ts +13 -0
  316. package/dist/server/routes/healthRoutes.d.ts.map +1 -0
  317. package/dist/server/routes/healthRoutes.js +70 -0
  318. package/dist/server/routes/healthRoutes.js.map +1 -0
  319. package/dist/server/routes/index.d.ts +8 -0
  320. package/dist/server/routes/index.d.ts.map +1 -0
  321. package/dist/server/routes/index.js +67 -0
  322. package/dist/server/routes/index.js.map +1 -0
  323. package/dist/server/routes/keysRoutes.d.ts +33 -0
  324. package/dist/server/routes/keysRoutes.d.ts.map +1 -0
  325. package/dist/server/routes/keysRoutes.js +128 -0
  326. package/dist/server/routes/keysRoutes.js.map +1 -0
  327. package/dist/server/routes/panesRoutes.d.ts +2 -0
  328. package/dist/server/routes/panesRoutes.d.ts.map +1 -0
  329. package/dist/server/routes/panesRoutes.js +373 -0
  330. package/dist/server/routes/panesRoutes.js.map +1 -0
  331. package/dist/server/routes/settingsRoutes.d.ts +94 -0
  332. package/dist/server/routes/settingsRoutes.d.ts.map +1 -0
  333. package/dist/server/routes/settingsRoutes.js +159 -0
  334. package/dist/server/routes/settingsRoutes.js.map +1 -0
  335. package/dist/server/routes/streamRoutes.d.ts +18 -0
  336. package/dist/server/routes/streamRoutes.d.ts.map +1 -0
  337. package/dist/server/routes/streamRoutes.js +87 -0
  338. package/dist/server/routes/streamRoutes.js.map +1 -0
  339. package/dist/server/routes/tunnelRoutes.d.ts +11 -0
  340. package/dist/server/routes/tunnelRoutes.d.ts.map +1 -0
  341. package/dist/server/routes/tunnelRoutes.js +28 -0
  342. package/dist/server/routes/tunnelRoutes.js.map +1 -0
  343. package/dist/server/routes.d.ts +16 -2
  344. package/dist/server/routes.d.ts.map +1 -1
  345. package/dist/server/routes.js +16 -878
  346. package/dist/server/routes.js.map +1 -1
  347. package/dist/{AutoUpdater.d.ts → services/AutoUpdater.d.ts} +1 -0
  348. package/dist/services/AutoUpdater.d.ts.map +1 -0
  349. package/dist/{AutoUpdater.js → services/AutoUpdater.js} +44 -10
  350. package/dist/services/AutoUpdater.js.map +1 -0
  351. package/dist/services/PaneAnalyzer.d.ts.map +1 -0
  352. package/dist/{PaneAnalyzer.js → services/PaneAnalyzer.js} +1 -1
  353. package/dist/services/PaneAnalyzer.js.map +1 -0
  354. package/dist/services/PaneLifecycleManager.d.ts +60 -0
  355. package/dist/services/PaneLifecycleManager.d.ts.map +1 -0
  356. package/dist/services/PaneLifecycleManager.js +119 -0
  357. package/dist/services/PaneLifecycleManager.js.map +1 -0
  358. package/dist/services/PaneWorkerManager.d.ts.map +1 -1
  359. package/dist/services/PaneWorkerManager.js +6 -3
  360. package/dist/services/PaneWorkerManager.js.map +1 -1
  361. package/dist/services/PopupManager.d.ts +68 -0
  362. package/dist/services/PopupManager.d.ts.map +1 -0
  363. package/dist/services/PopupManager.js +415 -0
  364. package/dist/services/PopupManager.js.map +1 -0
  365. package/dist/services/StatusDetector.d.ts.map +1 -1
  366. package/dist/services/StatusDetector.js +6 -8
  367. package/dist/services/StatusDetector.js.map +1 -1
  368. package/dist/services/TerminalStreamer.d.ts +1 -0
  369. package/dist/services/TerminalStreamer.d.ts.map +1 -1
  370. package/dist/services/TerminalStreamer.js +22 -16
  371. package/dist/services/TerminalStreamer.js.map +1 -1
  372. package/dist/services/TmuxService.d.ts +346 -0
  373. package/dist/services/TmuxService.d.ts.map +1 -0
  374. package/dist/services/TmuxService.js +849 -0
  375. package/dist/services/TmuxService.js.map +1 -0
  376. package/dist/services/ToastService.d.ts +71 -0
  377. package/dist/services/ToastService.d.ts.map +1 -0
  378. package/dist/services/ToastService.js +151 -0
  379. package/dist/services/ToastService.js.map +1 -0
  380. package/dist/services/TunnelService.d.ts.map +1 -1
  381. package/dist/services/TunnelService.js +2 -1
  382. package/dist/services/TunnelService.js.map +1 -1
  383. package/dist/shared/StateManager.d.ts +22 -0
  384. package/dist/shared/StateManager.d.ts.map +1 -1
  385. package/dist/shared/StateManager.js +68 -1
  386. package/dist/shared/StateManager.js.map +1 -1
  387. package/dist/terminal.js +3 -3
  388. package/dist/types.d.ts +7 -0
  389. package/dist/types.d.ts.map +1 -1
  390. package/dist/utils/asciiArt.d.ts.map +1 -1
  391. package/dist/utils/asciiArt.js +9 -22
  392. package/dist/utils/asciiArt.js.map +1 -1
  393. package/dist/utils/atomicWrite.d.ts +33 -0
  394. package/dist/utils/atomicWrite.d.ts.map +1 -0
  395. package/dist/utils/atomicWrite.js +89 -0
  396. package/dist/utils/atomicWrite.js.map +1 -0
  397. package/dist/utils/conflictMonitor.d.ts +20 -0
  398. package/dist/utils/conflictMonitor.d.ts.map +1 -0
  399. package/dist/utils/conflictMonitor.js +113 -0
  400. package/dist/utils/conflictMonitor.js.map +1 -0
  401. package/dist/utils/conflictResolutionPane.d.ts.map +1 -1
  402. package/dist/utils/conflictResolutionPane.js +70 -79
  403. package/dist/utils/conflictResolutionPane.js.map +1 -1
  404. package/dist/utils/errorHandling.d.ts +37 -0
  405. package/dist/utils/errorHandling.d.ts.map +1 -0
  406. package/dist/utils/errorHandling.js +138 -0
  407. package/dist/utils/errorHandling.js.map +1 -0
  408. package/dist/utils/generated-agents-doc.d.ts +1 -1
  409. package/dist/utils/generated-agents-doc.js +1 -1
  410. package/dist/utils/git.d.ts +4 -0
  411. package/dist/utils/git.d.ts.map +1 -1
  412. package/dist/utils/git.js +15 -0
  413. package/dist/utils/git.js.map +1 -1
  414. package/dist/utils/hooksDocs.d.ts +1 -1
  415. package/dist/utils/layoutManager.d.ts +20 -16
  416. package/dist/utils/layoutManager.d.ts.map +1 -1
  417. package/dist/utils/layoutManager.js +159 -380
  418. package/dist/utils/layoutManager.js.map +1 -1
  419. package/dist/utils/mergeExecution.d.ts.map +1 -1
  420. package/dist/utils/mergeExecution.js +8 -1
  421. package/dist/utils/mergeExecution.js.map +1 -1
  422. package/dist/utils/mergeValidation.d.ts.map +1 -1
  423. package/dist/utils/mergeValidation.js +46 -13
  424. package/dist/utils/mergeValidation.js.map +1 -1
  425. package/dist/utils/paneCreation.d.ts.map +1 -1
  426. package/dist/utils/paneCreation.js +115 -106
  427. package/dist/utils/paneCreation.js.map +1 -1
  428. package/dist/utils/paneRebinding.d.ts +14 -0
  429. package/dist/utils/paneRebinding.d.ts.map +1 -0
  430. package/dist/utils/paneRebinding.js +30 -0
  431. package/dist/utils/paneRebinding.js.map +1 -0
  432. package/dist/utils/popup.d.ts.map +1 -1
  433. package/dist/utils/popup.js +11 -17
  434. package/dist/utils/popup.js.map +1 -1
  435. package/dist/utils/postPaneCleanup.d.ts.map +1 -1
  436. package/dist/utils/postPaneCleanup.js +5 -14
  437. package/dist/utils/postPaneCleanup.js.map +1 -1
  438. package/dist/utils/shellPaneDetection.d.ts +3 -3
  439. package/dist/utils/shellPaneDetection.d.ts.map +1 -1
  440. package/dist/utils/shellPaneDetection.js +43 -29
  441. package/dist/utils/shellPaneDetection.js.map +1 -1
  442. package/dist/utils/systemCheck.d.ts +19 -0
  443. package/dist/utils/systemCheck.d.ts.map +1 -0
  444. package/dist/utils/systemCheck.js +160 -0
  445. package/dist/utils/systemCheck.js.map +1 -0
  446. package/dist/utils/tmux.d.ts +26 -7
  447. package/dist/utils/tmux.d.ts.map +1 -1
  448. package/dist/utils/tmux.js +84 -76
  449. package/dist/utils/tmux.js.map +1 -1
  450. package/dist/utils/welcomePane.d.ts +2 -2
  451. package/dist/utils/welcomePane.d.ts.map +1 -1
  452. package/dist/utils/welcomePane.js +19 -33
  453. package/dist/utils/welcomePane.js.map +1 -1
  454. package/dist/utils/welcomePaneManager.d.ts.map +1 -1
  455. package/dist/utils/welcomePaneManager.js +11 -25
  456. package/dist/utils/welcomePaneManager.js.map +1 -1
  457. package/dist/workers/PaneWorker.js +7 -9
  458. package/dist/workers/PaneWorker.js.map +1 -1
  459. package/dist/workers/updateChecker.js +1 -1
  460. package/dist/workers/updateChecker.js.map +1 -1
  461. package/package.json +3 -1
  462. package/dist/AutoUpdater.d.ts.map +0 -1
  463. package/dist/AutoUpdater.js.map +0 -1
  464. package/dist/BetterTextInput.d.ts +0 -10
  465. package/dist/BetterTextInput.d.ts.map +0 -1
  466. package/dist/BetterTextInput.js +0 -177
  467. package/dist/BetterTextInput.js.map +0 -1
  468. package/dist/CleanTextInput.d.ts.map +0 -1
  469. package/dist/CleanTextInput.js.map +0 -1
  470. package/dist/EnhancedTextInput.d.ts +0 -13
  471. package/dist/EnhancedTextInput.d.ts.map +0 -1
  472. package/dist/EnhancedTextInput.js +0 -443
  473. package/dist/EnhancedTextInput.js.map +0 -1
  474. package/dist/GeminiTextInput.d.ts +0 -12
  475. package/dist/GeminiTextInput.d.ts.map +0 -1
  476. package/dist/GeminiTextInput.js +0 -210
  477. package/dist/GeminiTextInput.js.map +0 -1
  478. package/dist/MergePane.d.ts.map +0 -1
  479. package/dist/MergePane.js.map +0 -1
  480. package/dist/MultilineTextInput.d.ts +0 -10
  481. package/dist/MultilineTextInput.d.ts.map +0 -1
  482. package/dist/MultilineTextInput.js +0 -184
  483. package/dist/MultilineTextInput.js.map +0 -1
  484. package/dist/PaneAnalyzer.d.ts.map +0 -1
  485. package/dist/PaneAnalyzer.js.map +0 -1
  486. package/dist/SimpleEnhancedInput.d.ts +0 -13
  487. package/dist/SimpleEnhancedInput.d.ts.map +0 -1
  488. package/dist/SimpleEnhancedInput.js +0 -639
  489. package/dist/SimpleEnhancedInput.js.map +0 -1
  490. package/dist/SimpleGeminiInput.d.ts +0 -12
  491. package/dist/SimpleGeminiInput.d.ts.map +0 -1
  492. package/dist/SimpleGeminiInput.js +0 -223
  493. package/dist/SimpleGeminiInput.js.map +0 -1
  494. package/dist/StyledTextInput.d.ts.map +0 -1
  495. package/dist/StyledTextInput.js.map +0 -1
  496. package/dist/components/ActionChoiceDialog.d.ts.map +0 -1
  497. package/dist/components/ActionChoiceDialog.js.map +0 -1
  498. package/dist/components/ActionConfirmDialog.d.ts.map +0 -1
  499. package/dist/components/ActionConfirmDialog.js.map +0 -1
  500. package/dist/components/ActionInputDialog.d.ts.map +0 -1
  501. package/dist/components/ActionInputDialog.js.map +0 -1
  502. package/dist/components/ActionProgressDialog.d.ts.map +0 -1
  503. package/dist/components/ActionProgressDialog.js.map +0 -1
  504. package/dist/components/AgentChoiceDialog.d.ts.map +0 -1
  505. package/dist/components/AgentChoiceDialog.js.map +0 -1
  506. package/dist/components/CloseOptionsDialog.d.ts.map +0 -1
  507. package/dist/components/CloseOptionsDialog.js.map +0 -1
  508. package/dist/components/CommandPromptDialog.d.ts.map +0 -1
  509. package/dist/components/CommandPromptDialog.js.map +0 -1
  510. package/dist/components/CreatingIndicator.d.ts.map +0 -1
  511. package/dist/components/CreatingIndicator.js.map +0 -1
  512. package/dist/components/DialogBox.d.ts.map +0 -1
  513. package/dist/components/DialogBox.js.map +0 -1
  514. package/dist/components/FileCopyPrompt.d.ts.map +0 -1
  515. package/dist/components/FileCopyPrompt.js.map +0 -1
  516. package/dist/components/FooterHelp.d.ts.map +0 -1
  517. package/dist/components/FooterHelp.js.map +0 -1
  518. package/dist/components/HooksDialog.d.ts.map +0 -1
  519. package/dist/components/HooksDialog.js.map +0 -1
  520. package/dist/components/KebabMenu.d.ts.map +0 -1
  521. package/dist/components/KebabMenu.js.map +0 -1
  522. package/dist/components/LoadingIndicator.d.ts.map +0 -1
  523. package/dist/components/LoadingIndicator.js.map +0 -1
  524. package/dist/components/MergeConfirmationDialog.d.ts.map +0 -1
  525. package/dist/components/MergeConfirmationDialog.js.map +0 -1
  526. package/dist/components/PaneCard.d.ts.map +0 -1
  527. package/dist/components/PaneCard.js.map +0 -1
  528. package/dist/components/PanesGrid.d.ts.map +0 -1
  529. package/dist/components/PanesGrid.js.map +0 -1
  530. package/dist/components/QRCode.d.ts.map +0 -1
  531. package/dist/components/QRCode.js.map +0 -1
  532. package/dist/components/RunningIndicator.d.ts.map +0 -1
  533. package/dist/components/RunningIndicator.js.map +0 -1
  534. package/dist/components/SettingsDialog.d.ts.map +0 -1
  535. package/dist/components/SettingsDialog.js.map +0 -1
  536. package/dist/components/Spinner.d.ts.map +0 -1
  537. package/dist/components/Spinner.js.map +0 -1
  538. package/dist/components/UpdateDialog.d.ts.map +0 -1
  539. package/dist/components/UpdateDialog.js.map +0 -1
  540. package/dist/components/UpdatingIndicator.d.ts.map +0 -1
  541. package/dist/components/UpdatingIndicator.js.map +0 -1
  542. package/dist/decorative-pane.d.ts.map +0 -1
  543. package/dist/decorative-pane.js.map +0 -1
  544. package/dist/popups/agentChoicePopup.d.ts.map +0 -1
  545. package/dist/popups/agentChoicePopup.js.map +0 -1
  546. package/dist/popups/choicePopup.d.ts.map +0 -1
  547. package/dist/popups/choicePopup.js.map +0 -1
  548. package/dist/popups/components/FileList.d.ts.map +0 -1
  549. package/dist/popups/components/FileList.js.map +0 -1
  550. package/dist/popups/components/PopupContainer.d.ts.map +0 -1
  551. package/dist/popups/components/PopupContainer.js.map +0 -1
  552. package/dist/popups/components/PopupInputBox.d.ts.map +0 -1
  553. package/dist/popups/components/PopupInputBox.js.map +0 -1
  554. package/dist/popups/components/PopupWrapper.d.ts.map +0 -1
  555. package/dist/popups/components/PopupWrapper.js.map +0 -1
  556. package/dist/popups/components/index.d.ts.map +0 -1
  557. package/dist/popups/components/index.js.map +0 -1
  558. package/dist/popups/config.d.ts.map +0 -1
  559. package/dist/popups/config.js.map +0 -1
  560. package/dist/popups/confirmPopup.d.ts.map +0 -1
  561. package/dist/popups/confirmPopup.js.map +0 -1
  562. package/dist/popups/hooksPopup.d.ts.map +0 -1
  563. package/dist/popups/hooksPopup.js.map +0 -1
  564. package/dist/popups/inputPopup.d.ts.map +0 -1
  565. package/dist/popups/inputPopup.js.map +0 -1
  566. package/dist/popups/kebabMenuPopup.d.ts.map +0 -1
  567. package/dist/popups/kebabMenuPopup.js.map +0 -1
  568. package/dist/popups/logsPopup.d.ts.map +0 -1
  569. package/dist/popups/logsPopup.js.map +0 -1
  570. package/dist/popups/mergePopup.d.ts.map +0 -1
  571. package/dist/popups/mergePopup.js.map +0 -1
  572. package/dist/popups/newPanePopup.d.ts.map +0 -1
  573. package/dist/popups/newPanePopup.js.map +0 -1
  574. package/dist/popups/progressPopup.d.ts.map +0 -1
  575. package/dist/popups/progressPopup.js.map +0 -1
  576. package/dist/popups/remotePopup.d.ts.map +0 -1
  577. package/dist/popups/remotePopup.js.map +0 -1
  578. package/dist/popups/settingsPopup.d.ts.map +0 -1
  579. package/dist/popups/settingsPopup.js.map +0 -1
  580. package/dist/popups/shortcutsPopup.d.ts.map +0 -1
  581. package/dist/popups/shortcutsPopup.js.map +0 -1
  582. package/dist/popups/templates/SimpleInputPopup.d.ts.map +0 -1
  583. package/dist/popups/templates/SimpleInputPopup.js.map +0 -1
  584. package/dist/server/static.d.ts +0 -6
  585. package/dist/server/static.d.ts.map +0 -1
  586. package/dist/server/static.js +0 -3040
  587. package/dist/server/static.js.map +0 -1
  588. package/dist/spacer-pane.d.ts.map +0 -1
  589. package/dist/spacer-pane.js.map +0 -1
  590. /package/dist/components/{ActionChoiceDialog.js → dialogs/ActionChoiceDialog.js} +0 -0
  591. /package/dist/components/{ActionConfirmDialog.d.ts → dialogs/ActionConfirmDialog.d.ts} +0 -0
  592. /package/dist/components/{ActionConfirmDialog.js → dialogs/ActionConfirmDialog.js} +0 -0
  593. /package/dist/components/{ActionInputDialog.d.ts → dialogs/ActionInputDialog.d.ts} +0 -0
  594. /package/dist/components/{ActionProgressDialog.d.ts → dialogs/ActionProgressDialog.d.ts} +0 -0
  595. /package/dist/components/{ActionProgressDialog.js → dialogs/ActionProgressDialog.js} +0 -0
  596. /package/dist/components/{AgentChoiceDialog.d.ts → dialogs/AgentChoiceDialog.d.ts} +0 -0
  597. /package/dist/components/{AgentChoiceDialog.js → dialogs/AgentChoiceDialog.js} +0 -0
  598. /package/dist/components/{CloseOptionsDialog.js → dialogs/CloseOptionsDialog.js} +0 -0
  599. /package/dist/components/{CommandPromptDialog.d.ts → dialogs/CommandPromptDialog.d.ts} +0 -0
  600. /package/dist/components/{DialogBox.d.ts → dialogs/DialogBox.d.ts} +0 -0
  601. /package/dist/components/{DialogBox.js → dialogs/DialogBox.js} +0 -0
  602. /package/dist/components/{HooksDialog.d.ts → dialogs/HooksDialog.d.ts} +0 -0
  603. /package/dist/components/{HooksDialog.js → dialogs/HooksDialog.js} +0 -0
  604. /package/dist/components/{MergeConfirmationDialog.js → dialogs/MergeConfirmationDialog.js} +0 -0
  605. /package/dist/components/{SettingsDialog.js → dialogs/SettingsDialog.js} +0 -0
  606. /package/dist/components/{UpdateDialog.d.ts → dialogs/UpdateDialog.d.ts} +0 -0
  607. /package/dist/components/{UpdateDialog.js → dialogs/UpdateDialog.js} +0 -0
  608. /package/dist/components/{CreatingIndicator.d.ts → indicators/CreatingIndicator.d.ts} +0 -0
  609. /package/dist/components/{CreatingIndicator.js → indicators/CreatingIndicator.js} +0 -0
  610. /package/dist/components/{LoadingIndicator.d.ts → indicators/LoadingIndicator.d.ts} +0 -0
  611. /package/dist/components/{LoadingIndicator.js → indicators/LoadingIndicator.js} +0 -0
  612. /package/dist/components/{RunningIndicator.d.ts → indicators/RunningIndicator.d.ts} +0 -0
  613. /package/dist/components/{RunningIndicator.js → indicators/RunningIndicator.js} +0 -0
  614. /package/dist/components/{Spinner.d.ts → indicators/Spinner.d.ts} +0 -0
  615. /package/dist/components/{Spinner.js → indicators/Spinner.js} +0 -0
  616. /package/dist/components/{UpdatingIndicator.d.ts → indicators/UpdatingIndicator.d.ts} +0 -0
  617. /package/dist/components/{UpdatingIndicator.js → indicators/UpdatingIndicator.js} +0 -0
  618. /package/dist/{CleanTextInput.d.ts → components/inputs/CleanTextInput.d.ts} +0 -0
  619. /package/dist/{StyledTextInput.d.ts → components/inputs/StyledTextInput.d.ts} +0 -0
  620. /package/dist/{StyledTextInput.js → components/inputs/StyledTextInput.js} +0 -0
  621. /package/dist/components/{KebabMenu.js → panes/KebabMenu.js} +0 -0
  622. /package/dist/{MergePane.d.ts → components/panes/MergePane.d.ts} +0 -0
  623. /package/dist/{popups → components/popups}/agentChoicePopup.d.ts +0 -0
  624. /package/dist/{popups → components/popups}/choicePopup.d.ts +0 -0
  625. /package/dist/{popups → components/popups}/config.d.ts +0 -0
  626. /package/dist/{popups → components/popups}/confirmPopup.d.ts +0 -0
  627. /package/dist/{popups → components/popups}/hooksPopup.d.ts +0 -0
  628. /package/dist/{popups → components/popups}/inputPopup.d.ts +0 -0
  629. /package/dist/{popups → components/popups}/kebabMenuPopup.d.ts +0 -0
  630. /package/dist/{popups → components/popups}/logsPopup.d.ts +0 -0
  631. /package/dist/{popups → components/popups}/mergePopup.d.ts +0 -0
  632. /package/dist/{popups → components/popups}/newPanePopup.d.ts +0 -0
  633. /package/dist/{popups → components/popups}/progressPopup.d.ts +0 -0
  634. /package/dist/{popups → components/popups}/remotePopup.d.ts +0 -0
  635. /package/dist/{popups → components/popups}/settingsPopup.d.ts +0 -0
  636. /package/dist/{popups/components → components/popups/shared}/FileList.d.ts +0 -0
  637. /package/dist/{popups/components → components/popups/shared}/FileList.js +0 -0
  638. /package/dist/{popups/components → components/popups/shared}/PopupContainer.d.ts +0 -0
  639. /package/dist/{popups/components → components/popups/shared}/PopupContainer.js +0 -0
  640. /package/dist/{popups/components → components/popups/shared}/PopupInputBox.d.ts +0 -0
  641. /package/dist/{popups/components → components/popups/shared}/PopupInputBox.js +0 -0
  642. /package/dist/{popups/components → components/popups/shared}/PopupWrapper.d.ts +0 -0
  643. /package/dist/{popups/components → components/popups/shared}/PopupWrapper.js +0 -0
  644. /package/dist/{popups/components → components/popups/shared}/index.d.ts +0 -0
  645. /package/dist/{popups/components → components/popups/shared}/index.js +0 -0
  646. /package/dist/{popups → components/popups}/shortcutsPopup.d.ts +0 -0
  647. /package/dist/{popups → components/popups}/templates/SimpleInputPopup.d.ts +0 -0
  648. /package/dist/components/{FileCopyPrompt.d.ts → ui/FileCopyPrompt.d.ts} +0 -0
  649. /package/dist/components/{FileCopyPrompt.js → ui/FileCopyPrompt.js} +0 -0
  650. /package/dist/components/{QRCode.d.ts → ui/QRCode.d.ts} +0 -0
  651. /package/dist/components/{QRCode.js → ui/QRCode.js} +0 -0
  652. /package/dist/{decorative-pane.d.ts → panes/decorative-pane.d.ts} +0 -0
  653. /package/dist/{spacer-pane.d.ts → panes/spacer-pane.d.ts} +0 -0
  654. /package/dist/{spacer-pane.js → panes/spacer-pane.js} +0 -0
  655. /package/dist/{PaneAnalyzer.d.ts → services/PaneAnalyzer.d.ts} +0 -0
@@ -1,1043 +1,9 @@
1
1
  /**
2
2
  * Standardized Pane Actions
3
3
  *
4
- * Core action implementations that work across all interfaces.
5
- * Each action returns a standardized ActionResult that interfaces can handle.
4
+ * Re-exports all action implementations from the implementations directory.
5
+ * This file maintains backward compatibility while actions are now split into separate files.
6
6
  */
7
- import { execSync } from 'child_process';
8
- import { StateManager } from '../shared/StateManager.js';
9
- import { triggerHook } from '../utils/hooks.js';
10
- import { LogService } from '../services/LogService.js';
11
- import * as fs from 'fs';
12
- import path from 'path';
13
- /**
14
- * Generate commit message with timeout and error handling
15
- * Returns null if it fails, so caller can fall back to manual input
16
- */
17
- async function generateCommitMessageSafe(repoPath, timeoutMs = 15000) {
18
- try {
19
- const { generateCommitMessage } = await import('../utils/aiMerge.js');
20
- // Race between generation and timeout
21
- const result = await Promise.race([
22
- generateCommitMessage(repoPath),
23
- new Promise((_, reject) => setTimeout(() => reject(new Error('Timeout')), timeoutMs)),
24
- ]);
25
- if (!result) {
26
- StateManager.getInstance().setDebugMessage('[AI] Commit message generation returned null');
27
- LogService.getInstance().warn('AI commit message generation returned null', 'aiMerge');
28
- }
29
- return result;
30
- }
31
- catch (error) {
32
- const errorMsg = `AI commit message generation error: ${error}`;
33
- StateManager.getInstance().setDebugMessage(`[AI] ${errorMsg}`);
34
- LogService.getInstance().error(errorMsg, 'aiMerge', undefined, error instanceof Error ? error : undefined);
35
- return null;
36
- }
37
- }
38
- /**
39
- * View/Jump to a pane
40
- */
41
- export async function viewPane(pane, context) {
42
- try {
43
- execSync(`tmux select-pane -t '${pane.paneId}'`, { stdio: 'pipe' });
44
- return {
45
- type: 'navigation',
46
- message: `Jumped to pane: ${pane.slug}`,
47
- targetPaneId: pane.id,
48
- dismissable: true,
49
- };
50
- }
51
- catch (error) {
52
- return {
53
- type: 'error',
54
- message: 'Failed to jump to pane - it may have been closed',
55
- dismissable: true,
56
- };
57
- }
58
- }
59
- /**
60
- * Close a pane - presents options for how to close
61
- */
62
- export async function closePane(pane, context) {
63
- // For shell panes (no worktree), close immediately without options
64
- if (pane.type === 'shell' || !pane.worktreePath) {
65
- return executeCloseOption(pane, context, 'kill_only');
66
- }
67
- // For worktree panes, present options
68
- const options = [
69
- {
70
- id: 'kill_only',
71
- label: 'Just close pane',
72
- description: 'Keep worktree and branch',
73
- default: true,
74
- },
75
- {
76
- id: 'kill_and_clean',
77
- label: 'Close and remove worktree',
78
- description: 'Delete worktree but keep branch',
79
- danger: true,
80
- },
81
- {
82
- id: 'kill_clean_branch',
83
- label: 'Close and delete everything',
84
- description: 'Remove worktree and delete branch',
85
- danger: true,
86
- },
87
- ];
88
- return {
89
- type: 'choice',
90
- title: 'Close Pane',
91
- message: `How do you want to close "${pane.slug}"?`,
92
- options,
93
- onSelect: async (optionId) => {
94
- return executeCloseOption(pane, context, optionId);
95
- },
96
- dismissable: true,
97
- };
98
- }
99
- /**
100
- * Execute the selected close option
101
- */
102
- async function executeCloseOption(pane, context, option) {
103
- try {
104
- // Get project root for hooks
105
- const state = StateManager.getInstance().getState();
106
- const projectRoot = state.projectRoot || process.cwd();
107
- // Trigger before_pane_close hook
108
- await triggerHook('before_pane_close', projectRoot, pane);
109
- // CRITICAL: Pause ConfigWatcher to prevent race condition where
110
- // the watcher reloads the pane list from disk before our save completes
111
- StateManager.getInstance().pauseConfigWatcher();
112
- try {
113
- // Kill the tmux pane - use a more robust approach
114
- try {
115
- // First, try to kill any running process in the pane (like Claude)
116
- try {
117
- execSync(`tmux send-keys -t '${pane.paneId}' C-c`, { stdio: 'pipe' });
118
- // Wait a moment for the process to exit
119
- await new Promise(resolve => setTimeout(resolve, 100));
120
- }
121
- catch {
122
- // Process might not be running
123
- }
124
- // Now kill the pane
125
- execSync(`tmux kill-pane -t '${pane.paneId}'`, { stdio: 'pipe' });
126
- // Verify the pane is actually gone
127
- await new Promise(resolve => setTimeout(resolve, 100));
128
- try {
129
- // Check if pane still exists
130
- const paneList = execSync('tmux list-panes -F "#{pane_id}"', { encoding: 'utf-8', stdio: 'pipe' });
131
- if (paneList.includes(pane.paneId)) {
132
- const msg = `Pane ${pane.paneId} still exists after kill attempt`;
133
- console.error(`Warning: ${msg}`);
134
- LogService.getInstance().warn(msg, 'paneActions', pane.id);
135
- }
136
- }
137
- catch {
138
- // Error listing panes is fine
139
- }
140
- }
141
- catch (killError) {
142
- // Pane might already be dead, which is fine
143
- const msg = `Error killing pane ${pane.paneId}`;
144
- console.error(msg, killError);
145
- LogService.getInstance().error(msg, 'paneActions', pane.id, killError instanceof Error ? killError : undefined);
146
- }
147
- // Handle worktree cleanup based on option
148
- if (pane.worktreePath && (option === 'kill_and_clean' || option === 'kill_clean_branch')) {
149
- const mainRepoPath = pane.worktreePath.replace(/\/\.dmux\/worktrees\/[^/]+$/, '');
150
- // Trigger before_worktree_remove hook
151
- await triggerHook('before_worktree_remove', projectRoot, pane);
152
- try {
153
- execSync(`git worktree remove "${pane.worktreePath}" --force`, {
154
- stdio: 'pipe',
155
- cwd: mainRepoPath,
156
- });
157
- }
158
- catch {
159
- // Worktree might already be removed
160
- }
161
- // Trigger worktree_removed hook
162
- await triggerHook('worktree_removed', projectRoot, pane);
163
- // Delete branch if requested
164
- if (option === 'kill_clean_branch') {
165
- try {
166
- execSync(`git branch -D ${pane.slug}`, {
167
- stdio: 'pipe',
168
- cwd: mainRepoPath,
169
- });
170
- }
171
- catch {
172
- // Branch might not exist or already deleted
173
- }
174
- }
175
- }
176
- // Remove from panes list
177
- const updatedPanes = context.panes.filter(p => p.id !== pane.id);
178
- await context.savePanes(updatedPanes);
179
- if (context.onPaneRemove) {
180
- context.onPaneRemove(pane.paneId); // Pass tmux pane ID, not dmux ID
181
- }
182
- // Recalculate layout for remaining panes
183
- try {
184
- const config = JSON.parse(fs.readFileSync(path.join(projectRoot, '.dmux', 'dmux.config.json'), 'utf-8'));
185
- if (config.controlPaneId && updatedPanes.length > 0) {
186
- const { recalculateAndApplyLayout } = await import('../utils/layoutManager.js');
187
- const { getTerminalDimensions } = await import('../utils/tmux.js');
188
- const dimensions = getTerminalDimensions();
189
- recalculateAndApplyLayout(config.controlPaneId, updatedPanes.map(p => p.paneId), dimensions.width, dimensions.height);
190
- LogService.getInstance().debug(`Recalculated layout after closing pane: ${updatedPanes.length} panes remaining`, 'paneActions');
191
- }
192
- }
193
- catch (error) {
194
- // Log but don't fail - layout recalc is non-critical
195
- LogService.getInstance().debug('Failed to recalculate layout after pane close', 'paneActions');
196
- }
197
- // Wait a bit for the file save to stabilize
198
- await new Promise(resolve => setTimeout(resolve, 200));
199
- // CRITICAL: Aggressively clear terminal BEFORE returning success
200
- // This prevents artifacts when Ink re-renders the status message
201
- try {
202
- // Clear screen with ANSI codes
203
- process.stdout.write('\x1b[2J\x1b[3J\x1b[H');
204
- // Clear tmux history and scrollback
205
- execSync('tmux clear-history', { stdio: 'pipe' });
206
- // Force tmux client refresh
207
- execSync('tmux refresh-client', { stdio: 'pipe' });
208
- }
209
- catch {
210
- // Ignore clearing errors
211
- }
212
- // Trigger pane_closed hook (after everything is cleaned up)
213
- await triggerHook('pane_closed', projectRoot, pane);
214
- // If we just closed the last pane, recreate the welcome pane and recalculate layout
215
- if (updatedPanes.length === 0) {
216
- const { handleLastPaneRemoved } = await import('../utils/postPaneCleanup.js');
217
- await handleLastPaneRemoved(projectRoot);
218
- }
219
- return {
220
- type: 'success',
221
- message: `Pane "${pane.slug}" closed successfully`,
222
- dismissable: true,
223
- };
224
- }
225
- finally {
226
- // CRITICAL: Always resume watcher, even if there was an error
227
- StateManager.getInstance().resumeConfigWatcher();
228
- }
229
- }
230
- catch (error) {
231
- // Clear before showing error too
232
- try {
233
- process.stdout.write('\x1b[2J\x1b[3J\x1b[H');
234
- execSync('tmux clear-history', { stdio: 'pipe' });
235
- execSync('tmux refresh-client', { stdio: 'pipe' });
236
- }
237
- catch { }
238
- return {
239
- type: 'error',
240
- message: `Failed to close pane: ${error}`,
241
- dismissable: true,
242
- };
243
- }
244
- }
245
- /**
246
- * Merge a worktree into the main branch with comprehensive pre-checks
247
- */
248
- export async function mergePane(pane, context, params) {
249
- if (!pane.worktreePath) {
250
- return {
251
- type: 'error',
252
- message: 'This pane has no worktree to merge',
253
- dismissable: true,
254
- };
255
- }
256
- // Import merge utilities dynamically
257
- const { validateMerge } = await import('../utils/mergeValidation.js');
258
- const mainRepoPath = pane.worktreePath.replace(/\/\.dmux\/worktrees\/[^/]+$/, '');
259
- // Run pre-merge validation
260
- const validation = validateMerge(mainRepoPath, pane.worktreePath, pane.slug);
261
- // If there are issues, present them to the user
262
- if (!validation.canMerge) {
263
- return handleMergeIssues(pane, context, validation, mainRepoPath);
264
- }
265
- // No issues detected, proceed with merge confirmation
266
- return {
267
- type: 'confirm',
268
- title: 'Merge Worktree',
269
- message: `Merge "${pane.slug}" into ${validation.mainBranch}?`,
270
- confirmLabel: 'Merge',
271
- cancelLabel: 'Cancel',
272
- onConfirm: async () => {
273
- // Trigger pre_merge hook before starting merge
274
- await triggerHook('pre_merge', mainRepoPath, pane, {
275
- DMUX_TARGET_BRANCH: validation.mainBranch,
276
- });
277
- return executeMerge(pane, context, validation.mainBranch, mainRepoPath);
278
- },
279
- onCancel: async () => {
280
- return {
281
- type: 'info',
282
- message: 'Merge cancelled',
283
- dismissable: true,
284
- };
285
- },
286
- };
287
- }
288
- /**
289
- * Handle detected merge issues
290
- */
291
- async function handleMergeIssues(pane, context, validation, mainRepoPath) {
292
- const { issues, mainBranch } = validation;
293
- const { commitChanges, stashChanges } = await import('../utils/mergeValidation.js');
294
- const { generateCommitMessage } = await import('../utils/aiMerge.js');
295
- // Group issues by type for clearer handling
296
- const mainDirty = issues.find((i) => i.type === 'main_dirty');
297
- const worktreeUncommitted = issues.find((i) => i.type === 'worktree_uncommitted');
298
- const mergeConflict = issues.find((i) => i.type === 'merge_conflict');
299
- const nothingToMerge = issues.find((i) => i.type === 'nothing_to_merge');
300
- // Handle "nothing to merge" case
301
- if (nothingToMerge) {
302
- return {
303
- type: 'info',
304
- message: 'No new commits to merge',
305
- dismissable: true,
306
- };
307
- }
308
- // Handle main branch dirty
309
- if (mainDirty) {
310
- return {
311
- type: 'choice',
312
- title: 'Main Branch Has Uncommitted Changes',
313
- message: `${mainBranch} has uncommitted changes in:\n${mainDirty.files.slice(0, 5).join('\n')}${mainDirty.files.length > 5 ? '\n...' : ''}`,
314
- options: [
315
- {
316
- id: 'commit_automatic',
317
- label: 'AI commit (automatic)',
318
- description: 'Auto-generate and commit immediately',
319
- default: true,
320
- },
321
- {
322
- id: 'commit_ai_editable',
323
- label: 'AI commit (editable)',
324
- description: 'Generate message from diff, edit before commit',
325
- },
326
- {
327
- id: 'commit_manual',
328
- label: 'Manual commit message',
329
- description: 'Write your own commit message',
330
- },
331
- {
332
- id: 'stash_main',
333
- label: 'Stash changes in main',
334
- description: 'Temporarily stash uncommitted changes',
335
- },
336
- {
337
- id: 'cancel',
338
- label: 'Cancel merge',
339
- description: 'Resolve manually later',
340
- },
341
- ],
342
- onSelect: async (optionId) => {
343
- if (optionId === 'cancel') {
344
- return { type: 'info', message: 'Merge cancelled', dismissable: true };
345
- }
346
- if (optionId === 'stash_main') {
347
- const result = stashChanges(mainRepoPath);
348
- if (!result.success) {
349
- return { type: 'error', message: `Stash failed: ${result.error}`, dismissable: true };
350
- }
351
- // Retry merge after stashing
352
- return mergePane(pane, context, { mainBranch });
353
- }
354
- if (optionId === 'commit_ai_editable') {
355
- try {
356
- const { stageAllChanges } = await import('../utils/mergeValidation.js');
357
- const { getComprehensiveDiff } = await import('../utils/aiMerge.js');
358
- // Stage all changes first
359
- const stageResult = stageAllChanges(mainRepoPath);
360
- if (!stageResult.success) {
361
- return { type: 'error', message: `Failed to stage changes: ${stageResult.error}`, dismissable: true };
362
- }
363
- // Get diff and generate message
364
- const { diff, summary } = getComprehensiveDiff(mainRepoPath);
365
- StateManager.getInstance().setDebugMessage('[AI] Generating commit message for main repo...');
366
- const generatedMessage = await generateCommitMessageSafe(mainRepoPath);
367
- if (generatedMessage) {
368
- StateManager.getInstance().setDebugMessage(`[AI] Generated message: ${generatedMessage.split('\n')[0]}`);
369
- }
370
- // If AI generation failed, fall back to manual with explanation
371
- if (!generatedMessage) {
372
- StateManager.getInstance().setDebugMessage('[AI] Generation failed, falling back to manual input');
373
- return {
374
- type: 'input',
375
- title: 'Enter Commit Message',
376
- message: `⚠️ Auto-generation failed or timed out. Please write a commit message manually.\n\nFiles changed:\n${summary}`,
377
- placeholder: 'feat: add new feature',
378
- onSubmit: async (message) => {
379
- if (!message || !message.trim()) {
380
- return { type: 'error', message: 'Commit message cannot be empty', dismissable: true };
381
- }
382
- const result = commitChanges(mainRepoPath, message.trim());
383
- if (!result.success) {
384
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
385
- }
386
- // Retry merge after committing
387
- return mergePane(pane, context, { mainBranch });
388
- },
389
- dismissable: true,
390
- };
391
- }
392
- return {
393
- type: 'input',
394
- title: 'Review & Edit Commit Message',
395
- message: `Files changed:\n${summary}\n\nGenerated message (edit as needed):`,
396
- placeholder: 'feat: add new feature',
397
- defaultValue: generatedMessage,
398
- onSubmit: async (message) => {
399
- if (!message || !message.trim()) {
400
- return { type: 'error', message: 'Commit message cannot be empty', dismissable: true };
401
- }
402
- const result = commitChanges(mainRepoPath, message.trim());
403
- if (!result.success) {
404
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
405
- }
406
- // Retry merge after committing
407
- return mergePane(pane, context, { mainBranch });
408
- },
409
- dismissable: true,
410
- };
411
- }
412
- catch (error) {
413
- StateManager.getInstance().setDebugMessage(`[AI] Unexpected error: ${error}`);
414
- return {
415
- type: 'error',
416
- message: `Unexpected error: ${error instanceof Error ? error.message : String(error)}`,
417
- dismissable: true,
418
- };
419
- }
420
- }
421
- if (optionId === 'commit_automatic') {
422
- const { stageAllChanges } = await import('../utils/mergeValidation.js');
423
- const { getComprehensiveDiff } = await import('../utils/aiMerge.js');
424
- // Stage all changes first
425
- const stageResult = stageAllChanges(mainRepoPath);
426
- if (!stageResult.success) {
427
- return { type: 'error', message: `Failed to stage changes: ${stageResult.error}`, dismissable: true };
428
- }
429
- // Generate commit message
430
- const message = await generateCommitMessageSafe(mainRepoPath);
431
- // If AI generation failed, fall back to manual input
432
- if (!message) {
433
- const { summary } = getComprehensiveDiff(mainRepoPath);
434
- return {
435
- type: 'input',
436
- title: 'Enter Commit Message',
437
- message: `⚠️ Auto-generation failed or timed out. Please write a commit message manually.\n\nFiles changed:\n${summary}`,
438
- placeholder: 'feat: add new feature',
439
- onSubmit: async (manualMessage) => {
440
- if (!manualMessage || !manualMessage.trim()) {
441
- return { type: 'error', message: 'Commit message cannot be empty', dismissable: true };
442
- }
443
- const result = commitChanges(mainRepoPath, manualMessage.trim());
444
- if (!result.success) {
445
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
446
- }
447
- // Retry merge after committing
448
- return mergePane(pane, context, { mainBranch });
449
- },
450
- dismissable: true,
451
- };
452
- }
453
- const result = commitChanges(mainRepoPath, message);
454
- if (!result.success) {
455
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
456
- }
457
- // Retry merge after committing
458
- return mergePane(pane, context, { mainBranch });
459
- }
460
- if (optionId === 'commit_manual') {
461
- const { stageAllChanges } = await import('../utils/mergeValidation.js');
462
- // Stage all changes first
463
- const stageResult = stageAllChanges(mainRepoPath);
464
- if (!stageResult.success) {
465
- return { type: 'error', message: `Failed to stage changes: ${stageResult.error}`, dismissable: true };
466
- }
467
- return {
468
- type: 'input',
469
- title: 'Enter Commit Message',
470
- message: 'Write a commit message for the changes in main:',
471
- placeholder: 'feat: add new feature',
472
- onSubmit: async (message) => {
473
- if (!message || !message.trim()) {
474
- return { type: 'error', message: 'Commit message cannot be empty', dismissable: true };
475
- }
476
- const result = commitChanges(mainRepoPath, message.trim());
477
- if (!result.success) {
478
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
479
- }
480
- // Retry merge after committing
481
- return mergePane(pane, context, { mainBranch });
482
- },
483
- dismissable: true,
484
- };
485
- }
486
- return { type: 'info', message: 'Unknown option', dismissable: true };
487
- },
488
- dismissable: true,
489
- };
490
- }
491
- // Handle worktree uncommitted changes
492
- if (worktreeUncommitted) {
493
- return {
494
- type: 'choice',
495
- title: 'Worktree Has Uncommitted Changes',
496
- message: `Changes in:\n${worktreeUncommitted.files.slice(0, 5).join('\n')}${worktreeUncommitted.files.length > 5 ? '\n...' : ''}`,
497
- options: [
498
- {
499
- id: 'commit_automatic',
500
- label: 'AI commit (automatic)',
501
- description: 'Auto-generate and commit immediately',
502
- default: true,
503
- },
504
- {
505
- id: 'commit_ai_editable',
506
- label: 'AI commit (editable)',
507
- description: 'Generate message from diff, edit before commit',
508
- },
509
- {
510
- id: 'commit_manual',
511
- label: 'Manual commit message',
512
- description: 'Write your own commit message',
513
- },
514
- {
515
- id: 'cancel',
516
- label: 'Cancel merge',
517
- description: 'Resolve manually later',
518
- },
519
- ],
520
- onSelect: async (optionId) => {
521
- if (optionId === 'cancel') {
522
- return { type: 'info', message: 'Merge cancelled', dismissable: true };
523
- }
524
- if (optionId === 'commit_ai_editable') {
525
- try {
526
- const { stageAllChanges } = await import('../utils/mergeValidation.js');
527
- const { getComprehensiveDiff } = await import('../utils/aiMerge.js');
528
- // Stage all changes first
529
- const stageResult = stageAllChanges(pane.worktreePath);
530
- if (!stageResult.success) {
531
- return { type: 'error', message: `Failed to stage changes: ${stageResult.error}`, dismissable: true };
532
- }
533
- // Get diff and generate message
534
- const { diff, summary } = getComprehensiveDiff(pane.worktreePath);
535
- StateManager.getInstance().setDebugMessage('[AI] Generating commit message for worktree...');
536
- const generatedMessage = await generateCommitMessageSafe(pane.worktreePath);
537
- if (generatedMessage) {
538
- StateManager.getInstance().setDebugMessage(`[AI] Generated message: ${generatedMessage.split('\n')[0]}`);
539
- }
540
- // If AI generation failed, fall back to manual with explanation
541
- if (!generatedMessage) {
542
- StateManager.getInstance().setDebugMessage('[AI] Generation failed, falling back to manual input');
543
- return {
544
- type: 'input',
545
- title: 'Enter Commit Message',
546
- message: `⚠️ Auto-generation failed or timed out. Please write a commit message manually.\n\nFiles changed:\n${summary}`,
547
- placeholder: 'feat: add new feature',
548
- onSubmit: async (message) => {
549
- if (!message || !message.trim()) {
550
- return { type: 'error', message: 'Commit message cannot be empty', dismissable: true };
551
- }
552
- const result = commitChanges(pane.worktreePath, message.trim());
553
- if (!result.success) {
554
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
555
- }
556
- // Retry merge after committing
557
- return mergePane(pane, context, { mainBranch });
558
- },
559
- dismissable: true,
560
- };
561
- }
562
- return {
563
- type: 'input',
564
- title: 'Review & Edit Commit Message',
565
- message: `Files changed:\n${summary}\n\nGenerated message (edit as needed):`,
566
- placeholder: 'feat: add new feature',
567
- defaultValue: generatedMessage,
568
- onSubmit: async (message) => {
569
- if (!message || !message.trim()) {
570
- return { type: 'error', message: 'Commit message cannot be empty', dismissable: true };
571
- }
572
- const result = commitChanges(pane.worktreePath, message.trim());
573
- if (!result.success) {
574
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
575
- }
576
- // Retry merge after committing
577
- return mergePane(pane, context, { mainBranch });
578
- },
579
- dismissable: true,
580
- };
581
- }
582
- catch (error) {
583
- StateManager.getInstance().setDebugMessage(`[AI] Unexpected error: ${error}`);
584
- return {
585
- type: 'error',
586
- message: `Unexpected error: ${error instanceof Error ? error.message : String(error)}`,
587
- dismissable: true,
588
- };
589
- }
590
- }
591
- if (optionId === 'commit_automatic') {
592
- const { stageAllChanges } = await import('../utils/mergeValidation.js');
593
- const { getComprehensiveDiff } = await import('../utils/aiMerge.js');
594
- // Stage all changes first
595
- const stageResult = stageAllChanges(pane.worktreePath);
596
- if (!stageResult.success) {
597
- return { type: 'error', message: `Failed to stage changes: ${stageResult.error}`, dismissable: true };
598
- }
599
- const message = await generateCommitMessageSafe(pane.worktreePath);
600
- // If AI generation failed, fall back to manual input
601
- if (!message) {
602
- const { summary } = getComprehensiveDiff(pane.worktreePath);
603
- return {
604
- type: 'input',
605
- title: 'Enter Commit Message',
606
- message: `⚠️ Auto-generation failed or timed out. Please write a commit message manually.\n\nFiles changed:\n${summary}`,
607
- placeholder: 'feat: add new feature',
608
- onSubmit: async (manualMessage) => {
609
- if (!manualMessage || !manualMessage.trim()) {
610
- return { type: 'error', message: 'Commit message cannot be empty', dismissable: true };
611
- }
612
- const result = commitChanges(pane.worktreePath, manualMessage.trim());
613
- if (!result.success) {
614
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
615
- }
616
- // Retry merge after committing
617
- return mergePane(pane, context, { mainBranch });
618
- },
619
- dismissable: true,
620
- };
621
- }
622
- const result = commitChanges(pane.worktreePath, message);
623
- if (!result.success) {
624
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
625
- }
626
- // Retry merge after committing
627
- return mergePane(pane, context, { mainBranch });
628
- }
629
- if (optionId === 'commit_manual') {
630
- const { stageAllChanges } = await import('../utils/mergeValidation.js');
631
- // Stage all changes first
632
- const stageResult = stageAllChanges(pane.worktreePath);
633
- if (!stageResult.success) {
634
- return { type: 'error', message: `Failed to stage changes: ${stageResult.error}`, dismissable: true };
635
- }
636
- return {
637
- type: 'input',
638
- title: 'Enter Commit Message',
639
- message: 'Write a commit message for the changes:',
640
- placeholder: 'feat: add new feature',
641
- onSubmit: async (message) => {
642
- if (!message || !message.trim()) {
643
- return { type: 'error', message: 'Commit message cannot be empty', dismissable: true };
644
- }
645
- const result = commitChanges(pane.worktreePath, message.trim());
646
- if (!result.success) {
647
- return { type: 'error', message: `Commit failed: ${result.error}`, dismissable: true };
648
- }
649
- // Retry merge after committing
650
- return mergePane(pane, context, { mainBranch });
651
- },
652
- dismissable: true,
653
- };
654
- }
655
- return { type: 'info', message: 'Unknown option', dismissable: true };
656
- },
657
- dismissable: true,
658
- };
659
- }
660
- // Handle merge conflicts
661
- if (mergeConflict) {
662
- return {
663
- type: 'choice',
664
- title: 'Merge Conflicts Detected',
665
- message: `Conflicts will occur in:\n${mergeConflict.files.slice(0, 5).join('\n')}${mergeConflict.files.length > 5 ? '\n...' : ''}`,
666
- options: [
667
- {
668
- id: 'ai_merge',
669
- label: 'Try AI-assisted merge',
670
- description: 'Let AI intelligently combine both versions',
671
- default: true,
672
- },
673
- {
674
- id: 'manual_merge',
675
- label: 'Manual resolution',
676
- description: 'Jump to pane to resolve conflicts',
677
- },
678
- {
679
- id: 'cancel',
680
- label: 'Cancel merge',
681
- description: 'Do nothing',
682
- },
683
- ],
684
- onSelect: async (optionId) => {
685
- if (optionId === 'cancel') {
686
- return { type: 'info', message: 'Merge cancelled', dismissable: true };
687
- }
688
- if (optionId === 'manual_merge') {
689
- // Start the merge process and let user resolve manually
690
- return executeMergeWithConflictHandling(pane, context, mainBranch, mainRepoPath, 'manual');
691
- }
692
- if (optionId === 'ai_merge') {
693
- // Attempt AI-assisted merge via new pane
694
- return createConflictResolutionPaneForMerge(pane, context, mainBranch, mainRepoPath);
695
- }
696
- return { type: 'info', message: 'Unknown option', dismissable: true };
697
- },
698
- dismissable: true,
699
- };
700
- }
701
- // Generic issue display
702
- return {
703
- type: 'error',
704
- title: 'Merge Issues Detected',
705
- message: issues.map((i) => i.message).join('\n'),
706
- dismissable: true,
707
- };
708
- }
709
- /**
710
- * Create a new pane for AI-assisted conflict resolution
711
- */
712
- async function createConflictResolutionPaneForMerge(pane, context, targetBranch, targetRepoPath) {
713
- // First, check which agents are available
714
- const { findClaudeCommand, findOpencodeCommand } = await import('../utils/agentDetection.js');
715
- const availableAgents = [];
716
- if (await findClaudeCommand())
717
- availableAgents.push('claude');
718
- if (await findOpencodeCommand())
719
- availableAgents.push('opencode');
720
- if (availableAgents.length === 0) {
721
- return {
722
- type: 'error',
723
- message: 'No AI agents available. Please install claude or opencode.',
724
- dismissable: true,
725
- };
726
- }
727
- // If multiple agents available, ask user to choose
728
- if (availableAgents.length > 1) {
729
- return {
730
- type: 'choice',
731
- title: 'Choose AI Agent for Conflict Resolution',
732
- message: 'Which agent would you like to use to resolve merge conflicts?',
733
- options: availableAgents.map(agent => ({
734
- id: agent,
735
- label: agent === 'claude' ? 'Claude Code' : 'OpenCode',
736
- description: agent === 'claude' ? 'Anthropic Claude' : 'Open-source alternative',
737
- default: agent === 'claude',
738
- })),
739
- onSelect: async (agentId) => {
740
- return createAndLaunchConflictPane(pane, context, targetBranch, targetRepoPath, agentId);
741
- },
742
- dismissable: true,
743
- };
744
- }
745
- // Only one agent available, use it directly
746
- return createAndLaunchConflictPane(pane, context, targetBranch, targetRepoPath, availableAgents[0]);
747
- }
748
- /**
749
- * Actually create and launch the conflict resolution pane
750
- */
751
- async function createAndLaunchConflictPane(pane, context, targetBranch, targetRepoPath, agent) {
752
- try {
753
- const { createConflictResolutionPane } = await import('../utils/conflictResolutionPane.js');
754
- // Create the new pane
755
- const conflictPane = await createConflictResolutionPane({
756
- sourceBranch: pane.slug,
757
- targetBranch,
758
- targetRepoPath,
759
- agent,
760
- projectName: context.projectName,
761
- existingPanes: context.panes,
762
- });
763
- // Add the new pane to the panes list
764
- const updatedPanes = [...context.panes, conflictPane];
765
- await context.savePanes(updatedPanes);
766
- // Notify about the new pane
767
- if (context.onPaneUpdate) {
768
- context.onPaneUpdate(conflictPane);
769
- }
770
- return {
771
- type: 'navigation',
772
- title: 'Conflict Resolution Pane Created',
773
- message: `Created pane "${conflictPane.slug}" with ${agent} to help resolve conflicts. Switch to it to see the AI working.`,
774
- targetPaneId: conflictPane.id,
775
- dismissable: true,
776
- };
777
- }
778
- catch (error) {
779
- return {
780
- type: 'error',
781
- message: `Failed to create conflict resolution pane: ${error instanceof Error ? error.message : String(error)}`,
782
- dismissable: true,
783
- };
784
- }
785
- }
786
- /**
787
- * Execute merge with conflict handling
788
- */
789
- async function executeMergeWithConflictHandling(pane, context, mainBranch, mainRepoPath, strategy) {
790
- const { mergeMainIntoWorktree, getConflictingFiles, completeMerge } = await import('../utils/mergeExecution.js');
791
- // Step 1: Merge main into worktree
792
- const result = mergeMainIntoWorktree(pane.worktreePath, mainBranch);
793
- if (!result.success && result.needsManualResolution) {
794
- if (strategy === 'ai') {
795
- // Try AI resolution
796
- const { aiResolveAllConflicts } = await import('../utils/aiMerge.js');
797
- const aiResult = await aiResolveAllConflicts(pane.worktreePath, result.conflictFiles || []);
798
- if (aiResult.success) {
799
- // AI resolved all conflicts, complete the merge
800
- const completeResult = completeMerge(pane.worktreePath, 'Merge with AI-resolved conflicts');
801
- if (completeResult.success) {
802
- // Continue with the second phase of merge
803
- return executeMerge(pane, context, mainBranch, mainRepoPath);
804
- }
805
- else {
806
- return {
807
- type: 'error',
808
- message: `Failed to complete merge: ${completeResult.error}`,
809
- dismissable: true,
810
- };
811
- }
812
- }
813
- else {
814
- // AI couldn't resolve, fall back to manual
815
- return {
816
- type: 'error',
817
- title: 'AI Merge Failed',
818
- message: `AI couldn't resolve conflicts in: ${aiResult.failedFiles.join(', ')}.\nPlease resolve manually.`,
819
- dismissable: true,
820
- };
821
- }
822
- }
823
- else {
824
- // Manual resolution - jump to pane
825
- return {
826
- type: 'navigation',
827
- title: 'Manual Conflict Resolution',
828
- message: `Conflicts in: ${result.conflictFiles?.join(', ')}.\nResolve in the pane, then try merge again.`,
829
- targetPaneId: pane.id,
830
- dismissable: true,
831
- };
832
- }
833
- }
834
- if (!result.success) {
835
- return {
836
- type: 'error',
837
- message: `Merge failed: ${result.error}`,
838
- dismissable: true,
839
- };
840
- }
841
- // No conflicts, proceed with the main merge
842
- return executeMerge(pane, context, mainBranch, mainRepoPath);
843
- }
844
- /**
845
- * Execute the actual merge operation (called after all pre-checks pass)
846
- */
847
- async function executeMerge(pane, context, mainBranch, mainRepoPath) {
848
- const { mergeWorktreeIntoMain, cleanupAfterMerge } = await import('../utils/mergeExecution.js');
849
- // Step 2: Merge worktree into main
850
- const result = mergeWorktreeIntoMain(mainRepoPath, pane.slug);
851
- if (!result.success) {
852
- return {
853
- type: 'error',
854
- title: 'Merge Failed',
855
- message: `Failed to merge into ${mainBranch}: ${result.error}`,
856
- dismissable: true,
857
- };
858
- }
859
- // Trigger post_merge hook after successful merge
860
- await triggerHook('post_merge', mainRepoPath, pane, {
861
- DMUX_TARGET_BRANCH: mainBranch,
862
- });
863
- // Merge successful! Ask about cleanup
864
- return {
865
- type: 'confirm',
866
- title: 'Merge Complete',
867
- message: `Successfully merged "${pane.slug}" into ${mainBranch}. Close the pane and cleanup worktree?`,
868
- confirmLabel: 'Yes, close it',
869
- cancelLabel: 'No, keep it',
870
- onConfirm: async () => {
871
- // Cleanup worktree and branch
872
- const cleanup = cleanupAfterMerge(mainRepoPath, pane.worktreePath, pane.slug);
873
- if (!cleanup.success) {
874
- return {
875
- type: 'error',
876
- message: `Merge succeeded but cleanup failed: ${cleanup.error}`,
877
- dismissable: true,
878
- };
879
- }
880
- // Close the pane
881
- return executeCloseOption(pane, context, 'kill_only');
882
- },
883
- onCancel: async () => {
884
- return {
885
- type: 'success',
886
- message: 'Merge complete. Pane kept open.',
887
- dismissable: true,
888
- };
889
- },
890
- };
891
- }
892
- /**
893
- * Rename a pane
894
- */
895
- export async function renamePane(pane, context) {
896
- return {
897
- type: 'input',
898
- title: 'Rename Pane',
899
- message: 'Enter new name for pane:',
900
- placeholder: pane.slug,
901
- defaultValue: pane.slug,
902
- onSubmit: async (value) => {
903
- if (!value || value === pane.slug) {
904
- return {
905
- type: 'info',
906
- message: 'Rename cancelled',
907
- dismissable: true,
908
- };
909
- }
910
- // Update pane name
911
- const updatedPane = {
912
- ...pane,
913
- slug: value,
914
- };
915
- // Update tmux pane title
916
- try {
917
- execSync(`tmux select-pane -t '${pane.paneId}' -T "${value}"`, { stdio: 'pipe' });
918
- }
919
- catch {
920
- // Ignore if title update fails
921
- }
922
- // Update in panes list
923
- const updatedPanes = context.panes.map(p => p.id === pane.id ? updatedPane : p);
924
- await context.savePanes(updatedPanes);
925
- if (context.onPaneUpdate) {
926
- context.onPaneUpdate(updatedPane);
927
- }
928
- return {
929
- type: 'success',
930
- message: `Renamed to "${value}"`,
931
- dismissable: true,
932
- };
933
- },
934
- };
935
- }
936
- /**
937
- * Copy worktree path to clipboard
938
- */
939
- export async function copyPath(pane, context) {
940
- if (!pane.worktreePath) {
941
- return {
942
- type: 'error',
943
- message: 'This pane has no worktree path',
944
- dismissable: true,
945
- };
946
- }
947
- try {
948
- // Try to copy to clipboard (works on macOS)
949
- execSync(`echo "${pane.worktreePath}" | pbcopy`, { stdio: 'pipe' });
950
- return {
951
- type: 'success',
952
- message: `Path copied: ${pane.worktreePath}`,
953
- dismissable: true,
954
- };
955
- }
956
- catch {
957
- // If clipboard copy fails, just show the path
958
- return {
959
- type: 'info',
960
- message: `Path: ${pane.worktreePath}`,
961
- dismissable: true,
962
- };
963
- }
964
- }
965
- /**
966
- * Open worktree in external editor
967
- */
968
- export async function openInEditor(pane, context, params) {
969
- if (!pane.worktreePath) {
970
- return {
971
- type: 'error',
972
- message: 'This pane has no worktree to open',
973
- dismissable: true,
974
- };
975
- }
976
- const editor = params?.editor || process.env.EDITOR || 'code';
977
- try {
978
- execSync(`${editor} "${pane.worktreePath}"`, { stdio: 'pipe' });
979
- return {
980
- type: 'success',
981
- message: `Opened in ${editor}`,
982
- dismissable: true,
983
- };
984
- }
985
- catch (error) {
986
- return {
987
- type: 'error',
988
- message: `Failed to open in editor: ${error}`,
989
- dismissable: true,
990
- };
991
- }
992
- }
993
- /**
994
- * Duplicate a pane (create a new pane with the same prompt)
995
- */
996
- export async function duplicatePane(pane, context) {
997
- return {
998
- type: 'confirm',
999
- title: 'Duplicate Pane',
1000
- message: `Create a new pane with the same prompt as "${pane.slug}"?`,
1001
- confirmLabel: 'Duplicate',
1002
- cancelLabel: 'Cancel',
1003
- onConfirm: async () => {
1004
- // This would trigger the new pane creation flow with the same prompt
1005
- return {
1006
- type: 'info',
1007
- message: 'Duplication not yet implemented',
1008
- data: { action: 'create_pane', prompt: pane.prompt, agent: pane.agent },
1009
- dismissable: true,
1010
- };
1011
- },
1012
- };
1013
- }
1014
- /**
1015
- * Toggle autopilot mode for a pane
1016
- */
1017
- export async function toggleAutopilot(pane, context) {
1018
- try {
1019
- // Toggle the autopilot setting
1020
- const newAutopilotState = !pane.autopilot;
1021
- // Update the pane
1022
- const updatedPanes = context.panes.map(p => p.id === pane.id ? { ...p, autopilot: newAutopilotState } : p);
1023
- // Save the updated panes
1024
- await context.savePanes(updatedPanes);
1025
- // Notify about the update
1026
- if (context.onPaneUpdate) {
1027
- context.onPaneUpdate({ ...pane, autopilot: newAutopilotState });
1028
- }
1029
- return {
1030
- type: 'success',
1031
- message: `Autopilot ${newAutopilotState ? 'enabled' : 'disabled'} for "${pane.slug}"`,
1032
- dismissable: true,
1033
- };
1034
- }
1035
- catch (error) {
1036
- return {
1037
- type: 'error',
1038
- message: `Failed to toggle autopilot: ${error instanceof Error ? error.message : 'Unknown error'}`,
1039
- dismissable: true,
1040
- };
1041
- }
1042
- }
7
+ // Re-export all actions from their individual files
8
+ export { viewPane, closePane, mergePane, renamePane, duplicatePane, copyPath, openInEditor, toggleAutopilot, } from './implementations/index.js';
1043
9
  //# sourceMappingURL=paneActions.js.map