tower-studio 0.1.16 → 0.1.17

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 (169) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/diagnostics/route-bundle-stats.json +41 -41
  7. package/.next/fallback-build-manifest.json +3 -3
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  17. package/.next/server/app/_not-found/page/server-reference-manifest.json +23 -23
  18. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  19. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  20. package/.next/server/app/_not-found.html +1 -1
  21. package/.next/server/app/_not-found.rsc +13 -13
  22. package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
  23. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  24. package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
  25. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  26. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  27. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  28. package/.next/server/app/index.html +1 -1
  29. package/.next/server/app/index.rsc +13 -13
  30. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  31. package/.next/server/app/index.segments/_full.segment.rsc +13 -13
  32. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  33. package/.next/server/app/index.segments/_index.segment.rsc +8 -8
  34. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  35. package/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  36. package/.next/server/app/missions/page/server-reference-manifest.json +53 -53
  37. package/.next/server/app/missions/page.js.nft.json +1 -1
  38. package/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  40. package/.next/server/app/onboarding/page/server-reference-manifest.json +23 -23
  41. package/.next/server/app/onboarding/page.js.nft.json +1 -1
  42. package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  43. package/.next/server/app/onboarding.html +1 -1
  44. package/.next/server/app/onboarding.rsc +15 -15
  45. package/.next/server/app/onboarding.segments/_full.segment.rsc +15 -15
  46. package/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  47. package/.next/server/app/onboarding.segments/_index.segment.rsc +8 -8
  48. package/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  49. package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  50. package/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  51. package/.next/server/app/page/react-loadable-manifest.json +1 -1
  52. package/.next/server/app/page/server-reference-manifest.json +23 -23
  53. package/.next/server/app/page.js.nft.json +1 -1
  54. package/.next/server/app/page_client-reference-manifest.js +1 -1
  55. package/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  56. package/.next/server/app/settings/page/server-reference-manifest.json +30 -30
  57. package/.next/server/app/settings/page.js.nft.json +1 -1
  58. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  59. package/.next/server/app/settings.html +1 -1
  60. package/.next/server/app/settings.rsc +15 -15
  61. package/.next/server/app/settings.segments/_full.segment.rsc +15 -15
  62. package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  63. package/.next/server/app/settings.segments/_index.segment.rsc +8 -8
  64. package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  65. package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  66. package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  67. package/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  68. package/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +77 -77
  69. package/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  70. package/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  71. package/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  72. package/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +66 -66
  73. package/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  74. package/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  75. package/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  76. package/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +55 -55
  77. package/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  78. package/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  79. package/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  80. package/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +51 -51
  81. package/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  82. package/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  83. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  84. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +23 -23
  85. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  86. package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  87. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +1 -1
  88. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +52 -52
  89. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  90. package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  91. package/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  92. package/.next/server/app/workspaces/page/server-reference-manifest.json +41 -41
  93. package/.next/server/app/workspaces/page.js.nft.json +1 -1
  94. package/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  95. package/.next/server/chunks/0uz~_next_dist_esm_build_templates_app-route_05yec2y.js +1 -1
  96. package/.next/server/chunks/[root-of-the-server]__0rb-ear._.js +1 -1
  97. package/.next/server/chunks/project_f_tower_0n1s3ym._.js +1 -1
  98. package/.next/server/chunks/project_f_tower_src_11e.cv5._.js +1 -1
  99. package/.next/server/chunks/ssr/04uy_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_01.s1p0._.js +1 -1
  100. package/.next/server/chunks/ssr/0y0r_f_tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0n4g3bn._.js +1 -1
  101. package/.next/server/chunks/ssr/[root-of-the-server]__0-x7b4t._.js +3 -0
  102. package/.next/server/chunks/ssr/[root-of-the-server]__06qzctf._.js +1 -1
  103. package/.next/server/chunks/ssr/[root-of-the-server]__0_47k-j._.js +1 -1
  104. package/.next/server/chunks/ssr/[root-of-the-server]__0aidehy._.js +1 -1
  105. package/.next/server/chunks/ssr/[root-of-the-server]__0ffdrwp._.js +1 -1
  106. package/.next/server/chunks/ssr/[root-of-the-server]__0i4rk9v._.js +3 -3
  107. package/.next/server/chunks/ssr/[root-of-the-server]__0w7gbe7._.js +1 -1
  108. package/.next/server/chunks/ssr/{[root-of-the-server]__0h38s6n._.js → [root-of-the-server]__0z9azne._.js} +2 -2
  109. package/.next/server/chunks/ssr/[root-of-the-server]__0zaw-fl._.js +1 -1
  110. package/.next/server/chunks/ssr/{[root-of-the-server]__0h8nl.m._.js → [root-of-the-server]__13b2wve._.js} +2 -2
  111. package/.next/server/chunks/ssr/[root-of-the-server]__13eo85g._.js +1 -1
  112. package/.next/server/chunks/ssr/{project_f_tower_12oax__._.js → project_f_tower_0-wsdce._.js} +2 -2
  113. package/.next/server/chunks/ssr/{project_f_tower_0ssr2sl._.js → project_f_tower_0.nfmle._.js} +2 -2
  114. package/.next/server/chunks/ssr/project_f_tower_0.txwd8._.js +1 -1
  115. package/.next/server/chunks/ssr/{project_f_tower_0tlnklr._.js → project_f_tower_0ai4twk._.js} +2 -2
  116. package/.next/server/chunks/ssr/project_f_tower_0e3m009._.js +3 -0
  117. package/.next/server/chunks/ssr/project_f_tower_0f0-wva._.js +1 -1
  118. package/.next/server/chunks/ssr/project_f_tower_0hgtev9._.js +1 -1
  119. package/.next/server/chunks/ssr/project_f_tower_0ivvjwd._.js +1 -1
  120. package/.next/server/chunks/ssr/project_f_tower_0jy~1uf._.js +1 -1
  121. package/.next/server/chunks/ssr/project_f_tower_0l6ssf8._.js +1 -1
  122. package/.next/server/chunks/ssr/project_f_tower_0o5.y1e._.js +1 -1
  123. package/.next/server/chunks/ssr/{project_f_tower_0ps2~v1._.js → project_f_tower_0uu8dha._.js} +2 -2
  124. package/.next/server/chunks/ssr/project_f_tower_0w01kgd._.js +1 -1
  125. package/.next/server/chunks/ssr/project_f_tower_0ym-aea._.js +1 -1
  126. package/.next/server/chunks/ssr/{project_f_tower_0i96rjz._.js → project_f_tower_0zqkh.-._.js} +2 -2
  127. package/.next/server/chunks/ssr/project_f_tower_src_03-54or._.js +3 -0
  128. package/.next/server/chunks/ssr/project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js +1 -1
  129. package/.next/server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js +1 -1
  130. package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js +1 -1
  131. package/.next/server/chunks/ssr/project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js +1 -1
  132. package/.next/server/chunks/ssr/project_f_tower_src_app_settings_page_tsx_0oo06~d._.js +1 -1
  133. package/.next/server/chunks/ssr/project_f_tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0jmj1xz._.js +1 -1
  134. package/.next/server/middleware-build-manifest.js +3 -3
  135. package/.next/server/pages/404.html +1 -1
  136. package/.next/server/pages/500.html +1 -1
  137. package/.next/server/server-reference-manifest.js +1 -1
  138. package/.next/server/server-reference-manifest.json +187 -187
  139. package/.next/static/chunks/{14xrab1qyw2yw.js → 037e47w8xw0vw.js} +1 -1
  140. package/.next/static/chunks/{0jef3e_wsh4mf.js → 083e56klgnjgy.js} +1 -1
  141. package/.next/static/chunks/0a8x8yl_kme06.js +1 -0
  142. package/.next/static/chunks/{0jfknbbi-cjcl.js → 0cqsk~mfhg.i5.js} +1 -1
  143. package/.next/static/chunks/{0gwxdr2ihtu8z.js → 0i_v_7f3gdmz4.js} +1 -1
  144. package/.next/static/chunks/0j.~gle~mn8uy.js +1 -0
  145. package/.next/static/chunks/{08x0olwzpsczv.js → 0nyip_341~xyg.js} +2 -2
  146. package/.next/static/chunks/0rt2m4hy13qby.js +1 -0
  147. package/.next/static/chunks/0x5iegao~6ge3.js +1 -0
  148. package/.next/static/chunks/0x6gp.e04de4e.js +1 -0
  149. package/.next/static/chunks/{12q1f_9u6eduf.js → 0zz4ryeh6j~.x.js} +1 -1
  150. package/.next/static/chunks/{06~5p79536pfs.js → 110k271zgqb6h.js} +1 -1
  151. package/.next/static/chunks/125_gss3san00.js +1 -0
  152. package/.next/static/chunks/12wq.0xcxup1q.js +1 -0
  153. package/.next/static/chunks/{0uxf3e~tjkjuz.js → 187llw593phxu.js} +1 -1
  154. package/.next/trace +2 -2
  155. package/.next/trace-build +1 -1
  156. package/package.json +4 -2
  157. package/.next/server/chunks/ssr/[root-of-the-server]__0bqzhpe._.js +0 -3
  158. package/.next/server/chunks/ssr/project_f_tower_047pa2s._.js +0 -3
  159. package/.next/server/chunks/ssr/project_f_tower_src_10.nkh7._.js +0 -3
  160. package/.next/static/chunks/076vhlm6g1m9n.js +0 -1
  161. package/.next/static/chunks/0amzt~927k5f5.js +0 -1
  162. package/.next/static/chunks/0l5tqul.pwfze.js +0 -1
  163. package/.next/static/chunks/0pez9k2q~8lom.js +0 -1
  164. package/.next/static/chunks/1034h4copyi13.js +0 -1
  165. package/.next/static/chunks/11j_4bpiqb5on.js +0 -1
  166. package/.next/static/chunks/181v0f2l.x5_p.js +0 -1
  167. /package/.next/static/{UuR3rJNr0J0cwFZgsovkL → Gxj1QMzOqxH1St959O3yh}/_buildManifest.js +0 -0
  168. /package/.next/static/{UuR3rJNr0J0cwFZgsovkL → Gxj1QMzOqxH1St959O3yh}/_clientMiddlewareManifest.js +0 -0
  169. /package/.next/static/{UuR3rJNr0J0cwFZgsovkL → Gxj1QMzOqxH1St959O3yh}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[983869,a=>{"use strict";let b=(0,a.i(302856).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);a.s(["GitCompare",0,b],983869)},105916,418841,a=>{"use strict";let b=(0,a.i(302856).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,b],105916);var c=a.i(582812);a.s(["AlertTriangle",()=>c.default],418841)},641804,569720,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(506008),e=a.i(354994),f=a.i(418841),g=a.i(983869),h=a.i(302856);let i=(0,h.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var j=a.i(410756),k=a.i(468518),l=a.i(48300),m=a.i(857122),n=a.i(246962),o=a.i(584335);a.s(["TaskDiffView",0,function({files:a,totalAdded:h,totalRemoved:p,hasConflicts:q,conflictFiles:r,onCommit:s,hasUncommitted:t}){let{t:u}=(0,o.useI18n)(),[v,w]=(0,c.useState)(new Set),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),[B,C]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{className:"font-medium text-foreground",children:[a.length," files changed"]}),(0,b.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",h]}),(0,b.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",p]})]}),(0,b.jsx)("div",{className:"flex items-center gap-2",children:t&&s&&(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>y(!0),className:"gap-2",children:[(0,b.jsx)(i,{className:"h-4 w-4"}),u("diff.commit")]})})]}),q&&(0,b.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,b.jsx)(f.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,b.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",r.length," conflicting file",1!==r.length?"s":""]})]}),(0,b.jsx)("ul",{className:"ml-6 space-y-1",children:r.map(a=>(0,b.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:0===a.length?(0,b.jsx)(k.EmptyState,{icon:g.GitCompare,title:u("diff.noChanges"),className:"h-full"}):(0,b.jsx)("div",{className:"divide-y divide-border",children:a.map(a=>{let c=v.has(a.filename);return(0,b.jsxs)("div",{children:[(0,b.jsxs)(j.Button,{variant:"ghost",type:"button",onClick:()=>{var b;return b=a.filename,void w(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[c?(0,b.jsx)(e.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,b.jsx)(d.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,b.jsx)(l.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,b.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),c&&a.patch&&(0,b.jsx)("div",{className:"border-t border-border bg-background",children:(0,b.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:a.patch.split("\n").map((a,c)=>{let d=a.startsWith("+")&&!a.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":a.startsWith("-")&&!a.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":a.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,b.jsx)("span",{className:d,children:a||" "},c)})})})]},a.filename)})})}),(0,b.jsx)(m.Dialog,{open:x,onOpenChange:y,children:(0,b.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:u("diff.commitChanges")})}),(0,b.jsx)("div",{className:"flex flex-col gap-3",children:(0,b.jsx)(n.Textarea,{value:z,onChange:a=>A(a.target.value),placeholder:u("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"ghost",onClick:()=>y(!1),children:u("common.cancel")}),(0,b.jsx)(j.Button,{onClick:async()=>{if(z.trim()&&s){C(!0);try{await s(z.trim()),A(""),y(!1)}finally{C(!1)}}},disabled:!z.trim()||B,children:B?"...":u("diff.commit")})]})]})})]})}],641804);var p=a.i(448287);let q=(0,h.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var r=a.i(109434);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:d,taskId:e,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:k=[],onMergeComplete:l}){let n=(0,p.useRouter)(),[o,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=async()=>{s(!0),u(null);try{let a=await fetch(`/api/tasks/${e}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){d(!1),l(),n.refresh();return}let b=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?u(`Merge conflicts detected: ${Array.isArray(b.conflictFiles)?b.conflictFiles.join(", "):"unknown files"}`):u(b.error??"Merge failed")}catch{u("Network error — merge failed")}finally{s(!1)}};return(0,b.jsx)(m.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(q,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,b.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),k.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:k.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),t&&(0,b.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,b.jsx)("p",{className:"text-xs text-red-400",children:t})})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"}),(0,b.jsx)(j.Button,{onClick:v,disabled:o,className:"gap-2",children:o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],569720)},460143,a=>{"use strict";let b=(0,a.i(302856).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);a.s(["ArrowUpFromLine",0,b],460143)},929526,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(61966),e=a.i(354994),f=a.i(410215),g=a.i(858967),h=a.i(109434),i=a.i(857122),j=a.i(410756),k=a.i(620235),l=a.i(246962),m=a.i(584335);a.s(["CreateBranchDialog",0,function({open:a,onOpenChange:n,branches:o,currentBranch:p,localPath:q,onCreated:r,onError:s}){let{t}=(0,m.useI18n)(),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(p),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(v(""),x(p),z(""),D(""))},[a,p]);let G=[...new Set(o)].filter(a=>a.toLowerCase().includes(C.toLowerCase())),H=async()=>{if(u.trim()){B(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:q,branch:u.trim(),baseBranch:w})});if(a.ok)n(!1),r();else{let b=await a.json();s(b.error||"Unknown error")}}catch{s("Network error")}finally{B(!1)}}};return(0,b.jsx)(i.Dialog,{open:a,onOpenChange:n,children:(0,b.jsxs)(i.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(i.DialogHeader,{children:(0,b.jsx)(i.DialogTitle,{children:t("git.createBranch")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchName")}),(0,b.jsx)(k.Input,{value:u,onChange:a=>v(a.target.value),placeholder:t("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&H()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>F(!E),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,b.jsx)("span",{className:"font-mono text-xs text-foreground",children:w})]}),(0,b.jsx)(e.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&(0,b.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(f.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:C,onChange:a=>D(a.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,b.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:G.map(a=>(0,b.jsxs)("button",{onClick:()=>{x(a),F(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",children:a}),a===w&&(0,b.jsx)(g.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},a))})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchDesc")}),(0,b.jsx)(l.Textarea,{value:y,onChange:a=>z(a.target.value),placeholder:t("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(i.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>n(!1),children:t("common.cancel")}),(0,b.jsxs)(j.Button,{onClick:H,disabled:!u.trim()||A,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[A?(0,b.jsx)(h.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,t("common.create")]})]})]})})}])},820838,a=>{"use strict";async function b(a,c,d={}){let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:c,path:a,...d})});if(!e.ok)throw Error((await e.json()).error||`${c} failed`);return e.json()}a.s(["gitAction",0,b])},627183,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60a4ba34f60e290ae4231c1a5d2200c6665025e6b0",b.callServer,void 0,b.findSourceMapURL,"updateProject");a.s(["updateProject",0,c])},658437,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("4096ff3c2eb9b14c7722d91462a22aa3eddc0efb50",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,c])},218074,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("4063918367cd563e2058c622e701bbbe48352b8284",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},359959,607602,913363,536453,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("603e8da543b13fd18b235538edb812db23819cc7a1",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],359959);let d=(0,b.createServerReference)("407b9e94f9c79be134a77d9ce4c0b0a15b4261a88d",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],607602);let e=(0,b.createServerReference)("60acc3d390a48cd5616f27d78cf43022df7960feba",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],913363);let f=(0,a.i(302856).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,f],536453)},272932,a=>{"use strict";let b=(0,a.i(302856).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);a.s(["Lightbulb",0,b],272932)},884284,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(354994),e=a.i(413857),f=a.i(57726),g=a.i(891903),h=a.i(109434),i=a.i(536453),j=a.i(236345),k=a.i(595313),l=a.i(272932);let m=(0,a.i(302856).default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var n=a.i(410756),o=a.i(468518),p=a.i(584335);function q({status:a}){switch(a){case"COMPLETED":return(0,b.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,b.jsx)(g.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,b.jsx)(h.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,b.jsx)(i.Clock,{className:"h-4 w-4 text-neutral-500"})}}a.s(["ExecutionTimeline",0,function({executions:a,onResume:f,onContinueLatest:g}){let{t:h,locale:i}=(0,p.useI18n)(),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null);return 0===a.length?(0,b.jsx)(o.EmptyState,{icon:m,title:h("execution.noHistory")}):(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:h("execution.history")}),a.map(c=>{let m=function(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}(c.gitStats??null),o=function(a,b){if(!a||!b)return"";let c=new Date(b).getTime()-new Date(a).getTime();if(c<0)return"";let d=Math.floor(c/1e3);if(d<60)return`${d}s`;let e=Math.floor(d/60);if(e<60)return`${e}m ${d%60}s`;let f=Math.floor(e/60);return`${f}h ${e%60}m`}(c.startedAt??null,c.endedAt??null),p=r===c.id;return(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,b.jsxs)("div",{className:"p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)(q,{status:c.status}),(0,b.jsx)("span",{className:`font-medium ${function(a){switch(a){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(c.status)}`,children:function(a,b){switch(a){case"COMPLETED":return b("execution.success");case"FAILED":return b("execution.failed");case"RUNNING":return b("execution.running");default:return a}}(c.status,h)}),(0,b.jsx)("span",{className:"text-muted-foreground",children:function(a,b="zh"){if(!a)return"";let c=new Date(a),d=Math.floor((new Date().getTime()-c.getTime())/864e5),e="zh"===b?"zh-CN":"en-US",f=c.toLocaleTimeString(e,{hour:"2-digit",minute:"2-digit"});return 0===d?f:1===d?"zh"===b?`昨天 ${f}`:`Yesterday ${f}`:d<7?"zh"===b?`${d}天前 ${f}`:`${d}d ago ${f}`:c.toLocaleDateString(e,{month:"2-digit",day:"2-digit"})+" "+f}(c.startedAt??null,i)}),o&&(0,b.jsxs)("span",{className:"text-muted-foreground/60",children:["(",o,")"]})]}),(0,b.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:c.summary||h("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,b.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,b.jsxs)("span",{children:[m.commits," ",h("execution.commits")]}):null,m.filesChanged?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:[m.filesChanged," ",h("execution.files")]})]}):null,m.insertions||m.deletions?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),m.insertions?(0,b.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,b.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),c.insightNote&&(0,b.jsxs)("div",{className:"mt-2",children:[(0,b.jsxs)("button",{onClick:()=>u(t===c.id?null:c.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,b.jsx)(l.Lightbulb,{className:"h-3.5 w-3.5"}),(0,b.jsxs)("span",{className:"font-medium",children:[h("execution.insight"),":"]}),(0,b.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:c.insightNote.title}),t===c.id?(0,b.jsx)(e.ChevronUp,{className:"h-3 w-3"}):(0,b.jsx)(d.ChevronDown,{className:"h-3 w-3"})]}),t===c.id&&(0,b.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:c.insightNote.content})]}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[c.sessionId&&f?(0,b.jsxs)(n.Button,{size:"sm",onClick:()=>f(c.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(j.PlayCircle,{className:"h-3.5 w-3.5"}),h("execution.resume")]}):!c.sessionId&&"FAILED"===c.status&&c.id===a[0]?.id&&g?(0,b.jsxs)(n.Button,{size:"sm",onClick:g,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,b.jsx)(k.RotateCcw,{className:"h-3.5 w-3.5"}),h("execution.tryRecover")]}):null,(0,b.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>s(p?null:c.id),className:"bg-muted text-muted-foreground",children:[p?(0,b.jsx)(e.ChevronUp,{className:"h-3.5 w-3.5"}):(0,b.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5"}),p?h("execution.collapse"):h("execution.details")]})]})]}),p&&(0,b.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[c.gitLog&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.gitLog")}),(0,b.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:c.gitLog.split("\n").slice(0,3).join("\n")})]}),c.terminalLog&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.terminalOutput")}),(0,b.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:c.terminalLog})]}),"FAILED"===c.status&&null!=c.exitCode&&(0,b.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",c.exitCode]})]})]},c.id)})]})}],884284)}];
1
+ module.exports=[983869,a=>{"use strict";let b=(0,a.i(302856).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);a.s(["GitCompare",0,b],983869)},105916,418841,a=>{"use strict";let b=(0,a.i(302856).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,b],105916);var c=a.i(582812);a.s(["AlertTriangle",()=>c.default],418841)},641804,569720,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(506008),e=a.i(354994),f=a.i(418841),g=a.i(983869),h=a.i(302856);let i=(0,h.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);var j=a.i(410756),k=a.i(468518),l=a.i(48300),m=a.i(857122),n=a.i(246962),o=a.i(584335);a.s(["TaskDiffView",0,function({files:a,totalAdded:h,totalRemoved:p,hasConflicts:q,conflictFiles:r,onCommit:s,hasUncommitted:t}){let{t:u}=(0,o.useI18n)(),[v,w]=(0,c.useState)(new Set),[x,y]=(0,c.useState)(!1),[z,A]=(0,c.useState)(""),[B,C]=(0,c.useState)(!1);return(0,b.jsxs)("div",{className:"flex flex-col h-full",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{className:"font-medium text-foreground",children:[a.length," files changed"]}),(0,b.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",h]}),(0,b.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",p]})]}),(0,b.jsx)("div",{className:"flex items-center gap-2",children:t&&s&&(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>y(!0),className:"gap-2",children:[(0,b.jsx)(i,{className:"h-4 w-4"}),u("diff.commit")]})})]}),q&&(0,b.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,b.jsx)(f.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,b.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",r.length," conflicting file",1!==r.length?"s":""]})]}),(0,b.jsx)("ul",{className:"ml-6 space-y-1",children:r.map(a=>(0,b.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:0===a.length?(0,b.jsx)(k.EmptyState,{icon:g.GitCompare,title:u("diff.noChanges"),className:"h-full"}):(0,b.jsx)("div",{className:"divide-y divide-border",children:a.map(a=>{let c=v.has(a.filename);return(0,b.jsxs)("div",{children:[(0,b.jsxs)(j.Button,{variant:"ghost",type:"button",onClick:()=>{var b;return b=a.filename,void w(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[c?(0,b.jsx)(e.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,b.jsx)(d.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,b.jsx)(l.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:"Binary"}):(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,b.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),c&&a.patch&&(0,b.jsx)("div",{className:"border-t border-border bg-background",children:(0,b.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:a.patch.split("\n").map((a,c)=>{let d=a.startsWith("+")&&!a.startsWith("+++")?"px-4 block bg-green-500/10 text-green-400":a.startsWith("-")&&!a.startsWith("---")?"px-4 block bg-red-500/10 text-red-400":a.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,b.jsx)("span",{className:d,children:a||" "},c)})})})]},a.filename)})})}),(0,b.jsx)(m.Dialog,{open:x,onOpenChange:y,children:(0,b.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:u("diff.commitChanges")})}),(0,b.jsx)("div",{className:"flex flex-col gap-3",children:(0,b.jsx)(n.Textarea,{value:z,onChange:a=>A(a.target.value),placeholder:u("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"ghost",onClick:()=>y(!1),children:u("common.cancel")}),(0,b.jsx)(j.Button,{onClick:async()=>{if(z.trim()&&s){C(!0);try{await s(z.trim()),A(""),y(!1)}finally{C(!1)}}},disabled:!z.trim()||B,children:B?"...":u("diff.commit")})]})]})})]})}],641804);var p=a.i(448287);let q=(0,h.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var r=a.i(109434);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:d,taskId:e,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:k=[],onMergeComplete:l}){let n=(0,p.useRouter)(),[o,s]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),v=async()=>{s(!0),u(null);try{let a=await fetch(`/api/tasks/${e}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){d(!1),l(),n.refresh();return}let b=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?u(`Merge conflicts detected: ${Array.isArray(b.conflictFiles)?b.conflictFiles.join(", "):"unknown files"}`):u(b.error??"Merge failed")}catch{u("Network error — merge failed")}finally{s(!1)}};return(0,b.jsx)(m.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(q,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,b.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),k.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:k.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),t&&(0,b.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,b.jsx)("p",{className:"text-xs text-red-400",children:t})})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>d(!1),disabled:o,children:"Cancel"}),(0,b.jsx)(j.Button,{onClick:v,disabled:o,className:"gap-2",children:o?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(q,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],569720)},460143,a=>{"use strict";let b=(0,a.i(302856).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);a.s(["ArrowUpFromLine",0,b],460143)},929526,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(61966),e=a.i(354994),f=a.i(410215),g=a.i(858967),h=a.i(109434),i=a.i(857122),j=a.i(410756),k=a.i(620235),l=a.i(246962),m=a.i(584335);a.s(["CreateBranchDialog",0,function({open:a,onOpenChange:n,branches:o,currentBranch:p,localPath:q,onCreated:r,onError:s}){let{t}=(0,m.useI18n)(),[u,v]=(0,c.useState)(""),[w,x]=(0,c.useState)(p),[y,z]=(0,c.useState)(""),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)(""),[E,F]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(v(""),x(p),z(""),D(""))},[a,p]);let G=[...new Set(o)].filter(a=>a.toLowerCase().includes(C.toLowerCase())),H=async()=>{if(u.trim()){B(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:q,branch:u.trim(),baseBranch:w})});if(a.ok)n(!1),r();else{let b=await a.json();s(b.error||"Unknown error")}}catch{s("Network error")}finally{B(!1)}}};return(0,b.jsx)(i.Dialog,{open:a,onOpenChange:n,children:(0,b.jsxs)(i.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(i.DialogHeader,{children:(0,b.jsx)(i.DialogTitle,{children:t("git.createBranch")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchName")}),(0,b.jsx)(k.Input,{value:u,onChange:a=>v(a.target.value),placeholder:t("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&H()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>F(!E),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 text-emerald-400"}),(0,b.jsx)("span",{className:"font-mono text-xs text-foreground",children:w})]}),(0,b.jsx)(e.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${E?"rotate-180":""}`})]}),E&&(0,b.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(f.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:C,onChange:a=>D(a.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,b.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:G.map(a=>(0,b.jsxs)("button",{onClick:()=>{x(a),F(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(d.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",children:a}),a===w&&(0,b.jsx)(g.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},a))})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:t("git.branchDesc")}),(0,b.jsx)(l.Textarea,{value:y,onChange:a=>z(a.target.value),placeholder:t("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(i.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>n(!1),children:t("common.cancel")}),(0,b.jsxs)(j.Button,{onClick:H,disabled:!u.trim()||A,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[A?(0,b.jsx)(h.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,t("common.create")]})]})]})})}])},820838,a=>{"use strict";async function b(a,c,d={}){let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:c,path:a,...d})});if(!e.ok)throw Error((await e.json()).error||`${c} failed`);return e.json()}a.s(["gitAction",0,b])},736935,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60d9e69cf34902e6c9b1b76bf703b2feeee2aa4321",b.callServer,void 0,b.findSourceMapURL,"updateProject");a.s(["updateProject",0,c])},750317,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("406378b9a6edd3895485b7719c17ade259a85ed858",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,c])},853221,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("403af063e2dc8ef292c7d4742fc95a74a8066a7540",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},324514,944272,742160,536453,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("60f806cf24847a062289b6b7b3be473dc393683eab",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],324514);let d=(0,b.createServerReference)("40d1b0a6f9d0b9fe3ef53ab8dccb59ce3880e400f4",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],944272);let e=(0,b.createServerReference)("6027bff7a3efa53d1bde748d880572ab57ae3a1968",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],742160);let f=(0,a.i(302856).default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,f],536453)},272932,a=>{"use strict";let b=(0,a.i(302856).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);a.s(["Lightbulb",0,b],272932)},884284,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(354994),e=a.i(413857),f=a.i(57726),g=a.i(891903),h=a.i(109434),i=a.i(536453),j=a.i(236345),k=a.i(595313),l=a.i(272932);let m=(0,a.i(302856).default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);var n=a.i(410756),o=a.i(468518),p=a.i(584335);function q({status:a}){switch(a){case"COMPLETED":return(0,b.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,b.jsx)(g.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,b.jsx)(h.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,b.jsx)(i.Clock,{className:"h-4 w-4 text-neutral-500"})}}a.s(["ExecutionTimeline",0,function({executions:a,onResume:f,onContinueLatest:g}){let{t:h,locale:i}=(0,p.useI18n)(),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null);return 0===a.length?(0,b.jsx)(o.EmptyState,{icon:m,title:h("execution.noHistory")}):(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:h("execution.history")}),a.map(c=>{let m=function(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}(c.gitStats??null),o=function(a,b){if(!a||!b)return"";let c=new Date(b).getTime()-new Date(a).getTime();if(c<0)return"";let d=Math.floor(c/1e3);if(d<60)return`${d}s`;let e=Math.floor(d/60);if(e<60)return`${e}m ${d%60}s`;let f=Math.floor(e/60);return`${f}h ${e%60}m`}(c.startedAt??null,c.endedAt??null),p=r===c.id;return(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,b.jsxs)("div",{className:"p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)(q,{status:c.status}),(0,b.jsx)("span",{className:`font-medium ${function(a){switch(a){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(c.status)}`,children:function(a,b){switch(a){case"COMPLETED":return b("execution.success");case"FAILED":return b("execution.failed");case"RUNNING":return b("execution.running");default:return a}}(c.status,h)}),(0,b.jsx)("span",{className:"text-muted-foreground",children:function(a,b="zh"){if(!a)return"";let c=new Date(a),d=Math.floor((new Date().getTime()-c.getTime())/864e5),e="zh"===b?"zh-CN":"en-US",f=c.toLocaleTimeString(e,{hour:"2-digit",minute:"2-digit"});return 0===d?f:1===d?"zh"===b?`昨天 ${f}`:`Yesterday ${f}`:d<7?"zh"===b?`${d}天前 ${f}`:`${d}d ago ${f}`:c.toLocaleDateString(e,{month:"2-digit",day:"2-digit"})+" "+f}(c.startedAt??null,i)}),o&&(0,b.jsxs)("span",{className:"text-muted-foreground/60",children:["(",o,")"]})]}),(0,b.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:c.summary||h("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,b.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,b.jsxs)("span",{children:[m.commits," ",h("execution.commits")]}):null,m.filesChanged?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:[m.filesChanged," ",h("execution.files")]})]}):null,m.insertions||m.deletions?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),m.insertions?(0,b.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,b.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),c.insightNote&&(0,b.jsxs)("div",{className:"mt-2",children:[(0,b.jsxs)("button",{onClick:()=>u(t===c.id?null:c.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,b.jsx)(l.Lightbulb,{className:"h-3.5 w-3.5"}),(0,b.jsxs)("span",{className:"font-medium",children:[h("execution.insight"),":"]}),(0,b.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:c.insightNote.title}),t===c.id?(0,b.jsx)(e.ChevronUp,{className:"h-3 w-3"}):(0,b.jsx)(d.ChevronDown,{className:"h-3 w-3"})]}),t===c.id&&(0,b.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:c.insightNote.content})]}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[c.sessionId&&f?(0,b.jsxs)(n.Button,{size:"sm",onClick:()=>f(c.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(j.PlayCircle,{className:"h-3.5 w-3.5"}),h("execution.resume")]}):!c.sessionId&&"FAILED"===c.status&&c.id===a[0]?.id&&g?(0,b.jsxs)(n.Button,{size:"sm",onClick:g,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,b.jsx)(k.RotateCcw,{className:"h-3.5 w-3.5"}),h("execution.tryRecover")]}):null,(0,b.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>s(p?null:c.id),className:"bg-muted text-muted-foreground",children:[p?(0,b.jsx)(e.ChevronUp,{className:"h-3.5 w-3.5"}):(0,b.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5"}),p?h("execution.collapse"):h("execution.details")]})]})]}),p&&(0,b.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[c.gitLog&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.gitLog")}),(0,b.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:c.gitLog.split("\n").slice(0,3).join("\n")})]}),c.terminalLog&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.terminalOutput")}),(0,b.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:c.terminalLog})]}),"FAILED"===c.status&&null!=c.exitCode&&(0,b.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",c.exitCode]})]})]},c.id)})]})}],884284)}];
2
2
 
