tower-studio 0.2.29 → 0.2.31

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 (335) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +2 -1
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +45 -33
  13. package/.next/standalone/.next/server/app/_not-found/page.js +4 -4
  14. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/api/adapters/test/route.js +2 -2
  17. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/browse-fs/route.js +2 -1
  19. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js +1 -1
  25. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/assistant/route.js +2 -2
  29. package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js +2 -2
  31. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js +1 -1
  33. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +4 -4
  42. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js +1 -1
  44. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js +1 -1
  46. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +1 -1
  48. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  50. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +78 -78
  51. package/.next/standalone/.next/server/app/missions/page.js +4 -4
  52. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +2 -1
  55. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +45 -33
  56. package/.next/standalone/.next/server/app/onboarding/page.js +4 -4
  57. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +2 -1
  60. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +45 -33
  61. package/.next/standalone/.next/server/app/page.js +4 -4
  62. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +2 -1
  65. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +62 -62
  66. package/.next/standalone/.next/server/app/settings/page.js +6 -6
  67. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +2 -1
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +105 -105
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +7 -7
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +2 -1
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +97 -97
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +6 -6
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +2 -1
  80. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +79 -67
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +4 -4
  82. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +2 -1
  85. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +78 -78
  86. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +7 -7
  87. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  88. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +2 -1
  90. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +45 -33
  91. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +5 -5
  92. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +2 -1
  95. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +79 -79
  96. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +6 -6
  97. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  98. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  99. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +3 -2
  100. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +92 -80
  101. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +7 -7
  102. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +2 -1
  105. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +65 -53
  106. package/.next/standalone/.next/server/app/workspaces/page.js +4 -4
  107. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  108. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_03qwlhl.js +3 -0
  110. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +2 -2
  111. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0q.piu~._.js → [root-of-the-server]__00~-bvt._.js} +2 -2
  112. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0122.hq._.js +3 -0
  113. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01_h-re._.js +3 -0
  114. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0bx47rj._.js → [root-of-the-server]__01n7exm._.js} +3 -3
  115. package/.next/standalone/.next/server/chunks/[root-of-the-server]__08u6wg.._.js +20 -0
  116. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0~au8v.._.js → [root-of-the-server]__0ag-i9m._.js} +2 -2
  117. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c513um._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0clvf~t._.js +4 -0
  119. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__03nvcdl._.js → [root-of-the-server]__0d2japj._.js} +2 -2
  120. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fey.8j._.js +3 -0
  121. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__11c_is3._.js → [root-of-the-server]__0g2lv9x._.js} +2 -2
  122. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__062mzio._.js → [root-of-the-server]__0gk6ftq._.js} +3 -3
  123. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0xelcb1._.js → [root-of-the-server]__0kay2~d._.js} +3 -3
  124. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lioghc._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0mw.9lg._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qif839._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0tys9pv._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0ogh_qu._.js → [root-of-the-server]__12ohpl.._.js} +2 -2
  129. package/.next/standalone/.next/server/chunks/_0lb0q5p._.js +7 -0
  130. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/src_0weytpz._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/src_lib_02llcit._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/src_lib_0aowbzy._.js +1 -1
  134. package/.next/standalone/.next/server/chunks/src_lib_0nw5n~t._.js +1 -1
  135. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-b8f6d._.js +30 -0
  139. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01pn3ol._.js +3 -0
  140. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02p4lry._.js +3 -0
  141. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0eea3ta._.js → [root-of-the-server]__037nnpo._.js} +2 -2
  142. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m1tg3c._.js → [root-of-the-server]__06ubi1g._.js} +3 -3
  143. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07ptf-z._.js +3 -0
  144. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12ktvsa._.js → [root-of-the-server]__0azyv7l._.js} +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b77ayk._.js +47 -0
  146. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bs_c.t._.js +3 -0
  147. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cjnw12._.js +3 -0
  148. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cle18b._.js +3 -0
  149. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0oqhxfb._.js → [root-of-the-server]__0d76zys._.js} +2 -2
  150. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e25s-_._.js +3 -0
  151. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ggwnea._.js +3 -0
  152. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hg-fwv._.js +30 -0
  153. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  154. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lho64y._.js +3 -0
  155. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lx7sf8._.js +3 -0
  156. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0261~vp._.js → [root-of-the-server]__0mv64fw._.js} +2 -2
  157. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__09rts_e._.js → [root-of-the-server]__0ohx~.q._.js} +2 -2
  158. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__01evhhc._.js → [root-of-the-server]__0p8otw1._.js} +3 -3
  159. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m.uq9z._.js → [root-of-the-server]__0q6m-fw._.js} +1 -1
  160. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qp5cw1._.js +3 -0
  161. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rara9.._.js +3 -0
  162. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0v7p~3.._.js → [root-of-the-server]__0rv7-_r._.js} +2 -2
  163. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tjczqw._.js +43 -0
  164. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0u7n6kw._.js +43 -0
  165. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0uq_0mc._.js +30 -0
  166. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wm~yai._.js +30 -0
  167. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ymqgu_._.js +43 -0
  168. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  169. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__13374-3._.js → [root-of-the-server]__127.0d7._.js} +3 -3
  170. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12w_sm_._.js +30 -0
  171. package/.next/standalone/.next/server/chunks/ssr/_0.5wuxq._.js +3 -0
  172. package/.next/standalone/.next/server/chunks/ssr/{_0q2tjdv._.js → _0.i2.1y._.js} +3 -3
  173. package/.next/standalone/.next/server/chunks/ssr/_0.sfgns._.js +3 -0
  174. package/.next/standalone/.next/server/chunks/ssr/{_0w9hqi-._.js → _010l~rd._.js} +2 -2
  175. package/.next/standalone/.next/server/chunks/ssr/{_122obq1._.js → _01jctji._.js} +2 -2
  176. package/.next/standalone/.next/server/chunks/ssr/_04ia97a._.js +3 -0
  177. package/.next/standalone/.next/server/chunks/ssr/_0533im8._.js +30 -0
  178. package/.next/standalone/.next/server/chunks/ssr/_06~9axc._.js +3 -0
  179. package/.next/standalone/.next/server/chunks/ssr/_070.dxf._.js +4 -0
  180. package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
  181. package/.next/standalone/.next/server/chunks/ssr/{_0nbufo.._.js → _079_ku8._.js} +1 -1
  182. package/.next/standalone/.next/server/chunks/ssr/_0_kfemp._.js +3 -0
  183. package/.next/standalone/.next/server/chunks/ssr/_0bkb_.9._.js +3 -0
  184. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  185. package/.next/standalone/.next/server/chunks/ssr/{_0ogp-c1._.js → _0e2s44q._.js} +3 -3
  186. package/.next/standalone/.next/server/chunks/ssr/_0ex2yo6._.js +3 -0
  187. package/.next/standalone/.next/server/chunks/ssr/{_0ql3kw8._.js → _0fc7rh_._.js} +3 -3
  188. package/.next/standalone/.next/server/chunks/ssr/_0jartlx._.js +3 -0
  189. package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
  190. package/.next/standalone/.next/server/chunks/ssr/_0jixh5l._.js +3 -0
  191. package/.next/standalone/.next/server/chunks/ssr/_0lr6c.q._.js +3 -0
  192. package/.next/standalone/.next/server/chunks/ssr/_0njo37o._.js +30 -0
  193. package/.next/standalone/.next/server/chunks/ssr/{_05xdaz3._.js → _0np9y-t._.js} +1 -1
  194. package/.next/standalone/.next/server/chunks/ssr/_0p523x3._.js +3 -0
  195. package/.next/standalone/.next/server/chunks/ssr/_0r5h7cr._.js +30 -0
  196. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  197. package/.next/standalone/.next/server/chunks/ssr/_0s02eu9._.js +43 -0
  198. package/.next/standalone/.next/server/chunks/ssr/{_0ypra_h._.js → _0sj20-h._.js} +2 -2
  199. package/.next/standalone/.next/server/chunks/ssr/{_0kef0v6._.js → _0tf~vm8._.js} +1 -1
  200. package/.next/standalone/.next/server/chunks/ssr/_0ueyys5._.js +1 -1
  201. package/.next/standalone/.next/server/chunks/ssr/_0vcbjph._.js +43 -0
  202. package/.next/standalone/.next/server/chunks/ssr/_0v~zkwi._.js +3 -0
  203. package/.next/standalone/.next/server/chunks/ssr/_0w2xtk9._.js +43 -0
  204. package/.next/standalone/.next/server/chunks/ssr/{_0574rlr._.js → _0xl~whi._.js} +1 -1
  205. package/.next/standalone/.next/server/chunks/ssr/{_0rikvu5._.js → _12e8ueo._.js} +2 -2
  206. package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +1 -1
  207. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  208. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  209. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +2 -2
  210. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  211. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  212. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  213. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  214. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  215. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  216. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  217. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0dnn~ft._.js → src_lib_0-t3s4k._.js} +1 -1
  218. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0.aklj3._.js → src_lib_007-dd1._.js} +1 -1
  219. package/.next/standalone/.next/server/chunks/ssr/{src_lib_00tdjs9._.js → src_lib_09bjxpu._.js} +1 -1
  220. package/.next/standalone/.next/server/chunks/ssr/{src_lib_07bxr4y._.js → src_lib_09vospx._.js} +1 -1
  221. package/.next/standalone/.next/server/chunks/ssr/src_lib_0dbdb7l._.js +3 -0
  222. package/.next/standalone/.next/server/chunks/ssr/src_lib_0dypzt_._.js +3 -0
  223. package/.next/standalone/.next/server/chunks/ssr/src_lib_0f948rt._.js +3 -0
  224. package/.next/standalone/.next/server/chunks/ssr/src_lib_0h1rnc.._.js +3 -0
  225. package/.next/standalone/.next/server/chunks/ssr/src_lib_0lcvt1c._.js +3 -0
  226. package/.next/standalone/.next/server/chunks/ssr/src_lib_0mao-of._.js +3 -0
  227. package/.next/standalone/.next/server/chunks/ssr/src_lib_0qlnl~c._.js +3 -0
  228. package/.next/standalone/.next/server/chunks/ssr/src_lib_0qt5bft._.js +3 -0
  229. package/.next/standalone/.next/server/chunks/ssr/src_lib_0z75cue._.js +3 -0
  230. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  231. package/.next/standalone/.next/server/pages/500.html +1 -1
  232. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  233. package/.next/standalone/.next/server/server-reference-manifest.json +368 -326
  234. package/.next/standalone/.next/static/chunks/0.0j755cvqmrp.js +1 -0
  235. package/.next/standalone/.next/static/chunks/{02qa2vs~vqm-y.js → 0.buvrbvzfwyy.js} +1 -1
  236. package/.next/standalone/.next/static/chunks/0204r--~nsp18.js +1 -0
  237. package/.next/standalone/.next/static/chunks/030ac851xd~gu.js +1 -0
  238. package/.next/standalone/.next/static/chunks/{08o-03rbtt-9_.js → 03kiyommty8e..js} +1 -1
  239. package/.next/standalone/.next/static/chunks/{0idlcmve-t2ib.js → 0486duu_3efe7.js} +1 -1
  240. package/.next/standalone/.next/static/chunks/05lkncv5~cymd.js +1 -0
  241. package/.next/standalone/.next/static/chunks/07frdan9tq1_3.js +1 -0
  242. package/.next/standalone/.next/static/chunks/{0qeyijgwevvt1.js → 08i7p_8fg0alm.js} +2 -2
  243. package/.next/standalone/.next/static/chunks/{0ndn0hb3rejar.js → 090nszcq3.6j3.js} +1 -1
  244. package/.next/standalone/.next/static/chunks/0buf_9f~42bcs.js +1 -0
  245. package/.next/standalone/.next/static/chunks/{0b1lz8_b120x8.js → 0c37kkv-_mqh1.js} +2 -2
  246. package/.next/standalone/.next/static/chunks/0ch2~x.r._~9f.js +1 -0
  247. package/.next/standalone/.next/static/chunks/0eskfzrdlc5ka.js +1 -0
  248. package/.next/standalone/.next/static/chunks/0g0ui9x6~.du4.js +2 -0
  249. package/.next/standalone/.next/static/chunks/{11c77onw906yw.js → 0jdea_ondwo2z.js} +1 -1
  250. package/.next/standalone/.next/static/chunks/0jj53.l_c5mi9.js +5 -0
  251. package/.next/standalone/.next/static/chunks/0ktahv77jdq60.css +1 -0
  252. package/.next/standalone/.next/static/chunks/0m.k-orls2qu4.js +1 -0
  253. package/.next/standalone/.next/static/chunks/0ox7k.va.hxke.js +1 -0
  254. package/.next/standalone/.next/static/chunks/0ps1bcdktah3z.js +1 -0
  255. package/.next/standalone/.next/static/chunks/{0kb37luu6e-4c.js → 0q0hf~j_0ho6u.js} +1 -1
  256. package/.next/standalone/.next/static/chunks/{11lcq.oneb80-.js → 0qrh5-j~zd5nb.js} +1 -1
  257. package/.next/standalone/.next/static/chunks/0x.tfkgl9nu-f.js +1 -0
  258. package/.next/standalone/.next/static/chunks/{05p5m6w09u.zq.js → 0z42w8y2ktwst.js} +1 -1
  259. package/.next/standalone/.next/static/chunks/0~qog0fhbtq68.js +2 -0
  260. package/.next/standalone/.next/static/chunks/11qbnyfcew125.js +1 -0
  261. package/.next/standalone/.next/static/chunks/13l5bumoa7m-8.js +1 -0
  262. package/.next/standalone/.next/static/chunks/15jqo~pexyrdp.js +1 -0
  263. package/.next/standalone/package.json +1 -1
  264. package/dist/mcp-server.cjs +502 -104
  265. package/package.json +1 -1
  266. package/prisma/schema.prisma +7 -0
  267. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.z97nx._.js +0 -4
  268. package/.next/standalone/.next/server/chunks/[root-of-the-server]__09sw_a5._.js +0 -3
  269. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0v5.ht~._.js +0 -3
  270. package/.next/standalone/.next/server/chunks/_0_eodxe._.js +0 -7
  271. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04ze9p8._.js +0 -47
  272. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0c7x0o9._.js +0 -3
  273. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cv7yj9._.js +0 -3
  274. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e82_jw._.js +0 -3
  275. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g_4qvl._.js +0 -3
  276. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ggfem6._.js +0 -3
  277. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ihwpkg._.js +0 -3
  278. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0la1659._.js +0 -30
  279. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qomv-y._.js +0 -3
  280. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qy0o3-._.js +0 -30
  281. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0sc_a_d._.js +0 -30
  282. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0sdd0qu._.js +0 -30
  283. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0sk.itb._.js +0 -3
  284. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wjuu0z._.js +0 -3
  285. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y.s5ax._.js +0 -3
  286. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zq.n2w._.js +0 -30
  287. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~bt1fr._.js +0 -3
  288. package/.next/standalone/.next/server/chunks/ssr/_0-ez10.._.js +0 -30
  289. package/.next/standalone/.next/server/chunks/ssr/_01-sgr0._.js +0 -4
  290. package/.next/standalone/.next/server/chunks/ssr/_012ww1b._.js +0 -3
  291. package/.next/standalone/.next/server/chunks/ssr/_04y11oe._.js +0 -3
  292. package/.next/standalone/.next/server/chunks/ssr/_068g~hf._.js +0 -3
  293. package/.next/standalone/.next/server/chunks/ssr/_0a0aq2i._.js +0 -3
  294. package/.next/standalone/.next/server/chunks/ssr/_0lhvl1i._.js +0 -3
  295. package/.next/standalone/.next/server/chunks/ssr/_0me6z_3._.js +0 -3
  296. package/.next/standalone/.next/server/chunks/ssr/_0qkxdkn._.js +0 -30
  297. package/.next/standalone/.next/server/chunks/ssr/_0qxrl.t._.js +0 -3
  298. package/.next/standalone/.next/server/chunks/ssr/_0rm18by._.js +0 -3
  299. package/.next/standalone/.next/server/chunks/ssr/_0sbxdnc._.js +0 -30
  300. package/.next/standalone/.next/server/chunks/ssr/_0wini_1._.js +0 -3
  301. package/.next/standalone/.next/server/chunks/ssr/_0zjukoh._.js +0 -3
  302. package/.next/standalone/.next/server/chunks/ssr/_10i~kx3._.js +0 -3
  303. package/.next/standalone/.next/server/chunks/ssr/_10x572b._.js +0 -3
  304. package/.next/standalone/.next/server/chunks/ssr/src_lib_0e.v07~._.js +0 -3
  305. package/.next/standalone/.next/server/chunks/ssr/src_lib_0haj7_-._.js +0 -3
  306. package/.next/standalone/.next/server/chunks/ssr/src_lib_0l9igqj._.js +0 -3
  307. package/.next/standalone/.next/server/chunks/ssr/src_lib_0vp4mgz._.js +0 -3
  308. package/.next/standalone/.next/server/chunks/ssr/src_lib_0wd-1.k._.js +0 -3
  309. package/.next/standalone/.next/server/chunks/ssr/src_lib_0yvdojq._.js +0 -3
  310. package/.next/standalone/.next/server/chunks/ssr/src_lib_0zfjhu1._.js +0 -3
  311. package/.next/standalone/.next/server/chunks/ssr/src_lib_0~cwhiw._.js +0 -3
  312. package/.next/standalone/.next/server/chunks/ssr/src_lib_127qa83._.js +0 -3
  313. package/.next/standalone/.next/server/chunks/ssr/src_lib_12h5txa._.js +0 -3
  314. package/.next/standalone/.next/static/chunks/00qurnl9erkgb.js +0 -1
  315. package/.next/standalone/.next/static/chunks/02__e-asq9zon.js +0 -1
  316. package/.next/standalone/.next/static/chunks/02f8lqfqcsvo3.js +0 -1
  317. package/.next/standalone/.next/static/chunks/08kub70y9uw4q.js +0 -2
  318. package/.next/standalone/.next/static/chunks/092wf~n14ok0h.js +0 -1
  319. package/.next/standalone/.next/static/chunks/0avgpwv8_gf7z.js +0 -2
  320. package/.next/standalone/.next/static/chunks/0fvpv9go6.7bi.js +0 -1
  321. package/.next/standalone/.next/static/chunks/0j24n8~mpnczp.js +0 -1
  322. package/.next/standalone/.next/static/chunks/0kdvltfdet5rq.js +0 -1
  323. package/.next/standalone/.next/static/chunks/0mtmre6ztneut.js +0 -1
  324. package/.next/standalone/.next/static/chunks/0nf6hn910tqeq.css +0 -1
  325. package/.next/standalone/.next/static/chunks/0nm1ux1qybznc.js +0 -1
  326. package/.next/standalone/.next/static/chunks/0sa60qn.3cb0c.js +0 -5
  327. package/.next/standalone/.next/static/chunks/0wa.h9jc7z7v5.js +0 -1
  328. package/.next/standalone/.next/static/chunks/10k89w233i28z.js +0 -1
  329. package/.next/standalone/.next/static/chunks/12bsh7fw8bg77.js +0 -1
  330. package/.next/standalone/.next/static/chunks/13td.z.kgq7~4.js +0 -1
  331. package/.next/standalone/.next/static/chunks/15_.l.-~mxr1v.js +0 -1
  332. package/.next/standalone/.next/static/chunks/15mle~71jj5qd.js +0 -1
  333. /package/.next/standalone/.next/static/{1ZaC3q-jCTUM28yBO4rcb → 91SkA26N5DQokm5Txl-cb}/_buildManifest.js +0 -0
  334. /package/.next/standalone/.next/static/{1ZaC3q-jCTUM28yBO4rcb → 91SkA26N5DQokm5Txl-cb}/_clientMiddlewareManifest.js +0 -0
  335. /package/.next/standalone/.next/static/{1ZaC3q-jCTUM28yBO4rcb → 91SkA26N5DQokm5Txl-cb}/_ssgManifest.js +0 -0
