tower-studio 0.2.7 → 0.2.9
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.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +47 -47
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/adapters/test/route.js +3 -2
- package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +9 -9
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +75 -75
- package/.next/standalone/.next/server/app/missions/page.js +5 -5
- package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +47 -47
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding.html +1 -1
- package/.next/standalone/.next/server/app/onboarding.rsc +16 -16
- package/.next/standalone/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
- package/.next/standalone/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +47 -47
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +60 -60
- package/.next/standalone/.next/server/app/settings/page.js +3 -3
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings.html +1 -1
- package/.next/standalone/.next/server/app/settings.rsc +16 -16
- package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +16 -16
- package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +9 -9
- package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +98 -98
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +88 -88
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +81 -81
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +76 -76
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +47 -47
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +84 -84
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +90 -90
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +5 -5
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +67 -67
- package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0h5yr8p.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__028ucbo._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03gi3ue._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07f7~6u._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_90467._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d~z6xs._.js +2 -2
- package/.next/standalone/.next/server/chunks/_0_w835g._.js +4 -0
- package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_0ba0ntr._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_ai_0q-~me1._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.ukame._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__006_qh0._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01j8ix6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02px.0y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03ebsif._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ca_ueb._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dsdplu._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l43.5g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n.cuy2._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nbj.ml._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ojv-d0._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pm2~fu._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ps55l6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ribsk4._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rjue04._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0souuv~._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tc6uh2._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0v2eslh._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vwc25l._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wjg_.n._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wlmzzq._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wvyks.._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0u4gc4b._.js → [root-of-the-server]__0z7q-_5._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zbmoit._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~03tpv._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~a-emb._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0zujp5l._.js → [root-of-the-server]__10o9il8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vdw4w._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0ysygps._.js → _0-fpxu8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0pd0.8f._.js → _03zmko4._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_04b71ua._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0ysyq9g._.js → _0568hf5._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_05h.8a~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_07k_7zo._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0c-jnbs._.js → _0999z~z._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0_l8.dg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0ds6nk2._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0gkxdta._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/_0i4__mf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0ihq._v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0f6u19w._.js → _0jxhs~u._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0b0.-sj._.js → _0r8ftmo._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0r9w-k8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0rbctq7._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0rt8hus._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0bw-tx8._.js → _0zcog8w._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0~80adm._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0fob8fc._.js → _11uabrg._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_13b~3az._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_13jha60._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +317 -317
- package/.next/standalone/.next/static/chunks/{0v~pz9e87t99b.js → 0-9-c__gfaxpa.js} +1 -1
- package/.next/standalone/.next/static/chunks/{05-ui_o~3irq_.js → 04djo-eed_8rf.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0r1mkt5qs~s6m.js → 05fy_a4boi~ym.js} +1 -1
- package/.next/standalone/.next/static/chunks/05mg~bkdmeovq.js +1 -0
- package/.next/standalone/.next/static/chunks/08o3st.fn2~6x.js +1 -0
- package/.next/standalone/.next/static/chunks/{08~e63d2q~cam.js → 0d5wyd0-zzb94.js} +1 -1
- package/.next/standalone/.next/static/chunks/{00j0mdc41wa44.js → 0e6c~o_iuvycp.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0i55dediewjp5.js → 0h3jzfwt-f9o7.js} +1 -1
- package/.next/standalone/.next/static/chunks/0igfu0uxcf238.js +1 -0
- package/.next/standalone/.next/static/chunks/{0l3mmc866npw4.js → 0jd4uhx~x74ox.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0bw4ahlj4~l~g.js → 0obdotk~5x07o.js} +1 -1
- package/.next/standalone/.next/static/chunks/0o~dk86gtjq-..js +1 -0
- package/.next/standalone/.next/static/chunks/{0ft77ybyq903..js → 0p_vnqgdse218.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0~27mkhc9s5k2.js → 0sbpshsch~ak2.js} +2 -2
- package/.next/standalone/.next/static/chunks/{00.52653v5c~c.js → 0t.7i1ltlf~rt.js} +1 -1
- package/.next/standalone/.next/static/chunks/0v--ko.s9zeij.js +1 -0
- package/.next/standalone/.next/static/chunks/{02edbrlq~2uyx.js → 0v-8_9de2o32z.js} +1 -1
- package/.next/standalone/.next/static/chunks/{05hls.3r4bz.0.js → 0x~sbju1g3fjh.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0fxm-wv..y_a_.js → 0y1m4k4hrzl33.js} +2 -2
- package/.next/standalone/.next/static/chunks/0ztm6whl93nyg.js +1 -0
- package/.next/standalone/.next/static/chunks/136efy8zbqp13.js +1 -0
- package/.next/standalone/package.json +1 -2
- package/dist/mcp-server.cjs +34 -28
- package/package.json +1 -2
- package/scripts/post-tool-hook.js +24 -39
- package/scripts/session-start-hook.js +21 -19
- package/scripts/stop-hook.js +21 -19
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wbndoc._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04pq37d._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07_b6c.._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09kc.q_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jo1r7k._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o8k4pc._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_02v3fjp._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_07~0_w6._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_08w-r6e._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/src_095o8x6._.js +0 -3
- package/.next/standalone/.next/static/chunks/0nno5if2x1mvs.js +0 -1
- package/.next/standalone/.next/static/chunks/0q-u-hhre1uyw.js +0 -1
- package/.next/standalone/.next/static/chunks/0qazzw-pr_sv7.js +0 -1
- package/.next/standalone/.next/static/chunks/0w3jww1m3k77x.js +0 -1
- package/.next/standalone/.next/static/chunks/0z01g02xstbqe.js +0 -1
- package/.next/standalone/.next/static/chunks/117qu902jput3.js +0 -1
- package/.next/standalone/.next/static/chunks/142w-q8.7m3kl.js +0 -1
- package/src/mcp/db.ts +0 -11
- package/src/mcp/index.ts +0 -15
- package/src/mcp/server.ts +0 -52
- package/src/mcp/tools/__tests__/label-tools.test.ts +0 -140
- package/src/mcp/tools/__tests__/project-tools.test.ts +0 -182
- package/src/mcp/tools/__tests__/report-tools.test.ts +0 -212
- package/src/mcp/tools/__tests__/task-tools.test.ts +0 -418
- package/src/mcp/tools/__tests__/terminal-tools.test.ts +0 -318
- package/src/mcp/tools/__tests__/workspace-tools.test.ts +0 -146
- package/src/mcp/tools/knowledge-tools.ts +0 -100
- package/src/mcp/tools/label-tools.ts +0 -70
- package/src/mcp/tools/note-asset-tools.ts +0 -271
- package/src/mcp/tools/project-tools.ts +0 -79
- package/src/mcp/tools/report-tools.ts +0 -220
- package/src/mcp/tools/search-tools.ts +0 -32
- package/src/mcp/tools/task-tools.ts +0 -272
- package/src/mcp/tools/terminal-tools.ts +0 -154
- package/src/mcp/tools/workspace-tools.ts +0 -73
- /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7iWXcI7IK1tpJQ-itTcOk}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7iWXcI7IK1tpJQ-itTcOk}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7iWXcI7IK1tpJQ-itTcOk}/_ssgManifest.js +0 -0
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as fs from "node:fs";
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import { db } from "../db";
|
|
5
|
-
import { searchNotes, syncNoteToFts, deleteNoteFromFts } from "@/lib/fts";
|
|
6
|
-
import { ensureAssetsDir } from "@/lib/file-utils";
|
|
7
|
-
|
|
8
|
-
// ─── manage_notes ────────────────────────────────────────────────────────────
|
|
9
|
-
|
|
10
|
-
const manageNotesSchema = z.object({
|
|
11
|
-
action: z.enum(["create", "update", "delete", "get", "list", "search"]),
|
|
12
|
-
projectId: z.string().optional(),
|
|
13
|
-
noteId: z.string().optional(),
|
|
14
|
-
title: z.string().optional(),
|
|
15
|
-
content: z.string().optional(),
|
|
16
|
-
category: z.string().optional(),
|
|
17
|
-
query: z.string().optional(),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
type ManageNotesArgs = z.infer<typeof manageNotesSchema>;
|
|
21
|
-
|
|
22
|
-
async function handleManageNotes(args: ManageNotesArgs) {
|
|
23
|
-
switch (args.action) {
|
|
24
|
-
case "create": {
|
|
25
|
-
if (!args.projectId || !args.title) {
|
|
26
|
-
throw new Error("projectId and title required");
|
|
27
|
-
}
|
|
28
|
-
const note = await db.projectNote.create({
|
|
29
|
-
data: {
|
|
30
|
-
title: args.title,
|
|
31
|
-
content: args.content ?? "",
|
|
32
|
-
category: args.category ?? "备忘",
|
|
33
|
-
projectId: args.projectId,
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
await syncNoteToFts(db, { id: note.id, title: note.title, content: note.content });
|
|
37
|
-
return note;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
case "update": {
|
|
41
|
-
if (!args.noteId) {
|
|
42
|
-
throw new Error("noteId required");
|
|
43
|
-
}
|
|
44
|
-
const updateData: { title?: string; content?: string; category?: string } = {};
|
|
45
|
-
if (args.title !== undefined) updateData.title = args.title;
|
|
46
|
-
if (args.content !== undefined) updateData.content = args.content;
|
|
47
|
-
if (args.category !== undefined) updateData.category = args.category;
|
|
48
|
-
|
|
49
|
-
const note = await db.projectNote.update({
|
|
50
|
-
where: { id: args.noteId },
|
|
51
|
-
data: updateData,
|
|
52
|
-
});
|
|
53
|
-
await syncNoteToFts(db, { id: note.id, title: note.title, content: note.content });
|
|
54
|
-
return note;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
case "delete": {
|
|
58
|
-
if (!args.noteId) {
|
|
59
|
-
throw new Error("noteId required");
|
|
60
|
-
}
|
|
61
|
-
await deleteNoteFromFts(db, args.noteId);
|
|
62
|
-
await db.projectNote.delete({ where: { id: args.noteId } });
|
|
63
|
-
return { deleted: true, noteId: args.noteId };
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
case "get": {
|
|
67
|
-
if (!args.noteId) {
|
|
68
|
-
throw new Error("noteId required");
|
|
69
|
-
}
|
|
70
|
-
return db.projectNote.findUnique({ where: { id: args.noteId } });
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
case "list": {
|
|
74
|
-
if (!args.projectId) {
|
|
75
|
-
throw new Error("projectId required");
|
|
76
|
-
}
|
|
77
|
-
const where: { projectId: string; category?: string } = { projectId: args.projectId };
|
|
78
|
-
if (args.category) where.category = args.category;
|
|
79
|
-
|
|
80
|
-
return db.projectNote.findMany({
|
|
81
|
-
where,
|
|
82
|
-
orderBy: { updatedAt: "desc" },
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
case "search": {
|
|
87
|
-
if (!args.projectId || !args.query) {
|
|
88
|
-
throw new Error("projectId and query required");
|
|
89
|
-
}
|
|
90
|
-
return searchNotes(db, args.projectId, args.query);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
default:
|
|
94
|
-
throw new Error(`Unknown action: ${args.action}`);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// ─── manage_assets ───────────────────────────────────────────────────────────
|
|
99
|
-
|
|
100
|
-
const manageAssetsSchema = z.object({
|
|
101
|
-
action: z.enum(["add", "upload", "delete", "list", "get", "link_task"]),
|
|
102
|
-
projectId: z.string().optional(),
|
|
103
|
-
assetId: z.string().optional(),
|
|
104
|
-
assetIds: z.array(z.string()).optional(),
|
|
105
|
-
taskId: z.string().optional(),
|
|
106
|
-
sourcePath: z.string().optional(),
|
|
107
|
-
filename: z.string().optional(),
|
|
108
|
-
base64: z.string().optional().describe("Base64-encoded file content (for action=upload)"),
|
|
109
|
-
mimeType: z.string().optional().describe("MIME type of the uploaded file (e.g. image/png)"),
|
|
110
|
-
description: z.string().optional(),
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
type ManageAssetsArgs = z.infer<typeof manageAssetsSchema>;
|
|
114
|
-
|
|
115
|
-
// Map common MIME types to file extensions
|
|
116
|
-
const MIME_EXT: Record<string, string> = {
|
|
117
|
-
"image/png": ".png",
|
|
118
|
-
"image/jpeg": ".jpg",
|
|
119
|
-
"image/gif": ".gif",
|
|
120
|
-
"image/webp": ".webp",
|
|
121
|
-
"image/svg+xml": ".svg",
|
|
122
|
-
"application/pdf": ".pdf",
|
|
123
|
-
"text/plain": ".txt",
|
|
124
|
-
"text/markdown": ".md",
|
|
125
|
-
"application/json": ".json",
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
async function handleManageAssets(args: ManageAssetsArgs) {
|
|
129
|
-
switch (args.action) {
|
|
130
|
-
case "add": {
|
|
131
|
-
if (!args.projectId || !args.sourcePath) {
|
|
132
|
-
throw new Error("projectId and sourcePath required");
|
|
133
|
-
}
|
|
134
|
-
const assetsDir = ensureAssetsDir(args.projectId);
|
|
135
|
-
const filename = args.filename ?? path.basename(args.sourcePath);
|
|
136
|
-
const destPath = path.join(assetsDir, filename);
|
|
137
|
-
|
|
138
|
-
// Move file: try rename first, fall back to copy+delete for cross-device
|
|
139
|
-
try {
|
|
140
|
-
fs.renameSync(args.sourcePath, destPath);
|
|
141
|
-
} catch (err) {
|
|
142
|
-
const nodeErr = err as NodeJS.ErrnoException;
|
|
143
|
-
if (nodeErr.code === "EXDEV") {
|
|
144
|
-
fs.copyFileSync(args.sourcePath, destPath);
|
|
145
|
-
fs.unlinkSync(args.sourcePath);
|
|
146
|
-
} else {
|
|
147
|
-
throw err;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
const stats = fs.statSync(destPath);
|
|
152
|
-
const asset = await db.projectAsset.create({
|
|
153
|
-
data: {
|
|
154
|
-
filename,
|
|
155
|
-
path: destPath,
|
|
156
|
-
size: stats.size,
|
|
157
|
-
mimeType: args.mimeType,
|
|
158
|
-
projectId: args.projectId,
|
|
159
|
-
taskId: args.taskId,
|
|
160
|
-
description: args.description,
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
return asset;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
case "upload": {
|
|
167
|
-
if (!args.projectId || !args.base64) {
|
|
168
|
-
throw new Error("projectId and base64 required");
|
|
169
|
-
}
|
|
170
|
-
const buffer = Buffer.from(args.base64, "base64");
|
|
171
|
-
const assetsDir = ensureAssetsDir(args.projectId);
|
|
172
|
-
|
|
173
|
-
// Determine filename
|
|
174
|
-
let filename = args.filename;
|
|
175
|
-
if (!filename) {
|
|
176
|
-
const ext = (args.mimeType && MIME_EXT[args.mimeType]) || ".bin";
|
|
177
|
-
filename = `upload-${Date.now()}${ext}`;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
// Avoid overwriting
|
|
181
|
-
let destPath = path.join(assetsDir, filename);
|
|
182
|
-
if (fs.existsSync(destPath)) {
|
|
183
|
-
const ext = path.extname(filename);
|
|
184
|
-
const base = path.basename(filename, ext);
|
|
185
|
-
filename = `${base}-${Date.now()}${ext}`;
|
|
186
|
-
destPath = path.join(assetsDir, filename);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
fs.writeFileSync(destPath, buffer);
|
|
190
|
-
|
|
191
|
-
const asset = await db.projectAsset.create({
|
|
192
|
-
data: {
|
|
193
|
-
filename,
|
|
194
|
-
path: destPath,
|
|
195
|
-
size: buffer.length,
|
|
196
|
-
mimeType: args.mimeType,
|
|
197
|
-
projectId: args.projectId,
|
|
198
|
-
taskId: args.taskId,
|
|
199
|
-
description: args.description,
|
|
200
|
-
},
|
|
201
|
-
});
|
|
202
|
-
return asset;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
case "link_task": {
|
|
206
|
-
if (!args.taskId) {
|
|
207
|
-
throw new Error("taskId required");
|
|
208
|
-
}
|
|
209
|
-
if (!args.assetIds || args.assetIds.length === 0) {
|
|
210
|
-
throw new Error("assetIds required (array of asset IDs to link)");
|
|
211
|
-
}
|
|
212
|
-
const updated = await db.projectAsset.updateMany({
|
|
213
|
-
where: { id: { in: args.assetIds } },
|
|
214
|
-
data: { taskId: args.taskId },
|
|
215
|
-
});
|
|
216
|
-
return { linked: updated.count, taskId: args.taskId, assetIds: args.assetIds };
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
case "delete": {
|
|
220
|
-
if (!args.assetId) {
|
|
221
|
-
throw new Error("assetId required");
|
|
222
|
-
}
|
|
223
|
-
// Also delete the file from disk
|
|
224
|
-
const asset = await db.projectAsset.findUnique({ where: { id: args.assetId } });
|
|
225
|
-
if (asset?.path && fs.existsSync(asset.path)) {
|
|
226
|
-
fs.unlinkSync(asset.path);
|
|
227
|
-
}
|
|
228
|
-
await db.projectAsset.delete({ where: { id: args.assetId } });
|
|
229
|
-
return { deleted: true, assetId: args.assetId };
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
case "list": {
|
|
233
|
-
if (!args.projectId) {
|
|
234
|
-
throw new Error("projectId required");
|
|
235
|
-
}
|
|
236
|
-
const where: { projectId: string; taskId?: string } = { projectId: args.projectId };
|
|
237
|
-
if (args.taskId) where.taskId = args.taskId;
|
|
238
|
-
return db.projectAsset.findMany({
|
|
239
|
-
where,
|
|
240
|
-
orderBy: { createdAt: "desc" },
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
case "get": {
|
|
245
|
-
if (!args.assetId) {
|
|
246
|
-
throw new Error("assetId required");
|
|
247
|
-
}
|
|
248
|
-
return db.projectAsset.findUnique({ where: { id: args.assetId } });
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
default:
|
|
252
|
-
throw new Error(`Unknown action: ${args.action}`);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
// ─── Exports ─────────────────────────────────────────────────────────────────
|
|
257
|
-
|
|
258
|
-
export const noteAssetTools = {
|
|
259
|
-
manage_notes: {
|
|
260
|
-
description:
|
|
261
|
-
"Create, read, update, delete, or search project notes. Use action field to select operation.",
|
|
262
|
-
schema: manageNotesSchema,
|
|
263
|
-
handler: handleManageNotes,
|
|
264
|
-
},
|
|
265
|
-
manage_assets: {
|
|
266
|
-
description:
|
|
267
|
-
"Manage project assets (files, images, screenshots). Actions: add (move file from sourcePath), upload (save base64 content — use this for pasted screenshots/images), link_task (associate uploaded assets with a task after creation), delete, list, get. Upload flow: 1) upload with projectId+base64 → get assetId+path, 2) use path in task description, 3) after create_task, call link_task with taskId+assetIds.",
|
|
268
|
-
schema: manageAssetsSchema,
|
|
269
|
-
handler: handleManageAssets,
|
|
270
|
-
},
|
|
271
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { db } from "../db";
|
|
3
|
-
|
|
4
|
-
export const projectTools = {
|
|
5
|
-
list_projects: {
|
|
6
|
-
description: "List all projects in a workspace ordered by last updated, including task and repository counts.",
|
|
7
|
-
schema: z.object({
|
|
8
|
-
workspaceId: z.string(),
|
|
9
|
-
}),
|
|
10
|
-
handler: async (args: { workspaceId: string }) => {
|
|
11
|
-
const projects = await db.project.findMany({
|
|
12
|
-
where: { workspaceId: args.workspaceId },
|
|
13
|
-
include: {
|
|
14
|
-
tasks: { select: { id: true } },
|
|
15
|
-
repositories: { select: { id: true } },
|
|
16
|
-
},
|
|
17
|
-
orderBy: { updatedAt: "desc" },
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return projects.map(({ tasks, repositories, ...rest }) => ({
|
|
21
|
-
...rest,
|
|
22
|
-
taskCount: tasks.length,
|
|
23
|
-
repositoryCount: repositories.length,
|
|
24
|
-
}));
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
create_project: {
|
|
29
|
-
description: "Create a new project in a workspace. Type is derived from gitUrl: GIT if provided, NORMAL otherwise.",
|
|
30
|
-
schema: z.object({
|
|
31
|
-
workspaceId: z.string(),
|
|
32
|
-
name: z.string(),
|
|
33
|
-
alias: z.string().optional().describe("Short alias for the project"),
|
|
34
|
-
gitUrl: z.string().optional(),
|
|
35
|
-
localPath: z.string().optional(),
|
|
36
|
-
}),
|
|
37
|
-
handler: async (args: { workspaceId: string; name: string; alias?: string; gitUrl?: string; localPath?: string }) => {
|
|
38
|
-
return db.project.create({
|
|
39
|
-
data: {
|
|
40
|
-
name: args.name,
|
|
41
|
-
alias: args.alias,
|
|
42
|
-
type: args.gitUrl ? "GIT" : "NORMAL",
|
|
43
|
-
gitUrl: args.gitUrl,
|
|
44
|
-
localPath: args.localPath,
|
|
45
|
-
workspaceId: args.workspaceId,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
update_project: {
|
|
52
|
-
description: "Update an existing project's name, localPath, and/or description.",
|
|
53
|
-
schema: z.object({
|
|
54
|
-
projectId: z.string(),
|
|
55
|
-
name: z.string().optional(),
|
|
56
|
-
alias: z.string().optional().describe("Short alias for the project"),
|
|
57
|
-
localPath: z.string().optional(),
|
|
58
|
-
description: z.string().optional(),
|
|
59
|
-
}),
|
|
60
|
-
handler: async (args: { projectId: string; name?: string; alias?: string; localPath?: string; description?: string }) => {
|
|
61
|
-
const { projectId, ...data } = args;
|
|
62
|
-
return db.project.update({
|
|
63
|
-
where: { id: projectId },
|
|
64
|
-
data,
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
delete_project: {
|
|
70
|
-
description: "Delete a project by ID.",
|
|
71
|
-
schema: z.object({
|
|
72
|
-
projectId: z.string(),
|
|
73
|
-
}),
|
|
74
|
-
handler: async (args: { projectId: string }) => {
|
|
75
|
-
await db.project.delete({ where: { id: args.projectId } });
|
|
76
|
-
return { deleted: true, projectId: args.projectId };
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
};
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { db } from "../db";
|
|
3
|
-
|
|
4
|
-
const PRIORITY_ORDER: Record<string, number> = { CRITICAL: 0, HIGH: 1, MEDIUM: 2, LOW: 3 };
|
|
5
|
-
|
|
6
|
-
export const reportTools = {
|
|
7
|
-
daily_summary: {
|
|
8
|
-
description:
|
|
9
|
-
"Get a summary of today's work across all workspaces. Shows completed tasks, in-progress tasks with their last chat summary, grouped by workspace → project. Also includes session-insight notes created that day in an `insights` array. Optionally pass a date (YYYY-MM-DD) to query a specific day. Date boundary is server-local time.",
|
|
10
|
-
schema: z.object({
|
|
11
|
-
date: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional()
|
|
12
|
-
.describe("Date in YYYY-MM-DD format. Defaults to today."),
|
|
13
|
-
}),
|
|
14
|
-
handler: async (args: { date?: string }) => {
|
|
15
|
-
const date = args.date ? new Date(args.date + "T00:00:00") : new Date();
|
|
16
|
-
date.setHours(0, 0, 0, 0);
|
|
17
|
-
const nextDay = new Date(date);
|
|
18
|
-
nextDay.setDate(nextDay.getDate() + 1);
|
|
19
|
-
|
|
20
|
-
const tasks = await db.task.findMany({
|
|
21
|
-
where: {
|
|
22
|
-
OR: [
|
|
23
|
-
{ updatedAt: { gte: date, lt: nextDay } },
|
|
24
|
-
{ executions: { some: { startedAt: { gte: date, lt: nextDay } } } },
|
|
25
|
-
{ messages: { some: { createdAt: { gte: date, lt: nextDay } } } },
|
|
26
|
-
],
|
|
27
|
-
// Exclude system tasks tagged with the builtin "Tower" label
|
|
28
|
-
NOT: { labels: { some: { label: { name: "Tower", isBuiltin: true } } } },
|
|
29
|
-
},
|
|
30
|
-
include: {
|
|
31
|
-
project: { include: { workspace: true } },
|
|
32
|
-
messages: {
|
|
33
|
-
where: { role: "ASSISTANT", createdAt: { gte: date, lt: nextDay } },
|
|
34
|
-
orderBy: { createdAt: "desc" },
|
|
35
|
-
take: 1,
|
|
36
|
-
select: { content: true, createdAt: true },
|
|
37
|
-
},
|
|
38
|
-
executions: {
|
|
39
|
-
where: { startedAt: { gte: date, lt: nextDay } },
|
|
40
|
-
orderBy: { startedAt: "desc" },
|
|
41
|
-
take: 1,
|
|
42
|
-
select: { startedAt: true, status: true, summary: true },
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
orderBy: { updatedAt: "desc" },
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// Group by workspace → project
|
|
49
|
-
type CompletedTask = { id: string; title: string; priority: string; completedAt: string };
|
|
50
|
-
type InProgressTask = { id: string; title: string; status: string; priority: string; lastActivity: string; progressSummary: string | null };
|
|
51
|
-
type ProjectEntry = { id: string; name: string; alias: string | null; completed: CompletedTask[]; inProgress: InProgressTask[] };
|
|
52
|
-
type WsEntry = { id: string; name: string; projects: Map<string, ProjectEntry> };
|
|
53
|
-
|
|
54
|
-
const wsMap = new Map<string, WsEntry>();
|
|
55
|
-
|
|
56
|
-
for (const task of tasks) {
|
|
57
|
-
const ws = task.project.workspace;
|
|
58
|
-
if (!wsMap.has(ws.id)) {
|
|
59
|
-
wsMap.set(ws.id, { id: ws.id, name: ws.name, projects: new Map() });
|
|
60
|
-
}
|
|
61
|
-
const projMap = wsMap.get(ws.id)!.projects;
|
|
62
|
-
const proj = task.project;
|
|
63
|
-
if (!projMap.has(proj.id)) {
|
|
64
|
-
projMap.set(proj.id, { id: proj.id, name: proj.name, alias: proj.alias, completed: [], inProgress: [] });
|
|
65
|
-
}
|
|
66
|
-
const projEntry = projMap.get(proj.id)!;
|
|
67
|
-
|
|
68
|
-
if (task.status === "DONE") {
|
|
69
|
-
projEntry.completed.push({
|
|
70
|
-
id: task.id, title: task.title, priority: task.priority,
|
|
71
|
-
completedAt: task.updatedAt.toISOString(),
|
|
72
|
-
});
|
|
73
|
-
} else if (task.status !== "CANCELLED") {
|
|
74
|
-
projEntry.inProgress.push({
|
|
75
|
-
id: task.id, title: task.title, status: task.status, priority: task.priority,
|
|
76
|
-
lastActivity: (task.messages[0]?.createdAt ?? task.updatedAt).toISOString(),
|
|
77
|
-
progressSummary: task.executions[0]?.summary
|
|
78
|
-
?? (task.messages[0]?.content
|
|
79
|
-
? task.messages[0].content.slice(0, 200) + (task.messages[0].content.length > 200 ? "..." : "")
|
|
80
|
-
: null),
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Query session-insight notes created that day
|
|
86
|
-
const insightNotes = await db.projectNote.findMany({
|
|
87
|
-
where: {
|
|
88
|
-
category: "session-insight",
|
|
89
|
-
createdAt: { gte: date, lt: nextDay },
|
|
90
|
-
},
|
|
91
|
-
include: {
|
|
92
|
-
project: {
|
|
93
|
-
include: { workspace: true },
|
|
94
|
-
},
|
|
95
|
-
task: { select: { id: true, title: true } },
|
|
96
|
-
},
|
|
97
|
-
orderBy: { createdAt: "desc" },
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
const insights = insightNotes.map((note) => ({
|
|
101
|
-
id: note.id,
|
|
102
|
-
title: note.title,
|
|
103
|
-
content: note.content.slice(0, 500),
|
|
104
|
-
createdAt: note.createdAt.toISOString(),
|
|
105
|
-
workspace: { id: note.project.workspace.id, name: note.project.workspace.name },
|
|
106
|
-
project: { id: note.project.id, name: note.project.name, alias: note.project.alias },
|
|
107
|
-
task: note.task ? { id: note.task.id, title: note.task.title } : null,
|
|
108
|
-
}));
|
|
109
|
-
|
|
110
|
-
let totalCompleted = 0;
|
|
111
|
-
let totalInProgress = 0;
|
|
112
|
-
const workspaces = Array.from(wsMap.values()).map((ws) => ({
|
|
113
|
-
id: ws.id, name: ws.name,
|
|
114
|
-
projects: Array.from(ws.projects.values()).map((p) => {
|
|
115
|
-
totalCompleted += p.completed.length;
|
|
116
|
-
totalInProgress += p.inProgress.length;
|
|
117
|
-
return { id: p.id, name: p.name, alias: p.alias, completed: p.completed, inProgress: p.inProgress };
|
|
118
|
-
}),
|
|
119
|
-
}));
|
|
120
|
-
|
|
121
|
-
return {
|
|
122
|
-
date: date.toISOString().slice(0, 10),
|
|
123
|
-
workspaces,
|
|
124
|
-
stats: { totalCompleted, totalInProgress, totalActive: totalCompleted + totalInProgress },
|
|
125
|
-
insights,
|
|
126
|
-
insightCount: insights.length,
|
|
127
|
-
};
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
daily_todo: {
|
|
132
|
-
description:
|
|
133
|
-
"Get all pending tasks (TODO, IN_PROGRESS, IN_REVIEW) across all workspaces, grouped by workspace → project. Supports filtering by workspace, project, status, and priority. Sorted by priority severity (CRITICAL first). Returns lastSessionId for resuming tasks.",
|
|
134
|
-
schema: z.object({
|
|
135
|
-
workspaceId: z.string().optional().describe("Filter by workspace ID"),
|
|
136
|
-
projectId: z.string().optional().describe("Filter by project ID"),
|
|
137
|
-
status: z.array(z.enum(["TODO", "IN_PROGRESS", "IN_REVIEW"])).optional()
|
|
138
|
-
.describe("Filter by status. Defaults to all three."),
|
|
139
|
-
priority: z.array(z.enum(["LOW", "MEDIUM", "HIGH", "CRITICAL"])).optional()
|
|
140
|
-
.describe("Filter by priority levels"),
|
|
141
|
-
}),
|
|
142
|
-
handler: async (args: {
|
|
143
|
-
workspaceId?: string;
|
|
144
|
-
projectId?: string;
|
|
145
|
-
status?: ("TODO" | "IN_PROGRESS" | "IN_REVIEW")[];
|
|
146
|
-
priority?: ("LOW" | "MEDIUM" | "HIGH" | "CRITICAL")[];
|
|
147
|
-
}) => {
|
|
148
|
-
const statusFilter = args.status ?? ["TODO", "IN_PROGRESS", "IN_REVIEW"];
|
|
149
|
-
|
|
150
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
151
|
-
const where: any = {
|
|
152
|
-
status: { in: statusFilter },
|
|
153
|
-
// Exclude system tasks tagged with the builtin "Tower" label
|
|
154
|
-
NOT: { labels: { some: { label: { name: "Tower", isBuiltin: true } } } },
|
|
155
|
-
};
|
|
156
|
-
if (args.priority) where.priority = { in: args.priority };
|
|
157
|
-
if (args.projectId) where.projectId = args.projectId;
|
|
158
|
-
if (args.workspaceId) where.project = { workspaceId: args.workspaceId };
|
|
159
|
-
|
|
160
|
-
const tasks = await db.task.findMany({
|
|
161
|
-
where,
|
|
162
|
-
include: {
|
|
163
|
-
project: { include: { workspace: true } },
|
|
164
|
-
labels: { include: { label: true } },
|
|
165
|
-
executions: {
|
|
166
|
-
where: { sessionId: { not: null } },
|
|
167
|
-
orderBy: { createdAt: "desc" },
|
|
168
|
-
take: 1,
|
|
169
|
-
select: { sessionId: true },
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
// Sort by priority severity (CRITICAL first), then by updatedAt desc
|
|
175
|
-
tasks.sort((a, b) =>
|
|
176
|
-
(PRIORITY_ORDER[a.priority] ?? 99) - (PRIORITY_ORDER[b.priority] ?? 99)
|
|
177
|
-
|| b.updatedAt.getTime() - a.updatedAt.getTime()
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
// Group by workspace → project
|
|
181
|
-
type FormattedTask = { id: string; title: string; status: string; priority: string; labels: string[]; createdAt: string; lastSessionId: string | null };
|
|
182
|
-
type ProjEntry = { id: string; name: string; alias: string | null; tasks: FormattedTask[] };
|
|
183
|
-
type WsEntry = { id: string; name: string; projects: Map<string, ProjEntry> };
|
|
184
|
-
|
|
185
|
-
const wsMap = new Map<string, WsEntry>();
|
|
186
|
-
|
|
187
|
-
for (const task of tasks) {
|
|
188
|
-
const ws = task.project.workspace;
|
|
189
|
-
if (!wsMap.has(ws.id)) wsMap.set(ws.id, { id: ws.id, name: ws.name, projects: new Map() });
|
|
190
|
-
const projMap = wsMap.get(ws.id)!.projects;
|
|
191
|
-
const proj = task.project;
|
|
192
|
-
if (!projMap.has(proj.id)) projMap.set(proj.id, { id: proj.id, name: proj.name, alias: proj.alias, tasks: [] });
|
|
193
|
-
projMap.get(proj.id)!.tasks.push({
|
|
194
|
-
id: task.id, title: task.title, status: task.status, priority: task.priority,
|
|
195
|
-
labels: task.labels.map((tl) => tl.label.name),
|
|
196
|
-
createdAt: task.createdAt.toISOString(),
|
|
197
|
-
lastSessionId: task.executions[0]?.sessionId ?? null,
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
const byStatus = { TODO: 0, IN_PROGRESS: 0, IN_REVIEW: 0 };
|
|
202
|
-
const byPriority = { CRITICAL: 0, HIGH: 0, MEDIUM: 0, LOW: 0 };
|
|
203
|
-
for (const t of tasks) {
|
|
204
|
-
if (t.status in byStatus) byStatus[t.status as keyof typeof byStatus]++;
|
|
205
|
-
if (t.priority in byPriority) byPriority[t.priority as keyof typeof byPriority]++;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
return {
|
|
209
|
-
date: new Date().toISOString().slice(0, 10),
|
|
210
|
-
workspaces: Array.from(wsMap.values()).map((ws) => ({
|
|
211
|
-
id: ws.id, name: ws.name,
|
|
212
|
-
projects: Array.from(ws.projects.values()).map((p) => ({
|
|
213
|
-
id: p.id, name: p.name, alias: p.alias, tasks: p.tasks,
|
|
214
|
-
})),
|
|
215
|
-
})),
|
|
216
|
-
stats: { total: tasks.length, byStatus, byPriority },
|
|
217
|
-
};
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { search, type SearchCategory } from "@/lib/search";
|
|
3
|
-
import { readConfigValue } from "@/lib/config-reader";
|
|
4
|
-
|
|
5
|
-
export const searchTools = {
|
|
6
|
-
search: {
|
|
7
|
-
description:
|
|
8
|
-
"Search for tasks, projects, repositories, notes, or assets by a query string. Use category 'all' to search across all types.",
|
|
9
|
-
schema: z.object({
|
|
10
|
-
query: z.string(),
|
|
11
|
-
category: z
|
|
12
|
-
.enum(["task", "project", "repository", "note", "asset", "all"])
|
|
13
|
-
.default("task")
|
|
14
|
-
.optional(),
|
|
15
|
-
}),
|
|
16
|
-
handler: async (args: {
|
|
17
|
-
query: string;
|
|
18
|
-
category?: SearchCategory;
|
|
19
|
-
}) => {
|
|
20
|
-
const [resultLimit, allModeCap, snippetLength] = await Promise.all([
|
|
21
|
-
readConfigValue<number>("search.resultLimit", 20),
|
|
22
|
-
readConfigValue<number>("search.allModeCap", 5),
|
|
23
|
-
readConfigValue<number>("search.snippetLength", 80),
|
|
24
|
-
]);
|
|
25
|
-
return search(args.query, args.category ?? "task", {
|
|
26
|
-
resultLimit,
|
|
27
|
-
allModeCap,
|
|
28
|
-
snippetLength,
|
|
29
|
-
});
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
};
|