tower-studio 0.2.6 → 0.2.8

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 (314) 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 +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +43 -43
  13. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  18. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  19. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  20. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  22. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/standalone/.next/server/app/api/adapters/test/route.js +3 -2
  24. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js +1 -2
  28. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +3 -2
  30. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/internal/assistant/route.js +1 -2
  32. package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js +3 -2
  34. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js +2 -3
  36. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js +3 -2
  38. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js +2 -3
  40. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js +2 -3
  42. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js +2 -3
  44. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +3 -4
  46. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/index.html +1 -1
  48. package/.next/standalone/.next/server/app/index.rsc +14 -14
  49. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  50. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
  51. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  52. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +9 -9
  53. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  54. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  55. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +75 -75
  56. package/.next/standalone/.next/server/app/missions/page.js +5 -5
  57. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  60. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +43 -43
  61. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/onboarding.html +1 -1
  64. package/.next/standalone/.next/server/app/onboarding.rsc +16 -16
  65. package/.next/standalone/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
  66. package/.next/standalone/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  67. package/.next/standalone/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
  68. package/.next/standalone/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  69. package/.next/standalone/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  70. package/.next/standalone/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  71. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  72. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +43 -43
  73. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  74. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  75. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  76. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +56 -56
  77. package/.next/standalone/.next/server/app/settings/page.js +3 -3
  78. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/settings.html +1 -1
  81. package/.next/standalone/.next/server/app/settings.rsc +16 -16
  82. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +16 -16
  83. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  84. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  85. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  86. package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  87. package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  88. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  89. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +100 -100
  90. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  93. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +82 -82
  94. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  97. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +77 -77
  98. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  101. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +72 -72
  102. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +3 -3
  103. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  104. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  105. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  106. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +43 -43
  107. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  108. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  110. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +82 -82
  111. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  112. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  113. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  114. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +86 -86
  115. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +5 -5
  116. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  117. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  119. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +61 -61
  120. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  121. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0h5yr8p.js +1 -1
  123. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
  124. package/.next/standalone/.next/server/chunks/[root-of-the-server]__00mjz~7._.js +3 -0
  125. package/.next/standalone/.next/server/chunks/[root-of-the-server]__028ucbo._.js +4 -0
  126. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03gi3ue._.js +4 -0
  127. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07f7~6u._.js +4 -0
  128. package/.next/standalone/.next/server/chunks/[root-of-the-server]__09p152b._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_90467._.js +3 -0
  130. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b-ib~7._.js +3 -0
  131. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c513um._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d~z6xs._.js +4 -0
  133. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e44k3f._.js +20 -0
  134. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h.z9fm._.js +11 -0
  135. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lioghc._.js +3 -0
  136. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0mw.9lg._.js +3 -0
  137. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ogh_qu._.js +20 -0
  138. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0tys9pv._.js +3 -0
  139. package/.next/standalone/.next/server/chunks/[root-of-the-server]__12c9noi._.js +3 -0
  140. package/.next/standalone/.next/server/chunks/{_0trog_r._.js → _0_eodxe._.js} +1 -1
  141. package/.next/standalone/.next/server/chunks/_0_w835g._.js +4 -0
  142. package/.next/standalone/.next/server/chunks/{src_01ztl3b._.js → src_0bkvm8c._.js} +2 -2
  143. package/.next/standalone/.next/server/chunks/src_0weytpz._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/src_lib_0ba0ntr._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/src_lib_ai_0q-~me1._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
  148. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.ukame._.js +30 -0
  150. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__006_qh0._.js +1 -1
  151. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01j8ix6._.js +30 -0
  152. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02px.0y._.js +1 -1
  153. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03ebsif._.js +3 -3
  154. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0-yld.d._.js → [root-of-the-server]__08901f9._.js} +2 -2
  155. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08n5qbf._.js +1 -1
  156. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ca_ueb._.js +30 -0
  157. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dsdplu._.js +30 -0
  158. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l43.5g._.js +1 -1
  159. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0nwue~m._.js → [root-of-the-server]__0miur_1._.js} +2 -2
  160. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n.cuy2._.js +30 -0
  161. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nbj.ml._.js +30 -0
  162. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ojv-d0._.js +3 -0
  163. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pm2~fu._.js +30 -0
  164. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ps55l6._.js +1 -1
  165. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ribsk4._.js +1 -1
  166. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rjue04._.js +30 -0
  167. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0souuv~._.js +3 -0
  168. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tc6uh2._.js +30 -0
  169. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0v2eslh._.js +30 -0
  170. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wjg_.n._.js +1 -1
  171. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wlmzzq._.js +30 -0
  172. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wvyks.._.js +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zbmoit._.js +1 -1
  174. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~03tpv._.js +3 -0
  175. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~a-emb._.js +30 -0
  176. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0c4.z1s._.js → [root-of-the-server]__121lss.._.js} +2 -2
  177. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vdw4w._.js +3 -0
  178. package/.next/standalone/.next/server/chunks/ssr/{_03xwww2._.js → _0.knmg-._.js} +2 -2
  179. package/.next/standalone/.next/server/chunks/ssr/{_08t2xag._.js → _0.oe3b8._.js} +2 -2
  180. package/.next/standalone/.next/server/chunks/ssr/_04b71ua._.js +1 -1
  181. package/.next/standalone/.next/server/chunks/ssr/_05h.8a~._.js +1 -1
  182. package/.next/standalone/.next/server/chunks/ssr/_05unqgy._.js +7 -0
  183. package/.next/standalone/.next/server/chunks/ssr/_0_l8.dg._.js +1 -1
  184. package/.next/standalone/.next/server/chunks/ssr/{_0f8jvpw._.js → _0_q~7z7._.js} +1 -1
  185. package/.next/standalone/.next/server/chunks/ssr/_0a2m~cj._.js +7 -0
  186. package/.next/standalone/.next/server/chunks/ssr/{_0i2usny._.js → _0c-49y3._.js} +1 -1
  187. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  188. package/.next/standalone/.next/server/chunks/ssr/{_0vqyzrr._.js → _0d2cdox._.js} +2 -2
  189. package/.next/standalone/.next/server/chunks/ssr/_0ds6nk2._.js +1 -1
  190. package/.next/standalone/.next/server/chunks/ssr/{_0rfo51k._.js → _0fq4yrr._.js} +2 -2
  191. package/.next/standalone/.next/server/chunks/ssr/_0i4__mf._.js +1 -1
  192. package/.next/standalone/.next/server/chunks/ssr/{_054w82_._.js → _0icu6m~._.js} +2 -2
  193. package/.next/standalone/.next/server/chunks/ssr/_0ihq._v._.js +1 -1
  194. package/.next/standalone/.next/server/chunks/ssr/{_00d1y-k._.js → _0kx.c-s._.js} +2 -2
  195. package/.next/standalone/.next/server/chunks/ssr/{_0ah80pn._.js → _0niubv5._.js} +1 -1
  196. package/.next/standalone/.next/server/chunks/ssr/{_0fri5n~._.js → _0pu8x.f._.js} +2 -2
  197. package/.next/standalone/.next/server/chunks/ssr/_0r9w-k8._.js +1 -1
  198. package/.next/standalone/.next/server/chunks/ssr/{_0_gqtgq._.js → _0rbai5c._.js} +1 -1
  199. package/.next/standalone/.next/server/chunks/ssr/_0rbctq7._.js +1 -1
  200. package/.next/standalone/.next/server/chunks/ssr/_0rt8hus._.js +1 -1
  201. package/.next/standalone/.next/server/chunks/ssr/_0vnfnib._.js +7 -0
  202. package/.next/standalone/.next/server/chunks/ssr/{_0_~ftjv._.js → _0xvsyc0._.js} +2 -2
  203. package/.next/standalone/.next/server/chunks/ssr/{_0ep3sg_._.js → _0y-7tle._.js} +1 -1
  204. package/.next/standalone/.next/server/chunks/ssr/{_049.box._.js → _0zgu282._.js} +1 -1
  205. package/.next/standalone/.next/server/chunks/ssr/{_086yn8o._.js → _0zszi6-._.js} +1 -1
  206. package/.next/standalone/.next/server/chunks/ssr/_0~80adm._.js +3 -3
  207. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +3 -0
  208. package/.next/standalone/.next/server/chunks/ssr/src_13jha60._.js +1 -1
  209. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  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_08n755q._.js → src_lib_07rspg0._.js} +1 -1
  218. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0tb2yya._.js → src_lib_0_8frs_._.js} +1 -1
  219. package/.next/standalone/.next/server/chunks/ssr/{src_lib_123jf_a._.js → src_lib_0fjk3hr._.js} +1 -1
  220. package/.next/standalone/.next/server/chunks/ssr/{src_lib_12ulcxj._.js → src_lib_0g-92s-._.js} +1 -1
  221. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  222. package/.next/standalone/.next/server/pages/404.html +1 -1
  223. package/.next/standalone/.next/server/pages/500.html +1 -1
  224. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  225. package/.next/standalone/.next/server/server-reference-manifest.json +307 -307
  226. package/.next/standalone/.next/static/chunks/000k30wpair3e.js +5 -0
  227. package/.next/standalone/.next/static/chunks/005169or2nxlh.js +1 -0
  228. package/.next/standalone/.next/static/chunks/{0mfgulw-d49o9.js → 04uepvk5f~_a-.js} +1 -1
  229. package/.next/standalone/.next/static/chunks/{0nrbltth-7m~e.js → 07vas3ezrfrjg.js} +1 -1
  230. package/.next/standalone/.next/static/chunks/{0fovq74l0wh7c.js → 087l367c1psb6.js} +1 -1
  231. package/.next/standalone/.next/static/chunks/{0ee.~~ae-vl_q.js → 09m-rcwwlggjy.js} +1 -1
  232. package/.next/standalone/.next/static/chunks/{06shpikm5rcmu.js → 0h1-tehkx05kz.js} +1 -1
  233. package/.next/standalone/.next/static/chunks/0hueiuk3kjujl.js +5 -0
  234. package/.next/standalone/.next/static/chunks/0ikej72py2xo3.js +1 -0
  235. package/.next/standalone/.next/static/chunks/0lx08u-wp-gt6.js +2 -0
  236. package/.next/standalone/.next/static/chunks/0mu8uzvw4gvpf.js +1 -0
  237. package/.next/standalone/.next/static/chunks/{0r7jm27~cp-vs.js → 0ow7ynd7g7ptv.js} +1 -1
  238. package/.next/standalone/.next/static/chunks/{0v9ahxdsn0mse.js → 0szduy0e92e5g.js} +1 -1
  239. package/.next/standalone/.next/static/chunks/{0jscst0zjd2az.js → 0szie_5oyakv1.js} +1 -1
  240. package/.next/standalone/.next/static/chunks/{0m2lubto0vt0x.js → 0ur-499l_2jrc.js} +1 -1
  241. package/.next/standalone/.next/static/chunks/{0hxgzql5.szyz.js → 0xs0yzxjkoeas.js} +1 -1
  242. package/.next/standalone/.next/static/chunks/{07i~~ygu~oi26.js → 0ynbql~9oq0av.js} +1 -1
  243. package/.next/standalone/.next/static/chunks/{04-7c5m91nvj1.js → 0~88n47ys3due.js} +1 -1
  244. package/.next/standalone/.next/static/chunks/{186ahmq856rfj.js → 10nil20v3q7~..js} +1 -1
  245. package/.next/standalone/.next/static/chunks/12rh72_2o79jv.js +1 -0
  246. package/.next/standalone/.next/static/chunks/156si6w7d-_ct.js +5 -0
  247. package/.next/standalone/package.json +1 -2
  248. package/dist/mcp-server.cjs +257 -61
  249. package/package.json +1 -2
  250. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.9mj3v._.js +0 -4
  251. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05353yb._.js +0 -4
  252. package/.next/standalone/.next/server/chunks/[root-of-the-server]__09h3i6m._.js +0 -4
  253. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_a8-jq._.js +0 -3
  254. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_mbhor._.js +0 -3
  255. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0dsv3wl._.js +0 -4
  256. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jmqy_3._.js +0 -3
  257. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j~qauc._.js +0 -4
  258. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nwxhai._.js +0 -3
  259. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o4z8qp._.js +0 -3
  260. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0p_ii~p._.js +0 -3
  261. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0puw1af._.js +0 -20
  262. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0py_jdb._.js +0 -3
  263. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qie1gs._.js +0 -11
  264. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qz9-me._.js +0 -3
  265. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0w2w3x.._.js +0 -20
  266. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.5rcav._.js +0 -30
  267. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05kq890._.js +0 -30
  268. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__079.nog._.js +0 -3
  269. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gaa~xc._.js +0 -30
  270. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gcf4k3._.js +0 -30
  271. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ghfuuv._.js +0 -30
  272. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k3isnk._.js +0 -3
  273. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0q7ho54._.js +0 -30
  274. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qe~p-n._.js +0 -30
  275. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tf4zp_._.js +0 -30
  276. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vh-egg._.js +0 -3
  277. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y.nw7l._.js +0 -30
  278. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11bequ2._.js +0 -30
  279. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11ko84j._.js +0 -30
  280. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12pnl8n._.js +0 -30
  281. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13k4vkg._.js +0 -3
  282. package/.next/standalone/.next/server/chunks/ssr/_0-pqb_c._.js +0 -7
  283. package/.next/standalone/.next/server/chunks/ssr/_05-r00y._.js +0 -7
  284. package/.next/standalone/.next/server/chunks/ssr/_0h_~oum._.js +0 -7
  285. package/.next/standalone/.next/server/chunks/ssr/src_095o8x6._.js +0 -3
  286. package/.next/standalone/.next/static/chunks/0.zipr1bga3lu.js +0 -1
  287. package/.next/standalone/.next/static/chunks/037-verumdykv.js +0 -5
  288. package/.next/standalone/.next/static/chunks/082cedbq4pp.-.js +0 -1
  289. package/.next/standalone/.next/static/chunks/089ktlh~nim1x.js +0 -1
  290. package/.next/standalone/.next/static/chunks/0m~ltp.wfnbf7.js +0 -5
  291. package/.next/standalone/.next/static/chunks/0tk-ju9xhoh68.js +0 -5
  292. package/.next/standalone/.next/static/chunks/0w9x-ap4dcwy..js +0 -1
  293. package/.next/standalone/.next/static/chunks/17cayeebhpt~w.js +0 -2
  294. package/src/mcp/db.ts +0 -11
  295. package/src/mcp/index.ts +0 -15
  296. package/src/mcp/server.ts +0 -52
  297. package/src/mcp/tools/__tests__/label-tools.test.ts +0 -140
  298. package/src/mcp/tools/__tests__/project-tools.test.ts +0 -182
  299. package/src/mcp/tools/__tests__/report-tools.test.ts +0 -212
  300. package/src/mcp/tools/__tests__/task-tools.test.ts +0 -418
  301. package/src/mcp/tools/__tests__/terminal-tools.test.ts +0 -318
  302. package/src/mcp/tools/__tests__/workspace-tools.test.ts +0 -146
  303. package/src/mcp/tools/knowledge-tools.ts +0 -100
  304. package/src/mcp/tools/label-tools.ts +0 -70
  305. package/src/mcp/tools/note-asset-tools.ts +0 -271
  306. package/src/mcp/tools/project-tools.ts +0 -79
  307. package/src/mcp/tools/report-tools.ts +0 -220
  308. package/src/mcp/tools/search-tools.ts +0 -32
  309. package/src/mcp/tools/task-tools.ts +0 -272
  310. package/src/mcp/tools/terminal-tools.ts +0 -154
  311. package/src/mcp/tools/workspace-tools.ts +0 -73
  312. /package/.next/standalone/.next/static/{VGoiH5uRfCRm6SKXNPZoz → 7DBkEq_6oXffs_C5TFLBR}/_buildManifest.js +0 -0
  313. /package/.next/standalone/.next/static/{VGoiH5uRfCRm6SKXNPZoz → 7DBkEq_6oXffs_C5TFLBR}/_clientMiddlewareManifest.js +0 -0
  314. /package/.next/standalone/.next/static/{VGoiH5uRfCRm6SKXNPZoz → 7DBkEq_6oXffs_C5TFLBR}/_ssgManifest.js +0 -0