@@ -26440,23 +26440,25 @@ function resolveSdkExecutable(command, platform = process.platform, readFile = (
26440
26440
  const ext = import_node_path2.default.extname(command).toLowerCase();
26441
26441
  if (ext !== ".cmd" && ext !== ".bat") return command;
26442
26442
  const dir = import_node_path2.default.win32.dirname(command);
26443
+ let shimSnippet = "";
26443
26444
  try {
26444
26445
  const shim = readFile(command);
26445
- const match = shim.match(/%~?dp0%[\\/]?([^"]+?\.(?:js|mjs|cjs))/i);
26446
+ shimSnippet = shim.replace(/\s+/g, " ").slice(0, 400);
26447
+ const match = shim.match(/"([^"]*\.(?:c?js|mjs))"/i);
26446
26448
  if (match) {
26447
- const resolved = import_node_path2.default.win32.resolve(dir, match[1].replace(/\//g, "\\"));
26449
+ let p2 = match[1].replace(/%~?dp0%/gi, dir).replace(/\//g, "\\");
26450
+ const resolved = import_node_path2.default.win32.isAbsolute(p2) ? import_node_path2.default.win32.normalize(p2) : import_node_path2.default.win32.resolve(dir, p2);
26448
26451
  if (fileExists(resolved)) return resolved;
26452
+ console.error(`[resolveSdkExecutable] parsed cli="${resolved}" but it doesn't exist`);
26449
26453
  }
26450
- } catch {
26454
+ } catch (e2) {
26455
+ console.error(`[resolveSdkExecutable] shim read failed: ${e2 instanceof Error ? e2.message : e2}`);
26451
26456
  }
26452
- const guess = import_node_path2.default.win32.join(
26453
- dir,
26454
- "node_modules",
26455
- "@anthropic-ai",
26456
- "claude-code",
26457
- "cli.js"
26458
- );
26457
+ const guess = import_node_path2.default.win32.join(dir, "node_modules", "@anthropic-ai", "claude-code", "cli.js");
26459
26458
  if (fileExists(guess)) return guess;
26459
+ console.error(
26460
+ `[resolveSdkExecutable] could not convert ${command} \u2192 guess="${guess}" exists=${fileExists(guess)} shim="${shimSnippet}"`
26461
+ );
26460
26462
  return command;
26461
26463
  }
26462
26464
  async function resolveSpawnTarget(command, args, opts = {}) {
@@ -26988,7 +26990,7 @@ var init_claude_cli_adapter = __esm({
26988
26990
  fs3.mkdirSync(path4.dirname(target), { recursive: true });
26989
26991
  const existing = await fs3.promises.lstat(target).catch(() => null);
26990
26992
  if (existing) {
26991
- if (existing.isSymbolicLink() || process.platform === "win32" && existing.isDirectory()) {
26993
+ if (existing.isSymbolicLink() || isWindows() && existing.isDirectory()) {
26992
26994
  try {
26993
26995
  const current = await fs3.promises.readlink(target);
26994
26996
  if (path4.resolve(current) === path4.resolve(sourceDir)) {
@@ -27014,7 +27016,7 @@ var init_claude_cli_adapter = __esm({
27014
27016
  };
27015
27017
  }
27016
27018
  }
27017
- const linkType = process.platform === "win32" ? "junction" : "dir";
27019
+ const linkType = isWindows() ? "junction" : "dir";
27018
27020
  await fs3.promises.symlink(sourceDir, target, linkType);
27019
27021
  return { ok: true, method: "symlink", detail: `${target} \u2192 ${sourceDir}` };
27020
27022
  } catch (err) {
@@ -27116,7 +27118,7 @@ var init_claude_cli_adapter = __esm({
27116
27118
  * Public so claude-session.ts can reuse instead of duplicating findClaudeBinary(). */
27117
27119
  resolveCommand() {
27118
27120
  if (process.env.CLAUDE_CODE_PATH) return process.env.CLAUDE_CODE_PATH;
27119
- if (process.platform === "win32") {
27121
+ if (isWindows()) {
27120
27122
  const native = resolveCommandPathSync("claude-code");
27121
27123
  if (native !== "claude-code") return native;
27122
27124
  }
@@ -47400,27 +47402,24 @@ function getMergeBase(cwd) {
47400
47402
  }
47401
47403
  return null;
47402
47404
  }
47403
- function captureGitLog(cwd) {
47405
+ function resolveGitBase(cwd, forkCommit) {
47406
+ if (forkCommit) return forkCommit;
47407
+ return getMergeBase(cwd);
47408
+ }
47409
+ function captureGitLog(cwd, forkCommit) {
47404
47410
  try {
47405
- const mergeBase = getMergeBase(cwd);
47406
- if (mergeBase) {
47407
- const log2 = runGit(["log", "--oneline", `${mergeBase}..HEAD`], cwd);
47408
- if (log2) return log2;
47409
- }
47410
- return runGit(["log", "--oneline", "-3"], cwd) || null;
47411
+ const base = resolveGitBase(cwd, forkCommit);
47412
+ if (!base) return null;
47413
+ return runGit(["log", "--oneline", `${base}..HEAD`], cwd) || null;
47411
47414
  } catch {
47412
47415
  return null;
47413
47416
  }
47414
47417
  }
47415
- function captureGitStats(cwd) {
47418
+ function captureGitStats(cwd, forkCommit) {
47416
47419
  try {
47417
- let diffOutput;
47418
- const mergeBase = getMergeBase(cwd);
47419
- if (mergeBase) {
47420
- diffOutput = runGit(["diff", "--stat", `${mergeBase}..HEAD`], cwd);
47421
- } else {
47422
- diffOutput = runGit(["diff", "--stat", "HEAD~20", "HEAD"], cwd);
47423
- }
47420
+ const base = resolveGitBase(cwd, forkCommit);
47421
+ if (!base) return null;
47422
+ const diffOutput = runGit(["diff", "--stat", `${base}..HEAD`], cwd);
47424
47423
  if (!diffOutput) return null;
47425
47424
  return parseDiffStat(diffOutput);
47426
47425
  } catch {
@@ -47459,17 +47458,17 @@ function trimTerminalBuffer(buffer) {
47459
47458
  if (clean.length <= TERMINAL_LOG_MAX) return clean;
47460
47459
  return clean.slice(clean.length - TERMINAL_LOG_MAX);
47461
47460
  }
47462
- async function captureExecutionSummary(executionId, _taskId, exitCode, terminalBuffer, worktreePath) {
47461
+ async function captureExecutionSummary(executionId, _taskId, exitCode, terminalBuffer, worktreePath, forkCommit = null) {
47463
47462
  try {
47464
- console.error(`[captureExecutionSummary] Starting: exec=${executionId.slice(0, 8)} exit=${exitCode} buffer=${terminalBuffer.length}chars worktree=${worktreePath}`);
47463
+ console.error(`[captureExecutionSummary] Starting: exec=${executionId.slice(0, 8)} exit=${exitCode} buffer=${terminalBuffer.length}chars worktree=${worktreePath} fork=${forkCommit?.slice(0, 8) ?? "none"}`);
47465
47464
  let gitLog = null;
47466
47465
  let gitStats = null;
47467
47466
  let summary = null;
47468
47467
  if (worktreePath && (0, import_fs6.existsSync)(worktreePath)) {
47469
47468
  try {
47470
47469
  runGit(["rev-parse", "--git-dir"], worktreePath);
47471
- gitLog = captureGitLog(worktreePath);
47472
- gitStats = captureGitStats(worktreePath);
47470
+ gitLog = captureGitLog(worktreePath, forkCommit);
47471
+ gitStats = captureGitStats(worktreePath, forkCommit);
47473
47472
  if (gitStats && gitLog) {
47474
47473
  const commitCount = gitLog.split("\n").filter(Boolean).length;
47475
47474
  gitStats = { ...gitStats, commits: commitCount };
@@ -47575,6 +47574,437 @@ var init_execution_summary = __esm({
47575
47574
  }
47576
47575
  });
47577
47576
 
47577
+ // src/lib/fts.ts
47578
+ async function searchNotes(db4, projectId, query) {
47579
+ const trimmed = query.trim();
47580
+ if (!trimmed) return [];
47581
+ if (trimmed.length < 3) {
47582
+ return db4.$queryRawUnsafe(
47583
+ `SELECT id as note_id, title, content FROM "ProjectNote"
47584
+ WHERE "projectId" = ? AND (title LIKE ? OR content LIKE ?)
47585
+ LIMIT 20`,
47586
+ projectId,
47587
+ `%${trimmed}%`,
47588
+ `%${trimmed}%`
47589
+ );
47590
+ }
47591
+ return db4.$queryRawUnsafe(
47592
+ `SELECT f.note_id, f.title, f.content
47593
+ FROM notes_fts f
47594
+ JOIN "ProjectNote" n ON n.id = f.note_id
47595
+ WHERE f.notes_fts MATCH ? AND n."projectId" = ?
47596
+ ORDER BY rank
47597
+ LIMIT 20`,
47598
+ trimmed,
47599
+ projectId
47600
+ );
47601
+ }
47602
+ async function syncNoteToFts(db4, note) {
47603
+ await db4.$executeRawUnsafe(
47604
+ "DELETE FROM notes_fts WHERE note_id = ?",
47605
+ note.id
47606
+ );
47607
+ await db4.$executeRawUnsafe(
47608
+ "INSERT INTO notes_fts(note_id, title, content) VALUES (?, ?, ?)",
47609
+ note.id,
47610
+ note.title,
47611
+ note.content
47612
+ );
47613
+ }
47614
+ async function deleteNoteFromFts(db4, noteId) {
47615
+ await db4.$executeRawUnsafe(
47616
+ "DELETE FROM notes_fts WHERE note_id = ?",
47617
+ noteId
47618
+ );
47619
+ }
47620
+ var init_fts = __esm({
47621
+ "src/lib/fts.ts"() {
47622
+ "use strict";
47623
+ }
47624
+ });
47625
+
47626
+ // src/lib/task-diff-resolver.ts
47627
+ async function resolveTaskDiffSource(taskId) {
47628
+ const task = await db2.task.findUnique({
47629
+ where: { id: taskId },
47630
+ include: { project: true }
47631
+ });
47632
+ if (!task) return { kind: "error", status: 404, message: "Task not found" };
47633
+ if (!task.project?.localPath) {
47634
+ return { kind: "error", status: 400, message: "Project has no local path" };
47635
+ }
47636
+ const baseBranch = task.baseBranch || "main";
47637
+ const localPath = task.project.localPath;
47638
+ const latestExecution = await db2.taskExecution.findFirst({
47639
+ where: { taskId },
47640
+ orderBy: { createdAt: "desc" }
47641
+ });
47642
+ if (!latestExecution) return { kind: "empty" };
47643
+ const { forkCommit, mergeCommit, branchTipCommit, worktreeBranch, worktreePath } = latestExecution;
47644
+ if (mergeCommit && forkCommit) {
47645
+ const endCommit = branchTipCommit || mergeCommit;
47646
+ return {
47647
+ kind: "ok",
47648
+ data: {
47649
+ diffCwd: localPath,
47650
+ diffTarget: `${forkCommit}..${endCommit}`,
47651
+ baseRef: forkCommit,
47652
+ endRef: endCommit,
47653
+ worktreePath: null
47654
+ }
47655
+ };
47656
+ }
47657
+ if (forkCommit && worktreePath && (0, import_fs7.existsSync)(worktreePath)) {
47658
+ return {
47659
+ kind: "ok",
47660
+ data: {
47661
+ diffCwd: worktreePath,
47662
+ diffTarget: forkCommit,
47663
+ baseRef: forkCommit,
47664
+ endRef: null,
47665
+ worktreePath
47666
+ }
47667
+ };
47668
+ }
47669
+ if (forkCommit && !worktreePath) {
47670
+ return {
47671
+ kind: "ok",
47672
+ data: {
47673
+ diffCwd: localPath,
47674
+ diffTarget: forkCommit,
47675
+ baseRef: forkCommit,
47676
+ endRef: null,
47677
+ worktreePath: null
47678
+ }
47679
+ };
47680
+ }
47681
+ if (worktreeBranch) {
47682
+ try {
47683
+ const mb2 = (0, import_child_process6.execFileSync)(
47684
+ "git",
47685
+ ["merge-base", baseBranch, worktreeBranch],
47686
+ { cwd: localPath, encoding: "utf-8", timeout: 5e3 }
47687
+ ).trim();
47688
+ const wtp = worktreePath && (0, import_fs7.existsSync)(worktreePath) ? worktreePath : localPath;
47689
+ return {
47690
+ kind: "ok",
47691
+ data: {
47692
+ diffCwd: wtp,
47693
+ diffTarget: mb2,
47694
+ baseRef: mb2,
47695
+ endRef: null,
47696
+ worktreePath: worktreePath && (0, import_fs7.existsSync)(worktreePath) ? worktreePath : null
47697
+ }
47698
+ };
47699
+ } catch {
47700
+ return { kind: "branch-deleted" };
47701
+ }
47702
+ }
47703
+ return { kind: "empty" };
47704
+ }
47705
+ var import_child_process6, import_fs7;
47706
+ var init_task_diff_resolver = __esm({
47707
+ "src/lib/task-diff-resolver.ts"() {
47708
+ "use strict";
47709
+ import_child_process6 = require("child_process");
47710
+ import_fs7 = require("fs");
47711
+ init_db();
47712
+ }
47713
+ });
47714
+
47715
+ // src/lib/diff-parser.ts
47716
+ function parseDiffOutput(numstat, unifiedDiff) {
47717
+ const numstatEntries = [];
47718
+ for (const line of numstat.split("\n")) {
47719
+ const trimmed = line.trim();
47720
+ if (!trimmed) continue;
47721
+ const parts = trimmed.split(" ");
47722
+ if (parts.length < 3) continue;
47723
+ const [addedStr, removedStr, ...filenameParts] = parts;
47724
+ const filename = filenameParts.join(" ");
47725
+ if (addedStr === "-" && removedStr === "-") {
47726
+ numstatEntries.push({ filename, added: 0, removed: 0, isBinary: true });
47727
+ } else {
47728
+ numstatEntries.push({
47729
+ filename,
47730
+ added: parseInt(addedStr, 10) || 0,
47731
+ removed: parseInt(removedStr, 10) || 0,
47732
+ isBinary: false
47733
+ });
47734
+ }
47735
+ }
47736
+ const DIFF_GIT_HEADER = /^diff --git a\/.+ b\/.+$/m;
47737
+ const diffHeaderRegex = /^diff --git a\/(.+) b\/(.+)$/;
47738
+ const patchMap = /* @__PURE__ */ new Map();
47739
+ if (unifiedDiff.trim()) {
47740
+ const isTruncationNeeded = unifiedDiff.length > 500 * 1024;
47741
+ const segments = unifiedDiff.split(/(?=^diff --git )/m);
47742
+ for (const segment of segments) {
47743
+ if (!segment.trim()) continue;
47744
+ const firstLine = segment.split("\n")[0];
47745
+ const match = diffHeaderRegex.exec(firstLine);
47746
+ if (!match) continue;
47747
+ const filename = match[2];
47748
+ let patch = segment;
47749
+ if (isTruncationNeeded) {
47750
+ const lines = segment.split("\n");
47751
+ if (lines.length > 200) {
47752
+ patch = lines.slice(0, 200).join("\n") + "\n... (truncated)";
47753
+ }
47754
+ }
47755
+ patchMap.set(filename, patch);
47756
+ }
47757
+ }
47758
+ const files = numstatEntries.map((entry) => ({
47759
+ filename: entry.filename,
47760
+ added: entry.added,
47761
+ removed: entry.removed,
47762
+ isBinary: entry.isBinary,
47763
+ patch: patchMap.get(entry.filename) ?? ""
47764
+ }));
47765
+ const totalAdded = files.reduce((sum, f2) => sum + f2.added, 0);
47766
+ const totalRemoved = files.reduce((sum, f2) => sum + f2.removed, 0);
47767
+ return { files, totalAdded, totalRemoved };
47768
+ }
47769
+ var init_diff_parser = __esm({
47770
+ "src/lib/diff-parser.ts"() {
47771
+ "use strict";
47772
+ }
47773
+ });
47774
+
47775
+ // src/lib/task-overview-format.ts
47776
+ function buildFallbackSummary(commitLog) {
47777
+ if (!commitLog) return null;
47778
+ const lines = commitLog.split("\n").filter(Boolean);
47779
+ if (lines.length === 0) return null;
47780
+ const first = lines[0].replace(/^[a-f0-9]+\s+/, "");
47781
+ return lines.length === 1 ? first : `${lines.length} \u4E2A\u63D0\u4EA4\uFF1A${first}`;
47782
+ }
47783
+ function buildNoteTitle(taskTitle, kind = "done") {
47784
+ const prefix = kind === "cancelled" ? "\u4EFB\u52A1\u6982\u89C8\uFF08\u5DF2\u53D6\u6D88\uFF09\uFF1A" : "\u4EFB\u52A1\u6982\u89C8\uFF1A";
47785
+ return `${prefix}${taskTitle}`.slice(0, 200);
47786
+ }
47787
+ function formatNoteContent(data, summary, generatedAt, kind = "done") {
47788
+ const intro = kind === "cancelled" ? "> \u672C\u7B14\u8BB0\u7531\u4EFB\u52A1\u53D6\u6D88\u65F6\u81EA\u52A8\u751F\u6210\uFF0C\u8BB0\u5F55\u5DF2\u4EA7\u751F\u7684\u6539\u52A8\uFF0C\u4F5C\u4E3A\u4E0B\u6B21\u91CD\u542F\u8BE5\u4EFB\u52A1\u7684\u53C2\u8003\u7ECF\u9A8C\u3002" : "> \u672C\u7B14\u8BB0\u7531\u4EFB\u52A1\u5B8C\u6210\u65F6\u81EA\u52A8\u751F\u6210\uFF0C\u8BB0\u5F55\u672C\u6B21\u4EFB\u52A1\u7684\u6539\u52A8\u6982\u89C8\uFF0C\u4FBF\u4E8E\u540E\u7EED\u590D\u76D8\u4E0E\u6392\u67E5\u3002";
47789
+ const lines = [];
47790
+ lines.push(intro);
47791
+ lines.push("");
47792
+ lines.push("## \u6539\u52A8\u6458\u8981");
47793
+ lines.push(summary ?? "\uFF08\u672A\u80FD\u751F\u6210\u6539\u52A8\u6458\u8981\uFF09");
47794
+ lines.push("");
47795
+ lines.push("## \u6587\u4EF6\u6E05\u5355");
47796
+ if (data.files.length > 0) {
47797
+ const shown = data.files.slice(0, FILE_LIST_NOTE_MAX);
47798
+ for (const f2 of shown) {
47799
+ lines.push(
47800
+ f2.isBinary ? `- \`${f2.filename}\`\uFF08\u4E8C\u8FDB\u5236\uFF09` : `- \`${f2.filename}\` (+${f2.added} / -${f2.removed})`
47801
+ );
47802
+ }
47803
+ if (data.files.length > shown.length) {
47804
+ lines.push(`- \u2026\u5176\u4F59 ${data.files.length - shown.length} \u4E2A\u6587\u4EF6`);
47805
+ }
47806
+ lines.push("");
47807
+ lines.push(`\u5171 ${data.files.length} \u4E2A\u6587\u4EF6\u3001${data.commitCount} \u4E2A\u63D0\u4EA4\u3002`);
47808
+ } else {
47809
+ lines.push(`\uFF08\u672A\u80FD\u83B7\u53D6\u7CBE\u786E\u6587\u4EF6\u6E05\u5355\uFF0C\u672C\u6B21\u7EA6 ${data.commitCount} \u4E2A\u63D0\u4EA4\u3002\uFF09`);
47810
+ }
47811
+ lines.push("");
47812
+ lines.push("## \u76F8\u5173\u9644\u4EF6\u4E0E\u53C2\u8003\u8D44\u6599");
47813
+ if (data.assets.length > 0) {
47814
+ for (const a2 of data.assets) {
47815
+ lines.push(a2.description ? `- ${a2.filename} \u2014 ${a2.description}` : `- ${a2.filename}`);
47816
+ }
47817
+ } else {
47818
+ lines.push("\uFF08\u65E0\uFF09");
47819
+ }
47820
+ lines.push("");
47821
+ lines.push("---");
47822
+ lines.push(`> \u5173\u8054\u4EFB\u52A1\uFF1A${data.taskTitle} (\`${data.taskId}\`)`);
47823
+ lines.push(`> \u9879\u76EE\uFF1A${data.projectName}`);
47824
+ lines.push(`> \u751F\u6210\u65F6\u95F4\uFF1A${generatedAt}`);
47825
+ return lines.join("\n");
47826
+ }
47827
+ var FILE_LIST_NOTE_MAX;
47828
+ var init_task_overview_format = __esm({
47829
+ "src/lib/task-overview-format.ts"() {
47830
+ "use strict";
47831
+ FILE_LIST_NOTE_MAX = 100;
47832
+ }
47833
+ });
47834
+
47835
+ // src/lib/task-overview.ts
47836
+ var task_overview_exports = {};
47837
+ __export2(task_overview_exports, {
47838
+ TASK_OVERVIEW_CATEGORY: () => TASK_OVERVIEW_CATEGORY,
47839
+ captureTaskOverview: () => captureTaskOverview
47840
+ });
47841
+ function runGit2(args, cwd, maxBuffer = 1024 * 1024) {
47842
+ try {
47843
+ return (0, import_child_process7.execFileSync)("git", args, {
47844
+ cwd,
47845
+ encoding: "utf-8",
47846
+ timeout: 3e4,
47847
+ maxBuffer,
47848
+ stdio: ["pipe", "pipe", "pipe"]
47849
+ }).trim();
47850
+ } catch {
47851
+ return null;
47852
+ }
47853
+ }
47854
+ async function gatherTaskChangeData(taskId) {
47855
+ const task = await db2.task.findUnique({
47856
+ where: { id: taskId },
47857
+ include: { project: true }
47858
+ });
47859
+ if (!task || !task.project) return null;
47860
+ const localPath = task.project.localPath ?? null;
47861
+ let files = [];
47862
+ let commitLog = null;
47863
+ let commitCount = 0;
47864
+ let diffText = null;
47865
+ let cwd = localPath || process.cwd();
47866
+ if (localPath) {
47867
+ const resolved = await resolveTaskDiffSource(taskId);
47868
+ if (resolved.kind === "ok") {
47869
+ const { diffCwd, diffTarget } = resolved.data;
47870
+ cwd = diffCwd;
47871
+ const logRange = diffTarget.includes("..") ? diffTarget : `${diffTarget}..HEAD`;
47872
+ const numstat = runGit2(["diff", "--numstat", diffTarget], diffCwd, GIT_MAX_BUFFER);
47873
+ if (numstat) {
47874
+ files = parseDiffOutput(numstat, "").files;
47875
+ }
47876
+ commitLog = runGit2(["log", "--oneline", logRange], diffCwd) || null;
47877
+ const countStr = runGit2(["rev-list", "--count", logRange], diffCwd);
47878
+ commitCount = countStr ? parseInt(countStr, 10) || 0 : 0;
47879
+ const rawDiff = runGit2(["diff", diffTarget], diffCwd, GIT_MAX_BUFFER);
47880
+ if (rawDiff) {
47881
+ diffText = rawDiff.length > DIFF_TEXT_MAX ? rawDiff.slice(0, DIFF_TEXT_MAX) + "\n...(diff truncated)" : rawDiff;
47882
+ }
47883
+ }
47884
+ }
47885
+ if (files.length === 0 && commitCount === 0) {
47886
+ const latestExec = await db2.taskExecution.findFirst({
47887
+ where: { taskId },
47888
+ orderBy: { createdAt: "desc" },
47889
+ select: { gitLog: true, worktreePath: true }
47890
+ });
47891
+ if (latestExec?.gitLog) {
47892
+ commitLog = latestExec.gitLog;
47893
+ commitCount = latestExec.gitLog.split("\n").filter(Boolean).length;
47894
+ }
47895
+ if (latestExec?.worktreePath && (0, import_fs8.existsSync)(latestExec.worktreePath)) {
47896
+ cwd = latestExec.worktreePath;
47897
+ }
47898
+ }
47899
+ if (files.length === 0 && commitCount === 0) return null;
47900
+ const assetRows = await db2.projectAsset.findMany({
47901
+ where: { taskId },
47902
+ orderBy: { createdAt: "asc" },
47903
+ select: { filename: true, description: true }
47904
+ });
47905
+ const assets = assetRows.map((a2) => ({
47906
+ filename: a2.filename,
47907
+ description: a2.description
47908
+ }));
47909
+ return {
47910
+ taskId,
47911
+ taskTitle: task.title,
47912
+ projectId: task.projectId,
47913
+ projectName: task.project.name,
47914
+ files,
47915
+ commitLog,
47916
+ commitCount,
47917
+ diffText,
47918
+ assets,
47919
+ cwd
47920
+ };
47921
+ }
47922
+ async function generateChangeSummary(data) {
47923
+ const fileListText = data.files.slice(0, FILE_LIST_PROMPT_MAX).map(
47924
+ (f2) => f2.isBinary ? `${f2.filename} (binary)` : `${f2.filename} (+${f2.added}/-${f2.removed})`
47925
+ ).join("\n") || "\uFF08\u65E0\u6587\u4EF6\u6E05\u5355\uFF09";
47926
+ const prompt = `\u4F60\u662F\u8D44\u6DF1\u5DE5\u7A0B\u5E08\u3002\u4E0B\u9762\u662F\u4E00\u4E2A\u521A\u5B8C\u6210\u7684\u5F00\u53D1\u4EFB\u52A1\u7684\u4EE3\u7801\u6539\u52A8\u4FE1\u606F\uFF0C\u8BF7\u7528\u7B80\u6D01\u4E2D\u6587\u5199\u4E00\u6BB5\u300C\u6539\u52A8\u6458\u8981\u300D\uFF1A\u8BF4\u660E\u8FD9\u6B21\u6539\u52A8\u505A\u4E86\u4EC0\u4E48\u3001\u89E3\u51B3\u4E86\u4EC0\u4E48\u95EE\u9898\u3001\u4E3B\u8981\u6D89\u53CA\u54EA\u4E9B\u6A21\u5757\u6216\u903B\u8F91\u3002\u8981\u6C42 3-6 \u53E5\u3001\u7EAF\u6587\u672C\uFF0C\u4E0D\u8981 markdown \u6807\u9898\uFF0C\u4E0D\u8981\u9010\u6761\u7F57\u5217\u6587\u4EF6\uFF08\u6587\u4EF6\u6E05\u5355\u4F1A\u53E6\u5916\u5C55\u793A\uFF09\u3002
47927
+
47928
+ \u4EFB\u52A1\u6807\u9898\uFF1A${data.taskTitle}
47929
+
47930
+ \u63D0\u4EA4\u8BB0\u5F55\uFF1A
47931
+ ${data.commitLog ?? "\uFF08\u65E0\u63D0\u4EA4\u8BB0\u5F55\uFF09"}
47932
+
47933
+ \u53D8\u66F4\u6587\u4EF6\uFF08\u5171 ${data.files.length} \u4E2A\uFF09\uFF1A
47934
+ ${fileListText}
47935
+
47936
+ diff\uFF08\u53EF\u80FD\u5DF2\u622A\u65AD\uFF09\uFF1A
47937
+ \`\`\`diff
47938
+ ${data.diffText ?? "\uFF08\u65E0 diff\uFF09"}
47939
+ \`\`\``;
47940
+ const cwd = (0, import_fs8.existsSync)(data.cwd) ? data.cwd : process.cwd();
47941
+ const result = await aiQuery(prompt, cwd, { maxTurns: 1 });
47942
+ if (result) {
47943
+ const cleaned = result.replace(/^[#*\->"'\s]+/, "").trim();
47944
+ if (cleaned) return cleaned;
47945
+ }
47946
+ return buildFallbackSummary(data.commitLog);
47947
+ }
47948
+ async function captureTaskOverview(taskId, opts = {}) {
47949
+ const kind = opts.kind ?? "done";
47950
+ let data = null;
47951
+ try {
47952
+ data = await gatherTaskChangeData(taskId);
47953
+ } catch (err) {
47954
+ console.error("[captureTaskOverview] Failed to gather change data:", err);
47955
+ return;
47956
+ }
47957
+ if (!data) {
47958
+ console.error(`[captureTaskOverview] No changes for task=${taskId.slice(0, 8)} \u2014 skip`);
47959
+ return;
47960
+ }
47961
+ const captured = data;
47962
+ void (async () => {
47963
+ try {
47964
+ const summary = await generateChangeSummary(captured);
47965
+ const generatedAt = (/* @__PURE__ */ new Date()).toISOString();
47966
+ const content = formatNoteContent(captured, summary, generatedAt, kind);
47967
+ const title = buildNoteTitle(captured.taskTitle, kind);
47968
+ const note = await db2.projectNote.create({
47969
+ data: {
47970
+ title,
47971
+ content,
47972
+ category: TASK_OVERVIEW_CATEGORY,
47973
+ projectId: captured.projectId,
47974
+ // taskId stays null so the note surfaces in the project Notes page
47975
+ // (getProjectNotes filters taskId:null). The task linkage lives as a
47976
+ // text backlink in the note body instead.
47977
+ taskId: null
47978
+ }
47979
+ });
47980
+ await syncNoteToFts(db2, { id: note.id, title: note.title, content: note.content });
47981
+ console.error(
47982
+ `[captureTaskOverview] Note created: ${note.id} for task=${taskId.slice(0, 8)}`
47983
+ );
47984
+ } catch (err) {
47985
+ console.error("[captureTaskOverview] Failed to create overview note:", err);
47986
+ }
47987
+ })();
47988
+ }
47989
+ var import_child_process7, import_fs8, TASK_OVERVIEW_CATEGORY, DIFF_TEXT_MAX, FILE_LIST_PROMPT_MAX, GIT_MAX_BUFFER;
47990
+ var init_task_overview = __esm({
47991
+ "src/lib/task-overview.ts"() {
47992
+ "use strict";
47993
+ import_child_process7 = require("child_process");
47994
+ import_fs8 = require("fs");
47995
+ init_db();
47996
+ init_fts();
47997
+ init_claude_session();
47998
+ init_task_diff_resolver();
47999
+ init_diff_parser();
48000
+ init_task_overview_format();
48001
+ TASK_OVERVIEW_CATEGORY = "\u4EFB\u52A1\u7B14\u8BB0";
48002
+ DIFF_TEXT_MAX = 12 * 1024;
48003
+ FILE_LIST_PROMPT_MAX = 60;
48004
+ GIT_MAX_BUFFER = 64 * 1024 * 1024;
48005
+ }
48006
+ });
48007
+
47578
48008
  // node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/utils.js
47579
48009
  var require_utils4 = __commonJS({
47580
48010
  "node_modules/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/utils.js"(exports2) {
@@ -49127,8 +49557,8 @@ async function updateTaskStatus(taskId, status) {
49127
49557
  });
49128
49558
  if (status === "DONE" && !task.baseBranch && task.project?.localPath) {
49129
49559
  try {
49130
- const { execFileSync: execFileSync5 } = await import("child_process");
49131
- const headCommit = execFileSync5(
49560
+ const { execFileSync: execFileSync7 } = await import("child_process");
49561
+ const headCommit = execFileSync7(
49132
49562
  "git",
49133
49563
  ["rev-parse", "HEAD"],
49134
49564
  { cwd: task.project.localPath, encoding: "utf-8", timeout: 5e3 }
@@ -49154,6 +49584,11 @@ async function updateTaskStatus(taskId, status) {
49154
49584
  });
49155
49585
  }).catch(() => {
49156
49586
  });
49587
+ Promise.resolve().then(() => (init_task_overview(), task_overview_exports)).then(({ captureTaskOverview: captureTaskOverview2 }) => {
49588
+ captureTaskOverview2(taskId).catch(() => {
49589
+ });
49590
+ }).catch(() => {
49591
+ });
49157
49592
  }
49158
49593
  if (status === "DONE" || status === "CANCELLED") {
49159
49594
  try {
@@ -49163,6 +49598,14 @@ async function updateTaskStatus(taskId, status) {
49163
49598
  log.error("PTY session destroy failed", error48, { taskId });
49164
49599
  }
49165
49600
  }
49601
+ if (status === "CANCELLED" && task.project?.localPath) {
49602
+ try {
49603
+ const { captureTaskOverview: captureTaskOverview2 } = await Promise.resolve().then(() => (init_task_overview(), task_overview_exports));
49604
+ await captureTaskOverview2(taskId, { kind: "cancelled" });
49605
+ } catch (error48) {
49606
+ log.error("Task overview capture failed", error48, { taskId });
49607
+ }
49608
+ }
49166
49609
  if (status === "CANCELLED" && task.project?.localPath) {
49167
49610
  try {
49168
49611
  await removeWorktree(task.project.localPath, taskId);
@@ -49273,20 +49716,20 @@ async function getArchivedTasks(projectId) {
49273
49716
  });
49274
49717
  }
49275
49718
  async function checkWorktreeClean(taskId) {
49276
- const { execFileSync: execFileSync5 } = await import("child_process");
49277
- const { existsSync: existsSync10 } = await import("fs");
49719
+ const { execFileSync: execFileSync7 } = await import("child_process");
49720
+ const { existsSync: existsSync12 } = await import("fs");
49278
49721
  const task = await db2.task.findUnique({ where: { id: taskId } });
49279
49722
  const execution = await db2.taskExecution.findFirst({
49280
49723
  where: { taskId },
49281
49724
  orderBy: { createdAt: "desc" }
49282
49725
  });
49283
- if (!execution?.worktreePath || !existsSync10(execution.worktreePath)) {
49726
+ if (!execution?.worktreePath || !existsSync12(execution.worktreePath)) {
49284
49727
  return { clean: true, files: [], hasCommits: false, lastCommitMessage: null, commitLog: [], hasWorktree: false };
49285
49728
  }
49286
49729
  const cwd = execution.worktreePath;
49287
49730
  const baseBranch = task?.baseBranch || "main";
49288
49731
  try {
49289
- const status = execFileSync5(
49732
+ const status = execFileSync7(
49290
49733
  "git",
49291
49734
  ["status", "--porcelain"],
49292
49735
  { cwd, encoding: "utf-8", timeout: 5e3 }
@@ -49297,24 +49740,24 @@ async function checkWorktreeClean(taskId) {
49297
49740
  let lastCommitMessage = null;
49298
49741
  let commitLog = [];
49299
49742
  try {
49300
- const forkPoint = execFileSync5(
49743
+ const forkPoint = execFileSync7(
49301
49744
  "git",
49302
49745
  ["merge-base", baseBranch, "HEAD"],
49303
49746
  { cwd, encoding: "utf-8", timeout: 5e3 }
49304
49747
  ).trim();
49305
- const commitCount = execFileSync5(
49748
+ const commitCount = execFileSync7(
49306
49749
  "git",
49307
49750
  ["rev-list", "--count", `${forkPoint}..HEAD`],
49308
49751
  { cwd, encoding: "utf-8", timeout: 5e3 }
49309
49752
  ).trim();
49310
49753
  hasCommits = parseInt(commitCount, 10) > 0;
49311
49754
  if (hasCommits) {
49312
- lastCommitMessage = execFileSync5(
49755
+ lastCommitMessage = execFileSync7(
49313
49756
  "git",
49314
49757
  ["log", "-1", "--format=%B"],
49315
49758
  { cwd, encoding: "utf-8", timeout: 5e3 }
49316
49759
  ).trim();
49317
- const log2 = execFileSync5(
49760
+ const log2 = execFileSync7(
49318
49761
  "git",
49319
49762
  ["log", "--oneline", `${forkPoint}..HEAD`],
49320
49763
  { cwd, encoding: "utf-8", timeout: 5e3 }
@@ -49329,23 +49772,23 @@ async function checkWorktreeClean(taskId) {
49329
49772
  }
49330
49773
  }
49331
49774
  async function commitWorktreeChanges(taskId, message) {
49332
- const { execFileSync: execFileSync5 } = await import("child_process");
49333
- const { existsSync: existsSync10 } = await import("fs");
49775
+ const { execFileSync: execFileSync7 } = await import("child_process");
49776
+ const { existsSync: existsSync12 } = await import("fs");
49334
49777
  const execution = await db2.taskExecution.findFirst({
49335
49778
  where: { taskId },
49336
49779
  orderBy: { createdAt: "desc" }
49337
49780
  });
49338
- if (!execution?.worktreePath || !existsSync10(execution.worktreePath)) {
49781
+ if (!execution?.worktreePath || !existsSync12(execution.worktreePath)) {
49339
49782
  throw new Error("No active worktree for this task");
49340
49783
  }
49341
49784
  const cwd = execution.worktreePath;
49342
- execFileSync5("git", ["add", "-A"], { cwd, timeout: 1e4 });
49343
- const status = execFileSync5("git", ["status", "--porcelain"], { cwd, encoding: "utf-8", timeout: 5e3 }).trim();
49785
+ execFileSync7("git", ["add", "-A"], { cwd, timeout: 1e4 });
49786
+ const status = execFileSync7("git", ["status", "--porcelain"], { cwd, encoding: "utf-8", timeout: 5e3 }).trim();
49344
49787
  if (!status) {
49345
49788
  throw new Error("No changes to commit");
49346
49789
  }
49347
- execFileSync5("git", ["commit", "-m", message], { cwd, encoding: "utf-8", timeout: 15e3 });
49348
- const hash2 = execFileSync5("git", ["rev-parse", "--short", "HEAD"], { cwd, encoding: "utf-8", timeout: 5e3 }).trim();
49790
+ execFileSync7("git", ["commit", "-m", message], { cwd, encoding: "utf-8", timeout: 15e3 });
49791
+ const hash2 = execFileSync7("git", ["rev-parse", "--short", "HEAD"], { cwd, encoding: "utf-8", timeout: 5e3 }).trim();
49349
49792
  return { hash: hash2 };
49350
49793
  }
49351
49794
  async function getTaskOverview(taskId) {
@@ -49558,8 +50001,8 @@ var projectTools = {
49558
50001
 
49559
50002
  // src/mcp/tools/task-tools.ts
49560
50003
  init_zod();
49561
- var import_child_process6 = require("child_process");
49562
- var import_fs7 = require("fs");
50004
+ var import_child_process8 = require("child_process");
50005
+ var import_fs9 = require("fs");
49563
50006
  var import_path11 = require("path");
49564
50007
 
49565
50008
  // src/lib/config-reader.ts
@@ -49736,7 +50179,7 @@ var taskTools = {
49736
50179
  const project = await db.project.findUnique({ where: { id: args.projectId }, select: { localPath: true } });
49737
50180
  if (project?.localPath) {
49738
50181
  try {
49739
- baseBranch = (0, import_child_process6.execFileSync)("git", ["branch", "--show-current"], {
50182
+ baseBranch = (0, import_child_process8.execFileSync)("git", ["branch", "--show-current"], {
49740
50183
  cwd: project.localPath,
49741
50184
  encoding: "utf-8",
49742
50185
  timeout: 5e3
@@ -49767,20 +50210,20 @@ var taskTools = {
49767
50210
  let updatedDesc = null;
49768
50211
  if (args.references && args.references.length > 0) {
49769
50212
  const assetsDir = (0, import_path11.join)(MCP_PROJECT_ROOT, "data", "assets", args.projectId);
49770
- (0, import_fs7.mkdirSync)(assetsDir, { recursive: true });
50213
+ (0, import_fs9.mkdirSync)(assetsDir, { recursive: true });
49771
50214
  for (const filePath of args.references) {
49772
50215
  try {
49773
- if (!(0, import_fs7.existsSync)(filePath)) continue;
49774
- const stat = (0, import_fs7.statSync)(filePath);
50216
+ if (!(0, import_fs9.existsSync)(filePath)) continue;
50217
+ const stat = (0, import_fs9.statSync)(filePath);
49775
50218
  if (!stat.isFile()) continue;
49776
50219
  const isCache = isAssistantCachePath(filePath);
49777
50220
  let filename = isCache ? stripCacheUuidSuffix((0, import_path11.basename)(filePath)) : (0, import_path11.basename)(filePath);
49778
- if ((0, import_fs7.existsSync)((0, import_path11.join)(assetsDir, filename))) {
50221
+ if ((0, import_fs9.existsSync)((0, import_path11.join)(assetsDir, filename))) {
49779
50222
  const ext = (0, import_path11.extname)(filename);
49780
50223
  const base = (0, import_path11.basename)(filename, ext);
49781
50224
  if (isCache) {
49782
50225
  let counter = 1;
49783
- while ((0, import_fs7.existsSync)((0, import_path11.join)(assetsDir, `${base} (${counter})${ext}`))) {
50226
+ while ((0, import_fs9.existsSync)((0, import_path11.join)(assetsDir, `${base} (${counter})${ext}`))) {
49784
50227
  counter++;
49785
50228
  }
49786
50229
  filename = `${base} (${counter})${ext}`;
@@ -49789,7 +50232,7 @@ var taskTools = {
49789
50232
  }
49790
50233
  }
49791
50234
  const dest = (0, import_path11.join)(assetsDir, filename);
49792
- (0, import_fs7.copyFileSync)(filePath, dest);
50235
+ (0, import_fs9.copyFileSync)(filePath, dest);
49793
50236
  await db.projectAsset.create({
49794
50237
  data: {
49795
50238
  filename,
@@ -50272,52 +50715,7 @@ var knowledgeTools = {
50272
50715
  init_zod();
50273
50716
  var fs4 = __toESM(require("node:fs"));
50274
50717
  var path5 = __toESM(require("node:path"));
50275
-
50276
- // src/lib/fts.ts
50277
- async function searchNotes(db4, projectId, query) {
50278
- const trimmed = query.trim();
50279
- if (!trimmed) return [];
50280
- if (trimmed.length < 3) {
50281
- return db4.$queryRawUnsafe(
50282
- `SELECT id as note_id, title, content FROM "ProjectNote"
50283
- WHERE "projectId" = ? AND (title LIKE ? OR content LIKE ?)
50284
- LIMIT 20`,
50285
- projectId,
50286
- `%${trimmed}%`,
50287
- `%${trimmed}%`
50288
- );
50289
- }
50290
- return db4.$queryRawUnsafe(
50291
- `SELECT f.note_id, f.title, f.content
50292
- FROM notes_fts f
50293
- JOIN "ProjectNote" n ON n.id = f.note_id
50294
- WHERE f.notes_fts MATCH ? AND n."projectId" = ?
50295
- ORDER BY rank
50296
- LIMIT 20`,
50297
- trimmed,
50298
- projectId
50299
- );
50300
- }
50301
- async function syncNoteToFts(db4, note) {
50302
- await db4.$executeRawUnsafe(
50303
- "DELETE FROM notes_fts WHERE note_id = ?",
50304
- note.id
50305
- );
50306
- await db4.$executeRawUnsafe(
50307
- "INSERT INTO notes_fts(note_id, title, content) VALUES (?, ?, ?)",
50308
- note.id,
50309
- note.title,
50310
- note.content
50311
- );
50312
- }
50313
- async function deleteNoteFromFts(db4, noteId) {
50314
- await db4.$executeRawUnsafe(
50315
- "DELETE FROM notes_fts WHERE note_id = ?",
50316
- noteId
50317
- );
50318
- }
50319
-
50320
- // src/mcp/tools/note-asset-tools.ts
50718
+ init_fts();
50321
50719
  var manageNotesSchema = external_exports.object({
50322
50720
  action: external_exports.enum(["create", "update", "delete", "get", "list", "search"]),
50323
50721
  projectId: external_exports.string().optional(),