agor-live 0.14.2 → 0.14.3

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 (224) hide show
  1. package/bin/version-check.js +7 -5
  2. package/dist/core/api/index.d.cts +2 -2
  3. package/dist/core/api/index.d.ts +2 -2
  4. package/dist/core/config/browser.d.cts +2 -2
  5. package/dist/core/config/browser.d.ts +2 -2
  6. package/dist/core/config/index.d.cts +3 -3
  7. package/dist/core/config/index.d.ts +3 -3
  8. package/dist/core/{config-manager-DdwPsKTh.d.ts → config-manager-BDJG7HPR.d.ts} +1 -1
  9. package/dist/core/{config-manager-4zF2cWdg.d.cts → config-manager-Dw2LXbKq.d.cts} +1 -1
  10. package/dist/core/db/index.cjs +3 -6
  11. package/dist/core/db/index.d.cts +1 -1
  12. package/dist/core/db/index.d.ts +1 -1
  13. package/dist/core/db/index.js +3 -6
  14. package/dist/core/environment/variable-resolver.d.cts +1 -1
  15. package/dist/core/environment/variable-resolver.d.ts +1 -1
  16. package/dist/core/{feathers-B78IxAoi.d.cts → feathers-5DsXBqOW.d.cts} +3 -1
  17. package/dist/core/{feathers-MlqnVpas.d.ts → feathers-qrz_9jSJ.d.ts} +3 -1
  18. package/dist/core/gateway/index.cjs +3 -2
  19. package/dist/core/gateway/index.js +3 -2
  20. package/dist/core/git/index.cjs +41 -1
  21. package/dist/core/git/index.d.cts +14 -3
  22. package/dist/core/git/index.d.ts +14 -3
  23. package/dist/core/git/index.js +40 -1
  24. package/dist/core/index.cjs +87 -13
  25. package/dist/core/index.d.cts +5 -5
  26. package/dist/core/index.d.ts +5 -5
  27. package/dist/core/index.js +86 -13
  28. package/dist/core/sdk/index.d.cts +1 -1
  29. package/dist/core/sdk/index.d.ts +1 -1
  30. package/dist/core/seed/index.cjs +98 -7
  31. package/dist/core/seed/index.js +98 -7
  32. package/dist/core/templates/agor-system-prompt.md +3 -0
  33. package/dist/core/templates/session-context.cjs +16 -0
  34. package/dist/core/templates/session-context.d.cts +7 -1
  35. package/dist/core/templates/session-context.d.ts +7 -1
  36. package/dist/core/templates/session-context.js +16 -0
  37. package/dist/core/types/index.d.cts +2 -2
  38. package/dist/core/types/index.d.ts +2 -2
  39. package/dist/core/{types-D7s9-Y1x.d.cts → types-Cox7HmbB.d.cts} +17 -0
  40. package/dist/core/{types-D7s9-Y1x.d.ts → types-Cox7HmbB.d.ts} +17 -0
  41. package/dist/core/unix/index.cjs +43 -6
  42. package/dist/core/unix/index.d.cts +15 -1
  43. package/dist/core/unix/index.d.ts +15 -1
  44. package/dist/core/unix/index.js +43 -6
  45. package/dist/core/{worktree-BUhwPBvP.d.cts → worktree-CvakJ5w4.d.cts} +2 -0
  46. package/dist/core/{worktree-z5k683z2.d.ts → worktree-Dr_m10w8.d.ts} +2 -0
  47. package/dist/daemon/declarations.d.ts +5 -1
  48. package/dist/daemon/index.js +732 -35
  49. package/dist/daemon/mcp/routes.js +413 -3
  50. package/dist/daemon/services/health-monitor.js +0 -1
  51. package/dist/daemon/services/leaderboard.js +10 -4
  52. package/dist/daemon/services/repos.js +36 -2
  53. package/dist/daemon/services/session-token-service.js +0 -1
  54. package/dist/daemon/services/worktree-owners.js +6 -0
  55. package/dist/daemon/services/worktrees.js +8 -2
  56. package/dist/daemon/setup/index.js +3 -0
  57. package/dist/daemon/setup/socketio.js +3 -0
  58. package/dist/daemon/utils/worktree-authorization.js +18 -0
  59. package/dist/executor/commands/git.d.ts.map +1 -1
  60. package/dist/executor/commands/git.js +26 -3
  61. package/dist/executor/commands/unix.d.ts +1 -1
  62. package/dist/executor/commands/unix.d.ts.map +1 -1
  63. package/dist/executor/commands/unix.js +101 -2
  64. package/dist/executor/db/feathers-repositories.d.ts +11 -1
  65. package/dist/executor/db/feathers-repositories.d.ts.map +1 -1
  66. package/dist/executor/db/feathers-repositories.js +19 -0
  67. package/dist/executor/handlers/sdk/claude.d.ts.map +1 -1
  68. package/dist/executor/handlers/sdk/claude.js +1 -1
  69. package/dist/executor/handlers/sdk/codex.d.ts.map +1 -1
  70. package/dist/executor/handlers/sdk/codex.js +2 -2
  71. package/dist/executor/handlers/sdk/gemini.d.ts.map +1 -1
  72. package/dist/executor/handlers/sdk/gemini.js +2 -2
  73. package/dist/executor/handlers/sdk/tool-registry.d.ts.map +1 -1
  74. package/dist/executor/handlers/sdk/tool-registry.js +1 -1
  75. package/dist/executor/payload-types.d.ts +4 -0
  76. package/dist/executor/payload-types.d.ts.map +1 -1
  77. package/dist/executor/payload-types.js +4 -0
  78. package/dist/executor/sdk-handlers/claude/claude-tool.d.ts +1 -1
  79. package/dist/executor/sdk-handlers/claude/claude-tool.d.ts.map +1 -1
  80. package/dist/executor/sdk-handlers/claude/claude-tool.js +20 -2
  81. package/dist/executor/sdk-handlers/claude/message-processor.d.ts +8 -0
  82. package/dist/executor/sdk-handlers/claude/message-processor.d.ts.map +1 -1
  83. package/dist/executor/sdk-handlers/claude/message-processor.js +67 -19
  84. package/dist/executor/sdk-handlers/claude/prompt-service.d.ts +7 -2
  85. package/dist/executor/sdk-handlers/claude/prompt-service.d.ts.map +1 -1
  86. package/dist/executor/sdk-handlers/claude/prompt-service.js +81 -6
  87. package/dist/executor/sdk-handlers/claude/query-builder.d.ts +4 -1
  88. package/dist/executor/sdk-handlers/claude/query-builder.d.ts.map +1 -1
  89. package/dist/executor/sdk-handlers/claude/query-builder.js +2 -0
  90. package/dist/executor/sdk-handlers/codex/codex-tool.d.ts +2 -2
  91. package/dist/executor/sdk-handlers/codex/codex-tool.d.ts.map +1 -1
  92. package/dist/executor/sdk-handlers/codex/codex-tool.js +2 -2
  93. package/dist/executor/sdk-handlers/codex/prompt-service.d.ts +3 -2
  94. package/dist/executor/sdk-handlers/codex/prompt-service.d.ts.map +1 -1
  95. package/dist/executor/sdk-handlers/codex/prompt-service.js +4 -1
  96. package/dist/executor/sdk-handlers/gemini/gemini-tool.d.ts +3 -2
  97. package/dist/executor/sdk-handlers/gemini/gemini-tool.d.ts.map +1 -1
  98. package/dist/executor/sdk-handlers/gemini/gemini-tool.js +3 -3
  99. package/dist/executor/sdk-handlers/gemini/prompt-service.d.ts +4 -2
  100. package/dist/executor/sdk-handlers/gemini/prompt-service.d.ts.map +1 -1
  101. package/dist/executor/sdk-handlers/gemini/prompt-service.js +5 -2
  102. package/dist/ui/assets/{_basePickBy-BcsCIFl3.js → _basePickBy-a-UPuVdu.js} +1 -1
  103. package/dist/ui/assets/_basePickBy-a-UPuVdu.js.gz +0 -0
  104. package/dist/ui/assets/{_baseUniq-C9qLHNz1.js → _baseUniq-BsamLjHu.js} +1 -1
  105. package/dist/ui/assets/_baseUniq-BsamLjHu.js.gz +0 -0
  106. package/dist/ui/assets/{arc-Ceq4haa-.js → arc-DyqZs1Vh.js} +1 -1
  107. package/dist/ui/assets/arc-DyqZs1Vh.js.gz +0 -0
  108. package/dist/ui/assets/{architectureDiagram-VXUJARFQ-DfyMRH2g.js → architectureDiagram-VXUJARFQ-CgsIeOuk.js} +1 -1
  109. package/dist/ui/assets/architectureDiagram-VXUJARFQ-CgsIeOuk.js.gz +0 -0
  110. package/dist/ui/assets/{blockDiagram-VD42YOAC-B-zMNwIS.js → blockDiagram-VD42YOAC-D1eydKiU.js} +1 -1
  111. package/dist/ui/assets/blockDiagram-VD42YOAC-D1eydKiU.js.gz +0 -0
  112. package/dist/ui/assets/{c4Diagram-YG6GDRKO-BMw-AOGm.js → c4Diagram-YG6GDRKO-CTRsvfoC.js} +1 -1
  113. package/dist/ui/assets/c4Diagram-YG6GDRKO-CTRsvfoC.js.gz +0 -0
  114. package/dist/ui/assets/channel-Buowy_Lw.js +1 -0
  115. package/dist/ui/assets/{chunk-4BX2VUAB-DKyQz3bJ.js → chunk-4BX2VUAB-DywfV5U9.js} +1 -1
  116. package/dist/ui/assets/{chunk-55IACEB6-DG978z5k.js → chunk-55IACEB6-_2HiUO9U.js} +1 -1
  117. package/dist/ui/assets/{chunk-B4BG7PRW-D4eKcLoO.js → chunk-B4BG7PRW-fTTNlIHk.js} +1 -1
  118. package/dist/ui/assets/chunk-B4BG7PRW-fTTNlIHk.js.gz +0 -0
  119. package/dist/ui/assets/{chunk-DI55MBZ5-BhCXePw-.js → chunk-DI55MBZ5-CkK99YYw.js} +1 -1
  120. package/dist/ui/assets/chunk-DI55MBZ5-CkK99YYw.js.gz +0 -0
  121. package/dist/ui/assets/{chunk-FMBD7UC4-LkMGYJmg.js → chunk-FMBD7UC4-DQTX-Hsy.js} +1 -1
  122. package/dist/ui/assets/{chunk-QN33PNHL-DqmrkLAy.js → chunk-QN33PNHL-CzeO2t_E.js} +1 -1
  123. package/dist/ui/assets/{chunk-QZHKN3VN-vu9nX0F4.js → chunk-QZHKN3VN-CHoat9Pt.js} +1 -1
  124. package/dist/ui/assets/{chunk-TZMSLE5B-D6ocQBEr.js → chunk-TZMSLE5B-S7n8674o.js} +1 -1
  125. package/dist/ui/assets/chunk-TZMSLE5B-S7n8674o.js.gz +0 -0
  126. package/dist/ui/assets/classDiagram-2ON5EDUG-6NEyxcEx.js +1 -0
  127. package/dist/ui/assets/classDiagram-v2-WZHVMYZB-6NEyxcEx.js +1 -0
  128. package/dist/ui/assets/clone-D03hM6j2.js +1 -0
  129. package/dist/ui/assets/{cose-bilkent-S5V4N54A-DCGk_n2D.js → cose-bilkent-S5V4N54A-siMLCMvS.js} +1 -1
  130. package/dist/ui/assets/cose-bilkent-S5V4N54A-siMLCMvS.js.gz +0 -0
  131. package/dist/ui/assets/{dagre-6UL2VRFP-CsjhA74v.js → dagre-6UL2VRFP-_OX2gkxc.js} +1 -1
  132. package/dist/ui/assets/dagre-6UL2VRFP-_OX2gkxc.js.gz +0 -0
  133. package/dist/ui/assets/{diagram-PSM6KHXK-bZdNMr9V.js → diagram-PSM6KHXK-DiegU_YP.js} +1 -1
  134. package/dist/ui/assets/diagram-PSM6KHXK-DiegU_YP.js.gz +0 -0
  135. package/dist/ui/assets/{diagram-QEK2KX5R-DvyBuPwZ.js → diagram-QEK2KX5R-RLTZ88ZV.js} +1 -1
  136. package/dist/ui/assets/diagram-QEK2KX5R-RLTZ88ZV.js.gz +0 -0
  137. package/dist/ui/assets/{diagram-S2PKOQOG-DvV0uTTN.js → diagram-S2PKOQOG-yQSuJDK3.js} +1 -1
  138. package/dist/ui/assets/diagram-S2PKOQOG-yQSuJDK3.js.gz +0 -0
  139. package/dist/ui/assets/{erDiagram-Q2GNP2WA-BTmYWhPJ.js → erDiagram-Q2GNP2WA--p-2-5N5.js} +1 -1
  140. package/dist/ui/assets/erDiagram-Q2GNP2WA--p-2-5N5.js.gz +0 -0
  141. package/dist/ui/assets/{flowDiagram-NV44I4VS-B2RLSbVi.js → flowDiagram-NV44I4VS-C4zjWB0K.js} +1 -1
  142. package/dist/ui/assets/flowDiagram-NV44I4VS-C4zjWB0K.js.gz +0 -0
  143. package/dist/ui/assets/{ganttDiagram-LVOFAZNH-497U3z0q.js → ganttDiagram-LVOFAZNH-mxE44wXO.js} +1 -1
  144. package/dist/ui/assets/ganttDiagram-LVOFAZNH-mxE44wXO.js.gz +0 -0
  145. package/dist/ui/assets/{gitGraphDiagram-NY62KEGX-D_zLKKo5.js → gitGraphDiagram-NY62KEGX-DMrIQq3G.js} +1 -1
  146. package/dist/ui/assets/gitGraphDiagram-NY62KEGX-DMrIQq3G.js.gz +0 -0
  147. package/dist/ui/assets/{graph-C96eyvF2.js → graph-VhrcdIIR.js} +1 -1
  148. package/dist/ui/assets/graph-VhrcdIIR.js.gz +0 -0
  149. package/dist/ui/assets/{index-DAG3Th-7.js → index-DKOtdAlC.js} +246 -248
  150. package/dist/ui/assets/index-DKOtdAlC.js.gz +0 -0
  151. package/dist/ui/assets/{infoDiagram-ER5ION4S-C_74OE3M.js → infoDiagram-ER5ION4S-Xoedk4d-.js} +1 -1
  152. package/dist/ui/assets/{journeyDiagram-XKPGCS4Q-CzA_GvKr.js → journeyDiagram-XKPGCS4Q-B_a5FCHm.js} +1 -1
  153. package/dist/ui/assets/journeyDiagram-XKPGCS4Q-B_a5FCHm.js.gz +0 -0
  154. package/dist/ui/assets/{kanban-definition-3W4ZIXB7-DOP0b3y_.js → kanban-definition-3W4ZIXB7-DiBtDV_W.js} +1 -1
  155. package/dist/ui/assets/kanban-definition-3W4ZIXB7-DiBtDV_W.js.gz +0 -0
  156. package/dist/ui/assets/{layout-CW1WQp_3.js → layout-bk99zgxO.js} +1 -1
  157. package/dist/ui/assets/layout-bk99zgxO.js.gz +0 -0
  158. package/dist/ui/assets/{linear-Cv3uYX5l.js → linear-DZd1s0sw.js} +1 -1
  159. package/dist/ui/assets/linear-DZd1s0sw.js.gz +0 -0
  160. package/dist/ui/assets/{mermaid.core-C-4jB_A3.js → mermaid.core-Dc9f_1yv.js} +5 -5
  161. package/dist/ui/assets/mermaid.core-Dc9f_1yv.js.gz +0 -0
  162. package/dist/ui/assets/{mindmap-definition-VGOIOE7T-CB2ELYQo.js → mindmap-definition-VGOIOE7T-J9nYSB--.js} +1 -1
  163. package/dist/ui/assets/mindmap-definition-VGOIOE7T-J9nYSB--.js.gz +0 -0
  164. package/dist/ui/assets/{pieDiagram-ADFJNKIX-HnXxtlZ9.js → pieDiagram-ADFJNKIX-Dh-hO5TS.js} +1 -1
  165. package/dist/ui/assets/pieDiagram-ADFJNKIX-Dh-hO5TS.js.gz +0 -0
  166. package/dist/ui/assets/{quadrantDiagram-AYHSOK5B-Iq9g2p8B.js → quadrantDiagram-AYHSOK5B-COUMk2nQ.js} +1 -1
  167. package/dist/ui/assets/quadrantDiagram-AYHSOK5B-COUMk2nQ.js.gz +0 -0
  168. package/dist/ui/assets/{requirementDiagram-UZGBJVZJ-DDFb6VL2.js → requirementDiagram-UZGBJVZJ-DVSwLaEz.js} +1 -1
  169. package/dist/ui/assets/requirementDiagram-UZGBJVZJ-DVSwLaEz.js.gz +0 -0
  170. package/dist/ui/assets/{sankeyDiagram-TZEHDZUN-CXiKAieY.js → sankeyDiagram-TZEHDZUN-CCEMM6UB.js} +1 -1
  171. package/dist/ui/assets/sankeyDiagram-TZEHDZUN-CCEMM6UB.js.gz +0 -0
  172. package/dist/ui/assets/{sequenceDiagram-WL72ISMW-rf_zL-yk.js → sequenceDiagram-WL72ISMW-DnlaHA2K.js} +1 -1
  173. package/dist/ui/assets/sequenceDiagram-WL72ISMW-DnlaHA2K.js.gz +0 -0
  174. package/dist/ui/assets/{stateDiagram-FKZM4ZOC-Bqqna_jr.js → stateDiagram-FKZM4ZOC-DJftQqhn.js} +1 -1
  175. package/dist/ui/assets/stateDiagram-FKZM4ZOC-DJftQqhn.js.gz +0 -0
  176. package/dist/ui/assets/stateDiagram-v2-4FDKWEC3-9ApJophA.js +1 -0
  177. package/dist/ui/assets/{timeline-definition-IT6M3QCI-BM21Xo3N.js → timeline-definition-IT6M3QCI-BB3mW5UW.js} +1 -1
  178. package/dist/ui/assets/timeline-definition-IT6M3QCI-BB3mW5UW.js.gz +0 -0
  179. package/dist/ui/assets/{treemap-KMMF4GRG-uSEFIr6t.js → treemap-KMMF4GRG-KI87p8ms.js} +1 -1
  180. package/dist/ui/assets/treemap-KMMF4GRG-KI87p8ms.js.gz +0 -0
  181. package/dist/ui/assets/{xychartDiagram-PRI3JC2R-C0rLaN2k.js → xychartDiagram-PRI3JC2R-BcAowgbC.js} +1 -1
  182. package/dist/ui/assets/xychartDiagram-PRI3JC2R-BcAowgbC.js.gz +0 -0
  183. package/dist/ui/index.html +1 -1
  184. package/package.json +6 -4
  185. package/dist/ui/assets/_basePickBy-BcsCIFl3.js.gz +0 -0
  186. package/dist/ui/assets/_baseUniq-C9qLHNz1.js.gz +0 -0
  187. package/dist/ui/assets/arc-Ceq4haa-.js.gz +0 -0
  188. package/dist/ui/assets/architectureDiagram-VXUJARFQ-DfyMRH2g.js.gz +0 -0
  189. package/dist/ui/assets/blockDiagram-VD42YOAC-B-zMNwIS.js.gz +0 -0
  190. package/dist/ui/assets/c4Diagram-YG6GDRKO-BMw-AOGm.js.gz +0 -0
  191. package/dist/ui/assets/channel-Bd2BDOXM.js +0 -1
  192. package/dist/ui/assets/chunk-B4BG7PRW-D4eKcLoO.js.gz +0 -0
  193. package/dist/ui/assets/chunk-DI55MBZ5-BhCXePw-.js.gz +0 -0
  194. package/dist/ui/assets/chunk-TZMSLE5B-D6ocQBEr.js.gz +0 -0
  195. package/dist/ui/assets/classDiagram-2ON5EDUG-BeBW1sCT.js +0 -1
  196. package/dist/ui/assets/classDiagram-v2-WZHVMYZB-BeBW1sCT.js +0 -1
  197. package/dist/ui/assets/clone-BYVESyX3.js +0 -1
  198. package/dist/ui/assets/cose-bilkent-S5V4N54A-DCGk_n2D.js.gz +0 -0
  199. package/dist/ui/assets/dagre-6UL2VRFP-CsjhA74v.js.gz +0 -0
  200. package/dist/ui/assets/diagram-PSM6KHXK-bZdNMr9V.js.gz +0 -0
  201. package/dist/ui/assets/diagram-QEK2KX5R-DvyBuPwZ.js.gz +0 -0
  202. package/dist/ui/assets/diagram-S2PKOQOG-DvV0uTTN.js.gz +0 -0
  203. package/dist/ui/assets/erDiagram-Q2GNP2WA-BTmYWhPJ.js.gz +0 -0
  204. package/dist/ui/assets/flowDiagram-NV44I4VS-B2RLSbVi.js.gz +0 -0
  205. package/dist/ui/assets/ganttDiagram-LVOFAZNH-497U3z0q.js.gz +0 -0
  206. package/dist/ui/assets/gitGraphDiagram-NY62KEGX-D_zLKKo5.js.gz +0 -0
  207. package/dist/ui/assets/graph-C96eyvF2.js.gz +0 -0
  208. package/dist/ui/assets/index-DAG3Th-7.js.gz +0 -0
  209. package/dist/ui/assets/journeyDiagram-XKPGCS4Q-CzA_GvKr.js.gz +0 -0
  210. package/dist/ui/assets/kanban-definition-3W4ZIXB7-DOP0b3y_.js.gz +0 -0
  211. package/dist/ui/assets/layout-CW1WQp_3.js.gz +0 -0
  212. package/dist/ui/assets/linear-Cv3uYX5l.js.gz +0 -0
  213. package/dist/ui/assets/mermaid.core-C-4jB_A3.js.gz +0 -0
  214. package/dist/ui/assets/mindmap-definition-VGOIOE7T-CB2ELYQo.js.gz +0 -0
  215. package/dist/ui/assets/pieDiagram-ADFJNKIX-HnXxtlZ9.js.gz +0 -0
  216. package/dist/ui/assets/quadrantDiagram-AYHSOK5B-Iq9g2p8B.js.gz +0 -0
  217. package/dist/ui/assets/requirementDiagram-UZGBJVZJ-DDFb6VL2.js.gz +0 -0
  218. package/dist/ui/assets/sankeyDiagram-TZEHDZUN-CXiKAieY.js.gz +0 -0
  219. package/dist/ui/assets/sequenceDiagram-WL72ISMW-rf_zL-yk.js.gz +0 -0
  220. package/dist/ui/assets/stateDiagram-FKZM4ZOC-Bqqna_jr.js.gz +0 -0
  221. package/dist/ui/assets/stateDiagram-v2-4FDKWEC3-Bxdu6frV.js +0 -1
  222. package/dist/ui/assets/timeline-definition-IT6M3QCI-BM21Xo3N.js.gz +0 -0
  223. package/dist/ui/assets/treemap-KMMF4GRG-uSEFIr6t.js.gz +0 -0
  224. package/dist/ui/assets/xychartDiagram-PRI3JC2R-C0rLaN2k.js.gz +0 -0
