commandmate 0.10.3 → 0.10.4

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 (383) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-build-manifest.json +135 -135
  3. package/.next/app-path-routes-manifest.json +28 -28
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +15 -15
  6. package/.next/required-server-files.json +1 -1
  7. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/.next/server/app/api/app/update/route.js +3 -3
  9. package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
  10. package/.next/server/app/api/app/update-check/route.js +1 -1
  11. package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
  12. package/.next/server/app/api/assistant/conversation/route.js +1 -1
  13. package/.next/server/app/api/assistant/conversation/route.js.nft.json +1 -1
  14. package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
  15. package/.next/server/app/api/assistant/current-output/route.js +1 -1
  16. package/.next/server/app/api/assistant/current-output/route.js.nft.json +1 -1
  17. package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
  18. package/.next/server/app/api/assistant/messages/route.js +1 -1
  19. package/.next/server/app/api/assistant/messages/route.js.nft.json +1 -1
  20. package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
  21. package/.next/server/app/api/assistant/session/route.js +1 -1
  22. package/.next/server/app/api/assistant/session/route.js.nft.json +1 -1
  23. package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
  24. package/.next/server/app/api/assistant/start/route.js +1 -1
  25. package/.next/server/app/api/assistant/start/route.js.nft.json +1 -1
  26. package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
  27. package/.next/server/app/api/assistant/terminal/route.js +3 -2
  28. package/.next/server/app/api/assistant/terminal/route.js.nft.json +1 -1
  29. package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
  30. package/.next/server/app/api/assistant/tools/route.js +1 -1
  31. package/.next/server/app/api/assistant/tools/route.js.nft.json +1 -1
  32. package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
  33. package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  34. package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  35. package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  36. package/.next/server/app/api/daily-summary/route.js +1 -1
  37. package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
  38. package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
  39. package/.next/server/app/api/daily-summary/status/route.js +1 -1
  40. package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
  41. package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
  42. package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
  43. package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
  44. package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
  45. package/.next/server/app/api/hooks/claude-done/route.js +1 -1
  46. package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
  47. package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
  48. package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
  49. package/.next/server/app/api/push/subscriptions/route.js +1 -1
  50. package/.next/server/app/api/push/subscriptions/route.js.nft.json +1 -1
  51. package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
  52. package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
  53. package/.next/server/app/api/repositories/[id]/route.js +1 -47
  54. package/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
  55. package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
  56. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js +1 -1
  57. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route.js.nft.json +1 -1
  58. package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  59. package/.next/server/app/api/repositories/[id]/todos/route.js +1 -1
  60. package/.next/server/app/api/repositories/[id]/todos/route.js.nft.json +1 -1
  61. package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
  62. package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
  63. package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
  64. package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
  65. package/.next/server/app/api/repositories/clone/route.js +1 -1
  66. package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
  67. package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
  68. package/.next/server/app/api/repositories/excluded/route.js +1 -47
  69. package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -1
  70. package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
  71. package/.next/server/app/api/repositories/restore/route.js +1 -1
  72. package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
  73. package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
  74. package/.next/server/app/api/repositories/route.js +1 -1
  75. package/.next/server/app/api/repositories/route.js.nft.json +1 -1
  76. package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/repositories/scan/route.js +1 -1
  78. package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
  79. package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
  80. package/.next/server/app/api/repositories/sync/route.js +1 -1
  81. package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
  82. package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
  83. package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
  84. package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
  85. package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
  86. package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
  87. package/.next/server/app/api/todos/route.js +1 -1
  88. package/.next/server/app/api/todos/route.js.nft.json +1 -1
  89. package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
  90. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
  91. package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
  92. package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
  93. package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
  94. package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
  95. package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
  96. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js +1 -1
  97. package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
  98. package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
  99. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +1 -1
  100. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
  101. package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
  102. package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
  103. package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
  104. package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
  105. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
  106. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
  107. package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
  108. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +2 -2
  109. package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
  110. package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
  111. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
  112. package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
  113. package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
  114. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js +1 -1
  115. package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
  116. package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
  117. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js +1 -1
  118. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
  119. package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
  120. package/.next/server/app/api/worktrees/[id]/git/branches/route.js +1 -1
  121. package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +1 -1
  122. package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
  123. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js +1 -1
  124. package/.next/server/app/api/worktrees/[id]/git/checkout/route.js.nft.json +1 -1
  125. package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
  126. package/.next/server/app/api/worktrees/[id]/git/commit/route.js +1 -1
  127. package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
  128. package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
  129. package/.next/server/app/api/worktrees/[id]/git/diff/route.js +1 -1
  130. package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
  131. package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
  132. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js +1 -1
  133. package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
  134. package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
  135. package/.next/server/app/api/worktrees/[id]/git/log/route.js +1 -1
  136. package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
  137. package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
  138. package/.next/server/app/api/worktrees/[id]/git/pull/route.js +1 -1
  139. package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
  140. package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
  141. package/.next/server/app/api/worktrees/[id]/git/push/route.js +1 -1
  142. package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +1 -1
  143. package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
  144. package/.next/server/app/api/worktrees/[id]/git/reset/route.js +1 -1
  145. package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +1 -1
  146. package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
  147. package/.next/server/app/api/worktrees/[id]/git/revert/route.js +1 -1
  148. package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
  149. package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
  150. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js +1 -1
  151. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
  152. package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
  153. package/.next/server/app/api/worktrees/[id]/git/stage/route.js +1 -1
  154. package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
  155. package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
  156. package/.next/server/app/api/worktrees/[id]/git/staged/route.js +1 -1
  157. package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
  158. package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
  159. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js +1 -1
  160. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
  161. package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
  162. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js +1 -1
  163. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
  164. package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
  165. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js +1 -1
  166. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
  167. package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
  168. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js +1 -1
  169. package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
  170. package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
  171. package/.next/server/app/api/worktrees/[id]/git/stash/route.js +1 -1
  172. package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
  173. package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
  174. package/.next/server/app/api/worktrees/[id]/git/status/route.js +1 -1
  175. package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
  176. package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
  177. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js +1 -1
  178. package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
  179. package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
  180. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js +1 -1
  181. package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +1 -1
  182. package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
  183. package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
  184. package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
  185. package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
  186. package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
  187. package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
  188. package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
  189. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js +1 -1
  190. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
  191. package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
  192. package/.next/server/app/api/worktrees/[id]/logs/route.js +1 -1
  193. package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
  194. package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
  195. package/.next/server/app/api/worktrees/[id]/marp-render/route.js +2 -2
  196. package/.next/server/app/api/worktrees/[id]/marp-render/route.js.nft.json +1 -1
  197. package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
  198. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js +1 -1
  199. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
  200. package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
  201. package/.next/server/app/api/worktrees/[id]/memos/route.js +1 -1
  202. package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
  203. package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
  204. package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
  205. package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
  206. package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
  207. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
  208. package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
  209. package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
  210. package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
  211. package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
  212. package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
  213. package/.next/server/app/api/worktrees/[id]/route.js +1 -1
  214. package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
  215. package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
  216. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +1 -1
  217. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
  218. package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
  219. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +1 -1
  220. package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
  221. package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
  222. package/.next/server/app/api/worktrees/[id]/schedules/route.js +2 -2
  223. package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
  224. package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
  225. package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
  226. package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
  227. package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
  228. package/.next/server/app/api/worktrees/[id]/send/route.js +1 -1
  229. package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
  230. package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
  231. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
  232. package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
  233. package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
  234. package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
  235. package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
  236. package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
  237. package/.next/server/app/api/worktrees/[id]/start-polling/route.js +1 -1
  238. package/.next/server/app/api/worktrees/[id]/start-polling/route.js.nft.json +1 -1
  239. package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
  240. package/.next/server/app/api/worktrees/[id]/terminal/route.js +1 -1
  241. package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
  242. package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
  243. package/.next/server/app/api/worktrees/[id]/timers/history/route.js +1 -1
  244. package/.next/server/app/api/worktrees/[id]/timers/history/route.js.nft.json +1 -1
  245. package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
  246. package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
  247. package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
  248. package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
  249. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js +1 -1
  250. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
  251. package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
  252. package/.next/server/app/api/worktrees/[id]/todos/route.js +1 -1
  253. package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
  254. package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
  255. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js +1 -1
  256. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
  257. package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
  258. package/.next/server/app/api/worktrees/[id]/tree/route.js +1 -1
  259. package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
  260. package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
  261. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js +1 -1
  262. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
  263. package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
  264. package/.next/server/app/api/worktrees/[id]/viewed/route.js +1 -1
  265. package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
  266. package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
  267. package/.next/server/app/api/worktrees/route.js +1 -1
  268. package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
  269. package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
  270. package/.next/server/app/chat/page.js +1 -1
  271. package/.next/server/app/chat/page.js.nft.json +1 -1
  272. package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
  273. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  274. package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
  275. package/.next/server/app/more/page.js +2 -2
  276. package/.next/server/app/more/page.js.nft.json +1 -1
  277. package/.next/server/app/more/page_client-reference-manifest.js +1 -1
  278. package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
  279. package/.next/server/app/page.js +1 -1
  280. package/.next/server/app/page.js.nft.json +1 -1
  281. package/.next/server/app/page_client-reference-manifest.js +1 -1
  282. package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
  283. package/.next/server/app/repositories/page.js +1 -1
  284. package/.next/server/app/repositories/page.js.nft.json +1 -1
  285. package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
  286. package/.next/server/app/review/page.js +1 -1
  287. package/.next/server/app/review/page.js.nft.json +1 -1
  288. package/.next/server/app/review/page_client-reference-manifest.js +1 -1
  289. package/.next/server/app/sessions/page.js +1 -1
  290. package/.next/server/app/sessions/page.js.nft.json +1 -1
  291. package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
  292. package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
  293. package/.next/server/app/worktrees/[id]/page.js +8 -8
  294. package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
  295. package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
  296. package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
  297. package/.next/server/app-paths-manifest.json +28 -28
  298. package/.next/server/chunks/1068.js +1 -1
  299. package/.next/server/chunks/1117.js +1 -0
  300. package/.next/server/chunks/233.js +1 -1
  301. package/.next/server/chunks/2404.js +1 -1
  302. package/.next/server/chunks/3270.js +1 -1
  303. package/.next/server/chunks/3480.js +2 -2
  304. package/.next/server/chunks/3543.js +1 -1
  305. package/.next/server/chunks/3945.js +1 -1
  306. package/.next/server/chunks/406.js +47 -0
  307. package/.next/server/chunks/4444.js +1 -1
  308. package/.next/server/chunks/5381.js +1 -47
  309. package/.next/server/chunks/5959.js +2 -2
  310. package/.next/server/chunks/646.js +33 -0
  311. package/.next/server/chunks/8681.js +1 -0
  312. package/.next/server/chunks/8807.js +305 -300
  313. package/.next/server/chunks/9355.js +1 -1
  314. package/.next/server/chunks/9687.js +1 -1
  315. package/.next/server/middleware-manifest.json +5 -5
  316. package/.next/server/pages/500.html +1 -1
  317. package/.next/server/pages-manifest.json +1 -1
  318. package/.next/server/server-reference-manifest.json +1 -1
  319. package/.next/static/chunks/4560-2bf9cb6504cc4425.js +1 -0
  320. package/.next/static/chunks/7347-a013a163a75030ec.js +1 -0
  321. package/.next/static/chunks/app/chat/page-5d20240f98c07cee.js +1 -0
  322. package/.next/static/chunks/app/layout-fe5857360dfba2b9.js +1 -0
  323. package/.next/static/chunks/app/more/page-af1d2af13ea901d2.js +1 -0
  324. package/.next/static/chunks/app/page-3bbe737ec910d1fb.js +1 -0
  325. package/.next/static/chunks/app/repositories/page-ace9134ac165a6de.js +1 -0
  326. package/.next/static/chunks/app/review/page-331b80f4f58582bc.js +1 -0
  327. package/.next/static/chunks/app/sessions/page-d694149a7e8649b6.js +1 -0
  328. package/.next/static/chunks/app/worktrees/[id]/page-932a52f8d11971f7.js +1 -0
  329. package/.next/static/css/d7e2e8d1b8d69d36.css +1 -0
  330. package/.next/trace +10 -10
  331. package/dist/cli/commands/quickstart.d.ts.map +1 -1
  332. package/dist/cli/commands/quickstart.js +27 -0
  333. package/dist/cli/commands/status.d.ts.map +1 -1
  334. package/dist/cli/commands/status.js +19 -0
  335. package/dist/cli/types/index.d.ts +6 -0
  336. package/dist/cli/types/index.d.ts.map +1 -1
  337. package/dist/cli/utils/agent-instances.d.ts +1 -1
  338. package/dist/cli/utils/agent-instances.d.ts.map +1 -1
  339. package/dist/cli/utils/agent-instances.js +8 -1
  340. package/dist/cli/utils/api-client.d.ts +36 -0
  341. package/dist/cli/utils/api-client.d.ts.map +1 -1
  342. package/dist/cli/utils/api-client.js +82 -0
  343. package/dist/cli/utils/daemon.d.ts.map +1 -1
  344. package/dist/cli/utils/daemon.js +44 -9
  345. package/dist/cli/utils/package-info.d.ts +17 -0
  346. package/dist/cli/utils/package-info.d.ts.map +1 -0
  347. package/dist/cli/utils/package-info.js +31 -0
  348. package/dist/cli/utils/pid-manager.d.ts +65 -9
  349. package/dist/cli/utils/pid-manager.d.ts.map +1 -1
  350. package/dist/cli/utils/pid-manager.js +81 -21
  351. package/dist/cli/utils/process-inspector.d.ts +27 -0
  352. package/dist/cli/utils/process-inspector.d.ts.map +1 -0
  353. package/dist/cli/utils/process-inspector.js +37 -0
  354. package/dist/server/src/config/github-links.js +22 -0
  355. package/dist/server/src/lib/db/db-instance.js +22 -3
  356. package/dist/server/src/lib/db/db-repository.js +107 -19
  357. package/dist/server/src/lib/db/db.js +3 -2
  358. package/dist/server/src/lib/db/memo-db.js +32 -1
  359. package/dist/server/src/lib/db/migrations/index.js +2 -0
  360. package/dist/server/src/lib/db/migrations/runner.js +11 -1
  361. package/dist/server/src/lib/db/migrations/v43-remove-cm-root-dir-ghost-repository.js +126 -0
  362. package/dist/server/src/lib/git/worktrees.js +90 -0
  363. package/dist/server/src/lib/job-executor.js +8 -2
  364. package/dist/server/src/lib/realtime/types.js +76 -0
  365. package/dist/server/src/lib/schedule-manager.js +9 -1
  366. package/dist/server/src/lib/version-checker.js +297 -0
  367. package/dist/server/src/lib/ws-server.js +37 -0
  368. package/package.json +1 -1
  369. package/.next/server/chunks/2464.js +0 -33
  370. package/.next/server/chunks/6791.js +0 -47
  371. package/.next/static/chunks/7347-4a031aecf4664a6d.js +0 -1
  372. package/.next/static/chunks/8954-ce15ee4d0423f1b1.js +0 -1
  373. package/.next/static/chunks/app/chat/page-dee86bdf87516e40.js +0 -1
  374. package/.next/static/chunks/app/layout-d02f4691a4eff86b.js +0 -1
  375. package/.next/static/chunks/app/more/page-39ec8b5f27cf52e7.js +0 -1
  376. package/.next/static/chunks/app/page-ebf1db9826b4065d.js +0 -1
  377. package/.next/static/chunks/app/repositories/page-2be54cae5fcc1f7a.js +0 -1
  378. package/.next/static/chunks/app/review/page-ac4efe6857a0f3bf.js +0 -1
  379. package/.next/static/chunks/app/sessions/page-dc545a3d45374187.js +0 -1
  380. package/.next/static/chunks/app/worktrees/[id]/page-9eb2f37809919531.js +0 -1
  381. package/.next/static/css/eabd34bf2ab147a4.css +0 -1
  382. /package/.next/static/{Ndx_NzkoP54cD0UCmjUlu → uBCIYS1Hth7V4unroKqGu}/_buildManifest.js +0 -0
  383. /package/.next/static/{Ndx_NzkoP54cD0UCmjUlu → uBCIYS1Hth7V4unroKqGu}/_ssgManifest.js +0 -0