3
- //# sourceMappingURL=project_f_tower_0i96rjz._.js.map
3
+ //# sourceMappingURL=project_f_tower_0zqkh.-._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[201834,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("408906d4b9a19ec5401b7ff1d29490bab141bb9116",b.callServer,void 0,b.findSourceMapURL,"getConfigValues");a.s(["getConfigValues",0,c])},468518,a=>{"use strict";var b=a.i(858360),c=a.i(44585);a.s(["EmptyState",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",g),children:[a&&(0,b.jsx)(a,{className:"h-10 w-10 text-muted-foreground/40"}),(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:d}),e&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e}),f&&(0,b.jsx)("div",{className:"mt-2",children:f})]})}])},48300,a=>{"use strict";var b=a.i(293785),c=a.i(256116),d=a.i(488137),e=a.i(44585);let f=(0,d.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});a.s(["Badge",0,function({className:a,variant:d="default",render:g,...h}){var i;return i={defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}},(0,c.useRenderElement)(i.defaultTagName??"div",i,i)}],48300)},512340,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("402d9346fe9d9230b99c6d4bd8b3d54549b6dfe5c1",b.callServer,void 0,b.findSourceMapURL,"stopPtyExecution");a.s(["stopPtyExecution",0,c])},343146,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("78822464cbc435f4231430fc80d9496f2c57dc5366",b.callServer,void 0,b.findSourceMapURL,"startPtyExecution");a.s(["startPtyExecution",0,c])},387633,595313,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("608df97fd6455e84d963a9b89177a86efea6cb3ead",b.callServer,void 0,b.findSourceMapURL,"resumePtyExecution");a.s(["resumePtyExecution",0,c],387633);let d=(0,a.i(302856).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);a.s(["RotateCcw",0,d],595313)},939153,a=>{"use strict";var b=a.i(879876);let c=(0,b.createServerReference)("405775ecd4197a052e7e8cab0dfccced8544076248",b.callServer,void 0,b.findSourceMapURL,"openInTerminal");a.s(["openInTerminal",0,c])}];
2
+
3
+ //# sourceMappingURL=project_f_tower_src_03-54or._.js.map
@@ -1,4 +1,4 @@
1
1
  module.exports=[643700,a=>{"use strict";var b=a.i(680889),c=a.i(832116),d=a.i(972795),e=a.i(961374),f=a.i(264572),g=a.i(6938),h=a.i(968623);class i{providers=new Map;register(a){this.providers.set(a.name,a)}get(a){return this.providers.get(a)}getAll(){return Array.from(this.providers.values())}getCliAdapter(a){return this.providers.get(a)?.cli?.adapter??null}getQueryAdapter(a,b){let c=this.providers.get(a);return c?"api"===b?c.api?.adapter??null:c.cliQuery?.adapter??null:null}getAllowedCommands(){let a=[];for(let b of this.providers.values())b.cli?.command&&a.push(b.cli.command);return a}async getAvailableProviders(){let a=[];for(let b of this.providers.values()){let c=!!b.cli&&await b.cli.adapter.isAvailable(),d=c&&b.cli?await b.cli.adapter.getVersion():null,e=!!b.api&&!!process.env[b.api.keyEnvVar],f=!!b.api&&e;a.push({name:b.name,displayName:b.displayName,cli:{available:c,version:d},api:{available:f,keyConfigured:e}})}return a}}var j=a.i(575675);let k=globalThis;if(!k.__providerRegistry){let a=new i;a.register({name:"claude",displayName:"Claude Code",agentFieldValue:"CLAUDE_CODE",cli:{command:"claude",adapter:new j.ClaudeCliAdapter},models:{cli:["sonnet","opus","haiku","claude-sonnet-4-6","claude-opus-4-6","claude-haiku-4-5-20251001"],api:[]}}),k.__providerRegistry=a}let l=k.__providerRegistry;class m extends Error{code;provider;constructor(a,b,c){super(c),this.code=a,this.provider=b,this.name="AiProviderError"}}async function n(a){return c.db.aiCapabilityConfig.findUnique({where:{slot:a}})}async function o(a){let b=await n(a),c=b?.provider??"claude",d=b?.model??void 0,e=l.get(c);if(!e)throw new m("CLI_NOT_FOUND",c,`Provider "${c}" 未注册`);let f=e.cli?.adapter;if(!f)throw new m("UNSUPPORTED_MODE",c,`Provider "${c}" 不支持 CLI 模式`);return{adapter:f,provider:e,model:d}}var p=a.i(924868),q=a.i(446786),r=a.i(814747),s=a.i(632919);let t=g.logger.create("agent-actions"),u=(0,r.join)((0,q.tmpdir)(),"tower-signals");async function v(a,b){try{await (0,p.mkdir)(u,{recursive:!0,mode:448}),await (0,p.writeFile)((0,r.join)(u,`exit-${a}`),String(b),{mode:384})}catch{}}async function w(a,b){let e=await c.db.taskMessage.create({data:{role:"USER",content:b,taskId:a}});return(0,d.revalidatePath)("/workspaces"),{userMessage:e}}async function x(a){return c.db.taskMessage.findMany({where:{taskId:a},orderBy:{createdAt:"asc"}})}async function y(a,b="CLAUDE_CODE",e,f){let g=await c.db.taskExecution.create({data:{taskId:a,agent:b,status:"RUNNING",startedAt:new Date,worktreePath:e??null,worktreeBranch:f??null}});return await c.db.task.update({where:{id:a},data:{status:"IN_PROGRESS"}}),(0,d.revalidatePath)("/workspaces"),g}async function z(a,b="FAILED"){let e=await c.db.taskExecution.update({where:{id:a},data:{status:b,endedAt:new Date}});return(0,d.revalidatePath)("/workspaces"),e}async function A(b){let{destroySession:e,getSession:f}=await a.A(585988),g=f(b),h=g?.getBuffer()??"",i=await c.db.taskExecution.findFirst({where:{taskId:b,status:"RUNNING"},orderBy:{createdAt:"desc"}}),j=await c.db.task.findUnique({where:{id:b},include:{project:{select:{localPath:!0}}}});if(e(b),i){await c.db.taskExecution.update({where:{id:i.id},data:{status:"COMPLETED",endedAt:new Date}}),await c.db.task.update({where:{id:b},data:{status:"IN_REVIEW"}});let d=i.worktreePath||j?.project?.localPath||null,{captureExecutionSummary:e}=await a.A(131993);await e(i.id,b,0,h,d)}(0,d.revalidatePath)("/workspaces")}async function B(a){return c.db.taskExecution.findMany({where:{taskId:a},orderBy:{createdAt:"desc"},include:{insightNote:{select:{id:!0,title:!0,content:!0}}}})}async function C(b,e){let g=await c.db.task.findUnique({where:{id:b},include:{project:!0}});if(!g)throw Error("Task not found");if(!g.project?.localPath)throw Error("Project has no local path configured");await c.db.taskExecution.updateMany({where:{taskId:b,status:"RUNNING",NOT:{sessionId:e}},data:{status:"FAILED",endedAt:new Date}});let i=await c.db.taskExecution.findFirst({where:{taskId:b,sessionId:e},orderBy:{createdAt:"desc"}});if(!i)throw Error("Previous execution not found");let j=i.worktreePath??g.project.localPath,k=g.subPath?(0,r.join)(j,g.subPath):j,l=await (0,h.readConfigValue)("terminal.idleTimeoutSec",180),{adapter:m}=await o("terminal"),n=m.buildEnvOverrides({taskId:b,taskTitle:g.title,apiUrl:`http://localhost:${process.env.PORT||"3000"}`,callbackUrl:i.callbackUrl??void 0}),p=await c.db.taskExecution.update({where:{id:i.id},data:{status:"RUNNING",endedAt:null}});await c.db.task.update({where:{id:b},data:{status:"IN_PROGRESS"}}),(0,d.revalidatePath)("/workspaces");let q=await (0,h.readConfigValue)("onboarding.username",""),s=m.buildSpawnArgs({taskId:b,prompt:"",cwd:k,resumeSessionId:e,extraArgs:[...q?["--append-system-prompt",`The user's name is ${q}.`]:[]],envOverrides:n}),u=/no conversation found with session id|unknown session|session .* not found/i;return(0,f.createSession)(b,s.command,s.args,k,()=>{},async d=>{await v(b,d);let f=await c.db.taskExecution.findUnique({where:{id:p.id}});if(f?.status!=="RUNNING")return;let{getSession:h}=await a.A(585988),j=h(b),k=j?.getBuffer()??"";if(0!==d&&u.test(k)){t.info("Session resume failed — retrying with fresh execution",{taskId:b,previousSessionId:e}),await c.db.taskExecution.update({where:{id:p.id},data:{status:"FAILED",endedAt:new Date}}).catch(()=>{});try{await E(b,g.title)}catch(a){t.error("Fresh execution retry also failed",a,{taskId:b})}return}await c.db.taskExecution.update({where:{id:p.id},data:{status:0===d?"COMPLETED":"FAILED",endedAt:new Date}}).catch(()=>{});let l=i.worktreePath||g.project.localPath,{captureExecutionSummary:m}=await a.A(131993);await m(p.id,b,d,k,l);let{dispatchTaskCompletionEvent:n}=await a.A(4868);await n({taskId:b,taskTitle:g.title,status:0===d?"COMPLETED":"FAILED",executionId:p.id,workspaceId:g.project.workspaceId}),0===d&&await c.db.task.update({where:{id:b},data:{status:"IN_REVIEW"}}).catch(()=>{})},s.env,void 0,1e3*l),{executionId:p.id,worktreePath:i.worktreePath??j??null}}async function D(b){let e=await c.db.task.findUnique({where:{id:b},include:{project:!0}});if(!e)throw Error("Task not found");if(!e.project?.localPath)throw Error("Project has no local path configured");let g=await c.db.taskExecution.findFirst({where:{taskId:b},orderBy:{createdAt:"desc"}}),{destroySession:i}=await a.A(585988);i(b),await c.db.taskExecution.updateMany({where:{taskId:b,status:"RUNNING"},data:{status:"FAILED",endedAt:new Date}});let j=g?.worktreePath??e.project.localPath,k=e.subPath?(0,r.join)(j,e.subPath):j,l=await (0,h.readConfigValue)("terminal.idleTimeoutSec",180),{adapter:m,provider:n}=await o("terminal"),p=m.buildEnvOverrides({taskId:b,taskTitle:e.title,apiUrl:`http://localhost:${process.env.PORT||"3000"}`}),q=await c.db.taskExecution.create({data:{taskId:b,agent:n.agentFieldValue,status:"RUNNING",startedAt:new Date,worktreePath:g?.worktreePath??null,worktreeBranch:g?.worktreeBranch??null}});await c.db.task.update({where:{id:b},data:{status:"IN_PROGRESS"}}),(0,d.revalidatePath)("/workspaces");let s=await (0,h.readConfigValue)("onboarding.username",""),t=m.buildSpawnArgs({taskId:b,prompt:"",cwd:k,continueLatest:!0,extraArgs:[...s?["--append-system-prompt",`The user's name is ${s}.`]:[]],envOverrides:p});return(0,f.createSession)(b,t.command,t.args,k,()=>{},async d=>{await v(b,d);let f=await c.db.taskExecution.findUnique({where:{id:q.id}});if(f?.status!=="RUNNING")return;let{getSession:h}=await a.A(585988),i=h(b),j=i?.getBuffer()??"";await c.db.taskExecution.update({where:{id:q.id},data:{status:0===d?"COMPLETED":"FAILED",endedAt:new Date}}).catch(()=>{});let k=g?.worktreePath||e.project.localPath,{captureExecutionSummary:l}=await a.A(131993);await l(q.id,b,d,j,k);let{dispatchTaskCompletionEvent:m}=await a.A(4868);await m({taskId:b,taskTitle:e.title,status:0===d?"COMPLETED":"FAILED",executionId:q.id,workspaceId:e.project.workspaceId}),0===d&&await c.db.task.update({where:{id:b},data:{status:"IN_REVIEW"}}).catch(()=>{})},t.env,void 0,1e3*l),{executionId:q.id,worktreePath:g?.worktreePath??j??null}}async function E(b,g,i,j){let k,l,m=await c.db.task.findUnique({where:{id:b},include:{project:!0}});if(!m)throw Error("Task not found");if(!m.project?.localPath)throw Error("Project has no local path configured");let n=await (0,h.readConfigValue)("system.maxConcurrentExecutions",20);if(await c.db.taskExecution.count({where:{status:"RUNNING"}})>=n)throw Error(`已达并发上限(${n}),请等待其他任务完成后再启动`);let s=await (0,h.readConfigValue)("terminal.idleTimeoutSec",180),{adapter:u,provider:w,model:x}=await o("terminal");await c.db.taskExecution.updateMany({where:{taskId:b,status:"RUNNING"},data:{status:"FAILED",endedAt:new Date}}),"IN_PROGRESS"!==m.status&&(await c.db.task.update({where:{id:b},data:{status:"IN_PROGRESS"}}),(0,d.revalidatePath)("/workspaces"));let y=await c.db.taskMessage.findMany({where:{taskId:b},orderBy:{createdAt:"desc"},take:10}),z=[`Task: ${m.title}`,m.description?`Description: ${m.description}`:"",y.length>0?`Recent conversation:
2
- ${y.reverse().map(a=>`${a.role}: ${a.content}`).join("\n")}`:"",g.trim()?`User message: ${g}`:""].filter(Boolean).join("\n\n"),A=i??m.promptId;if(A){let a=await c.db.agentPrompt.findUnique({where:{id:A}});a?.content&&(l=await (0,p.mkdtemp)((0,r.join)((0,q.tmpdir)(),"tower-pty-")),k=(0,r.join)(l,"instructions.md"),await (0,p.writeFile)(k,a.content,"utf-8"))}let B=null,C=null;if(m.baseBranch&&m.project.localPath){let{worktreePath:a,worktreeBranch:c}=await (0,e.createWorktree)(m.project.localPath,b,m.baseBranch);B=a,C=c}let D=B??m.project.localPath,E=m.subPath?(0,r.join)(D,m.subPath):D,F=await c.db.taskExecution.create({data:{taskId:b,agent:w.agentFieldValue,status:"RUNNING",startedAt:new Date,worktreePath:B??null,worktreeBranch:C??null,callbackUrl:j??null}});if(m.project.localPath)try{let b,{execFileSync:d}=await a.A(144264);(b=B&&m.baseBranch?d("git",["merge-base",m.baseBranch,"HEAD"],{cwd:B,encoding:"utf-8",timeout:5e3}).trim():d("git",["rev-parse","HEAD"],{cwd:m.project.localPath,encoding:"utf-8",timeout:5e3}).trim())&&await c.db.taskExecution.update({where:{id:F.id},data:{forkCommit:b}})}catch{}let G="";if(k){let{readFile:b}=await a.A(260815);G+=await b(k,"utf-8")}let H=await (0,h.readConfigValue)("onboarding.username","");H&&(G+=(G?"\n":"")+`The user's name is ${H}.`);let I=u.buildSpawnArgs({taskId:b,prompt:z,cwd:E,extraArgs:[...G?["--append-system-prompt",G]:[],...x?["--model",x]:[]],envOverrides:u.buildEnvOverrides({taskId:b,taskTitle:m.title,apiUrl:`http://localhost:${process.env.PORT||"3000"}`,callbackUrl:j??void 0})});return(0,f.createSession)(b,I.command,I.args,E,()=>{},async d=>{await v(b,d);let e=await c.db.taskExecution.findUnique({where:{id:F.id}});if(e?.status!=="RUNNING")return;let{getSession:f}=await a.A(585988),g=f(b),h=g?.getBuffer()??"";await c.db.taskExecution.update({where:{id:F.id},data:{status:0===d?"COMPLETED":"FAILED",endedAt:new Date}}).catch(a=>{t.error("Failed to update execution status",a)});let i=B||m.project.localPath,{captureExecutionSummary:j}=await a.A(131993);await j(F.id,b,d,h,i);let{dispatchTaskCompletionEvent:k}=await a.A(4868);await k({taskId:b,taskTitle:m.title,status:0===d?"COMPLETED":"FAILED",executionId:F.id,workspaceId:m.project.workspaceId}),0===d&&await c.db.task.update({where:{id:b},data:{status:"IN_REVIEW"}}).catch(a=>{t.error("Failed to update task status",a)}),l&&await (0,p.rm)(l,{recursive:!0,force:!0}).catch(()=>{})},I.env,void 0,1e3*s),{executionId:F.id,worktreePath:B??D??null}}async function F(){return(await c.db.taskExecution.findMany({where:{status:"RUNNING"},orderBy:{startedAt:"asc"},include:{task:{include:{project:{include:{workspace:!0}}}}}})).map(a=>({executionId:a.id,taskId:a.taskId,taskTitle:a.task.title,projectId:a.task.project.id,projectName:a.task.project.name,projectAlias:a.task.project.alias,projectLocalPath:a.task.project.localPath,workspaceId:a.task.project.workspace.id,workspaceName:a.task.project.workspace.name,worktreePath:a.worktreePath,startedAt:a.startedAt?.toISOString()??null}))}(0,s.ensureServerEntryExports)([w,x,y,z,A,B,C,D,E,F]),(0,b.registerServerReference)(w,"6002704f9d1116e74bcd8fab6c0fbb55b03952e4df",null),(0,b.registerServerReference)(x,"40129fd62a111749d8b35bef826bfca54222e9f910",null),(0,b.registerServerReference)(y,"78ddd4195b48c6388a9a55fe3928706c8dc3534687",null),(0,b.registerServerReference)(z,"600f42b87ee3eab910cb620c77768d58f6fef3b34b",null),(0,b.registerServerReference)(A,"40497fcd3ab1c5238a08d4cb0ce3e98c8dbde9dfbd",null),(0,b.registerServerReference)(B,"4063918367cd563e2058c622e701bbbe48352b8284",null),(0,b.registerServerReference)(C,"602709e7f331707daade8f9ffa826382f472cea8df",null),(0,b.registerServerReference)(D,"4096ff3c2eb9b14c7722d91462a22aa3eddc0efb50",null),(0,b.registerServerReference)(E,"78af7cd15573edb9bbe7295c42ae438e98dc783b26",null),(0,b.registerServerReference)(F,"00a268f3cf0427d3f86f445d5c4724f55507814b04",null),a.s(["continueLatestPtyExecution",0,D,"getActiveExecutionsAcrossWorkspaces",0,F,"getTaskExecutions",0,B,"getTaskMessages",0,x,"resumePtyExecution",0,C,"sendTaskMessage",0,w,"startPtyExecution",0,E,"startTaskExecution",0,y,"stopPtyExecution",0,A,"stopTaskExecution",0,z],643700)}];
2
+ ${y.reverse().map(a=>`${a.role}: ${a.content}`).join("\n")}`:"",g.trim()?`User message: ${g}`:""].filter(Boolean).join("\n\n"),A=i??m.promptId;if(A){let a=await c.db.agentPrompt.findUnique({where:{id:A}});a?.content&&(l=await (0,p.mkdtemp)((0,r.join)((0,q.tmpdir)(),"tower-pty-")),k=(0,r.join)(l,"instructions.md"),await (0,p.writeFile)(k,a.content,"utf-8"))}let B=null,C=null;if(m.baseBranch&&m.project.localPath){let{worktreePath:a,worktreeBranch:c}=await (0,e.createWorktree)(m.project.localPath,b,m.baseBranch);B=a,C=c}let D=B??m.project.localPath,E=m.subPath?(0,r.join)(D,m.subPath):D,F=await c.db.taskExecution.create({data:{taskId:b,agent:w.agentFieldValue,status:"RUNNING",startedAt:new Date,worktreePath:B??null,worktreeBranch:C??null,callbackUrl:j??null}});if(m.project.localPath)try{let b,{execFileSync:d}=await a.A(144264);(b=B&&m.baseBranch?d("git",["merge-base",m.baseBranch,"HEAD"],{cwd:B,encoding:"utf-8",timeout:5e3}).trim():d("git",["rev-parse","HEAD"],{cwd:m.project.localPath,encoding:"utf-8",timeout:5e3}).trim())&&await c.db.taskExecution.update({where:{id:F.id},data:{forkCommit:b}})}catch{}let G="";if(k){let{readFile:b}=await a.A(260815);G+=await b(k,"utf-8")}let H=await (0,h.readConfigValue)("onboarding.username","");H&&(G+=(G?"\n":"")+`The user's name is ${H}.`);let I=u.buildSpawnArgs({taskId:b,prompt:z,cwd:E,extraArgs:[...G?["--append-system-prompt",G]:[],...x?["--model",x]:[]],envOverrides:u.buildEnvOverrides({taskId:b,taskTitle:m.title,apiUrl:`http://localhost:${process.env.PORT||"3000"}`,callbackUrl:j??void 0})});return(0,f.createSession)(b,I.command,I.args,E,()=>{},async d=>{await v(b,d);let e=await c.db.taskExecution.findUnique({where:{id:F.id}});if(e?.status!=="RUNNING")return;let{getSession:f}=await a.A(585988),g=f(b),h=g?.getBuffer()??"";await c.db.taskExecution.update({where:{id:F.id},data:{status:0===d?"COMPLETED":"FAILED",endedAt:new Date}}).catch(a=>{t.error("Failed to update execution status",a)});let i=B||m.project.localPath,{captureExecutionSummary:j}=await a.A(131993);await j(F.id,b,d,h,i);let{dispatchTaskCompletionEvent:k}=await a.A(4868);await k({taskId:b,taskTitle:m.title,status:0===d?"COMPLETED":"FAILED",executionId:F.id,workspaceId:m.project.workspaceId}),0===d&&await c.db.task.update({where:{id:b},data:{status:"IN_REVIEW"}}).catch(a=>{t.error("Failed to update task status",a)}),l&&await (0,p.rm)(l,{recursive:!0,force:!0}).catch(()=>{})},I.env,void 0,1e3*s),{executionId:F.id,worktreePath:B??D??null}}async function F(){return(await c.db.taskExecution.findMany({where:{status:"RUNNING"},orderBy:{startedAt:"asc"},include:{task:{include:{project:{include:{workspace:!0}}}}}})).map(a=>({executionId:a.id,taskId:a.taskId,taskTitle:a.task.title,projectId:a.task.project.id,projectName:a.task.project.name,projectAlias:a.task.project.alias,projectLocalPath:a.task.project.localPath,workspaceId:a.task.project.workspace.id,workspaceName:a.task.project.workspace.name,worktreePath:a.worktreePath,startedAt:a.startedAt?.toISOString()??null}))}(0,s.ensureServerEntryExports)([w,x,y,z,A,B,C,D,E,F]),(0,b.registerServerReference)(w,"602c700dd0ccdc60aaf6e246a7ebfe9e76c9e4119e",null),(0,b.registerServerReference)(x,"40eb59865383a78eecc2cf4ae4a638f74018ddec52",null),(0,b.registerServerReference)(y,"780990f977d6dfb1b944fd45a253fb0d9207ffcb7f",null),(0,b.registerServerReference)(z,"60eed3796be17a5b593d3108ccd4f86f897d78c2c9",null),(0,b.registerServerReference)(A,"402d9346fe9d9230b99c6d4bd8b3d54549b6dfe5c1",null),(0,b.registerServerReference)(B,"403af063e2dc8ef292c7d4742fc95a74a8066a7540",null),(0,b.registerServerReference)(C,"608df97fd6455e84d963a9b89177a86efea6cb3ead",null),(0,b.registerServerReference)(D,"406378b9a6edd3895485b7719c17ade259a85ed858",null),(0,b.registerServerReference)(E,"78822464cbc435f4231430fc80d9496f2c57dc5366",null),(0,b.registerServerReference)(F,"00bedd2e911d7130dfde01bb4ad2bd6ac477ac793b",null),a.s(["continueLatestPtyExecution",0,D,"getActiveExecutionsAcrossWorkspaces",0,F,"getTaskExecutions",0,B,"getTaskMessages",0,x,"resumePtyExecution",0,C,"sendTaskMessage",0,w,"startPtyExecution",0,E,"startTaskExecution",0,y,"stopPtyExecution",0,A,"stopTaskExecution",0,z],643700)}];
3
3
 