@@ -1,318 +0,0 @@
1
- import { vi, describe, it, expect, beforeAll, beforeEach } from "vitest";
2
-
3
- // Mock db before any imports
4
- vi.mock("../../db", () => ({
5
- db: {
6
- taskExecution: {
7
- findFirst: vi.fn(),
8
- },
9
- },
10
- }));
11
-
12
- // Mock global.fetch before any imports
13
- const mockFetch = vi.fn();
14
- global.fetch = mockFetch;
15
-
16
- import { db } from "../../db";
17
- import { terminalTools } from "../terminal-tools";
18
-
19
- const mockDb = db as {
20
- taskExecution: {
21
- findFirst: ReturnType<typeof vi.fn>;
22
- };
23
- };
24
-
25
- // Helper to create mock fetch response
26
- function mockFetchResponse(status: number, data: unknown): Response {
27
- return {
28
- ok: status >= 200 && status < 400,
29
- status,
30
- json: () => Promise.resolve(data),
31
- } as unknown as Response;
32
- }
33
-
34
- // Valid CUID-format task ID for tests
35
- const VALID_TASK_ID = "cjldlkfxz0000ld08001abcde";
36
-
37
- describe("terminal-tools", () => {
38
- beforeAll(() => {
39
- // Ensure PORT is set for bridge URL
40
- process.env.PORT = "3000";
41
- });
42
-
43
- beforeEach(() => {
44
- vi.clearAllMocks();
45
- });
46
-
47
- describe("CUID validation", () => {
48
- it("returns error immediately for invalid taskId without calling fetch", async () => {
49
- const result = await terminalTools.get_task_terminal_output.handler({ taskId: "invalid" });
50
-
51
- expect(mockFetch).not.toHaveBeenCalled();
52
- expect(result).toMatchObject({
53
- error: expect.stringContaining("Invalid taskId"),
54
- taskId: "invalid",
55
- });
56
- });
57
-
58
- it("returns error for numeric-looking taskId", async () => {
59
- const result = await terminalTools.get_task_terminal_output.handler({ taskId: "12345" });
60
-
61
- expect(mockFetch).not.toHaveBeenCalled();
62
- expect(result).toMatchObject({ error: expect.stringContaining("Invalid taskId") });
63
- });
64
-
65
- it("returns error for taskId with hyphens (not CUID format)", async () => {
66
- const result = await terminalTools.send_task_terminal_input.handler({
67
- taskId: "not-a-cuid-format",
68
- text: "hello",
69
- });
70
-
71
- expect(mockFetch).not.toHaveBeenCalled();
72
- expect(result).toMatchObject({ error: expect.stringContaining("Invalid taskId") });
73
- });
74
- });
75
-
76
- describe("start_task_execution", () => {
77
- it("POSTs to /{taskId}/start and returns ok: true with merged data on success", async () => {
78
- const mockData = { executionId: "exec1", worktreePath: "/tmp/wt" };
79
- mockFetch.mockResolvedValue(mockFetchResponse(200, mockData));
80
-
81
- const result = await terminalTools.start_task_execution.handler({
82
- taskId: VALID_TASK_ID,
83
- prompt: "do something",
84
- });
85
-
86
- expect(mockFetch).toHaveBeenCalledOnce();
87
- const [url, init] = mockFetch.mock.calls[0];
88
- expect(url).toContain(`/api/internal/terminal/${VALID_TASK_ID}/start`);
89
- expect(init.method).toBe("POST");
90
- expect(JSON.parse(init.body)).toEqual({ prompt: "do something" });
91
-
92
- expect(result).toMatchObject({ ok: true, executionId: "exec1", worktreePath: "/tmp/wt" });
93
- });
94
-
95
- it("returns error with status on non-ok response", async () => {
96
- const errData = { error: "Task not found" };
97
- mockFetch.mockResolvedValue(mockFetchResponse(404, errData));
98
-
99
- const result = await terminalTools.start_task_execution.handler({
100
- taskId: VALID_TASK_ID,
101
- prompt: "do something",
102
- });
103
-
104
- expect(result).toMatchObject({ error: "Task not found", status: 404 });
105
- });
106
-
107
- it("uses empty string as default prompt when not provided", async () => {
108
- mockFetch.mockResolvedValue(mockFetchResponse(200, { executionId: "exec1" }));
109
-
110
- await terminalTools.start_task_execution.handler({ taskId: VALID_TASK_ID });
111
-
112
- const [, init] = mockFetch.mock.calls[0];
113
- expect(JSON.parse(init.body)).toEqual({ prompt: "" });
114
- });
115
- });
116
-
117
- describe("get_task_terminal_output", () => {
118
- it("GETs /{taskId}/buffer?lines=N and returns lines/total/killed on 200", async () => {
119
- const mockData = {
120
- taskId: VALID_TASK_ID,
121
- lines: ["line1", "line2"],
122
- total: 2,
123
- killed: false,
124
- };
125
- mockFetch.mockResolvedValue(mockFetchResponse(200, mockData));
126
-
127
- const result = await terminalTools.get_task_terminal_output.handler({
128
- taskId: VALID_TASK_ID,
129
- lines: 20,
130
- });
131
-
132
- expect(mockFetch).toHaveBeenCalledOnce();
133
- const [url] = mockFetch.mock.calls[0];
134
- expect(url).toContain(`/api/internal/terminal/${VALID_TASK_ID}/buffer?lines=20`);
135
-
136
- expect(result).toEqual({
137
- taskId: VALID_TASK_ID,
138
- lines: ["line1", "line2"],
139
- total: 2,
140
- killed: false,
141
- });
142
- });
143
-
144
- it("returns 'No active terminal session' error on 404", async () => {
145
- mockFetch.mockResolvedValue(mockFetchResponse(404, {}));
146
-
147
- const result = await terminalTools.get_task_terminal_output.handler({
148
- taskId: VALID_TASK_ID,
149
- lines: 10,
150
- });
151
-
152
- expect(result).toMatchObject({
153
- error: "No active terminal session for this task",
154
- taskId: VALID_TASK_ID,
155
- });
156
- });
157
-
158
- it("uses default lines=50 when lines param not provided", async () => {
159
- mockFetch.mockResolvedValue(
160
- mockFetchResponse(200, { taskId: VALID_TASK_ID, lines: [], total: 0, killed: false })
161
- );
162
-
163
- await terminalTools.get_task_terminal_output.handler({ taskId: VALID_TASK_ID });
164
-
165
- const [url] = mockFetch.mock.calls[0];
166
- expect(url).toContain("buffer?lines=50");
167
- });
168
- });
169
-
170
- describe("send_task_terminal_input", () => {
171
- it("POSTs to /{taskId}/input with text body and returns ok: true on success", async () => {
172
- mockFetch.mockResolvedValue(mockFetchResponse(200, {}));
173
-
174
- const result = await terminalTools.send_task_terminal_input.handler({
175
- taskId: VALID_TASK_ID,
176
- text: "hello\n",
177
- });
178
-
179
- expect(mockFetch).toHaveBeenCalledOnce();
180
- const [url, init] = mockFetch.mock.calls[0];
181
- expect(url).toContain(`/api/internal/terminal/${VALID_TASK_ID}/input`);
182
- expect(init.method).toBe("POST");
183
- expect(JSON.parse(init.body)).toEqual({ text: "hello\n" });
184
-
185
- expect(result).toMatchObject({ ok: true, taskId: VALID_TASK_ID });
186
- });
187
-
188
- it("returns 'No active terminal session' error on 404", async () => {
189
- mockFetch.mockResolvedValue(mockFetchResponse(404, {}));
190
-
191
- const result = await terminalTools.send_task_terminal_input.handler({
192
- taskId: VALID_TASK_ID,
193
- text: "hello",
194
- });
195
-
196
- expect(result).toMatchObject({
197
- error: "No active terminal session for this task",
198
- taskId: VALID_TASK_ID,
199
- });
200
- });
201
-
202
- it("returns 'Terminal session has exited' error on 410", async () => {
203
- mockFetch.mockResolvedValue(mockFetchResponse(410, {}));
204
-
205
- const result = await terminalTools.send_task_terminal_input.handler({
206
- taskId: VALID_TASK_ID,
207
- text: "hello",
208
- });
209
-
210
- expect(result).toMatchObject({
211
- error: "Terminal session has exited",
212
- taskId: VALID_TASK_ID,
213
- });
214
- });
215
- });
216
-
217
- describe("get_task_execution_status", () => {
218
- it("returns error when no execution found in db", async () => {
219
- mockDb.taskExecution.findFirst.mockResolvedValue(null);
220
-
221
- const result = await terminalTools.get_task_execution_status.handler({
222
- taskId: VALID_TASK_ID,
223
- });
224
-
225
- expect(result).toMatchObject({
226
- error: "No execution found for this task",
227
- taskId: VALID_TASK_ID,
228
- });
229
- expect(mockFetch).not.toHaveBeenCalled();
230
- });
231
-
232
- it("returns terminalStatus=exited when buffer returns 404 and execution is COMPLETED", async () => {
233
- mockDb.taskExecution.findFirst.mockResolvedValue({
234
- id: "exec1",
235
- status: "COMPLETED",
236
- startedAt: null,
237
- endedAt: null,
238
- });
239
- mockFetch.mockResolvedValue(mockFetchResponse(404, {}));
240
-
241
- const result = await terminalTools.get_task_execution_status.handler({
242
- taskId: VALID_TASK_ID,
243
- });
244
-
245
- expect(result).toMatchObject({
246
- taskId: VALID_TASK_ID,
247
- executionId: "exec1",
248
- executionStatus: "COMPLETED",
249
- terminalStatus: "exited",
250
- outputSnippet: null,
251
- });
252
- });
253
-
254
- it("returns terminalStatus=not_running when buffer returns 404 and execution is RUNNING", async () => {
255
- mockDb.taskExecution.findFirst.mockResolvedValue({
256
- id: "exec1",
257
- status: "RUNNING",
258
- startedAt: null,
259
- endedAt: null,
260
- });
261
- mockFetch.mockResolvedValue(mockFetchResponse(404, {}));
262
-
263
- const result = await terminalTools.get_task_execution_status.handler({
264
- taskId: VALID_TASK_ID,
265
- });
266
-
267
- expect(result).toMatchObject({
268
- terminalStatus: "not_running",
269
- });
270
- });
271
-
272
- it("returns terminalStatus=exited when buffer is ok and killed=true", async () => {
273
- mockDb.taskExecution.findFirst.mockResolvedValue({
274
- id: "exec1",
275
- status: "RUNNING",
276
- startedAt: null,
277
- endedAt: null,
278
- });
279
- mockFetch.mockResolvedValue(
280
- mockFetchResponse(200, { lines: ["done"], killed: true })
281
- );
282
-
283
- const result = await terminalTools.get_task_execution_status.handler({
284
- taskId: VALID_TASK_ID,
285
- });
286
-
287
- expect(result).toMatchObject({
288
- terminalStatus: "exited",
289
- outputSnippet: "done",
290
- });
291
- });
292
-
293
- it("returns terminalStatus=running with outputSnippet when buffer is ok and killed=false", async () => {
294
- mockDb.taskExecution.findFirst.mockResolvedValue({
295
- id: "exec1",
296
- status: "RUNNING",
297
- startedAt: null,
298
- endedAt: null,
299
- });
300
- mockFetch.mockResolvedValue(
301
- mockFetchResponse(200, { lines: ["line1", "line2", "line3"], killed: false })
302
- );
303
-
304
- const result = await terminalTools.get_task_execution_status.handler({
305
- taskId: VALID_TASK_ID,
306
- });
307
-
308
- expect(result).toMatchObject({
309
- terminalStatus: "running",
310
- outputSnippet: "line1\nline2\nline3",
311
- });
312
-
313
- // Verify bridge fetch was called with buffer?lines=10
314
- const [url] = mockFetch.mock.calls[0];
315
- expect(url).toContain(`/api/internal/terminal/${VALID_TASK_ID}/buffer?lines=10`);
316
- });
317
- });
318
- });
@@ -1,146 +0,0 @@
1
- import { vi, describe, it, expect, beforeEach } from "vitest";
2
-
3
- // Mock db before any imports
4
- vi.mock("../../db", () => ({
5
- db: {
6
- workspace: {
7
- findMany: vi.fn(),
8
- create: vi.fn(),
9
- update: vi.fn(),
10
- delete: vi.fn(),
11
- count: vi.fn(),
12
- },
13
- },
14
- }));
15
-
16
- import { db } from "../../db";
17
- import { workspaceTools } from "../workspace-tools";
18
-
19
- const mockDb = db as unknown as {
20
- workspace: {
21
- findMany: ReturnType<typeof vi.fn>;
22
- create: ReturnType<typeof vi.fn>;
23
- update: ReturnType<typeof vi.fn>;
24
- delete: ReturnType<typeof vi.fn>;
25
- count: ReturnType<typeof vi.fn>;
26
- };
27
- };
28
-
29
- describe("workspace-tools", () => {
30
- beforeEach(() => {
31
- vi.clearAllMocks();
32
- });
33
-
34
- describe("list_workspaces", () => {
35
- it("calls db.workspace.findMany with projects include and returns projectCount", async () => {
36
- const mockWorkspaces = [
37
- {
38
- id: "ws1",
39
- name: "Workspace 1",
40
- description: null,
41
- createdAt: new Date(),
42
- updatedAt: new Date(),
43
- projects: [{ id: "p1" }, { id: "p2" }],
44
- },
45
- {
46
- id: "ws2",
47
- name: "Workspace 2",
48
- description: "desc",
49
- createdAt: new Date(),
50
- updatedAt: new Date(),
51
- projects: [],
52
- },
53
- ];
54
- mockDb.workspace.findMany.mockResolvedValue(mockWorkspaces);
55
-
56
- const result = await workspaceTools.list_workspaces.handler({});
57
-
58
- expect(mockDb.workspace.findMany).toHaveBeenCalledOnce();
59
- const callArgs = mockDb.workspace.findMany.mock.calls[0][0];
60
- expect(callArgs.include.projects).toBeDefined();
61
- expect(callArgs.orderBy).toEqual({ updatedAt: "desc" });
62
-
63
- expect(result).toHaveLength(2);
64
- expect(result[0]).toMatchObject({ id: "ws1", name: "Workspace 1", projectCount: 2 });
65
- expect(result[0]).not.toHaveProperty("projects");
66
- expect(result[1]).toMatchObject({ id: "ws2", name: "Workspace 2", projectCount: 0 });
67
- });
68
- });
69
-
70
- describe("create_workspace", () => {
71
- it("calls db.workspace.create with name and description", async () => {
72
- const mockWorkspace = { id: "ws1", name: "New WS", description: "My desc", createdAt: new Date(), updatedAt: new Date() };
73
- mockDb.workspace.create.mockResolvedValue(mockWorkspace);
74
-
75
- const result = await workspaceTools.create_workspace.handler({ name: "New WS", description: "My desc" });
76
-
77
- expect(mockDb.workspace.create).toHaveBeenCalledWith({
78
- data: { name: "New WS", description: "My desc" },
79
- });
80
- expect(result).toEqual(mockWorkspace);
81
- });
82
-
83
- it("calls db.workspace.create without description when not provided", async () => {
84
- const mockWorkspace = { id: "ws1", name: "No Desc", description: null, createdAt: new Date(), updatedAt: new Date() };
85
- mockDb.workspace.create.mockResolvedValue(mockWorkspace);
86
-
87
- await workspaceTools.create_workspace.handler({ name: "No Desc" });
88
-
89
- expect(mockDb.workspace.create).toHaveBeenCalledWith({
90
- data: { name: "No Desc", description: undefined },
91
- });
92
- });
93
- });
94
-
95
- describe("update_workspace", () => {
96
- it("calls db.workspace.update with correct where and data", async () => {
97
- const mockWorkspace = { id: "ws1", name: "Updated", description: "new desc", createdAt: new Date(), updatedAt: new Date() };
98
- mockDb.workspace.update.mockResolvedValue(mockWorkspace);
99
-
100
- const result = await workspaceTools.update_workspace.handler({
101
- workspaceId: "ws1",
102
- name: "Updated",
103
- description: "new desc",
104
- });
105
-
106
- expect(mockDb.workspace.update).toHaveBeenCalledWith({
107
- where: { id: "ws1" },
108
- data: { name: "Updated", description: "new desc" },
109
- });
110
- expect(result).toEqual(mockWorkspace);
111
- });
112
-
113
- it("calls db.workspace.update with partial data (name only)", async () => {
114
- const mockWorkspace = { id: "ws1", name: "Renamed", description: null, createdAt: new Date(), updatedAt: new Date() };
115
- mockDb.workspace.update.mockResolvedValue(mockWorkspace);
116
-
117
- await workspaceTools.update_workspace.handler({ workspaceId: "ws1", name: "Renamed" });
118
-
119
- expect(mockDb.workspace.update).toHaveBeenCalledWith({
120
- where: { id: "ws1" },
121
- data: { name: "Renamed", description: undefined },
122
- });
123
- });
124
- });
125
-
126
- describe("delete_workspace", () => {
127
- it("calls db.workspace.delete with workspaceId and returns deleted: true", async () => {
128
- mockDb.workspace.count.mockResolvedValue(2);
129
- mockDb.workspace.delete.mockResolvedValue({ id: "ws1" });
130
-
131
- const result = await workspaceTools.delete_workspace.handler({ workspaceId: "ws1" });
132
-
133
- expect(mockDb.workspace.delete).toHaveBeenCalledWith({ where: { id: "ws1" } });
134
- expect(result).toEqual({ deleted: true, workspaceId: "ws1" });
135
- });
136
-
137
- it("throws when trying to delete the last workspace", async () => {
138
- mockDb.workspace.count.mockResolvedValue(1);
139
-
140
- await expect(
141
- workspaceTools.delete_workspace.handler({ workspaceId: "ws1" }),
142
- ).rejects.toThrow("Cannot delete the last workspace");
143
- expect(mockDb.workspace.delete).not.toHaveBeenCalled();
144
- });
145
- });
146
- });
@@ -1,100 +0,0 @@
1
- import { z } from "zod";
2
- import { db } from "../db";
3
-
4
- // Scoring constants
5
- const NAME_EXACT = 1.0;
6
- const NAME_STARTS_WITH = 0.9;
7
- const NAME_CONTAINS = 0.75;
8
- const ALIAS_EXACT = 0.85;
9
- const ALIAS_STARTS_WITH = 0.75;
10
- const ALIAS_CONTAINS = 0.6;
11
- const DESC_CONTAINS = 0.4;
12
- const MIN_CONFIDENCE = 0.3;
13
-
14
- interface ProjectFields {
15
- name: string;
16
- alias: string | null;
17
- description?: string | null;
18
- }
19
-
20
- /**
21
- * Score a project against a query string.
22
- * Returns a confidence value between 0 and 1.
23
- * Name match > alias match > description match.
24
- */
25
- export function scoreProject(project: ProjectFields, query: string): number {
26
- const q = query.toLowerCase();
27
- const name = project.name.toLowerCase();
28
-
29
- // Name scoring
30
- let nameScore = 0;
31
- if (name === q) {
32
- nameScore = NAME_EXACT;
33
- } else if (name.startsWith(q)) {
34
- nameScore = NAME_STARTS_WITH;
35
- } else if (name.includes(q)) {
36
- nameScore = NAME_CONTAINS;
37
- }
38
-
39
- // Alias scoring
40
- let aliasScore = 0;
41
- if (project.alias) {
42
- const alias = project.alias.toLowerCase();
43
- if (alias === q) {
44
- aliasScore = ALIAS_EXACT;
45
- } else if (alias.startsWith(q)) {
46
- aliasScore = ALIAS_STARTS_WITH;
47
- } else if (alias.includes(q)) {
48
- aliasScore = ALIAS_CONTAINS;
49
- }
50
- }
51
-
52
- // Description scoring
53
- let descScore = 0;
54
- if (project.description) {
55
- const desc = project.description.toLowerCase();
56
- if (desc.includes(q)) {
57
- descScore = DESC_CONTAINS;
58
- }
59
- }
60
-
61
- return Math.max(nameScore, aliasScore, descScore);
62
- }
63
-
64
- export const knowledgeTools = {
65
- identify_project: {
66
- description:
67
- "Find a project by partial name, alias, or description. Returns matches sorted by confidence score (0-1).",
68
- schema: z.object({
69
- query: z.string(),
70
- workspaceId: z.string().optional(),
71
- }),
72
- handler: async (args: { query: string; workspaceId?: string }) => {
73
- // Fetch all projects (with workspace) optionally filtered by workspaceId
74
- const projects = await db.project.findMany({
75
- where: args.workspaceId ? { workspaceId: args.workspaceId } : undefined,
76
- include: { workspace: true },
77
- });
78
-
79
- // Score each project
80
- const scored = projects
81
- .map((project) => ({
82
- projectId: project.id,
83
- name: project.name,
84
- alias: project.alias,
85
- workspaceId: project.workspaceId,
86
- workspaceName: project.workspace.name,
87
- confidence: scoreProject(
88
- { name: project.name, alias: project.alias, description: project.description },
89
- args.query
90
- ),
91
- }))
92
- // Filter out low-confidence results
93
- .filter((result) => result.confidence >= MIN_CONFIDENCE)
94
- // Sort by confidence descending
95
- .sort((a, b) => b.confidence - a.confidence);
96
-
97
- return scored;
98
- },
99
- },
100
- };
@@ -1,70 +0,0 @@
1
- import { z } from "zod";
2
- import { db } from "../db";
3
-
4
- export const labelTools = {
5
- list_labels: {
6
- description: "List all labels available for a workspace, including builtin labels and workspace-specific labels.",
7
- schema: z.object({
8
- workspaceId: z.string(),
9
- }),
10
- handler: async (args: { workspaceId: string }) => {
11
- return db.label.findMany({
12
- where: {
13
- OR: [
14
- { isBuiltin: true },
15
- { workspaceId: args.workspaceId },
16
- ],
17
- },
18
- orderBy: [{ isBuiltin: "desc" }, { name: "asc" }],
19
- });
20
- },
21
- },
22
-
23
- create_label: {
24
- description: "Create a custom label for a workspace with a name and color.",
25
- schema: z.object({
26
- workspaceId: z.string(),
27
- name: z.string(),
28
- color: z.string().regex(/^#[0-9a-fA-F]{6}$/, "Color must be a hex color code like #ff0000"),
29
- }),
30
- handler: async (args: { workspaceId: string; name: string; color: string }) => {
31
- return db.label.create({
32
- data: {
33
- name: args.name,
34
- color: args.color,
35
- workspaceId: args.workspaceId,
36
- },
37
- });
38
- },
39
- },
40
-
41
- delete_label: {
42
- description: "Delete a label by ID.",
43
- schema: z.object({
44
- labelId: z.string(),
45
- }),
46
- handler: async (args: { labelId: string }) => {
47
- await db.label.delete({ where: { id: args.labelId } });
48
- return { deleted: true };
49
- },
50
- },
51
-
52
- set_task_labels: {
53
- description: "Replace all labels on a task with the provided list of label IDs.",
54
- schema: z.object({
55
- taskId: z.string(),
56
- labelIds: z.array(z.string()),
57
- }),
58
- handler: async (args: { taskId: string; labelIds: string[] }) => {
59
- await db.$transaction(async (tx) => {
60
- await tx.taskLabel.deleteMany({ where: { taskId: args.taskId } });
61
- if (args.labelIds.length > 0) {
62
- await tx.taskLabel.createMany({
63
- data: args.labelIds.map((labelId) => ({ taskId: args.taskId, labelId })),
64
- });
65
- }
66
- });
67
- return { taskId: args.taskId, labelIds: args.labelIds };
68
- },
69
- },
70
- };