tower-studio 0.2.20 → 0.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +25 -25
  13. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +3 -2
  18. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  20. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +61 -61
  21. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  23. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  24. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +25 -25
  25. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  27. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  28. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +25 -25
  29. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  31. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  32. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +41 -41
  33. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  36. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +76 -76
  37. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  40. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +80 -80
  41. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  44. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +57 -57
  45. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  48. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +59 -59
  49. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  51. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  52. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +25 -25
  53. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  55. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  56. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +68 -68
  57. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  60. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +68 -68
  61. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  63. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  64. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +43 -43
  65. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  66. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  67. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +12 -0
  68. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +2 -2
  69. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +2 -2
  70. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05se6yk._.js +1 -1
  71. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06m1r8x._.js +1 -1
  72. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_6swdz._.js +1 -1
  73. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iyp~.k._.js +10 -2
  74. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3iihg._.js +3 -0
  75. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ogh_qu._.js +10 -2
  76. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q.piu~._.js +9 -1
  77. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +1 -1
  78. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  79. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  80. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02-6df-._.js +3 -3
  81. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e_-mj-._.js +3 -3
  82. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fzkdjl._.js +3 -3
  83. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0f72pl_._.js → [root-of-the-server]__0hy3~f.._.js} +2 -2
  84. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  85. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pu-v0l._.js +3 -3
  86. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0q-abig._.js +3 -0
  87. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0q~lxnz._.js +3 -0
  88. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0th0_fo._.js +3 -3
  89. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ty1ao1._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0um1ugs._.js +3 -3
  91. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.hrt0s._.js → [root-of-the-server]__10ol5vl._.js} +1 -1
  93. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__134_xv.._.js +1 -1
  94. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vgkq5._.js +3 -3
  95. package/.next/standalone/.next/server/chunks/ssr/_00jadm8._.js +3 -0
  96. package/.next/standalone/.next/server/chunks/ssr/{_0es22_y._.js → _03.a~r1._.js} +2 -2
  97. package/.next/standalone/.next/server/chunks/ssr/_053zyvm._.js +3 -0
  98. package/.next/standalone/.next/server/chunks/ssr/{_0tua.9p._.js → _08x3jaa._.js} +2 -2
  99. package/.next/standalone/.next/server/chunks/ssr/_08z-g~5._.js +3 -3
  100. package/.next/standalone/.next/server/chunks/ssr/{_0-zk1xq._.js → _09j4imi._.js} +2 -2
  101. package/.next/standalone/.next/server/chunks/ssr/_09r0_z9._.js +3 -0
  102. package/.next/standalone/.next/server/chunks/ssr/_0_vjay8._.js +3 -3
  103. package/.next/standalone/.next/server/chunks/ssr/_0a554d8._.js +3 -0
  104. package/.next/standalone/.next/server/chunks/ssr/{_0z-mopi._.js → _0aw2qq6._.js} +2 -2
  105. package/.next/standalone/.next/server/chunks/ssr/{_0fhds8v._.js → _0bmywa6._.js} +2 -2
  106. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  107. package/.next/standalone/.next/server/chunks/ssr/_0ghovf3._.js +4 -0
  108. package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
  109. package/.next/standalone/.next/server/chunks/ssr/{_10sx3n7._.js → _0jyj~t3._.js} +3 -3
  110. package/.next/standalone/.next/server/chunks/ssr/_0r6gweb._.js +3 -3
  111. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/ssr/_0rt8jf_._.js +3 -3
  113. package/.next/standalone/.next/server/chunks/ssr/_0unw1fq._.js +2 -2
  114. package/.next/standalone/.next/server/chunks/ssr/_0uuzh5m._.js +3 -3
  115. package/.next/standalone/.next/server/chunks/ssr/{_0ln8vj0._.js → _0yakvlq._.js} +3 -3
  116. package/.next/standalone/.next/server/chunks/ssr/_0~aon4t._.js +3 -3
  117. package/.next/standalone/.next/server/chunks/ssr/{_0nzwk2y._.js → _13r9dxk._.js} +3 -3
  118. package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +1 -1
  119. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  123. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  129. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  130. package/.next/standalone/.next/server/pages/500.html +1 -1
  131. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  132. package/.next/standalone/.next/server/server-reference-manifest.json +233 -233
  133. package/.next/standalone/.next/static/chunks/{0~7zlta-boej_.js → 00fv~h4rni5hv.js} +1 -1
  134. package/.next/standalone/.next/static/chunks/{0m2o51rtidmxh.js → 00p3.tda-56.l.js} +1 -1
  135. package/.next/standalone/.next/static/chunks/{0mqdumoz_frlg.js → 01tnwkggn5.s-.js} +1 -1
  136. package/.next/standalone/.next/static/chunks/02bobmiee9ss8.js +1 -0
  137. package/.next/standalone/.next/static/chunks/039ntokp82-em.js +1 -0
  138. package/.next/standalone/.next/static/chunks/{0j157xr-bax~d.js → 04yrp-8ps3q_-.js} +1 -1
  139. package/.next/standalone/.next/static/chunks/05.wfh773dxo9.js +1 -0
  140. package/.next/standalone/.next/static/chunks/06~1n6of8ll__.js +5 -0
  141. package/.next/standalone/.next/static/chunks/0_n2l3jehwcsq.js +1 -0
  142. package/.next/standalone/.next/static/chunks/{0m90vde-l0h1a.js → 0aq7ksckxr-8-.js} +2 -2
  143. package/.next/standalone/.next/static/chunks/0d4~4k4hv01ah.js +1 -0
  144. package/.next/standalone/.next/static/chunks/{08q54xdtb58sp.js → 0f1gk0.5slqqh.js} +1 -1
  145. package/.next/standalone/.next/static/chunks/0ip_37zz4f080.js +1 -0
  146. package/.next/standalone/.next/static/chunks/{15nh9t21_9u6i.js → 0j16~sj50uq_m.js} +1 -1
  147. package/.next/standalone/.next/static/chunks/0o8jf4a30e_ri.js +5 -0
  148. package/.next/standalone/.next/static/chunks/0ol16355~utic.js +5 -0
  149. package/.next/standalone/.next/static/chunks/{0wzn4nbo56gf3.js → 0pg_rf2cch5pv.js} +1 -1
  150. package/.next/standalone/.next/static/chunks/0pwe0m3i1rro1.js +1 -0
  151. package/.next/standalone/.next/static/chunks/{163o-5kdc6me5.js → 0rwca.wrfl3b9.js} +1 -1
  152. package/.next/standalone/.next/static/chunks/0srx~7bncp64q.js +5 -0
  153. package/.next/standalone/.next/static/chunks/{0bxz4rml4iaob.js → 0vyvdsh1mkl5d.js} +1 -1
  154. package/.next/standalone/.next/static/chunks/{0vykez3mijj6f.js → 10h~50kdsu5fx.js} +1 -1
  155. package/.next/standalone/.next/static/chunks/{18aqm8uawnpl3.js → 15esfko8asvh7.js} +1 -1
  156. package/.next/standalone/.next/static/chunks/{0yje2relcvr6r.js → 16sn2ij01qrfz.js} +1 -1
  157. package/.next/standalone/.next/static/chunks/{1157qwl1lq-uv.js → 17oxpxjm7_smn.js} +1 -1
  158. package/.next/standalone/package.json +1 -1
  159. package/package.json +1 -1
  160. package/skills/tower/SKILL.md +9 -0
  161. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3ggen._.js +0 -12
  162. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08mkpqd._.js +0 -3
  163. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ntdmyn._.js +0 -3
  164. package/.next/standalone/.next/server/chunks/ssr/_07~q7qs._.js +0 -3
  165. package/.next/standalone/.next/server/chunks/ssr/_09b8zgw._.js +0 -4
  166. package/.next/standalone/.next/server/chunks/ssr/_0_2c7e0._.js +0 -3
  167. package/.next/standalone/.next/server/chunks/ssr/_0mqxe~e._.js +0 -3
  168. package/.next/standalone/.next/server/chunks/ssr/_12e_1hd._.js +0 -3
  169. package/.next/standalone/.next/static/chunks/0-93a_ovah-e0.js +0 -5
  170. package/.next/standalone/.next/static/chunks/0.rw..0v.8a1-.js +0 -5
  171. package/.next/standalone/.next/static/chunks/0gh2r0ji~m34y.js +0 -1
  172. package/.next/standalone/.next/static/chunks/0odb2p6e7-8n8.js +0 -1
  173. package/.next/standalone/.next/static/chunks/0t0.k0pugrmxt.js +0 -1
  174. package/.next/standalone/.next/static/chunks/0xrhj92idqx72.js +0 -5
  175. package/.next/standalone/.next/static/chunks/0yj4qfp~pk5na.js +0 -1
  176. package/.next/standalone/.next/static/chunks/0zk-aoc.g8t8h.js +0 -1
  177. package/.next/standalone/.next/static/chunks/11~-fm76bj3r4.js +0 -1
  178. package/.next/standalone/.next/static/chunks/13wlh1lxhudv~.js +0 -1
  179. package/.next/standalone/.next/static/chunks/16pnb9m-vqs75.js +0 -5
  180. /package/.next/standalone/.next/static/{QK0JGDY3UZSvD1SQgyL-w → zosKR5i2aA392qu0Ka1j9}/_buildManifest.js +0 -0
  181. /package/.next/standalone/.next/static/{QK0JGDY3UZSvD1SQgyL-w → zosKR5i2aA392qu0Ka1j9}/_clientMiddlewareManifest.js +0 -0
  182. /package/.next/standalone/.next/static/{QK0JGDY3UZSvD1SQgyL-w → zosKR5i2aA392qu0Ka1j9}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- module.exports=[495370,a=>{"use strict";var b=a.i(815429),c=a.i(761469),d=a.i(188139),e=a.i(496877);async function f(a){return c.db.label.findMany({where:{OR:[{isBuiltin:!0},{workspaceId:a}]},orderBy:[{isBuiltin:"desc"},{name:"asc"}]})}async function g(a){let b=e.createLabelSchema.parse(a),f=await c.db.label.create({data:{name:b.name,color:b.color,workspaceId:b.workspaceId}});return(0,d.revalidatePath)("/workspaces"),f}async function h(a){let b=await c.db.label.findUnique({where:{id:a}});if(!b)throw Error("Label not found");if(b.isBuiltin)throw Error("Cannot delete builtin labels");await c.db.label.delete({where:{id:a}}),(0,d.revalidatePath)("/workspaces")}async function i(a,b){await c.db.$transaction(async c=>{await c.taskLabel.deleteMany({where:{taskId:a}}),b.length>0&&await c.taskLabel.createMany({data:b.map(b=>({taskId:a,labelId:b}))})}),(0,d.revalidatePath)("/workspaces")}async function j(a){return(await c.db.taskLabel.findMany({where:{taskId:a},include:{label:!0}})).map(a=>a.label)}(0,a.i(630048).ensureServerEntryExports)([f,g,h,i,j]),(0,b.registerServerReference)(f,"4035e735b1b22894193be485cb6a9524a54a795c4a",null),(0,b.registerServerReference)(g,"40d394c70d71176e9b48354f6c4f59095c8dcbabd2",null),(0,b.registerServerReference)(h,"40f6f414c4c9714d1f6d472444873071e2e0703567",null),(0,b.registerServerReference)(i,"6079c2c1d6092dcace7fdf012860938d2500e68b4f",null),(0,b.registerServerReference)(j,"40759c0652dd2f3a64b4d2b77207dc3a329eae4cc9",null),a.s(["createLabel",0,g,"deleteLabel",0,h,"getLabelsForWorkspace",0,f,"getTaskLabels",0,j,"setTaskLabels",0,i])},287068,a=>{"use strict";var b=a.i(761469);function c(a,b){return{id:a.note_id,type:"note",title:a.title,subtitle:`${a.workspace_name} / ${a.project_name}`,navigateTo:`/workspaces/${a.workspaceId}/notes?projectId=${a.projectId}`,snippet:a.content?a.content.slice(0,b):void 0}}async function d(a,e="task",f){if(!a.trim())return[];let g=a.trim(),{resultLimit:h,allModeCap:i,snippetLength:j}=f;if("all"===e){let[a,b,c,e,h]=await Promise.allSettled([d(g,"task",f),d(g,"project",f),d(g,"repository",f),d(g,"note",f),d(g,"asset",f)]),j=a=>"fulfilled"===a.status?a.value.slice(0,i):[];return[...j(a),...j(b),...j(c),...j(e),...j(h)]}if("task"===e)return(await b.db.task.findMany({where:{OR:[{title:{contains:g}},{description:{contains:g}}]},include:{project:{include:{workspace:!0}}},take:h,orderBy:{updatedAt:"desc"}})).map(a=>{let b="DONE"===a.status||"CANCELLED"===a.status,c=a.project.workspaceId;return{id:a.id,type:"task",title:a.title,subtitle:`${a.project.workspace.name} / ${a.project.name}`,navigateTo:b?`/workspaces/${c}/archive?projectId=${a.projectId}`:`/workspaces/${c}?projectId=${a.projectId}`}});if("project"===e)return(await b.db.project.findMany({where:{OR:[{name:{contains:g}},{alias:{contains:g}},{description:{contains:g}}]},include:{workspace:!0},take:h,orderBy:{updatedAt:"desc"}})).map(a=>({id:a.id,type:"project",title:a.alias?`${a.name} (${a.alias})`:a.name,subtitle:a.workspace.name,navigateTo:`/workspaces/${a.workspaceId}?projectId=${a.id}`}));if("repository"===e)return(await b.db.repository.findMany({where:{OR:[{name:{contains:g}},{path:{contains:g}}]},include:{project:{include:{workspace:!0}}},take:h})).map(a=>({id:a.id,type:"repository",title:a.name,subtitle:`${a.project.workspace.name} / ${a.project.name} \xb7 ${a.branch}`,navigateTo:`/workspaces/${a.project.workspaceId}?projectId=${a.projectId}`}));if("note"===e){if(g.length<3)return(await b.db.$queryRawUnsafe(`SELECT n.id as note_id, n.title, n.content,
1
+ module.exports=[495370,a=>{"use strict";var b=a.i(815429),c=a.i(761469),d=a.i(188139),e=a.i(496877);async function f(a){return c.db.label.findMany({where:{OR:[{isBuiltin:!0},{workspaceId:a}]},orderBy:[{isBuiltin:"desc"},{name:"asc"}]})}async function g(a){let b=e.createLabelSchema.parse(a),f=await c.db.label.create({data:{name:b.name,color:b.color,workspaceId:b.workspaceId}});return(0,d.revalidatePath)("/workspaces"),f}async function h(a){let b=await c.db.label.findUnique({where:{id:a}});if(!b)throw Error("Label not found");if(b.isBuiltin)throw Error("Cannot delete builtin labels");await c.db.label.delete({where:{id:a}}),(0,d.revalidatePath)("/workspaces")}async function i(a,b){await c.db.$transaction(async c=>{await c.taskLabel.deleteMany({where:{taskId:a}}),b.length>0&&await c.taskLabel.createMany({data:b.map(b=>({taskId:a,labelId:b}))})}),(0,d.revalidatePath)("/workspaces")}async function j(a){return(await c.db.taskLabel.findMany({where:{taskId:a},include:{label:!0}})).map(a=>a.label)}(0,a.i(630048).ensureServerEntryExports)([f,g,h,i,j]),(0,b.registerServerReference)(f,"40c62fb00530ae3e071a18e1b5cc7097b2ce49490b",null),(0,b.registerServerReference)(g,"40444f7a86f1302e060ba19c60ce890eb7a78ad749",null),(0,b.registerServerReference)(h,"40b29e14239f3fb3582c539de2b5d8951d2d169f75",null),(0,b.registerServerReference)(i,"60a5bb7e4c680d348cda1272ec7d5d08111c60ea62",null),(0,b.registerServerReference)(j,"40115c7252b55b71fcc64979ad887afcbd18a4e43b",null),a.s(["createLabel",0,g,"deleteLabel",0,h,"getLabelsForWorkspace",0,f,"getTaskLabels",0,j,"setTaskLabels",0,i])},287068,a=>{"use strict";var b=a.i(761469);function c(a,b){return{id:a.note_id,type:"note",title:a.title,subtitle:`${a.workspace_name} / ${a.project_name}`,navigateTo:`/workspaces/${a.workspaceId}/notes?projectId=${a.projectId}`,snippet:a.content?a.content.slice(0,b):void 0}}async function d(a,e="task",f){if(!a.trim())return[];let g=a.trim(),{resultLimit:h,allModeCap:i,snippetLength:j}=f;if("all"===e){let[a,b,c,e,h]=await Promise.allSettled([d(g,"task",f),d(g,"project",f),d(g,"repository",f),d(g,"note",f),d(g,"asset",f)]),j=a=>"fulfilled"===a.status?a.value.slice(0,i):[];return[...j(a),...j(b),...j(c),...j(e),...j(h)]}if("task"===e)return(await b.db.task.findMany({where:{OR:[{title:{contains:g}},{description:{contains:g}}]},include:{project:{include:{workspace:!0}}},take:h,orderBy:{updatedAt:"desc"}})).map(a=>{let b="DONE"===a.status||"CANCELLED"===a.status,c=a.project.workspaceId;return{id:a.id,type:"task",title:a.title,subtitle:`${a.project.workspace.name} / ${a.project.name}`,navigateTo:b?`/workspaces/${c}/archive?projectId=${a.projectId}`:`/workspaces/${c}?projectId=${a.projectId}`}});if("project"===e)return(await b.db.project.findMany({where:{OR:[{name:{contains:g}},{alias:{contains:g}},{description:{contains:g}}]},include:{workspace:!0},take:h,orderBy:{updatedAt:"desc"}})).map(a=>({id:a.id,type:"project",title:a.alias?`${a.name} (${a.alias})`:a.name,subtitle:a.workspace.name,navigateTo:`/workspaces/${a.workspaceId}?projectId=${a.id}`}));if("repository"===e)return(await b.db.repository.findMany({where:{OR:[{name:{contains:g}},{path:{contains:g}}]},include:{project:{include:{workspace:!0}}},take:h})).map(a=>({id:a.id,type:"repository",title:a.name,subtitle:`${a.project.workspace.name} / ${a.project.name} \xb7 ${a.branch}`,navigateTo:`/workspaces/${a.project.workspaceId}?projectId=${a.projectId}`}));if("note"===e){if(g.length<3)return(await b.db.$queryRawUnsafe(`SELECT n.id as note_id, n.title, n.content,
2
2
  n."projectId", p."workspaceId", p.name as project_name, w.name as workspace_name
3
3
  FROM "ProjectNote" n
4
4
  JOIN "Project" p ON p.id = n."projectId"
@@ -18,7 +18,7 @@ module.exports=[495370,a=>{"use strict";var b=a.i(815429),c=a.i(761469),d=a.i(18
18
18
  JOIN "Project" p ON p.id = n."projectId"
19
19
  JOIN "Workspace" w ON w.id = p."workspaceId"
20
20
  WHERE n.title LIKE ? OR n.content LIKE ?
21
- LIMIT ?`,`%${g}%`,`%${g}%`,h)).map(a=>c(a,j))}}return"asset"===e?(await b.db.projectAsset.findMany({where:{OR:[{filename:{contains:g}},{description:{contains:g}}]},include:{project:{include:{workspace:!0}}},take:h,orderBy:{createdAt:"desc"}})).map(a=>({id:a.id,type:"asset",title:a.filename,subtitle:`${a.project.workspace.name} / ${a.project.name}`,navigateTo:`/workspaces/${a.project.workspaceId}/assets?projectId=${a.projectId}`,snippet:a.description||void 0})):[]}a.s(["search",0,d])},396904,a=>a.a(async(b,c)=>{try{var d=a.i(815429),e=a.i(287068),f=a.i(980999),g=a.i(630048),h=b([f]);async function i(a,b="task"){let c=await (0,f.getConfigValues)(["search.resultLimit","search.allModeCap","search.snippetLength"]);return(0,e.search)(a,b,{resultLimit:c["search.resultLimit"]??20,allModeCap:c["search.allModeCap"]??5,snippetLength:c["search.snippetLength"]??80})}[f]=h.then?(await h)():h,(0,g.ensureServerEntryExports)([i]),(0,d.registerServerReference)(i,"600c58e87d471b6e34ea1647f939b194970202376b",null),a.s(["globalSearch",0,i]),c()}catch(a){c(a)}},!1),101844,a=>{"use strict";var b=a.i(815429),c=a.i(924868),d=a.i(522734),e=a.i(814747),f=a.i(761469),g=a.i(188139),h=a.i(630048);async function i(b){if(!b||"string"!=typeof b)return{safe:!1,reason:"无效的项目 ID"};let g=await f.db.project.findUnique({where:{id:b}});if(!g||!g.localPath)return{safe:!1,reason:"项目不存在或未设置本地路径"};if((await f.db.taskExecution.findMany({where:{task:{projectId:b},status:"RUNNING"},select:{id:!0}})).length>0)return{safe:!1,reason:"该项目有正在运行的任务执行,请先停止所有执行"};let h=await f.db.task.findMany({where:{projectId:b},select:{id:!0}}),{getSession:i}=await a.A(98813);for(let a of h)if(void 0!==i(a.id))return{safe:!1,reason:"该项目有活跃的终端会话,请先关闭"};let j=e.default.join(g.localPath,".worktrees");if((0,d.existsSync)(j))try{if((await (0,c.readdir)(j)).length>0)return{safe:!1,reason:"该项目有活跃的 Git Worktree,请先清理"}}catch{}return{safe:!0}}async function j(b,h){if(!b||"string"!=typeof b)return{success:!1,error:"无效的项目 ID"};if(!h||"string"!=typeof h||!e.default.isAbsolute(h))return{success:!1,error:"目标路径必须是非空的绝对路径"};let i=await f.db.project.findUnique({where:{id:b}});if(!i||!i.localPath)return{success:!1,error:"项目不存在或未设置本地路径"};let j=i.localPath;if(h===j)return{success:!1,error:"源路径和目标路径相同"};if((await f.db.taskExecution.findMany({where:{task:{projectId:b},status:"RUNNING"},select:{id:!0}})).length>0)return{success:!1,error:"该项目有正在运行的任务执行,请先停止所有执行"};let k=await f.db.task.findMany({where:{projectId:b},select:{id:!0}}),{getSession:l}=await a.A(98813);for(let a of k)if(void 0!==l(a.id))return{success:!1,error:"该项目有活跃的终端会话,请先关闭"};let m=e.default.join(j,".worktrees");if((0,d.existsSync)(m))try{if((await (0,c.readdir)(m)).length>0)return{success:!1,error:"该项目有活跃的 Git Worktree,请先清理"}}catch{}if((0,d.existsSync)(h))try{if((await (0,c.readdir)(h)).length>0)return{success:!1,error:"目标路径已存在且不为空"}}catch{return{success:!1,error:"目标路径已存在且不为空"}}let n=e.default.dirname(h);try{await (0,c.mkdir)(n,{recursive:!0})}catch(a){if("EACCES"===a.code||"EPERM"===a.code)return{success:!1,error:`无权限创建父目录 ${n} — 请检查 Git 路径映射规则的模板是否漏了 "~/" 前缀`};if("EROFS"===a.code)return{success:!1,error:`父目录所在文件系统只读:${n}`};return{success:!1,error:`创建父目录失败:${a.message||a.code||"未知错误"}`}}try{await (0,c.rename)(j,h)}catch(a){if("EXDEV"===a.code)return{success:!1,error:"源路径和目标路径不在同一文件系统,不支持跨设备迁移"};if("EACCES"===a.code||"EPERM"===a.code)return{success:!1,error:`无权限移动到 ${h}`};return{success:!1,error:a.message||"文件系统操作失败"}}return await f.db.project.update({where:{id:b},data:{localPath:h}}),(0,g.revalidatePath)("/workspaces"),{success:!0}}let k=`分析这个项目目录,生成一段简短的 Markdown 项目描述。
21
+ LIMIT ?`,`%${g}%`,`%${g}%`,h)).map(a=>c(a,j))}}return"asset"===e?(await b.db.projectAsset.findMany({where:{OR:[{filename:{contains:g}},{description:{contains:g}}]},include:{project:{include:{workspace:!0}}},take:h,orderBy:{createdAt:"desc"}})).map(a=>({id:a.id,type:"asset",title:a.filename,subtitle:`${a.project.workspace.name} / ${a.project.name}`,navigateTo:`/workspaces/${a.project.workspaceId}/assets?projectId=${a.projectId}`,snippet:a.description||void 0})):[]}a.s(["search",0,d])},396904,a=>a.a(async(b,c)=>{try{var d=a.i(815429),e=a.i(287068),f=a.i(980999),g=a.i(630048),h=b([f]);async function i(a,b="task"){let c=await (0,f.getConfigValues)(["search.resultLimit","search.allModeCap","search.snippetLength"]);return(0,e.search)(a,b,{resultLimit:c["search.resultLimit"]??20,allModeCap:c["search.allModeCap"]??5,snippetLength:c["search.snippetLength"]??80})}[f]=h.then?(await h)():h,(0,g.ensureServerEntryExports)([i]),(0,d.registerServerReference)(i,"60751743522ff78047aba190f7de08fcba63b994a2",null),a.s(["globalSearch",0,i]),c()}catch(a){c(a)}},!1),101844,a=>{"use strict";var b=a.i(815429),c=a.i(924868),d=a.i(522734),e=a.i(814747),f=a.i(761469),g=a.i(188139),h=a.i(630048);async function i(b){if(!b||"string"!=typeof b)return{safe:!1,reason:"无效的项目 ID"};let g=await f.db.project.findUnique({where:{id:b}});if(!g||!g.localPath)return{safe:!1,reason:"项目不存在或未设置本地路径"};if((await f.db.taskExecution.findMany({where:{task:{projectId:b},status:"RUNNING"},select:{id:!0}})).length>0)return{safe:!1,reason:"该项目有正在运行的任务执行,请先停止所有执行"};let h=await f.db.task.findMany({where:{projectId:b},select:{id:!0}}),{getSession:i}=await a.A(98813);for(let a of h)if(void 0!==i(a.id))return{safe:!1,reason:"该项目有活跃的终端会话,请先关闭"};let j=e.default.join(g.localPath,".worktrees");if((0,d.existsSync)(j))try{if((await (0,c.readdir)(j)).length>0)return{safe:!1,reason:"该项目有活跃的 Git Worktree,请先清理"}}catch{}return{safe:!0}}async function j(b,h){if(!b||"string"!=typeof b)return{success:!1,error:"无效的项目 ID"};if(!h||"string"!=typeof h||!e.default.isAbsolute(h))return{success:!1,error:"目标路径必须是非空的绝对路径"};let i=await f.db.project.findUnique({where:{id:b}});if(!i||!i.localPath)return{success:!1,error:"项目不存在或未设置本地路径"};let j=i.localPath;if(h===j)return{success:!1,error:"源路径和目标路径相同"};if((await f.db.taskExecution.findMany({where:{task:{projectId:b},status:"RUNNING"},select:{id:!0}})).length>0)return{success:!1,error:"该项目有正在运行的任务执行,请先停止所有执行"};let k=await f.db.task.findMany({where:{projectId:b},select:{id:!0}}),{getSession:l}=await a.A(98813);for(let a of k)if(void 0!==l(a.id))return{success:!1,error:"该项目有活跃的终端会话,请先关闭"};let m=e.default.join(j,".worktrees");if((0,d.existsSync)(m))try{if((await (0,c.readdir)(m)).length>0)return{success:!1,error:"该项目有活跃的 Git Worktree,请先清理"}}catch{}if((0,d.existsSync)(h))try{if((await (0,c.readdir)(h)).length>0)return{success:!1,error:"目标路径已存在且不为空"}}catch{return{success:!1,error:"目标路径已存在且不为空"}}let n=e.default.dirname(h);try{await (0,c.mkdir)(n,{recursive:!0})}catch(a){if("EACCES"===a.code||"EPERM"===a.code)return{success:!1,error:`无权限创建父目录 ${n} — 请检查 Git 路径映射规则的模板是否漏了 "~/" 前缀`};if("EROFS"===a.code)return{success:!1,error:`父目录所在文件系统只读:${n}`};return{success:!1,error:`创建父目录失败:${a.message||a.code||"未知错误"}`}}try{await (0,c.rename)(j,h)}catch(a){if("EXDEV"===a.code)return{success:!1,error:"源路径和目标路径不在同一文件系统,不支持跨设备迁移"};if("EACCES"===a.code||"EPERM"===a.code)return{success:!1,error:`无权限移动到 ${h}`};return{success:!1,error:a.message||"文件系统操作失败"}}return await f.db.project.update({where:{id:b},data:{localPath:h}}),(0,g.revalidatePath)("/workspaces"),{success:!0}}let k=`分析这个项目目录,生成一段简短的 Markdown 项目描述。
22
22
 
23
23
  读取 package.json、README.md 等关键文件,然后概括:
24
24
 
@@ -42,6 +42,6 @@ Requirements:
42
42
  - Keep it under 1000 words
43
43
  - Use concise Markdown (bold labels + short sentences), no ## headings or tables
44
44
  - Don't list every file/directory, only key information
45
- - Output in English`;async function m(b,c="zh"){if(!b||"string"!=typeof b)throw Error("无效的本地路径");if(b.startsWith("~"))throw Error("不支持 ~ 别名,请提供绝对路径");if(!e.default.isAbsolute(b))throw Error("本地路径必须为绝对路径");let{aiQuery:d}=await a.A(752453),f=await d("en"===c?l:k,b,{maxTurns:10,tools:["Read","Glob"],allowedTools:["Read","Glob"]});if(!f)throw Error("AI 分析未返回结果");return f.length>2e3?f.slice(0,2e3).trimEnd()+"\n\n...":f}(0,h.ensureServerEntryExports)([i,j,m]),(0,b.registerServerReference)(i,"40d474d67d482367a92a77a107951ba1cd1102b987",null),(0,b.registerServerReference)(j,"601ad7263d6879a306b1f5be7639459092299da75c",null),(0,b.registerServerReference)(m,"60d620deef0266f60fc86388756c6fa60282d23a29",null),a.s(["analyzeProjectDirectory",0,m,"checkMigrationSafety",0,i,"migrateProjectPath",0,j])},196195,a=>{"use strict";var b=a.i(815429),c=a.i(233405),d=a.i(814747),e=a.i(446786);function f(a){return a.startsWith("~/")||"~"===a?d.default.join(e.default.homedir(),a.slice(1)):a}async function g(a){if(!a?.trim())return null;let b=d.default.resolve(f(a));try{return(0,c.execSync)("git rev-parse --abbrev-ref HEAD",{cwd:b,encoding:"utf-8",timeout:5e3}).trim()}catch{return null}}async function h(a){if(!a?.trim())return[];let b=d.default.resolve(f(a));try{let a,d;return a=new Set((0,c.execSync)("git branch --format='%(refname:short)'",{cwd:b,encoding:"utf-8",timeout:5e3}).trim().split("\n").filter(Boolean).map(a=>a.replace(/'/g,""))),d=(0,c.execSync)("git branch -r --format='%(refname:short)'",{cwd:b,encoding:"utf-8",timeout:5e3}).trim().split("\n").filter(Boolean).map(a=>a.replace(/'/g,"").replace(/^origin\//,"")).filter(b=>"HEAD"!==b&&!a.has(b)),[...a,...d]}catch{return[]}}async function i(a){if(!a?.trim())return;let b=d.default.resolve(f(a));try{(0,c.spawn)("git",["fetch","--prune"],{cwd:b,stdio:"ignore",detached:!0}).unref()}catch{}}(0,a.i(630048).ensureServerEntryExports)([g,h,i]),(0,b.registerServerReference)(g,"40cab6bfdce457414144715ec29ec6b0e9eeb638ae",null),(0,b.registerServerReference)(h,"406ab39f1bb8aa7d87788e7abe36c7f31481e89de8",null),(0,b.registerServerReference)(i,"4036aaba0d8c5c679356cff5916cc62d0c00afa0e5",null),a.s(["fetchRemoteBranches",0,i,"getCurrentBranch",0,g,"getProjectBranches",0,h])},488766,a=>a.a(async(b,c)=>{try{a.i(244256),a.i(495370);var d=a.i(396904),e=a.i(980999);a.i(101844),a.i(563736),a.i(4634),a.i(689171),a.i(536960),a.i(196195);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),566559,a=>a.a(async(b,c)=>{try{var d=a.i(488766),e=a.i(244256),f=a.i(495370),g=a.i(396904),h=a.i(980999),i=a.i(101844),j=a.i(563736),k=a.i(4634),l=a.i(689171),m=a.i(536960),n=a.i(196195),o=b([d,g,h]);[d,g,h]=o.then?(await o)():o,a.s(["00695564c7f2ce2892db4febc4a168c175b3d2afb9",()=>e.getWorkspacesWithProjects,"00997912ad83ae2be5ec83e7394e4d1a6105f46214",()=>j.listAllExtensionStatus,"009a4750cbb36460580b11d73a223e3366dca084dd",()=>k.getOnboardingStatus,"00fbc689cb0a02219ea14de9ae0e6a836b6ccd9815",()=>h.getActualWsPort,"4008d181ffbd4615d32b560bd561eab2a62538ea7f",()=>j.checkExtension,"40092a66440a7070e7360ec9dca436c03f40e2bcb8",()=>k.setOnboardingProgress,"400b2f4c3ac840453d0226c54c3024cfef7aa31457",()=>l.getProjectTasks,"4010962b6e3809e9ec6adcc5e4727e5afa521b684c",()=>m.openInFileManager,"40170991334b245c08bece90b1660e14a693a6a94d",()=>l.createTask,"402d87b6ead0e5bae4b42b92c38d83853a147ec6dd",()=>e.createProject,"402f12a5c8befd86b1a80847c2c204acd1be2dc265",()=>e.getOrCreateTowerTaskId,"4035e735b1b22894193be485cb6a9524a54a795c4a",()=>f.getLabelsForWorkspace,"4036aaba0d8c5c679356cff5916cc62d0c00afa0e5",()=>n.fetchRemoteBranches,"403d1df8a142d93b5320c6f253ba669b1176f03d16",()=>m.openInTerminal,"405fce19efb2cf0b35a9d14b1a7c8a55c28ea204f4",()=>l.getTaskOverview,"40625a916de87b97176a866a6991098bc7720be836",()=>e.reorderWorkspaces,"406ab39f1bb8aa7d87788e7abe36c7f31481e89de8",()=>n.getProjectBranches,"406d2cdabab5795e4c05cfd5cfb944193885a68fd7",()=>l.toggleTaskPinned,"406f49c17cecdef2dfbba8f09cf2615df00c57e770",()=>l.searchTasks,"40759c0652dd2f3a64b4d2b77207dc3a329eae4cc9",()=>f.getTaskLabels,"4080354b674f4768e267ebd9cf353c32dfa42dcb03",()=>l.getArchivedTasks,"4080b66c619f2654a2fee839c95fd37ce187381c88",()=>l.checkWorktreeClean,"4082f3efb288761c5f251b36fc6721f7269ac6492a",()=>e.deleteProject,"40856b767eb1a0f1ae0bcaab6d5940eb04f1e3899c",()=>e.deleteWorkspace,"408c8af808f6135a2406e34f132c3d198b9be882e3",()=>j.installExtension,"409d39576fd0026333accf483f4e8fa38e8274dac9",()=>e.createWorkspace,"40aa5b737a3c8b15f19d74784e47d3ec8be042714a",()=>l.deleteTask,"40b1b23d9189186160636e3b2750e8a815675b0fc4",()=>e.getWorkspacesWithRecentTasks,"40b2bf301ba7965d688a0a26f0ed4d865276d5fc03",()=>e.getProjectByLocalPath,"40bd7a8eeae93513d0c8ddd2a50e130aa8a7962e7f",()=>l.getArchivedTaskCount,"40be27da3d825f066d4b19581f06b266b91ed8201c",()=>h.resolveGitLocalPath,"40c322aad81ac5ff4595094ae9a89aeb0efb12e49f",()=>e.getWorkspaceById,"40cab6bfdce457414144715ec29ec6b0e9eeb638ae",()=>n.getCurrentBranch,"40cd2b5cf265781af5b411618c378f7ba29ac89115",()=>j.uninstallExtension,"40d394c70d71176e9b48354f6c4f59095c8dcbabd2",()=>f.createLabel,"40d474d67d482367a92a77a107951ba1cd1102b987",()=>i.checkMigrationSafety,"40eaf8cb395a2d553073d5e4b45b5c7e67635a0408",()=>h.getConfigValues,"40f6f414c4c9714d1f6d472444873071e2e0703567",()=>f.deleteLabel,"40fd99148337c60ca94d46d086536b07608aaf2176",()=>k.dispatchTaskCompletionEvent,"40fe3aa7bc2326c6a4b056afc9ed7d44b6d1f2c0e9",()=>e.getRecentLocalProjects,"40ffbf43f53a51dbec34e07f44c777d2eac35a0385",()=>m.openInEditor,"6009a90ec1367547b862dabe8f0f4ee4c1721dbd0c",()=>e.updateWorkspace,"600c58e87d471b6e34ea1647f939b194970202376b",()=>g.globalSearch,"601ad7263d6879a306b1f5be7639459092299da75c",()=>i.migrateProjectPath,"601eafdd454c31272bbc215e55a26b5c6618f49b7b",()=>h.getConfigValue,"6036b3b4879c62e8bbc7f6ec5b55c8eb61b230d299",()=>h.setConfigValue,"603f511232cbef05181f32fde7b4bedb5dedee225f",()=>l.commitWorktreeChanges,"605021ab2307e226d867a3f69b8bb639a7acd99981",()=>l.updateTask,"605b0a1e06e441552e6787ecacf1ccacf98322be73",()=>k.setOnboardingExtensions,"605e1a419b1d57c71f50b31c285b559cc200822a7a",()=>l.updateTaskStatus,"6079c2c1d6092dcace7fdf012860938d2500e68b4f",()=>f.setTaskLabels,"60b00fd1a41111aff9c016bac32cb1e325e8b4c33e",()=>k.completeOnboarding,"60d620deef0266f60fc86388756c6fa60282d23a29",()=>i.analyzeProjectDirectory,"60d96729d37481304ce6156c227b593155e817f078",()=>e.updateProject]),c()}catch(a){c(a)}},!1),76052,a=>{a.v(b=>Promise.all(["server/chunks/ssr/src_lib_127qa83._.js"].map(b=>a.l(b))).then(()=>b(492067)))},98813,a=>{a.v(a=>Promise.resolve().then(()=>a(962620)))},507502,a=>{a.v(a=>Promise.resolve().then(()=>a(845427)))},752453,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__13374-3._.js"].map(b=>a.l(b))).then(()=>b(897667)))},144264,a=>{a.v(a=>Promise.resolve().then(()=>a(233405)))},662330,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0la1659._.js"].map(b=>a.l(b))).then(()=>b(818992)))},323970,a=>{a.v(a=>Promise.resolve().then(()=>a(522734)))},173855,a=>{a.v(b=>Promise.all(["server/chunks/ssr/src_lib_open-targets_ts_12a-_~u._.js"].map(b=>a.l(b))).then(()=>b(289288)))},889618,a=>{a.v(a=>Promise.resolve().then(()=>a(163812)))}];
45
+ - Output in English`;async function m(b,c="zh"){if(!b||"string"!=typeof b)throw Error("无效的本地路径");if(b.startsWith("~"))throw Error("不支持 ~ 别名,请提供绝对路径");if(!e.default.isAbsolute(b))throw Error("本地路径必须为绝对路径");let{aiQuery:d}=await a.A(752453),f=await d("en"===c?l:k,b,{maxTurns:10,tools:["Read","Glob"],allowedTools:["Read","Glob"]});if(!f)throw Error("AI 分析未返回结果");return f.length>2e3?f.slice(0,2e3).trimEnd()+"\n\n...":f}(0,h.ensureServerEntryExports)([i,j,m]),(0,b.registerServerReference)(i,"40bfb929e78b8995885651b72d3b4db9a6b698574f",null),(0,b.registerServerReference)(j,"60f23288a3871909d904ecbaab16d7246813ebcef5",null),(0,b.registerServerReference)(m,"60c04f31783506683945f873bb2f23b60b545118bb",null),a.s(["analyzeProjectDirectory",0,m,"checkMigrationSafety",0,i,"migrateProjectPath",0,j])},196195,a=>{"use strict";var b=a.i(815429),c=a.i(233405),d=a.i(814747),e=a.i(446786);function f(a){return a.startsWith("~/")||"~"===a?d.default.join(e.default.homedir(),a.slice(1)):a}async function g(a){if(!a?.trim())return null;let b=d.default.resolve(f(a));try{return(0,c.execSync)("git rev-parse --abbrev-ref HEAD",{cwd:b,encoding:"utf-8",timeout:5e3}).trim()}catch{return null}}async function h(a){if(!a?.trim())return[];let b=d.default.resolve(f(a));try{let a,d;return a=new Set((0,c.execSync)("git branch --format='%(refname:short)'",{cwd:b,encoding:"utf-8",timeout:5e3}).trim().split("\n").filter(Boolean).map(a=>a.replace(/'/g,""))),d=(0,c.execSync)("git branch -r --format='%(refname:short)'",{cwd:b,encoding:"utf-8",timeout:5e3}).trim().split("\n").filter(Boolean).map(a=>a.replace(/'/g,"").replace(/^origin\//,"")).filter(b=>"HEAD"!==b&&!a.has(b)),[...a,...d]}catch{return[]}}async function i(a){if(!a?.trim())return;let b=d.default.resolve(f(a));try{(0,c.spawn)("git",["fetch","--prune"],{cwd:b,stdio:"ignore",detached:!0}).unref()}catch{}}(0,a.i(630048).ensureServerEntryExports)([g,h,i]),(0,b.registerServerReference)(g,"405810467840a01d7443959ac1f02cfb525fc51278",null),(0,b.registerServerReference)(h,"4065c14c1b969f31d323d26d621b80d898e1d5713c",null),(0,b.registerServerReference)(i,"403ede958bb29b85b6ef1ac727319c6bfbc193cd23",null),a.s(["fetchRemoteBranches",0,i,"getCurrentBranch",0,g,"getProjectBranches",0,h])},488766,a=>a.a(async(b,c)=>{try{a.i(244256),a.i(495370);var d=a.i(396904),e=a.i(980999);a.i(101844),a.i(563736),a.i(4634),a.i(689171),a.i(536960),a.i(196195);var f=b([d,e]);[d,e]=f.then?(await f)():f,a.s([]),c()}catch(a){c(a)}},!1),566559,a=>a.a(async(b,c)=>{try{var d=a.i(488766),e=a.i(244256),f=a.i(495370),g=a.i(396904),h=a.i(980999),i=a.i(101844),j=a.i(563736),k=a.i(4634),l=a.i(689171),m=a.i(536960),n=a.i(196195),o=b([d,g,h]);[d,g,h]=o.then?(await o)():o,a.s(["0005b64703c4a5811dd1acb30be490230d79be171c",()=>j.listAllExtensionStatus,"005b59eef31a2c7bf097c3f67dc6e4d941d4546d61",()=>k.getOnboardingStatus,"00c3f4a8b16c1e7967c2458b5e9b7fd2b57d9bcf6b",()=>h.getActualWsPort,"00f62b2709b1c17b1fbdc7f2618a317972c5b8455a",()=>e.getWorkspacesWithProjects,"400af64baf5eef2e6b627a6d20a331f3d5763c2646",()=>e.deleteProject,"40115c7252b55b71fcc64979ad887afcbd18a4e43b",()=>f.getTaskLabels,"40193ef482efd0e85c14f12ff597c1289afda05300",()=>h.resolveGitLocalPath,"401ad906f1e84e3af1f4ef616c294f5aaf7caac25f",()=>l.searchTasks,"4024cdf75f17616d244c27677852d599eed1afd7cb",()=>e.deleteWorkspace,"40292a7c769eb13bbc34ac66e49c9698605ad03e12",()=>l.getArchivedTasks,"403b726cc7d9cff0549ec73b0b63b5550d931ba5bc",()=>l.getTaskOverview,"403ede958bb29b85b6ef1ac727319c6bfbc193cd23",()=>n.fetchRemoteBranches,"40404bfd84f70f4aa8d30282e4a25081f324161a13",()=>e.createWorkspace,"4040c7dadb7c3e097da9f6b5ea7b34753aed553d3c",()=>j.checkExtension,"4041a7f15aceb3c8450797ad6507b966941cca7fd7",()=>l.toggleTaskPinned,"40444f7a86f1302e060ba19c60ce890eb7a78ad749",()=>f.createLabel,"4045a06ad46f6ca52053a502d00fb918a2354b7c11",()=>j.uninstallExtension,"405810467840a01d7443959ac1f02cfb525fc51278",()=>n.getCurrentBranch,"405ce5c138a36557dec156f4dc02d0709b3e605c83",()=>l.getArchivedTaskCount,"4065c14c1b969f31d323d26d621b80d898e1d5713c",()=>n.getProjectBranches,"40719cb16427d6f878b1d2d591569b47d9eb089f13",()=>e.reorderWorkspaces,"4071f63fb5bd8ebb5c5ff83388414c0dde47707af0",()=>l.deleteTask,"4072804d823a8f55231ec0829fb98a68bc38646216",()=>m.openInFileManager,"40761db40351e40c001ff439284f4ab6a350d93b1b",()=>m.openInTerminal,"407929aafc2405b8ba4236dc6a0815eab451bba86a",()=>k.setOnboardingProgress,"408bcb914d056275e6454a031cc4bc59ce08cf5bc5",()=>e.getOrCreateTowerTaskId,"40a26582229b4a342d27d3eb6da88392b7e70836f4",()=>e.createProject,"40a7283207727ed21a6ecaca85b390988b3687e1dd",()=>m.openInEditor,"40b0c9a5c3b37cdf74d8565ce067e8917e63c79c45",()=>l.checkWorktreeClean,"40b29e14239f3fb3582c539de2b5d8951d2d169f75",()=>f.deleteLabel,"40bfb929e78b8995885651b72d3b4db9a6b698574f",()=>i.checkMigrationSafety,"40c62fb00530ae3e071a18e1b5cc7097b2ce49490b",()=>f.getLabelsForWorkspace,"40ca362c38454d1a8b11e77c4e837e440da6547f6f",()=>j.installExtension,"40d74056ee6b3f93085c03d2130af71d3d22c05f1e",()=>e.getWorkspaceById,"40d87c5b8ecaf5e45003062367ca0e6fdc06ff6eef",()=>k.dispatchTaskCompletionEvent,"40e108c37443f04ac9fce90d392f215b8db06f5e89",()=>e.getProjectByLocalPath,"40ec6af48a9b84fa1af9e1717453043a031bed7e4c",()=>l.createTask,"40f12a108d0c4d5258611b0dd1894d7aafae502aed",()=>h.getConfigValues,"40f47e8b0f2825b36a39876136c9894d36b76d124d",()=>l.getProjectTasks,"40f56c724ff4de28b52994d784fb8faf4cdeb0c411",()=>e.getRecentLocalProjects,"40f97276a1319dc0d5a853766896ef171acf6a813a",()=>e.getWorkspacesWithRecentTasks,"600ac086d615749a75443aa273f648b191a575c17d",()=>h.setConfigValue,"6017cfb7c1ea9098673c3fb41bf5fb4209494d7dd7",()=>l.commitWorktreeChanges,"604d06004b63fdc04eba5a42565e990cde1668c5ed",()=>e.updateWorkspace,"60751743522ff78047aba190f7de08fcba63b994a2",()=>g.globalSearch,"608352de1cc1602250a8ff2ac89d7162a531657d3f",()=>e.updateProject,"60a5bb7e4c680d348cda1272ec7d5d08111c60ea62",()=>f.setTaskLabels,"60af59ff136f132f6f6c9f32423f2b701196b93694",()=>h.getConfigValue,"60b065b32bb69305b6e8ee9a922ad29fbd6b12beb1",()=>k.setOnboardingExtensions,"60c04f31783506683945f873bb2f23b60b545118bb",()=>i.analyzeProjectDirectory,"60e4a419220a4075eb76a0587ff8e11e675f6c5cf2",()=>k.completeOnboarding,"60e903d81016ad087f0673954b19123d6402d9ea4d",()=>l.updateTask,"60f23288a3871909d904ecbaab16d7246813ebcef5",()=>i.migrateProjectPath,"60f81021da1a9765ca9d3ef0fdcc96463310df9374",()=>l.updateTaskStatus]),c()}catch(a){c(a)}},!1),76052,a=>{a.v(b=>Promise.all(["server/chunks/ssr/src_lib_127qa83._.js"].map(b=>a.l(b))).then(()=>b(492067)))},98813,a=>{a.v(a=>Promise.resolve().then(()=>a(962620)))},507502,a=>{a.v(a=>Promise.resolve().then(()=>a(845427)))},752453,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__13374-3._.js"].map(b=>a.l(b))).then(()=>b(897667)))},144264,a=>{a.v(a=>Promise.resolve().then(()=>a(233405)))},662330,a=>{a.v(b=>Promise.all(["server/chunks/ssr/[root-of-the-server]__0la1659._.js"].map(b=>a.l(b))).then(()=>b(818992)))},323970,a=>{a.v(a=>Promise.resolve().then(()=>a(522734)))},173855,a=>{a.v(b=>Promise.all(["server/chunks/ssr/src_lib_open-targets_ts_12a-_~u._.js"].map(b=>a.l(b))).then(()=>b(289288)))},889618,a=>{a.v(a=>Promise.resolve().then(()=>a(163812)))}];
46
46
 
47
47
  //# sourceMappingURL=%5Broot-of-the-server%5D__13vgkq5._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[264589,a=>{"use strict";let b=(0,a.i(711796).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);a.s(["Package",0,b],264589)},236196,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("40f12a108d0c4d5258611b0dd1894d7aafae502aed",b.callServer,void 0,b.findSourceMapURL,"getConfigValues");a.s(["getConfigValues",0,c])},269280,a=>{"use strict";let b=(0,a.i(711796).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",0,b],269280)},521007,a=>{"use strict";a.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},786304,a=>{"use strict";var b=a.i(475295),c=a.i(213200),d=a.i(142261),e=a.i(368114);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)}],786304)},69544,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("40761db40351e40c001ff439284f4ab6a350d93b1b",b.callServer,void 0,b.findSourceMapURL,"openInTerminal");a.s(["openInTerminal",0,c])},648512,a=>{"use strict";let b=(0,a.i(711796).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);a.s(["Terminal",0,b],648512)},551578,a=>{"use strict";var b=a.i(728778);let c=(0,a.i(711796).default)("milestone",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",key:"8gz4t4"}]]);var d=a.i(951192);let e=["bg-sky-500/20 text-sky-300 border border-sky-500/30","bg-amber-500/20 text-amber-300 border border-amber-500/30","bg-violet-500/20 text-violet-300 border border-violet-500/30","bg-emerald-500/20 text-emerald-300 border border-emerald-500/30","bg-rose-500/20 text-rose-300 border border-rose-500/30","bg-cyan-500/20 text-cyan-300 border border-cyan-500/30","bg-indigo-500/20 text-indigo-300 border border-indigo-500/30"];function f(a){return e[function(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)>>>0;return b}(a)%e.length]}let g={PLANNED:"bg-slate-500/20 text-slate-300 border border-slate-500/30",ACTIVE:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",RELEASED:"bg-zinc-500/20 text-zinc-400 border border-zinc-500/30"};a.s(["TaskVersionTag",0,function({number:a,name:d,showName:e=!1,className:f="",title:g}){return(0,b.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground ${f}`,title:g??(d?`${a} \xb7 ${d}`:a),children:[(0,b.jsx)(c,{className:"h-2.5 w-2.5 shrink-0"}),(0,b.jsx)("span",{className:"font-mono",children:a}),e&&d?(0,b.jsx)("span",{className:"max-w-[140px] truncate",children:d}):null]})},"VersionStatusBadge",0,function({status:a}){let{t:c}=(0,d.useI18n)();return(0,b.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${g[a]}`,children:c(`version.status.${a}`)})},"VersionTypeBadge",0,function({name:a}){let{t:c}=(0,d.useI18n)();return a?(0,b.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${f(a)}`,children:a}):(0,b.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-muted-foreground",children:c("version.type.uncategorized")})},"typeBadgeColor",0,f],551578)},974471,52251,165614,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("4072804d823a8f55231ec0829fb98a68bc38646216",b.callServer,void 0,b.findSourceMapURL,"openInFileManager");a.s(["openInFileManager",0,c],974471);let d=(0,b.createServerReference)("40a7283207727ed21a6ecaca85b390988b3687e1dd",b.callServer,void 0,b.findSourceMapURL,"openInEditor");a.s(["openInEditor",0,d],52251);let e=(0,a.i(711796).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,e],165614)},625892,939859,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);a.s(["FolderSearch",0,c],625892);let d=(0,b.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);a.s(["Code",0,d],939859)},157551,a=>{"use strict";let b=(0,a.i(711796).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);a.s(["Calendar",0,b],157551)},757061,462831,a=>{"use strict";var b=a.i(728778),c=a.i(432949),d=a.i(368114),e=a.i(699570),f=a.i(14906);function g({...a}){return(0,b.jsx)(c.Dialog.Portal,{"data-slot":"sheet-portal",...a})}function h({className:a,...e}){return(0,b.jsx)(c.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,d.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",a),...e})}a.s(["Sheet",0,function({...a}){return(0,b.jsx)(c.Dialog.Root,{"data-slot":"sheet",...a})},"SheetContent",0,function({className:a,children:i,side:j="right",showCloseButton:k=!0,...l}){return(0,b.jsxs)(g,{children:[(0,b.jsx)(h,{}),(0,b.jsxs)(c.Dialog.Popup,{"data-slot":"sheet-content","data-side":j,className:(0,d.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",a),...l,children:[i,k&&(0,b.jsxs)(c.Dialog.Close,{"data-slot":"sheet-close",render:(0,b.jsx)(e.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,b.jsx)(f.XIcon,{}),(0,b.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:a,...e}){return(0,b.jsx)(c.Dialog.Description,{"data-slot":"sheet-description",className:(0,d.cn)("text-sm text-muted-foreground",a),...e})},"SheetHeader",0,function({className:a,...c}){return(0,b.jsx)("div",{"data-slot":"sheet-header",className:(0,d.cn)("flex flex-col gap-0.5 p-4",a),...c})},"SheetTitle",0,function({className:a,...e}){return(0,b.jsx)(c.Dialog.Title,{"data-slot":"sheet-title",className:(0,d.cn)("font-heading text-base font-medium text-foreground",a),...e})}],757061);var i=a.i(780410);let j=(0,i.createServerReference)("403b726cc7d9cff0549ec73b0b63b5550d931ba5bc",i.callServer,void 0,i.findSourceMapURL,"getTaskOverview");a.s(["getTaskOverview",0,j],462831)},972420,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(757061),e=a.i(269876),f=a.i(786304),g=a.i(699570),h=a.i(951192),i=a.i(851333),j=a.i(462831),k=a.i(540479),l=a.i(974471),m=a.i(52251),n=a.i(69544),o=a.i(445798),p=a.i(521007),q=a.i(157551),r=a.i(22761),s=a.i(264589),t=a.i(165614),u=a.i(625892),v=a.i(939859),w=a.i(648512);function x({added:a,removed:c}){let{t:d}=(0,h.useI18n)();return(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,b.jsx)("span",{children:d("diff.filesChanged",{count:String(a+c)})}),a>0&&(0,b.jsxs)("span",{className:"text-green-500",children:["+",a]}),c>0&&(0,b.jsxs)("span",{className:"text-red-500",children:["-",c]})]})}var y=a.i(551578),z=a.i(952313);a.s(["TaskOverviewDrawer",0,function({open:a,onOpenChange:A,taskId:B}){let{t:C}=(0,h.useI18n)(),[D,E]=(0,c.useState)(null),[F,G]=(0,c.useTransition)(),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)([]);(0,c.useEffect)(()=>{B&&a?G(async()=>{let a=await (0,j.getTaskOverview)(B);a&&(E(a),a.project?.workspaceId&&(0,k.getLabelsForWorkspace)(a.project.workspaceId).then(a=>{K(a.map(a=>({id:a.id,name:a.name,color:a.color,isBuiltin:a.isBuiltin})))}).catch(()=>K([])))}):E(null)},[B,a]);let L=D?p.BOARD_COLUMNS.find(a=>a.id===D.status):null,M=D?p.PRIORITY_CONFIG[D.priority]:null,N=D?.executions?.[0]??null,O=(()=>{if(N?.worktreePath)return N.worktreePath;let a=D?.project?.localPath;return a?D?.subPath?`${a}/${D.subPath}`:a:null})(),P=(()=>{let a=N?.gitStats;if(!a)return null;try{let b=JSON.parse(a);return{added:b.insertions??0,removed:b.deletions??0}}catch{return null}})(),Q=async a=>{if(D?.project)try{let{autoStart:b,...c}=a;await (0,i.createTask)({...c,projectId:D.project.id}),z.toast.success(C("taskDrawer.duplicateSuccess")),I(!1),A(!1)}catch{z.toast.error(C("taskDrawer.duplicateFailed"))}};return(0,b.jsxs)(d.Sheet,{open:a,onOpenChange:A,children:[(0,b.jsxs)(d.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,b.jsxs)(d.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,b.jsx)(d.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:D?.title??""}),(0,b.jsx)(d.SheetDescription,{className:"sr-only",children:C("taskDrawer.title")}),D&&(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[L&&(0,b.jsxs)(f.Badge,{variant:"secondary",className:"text-xs",children:[(0,b.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${L.color}`}),L.label]}),M&&(0,b.jsx)(f.Badge,{variant:"secondary",className:`text-xs ${M.color}`,children:M.label}),D.version&&(0,b.jsx)(y.TaskVersionTag,{number:D.version.number,name:D.version.name,showName:!0})]})]}),(0,b.jsx)(e.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:F&&!D?(0,b.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:C("assets.loading")}):D?(0,b.jsxs)("div",{className:"p-4 space-y-4",children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:C("taskDrawer.description")}),(0,b.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:D.description||C("taskDrawer.noDescription")})]}),D.labels.length>0&&(0,b.jsxs)("section",{children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:C("taskDrawer.labels")}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:D.labels.map(a=>(0,b.jsx)(f.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${a.label.color}20`,color:a.label.color,borderColor:`${a.label.color}40`},children:a.label.name},a.label.id))})]}),(0,b.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(q.Calendar,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:C("taskDrawer.createdAt")}),(0,b.jsx)("span",{className:"text-foreground",children:new Date(D.createdAt).toLocaleDateString()})]}),(0,b.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(s.Package,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:C("taskDrawer.resources")}),(0,b.jsx)("span",{className:"text-foreground",children:D._count.assets})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:C("taskDrawer.fileChanges")}),P?(0,b.jsx)(x,{added:P.added,removed:P.removed}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:C("taskDrawer.noFileChanges")})]}),(0,b.jsxs)("section",{children:[(0,b.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,b.jsx)(t.PlayCircle,{className:"h-3.5 w-3.5"}),C("taskDrawer.lastExecution")]}),N?(0,b.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,b.jsx)(f.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:N.status}),N.summary&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:N.summary.slice(0,200)})]}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:C("taskDrawer.noExecution")})]}),O&&(0,b.jsxs)("section",{className:"flex flex-col",children:[(0,b.jsxs)(g.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,l.openInFileManager)(O)}catch(a){console.error("openInFileManager failed:",a),z.toast.error(C("git.openInFileManagerFailed"))}},children:[(0,b.jsx)(u.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),C("git.openInFileManager")]}),(0,b.jsxs)(g.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,m.openInEditor)(O)}catch(a){console.error("openInEditor failed:",a),z.toast.error(C("git.openInEditorFailed"))}},children:[(0,b.jsx)(v.Code,{className:"h-3.5 w-3.5 shrink-0"}),C("git.openInEditor")]}),(0,b.jsxs)(g.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,n.openInTerminal)(O)}catch(a){console.error("openInTerminal failed:",a),z.toast.error(C("git.openInTerminalFailed"))}},children:[(0,b.jsx)(w.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),C("git.openInTerminal")]})]}),(0,b.jsx)("section",{children:(0,b.jsxs)(g.Button,{variant:"default",className:"w-full",onClick:()=>{D&&I(!0)},disabled:!D,children:[(0,b.jsx)(r.Copy,{className:"h-4 w-4"}),C("taskDrawer.duplicate")]})})]}):null})]}),D?.project&&(0,b.jsx)(o.CreateTaskDialog,{open:H,onOpenChange:I,onSubmit:Q,labels:J,projectType:D.project.type,projectLocalPath:D.project.localPath,prefillFromTask:{title:D.title,description:D.description,priority:D.priority,subPath:D.subPath,labelIds:D.labels.map(a=>a.label.id),baseBranch:D.baseBranch}})]})}],972420)}];
2
+
3
+ //# sourceMappingURL=_00jadm8._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[26134,949481,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);a.s(["FolderGit2",0,c],26134);let d=(0,b.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);a.s(["Home",0,d],949481)},705594,a=>{"use strict";let b=(0,a.i(711796).default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);a.s(["HardDrive",0,b],705594)},43775,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(146758),e=a.i(26134),f=a.i(949481),g=a.i(745539),h=a.i(573242),i=a.i(705594);let j=(0,a.i(711796).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var k=a.i(668116),l=a.i(54384),m=a.i(814574),n=a.i(699570),o=a.i(866718),p=a.i(785259),q=a.i(951192),r=a.i(269876);a.s(["FolderBrowserDialog",0,function({open:a,onOpenChange:s,onSelect:t,gitOnly:u=!1}){let{t:v}=(0,q.useI18n)(),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(null),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)(""),[G,H]=(0,c.useState)(!1),I=(0,c.useRef)(null),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(""),N=(0,c.useRef)(null),O=(0,c.useCallback)(async a=>{z(!0),B(null),F(""),H(!1);try{let b=a?`/api/browse-fs?path=${encodeURIComponent(a)}`:"/api/browse-fs",c=await fetch(b);if(!c.ok){let a=await c.json();B(a.error||"Failed");return}let d=await c.json();x(d),D(d.currentPath)}catch{B("Failed to browse filesystem")}finally{z(!1)}},[]);(0,c.useEffect)(()=>{a&&(O(),setTimeout(()=>I.current?.focus(),200))},[a,O]);let P=()=>{C.trim()&&O(C.trim())},Q=async()=>{let a=L.trim();if(a&&w?.currentPath)try{let b=await fetch("/api/browse-fs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentPath:w.currentPath,name:a})});if(!b.ok){let a=await b.json();B(a.error||v("folder.newFolderError"));return}K(!1),M(""),O(w.currentPath)}catch{B(v("folder.newFolderError"))}},R=()=>{K(!1),M("")},S=w?.folders.filter(a=>a.name.toLowerCase().includes(E.toLowerCase()))??[];return(0,b.jsx)(m.Dialog,{open:a,onOpenChange:s,children:(0,b.jsx)(m.DialogContent,{className:"p-0 gap-0",style:{maxWidth:"36rem",overflow:"hidden"},children:(0,b.jsxs)("div",{className:"flex flex-col max-h-[60vh] overflow-hidden",children:[(0,b.jsxs)("div",{className:"px-5 pt-5 pb-3 shrink-0",children:[(0,b.jsx)(m.DialogTitle,{children:u?v("folder.selectGitRepo"):v("folder.selectFolder")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:v("folder.hint")})]}),(0,b.jsxs)("div",{className:"border-t border-border px-4 pt-3 pb-2 shrink-0",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("folder.manualInput")}),(0,b.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,b.jsx)(o.Input,{ref:I,value:C,onChange:a=>D(a.target.value),onKeyDown:a=>"Enter"===a.key&&P(),placeholder:"/path/to/your/project",title:C,className:"flex-1 min-w-0"}),(0,b.jsx)(n.Button,{variant:"outline",onClick:P,className:"h-8 px-3 shrink-0",children:v("folder.goTo")})]})]}),(0,b.jsxs)("div",{className:"px-4 py-2 shrink-0",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("folder.searchDir")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsx)(h.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("input",{value:E,onChange:a=>F(a.target.value),placeholder:"Filter folders and files...",className:"h-8 w-full rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 border-y border-border px-4 py-2 shrink-0 min-w-0",children:[(0,b.jsxs)(p.Tooltip,{children:[(0,b.jsx)(p.TooltipTrigger,{render:(0,b.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>w?.homePath&&O(w.homePath),className:"shrink-0 text-muted-foreground"}),children:(0,b.jsx)(f.Home,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Home"})]}),(0,b.jsxs)(p.Tooltip,{children:[(0,b.jsx)(p.TooltipTrigger,{render:(0,b.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>{w&&("__DRIVES__"===w.parentPath?H(!0):(H(!1),O(w.parentPath)))},className:"shrink-0 text-muted-foreground"}),children:(0,b.jsx)(g.ChevronUp,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Parent"})]}),w?.drives&&w.drives.length>0&&(0,b.jsxs)(p.Tooltip,{children:[(0,b.jsx)(p.TooltipTrigger,{render:(0,b.jsx)(n.Button,{variant:G?"default":"outline",size:"icon-sm",onClick:()=>H(a=>!a),className:"shrink-0 text-muted-foreground"}),children:(0,b.jsx)(i.HardDrive,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Drives"})]}),(0,b.jsxs)(p.Tooltip,{children:[(0,b.jsx)(p.TooltipTrigger,{render:(0,b.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>{K(!0),M(""),setTimeout(()=>N.current?.focus(),50)},className:"shrink-0 text-muted-foreground"}),children:(0,b.jsx)(j,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:v("folder.newFolder")})]}),(0,b.jsx)("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground font-mono",title:w?.currentPath??"",children:w?.currentPath??"..."})]}),(0,b.jsxs)(r.ScrollArea,{className:"min-h-0 flex-1",children:[J&&(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/30 px-4 py-2",children:[(0,b.jsx)(d.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,b.jsx)("input",{ref:N,value:L,onChange:a=>M(a.target.value),onKeyDown:a=>{"Enter"===a.key&&Q(),"Escape"===a.key&&R()},placeholder:v("folder.newFolderPlaceholder"),className:"h-7 flex-1 rounded-md border border-border bg-background px-2 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,b.jsx)(n.Button,{variant:"ghost",size:"icon-xs",onClick:Q,disabled:!L.trim(),className:"text-emerald-400 hover:text-emerald-300",children:(0,b.jsx)(k.Check,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(n.Button,{variant:"ghost",size:"icon-xs",onClick:R,className:"text-muted-foreground",children:(0,b.jsx)(l.X,{className:"h-3.5 w-3.5"})})]}),y&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}),A&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-rose-400",children:A}),G&&w?.drives&&w.drives.map(a=>(0,b.jsxs)("button",{onClick:()=>{var b;return b=a.path,void(H(!1),O(b))},className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,b.jsx)(i.HardDrive,{className:"h-4 w-4 text-blue-400 shrink-0"}),(0,b.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:a.name}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.path})]},a.path)),!G&&!y&&!A&&0===S.length&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:v("folder.empty")}),!G&&!y&&!A&&S.map(a=>(0,b.jsxs)("button",{onClick:()=>{a.isGit||u?(t(a.path),s(!1)):O(a.path)},onDoubleClick:()=>O(a.path),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[a.isGit?(0,b.jsx)(e.FolderGit2,{className:"h-4 w-4 text-emerald-400 shrink-0"}):(0,b.jsx)(d.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,b.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:a.name}),a.isGit&&(0,b.jsx)("span",{className:"shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400 ring-1 ring-emerald-500/20",children:"git"})]},a.path))]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 shrink-0 border-t border-border",children:[(0,b.jsx)(n.Button,{variant:"outline",onClick:()=>s(!1),children:v("common.cancel")}),(0,b.jsx)(n.Button,{onClick:()=>{w?.currentPath&&(t(w.currentPath),s(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:v("folder.selectPath")})]})]})})})}],43775)},487410,a=>{"use strict";var b=a.i(728778),c=a.i(368114);a.s(["SegmentedControl",0,function({options:a,value:d,onChange:e,className:f}){return(0,b.jsx)("div",{className:(0,c.cn)("inline-flex rounded-md border border-border bg-muted p-1 gap-1",f),children:a.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>e(a.value),className:(0,c.cn)("rounded px-3 py-1 text-sm transition-colors",d===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value))})}])},421992,a=>{"use strict";let b=(0,a.i(711796).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);a.s(["default",0,b])},347165,a=>{"use strict";let b=(0,a.i(711796).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);a.s(["FolderOpen",0,b],347165)},663513,a=>{"use strict";let b=(0,a.i(711796).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);a.s(["default",0,b])},704494,a=>{"use strict";var b=a.i(663513);a.s(["Loader2",()=>b.default])},668116,a=>{"use strict";var b=a.i(29715);a.s(["Check",()=>b.default])},577565,a=>{"use strict";let b=(0,a.i(711796).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);a.s(["GitBranch",0,b],577565)},91756,a=>{"use strict";let b=(0,a.i(711796).default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);a.s(["ChevronsLeft",0,b],91756)},394259,a=>{"use strict";let b=(0,a.i(711796).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);a.s(["Sparkles",0,b],394259)},78295,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("60d620deef0266f60fc86388756c6fa60282d23a29",b.callServer,void 0,b.findSourceMapURL,"analyzeProjectDirectory");a.s(["analyzeProjectDirectory",0,c])},117394,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("402d87b6ead0e5bae4b42b92c38d83853a147ec6dd",b.callServer,void 0,b.findSourceMapURL,"createProject");a.s(["createProject",0,c])}];
1
+ module.exports=[26134,949481,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);a.s(["FolderGit2",0,c],26134);let d=(0,b.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);a.s(["Home",0,d],949481)},705594,a=>{"use strict";let b=(0,a.i(711796).default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);a.s(["HardDrive",0,b],705594)},43775,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(146758),e=a.i(26134),f=a.i(949481),g=a.i(745539),h=a.i(573242),i=a.i(705594);let j=(0,a.i(711796).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);var k=a.i(668116),l=a.i(54384),m=a.i(814574),n=a.i(699570),o=a.i(866718),p=a.i(785259),q=a.i(951192),r=a.i(269876);a.s(["FolderBrowserDialog",0,function({open:a,onOpenChange:s,onSelect:t,gitOnly:u=!1}){let{t:v}=(0,q.useI18n)(),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(null),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)(""),[G,H]=(0,c.useState)(!1),I=(0,c.useRef)(null),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(""),N=(0,c.useRef)(null),O=(0,c.useCallback)(async a=>{z(!0),B(null),F(""),H(!1);try{let b=a?`/api/browse-fs?path=${encodeURIComponent(a)}`:"/api/browse-fs",c=await fetch(b);if(!c.ok){let a=await c.json();B(a.error||"Failed");return}let d=await c.json();x(d),D(d.currentPath)}catch{B("Failed to browse filesystem")}finally{z(!1)}},[]);(0,c.useEffect)(()=>{a&&(O(),setTimeout(()=>I.current?.focus(),200))},[a,O]);let P=()=>{C.trim()&&O(C.trim())},Q=async()=>{let a=L.trim();if(a&&w?.currentPath)try{let b=await fetch("/api/browse-fs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentPath:w.currentPath,name:a})});if(!b.ok){let a=await b.json();B(a.error||v("folder.newFolderError"));return}K(!1),M(""),O(w.currentPath)}catch{B(v("folder.newFolderError"))}},R=()=>{K(!1),M("")},S=w?.folders.filter(a=>a.name.toLowerCase().includes(E.toLowerCase()))??[];return(0,b.jsx)(m.Dialog,{open:a,onOpenChange:s,children:(0,b.jsx)(m.DialogContent,{className:"p-0 gap-0",style:{maxWidth:"36rem",overflow:"hidden"},children:(0,b.jsxs)("div",{className:"flex flex-col max-h-[60vh] overflow-hidden",children:[(0,b.jsxs)("div",{className:"px-5 pt-5 pb-3 shrink-0",children:[(0,b.jsx)(m.DialogTitle,{children:u?v("folder.selectGitRepo"):v("folder.selectFolder")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:v("folder.hint")})]}),(0,b.jsxs)("div",{className:"border-t border-border px-4 pt-3 pb-2 shrink-0",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("folder.manualInput")}),(0,b.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,b.jsx)(o.Input,{ref:I,value:C,onChange:a=>D(a.target.value),onKeyDown:a=>"Enter"===a.key&&P(),placeholder:"/path/to/your/project",title:C,className:"flex-1 min-w-0"}),(0,b.jsx)(n.Button,{variant:"outline",onClick:P,className:"h-8 px-3 shrink-0",children:v("folder.goTo")})]})]}),(0,b.jsxs)("div",{className:"px-4 py-2 shrink-0",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:v("folder.searchDir")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsx)(h.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("input",{value:E,onChange:a=>F(a.target.value),placeholder:"Filter folders and files...",className:"h-8 w-full rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 border-y border-border px-4 py-2 shrink-0 min-w-0",children:[(0,b.jsxs)(p.Tooltip,{children:[(0,b.jsx)(p.TooltipTrigger,{render:(0,b.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>w?.homePath&&O(w.homePath),className:"shrink-0 text-muted-foreground"}),children:(0,b.jsx)(f.Home,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Home"})]}),(0,b.jsxs)(p.Tooltip,{children:[(0,b.jsx)(p.TooltipTrigger,{render:(0,b.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>{w&&("__DRIVES__"===w.parentPath?H(!0):(H(!1),O(w.parentPath)))},className:"shrink-0 text-muted-foreground"}),children:(0,b.jsx)(g.ChevronUp,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Parent"})]}),w?.drives&&w.drives.length>0&&(0,b.jsxs)(p.Tooltip,{children:[(0,b.jsx)(p.TooltipTrigger,{render:(0,b.jsx)(n.Button,{variant:G?"default":"outline",size:"icon-sm",onClick:()=>H(a=>!a),className:"shrink-0 text-muted-foreground"}),children:(0,b.jsx)(i.HardDrive,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Drives"})]}),(0,b.jsxs)(p.Tooltip,{children:[(0,b.jsx)(p.TooltipTrigger,{render:(0,b.jsx)(n.Button,{variant:"outline",size:"icon-sm",onClick:()=>{K(!0),M(""),setTimeout(()=>N.current?.focus(),50)},className:"shrink-0 text-muted-foreground"}),children:(0,b.jsx)(j,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:v("folder.newFolder")})]}),(0,b.jsx)("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground font-mono",title:w?.currentPath??"",children:w?.currentPath??"..."})]}),(0,b.jsxs)(r.ScrollArea,{className:"min-h-0 flex-1",children:[J&&(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/30 px-4 py-2",children:[(0,b.jsx)(d.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,b.jsx)("input",{ref:N,value:L,onChange:a=>M(a.target.value),onKeyDown:a=>{"Enter"===a.key&&Q(),"Escape"===a.key&&R()},placeholder:v("folder.newFolderPlaceholder"),className:"h-7 flex-1 rounded-md border border-border bg-background px-2 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,b.jsx)(n.Button,{variant:"ghost",size:"icon-xs",onClick:Q,disabled:!L.trim(),className:"text-emerald-400 hover:text-emerald-300",children:(0,b.jsx)(k.Check,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(n.Button,{variant:"ghost",size:"icon-xs",onClick:R,className:"text-muted-foreground",children:(0,b.jsx)(l.X,{className:"h-3.5 w-3.5"})})]}),y&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}),A&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-rose-400",children:A}),G&&w?.drives&&w.drives.map(a=>(0,b.jsxs)("button",{onClick:()=>{var b;return b=a.path,void(H(!1),O(b))},className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,b.jsx)(i.HardDrive,{className:"h-4 w-4 text-blue-400 shrink-0"}),(0,b.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:a.name}),(0,b.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:a.path})]},a.path)),!G&&!y&&!A&&0===S.length&&(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:v("folder.empty")}),!G&&!y&&!A&&S.map(a=>(0,b.jsxs)("button",{onClick:()=>{a.isGit||u?(t(a.path),s(!1)):O(a.path)},onDoubleClick:()=>O(a.path),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[a.isGit?(0,b.jsx)(e.FolderGit2,{className:"h-4 w-4 text-emerald-400 shrink-0"}):(0,b.jsx)(d.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,b.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:a.name}),a.isGit&&(0,b.jsx)("span",{className:"shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400 ring-1 ring-emerald-500/20",children:"git"})]},a.path))]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 shrink-0 border-t border-border",children:[(0,b.jsx)(n.Button,{variant:"outline",onClick:()=>s(!1),children:v("common.cancel")}),(0,b.jsx)(n.Button,{onClick:()=>{w?.currentPath&&(t(w.currentPath),s(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:v("folder.selectPath")})]})]})})})}],43775)},487410,a=>{"use strict";var b=a.i(728778),c=a.i(368114);a.s(["SegmentedControl",0,function({options:a,value:d,onChange:e,className:f}){return(0,b.jsx)("div",{className:(0,c.cn)("inline-flex rounded-md border border-border bg-muted p-1 gap-1",f),children:a.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>e(a.value),className:(0,c.cn)("rounded px-3 py-1 text-sm transition-colors",d===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value))})}])},421992,a=>{"use strict";let b=(0,a.i(711796).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);a.s(["default",0,b])},347165,a=>{"use strict";let b=(0,a.i(711796).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);a.s(["FolderOpen",0,b],347165)},663513,a=>{"use strict";let b=(0,a.i(711796).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);a.s(["default",0,b])},704494,a=>{"use strict";var b=a.i(663513);a.s(["Loader2",()=>b.default])},668116,a=>{"use strict";var b=a.i(29715);a.s(["Check",()=>b.default])},577565,a=>{"use strict";let b=(0,a.i(711796).default)("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]);a.s(["GitBranch",0,b],577565)},91756,a=>{"use strict";let b=(0,a.i(711796).default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);a.s(["ChevronsLeft",0,b],91756)},394259,a=>{"use strict";let b=(0,a.i(711796).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);a.s(["Sparkles",0,b],394259)},144530,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("60c04f31783506683945f873bb2f23b60b545118bb",b.callServer,void 0,b.findSourceMapURL,"analyzeProjectDirectory");a.s(["analyzeProjectDirectory",0,c])},262140,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("40a26582229b4a342d27d3eb6da88392b7e70836f4",b.callServer,void 0,b.findSourceMapURL,"createProject");a.s(["createProject",0,c])}];
2
2
 
3
- //# sourceMappingURL=_0es22_y._.js.map
3
+ //# sourceMappingURL=_03.a~r1._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[264589,a=>{"use strict";let b=(0,a.i(711796).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);a.s(["Package",0,b],264589)},236196,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("40f12a108d0c4d5258611b0dd1894d7aafae502aed",b.callServer,void 0,b.findSourceMapURL,"getConfigValues");a.s(["getConfigValues",0,c])},269280,a=>{"use strict";let b=(0,a.i(711796).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",0,b],269280)},521007,a=>{"use strict";a.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},786304,a=>{"use strict";var b=a.i(475295),c=a.i(213200),d=a.i(142261),e=a.i(368114);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)}],786304)},69544,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("40761db40351e40c001ff439284f4ab6a350d93b1b",b.callServer,void 0,b.findSourceMapURL,"openInTerminal");a.s(["openInTerminal",0,c])},648512,a=>{"use strict";let b=(0,a.i(711796).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);a.s(["Terminal",0,b],648512)},974471,52251,165614,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("4072804d823a8f55231ec0829fb98a68bc38646216",b.callServer,void 0,b.findSourceMapURL,"openInFileManager");a.s(["openInFileManager",0,c],974471);let d=(0,b.createServerReference)("40a7283207727ed21a6ecaca85b390988b3687e1dd",b.callServer,void 0,b.findSourceMapURL,"openInEditor");a.s(["openInEditor",0,d],52251);let e=(0,a.i(711796).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,e],165614)},625892,939859,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);a.s(["FolderSearch",0,c],625892);let d=(0,b.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);a.s(["Code",0,d],939859)},551578,a=>{"use strict";var b=a.i(728778);let c=(0,a.i(711796).default)("milestone",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",key:"8gz4t4"}]]);var d=a.i(951192);let e=["bg-sky-500/20 text-sky-300 border border-sky-500/30","bg-amber-500/20 text-amber-300 border border-amber-500/30","bg-violet-500/20 text-violet-300 border border-violet-500/30","bg-emerald-500/20 text-emerald-300 border border-emerald-500/30","bg-rose-500/20 text-rose-300 border border-rose-500/30","bg-cyan-500/20 text-cyan-300 border border-cyan-500/30","bg-indigo-500/20 text-indigo-300 border border-indigo-500/30"];function f(a){return e[function(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)>>>0;return b}(a)%e.length]}let g={PLANNED:"bg-slate-500/20 text-slate-300 border border-slate-500/30",ACTIVE:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",RELEASED:"bg-zinc-500/20 text-zinc-400 border border-zinc-500/30"};a.s(["TaskVersionTag",0,function({number:a,name:d,showName:e=!1,className:f="",title:g}){return(0,b.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground ${f}`,title:g??(d?`${a} \xb7 ${d}`:a),children:[(0,b.jsx)(c,{className:"h-2.5 w-2.5 shrink-0"}),(0,b.jsx)("span",{className:"font-mono",children:a}),e&&d?(0,b.jsx)("span",{className:"max-w-[140px] truncate",children:d}):null]})},"VersionStatusBadge",0,function({status:a}){let{t:c}=(0,d.useI18n)();return(0,b.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${g[a]}`,children:c(`version.status.${a}`)})},"VersionTypeBadge",0,function({name:a}){let{t:c}=(0,d.useI18n)();return a?(0,b.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${f(a)}`,children:a}):(0,b.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-muted-foreground",children:c("version.type.uncategorized")})},"typeBadgeColor",0,f],551578)},757061,462831,a=>{"use strict";var b=a.i(728778),c=a.i(432949),d=a.i(368114),e=a.i(699570),f=a.i(14906);function g({...a}){return(0,b.jsx)(c.Dialog.Portal,{"data-slot":"sheet-portal",...a})}function h({className:a,...e}){return(0,b.jsx)(c.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,d.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",a),...e})}a.s(["Sheet",0,function({...a}){return(0,b.jsx)(c.Dialog.Root,{"data-slot":"sheet",...a})},"SheetContent",0,function({className:a,children:i,side:j="right",showCloseButton:k=!0,...l}){return(0,b.jsxs)(g,{children:[(0,b.jsx)(h,{}),(0,b.jsxs)(c.Dialog.Popup,{"data-slot":"sheet-content","data-side":j,className:(0,d.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",a),...l,children:[i,k&&(0,b.jsxs)(c.Dialog.Close,{"data-slot":"sheet-close",render:(0,b.jsx)(e.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,b.jsx)(f.XIcon,{}),(0,b.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:a,...e}){return(0,b.jsx)(c.Dialog.Description,{"data-slot":"sheet-description",className:(0,d.cn)("text-sm text-muted-foreground",a),...e})},"SheetHeader",0,function({className:a,...c}){return(0,b.jsx)("div",{"data-slot":"sheet-header",className:(0,d.cn)("flex flex-col gap-0.5 p-4",a),...c})},"SheetTitle",0,function({className:a,...e}){return(0,b.jsx)(c.Dialog.Title,{"data-slot":"sheet-title",className:(0,d.cn)("font-heading text-base font-medium text-foreground",a),...e})}],757061);var i=a.i(780410);let j=(0,i.createServerReference)("403b726cc7d9cff0549ec73b0b63b5550d931ba5bc",i.callServer,void 0,i.findSourceMapURL,"getTaskOverview");a.s(["getTaskOverview",0,j],462831)},157551,a=>{"use strict";let b=(0,a.i(711796).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);a.s(["Calendar",0,b],157551)},972420,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(757061),e=a.i(269876),f=a.i(786304),g=a.i(699570),h=a.i(951192),i=a.i(851333),j=a.i(462831),k=a.i(540479),l=a.i(974471),m=a.i(52251),n=a.i(69544),o=a.i(445798),p=a.i(521007),q=a.i(157551),r=a.i(22761),s=a.i(264589),t=a.i(165614),u=a.i(625892),v=a.i(939859),w=a.i(648512);function x({added:a,removed:c}){let{t:d}=(0,h.useI18n)();return(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,b.jsx)("span",{children:d("diff.filesChanged",{count:String(a+c)})}),a>0&&(0,b.jsxs)("span",{className:"text-green-500",children:["+",a]}),c>0&&(0,b.jsxs)("span",{className:"text-red-500",children:["-",c]})]})}var y=a.i(551578),z=a.i(952313);a.s(["TaskOverviewDrawer",0,function({open:a,onOpenChange:A,taskId:B}){let{t:C}=(0,h.useI18n)(),[D,E]=(0,c.useState)(null),[F,G]=(0,c.useTransition)(),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)([]);(0,c.useEffect)(()=>{B&&a?G(async()=>{let a=await (0,j.getTaskOverview)(B);a&&(E(a),a.project?.workspaceId&&(0,k.getLabelsForWorkspace)(a.project.workspaceId).then(a=>{K(a.map(a=>({id:a.id,name:a.name,color:a.color,isBuiltin:a.isBuiltin})))}).catch(()=>K([])))}):E(null)},[B,a]);let L=D?p.BOARD_COLUMNS.find(a=>a.id===D.status):null,M=D?p.PRIORITY_CONFIG[D.priority]:null,N=D?.executions?.[0]??null,O=(()=>{if(N?.worktreePath)return N.worktreePath;let a=D?.project?.localPath;return a?D?.subPath?`${a}/${D.subPath}`:a:null})(),P=(()=>{let a=N?.gitStats;if(!a)return null;try{let b=JSON.parse(a);return{added:b.insertions??0,removed:b.deletions??0}}catch{return null}})(),Q=async a=>{if(D?.project)try{let{autoStart:b,...c}=a;await (0,i.createTask)({...c,projectId:D.project.id}),z.toast.success(C("taskDrawer.duplicateSuccess")),I(!1),A(!1)}catch{z.toast.error(C("taskDrawer.duplicateFailed"))}};return(0,b.jsxs)(d.Sheet,{open:a,onOpenChange:A,children:[(0,b.jsxs)(d.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,b.jsxs)(d.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,b.jsx)(d.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:D?.title??""}),(0,b.jsx)(d.SheetDescription,{className:"sr-only",children:C("taskDrawer.title")}),D&&(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[L&&(0,b.jsxs)(f.Badge,{variant:"secondary",className:"text-xs",children:[(0,b.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${L.color}`}),L.label]}),M&&(0,b.jsx)(f.Badge,{variant:"secondary",className:`text-xs ${M.color}`,children:M.label}),D.version&&(0,b.jsx)(y.TaskVersionTag,{number:D.version.number,name:D.version.name,showName:!0})]})]}),(0,b.jsx)(e.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:F&&!D?(0,b.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:C("assets.loading")}):D?(0,b.jsxs)("div",{className:"p-4 space-y-4",children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:C("taskDrawer.description")}),(0,b.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:D.description||C("taskDrawer.noDescription")})]}),D.labels.length>0&&(0,b.jsxs)("section",{children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:C("taskDrawer.labels")}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:D.labels.map(a=>(0,b.jsx)(f.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${a.label.color}20`,color:a.label.color,borderColor:`${a.label.color}40`},children:a.label.name},a.label.id))})]}),(0,b.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(q.Calendar,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:C("taskDrawer.createdAt")}),(0,b.jsx)("span",{className:"text-foreground",children:new Date(D.createdAt).toLocaleDateString()})]}),(0,b.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(s.Package,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:C("taskDrawer.resources")}),(0,b.jsx)("span",{className:"text-foreground",children:D._count.assets})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:C("taskDrawer.fileChanges")}),P?(0,b.jsx)(x,{added:P.added,removed:P.removed}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:C("taskDrawer.noFileChanges")})]}),(0,b.jsxs)("section",{children:[(0,b.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,b.jsx)(t.PlayCircle,{className:"h-3.5 w-3.5"}),C("taskDrawer.lastExecution")]}),N?(0,b.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,b.jsx)(f.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:N.status}),N.summary&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:N.summary.slice(0,200)})]}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:C("taskDrawer.noExecution")})]}),O&&(0,b.jsxs)("section",{className:"flex flex-col",children:[(0,b.jsxs)(g.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,l.openInFileManager)(O)}catch(a){console.error("openInFileManager failed:",a),z.toast.error(C("git.openInFileManagerFailed"))}},children:[(0,b.jsx)(u.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),C("git.openInFileManager")]}),(0,b.jsxs)(g.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,m.openInEditor)(O)}catch(a){console.error("openInEditor failed:",a),z.toast.error(C("git.openInEditorFailed"))}},children:[(0,b.jsx)(v.Code,{className:"h-3.5 w-3.5 shrink-0"}),C("git.openInEditor")]}),(0,b.jsxs)(g.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,n.openInTerminal)(O)}catch(a){console.error("openInTerminal failed:",a),z.toast.error(C("git.openInTerminalFailed"))}},children:[(0,b.jsx)(w.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),C("git.openInTerminal")]})]}),(0,b.jsx)("section",{children:(0,b.jsxs)(g.Button,{variant:"default",className:"w-full",onClick:()=>{D&&I(!0)},disabled:!D,children:[(0,b.jsx)(r.Copy,{className:"h-4 w-4"}),C("taskDrawer.duplicate")]})})]}):null})]}),D?.project&&(0,b.jsx)(o.CreateTaskDialog,{open:H,onOpenChange:I,onSubmit:Q,labels:J,projectType:D.project.type,projectLocalPath:D.project.localPath,prefillFromTask:{title:D.title,description:D.description,priority:D.priority,subPath:D.subPath,labelIds:D.labels.map(a=>a.label.id),baseBranch:D.baseBranch}})]})}],972420)}];
2
+
3
+ //# sourceMappingURL=_053zyvm._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[300141,639138,88757,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,c],300141);var d=a.i(728778),e=a.i(374637),f=a.i(10390),g=a.i(442620),h=a.i(811344),i=a.i(394869),j=a.i(207339),k=a.i(704494),l=a.i(699570),m=a.i(579834),n=a.i(786304),o=a.i(814574),p=a.i(429246),q=a.i(951192);function r({patchState:a,isLargeFold:b,onLoad:c}){let{t:e}=(0,q.useI18n)();return b?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,d.jsx)(l.Button,{variant:"link",onClick:c,className:"h-auto p-0 text-sm",children:e("diff.loadDiff")}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:e("diff.foldedLarge")})]}):a&&"loading"!==a.kind?"error"===a.kind?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,d.jsx)("span",{children:e("diff.loadFailed")}),(0,d.jsx)(l.Button,{variant:"ghost",onClick:c,children:e("diff.retry")})]}):"binary"===a.kind?(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:e("diff.binaryNotShown")}):"empty"===a.kind?(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:e("diff.noChanges")}):(0,d.jsx)(s,{patch:a.patch??""}):(0,d.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,d.jsx)(k.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function s({patch:a}){let{t:b}=(0,q.useI18n)(),c=a.split("\n"),e=c.length>500,f=e?c.slice(0,500):c;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:f.map((a,b)=>{let c=a.startsWith("+++")||a.startsWith("---")?"px-4 block text-muted-foreground":a.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":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,d.jsx)("span",{className:c,children:a||" "},b)})}),e&&(0,d.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:b("diff.patchTruncated",{n:String(500),total:String(c.length)})})]})}a.s(["TaskDiffView",0,function({taskId:a,files:b,totalAdded:c,totalRemoved:k,hasConflicts:s,conflictFiles:t,onCommit:u,hasUncommitted:v}){let{t:w}=(0,q.useI18n)(),[x,y]=(0,e.useState)(new Set),[z,A]=(0,e.useState)(new Map),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(!1),H=b=>{A(a=>new Map(a).set(b,{kind:"loading"})),fetch(`/api/tasks/${a}/diff-patch?file=${encodeURIComponent(b)}`).then(a=>a.ok?a.json():Promise.reject(Error(`HTTP ${a.status}`))).then(a=>{A(c=>{let d=new Map(c);return"binary"===a.kind?d.set(b,{kind:"binary"}):"empty"===a.kind?d.set(b,{kind:"empty"}):d.set(b,{kind:"ready",patch:a.patch??""}),d})}).catch(()=>{A(a=>new Map(a).set(b,{kind:"error"}))})};return(0,d.jsxs)("div",{className:"flex flex-col h-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,d.jsxs)("span",{className:"font-medium text-foreground",children:[b.length," files changed"]}),(0,d.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",c]}),(0,d.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",k]})]}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:v&&u&&(0,d.jsxs)(l.Button,{variant:"outline",onClick:()=>C(!0),className:"gap-2",children:[(0,d.jsx)(j.GitCommitHorizontal,{className:"h-4 w-4"}),w("diff.commit")]})})]}),s&&(0,d.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,d.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,d.jsx)(h.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,d.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",t.length," conflicting file",1!==t.length?"s":""]})]}),(0,d.jsx)("ul",{className:"ml-6 space-y-1",children:t.map(a=>(0,d.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,d.jsx)("div",{className:"flex-1 overflow-auto",children:0===b.length?(0,d.jsx)(m.EmptyState,{icon:i.GitCompare,title:w("diff.noChanges"),className:"h-full"}):(0,d.jsx)("div",{className:"divide-y divide-border",children:b.map(a=>{let b=x.has(a.filename),c=z.get(a.filename),e=a.added+a.removed;return(0,d.jsxs)("div",{children:[(0,d.jsxs)(l.Button,{variant:"ghost",type:"button",onClick:()=>{let b;return b=x.has(a.filename),void(y(b=>{let c=new Set(b);return c.has(a.filename)?c.delete(a.filename):c.add(a.filename),c}),b||a.isBinary||z.has(a.filename)||a.added+a.removed<=200&&H(a.filename))},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:[b?(0,d.jsx)(g.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,d.jsx)(f.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,d.jsx)(n.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:w("diff.binary")}):(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,d.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),b&&!a.isBinary&&(0,d.jsx)("div",{className:"border-t border-border bg-background",children:(0,d.jsx)(r,{filename:a.filename,patchState:c,isLargeFold:!c&&e>200,onLoad:()=>H(a.filename)})})]},a.filename)})})}),(0,d.jsx)(o.Dialog,{open:B,onOpenChange:C,children:(0,d.jsxs)(o.DialogContent,{className:"max-w-md",children:[(0,d.jsx)(o.DialogHeader,{children:(0,d.jsx)(o.DialogTitle,{children:w("diff.commitChanges")})}),(0,d.jsx)("div",{className:"flex flex-col gap-3",children:(0,d.jsx)(p.Textarea,{value:D,onChange:a=>E(a.target.value),placeholder:w("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,d.jsxs)(o.DialogFooter,{children:[(0,d.jsx)(l.Button,{variant:"ghost",onClick:()=>C(!1),children:w("common.cancel")}),(0,d.jsx)(l.Button,{onClick:async()=>{if(D.trim()&&u){G(!0);try{await u(D.trim()),E(""),C(!1)}finally{G(!1)}}},disabled:!D.trim()||F,children:F?"...":w("diff.commit")})]})]})})]})}],639138);var t=a.i(553798);let u=(0,b.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"}]]);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:b,taskId:c,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:j=[],onMergeComplete:m}){let n=(0,t.useRouter)(),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(null),v=async()=>{q(!0),s(null);try{let a=await fetch(`/api/tasks/${c}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){b(!1),m(),n.refresh();return}let d=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?s(`Merge conflicts detected: ${Array.isArray(d.conflictFiles)?d.conflictFiles.join(", "):"unknown files"}`):s(d.error??"Merge failed")}catch{s("Network error — merge failed")}finally{q(!1)}};return(0,d.jsx)(o.Dialog,{open:a,onOpenChange:b,children:(0,d.jsxs)(o.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,d.jsx)(o.DialogHeader,{children:(0,d.jsxs)(o.DialogTitle,{className:"flex items-center gap-2",children:[(0,d.jsx)(u,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,d.jsxs)("div",{className:"space-y-3 py-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,d.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),j.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,d.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:j.map((a,b)=>(0,d.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},b))})]}),r&&(0,d.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,d.jsx)("p",{className:"text-xs text-red-400",children:r})})]}),(0,d.jsxs)(o.DialogFooter,{children:[(0,d.jsx)(l.Button,{variant:"outline",onClick:()=>b(!1),disabled:p,children:"Cancel"}),(0,d.jsx)(l.Button,{onClick:v,disabled:p,className:"gap-2",children:p?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],88757)},140597,694116,a=>{"use strict";let b=(0,a.i(711796).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);a.s(["default",0,b],694116),a.s(["File",0,b],140597)},970535,359948,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,c],970535);let d=(0,b.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"}]]);a.s(["History",0,d],359948)},7285,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])},771313,307373,646788,806671,114884,604456,703903,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);a.s(["FilePlus",0,c],771313);let d=(0,b.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);a.s(["FileMinus",0,d],307373);let e=(0,b.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);a.s(["FileQuestion",0,e],646788);let f=(0,b.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);a.s(["FileEdit",0,f],806671);let g=(0,b.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);a.s(["ArrowDown",0,g],114884);let h=(0,b.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);a.s(["ArrowUp",0,h],604456);let i=(0,b.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);a.s(["Minus",0,i],703903)},324263,a=>{"use strict";let b=(0,a.i(711796).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],324263)},985716,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(140597),e=a.i(771313),f=a.i(307373),g=a.i(646788),h=a.i(806671),i=a.i(704494),j=a.i(114884),k=a.i(604456),l=a.i(668116),m=a.i(10390),n=a.i(442620),o=a.i(146758),p=a.i(703903),q=a.i(774881),r=a.i(336771),s=a.i(192369),t=a.i(607219),u=a.i(324263);let v=(0,a.i(711796).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var w=a.i(577565),x=a.i(573242),y=a.i(851378),z=a.i(975231),A=a.i(699570),B=a.i(335732),C=a.i(269876),D=a.i(785259),E=a.i(814574),F=a.i(866718),G=a.i(429246),H=a.i(951192);function I({open:a,onOpenChange:d,branches:e,currentBranch:f,localPath:g,onCreated:h,onError:j}){let{t:k}=(0,H.useI18n)(),[m,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(f),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,y]=(0,c.useState)(""),[z,B]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(o(""),q(f),s(""),y(""))},[a,f]);let C=[...new Set(e)].filter(a=>a.toLowerCase().includes(v.toLowerCase())),D=async()=>{if(m.trim()){u(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:g,branch:m.trim(),baseBranch:p})});if(a.ok)d(!1),h();else{let b=await a.json();j(b.error||"Unknown error")}}catch{j("Network error")}finally{u(!1)}}};return(0,b.jsx)(E.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(E.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(E.DialogHeader,{children:(0,b.jsx)(E.DialogTitle,{children:k("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:k("git.branchName")}),(0,b.jsx)(F.Input,{value:m,onChange:a=>o(a.target.value),placeholder:k("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&D()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>B(!z),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 min-w-0 items-center gap-2",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:p,children:p})]}),(0,b.jsx)(n.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${z?"rotate-180":""}`})]}),z&&(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)(x.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:v,onChange:a=>y(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:C.map(a=>(0,b.jsxs)("button",{onClick:()=>{q(a),B(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===p?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a}),a===p&&(0,b.jsx)(l.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:k("git.branchDesc")}),(0,b.jsx)(G.Textarea,{value:r,onChange:a=>s(a.target.value),placeholder:k("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)(E.DialogFooter,{children:[(0,b.jsx)(A.Button,{variant:"outline",onClick:()=>d(!1),children:k("common.cancel")}),(0,b.jsxs)(A.Button,{onClick:D,disabled:!m.trim()||t,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[t?(0,b.jsx)(i.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,k("common.create")]})]})]})})}var J=a.i(952313),K=a.i(7285);let L={modified:h.FileEdit,added:e.FilePlus,deleted:f.FileMinus,untracked:g.FileQuestion,renamed:h.FileEdit},M={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},N={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function O(a){let b={name:"",path:"",isDir:!0,children:[]};for(let c of a){let a=c.file.split("/"),d=b;for(let b=0;b<a.length;b++){let e=a[b],f=b===a.length-1,g=a.slice(0,b+1).join("/");if(f)d.children.push({name:e,path:g,isDir:!1,children:[],file:c});else{let a=d.children.find(a=>a.isDir&&a.name===e);a||(a={name:e,path:g,isDir:!0,children:[]},d.children.push(a)),d=a}}}return(function a(b){if(b.isDir&&(b.children=b.children.map(a),1===b.children.length&&b.children[0].isDir&&""!==b.name)){let a=b.children[0];return{...a,name:`${b.name}/${a.name}`}}return b})(b).children.sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name))}function P({label:a,count:d,labelColor:e,tree:f,batchAction:g,batchLabel:h,batchIcon:i,onFileClick:j,onFileAction:k,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:p,fileSecondaryIcon:q,fileSecondaryLabel:r}){let[s,t]=(0,c.useState)(!0);return 0===d?null:(0,b.jsxs)("div",{className:"border-b border-border",children:[(0,b.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,b.jsxs)("button",{onClick:()=>t(!s),className:"flex items-center gap-1 flex-1 min-w-0",children:[s?(0,b.jsx)(n.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${e}`,children:[a," (",d,")"]})]}),(0,b.jsx)(A.Button,{variant:"ghost",size:"icon-xs",onClick:g,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":h,children:i})]}),s&&(0,b.jsx)("div",{className:"pb-1",children:f.map(a=>(0,b.jsx)(Q,{node:a,depth:0,onFileClick:j,onFileAction:k,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:p,fileSecondaryIcon:q,fileSecondaryLabel:r},a.path))})]})}function Q({node:a,depth:e,onFileClick:f,onFileAction:g,fileActionIcon:h,fileActionLabel:i,onFileSecondaryAction:j,fileSecondaryIcon:k,fileSecondaryLabel:l}){let[p,q]=(0,c.useState)(!0),r={paddingLeft:`calc(${e} * 8px + 4px)`};if(a.isDir)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:()=>q(!p),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:r,children:[p?(0,b.jsx)(n.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsx)(o.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,b.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:a.name})]}),p&&a.children.sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name)).map(a=>(0,b.jsx)(Q,{node:a,depth:e+1,onFileClick:f,onFileAction:g,fileActionIcon:h,fileActionLabel:i,onFileSecondaryAction:j,fileSecondaryIcon:k,fileSecondaryLabel:l},a.path))]});let s=a.file,t=L[s.status]||d.File,u=M[s.status]||"text-muted-foreground",v=N[s.status]||"?";return(0,b.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:r,onClick:()=>f(s),children:[(0,b.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,b.jsx)(t,{className:`h-3.5 w-3.5 shrink-0 ${u}`}),(0,b.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:a.name}),(0,b.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${u}`,children:v}),j&&(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:a=>{a.stopPropagation(),j(s.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":l??"",children:k}),l&&(0,b.jsx)(D.TooltipContent,{side:"bottom",children:l})]}),(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:a=>{a.stopPropagation(),g(s.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":i??"",children:h}),i&&(0,b.jsx)(D.TooltipContent,{side:"bottom",children:i})]})]})}a.s(["EditorGitPanel",0,function({localPath:a,onFileSelect:d,mode:e="project"}){let f="task"===e,{t:g}=(0,H.useI18n)(),[h,m]=(0,c.useState)(null),[o,E]=(0,c.useState)(!0),[F,G]=(0,c.useState)(""),[L,M]=(0,c.useState)(!1),[N,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)(!1),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)(""),Z=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(V)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a);function a(a){Z.current&&!Z.current.contains(a.target)&&W(!1)}},[V]);let[$,_]=(0,c.useState)(!1),aa=(0,c.useCallback)(async()=>{try{let b=await fetch(`/api/git?path=${encodeURIComponent(a)}`);if(b.ok){let c=await b.json();m({changedFiles:c.changedFiles??[],ahead:c.ahead??0,behind:c.behind??0,remoteUrl:c.remoteUrl??"",currentBranch:c.currentBranch??"",branches:c.branches??[],remoteBranches:c.remoteBranches??[],topLevel:c.topLevel??a})}}catch{}finally{E(!1)}},[a]);(0,c.useEffect)(()=>{aa();let a=setInterval(aa,5e3);return()=>clearInterval(a)},[aa]);let ab=async b=>{try{await (0,K.gitAction)(a,"stage",{files:b}),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ac=async b=>{try{await (0,K.gitAction)(a,"unstage",{files:b}),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ad=async()=>{if(F.trim()){M(!0);try{await (0,K.gitAction)(a,"commit",{message:F}),G(""),J.toast.success(g("git.commitSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{M(!1)}}},ae=async b=>{Q(!0);try{await (0,K.gitAction)(a,"pull",b?{branch:b}:{}),J.toast.success(g("git.pullSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{Q(!1)}},af=async b=>{S(!0);try{await (0,K.gitAction)(a,"push",b?{branch:b}:{}),J.toast.success(g("git.pushSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{S(!1)}},ag=async()=>{U(!0);try{await (0,K.gitAction)(a,"fetch"),J.toast.success(g("git.fetchSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{U(!1)}},ah=async b=>{try{await (0,K.gitAction)(a,"checkout",{branch:b}),W(!1),J.toast.success(`${g("git.switchSuccess")} ${b}`),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ai=async()=>{try{await (0,K.gitAction)(a,"stash-save",{message:F||void 0}),G(""),J.toast.success(g("git.stashSaved")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},aj=async()=>{try{await (0,K.gitAction)(a,"stash-pop",{index:0}),J.toast.success(g("git.stashApplied")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ak=async b=>{try{await (0,K.gitAction)(a,"discard-file",{file:b}),J.toast.success(g("git.discardFileSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},al=async()=>{try{await (0,K.gitAction)(a,"discard-all"),J.toast.success(g("git.discardSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},am=async b=>{if("deleted"===b.status)return;let c=h?.topLevel??a;try{let e=await (0,K.gitAction)(a,"show",{file:b.file});d?.(b.file,e.content??"",c)}catch{d?.(b.file,"",c)}},an=h?.changedFiles.filter(a=>a.staged)??[],ao=h?.changedFiles.filter(a=>!a.staged)??[],ap=(0,c.useMemo)(()=>O(an),[an]),aq=(0,c.useMemo)(()=>O(ao),[ao]);if(o)return(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!h)return null;function ar(a){let b=[];for(let c of a)c.isDir?b.push(...ar(c.children)):c.file&&b.push(c.file.file);return b}let as=[...h?.branches??[],...(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a))],at=X?as.filter(a=>a.toLowerCase().includes(X.toLowerCase())):as;return(0,b.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[f?(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{render:(0,b.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:h?.currentBranch||"—"})]})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:h?.currentBranch||"—"})]}):(0,b.jsxs)("div",{className:"relative flex-1 min-w-0",ref:Z,children:[(0,b.jsxs)("button",{onClick:()=>{W(!V),Y("")},className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:h?.currentBranch||void 0,children:h?.currentBranch||"—"})]}),(0,b.jsx)(n.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${V?"rotate-180":""}`})]}),V&&(0,b.jsxs)("div",{className:"absolute left-0 top-full z-30 mt-1 min-w-full w-max max-w-[320px] 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)(x.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:X,onChange:a=>Y(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.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(h?.branches??[]).filter(a=>a.toLowerCase().includes(X.toLowerCase())).length>0&&(0,b.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:g("git.localBranches")}),(h?.branches??[]).filter(a=>a.toLowerCase().includes(X.toLowerCase())).map(a=>{let c=a===h?.currentBranch;return(0,b.jsxs)("button",{onClick:()=>{c?W(!1):ah(a)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${c?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a}),c&&(0,b.jsx)(l.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${a}`)}),(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a)).filter(a=>a.toLowerCase().includes(X.toLowerCase())).length>0&&(0,b.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:g("git.remoteBranches")}),(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a)).filter(a=>a.toLowerCase().includes(X.toLowerCase())).map(a=>(0,b.jsxs)("button",{onClick:()=>ah(a),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,b.jsx)(y.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a})]},`remote-${a}`)),0===at.length&&(0,b.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!f&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:ag,disabled:T,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,b.jsx)(s.RefreshCw,{className:`h-3.5 w-3.5 ${T?"animate-spin":""}`})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:()=>{W(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":g("git.createBranch"),children:(0,b.jsx)(q.Plus,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",children:g("git.createBranch")})]})]})]}),(0,b.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,b.jsx)("textarea",{value:F,onChange:a=>G(a.target.value),placeholder:g("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&"Enter"===a.key&&ad()}}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(A.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:ad,disabled:L||!F.trim()||0===an.length,children:[L?(0,b.jsx)(i.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(l.Check,{className:"h-3 w-3"}),g("git.commit")]}),(0,b.jsxs)(B.DropdownMenu,{children:[(0,b.jsx)(B.DropdownMenuTrigger,{render:(0,b.jsx)(A.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,b.jsx)(r.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)(B.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.commit")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ad,disabled:!F.trim()||0===an.length,children:[(0,b.jsx)(l.Check,{className:"h-3.5 w-3.5 mr-2"}),g("git.commit")]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.changes")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ab(ar(aq)),disabled:0===ao.length,children:[(0,b.jsx)(q.Plus,{className:"h-3.5 w-3.5 mr-2"}),g("git.stageAll")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ac(ar(ap)),disabled:0===an.length,children:[(0,b.jsx)(p.Minus,{className:"h-3.5 w-3.5 mr-2"}),g("git.unstageAll")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:al,disabled:0===ao.length,children:[(0,b.jsx)(v,{className:"h-3.5 w-3.5 mr-2"}),g("git.discardAll")]})]}),!f&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.sync")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(),disabled:N,children:[(0,b.jsx)(j.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),g("git.pull")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(),disabled:R,children:[(0,b.jsx)(k.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),g("git.push")]}),(0,b.jsxs)(B.DropdownMenuSub,{children:[(0,b.jsxs)(B.DropdownMenuSubTrigger,{disabled:N,children:[(0,b.jsx)(j.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),g("git.pullFrom"),"..."]}),(0,b.jsxs)(B.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),h.currentBranch,h.behind>0&&(0,b.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",h.behind]})]}),h.remoteBranches.filter(a=>a!==h.currentBranch).map(a=>(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(a),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),a]},a))]})]}),(0,b.jsxs)(B.DropdownMenuSub,{children:[(0,b.jsxs)(B.DropdownMenuSubTrigger,{disabled:R,children:[(0,b.jsx)(k.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),g("git.pushTo"),"..."]}),(0,b.jsxs)(B.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),h.currentBranch,h.ahead>0&&(0,b.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",h.ahead]})]}),h.remoteBranches.filter(a=>a!==h.currentBranch).map(a=>(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(a),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),a]},a))]})]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ag,disabled:T,children:[(0,b.jsx)(s.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${T?"animate-spin":""}`}),g("git.fetchAll")]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.stash")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ai,disabled:0===h.changedFiles.length,children:[(0,b.jsx)(t.Archive,{className:"h-3.5 w-3.5 mr-2"}),g("git.stashSave")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:aj,children:[(0,b.jsx)(u.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),g("git.stashPopLatest")]})]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,b.jsx)(w.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),h.currentBranch]})]})]})]})]}),(0,b.jsxs)(C.ScrollArea,{className:"flex-1 min-h-0",children:[(0,b.jsx)(P,{label:g("git.stagedChanges"),count:an.length,labelColor:"text-emerald-400",tree:ap,batchAction:()=>ac(ar(ap)),batchLabel:g("git.unstageAll"),batchIcon:(0,b.jsx)(p.Minus,{className:"h-3 w-3"}),onFileClick:am,onFileAction:a=>ac([a]),fileActionIcon:"−",fileActionLabel:g("git.unstageFile")}),(0,b.jsx)(P,{label:g("git.unstagedChanges"),count:ao.length,labelColor:"text-muted-foreground",tree:aq,batchAction:()=>ab(ar(aq)),batchLabel:g("git.stageAll"),batchIcon:(0,b.jsx)(q.Plus,{className:"h-3 w-3"}),onFileClick:am,onFileAction:a=>ab([a]),fileActionIcon:"+",fileActionLabel:g("git.stageFile"),onFileSecondaryAction:a=>ak(a),fileSecondaryIcon:(0,b.jsx)(z.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:g("git.discardFile")}),0===h.changedFiles.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,b.jsx)(l.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g("git.noChanges")})]})]}),(0,b.jsx)(I,{open:$,onOpenChange:_,branches:[...h?.branches??[],...h?.remoteBranches??[]],currentBranch:h?.currentBranch??"",localPath:a,onCreated:async()=>{J.toast.success(g("git.createSuccess")),await aa()},onError:a=>J.toast.error(`${g("git.createFailed")}: ${a}`)})]})}],985716)},613525,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("605021ab2307e226d867a3f69b8bb639a7acd99981",b.callServer,void 0,b.findSourceMapURL,"updateTask");a.s(["updateTask",0,c])},798126,921793,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("7c8e64a7609183658c499a723fb9ddc268c4b93828",b.callServer,void 0,b.findSourceMapURL,"startPtyExecutionSafe");a.s(["startPtyExecutionSafe",0,c],798126);let d=(0,b.createServerReference)("40dbd9d9ece00eafcf38ec3c043d66e6df7a649cc3",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,d],921793)},723503,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("407261dd77a1aed555bfefb9fa4175dab402f0fc86",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},274346,30771,234438,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("605e1a419b1d57c71f50b31c285b559cc200822a7a",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],274346);let d=(0,b.createServerReference)("4080b66c619f2654a2fee839c95fd37ce187381c88",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],30771);let e=(0,b.createServerReference)("603f511232cbef05181f32fde7b4bedb5dedee225f",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],234438)},283857,a=>{"use strict";let b=(0,a.i(711796).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],283857)},715525,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(442620),e=a.i(745539),f=a.i(913284),g=a.i(468862),h=a.i(704494),i=a.i(970535),j=a.i(165614),k=a.i(747798),l=a.i(283857),m=a.i(359948),n=a.i(699570),o=a.i(579834),p=a.i(951192);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.History,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)})]})}])}];
1
+ module.exports=[300141,639138,88757,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,c],300141);var d=a.i(728778),e=a.i(374637),f=a.i(10390),g=a.i(442620),h=a.i(811344),i=a.i(394869),j=a.i(207339),k=a.i(704494),l=a.i(699570),m=a.i(579834),n=a.i(786304),o=a.i(814574),p=a.i(429246),q=a.i(951192);function r({patchState:a,isLargeFold:b,onLoad:c}){let{t:e}=(0,q.useI18n)();return b?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,d.jsx)(l.Button,{variant:"link",onClick:c,className:"h-auto p-0 text-sm",children:e("diff.loadDiff")}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:e("diff.foldedLarge")})]}):a&&"loading"!==a.kind?"error"===a.kind?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,d.jsx)("span",{children:e("diff.loadFailed")}),(0,d.jsx)(l.Button,{variant:"ghost",onClick:c,children:e("diff.retry")})]}):"binary"===a.kind?(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:e("diff.binaryNotShown")}):"empty"===a.kind?(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:e("diff.noChanges")}):(0,d.jsx)(s,{patch:a.patch??""}):(0,d.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,d.jsx)(k.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function s({patch:a}){let{t:b}=(0,q.useI18n)(),c=a.split("\n"),e=c.length>500,f=e?c.slice(0,500):c;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:f.map((a,b)=>{let c=a.startsWith("+++")||a.startsWith("---")?"px-4 block text-muted-foreground":a.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":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,d.jsx)("span",{className:c,children:a||" "},b)})}),e&&(0,d.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:b("diff.patchTruncated",{n:String(500),total:String(c.length)})})]})}a.s(["TaskDiffView",0,function({taskId:a,files:b,totalAdded:c,totalRemoved:k,hasConflicts:s,conflictFiles:t,onCommit:u,hasUncommitted:v}){let{t:w}=(0,q.useI18n)(),[x,y]=(0,e.useState)(new Set),[z,A]=(0,e.useState)(new Map),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(!1),H=b=>{A(a=>new Map(a).set(b,{kind:"loading"})),fetch(`/api/tasks/${a}/diff-patch?file=${encodeURIComponent(b)}`).then(a=>a.ok?a.json():Promise.reject(Error(`HTTP ${a.status}`))).then(a=>{A(c=>{let d=new Map(c);return"binary"===a.kind?d.set(b,{kind:"binary"}):"empty"===a.kind?d.set(b,{kind:"empty"}):d.set(b,{kind:"ready",patch:a.patch??""}),d})}).catch(()=>{A(a=>new Map(a).set(b,{kind:"error"}))})};return(0,d.jsxs)("div",{className:"flex flex-col h-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,d.jsxs)("span",{className:"font-medium text-foreground",children:[b.length," files changed"]}),(0,d.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",c]}),(0,d.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",k]})]}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:v&&u&&(0,d.jsxs)(l.Button,{variant:"outline",onClick:()=>C(!0),className:"gap-2",children:[(0,d.jsx)(j.GitCommitHorizontal,{className:"h-4 w-4"}),w("diff.commit")]})})]}),s&&(0,d.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,d.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,d.jsx)(h.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,d.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",t.length," conflicting file",1!==t.length?"s":""]})]}),(0,d.jsx)("ul",{className:"ml-6 space-y-1",children:t.map(a=>(0,d.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,d.jsx)("div",{className:"flex-1 overflow-auto",children:0===b.length?(0,d.jsx)(m.EmptyState,{icon:i.GitCompare,title:w("diff.noChanges"),className:"h-full"}):(0,d.jsx)("div",{className:"divide-y divide-border",children:b.map(a=>{let b=x.has(a.filename),c=z.get(a.filename),e=a.added+a.removed;return(0,d.jsxs)("div",{children:[(0,d.jsxs)(l.Button,{variant:"ghost",type:"button",onClick:()=>{let b;return b=x.has(a.filename),void(y(b=>{let c=new Set(b);return c.has(a.filename)?c.delete(a.filename):c.add(a.filename),c}),b||a.isBinary||z.has(a.filename)||a.added+a.removed<=200&&H(a.filename))},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:[b?(0,d.jsx)(g.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,d.jsx)(f.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,d.jsx)(n.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:w("diff.binary")}):(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,d.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),b&&!a.isBinary&&(0,d.jsx)("div",{className:"border-t border-border bg-background",children:(0,d.jsx)(r,{filename:a.filename,patchState:c,isLargeFold:!c&&e>200,onLoad:()=>H(a.filename)})})]},a.filename)})})}),(0,d.jsx)(o.Dialog,{open:B,onOpenChange:C,children:(0,d.jsxs)(o.DialogContent,{className:"max-w-md",children:[(0,d.jsx)(o.DialogHeader,{children:(0,d.jsx)(o.DialogTitle,{children:w("diff.commitChanges")})}),(0,d.jsx)("div",{className:"flex flex-col gap-3",children:(0,d.jsx)(p.Textarea,{value:D,onChange:a=>E(a.target.value),placeholder:w("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,d.jsxs)(o.DialogFooter,{children:[(0,d.jsx)(l.Button,{variant:"ghost",onClick:()=>C(!1),children:w("common.cancel")}),(0,d.jsx)(l.Button,{onClick:async()=>{if(D.trim()&&u){G(!0);try{await u(D.trim()),E(""),C(!1)}finally{G(!1)}}},disabled:!D.trim()||F,children:F?"...":w("diff.commit")})]})]})})]})}],639138);var t=a.i(553798);let u=(0,b.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"}]]);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:b,taskId:c,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:j=[],onMergeComplete:m}){let n=(0,t.useRouter)(),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(null),v=async()=>{q(!0),s(null);try{let a=await fetch(`/api/tasks/${c}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){b(!1),m(),n.refresh();return}let d=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?s(`Merge conflicts detected: ${Array.isArray(d.conflictFiles)?d.conflictFiles.join(", "):"unknown files"}`):s(d.error??"Merge failed")}catch{s("Network error — merge failed")}finally{q(!1)}};return(0,d.jsx)(o.Dialog,{open:a,onOpenChange:b,children:(0,d.jsxs)(o.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,d.jsx)(o.DialogHeader,{children:(0,d.jsxs)(o.DialogTitle,{className:"flex items-center gap-2",children:[(0,d.jsx)(u,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,d.jsxs)("div",{className:"space-y-3 py-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,d.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),j.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,d.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:j.map((a,b)=>(0,d.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},b))})]}),r&&(0,d.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,d.jsx)("p",{className:"text-xs text-red-400",children:r})})]}),(0,d.jsxs)(o.DialogFooter,{children:[(0,d.jsx)(l.Button,{variant:"outline",onClick:()=>b(!1),disabled:p,children:"Cancel"}),(0,d.jsx)(l.Button,{onClick:v,disabled:p,className:"gap-2",children:p?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],88757)},140597,694116,a=>{"use strict";let b=(0,a.i(711796).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);a.s(["default",0,b],694116),a.s(["File",0,b],140597)},970535,359948,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,c],970535);let d=(0,b.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"}]]);a.s(["History",0,d],359948)},7285,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])},771313,307373,646788,806671,114884,604456,703903,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);a.s(["FilePlus",0,c],771313);let d=(0,b.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);a.s(["FileMinus",0,d],307373);let e=(0,b.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);a.s(["FileQuestion",0,e],646788);let f=(0,b.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);a.s(["FileEdit",0,f],806671);let g=(0,b.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);a.s(["ArrowDown",0,g],114884);let h=(0,b.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);a.s(["ArrowUp",0,h],604456);let i=(0,b.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);a.s(["Minus",0,i],703903)},324263,a=>{"use strict";let b=(0,a.i(711796).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],324263)},985716,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(140597),e=a.i(771313),f=a.i(307373),g=a.i(646788),h=a.i(806671),i=a.i(704494),j=a.i(114884),k=a.i(604456),l=a.i(668116),m=a.i(10390),n=a.i(442620),o=a.i(146758),p=a.i(703903),q=a.i(774881),r=a.i(336771),s=a.i(192369),t=a.i(607219),u=a.i(324263);let v=(0,a.i(711796).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var w=a.i(577565),x=a.i(573242),y=a.i(851378),z=a.i(975231),A=a.i(699570),B=a.i(335732),C=a.i(269876),D=a.i(785259),E=a.i(814574),F=a.i(866718),G=a.i(429246),H=a.i(951192);function I({open:a,onOpenChange:d,branches:e,currentBranch:f,localPath:g,onCreated:h,onError:j}){let{t:k}=(0,H.useI18n)(),[m,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(f),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,y]=(0,c.useState)(""),[z,B]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(o(""),q(f),s(""),y(""))},[a,f]);let C=[...new Set(e)].filter(a=>a.toLowerCase().includes(v.toLowerCase())),D=async()=>{if(m.trim()){u(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:g,branch:m.trim(),baseBranch:p})});if(a.ok)d(!1),h();else{let b=await a.json();j(b.error||"Unknown error")}}catch{j("Network error")}finally{u(!1)}}};return(0,b.jsx)(E.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(E.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(E.DialogHeader,{children:(0,b.jsx)(E.DialogTitle,{children:k("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:k("git.branchName")}),(0,b.jsx)(F.Input,{value:m,onChange:a=>o(a.target.value),placeholder:k("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&D()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>B(!z),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 min-w-0 items-center gap-2",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:p,children:p})]}),(0,b.jsx)(n.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${z?"rotate-180":""}`})]}),z&&(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)(x.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:v,onChange:a=>y(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:C.map(a=>(0,b.jsxs)("button",{onClick:()=>{q(a),B(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===p?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a}),a===p&&(0,b.jsx)(l.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:k("git.branchDesc")}),(0,b.jsx)(G.Textarea,{value:r,onChange:a=>s(a.target.value),placeholder:k("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)(E.DialogFooter,{children:[(0,b.jsx)(A.Button,{variant:"outline",onClick:()=>d(!1),children:k("common.cancel")}),(0,b.jsxs)(A.Button,{onClick:D,disabled:!m.trim()||t,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[t?(0,b.jsx)(i.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,k("common.create")]})]})]})})}var J=a.i(952313),K=a.i(7285);let L={modified:h.FileEdit,added:e.FilePlus,deleted:f.FileMinus,untracked:g.FileQuestion,renamed:h.FileEdit},M={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},N={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function O(a){let b={name:"",path:"",isDir:!0,children:[]};for(let c of a){let a=c.file.split("/"),d=b;for(let b=0;b<a.length;b++){let e=a[b],f=b===a.length-1,g=a.slice(0,b+1).join("/");if(f)d.children.push({name:e,path:g,isDir:!1,children:[],file:c});else{let a=d.children.find(a=>a.isDir&&a.name===e);a||(a={name:e,path:g,isDir:!0,children:[]},d.children.push(a)),d=a}}}return(function a(b){if(b.isDir&&(b.children=b.children.map(a),1===b.children.length&&b.children[0].isDir&&""!==b.name)){let a=b.children[0];return{...a,name:`${b.name}/${a.name}`}}return b})(b).children.sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name))}function P({label:a,count:d,labelColor:e,tree:f,batchAction:g,batchLabel:h,batchIcon:i,onFileClick:j,onFileAction:k,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:p,fileSecondaryIcon:q,fileSecondaryLabel:r}){let[s,t]=(0,c.useState)(!0);return 0===d?null:(0,b.jsxs)("div",{className:"border-b border-border",children:[(0,b.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,b.jsxs)("button",{onClick:()=>t(!s),className:"flex items-center gap-1 flex-1 min-w-0",children:[s?(0,b.jsx)(n.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${e}`,children:[a," (",d,")"]})]}),(0,b.jsx)(A.Button,{variant:"ghost",size:"icon-xs",onClick:g,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":h,children:i})]}),s&&(0,b.jsx)("div",{className:"pb-1",children:f.map(a=>(0,b.jsx)(Q,{node:a,depth:0,onFileClick:j,onFileAction:k,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:p,fileSecondaryIcon:q,fileSecondaryLabel:r},a.path))})]})}function Q({node:a,depth:e,onFileClick:f,onFileAction:g,fileActionIcon:h,fileActionLabel:i,onFileSecondaryAction:j,fileSecondaryIcon:k,fileSecondaryLabel:l}){let[p,q]=(0,c.useState)(!0),r={paddingLeft:`calc(${e} * 8px + 4px)`};if(a.isDir)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:()=>q(!p),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:r,children:[p?(0,b.jsx)(n.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsx)(o.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,b.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:a.name})]}),p&&a.children.sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name)).map(a=>(0,b.jsx)(Q,{node:a,depth:e+1,onFileClick:f,onFileAction:g,fileActionIcon:h,fileActionLabel:i,onFileSecondaryAction:j,fileSecondaryIcon:k,fileSecondaryLabel:l},a.path))]});let s=a.file,t=L[s.status]||d.File,u=M[s.status]||"text-muted-foreground",v=N[s.status]||"?";return(0,b.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:r,onClick:()=>f(s),children:[(0,b.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,b.jsx)(t,{className:`h-3.5 w-3.5 shrink-0 ${u}`}),(0,b.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:a.name}),(0,b.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${u}`,children:v}),j&&(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:a=>{a.stopPropagation(),j(s.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":l??"",children:k}),l&&(0,b.jsx)(D.TooltipContent,{side:"bottom",children:l})]}),(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:a=>{a.stopPropagation(),g(s.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":i??"",children:h}),i&&(0,b.jsx)(D.TooltipContent,{side:"bottom",children:i})]})]})}a.s(["EditorGitPanel",0,function({localPath:a,onFileSelect:d,mode:e="project"}){let f="task"===e,{t:g}=(0,H.useI18n)(),[h,m]=(0,c.useState)(null),[o,E]=(0,c.useState)(!0),[F,G]=(0,c.useState)(""),[L,M]=(0,c.useState)(!1),[N,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)(!1),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)(""),Z=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(V)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a);function a(a){Z.current&&!Z.current.contains(a.target)&&W(!1)}},[V]);let[$,_]=(0,c.useState)(!1),aa=(0,c.useCallback)(async()=>{try{let b=await fetch(`/api/git?path=${encodeURIComponent(a)}`);if(b.ok){let c=await b.json();m({changedFiles:c.changedFiles??[],ahead:c.ahead??0,behind:c.behind??0,remoteUrl:c.remoteUrl??"",currentBranch:c.currentBranch??"",branches:c.branches??[],remoteBranches:c.remoteBranches??[],topLevel:c.topLevel??a})}}catch{}finally{E(!1)}},[a]);(0,c.useEffect)(()=>{aa();let a=setInterval(aa,5e3);return()=>clearInterval(a)},[aa]);let ab=async b=>{try{await (0,K.gitAction)(a,"stage",{files:b}),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ac=async b=>{try{await (0,K.gitAction)(a,"unstage",{files:b}),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ad=async()=>{if(F.trim()){M(!0);try{await (0,K.gitAction)(a,"commit",{message:F}),G(""),J.toast.success(g("git.commitSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{M(!1)}}},ae=async b=>{Q(!0);try{await (0,K.gitAction)(a,"pull",b?{branch:b}:{}),J.toast.success(g("git.pullSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{Q(!1)}},af=async b=>{S(!0);try{await (0,K.gitAction)(a,"push",b?{branch:b}:{}),J.toast.success(g("git.pushSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{S(!1)}},ag=async()=>{U(!0);try{await (0,K.gitAction)(a,"fetch"),J.toast.success(g("git.fetchSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{U(!1)}},ah=async b=>{try{await (0,K.gitAction)(a,"checkout",{branch:b}),W(!1),J.toast.success(`${g("git.switchSuccess")} ${b}`),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ai=async()=>{try{await (0,K.gitAction)(a,"stash-save",{message:F||void 0}),G(""),J.toast.success(g("git.stashSaved")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},aj=async()=>{try{await (0,K.gitAction)(a,"stash-pop",{index:0}),J.toast.success(g("git.stashApplied")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ak=async b=>{try{await (0,K.gitAction)(a,"discard-file",{file:b}),J.toast.success(g("git.discardFileSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},al=async()=>{try{await (0,K.gitAction)(a,"discard-all"),J.toast.success(g("git.discardSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},am=async b=>{if("deleted"===b.status)return;let c=h?.topLevel??a;try{let e=await (0,K.gitAction)(a,"show",{file:b.file});d?.(b.file,e.content??"",c)}catch{d?.(b.file,"",c)}},an=h?.changedFiles.filter(a=>a.staged)??[],ao=h?.changedFiles.filter(a=>!a.staged)??[],ap=(0,c.useMemo)(()=>O(an),[an]),aq=(0,c.useMemo)(()=>O(ao),[ao]);if(o)return(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!h)return null;function ar(a){let b=[];for(let c of a)c.isDir?b.push(...ar(c.children)):c.file&&b.push(c.file.file);return b}let as=[...h?.branches??[],...(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a))],at=X?as.filter(a=>a.toLowerCase().includes(X.toLowerCase())):as;return(0,b.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[f?(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{render:(0,b.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:h?.currentBranch||"—"})]})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:h?.currentBranch||"—"})]}):(0,b.jsxs)("div",{className:"relative flex-1 min-w-0",ref:Z,children:[(0,b.jsxs)("button",{onClick:()=>{W(!V),Y("")},className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:h?.currentBranch||void 0,children:h?.currentBranch||"—"})]}),(0,b.jsx)(n.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${V?"rotate-180":""}`})]}),V&&(0,b.jsxs)("div",{className:"absolute left-0 top-full z-30 mt-1 min-w-full w-max max-w-[320px] 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)(x.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:X,onChange:a=>Y(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.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(h?.branches??[]).filter(a=>a.toLowerCase().includes(X.toLowerCase())).length>0&&(0,b.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:g("git.localBranches")}),(h?.branches??[]).filter(a=>a.toLowerCase().includes(X.toLowerCase())).map(a=>{let c=a===h?.currentBranch;return(0,b.jsxs)("button",{onClick:()=>{c?W(!1):ah(a)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${c?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a}),c&&(0,b.jsx)(l.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${a}`)}),(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a)).filter(a=>a.toLowerCase().includes(X.toLowerCase())).length>0&&(0,b.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:g("git.remoteBranches")}),(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a)).filter(a=>a.toLowerCase().includes(X.toLowerCase())).map(a=>(0,b.jsxs)("button",{onClick:()=>ah(a),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,b.jsx)(y.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a})]},`remote-${a}`)),0===at.length&&(0,b.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!f&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:ag,disabled:T,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,b.jsx)(s.RefreshCw,{className:`h-3.5 w-3.5 ${T?"animate-spin":""}`})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:()=>{W(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":g("git.createBranch"),children:(0,b.jsx)(q.Plus,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",children:g("git.createBranch")})]})]})]}),(0,b.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,b.jsx)("textarea",{value:F,onChange:a=>G(a.target.value),placeholder:g("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&"Enter"===a.key&&ad()}}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(A.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:ad,disabled:L||!F.trim()||0===an.length,children:[L?(0,b.jsx)(i.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(l.Check,{className:"h-3 w-3"}),g("git.commit")]}),(0,b.jsxs)(B.DropdownMenu,{children:[(0,b.jsx)(B.DropdownMenuTrigger,{render:(0,b.jsx)(A.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,b.jsx)(r.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)(B.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.commit")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ad,disabled:!F.trim()||0===an.length,children:[(0,b.jsx)(l.Check,{className:"h-3.5 w-3.5 mr-2"}),g("git.commit")]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.changes")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ab(ar(aq)),disabled:0===ao.length,children:[(0,b.jsx)(q.Plus,{className:"h-3.5 w-3.5 mr-2"}),g("git.stageAll")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ac(ar(ap)),disabled:0===an.length,children:[(0,b.jsx)(p.Minus,{className:"h-3.5 w-3.5 mr-2"}),g("git.unstageAll")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:al,disabled:0===ao.length,children:[(0,b.jsx)(v,{className:"h-3.5 w-3.5 mr-2"}),g("git.discardAll")]})]}),!f&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.sync")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(),disabled:N,children:[(0,b.jsx)(j.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),g("git.pull")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(),disabled:R,children:[(0,b.jsx)(k.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),g("git.push")]}),(0,b.jsxs)(B.DropdownMenuSub,{children:[(0,b.jsxs)(B.DropdownMenuSubTrigger,{disabled:N,children:[(0,b.jsx)(j.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),g("git.pullFrom"),"..."]}),(0,b.jsxs)(B.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),h.currentBranch,h.behind>0&&(0,b.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",h.behind]})]}),h.remoteBranches.filter(a=>a!==h.currentBranch).map(a=>(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(a),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),a]},a))]})]}),(0,b.jsxs)(B.DropdownMenuSub,{children:[(0,b.jsxs)(B.DropdownMenuSubTrigger,{disabled:R,children:[(0,b.jsx)(k.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),g("git.pushTo"),"..."]}),(0,b.jsxs)(B.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),h.currentBranch,h.ahead>0&&(0,b.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",h.ahead]})]}),h.remoteBranches.filter(a=>a!==h.currentBranch).map(a=>(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(a),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),a]},a))]})]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ag,disabled:T,children:[(0,b.jsx)(s.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${T?"animate-spin":""}`}),g("git.fetchAll")]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.stash")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ai,disabled:0===h.changedFiles.length,children:[(0,b.jsx)(t.Archive,{className:"h-3.5 w-3.5 mr-2"}),g("git.stashSave")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:aj,children:[(0,b.jsx)(u.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),g("git.stashPopLatest")]})]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,b.jsx)(w.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),h.currentBranch]})]})]})]})]}),(0,b.jsxs)(C.ScrollArea,{className:"flex-1 min-h-0",children:[(0,b.jsx)(P,{label:g("git.stagedChanges"),count:an.length,labelColor:"text-emerald-400",tree:ap,batchAction:()=>ac(ar(ap)),batchLabel:g("git.unstageAll"),batchIcon:(0,b.jsx)(p.Minus,{className:"h-3 w-3"}),onFileClick:am,onFileAction:a=>ac([a]),fileActionIcon:"−",fileActionLabel:g("git.unstageFile")}),(0,b.jsx)(P,{label:g("git.unstagedChanges"),count:ao.length,labelColor:"text-muted-foreground",tree:aq,batchAction:()=>ab(ar(aq)),batchLabel:g("git.stageAll"),batchIcon:(0,b.jsx)(q.Plus,{className:"h-3 w-3"}),onFileClick:am,onFileAction:a=>ab([a]),fileActionIcon:"+",fileActionLabel:g("git.stageFile"),onFileSecondaryAction:a=>ak(a),fileSecondaryIcon:(0,b.jsx)(z.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:g("git.discardFile")}),0===h.changedFiles.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,b.jsx)(l.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g("git.noChanges")})]})]}),(0,b.jsx)(I,{open:$,onOpenChange:_,branches:[...h?.branches??[],...h?.remoteBranches??[]],currentBranch:h?.currentBranch??"",localPath:a,onCreated:async()=>{J.toast.success(g("git.createSuccess")),await aa()},onError:a=>J.toast.error(`${g("git.createFailed")}: ${a}`)})]})}],985716)},254480,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("60e903d81016ad087f0673954b19123d6402d9ea4d",b.callServer,void 0,b.findSourceMapURL,"updateTask");a.s(["updateTask",0,c])},986565,420436,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("7c5e3b54118977428104afc6d77720611257ac522a",b.callServer,void 0,b.findSourceMapURL,"startPtyExecutionSafe");a.s(["startPtyExecutionSafe",0,c],986565);let d=(0,b.createServerReference)("40d0c8238b487e664660cb962acdf111f015db29da",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,d],420436)},212524,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("400329c68fcd02edea883a2bcaf2651767b169dfd3",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},714812,329351,430756,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("60f81021da1a9765ca9d3ef0fdcc96463310df9374",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],714812);let d=(0,b.createServerReference)("40b0c9a5c3b37cdf74d8565ce067e8917e63c79c45",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],329351);let e=(0,b.createServerReference)("6017cfb7c1ea9098673c3fb41bf5fb4209494d7dd7",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],430756)},283857,a=>{"use strict";let b=(0,a.i(711796).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],283857)},715525,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(442620),e=a.i(745539),f=a.i(913284),g=a.i(468862),h=a.i(704494),i=a.i(970535),j=a.i(165614),k=a.i(747798),l=a.i(283857),m=a.i(359948),n=a.i(699570),o=a.i(579834),p=a.i(951192);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.History,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)})]})}])}];
2
2
 
3
- //# sourceMappingURL=_0tua.9p._.js.map
3
+ //# sourceMappingURL=_08x3jaa._.js.map