4
4
  //# sourceMappingURL=project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[5533,a=>{"use strict";a.s([],475505),a.i(475505),a.i(913147),a.i(406135),a.i(186798),a.i(694526),a.i(26102),a.i(231387),a.i(681759),a.i(50544),a.i(685988);var b=a.i(879876);let c=(0,b.createServerReference)("6001eb003f774729f9b987f7fa8be7a12a0d3680be",b.callServer,void 0,b.findSourceMapURL,"revealInFinder");a.s(["revealInFinder",0,c],5533)}];
1
+ module.exports=[5533,a=>{"use strict";a.s([],475505),a.i(475505),a.i(648025),a.i(61639),a.i(727330),a.i(792358),a.i(638256),a.i(748024),a.i(275735),a.i(910010),a.i(652804);var b=a.i(879876);let c=(0,b.createServerReference)("60abd2562f6034ca75eac589ec6ee2d5fb516fc483",b.callServer,void 0,b.findSourceMapURL,"revealInFinder");a.s(["revealInFinder",0,c],5533)}];
2
2
 
3
3
  //# sourceMappingURL=project_f_tower_src_actions_file-actions_ts_02i742t._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[502160,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(584335),e=a.i(879876);let f=(0,e.createServerReference)("00a268f3cf0427d3f86f445d5c4724f55507814b04",e.callServer,void 0,e.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var g=a.i(976621);let h=[{id:"1x1",label:"1×1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2×1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3×2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2×2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4×2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3×3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var i=a.i(224372),j=a.i(410756),k=a.i(468518),l=a.i(302856);let m=(0,l.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var n=a.i(6244);function o({cols:a,rows:c,active:d}){let e=Array.from({length:a*c});return(0,b.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${d?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${a}, 1fr)`,gridTemplateRows:`repeat(${c}, 1fr)`},children:e.map((a,c)=>(0,b.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${d?"bg-primary":"bg-muted-foreground/40"}`},c))})}let p="custom";function q({value:a,customValue:e,onChange:f}){let{t:g}=(0,d.useI18n)(),[i,k]=(0,c.useState)(!1),l=(0,c.useRef)(null),m=a===p,r=m?null:h.find(b=>b.id===a)??h[2],[s,t]=(0,c.useState)(e?.cols??2),[u,v]=(0,c.useState)(e?.rows??2),[w,x]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,c.useEffect)(()=>{(0,n.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(a=>{x({minCols:a["missions.grid.minCols"]??1,maxCols:a["missions.grid.maxCols"]??5,minRows:a["missions.grid.minRows"]??1,maxRows:a["missions.grid.maxRows"]??5})})},[]),(0,c.useEffect)(()=>{e&&(t(e.cols),v(e.rows))},[e?.cols,e?.rows]),(0,c.useEffect)(()=>{if(i)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a);function a(a){l.current&&!l.current.contains(a.target)&&k(!1)}},[i]);let y=(a,b,c)=>Math.max(b,Math.min(c,a)),z=m?s:r?.cols??2,A=m?u:r?.rows??2,B=m?`${s}\xd7${u}`:r?.label??"";return(0,b.jsxs)("div",{ref:l,className:"relative",children:[(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>k(a=>!a),className:"gap-2",children:[(0,b.jsx)(o,{cols:z,rows:A,active:!1}),(0,b.jsx)("span",{children:B}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),i&&(0,b.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,b.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:g("missions.gridPreset")}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[h.map(c=>{let d=c.id===a;return(0,b.jsxs)("button",{onClick:()=>{f(c.id),k(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${d?"bg-primary/10":"hover:bg-accent"}`,children:[(0,b.jsx)(o,{cols:c.cols,rows:c.rows,active:d}),(0,b.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${d?"text-primary":"text-foreground"}`,children:c.label}),(0,b.jsx)("span",{className:`text-xs ${d?"text-primary/60":"text-muted-foreground"}`,children:c.desc})]},c.id)}),(0,b.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,b.jsxs)("button",{onClick:()=>{m||f(p,{cols:s,rows:u})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${m?"bg-primary/10":"hover:bg-accent"}`,children:[(0,b.jsx)(o,{cols:s,rows:u,active:m}),(0,b.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${m?"text-primary":"text-foreground"}`,children:g("missions.gridCustom")}),(0,b.jsxs)("span",{className:`text-xs ${m?"text-primary/60":"text-muted-foreground"}`,children:[s,"×",u]})]}),m&&(0,b.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:g("missions.gridCols")}),(0,b.jsx)("input",{type:"number",min:w.minCols,max:w.maxCols,value:s,onChange:a=>{let b;t(b=y(Number(a.target.value),w.minCols,w.maxCols)),f(p,{cols:b,rows:u})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:"×"}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:g("missions.gridRows")}),(0,b.jsx)("input",{type:"number",min:w.minRows,max:w.maxRows,value:u,onChange:a=>{let b;v(b=y(Number(a.target.value),w.minRows,w.maxRows)),f(p,{cols:s,rows:b})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var r=a.i(11505),s=a.i(107788),t=a.i(357089),u=a.i(448287),v=a.i(466126);let w=(0,l.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),x=(0,l.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var y=a.i(54709);let z=(0,l.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var A=a.i(95446),B=a.i(48300),C=a.i(549011),D=a.i(942308);let E=(0,t.default)(async()=>{},{loadableGenerated:{modules:[467005]},ssr:!1,loading:()=>(0,b.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function F({execution:a,isRemoving:e,removeReason:f,onStop:g,onSessionEnd:h}){let{t:i}=(0,d.useI18n)(),k=(0,u.useRouter)(),{attributes:l,listeners:m,setNodeRef:n,transform:o,transition:p}=(0,s.useSortable)({id:a.executionId}),q={transform:v.CSS.Transform.toString(o),transition:p,opacity:+!e},[r,t]=(0,c.useState)(()=>a.startedAt?Math.floor((Date.now()-new Date(a.startedAt).getTime())/1e3):0);(0,c.useEffect)(()=>{if(e)return;let b=setInterval(()=>{t(a.startedAt?Math.floor((Date.now()-new Date(a.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(b)},[a.startedAt,e]);let G=Math.floor(r/60),H=`${G}m ${r%60}s`;async function I(){if(a.projectLocalPath)try{await (0,C.openInTerminal)(a.projectLocalPath)}catch{D.toast.error(i("preview.terminalError"))}}return(0,b.jsxs)("div",{ref:n,style:q,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...l,children:[(0,b.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,b.jsx)("button",{...m,"aria-label":i("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,b.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[a.workspaceName," ›"," ",a.projectAlias||a.projectName," ›"," ",(0,b.jsx)("span",{className:"text-foreground font-semibold",children:a.taskTitle})]}),e?(0,b.jsx)(B.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===f?i("missions.statusStopped"):i("missions.statusCompleted")}):(0,b.jsx)(B.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:i("missions.statusRunning")}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:H}),a.projectLocalPath&&(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:I}),children:(0,b.jsx)(z,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.openInTerminal")})]}),(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>k.push(`/workspaces/${a.workspaceId}/tasks/${a.taskId}`)}),children:(0,b.jsx)(x,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.openFullView")})]}),(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>g(a.taskId),disabled:e}),children:(0,b.jsx)(y.X,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.stopTask")})]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,b.jsx)(E,{taskId:a.taskId,worktreePath:a.worktreePath??a.projectLocalPath,onSessionEnd:b=>h?.(a.taskId,b),useCanvasRenderer:!0})})]})}let G=(0,e.createServerReference)("409aeed388fbd0822fd35851a45232ef5f14ca8323",e.callServer,void 0,e.findSourceMapURL,"getWorkspacesWithRecentTasks"),H=(0,e.createServerReference)("4085db19f9504cf12d79ee12d86913ca1d182f58cb",e.callServer,void 0,e.findSourceMapURL,"getProjectTasks");var I=a.i(957087),J=a.i(941497),K=a.i(857122);let L=(0,l.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var M=a.i(595313),N=a.i(358440);let O={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},P={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function Q({status:a}){return(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[a]??"bg-slate-100 text-slate-600"}`,children:O[a]??a})}function R({task:a,isRunning:c,launchingId:d,onLaunchNew:e,onResume:f,t:g}){let h=a.executions?.[0]?.sessionId,i=d===a.id;return(0,b.jsxs)("div",{className:"group/task flex items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:`text-sm truncate ${c?"italic text-muted-foreground":""}`,children:a.title}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,b.jsx)(Q,{status:a.status}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:P[a.priority]??a.priority})]})]}),c?(0,b.jsx)("span",{className:"text-[10px] italic text-muted-foreground shrink-0",children:g("missions.alreadyMonitored")}):(0,b.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity shrink-0",children:[h&&(0,b.jsxs)(j.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>f(a.id,h),disabled:i,title:g("missions.continueSession"),children:[(0,b.jsx)(M.RotateCcw,{className:"h-3 w-3 mr-1"}),g("missions.continueLabel")]}),(0,b.jsxs)(j.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>e(a.id),disabled:i,title:g("missions.launchNew"),children:[(0,b.jsx)(L,{className:"h-3 w-3 mr-1"}),i?"...":g("missions.launchNewLabel")]})]})]})}function S({open:a,onOpenChange:e,onLaunchNew:f,onResume:g,runningTaskIds:h,launchingId:j}){let{t:k}=(0,d.useI18n)(),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)([]);(0,c.useEffect)(()=>{a&&(o(""),q(""),s([]),G(100).then(m).catch(()=>D.toast.error(k("missions.error.launchFailed"))))},[a,k]),(0,c.useEffect)(()=>{p?H(p).then(a=>{s(a.filter(a=>"TODO"===a.status||"IN_PROGRESS"===a.status||"IN_REVIEW"===a.status))}).catch(()=>D.toast.error(k("missions.error.launchFailed"))):s([])},[p,k]);let t=l.find(a=>a.id===n),u=t?.projects??[];return(0,b.jsx)(K.Dialog,{open:a,onOpenChange:e,children:(0,b.jsxs)(K.DialogContent,{className:"max-w-lg max-h-[70vh] flex flex-col",children:[(0,b.jsx)(K.DialogHeader,{children:(0,b.jsx)(K.DialogTitle,{children:k("missions.fullPickerTitle")})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,b.jsxs)(i.Select,{value:n,onValueChange:a=>{o(a??""),q("")},children:[(0,b.jsx)(i.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,b.jsx)("span",{className:"truncate",children:l.find(a=>a.id===n)?.name??k("missions.launcher.selectWorkspace")})}),(0,b.jsx)(i.SelectContent,{children:l.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.name},a.id))})]}),(0,b.jsxs)(i.Select,{value:p,onValueChange:a=>q(a??""),disabled:!n,children:[(0,b.jsx)(i.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,b.jsx)("span",{className:"truncate",children:u.find(a=>a.id===p)?.name??k("missions.launcher.selectProject")})}),(0,b.jsx)(i.SelectContent,{children:u.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.alias??a.name},a.id))})]})]}),(0,b.jsx)(N.ScrollArea,{className:"flex-1 min-h-0 -mx-2",children:0===r.length&&p?(0,b.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:k("missions.launcher.noTasks")}):0===r.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:k("missions.fullPickerHint")}):r.map(a=>(0,b.jsx)(R,{task:a,isRunning:h.has(a.id),launchingId:j,onLaunchNew:f,onResume:g,t:k},a.id))})]})})}function T({open:a,onOpenChange:e,onLaunched:f,runningTaskIds:g=new Set,anchorRef:h}){let{t:i}=(0,d.useI18n)(),k=(0,c.useRef)(null),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(o(!0),G(3).then(m).catch(()=>D.toast.error(i("missions.error.launchFailed"))).finally(()=>o(!1)))},[a,i]),(0,c.useEffect)(()=>{if(a)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b);function b(a){let b=a.target;if(k.current&&!k.current.contains(b)){if(h?.current&&h.current.contains(b))return;e(!1)}}},[a,e,h]);let t=(0,c.useCallback)(async a=>{try{q(a),await (0,I.startPtyExecution)(a,""),f(a),e(!1),s(!1)}catch{D.toast.error(i("missions.error.launchFailed"))}finally{q(null)}},[f,e,i]),u=(0,c.useCallback)(async(a,b)=>{try{q(a),await (0,J.resumePtyExecution)(a,b),f(a),e(!1),s(!1)}catch{D.toast.error(i("missions.error.launchFailed"))}finally{q(null)}},[f,e,i]),v=(0,c.useCallback)(()=>{e(!1),s(!0)},[e]);return a||r?(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsxs)("div",{ref:k,className:"absolute right-0 z-50 mt-1 w-96 rounded-lg border border-border bg-popover shadow-xl flex flex-col overflow-hidden",style:{maxHeight:"480px"},children:[(0,b.jsx)("div",{className:"px-3 py-2 border-b border-border shrink-0",children:(0,b.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:i("missions.pickerTitle")})}),(0,b.jsx)(N.ScrollArea,{className:"flex-1 min-h-0",children:n?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===l.length?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:i("missions.noAvailableTasks")}):l.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"sticky top-0 z-10 px-3 py-1.5 bg-popover border-b border-border/50",children:(0,b.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:a.name})}),a.projects.map(a=>0===a._count.tasks?null:(0,b.jsxs)("div",{className:"mb-1",children:[(0,b.jsx)("div",{className:"px-3 pt-2 pb-0.5",children:(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:a.alias??a.name})}),a.tasks.map(a=>(0,b.jsx)(R,{task:a,isRunning:g.has(a.id),launchingId:p,onLaunchNew:t,onResume:u,t:i},a.id))]},a.id))]},a.id))}),(0,b.jsx)("div",{className:"shrink-0 border-t border-border",children:(0,b.jsx)(j.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:v,children:i("missions.showMoreTasks")})})]}),(0,b.jsx)(S,{open:r,onOpenChange:s,onLaunchNew:t,onResume:u,runningTaskIds:g,launchingId:p})]}):null}a.s(["MissionsClient",0,function({initialExecutions:a}){let{t:e}=(0,d.useI18n)(),[l,n]=(0,c.useState)(a),[o,p]=(0,c.useState)(()=>"3x2"),[t,u]=(0,c.useState)(()=>({cols:2,rows:2})),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(""),z=(0,c.useRef)(null),[A,B]=(0,c.useState)(new Map),C=(0,c.useRef)(A);(0,c.useEffect)(()=>{C.current=A},[A]);let E=(0,c.useRef)(new Map),G=h.find(a=>a.id===o)??h[2],H="custom"===o?t.cols:G.cols,I="custom"===o?t.rows:G.rows,J=(0,c.useRef)(null),[K,L]=(0,c.useState)("480px");(0,c.useEffect)(()=>{let a=J.current;if(!a)return;let b=()=>{let b=(a.clientHeight-32-16*(I-1))/I;L(`${Math.max(b,200)}px`)};b();let c=new ResizeObserver(b);return c.observe(a),()=>c.disconnect()},[I]);let M=(0,c.useCallback)((a,b)=>{a&&(p(a),localStorage.setItem("missions-grid-preset",a),"custom"===a&&b&&(u(b),localStorage.setItem("missions-grid-custom",JSON.stringify(b))))},[]),N=(0,r.useSensors)((0,r.useSensor)(r.PointerSensor,{activationConstraint:{distance:8}})),O=(0,c.useCallback)(a=>{let{active:b,over:c}=a;c&&b.id!==c.id&&n(a=>{let d=a.findIndex(a=>a.executionId===b.id),e=a.findIndex(a=>a.executionId===c.id);return(0,s.arrayMove)(a,d,e)})},[]),P=(0,c.useCallback)((a,b)=>{if(C.current.has(a))return;B(c=>new Map([...c,[a,b]]));let c=setTimeout(()=>{n(b=>b.filter(b=>b.executionId!==a)),B(b=>{let c=new Map(b);return c.delete(a),c}),E.current.delete(a)},500);E.current.set(a,c)},[]);(0,c.useEffect)(()=>{let a=setInterval(async()=>{try{let a=await f();n(b=>{let c=C.current,{merged:d,goneIds:e}=function({prev:a,fresh:b,removingIds:c}){let d=new Set(b.map(a=>a.executionId)),e=[];a.forEach(a=>{d.has(a.executionId)||c.has(a.executionId)||e.push(a.executionId)});let f=a.filter(a=>d.has(a.executionId)||c.has(a.executionId)),g=new Set(a.map(a=>a.executionId));return{merged:[...f,...b.filter(a=>!g.has(a.executionId))],goneIds:e}}({prev:b,fresh:a,removingIds:new Set(c.keys())});return e.forEach(a=>P(a,"completed")),d})}catch{}},4e3);return()=>clearInterval(a)},[P]),(0,c.useEffect)(()=>{let a=E.current;return()=>{a.forEach(a=>clearTimeout(a))}},[]);let Q=(0,c.useCallback)(async a=>{try{await (0,g.stopPtyExecution)(a),n(b=>{let c=b.find(b=>b.taskId===a);return c&&P(c.executionId,"stopped"),b})}catch{D.toast.error(e("missions.error.stopFailed"))}},[P,e]),R=(0,c.useCallback)((a,b)=>{n(b=>{let c=b.find(b=>b.taskId===a);return c&&P(c.executionId,"completed"),b})},[P]),S=(0,c.useCallback)(a=>{f().then(a=>{n(b=>{let c=new Set(b.map(a=>a.executionId));return[...b,...a.filter(a=>!c.has(a.executionId))]})}).catch(()=>{})},[]),U=Array.from(new Map(l.map(a=>[a.workspaceId,a.workspaceName])).entries()).map(([a,b])=>({id:a,name:b})),V=x?l.filter(a=>a.workspaceId===x):l,W=new Set(l.map(a=>a.taskId));return(0,b.jsxs)("div",{className:"flex h-full flex-col",children:[(0,b.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,b.jsx)("h1",{className:"text-base font-semibold",children:e("missions.pageTitle")}),(0,b.jsxs)(i.Select,{value:x,onValueChange:a=>y(a??""),children:[(0,b.jsx)(i.SelectTrigger,{className:"w-36 h-8",children:(0,b.jsx)("span",{className:"truncate",children:x?U.find(a=>a.id===x)?.name??e("missions.filterAll"):e("missions.filterAll")})}),(0,b.jsxs)(i.SelectContent,{children:[(0,b.jsx)(i.SelectItem,{value:"",children:e("missions.filterAll")}),U.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.name},a.id))]})]}),(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsx)(q,{value:o,customValue:t,onChange:M}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(j.Button,{ref:z,onClick:()=>w(a=>!a),children:e("missions.launchTask")}),(0,b.jsx)(T,{open:v,onOpenChange:w,onLaunched:S,runningTaskIds:W,anchorRef:z})]})]}),(0,b.jsx)("div",{ref:J,className:"flex-1 overflow-auto min-h-0 p-4",children:0===V.length&&0===A.size?(0,b.jsx)(k.EmptyState,{icon:m,title:e("missions.emptyTitle"),description:e("missions.emptyDesc"),className:"h-full",action:(0,b.jsx)(j.Button,{onClick:()=>w(!0),children:e("missions.launchTask")})}):(0,b.jsx)(r.DndContext,{id:"missions-dnd",sensors:N,collisionDetection:r.closestCenter,onDragEnd:O,children:(0,b.jsx)(s.SortableContext,{items:V.map(a=>a.executionId),strategy:s.rectSortingStrategy,children:(0,b.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${H}, 1fr)`,gridAutoRows:K},children:V.map(a=>(0,b.jsx)(F,{execution:a,isRemoving:A.has(a.executionId),removeReason:A.get(a.executionId),onStop:Q,onSessionEnd:R},a.executionId))})})})})]})}],502160)}];