@@ -1,299 +1,4 @@
1
- "use strict";exports.id=8807,exports.ids=[8807],exports.modules={25537:(a,b,c)=>{function d(a){a.exec(`
2
- CREATE TABLE IF NOT EXISTS worktrees (
3
- id TEXT PRIMARY KEY,
4
- name TEXT NOT NULL,
5
- path TEXT NOT NULL UNIQUE,
6
- last_message_summary TEXT,
7
- updated_at INTEGER
8
- );
9
- `),a.exec(`
10
- CREATE INDEX IF NOT EXISTS idx_worktrees_updated_at
11
- ON worktrees(updated_at DESC);
12
- `),a.exec(`
13
- CREATE TABLE IF NOT EXISTS chat_messages (
14
- id TEXT PRIMARY KEY,
15
- worktree_id TEXT NOT NULL,
16
- role TEXT NOT NULL CHECK(role IN ('user', 'assistant')),
17
- content TEXT NOT NULL,
18
- summary TEXT,
19
- timestamp INTEGER NOT NULL,
20
- log_file_name TEXT,
21
- request_id TEXT,
22
- message_type TEXT DEFAULT 'normal',
23
- prompt_data TEXT,
24
- cli_tool_id TEXT DEFAULT 'claude',
25
- archived INTEGER DEFAULT 0,
26
-
27
- FOREIGN KEY (worktree_id) REFERENCES worktrees(id) ON DELETE CASCADE
28
- );
29
- `),a.exec(`
30
- CREATE INDEX IF NOT EXISTS idx_messages_worktree_time
31
- ON chat_messages(worktree_id, timestamp DESC);
32
- `),a.exec(`
33
- CREATE INDEX IF NOT EXISTS idx_messages_request_id
34
- ON chat_messages(request_id);
35
- `),a.exec(`
36
- CREATE INDEX IF NOT EXISTS idx_messages_type
37
- ON chat_messages(message_type, worktree_id);
38
- `),a.exec(`
39
- CREATE INDEX IF NOT EXISTS idx_messages_cli_tool
40
- ON chat_messages(worktree_id, cli_tool_id, timestamp DESC);
41
- `),a.exec(`
42
- CREATE INDEX IF NOT EXISTS idx_messages_worktree_role_archived_time
43
- ON chat_messages(worktree_id, role, archived, timestamp DESC);
44
- `),a.exec(`
45
- CREATE TABLE IF NOT EXISTS session_states (
46
- worktree_id TEXT NOT NULL,
47
- cli_tool_id TEXT NOT NULL DEFAULT 'claude',
48
- last_captured_line INTEGER DEFAULT 0,
49
-
50
- PRIMARY KEY (worktree_id, cli_tool_id),
51
- FOREIGN KEY (worktree_id) REFERENCES worktrees(id) ON DELETE CASCADE
52
- );
53
- `)}c.d(b,{AC:()=>k.AC,ug:()=>k.ug,KG:()=>B,cD:()=>W,Jj:()=>X,YX:()=>i,G4:()=>R,hL:()=>Z,qp:()=>T,To:()=>p,oH:()=>f.oH,py:()=>y,yy:()=>G,pE:()=>f.pE,z2:()=>ad,cP:()=>r,DF:()=>f.DF,lA:()=>f.lA,Qp:()=>f.Qp,th:()=>ae.th,oZ:()=>e.oZ,ZP:()=>j,Ys:()=>A,vg:()=>I,Rm:()=>e.Rm,BN:()=>k.BN,m0:()=>k.m0,Tk:()=>w,iT:()=>P,gp:()=>Q,yE:()=>Y,BE:()=>V,qK:()=>ab,p4:()=>e.p4,r8:()=>f.r8,of:()=>_,DN:()=>o,pZ:()=>n,kA:()=>f.kA,VL:()=>f.VL,CF:()=>ae.CF,NV:()=>e.NV,ce:()=>aa,y1:()=>g,Nr:()=>x,ob:()=>v,fr:()=>E,Ui:()=>e.Ui,P9:()=>e.P9,eN:()=>F,vi:()=>e.vi,uJ:()=>e.uJ,s4:()=>d,yT:()=>C,PL:()=>f.PL,jp:()=>f.jp,nQ:()=>s,yb:()=>J,GA:()=>e.GA,Cs:()=>k.Cs,xR:()=>S,az:()=>$,nZ:()=>U,PP:()=>ac,Dx:()=>e.Dx,O:()=>e.O,EU:()=>f.EU,HZ:()=>e.HZ,UY:()=>q,cw:()=>f.cw,jJ:()=>ae.jJ,DC:()=>e.DC,gb:()=>h,yB:()=>e.yB,uy:()=>z,s:()=>e.s,iu:()=>e.iu,hq:()=>e.hq,z1:()=>e.z1,bl:()=>H,jA:()=>ae.jA,ZL:()=>e.ZL});var e=c(73753),f=c(52660);function g(a,b,c="claude"){let d=a.prepare(`
54
- SELECT worktree_id, cli_tool_id, instance_id, last_captured_line, in_progress_message_id
55
- FROM session_states
56
- WHERE worktree_id = ? AND instance_id = ?
57
- `).get(b,c);return d?{worktreeId:d.worktree_id,cliToolId:d.cli_tool_id,instanceId:d.instance_id,lastCapturedLine:d.last_captured_line,inProgressMessageId:d.in_progress_message_id||null}:null}function h(a,b,c,d,e){let f=e??c;a.prepare(`
58
- INSERT INTO session_states (worktree_id, cli_tool_id, instance_id, last_captured_line)
59
- VALUES (?, ?, ?, ?)
60
- ON CONFLICT(worktree_id, instance_id) DO UPDATE SET
61
- last_captured_line = excluded.last_captured_line,
62
- cli_tool_id = excluded.cli_tool_id
63
- `).run(b,c,f,d)}function i(a,b,c,d){let e=d??c;a.prepare(`
64
- INSERT INTO session_states (worktree_id, cli_tool_id, instance_id, last_captured_line, in_progress_message_id)
65
- VALUES (?, ?, ?, 0, ?)
66
- ON CONFLICT(worktree_id, instance_id) DO UPDATE SET
67
- in_progress_message_id = excluded.in_progress_message_id,
68
- cli_tool_id = excluded.cli_tool_id
69
- `).run(b,c,e,null)}function j(a,b,c,d){d?a.prepare(`
70
- DELETE FROM session_states
71
- WHERE worktree_id = ? AND instance_id = ?
72
- `).run(b,d):c?a.prepare(`
73
- DELETE FROM session_states
74
- WHERE worktree_id = ? AND cli_tool_id = ?
75
- `).run(b,c):a.prepare(`
76
- DELETE FROM session_states
77
- WHERE worktree_id = ?
78
- `).run(b)}var k=c(28274),l=c(55511);function m(a){return{id:a.id,worktreeId:a.worktree_id,title:a.title,content:a.content,position:a.position,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}function n(a,b){return a.prepare(`
79
- SELECT id, worktree_id, title, content, position, created_at, updated_at
80
- FROM worktree_memos
81
- WHERE worktree_id = ?
82
- ORDER BY position ASC
83
- `).all(b).map(m)}function o(a,b){let c=a.prepare(`
84
- SELECT id, worktree_id, title, content, position, created_at, updated_at
85
- FROM worktree_memos
86
- WHERE id = ?
87
- `).get(b);return c?m(c):null}function p(a,b,c){let d=(0,l.randomUUID)(),e=Date.now(),f=c.title??"Memo",g=c.content??"";return a.prepare(`
88
- INSERT INTO worktree_memos (id, worktree_id, title, content, position, created_at, updated_at)
89
- VALUES (?, ?, ?, ?, ?, ?, ?)
90
- `).run(d,b,f,g,c.position,e,e),{id:d,worktreeId:b,title:f,content:g,position:c.position,createdAt:new Date(e),updatedAt:new Date(e)}}function q(a,b,c){let d=Date.now(),e=["updated_at = ?"],f=[d];void 0!==c.title&&(e.push("title = ?"),f.push(c.title)),void 0!==c.content&&(e.push("content = ?"),f.push(c.content)),f.push(b),a.prepare(`
91
- UPDATE worktree_memos
92
- SET ${e.join(", ")}
93
- WHERE id = ?
94
- `).run(...f)}function r(a,b){a.prepare(`
95
- DELETE FROM worktree_memos
96
- WHERE id = ?
97
- `).run(b)}function s(a,b,c){if(0===c.length)return;let d=Date.now();a.transaction(()=>{let b=a.prepare(`
98
- UPDATE worktree_memos
99
- SET position = -1 - position
100
- WHERE id = ?
101
- `);for(let a of c)b.run(a);let e=a.prepare(`
102
- UPDATE worktree_memos
103
- SET position = ?, updated_at = ?
104
- WHERE id = ?
105
- `);c.forEach((a,b)=>{e.run(b,d,a)})})()}let t=`
106
- SELECT
107
- t.id,
108
- t.repository_id,
109
- r.name AS repository_name,
110
- r.display_name AS repository_display_name,
111
- t.content,
112
- t.done,
113
- t.position,
114
- t.created_at,
115
- t.updated_at
116
- FROM repository_todos t
117
- JOIN repositories r ON r.id = t.repository_id
118
- `;function u(a){return{id:a.id,repositoryId:a.repository_id,repositoryName:a.repository_name,repositoryDisplayName:a.repository_display_name||void 0,content:a.content,done:1===a.done,position:a.position,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}function v(a,b){return a.prepare(`
119
- ${t}
120
- WHERE t.repository_id = ?
121
- ORDER BY t.position ASC, t.created_at ASC
122
- `).all(b).map(u)}function w(a){return a.prepare(`
123
- ${t}
124
- ORDER BY
125
- COALESCE(NULLIF(TRIM(r.display_name), ''), r.name) COLLATE NOCASE ASC,
126
- t.position ASC,
127
- t.created_at ASC,
128
- t.id ASC
129
- `).all().map(u)}function x(a,b){let c=a.prepare(`
130
- ${t}
131
- WHERE t.id = ?
132
- `).get(b);return c?u(c):null}function y(a,b,c){let d=(0,l.randomUUID)(),e=Date.now();a.prepare(`
133
- INSERT INTO repository_todos (id, repository_id, content, done, position, created_at, updated_at)
134
- VALUES (?, ?, ?, 0, ?, ?, ?)
135
- `).run(d,b,c.content,c.position,e,e);let f=x(a,d);if(!f)throw Error(`Failed to load created todo '${d}'`);return f}function z(a,b,c){let d=Date.now(),e=["updated_at = ?"],f=[d];void 0!==c.content&&(e.push("content = ?"),f.push(c.content)),void 0!==c.done&&(e.push("done = ?"),f.push(+!!c.done)),f.push(b),a.prepare(`
136
- UPDATE repository_todos
137
- SET ${e.join(", ")}
138
- WHERE id = ?
139
- `).run(...f)}function A(a,b){a.prepare(`
140
- DELETE FROM repository_todos
141
- WHERE id = ?
142
- `).run(b)}let B=["todo","doing","done"];function C(a){return"todo"===a||"doing"===a||"done"===a}function D(a){var b,c;let d=(b=a.status,c=a.done,C(b)?b:1===c?"done":"todo");return{id:a.id,worktreeId:a.worktree_id,content:a.content,detail:a.detail??"",status:d,done:"done"===d,position:a.position,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}function E(a,b){return a.prepare(`
143
- SELECT id, worktree_id, content, detail, done, status, position, created_at, updated_at
144
- FROM worktree_todos
145
- WHERE worktree_id = ?
146
- ORDER BY position ASC, created_at ASC
147
- `).all(b).map(D)}function F(a,b){let c=a.prepare(`
148
- SELECT id, worktree_id, content, detail, done, status, position, created_at, updated_at
149
- FROM worktree_todos
150
- WHERE id = ?
151
- `).get(b);return c?D(c):null}function G(a,b,c){let d=(0,l.randomUUID)(),e=Date.now(),f=c.status??"todo",g=c.detail??"";return a.prepare(`
152
- INSERT INTO worktree_todos (id, worktree_id, content, detail, done, status, position, created_at, updated_at)
153
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
154
- `).run(d,b,c.content,g,+("done"===f),f,c.position,e,e),{id:d,worktreeId:b,content:c.content,detail:g,status:f,done:"done"===f,position:c.position,createdAt:new Date(e),updatedAt:new Date(e)}}function H(a,b,c){let d,e=Date.now(),f=["updated_at = ?"],g=[e];void 0!==c.content&&(f.push("content = ?"),g.push(c.content)),void 0!==c.detail&&(f.push("detail = ?"),g.push(c.detail)),void 0!==c.status?d=c.status:void 0!==c.done&&(d=c.done?"done":"todo"),void 0!==d&&(f.push("status = ?"),g.push(d),f.push("done = ?"),g.push(+("done"===d))),g.push(b),a.prepare(`
155
- UPDATE worktree_todos
156
- SET ${f.join(", ")}
157
- WHERE id = ?
158
- `).run(...g)}function I(a,b){a.prepare(`
159
- DELETE FROM worktree_todos
160
- WHERE id = ?
161
- `).run(b)}function J(a,b,c){if(0===c.length)return;let d=Date.now();a.transaction(()=>{let e=a.prepare(`
162
- UPDATE worktree_todos
163
- SET position = -1 - position
164
- WHERE id = ? AND worktree_id = ?
165
- `);for(let a of c)e.run(a,b);let f=a.prepare(`
166
- UPDATE worktree_todos
167
- SET position = ?, updated_at = ?
168
- WHERE id = ? AND worktree_id = ?
169
- `);c.forEach((a,c)=>{f.run(c,d,a,b)})})()}function K(a,b){return Buffer.byteLength(a,"utf-8")<=b?a:Buffer.from(a,"utf-8").subarray(0,b).toString("utf-8")}function L(a){return{id:a.id,repositoryId:a.repository_id,cliToolId:a.cli_tool_id,workingDirectory:a.working_directory,executionMode:a.execution_mode??"interactive",resumeSessionId:a.resume_session_id??void 0,lastExecutionId:a.last_execution_id??void 0,sessionName:a.session_name??void 0,status:"idle"===a.status?"stopped":a.status,lastStartedAt:a.last_started_at?new Date(a.last_started_at):void 0,lastStoppedAt:a.last_stopped_at?new Date(a.last_stopped_at):void 0,contextSentAt:a.context_sent_at?new Date(a.context_sent_at):void 0,contextSnapshot:a.context_snapshot??void 0,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at),archived:1===a.archived}}function M(a){return{id:a.id,conversationId:a.conversation_id,role:a.role,content:a.content,summary:a.summary??void 0,timestamp:new Date(a.timestamp),messageType:a.message_type,deliveryStatus:a.delivery_status??void 0,archived:1===a.archived}}function N(a){return{id:a.id,conversationId:a.conversation_id,cliToolId:a.cli_tool_id,status:a.status,pid:a.pid??void 0,commandLine:a.command_line,promptText:a.prompt_text,stdoutText:a.stdout_text??void 0,stderrText:a.stderr_text??void 0,finalMessageText:a.final_message_text??void 0,exitCode:a.exit_code,resumeSessionIdBefore:a.resume_session_id_before??void 0,resumeSessionIdAfter:a.resume_session_id_after??void 0,startedAt:a.started_at?new Date(a.started_at):void 0,finishedAt:a.finished_at?new Date(a.finished_at):void 0,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}function O(a,b,c){a.prepare(`
170
- UPDATE assistant_conversations
171
- SET updated_at = ?
172
- WHERE id = ?
173
- `).run(c.getTime(),b)}function P(a,b,c={}){let d=`
174
- SELECT *
175
- FROM assistant_conversations
176
- WHERE id = ?
177
- ${c.includeArchived?"":"AND archived = 0"}
178
- LIMIT 1
179
- `,e=a.prepare(d).get(b);return e?L(e):null}function Q(a,b,c,d={}){let e=`
180
- SELECT *
181
- FROM assistant_conversations
182
- WHERE repository_id = ?
183
- AND cli_tool_id = ?
184
- ${d.includeArchived?"":"AND archived = 0"}
185
- LIMIT 1
186
- `,f=a.prepare(e).get(b,c);return f?L(f):null}function R(a,b){let c=(0,l.randomUUID)(),d=Date.now();return a.prepare(`
187
- INSERT INTO assistant_conversations (
188
- id, repository_id, cli_tool_id, working_directory, execution_mode, resume_session_id,
189
- last_execution_id, session_name, status,
190
- last_started_at, last_stopped_at, context_sent_at, created_at, updated_at, archived
191
- )
192
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0)
193
- `).run(c,b.repositoryId,b.cliToolId,b.workingDirectory,b.executionMode??"interactive",b.resumeSessionId??null,b.lastExecutionId??null,b.sessionName??null,b.status??"stopped",b.lastStartedAt?.getTime()??null,b.lastStoppedAt?.getTime()??null,b.contextSentAt?.getTime()??null,d,d),{id:c,repositoryId:b.repositoryId,cliToolId:b.cliToolId,workingDirectory:b.workingDirectory,executionMode:b.executionMode??"interactive",resumeSessionId:b.resumeSessionId,lastExecutionId:b.lastExecutionId,sessionName:b.sessionName,status:b.status??"stopped",contextSentAt:b.contextSentAt,lastStartedAt:b.lastStartedAt,lastStoppedAt:b.lastStoppedAt,createdAt:new Date(d),updatedAt:new Date(d),archived:!1}}function S(a,b,c){let d=[],e=[];void 0!==c.workingDirectory&&(d.push("working_directory = ?"),e.push(c.workingDirectory)),void 0!==c.executionMode&&(d.push("execution_mode = ?"),e.push(c.executionMode)),void 0!==c.resumeSessionId&&(d.push("resume_session_id = ?"),e.push(c.resumeSessionId)),void 0!==c.lastExecutionId&&(d.push("last_execution_id = ?"),e.push(c.lastExecutionId)),void 0!==c.sessionName&&(d.push("session_name = ?"),e.push(c.sessionName)),void 0!==c.status&&(d.push("status = ?"),e.push(c.status)),void 0!==c.lastStartedAt&&(d.push("last_started_at = ?"),e.push(c.lastStartedAt?.getTime()??null)),void 0!==c.lastStoppedAt&&(d.push("last_stopped_at = ?"),e.push(c.lastStoppedAt?.getTime()??null)),void 0!==c.contextSentAt&&(d.push("context_sent_at = ?"),e.push(c.contextSentAt?.getTime()??null)),void 0!==c.contextSnapshot&&(d.push("context_snapshot = ?"),e.push(c.contextSnapshot??null)),void 0!==c.archived&&(d.push("archived = ?"),e.push(+!!c.archived));let f=c.updatedAt??new Date;return d.push("updated_at = ?"),e.push(f.getTime()),e.push(b),a.prepare(`
194
- UPDATE assistant_conversations
195
- SET ${d.join(", ")}
196
- WHERE id = ?
197
- `).run(...e),P(a,b,{includeArchived:!0})}function T(a,b){let c=(0,l.randomUUID)();return a.prepare(`
198
- INSERT INTO assistant_messages (
199
- id, conversation_id, role, content, summary, timestamp, message_type, delivery_status, archived
200
- )
201
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, 0)
202
- `).run(c,b.conversationId,b.role,b.content,b.summary??null,b.timestamp.getTime(),b.messageType,b.deliveryStatus??null),O(a,b.conversationId,b.timestamp),{id:c,...b,archived:!1}}function U(a,b,c){a.prepare(`
203
- UPDATE assistant_messages
204
- SET delivery_status = ?
205
- WHERE id = ?
206
- `).run(c,b)}function V(a,b,c={}){let{limit:d=200,before:e,includeArchived:f=!1}=c,g=[b,e?.getTime()??null,e?.getTime()??null],h=`
207
- SELECT *
208
- FROM assistant_messages
209
- WHERE conversation_id = ?
210
- AND (? IS NULL OR timestamp < ?)
211
- `;return f||(h+=" AND archived = 0"),h+=" ORDER BY timestamp DESC LIMIT ?",g.push(d),a.prepare(h).all(...g).map(M)}function W(a,b){return a.prepare(`
212
- UPDATE assistant_messages
213
- SET archived = 1
214
- WHERE conversation_id = ?
215
- AND archived = 0
216
- `).run(b).changes}function X(a,b,c){return a.prepare(`
217
- UPDATE assistant_messages
218
- SET archived = 1
219
- WHERE conversation_id = ?
220
- AND archived = 0
221
- AND timestamp >= ?
222
- `).run(b,c).changes}function Y(a,b){let c=a.prepare(`
223
- SELECT * FROM assistant_messages WHERE id = ?
224
- `).get(b);return c?M(c):null}function Z(a,b){let c=(0,l.randomUUID)(),d=Date.now();return a.prepare(`
225
- INSERT INTO assistant_executions (
226
- id, conversation_id, cli_tool_id, status, pid, command_line, prompt_text,
227
- stdout_text, stderr_text, final_message_text, exit_code, resume_session_id_before,
228
- resume_session_id_after, started_at, finished_at, created_at, updated_at
229
- )
230
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
231
- `).run(c,b.conversationId,b.cliToolId,b.status??"queued",b.pid??null,b.commandLine,K(b.promptText,65536),K(b.stdoutText??"",262144)||null,K(b.stderrText??"",262144)||null,b.finalMessageText?K(b.finalMessageText,65536):null,b.exitCode??null,b.resumeSessionIdBefore??null,b.resumeSessionIdAfter??null,b.startedAt?.getTime()??null,b.finishedAt?.getTime()??null,d,d),O(a,b.conversationId,new Date(d)),{id:c,conversationId:b.conversationId,cliToolId:b.cliToolId,status:b.status??"queued",pid:b.pid,commandLine:b.commandLine,promptText:K(b.promptText,65536),stdoutText:b.stdoutText?K(b.stdoutText,262144):void 0,stderrText:b.stderrText?K(b.stderrText,262144):void 0,finalMessageText:b.finalMessageText?K(b.finalMessageText,65536):void 0,exitCode:b.exitCode,resumeSessionIdBefore:b.resumeSessionIdBefore,resumeSessionIdAfter:b.resumeSessionIdAfter,startedAt:b.startedAt,finishedAt:b.finishedAt,createdAt:new Date(d),updatedAt:new Date(d)}}function $(a,b,c){let d=[],e=[];void 0!==c.status&&(d.push("status = ?"),e.push(c.status)),void 0!==c.pid&&(d.push("pid = ?"),e.push(c.pid)),void 0!==c.stdoutText&&(d.push("stdout_text = ?"),e.push(c.stdoutText?K(c.stdoutText,262144):null)),void 0!==c.stderrText&&(d.push("stderr_text = ?"),e.push(c.stderrText?K(c.stderrText,262144):null)),void 0!==c.finalMessageText&&(d.push("final_message_text = ?"),e.push(c.finalMessageText?K(c.finalMessageText,65536):null)),void 0!==c.exitCode&&(d.push("exit_code = ?"),e.push(c.exitCode)),void 0!==c.resumeSessionIdAfter&&(d.push("resume_session_id_after = ?"),e.push(c.resumeSessionIdAfter)),void 0!==c.startedAt&&(d.push("started_at = ?"),e.push(c.startedAt?.getTime()??null)),void 0!==c.finishedAt&&(d.push("finished_at = ?"),e.push(c.finishedAt?.getTime()??null));let f=c.updatedAt??new Date;return d.push("updated_at = ?"),e.push(f.getTime(),b),a.prepare(`
232
- UPDATE assistant_executions
233
- SET ${d.join(", ")}
234
- WHERE id = ?
235
- `).run(...e),function(a,b){let c=a.prepare(`
236
- SELECT *
237
- FROM assistant_executions
238
- WHERE id = ?
239
- LIMIT 1
240
- `).get(b);return c?N(c):null}(a,b)}function _(a,b){let c=a.prepare(`
241
- SELECT *
242
- FROM assistant_executions
243
- WHERE conversation_id = ?
244
- ORDER BY created_at DESC
245
- LIMIT 1
246
- `).get(b);return c?N(c):null}function aa(a,b){let c=a.prepare(`
247
- SELECT *
248
- FROM assistant_executions
249
- WHERE conversation_id = ?
250
- AND status = 'running'
251
- ORDER BY created_at DESC
252
- LIMIT 1
253
- `).get(b);return c?N(c):null}function ab(a,b){let c=a.prepare(`
254
- SELECT conversation_id, last_captured_line, in_progress_message_id
255
- FROM assistant_session_states
256
- WHERE conversation_id = ?
257
- `).get(b);return c?{conversationId:c.conversation_id,lastCapturedLine:c.last_captured_line,inProgressMessageId:c.in_progress_message_id}:null}function ac(a,b,c,d){a.prepare(`
258
- INSERT INTO assistant_session_states (conversation_id, last_captured_line, in_progress_message_id)
259
- VALUES (?, ?, ?)
260
- ON CONFLICT(conversation_id) DO UPDATE SET
261
- last_captured_line = excluded.last_captured_line,
262
- in_progress_message_id = excluded.in_progress_message_id
263
- `).run(b,c,d??null)}function ad(a,b){a.prepare(`
264
- DELETE FROM assistant_session_states
265
- WHERE conversation_id = ?
266
- `).run(b)}c(34129);var ae=c(43167)},28274:(a,b,c)=>{c.d(b,{AC:()=>e,BN:()=>i,Cs:()=>j,m0:()=>h,ug:()=>f});var d=c(15194);class e extends Error{constructor(a,b=d.Ab){super(`Worktree ${a} cannot have more than ${b} agent instances`),this.name="AgentInstanceLimitError"}}class f extends Error{constructor(a){super(a),this.name="InvalidAgentInstanceError"}}function g(a){let b=a.cli_tool_id,c=a.alias&&a.alias.length>0?a.alias:(0,d.hR)(a.cli_tool_id)?(0,d.oo)(b):a.cli_tool_id;return{id:a.instance_id,cliTool:b,alias:c,order:a.sort_order}}function h(a,b){return a.prepare(`
267
- SELECT worktree_id, instance_id, cli_tool_id, alias, sort_order, created_at
268
- FROM agent_instances
269
- WHERE worktree_id = ?
270
- ORDER BY sort_order ASC, instance_id ASC
271
- `).all(b).map(g)}function i(a,b,c){let d=a.prepare(`
272
- SELECT worktree_id, instance_id, cli_tool_id, alias, sort_order, created_at
273
- FROM agent_instances
274
- WHERE worktree_id = ? AND instance_id = ?
275
- `).get(b,c);return d?g(d):null}function j(a,b,c){if(c.length>d.Ab)throw new e(b);let g=new Set;for(let a of c){if(!(0,d.n6)(a.id))throw new f(`Invalid instance id: ${String(a.id)}`);if(!(0,d.hR)(a.cliTool))throw new f(`Invalid CLI tool: ${String(a.cliTool)}`);if("string"==typeof a.alias&&a.alias.length>d.pQ)throw new f(`Alias exceeds ${d.pQ} characters`);if(g.has(a.id))throw new f(`Duplicate instance id: ${a.id}`);g.add(a.id)}let h=Date.now();a.transaction(()=>{a.prepare("DELETE FROM agent_instances WHERE worktree_id = ?").run(b);let d=a.prepare(`
276
- INSERT INTO agent_instances
277
- (worktree_id, instance_id, cli_tool_id, alias, sort_order, created_at)
278
- VALUES (?, ?, ?, ?, ?, ?)
279
- `);c.forEach((a,c)=>{let e=a.alias??"",f=Number.isInteger(a.order)?a.order:c;d.run(b,a.id,a.cliTool,e,f,h)})})()}},34129:(a,b,c)=>{c.d(b,{$$:()=>m,CR:()=>h,DP:()=>i,GF:()=>n,Ud:()=>l,j2:()=>k,jf:()=>o,kx:()=>j});var d=c(55511),e=c(87374);let f="id, worktree_id, cli_tool_id, instance_id, message, delay_ms, scheduled_send_time, status, created_at, sent_at, error";function g(a){return{id:a.id,worktreeId:a.worktree_id,cliToolId:a.cli_tool_id,instanceId:a.instance_id??a.cli_tool_id,message:a.message,delayMs:a.delay_ms,scheduledSendTime:a.scheduled_send_time,status:a.status,createdAt:a.created_at,sentAt:a.sent_at,error:a.error??null}}function h(a,b){let c=(0,d.randomUUID)(),e=Date.now(),f=e+b.delayMs,g=b.instanceId??b.cliToolId;return a.prepare(`
280
- INSERT INTO timer_messages (id, worktree_id, cli_tool_id, instance_id, message, delay_ms, scheduled_send_time, status, created_at, sent_at)
281
- VALUES (?, ?, ?, ?, ?, ?, ?, 'pending', ?, NULL)
282
- `).run(c,b.worktreeId,b.cliToolId,g,b.message,b.delayMs,f,e),{id:c,worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:g,message:b.message,delayMs:b.delayMs,scheduledSendTime:f,status:"pending",createdAt:e,sentAt:null,error:null}}function i(a,b,c){let{before:d,limit:h=e.XS}=c??{},i=`SELECT ${f} FROM timer_messages WHERE worktree_id = ?`,j=[b];return void 0!==d&&(i+=" AND created_at < ?",j.push(d)),i+=" ORDER BY created_at DESC LIMIT ?",j.push(h+1),a.prepare(i).all(...j).map(g)}function j(a,b){let c=a.prepare(`
283
- SELECT ${f}
284
- FROM timer_messages
285
- WHERE id = ?
286
- `).get(b);return c?g(c):void 0}function k(a,b,c,d,e){let f=["status = ?"],g=[c];void 0!==d&&(f.push("sent_at = ?"),g.push(d)),void 0!==e&&(f.push("error = ?"),g.push(e)),g.push(b),a.prepare(`UPDATE timer_messages SET ${f.join(", ")} WHERE id = ?`).run(...g)}function l(a,b){return a.prepare(`
287
- UPDATE timer_messages SET status = 'cancelled' WHERE id = ? AND status = 'pending'
288
- `).run(b).changes>0}function m(a,b){return a.prepare(`
289
- UPDATE timer_messages SET status = 'cancelled' WHERE worktree_id = ? AND status = 'pending'
290
- `).run(b).changes}function n(a,b){return a.prepare(`
291
- SELECT COUNT(*) as count FROM timer_messages WHERE worktree_id = ? AND status = 'pending'
292
- `).get(b).count}function o(a,b){return a.prepare(`
293
- DELETE FROM timer_messages
294
- WHERE worktree_id = ?
295
- AND status NOT IN ('pending', 'sending')
296
- `).run(b).changes}},36395:(a,b,c)=>{c.d(b,{vI:()=>j});var d=c(33873),e=c.n(d);function f(a){try{let b=a.prepare("SELECT MAX(version) as version FROM schema_version").get();return b?.version??0}catch{return 0}}function g(a){let b=c(29021),d=a;for(;d!==e().dirname(d);){let a=e().join(d,".git");if(b.existsSync(a)){let c=b.statSync(a);if(c.isDirectory())return d;if(c.isFile()){let c=b.readFileSync(a,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(c)return c[1].split("/.git/")[0]}}d=e().dirname(d)}return a}var h=c(25537);let i=[{version:1,name:"initial-schema",up:a=>{(0,h.s4)(a)},down:a=>{a.exec("DROP TABLE IF EXISTS session_states;"),a.exec("DROP TABLE IF EXISTS chat_messages;"),a.exec("DROP TABLE IF EXISTS worktrees;")}},{version:2,name:"add-multi-repo-and-memo-support",up:a=>{a.exec(`
1
+ "use strict";exports.id=8807,exports.ids=[8807],exports.modules={19006:(a,b,c)=>{c.d(b,{vI:()=>j});var d=c(33873),e=c.n(d);function f(a){try{let b=a.prepare("SELECT MAX(version) as version FROM schema_version").get();return b?.version??0}catch{return 0}}function g(a){let b=c(29021),d=a;for(;d!==e().dirname(d);){let a=e().join(d,".git");if(b.existsSync(a)){let c=b.statSync(a);if(c.isDirectory())return d;if(c.isFile()){let c=b.readFileSync(a,"utf-8").trim().match(/^gitdir:\s*(.+)$/);if(c)return c[1].split("/.git/")[0]}}d=e().dirname(d)}return a}var h=c(25537);let i=[{version:1,name:"initial-schema",up:a=>{(0,h.s4)(a)},down:a=>{a.exec("DROP TABLE IF EXISTS session_states;"),a.exec("DROP TABLE IF EXISTS chat_messages;"),a.exec("DROP TABLE IF EXISTS worktrees;")}},{version:2,name:"add-multi-repo-and-memo-support",up:a=>{a.exec(`
297
2
  ALTER TABLE worktrees ADD COLUMN repository_path TEXT;
298
3
  ALTER TABLE worktrees ADD COLUMN repository_name TEXT;
299
4
  ALTER TABLE worktrees ADD COLUMN memo TEXT;
@@ -1035,16 +740,316 @@
1035
740
  ALTER TABLE push_subscriptions ADD COLUMN locale TEXT;
1036
741
  `)},down:a=>{a.exec(`
1037
742
  ALTER TABLE push_subscriptions DROP COLUMN locale;
1038
- `)}}];function j(a){!function(a,b){a.exec(`
743
+ `)}},{version:43,name:"remove-cm-root-dir-ghost-repository",up:a=>{let b=function(){let a=process.env.CM_ROOT_DIR??process.env.MCBD_ROOT_DIR;return a&&a.trim()?e().resolve(a.trim()):null}();return b?(function(){let a=process.env.WORKTREE_REPOS;return a&&a.trim()?a.split(",").map(a=>a.trim()).filter(a=>a.length>0).map(a=>e().resolve(a)):[]})().includes(b)?void console.log(`Migration 43: ${b} is a WORKTREE_REPOS entry; keeping its repository row`):void(a.prepare(`DELETE FROM repositories
744
+ WHERE path = ?
745
+ AND is_env_managed = 1
746
+ AND NOT EXISTS (
747
+ SELECT 1 FROM worktrees WHERE worktrees.repository_path = ?
748
+ )`).run(b,b).changes>0?console.log(`Migration 43: removed CM_ROOT_DIR ghost repository row (${b})`):console.log(`Migration 43: no ghost repository row at ${b}`)):void console.log("Migration 43: CM_ROOT_DIR is not set; no ghost row to remove")},down:()=>{console.log("No rollback for the CM_ROOT_DIR ghost row removal")}}];function j(a){!function(a,b){a.exec(`
1039
749
  CREATE TABLE IF NOT EXISTS schema_version (
1040
750
  version INTEGER PRIMARY KEY,
1041
751
  name TEXT NOT NULL,
1042
752
  applied_at INTEGER NOT NULL
1043
753
  );
1044
- `);let c=f(a);console.log(`Current schema version: ${c}`);let d=b.filter(a=>a.version>c);if(0===d.length)return console.log("Schema is up to date");for(let b of(console.log(`Found ${d.length} pending migration(s)`),d)){console.log(`Applying migration ${b.version}: ${b.name}...`);try{a.transaction(()=>{b.up(a),a.prepare(`
754
+ `);let c=f(a);if(console.log(`Current schema version: ${c}`),c>43)throw Error(`This database (schema v${c}) was created by a newer version of CommandMate (this build supports up to v43). Please update: commandmate update`);let d=b.filter(a=>a.version>c);if(0===d.length)return console.log("Schema is up to date");for(let b of(console.log(`Found ${d.length} pending migration(s)`),d)){console.log(`Applying migration ${b.version}: ${b.name}...`);try{a.transaction(()=>{b.up(a),a.prepare(`
1045
755
  INSERT INTO schema_version (version, name, applied_at)
1046
756
  VALUES (?, ?, ?)
1047
- `).run(b.version,b.name,Date.now())})(),console.log(`Migration ${b.version} applied successfully`)}catch(c){let a=c instanceof Error?c.message:String(c);throw console.error(`Migration ${b.version} failed:`,a),Error(`Migration ${b.version} (${b.name}) failed: ${a}`)}}console.log(`All migrations completed. Current version: ${f(a)}`)}(a,i)}},43167:(a,b,c)=>{c.d(b,{CF:()=>h,gn:()=>i,jA:()=>g,jJ:()=>j,th:()=>k});var d=c(55511);function e(a){return{id:a.id,endpoint:a.endpoint,keys:{p256dh:a.p256dh,auth:a.auth},deviceLabel:a.device_label,enabledPrompt:1===a.enabled_prompt,enabledCompletion:1===a.enabled_completion,locale:a.locale,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}let f=`
757
+ `).run(b.version,b.name,Date.now())})(),console.log(`Migration ${b.version} applied successfully`)}catch(c){let a=c instanceof Error?c.message:String(c);throw console.error(`Migration ${b.version} failed:`,a),Error(`Migration ${b.version} (${b.name}) failed: ${a}`)}}console.log(`All migrations completed. Current version: ${f(a)}`)}(a,i)}},25537:(a,b,c)=>{function d(a){a.exec(`
758
+ CREATE TABLE IF NOT EXISTS worktrees (
759
+ id TEXT PRIMARY KEY,
760
+ name TEXT NOT NULL,
761
+ path TEXT NOT NULL UNIQUE,
762
+ last_message_summary TEXT,
763
+ updated_at INTEGER
764
+ );
765
+ `),a.exec(`
766
+ CREATE INDEX IF NOT EXISTS idx_worktrees_updated_at
767
+ ON worktrees(updated_at DESC);
768
+ `),a.exec(`
769
+ CREATE TABLE IF NOT EXISTS chat_messages (
770
+ id TEXT PRIMARY KEY,
771
+ worktree_id TEXT NOT NULL,
772
+ role TEXT NOT NULL CHECK(role IN ('user', 'assistant')),
773
+ content TEXT NOT NULL,
774
+ summary TEXT,
775
+ timestamp INTEGER NOT NULL,
776
+ log_file_name TEXT,
777
+ request_id TEXT,
778
+ message_type TEXT DEFAULT 'normal',
779
+ prompt_data TEXT,
780
+ cli_tool_id TEXT DEFAULT 'claude',
781
+ archived INTEGER DEFAULT 0,
782
+
783
+ FOREIGN KEY (worktree_id) REFERENCES worktrees(id) ON DELETE CASCADE
784
+ );
785
+ `),a.exec(`
786
+ CREATE INDEX IF NOT EXISTS idx_messages_worktree_time
787
+ ON chat_messages(worktree_id, timestamp DESC);
788
+ `),a.exec(`
789
+ CREATE INDEX IF NOT EXISTS idx_messages_request_id
790
+ ON chat_messages(request_id);
791
+ `),a.exec(`
792
+ CREATE INDEX IF NOT EXISTS idx_messages_type
793
+ ON chat_messages(message_type, worktree_id);
794
+ `),a.exec(`
795
+ CREATE INDEX IF NOT EXISTS idx_messages_cli_tool
796
+ ON chat_messages(worktree_id, cli_tool_id, timestamp DESC);
797
+ `),a.exec(`
798
+ CREATE INDEX IF NOT EXISTS idx_messages_worktree_role_archived_time
799
+ ON chat_messages(worktree_id, role, archived, timestamp DESC);
800
+ `),a.exec(`
801
+ CREATE TABLE IF NOT EXISTS session_states (
802
+ worktree_id TEXT NOT NULL,
803
+ cli_tool_id TEXT NOT NULL DEFAULT 'claude',
804
+ last_captured_line INTEGER DEFAULT 0,
805
+
806
+ PRIMARY KEY (worktree_id, cli_tool_id),
807
+ FOREIGN KEY (worktree_id) REFERENCES worktrees(id) ON DELETE CASCADE
808
+ );
809
+ `)}c.d(b,{AC:()=>k.AC,ug:()=>k.ug,lm:()=>m,KG:()=>C,cD:()=>X,Jj:()=>Y,YX:()=>i,G4:()=>S,hL:()=>$,qp:()=>U,To:()=>q,oH:()=>f.oH,py:()=>z,yy:()=>H,pE:()=>f.pE,z2:()=>ae,cP:()=>s,DF:()=>f.DF,lA:()=>f.lA,Qp:()=>f.Qp,th:()=>af.th,oZ:()=>e.oZ,ZP:()=>j,Ys:()=>B,vg:()=>J,Rm:()=>e.Rm,BN:()=>k.BN,m0:()=>k.m0,Tk:()=>x,iT:()=>Q,gp:()=>R,yE:()=>Z,BE:()=>W,qK:()=>ac,p4:()=>e.p4,r8:()=>f.r8,of:()=>aa,DN:()=>p,pZ:()=>o,kA:()=>f.kA,VL:()=>f.VL,CF:()=>af.CF,NV:()=>e.NV,ce:()=>ab,y1:()=>g,Nr:()=>y,ob:()=>w,fr:()=>F,Ui:()=>e.Ui,P9:()=>e.P9,eN:()=>G,vi:()=>e.vi,uJ:()=>e.uJ,s4:()=>d,yT:()=>D,PL:()=>f.PL,jp:()=>f.jp,nQ:()=>t,yb:()=>K,GA:()=>e.GA,Cs:()=>k.Cs,xR:()=>T,az:()=>_,nZ:()=>V,PP:()=>ad,Dx:()=>e.Dx,O:()=>e.O,EU:()=>f.EU,HZ:()=>e.HZ,UY:()=>r,cw:()=>f.cw,jJ:()=>af.jJ,DC:()=>e.DC,gb:()=>h,yB:()=>e.yB,uy:()=>A,s:()=>e.s,iu:()=>e.iu,hq:()=>e.hq,z1:()=>e.z1,bl:()=>I,jA:()=>af.jA,ZL:()=>e.ZL});var e=c(73753),f=c(52660);function g(a,b,c="claude"){let d=a.prepare(`
810
+ SELECT worktree_id, cli_tool_id, instance_id, last_captured_line, in_progress_message_id
811
+ FROM session_states
812
+ WHERE worktree_id = ? AND instance_id = ?
813
+ `).get(b,c);return d?{worktreeId:d.worktree_id,cliToolId:d.cli_tool_id,instanceId:d.instance_id,lastCapturedLine:d.last_captured_line,inProgressMessageId:d.in_progress_message_id||null}:null}function h(a,b,c,d,e){let f=e??c;a.prepare(`
814
+ INSERT INTO session_states (worktree_id, cli_tool_id, instance_id, last_captured_line)
815
+ VALUES (?, ?, ?, ?)
816
+ ON CONFLICT(worktree_id, instance_id) DO UPDATE SET
817
+ last_captured_line = excluded.last_captured_line,
818
+ cli_tool_id = excluded.cli_tool_id
819
+ `).run(b,c,f,d)}function i(a,b,c,d){let e=d??c;a.prepare(`
820
+ INSERT INTO session_states (worktree_id, cli_tool_id, instance_id, last_captured_line, in_progress_message_id)
821
+ VALUES (?, ?, ?, 0, ?)
822
+ ON CONFLICT(worktree_id, instance_id) DO UPDATE SET
823
+ in_progress_message_id = excluded.in_progress_message_id,
824
+ cli_tool_id = excluded.cli_tool_id
825
+ `).run(b,c,e,null)}function j(a,b,c,d){d?a.prepare(`
826
+ DELETE FROM session_states
827
+ WHERE worktree_id = ? AND instance_id = ?
828
+ `).run(b,d):c?a.prepare(`
829
+ DELETE FROM session_states
830
+ WHERE worktree_id = ? AND cli_tool_id = ?
831
+ `).run(b,c):a.prepare(`
832
+ DELETE FROM session_states
833
+ WHERE worktree_id = ?
834
+ `).run(b)}var k=c(28274),l=c(55511);class m extends Error{constructor(a,b,c){super(a),this.code=b,this.cause=c,this.name="MemoDbError"}}function n(a){return{id:a.id,worktreeId:a.worktree_id,title:a.title,content:a.content,position:a.position,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}function o(a,b){return a.prepare(`
835
+ SELECT id, worktree_id, title, content, position, created_at, updated_at
836
+ FROM worktree_memos
837
+ WHERE worktree_id = ?
838
+ ORDER BY position ASC
839
+ `).all(b).map(n)}function p(a,b){let c=a.prepare(`
840
+ SELECT id, worktree_id, title, content, position, created_at, updated_at
841
+ FROM worktree_memos
842
+ WHERE id = ?
843
+ `).get(b);return c?n(c):null}function q(a,b,c){let d=(0,l.randomUUID)(),e=Date.now(),f=c.title??"Memo",g=c.content??"",h=a.prepare(`
844
+ INSERT INTO worktree_memos (id, worktree_id, title, content, position, created_at, updated_at)
845
+ VALUES (?, ?, ?, ?, ?, ?, ?)
846
+ `);try{h.run(d,b,f,g,c.position,e,e)}catch(a){if(a instanceof Error&&a.message.includes("UNIQUE constraint"))throw new m(`Memo position ${c.position} is already in use for worktree "${b}"`,"DUPLICATE_POSITION",a);throw a}return{id:d,worktreeId:b,title:f,content:g,position:c.position,createdAt:new Date(e),updatedAt:new Date(e)}}function r(a,b,c){let d=Date.now(),e=["updated_at = ?"],f=[d];void 0!==c.title&&(e.push("title = ?"),f.push(c.title)),void 0!==c.content&&(e.push("content = ?"),f.push(c.content)),f.push(b),a.prepare(`
847
+ UPDATE worktree_memos
848
+ SET ${e.join(", ")}
849
+ WHERE id = ?
850
+ `).run(...f)}function s(a,b){a.prepare(`
851
+ DELETE FROM worktree_memos
852
+ WHERE id = ?
853
+ `).run(b)}function t(a,b,c){if(0===c.length)return;let d=Date.now();a.transaction(()=>{let b=a.prepare(`
854
+ UPDATE worktree_memos
855
+ SET position = -1 - position
856
+ WHERE id = ?
857
+ `);for(let a of c)b.run(a);let e=a.prepare(`
858
+ UPDATE worktree_memos
859
+ SET position = ?, updated_at = ?
860
+ WHERE id = ?
861
+ `);c.forEach((a,b)=>{e.run(b,d,a)})})()}let u=`
862
+ SELECT
863
+ t.id,
864
+ t.repository_id,
865
+ r.name AS repository_name,
866
+ r.display_name AS repository_display_name,
867
+ t.content,
868
+ t.done,
869
+ t.position,
870
+ t.created_at,
871
+ t.updated_at
872
+ FROM repository_todos t
873
+ JOIN repositories r ON r.id = t.repository_id
874
+ `;function v(a){return{id:a.id,repositoryId:a.repository_id,repositoryName:a.repository_name,repositoryDisplayName:a.repository_display_name||void 0,content:a.content,done:1===a.done,position:a.position,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}function w(a,b){return a.prepare(`
875
+ ${u}
876
+ WHERE t.repository_id = ?
877
+ ORDER BY t.position ASC, t.created_at ASC
878
+ `).all(b).map(v)}function x(a){return a.prepare(`
879
+ ${u}
880
+ ORDER BY
881
+ COALESCE(NULLIF(TRIM(r.display_name), ''), r.name) COLLATE NOCASE ASC,
882
+ t.position ASC,
883
+ t.created_at ASC,
884
+ t.id ASC
885
+ `).all().map(v)}function y(a,b){let c=a.prepare(`
886
+ ${u}
887
+ WHERE t.id = ?
888
+ `).get(b);return c?v(c):null}function z(a,b,c){let d=(0,l.randomUUID)(),e=Date.now();a.prepare(`
889
+ INSERT INTO repository_todos (id, repository_id, content, done, position, created_at, updated_at)
890
+ VALUES (?, ?, ?, 0, ?, ?, ?)
891
+ `).run(d,b,c.content,c.position,e,e);let f=y(a,d);if(!f)throw Error(`Failed to load created todo '${d}'`);return f}function A(a,b,c){let d=Date.now(),e=["updated_at = ?"],f=[d];void 0!==c.content&&(e.push("content = ?"),f.push(c.content)),void 0!==c.done&&(e.push("done = ?"),f.push(+!!c.done)),f.push(b),a.prepare(`
892
+ UPDATE repository_todos
893
+ SET ${e.join(", ")}
894
+ WHERE id = ?
895
+ `).run(...f)}function B(a,b){a.prepare(`
896
+ DELETE FROM repository_todos
897
+ WHERE id = ?
898
+ `).run(b)}let C=["todo","doing","done"];function D(a){return"todo"===a||"doing"===a||"done"===a}function E(a){var b,c;let d=(b=a.status,c=a.done,D(b)?b:1===c?"done":"todo");return{id:a.id,worktreeId:a.worktree_id,content:a.content,detail:a.detail??"",status:d,done:"done"===d,position:a.position,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}function F(a,b){return a.prepare(`
899
+ SELECT id, worktree_id, content, detail, done, status, position, created_at, updated_at
900
+ FROM worktree_todos
901
+ WHERE worktree_id = ?
902
+ ORDER BY position ASC, created_at ASC
903
+ `).all(b).map(E)}function G(a,b){let c=a.prepare(`
904
+ SELECT id, worktree_id, content, detail, done, status, position, created_at, updated_at
905
+ FROM worktree_todos
906
+ WHERE id = ?
907
+ `).get(b);return c?E(c):null}function H(a,b,c){let d=(0,l.randomUUID)(),e=Date.now(),f=c.status??"todo",g=c.detail??"";return a.prepare(`
908
+ INSERT INTO worktree_todos (id, worktree_id, content, detail, done, status, position, created_at, updated_at)
909
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
910
+ `).run(d,b,c.content,g,+("done"===f),f,c.position,e,e),{id:d,worktreeId:b,content:c.content,detail:g,status:f,done:"done"===f,position:c.position,createdAt:new Date(e),updatedAt:new Date(e)}}function I(a,b,c){let d,e=Date.now(),f=["updated_at = ?"],g=[e];void 0!==c.content&&(f.push("content = ?"),g.push(c.content)),void 0!==c.detail&&(f.push("detail = ?"),g.push(c.detail)),void 0!==c.status?d=c.status:void 0!==c.done&&(d=c.done?"done":"todo"),void 0!==d&&(f.push("status = ?"),g.push(d),f.push("done = ?"),g.push(+("done"===d))),g.push(b),a.prepare(`
911
+ UPDATE worktree_todos
912
+ SET ${f.join(", ")}
913
+ WHERE id = ?
914
+ `).run(...g)}function J(a,b){a.prepare(`
915
+ DELETE FROM worktree_todos
916
+ WHERE id = ?
917
+ `).run(b)}function K(a,b,c){if(0===c.length)return;let d=Date.now();a.transaction(()=>{let e=a.prepare(`
918
+ UPDATE worktree_todos
919
+ SET position = -1 - position
920
+ WHERE id = ? AND worktree_id = ?
921
+ `);for(let a of c)e.run(a,b);let f=a.prepare(`
922
+ UPDATE worktree_todos
923
+ SET position = ?, updated_at = ?
924
+ WHERE id = ? AND worktree_id = ?
925
+ `);c.forEach((a,c)=>{f.run(c,d,a,b)})})()}function L(a,b){return Buffer.byteLength(a,"utf-8")<=b?a:Buffer.from(a,"utf-8").subarray(0,b).toString("utf-8")}function M(a){return{id:a.id,repositoryId:a.repository_id,cliToolId:a.cli_tool_id,workingDirectory:a.working_directory,executionMode:a.execution_mode??"interactive",resumeSessionId:a.resume_session_id??void 0,lastExecutionId:a.last_execution_id??void 0,sessionName:a.session_name??void 0,status:"idle"===a.status?"stopped":a.status,lastStartedAt:a.last_started_at?new Date(a.last_started_at):void 0,lastStoppedAt:a.last_stopped_at?new Date(a.last_stopped_at):void 0,contextSentAt:a.context_sent_at?new Date(a.context_sent_at):void 0,contextSnapshot:a.context_snapshot??void 0,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at),archived:1===a.archived}}function N(a){return{id:a.id,conversationId:a.conversation_id,role:a.role,content:a.content,summary:a.summary??void 0,timestamp:new Date(a.timestamp),messageType:a.message_type,deliveryStatus:a.delivery_status??void 0,archived:1===a.archived}}function O(a){return{id:a.id,conversationId:a.conversation_id,cliToolId:a.cli_tool_id,status:a.status,pid:a.pid??void 0,commandLine:a.command_line,promptText:a.prompt_text,stdoutText:a.stdout_text??void 0,stderrText:a.stderr_text??void 0,finalMessageText:a.final_message_text??void 0,exitCode:a.exit_code,resumeSessionIdBefore:a.resume_session_id_before??void 0,resumeSessionIdAfter:a.resume_session_id_after??void 0,startedAt:a.started_at?new Date(a.started_at):void 0,finishedAt:a.finished_at?new Date(a.finished_at):void 0,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}function P(a,b,c){a.prepare(`
926
+ UPDATE assistant_conversations
927
+ SET updated_at = ?
928
+ WHERE id = ?
929
+ `).run(c.getTime(),b)}function Q(a,b,c={}){let d=`
930
+ SELECT *
931
+ FROM assistant_conversations
932
+ WHERE id = ?
933
+ ${c.includeArchived?"":"AND archived = 0"}
934
+ LIMIT 1
935
+ `,e=a.prepare(d).get(b);return e?M(e):null}function R(a,b,c,d={}){let e=`
936
+ SELECT *
937
+ FROM assistant_conversations
938
+ WHERE repository_id = ?
939
+ AND cli_tool_id = ?
940
+ ${d.includeArchived?"":"AND archived = 0"}
941
+ LIMIT 1
942
+ `,f=a.prepare(e).get(b,c);return f?M(f):null}function S(a,b){let c=(0,l.randomUUID)(),d=Date.now();return a.prepare(`
943
+ INSERT INTO assistant_conversations (
944
+ id, repository_id, cli_tool_id, working_directory, execution_mode, resume_session_id,
945
+ last_execution_id, session_name, status,
946
+ last_started_at, last_stopped_at, context_sent_at, created_at, updated_at, archived
947
+ )
948
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 0)
949
+ `).run(c,b.repositoryId,b.cliToolId,b.workingDirectory,b.executionMode??"interactive",b.resumeSessionId??null,b.lastExecutionId??null,b.sessionName??null,b.status??"stopped",b.lastStartedAt?.getTime()??null,b.lastStoppedAt?.getTime()??null,b.contextSentAt?.getTime()??null,d,d),{id:c,repositoryId:b.repositoryId,cliToolId:b.cliToolId,workingDirectory:b.workingDirectory,executionMode:b.executionMode??"interactive",resumeSessionId:b.resumeSessionId,lastExecutionId:b.lastExecutionId,sessionName:b.sessionName,status:b.status??"stopped",contextSentAt:b.contextSentAt,lastStartedAt:b.lastStartedAt,lastStoppedAt:b.lastStoppedAt,createdAt:new Date(d),updatedAt:new Date(d),archived:!1}}function T(a,b,c){let d=[],e=[];void 0!==c.workingDirectory&&(d.push("working_directory = ?"),e.push(c.workingDirectory)),void 0!==c.executionMode&&(d.push("execution_mode = ?"),e.push(c.executionMode)),void 0!==c.resumeSessionId&&(d.push("resume_session_id = ?"),e.push(c.resumeSessionId)),void 0!==c.lastExecutionId&&(d.push("last_execution_id = ?"),e.push(c.lastExecutionId)),void 0!==c.sessionName&&(d.push("session_name = ?"),e.push(c.sessionName)),void 0!==c.status&&(d.push("status = ?"),e.push(c.status)),void 0!==c.lastStartedAt&&(d.push("last_started_at = ?"),e.push(c.lastStartedAt?.getTime()??null)),void 0!==c.lastStoppedAt&&(d.push("last_stopped_at = ?"),e.push(c.lastStoppedAt?.getTime()??null)),void 0!==c.contextSentAt&&(d.push("context_sent_at = ?"),e.push(c.contextSentAt?.getTime()??null)),void 0!==c.contextSnapshot&&(d.push("context_snapshot = ?"),e.push(c.contextSnapshot??null)),void 0!==c.archived&&(d.push("archived = ?"),e.push(+!!c.archived));let f=c.updatedAt??new Date;return d.push("updated_at = ?"),e.push(f.getTime()),e.push(b),a.prepare(`
950
+ UPDATE assistant_conversations
951
+ SET ${d.join(", ")}
952
+ WHERE id = ?
953
+ `).run(...e),Q(a,b,{includeArchived:!0})}function U(a,b){let c=(0,l.randomUUID)();return a.prepare(`
954
+ INSERT INTO assistant_messages (
955
+ id, conversation_id, role, content, summary, timestamp, message_type, delivery_status, archived
956
+ )
957
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, 0)
958
+ `).run(c,b.conversationId,b.role,b.content,b.summary??null,b.timestamp.getTime(),b.messageType,b.deliveryStatus??null),P(a,b.conversationId,b.timestamp),{id:c,...b,archived:!1}}function V(a,b,c){a.prepare(`
959
+ UPDATE assistant_messages
960
+ SET delivery_status = ?
961
+ WHERE id = ?
962
+ `).run(c,b)}function W(a,b,c={}){let{limit:d=200,before:e,includeArchived:f=!1}=c,g=[b,e?.getTime()??null,e?.getTime()??null],h=`
963
+ SELECT *
964
+ FROM assistant_messages
965
+ WHERE conversation_id = ?
966
+ AND (? IS NULL OR timestamp < ?)
967
+ `;return f||(h+=" AND archived = 0"),h+=" ORDER BY timestamp DESC LIMIT ?",g.push(d),a.prepare(h).all(...g).map(N)}function X(a,b){return a.prepare(`
968
+ UPDATE assistant_messages
969
+ SET archived = 1
970
+ WHERE conversation_id = ?
971
+ AND archived = 0
972
+ `).run(b).changes}function Y(a,b,c){return a.prepare(`
973
+ UPDATE assistant_messages
974
+ SET archived = 1
975
+ WHERE conversation_id = ?
976
+ AND archived = 0
977
+ AND timestamp >= ?
978
+ `).run(b,c).changes}function Z(a,b){let c=a.prepare(`
979
+ SELECT * FROM assistant_messages WHERE id = ?
980
+ `).get(b);return c?N(c):null}function $(a,b){let c=(0,l.randomUUID)(),d=Date.now();return a.prepare(`
981
+ INSERT INTO assistant_executions (
982
+ id, conversation_id, cli_tool_id, status, pid, command_line, prompt_text,
983
+ stdout_text, stderr_text, final_message_text, exit_code, resume_session_id_before,
984
+ resume_session_id_after, started_at, finished_at, created_at, updated_at
985
+ )
986
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
987
+ `).run(c,b.conversationId,b.cliToolId,b.status??"queued",b.pid??null,b.commandLine,L(b.promptText,65536),L(b.stdoutText??"",262144)||null,L(b.stderrText??"",262144)||null,b.finalMessageText?L(b.finalMessageText,65536):null,b.exitCode??null,b.resumeSessionIdBefore??null,b.resumeSessionIdAfter??null,b.startedAt?.getTime()??null,b.finishedAt?.getTime()??null,d,d),P(a,b.conversationId,new Date(d)),{id:c,conversationId:b.conversationId,cliToolId:b.cliToolId,status:b.status??"queued",pid:b.pid,commandLine:b.commandLine,promptText:L(b.promptText,65536),stdoutText:b.stdoutText?L(b.stdoutText,262144):void 0,stderrText:b.stderrText?L(b.stderrText,262144):void 0,finalMessageText:b.finalMessageText?L(b.finalMessageText,65536):void 0,exitCode:b.exitCode,resumeSessionIdBefore:b.resumeSessionIdBefore,resumeSessionIdAfter:b.resumeSessionIdAfter,startedAt:b.startedAt,finishedAt:b.finishedAt,createdAt:new Date(d),updatedAt:new Date(d)}}function _(a,b,c){let d=[],e=[];void 0!==c.status&&(d.push("status = ?"),e.push(c.status)),void 0!==c.pid&&(d.push("pid = ?"),e.push(c.pid)),void 0!==c.stdoutText&&(d.push("stdout_text = ?"),e.push(c.stdoutText?L(c.stdoutText,262144):null)),void 0!==c.stderrText&&(d.push("stderr_text = ?"),e.push(c.stderrText?L(c.stderrText,262144):null)),void 0!==c.finalMessageText&&(d.push("final_message_text = ?"),e.push(c.finalMessageText?L(c.finalMessageText,65536):null)),void 0!==c.exitCode&&(d.push("exit_code = ?"),e.push(c.exitCode)),void 0!==c.resumeSessionIdAfter&&(d.push("resume_session_id_after = ?"),e.push(c.resumeSessionIdAfter)),void 0!==c.startedAt&&(d.push("started_at = ?"),e.push(c.startedAt?.getTime()??null)),void 0!==c.finishedAt&&(d.push("finished_at = ?"),e.push(c.finishedAt?.getTime()??null));let f=c.updatedAt??new Date;return d.push("updated_at = ?"),e.push(f.getTime(),b),a.prepare(`
988
+ UPDATE assistant_executions
989
+ SET ${d.join(", ")}
990
+ WHERE id = ?
991
+ `).run(...e),function(a,b){let c=a.prepare(`
992
+ SELECT *
993
+ FROM assistant_executions
994
+ WHERE id = ?
995
+ LIMIT 1
996
+ `).get(b);return c?O(c):null}(a,b)}function aa(a,b){let c=a.prepare(`
997
+ SELECT *
998
+ FROM assistant_executions
999
+ WHERE conversation_id = ?
1000
+ ORDER BY created_at DESC
1001
+ LIMIT 1
1002
+ `).get(b);return c?O(c):null}function ab(a,b){let c=a.prepare(`
1003
+ SELECT *
1004
+ FROM assistant_executions
1005
+ WHERE conversation_id = ?
1006
+ AND status = 'running'
1007
+ ORDER BY created_at DESC
1008
+ LIMIT 1
1009
+ `).get(b);return c?O(c):null}function ac(a,b){let c=a.prepare(`
1010
+ SELECT conversation_id, last_captured_line, in_progress_message_id
1011
+ FROM assistant_session_states
1012
+ WHERE conversation_id = ?
1013
+ `).get(b);return c?{conversationId:c.conversation_id,lastCapturedLine:c.last_captured_line,inProgressMessageId:c.in_progress_message_id}:null}function ad(a,b,c,d){a.prepare(`
1014
+ INSERT INTO assistant_session_states (conversation_id, last_captured_line, in_progress_message_id)
1015
+ VALUES (?, ?, ?)
1016
+ ON CONFLICT(conversation_id) DO UPDATE SET
1017
+ last_captured_line = excluded.last_captured_line,
1018
+ in_progress_message_id = excluded.in_progress_message_id
1019
+ `).run(b,c,d??null)}function ae(a,b){a.prepare(`
1020
+ DELETE FROM assistant_session_states
1021
+ WHERE conversation_id = ?
1022
+ `).run(b)}c(34129);var af=c(43167)},28274:(a,b,c)=>{c.d(b,{AC:()=>e,BN:()=>i,Cs:()=>j,m0:()=>h,ug:()=>f});var d=c(15194);class e extends Error{constructor(a,b=d.Ab){super(`Worktree ${a} cannot have more than ${b} agent instances`),this.name="AgentInstanceLimitError"}}class f extends Error{constructor(a){super(a),this.name="InvalidAgentInstanceError"}}function g(a){let b=a.cli_tool_id,c=a.alias&&a.alias.length>0?a.alias:(0,d.hR)(a.cli_tool_id)?(0,d.oo)(b):a.cli_tool_id;return{id:a.instance_id,cliTool:b,alias:c,order:a.sort_order}}function h(a,b){return a.prepare(`
1023
+ SELECT worktree_id, instance_id, cli_tool_id, alias, sort_order, created_at
1024
+ FROM agent_instances
1025
+ WHERE worktree_id = ?
1026
+ ORDER BY sort_order ASC, instance_id ASC
1027
+ `).all(b).map(g)}function i(a,b,c){let d=a.prepare(`
1028
+ SELECT worktree_id, instance_id, cli_tool_id, alias, sort_order, created_at
1029
+ FROM agent_instances
1030
+ WHERE worktree_id = ? AND instance_id = ?
1031
+ `).get(b,c);return d?g(d):null}function j(a,b,c){if(c.length>d.Ab)throw new e(b);let g=new Set;for(let a of c){if(!(0,d.n6)(a.id))throw new f(`Invalid instance id: ${String(a.id)}`);if(!(0,d.hR)(a.cliTool))throw new f(`Invalid CLI tool: ${String(a.cliTool)}`);if("string"==typeof a.alias&&a.alias.length>d.pQ)throw new f(`Alias exceeds ${d.pQ} characters`);if(g.has(a.id))throw new f(`Duplicate instance id: ${a.id}`);g.add(a.id)}let h=Date.now();a.transaction(()=>{a.prepare("DELETE FROM agent_instances WHERE worktree_id = ?").run(b);let d=a.prepare(`
1032
+ INSERT INTO agent_instances
1033
+ (worktree_id, instance_id, cli_tool_id, alias, sort_order, created_at)
1034
+ VALUES (?, ?, ?, ?, ?, ?)
1035
+ `);c.forEach((a,c)=>{let e=a.alias??"",f=Number.isInteger(a.order)?a.order:c;d.run(b,a.id,a.cliTool,e,f,h)})})()}},34129:(a,b,c)=>{c.d(b,{$$:()=>m,CR:()=>h,DP:()=>i,GF:()=>n,Ud:()=>l,j2:()=>k,jf:()=>o,kx:()=>j});var d=c(55511),e=c(87374);let f="id, worktree_id, cli_tool_id, instance_id, message, delay_ms, scheduled_send_time, status, created_at, sent_at, error";function g(a){return{id:a.id,worktreeId:a.worktree_id,cliToolId:a.cli_tool_id,instanceId:a.instance_id??a.cli_tool_id,message:a.message,delayMs:a.delay_ms,scheduledSendTime:a.scheduled_send_time,status:a.status,createdAt:a.created_at,sentAt:a.sent_at,error:a.error??null}}function h(a,b){let c=(0,d.randomUUID)(),e=Date.now(),f=e+b.delayMs,g=b.instanceId??b.cliToolId;return a.prepare(`
1036
+ INSERT INTO timer_messages (id, worktree_id, cli_tool_id, instance_id, message, delay_ms, scheduled_send_time, status, created_at, sent_at)
1037
+ VALUES (?, ?, ?, ?, ?, ?, ?, 'pending', ?, NULL)
1038
+ `).run(c,b.worktreeId,b.cliToolId,g,b.message,b.delayMs,f,e),{id:c,worktreeId:b.worktreeId,cliToolId:b.cliToolId,instanceId:g,message:b.message,delayMs:b.delayMs,scheduledSendTime:f,status:"pending",createdAt:e,sentAt:null,error:null}}function i(a,b,c){let{before:d,limit:h=e.XS}=c??{},i=`SELECT ${f} FROM timer_messages WHERE worktree_id = ?`,j=[b];return void 0!==d&&(i+=" AND created_at < ?",j.push(d)),i+=" ORDER BY created_at DESC LIMIT ?",j.push(h+1),a.prepare(i).all(...j).map(g)}function j(a,b){let c=a.prepare(`
1039
+ SELECT ${f}
1040
+ FROM timer_messages
1041
+ WHERE id = ?
1042
+ `).get(b);return c?g(c):void 0}function k(a,b,c,d,e){let f=["status = ?"],g=[c];void 0!==d&&(f.push("sent_at = ?"),g.push(d)),void 0!==e&&(f.push("error = ?"),g.push(e)),g.push(b),a.prepare(`UPDATE timer_messages SET ${f.join(", ")} WHERE id = ?`).run(...g)}function l(a,b){return a.prepare(`
1043
+ UPDATE timer_messages SET status = 'cancelled' WHERE id = ? AND status = 'pending'
1044
+ `).run(b).changes>0}function m(a,b){return a.prepare(`
1045
+ UPDATE timer_messages SET status = 'cancelled' WHERE worktree_id = ? AND status = 'pending'
1046
+ `).run(b).changes}function n(a,b){return a.prepare(`
1047
+ SELECT COUNT(*) as count FROM timer_messages WHERE worktree_id = ? AND status = 'pending'
1048
+ `).get(b).count}function o(a,b){return a.prepare(`
1049
+ DELETE FROM timer_messages
1050
+ WHERE worktree_id = ?
1051
+ AND status NOT IN ('pending', 'sending')
1052
+ `).run(b).changes}},43167:(a,b,c)=>{c.d(b,{CF:()=>h,gn:()=>i,jA:()=>g,jJ:()=>j,th:()=>k});var d=c(55511);function e(a){return{id:a.id,endpoint:a.endpoint,keys:{p256dh:a.p256dh,auth:a.auth},deviceLabel:a.device_label,enabledPrompt:1===a.enabled_prompt,enabledCompletion:1===a.enabled_completion,locale:a.locale,createdAt:new Date(a.created_at),updatedAt:new Date(a.updated_at)}}let f=`
1048
1053
  id, endpoint, p256dh, auth, device_label,
1049
1054
  enabled_prompt, enabled_completion, locale, created_at, updated_at
1050
1055
  `;function g(a,b){let c=Date.now(),e=b.deviceLabel??null,f=b.locale??null;a.prepare(`
@@ -1059,4 +1064,4 @@
1059
1064
  device_label = excluded.device_label,
1060
1065
  locale = COALESCE(excluded.locale, push_subscriptions.locale),
1061
1066
  updated_at = excluded.updated_at
1062
- `).run((0,d.randomUUID)(),b.endpoint,b.p256dh,b.auth,e,f,c,c);let g=h(a,b.endpoint);if(!g)throw Error("Failed to persist push subscription");return g}function h(a,b){let c=a.prepare(`SELECT ${f} FROM push_subscriptions WHERE endpoint = ?`).get(b);return c?e(c):null}function i(a,b){return a.prepare(`SELECT ${f} FROM push_subscriptions WHERE ${"prompt"===b?"enabled_prompt":"enabled_completion"} = 1 ORDER BY created_at ASC`).all().map(e)}function j(a,b,c){let d=["updated_at = ?"],e=[Date.now()];return void 0!==c.enabledPrompt&&(d.push("enabled_prompt = ?"),e.push(+!!c.enabledPrompt)),void 0!==c.enabledCompletion&&(d.push("enabled_completion = ?"),e.push(+!!c.enabledCompletion)),e.push(b),a.prepare(`UPDATE push_subscriptions SET ${d.join(", ")} WHERE endpoint = ?`).run(...e),h(a,b)}function k(a,b){return a.prepare("DELETE FROM push_subscriptions WHERE endpoint = ?").run(b).changes>0}},87374:(a,b,c)=>{c.d(b,{Dr:()=>i,HR:()=>h,Ky:()=>f,XS:()=>e,ms:()=>g,u8:()=>d}),Array.from({length:Math.floor(104)+1},(a,b)=>3e5+3e5*b);let d=5,e=50,f=100,g=1e4,h={PENDING:"pending",SENDING:"sending",SENT:"sent",FAILED:"failed",CANCELLED:"cancelled",NO_SESSION:"no_session"};function i(a){return"number"==typeof a&&a>=3e5&&a<=315e5&&a%3e5==0}},88807:(a,b,c)=>{c.r(b),c.d(b,{closeDbInstance:()=>p,getDbInstance:()=>o});var d=c(33873),e=c.n(d),f=c(36395),g=c(79646),h=c(87550),i=c.n(h);let j=!1;function k(a){return a instanceof Error&&"ERR_DLOPEN_FAILED"===a.code&&a.message.includes("NODE_MODULE_VERSION")}function l(a,b){let c=["better-sqlite3 could not be loaded: it was built for a different Node.js version.","This usually happens after switching Node.js versions (nvm, fnm, Homebrew, ...).","",`Automatic recovery failed: ${a}`,"","How to fix it manually:"];return b?c.push(" The install directory is not writable by the current user, so the addon"," cannot be rebuilt in place. Do not re-run this with sudo — root-owned"," files there will break future installs and updates.",""," Either switch back to the Node.js version CommandMate was installed with:",` node -v (currently ${process.version}, NODE_MODULE_VERSION ${process.versions.modules})`,""," Or reinstall CommandMate under a Node.js version manager, which keeps"," global packages in a user-owned directory:"," nvm use <version> && npm install -g commandmate"):c.push(` 1. cd ${process.cwd()}`," 2. npm rebuild better-sqlite3"," 3. Start CommandMate again",""," If that fails, reinstalling picks up the current Node.js version:"," npm install -g commandmate"),c.join("\n")}var m=c(87447);let n=null;function o(){if(!n){let a=(0,m._$)().CM_DB_PATH,b=c(29021),d=e().dirname(a);b.existsSync(d)||b.mkdirSync(d,{recursive:!0,mode:448}),(n=function(a){try{return new(i())(a)}catch(c){if(!k(c))throw c;if(j)throw Error(l("a rebuild was already attempted in this process.",!1));j=!0,console.error("[commandmate] better-sqlite3 was built for a different Node.js version.\n[commandmate] Rebuilding it automatically — this can take a few minutes...");let b=function(){let a=(0,g.spawnSync)("npm",["rebuild","better-sqlite3"],{cwd:process.cwd(),encoding:"utf-8",timeout:3e5,env:{...process.env,PATH:`${e().dirname(process.execPath)}${e().delimiter}${process.env.PATH??""}`}}),b=`${a.stdout??""}${a.stderr??""}`;return a.error||0!==a.status?{success:!1,permissionDenied:/EACCES|permission denied/i.test(b),output:b}:{success:!0,permissionDenied:!1,output:b}}();if(!b.success)throw Error(l("npm rebuild better-sqlite3 failed.",b.permissionDenied));console.error("[commandmate] Rebuild succeeded. Continuing startup.");try{return new(i())(a)}catch(a){if(k(a))throw Error(l("the addon still reports a version mismatch after rebuilding.",!1));throw a}}}(a)).pragma("foreign_keys = ON"),(0,f.vI)(n)}return n}function p(){n&&(n.close(),n=null)}}};
1067
+ `).run((0,d.randomUUID)(),b.endpoint,b.p256dh,b.auth,e,f,c,c);let g=h(a,b.endpoint);if(!g)throw Error("Failed to persist push subscription");return g}function h(a,b){let c=a.prepare(`SELECT ${f} FROM push_subscriptions WHERE endpoint = ?`).get(b);return c?e(c):null}function i(a,b){return a.prepare(`SELECT ${f} FROM push_subscriptions WHERE ${"prompt"===b?"enabled_prompt":"enabled_completion"} = 1 ORDER BY created_at ASC`).all().map(e)}function j(a,b,c){let d=["updated_at = ?"],e=[Date.now()];return void 0!==c.enabledPrompt&&(d.push("enabled_prompt = ?"),e.push(+!!c.enabledPrompt)),void 0!==c.enabledCompletion&&(d.push("enabled_completion = ?"),e.push(+!!c.enabledCompletion)),e.push(b),a.prepare(`UPDATE push_subscriptions SET ${d.join(", ")} WHERE endpoint = ?`).run(...e),h(a,b)}function k(a,b){return a.prepare("DELETE FROM push_subscriptions WHERE endpoint = ?").run(b).changes>0}},87374:(a,b,c)=>{c.d(b,{Dr:()=>i,HR:()=>h,Ky:()=>f,XS:()=>e,ms:()=>g,u8:()=>d}),Array.from({length:Math.floor(104)+1},(a,b)=>3e5+3e5*b);let d=5,e=50,f=100,g=1e4,h={PENDING:"pending",SENDING:"sending",SENT:"sent",FAILED:"failed",CANCELLED:"cancelled",NO_SESSION:"no_session"};function i(a){return"number"==typeof a&&a>=3e5&&a<=315e5&&a%3e5==0}},88807:(a,b,c)=>{c.r(b),c.d(b,{closeDbInstance:()=>p,getDbInstance:()=>o});var d=c(33873),e=c.n(d),f=c(19006),g=c(79646),h=c(87550),i=c.n(h);let j=!1;function k(a){return a instanceof Error&&"ERR_DLOPEN_FAILED"===a.code&&a.message.includes("NODE_MODULE_VERSION")}function l(a,b){let c=["better-sqlite3 could not be loaded: it was built for a different Node.js version.","This usually happens after switching Node.js versions (nvm, fnm, Homebrew, ...).","",`Automatic recovery failed: ${a}`,"","How to fix it manually:"];return b?c.push(" The install directory is not writable by the current user, so the addon"," cannot be rebuilt in place. Do not re-run this with sudo — root-owned"," files there will break future installs and updates.",""," Either switch back to the Node.js version CommandMate was installed with:",` node -v (currently ${process.version}, NODE_MODULE_VERSION ${process.versions.modules})`,""," Or reinstall CommandMate under a Node.js version manager, which keeps"," global packages in a user-owned directory:"," nvm use <version> && npm install -g commandmate"):c.push(` 1. cd ${process.cwd()}`," 2. npm rebuild better-sqlite3"," 3. Start CommandMate again",""," If that fails, reinstalling picks up the current Node.js version:"," npm install -g commandmate"),c.join("\n")}var m=c(87447);let n=null;function o(){if(!n){let a=(0,m._$)().CM_DB_PATH,b=c(29021),d=e().dirname(a);b.existsSync(d)||b.mkdirSync(d,{recursive:!0,mode:448});let h=function(a){try{return new(i())(a)}catch(c){if(!k(c))throw c;if(j)throw Error(l("a rebuild was already attempted in this process.",!1));j=!0,console.error("[commandmate] better-sqlite3 was built for a different Node.js version.\n[commandmate] Rebuilding it automatically — this can take a few minutes...");let b=function(){let a=(0,g.spawnSync)("npm",["rebuild","better-sqlite3"],{cwd:process.cwd(),encoding:"utf-8",timeout:3e5,env:{...process.env,PATH:`${e().dirname(process.execPath)}${e().delimiter}${process.env.PATH??""}`}}),b=`${a.stdout??""}${a.stderr??""}`;return a.error||0!==a.status?{success:!1,permissionDenied:/EACCES|permission denied/i.test(b),output:b}:{success:!0,permissionDenied:!1,output:b}}();if(!b.success)throw Error(l("npm rebuild better-sqlite3 failed.",b.permissionDenied));console.error("[commandmate] Rebuild succeeded. Continuing startup.");try{return new(i())(a)}catch(a){if(k(a))throw Error(l("the addon still reports a version mismatch after rebuilding.",!1));throw a}}}(a);h.pragma("foreign_keys = ON"),h.pragma("journal_mode = WAL"),h.pragma("busy_timeout = 5000");try{(0,f.vI)(h)}catch(a){throw h.close(),a}n=h}return n}function p(){n&&(n.close(),n=null)}}};