tower-studio 0.2.7 → 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.
- 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 +41 -41
- 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 +71 -71
- 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 +41 -41
- 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 +41 -41
- 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 +54 -54
- 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 +82 -82
- 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 +71 -71
- 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 +70 -70
- 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 +41 -41
- 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 +74 -74
- 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 +80 -80
- 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 +59 -59
- 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_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 +1 -1
- 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]__0o8k4pc._.js → [root-of-the-server]__08901f9._.js} +2 -2
- 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]__0zujp5l._.js → [root-of-the-server]__0miur_1._.js} +2 -2
- 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]__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]__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]__0u4gc4b._.js → [root-of-the-server]__121lss.._.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/{_0ysyq9g._.js → _0.knmg-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0f6u19w._.js → _0.oe3b8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_04b71ua._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_05h.8a~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_02v3fjp._.js → _05unqgy._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0_l8.dg._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_07~0_w6._.js → _0a2m~cj._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0b0.-sj._.js → _0d2cdox._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0ds6nk2._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0pd0.8f._.js → _0fq4yrr._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0i4__mf._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0ysygps._.js → _0icu6m~._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0ihq._v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0bw-tx8._.js → _0kx.c-s._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0c-jnbs._.js → _0pu8x.f._.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/{_08w-r6e._.js → _0vnfnib._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0fob8fc._.js → _0xvsyc0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0~80adm._.js +3 -3
- 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 +286 -286
- package/.next/standalone/.next/static/chunks/{0fxm-wv..y_a_.js → 000k30wpair3e.js} +2 -2
- package/.next/standalone/.next/static/chunks/005169or2nxlh.js +1 -0
- package/.next/standalone/.next/static/chunks/{142w-q8.7m3kl.js → 04uepvk5f~_a-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{02edbrlq~2uyx.js → 07vas3ezrfrjg.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0ft77ybyq903..js → 087l367c1psb6.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0v~pz9e87t99b.js → 09m-rcwwlggjy.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0r1mkt5qs~s6m.js → 0h1-tehkx05kz.js} +1 -1
- package/.next/standalone/.next/static/chunks/{05-ui_o~3irq_.js → 0hueiuk3kjujl.js} +2 -2
- package/.next/standalone/.next/static/chunks/{05hls.3r4bz.0.js → 0ikej72py2xo3.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0l3mmc866npw4.js → 0lx08u-wp-gt6.js} +2 -2
- package/.next/standalone/.next/static/chunks/0mu8uzvw4gvpf.js +1 -0
- package/.next/standalone/.next/static/chunks/0ow7ynd7g7ptv.js +1 -0
- package/.next/standalone/.next/static/chunks/{0i55dediewjp5.js → 0szduy0e92e5g.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0w3jww1m3k77x.js → 0szie_5oyakv1.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0bw4ahlj4~l~g.js → 0ur-499l_2jrc.js} +1 -1
- package/.next/standalone/.next/static/chunks/{00.52653v5c~c.js → 0xs0yzxjkoeas.js} +1 -1
- package/.next/standalone/.next/static/chunks/{08~e63d2q~cam.js → 0ynbql~9oq0av.js} +1 -1
- package/.next/standalone/.next/static/chunks/{117qu902jput3.js → 0~88n47ys3due.js} +1 -1
- package/.next/standalone/.next/static/chunks/10nil20v3q7~..js +1 -0
- package/.next/standalone/.next/static/chunks/{0q-u-hhre1uyw.js → 12rh72_2o79jv.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0~27mkhc9s5k2.js → 156si6w7d-_ct.js} +2 -2
- package/.next/standalone/package.json +1 -2
- package/dist/mcp-server.cjs +34 -28
- package/package.json +1 -2
- 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/src_095o8x6._.js +0 -3
- package/.next/standalone/.next/static/chunks/00j0mdc41wa44.js +0 -1
- package/.next/standalone/.next/static/chunks/0nno5if2x1mvs.js +0 -1
- package/.next/standalone/.next/static/chunks/0qazzw-pr_sv7.js +0 -1
- package/.next/standalone/.next/static/chunks/0z01g02xstbqe.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 → 7DBkEq_6oXffs_C5TFLBR}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7DBkEq_6oXffs_C5TFLBR}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7DBkEq_6oXffs_C5TFLBR}/_ssgManifest.js +0 -0
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
-
|
|
3
|
-
vi.mock("../../db", () => ({
|
|
4
|
-
db: {
|
|
5
|
-
task: { findMany: vi.fn() },
|
|
6
|
-
projectNote: { findMany: vi.fn() },
|
|
7
|
-
},
|
|
8
|
-
}));
|
|
9
|
-
|
|
10
|
-
import { db } from "../../db";
|
|
11
|
-
import { reportTools } from "../report-tools";
|
|
12
|
-
|
|
13
|
-
const mockDb = db as {
|
|
14
|
-
task: { findMany: ReturnType<typeof vi.fn> };
|
|
15
|
-
projectNote: { findMany: ReturnType<typeof vi.fn> };
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/** Build a minimal task object matching the daily_summary include clause */
|
|
19
|
-
function makeSummaryTask(overrides: {
|
|
20
|
-
id?: string;
|
|
21
|
-
title?: string;
|
|
22
|
-
status?: string;
|
|
23
|
-
priority?: string;
|
|
24
|
-
updatedAt?: Date;
|
|
25
|
-
project?: object;
|
|
26
|
-
messages?: { content: string; createdAt: Date }[];
|
|
27
|
-
executions?: { startedAt?: Date; status?: string; summary?: string | null }[];
|
|
28
|
-
}) {
|
|
29
|
-
const now = new Date("2026-01-15T10:00:00Z");
|
|
30
|
-
const ws = { id: "ws1", name: "Workspace 1" };
|
|
31
|
-
const proj = { id: "p1", name: "Project 1", alias: null, workspace: ws };
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
id: overrides.id ?? "task1",
|
|
35
|
-
title: overrides.title ?? "Test task",
|
|
36
|
-
status: overrides.status ?? "TODO",
|
|
37
|
-
priority: overrides.priority ?? "MEDIUM",
|
|
38
|
-
updatedAt: overrides.updatedAt ?? now,
|
|
39
|
-
createdAt: now,
|
|
40
|
-
project: overrides.project ?? proj,
|
|
41
|
-
messages: overrides.messages ?? [],
|
|
42
|
-
executions: overrides.executions ?? [],
|
|
43
|
-
labels: [],
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/** Build a minimal task object matching the daily_todo include clause */
|
|
48
|
-
function makeTodoTask(overrides: {
|
|
49
|
-
id?: string;
|
|
50
|
-
title?: string;
|
|
51
|
-
status?: string;
|
|
52
|
-
priority?: string;
|
|
53
|
-
updatedAt?: Date;
|
|
54
|
-
project?: object;
|
|
55
|
-
labels?: { label: { name: string } }[];
|
|
56
|
-
executions?: { sessionId?: string | null }[];
|
|
57
|
-
}) {
|
|
58
|
-
const now = new Date("2026-01-15T10:00:00Z");
|
|
59
|
-
const ws = { id: "ws1", name: "Workspace 1" };
|
|
60
|
-
const proj = { id: "p1", name: "Project 1", alias: null, workspace: ws };
|
|
61
|
-
|
|
62
|
-
return {
|
|
63
|
-
id: overrides.id ?? "task1",
|
|
64
|
-
title: overrides.title ?? "Test task",
|
|
65
|
-
status: overrides.status ?? "TODO",
|
|
66
|
-
priority: overrides.priority ?? "MEDIUM",
|
|
67
|
-
updatedAt: overrides.updatedAt ?? now,
|
|
68
|
-
createdAt: now,
|
|
69
|
-
project: overrides.project ?? proj,
|
|
70
|
-
labels: overrides.labels ?? [],
|
|
71
|
-
executions: overrides.executions ?? [],
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
describe("report-tools (MCP)", () => {
|
|
76
|
-
beforeEach(() => {
|
|
77
|
-
vi.clearAllMocks();
|
|
78
|
-
mockDb.projectNote.findMany.mockResolvedValue([]);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// ── daily_summary ─────────────────────────────────────────────────────────
|
|
82
|
-
|
|
83
|
-
describe("daily_summary", () => {
|
|
84
|
-
it("with date param: uses date range [00:00, next day 00:00) and groups DONE/IN_PROGRESS tasks", async () => {
|
|
85
|
-
const doneTask = makeSummaryTask({ id: "t1", status: "DONE", title: "Done task" });
|
|
86
|
-
const inProgressTask = makeSummaryTask({ id: "t2", status: "IN_PROGRESS", title: "WIP task" });
|
|
87
|
-
mockDb.task.findMany.mockResolvedValue([doneTask, inProgressTask]);
|
|
88
|
-
|
|
89
|
-
const result = await reportTools.daily_summary.handler({ date: "2026-01-15" });
|
|
90
|
-
|
|
91
|
-
// Verify date range filter passed to findMany
|
|
92
|
-
const callArgs = mockDb.task.findMany.mock.calls[0][0];
|
|
93
|
-
const orClauses = callArgs.where.OR;
|
|
94
|
-
const updatedAtClause = orClauses.find((c: Record<string, unknown>) => "updatedAt" in c);
|
|
95
|
-
expect(updatedAtClause).toBeDefined();
|
|
96
|
-
const gte = updatedAtClause.updatedAt.gte as Date;
|
|
97
|
-
const lt = updatedAtClause.updatedAt.lt as Date;
|
|
98
|
-
expect(gte.getHours()).toBe(0);
|
|
99
|
-
expect(gte.getMinutes()).toBe(0);
|
|
100
|
-
const diffMs = lt.getTime() - gte.getTime();
|
|
101
|
-
expect(diffMs).toBe(24 * 60 * 60 * 1000);
|
|
102
|
-
|
|
103
|
-
// Verify grouping
|
|
104
|
-
expect(result.workspaces).toHaveLength(1);
|
|
105
|
-
const ws = result.workspaces[0];
|
|
106
|
-
expect(ws.projects).toHaveLength(1);
|
|
107
|
-
const proj = ws.projects[0];
|
|
108
|
-
expect(proj.completed).toHaveLength(1);
|
|
109
|
-
expect(proj.completed[0].id).toBe("t1");
|
|
110
|
-
expect(proj.inProgress).toHaveLength(1);
|
|
111
|
-
expect(proj.inProgress[0].id).toBe("t2");
|
|
112
|
-
expect(result.stats.totalCompleted).toBe(1);
|
|
113
|
-
expect(result.stats.totalInProgress).toBe(1);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it("without date param: defaults to today (passes Date objects to findMany)", async () => {
|
|
117
|
-
mockDb.task.findMany.mockResolvedValue([]);
|
|
118
|
-
|
|
119
|
-
const before = new Date();
|
|
120
|
-
before.setHours(0, 0, 0, 0);
|
|
121
|
-
await reportTools.daily_summary.handler({});
|
|
122
|
-
const after = new Date();
|
|
123
|
-
after.setHours(0, 0, 0, 0);
|
|
124
|
-
|
|
125
|
-
const callArgs = mockDb.task.findMany.mock.calls[0][0];
|
|
126
|
-
const orClauses = callArgs.where.OR;
|
|
127
|
-
const updatedAtClause = orClauses.find((c: Record<string, unknown>) => "updatedAt" in c);
|
|
128
|
-
const gte = updatedAtClause.updatedAt.gte as Date;
|
|
129
|
-
// gte should be today's midnight (between before and after)
|
|
130
|
-
expect(gte.getTime()).toBeGreaterThanOrEqual(before.getTime());
|
|
131
|
-
expect(gte.getTime()).toBeLessThanOrEqual(after.getTime());
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
it("CANCELLED tasks are excluded from completed and inProgress", async () => {
|
|
135
|
-
const cancelledTask = makeSummaryTask({ id: "t1", status: "CANCELLED" });
|
|
136
|
-
mockDb.task.findMany.mockResolvedValue([cancelledTask]);
|
|
137
|
-
|
|
138
|
-
const result = await reportTools.daily_summary.handler({});
|
|
139
|
-
|
|
140
|
-
expect(result.stats.totalCompleted).toBe(0);
|
|
141
|
-
expect(result.stats.totalInProgress).toBe(0);
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
it("empty result: returns empty workspaces array with zero stats", async () => {
|
|
145
|
-
mockDb.task.findMany.mockResolvedValue([]);
|
|
146
|
-
|
|
147
|
-
const result = await reportTools.daily_summary.handler({});
|
|
148
|
-
|
|
149
|
-
expect(result.workspaces).toHaveLength(0);
|
|
150
|
-
expect(result.stats.totalCompleted).toBe(0);
|
|
151
|
-
expect(result.stats.totalInProgress).toBe(0);
|
|
152
|
-
expect(result.stats.totalActive).toBe(0);
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
// ── daily_todo ────────────────────────────────────────────────────────────
|
|
157
|
-
|
|
158
|
-
describe("daily_todo", () => {
|
|
159
|
-
it("default call: status filter is [TODO, IN_PROGRESS, IN_REVIEW]", async () => {
|
|
160
|
-
mockDb.task.findMany.mockResolvedValue([]);
|
|
161
|
-
|
|
162
|
-
await reportTools.daily_todo.handler({});
|
|
163
|
-
|
|
164
|
-
const where = mockDb.task.findMany.mock.calls[0][0].where;
|
|
165
|
-
expect(where.status).toEqual({ in: ["TODO", "IN_PROGRESS", "IN_REVIEW"] });
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
it("with workspaceId: where clause includes project.workspaceId", async () => {
|
|
169
|
-
mockDb.task.findMany.mockResolvedValue([]);
|
|
170
|
-
|
|
171
|
-
await reportTools.daily_todo.handler({ workspaceId: "ws1" });
|
|
172
|
-
|
|
173
|
-
const where = mockDb.task.findMany.mock.calls[0][0].where;
|
|
174
|
-
expect(where.project).toEqual({ workspaceId: "ws1" });
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it("with projectId: where clause includes projectId", async () => {
|
|
178
|
-
mockDb.task.findMany.mockResolvedValue([]);
|
|
179
|
-
|
|
180
|
-
await reportTools.daily_todo.handler({ projectId: "p1" });
|
|
181
|
-
|
|
182
|
-
const where = mockDb.task.findMany.mock.calls[0][0].where;
|
|
183
|
-
expect(where.projectId).toBe("p1");
|
|
184
|
-
});
|
|
185
|
-
|
|
186
|
-
it("with priority filter: where clause includes priority.in", async () => {
|
|
187
|
-
mockDb.task.findMany.mockResolvedValue([]);
|
|
188
|
-
|
|
189
|
-
await reportTools.daily_todo.handler({ priority: ["CRITICAL", "HIGH"] });
|
|
190
|
-
|
|
191
|
-
const where = mockDb.task.findMany.mock.calls[0][0].where;
|
|
192
|
-
expect(where.priority).toEqual({ in: ["CRITICAL", "HIGH"] });
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
it("stats computation: byStatus and byPriority match returned tasks", async () => {
|
|
196
|
-
const t1 = makeTodoTask({ id: "t1", status: "TODO", priority: "CRITICAL" });
|
|
197
|
-
const t2 = makeTodoTask({ id: "t2", status: "IN_PROGRESS", priority: "HIGH" });
|
|
198
|
-
const t3 = makeTodoTask({ id: "t3", status: "IN_REVIEW", priority: "CRITICAL" });
|
|
199
|
-
mockDb.task.findMany.mockResolvedValue([t1, t2, t3]);
|
|
200
|
-
|
|
201
|
-
const result = await reportTools.daily_todo.handler({});
|
|
202
|
-
|
|
203
|
-
expect(result.stats.total).toBe(3);
|
|
204
|
-
expect(result.stats.byStatus.TODO).toBe(1);
|
|
205
|
-
expect(result.stats.byStatus.IN_PROGRESS).toBe(1);
|
|
206
|
-
expect(result.stats.byStatus.IN_REVIEW).toBe(1);
|
|
207
|
-
expect(result.stats.byPriority.CRITICAL).toBe(2);
|
|
208
|
-
expect(result.stats.byPriority.HIGH).toBe(1);
|
|
209
|
-
expect(result.stats.byPriority.MEDIUM).toBe(0);
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
});
|
|
@@ -1,418 +0,0 @@
|
|
|
1
|
-
// @vitest-environment node
|
|
2
|
-
import { vi, describe, it, expect, beforeEach } from "vitest";
|
|
3
|
-
|
|
4
|
-
// Mock db BEFORE imports — vi.mock is hoisted but we need the mock available
|
|
5
|
-
const mockTx = {
|
|
6
|
-
task: {
|
|
7
|
-
update: vi.fn(),
|
|
8
|
-
},
|
|
9
|
-
taskLabel: {
|
|
10
|
-
deleteMany: vi.fn(),
|
|
11
|
-
createMany: vi.fn(),
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
vi.mock("../../db", () => ({
|
|
16
|
-
db: {
|
|
17
|
-
task: {
|
|
18
|
-
findMany: vi.fn(),
|
|
19
|
-
create: vi.fn(),
|
|
20
|
-
update: vi.fn(),
|
|
21
|
-
delete: vi.fn(),
|
|
22
|
-
},
|
|
23
|
-
taskLabel: {
|
|
24
|
-
createMany: vi.fn(),
|
|
25
|
-
deleteMany: vi.fn(),
|
|
26
|
-
},
|
|
27
|
-
projectAsset: {
|
|
28
|
-
create: vi.fn(),
|
|
29
|
-
},
|
|
30
|
-
project: {
|
|
31
|
-
findUnique: vi.fn(),
|
|
32
|
-
},
|
|
33
|
-
$transaction: vi.fn(),
|
|
34
|
-
},
|
|
35
|
-
}));
|
|
36
|
-
|
|
37
|
-
vi.mock("child_process", () => ({
|
|
38
|
-
execFileSync: vi.fn(),
|
|
39
|
-
}));
|
|
40
|
-
vi.mock("next/cache", () => ({ revalidatePath: vi.fn() }));
|
|
41
|
-
vi.mock("@/actions/task-actions", () => ({
|
|
42
|
-
updateTaskStatus: vi.fn(async (taskId: string, status: string) => ({ id: taskId, status })),
|
|
43
|
-
}));
|
|
44
|
-
|
|
45
|
-
vi.mock("fs", () => ({
|
|
46
|
-
existsSync: vi.fn(),
|
|
47
|
-
statSync: vi.fn(),
|
|
48
|
-
copyFileSync: vi.fn(),
|
|
49
|
-
mkdirSync: vi.fn(),
|
|
50
|
-
}));
|
|
51
|
-
|
|
52
|
-
vi.mock("@/lib/file-utils", () => ({
|
|
53
|
-
stripCacheUuidSuffix: vi.fn((filename: string) => filename.replace(/-[0-9a-f]{8}(\.[^.]+)$/i, "$1")),
|
|
54
|
-
isAssistantCachePath: vi.fn(),
|
|
55
|
-
}));
|
|
56
|
-
|
|
57
|
-
import { db } from "../../db";
|
|
58
|
-
import { execFileSync } from "child_process";
|
|
59
|
-
import { existsSync, statSync, copyFileSync, mkdirSync } from "fs";
|
|
60
|
-
import { stripCacheUuidSuffix, isAssistantCachePath } from "@/lib/file-utils";
|
|
61
|
-
import { taskTools } from "../task-tools";
|
|
62
|
-
|
|
63
|
-
const mockDb = db as {
|
|
64
|
-
task: {
|
|
65
|
-
findMany: ReturnType<typeof vi.fn>;
|
|
66
|
-
create: ReturnType<typeof vi.fn>;
|
|
67
|
-
update: ReturnType<typeof vi.fn>;
|
|
68
|
-
delete: ReturnType<typeof vi.fn>;
|
|
69
|
-
};
|
|
70
|
-
taskLabel: {
|
|
71
|
-
createMany: ReturnType<typeof vi.fn>;
|
|
72
|
-
deleteMany: ReturnType<typeof vi.fn>;
|
|
73
|
-
};
|
|
74
|
-
projectAsset: {
|
|
75
|
-
create: ReturnType<typeof vi.fn>;
|
|
76
|
-
};
|
|
77
|
-
project: {
|
|
78
|
-
findUnique: ReturnType<typeof vi.fn>;
|
|
79
|
-
};
|
|
80
|
-
$transaction: ReturnType<typeof vi.fn>;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const mockExecFileSync = execFileSync as ReturnType<typeof vi.fn>;
|
|
84
|
-
const mockExistsSync = existsSync as ReturnType<typeof vi.fn>;
|
|
85
|
-
const mockStatSync = statSync as ReturnType<typeof vi.fn>;
|
|
86
|
-
const mockCopyFileSync = copyFileSync as ReturnType<typeof vi.fn>;
|
|
87
|
-
const mockMkdirSync = mkdirSync as ReturnType<typeof vi.fn>;
|
|
88
|
-
const mockIsAssistantCachePath = isAssistantCachePath as ReturnType<typeof vi.fn>;
|
|
89
|
-
const mockStripCacheUuidSuffix = stripCacheUuidSuffix as ReturnType<typeof vi.fn>;
|
|
90
|
-
|
|
91
|
-
describe("task-tools", () => {
|
|
92
|
-
beforeEach(() => {
|
|
93
|
-
vi.clearAllMocks();
|
|
94
|
-
// Default $transaction: execute callback with mockTx
|
|
95
|
-
mockDb.$transaction.mockImplementation(async (cb: (tx: typeof mockTx) => Promise<unknown>) => cb(mockTx));
|
|
96
|
-
mockTx.task.update.mockResolvedValue({});
|
|
97
|
-
mockTx.taskLabel.deleteMany.mockResolvedValue({});
|
|
98
|
-
mockTx.taskLabel.createMany.mockResolvedValue({});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// ─── list_tasks ──────────────────────────────────────────────────────────
|
|
102
|
-
|
|
103
|
-
describe("list_tasks", () => {
|
|
104
|
-
it("calls findMany with projectId and flattens labels", async () => {
|
|
105
|
-
const mockTasks = [
|
|
106
|
-
{
|
|
107
|
-
id: "task1",
|
|
108
|
-
title: "Test Task",
|
|
109
|
-
labels: [
|
|
110
|
-
{ label: { id: "label1", name: "Bug", color: "#ff0000" } },
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
];
|
|
114
|
-
mockDb.task.findMany.mockResolvedValue(mockTasks);
|
|
115
|
-
|
|
116
|
-
const result = await taskTools.list_tasks.handler({ projectId: "proj1" });
|
|
117
|
-
|
|
118
|
-
expect(mockDb.task.findMany).toHaveBeenCalledWith(
|
|
119
|
-
expect.objectContaining({
|
|
120
|
-
where: {
|
|
121
|
-
projectId: "proj1",
|
|
122
|
-
NOT: { labels: { some: { label: { name: "Tower", isBuiltin: true } } } },
|
|
123
|
-
},
|
|
124
|
-
})
|
|
125
|
-
);
|
|
126
|
-
expect(result[0].labels).toEqual([{ id: "label1", name: "Bug", color: "#ff0000" }]);
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it("passes status filter to findMany when provided", async () => {
|
|
130
|
-
mockDb.task.findMany.mockResolvedValue([]);
|
|
131
|
-
|
|
132
|
-
await taskTools.list_tasks.handler({ projectId: "proj1", status: "IN_PROGRESS" });
|
|
133
|
-
|
|
134
|
-
expect(mockDb.task.findMany).toHaveBeenCalledWith(
|
|
135
|
-
expect.objectContaining({
|
|
136
|
-
where: {
|
|
137
|
-
projectId: "proj1",
|
|
138
|
-
status: "IN_PROGRESS",
|
|
139
|
-
NOT: { labels: { some: { label: { name: "Tower", isBuiltin: true } } } },
|
|
140
|
-
},
|
|
141
|
-
})
|
|
142
|
-
);
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// ─── create_task ──────────────────────────────────────────────────────────
|
|
147
|
-
|
|
148
|
-
describe("create_task", () => {
|
|
149
|
-
it("creates task with MEDIUM priority and TODO status by default", async () => {
|
|
150
|
-
const createdTask = { id: "task1", title: "My Task", priority: "MEDIUM", status: "TODO" };
|
|
151
|
-
mockDb.task.create.mockResolvedValue(createdTask);
|
|
152
|
-
|
|
153
|
-
const result = await taskTools.create_task.handler({
|
|
154
|
-
projectId: "proj1",
|
|
155
|
-
title: "My Task",
|
|
156
|
-
autoStart: false,
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
expect(mockDb.task.create).toHaveBeenCalledWith({
|
|
160
|
-
data: expect.objectContaining({
|
|
161
|
-
title: "My Task",
|
|
162
|
-
projectId: "proj1",
|
|
163
|
-
priority: "MEDIUM",
|
|
164
|
-
status: "TODO",
|
|
165
|
-
}),
|
|
166
|
-
});
|
|
167
|
-
expect(result).toEqual(createdTask);
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
it("creates TaskLabel records when labelIds provided", async () => {
|
|
171
|
-
const createdTask = { id: "task1", title: "Labeled Task" };
|
|
172
|
-
mockDb.task.create.mockResolvedValue(createdTask);
|
|
173
|
-
|
|
174
|
-
await taskTools.create_task.handler({
|
|
175
|
-
projectId: "proj1",
|
|
176
|
-
title: "Labeled Task",
|
|
177
|
-
labelIds: ["lbl1", "lbl2"],
|
|
178
|
-
autoStart: false,
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
expect(mockDb.taskLabel.createMany).toHaveBeenCalledWith({
|
|
182
|
-
data: [
|
|
183
|
-
{ taskId: "task1", labelId: "lbl1" },
|
|
184
|
-
{ taskId: "task1", labelId: "lbl2" },
|
|
185
|
-
],
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
it("copies reference files, strips UUID suffix for cache paths, creates ProjectAsset", async () => {
|
|
190
|
-
const createdTask = { id: "task1", title: "With Ref", description: "desc" };
|
|
191
|
-
mockDb.task.create.mockResolvedValue(createdTask);
|
|
192
|
-
mockDb.task.update.mockResolvedValue({ ...createdTask });
|
|
193
|
-
mockDb.projectAsset.create.mockResolvedValue({});
|
|
194
|
-
|
|
195
|
-
// existsSync: true for source file, false for dest (no collision)
|
|
196
|
-
mockExistsSync.mockImplementation((p: string) => {
|
|
197
|
-
if (p === "/cache/assistant/2026-04/images/design-a1b2c3d4.png") return true; // source exists
|
|
198
|
-
return false; // dest does not exist
|
|
199
|
-
});
|
|
200
|
-
mockStatSync.mockReturnValue({ isFile: () => true, size: 1024 });
|
|
201
|
-
mockIsAssistantCachePath.mockReturnValue(true);
|
|
202
|
-
mockStripCacheUuidSuffix.mockReturnValue("design.png");
|
|
203
|
-
|
|
204
|
-
await taskTools.create_task.handler({
|
|
205
|
-
projectId: "proj1",
|
|
206
|
-
title: "With Ref",
|
|
207
|
-
references: ["/cache/assistant/2026-04/images/design-a1b2c3d4.png"],
|
|
208
|
-
autoStart: false,
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
expect(mockIsAssistantCachePath).toHaveBeenCalledWith("/cache/assistant/2026-04/images/design-a1b2c3d4.png");
|
|
212
|
-
expect(mockStripCacheUuidSuffix).toHaveBeenCalledWith("design-a1b2c3d4.png");
|
|
213
|
-
expect(mockCopyFileSync).toHaveBeenCalled();
|
|
214
|
-
expect(mockDb.projectAsset.create).toHaveBeenCalledWith(
|
|
215
|
-
expect.objectContaining({
|
|
216
|
-
data: expect.objectContaining({
|
|
217
|
-
filename: "design.png",
|
|
218
|
-
projectId: "proj1",
|
|
219
|
-
taskId: "task1",
|
|
220
|
-
}),
|
|
221
|
-
})
|
|
222
|
-
);
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
it("uses counter suffix for cache file collision", async () => {
|
|
226
|
-
const createdTask = { id: "task1", title: "Collision", description: null };
|
|
227
|
-
mockDb.task.create.mockResolvedValue(createdTask);
|
|
228
|
-
mockDb.task.update.mockResolvedValue({ ...createdTask });
|
|
229
|
-
mockDb.projectAsset.create.mockResolvedValue({});
|
|
230
|
-
|
|
231
|
-
mockIsAssistantCachePath.mockReturnValue(true);
|
|
232
|
-
mockStripCacheUuidSuffix.mockReturnValue("design.png");
|
|
233
|
-
|
|
234
|
-
// existsSync: source true, dest "design.png" true (collision), "design (1).png" false
|
|
235
|
-
mockExistsSync.mockImplementation((p: string) => {
|
|
236
|
-
if (p === "/cache/design-a1b2c3d4.png") return true;
|
|
237
|
-
if (typeof p === "string" && p.endsWith("design.png")) return true;
|
|
238
|
-
if (typeof p === "string" && p.includes("design (1).png")) return false;
|
|
239
|
-
return false;
|
|
240
|
-
});
|
|
241
|
-
mockStatSync.mockReturnValue({ isFile: () => true, size: 512 });
|
|
242
|
-
|
|
243
|
-
await taskTools.create_task.handler({
|
|
244
|
-
projectId: "proj1",
|
|
245
|
-
title: "Collision",
|
|
246
|
-
references: ["/cache/design-a1b2c3d4.png"],
|
|
247
|
-
autoStart: false,
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
// Should have used "design (1).png" as the dest filename
|
|
251
|
-
expect(mockCopyFileSync).toHaveBeenCalled();
|
|
252
|
-
const copyCall = mockCopyFileSync.mock.calls[0];
|
|
253
|
-
expect(copyCall[1]).toContain("design (1).png");
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
it("auto-detects baseBranch via git when useWorktree=true and no baseBranch given", async () => {
|
|
257
|
-
const createdTask = { id: "task1", title: "Worktree Task" };
|
|
258
|
-
mockDb.task.create.mockResolvedValue(createdTask);
|
|
259
|
-
mockDb.project.findUnique.mockResolvedValue({ localPath: "/home/user/project" });
|
|
260
|
-
mockExecFileSync.mockReturnValue("main\n");
|
|
261
|
-
|
|
262
|
-
await taskTools.create_task.handler({
|
|
263
|
-
projectId: "proj1",
|
|
264
|
-
title: "Worktree Task",
|
|
265
|
-
useWorktree: true,
|
|
266
|
-
autoStart: false,
|
|
267
|
-
});
|
|
268
|
-
|
|
269
|
-
expect(mockDb.project.findUnique).toHaveBeenCalledWith({
|
|
270
|
-
where: { id: "proj1" },
|
|
271
|
-
select: { localPath: true },
|
|
272
|
-
});
|
|
273
|
-
expect(mockExecFileSync).toHaveBeenCalledWith(
|
|
274
|
-
"git",
|
|
275
|
-
["branch", "--show-current"],
|
|
276
|
-
expect.objectContaining({ cwd: "/home/user/project" })
|
|
277
|
-
);
|
|
278
|
-
expect(mockDb.task.create).toHaveBeenCalledWith(
|
|
279
|
-
expect.objectContaining({
|
|
280
|
-
data: expect.objectContaining({ baseBranch: "main" }),
|
|
281
|
-
})
|
|
282
|
-
);
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
it("uses provided baseBranch and skips git detection when explicit baseBranch given", async () => {
|
|
286
|
-
const createdTask = { id: "task1", title: "Explicit Branch" };
|
|
287
|
-
mockDb.task.create.mockResolvedValue(createdTask);
|
|
288
|
-
|
|
289
|
-
await taskTools.create_task.handler({
|
|
290
|
-
projectId: "proj1",
|
|
291
|
-
title: "Explicit Branch",
|
|
292
|
-
useWorktree: true,
|
|
293
|
-
baseBranch: "feature/my-branch",
|
|
294
|
-
autoStart: false,
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
expect(mockExecFileSync).not.toHaveBeenCalled();
|
|
298
|
-
expect(mockDb.project.findUnique).not.toHaveBeenCalled();
|
|
299
|
-
expect(mockDb.task.create).toHaveBeenCalledWith(
|
|
300
|
-
expect.objectContaining({
|
|
301
|
-
data: expect.objectContaining({ baseBranch: "feature/my-branch" }),
|
|
302
|
-
})
|
|
303
|
-
);
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
it("calls fetch to start execution when autoStart=true", async () => {
|
|
307
|
-
const createdTask = { id: "task-autostart-01", title: "AutoStart Task", description: "start me" };
|
|
308
|
-
mockDb.task.create.mockResolvedValue(createdTask);
|
|
309
|
-
|
|
310
|
-
const mockFetchResponse = { ok: true, json: vi.fn().mockResolvedValue({ executionId: "exec1" }) };
|
|
311
|
-
global.fetch = vi.fn().mockResolvedValue(mockFetchResponse);
|
|
312
|
-
|
|
313
|
-
await taskTools.create_task.handler({
|
|
314
|
-
projectId: "proj1",
|
|
315
|
-
title: "AutoStart Task",
|
|
316
|
-
description: "start me",
|
|
317
|
-
autoStart: true,
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
// Prompt is the task title — startPtyExecution injects the description as context separately.
|
|
321
|
-
expect(global.fetch).toHaveBeenCalledWith(
|
|
322
|
-
expect.stringContaining("/api/internal/terminal/task-autostart-01/start"),
|
|
323
|
-
expect.objectContaining({
|
|
324
|
-
method: "POST",
|
|
325
|
-
body: expect.stringContaining("AutoStart Task"),
|
|
326
|
-
})
|
|
327
|
-
);
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
it("does NOT call fetch when autoStart=false", async () => {
|
|
331
|
-
const createdTask = { id: "task2", title: "No Auto" };
|
|
332
|
-
mockDb.task.create.mockResolvedValue(createdTask);
|
|
333
|
-
global.fetch = vi.fn();
|
|
334
|
-
|
|
335
|
-
await taskTools.create_task.handler({
|
|
336
|
-
projectId: "proj1",
|
|
337
|
-
title: "No Auto",
|
|
338
|
-
autoStart: false,
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
expect(global.fetch).not.toHaveBeenCalled();
|
|
342
|
-
});
|
|
343
|
-
});
|
|
344
|
-
|
|
345
|
-
// ─── update_task ──────────────────────────────────────────────────────────
|
|
346
|
-
|
|
347
|
-
describe("update_task", () => {
|
|
348
|
-
it("calls db.task.update with provided fields", async () => {
|
|
349
|
-
const updatedTask = { id: "task1", title: "Updated" };
|
|
350
|
-
mockTx.task.update.mockResolvedValue(updatedTask);
|
|
351
|
-
|
|
352
|
-
const result = await taskTools.update_task.handler({
|
|
353
|
-
taskId: "task1",
|
|
354
|
-
title: "Updated",
|
|
355
|
-
priority: "HIGH",
|
|
356
|
-
});
|
|
357
|
-
|
|
358
|
-
expect(mockDb.$transaction).toHaveBeenCalled();
|
|
359
|
-
expect(mockTx.task.update).toHaveBeenCalledWith({
|
|
360
|
-
where: { id: "task1" },
|
|
361
|
-
data: { title: "Updated", priority: "HIGH" },
|
|
362
|
-
});
|
|
363
|
-
expect(result).toEqual(updatedTask);
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
it("deletes existing labels then creates new ones when labelIds provided", async () => {
|
|
367
|
-
const callOrder: string[] = [];
|
|
368
|
-
mockTx.task.update.mockResolvedValue({ id: "task1" });
|
|
369
|
-
mockTx.taskLabel.deleteMany.mockImplementation(() => {
|
|
370
|
-
callOrder.push("deleteMany");
|
|
371
|
-
return Promise.resolve({});
|
|
372
|
-
});
|
|
373
|
-
mockTx.taskLabel.createMany.mockImplementation(() => {
|
|
374
|
-
callOrder.push("createMany");
|
|
375
|
-
return Promise.resolve({});
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
await taskTools.update_task.handler({
|
|
379
|
-
taskId: "task1",
|
|
380
|
-
labelIds: ["lbl1", "lbl2"],
|
|
381
|
-
});
|
|
382
|
-
|
|
383
|
-
expect(mockTx.taskLabel.deleteMany).toHaveBeenCalledWith({ where: { taskId: "task1" } });
|
|
384
|
-
expect(mockTx.taskLabel.createMany).toHaveBeenCalledWith({
|
|
385
|
-
data: [
|
|
386
|
-
{ taskId: "task1", labelId: "lbl1" },
|
|
387
|
-
{ taskId: "task1", labelId: "lbl2" },
|
|
388
|
-
],
|
|
389
|
-
});
|
|
390
|
-
expect(callOrder).toEqual(["deleteMany", "createMany"]);
|
|
391
|
-
});
|
|
392
|
-
});
|
|
393
|
-
|
|
394
|
-
// ─── move_task ────────────────────────────────────────────────────────────
|
|
395
|
-
|
|
396
|
-
describe("move_task", () => {
|
|
397
|
-
it("delegates to updateTaskStatus", async () => {
|
|
398
|
-
const result = await taskTools.move_task.handler({ taskId: "task1", status: "DONE" });
|
|
399
|
-
|
|
400
|
-
const { updateTaskStatus } = await import("@/actions/task-actions");
|
|
401
|
-
expect(updateTaskStatus).toHaveBeenCalledWith("task1", "DONE");
|
|
402
|
-
expect(result).toEqual({ id: "task1", status: "DONE" });
|
|
403
|
-
});
|
|
404
|
-
});
|
|
405
|
-
|
|
406
|
-
// ─── delete_task ──────────────────────────────────────────────────────────
|
|
407
|
-
|
|
408
|
-
describe("delete_task", () => {
|
|
409
|
-
it("deletes task and returns confirmation", async () => {
|
|
410
|
-
mockDb.task.delete.mockResolvedValue({ id: "task1" });
|
|
411
|
-
|
|
412
|
-
const result = await taskTools.delete_task.handler({ taskId: "task1" });
|
|
413
|
-
|
|
414
|
-
expect(mockDb.task.delete).toHaveBeenCalledWith({ where: { id: "task1" } });
|
|
415
|
-
expect(result).toEqual({ deleted: true, taskId: "task1" });
|
|
416
|
-
});
|
|
417
|
-
});
|
|
418
|
-
});
|