1
+ module.exports=[502160,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(584335),e=a.i(879876);let f=(0,e.createServerReference)("00bedd2e911d7130dfde01bb4ad2bd6ac477ac793b",e.callServer,void 0,e.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var g=a.i(512340);let h=[{id:"1x1",label:"1×1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2×1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3×2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2×2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4×2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3×3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var i=a.i(224372),j=a.i(410756),k=a.i(468518),l=a.i(302856);let m=(0,l.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var n=a.i(201834);function o({cols:a,rows:c,active:d}){let e=Array.from({length:a*c});return(0,b.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${d?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${a}, 1fr)`,gridTemplateRows:`repeat(${c}, 1fr)`},children:e.map((a,c)=>(0,b.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${d?"bg-primary":"bg-muted-foreground/40"}`},c))})}let p="custom";function q({value:a,customValue:e,onChange:f}){let{t:g}=(0,d.useI18n)(),[i,k]=(0,c.useState)(!1),l=(0,c.useRef)(null),m=a===p,r=m?null:h.find(b=>b.id===a)??h[2],[s,t]=(0,c.useState)(e?.cols??2),[u,v]=(0,c.useState)(e?.rows??2),[w,x]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,c.useEffect)(()=>{(0,n.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(a=>{x({minCols:a["missions.grid.minCols"]??1,maxCols:a["missions.grid.maxCols"]??5,minRows:a["missions.grid.minRows"]??1,maxRows:a["missions.grid.maxRows"]??5})})},[]),(0,c.useEffect)(()=>{e&&(t(e.cols),v(e.rows))},[e?.cols,e?.rows]),(0,c.useEffect)(()=>{if(i)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a);function a(a){l.current&&!l.current.contains(a.target)&&k(!1)}},[i]);let y=(a,b,c)=>Math.max(b,Math.min(c,a)),z=m?s:r?.cols??2,A=m?u:r?.rows??2,B=m?`${s}\xd7${u}`:r?.label??"";return(0,b.jsxs)("div",{ref:l,className:"relative",children:[(0,b.jsxs)(j.Button,{variant:"outline",onClick:()=>k(a=>!a),className:"gap-2",children:[(0,b.jsx)(o,{cols:z,rows:A,active:!1}),(0,b.jsx)("span",{children:B}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"▼"})]}),i&&(0,b.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,b.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:g("missions.gridPreset")}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[h.map(c=>{let d=c.id===a;return(0,b.jsxs)("button",{onClick:()=>{f(c.id),k(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${d?"bg-primary/10":"hover:bg-accent"}`,children:[(0,b.jsx)(o,{cols:c.cols,rows:c.rows,active:d}),(0,b.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${d?"text-primary":"text-foreground"}`,children:c.label}),(0,b.jsx)("span",{className:`text-xs ${d?"text-primary/60":"text-muted-foreground"}`,children:c.desc})]},c.id)}),(0,b.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,b.jsxs)("button",{onClick:()=>{m||f(p,{cols:s,rows:u})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${m?"bg-primary/10":"hover:bg-accent"}`,children:[(0,b.jsx)(o,{cols:s,rows:u,active:m}),(0,b.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${m?"text-primary":"text-foreground"}`,children:g("missions.gridCustom")}),(0,b.jsxs)("span",{className:`text-xs ${m?"text-primary/60":"text-muted-foreground"}`,children:[s,"×",u]})]}),m&&(0,b.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:g("missions.gridCols")}),(0,b.jsx)("input",{type:"number",min:w.minCols,max:w.maxCols,value:s,onChange:a=>{let b;t(b=y(Number(a.target.value),w.minCols,w.maxCols)),f(p,{cols:b,rows:u})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:"×"}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:g("missions.gridRows")}),(0,b.jsx)("input",{type:"number",min:w.minRows,max:w.maxRows,value:u,onChange:a=>{let b;v(b=y(Number(a.target.value),w.minRows,w.maxRows)),f(p,{cols:s,rows:b})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var r=a.i(11505),s=a.i(107788),t=a.i(357089),u=a.i(448287),v=a.i(466126);let w=(0,l.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),x=(0,l.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var y=a.i(54709);let z=(0,l.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var A=a.i(95446),B=a.i(48300),C=a.i(939153),D=a.i(942308);let E=(0,t.default)(async()=>{},{loadableGenerated:{modules:[467005]},ssr:!1,loading:()=>(0,b.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function F({execution:a,isRemoving:e,removeReason:f,onStop:g,onSessionEnd:h}){let{t:i}=(0,d.useI18n)(),k=(0,u.useRouter)(),{attributes:l,listeners:m,setNodeRef:n,transform:o,transition:p}=(0,s.useSortable)({id:a.executionId}),q={transform:v.CSS.Transform.toString(o),transition:p,opacity:+!e},[r,t]=(0,c.useState)(()=>a.startedAt?Math.floor((Date.now()-new Date(a.startedAt).getTime())/1e3):0);(0,c.useEffect)(()=>{if(e)return;let b=setInterval(()=>{t(a.startedAt?Math.floor((Date.now()-new Date(a.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(b)},[a.startedAt,e]);let G=Math.floor(r/60),H=`${G}m ${r%60}s`;async function I(){if(a.projectLocalPath)try{await (0,C.openInTerminal)(a.projectLocalPath)}catch{D.toast.error(i("preview.terminalError"))}}return(0,b.jsxs)("div",{ref:n,style:q,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...l,children:[(0,b.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,b.jsx)("button",{...m,"aria-label":i("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,b.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[a.workspaceName," ›"," ",a.projectAlias||a.projectName," ›"," ",(0,b.jsx)("span",{className:"text-foreground font-semibold",children:a.taskTitle})]}),e?(0,b.jsx)(B.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===f?i("missions.statusStopped"):i("missions.statusCompleted")}):(0,b.jsx)(B.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:i("missions.statusRunning")}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:H}),a.projectLocalPath&&(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:I}),children:(0,b.jsx)(z,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.openInTerminal")})]}),(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>k.push(`/workspaces/${a.workspaceId}/tasks/${a.taskId}`)}),children:(0,b.jsx)(x,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.openFullView")})]}),(0,b.jsxs)(A.Tooltip,{children:[(0,b.jsx)(A.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>g(a.taskId),disabled:e}),children:(0,b.jsx)(y.X,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(A.TooltipContent,{children:i("missions.stopTask")})]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,b.jsx)(E,{taskId:a.taskId,worktreePath:a.worktreePath??a.projectLocalPath,onSessionEnd:b=>h?.(a.taskId,b),useCanvasRenderer:!0})})]})}let G=(0,e.createServerReference)("4036852f6ccd4be5555193d353a5fd4913fb9254b4",e.callServer,void 0,e.findSourceMapURL,"getWorkspacesWithRecentTasks"),H=(0,e.createServerReference)("40dbc1a6daae52955d4262dd18b04f090ebd2011d0",e.callServer,void 0,e.findSourceMapURL,"getProjectTasks");var I=a.i(343146),J=a.i(387633),K=a.i(857122);let L=(0,l.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var M=a.i(595313),N=a.i(358440);let O={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},P={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function Q({status:a}){return(0,b.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[a]??"bg-slate-100 text-slate-600"}`,children:O[a]??a})}function R({task:a,isRunning:c,launchingId:d,onLaunchNew:e,onResume:f,t:g}){let h=a.executions?.[0]?.sessionId,i=d===a.id;return(0,b.jsxs)("div",{className:"group/task flex items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:`text-sm truncate ${c?"italic text-muted-foreground":""}`,children:a.title}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,b.jsx)(Q,{status:a.status}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:P[a.priority]??a.priority})]})]}),c?(0,b.jsx)("span",{className:"text-[10px] italic text-muted-foreground shrink-0",children:g("missions.alreadyMonitored")}):(0,b.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity shrink-0",children:[h&&(0,b.jsxs)(j.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>f(a.id,h),disabled:i,title:g("missions.continueSession"),children:[(0,b.jsx)(M.RotateCcw,{className:"h-3 w-3 mr-1"}),g("missions.continueLabel")]}),(0,b.jsxs)(j.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>e(a.id),disabled:i,title:g("missions.launchNew"),children:[(0,b.jsx)(L,{className:"h-3 w-3 mr-1"}),i?"...":g("missions.launchNewLabel")]})]})]})}function S({open:a,onOpenChange:e,onLaunchNew:f,onResume:g,runningTaskIds:h,launchingId:j}){let{t:k}=(0,d.useI18n)(),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)([]);(0,c.useEffect)(()=>{a&&(o(""),q(""),s([]),G(100).then(m).catch(()=>D.toast.error(k("missions.error.launchFailed"))))},[a,k]),(0,c.useEffect)(()=>{p?H(p).then(a=>{s(a.filter(a=>"TODO"===a.status||"IN_PROGRESS"===a.status||"IN_REVIEW"===a.status))}).catch(()=>D.toast.error(k("missions.error.launchFailed"))):s([])},[p,k]);let t=l.find(a=>a.id===n),u=t?.projects??[];return(0,b.jsx)(K.Dialog,{open:a,onOpenChange:e,children:(0,b.jsxs)(K.DialogContent,{className:"max-w-lg max-h-[70vh] flex flex-col",children:[(0,b.jsx)(K.DialogHeader,{children:(0,b.jsx)(K.DialogTitle,{children:k("missions.fullPickerTitle")})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,b.jsxs)(i.Select,{value:n,onValueChange:a=>{o(a??""),q("")},children:[(0,b.jsx)(i.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,b.jsx)("span",{className:"truncate",children:l.find(a=>a.id===n)?.name??k("missions.launcher.selectWorkspace")})}),(0,b.jsx)(i.SelectContent,{children:l.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.name},a.id))})]}),(0,b.jsxs)(i.Select,{value:p,onValueChange:a=>q(a??""),disabled:!n,children:[(0,b.jsx)(i.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,b.jsx)("span",{className:"truncate",children:u.find(a=>a.id===p)?.name??k("missions.launcher.selectProject")})}),(0,b.jsx)(i.SelectContent,{children:u.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.alias??a.name},a.id))})]})]}),(0,b.jsx)(N.ScrollArea,{className:"flex-1 min-h-0 -mx-2",children:0===r.length&&p?(0,b.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:k("missions.launcher.noTasks")}):0===r.length?(0,b.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:k("missions.fullPickerHint")}):r.map(a=>(0,b.jsx)(R,{task:a,isRunning:h.has(a.id),launchingId:j,onLaunchNew:f,onResume:g,t:k},a.id))})]})})}function T({open:a,onOpenChange:e,onLaunched:f,runningTaskIds:g=new Set,anchorRef:h}){let{t:i}=(0,d.useI18n)(),k=(0,c.useRef)(null),[l,m]=(0,c.useState)([]),[n,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(o(!0),G(3).then(m).catch(()=>D.toast.error(i("missions.error.launchFailed"))).finally(()=>o(!1)))},[a,i]),(0,c.useEffect)(()=>{if(a)return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b);function b(a){let b=a.target;if(k.current&&!k.current.contains(b)){if(h?.current&&h.current.contains(b))return;e(!1)}}},[a,e,h]);let t=(0,c.useCallback)(async a=>{try{q(a),await (0,I.startPtyExecution)(a,""),f(a),e(!1),s(!1)}catch{D.toast.error(i("missions.error.launchFailed"))}finally{q(null)}},[f,e,i]),u=(0,c.useCallback)(async(a,b)=>{try{q(a),await (0,J.resumePtyExecution)(a,b),f(a),e(!1),s(!1)}catch{D.toast.error(i("missions.error.launchFailed"))}finally{q(null)}},[f,e,i]),v=(0,c.useCallback)(()=>{e(!1),s(!0)},[e]);return a||r?(0,b.jsxs)(b.Fragment,{children:[a&&(0,b.jsxs)("div",{ref:k,className:"absolute right-0 z-50 mt-1 w-96 rounded-lg border border-border bg-popover shadow-xl flex flex-col overflow-hidden",style:{maxHeight:"480px"},children:[(0,b.jsx)("div",{className:"px-3 py-2 border-b border-border shrink-0",children:(0,b.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:i("missions.pickerTitle")})}),(0,b.jsx)(N.ScrollArea,{className:"flex-1 min-h-0",children:n?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===l.length?(0,b.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:i("missions.noAvailableTasks")}):l.map(a=>(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"sticky top-0 z-10 px-3 py-1.5 bg-popover border-b border-border/50",children:(0,b.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:a.name})}),a.projects.map(a=>0===a._count.tasks?null:(0,b.jsxs)("div",{className:"mb-1",children:[(0,b.jsx)("div",{className:"px-3 pt-2 pb-0.5",children:(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:a.alias??a.name})}),a.tasks.map(a=>(0,b.jsx)(R,{task:a,isRunning:g.has(a.id),launchingId:p,onLaunchNew:t,onResume:u,t:i},a.id))]},a.id))]},a.id))}),(0,b.jsx)("div",{className:"shrink-0 border-t border-border",children:(0,b.jsx)(j.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:v,children:i("missions.showMoreTasks")})})]}),(0,b.jsx)(S,{open:r,onOpenChange:s,onLaunchNew:t,onResume:u,runningTaskIds:g,launchingId:p})]}):null}a.s(["MissionsClient",0,function({initialExecutions:a}){let{t:e}=(0,d.useI18n)(),[l,n]=(0,c.useState)(a),[o,p]=(0,c.useState)(()=>"3x2"),[t,u]=(0,c.useState)(()=>({cols:2,rows:2})),[v,w]=(0,c.useState)(!1),[x,y]=(0,c.useState)(""),z=(0,c.useRef)(null),[A,B]=(0,c.useState)(new Map),C=(0,c.useRef)(A);(0,c.useEffect)(()=>{C.current=A},[A]);let E=(0,c.useRef)(new Map),G=h.find(a=>a.id===o)??h[2],H="custom"===o?t.cols:G.cols,I="custom"===o?t.rows:G.rows,J=(0,c.useRef)(null),[K,L]=(0,c.useState)("480px");(0,c.useEffect)(()=>{let a=J.current;if(!a)return;let b=()=>{let b=(a.clientHeight-32-16*(I-1))/I;L(`${Math.max(b,200)}px`)};b();let c=new ResizeObserver(b);return c.observe(a),()=>c.disconnect()},[I]);let M=(0,c.useCallback)((a,b)=>{a&&(p(a),localStorage.setItem("missions-grid-preset",a),"custom"===a&&b&&(u(b),localStorage.setItem("missions-grid-custom",JSON.stringify(b))))},[]),N=(0,r.useSensors)((0,r.useSensor)(r.PointerSensor,{activationConstraint:{distance:8}})),O=(0,c.useCallback)(a=>{let{active:b,over:c}=a;c&&b.id!==c.id&&n(a=>{let d=a.findIndex(a=>a.executionId===b.id),e=a.findIndex(a=>a.executionId===c.id);return(0,s.arrayMove)(a,d,e)})},[]),P=(0,c.useCallback)((a,b)=>{if(C.current.has(a))return;B(c=>new Map([...c,[a,b]]));let c=setTimeout(()=>{n(b=>b.filter(b=>b.executionId!==a)),B(b=>{let c=new Map(b);return c.delete(a),c}),E.current.delete(a)},500);E.current.set(a,c)},[]);(0,c.useEffect)(()=>{let a=setInterval(async()=>{try{let a=await f();n(b=>{let c=C.current,{merged:d,goneIds:e}=function({prev:a,fresh:b,removingIds:c}){let d=new Set(b.map(a=>a.executionId)),e=[];a.forEach(a=>{d.has(a.executionId)||c.has(a.executionId)||e.push(a.executionId)});let f=a.filter(a=>d.has(a.executionId)||c.has(a.executionId)),g=new Set(a.map(a=>a.executionId));return{merged:[...f,...b.filter(a=>!g.has(a.executionId))],goneIds:e}}({prev:b,fresh:a,removingIds:new Set(c.keys())});return e.forEach(a=>P(a,"completed")),d})}catch{}},4e3);return()=>clearInterval(a)},[P]),(0,c.useEffect)(()=>{let a=E.current;return()=>{a.forEach(a=>clearTimeout(a))}},[]);let Q=(0,c.useCallback)(async a=>{try{await (0,g.stopPtyExecution)(a),n(b=>{let c=b.find(b=>b.taskId===a);return c&&P(c.executionId,"stopped"),b})}catch{D.toast.error(e("missions.error.stopFailed"))}},[P,e]),R=(0,c.useCallback)((a,b)=>{n(b=>{let c=b.find(b=>b.taskId===a);return c&&P(c.executionId,"completed"),b})},[P]),S=(0,c.useCallback)(a=>{f().then(a=>{n(b=>{let c=new Set(b.map(a=>a.executionId));return[...b,...a.filter(a=>!c.has(a.executionId))]})}).catch(()=>{})},[]),U=Array.from(new Map(l.map(a=>[a.workspaceId,a.workspaceName])).entries()).map(([a,b])=>({id:a,name:b})),V=x?l.filter(a=>a.workspaceId===x):l,W=new Set(l.map(a=>a.taskId));return(0,b.jsxs)("div",{className:"flex h-full flex-col",children:[(0,b.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,b.jsx)("h1",{className:"text-base font-semibold",children:e("missions.pageTitle")}),(0,b.jsxs)(i.Select,{value:x,onValueChange:a=>y(a??""),children:[(0,b.jsx)(i.SelectTrigger,{className:"w-36 h-8",children:(0,b.jsx)("span",{className:"truncate",children:x?U.find(a=>a.id===x)?.name??e("missions.filterAll"):e("missions.filterAll")})}),(0,b.jsxs)(i.SelectContent,{children:[(0,b.jsx)(i.SelectItem,{value:"",children:e("missions.filterAll")}),U.map(a=>(0,b.jsx)(i.SelectItem,{value:a.id,children:a.name},a.id))]})]}),(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsx)(q,{value:o,customValue:t,onChange:M}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(j.Button,{ref:z,onClick:()=>w(a=>!a),children:e("missions.launchTask")}),(0,b.jsx)(T,{open:v,onOpenChange:w,onLaunched:S,runningTaskIds:W,anchorRef:z})]})]}),(0,b.jsx)("div",{ref:J,className:"flex-1 overflow-auto min-h-0 p-4",children:0===V.length&&0===A.size?(0,b.jsx)(k.EmptyState,{icon:m,title:e("missions.emptyTitle"),description:e("missions.emptyDesc"),className:"h-full",action:(0,b.jsx)(j.Button,{onClick:()=>w(!0),children:e("missions.launchTask")})}):(0,b.jsx)(r.DndContext,{id:"missions-dnd",sensors:N,collisionDetection:r.closestCenter,onDragEnd:O,children:(0,b.jsx)(s.SortableContext,{items:V.map(a=>a.executionId),strategy:s.rectSortingStrategy,children:(0,b.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${H}, 1fr)`,gridAutoRows:K},children:V.map(a=>(0,b.jsx)(F,{execution:a,isRemoving:A.has(a.executionId),removeReason:A.get(a.executionId),onStop:Q,onSessionEnd:R},a.executionId))})})})})]})}],502160)}];
2
2
 
