tower-studio 0.1.13 → 0.1.15
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/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/diagnostics/route-bundle-stats.json +39 -39
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +23 -23
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +13 -13
- package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +13 -13
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +13 -13
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +8 -8
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/missions/page/server-reference-manifest.json +45 -45
- package/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/onboarding/page/server-reference-manifest.json +23 -23
- package/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding.html +1 -1
- package/.next/server/app/onboarding.rsc +15 -15
- package/.next/server/app/onboarding.segments/_full.segment.rsc +15 -15
- package/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
- package/.next/server/app/onboarding.segments/_index.segment.rsc +8 -8
- package/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
- package/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/page/server-reference-manifest.json +23 -23
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/settings/page/server-reference-manifest.json +32 -32
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +15 -15
- package/.next/server/app/settings.segments/_full.segment.rsc +15 -15
- package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_index.segment.rsc +8 -8
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +77 -77
- package/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +62 -62
- package/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +59 -59
- package/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +51 -51
- package/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +23 -23
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +52 -52
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/page/server-reference-manifest.json +41 -41
- package/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/0uz~_next_dist_esm_build_templates_app-route_05yec2y.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0~33o~m._.js +2 -2
- package/.next/server/chunks/project_f_tower_0n1s3ym._.js +1 -1
- package/.next/server/chunks/project_f_tower_src_11e.cv5._.js +1 -1
- package/.next/server/chunks/ssr/04uy_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_01.s1p0._.js +1 -1
- package/.next/server/chunks/ssr/0y0r_f_tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0n4g3bn._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__06qzctf._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__0p59u95._.js → [root-of-the-server]__0fb0m0v._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0ffdrwp._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__118z55s._.js → [root-of-the-server]__0fp7reb._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0fwuc5u._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0i4rk9v._.js +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0nmyvwk._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0w7gbe7._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0y3o4rp._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__11j4k9o._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__13cjs8r._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__13eo85g._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0.txwd8._.js +1 -1
- package/.next/server/chunks/ssr/{project_f_tower_103i_mo._.js → project_f_tower_06z7x~2._.js} +2 -2
- package/.next/server/chunks/ssr/{project_f_tower_0d_85uz._.js → project_f_tower_08d6__q._.js} +2 -2
- package/.next/server/chunks/ssr/{project_f_tower_0qe3y7w._.js → project_f_tower_0arf7nr._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_0f0-wva._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0hgtev9._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0ivvjwd._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0jy~1uf._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0l6ssf8._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0o5.y1e._.js +1 -1
- package/.next/server/chunks/ssr/{project_f_tower_0gp-92y._.js → project_f_tower_0qepwa~._.js} +2 -2
- package/.next/server/chunks/ssr/{project_f_tower_11iv6rj._.js → project_f_tower_0u8bo7w._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_0ym-aea._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_135-_23._.js +3 -0
- package/.next/server/chunks/ssr/{project_f_tower_src_0dhz712._.js → project_f_tower_src_0w26c.x._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js +2 -2
- package/.next/server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_settings_page_tsx_0oo06~d._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0jmj1xz._.js +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +191 -191
- package/.next/static/chunks/0-ggl6l3h5syr.js +1 -0
- package/.next/static/chunks/{160iuo21rl~gx.js → 05_0-v~c00b__.js} +1 -1
- package/.next/static/chunks/{0b2l7e_-hz6uu.js → 05tpf5j-jft-k.js} +1 -1
- package/.next/static/chunks/{11y66l77sw_f_.js → 09wk17shlbfp6.js} +1 -1
- package/.next/static/chunks/{150hyh9in9gbd.js → 0_-rw81.wbmu..js} +2 -2
- package/.next/static/chunks/{0ufq5z-zsc_rq.js → 0_vexk9jnxj9q.js} +1 -1
- package/.next/static/chunks/{0uvcabj7_ht1m.js → 0gpckquc5j5cx.js} +1 -1
- package/.next/static/chunks/0h0m-v8uoeq~u.js +1 -0
- package/.next/static/chunks/{0i-bk-_pxq3kf.js → 0jz83jbb6_ldj.js} +1 -1
- package/.next/static/chunks/{0zk37-fhd4h6q.js → 0n3o6vvrc4ks4.js} +1 -1
- package/.next/static/chunks/0nvuuwr.v3r4k.js +1 -0
- package/.next/static/chunks/{0v6j_niujykvw.js → 0qz_w~ilkw07_.js} +1 -1
- package/.next/static/chunks/{0svo2_2.iajx0.js → 0ynxf.i-o3-xn.js} +1 -1
- package/.next/static/chunks/0zio-v5989p.b.js +1 -0
- package/.next/static/chunks/12x6kubkc37zq.js +1 -0
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/bin/tower.mjs +6 -0
- package/package.json +2 -4
- package/scripts/init-db.ts +17 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0ukbsy0._.js +0 -3
- package/.next/server/chunks/ssr/project_f_tower_0fdpm0.._.js +0 -3
- package/.next/static/chunks/09k2v2gb9asa~.js +0 -1
- package/.next/static/chunks/0d8czythhy15~.js +0 -1
- package/.next/static/chunks/0hbu0b_cpu234.js +0 -1
- package/.next/static/chunks/0qz9.02.c_xy9.js +0 -1
- package/.next/static/chunks/0s.v9zvpavx.p.js +0 -1
- /package/.next/static/{z3fBPUSyN4JFEFJowhSmx → QCWJhjbC4McTn-0CAT1Gx}/_buildManifest.js +0 -0
- /package/.next/static/{z3fBPUSyN4JFEFJowhSmx → QCWJhjbC4McTn-0CAT1Gx}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{z3fBPUSyN4JFEFJowhSmx → QCWJhjbC4McTn-0CAT1Gx}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[772462,a=>a.a(async(b,c)=>{try{a.i(279254),a.i(30292);var d=a.i(322220),e=a.i(727977);a.i(198433),a.i(541587);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),301225,a=>a.a(async(b,c)=>{try{var d=a.i(772462),e=a.i(279254),f=a.i(30292),g=a.i(322220),h=a.i(727977),i=a.i(198433),j=a.i(541587),k=b([d,g,h]);[d,g,h]=k.then?(await k)():k,a.s(["
|
|
1
|
+
module.exports=[772462,a=>a.a(async(b,c)=>{try{a.i(279254),a.i(30292);var d=a.i(322220),e=a.i(727977);a.i(198433),a.i(541587);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),301225,a=>a.a(async(b,c)=>{try{var d=a.i(772462),e=a.i(279254),f=a.i(30292),g=a.i(322220),h=a.i(727977),i=a.i(198433),j=a.i(541587),k=b([d,g,h]);[d,g,h]=k.then?(await k)():k,a.s(["0006200c83d8442fbd59f81b786b487a3951f59711",()=>h.getActualWsPort,"00d25064e3453bbc7f75d8655b61c851e40495993d",()=>j.getOnboardingStatus,"400adfcaf990bb17df86e8909a3e8a0aede992d1ae",()=>j.dispatchTaskCompletionEvent,"403e569967f7e40ef9f95a932fd1402ccf721dc22e",()=>f.getLabelsForWorkspace,"405fdc9c4d8b06477fa2fab70470ea3bcd09a3af4e",()=>f.createLabel,"406f4c33d6ee0b57f32ef36912f062f165599174b0",()=>h.resolveGitLocalPath,"407180c0ec858d00a140027fe8fa1fb3b5509c7e10",()=>j.setOnboardingProgress,"407b2af6329533534febb291b9b6995ca0c57ecfb6",()=>e.createWorkspace,"40b290a8b723e5d9ae2efac5ba686075fd0e43db66",()=>e.createProject,"40d0c2487c54b35bf5f33d97d9b22357244e5f649c",()=>j.completeOnboarding,"40d22d8522ddcd2962bee63eb58d49f34d0df34faf",()=>i.checkMigrationSafety,"40d7736a6bd6d01f427300af149cbed5f8178fd0b7",()=>e.deleteWorkspace,"40f99af0c2ef3e8f82b39d8517d51f004fa12d9445",()=>f.deleteLabel,"6021975fc50673c7323391469cb58b8009e8ef58d6",()=>i.analyzeProjectDirectory,"602d7a01b7b9836d416f35bce2820d9c6b173d9c02",()=>h.getConfigValue,"60557d38533851a85e3b22aff36176ee7e8ce42871",()=>e.updateWorkspace,"608f69f95a3beba367f60aa9887945df91c205a5a8",()=>g.globalSearch,"60c9debab62ab636e3bb82d67fe9d032e6722bba52",()=>i.migrateProjectPath,"60e717b64589146310c68266b1abebb0b6fcf06a70",()=>h.setConfigValue]),c()}catch(a){c(a)}},!1),939768,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__012ko5_._.js"].map(b=>a.l(b))).then(()=>b(326575)))},585988,a=>{a.v(a=>Promise.resolve().then(()=>a(264572)))},908462,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0xe9b6_._.js"].map(b=>a.l(b))).then(()=>b(961374)))},302452,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__025.0xa._.js"].map(b=>a.l(b))).then(()=>b(396477)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=project_f_tower_0l6ssf8._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[638e3,a=>a.a(async(b,c)=>{try{a.i(279254),a.i(30292);var d=a.i(322220),e=a.i(727977);a.i(198433),a.i(541587);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),444574,a=>a.a(async(b,c)=>{try{var d=a.i(638e3),e=a.i(279254),f=a.i(30292),g=a.i(322220),h=a.i(727977),i=a.i(198433),j=a.i(541587),k=b([d,g,h]);[d,g,h]=k.then?(await k)():k,a.s(["
|
|
1
|
+
module.exports=[638e3,a=>a.a(async(b,c)=>{try{a.i(279254),a.i(30292);var d=a.i(322220),e=a.i(727977);a.i(198433),a.i(541587);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),444574,a=>a.a(async(b,c)=>{try{var d=a.i(638e3),e=a.i(279254),f=a.i(30292),g=a.i(322220),h=a.i(727977),i=a.i(198433),j=a.i(541587),k=b([d,g,h]);[d,g,h]=k.then?(await k)():k,a.s(["0006200c83d8442fbd59f81b786b487a3951f59711",()=>h.getActualWsPort,"00d25064e3453bbc7f75d8655b61c851e40495993d",()=>j.getOnboardingStatus,"400adfcaf990bb17df86e8909a3e8a0aede992d1ae",()=>j.dispatchTaskCompletionEvent,"403e569967f7e40ef9f95a932fd1402ccf721dc22e",()=>f.getLabelsForWorkspace,"405fdc9c4d8b06477fa2fab70470ea3bcd09a3af4e",()=>f.createLabel,"406f4c33d6ee0b57f32ef36912f062f165599174b0",()=>h.resolveGitLocalPath,"407180c0ec858d00a140027fe8fa1fb3b5509c7e10",()=>j.setOnboardingProgress,"407b2af6329533534febb291b9b6995ca0c57ecfb6",()=>e.createWorkspace,"40b290a8b723e5d9ae2efac5ba686075fd0e43db66",()=>e.createProject,"40d0c2487c54b35bf5f33d97d9b22357244e5f649c",()=>j.completeOnboarding,"40d22d8522ddcd2962bee63eb58d49f34d0df34faf",()=>i.checkMigrationSafety,"40d7736a6bd6d01f427300af149cbed5f8178fd0b7",()=>e.deleteWorkspace,"40f99af0c2ef3e8f82b39d8517d51f004fa12d9445",()=>f.deleteLabel,"6021975fc50673c7323391469cb58b8009e8ef58d6",()=>i.analyzeProjectDirectory,"602d7a01b7b9836d416f35bce2820d9c6b173d9c02",()=>h.getConfigValue,"60557d38533851a85e3b22aff36176ee7e8ce42871",()=>e.updateWorkspace,"608f69f95a3beba367f60aa9887945df91c205a5a8",()=>g.globalSearch,"60c9debab62ab636e3bb82d67fe9d032e6722bba52",()=>i.migrateProjectPath,"60e717b64589146310c68266b1abebb0b6fcf06a70",()=>h.setConfigValue]),c()}catch(a){c(a)}},!1),939768,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__09mr4e7._.js"].map(b=>a.l(b))).then(()=>b(326575)))},585988,a=>{a.v(a=>Promise.resolve().then(()=>a(264572)))},908462,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0xe9b6_._.js"].map(b=>a.l(b))).then(()=>b(961374)))},302452,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0xe-o3g._.js"].map(b=>a.l(b))).then(()=>b(396477)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=project_f_tower_0o5.y1e._.js.map
|
package/.next/server/chunks/ssr/{project_f_tower_0gp-92y._.js → project_f_tower_0qepwa~._.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[983869,a=>{"use strict";let b=(0,a.i(302856).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);a.s(["GitCompare",0,b],983869)},105916,418841,a=>{"use strict";let b=(0,a.i(302856).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,b],105916);var c=a.i(582812);a.s(["AlertTriangle",()=>c.default],418841)},641804,569720,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(506008),e=a.i(354994),f=a.i(418841),g=a.i(983869),h=a.i(302856);let i=(0,h.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var j=a.i(410756),k=a.i(468518),l=a.i(48300),m=a.i(857122),n=a.i(246962),o=a.i(584335);a.s(["TaskDiffView",0,function({files:a,totalAdded:h,totalRemoved:p,hasConflicts:q,conflictFiles:r,onCommit:s,hasUncommitted:t}){let{t:u}=(0,o.useI18n)(),[v,w]=(0,c.useState)(new Set),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),[B,C]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{className:"font-medium text-foreground",children:[a.length," files changed"]}),(0,b.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",h]}),(0,b.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",p]})]}),(0,b.jsx)("div",{className:"flex items-center gap-2",children:t&&s&&(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>y(!0),className:"gap-2",children:[(0,b.jsx)(i,{className:"h-4 w-4"}),u("diff.commit")]})})]}),q&&(0,b.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,b.jsx)(f.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,b.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",r.length," conflicting file",1!==r.length?"s":""]})]}),(0,b.jsx)("ul",{className:"ml-6 space-y-1",children:r.map(a=>(0,b.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:0===a.length?(0,b.jsx)(k.EmptyState,{icon:g.GitCompare,title:u("diff.noChanges"),className:"h-full"}):(0,b.jsx)("div",{className:"divide-y divide-border",children:a.map(a=>{let c=v.has(a.filename);return(0,b.jsxs)("div",{children:[(0,b.jsxs)(j.Button,{variant:"ghost",type:"button",onClick:()=>{var b;return b=a.filename,void w(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[c?(0,b.jsx)(e.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,b.jsx)(d.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,b.jsx)(l.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,b.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),c&&a.patch&&(0,b.jsx)("div",{className:"border-t border-border bg-background",children:(0,b.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:a.patch.split("\n").map((a,c)=>{let d=a.startsWith("+")&&!a.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":a.startsWith("-")&&!a.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":a.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,b.jsx)("span",{className:d,children:a||" "},c)})})})]},a.filename)})})}),(0,b.jsx)(m.Dialog,{open:x,onOpenChange:y,children:(0,b.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:u("diff.commitChanges")})}),(0,b.jsx)("div",{className:"flex flex-col gap-3",children:(0,b.jsx)(n.Textarea,{value:z,onChange:a=>A(a.target.value),placeholder:u("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"ghost",onClick:()=>y(!1),children:u("common.cancel")}),(0,b.jsx)(j.Button,{onClick:async()=>{if(z.trim()&&s){C(!0);try{await s(z.trim()),A(""),y(!1)}finally{C(!1)}}},disabled:!z.trim()||B,children:B?"...":u("diff.commit")})]})]})})]})}],641804);var p=a.i(448287);let q=(0,h.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var r=a.i(109434);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:d,taskId:e,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:k=[],onMergeComplete:l}){let n=(0,p.useRouter)(),[o,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=async()=>{s(!0),u(null);try{let a=await fetch(`/api/tasks/${e}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){d(!1),l(),n.refresh();return}let b=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?u(`Merge conflicts detected: ${Array.isArray(b.conflictFiles)?b.conflictFiles.join(", "):"unknown files"}`):u(b.error??"Merge failed")}catch{u("Network error — merge failed")}finally{s(!1)}};return(0,b.jsx)(m.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(q,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,b.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),k.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:k.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),t&&(0,b.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,b.jsx)("p",{className:"text-xs text-red-400",children:t})})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"}),(0,b.jsx)(j.Button,{onClick:v,disabled:o,className:"gap-2",children:o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],569720)},460143,a=>{"use strict";let b=(0,a.i(302856).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);a.s(["ArrowUpFromLine",0,b],460143)},929526,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(61966),e=a.i(354994),f=a.i(410215),g=a.i(858967),h=a.i(109434),i=a.i(857122),j=a.i(410756),k=a.i(620235),l=a.i(246962),m=a.i(584335);a.s(["CreateBranchDialog",0,function({open:a,onOpenChange:n,branches:o,currentBranch:p,localPath:q,onCreated:r,onError:s}){let{t}=(0,m.useI18n)(),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(p),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(v(""),x(p),z(""),D(""))},[a,p]);let G=[...new Set(o)].filter(a=>a.toLowerCase().includes(C.toLowerCase())),H=async()=>{if(u.trim()){B(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:q,branch:u.trim(),baseBranch:w})});if(a.ok)n(!1),r();else{let b=await a.json();s(b.error||"Unknown error")}}catch{s("Network error")}finally{B(!1)}}};return(0,b.jsx)(i.Dialog,{open:a,onOpenChange:n,children:(0,b.jsxs)(i.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(i.DialogHeader,{children:(0,b.jsx)(i.DialogTitle,{children:t("git.createBranch")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchName")}),(0,b.jsx)(k.Input,{value:u,onChange:a=>v(a.target.value),placeholder:t("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&H()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>F(!E),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,b.jsx)("span",{className:"font-mono text-xs text-foreground",children:w})]}),(0,b.jsx)(e.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&(0,b.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(f.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:C,onChange:a=>D(a.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,b.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:G.map(a=>(0,b.jsxs)("button",{onClick:()=>{x(a),F(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",children:a}),a===w&&(0,b.jsx)(g.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},a))})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchDesc")}),(0,b.jsx)(l.Textarea,{value:y,onChange:a=>z(a.target.value),placeholder:t("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(i.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>n(!1),children:t("common.cancel")}),(0,b.jsxs)(j.Button,{onClick:H,disabled:!u.trim()||A,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[A?(0,b.jsx)(h.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,t("common.create")]})]})]})})}])},820838,a=>{"use strict";async function b(a,c,d={}){let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:c,path:a,...d})});if(!e.ok)throw Error((await e.json()).error||`${c} failed`);return e.json()}a.s(["gitAction",0,b])},893173,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("606338304ba89f67d0e8f07b8dfb6c7e213505ed48",b.callServer,void 0,b.findSourceMapURL,"updateProject");a.s(["updateProject",0,c])},278510,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40f1b12896aab7bf3d6326bf3b69ad8c624b877f2f",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,c])},161347,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40072e44f06ea7cc6c8e4cc54ca056e1f258f5d411",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},758678,243381,759709,536453,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("6019647bbc439d4da6156b656a60dabfcdde85bb1f",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],758678);let d=(0,b.createServerReference)("40dbed7b5a11a52a8ba506586c2e5fe665f2814de8",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],243381);let e=(0,b.createServerReference)("609e64d8a80dc8ac0d5d035b95e3095a73fc7b570d",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],759709);let f=(0,a.i(302856).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,f],536453)},272932,a=>{"use strict";let b=(0,a.i(302856).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);a.s(["Lightbulb",0,b],272932)},884284,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(354994),e=a.i(413857),f=a.i(57726),g=a.i(891903),h=a.i(109434),i=a.i(536453),j=a.i(236345),k=a.i(595313),l=a.i(272932);let m=(0,a.i(302856).default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var n=a.i(410756),o=a.i(468518),p=a.i(584335);function q({status:a}){switch(a){case"COMPLETED":return(0,b.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,b.jsx)(g.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,b.jsx)(h.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,b.jsx)(i.Clock,{className:"h-4 w-4 text-neutral-500"})}}a.s(["ExecutionTimeline",0,function({executions:a,onResume:f,onContinueLatest:g}){let{t:h,locale:i}=(0,p.useI18n)(),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null);return 0===a.length?(0,b.jsx)(o.EmptyState,{icon:m,title:h("execution.noHistory")}):(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:h("execution.history")}),a.map(c=>{let m=function(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}(c.gitStats??null),o=function(a,b){if(!a||!b)return"";let c=new Date(b).getTime()-new Date(a).getTime();if(c<0)return"";let d=Math.floor(c/1e3);if(d<60)return`${d}s`;let e=Math.floor(d/60);if(e<60)return`${e}m ${d%60}s`;let f=Math.floor(e/60);return`${f}h ${e%60}m`}(c.startedAt??null,c.endedAt??null),p=r===c.id;return(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,b.jsxs)("div",{className:"p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)(q,{status:c.status}),(0,b.jsx)("span",{className:`font-medium ${function(a){switch(a){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(c.status)}`,children:function(a,b){switch(a){case"COMPLETED":return b("execution.success");case"FAILED":return b("execution.failed");case"RUNNING":return b("execution.running");default:return a}}(c.status,h)}),(0,b.jsx)("span",{className:"text-muted-foreground",children:function(a,b="zh"){if(!a)return"";let c=new Date(a),d=Math.floor((new Date().getTime()-c.getTime())/864e5),e="zh"===b?"zh-CN":"en-US",f=c.toLocaleTimeString(e,{hour:"2-digit",minute:"2-digit"});return 0===d?f:1===d?"zh"===b?`昨天 ${f}`:`Yesterday ${f}`:d<7?"zh"===b?`${d}天前 ${f}`:`${d}d ago ${f}`:c.toLocaleDateString(e,{month:"2-digit",day:"2-digit"})+" "+f}(c.startedAt??null,i)}),o&&(0,b.jsxs)("span",{className:"text-muted-foreground/60",children:["(",o,")"]})]}),(0,b.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:c.summary||h("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,b.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,b.jsxs)("span",{children:[m.commits," ",h("execution.commits")]}):null,m.filesChanged?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:[m.filesChanged," ",h("execution.files")]})]}):null,m.insertions||m.deletions?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),m.insertions?(0,b.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,b.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),c.insightNote&&(0,b.jsxs)("div",{className:"mt-2",children:[(0,b.jsxs)("button",{onClick:()=>u(t===c.id?null:c.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,b.jsx)(l.Lightbulb,{className:"h-3.5 w-3.5"}),(0,b.jsxs)("span",{className:"font-medium",children:[h("execution.insight"),":"]}),(0,b.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:c.insightNote.title}),t===c.id?(0,b.jsx)(e.ChevronUp,{className:"h-3 w-3"}):(0,b.jsx)(d.ChevronDown,{className:"h-3 w-3"})]}),t===c.id&&(0,b.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:c.insightNote.content})]}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[c.sessionId&&f?(0,b.jsxs)(n.Button,{size:"sm",onClick:()=>f(c.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(j.PlayCircle,{className:"h-3.5 w-3.5"}),h("execution.resume")]}):!c.sessionId&&"FAILED"===c.status&&c.id===a[0]?.id&&g?(0,b.jsxs)(n.Button,{size:"sm",onClick:g,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,b.jsx)(k.RotateCcw,{className:"h-3.5 w-3.5"}),h("execution.tryRecover")]}):null,(0,b.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>s(p?null:c.id),className:"bg-muted text-muted-foreground",children:[p?(0,b.jsx)(e.ChevronUp,{className:"h-3.5 w-3.5"}):(0,b.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5"}),p?h("execution.collapse"):h("execution.details")]})]})]}),p&&(0,b.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[c.gitLog&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.gitLog")}),(0,b.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:c.gitLog.split("\n").slice(0,3).join("\n")})]}),c.terminalLog&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.terminalOutput")}),(0,b.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:c.terminalLog})]}),"FAILED"===c.status&&null!=c.exitCode&&(0,b.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",c.exitCode]})]})]},c.id)})]})}],884284)}];
|
|
1
|
+
module.exports=[983869,a=>{"use strict";let b=(0,a.i(302856).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);a.s(["GitCompare",0,b],983869)},105916,418841,a=>{"use strict";let b=(0,a.i(302856).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,b],105916);var c=a.i(582812);a.s(["AlertTriangle",()=>c.default],418841)},641804,569720,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(506008),e=a.i(354994),f=a.i(418841),g=a.i(983869),h=a.i(302856);let i=(0,h.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var j=a.i(410756),k=a.i(468518),l=a.i(48300),m=a.i(857122),n=a.i(246962),o=a.i(584335);a.s(["TaskDiffView",0,function({files:a,totalAdded:h,totalRemoved:p,hasConflicts:q,conflictFiles:r,onCommit:s,hasUncommitted:t}){let{t:u}=(0,o.useI18n)(),[v,w]=(0,c.useState)(new Set),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),[B,C]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{className:"font-medium text-foreground",children:[a.length," files changed"]}),(0,b.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",h]}),(0,b.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",p]})]}),(0,b.jsx)("div",{className:"flex items-center gap-2",children:t&&s&&(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>y(!0),className:"gap-2",children:[(0,b.jsx)(i,{className:"h-4 w-4"}),u("diff.commit")]})})]}),q&&(0,b.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,b.jsx)(f.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,b.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",r.length," conflicting file",1!==r.length?"s":""]})]}),(0,b.jsx)("ul",{className:"ml-6 space-y-1",children:r.map(a=>(0,b.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:0===a.length?(0,b.jsx)(k.EmptyState,{icon:g.GitCompare,title:u("diff.noChanges"),className:"h-full"}):(0,b.jsx)("div",{className:"divide-y divide-border",children:a.map(a=>{let c=v.has(a.filename);return(0,b.jsxs)("div",{children:[(0,b.jsxs)(j.Button,{variant:"ghost",type:"button",onClick:()=>{var b;return b=a.filename,void w(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[c?(0,b.jsx)(e.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,b.jsx)(d.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,b.jsx)(l.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,b.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),c&&a.patch&&(0,b.jsx)("div",{className:"border-t border-border bg-background",children:(0,b.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:a.patch.split("\n").map((a,c)=>{let d=a.startsWith("+")&&!a.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":a.startsWith("-")&&!a.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":a.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,b.jsx)("span",{className:d,children:a||" "},c)})})})]},a.filename)})})}),(0,b.jsx)(m.Dialog,{open:x,onOpenChange:y,children:(0,b.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:u("diff.commitChanges")})}),(0,b.jsx)("div",{className:"flex flex-col gap-3",children:(0,b.jsx)(n.Textarea,{value:z,onChange:a=>A(a.target.value),placeholder:u("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"ghost",onClick:()=>y(!1),children:u("common.cancel")}),(0,b.jsx)(j.Button,{onClick:async()=>{if(z.trim()&&s){C(!0);try{await s(z.trim()),A(""),y(!1)}finally{C(!1)}}},disabled:!z.trim()||B,children:B?"...":u("diff.commit")})]})]})})]})}],641804);var p=a.i(448287);let q=(0,h.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var r=a.i(109434);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:d,taskId:e,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:k=[],onMergeComplete:l}){let n=(0,p.useRouter)(),[o,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=async()=>{s(!0),u(null);try{let a=await fetch(`/api/tasks/${e}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){d(!1),l(),n.refresh();return}let b=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?u(`Merge conflicts detected: ${Array.isArray(b.conflictFiles)?b.conflictFiles.join(", "):"unknown files"}`):u(b.error??"Merge failed")}catch{u("Network error — merge failed")}finally{s(!1)}};return(0,b.jsx)(m.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(q,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,b.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),k.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:k.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),t&&(0,b.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,b.jsx)("p",{className:"text-xs text-red-400",children:t})})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"}),(0,b.jsx)(j.Button,{onClick:v,disabled:o,className:"gap-2",children:o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],569720)},460143,a=>{"use strict";let b=(0,a.i(302856).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);a.s(["ArrowUpFromLine",0,b],460143)},929526,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(61966),e=a.i(354994),f=a.i(410215),g=a.i(858967),h=a.i(109434),i=a.i(857122),j=a.i(410756),k=a.i(620235),l=a.i(246962),m=a.i(584335);a.s(["CreateBranchDialog",0,function({open:a,onOpenChange:n,branches:o,currentBranch:p,localPath:q,onCreated:r,onError:s}){let{t}=(0,m.useI18n)(),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(p),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(v(""),x(p),z(""),D(""))},[a,p]);let G=[...new Set(o)].filter(a=>a.toLowerCase().includes(C.toLowerCase())),H=async()=>{if(u.trim()){B(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:q,branch:u.trim(),baseBranch:w})});if(a.ok)n(!1),r();else{let b=await a.json();s(b.error||"Unknown error")}}catch{s("Network error")}finally{B(!1)}}};return(0,b.jsx)(i.Dialog,{open:a,onOpenChange:n,children:(0,b.jsxs)(i.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(i.DialogHeader,{children:(0,b.jsx)(i.DialogTitle,{children:t("git.createBranch")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchName")}),(0,b.jsx)(k.Input,{value:u,onChange:a=>v(a.target.value),placeholder:t("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&H()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>F(!E),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,b.jsx)("span",{className:"font-mono text-xs text-foreground",children:w})]}),(0,b.jsx)(e.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&(0,b.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(f.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:C,onChange:a=>D(a.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,b.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:G.map(a=>(0,b.jsxs)("button",{onClick:()=>{x(a),F(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",children:a}),a===w&&(0,b.jsx)(g.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},a))})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchDesc")}),(0,b.jsx)(l.Textarea,{value:y,onChange:a=>z(a.target.value),placeholder:t("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(i.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>n(!1),children:t("common.cancel")}),(0,b.jsxs)(j.Button,{onClick:H,disabled:!u.trim()||A,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[A?(0,b.jsx)(h.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,t("common.create")]})]})]})})}])},820838,a=>{"use strict";async function b(a,c,d={}){let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:c,path:a,...d})});if(!e.ok)throw Error((await e.json()).error||`${c} failed`);return e.json()}a.s(["gitAction",0,b])},272920,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60b53391796ce5572a3ec17841077beaea0761b0a9",b.callServer,void 0,b.findSourceMapURL,"updateProject");a.s(["updateProject",0,c])},758350,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40d34d213bc1ab35df38cb181947027c13e0e67544",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,c])},984756,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40514bf5261873cfa56acd3eacfdff662ea87ad96b",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},483457,372161,822985,536453,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60dfe37809ea924931c11329f457d09471f68f655c",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],483457);let d=(0,b.createServerReference)("4004bdf16d89b726cc790f34e08c76552e61156543",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],372161);let e=(0,b.createServerReference)("6079ac76a116c02db2d46ba5856a7f531199d158a3",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],822985);let f=(0,a.i(302856).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,f],536453)},272932,a=>{"use strict";let b=(0,a.i(302856).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);a.s(["Lightbulb",0,b],272932)},884284,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(354994),e=a.i(413857),f=a.i(57726),g=a.i(891903),h=a.i(109434),i=a.i(536453),j=a.i(236345),k=a.i(595313),l=a.i(272932);let m=(0,a.i(302856).default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var n=a.i(410756),o=a.i(468518),p=a.i(584335);function q({status:a}){switch(a){case"COMPLETED":return(0,b.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,b.jsx)(g.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,b.jsx)(h.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,b.jsx)(i.Clock,{className:"h-4 w-4 text-neutral-500"})}}a.s(["ExecutionTimeline",0,function({executions:a,onResume:f,onContinueLatest:g}){let{t:h,locale:i}=(0,p.useI18n)(),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null);return 0===a.length?(0,b.jsx)(o.EmptyState,{icon:m,title:h("execution.noHistory")}):(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:h("execution.history")}),a.map(c=>{let m=function(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}(c.gitStats??null),o=function(a,b){if(!a||!b)return"";let c=new Date(b).getTime()-new Date(a).getTime();if(c<0)return"";let d=Math.floor(c/1e3);if(d<60)return`${d}s`;let e=Math.floor(d/60);if(e<60)return`${e}m ${d%60}s`;let f=Math.floor(e/60);return`${f}h ${e%60}m`}(c.startedAt??null,c.endedAt??null),p=r===c.id;return(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,b.jsxs)("div",{className:"p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)(q,{status:c.status}),(0,b.jsx)("span",{className:`font-medium ${function(a){switch(a){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(c.status)}`,children:function(a,b){switch(a){case"COMPLETED":return b("execution.success");case"FAILED":return b("execution.failed");case"RUNNING":return b("execution.running");default:return a}}(c.status,h)}),(0,b.jsx)("span",{className:"text-muted-foreground",children:function(a,b="zh"){if(!a)return"";let c=new Date(a),d=Math.floor((new Date().getTime()-c.getTime())/864e5),e="zh"===b?"zh-CN":"en-US",f=c.toLocaleTimeString(e,{hour:"2-digit",minute:"2-digit"});return 0===d?f:1===d?"zh"===b?`昨天 ${f}`:`Yesterday ${f}`:d<7?"zh"===b?`${d}天前 ${f}`:`${d}d ago ${f}`:c.toLocaleDateString(e,{month:"2-digit",day:"2-digit"})+" "+f}(c.startedAt??null,i)}),o&&(0,b.jsxs)("span",{className:"text-muted-foreground/60",children:["(",o,")"]})]}),(0,b.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:c.summary||h("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,b.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,b.jsxs)("span",{children:[m.commits," ",h("execution.commits")]}):null,m.filesChanged?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:[m.filesChanged," ",h("execution.files")]})]}):null,m.insertions||m.deletions?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),m.insertions?(0,b.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,b.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),c.insightNote&&(0,b.jsxs)("div",{className:"mt-2",children:[(0,b.jsxs)("button",{onClick:()=>u(t===c.id?null:c.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,b.jsx)(l.Lightbulb,{className:"h-3.5 w-3.5"}),(0,b.jsxs)("span",{className:"font-medium",children:[h("execution.insight"),":"]}),(0,b.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:c.insightNote.title}),t===c.id?(0,b.jsx)(e.ChevronUp,{className:"h-3 w-3"}):(0,b.jsx)(d.ChevronDown,{className:"h-3 w-3"})]}),t===c.id&&(0,b.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:c.insightNote.content})]}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[c.sessionId&&f?(0,b.jsxs)(n.Button,{size:"sm",onClick:()=>f(c.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(j.PlayCircle,{className:"h-3.5 w-3.5"}),h("execution.resume")]}):!c.sessionId&&"FAILED"===c.status&&c.id===a[0]?.id&&g?(0,b.jsxs)(n.Button,{size:"sm",onClick:g,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,b.jsx)(k.RotateCcw,{className:"h-3.5 w-3.5"}),h("execution.tryRecover")]}):null,(0,b.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>s(p?null:c.id),className:"bg-muted text-muted-foreground",children:[p?(0,b.jsx)(e.ChevronUp,{className:"h-3.5 w-3.5"}):(0,b.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5"}),p?h("execution.collapse"):h("execution.details")]})]})]}),p&&(0,b.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[c.gitLog&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.gitLog")}),(0,b.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:c.gitLog.split("\n").slice(0,3).join("\n")})]}),c.terminalLog&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.terminalOutput")}),(0,b.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:c.terminalLog})]}),"FAILED"===c.status&&null!=c.exitCode&&(0,b.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",c.exitCode]})]})]},c.id)})]})}],884284)}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=project_f_tower_0qepwa~._.js.map
|
package/.next/server/chunks/ssr/{project_f_tower_11iv6rj._.js → project_f_tower_0u8bo7w._.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[272932,a=>{"use strict";let b=(0,a.i(302856).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);a.s(["Lightbulb",0,b],272932)},893173,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("606338304ba89f67d0e8f07b8dfb6c7e213505ed48",b.callServer,void 0,b.findSourceMapURL,"updateProject");a.s(["updateProject",0,c])},929526,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(61966),e=a.i(354994),f=a.i(410215),g=a.i(858967),h=a.i(109434),i=a.i(857122),j=a.i(410756),k=a.i(620235),l=a.i(246962),m=a.i(584335);a.s(["CreateBranchDialog",0,function({open:a,onOpenChange:n,branches:o,currentBranch:p,localPath:q,onCreated:r,onError:s}){let{t}=(0,m.useI18n)(),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(p),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(v(""),x(p),z(""),D(""))},[a,p]);let G=[...new Set(o)].filter(a=>a.toLowerCase().includes(C.toLowerCase())),H=async()=>{if(u.trim()){B(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:q,branch:u.trim(),baseBranch:w})});if(a.ok)n(!1),r();else{let b=await a.json();s(b.error||"Unknown error")}}catch{s("Network error")}finally{B(!1)}}};return(0,b.jsx)(i.Dialog,{open:a,onOpenChange:n,children:(0,b.jsxs)(i.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(i.DialogHeader,{children:(0,b.jsx)(i.DialogTitle,{children:t("git.createBranch")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchName")}),(0,b.jsx)(k.Input,{value:u,onChange:a=>v(a.target.value),placeholder:t("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&H()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>F(!E),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,b.jsx)("span",{className:"font-mono text-xs text-foreground",children:w})]}),(0,b.jsx)(e.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&(0,b.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(f.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:C,onChange:a=>D(a.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,b.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:G.map(a=>(0,b.jsxs)("button",{onClick:()=>{x(a),F(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",children:a}),a===w&&(0,b.jsx)(g.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},a))})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchDesc")}),(0,b.jsx)(l.Textarea,{value:y,onChange:a=>z(a.target.value),placeholder:t("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(i.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>n(!1),children:t("common.cancel")}),(0,b.jsxs)(j.Button,{onClick:H,disabled:!u.trim()||A,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[A?(0,b.jsx)(h.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,t("common.create")]})]})]})})}])},460143,a=>{"use strict";let b=(0,a.i(302856).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);a.s(["ArrowUpFromLine",0,b],460143)},820838,a=>{"use strict";async function b(a,c,d={}){let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:c,path:a,...d})});if(!e.ok)throw Error((await e.json()).error||`${c} failed`);return e.json()}a.s(["gitAction",0,b])},105916,418841,a=>{"use strict";let b=(0,a.i(302856).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,b],105916);var c=a.i(582812);a.s(["AlertTriangle",()=>c.default],418841)},983869,a=>{"use strict";let b=(0,a.i(302856).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);a.s(["GitCompare",0,b],983869)},641804,569720,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(506008),e=a.i(354994),f=a.i(418841),g=a.i(983869),h=a.i(302856);let i=(0,h.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var j=a.i(410756),k=a.i(468518),l=a.i(48300),m=a.i(857122),n=a.i(246962),o=a.i(584335);a.s(["TaskDiffView",0,function({files:a,totalAdded:h,totalRemoved:p,hasConflicts:q,conflictFiles:r,onCommit:s,hasUncommitted:t}){let{t:u}=(0,o.useI18n)(),[v,w]=(0,c.useState)(new Set),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),[B,C]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{className:"font-medium text-foreground",children:[a.length," files changed"]}),(0,b.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",h]}),(0,b.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",p]})]}),(0,b.jsx)("div",{className:"flex items-center gap-2",children:t&&s&&(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>y(!0),className:"gap-2",children:[(0,b.jsx)(i,{className:"h-4 w-4"}),u("diff.commit")]})})]}),q&&(0,b.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,b.jsx)(f.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,b.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",r.length," conflicting file",1!==r.length?"s":""]})]}),(0,b.jsx)("ul",{className:"ml-6 space-y-1",children:r.map(a=>(0,b.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:0===a.length?(0,b.jsx)(k.EmptyState,{icon:g.GitCompare,title:u("diff.noChanges"),className:"h-full"}):(0,b.jsx)("div",{className:"divide-y divide-border",children:a.map(a=>{let c=v.has(a.filename);return(0,b.jsxs)("div",{children:[(0,b.jsxs)(j.Button,{variant:"ghost",type:"button",onClick:()=>{var b;return b=a.filename,void w(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[c?(0,b.jsx)(e.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,b.jsx)(d.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,b.jsx)(l.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,b.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),c&&a.patch&&(0,b.jsx)("div",{className:"border-t border-border bg-background",children:(0,b.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:a.patch.split("\n").map((a,c)=>{let d=a.startsWith("+")&&!a.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":a.startsWith("-")&&!a.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":a.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,b.jsx)("span",{className:d,children:a||" "},c)})})})]},a.filename)})})}),(0,b.jsx)(m.Dialog,{open:x,onOpenChange:y,children:(0,b.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:u("diff.commitChanges")})}),(0,b.jsx)("div",{className:"flex flex-col gap-3",children:(0,b.jsx)(n.Textarea,{value:z,onChange:a=>A(a.target.value),placeholder:u("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"ghost",onClick:()=>y(!1),children:u("common.cancel")}),(0,b.jsx)(j.Button,{onClick:async()=>{if(z.trim()&&s){C(!0);try{await s(z.trim()),A(""),y(!1)}finally{C(!1)}}},disabled:!z.trim()||B,children:B?"...":u("diff.commit")})]})]})})]})}],641804);var p=a.i(448287);let q=(0,h.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var r=a.i(109434);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:d,taskId:e,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:k=[],onMergeComplete:l}){let n=(0,p.useRouter)(),[o,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=async()=>{s(!0),u(null);try{let a=await fetch(`/api/tasks/${e}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){d(!1),l(),n.refresh();return}let b=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?u(`Merge conflicts detected: ${Array.isArray(b.conflictFiles)?b.conflictFiles.join(", "):"unknown files"}`):u(b.error??"Merge failed")}catch{u("Network error — merge failed")}finally{s(!1)}};return(0,b.jsx)(m.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(q,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,b.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),k.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:k.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),t&&(0,b.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,b.jsx)("p",{className:"text-xs text-red-400",children:t})})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"}),(0,b.jsx)(j.Button,{onClick:v,disabled:o,className:"gap-2",children:o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],569720)},161347,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40072e44f06ea7cc6c8e4cc54ca056e1f258f5d411",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},278510,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40f1b12896aab7bf3d6326bf3b69ad8c624b877f2f",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,c])},758678,243381,759709,536453,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("6019647bbc439d4da6156b656a60dabfcdde85bb1f",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],758678);let d=(0,b.createServerReference)("40dbed7b5a11a52a8ba506586c2e5fe665f2814de8",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],243381);let e=(0,b.createServerReference)("609e64d8a80dc8ac0d5d035b95e3095a73fc7b570d",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],759709);let f=(0,a.i(302856).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,f],536453)},884284,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(354994),e=a.i(413857),f=a.i(57726),g=a.i(891903),h=a.i(109434),i=a.i(536453),j=a.i(236345),k=a.i(595313),l=a.i(272932);let m=(0,a.i(302856).default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var n=a.i(410756),o=a.i(468518),p=a.i(584335);function q({status:a}){switch(a){case"COMPLETED":return(0,b.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,b.jsx)(g.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,b.jsx)(h.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,b.jsx)(i.Clock,{className:"h-4 w-4 text-neutral-500"})}}a.s(["ExecutionTimeline",0,function({executions:a,onResume:f,onContinueLatest:g}){let{t:h,locale:i}=(0,p.useI18n)(),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null);return 0===a.length?(0,b.jsx)(o.EmptyState,{icon:m,title:h("execution.noHistory")}):(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:h("execution.history")}),a.map(c=>{let m=function(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}(c.gitStats??null),o=function(a,b){if(!a||!b)return"";let c=new Date(b).getTime()-new Date(a).getTime();if(c<0)return"";let d=Math.floor(c/1e3);if(d<60)return`${d}s`;let e=Math.floor(d/60);if(e<60)return`${e}m ${d%60}s`;let f=Math.floor(e/60);return`${f}h ${e%60}m`}(c.startedAt??null,c.endedAt??null),p=r===c.id;return(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,b.jsxs)("div",{className:"p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)(q,{status:c.status}),(0,b.jsx)("span",{className:`font-medium ${function(a){switch(a){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(c.status)}`,children:function(a,b){switch(a){case"COMPLETED":return b("execution.success");case"FAILED":return b("execution.failed");case"RUNNING":return b("execution.running");default:return a}}(c.status,h)}),(0,b.jsx)("span",{className:"text-muted-foreground",children:function(a,b="zh"){if(!a)return"";let c=new Date(a),d=Math.floor((new Date().getTime()-c.getTime())/864e5),e="zh"===b?"zh-CN":"en-US",f=c.toLocaleTimeString(e,{hour:"2-digit",minute:"2-digit"});return 0===d?f:1===d?"zh"===b?`昨天 ${f}`:`Yesterday ${f}`:d<7?"zh"===b?`${d}天前 ${f}`:`${d}d ago ${f}`:c.toLocaleDateString(e,{month:"2-digit",day:"2-digit"})+" "+f}(c.startedAt??null,i)}),o&&(0,b.jsxs)("span",{className:"text-muted-foreground/60",children:["(",o,")"]})]}),(0,b.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:c.summary||h("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,b.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,b.jsxs)("span",{children:[m.commits," ",h("execution.commits")]}):null,m.filesChanged?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:[m.filesChanged," ",h("execution.files")]})]}):null,m.insertions||m.deletions?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),m.insertions?(0,b.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,b.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),c.insightNote&&(0,b.jsxs)("div",{className:"mt-2",children:[(0,b.jsxs)("button",{onClick:()=>u(t===c.id?null:c.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,b.jsx)(l.Lightbulb,{className:"h-3.5 w-3.5"}),(0,b.jsxs)("span",{className:"font-medium",children:[h("execution.insight"),":"]}),(0,b.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:c.insightNote.title}),t===c.id?(0,b.jsx)(e.ChevronUp,{className:"h-3 w-3"}):(0,b.jsx)(d.ChevronDown,{className:"h-3 w-3"})]}),t===c.id&&(0,b.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:c.insightNote.content})]}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[c.sessionId&&f?(0,b.jsxs)(n.Button,{size:"sm",onClick:()=>f(c.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(j.PlayCircle,{className:"h-3.5 w-3.5"}),h("execution.resume")]}):!c.sessionId&&"FAILED"===c.status&&c.id===a[0]?.id&&g?(0,b.jsxs)(n.Button,{size:"sm",onClick:g,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,b.jsx)(k.RotateCcw,{className:"h-3.5 w-3.5"}),h("execution.tryRecover")]}):null,(0,b.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>s(p?null:c.id),className:"bg-muted text-muted-foreground",children:[p?(0,b.jsx)(e.ChevronUp,{className:"h-3.5 w-3.5"}):(0,b.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5"}),p?h("execution.collapse"):h("execution.details")]})]})]}),p&&(0,b.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[c.gitLog&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.gitLog")}),(0,b.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:c.gitLog.split("\n").slice(0,3).join("\n")})]}),c.terminalLog&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.terminalOutput")}),(0,b.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:c.terminalLog})]}),"FAILED"===c.status&&null!=c.exitCode&&(0,b.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",c.exitCode]})]})]},c.id)})]})}],884284)}];
|
|
1
|
+
module.exports=[272932,a=>{"use strict";let b=(0,a.i(302856).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);a.s(["Lightbulb",0,b],272932)},272920,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60b53391796ce5572a3ec17841077beaea0761b0a9",b.callServer,void 0,b.findSourceMapURL,"updateProject");a.s(["updateProject",0,c])},929526,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(61966),e=a.i(354994),f=a.i(410215),g=a.i(858967),h=a.i(109434),i=a.i(857122),j=a.i(410756),k=a.i(620235),l=a.i(246962),m=a.i(584335);a.s(["CreateBranchDialog",0,function({open:a,onOpenChange:n,branches:o,currentBranch:p,localPath:q,onCreated:r,onError:s}){let{t}=(0,m.useI18n)(),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(p),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(v(""),x(p),z(""),D(""))},[a,p]);let G=[...new Set(o)].filter(a=>a.toLowerCase().includes(C.toLowerCase())),H=async()=>{if(u.trim()){B(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:q,branch:u.trim(),baseBranch:w})});if(a.ok)n(!1),r();else{let b=await a.json();s(b.error||"Unknown error")}}catch{s("Network error")}finally{B(!1)}}};return(0,b.jsx)(i.Dialog,{open:a,onOpenChange:n,children:(0,b.jsxs)(i.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(i.DialogHeader,{children:(0,b.jsx)(i.DialogTitle,{children:t("git.createBranch")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchName")}),(0,b.jsx)(k.Input,{value:u,onChange:a=>v(a.target.value),placeholder:t("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&H()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>F(!E),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,b.jsx)("span",{className:"font-mono text-xs text-foreground",children:w})]}),(0,b.jsx)(e.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&(0,b.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(f.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:C,onChange:a=>D(a.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,b.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:G.map(a=>(0,b.jsxs)("button",{onClick:()=>{x(a),F(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",children:a}),a===w&&(0,b.jsx)(g.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},a))})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchDesc")}),(0,b.jsx)(l.Textarea,{value:y,onChange:a=>z(a.target.value),placeholder:t("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(i.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>n(!1),children:t("common.cancel")}),(0,b.jsxs)(j.Button,{onClick:H,disabled:!u.trim()||A,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[A?(0,b.jsx)(h.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,t("common.create")]})]})]})})}])},460143,a=>{"use strict";let b=(0,a.i(302856).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);a.s(["ArrowUpFromLine",0,b],460143)},820838,a=>{"use strict";async function b(a,c,d={}){let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:c,path:a,...d})});if(!e.ok)throw Error((await e.json()).error||`${c} failed`);return e.json()}a.s(["gitAction",0,b])},105916,418841,a=>{"use strict";let b=(0,a.i(302856).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,b],105916);var c=a.i(582812);a.s(["AlertTriangle",()=>c.default],418841)},983869,a=>{"use strict";let b=(0,a.i(302856).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);a.s(["GitCompare",0,b],983869)},641804,569720,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(506008),e=a.i(354994),f=a.i(418841),g=a.i(983869),h=a.i(302856);let i=(0,h.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var j=a.i(410756),k=a.i(468518),l=a.i(48300),m=a.i(857122),n=a.i(246962),o=a.i(584335);a.s(["TaskDiffView",0,function({files:a,totalAdded:h,totalRemoved:p,hasConflicts:q,conflictFiles:r,onCommit:s,hasUncommitted:t}){let{t:u}=(0,o.useI18n)(),[v,w]=(0,c.useState)(new Set),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),[B,C]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{className:"font-medium text-foreground",children:[a.length," files changed"]}),(0,b.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",h]}),(0,b.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",p]})]}),(0,b.jsx)("div",{className:"flex items-center gap-2",children:t&&s&&(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>y(!0),className:"gap-2",children:[(0,b.jsx)(i,{className:"h-4 w-4"}),u("diff.commit")]})})]}),q&&(0,b.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,b.jsx)(f.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,b.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",r.length," conflicting file",1!==r.length?"s":""]})]}),(0,b.jsx)("ul",{className:"ml-6 space-y-1",children:r.map(a=>(0,b.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:0===a.length?(0,b.jsx)(k.EmptyState,{icon:g.GitCompare,title:u("diff.noChanges"),className:"h-full"}):(0,b.jsx)("div",{className:"divide-y divide-border",children:a.map(a=>{let c=v.has(a.filename);return(0,b.jsxs)("div",{children:[(0,b.jsxs)(j.Button,{variant:"ghost",type:"button",onClick:()=>{var b;return b=a.filename,void w(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[c?(0,b.jsx)(e.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,b.jsx)(d.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,b.jsx)(l.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,b.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),c&&a.patch&&(0,b.jsx)("div",{className:"border-t border-border bg-background",children:(0,b.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:a.patch.split("\n").map((a,c)=>{let d=a.startsWith("+")&&!a.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":a.startsWith("-")&&!a.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":a.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,b.jsx)("span",{className:d,children:a||" "},c)})})})]},a.filename)})})}),(0,b.jsx)(m.Dialog,{open:x,onOpenChange:y,children:(0,b.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:u("diff.commitChanges")})}),(0,b.jsx)("div",{className:"flex flex-col gap-3",children:(0,b.jsx)(n.Textarea,{value:z,onChange:a=>A(a.target.value),placeholder:u("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"ghost",onClick:()=>y(!1),children:u("common.cancel")}),(0,b.jsx)(j.Button,{onClick:async()=>{if(z.trim()&&s){C(!0);try{await s(z.trim()),A(""),y(!1)}finally{C(!1)}}},disabled:!z.trim()||B,children:B?"...":u("diff.commit")})]})]})})]})}],641804);var p=a.i(448287);let q=(0,h.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var r=a.i(109434);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:d,taskId:e,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:k=[],onMergeComplete:l}){let n=(0,p.useRouter)(),[o,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=async()=>{s(!0),u(null);try{let a=await fetch(`/api/tasks/${e}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){d(!1),l(),n.refresh();return}let b=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?u(`Merge conflicts detected: ${Array.isArray(b.conflictFiles)?b.conflictFiles.join(", "):"unknown files"}`):u(b.error??"Merge failed")}catch{u("Network error — merge failed")}finally{s(!1)}};return(0,b.jsx)(m.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(q,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,b.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),k.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:k.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),t&&(0,b.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,b.jsx)("p",{className:"text-xs text-red-400",children:t})})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"}),(0,b.jsx)(j.Button,{onClick:v,disabled:o,className:"gap-2",children:o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],569720)},984756,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40514bf5261873cfa56acd3eacfdff662ea87ad96b",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},758350,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40d34d213bc1ab35df38cb181947027c13e0e67544",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,c])},483457,372161,822985,536453,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60dfe37809ea924931c11329f457d09471f68f655c",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],483457);let d=(0,b.createServerReference)("4004bdf16d89b726cc790f34e08c76552e61156543",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],372161);let e=(0,b.createServerReference)("6079ac76a116c02db2d46ba5856a7f531199d158a3",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],822985);let f=(0,a.i(302856).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,f],536453)},884284,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(354994),e=a.i(413857),f=a.i(57726),g=a.i(891903),h=a.i(109434),i=a.i(536453),j=a.i(236345),k=a.i(595313),l=a.i(272932);let m=(0,a.i(302856).default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var n=a.i(410756),o=a.i(468518),p=a.i(584335);function q({status:a}){switch(a){case"COMPLETED":return(0,b.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,b.jsx)(g.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,b.jsx)(h.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,b.jsx)(i.Clock,{className:"h-4 w-4 text-neutral-500"})}}a.s(["ExecutionTimeline",0,function({executions:a,onResume:f,onContinueLatest:g}){let{t:h,locale:i}=(0,p.useI18n)(),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null);return 0===a.length?(0,b.jsx)(o.EmptyState,{icon:m,title:h("execution.noHistory")}):(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:h("execution.history")}),a.map(c=>{let m=function(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}(c.gitStats??null),o=function(a,b){if(!a||!b)return"";let c=new Date(b).getTime()-new Date(a).getTime();if(c<0)return"";let d=Math.floor(c/1e3);if(d<60)return`${d}s`;let e=Math.floor(d/60);if(e<60)return`${e}m ${d%60}s`;let f=Math.floor(e/60);return`${f}h ${e%60}m`}(c.startedAt??null,c.endedAt??null),p=r===c.id;return(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,b.jsxs)("div",{className:"p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)(q,{status:c.status}),(0,b.jsx)("span",{className:`font-medium ${function(a){switch(a){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(c.status)}`,children:function(a,b){switch(a){case"COMPLETED":return b("execution.success");case"FAILED":return b("execution.failed");case"RUNNING":return b("execution.running");default:return a}}(c.status,h)}),(0,b.jsx)("span",{className:"text-muted-foreground",children:function(a,b="zh"){if(!a)return"";let c=new Date(a),d=Math.floor((new Date().getTime()-c.getTime())/864e5),e="zh"===b?"zh-CN":"en-US",f=c.toLocaleTimeString(e,{hour:"2-digit",minute:"2-digit"});return 0===d?f:1===d?"zh"===b?`昨天 ${f}`:`Yesterday ${f}`:d<7?"zh"===b?`${d}天前 ${f}`:`${d}d ago ${f}`:c.toLocaleDateString(e,{month:"2-digit",day:"2-digit"})+" "+f}(c.startedAt??null,i)}),o&&(0,b.jsxs)("span",{className:"text-muted-foreground/60",children:["(",o,")"]})]}),(0,b.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:c.summary||h("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,b.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,b.jsxs)("span",{children:[m.commits," ",h("execution.commits")]}):null,m.filesChanged?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:[m.filesChanged," ",h("execution.files")]})]}):null,m.insertions||m.deletions?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),m.insertions?(0,b.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,b.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),c.insightNote&&(0,b.jsxs)("div",{className:"mt-2",children:[(0,b.jsxs)("button",{onClick:()=>u(t===c.id?null:c.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,b.jsx)(l.Lightbulb,{className:"h-3.5 w-3.5"}),(0,b.jsxs)("span",{className:"font-medium",children:[h("execution.insight"),":"]}),(0,b.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:c.insightNote.title}),t===c.id?(0,b.jsx)(e.ChevronUp,{className:"h-3 w-3"}):(0,b.jsx)(d.ChevronDown,{className:"h-3 w-3"})]}),t===c.id&&(0,b.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:c.insightNote.content})]}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[c.sessionId&&f?(0,b.jsxs)(n.Button,{size:"sm",onClick:()=>f(c.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(j.PlayCircle,{className:"h-3.5 w-3.5"}),h("execution.resume")]}):!c.sessionId&&"FAILED"===c.status&&c.id===a[0]?.id&&g?(0,b.jsxs)(n.Button,{size:"sm",onClick:g,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,b.jsx)(k.RotateCcw,{className:"h-3.5 w-3.5"}),h("execution.tryRecover")]}):null,(0,b.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>s(p?null:c.id),className:"bg-muted text-muted-foreground",children:[p?(0,b.jsx)(e.ChevronUp,{className:"h-3.5 w-3.5"}):(0,b.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5"}),p?h("execution.collapse"):h("execution.details")]})]})]}),p&&(0,b.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[c.gitLog&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.gitLog")}),(0,b.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:c.gitLog.split("\n").slice(0,3).join("\n")})]}),c.terminalLog&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.terminalOutput")}),(0,b.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:c.terminalLog})]}),"FAILED"===c.status&&null!=c.exitCode&&(0,b.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",c.exitCode]})]})]},c.id)})]})}],884284)}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=project_f_tower_0u8bo7w._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[7533,a=>a.a(async(b,c)=>{try{a.i(279254),a.i(30292);var d=a.i(322220),e=a.i(727977);a.i(198433),a.i(541587);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),157616,a=>a.a(async(b,c)=>{try{var d=a.i(7533),e=a.i(279254),f=a.i(30292),g=a.i(322220),h=a.i(727977),i=a.i(198433),j=a.i(541587),k=b([d,g,h]);[d,g,h]=k.then?(await k)():k,a.s(["
|
|
1
|
+
module.exports=[7533,a=>a.a(async(b,c)=>{try{a.i(279254),a.i(30292);var d=a.i(322220),e=a.i(727977);a.i(198433),a.i(541587);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),157616,a=>a.a(async(b,c)=>{try{var d=a.i(7533),e=a.i(279254),f=a.i(30292),g=a.i(322220),h=a.i(727977),i=a.i(198433),j=a.i(541587),k=b([d,g,h]);[d,g,h]=k.then?(await k)():k,a.s(["0006200c83d8442fbd59f81b786b487a3951f59711",()=>h.getActualWsPort,"00280f914c62f9b1db47de8271d0523abb33f77089",()=>e.getWorkspacesWithProjects,"00d25064e3453bbc7f75d8655b61c851e40495993d",()=>j.getOnboardingStatus,"4006439fd6b57f5cb4983e1b958e5dced25f2799ae",()=>e.getRecentLocalProjects,"400adfcaf990bb17df86e8909a3e8a0aede992d1ae",()=>j.dispatchTaskCompletionEvent,"403e569967f7e40ef9f95a932fd1402ccf721dc22e",()=>f.getLabelsForWorkspace,"405092a34a8552a3cd95e6472954d6c79c339c9f8a",()=>e.getProjectByLocalPath,"405f05061cd88f9dc2b58ee656a461de24e9c9c113",()=>e.getWorkspaceById,"405fdc9c4d8b06477fa2fab70470ea3bcd09a3af4e",()=>f.createLabel,"406284301e79d715496b549f957cf93e59c11fd396",()=>e.getWorkspacesWithRecentTasks,"406f4c33d6ee0b57f32ef36912f062f165599174b0",()=>h.resolveGitLocalPath,"407180c0ec858d00a140027fe8fa1fb3b5509c7e10",()=>j.setOnboardingProgress,"40788239dcf0b3b5fd981ce49abb2e2f40b762327b",()=>e.getOrCreateTowerTaskId,"407b2af6329533534febb291b9b6995ca0c57ecfb6",()=>e.createWorkspace,"40b290a8b723e5d9ae2efac5ba686075fd0e43db66",()=>e.createProject,"40d0c2487c54b35bf5f33d97d9b22357244e5f649c",()=>j.completeOnboarding,"40d22d8522ddcd2962bee63eb58d49f34d0df34faf",()=>i.checkMigrationSafety,"40d7736a6bd6d01f427300af149cbed5f8178fd0b7",()=>e.deleteWorkspace,"40ec5240cd85ec3e967c244c48c63cac7926703d5f",()=>e.deleteProject,"40f99af0c2ef3e8f82b39d8517d51f004fa12d9445",()=>f.deleteLabel,"6021975fc50673c7323391469cb58b8009e8ef58d6",()=>i.analyzeProjectDirectory,"602d7a01b7b9836d416f35bce2820d9c6b173d9c02",()=>h.getConfigValue,"60557d38533851a85e3b22aff36176ee7e8ce42871",()=>e.updateWorkspace,"608f69f95a3beba367f60aa9887945df91c205a5a8",()=>g.globalSearch,"60b53391796ce5572a3ec17841077beaea0761b0a9",()=>e.updateProject,"60c9debab62ab636e3bb82d67fe9d032e6722bba52",()=>i.migrateProjectPath,"60e717b64589146310c68266b1abebb0b6fcf06a70",()=>h.setConfigValue]),c()}catch(a){c(a)}},!1),939768,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0fkkh9j._.js"].map(b=>a.l(b))).then(()=>b(326575)))},585988,a=>{a.v(a=>Promise.resolve().then(()=>a(264572)))},908462,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0xe9b6_._.js"].map(b=>a.l(b))).then(()=>b(961374)))},302452,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__00.lowc._.js"].map(b=>a.l(b))).then(()=>b(396477)))}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=project_f_tower_0ym-aea._.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
module.exports=[57726,891903,a=>{"use strict";var b=a.i(65735);a.s(["CheckCircle2",()=>b.default],57726);let c=(0,a.i(302856).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);a.s(["XCircle",0,c],891903)},236413,a=>{"use strict";let b=(0,a.i(302856).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);a.s(["Terminal",0,b],236413)},506008,a=>{"use strict";var b=a.i(360295);a.s(["ChevronRight",()=>b.default])},48300,a=>{"use strict";var b=a.i(293785),c=a.i(256116),d=a.i(488137),e=a.i(44585);let f=(0,d.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});a.s(["Badge",0,function({className:a,variant:d="default",render:g,...h}){var i;return i={defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}},(0,c.useRenderElement)(i.defaultTagName??"div",i,i)}],48300)},34301,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40469f2202d21113210f7781acdbc73dad857aa680",b.callServer,void 0,b.findSourceMapURL,"getPrompts");a.s(["getPrompts",0,c])},720822,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("78e2cd9bdb426640f014a1ec4624b473c25a849d42",b.callServer,void 0,b.findSourceMapURL,"startPtyExecution");a.s(["startPtyExecution",0,c])},684871,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40fdf7b3c181dbd95bb2d785fd7925a65618a9bbfc",b.callServer,void 0,b.findSourceMapURL,"stopPtyExecution");a.s(["stopPtyExecution",0,c])},480012,595313,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60097a58828811207251170fac5cf1eb4ee31bc301",b.callServer,void 0,b.findSourceMapURL,"resumePtyExecution");a.s(["resumePtyExecution",0,c],480012);let d=(0,a.i(302856).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);a.s(["RotateCcw",0,d],595313)},128839,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("4067fbecfd3268c0ad23bc447d1d443259fcbb0849",b.callServer,void 0,b.findSourceMapURL,"openInTerminal");a.s(["openInTerminal",0,c])},59711,a=>{"use strict";let b=(0,a.i(302856).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",0,b],59711)},468518,a=>{"use strict";var b=a.i(858360),c=a.i(44585);a.s(["EmptyState",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",g),children:[a&&(0,b.jsx)(a,{className:"h-10 w-10 text-muted-foreground/40"}),(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:d}),e&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e}),f&&(0,b.jsx)("div",{className:"mt-2",children:f})]})}])},236345,a=>{"use strict";let b=(0,a.i(302856).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);a.s(["PlayCircle",0,b],236345)},797896,a=>{"use strict";let b=(0,a.i(302856).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);a.s(["Eye",0,b],797896)},524699,192132,141376,109810,606212,964135,165244,116304,221590,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("605fd161fd99a138dfca9d4d31654558944419b111",b.callServer,void 0,b.findSourceMapURL,"listDirectory");a.s(["listDirectory",0,c],524699);let d=(0,b.createServerReference)("70368b8326d64007f178b58682fadba89ef464ec72",b.callServer,void 0,b.findSourceMapURL,"getGitStatus");a.s(["getGitStatus",0,d],192132);let e=(0,b.createServerReference)("60914189a91ca7354e1c9cb0eef9a8ce2e4d0f7ac1",b.callServer,void 0,b.findSourceMapURL,"createFile");a.s(["createFile",0,e],141376);let f=(0,b.createServerReference)("6020819408fcbafb33c1721fdc26df36b514f7d46d",b.callServer,void 0,b.findSourceMapURL,"createDirectory");a.s(["createDirectory",0,f],109810);let g=(0,b.createServerReference)("7092d9a20453d7dd5c939ac0f707324dfd8f5a7e0f",b.callServer,void 0,b.findSourceMapURL,"renameEntry");a.s(["renameEntry",0,g],606212);let h=(0,b.createServerReference)("60c4c5c4f52fb8a04ea5e3cbb28b01f21588407c36",b.callServer,void 0,b.findSourceMapURL,"deleteEntry");a.s(["deleteEntry",0,h],964135);let i=(0,b.createServerReference)("402d28ae729e825f2e100ede66c5cc390df36ac2d1",b.callServer,void 0,b.findSourceMapURL,"listAllFiles");a.s(["listAllFiles",0,i],165244);let j=(0,b.createServerReference)("608a058fb25886af70c055e69bbc6a03cffc5efa02",b.callServer,void 0,b.findSourceMapURL,"readFileContent");a.s(["readFileContent",0,j],116304);let k=(0,b.createServerReference)("7020b93ab3ee781dacdf423f866edc5944c057dc4d",b.callServer,void 0,b.findSourceMapURL,"writeFileContent");a.s(["writeFileContent",0,k],221590)},523151,a=>{a.v(b=>Promise.all(["server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js"].map(b=>a.l(b))).then(()=>b(5533)))},785402,a=>{a.v(b=>Promise.all(["server/chunks/ssr/0j~t_@monaco-editor_react_dist_index_mjs_0m1qx-m._.js"].map(b=>a.l(b))).then(()=>b(963908)))}];
|
|
2
|
+
|
|
3
|
+
//# sourceMappingURL=project_f_tower_135-_23._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[
|
|
1
|
+
module.exports=[324310,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("4064da2431a3e58576cf3e90ba9bf4214769cf2121",b.callServer,void 0,b.findSourceMapURL,"getConfigValues");a.s(["getConfigValues",0,c])},468518,a=>{"use strict";var b=a.i(858360),c=a.i(44585);a.s(["EmptyState",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",g),children:[a&&(0,b.jsx)(a,{className:"h-10 w-10 text-muted-foreground/40"}),(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:d}),e&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e}),f&&(0,b.jsx)("div",{className:"mt-2",children:f})]})}])},48300,a=>{"use strict";var b=a.i(293785),c=a.i(256116),d=a.i(488137),e=a.i(44585);let f=(0,d.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});a.s(["Badge",0,function({className:a,variant:d="default",render:g,...h}){var i;return i={defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}},(0,c.useRenderElement)(i.defaultTagName??"div",i,i)}],48300)},684871,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("40fdf7b3c181dbd95bb2d785fd7925a65618a9bbfc",b.callServer,void 0,b.findSourceMapURL,"stopPtyExecution");a.s(["stopPtyExecution",0,c])},720822,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("78e2cd9bdb426640f014a1ec4624b473c25a849d42",b.callServer,void 0,b.findSourceMapURL,"startPtyExecution");a.s(["startPtyExecution",0,c])},480012,595313,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60097a58828811207251170fac5cf1eb4ee31bc301",b.callServer,void 0,b.findSourceMapURL,"resumePtyExecution");a.s(["resumePtyExecution",0,c],480012);let d=(0,a.i(302856).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);a.s(["RotateCcw",0,d],595313)},128839,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("4067fbecfd3268c0ad23bc447d1d443259fcbb0849",b.callServer,void 0,b.findSourceMapURL,"openInTerminal");a.s(["openInTerminal",0,c])}];
|
|
2
2
|
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=project_f_tower_src_0w26c.x._.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports=[643700,a=>{"use strict";var b=a.i(680889),c=a.i(832116),d=a.i(972795),e=a.i(961374),f=a.i(264572),g=a.i(6938),h=a.i(968623),i=a.i(143971);class j extends Error{code;provider;constructor(a,b,c){super(c),this.code=a,this.provider=b,this.name="AiProviderError"}}async function k(a){return c.db.aiCapabilityConfig.findUnique({where:{slot:a}})}async function l(a){let b=await k(a),c=b?.provider??"claude",d=b?.model??void 0,e=i.providerRegistry.get(c);if(!e)throw new j("CLI_NOT_FOUND",c,`Provider "${c}" 未注册`);let f=e.cli?.adapter;if(!f)throw new j("UNSUPPORTED_MODE",c,`Provider "${c}" 不支持 CLI 模式`);return{adapter:f,provider:e,model:d}}var m=a.i(924868),n=a.i(446786),o=a.i(814747),p=a.i(632919);let q=g.logger.create("agent-actions"),r=(0,o.join)((0,n.tmpdir)(),"tower-signals");async function s(a,b){try{await (0,m.mkdir)(r,{recursive:!0,mode:448}),await (0,m.writeFile)((0,o.join)(r,`exit-${a}`),String(b),{mode:384})}catch{}}function t(a,b){try{return JSON.parse(a)}catch{throw Error(`CLI Profile ${b} 格式损坏,请在 Settings 中修复`)}}async function u(a,b){let e=await c.db.taskMessage.create({data:{role:"USER",content:b,taskId:a}});return(0,d.revalidatePath)("/workspaces"),{userMessage:e}}async function
|
|
2
|
-
${
|
|
1
|
+
module.exports=[643700,a=>{"use strict";var b=a.i(680889),c=a.i(832116),d=a.i(972795),e=a.i(961374),f=a.i(264572),g=a.i(6938),h=a.i(968623),i=a.i(143971);class j extends Error{code;provider;constructor(a,b,c){super(c),this.code=a,this.provider=b,this.name="AiProviderError"}}async function k(a){return c.db.aiCapabilityConfig.findUnique({where:{slot:a}})}async function l(a){let b=await k(a),c=b?.provider??"claude",d=b?.model??void 0,e=i.providerRegistry.get(c);if(!e)throw new j("CLI_NOT_FOUND",c,`Provider "${c}" 未注册`);let f=e.cli?.adapter;if(!f)throw new j("UNSUPPORTED_MODE",c,`Provider "${c}" 不支持 CLI 模式`);return{adapter:f,provider:e,model:d}}var m=a.i(924868),n=a.i(446786),o=a.i(814747),p=a.i(632919);let q=g.logger.create("agent-actions"),r=(0,o.join)((0,n.tmpdir)(),"tower-signals");async function s(a,b){try{await (0,m.mkdir)(r,{recursive:!0,mode:448}),await (0,m.writeFile)((0,o.join)(r,`exit-${a}`),String(b),{mode:384})}catch{}}function t(a,b){try{return JSON.parse(a)}catch{throw Error(`CLI Profile ${b} 格式损坏,请在 Settings 中修复`)}}async function u(){let a=await c.db.cliProfile.findFirst({where:{isDefault:!0}});return a||c.db.cliProfile.create({data:{name:"Default",command:"claude",baseArgs:JSON.stringify(["--dangerously-skip-permissions"]),envVars:"{}",isDefault:!0}})}async function v(a,b){let e=await c.db.taskMessage.create({data:{role:"USER",content:b,taskId:a}});return(0,d.revalidatePath)("/workspaces"),{userMessage:e}}async function w(a){return c.db.taskMessage.findMany({where:{taskId:a},orderBy:{createdAt:"asc"}})}async function x(a,b="CLAUDE_CODE",e,f){let g=await c.db.taskExecution.create({data:{taskId:a,agent:b,status:"RUNNING",startedAt:new Date,worktreePath:e??null,worktreeBranch:f??null}});return await c.db.task.update({where:{id:a},data:{status:"IN_PROGRESS"}}),(0,d.revalidatePath)("/workspaces"),g}async function y(a,b="FAILED"){let e=await c.db.taskExecution.update({where:{id:a},data:{status:b,endedAt:new Date}});return(0,d.revalidatePath)("/workspaces"),e}async function z(b){let{destroySession:e,getSession:f}=await a.A(585988),g=f(b),h=g?.getBuffer()??"",i=await c.db.taskExecution.findFirst({where:{taskId:b,status:"RUNNING"},orderBy:{createdAt:"desc"}}),j=await c.db.task.findUnique({where:{id:b},include:{project:{select:{localPath:!0}}}});if(e(b),i){await c.db.taskExecution.update({where:{id:i.id},data:{status:"COMPLETED",endedAt:new Date}}),await c.db.task.update({where:{id:b},data:{status:"IN_REVIEW"}});let d=i.worktreePath||j?.project?.localPath||null,{captureExecutionSummary:e}=await a.A(131993);await e(i.id,b,0,h,d)}(0,d.revalidatePath)("/workspaces")}async function A(a){return c.db.taskExecution.findMany({where:{taskId:a},orderBy:{createdAt:"desc"},include:{insightNote:{select:{id:!0,title:!0,content:!0}}}})}async function B(b,e){let g=await c.db.task.findUnique({where:{id:b},include:{project:!0}});if(!g)throw Error("Task not found");if(!g.project?.localPath)throw Error("Project has no local path configured");await c.db.taskExecution.updateMany({where:{taskId:b,status:"RUNNING",NOT:{sessionId:e}},data:{status:"FAILED",endedAt:new Date}});let i=await c.db.taskExecution.findFirst({where:{taskId:b,sessionId:e},orderBy:{createdAt:"desc"}});if(!i)throw Error("Previous execution not found");let j=i.worktreePath??g.project.localPath,k=g.subPath?(0,o.join)(j,g.subPath):j,m=await u(),n=t(m.baseArgs,"baseArgs"),p=t(m.envVars,"envVars"),r=await (0,h.readConfigValue)("terminal.idleTimeoutSec",180),{adapter:v}=await l("terminal"),w=v.buildEnvOverrides({taskId:b,taskTitle:g.title,apiUrl:`http://localhost:${process.env.PORT||"3000"}`,callbackUrl:i.callbackUrl??void 0}),x=await c.db.taskExecution.update({where:{id:i.id},data:{status:"RUNNING",endedAt:null}});await c.db.task.update({where:{id:b},data:{status:"IN_PROGRESS"}}),(0,d.revalidatePath)("/workspaces");let y=await (0,h.readConfigValue)("onboarding.username",""),z=v.buildSpawnArgs({taskId:b,prompt:"",cwd:k,resumeSessionId:e,profileArgs:[...n,...y?["--append-system-prompt",`The user's name is ${y}.`]:[]],profileEnvVars:p,envOverrides:w}),A=/no conversation found with session id|unknown session|session .* not found/i;return(0,f.createSession)(b,z.command,z.args,k,()=>{},async d=>{await s(b,d);let f=await c.db.taskExecution.findUnique({where:{id:x.id}});if(f?.status!=="RUNNING")return;let{getSession:h}=await a.A(585988),j=h(b),k=j?.getBuffer()??"";if(0!==d&&A.test(k)){q.info("Session resume failed — retrying with fresh execution",{taskId:b,previousSessionId:e}),await c.db.taskExecution.update({where:{id:x.id},data:{status:"FAILED",endedAt:new Date}}).catch(()=>{});try{await D(b,g.title)}catch(a){q.error("Fresh execution retry also failed",a,{taskId:b})}return}await c.db.taskExecution.update({where:{id:x.id},data:{status:0===d?"COMPLETED":"FAILED",endedAt:new Date}}).catch(()=>{});let l=i.worktreePath||g.project.localPath,{captureExecutionSummary:m}=await a.A(131993);await m(x.id,b,d,k,l);let{dispatchTaskCompletionEvent:n}=await a.A(4868);await n({taskId:b,taskTitle:g.title,status:0===d?"COMPLETED":"FAILED",executionId:x.id,workspaceId:g.project.workspaceId}),0===d&&await c.db.task.update({where:{id:b},data:{status:"IN_REVIEW"}}).catch(()=>{})},z.env,void 0,1e3*r),{executionId:x.id,worktreePath:i.worktreePath??j??null}}async function C(b){let e=await c.db.task.findUnique({where:{id:b},include:{project:!0}});if(!e)throw Error("Task not found");if(!e.project?.localPath)throw Error("Project has no local path configured");let g=await c.db.taskExecution.findFirst({where:{taskId:b},orderBy:{createdAt:"desc"}}),{destroySession:i}=await a.A(585988);i(b),await c.db.taskExecution.updateMany({where:{taskId:b,status:"RUNNING"},data:{status:"FAILED",endedAt:new Date}});let j=g?.worktreePath??e.project.localPath,k=e.subPath?(0,o.join)(j,e.subPath):j,m=await u(),n=t(m.baseArgs,"baseArgs"),p=t(m.envVars,"envVars"),q=await (0,h.readConfigValue)("terminal.idleTimeoutSec",180),{adapter:r,provider:v}=await l("terminal"),w=r.buildEnvOverrides({taskId:b,taskTitle:e.title,apiUrl:`http://localhost:${process.env.PORT||"3000"}`}),x=await c.db.taskExecution.create({data:{taskId:b,agent:v.agentFieldValue,status:"RUNNING",startedAt:new Date,worktreePath:g?.worktreePath??null,worktreeBranch:g?.worktreeBranch??null}});await c.db.task.update({where:{id:b},data:{status:"IN_PROGRESS"}}),(0,d.revalidatePath)("/workspaces");let y=await (0,h.readConfigValue)("onboarding.username",""),z=r.buildSpawnArgs({taskId:b,prompt:"",cwd:k,continueLatest:!0,profileArgs:[...n,...y?["--append-system-prompt",`The user's name is ${y}.`]:[]],profileEnvVars:p,envOverrides:w});return(0,f.createSession)(b,z.command,z.args,k,()=>{},async d=>{await s(b,d);let f=await c.db.taskExecution.findUnique({where:{id:x.id}});if(f?.status!=="RUNNING")return;let{getSession:h}=await a.A(585988),i=h(b),j=i?.getBuffer()??"";await c.db.taskExecution.update({where:{id:x.id},data:{status:0===d?"COMPLETED":"FAILED",endedAt:new Date}}).catch(()=>{});let k=g?.worktreePath||e.project.localPath,{captureExecutionSummary:l}=await a.A(131993);await l(x.id,b,d,j,k);let{dispatchTaskCompletionEvent:m}=await a.A(4868);await m({taskId:b,taskTitle:e.title,status:0===d?"COMPLETED":"FAILED",executionId:x.id,workspaceId:e.project.workspaceId}),0===d&&await c.db.task.update({where:{id:b},data:{status:"IN_REVIEW"}}).catch(()=>{})},z.env,void 0,1e3*q),{executionId:x.id,worktreePath:g?.worktreePath??j??null}}async function D(b,g,i,j){let k,p,r=await c.db.task.findUnique({where:{id:b},include:{project:!0}});if(!r)throw Error("Task not found");if(!r.project?.localPath)throw Error("Project has no local path configured");let v=await (0,h.readConfigValue)("system.maxConcurrentExecutions",20);if(await c.db.taskExecution.count({where:{status:"RUNNING"}})>=v)throw Error(`已达并发上限(${v}),请等待其他任务完成后再启动`);let w=await u(),x=t(w.baseArgs,"baseArgs"),y=t(w.envVars,"envVars"),z=await (0,h.readConfigValue)("terminal.idleTimeoutSec",180),{adapter:A,provider:B,model:C}=await l("terminal");await c.db.taskExecution.updateMany({where:{taskId:b,status:"RUNNING"},data:{status:"FAILED",endedAt:new Date}}),"IN_PROGRESS"!==r.status&&(await c.db.task.update({where:{id:b},data:{status:"IN_PROGRESS"}}),(0,d.revalidatePath)("/workspaces"));let D=await c.db.taskMessage.findMany({where:{taskId:b},orderBy:{createdAt:"desc"},take:10}),E=[`Task: ${r.title}`,r.description?`Description: ${r.description}`:"",D.length>0?`Recent conversation:
|
|
2
|
+
${D.reverse().map(a=>`${a.role}: ${a.content}`).join("\n")}`:"",g.trim()?`User message: ${g}`:""].filter(Boolean).join("\n\n"),F=i??r.promptId;if(F){let a=await c.db.agentPrompt.findUnique({where:{id:F}});a?.content&&(p=await (0,m.mkdtemp)((0,o.join)((0,n.tmpdir)(),"tower-pty-")),k=(0,o.join)(p,"instructions.md"),await (0,m.writeFile)(k,a.content,"utf-8"))}let G=null,H=null;if(r.baseBranch&&r.project.localPath){let{worktreePath:a,worktreeBranch:c}=await (0,e.createWorktree)(r.project.localPath,b,r.baseBranch);G=a,H=c}let I=G??r.project.localPath,J=r.subPath?(0,o.join)(I,r.subPath):I,K=await c.db.taskExecution.create({data:{taskId:b,agent:B.agentFieldValue,status:"RUNNING",startedAt:new Date,worktreePath:G??null,worktreeBranch:H??null,callbackUrl:j??null}});if(r.project.localPath)try{let b,{execFileSync:d}=await a.A(144264);(b=G&&r.baseBranch?d("git",["merge-base",r.baseBranch,"HEAD"],{cwd:G,encoding:"utf-8",timeout:5e3}).trim():d("git",["rev-parse","HEAD"],{cwd:r.project.localPath,encoding:"utf-8",timeout:5e3}).trim())&&await c.db.taskExecution.update({where:{id:K.id},data:{forkCommit:b}})}catch{}let L="";if(k){let{readFile:b}=await a.A(260815);L+=await b(k,"utf-8")}let M=await (0,h.readConfigValue)("onboarding.username","");M&&(L+=(L?"\n":"")+`The user's name is ${M}.`);let N=A.buildSpawnArgs({taskId:b,prompt:E,cwd:J,profileArgs:[...x,...L?["--append-system-prompt",L]:[],...C?["--model",C]:[]],profileEnvVars:y,envOverrides:A.buildEnvOverrides({taskId:b,taskTitle:r.title,apiUrl:`http://localhost:${process.env.PORT||"3000"}`,callbackUrl:j??void 0})});return(0,f.createSession)(b,N.command,N.args,J,()=>{},async d=>{await s(b,d);let e=await c.db.taskExecution.findUnique({where:{id:K.id}});if(e?.status!=="RUNNING")return;let{getSession:f}=await a.A(585988),g=f(b),h=g?.getBuffer()??"";await c.db.taskExecution.update({where:{id:K.id},data:{status:0===d?"COMPLETED":"FAILED",endedAt:new Date}}).catch(a=>{q.error("Failed to update execution status",a)});let i=G||r.project.localPath,{captureExecutionSummary:j}=await a.A(131993);await j(K.id,b,d,h,i);let{dispatchTaskCompletionEvent:k}=await a.A(4868);await k({taskId:b,taskTitle:r.title,status:0===d?"COMPLETED":"FAILED",executionId:K.id,workspaceId:r.project.workspaceId}),0===d&&await c.db.task.update({where:{id:b},data:{status:"IN_REVIEW"}}).catch(a=>{q.error("Failed to update task status",a)}),p&&await (0,m.rm)(p,{recursive:!0,force:!0}).catch(()=>{})},N.env,void 0,1e3*z),{executionId:K.id,worktreePath:G??I??null}}async function E(){return(await c.db.taskExecution.findMany({where:{status:"RUNNING"},orderBy:{startedAt:"asc"},include:{task:{include:{project:{include:{workspace:!0}}}}}})).map(a=>({executionId:a.id,taskId:a.taskId,taskTitle:a.task.title,projectId:a.task.project.id,projectName:a.task.project.name,projectAlias:a.task.project.alias,projectLocalPath:a.task.project.localPath,workspaceId:a.task.project.workspace.id,workspaceName:a.task.project.workspace.name,worktreePath:a.worktreePath,startedAt:a.startedAt?.toISOString()??null}))}(0,p.ensureServerEntryExports)([v,w,x,y,z,A,B,C,D,E]),(0,b.registerServerReference)(v,"60d61124dd3bb5ff1dc54f8b46354c432a18096620",null),(0,b.registerServerReference)(w,"409c3c2ee5cdf39f0b09796959112ee05c71a4a0be",null),(0,b.registerServerReference)(x,"789203e15d44189b4c29849acc1cf47dc5dd9f966f",null),(0,b.registerServerReference)(y,"60835ef76392399f91a839ff3152a203557682fd13",null),(0,b.registerServerReference)(z,"40fdf7b3c181dbd95bb2d785fd7925a65618a9bbfc",null),(0,b.registerServerReference)(A,"40514bf5261873cfa56acd3eacfdff662ea87ad96b",null),(0,b.registerServerReference)(B,"60097a58828811207251170fac5cf1eb4ee31bc301",null),(0,b.registerServerReference)(C,"40d34d213bc1ab35df38cb181947027c13e0e67544",null),(0,b.registerServerReference)(D,"78e2cd9bdb426640f014a1ec4624b473c25a849d42",null),(0,b.registerServerReference)(E,"00e1052a7b75ee380b577be49f12d8051d90c67c4d",null),a.s(["continueLatestPtyExecution",0,C,"getActiveExecutionsAcrossWorkspaces",0,E,"getTaskExecutions",0,A,"getTaskMessages",0,w,"resumePtyExecution",0,B,"sendTaskMessage",0,v,"startPtyExecution",0,D,"startTaskExecution",0,x,"stopPtyExecution",0,z,"stopTaskExecution",0,y],643700)}];
|
|
3
3
|
|
|
4
4
|
//# sourceMappingURL=project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[5533,a=>{"use strict";a.s([],475505),a.i(475505),a.i(
|
|
1
|
+
module.exports=[5533,a=>{"use strict";a.s([],475505),a.i(475505),a.i(524699),a.i(192132),a.i(141376),a.i(109810),a.i(606212),a.i(964135),a.i(165244),a.i(116304),a.i(221590);var b=a.i(879876);let c=(0,b.createServerReference)("60e7051da0886a62ea7451b4651de5f0cf5066da0e",b.callServer,void 0,b.findSourceMapURL,"revealInFinder");a.s(["revealInFinder",0,c],5533)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=project_f_tower_src_actions_file-actions_ts_02i742t._.js.map
|
package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[502160,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(584335),e=a.i(879876);let f=(0,e.createServerReference)("00e0100ba8769bdf64315d935cd52974956f58d4da",e.callServer,void 0,e.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var g=a.i(713844);let h=[{id:"1x1",label:"1×1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2×1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3×2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2×2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4×2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3×3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var i=a.i(224372),j=a.i(410756),k=a.i(468518),l=a.i(302856);let m=(0,l.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var n=a.i(521612);function o({cols:a,rows:c,active:d}){let e=Array.from({length:a*c});return(0,b.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${d?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${a}, 1fr)`,gridTemplateRows:`repeat(${c}, 1fr)`},children:e.map((a,c)=>(0,b.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${d?"bg-primary":"bg-muted-foreground/40"}`},c))})}let p="custom";function q({value:a,customValue:e,onChange:f}){let{t:g}=(0,d.useI18n)(),[i,k]=(0,c.useState)(!1),l=(0,c.useRef)(null),m=a===p,r=m?null:h.find(b=>b.id===a)??h[2],[s,t]=(0,c.useState)(e?.cols??2),[u,v]=(0,c.useState)(e?.rows??2),[w,x]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,c.useEffect)(()=>{(0,n.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(a=>{x({minCols:a["missions.grid.minCols"]??1,maxCols:a["missions.grid.maxCols"]??5,minRows:a["missions.grid.minRows"]??1,maxRows:a["missions.grid.maxRows"]??5})})},[]),(0,c.useEffect)(()=>{e&&(t(e.cols),v(e.rows))},[e?.cols,e?.rows]),(0,c.useEffect)(()=>{if(i)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a);function a(a){l.current&&!l.current.contains(a.target)&&k(!1)}},[i]);let y=(a,b,c)=>Math.max(b,Math.min(c,a)),z=m?s:r?.cols??2,A=m?u:r?.rows??2,B=m?`${s}\xd7${u}`:r?.label??"";return(0,b.jsxs)("div",{ref:l,className:"relative",children:[(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>k(a=>!a),className:"gap-2",children:[(0,b.jsx)(o,{cols:z,rows:A,active:!1}),(0,b.jsx)("span",{children:B}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),i&&(0,b.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,b.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:g("missions.gridPreset")}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[h.map(c=>{let d=c.id===a;return(0,b.jsxs)("button",{onClick:()=>{f(c.id),k(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${d?"bg-primary/10":"hover:bg-accent"}`,children:[(0,b.jsx)(o,{cols:c.cols,rows:c.rows,active:d}),(0,b.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${d?"text-primary":"text-foreground"}`,children:c.label}),(0,b.jsx)("span",{className:`text-xs ${d?"text-primary/60":"text-muted-foreground"}`,children:c.desc})]},c.id)}),(0,b.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,b.jsxs)("button",{onClick:()=>{m||f(p,{cols:s,rows:u})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${m?"bg-primary/10":"hover:bg-accent"}`,children:[(0,b.jsx)(o,{cols:s,rows:u,active:m}),(0,b.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${m?"text-primary":"text-foreground"}`,children:g("missions.gridCustom")}),(0,b.jsxs)("span",{className:`text-xs ${m?"text-primary/60":"text-muted-foreground"}`,children:[s,"×",u]})]}),m&&(0,b.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:g("missions.gridCols")}),(0,b.jsx)("input",{type:"number",min:w.minCols,max:w.maxCols,value:s,onChange:a=>{let b;t(b=y(Number(a.target.value),w.minCols,w.maxCols)),f(p,{cols:b,rows:u})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:"×"}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:g("missions.gridRows")}),(0,b.jsx)("input",{type:"number",min:w.minRows,max:w.maxRows,value:u,onChange:a=>{let b;v(b=y(Number(a.target.value),w.minRows,w.maxRows)),f(p,{cols:s,rows:b})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var r=a.i(11505),s=a.i(107788),t=a.i(357089),u=a.i(448287),v=a.i(466126);let w=(0,l.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),x=(0,l.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var y=a.i(54709);let z=(0,l.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var A=a.i(95446),B=a.i(48300),C=a.i(122135),D=a.i(942308);let E=(0,t.default)(async()=>{},{loadableGenerated:{modules:[467005]},ssr:!1,loading:()=>(0,b.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function F({execution:a,isRemoving:e,removeReason:f,onStop:g,onSessionEnd:h}){let{t:i}=(0,d.useI18n)(),k=(0,u.useRouter)(),{attributes:l,listeners:m,setNodeRef:n,transform:o,transition:p}=(0,s.useSortable)({id:a.executionId}),q={transform:v.CSS.Transform.toString(o),transition:p,opacity:+!e},[r,t]=(0,c.useState)(()=>a.startedAt?Math.floor((Date.now()-new Date(a.startedAt).getTime())/1e3):0);(0,c.useEffect)(()=>{if(e)return;let b=setInterval(()=>{t(a.startedAt?Math.floor((Date.now()-new Date(a.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(b)},[a.startedAt,e]);let G=Math.floor(r/60),H=`${G}m ${r%60}s`;async function I(){if(a.projectLocalPath)try{await (0,C.openInTerminal)(a.projectLocalPath)}catch{D.toast.error(i("preview.terminalError"))}}return(0,b.jsxs)("div",{ref:n,style:q,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...l,children:[(0,b.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,b.jsx)("button",{...m,"aria-label":i("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,b.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[a.workspaceName," ›"," ",a.projectAlias||a.projectName," ›"," ",(0,b.jsx)("span",{className:"text-foreground font-semibold",children:a.taskTitle})]}),e?(0,b.jsx)(B.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===f?i("missions.statusStopped"):i("missions.statusCompleted")}):(0,b.jsx)(B.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:i("missions.statusRunning")}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:H}),a.projectLocalPath&&(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:I}),children:(0,b.jsx)(z,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.openInTerminal")})]}),(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>k.push(`/workspaces/${a.workspaceId}/tasks/${a.taskId}`)}),children:(0,b.jsx)(x,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.openFullView")})]}),(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>g(a.taskId),disabled:e}),children:(0,b.jsx)(y.X,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.stopTask")})]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,b.jsx)(E,{taskId:a.taskId,worktreePath:a.worktreePath??a.projectLocalPath,onSessionEnd:b=>h?.(a.taskId,b),useCanvasRenderer:!0})})]})}let G=(0,e.createServerReference)("40d54cdc3ec5fc657987f05c5fd9673a3cf5550c64",e.callServer,void 0,e.findSourceMapURL,"getWorkspacesWithRecentTasks"),H=(0,e.createServerReference)("4097e24d8f2caf211a65c4facbb6fcd41f59014b43",e.callServer,void 0,e.findSourceMapURL,"getProjectTasks");var I=a.i(483541),J=a.i(966916),K=a.i(857122);let L=(0,l.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var M=a.i(595313),N=a.i(358440);let O={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},P={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function Q({status:a}){return(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[a]??"bg-slate-100 text-slate-600"}`,children:O[a]??a})}function R({task:a,isRunning:c,launchingId:d,onLaunchNew:e,onResume:f,t:g}){let h=a.executions?.[0]?.sessionId,i=d===a.id;return(0,b.jsxs)("div",{className:"group/task flex items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:`text-sm truncate ${c?"italic text-muted-foreground":""}`,children:a.title}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,b.jsx)(Q,{status:a.status}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:P[a.priority]??a.priority})]})]}),c?(0,b.jsx)("span",{className:"text-[10px] italic text-muted-foreground shrink-0",children:g("missions.alreadyMonitored")}):(0,b.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity shrink-0",children:[h&&(0,b.jsxs)(j.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>f(a.id,h),disabled:i,title:g("missions.continueSession"),children:[(0,b.jsx)(M.RotateCcw,{className:"h-3 w-3 mr-1"}),g("missions.continueLabel")]}),(0,b.jsxs)(j.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>e(a.id),disabled:i,title:g("missions.launchNew"),children:[(0,b.jsx)(L,{className:"h-3 w-3 mr-1"}),i?"...":g("missions.launchNewLabel")]})]})]})}function S({open:a,onOpenChange:e,onLaunchNew:f,onResume:g,runningTaskIds:h,launchingId:j}){let{t:k}=(0,d.useI18n)(),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)([]);(0,c.useEffect)(()=>{a&&(o(""),q(""),s([]),G(100).then(m).catch(()=>D.toast.error(k("missions.error.launchFailed"))))},[a,k]),(0,c.useEffect)(()=>{p?H(p).then(a=>{s(a.filter(a=>"TODO"===a.status||"IN_PROGRESS"===a.status||"IN_REVIEW"===a.status))}).catch(()=>D.toast.error(k("missions.error.launchFailed"))):s([])},[p,k]);let t=l.find(a=>a.id===n),u=t?.projects??[];return(0,b.jsx)(K.Dialog,{open:a,onOpenChange:e,children:(0,b.jsxs)(K.DialogContent,{className:"max-w-lg max-h-[70vh] flex flex-col",children:[(0,b.jsx)(K.DialogHeader,{children:(0,b.jsx)(K.DialogTitle,{children:k("missions.fullPickerTitle")})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,b.jsxs)(i.Select,{value:n,onValueChange:a=>{o(a??""),q("")},children:[(0,b.jsx)(i.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,b.jsx)("span",{className:"truncate",children:l.find(a=>a.id===n)?.name??k("missions.launcher.selectWorkspace")})}),(0,b.jsx)(i.SelectContent,{children:l.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.name},a.id))})]}),(0,b.jsxs)(i.Select,{value:p,onValueChange:a=>q(a??""),disabled:!n,children:[(0,b.jsx)(i.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,b.jsx)("span",{className:"truncate",children:u.find(a=>a.id===p)?.name??k("missions.launcher.selectProject")})}),(0,b.jsx)(i.SelectContent,{children:u.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.alias??a.name},a.id))})]})]}),(0,b.jsx)(N.ScrollArea,{className:"flex-1 min-h-0 -mx-2",children:0===r.length&&p?(0,b.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:k("missions.launcher.noTasks")}):0===r.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:k("missions.fullPickerHint")}):r.map(a=>(0,b.jsx)(R,{task:a,isRunning:h.has(a.id),launchingId:j,onLaunchNew:f,onResume:g,t:k},a.id))})]})})}function T({open:a,onOpenChange:e,onLaunched:f,runningTaskIds:g=new Set,anchorRef:h}){let{t:i}=(0,d.useI18n)(),k=(0,c.useRef)(null),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(o(!0),G(3).then(m).catch(()=>D.toast.error(i("missions.error.launchFailed"))).finally(()=>o(!1)))},[a,i]),(0,c.useEffect)(()=>{if(a)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b);function b(a){let b=a.target;if(k.current&&!k.current.contains(b)){if(h?.current&&h.current.contains(b))return;e(!1)}}},[a,e,h]);let t=(0,c.useCallback)(async a=>{try{q(a),await (0,I.startPtyExecution)(a,""),f(a),e(!1),s(!1)}catch{D.toast.error(i("missions.error.launchFailed"))}finally{q(null)}},[f,e,i]),u=(0,c.useCallback)(async(a,b)=>{try{q(a),await (0,J.resumePtyExecution)(a,b),f(a),e(!1),s(!1)}catch{D.toast.error(i("missions.error.launchFailed"))}finally{q(null)}},[f,e,i]),v=(0,c.useCallback)(()=>{e(!1),s(!0)},[e]);return a||r?(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsxs)("div",{ref:k,className:"absolute right-0 z-50 mt-1 w-96 rounded-lg border border-border bg-popover shadow-xl flex flex-col overflow-hidden",style:{maxHeight:"480px"},children:[(0,b.jsx)("div",{className:"px-3 py-2 border-b border-border shrink-0",children:(0,b.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:i("missions.pickerTitle")})}),(0,b.jsx)(N.ScrollArea,{className:"flex-1 min-h-0",children:n?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===l.length?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:i("missions.noAvailableTasks")}):l.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"sticky top-0 z-10 px-3 py-1.5 bg-popover border-b border-border/50",children:(0,b.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:a.name})}),a.projects.map(a=>0===a._count.tasks?null:(0,b.jsxs)("div",{className:"mb-1",children:[(0,b.jsx)("div",{className:"px-3 pt-2 pb-0.5",children:(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:a.alias??a.name})}),a.tasks.map(a=>(0,b.jsx)(R,{task:a,isRunning:g.has(a.id),launchingId:p,onLaunchNew:t,onResume:u,t:i},a.id))]},a.id))]},a.id))}),(0,b.jsx)("div",{className:"shrink-0 border-t border-border",children:(0,b.jsx)(j.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:v,children:i("missions.showMoreTasks")})})]}),(0,b.jsx)(S,{open:r,onOpenChange:s,onLaunchNew:t,onResume:u,runningTaskIds:g,launchingId:p})]}):null}a.s(["MissionsClient",0,function({initialExecutions:a}){let{t:e}=(0,d.useI18n)(),[l,n]=(0,c.useState)(a),[o,p]=(0,c.useState)(()=>"3x2"),[t,u]=(0,c.useState)(()=>({cols:2,rows:2})),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(""),z=(0,c.useRef)(null),[A,B]=(0,c.useState)(new Map),C=(0,c.useRef)(A);(0,c.useEffect)(()=>{C.current=A},[A]);let E=(0,c.useRef)(new Map),G=h.find(a=>a.id===o)??h[2],H="custom"===o?t.cols:G.cols,I="custom"===o?t.rows:G.rows,J=(0,c.useRef)(null),[K,L]=(0,c.useState)("480px");(0,c.useEffect)(()=>{let a=J.current;if(!a)return;let b=()=>{let b=(a.clientHeight-32-16*(I-1))/I;L(`${Math.max(b,200)}px`)};b();let c=new ResizeObserver(b);return c.observe(a),()=>c.disconnect()},[I]);let M=(0,c.useCallback)((a,b)=>{a&&(p(a),localStorage.setItem("missions-grid-preset",a),"custom"===a&&b&&(u(b),localStorage.setItem("missions-grid-custom",JSON.stringify(b))))},[]),N=(0,r.useSensors)((0,r.useSensor)(r.PointerSensor,{activationConstraint:{distance:8}})),O=(0,c.useCallback)(a=>{let{active:b,over:c}=a;c&&b.id!==c.id&&n(a=>{let d=a.findIndex(a=>a.executionId===b.id),e=a.findIndex(a=>a.executionId===c.id);return(0,s.arrayMove)(a,d,e)})},[]),P=(0,c.useCallback)((a,b)=>{if(C.current.has(a))return;B(c=>new Map([...c,[a,b]]));let c=setTimeout(()=>{n(b=>b.filter(b=>b.executionId!==a)),B(b=>{let c=new Map(b);return c.delete(a),c}),E.current.delete(a)},500);E.current.set(a,c)},[]);(0,c.useEffect)(()=>{let a=setInterval(async()=>{try{let a=await f();n(b=>{let c=C.current,{merged:d,goneIds:e}=function({prev:a,fresh:b,removingIds:c}){let d=new Set(b.map(a=>a.executionId)),e=[];a.forEach(a=>{d.has(a.executionId)||c.has(a.executionId)||e.push(a.executionId)});let f=a.filter(a=>d.has(a.executionId)||c.has(a.executionId)),g=new Set(a.map(a=>a.executionId));return{merged:[...f,...b.filter(a=>!g.has(a.executionId))],goneIds:e}}({prev:b,fresh:a,removingIds:new Set(c.keys())});return e.forEach(a=>P(a,"completed")),d})}catch{}},4e3);return()=>clearInterval(a)},[P]),(0,c.useEffect)(()=>{let a=E.current;return()=>{a.forEach(a=>clearTimeout(a))}},[]);let Q=(0,c.useCallback)(async a=>{try{await (0,g.stopPtyExecution)(a),n(b=>{let c=b.find(b=>b.taskId===a);return c&&P(c.executionId,"stopped"),b})}catch{D.toast.error(e("missions.error.stopFailed"))}},[P,e]),R=(0,c.useCallback)((a,b)=>{n(b=>{let c=b.find(b=>b.taskId===a);return c&&P(c.executionId,"completed"),b})},[P]),S=(0,c.useCallback)(a=>{f().then(a=>{n(b=>{let c=new Set(b.map(a=>a.executionId));return[...b,...a.filter(a=>!c.has(a.executionId))]})}).catch(()=>{})},[]),U=Array.from(new Map(l.map(a=>[a.workspaceId,a.workspaceName])).entries()).map(([a,b])=>({id:a,name:b})),V=x?l.filter(a=>a.workspaceId===x):l,W=new Set(l.map(a=>a.taskId));return(0,b.jsxs)("div",{className:"flex h-full flex-col",children:[(0,b.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,b.jsx)("h1",{className:"text-base font-semibold",children:e("missions.pageTitle")}),(0,b.jsxs)(i.Select,{value:x,onValueChange:a=>y(a??""),children:[(0,b.jsx)(i.SelectTrigger,{className:"w-36 h-8",children:(0,b.jsx)("span",{className:"truncate",children:x?U.find(a=>a.id===x)?.name??e("missions.filterAll"):e("missions.filterAll")})}),(0,b.jsxs)(i.SelectContent,{children:[(0,b.jsx)(i.SelectItem,{value:"",children:e("missions.filterAll")}),U.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.name},a.id))]})]}),(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsx)(q,{value:o,customValue:t,onChange:M}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(j.Button,{ref:z,onClick:()=>w(a=>!a),children:e("missions.launchTask")}),(0,b.jsx)(T,{open:v,onOpenChange:w,onLaunched:S,runningTaskIds:W,anchorRef:z})]})]}),(0,b.jsx)("div",{ref:J,className:"flex-1 overflow-auto min-h-0 p-4",children:0===V.length&&0===A.size?(0,b.jsx)(k.EmptyState,{icon:m,title:e("missions.emptyTitle"),description:e("missions.emptyDesc"),className:"h-full",action:(0,b.jsx)(j.Button,{onClick:()=>w(!0),children:e("missions.launchTask")})}):(0,b.jsx)(r.DndContext,{id:"missions-dnd",sensors:N,collisionDetection:r.closestCenter,onDragEnd:O,children:(0,b.jsx)(s.SortableContext,{items:V.map(a=>a.executionId),strategy:s.rectSortingStrategy,children:(0,b.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${H}, 1fr)`,gridAutoRows:K},children:V.map(a=>(0,b.jsx)(F,{execution:a,isRemoving:A.has(a.executionId),removeReason:A.get(a.executionId),onStop:Q,onSessionEnd:R},a.executionId))})})})})]})}],502160)}];
|
|
1
|
+
module.exports=[502160,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(584335),e=a.i(879876);let f=(0,e.createServerReference)("00e1052a7b75ee380b577be49f12d8051d90c67c4d",e.callServer,void 0,e.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var g=a.i(684871);let h=[{id:"1x1",label:"1×1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2×1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3×2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2×2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4×2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3×3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var i=a.i(224372),j=a.i(410756),k=a.i(468518),l=a.i(302856);let m=(0,l.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var n=a.i(324310);function o({cols:a,rows:c,active:d}){let e=Array.from({length:a*c});return(0,b.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${d?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${a}, 1fr)`,gridTemplateRows:`repeat(${c}, 1fr)`},children:e.map((a,c)=>(0,b.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${d?"bg-primary":"bg-muted-foreground/40"}`},c))})}let p="custom";function q({value:a,customValue:e,onChange:f}){let{t:g}=(0,d.useI18n)(),[i,k]=(0,c.useState)(!1),l=(0,c.useRef)(null),m=a===p,r=m?null:h.find(b=>b.id===a)??h[2],[s,t]=(0,c.useState)(e?.cols??2),[u,v]=(0,c.useState)(e?.rows??2),[w,x]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,c.useEffect)(()=>{(0,n.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(a=>{x({minCols:a["missions.grid.minCols"]??1,maxCols:a["missions.grid.maxCols"]??5,minRows:a["missions.grid.minRows"]??1,maxRows:a["missions.grid.maxRows"]??5})})},[]),(0,c.useEffect)(()=>{e&&(t(e.cols),v(e.rows))},[e?.cols,e?.rows]),(0,c.useEffect)(()=>{if(i)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a);function a(a){l.current&&!l.current.contains(a.target)&&k(!1)}},[i]);let y=(a,b,c)=>Math.max(b,Math.min(c,a)),z=m?s:r?.cols??2,A=m?u:r?.rows??2,B=m?`${s}\xd7${u}`:r?.label??"";return(0,b.jsxs)("div",{ref:l,className:"relative",children:[(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>k(a=>!a),className:"gap-2",children:[(0,b.jsx)(o,{cols:z,rows:A,active:!1}),(0,b.jsx)("span",{children:B}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),i&&(0,b.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,b.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:g("missions.gridPreset")}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[h.map(c=>{let d=c.id===a;return(0,b.jsxs)("button",{onClick:()=>{f(c.id),k(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${d?"bg-primary/10":"hover:bg-accent"}`,children:[(0,b.jsx)(o,{cols:c.cols,rows:c.rows,active:d}),(0,b.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${d?"text-primary":"text-foreground"}`,children:c.label}),(0,b.jsx)("span",{className:`text-xs ${d?"text-primary/60":"text-muted-foreground"}`,children:c.desc})]},c.id)}),(0,b.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,b.jsxs)("button",{onClick:()=>{m||f(p,{cols:s,rows:u})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${m?"bg-primary/10":"hover:bg-accent"}`,children:[(0,b.jsx)(o,{cols:s,rows:u,active:m}),(0,b.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${m?"text-primary":"text-foreground"}`,children:g("missions.gridCustom")}),(0,b.jsxs)("span",{className:`text-xs ${m?"text-primary/60":"text-muted-foreground"}`,children:[s,"×",u]})]}),m&&(0,b.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:g("missions.gridCols")}),(0,b.jsx)("input",{type:"number",min:w.minCols,max:w.maxCols,value:s,onChange:a=>{let b;t(b=y(Number(a.target.value),w.minCols,w.maxCols)),f(p,{cols:b,rows:u})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:"×"}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:g("missions.gridRows")}),(0,b.jsx)("input",{type:"number",min:w.minRows,max:w.maxRows,value:u,onChange:a=>{let b;v(b=y(Number(a.target.value),w.minRows,w.maxRows)),f(p,{cols:s,rows:b})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var r=a.i(11505),s=a.i(107788),t=a.i(357089),u=a.i(448287),v=a.i(466126);let w=(0,l.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),x=(0,l.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var y=a.i(54709);let z=(0,l.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var A=a.i(95446),B=a.i(48300),C=a.i(128839),D=a.i(942308);let E=(0,t.default)(async()=>{},{loadableGenerated:{modules:[467005]},ssr:!1,loading:()=>(0,b.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function F({execution:a,isRemoving:e,removeReason:f,onStop:g,onSessionEnd:h}){let{t:i}=(0,d.useI18n)(),k=(0,u.useRouter)(),{attributes:l,listeners:m,setNodeRef:n,transform:o,transition:p}=(0,s.useSortable)({id:a.executionId}),q={transform:v.CSS.Transform.toString(o),transition:p,opacity:+!e},[r,t]=(0,c.useState)(()=>a.startedAt?Math.floor((Date.now()-new Date(a.startedAt).getTime())/1e3):0);(0,c.useEffect)(()=>{if(e)return;let b=setInterval(()=>{t(a.startedAt?Math.floor((Date.now()-new Date(a.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(b)},[a.startedAt,e]);let G=Math.floor(r/60),H=`${G}m ${r%60}s`;async function I(){if(a.projectLocalPath)try{await (0,C.openInTerminal)(a.projectLocalPath)}catch{D.toast.error(i("preview.terminalError"))}}return(0,b.jsxs)("div",{ref:n,style:q,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...l,children:[(0,b.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,b.jsx)("button",{...m,"aria-label":i("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,b.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[a.workspaceName," ›"," ",a.projectAlias||a.projectName," ›"," ",(0,b.jsx)("span",{className:"text-foreground font-semibold",children:a.taskTitle})]}),e?(0,b.jsx)(B.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===f?i("missions.statusStopped"):i("missions.statusCompleted")}):(0,b.jsx)(B.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:i("missions.statusRunning")}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:H}),a.projectLocalPath&&(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:I}),children:(0,b.jsx)(z,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.openInTerminal")})]}),(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>k.push(`/workspaces/${a.workspaceId}/tasks/${a.taskId}`)}),children:(0,b.jsx)(x,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.openFullView")})]}),(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>g(a.taskId),disabled:e}),children:(0,b.jsx)(y.X,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.stopTask")})]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,b.jsx)(E,{taskId:a.taskId,worktreePath:a.worktreePath??a.projectLocalPath,onSessionEnd:b=>h?.(a.taskId,b),useCanvasRenderer:!0})})]})}let G=(0,e.createServerReference)("406284301e79d715496b549f957cf93e59c11fd396",e.callServer,void 0,e.findSourceMapURL,"getWorkspacesWithRecentTasks"),H=(0,e.createServerReference)("40d66bc3a4bd909d3ff4467f7f93e39ab7820b26d7",e.callServer,void 0,e.findSourceMapURL,"getProjectTasks");var I=a.i(720822),J=a.i(480012),K=a.i(857122);let L=(0,l.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var M=a.i(595313),N=a.i(358440);let O={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},P={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function Q({status:a}){return(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[a]??"bg-slate-100 text-slate-600"}`,children:O[a]??a})}function R({task:a,isRunning:c,launchingId:d,onLaunchNew:e,onResume:f,t:g}){let h=a.executions?.[0]?.sessionId,i=d===a.id;return(0,b.jsxs)("div",{className:"group/task flex items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:`text-sm truncate ${c?"italic text-muted-foreground":""}`,children:a.title}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,b.jsx)(Q,{status:a.status}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:P[a.priority]??a.priority})]})]}),c?(0,b.jsx)("span",{className:"text-[10px] italic text-muted-foreground shrink-0",children:g("missions.alreadyMonitored")}):(0,b.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity shrink-0",children:[h&&(0,b.jsxs)(j.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>f(a.id,h),disabled:i,title:g("missions.continueSession"),children:[(0,b.jsx)(M.RotateCcw,{className:"h-3 w-3 mr-1"}),g("missions.continueLabel")]}),(0,b.jsxs)(j.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>e(a.id),disabled:i,title:g("missions.launchNew"),children:[(0,b.jsx)(L,{className:"h-3 w-3 mr-1"}),i?"...":g("missions.launchNewLabel")]})]})]})}function S({open:a,onOpenChange:e,onLaunchNew:f,onResume:g,runningTaskIds:h,launchingId:j}){let{t:k}=(0,d.useI18n)(),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)([]);(0,c.useEffect)(()=>{a&&(o(""),q(""),s([]),G(100).then(m).catch(()=>D.toast.error(k("missions.error.launchFailed"))))},[a,k]),(0,c.useEffect)(()=>{p?H(p).then(a=>{s(a.filter(a=>"TODO"===a.status||"IN_PROGRESS"===a.status||"IN_REVIEW"===a.status))}).catch(()=>D.toast.error(k("missions.error.launchFailed"))):s([])},[p,k]);let t=l.find(a=>a.id===n),u=t?.projects??[];return(0,b.jsx)(K.Dialog,{open:a,onOpenChange:e,children:(0,b.jsxs)(K.DialogContent,{className:"max-w-lg max-h-[70vh] flex flex-col",children:[(0,b.jsx)(K.DialogHeader,{children:(0,b.jsx)(K.DialogTitle,{children:k("missions.fullPickerTitle")})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,b.jsxs)(i.Select,{value:n,onValueChange:a=>{o(a??""),q("")},children:[(0,b.jsx)(i.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,b.jsx)("span",{className:"truncate",children:l.find(a=>a.id===n)?.name??k("missions.launcher.selectWorkspace")})}),(0,b.jsx)(i.SelectContent,{children:l.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.name},a.id))})]}),(0,b.jsxs)(i.Select,{value:p,onValueChange:a=>q(a??""),disabled:!n,children:[(0,b.jsx)(i.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,b.jsx)("span",{className:"truncate",children:u.find(a=>a.id===p)?.name??k("missions.launcher.selectProject")})}),(0,b.jsx)(i.SelectContent,{children:u.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.alias??a.name},a.id))})]})]}),(0,b.jsx)(N.ScrollArea,{className:"flex-1 min-h-0 -mx-2",children:0===r.length&&p?(0,b.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:k("missions.launcher.noTasks")}):0===r.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:k("missions.fullPickerHint")}):r.map(a=>(0,b.jsx)(R,{task:a,isRunning:h.has(a.id),launchingId:j,onLaunchNew:f,onResume:g,t:k},a.id))})]})})}function T({open:a,onOpenChange:e,onLaunched:f,runningTaskIds:g=new Set,anchorRef:h}){let{t:i}=(0,d.useI18n)(),k=(0,c.useRef)(null),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(o(!0),G(3).then(m).catch(()=>D.toast.error(i("missions.error.launchFailed"))).finally(()=>o(!1)))},[a,i]),(0,c.useEffect)(()=>{if(a)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b);function b(a){let b=a.target;if(k.current&&!k.current.contains(b)){if(h?.current&&h.current.contains(b))return;e(!1)}}},[a,e,h]);let t=(0,c.useCallback)(async a=>{try{q(a),await (0,I.startPtyExecution)(a,""),f(a),e(!1),s(!1)}catch{D.toast.error(i("missions.error.launchFailed"))}finally{q(null)}},[f,e,i]),u=(0,c.useCallback)(async(a,b)=>{try{q(a),await (0,J.resumePtyExecution)(a,b),f(a),e(!1),s(!1)}catch{D.toast.error(i("missions.error.launchFailed"))}finally{q(null)}},[f,e,i]),v=(0,c.useCallback)(()=>{e(!1),s(!0)},[e]);return a||r?(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsxs)("div",{ref:k,className:"absolute right-0 z-50 mt-1 w-96 rounded-lg border border-border bg-popover shadow-xl flex flex-col overflow-hidden",style:{maxHeight:"480px"},children:[(0,b.jsx)("div",{className:"px-3 py-2 border-b border-border shrink-0",children:(0,b.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:i("missions.pickerTitle")})}),(0,b.jsx)(N.ScrollArea,{className:"flex-1 min-h-0",children:n?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===l.length?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:i("missions.noAvailableTasks")}):l.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"sticky top-0 z-10 px-3 py-1.5 bg-popover border-b border-border/50",children:(0,b.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:a.name})}),a.projects.map(a=>0===a._count.tasks?null:(0,b.jsxs)("div",{className:"mb-1",children:[(0,b.jsx)("div",{className:"px-3 pt-2 pb-0.5",children:(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:a.alias??a.name})}),a.tasks.map(a=>(0,b.jsx)(R,{task:a,isRunning:g.has(a.id),launchingId:p,onLaunchNew:t,onResume:u,t:i},a.id))]},a.id))]},a.id))}),(0,b.jsx)("div",{className:"shrink-0 border-t border-border",children:(0,b.jsx)(j.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:v,children:i("missions.showMoreTasks")})})]}),(0,b.jsx)(S,{open:r,onOpenChange:s,onLaunchNew:t,onResume:u,runningTaskIds:g,launchingId:p})]}):null}a.s(["MissionsClient",0,function({initialExecutions:a}){let{t:e}=(0,d.useI18n)(),[l,n]=(0,c.useState)(a),[o,p]=(0,c.useState)(()=>"3x2"),[t,u]=(0,c.useState)(()=>({cols:2,rows:2})),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(""),z=(0,c.useRef)(null),[A,B]=(0,c.useState)(new Map),C=(0,c.useRef)(A);(0,c.useEffect)(()=>{C.current=A},[A]);let E=(0,c.useRef)(new Map),G=h.find(a=>a.id===o)??h[2],H="custom"===o?t.cols:G.cols,I="custom"===o?t.rows:G.rows,J=(0,c.useRef)(null),[K,L]=(0,c.useState)("480px");(0,c.useEffect)(()=>{let a=J.current;if(!a)return;let b=()=>{let b=(a.clientHeight-32-16*(I-1))/I;L(`${Math.max(b,200)}px`)};b();let c=new ResizeObserver(b);return c.observe(a),()=>c.disconnect()},[I]);let M=(0,c.useCallback)((a,b)=>{a&&(p(a),localStorage.setItem("missions-grid-preset",a),"custom"===a&&b&&(u(b),localStorage.setItem("missions-grid-custom",JSON.stringify(b))))},[]),N=(0,r.useSensors)((0,r.useSensor)(r.PointerSensor,{activationConstraint:{distance:8}})),O=(0,c.useCallback)(a=>{let{active:b,over:c}=a;c&&b.id!==c.id&&n(a=>{let d=a.findIndex(a=>a.executionId===b.id),e=a.findIndex(a=>a.executionId===c.id);return(0,s.arrayMove)(a,d,e)})},[]),P=(0,c.useCallback)((a,b)=>{if(C.current.has(a))return;B(c=>new Map([...c,[a,b]]));let c=setTimeout(()=>{n(b=>b.filter(b=>b.executionId!==a)),B(b=>{let c=new Map(b);return c.delete(a),c}),E.current.delete(a)},500);E.current.set(a,c)},[]);(0,c.useEffect)(()=>{let a=setInterval(async()=>{try{let a=await f();n(b=>{let c=C.current,{merged:d,goneIds:e}=function({prev:a,fresh:b,removingIds:c}){let d=new Set(b.map(a=>a.executionId)),e=[];a.forEach(a=>{d.has(a.executionId)||c.has(a.executionId)||e.push(a.executionId)});let f=a.filter(a=>d.has(a.executionId)||c.has(a.executionId)),g=new Set(a.map(a=>a.executionId));return{merged:[...f,...b.filter(a=>!g.has(a.executionId))],goneIds:e}}({prev:b,fresh:a,removingIds:new Set(c.keys())});return e.forEach(a=>P(a,"completed")),d})}catch{}},4e3);return()=>clearInterval(a)},[P]),(0,c.useEffect)(()=>{let a=E.current;return()=>{a.forEach(a=>clearTimeout(a))}},[]);let Q=(0,c.useCallback)(async a=>{try{await (0,g.stopPtyExecution)(a),n(b=>{let c=b.find(b=>b.taskId===a);return c&&P(c.executionId,"stopped"),b})}catch{D.toast.error(e("missions.error.stopFailed"))}},[P,e]),R=(0,c.useCallback)((a,b)=>{n(b=>{let c=b.find(b=>b.taskId===a);return c&&P(c.executionId,"completed"),b})},[P]),S=(0,c.useCallback)(a=>{f().then(a=>{n(b=>{let c=new Set(b.map(a=>a.executionId));return[...b,...a.filter(a=>!c.has(a.executionId))]})}).catch(()=>{})},[]),U=Array.from(new Map(l.map(a=>[a.workspaceId,a.workspaceName])).entries()).map(([a,b])=>({id:a,name:b})),V=x?l.filter(a=>a.workspaceId===x):l,W=new Set(l.map(a=>a.taskId));return(0,b.jsxs)("div",{className:"flex h-full flex-col",children:[(0,b.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,b.jsx)("h1",{className:"text-base font-semibold",children:e("missions.pageTitle")}),(0,b.jsxs)(i.Select,{value:x,onValueChange:a=>y(a??""),children:[(0,b.jsx)(i.SelectTrigger,{className:"w-36 h-8",children:(0,b.jsx)("span",{className:"truncate",children:x?U.find(a=>a.id===x)?.name??e("missions.filterAll"):e("missions.filterAll")})}),(0,b.jsxs)(i.SelectContent,{children:[(0,b.jsx)(i.SelectItem,{value:"",children:e("missions.filterAll")}),U.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.name},a.id))]})]}),(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsx)(q,{value:o,customValue:t,onChange:M}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(j.Button,{ref:z,onClick:()=>w(a=>!a),children:e("missions.launchTask")}),(0,b.jsx)(T,{open:v,onOpenChange:w,onLaunched:S,runningTaskIds:W,anchorRef:z})]})]}),(0,b.jsx)("div",{ref:J,className:"flex-1 overflow-auto min-h-0 p-4",children:0===V.length&&0===A.size?(0,b.jsx)(k.EmptyState,{icon:m,title:e("missions.emptyTitle"),description:e("missions.emptyDesc"),className:"h-full",action:(0,b.jsx)(j.Button,{onClick:()=>w(!0),children:e("missions.launchTask")})}):(0,b.jsx)(r.DndContext,{id:"missions-dnd",sensors:N,collisionDetection:r.closestCenter,onDragEnd:O,children:(0,b.jsx)(s.SortableContext,{items:V.map(a=>a.executionId),strategy:s.rectSortingStrategy,children:(0,b.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${H}, 1fr)`,gridAutoRows:K},children:V.map(a=>(0,b.jsx)(F,{execution:a,isRemoving:A.has(a.executionId),removeReason:A.get(a.executionId),onStop:Q,onSessionEnd:R},a.executionId))})})})})]})}],502160)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js.map
|