@@ -1,19 +1,21 @@
1
1
  /**
2
2
  * Node.js version check utility
3
- * Used by CLI and daemon entry points to ensure Node 20+ requirement
3
+ * Used by CLI and daemon entry points to ensure Node 22+ requirement
4
4
  */
5
5
 
6
6
  import chalk from 'chalk';
7
7
 
8
8
  export function checkNodeVersion() {
9
9
  const nodeVersion = process.versions.node;
10
- const majorVersion = parseInt(nodeVersion.split('.')[0], 10);
10
+ const [majorStr, minorStr] = nodeVersion.split('.');
11
+ const major = parseInt(majorStr, 10);
12
+ const minor = parseInt(minorStr, 10);
11
13
 
12
- if (majorVersion < 20) {
13
- console.error(chalk.red('✖ Error: Agor requires Node.js v20.0.0 or higher'));
14
+ if (major < 22 || (major === 22 && minor < 12)) {
15
+ console.error(chalk.red('✖ Error: Agor requires Node.js v22.12.0 or higher'));
14
16
  console.error(chalk.yellow(` Current version: v${nodeVersion}\n`));
15
17
  console.error('Please upgrade Node.js:');
16
- console.error(` • Using nvm: ${chalk.cyan('nvm install 20 && nvm use 20')}`);
18
+ console.error(` • Using nvm: ${chalk.cyan('nvm install 22 && nvm use 22')}`);
17
19
  console.error(` • Download: ${chalk.cyan('https://nodejs.org/')}\n`);
18
20
  process.exit(1);
19
21
  }
@@ -1,11 +1,11 @@
1
1
  import { i as Message } from '../message-kDoxvdzV.cjs';
2
2
  import { e as Board, f as BoardExportBlob } from '../board-HBLXfsPa.cjs';
3
3
  import { a as ContextFileListItem, b as ContextFileDetail } from '../context-ByxGjp5l.cjs';
4
- import { b as AuthenticationResult } from '../feathers-B78IxAoi.cjs';
4
+ import { b as AuthenticationResult } from '../feathers-5DsXBqOW.cjs';
5
5
  import { f as Session } from '../session-DmaExlXI.cjs';
6
6
  import { d as User } from '../user-D8Z4aURB.cjs';
7
7
  import { i as MCPServer } from '../mcp-DhSSHDnR.cjs';
8
- import { b as Repo, d as Worktree } from '../worktree-BUhwPBvP.cjs';
8
+ import { b as Repo, d as Worktree } from '../worktree-CvakJ5w4.cjs';
9
9
  import { c as Task } from '../task-Cw2N74jk.cjs';
10
10
  import { Params, Paginated, Application } from '@feathersjs/feathers';
11
11
  import { Socket } from 'socket.io-client';
@@ -1,11 +1,11 @@
1
1
  import { i as Message } from '../message-C9XTt2nM.js';
2
2
  import { e as Board, f as BoardExportBlob } from '../board-CD258gWW.js';
3
3
  import { a as ContextFileListItem, b as ContextFileDetail } from '../context-ByxGjp5l.js';
4
- import { b as AuthenticationResult } from '../feathers-MlqnVpas.js';
4
+ import { b as AuthenticationResult } from '../feathers-qrz_9jSJ.js';
5
5
  import { f as Session } from '../session-0b_yCNQr.js';
6
6
  import { d as User } from '../user-BpflK7uR.js';
7
7
  import { i as MCPServer } from '../mcp-Db0cL7Xc.js';
8
- import { b as Repo, d as Worktree } from '../worktree-z5k683z2.js';
8
+ import { b as Repo, d as Worktree } from '../worktree-Dr_m10w8.js';
9
9
  import { c as Task } from '../task-C2jNGWSt.js';
10
10
  import { Params, Paginated, Application } from '@feathersjs/feathers';
11
11
  import { Socket } from 'socket.io-client';
@@ -1,6 +1,6 @@
1
- import { R as RepoSlug, W as WorktreeName, b as Repo, d as Worktree } from '../worktree-BUhwPBvP.cjs';
1
+ import { R as RepoSlug, W as WorktreeName, b as Repo, d as Worktree } from '../worktree-CvakJ5w4.cjs';
2
2
  import { U as UUID } from '../id-BwPJtWxW.cjs';
3
- export { f as AgorCodexSettings, k as AgorConfig, i as AgorCredentials, b as AgorDaemonSettings, e as AgorDatabaseSettings, A as AgorDefaults, a as AgorDisplaySettings, g as AgorExecutionSettings, j as AgorOnboardingSettings, d as AgorOpenCodeSettings, h as AgorPathSettings, c as AgorUISettings, l as ConfigKey, C as CredentialKey, U as UnknownJson } from '../types-D7s9-Y1x.cjs';
3
+ export { f as AgorCodexSettings, k as AgorConfig, i as AgorCredentials, b as AgorDaemonSettings, e as AgorDatabaseSettings, A as AgorDefaults, a as AgorDisplaySettings, g as AgorExecutionSettings, j as AgorOnboardingSettings, d as AgorOpenCodeSettings, h as AgorPathSettings, c as AgorUISettings, l as ConfigKey, C as CredentialKey, U as UnknownJson } from '../types-Cox7HmbB.cjs';
4
4
 
5
5
  /**
6
6
  * App-level constants for Agor
@@ -1,6 +1,6 @@
1
- import { R as RepoSlug, W as WorktreeName, b as Repo, d as Worktree } from '../worktree-z5k683z2.js';
1
+ import { R as RepoSlug, W as WorktreeName, b as Repo, d as Worktree } from '../worktree-Dr_m10w8.js';
2
2
  import { U as UUID } from '../id-BwPJtWxW.js';
3
- export { f as AgorCodexSettings, k as AgorConfig, i as AgorCredentials, b as AgorDaemonSettings, e as AgorDatabaseSettings, A as AgorDefaults, a as AgorDisplaySettings, g as AgorExecutionSettings, j as AgorOnboardingSettings, d as AgorOpenCodeSettings, h as AgorPathSettings, c as AgorUISettings, l as ConfigKey, C as CredentialKey, U as UnknownJson } from '../types-D7s9-Y1x.js';
3
+ export { f as AgorCodexSettings, k as AgorConfig, i as AgorCredentials, b as AgorDaemonSettings, e as AgorDatabaseSettings, A as AgorDefaults, a as AgorDisplaySettings, g as AgorExecutionSettings, j as AgorOnboardingSettings, d as AgorOpenCodeSettings, h as AgorPathSettings, c as AgorUISettings, l as ConfigKey, C as CredentialKey, U as UnknownJson } from '../types-Cox7HmbB.js';
4
4
 
5
5
  /**
6
6
  * App-level constants for Agor
@@ -1,9 +1,9 @@
1
- import { h as RepoEnvironmentConfig } from '../worktree-BUhwPBvP.cjs';
2
- export { c as ensureCodexHome, e as expandHomePath, g as getAgorHome, j as getBaseUrl, a as getConfigPath, d as getConfigValue, m as getCredential, h as getDaemonUrl, n as getDaemonUser, t as getDataHome, y as getDataHomeAsync, b as getDefaultConfig, v as getReposDir, z as getReposDirAsync, x as getWorktreePath, w as getWorktreesDir, A as getWorktreesDirAsync, i as initConfig, q as isUnixImpersonationEnabled, p as isWorktreeRbacEnabled, l as loadConfig, k as loadConfigSync, o as requireDaemonUser, r as resolveCodexHome, s as saveConfig, f as setConfigValue, u as unsetConfigValue } from '../config-manager-4zF2cWdg.cjs';
1
+ import { h as RepoEnvironmentConfig } from '../worktree-CvakJ5w4.cjs';
2
+ export { c as ensureCodexHome, e as expandHomePath, g as getAgorHome, j as getBaseUrl, a as getConfigPath, d as getConfigValue, m as getCredential, h as getDaemonUrl, n as getDaemonUser, t as getDataHome, y as getDataHomeAsync, b as getDefaultConfig, v as getReposDir, z as getReposDirAsync, x as getWorktreePath, w as getWorktreesDir, A as getWorktreesDirAsync, i as initConfig, q as isUnixImpersonationEnabled, p as isWorktreeRbacEnabled, l as loadConfig, k as loadConfigSync, o as requireDaemonUser, r as resolveCodexHome, s as saveConfig, f as setConfigValue, u as unsetConfigValue } from '../config-manager-Dw2LXbKq.cjs';
3
3
  export { DAEMON, DATABASE, ENVIRONMENT, GIT, PAGINATION, RepoReference, RepoReferenceOption, SESSION, WEBSOCKET, extractSlugFromUrl, formatRepoReference, getDefaultRepoReference, getGroupedRepoReferenceOptions, getRepoReferenceOptions, isValidGitUrl, isValidSlug, parseRepoReference, resolveRepoReference } from './browser.cjs';
4
4
  import { d as Database } from '../client-uz0_yQFy.cjs';
5
5
  import { b as UserID } from '../id-BwPJtWxW.cjs';
6
- export { f as AgorCodexSettings, k as AgorConfig, i as AgorCredentials, b as AgorDaemonSettings, e as AgorDatabaseSettings, A as AgorDefaults, a as AgorDisplaySettings, g as AgorExecutionSettings, j as AgorOnboardingSettings, d as AgorOpenCodeSettings, h as AgorPathSettings, c as AgorUISettings, l as ConfigKey, C as CredentialKey, U as UnknownJson } from '../types-D7s9-Y1x.cjs';
6
+ export { f as AgorCodexSettings, k as AgorConfig, i as AgorCredentials, b as AgorDaemonSettings, e as AgorDatabaseSettings, A as AgorDefaults, a as AgorDisplaySettings, g as AgorExecutionSettings, j as AgorOnboardingSettings, d as AgorOpenCodeSettings, h as AgorPathSettings, c as AgorUISettings, l as ConfigKey, C as CredentialKey, U as UnknownJson } from '../types-Cox7HmbB.cjs';
7
7
  import 'drizzle-orm/libsql';
8
8
  import 'drizzle-orm/postgres-js';
9
9
  import 'drizzle-orm';
@@ -1,9 +1,9 @@
1
- import { h as RepoEnvironmentConfig } from '../worktree-z5k683z2.js';
2
- export { c as ensureCodexHome, e as expandHomePath, g as getAgorHome, j as getBaseUrl, a as getConfigPath, d as getConfigValue, m as getCredential, h as getDaemonUrl, n as getDaemonUser, t as getDataHome, y as getDataHomeAsync, b as getDefaultConfig, v as getReposDir, z as getReposDirAsync, x as getWorktreePath, w as getWorktreesDir, A as getWorktreesDirAsync, i as initConfig, q as isUnixImpersonationEnabled, p as isWorktreeRbacEnabled, l as loadConfig, k as loadConfigSync, o as requireDaemonUser, r as resolveCodexHome, s as saveConfig, f as setConfigValue, u as unsetConfigValue } from '../config-manager-DdwPsKTh.js';
1
+ import { h as RepoEnvironmentConfig } from '../worktree-Dr_m10w8.js';
2
+ export { c as ensureCodexHome, e as expandHomePath, g as getAgorHome, j as getBaseUrl, a as getConfigPath, d as getConfigValue, m as getCredential, h as getDaemonUrl, n as getDaemonUser, t as getDataHome, y as getDataHomeAsync, b as getDefaultConfig, v as getReposDir, z as getReposDirAsync, x as getWorktreePath, w as getWorktreesDir, A as getWorktreesDirAsync, i as initConfig, q as isUnixImpersonationEnabled, p as isWorktreeRbacEnabled, l as loadConfig, k as loadConfigSync, o as requireDaemonUser, r as resolveCodexHome, s as saveConfig, f as setConfigValue, u as unsetConfigValue } from '../config-manager-BDJG7HPR.js';
3
3
  export { DAEMON, DATABASE, ENVIRONMENT, GIT, PAGINATION, RepoReference, RepoReferenceOption, SESSION, WEBSOCKET, extractSlugFromUrl, formatRepoReference, getDefaultRepoReference, getGroupedRepoReferenceOptions, getRepoReferenceOptions, isValidGitUrl, isValidSlug, parseRepoReference, resolveRepoReference } from './browser.js';
4
4
  import { d as Database } from '../client-BOtnEgnk.js';
5
5
  import { b as UserID } from '../id-BwPJtWxW.js';
6
- export { f as AgorCodexSettings, k as AgorConfig, i as AgorCredentials, b as AgorDaemonSettings, e as AgorDatabaseSettings, A as AgorDefaults, a as AgorDisplaySettings, g as AgorExecutionSettings, j as AgorOnboardingSettings, d as AgorOpenCodeSettings, h as AgorPathSettings, c as AgorUISettings, l as ConfigKey, C as CredentialKey, U as UnknownJson } from '../types-D7s9-Y1x.js';
6
+ export { f as AgorCodexSettings, k as AgorConfig, i as AgorCredentials, b as AgorDaemonSettings, e as AgorDatabaseSettings, A as AgorDefaults, a as AgorDisplaySettings, g as AgorExecutionSettings, j as AgorOnboardingSettings, d as AgorOpenCodeSettings, h as AgorPathSettings, c as AgorUISettings, l as ConfigKey, C as CredentialKey, U as UnknownJson } from '../types-Cox7HmbB.js';
7
7
  import 'drizzle-orm/libsql';
8
8
  import 'drizzle-orm/postgres-js';
9
9
  import 'drizzle-orm';
@@ -1,4 +1,4 @@
1
- import { k as AgorConfig } from './types-D7s9-Y1x.js';
1
+ import { k as AgorConfig } from './types-Cox7HmbB.js';
2
2
 
3
3
  /**
4
4
  * Agor Config Manager
@@ -1,4 +1,4 @@
1
- import { k as AgorConfig } from './types-D7s9-Y1x.cjs';
1
+ import { k as AgorConfig } from './types-Cox7HmbB.cjs';
2
2
 
3
3
  /**
4
4
  * Agor Config Manager
@@ -4918,12 +4918,9 @@ var SessionRepository = class {
4918
4918
  const current = this.rowToSession(currentRow, boardId, boardSlug, baseUrl);
4919
4919
  const merged = deepMerge(current, updates);
4920
4920
  const insertData = this.sessionToInsert(merged);
4921
- await update(tx, sessions3).set({
4922
- status: insertData.status,
4923
- updated_at: /* @__PURE__ */ new Date(),
4924
- ready_for_prompt: insertData.ready_for_prompt,
4925
- data: insertData.data
4926
- }).where((0, import_drizzle_orm12.eq)(sessions3.session_id, fullId)).run();
4921
+ insertData.updated_at = /* @__PURE__ */ new Date();
4922
+ await update(tx, sessions3).set(insertData).where((0, import_drizzle_orm12.eq)(sessions3.session_id, fullId)).run();
4923
+ merged.last_updated = insertData.updated_at.toISOString();
4927
4924
  return merged;