3
3
  //# sourceMappingURL=project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[790201,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(448287),e=a.i(432120),f=a.i(410756),g=a.i(620235),h=a.i(845924),i=a.i(44585);function j({className:a,size:c="default",...d}){return(0,b.jsx)("div",{"data-slot":"card","data-size":c,className:(0,i.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...d})}function k({className:a,...c}){return(0,b.jsx)("div",{"data-slot":"card-content",className:(0,i.cn)("px-4 group-data-[size=sm]/card:px-3",a),...c})}var l=a.i(109434),m=a.i(858967),n=a.i(54709),o=a.i(236413),p=a.i(57726),q=a.i(891903),r=a.i(584335);function s({adapterType:a,adapterLabel:d,onResult:e}){let[g,h]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),{t:v}=(0,r.useI18n)();async function w(){if(!g){h(!0),u(null);try{let b=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:a})}),c=await b.json();u(c),e?.(c)}catch{let a={ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]};u(a),e?.(a)}finally{h(!1)}}}return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-emerald-100 dark:bg-emerald-900/30 p-2",children:(0,b.jsx)(o.Terminal,{className:"h-5 w-5 text-emerald-600 dark:text-emerald-400"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"font-semibold",children:v("settings.aiTools.cliVerification")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:v("settings.aiTools.cliVerificationDesc")})]})]}),(0,b.jsx)(j,{children:(0,b.jsxs)(k,{className:"p-6 space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{children:d&&(0,b.jsx)("p",{className:"font-medium",children:d})}),(0,b.jsx)(f.Button,{onClick:w,disabled:g,variant:"outline",children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),v("settings.aiTools.testing")]}):v("settings.aiTools.testConnection")})]}),t&&(0,b.jsxs)("div",{className:(0,i.cn)("rounded-lg border p-4 space-y-3",t.ok?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-red-50 border-red-200 dark:bg-red-950/20 dark:border-red-800"),children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[t.ok?(0,b.jsx)(p.CheckCircle2,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):(0,b.jsx)(q.XCircle,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,b.jsx)("span",{className:(0,i.cn)("text-sm font-medium",t.ok?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:v(t.ok?"settings.aiTools.testPassed":"settings.aiTools.testFailed")})]}),(0,b.jsx)("div",{className:"space-y-2",children:t.checks.map(c=>(0,b.jsxs)("div",{className:"flex items-start gap-2 text-sm",children:[c.passed?(0,b.jsx)(m.Check,{className:"h-4 w-4 text-green-500 mt-0.5 shrink-0"}):(0,b.jsx)(n.X,{className:"h-4 w-4 text-red-500 mt-0.5 shrink-0"}),(0,b.jsx)("span",{className:(0,i.cn)(c.passed?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:c.message})]},`${a}-${c.name}`))})]})]})})]})}var t=a.i(879876);let u=(0,t.createServerReference)("40f25741b725b8f8b3f2e3a6cb06f71ef80d5258ad",t.callServer,void 0,t.findSourceMapURL,"completeOnboarding");var v=a.i(35532),w=a.i(302856);let x=(0,w.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var y=a.i(61966),z=a.i(769726),A=a.i(506008),B=a.i(248763),C=a.i(470612);let D=(0,w.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),E=(0,w.default)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);var F=a.i(263973),G=a.i(569210);function H({step:a}){let c=[x,o.Terminal,y.GitBranch][a-1]??x,d=["Profile","Connect","Configure"][a-1]??"";return(0,b.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:[(0,b.jsx)("div",{className:"absolute inset-0 opacity-[0.07] text-white",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{width:"380px",height:"380px",background:"radial-gradient(circle, oklch(0.80 0.14 75 / 0.25) 0%, oklch(0.80 0.14 75 / 0.08) 45%, transparent 70%)",animation:"ob-pulse 6s ease-in-out infinite"}}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/25",style:{width:"260px",height:"260px",animation:"ob-spin 20s linear infinite"},children:(0,b.jsx)("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 h-3 w-3 rounded-full bg-amber-400",style:{boxShadow:"0 0 16px oklch(0.80 0.14 75 / 0.7)"}})}),(0,b.jsxs)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/15",style:{width:"380px",height:"380px",animation:"ob-spin 30s linear infinite reverse"},children:[(0,b.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 h-2 w-2 rounded-full bg-amber-400/70"}),(0,b.jsx)("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 h-1.5 w-1.5 rounded-full bg-amber-400/50"})]}),(0,b.jsx)("svg",{className:"absolute",style:{top:"18%",right:"22%",animation:"ob-float 8s ease-in-out infinite"},width:"44",height:"50",viewBox:"0 0 40 46",fill:"none",children:(0,b.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.4)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.06)"})}),(0,b.jsx)("svg",{className:"absolute",style:{bottom:"22%",left:"18%",animation:"ob-float 10s ease-in-out 2s infinite"},width:"32",height:"36",viewBox:"0 0 40 46",fill:"none",children:(0,b.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.3)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.05)"})}),(0,b.jsx)("div",{className:"absolute h-3.5 w-3.5 rounded-full bg-amber-400/40",style:{top:"30%",left:"28%",animation:"ob-float 7s ease-in-out 1s infinite"}}),(0,b.jsx)("div",{className:"absolute h-2.5 w-2.5 rounded-full bg-amber-400/30",style:{top:"65%",right:"30%",animation:"ob-float 9s ease-in-out 3s infinite"}}),(0,b.jsx)("div",{className:"absolute h-2 w-2 rounded-full bg-amber-400/20",style:{top:"45%",right:"15%",animation:"ob-float 6s ease-in-out 0.5s infinite"}}),(0,b.jsxs)("svg",{className:"absolute inset-0 h-full w-full text-white opacity-[0.12]",children:[(0,b.jsx)("line",{x1:"30%",y1:"25%",x2:"70%",y2:"45%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 12s linear infinite"}}),(0,b.jsx)("line",{x1:"65%",y1:"30%",x2:"35%",y2:"70%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 15s linear infinite reverse"}})]}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,b.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl border border-amber-400/35 bg-amber-500/10 backdrop-blur-sm transition-all duration-700",style:{boxShadow:"0 0 50px oklch(0.80 0.14 75 / 0.2)"},children:(0,b.jsx)(c,{className:"h-7 w-7 text-amber-400"})})}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 translate-y-12 text-center",children:(0,b.jsx)("p",{className:"text-[11px] font-medium tracking-widest uppercase text-amber-400/60",children:d})})]})}let I={host:"",ownerMatch:"*",localPathTemplate:""};a.s(["default",0,function(){let a,i,j,k=(0,d.useRouter)(),{t:l,locale:n,setLocale:p}=(0,r.useI18n)(),{theme:q,setTheme:t}=(0,e.useTheme)(),[w,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(1),[M,N]=(0,c.useState)(""),[O,P]=(0,c.useState)(null),[Q,R]=(0,c.useState)([]),[S,T]=(0,c.useState)({...I}),[U,V]=(0,c.useState)(!0),[W,X]=(0,c.useState)(0),[Y,Z]=(0,c.useState)(!1),[$,_]=(0,c.useState)(!1);(0,c.useEffect)(()=>J(!0),[]);let aa=[{value:"light",label:(0,b.jsx)(B.Sun,{className:"h-4 w-4"})},{value:"dark",label:(0,b.jsx)(C.Moon,{className:"h-4 w-4"})},{value:"system",label:(0,b.jsx)(D,{className:"h-4 w-4"})}];function ab(){L(a=>a+1)}function ac(){L(a=>Math.max(1,a-1))}async function ad(){_(!0);try{Q.length>0&&await (0,v.setConfigValue)("git.pathMappingRules",Q),await u(M.trim()),k.replace("/workspaces")}catch{_(!1)}}let ae=[{icon:x,label:l("onboarding.step1.title")},{icon:o.Terminal,label:l("onboarding.step2.title")},{icon:y.GitBranch,label:l("onboarding.step3.title")}];return(0,b.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,b.jsx)("div",{className:"hidden xl:block xl:w-3/5 border-r border-border/50 bg-[oklch(0.13_0.006_260)]",children:(0,b.jsx)(H,{step:K})}),(0,b.jsx)("div",{className:"flex w-full flex-col items-center px-8 pt-[10vh] pb-10 xl:w-2/5 xl:px-16 overflow-y-auto",children:(0,b.jsxs)("div",{className:"w-full max-w-lg space-y-6",children:[(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-8 w-8 rounded-lg"}),(0,b.jsx)("span",{className:"text-lg font-semibold tracking-tight",children:"Tower"})]}),(0,b.jsx)("div",{className:"flex items-center gap-1.5",children:ae.map((a,c)=>{let d=c+1,e=d===K,f=d<K,g=a.icon;return(0,b.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[c>0&&(0,b.jsx)("div",{className:`h-px w-4 transition-colors duration-500 ${f?"bg-primary":"bg-border"}`}),(0,b.jsxs)("div",{className:`flex items-center gap-1 shrink-0 rounded-full px-2 py-1 text-[11px] font-medium whitespace-nowrap transition-all duration-500 ${e?"bg-primary text-primary-foreground shadow-sm":f?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:[f?(0,b.jsx)(m.Check,{className:"h-3 w-3 shrink-0"}):(0,b.jsx)(g,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{children:a.label})]})]},c)})})]}),(0,b.jsxs)("div",{children:[1===K&&(0,b.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:l("onboarding.step1.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:l("onboarding.step1.desc")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"onboarding-username",className:"text-sm font-medium",children:l("onboarding.step1.usernameLabel")}),(0,b.jsx)("input",{id:"onboarding-username",type:"text",value:M,onChange:a=>N(a.target.value),placeholder:l("onboarding.step1.usernamePlaceholder"),className:"flex h-10 w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",maxLength:64,autoFocus:!0,autoComplete:"username"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(E,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("label",{className:"text-sm font-medium",children:l("settings.language")})]}),(0,b.jsx)(h.SegmentedControl,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}].map(a=>({value:a.value,label:a.label})),value:n,onChange:a=>p(a)})]}),(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(B.Sun,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("label",{className:"text-sm font-medium",children:l("settings.theme")})]}),w?(0,b.jsx)(h.SegmentedControl,{options:aa.map(a=>({value:a.value,label:a.label})),value:q??"system",onChange:a=>t(a)}):(0,b.jsx)("div",{className:"inline-flex h-8 rounded-md border border-border bg-muted p-1 gap-1 w-[120px]"})]})]}),(0,b.jsx)("div",{className:"flex justify-end pt-3",children:(0,b.jsxs)(f.Button,{onClick:ab,disabled:0===M.trim().length,className:"px-5",children:[l("onboarding.step1.next"),(0,b.jsx)(A.ChevronRight,{className:"h-4 w-4 ml-1"})]})})]}),2===K&&(0,b.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:l("onboarding.step2.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:l("onboarding.step2.desc")})]}),(0,b.jsx)(s,{adapterType:"claude_code",adapterLabel:"Claude CLI",onResult:P}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,b.jsxs)(f.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ac,children:[(0,b.jsx)(z.ChevronLeft,{className:"h-4 w-4 mr-1"}),l("onboarding.back")]}),(0,b.jsxs)(f.Button,{onClick:ab,disabled:!O?.ok,className:"px-5",children:[l("onboarding.step1.next"),(0,b.jsx)(A.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),3===K&&(0,b.jsxs)("div",{className:"space-y-5 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:l("onboarding.step3.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:l("onboarding.step3.desc")})]}),Q.length>0&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:l("onboarding.step3.added").replace("{count}",String(Q.length))}),Q.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("p",{className:"text-sm font-medium truncate",children:[a.host,(0,b.jsx)("span",{className:"text-muted-foreground",children:"*"!==a.ownerMatch?` / ${a.ownerMatch}`:""})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground font-mono truncate",children:a.localPathTemplate})]}),(0,b.jsx)(f.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>{var b;return b=a.id,void R(a=>a.filter(a=>a.id!==b))},children:(0,b.jsx)(G.Trash2,{className:"h-3.5 w-3.5"})})]},a.id))]}),U?(0,b.jsxs)("div",{className:"space-y-3 rounded-lg border border-border p-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:l("onboarding.step3.hostLabel")}),(0,b.jsx)(g.Input,{value:S.host,onChange:a=>T(b=>({...b,host:a.target.value})),placeholder:l("onboarding.step3.hostPlaceholder"),className:"h-9",autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:l("onboarding.step3.ownerLabel")}),(0,b.jsx)(g.Input,{value:S.ownerMatch,onChange:a=>T(b=>({...b,ownerMatch:a.target.value})),placeholder:l("onboarding.step3.ownerPlaceholder"),className:"h-9"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:l("onboarding.step3.pathLabel")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.Input,{value:S.localPathTemplate,onChange:a=>T(b=>({...b,localPathTemplate:a.target.value})),placeholder:l("onboarding.step3.pathPlaceholder"),className:"h-9 font-mono text-xs flex-1"}),(0,b.jsx)("button",{type:"button",onClick:()=>{Z(a=>(a||X(2),!a))},className:`shrink-0 rounded-full px-2.5 py-1 text-[11px] font-mono font-medium transition-colors ${Y?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:"{path}"})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:l(Y?"onboarding.step3.pathHintFull":"onboarding.step3.pathHintRepo")})]}),S.localPathTemplate&&(a=S.localPathTemplate.trim().replace(/\/+$/,""),i=Y?`${a}/{path}`:a,j=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:l("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1 flex-wrap",children:j.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>X(c),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${W===c?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a.label},c))}),(0,b.jsxs)("div",{className:"rounded-md bg-muted/50 px-3 py-2 space-y-1",children:[(0,b.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:j[W].url}),(0,b.jsxs)("p",{className:"font-mono text-xs",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,b.jsx)("span",{className:"text-primary",children:function(a,b){if(!a||!b)return"";let c=b.trim(),d=[],e=c.match(/^git@[^:]+:(.+)$/);if(e)d=e[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let a=new URL(c);d=decodeURIComponent(a.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!d.length)return"";let f=d[0],g=d[d.length-1],h=d.join("/");if(a.includes("{path}"))return a.replace("{path}",h).replace("{owner}",f).replace("{repo}",g).replace(/\/+$/,"");let i=a.replace("{owner}",f).replace("{repo}","").replace(/\/+$/,"");return`${i}/${g}`}(i,j[W].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[Q.length>0&&(0,b.jsx)(f.Button,{variant:"ghost",onClick:()=>V(!1),children:l("settings.config.git.cancel")}),(0,b.jsxs)(f.Button,{onClick:function(){if(!S.host.trim()||!S.localPathTemplate.trim())return;let a=S.localPathTemplate.trim().replace(/\/+$/,""),b=Y?`${a}/{path}`:a,c={id:crypto.randomUUID(),host:S.host.trim(),ownerMatch:S.ownerMatch.trim()||"*",localPathTemplate:b,priority:Q.length};R(a=>[...a,c]),T({...I}),Z(!1),V(!1)},disabled:!S.host.trim()||!S.localPathTemplate.trim(),children:[(0,b.jsx)(m.Check,{className:"h-4 w-4 mr-1"}),l("settings.config.git.save")]})]})]}):(0,b.jsxs)(f.Button,{variant:"outline",onClick:()=>{T({...I}),V(!0)},children:[(0,b.jsx)(F.Plus,{className:"h-4 w-4 mr-1"}),l("settings.config.git.addRule")]}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,b.jsxs)(f.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ac,children:[(0,b.jsx)(z.ChevronLeft,{className:"h-4 w-4 mr-1"}),l("onboarding.back")]}),(0,b.jsxs)(f.Button,{onClick:ad,disabled:$,className:"px-5",children:[l("onboarding.complete"),(0,b.jsx)(m.Check,{className:"h-4 w-4 ml-1"})]})]})]})]}),(0,b.jsx)("div",{className:"pt-6 text-xs text-muted-foreground",children:l("onboarding.stepIndicator").replace("{current}",String(K)).replace("{total}",String(3))})]})})]})}],790201)}];