4928
4925
  });
4929
4926
  return result;
@@ -17,7 +17,7 @@ import { a as BoardEntityObject, e as Board, d as BoardObject, f as BoardExportB
17
17
  import { c as GatewayChannel, G as GatewayChannelID, d as ThreadSessionMap, a as ThreadStatus, T as ThreadSessionMapID } from '../gateway-DmSEDGAS.cjs';
18
18
  import { i as MCPServer, C as CreateMCPServerInput, U as UpdateMCPServerInput, j as MCPServerFilters, M as MCPServerID, S as SessionMCPServer } from '../mcp-DhSSHDnR.cjs';
19
19
  import { i as Message } from '../message-kDoxvdzV.cjs';
20
- import { b as Repo, d as Worktree } from '../worktree-BUhwPBvP.cjs';
20
+ import { b as Repo, d as Worktree } from '../worktree-CvakJ5w4.cjs';
21
21
  import { c as Task } from '../task-Cw2N74jk.cjs';
22
22
  import { d as User } from '../user-D8Z4aURB.cjs';
23
23
  import { S as SessionStatus, A as AgenticToolName, f as Session, P as PermissionMode, c as CodexSandboxMode, d as CodexApprovalPolicy } from '../session-DmaExlXI.cjs';
@@ -17,7 +17,7 @@ import { a as BoardEntityObject, e as Board, d as BoardObject, f as BoardExportB
17
17
  import { c as GatewayChannel, G as GatewayChannelID, d as ThreadSessionMap, a as ThreadStatus, T as ThreadSessionMapID } from '../gateway-BlmPS6ee.js';
18
18
  import { i as MCPServer, C as CreateMCPServerInput, U as UpdateMCPServerInput, j as MCPServerFilters, M as MCPServerID, S as SessionMCPServer } from '../mcp-Db0cL7Xc.js';
19
19
  import { i as Message } from '../message-C9XTt2nM.js';
20
- import { b as Repo, d as Worktree } from '../worktree-z5k683z2.js';
20
+ import { b as Repo, d as Worktree } from '../worktree-Dr_m10w8.js';
21
21
  import { c as Task } from '../task-C2jNGWSt.js';
22
22
  import { d as User } from '../user-BpflK7uR.js';
23
23
  import { S as SessionStatus, A as AgenticToolName, f as Session, P as PermissionMode, c as CodexSandboxMode, d as CodexApprovalPolicy } from '../session-0b_yCNQr.js';
@@ -4824,12 +4824,9 @@ var SessionRepository = class {
4824
4824
  const current = this.rowToSession(currentRow, boardId, boardSlug, baseUrl);
4825
4825
  const merged = deepMerge(current, updates);
4826
4826
  const insertData = this.sessionToInsert(merged);
4827
- await update(tx, sessions3).set({
4828
- status: insertData.status,
4829
- updated_at: /* @__PURE__ */ new Date(),
4830
- ready_for_prompt: insertData.ready_for_prompt,
4831
- data: insertData.data
4832
- }).where(eq9(sessions3.session_id, fullId)).run();
4827
+ insertData.updated_at = /* @__PURE__ */ new Date();
4828
+ await update(tx, sessions3).set(insertData).where(eq9(sessions3.session_id, fullId)).run();
4829
+ merged.last_updated = insertData.updated_at.toISOString();
4833
4830
  return merged;
4834
4831
  });
4835
4832
  return result;
@@ -1,4 +1,4 @@
1
- import { g as WorktreeEnvironmentInstance } from '../worktree-BUhwPBvP.cjs';
1
+ import { g as WorktreeEnvironmentInstance } from '../worktree-CvakJ5w4.cjs';
2
2
  import '../id-BwPJtWxW.cjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { g as WorktreeEnvironmentInstance } from '../worktree-z5k683z2.js';
1
+ import { g as WorktreeEnvironmentInstance } from '../worktree-Dr_m10w8.js';
2
2
  import '../id-BwPJtWxW.js';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { f as Session } from './session-DmaExlXI.cjs';
2
- import { d as Worktree } from './worktree-BUhwPBvP.cjs';
2
+ import { d as Worktree } from './worktree-CvakJ5w4.cjs';
3
3
  import { Params, HookContext as HookContext$1, Paginated } from '@feathersjs/feathers';
4
4
 
5
5
  /**
@@ -15,6 +15,8 @@ interface AuthenticatedUser {
15
15
  email: string;
16
16
  /** User role (for authorization) - always defined, defaults to 'member' */
17
17
  role: string;
18
+ /** True for service accounts (executor) — bypasses RBAC checks */
19
+ _isServiceAccount?: boolean;
18
20
  }