1
+ module.exports=[790201,a=>{"use strict";var b=a.i(858360),c=a.i(175391),d=a.i(448287),e=a.i(432120),f=a.i(410756),g=a.i(620235),h=a.i(845924),i=a.i(44585);function j({className:a,size:c="default",...d}){return(0,b.jsx)("div",{"data-slot":"card","data-size":c,className:(0,i.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...d})}function k({className:a,...c}){return(0,b.jsx)("div",{"data-slot":"card-content",className:(0,i.cn)("px-4 group-data-[size=sm]/card:px-3",a),...c})}var l=a.i(109434),m=a.i(858967),n=a.i(54709),o=a.i(236413),p=a.i(57726),q=a.i(891903),r=a.i(584335);function s({adapterType:a,adapterLabel:d,onResult:e}){let[g,h]=(0,c.useState)(!1),[t,u]=(0,c.useState)(null),{t:v}=(0,r.useI18n)();async function w(){if(!g){h(!0),u(null);try{let b=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:a})}),c=await b.json();u(c),e?.(c)}catch{let a={ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]};u(a),e?.(a)}finally{h(!1)}}}return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("div",{className:"rounded-lg bg-emerald-100 dark:bg-emerald-900/30 p-2",children:(0,b.jsx)(o.Terminal,{className:"h-5 w-5 text-emerald-600 dark:text-emerald-400"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"font-semibold",children:v("settings.aiTools.cliVerification")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:v("settings.aiTools.cliVerificationDesc")})]})]}),(0,b.jsx)(j,{children:(0,b.jsxs)(k,{className:"p-6 space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{children:d&&(0,b.jsx)("p",{className:"font-medium",children:d})}),(0,b.jsx)(f.Button,{onClick:w,disabled:g,variant:"outline",children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),v("settings.aiTools.testing")]}):v("settings.aiTools.testConnection")})]}),t&&(0,b.jsxs)("div",{className:(0,i.cn)("rounded-lg border p-4 space-y-3",t.ok?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-red-50 border-red-200 dark:bg-red-950/20 dark:border-red-800"),children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[t.ok?(0,b.jsx)(p.CheckCircle2,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):(0,b.jsx)(q.XCircle,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,b.jsx)("span",{className:(0,i.cn)("text-sm font-medium",t.ok?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:v(t.ok?"settings.aiTools.testPassed":"settings.aiTools.testFailed")})]}),(0,b.jsx)("div",{className:"space-y-2",children:t.checks.map(c=>(0,b.jsxs)("div",{className:"flex items-start gap-2 text-sm",children:[c.passed?(0,b.jsx)(m.Check,{className:"h-4 w-4 text-green-500 mt-0.5 shrink-0"}):(0,b.jsx)(n.X,{className:"h-4 w-4 text-red-500 mt-0.5 shrink-0"}),(0,b.jsx)("span",{className:(0,i.cn)(c.passed?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:c.message})]},`${a}-${c.name}`))})]})]})})]})}var t=a.i(879876);let u=(0,t.createServerReference)("40dd38e040cf8559ac131983482f47e49183b3ed40",t.callServer,void 0,t.findSourceMapURL,"completeOnboarding");var v=a.i(484802),w=a.i(302856);let x=(0,w.default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var y=a.i(61966),z=a.i(769726),A=a.i(506008),B=a.i(248763),C=a.i(470612);let D=(0,w.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),E=(0,w.default)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);var F=a.i(263973),G=a.i(569210);function H({step:a}){let c=[x,o.Terminal,y.GitBranch][a-1]??x,d=["Profile","Connect","Configure"][a-1]??"";return(0,b.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:[(0,b.jsx)("div",{className:"absolute inset-0 opacity-[0.07] text-white",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{width:"380px",height:"380px",background:"radial-gradient(circle, oklch(0.80 0.14 75 / 0.25) 0%, oklch(0.80 0.14 75 / 0.08) 45%, transparent 70%)",animation:"ob-pulse 6s ease-in-out infinite"}}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/25",style:{width:"260px",height:"260px",animation:"ob-spin 20s linear infinite"},children:(0,b.jsx)("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 h-3 w-3 rounded-full bg-amber-400",style:{boxShadow:"0 0 16px oklch(0.80 0.14 75 / 0.7)"}})}),(0,b.jsxs)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/15",style:{width:"380px",height:"380px",animation:"ob-spin 30s linear infinite reverse"},children:[(0,b.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 h-2 w-2 rounded-full bg-amber-400/70"}),(0,b.jsx)("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 h-1.5 w-1.5 rounded-full bg-amber-400/50"})]}),(0,b.jsx)("svg",{className:"absolute",style:{top:"18%",right:"22%",animation:"ob-float 8s ease-in-out infinite"},width:"44",height:"50",viewBox:"0 0 40 46",fill:"none",children:(0,b.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.4)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.06)"})}),(0,b.jsx)("svg",{className:"absolute",style:{bottom:"22%",left:"18%",animation:"ob-float 10s ease-in-out 2s infinite"},width:"32",height:"36",viewBox:"0 0 40 46",fill:"none",children:(0,b.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.3)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.05)"})}),(0,b.jsx)("div",{className:"absolute h-3.5 w-3.5 rounded-full bg-amber-400/40",style:{top:"30%",left:"28%",animation:"ob-float 7s ease-in-out 1s infinite"}}),(0,b.jsx)("div",{className:"absolute h-2.5 w-2.5 rounded-full bg-amber-400/30",style:{top:"65%",right:"30%",animation:"ob-float 9s ease-in-out 3s infinite"}}),(0,b.jsx)("div",{className:"absolute h-2 w-2 rounded-full bg-amber-400/20",style:{top:"45%",right:"15%",animation:"ob-float 6s ease-in-out 0.5s infinite"}}),(0,b.jsxs)("svg",{className:"absolute inset-0 h-full w-full text-white opacity-[0.12]",children:[(0,b.jsx)("line",{x1:"30%",y1:"25%",x2:"70%",y2:"45%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 12s linear infinite"}}),(0,b.jsx)("line",{x1:"65%",y1:"30%",x2:"35%",y2:"70%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 15s linear infinite reverse"}})]}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,b.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl border border-amber-400/35 bg-amber-500/10 backdrop-blur-sm transition-all duration-700",style:{boxShadow:"0 0 50px oklch(0.80 0.14 75 / 0.2)"},children:(0,b.jsx)(c,{className:"h-7 w-7 text-amber-400"})})}),(0,b.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 translate-y-12 text-center",children:(0,b.jsx)("p",{className:"text-[11px] font-medium tracking-widest uppercase text-amber-400/60",children:d})})]})}let I={host:"",ownerMatch:"*",localPathTemplate:""};a.s(["default",0,function(){let a,i,j,k=(0,d.useRouter)(),{t:l,locale:n,setLocale:p}=(0,r.useI18n)(),{theme:q,setTheme:t}=(0,e.useTheme)(),[w,J]=(0,c.useState)(!1),[K,L]=(0,c.useState)(1),[M,N]=(0,c.useState)(""),[O,P]=(0,c.useState)(null),[Q,R]=(0,c.useState)([]),[S,T]=(0,c.useState)({...I}),[U,V]=(0,c.useState)(!0),[W,X]=(0,c.useState)(0),[Y,Z]=(0,c.useState)(!1),[$,_]=(0,c.useState)(!1);(0,c.useEffect)(()=>J(!0),[]);let aa=[{value:"light",label:(0,b.jsx)(B.Sun,{className:"h-4 w-4"})},{value:"dark",label:(0,b.jsx)(C.Moon,{className:"h-4 w-4"})},{value:"system",label:(0,b.jsx)(D,{className:"h-4 w-4"})}];function ab(){L(a=>a+1)}function ac(){L(a=>Math.max(1,a-1))}async function ad(){_(!0);try{Q.length>0&&await (0,v.setConfigValue)("git.pathMappingRules",Q),await u(M.trim()),k.replace("/workspaces")}catch{_(!1)}}let ae=[{icon:x,label:l("onboarding.step1.title")},{icon:o.Terminal,label:l("onboarding.step2.title")},{icon:y.GitBranch,label:l("onboarding.step3.title")}];return(0,b.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,b.jsx)("div",{className:"hidden xl:block xl:w-3/5 border-r border-border/50 bg-[oklch(0.13_0.006_260)]",children:(0,b.jsx)(H,{step:K})}),(0,b.jsx)("div",{className:"flex w-full flex-col items-center px-8 pt-[10vh] pb-10 xl:w-2/5 xl:px-16 overflow-y-auto",children:(0,b.jsxs)("div",{className:"w-full max-w-lg space-y-6",children:[(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-8 w-8 rounded-lg"}),(0,b.jsx)("span",{className:"text-lg font-semibold tracking-tight",children:"Tower"})]}),(0,b.jsx)("div",{className:"flex items-center gap-1.5",children:ae.map((a,c)=>{let d=c+1,e=d===K,f=d<K,g=a.icon;return(0,b.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[c>0&&(0,b.jsx)("div",{className:`h-px w-4 transition-colors duration-500 ${f?"bg-primary":"bg-border"}`}),(0,b.jsxs)("div",{className:`flex items-center gap-1 shrink-0 rounded-full px-2 py-1 text-[11px] font-medium whitespace-nowrap transition-all duration-500 ${e?"bg-primary text-primary-foreground shadow-sm":f?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:[f?(0,b.jsx)(m.Check,{className:"h-3 w-3 shrink-0"}):(0,b.jsx)(g,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{children:a.label})]})]},c)})})]}),(0,b.jsxs)("div",{children:[1===K&&(0,b.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:l("onboarding.step1.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:l("onboarding.step1.desc")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{htmlFor:"onboarding-username",className:"text-sm font-medium",children:l("onboarding.step1.usernameLabel")}),(0,b.jsx)("input",{id:"onboarding-username",type:"text",value:M,onChange:a=>N(a.target.value),placeholder:l("onboarding.step1.usernamePlaceholder"),className:"flex h-10 w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",maxLength:64,autoFocus:!0,autoComplete:"username"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(E,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("label",{className:"text-sm font-medium",children:l("settings.language")})]}),(0,b.jsx)(h.SegmentedControl,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}].map(a=>({value:a.value,label:a.label})),value:n,onChange:a=>p(a)})]}),(0,b.jsxs)("div",{className:"space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(B.Sun,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("label",{className:"text-sm font-medium",children:l("settings.theme")})]}),w?(0,b.jsx)(h.SegmentedControl,{options:aa.map(a=>({value:a.value,label:a.label})),value:q??"system",onChange:a=>t(a)}):(0,b.jsx)("div",{className:"inline-flex h-8 rounded-md border border-border bg-muted p-1 gap-1 w-[120px]"})]})]}),(0,b.jsx)("div",{className:"flex justify-end pt-3",children:(0,b.jsxs)(f.Button,{onClick:ab,disabled:0===M.trim().length,className:"px-5",children:[l("onboarding.step1.next"),(0,b.jsx)(A.ChevronRight,{className:"h-4 w-4 ml-1"})]})})]}),2===K&&(0,b.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:l("onboarding.step2.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:l("onboarding.step2.desc")})]}),(0,b.jsx)(s,{adapterType:"claude_code",adapterLabel:"Claude CLI",onResult:P}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,b.jsxs)(f.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ac,children:[(0,b.jsx)(z.ChevronLeft,{className:"h-4 w-4 mr-1"}),l("onboarding.back")]}),(0,b.jsxs)(f.Button,{onClick:ab,disabled:!O?.ok,className:"px-5",children:[l("onboarding.step1.next"),(0,b.jsx)(A.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),3===K&&(0,b.jsxs)("div",{className:"space-y-5 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:l("onboarding.step3.title")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:l("onboarding.step3.desc")})]}),Q.length>0&&(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:l("onboarding.step3.added").replace("{count}",String(Q.length))}),Q.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("p",{className:"text-sm font-medium truncate",children:[a.host,(0,b.jsx)("span",{className:"text-muted-foreground",children:"*"!==a.ownerMatch?` / ${a.ownerMatch}`:""})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground font-mono truncate",children:a.localPathTemplate})]}),(0,b.jsx)(f.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>{var b;return b=a.id,void R(a=>a.filter(a=>a.id!==b))},children:(0,b.jsx)(G.Trash2,{className:"h-3.5 w-3.5"})})]},a.id))]}),U?(0,b.jsxs)("div",{className:"space-y-3 rounded-lg border border-border p-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:l("onboarding.step3.hostLabel")}),(0,b.jsx)(g.Input,{value:S.host,onChange:a=>T(b=>({...b,host:a.target.value})),placeholder:l("onboarding.step3.hostPlaceholder"),className:"h-9",autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:l("onboarding.step3.ownerLabel")}),(0,b.jsx)(g.Input,{value:S.ownerMatch,onChange:a=>T(b=>({...b,ownerMatch:a.target.value})),placeholder:l("onboarding.step3.ownerPlaceholder"),className:"h-9"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:l("onboarding.step3.pathLabel")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.Input,{value:S.localPathTemplate,onChange:a=>T(b=>({...b,localPathTemplate:a.target.value})),placeholder:l("onboarding.step3.pathPlaceholder"),className:"h-9 font-mono text-xs flex-1"}),(0,b.jsx)("button",{type:"button",onClick:()=>{Z(a=>(a||X(2),!a))},className:`shrink-0 rounded-full px-2.5 py-1 text-[11px] font-mono font-medium transition-colors ${Y?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:"{path}"})]}),(0,b.jsx)("p",{className:"text-[11px] text-muted-foreground",children:l(Y?"onboarding.step3.pathHintFull":"onboarding.step3.pathHintRepo")})]}),S.localPathTemplate&&(a=S.localPathTemplate.trim().replace(/\/+$/,""),i=Y?`${a}/{path}`:a,j=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:l("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1 flex-wrap",children:j.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>X(c),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${W===c?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a.label},c))}),(0,b.jsxs)("div",{className:"rounded-md bg-muted/50 px-3 py-2 space-y-1",children:[(0,b.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:j[W].url}),(0,b.jsxs)("p",{className:"font-mono text-xs",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,b.jsx)("span",{className:"text-primary",children:function(a,b){if(!a||!b)return"";let c=b.trim(),d=[],e=c.match(/^git@[^:]+:(.+)$/);if(e)d=e[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let a=new URL(c);d=decodeURIComponent(a.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!d.length)return"";let f=d[0],g=d[d.length-1],h=d.join("/");if(a.includes("{path}"))return a.replace("{path}",h).replace("{owner}",f).replace("{repo}",g).replace(/\/+$/,"");let i=a.replace("{owner}",f).replace("{repo}","").replace(/\/+$/,"");return`${i}/${g}`}(i,j[W].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[Q.length>0&&(0,b.jsx)(f.Button,{variant:"ghost",onClick:()=>V(!1),children:l("settings.config.git.cancel")}),(0,b.jsxs)(f.Button,{onClick:function(){if(!S.host.trim()||!S.localPathTemplate.trim())return;let a=S.localPathTemplate.trim().replace(/\/+$/,""),b=Y?`${a}/{path}`:a,c={id:crypto.randomUUID(),host:S.host.trim(),ownerMatch:S.ownerMatch.trim()||"*",localPathTemplate:b,priority:Q.length};R(a=>[...a,c]),T({...I}),Z(!1),V(!1)},disabled:!S.host.trim()||!S.localPathTemplate.trim(),children:[(0,b.jsx)(m.Check,{className:"h-4 w-4 mr-1"}),l("settings.config.git.save")]})]})]}):(0,b.jsxs)(f.Button,{variant:"outline",onClick:()=>{T({...I}),V(!0)},children:[(0,b.jsx)(F.Plus,{className:"h-4 w-4 mr-1"}),l("settings.config.git.addRule")]}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,b.jsxs)(f.Button,{variant:"ghost",className:"text-muted-foreground",onClick:ac,children:[(0,b.jsx)(z.ChevronLeft,{className:"h-4 w-4 mr-1"}),l("onboarding.back")]}),(0,b.jsxs)(f.Button,{onClick:ad,disabled:$,className:"px-5",children:[l("onboarding.complete"),(0,b.jsx)(m.Check,{className:"h-4 w-4 ml-1"})]})]})]})]}),(0,b.jsx)("div",{className:"pt-6 text-xs text-muted-foreground",children:l("onboarding.stepIndicator").replace("{current}",String(K)).replace("{total}",String(3))})]})})]})}],790201)}];
2
2
 
3
3
  //# sourceMappingURL=project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js.map