19
21
  /**
20
22
  * Extended params with authentication context
@@ -1,5 +1,5 @@
1
1
  import { f as Session } from './session-0b_yCNQr.js';
2
- import { d as Worktree } from './worktree-z5k683z2.js';
2
+ import { d as Worktree } from './worktree-Dr_m10w8.js';
3
3
  import { Params, HookContext as HookContext$1, Paginated } from '@feathersjs/feathers';
4
4
 
5
5
  /**
@@ -15,6 +15,8 @@ interface AuthenticatedUser {
15
15
  email: string;
16
16
  /** User role (for authorization) - always defined, defaults to 'member' */
17
17
  role: string;
18
+ /** True for service accounts (executor) — bypasses RBAC checks */
19
+ _isServiceAccount?: boolean;
18
20
  }
19
21
  /**
20
22
  * Extended params with authentication context
@@ -30,6 +30,7 @@ module.exports = __toCommonJS(gateway_exports);
30
30
  // src/gateway/connectors/slack.ts
31
31
  var import_socket_mode = require("@slack/socket-mode");
32
32
  var import_web_api = require("@slack/web-api");
33
+ var import_slackify_markdown = require("slackify-markdown");
33
34
  function parseThreadId(threadId) {
34
35
  const lastHyphen = threadId.lastIndexOf("-");
35
36
  if (lastHyphen === -1) {
@@ -52,7 +53,7 @@ function hasActiveMention(text, mentionPattern) {
52
53
  return mentionPattern.test(stripped);
53
54
  }
54
55
  function markdownToMrkdwn(markdown) {
55
- return markdown.replace(/\*\*(.+?)\*\*/g, "*$1*").replace(/\[([^\]]+)\]\(([^)]+)\)/g, "<$2|$1>");
56
+ return (0, import_slackify_markdown.slackifyMarkdown)(markdown).trim();
56
57
  }
57
58
  var SlackConnector = class _SlackConnector {
58
59
  channelType = "slack";
@@ -124,7 +125,7 @@ var SlackConnector = class _SlackConnector {
124
125
  const result = await this.web.chat.postMessage({
125
126
  channel,
126
127
  thread_ts,
127
- text: this.formatMessage(req.text),
128
+ text: req.text,
128
129
  unfurl_links: false,
129
130
  unfurl_media: false
130
131
  });
@@ -1,6 +1,7 @@
1
1
  // src/gateway/connectors/slack.ts
2
2
  import { SocketModeClient } from "@slack/socket-mode";
3
3
  import { WebClient } from "@slack/web-api";
4
+ import { slackifyMarkdown } from "slackify-markdown";
4
5
  function parseThreadId(threadId) {
5
6
  const lastHyphen = threadId.lastIndexOf("-");
6
7
  if (lastHyphen === -1) {
@@ -23,7 +24,7 @@ function hasActiveMention(text, mentionPattern) {
23
24
  return mentionPattern.test(stripped);
24
25
  }
25
26
  function markdownToMrkdwn(markdown) {
26
- return markdown.replace(/\*\*(.+?)\*\*/g, "*$1*").replace(/\[([^\]]+)\]\(([^)]+)\)/g, "<$2|$1>");
27
+ return slackifyMarkdown(markdown).trim();
27
28
  }
28
29
  var SlackConnector = class _SlackConnector {
29
30
  channelType = "slack";
@@ -95,7 +96,7 @@ var SlackConnector = class _SlackConnector {
95
96
  const result = await this.web.chat.postMessage({
96
97
  channel,
97
98
  thread_ts,
98
- text: this.formatMessage(req.text),
99
+ text: req.text,
99
100
  unfurl_links: false,
100
101
  unfurl_media: false
101
102
  });
@@ -33,6 +33,7 @@ __export(git_exports, {
33
33
  cleanWorktree: () => cleanWorktree,
34
34
  cloneRepo: () => cloneRepo,
35
35
  createWorktree: () => createWorktree,
36
+ deleteBranch: () => deleteBranch,
36
37
  deleteRepoDirectory: () => deleteRepoDirectory,
37
38
  deleteWorktreeDirectory: () => deleteWorktreeDirectory,
38
39
  extractRepoName: () => extractRepoName,
@@ -208,6 +209,9 @@ function createGit(baseDir, env) {
208
209
  baseDir,
209
210
  binary: gitBinary,
210
211
  config,
212
+ unsafe: {
213
+ allowUnsafeSshCommand: true
214
+ },
211
215
  spawnOptions: env ? {
212
216
  env: { ...process.env, ...env }
213
217
  // biome-ignore lint/suspicious/noExplicitAny: simple-git types don't expose env in spawnOptions
@@ -394,7 +398,29 @@ async function createWorktree(repoPath, worktreePath, ref, createBranch = false,
394
398
  } else {
395
399
  args.push(ref);
396
400
  }
397
- await git.raw(["worktree", "add", ...args]);
401
+ try {
402
+ await git.raw(["worktree", "add", ...args]);
403
+ } catch (error) {
404
+ const errorMessage = error instanceof Error ? error.message : String(error);
405
+ if (createBranch && errorMessage.includes("already exists")) {
406
+ console.warn(
407
+ `\u26A0\uFE0F Branch '${ref}' already exists. Checking if it's orphaned (stale from a deleted worktree)...`
408
+ );
409
+ const worktrees = await listWorktrees(repoPath);
410
+ const branchInUse = worktrees.some((wt) => wt.ref === ref);
411
+ if (branchInUse) {
412
+ throw new Error(
413
+ `A branch named '${ref}' already exists and is in use by another worktree. Please choose a different name.`
414
+ );
415
+ }
416
+ console.log(`\u{1F9F9} Deleting orphaned branch '${ref}' and retrying worktree creation...`);
417
+ await git.raw(["branch", "-D", ref]);
418
+ await git.raw(["worktree", "add", ...args]);
419
+ console.log(`\u2705 Successfully created worktree after cleaning up stale branch '${ref}'`);
420
+ } else {
421
+ throw error;
422
+ }
423
+ }
398
424
  try {
399
425
  const worktreeGit = createGit(worktreePath, env);
400
426
  await worktreeGit.addConfig("safe.directory", worktreePath, true, "global");
@@ -547,11 +573,25 @@ async function deleteWorktreeDirectory(worktreePath) {
547
573
  }
548
574
  await rm(resolvedWorktreePath, { recursive: true, force: true });
549
575
  }
576
+ async function deleteBranch(repoPath, branchName) {
577
+ const git = createGit(repoPath);
578
+ try {
579
+ await git.raw(["branch", "-D", branchName]);
580
+ return true;
581
+ } catch (error) {
582
+ const msg = error instanceof Error ? error.message : String(error);
583
+ if (msg.includes("not found")) {
584
+ return false;
585
+ }
586
+ throw error;
587
+ }
588
+ }
550
589
  // Annotate the CommonJS export names for ESM import in node:
551
590
  0 && (module.exports = {
552
591
  cleanWorktree,
553
592
  cloneRepo,
554
593
  createWorktree,
594
+ deleteBranch,
555
595
  deleteRepoDirectory,
556
596
  deleteWorktreeDirectory,
557
597
  extractRepoName,
@@ -1,6 +1,6 @@
1
1
  export { simpleGit } from 'simple-git';
2
- export { v as getReposDir, x as getWorktreePath, w as getWorktreesDir } from '../config-manager-4zF2cWdg.cjs';
3
- import '../types-D7s9-Y1x.cjs';
2
+ export { v as getReposDir, x as getWorktreePath, w as getWorktreesDir } from '../config-manager-Dw2LXbKq.cjs';
3
+ import '../types-Cox7HmbB.cjs';
4
4
 
5
5
  /**
6
6
  * Git Utils for Agor
@@ -171,5 +171,16 @@ declare function deleteRepoDirectory(repoPath: string): Promise<void>;
171
171
  * @throws Error if the path is not inside the configured worktrees directory (safety check)
172
172
  */
173
173
  declare function deleteWorktreeDirectory(worktreePath: string): Promise<void>;
174
+ /**
175
+ * Delete a local git branch
176
+ *
177
+ * Uses -D (force delete) to handle branches that haven't been merged.
178
+ * Silently succeeds if the branch doesn't exist.
179
+ *
180
+ * @param repoPath - Path to the repository
181
+ * @param branchName - Branch name to delete
182
+ * @returns true if branch was deleted, false if it didn't exist
183
+ */
184
+ declare function deleteBranch(repoPath: string, branchName: string): Promise<boolean>;
174
185
 
175
- export { type CloneOptions, type CloneProgress, type CloneResult, type WorktreeInfo, cleanWorktree, cloneRepo, createWorktree, deleteRepoDirectory, deleteWorktreeDirectory, extractRepoName, getCurrentBranch, getCurrentSha, getDefaultBranch, getGitState, getRemoteBranches, getRemoteUrl, hasRemoteBranch, isClean, isGitRepo, isValidGitRepo, listWorktrees, pruneWorktrees, removeWorktree };
186
+ export { type CloneOptions, type CloneProgress, type CloneResult, type WorktreeInfo, cleanWorktree, cloneRepo, createWorktree, deleteBranch, deleteRepoDirectory, deleteWorktreeDirectory, extractRepoName, getCurrentBranch, getCurrentSha, getDefaultBranch, getGitState, getRemoteBranches, getRemoteUrl, hasRemoteBranch, isClean, isGitRepo, isValidGitRepo, listWorktrees, pruneWorktrees, removeWorktree };
@@ -1,6 +1,6 @@
1
1
  export { simpleGit } from 'simple-git';
2
- export { v as getReposDir, x as getWorktreePath, w as getWorktreesDir } from '../config-manager-DdwPsKTh.js';
3
- import '../types-D7s9-Y1x.js';
2
+ export { v as getReposDir, x as getWorktreePath, w as getWorktreesDir } from '../config-manager-BDJG7HPR.js';
3
+ import '../types-Cox7HmbB.js';
4
4
 
5
5
  /**
6
6
  * Git Utils for Agor
@@ -171,5 +171,16 @@ declare function deleteRepoDirectory(repoPath: string): Promise<void>;
171
171
  * @throws Error if the path is not inside the configured worktrees directory (safety check)
172
172
  */
173
173
  declare function deleteWorktreeDirectory(worktreePath: string): Promise<void>;
174
+ /**
175
+ * Delete a local git branch
176
+ *
177
+ * Uses -D (force delete) to handle branches that haven't been merged.
178
+ * Silently succeeds if the branch doesn't exist.
179
+ *
180
+ * @param repoPath - Path to the repository
181
+ * @param branchName - Branch name to delete
182
+ * @returns true if branch was deleted, false if it didn't exist
183
+ */
184
+ declare function deleteBranch(repoPath: string, branchName: string): Promise<boolean>;
174
185
 
175
- export { type CloneOptions, type CloneProgress, type CloneResult, type WorktreeInfo, cleanWorktree, cloneRepo, createWorktree, deleteRepoDirectory, deleteWorktreeDirectory, extractRepoName, getCurrentBranch, getCurrentSha, getDefaultBranch, getGitState, getRemoteBranches, getRemoteUrl, hasRemoteBranch, isClean, isGitRepo, isValidGitRepo, listWorktrees, pruneWorktrees, removeWorktree };
186
+ export { type CloneOptions, type CloneProgress, type CloneResult, type WorktreeInfo, cleanWorktree, cloneRepo, createWorktree, deleteBranch, deleteRepoDirectory, deleteWorktreeDirectory, extractRepoName, getCurrentBranch, getCurrentSha, getDefaultBranch, getGitState, getRemoteBranches, getRemoteUrl, hasRemoteBranch, isClean, isGitRepo, isValidGitRepo, listWorktrees, pruneWorktrees, removeWorktree };
@@ -152,6 +152,9 @@ function createGit(baseDir, env) {
152
152
  baseDir,
153
153
  binary: gitBinary,
154
154
  config,
155
+ unsafe: {
156
+ allowUnsafeSshCommand: true
157
+ },
155
158
  spawnOptions: env ? {
156
159
  env: { ...process.env, ...env }
157
160
  // biome-ignore lint/suspicious/noExplicitAny: simple-git types don't expose env in spawnOptions
@@ -338,7 +341,29 @@ async function createWorktree(repoPath, worktreePath, ref, createBranch = false,
338
341
  } else {
339
342
  args.push(ref);
340
343
  }
341
- await git.raw(["worktree", "add", ...args]);
344
+ try {
345
+ await git.raw(["worktree", "add", ...args]);
346
+ } catch (error) {
347
+ const errorMessage = error instanceof Error ? error.message : String(error);
348
+ if (createBranch && errorMessage.includes("already exists")) {
349
+ console.warn(
350
+ `\u26A0\uFE0F Branch '${ref}' already exists. Checking if it's orphaned (stale from a deleted worktree)...`
351
+ );
352
+ const worktrees = await listWorktrees(repoPath);
353
+ const branchInUse = worktrees.some((wt) => wt.ref === ref);
354
+ if (branchInUse) {
355
+ throw new Error(
356
+ `A branch named '${ref}' already exists and is in use by another worktree. Please choose a different name.`
357
+ );
358
+ }
359
+ console.log(`\u{1F9F9} Deleting orphaned branch '${ref}' and retrying worktree creation...`);
360
+ await git.raw(["branch", "-D", ref]);
361
+ await git.raw(["worktree", "add", ...args]);
362
+ console.log(`\u2705 Successfully created worktree after cleaning up stale branch '${ref}'`);
363
+ } else {
364
+ throw error;
365
+ }
366
+ }
342
367
  try {
343
368
  const worktreeGit = createGit(worktreePath, env);
344
369
  await worktreeGit.addConfig("safe.directory", worktreePath, true, "global");
@@ -491,10 +516,24 @@ async function deleteWorktreeDirectory(worktreePath) {
491
516
  }
492
517
  await rm(resolvedWorktreePath, { recursive: true, force: true });
493
518
  }
519
+ async function deleteBranch(repoPath, branchName) {
520
+ const git = createGit(repoPath);
521
+ try {
522
+ await git.raw(["branch", "-D", branchName]);
523
+ return true;
524
+ } catch (error) {
525
+ const msg = error instanceof Error ? error.message : String(error);
526
+ if (msg.includes("not found")) {
527
+ return false;
528
+ }
529
+ throw error;
530
+ }
531
+ }
494
532
  export {
495
533
  cleanWorktree,
496
534
  cloneRepo,
497
535
  createWorktree,
536
+ deleteBranch,
498
537
  deleteRepoDirectory,
499
538
  deleteWorktreeDirectory,
500
539
  extractRepoName,