@overlordai/server 1.0.139 → 1.0.141

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 (235) hide show
  1. package/database/migrations/010-plan-review-mode.sql +11 -0
  2. package/database/migrations/012-schema-index-fixes.sql +72 -0
  3. package/dist/adapters/adapter.module.d.ts.map +1 -1
  4. package/dist/adapters/adapter.module.js +3 -0
  5. package/dist/adapters/adapter.module.js.map +1 -1
  6. package/dist/adapters/command-parser.utils.d.ts +11 -0
  7. package/dist/adapters/command-parser.utils.d.ts.map +1 -1
  8. package/dist/adapters/command-parser.utils.js +58 -1
  9. package/dist/adapters/command-parser.utils.js.map +1 -1
  10. package/dist/adapters/help-text.d.ts.map +1 -1
  11. package/dist/adapters/help-text.js +8 -6
  12. package/dist/adapters/help-text.js.map +1 -1
  13. package/dist/adapters/lark/lark-message.parser.d.ts +7 -7
  14. package/dist/adapters/lark/lark-message.parser.d.ts.map +1 -1
  15. package/dist/adapters/lark/lark-message.parser.js +11 -7
  16. package/dist/adapters/lark/lark-message.parser.js.map +1 -1
  17. package/dist/adapters/lark/lark.adapter.d.ts +3 -1
  18. package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
  19. package/dist/adapters/lark/lark.adapter.js +28 -12
  20. package/dist/adapters/lark/lark.adapter.js.map +1 -1
  21. package/dist/adapters/nlu.service.d.ts +20 -0
  22. package/dist/adapters/nlu.service.d.ts.map +1 -0
  23. package/dist/adapters/nlu.service.js +231 -0
  24. package/dist/adapters/nlu.service.js.map +1 -0
  25. package/dist/adapters/slack/slack-message.parser.d.ts.map +1 -1
  26. package/dist/adapters/slack/slack-message.parser.js +4 -0
  27. package/dist/adapters/slack/slack-message.parser.js.map +1 -1
  28. package/dist/adapters/slack/slack.adapter.d.ts +3 -1
  29. package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
  30. package/dist/adapters/slack/slack.adapter.js +43 -14
  31. package/dist/adapters/slack/slack.adapter.js.map +1 -1
  32. package/dist/adapters/slack/slack.controller.js +8 -8
  33. package/dist/adapters/slack/slack.controller.js.map +1 -1
  34. package/dist/common/project-validation.d.ts +13 -3
  35. package/dist/common/project-validation.d.ts.map +1 -1
  36. package/dist/common/project-validation.js +21 -5
  37. package/dist/common/project-validation.js.map +1 -1
  38. package/dist/database/migration-runner.d.ts.map +1 -1
  39. package/dist/database/migration-runner.js +10 -1
  40. package/dist/database/migration-runner.js.map +1 -1
  41. package/dist/database/repositories/project.repository.d.ts +2 -0
  42. package/dist/database/repositories/project.repository.d.ts.map +1 -1
  43. package/dist/database/repositories/project.repository.js +13 -0
  44. package/dist/database/repositories/project.repository.js.map +1 -1
  45. package/dist/database/repositories/task.repository.d.ts +11 -2
  46. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  47. package/dist/database/repositories/task.repository.js +64 -8
  48. package/dist/database/repositories/task.repository.js.map +1 -1
  49. package/dist/dispatcher/dispatcher.service.d.ts +2 -0
  50. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  51. package/dist/dispatcher/dispatcher.service.js +79 -0
  52. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  53. package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
  54. package/dist/dispatcher/scheduler.service.js +3 -0
  55. package/dist/dispatcher/scheduler.service.js.map +1 -1
  56. package/dist/dispatcher/task-creation.service.d.ts +13 -2
  57. package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
  58. package/dist/dispatcher/task-creation.service.js +207 -21
  59. package/dist/dispatcher/task-creation.service.js.map +1 -1
  60. package/dist/dispatcher/task-lifecycle.service.d.ts +5 -1
  61. package/dist/dispatcher/task-lifecycle.service.d.ts.map +1 -1
  62. package/dist/dispatcher/task-lifecycle.service.js +231 -1
  63. package/dist/dispatcher/task-lifecycle.service.js.map +1 -1
  64. package/dist/events/event-types.d.ts +8 -0
  65. package/dist/events/event-types.d.ts.map +1 -1
  66. package/dist/events/event-types.js +1 -0
  67. package/dist/events/event-types.js.map +1 -1
  68. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  69. package/dist/notifier/notification-consumer.js +5 -0
  70. package/dist/notifier/notification-consumer.js.map +1 -1
  71. package/dist/notifier/notification-event-listener.d.ts +2 -1
  72. package/dist/notifier/notification-event-listener.d.ts.map +1 -1
  73. package/dist/notifier/notification-event-listener.js +14 -0
  74. package/dist/notifier/notification-event-listener.js.map +1 -1
  75. package/dist/notifier/notifier.service.d.ts +1 -0
  76. package/dist/notifier/notifier.service.d.ts.map +1 -1
  77. package/dist/notifier/notifier.service.js +8 -0
  78. package/dist/notifier/notifier.service.js.map +1 -1
  79. package/dist/notifier/template.service.d.ts +4 -0
  80. package/dist/notifier/template.service.d.ts.map +1 -1
  81. package/dist/notifier/template.service.js +32 -0
  82. package/dist/notifier/template.service.js.map +1 -1
  83. package/dist/web/admin/admin-project.controller.d.ts.map +1 -1
  84. package/dist/web/admin/admin-project.controller.js +15 -0
  85. package/dist/web/admin/admin-project.controller.js.map +1 -1
  86. package/dist/web/dashboard.service.js +3 -3
  87. package/dist/web/frame-handlers/index.d.ts +1 -0
  88. package/dist/web/frame-handlers/index.d.ts.map +1 -1
  89. package/dist/web/frame-handlers/index.js +3 -1
  90. package/dist/web/frame-handlers/index.js.map +1 -1
  91. package/dist/web/frame-handlers/progress.handler.d.ts.map +1 -1
  92. package/dist/web/frame-handlers/progress.handler.js +18 -0
  93. package/dist/web/frame-handlers/progress.handler.js.map +1 -1
  94. package/dist/web/frame-handlers/review-report.handler.d.ts +15 -0
  95. package/dist/web/frame-handlers/review-report.handler.d.ts.map +1 -0
  96. package/dist/web/frame-handlers/review-report.handler.js +140 -0
  97. package/dist/web/frame-handlers/review-report.handler.js.map +1 -0
  98. package/dist/web/frame-handlers/stage-confirm.handler.d.ts +3 -1
  99. package/dist/web/frame-handlers/stage-confirm.handler.d.ts.map +1 -1
  100. package/dist/web/frame-handlers/stage-confirm.handler.js +18 -4
  101. package/dist/web/frame-handlers/stage-confirm.handler.js.map +1 -1
  102. package/dist/web/project.controller.js +1 -1
  103. package/dist/web/project.controller.js.map +1 -1
  104. package/dist/web/task.controller.d.ts +116 -2
  105. package/dist/web/task.controller.d.ts.map +1 -1
  106. package/dist/web/task.controller.js +172 -8
  107. package/dist/web/task.controller.js.map +1 -1
  108. package/dist/web/web-event.service.d.ts +2 -1
  109. package/dist/web/web-event.service.d.ts.map +1 -1
  110. package/dist/web/web-event.service.js +13 -0
  111. package/dist/web/web-event.service.js.map +1 -1
  112. package/dist/web/worker-channel.gateway.d.ts +2 -1
  113. package/dist/web/worker-channel.gateway.d.ts.map +1 -1
  114. package/dist/web/worker-channel.gateway.js +6 -3
  115. package/dist/web/worker-channel.gateway.js.map +1 -1
  116. package/package.json +4 -4
  117. package/public/assets/AccessTokensPage-wTxicSeE.js +1 -0
  118. package/public/assets/AdminPage-CBovEOm4.js +1 -0
  119. package/public/assets/{AgentCliPage-BR2YXUlN.js → AgentCliPage-DfqlFdFN.js} +1 -1
  120. package/public/assets/{ApiReferencePage-CWGvx9sZ.js → ApiReferencePage-7TUHB8sC.js} +1 -1
  121. package/public/assets/{ArchitecturePage-CVipZPS8.js → ArchitecturePage-CycvJ1HW.js} +1 -1
  122. package/public/assets/AuditLogPage-CqqCDd8o.js +1 -0
  123. package/public/assets/{BindPlatformPage-BDisYk6H.js → BindPlatformPage-BV5wNIi2.js} +1 -1
  124. package/public/assets/{BotIntegrationPage-DoqcdqwE.js → BotIntegrationPage-B2bQytks.js} +1 -1
  125. package/public/assets/{BotManage-DRo01WBu.js → BotManage-BBBrqdT_.js} +2 -2
  126. package/public/assets/{BotSetupPage-nornZgmt.js → BotSetupPage-DdDPniAd.js} +1 -1
  127. package/public/assets/{ChangelogPage-Bd5TviZ8.js → ChangelogPage-D5YE3BFH.js} +1 -1
  128. package/public/assets/CliReferencePage-yJgtPpFn.js +17 -0
  129. package/public/assets/ConfirmStageDialog-BOGr-qSN.js +12 -0
  130. package/public/assets/{DeploymentPage-3YMjpAFo.js → DeploymentPage-C0CXq8yl.js} +1 -1
  131. package/public/assets/{DevWorkflowPage-DFQTZVP9.js → DevWorkflowPage-I4Io3nYz.js} +1 -1
  132. package/public/assets/{DeveloperManage-BnMIj_g_.js → DeveloperManage-Cy0LRyHh.js} +2 -2
  133. package/public/assets/{DeveloperSetupPage-Cw4nLpIm.js → DeveloperSetupPage-DzGCH2XG.js} +1 -1
  134. package/public/assets/{DocsIndexPage-cK28EfKj.js → DocsIndexPage-PIEcc9gX.js} +2 -2
  135. package/public/assets/DocsLayout-ChIliA9A.js +1 -0
  136. package/public/assets/{DocsPrimitives-2csfHzW_.js → DocsPrimitives-BMgSDhur.js} +1 -1
  137. package/public/assets/EditProjectPage-D0rfXGZR.js +2 -0
  138. package/public/assets/{EmptyState-ADwWEXdn.js → EmptyState-Di2nOiOt.js} +1 -1
  139. package/public/assets/{EnvVariablesPage-D7HonzNe.js → EnvVariablesPage-EmfRwttc.js} +1 -1
  140. package/public/assets/HomePage-CeOmNhkc.js +1 -0
  141. package/public/assets/{InfoRow-CmtJW4M9.js → InfoRow-5vQ-_wWv.js} +1 -1
  142. package/public/assets/{InstallationPage-CJ-YdcrX.js → InstallationPage-CUbe1AD-.js} +1 -1
  143. package/public/assets/{LandingPage-CWdPeZv-.js → LandingPage-DSHGbkXw.js} +7 -12
  144. package/public/assets/{LocalDevelopmentPage-BDl2Ktyc.js → LocalDevelopmentPage-fialPCnX.js} +1 -1
  145. package/public/assets/{LoginPage-DgF9ENzx.js → LoginPage-C4oz9yjV.js} +1 -1
  146. package/public/assets/{MetricBar-DoUTAkIk.js → MetricBar-ByQYVWVi.js} +1 -1
  147. package/public/assets/{NotFoundPage-BUrnSFza.js → NotFoundPage-BeayCSH7.js} +1 -1
  148. package/public/assets/{OnboardingGuide-E87DHNsp.js → OnboardingGuide-CqcX04SL.js} +1 -1
  149. package/public/assets/{PermissionsPage-DKhdHNDg.js → PermissionsPage-Bb2CYzMf.js} +1 -1
  150. package/public/assets/{PipelineConfigPage-Dn-fh0Ia.js → PipelineConfigPage-DwY__0Ag.js} +2 -2
  151. package/public/assets/PipelineEditorPage-FkckQpQX.js +3 -0
  152. package/public/assets/PlanPage-BOzGJd2h.js +1 -0
  153. package/public/assets/ProfilePage-CT_kk3a8.js +1 -0
  154. package/public/assets/ProjectDetailPage-B-t7L84T.js +7 -0
  155. package/public/assets/ProjectListPage-C2uStUVE.js +6 -0
  156. package/public/assets/PtyTerminal-BYXg_ahq.js +38 -0
  157. package/public/assets/QuickAuth-CohuPihd.js +1 -0
  158. package/public/assets/{RemoveMemberConfirmDialog-Brv6Th8M.js → RemoveMemberConfirmDialog-DLq9g7Td.js} +1 -1
  159. package/public/assets/ReviewAggregatePage-dWQb52Df.js +11 -0
  160. package/public/assets/ReviewPage-DtdWSBgK.js +1 -0
  161. package/public/assets/Select-BAl7H-Y0.js +1 -0
  162. package/public/assets/{SettingsPage-CZwwUAeC.js → SettingsPage-qCfF6rzU.js} +1 -1
  163. package/public/assets/{Skeleton-DQWHHk9G.js → Skeleton-DA5o8Wqi.js} +1 -1
  164. package/public/assets/{SkillPage-CKbqXAb6.js → SkillPage-C6p0dXbu.js} +1 -1
  165. package/public/assets/TaskDetailPage-D4sGfico.js +21 -0
  166. package/public/assets/TaskGuidePage-COT0chCI.js +19 -0
  167. package/public/assets/TaskListPage-Bvq5ow7r.js +1 -0
  168. package/public/assets/{TaskStatusBadge-Cd9AKReP.js → TaskStatusBadge-BdNFkrjU.js} +1 -1
  169. package/public/assets/TerminalHomePage-XJ5daAJC.js +6 -0
  170. package/public/assets/TokenManage-JLFD8xAN.js +1 -0
  171. package/public/assets/{Tooltip-1tjISJAN.js → Tooltip-Bl8LCgWr.js} +1 -1
  172. package/public/assets/{TotpSetupPage-Dme4c3tv.js → TotpSetupPage-BGE6pDdn.js} +1 -1
  173. package/public/assets/{WorkerDetailPage-CgXIs1_M.js → WorkerDetailPage-Dd-IbO6r.js} +1 -1
  174. package/public/assets/{WorkerListPage-CM1GqeN7.js → WorkerListPage-e4P55nJc.js} +2 -2
  175. package/public/assets/{WorkerOperationsPage-uArfsFAY.js → WorkerOperationsPage-ioBw_i1j.js} +1 -1
  176. package/public/assets/WorkerSetupGuidePage-CRicnVVm.js +1 -0
  177. package/public/assets/{WorkerSetupPage-DTQvCeTf.js → WorkerSetupPage-DXOlNqUZ.js} +1 -1
  178. package/public/assets/{agent-type-options-l4HLs4lb.js → agent-type-options-BVIYXf2V.js} +1 -1
  179. package/public/assets/{arrow-left-D2z6WXle.js → arrow-left-CTo0KHGY.js} +1 -1
  180. package/public/assets/{arrow-right-BBWwGkdK.js → arrow-right-C9oQyTKw.js} +1 -1
  181. package/public/assets/{bot-haRrziLf.js → bot-B301pflD.js} +1 -1
  182. package/public/assets/chevron-down-B0Leook1.js +6 -0
  183. package/public/assets/{chevron-left-B11s6IVD.js → chevron-left-59qctCaF.js} +1 -1
  184. package/public/assets/{chevron-right-CxMAZVfy.js → chevron-right-XfJqITCa.js} +1 -1
  185. package/public/assets/chevron-up-BW2PVBfH.js +6 -0
  186. package/public/assets/{copy-CukaPL3b.js → copy-DEWCNXDf.js} +1 -1
  187. package/public/assets/{download-CtBIkCC6.js → download-7d5kMwpH.js} +1 -1
  188. package/public/assets/{external-link-BYaw3Ovt.js → external-link-DjBNV7ga.js} +1 -1
  189. package/public/assets/{file-text-CwpyLWx2.js → file-text-DHEz_RFq.js} +1 -1
  190. package/public/assets/{git-fork-DjDcRdWO.js → git-fork-cRLOBM6a.js} +1 -1
  191. package/public/assets/index-eKvCyU64.js +252 -0
  192. package/public/assets/index-kJfGgL_V.css +1 -0
  193. package/public/assets/{key-D-EBAM_S.js → key-D5BbAzTj.js} +1 -1
  194. package/public/assets/{loader-circle-PEOtoIoF.js → loader-circle-B_f_h4fq.js} +1 -1
  195. package/public/assets/{pencil-BObnoNZc.js → pencil-CTTWvWuS.js} +1 -1
  196. package/public/assets/play-Cqf1Kvc7.js +6 -0
  197. package/public/assets/{plus-JnJTWOh0.js → plus-DwBKB0x6.js} +1 -1
  198. package/public/assets/{rotate-ccw-9hl77Xny.js → rotate-ccw-CZR8KOZn.js} +1 -1
  199. package/public/assets/{scroll-text-w6v00sw0.js → scroll-text-BeQeZkLb.js} +1 -1
  200. package/public/assets/{settings-DqX6KTB6.js → settings-CsdOqob5.js} +1 -1
  201. package/public/assets/skip-forward-BqiRx2ZQ.js +6 -0
  202. package/public/assets/status-colors-yfNzOmz-.js +1 -0
  203. package/public/assets/task-constants-BWLt-ivk.js +1 -0
  204. package/public/assets/task.store-BDZwafPm.js +1 -0
  205. package/public/assets/{trash-2-BH7Uy_FR.js → trash-2-CXPG2vQr.js} +1 -1
  206. package/public/assets/{useFetch-C6aoI2YR.js → useFetch-CVFGit7a.js} +1 -1
  207. package/public/assets/{users-N89uFOml.js → users-DmefWRaM.js} +1 -1
  208. package/public/assets/{wifi-B0GLkoI5.js → wifi-BJIfMBKB.js} +1 -1
  209. package/public/assets/{workflow-CPFrQB2p.js → workflow-CuZasRLA.js} +1 -1
  210. package/public/index.html +2 -2
  211. package/public/sw.js +1 -1
  212. package/public/assets/AccessTokensPage-DMsQKvGG.js +0 -1
  213. package/public/assets/AdminPage-DqZMqDDh.js +0 -1
  214. package/public/assets/AuditLogPage-CCUK_lWo.js +0 -1
  215. package/public/assets/CliReferencePage-C6NT0ynG.js +0 -16
  216. package/public/assets/DocsLayout-BVtSzaqN.js +0 -1
  217. package/public/assets/EditProjectPage-D4LeLkUK.js +0 -2
  218. package/public/assets/HomePage-CFVWSe09.js +0 -1
  219. package/public/assets/MobileTerminalShell-BSE0-T35.js +0 -49
  220. package/public/assets/PipelineEditorPage-DY945ZLB.js +0 -3
  221. package/public/assets/ProfilePage-wMwqf3xq.js +0 -1
  222. package/public/assets/ProjectDetailPage-Czbvi0xm.js +0 -7
  223. package/public/assets/ProjectListPage-qT9qvnxf.js +0 -6
  224. package/public/assets/QuickAuth-BsMxofrA.js +0 -1
  225. package/public/assets/Select-BfjWmQST.js +0 -6
  226. package/public/assets/TaskDetailPage-CskFoYAc.js +0 -26
  227. package/public/assets/TaskListPage-T7DWBtM3.js +0 -1
  228. package/public/assets/TerminalHomePage-ClJFAaTn.js +0 -11
  229. package/public/assets/TokenManage-Cj9UuqyE.js +0 -1
  230. package/public/assets/WorkerSetupGuidePage-CyW_9sIh.js +0 -6
  231. package/public/assets/index-BUjb3VF-.css +0 -1
  232. package/public/assets/index-GPUbNOkg.js +0 -242
  233. package/public/assets/status-colors-C_RhLQKM.js +0 -1
  234. package/public/assets/task-constants-LNckgIqT.js +0 -1
  235. /package/public/assets/{MobileTerminalShell-6GBZ9nXN.css → PtyTerminal-6GBZ9nXN.css} +0 -0
@@ -0,0 +1 @@
1
+ import{a as h,r as s,h as b,a3 as v,j as e,C as j}from"./index-eKvCyU64.js";import{C as f}from"./copy-DEWCNXDf.js";function y({mode:l}){const{t:o}=h(),[n,d]=s.useState([]),[x,c]=s.useState(null),[u,i]=s.useState(!1);s.useEffect(()=>{b.get("web/profile/tokens").json().then(t=>{const r=t.filter(m=>m.status===v.ACTIVE);d(r),r.length>0&&c(r[0].id)}).catch(()=>{})},[]);const a=l==="cli"?"ov login --token <your-token>":'curl -H "authorization: bearer <your-token>" http://localhost:9000/api/web/tasks',p=s.useCallback(()=>{navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),2e3)},[a]);return n.length===0?null:e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--accent)]/20 bg-[var(--bg-card)] p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:o("docs.quick_start_with_token")}),e.jsx("select",{value:x??"",onChange:t=>c(Number(t.target.value)),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2 py-1 text-xs text-[var(--text-primary)]",children:n.map(t=>e.jsx("option",{value:t.id,children:t.label},t.id))})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)] break-all",children:a}),e.jsx("button",{onClick:p,className:"shrink-0 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:u?e.jsx(j,{size:14}):e.jsx(f,{size:14})})]}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:o("docs.replace_token_hint")})]})}export{y as Q};
@@ -1,4 +1,4 @@
1
- import{c as w,a as _,r as s,O as l,j as e,X as R,h as g,v as C}from"./index-GPUbNOkg.js";import{S as N}from"./Select-BfjWmQST.js";/**
1
+ import{c as w,a as _,r as s,Z as l,j as e,X as R,h as g,v as C}from"./index-eKvCyU64.js";import{S as N}from"./Select-BAl7H-Y0.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,11 @@
1
+ import{c as B,A as de,f as me,a as H,k as pe,r as n,h as L,j as e,L as ue,V as W,Y as ve,t as f,p as v,b as be,Q as ge,X as he}from"./index-eKvCyU64.js";import{P as fe}from"./PtyTerminal-BYXg_ahq.js";import{T as je}from"./Skeleton-DA5o8Wqi.js";import{f as ye,b as Ne}from"./date-RFA7-ZGs.js";import{a as we}from"./agent-type-options-BVIYXf2V.js";import{T as G,g as z}from"./task-constants-BWLt-ivk.js";import{A as ke}from"./arrow-left-CTo0KHGY.js";import{L as Se}from"./loader-circle-B_f_h4fq.js";import{P as q}from"./play-Cqf1Kvc7.js";import{S as Ce}from"./skip-forward-BqiRx2ZQ.js";import{R as Te}from"./rotate-ccw-CZR8KOZn.js";import{C as Ae}from"./chevron-up-BW2PVBfH.js";import{C as Ee}from"./chevron-down-B0Leook1.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Re=B("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
7
+ * @license lucide-react v0.469.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const De=B("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"}]]),X={critical:0,warning:1,suggestion:2};function Ie(s){switch(s){case"critical":return{text:"text-[var(--destructive)]",bg:"rgba(239,68,68,0.12)",border:"rgba(239,68,68,0.27)"};case"warning":return{text:"text-[var(--warning)]",bg:"rgba(245,158,11,0.12)",border:"rgba(245,158,11,0.27)"};default:return{text:"text-[var(--info)]",bg:"rgba(59,130,246,0.10)",border:"rgba(59,130,246,0.27)"}}}function Le({severity:s}){return s==="critical"?e.jsx(Re,{className:"h-3.5 w-3.5 text-[var(--destructive)]"}):s==="warning"?e.jsx(W,{className:"h-3.5 w-3.5 text-[var(--warning)]"}):e.jsx(De,{className:"h-3.5 w-3.5 text-[var(--info)]"})}function _e(s){switch(s){case v.RUNNING:return"bg-[var(--accent)]";case v.QUEUED:case v.ASSIGNED:case v.SUSPENDED:return"bg-[var(--warning)]";case v.COMPLETED:return"bg-[var(--accent)]";case v.FAILED:return"bg-[var(--destructive)]";default:return"bg-[#525252]"}}function Z(s){return s===v.RUNNING||s===v.QUEUED||s===v.ASSIGNED}function O(s){return s===v.SUSPENDED}const $e=we(z);function Pe({task:s,expanded:l,onToggleExpand:r}){const b=z(s.agentType),x=_e(s.status),o=Ne(s.startedAt,s.completedAt??void 0),j=Z(s.status),g=G.includes(s.status),N=n.useRef(null);return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3 hover:bg-[var(--bg-input)] transition-colors",onClick:r,children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${x} ${j?"animate-pulse":""}`}),e.jsx("span",{className:"flex-1 text-xs font-medium text-[var(--text-primary)]",children:b}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[j?`${s.status.toLowerCase()}...`:s.status.toLowerCase(),o&&` · ${o}`]}),e.jsxs("a",{href:`/tasks/${s.id}`,target:"_blank",rel:"noopener noreferrer",onClick:w=>w.stopPropagation(),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-muted)] hover:text-[var(--accent)] hover:border-[var(--accent)] transition-colors flex items-center gap-1",children:[e.jsx(be,{className:"h-3 w-3"}),"↗"]}),l?e.jsx(Ae,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}):e.jsx(Ee,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})]}),l&&e.jsx("div",{className:"border-t border-[var(--border)]",style:{height:"300px"},children:e.jsx(fe,{ref:N,taskId:s.id,sessionId:s.currentSessionId??void 0,taskFinished:g})})]})}function Fe({issue:s}){const l=Ie(s.severity);return e.jsxs("div",{className:`rounded-[4px] p-3 text-xs ${s.isDuplicate?"opacity-60":""}`,style:{backgroundColor:l.bg,border:`1px solid ${l.border}`},children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx(Le,{severity:s.severity}),e.jsx("span",{className:`font-bold ${l.text}`,children:s.severity}),s.agentType&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:s.agentType}),e.jsxs("span",{className:"text-[var(--text-muted)]",children:[s.file,s.line!=null?`:${s.line}`:""]}),s.isDuplicate&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:"duplicate"})]}),e.jsx("p",{className:"mb-1 text-[var(--text-secondary)]",children:s.description}),s.suggestion&&e.jsxs("p",{className:"text-[var(--text-muted)]",children:[e.jsx("span",{className:"font-medium",children:"suggestion:"})," ",s.suggestion]})]})}function Ue({sourceTaskId:s,defaultReviewers:l,onClose:r,onLaunched:b}){const{t:x}=H(),o=l.length>0?l:[ge.CLAUDE],j=l.length>0,[g,N]=n.useState(o),[w,_]=n.useState(""),[y,$]=n.useState(!1),[C,T]=n.useState(!1);function R(c){N(u=>u.includes(c)?u.filter(P=>P!==c):[...u,c])}async function D(){if(g.length===0){f.error("select at least one review agent.");return}T(!0);try{await L.post(`web/tasks/${s}/review`,{json:{agentTypes:g,description:w.trim()||void 0,skipFix:y||void 0}}),f.success("review launched"),b(),r()}catch(c){const u=c instanceof Error?c.message:String(c);f.error(u)}finally{T(!1)}}return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 font-mono",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-[var(--text-primary)]",children:x("review.review_again")}),e.jsx("button",{onClick:r,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(he,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:x("review.select_agents")}),j&&e.jsx("span",{className:"rounded-[4px] border border-amber-500/40 bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-500",children:"using project defaults"})]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:$e.map(c=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:g.includes(c.value),onChange:()=>R(c.value),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:c.label})]},c.value))}),e.jsx("textarea",{value:w,onChange:c=>_(c.target.value),placeholder:x("review.description_placeholder"),rows:3,className:"mb-3 w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("label",{className:"mb-4 flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:y,onChange:c=>$(c.target.checked),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-muted)]",children:x("review.skip_fix_label")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:D,disabled:C||g.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(q,{className:"h-3 w-3"}),x(C?"common.processing":"review.launch")]}),e.jsx("button",{onClick:r,className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:x("common.cancel")})]})]})})}function We(){var J;const{sourceTaskId:s}=de(),l=me(),{t:r}=H(),b=Number(s),x=pe(t=>t.eventSeq),[o,j]=n.useState(null),[g,N]=n.useState(!0),[w,_]=n.useState(new Set),[y,$]=n.useState(""),[C,T]=n.useState(!1),[R,D]=n.useState(!1),[c,u]=n.useState(!1),[P,Q]=n.useState(null),k=n.useCallback(async()=>{try{const t=await L.get(`web/tasks/${b}/reviews`).json();j(t),t.rounds&&t.rounds.length>0&&Q(a=>a??t.rounds[t.rounds.length-1].round)}catch{j(null)}finally{N(!1)}},[b]);n.useEffect(()=>{N(!0),k()},[k]),n.useEffect(()=>{x>0&&k()},[x,k]);const ee=n.useCallback(t=>{_(a=>{const d=new Set(a);return d.has(t)?d.delete(t):d.add(t),d})},[]),S=(o==null?void 0:o.rounds)??[],F=S.length>0?S[S.length-1].round:null,h=P??F,U=S.find(t=>t.round===h),i=(U==null?void 0:U.reviewTasks)??(o==null?void 0:o.reviewTasks)??[];i.some(t=>Z(t.status));const I=i.some(t=>O(t.status)),M=i.length>0&&i.every(t=>G.includes(t.status)),te=i.some(t=>t.report!=null),se=i.length>0&&i.every(t=>t.report!=null),V=h===F,re=I||M,A=n.useMemo(()=>{var d;const t=[];for(const p of i)if((d=p.report)!=null&&d.issues)for(const E of p.report.issues)t.push({...E,agentType:p.agentType??"claude"});t.sort((p,E)=>(X[p.severity]??9)-(X[E.severity]??9));const a=new Set;return t.map(p=>{const E=p.description.slice(0,20),K=`${p.file}:${p.line??""}:${E}`;return a.has(K)?{...p,isDuplicate:!0}:(a.add(K),p)})},[i]),ae=A.filter(t=>t.severity==="critical").length,ne=A.filter(t=>t.severity==="warning").length,oe=A.filter(t=>t.severity==="suggestion").length,Y=i.filter(t=>O(t.status)),ce=n.useMemo(()=>[{value:"",label:"select agent..."},...Y.map(t=>({value:String(t.id),label:z(t.agentType)}))],[Y]);async function ie(){if(!y){f.error("select a review agent to perform the fix.");return}T(!0);try{await L.post(`web/tasks/${b}/approve-fix`,{json:{reviewTaskId:Number(y)}}),f.success("fix started"),k()}catch(t){const a=t instanceof Error?t.message:String(t);f.error(a)}finally{T(!1)}}async function le(){D(!0);try{await L.post(`web/tasks/${b}/skip-fix`,{json:h!=null?{round:h}:{}}),f.success("review completed — no fix needed"),l("/review")}catch(t){const a=t instanceof Error?t.message:String(t);f.error(a)}finally{D(!1)}}const xe=n.useMemo(()=>{var a;const t=(a=o==null?void 0:o.sourceTask)==null?void 0:a.configSnapshot;if(!t)return[];try{const d=JSON.parse(t);return Array.isArray(d.defaultReviewers)?d.defaultReviewers:[]}catch{return[]}},[(J=o==null?void 0:o.sourceTask)==null?void 0:J.configSnapshot]);if(g)return e.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(je,{rows:5})});if(!o)return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"// reviews not found"}),e.jsx("button",{onClick:()=>l("/review"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:"< back to review"})]});const{sourceTask:m}=o;return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{onClick:()=>l("/review"),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(ke,{className:"h-3.5 w-3.5"}),r("common.back")]})}),e.jsx("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:"source task"}),e.jsxs(ue,{to:`/tasks/${m.id}`,className:"text-xs text-[var(--info)] hover:underline",children:["#",m.id]}),e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:m.projectKey})]}),e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:m.description}),(m.branch||m.sourceCommitSha)&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["reviewing branch"," ",m.branch&&e.jsx("span",{className:"text-[var(--text-secondary)]",children:m.branch}),m.sourceCommitSha&&e.jsxs(e.Fragment,{children:[" ","at commit"," ",e.jsx("span",{className:"font-mono text-[var(--accent)]",children:m.sourceCommitSha.slice(0,7)})]})]})]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:ye(m.createdAt)})]})}),S.length>1&&e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"round:"}),e.jsx("div",{className:"flex gap-1",children:S.map(t=>e.jsxs("button",{onClick:()=>Q(t.round),className:`rounded-[4px] border px-3 py-1 text-xs transition-colors ${h===t.round?"border-[var(--accent)] bg-[var(--accent)] text-black font-bold":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:["#",t.round]},t.round))}),h!==F&&e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// historical"})]}),i.length>0&&e.jsxs("div",{className:"mb-5",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:[r("review.round"),h?` #${h}`:""]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[i.filter(t=>G.includes(t.status)||O(t.status)).length," / ",i.length," done"]})]}),e.jsx("div",{className:"flex flex-col gap-2",children:i.map(t=>e.jsx(Pe,{task:t,expanded:w.has(t.id),onToggleExpand:()=>ee(t.id)},t.id))})]}),re&&te&&(i.filter(a=>a.report!=null).every(a=>!a.report.summary&&a.report.issues.length===0)?e.jsx("div",{className:"mb-5 rounded-[4px] border border-amber-500/40 bg-amber-500/10 p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(W,{className:"h-4 w-4 shrink-0 text-amber-500 mt-0.5"}),e.jsx("p",{className:"text-xs text-amber-500",children:r("review.empty_report_warning")})]})}):e.jsxs("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("div",{className:"mb-3 flex items-center gap-3",children:e.jsxs("span",{className:"text-xs font-bold text-[var(--accent)]",children:[r("review.round")," — ",r("review.issues_summary",{critical:String(ae),warning:String(ne),suggestion:String(oe)})]})}),A.length>0?e.jsx("div",{className:"flex flex-col gap-2",children:A.map((a,d)=>e.jsx(Fe,{issue:a},d))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// no issues reported"})]})),V&&se&&!I&&!M&&e.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx(Se,{className:"h-3.5 w-3.5 animate-spin text-[var(--text-muted)]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("review.waiting_agents")})]}),V&&(I||M)&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("span",{className:"mb-3 block text-xs font-bold text-[var(--text-muted)]",children:"actions"}),e.jsxs("div",{className:"flex flex-col gap-3",children:[I&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[e.jsx("select",{value:y,onChange:t=>$(t.target.value),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)] md:w-48",children:ce.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsxs("button",{onClick:ie,disabled:C||!y,className:"flex items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(q,{className:"h-3 w-3"}),r(C?"common.processing":"review.approve_fix")]}),e.jsxs("button",{onClick:le,disabled:R,className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(Ce,{className:"h-3 w-3"}),r(R?"common.processing":"review.skip_fix")]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-[var(--text-muted)]",children:[e.jsx(ve,{className:"h-3 w-3 shrink-0"}),r("review.fix_push_info")]})]}),e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(Te,{className:"h-3.5 w-3.5"}),r("review.review_again")]})]})]}),i.length===0&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8 text-center",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("review.no_reviews")}),e.jsxs("button",{onClick:()=>u(!0),className:"mt-3 flex items-center gap-1.5 mx-auto rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black",children:[e.jsx(q,{className:"h-3 w-3"}),r("review.launch")]})]}),c&&e.jsx(Ue,{sourceTaskId:b,defaultReviewers:xe,onClose:()=>u(!1),onLaunched:()=>{u(!1),k()}})]})}export{We as default};
@@ -0,0 +1 @@
1
+ import{a as h,k as C,r as d,w as D,j as e,f as y,h as g,p as c,E as N,l as L,Q as A,X as I,t as w}from"./index-eKvCyU64.js";import{E as k}from"./EmptyState-Di2nOiOt.js";import{T as E}from"./Skeleton-DA5o8Wqi.js";import{f as S}from"./date-RFA7-ZGs.js";import{a as P}from"./agent-type-options-BVIYXf2V.js";import{g as R}from"./task-constants-BWLt-ivk.js";import{P as T}from"./play-Cqf1Kvc7.js";function $(t){switch(t){case c.RUNNING:return"bg-[var(--accent)]";case c.QUEUED:return"bg-[var(--warning)]";case c.ASSIGNED:return"bg-[var(--info)]";case c.SUSPENDED:return"bg-[var(--warning)]";case c.COMPLETED:return"bg-[var(--accent)]";case c.FAILED:return"bg-[var(--destructive)]";case c.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}const U=P(R);function _({taskId:t,onClose:n,onLaunched:s}){const{t:a}=h(),[o,i]=d.useState([A.CLAUDE]),[u,m]=d.useState(""),[r,p]=d.useState(!1);function x(l){i(v=>v.includes(l)?v.filter(b=>b!==l):[...v,l])}async function f(){if(o.length===0){w.error("select at least one review agent.");return}p(!0);try{await g.post(`web/tasks/${t}/review`,{json:{agentTypes:o,description:u.trim()||void 0}}),w.success("review launched"),s(),n()}catch(l){const v=l instanceof Error?l.message:String(l);w.error(v)}finally{p(!1)}}return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 font-mono",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("review.launch")}),e.jsx("button",{onClick:n,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(I,{className:"h-4 w-4"})})]}),e.jsxs("p",{className:"mb-3 text-[11px] text-[var(--text-muted)]",children:["task #",t," — ",a("review.select_agents")]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:U.map(l=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:o.includes(l.value),onChange:()=>x(l.value),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:l.label})]},l.value))}),e.jsx("textarea",{value:u,onChange:l=>m(l.target.value),placeholder:a("review.description_placeholder"),rows:3,className:"mb-4 w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:f,disabled:r||o.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(T,{className:"h-3 w-3"}),a(r?"common.processing":"review.launch")]}),e.jsx("button",{onClick:n,className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")})]})]})})}function M({onRefresh:t}){const{t:n}=h(),s=y(),[a,o]=d.useState([]),[i,u]=d.useState(!0),[m,r]=d.useState(null),p=d.useCallback(async()=>{u(!0);try{const[x,f]=await Promise.all([g.get(`web/tasks?${new URLSearchParams({status:c.COMPLETED,taskMode:"develop",limit:"500"})}`).json(),g.get(`web/tasks?${new URLSearchParams({taskMode:"review",limit:"500"})}`).json()]),l=new Set((f.data??[]).filter(b=>b.sourceTaskId!=null).map(b=>b.sourceTaskId)),v=(x.data??[]).filter(b=>!l.has(b.id));o(v)}catch{o([])}finally{u(!1)}},[]);return d.useEffect(()=>{p()},[p]),i?e.jsx("div",{className:"p-4",children:e.jsx(E,{rows:4})}):a.length===0?e.jsx(k,{icon:N,title:n("review.no_reviews"),description:n("review.pending")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:a.map(x=>e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsxs("span",{className:"flex-1 cursor-pointer truncate text-xs text-[var(--text-primary)] hover:text-[var(--accent)] transition-colors",onClick:()=>s(`/tasks/${x.id}`),children:["#",x.id," ",L(x)]}),e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:x.projectKey}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:S(x.createdAt)}),e.jsxs("button",{onClick:()=>r(x.id),className:"shrink-0 flex items-center gap-1.5 rounded-[4px] px-3 py-1.5 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(T,{className:"h-3 w-3"}),n("review.launch")]})]},x.id))}),m!==null&&e.jsx(_,{taskId:m,onClose:()=>r(null),onLaunched:()=>{t(),p()}})]})}function G(t){const n=new Map;for(const s of t){const a=s.sourceTaskId??s.id;n.has(a)||n.set(a,[]),n.get(a).push(s)}return Array.from(n.entries()).map(([s,a])=>({sourceTaskId:s,tasks:a}))}function O({group:t,onClick:n}){h();const s=t.tasks[0],a=t.tasks.every(i=>i.status===c.COMPLETED||i.status===c.FAILED||i.status===c.CANCELLED),o=s==null?void 0:s.sourceCommitSha;return e.jsxs("div",{onClick:n,className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${a?"bg-[var(--accent)]":"bg-[var(--warning)]"}`}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["source #",t.sourceTaskId]}),o&&e.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-[var(--accent)]",children:["@",o.slice(0,7)]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[t.tasks.length," ",t.tasks.length===1?"agent":"agents"," · ",t.tasks.map(i=>(i.agentType??"claude").toLowerCase()).join(", ")]})]}),s&&e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:s.projectKey}),s&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:S(s.createdAt)}),e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:t.tasks.map(i=>e.jsx("span",{className:`h-2 w-2 rounded-full ${$(i.status)}`,title:i.status.toLowerCase()},i.id))})]})}function j({mode:t}){const{t:n}=h(),s=y(),[a,o]=d.useState([]),[i,u]=d.useState(!0),m=d.useCallback(async()=>{u(!0);try{const r=new URLSearchParams({taskMode:"review",limit:"100"});t==="in_progress"?r.set("status",[c.QUEUED,c.ASSIGNED,c.RUNNING,c.SUSPENDED].join(",")):r.set("status",[c.COMPLETED,c.FAILED,c.CANCELLED].join(","));const p=await g.get(`web/tasks?${r}`).json();o(G(p.data??[]))}catch{o([])}finally{u(!1)}},[t]);return d.useEffect(()=>{m()},[m]),i?e.jsx("div",{className:"p-4",children:e.jsx(E,{rows:4})}):a.length===0?e.jsx(k,{icon:N,title:n("review.no_reviews")}):e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:a.map(r=>e.jsx(O,{group:r,onClick:()=>s(`/review/${r.sourceTaskId}`)},r.sourceTaskId))})}function X(){const{t}=h(),n=C(r=>r.taskSeq),[s,a]=d.useState("pending"),[o,i]=d.useState(0);D(null);const u=d.useCallback(()=>i(r=>r+1),[]),m=[{key:"pending",label:t("review.pending")},{key:"in_progress",label:t("review.in_progress")},{key:"history",label:t("review.history")}];return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("h1",{className:"sr-only",children:t("review.title")}),e.jsx("div",{className:"mb-4 flex items-center gap-1 overflow-x-auto pb-1 no-scrollbar",children:m.map(r=>e.jsx("button",{onClick:()=>a(r.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${s===r.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:r.label},r.key))}),s==="pending"&&e.jsx(M,{onRefresh:u},`pending-${o}-${n}`),s==="in_progress"&&e.jsx(j,{mode:"in_progress"},`inprogress-${o}-${n}`),s==="history"&&e.jsx(j,{mode:"history"},`history-${o}-${n}`)]})}export{X as default};
@@ -0,0 +1 @@
1
+ import{r as l,j as t}from"./index-eKvCyU64.js";import{C as f}from"./chevron-down-B0Leook1.js";function h({value:r,onChange:x,options:c,placeholder:u,disabled:n=!1,className:m=""}){var i;const[a,o]=l.useState(!1),s=l.useRef(null),d=((i=c.find(e=>e.value===r))==null?void 0:i.label)??u??"";return l.useEffect(()=>{function e(v){s.current&&!s.current.contains(v.target)&&o(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.jsxs("div",{ref:s,className:`relative ${m}`,children:[t.jsxs("button",{type:"button",disabled:n,onClick:()=>!n&&o(!a),"aria-expanded":a,"aria-haspopup":"listbox",className:`flex w-full items-center justify-between rounded-[4px] border bg-[var(--bg-input)] px-3 py-2 font-mono text-xs outline-none transition-colors ${a?"border-[var(--accent)] text-[var(--text-primary)]":"border-[var(--border)] text-[var(--text-primary)] hover:border-[var(--text-muted)]"} ${n?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[t.jsx("span",{className:r?"":"text-[var(--text-muted)]",children:d}),t.jsx(f,{size:12,className:`ml-2 shrink-0 text-[var(--text-muted)] transition-transform ${a?"rotate-180":""}`})]}),a&&t.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-1 max-h-48 min-w-full w-max max-w-[calc(100vw-2rem)] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] py-1 shadow-lg",children:c.map(e=>t.jsxs("button",{type:"button",role:"option","aria-selected":e.value===r,onClick:()=>{x(e.value),o(!1)},className:`flex w-full items-center px-3 py-1.5 text-left font-mono text-xs transition-colors ${e.value===r?"bg-[var(--accent)]/10 text-[var(--accent)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.value===r&&t.jsx("span",{className:"mr-2 text-[var(--accent)]",children:">"}),e.label]},e.value))})]})}export{h as S};
@@ -1,4 +1,4 @@
1
- import{c as h,a as v,r,j as e,h as m,t as u}from"./index-GPUbNOkg.js";/**
1
+ import{c as h,a as v,r,j as e,h as m,t as u}from"./index-eKvCyU64.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e}from"./index-GPUbNOkg.js";const n="rounded-[4px] bg-[var(--border)] animate-pulse";function c({rows:r=5}){const a=[[60,200,80,120],[60,160,100,80],[60,220,70,140],[60,180,90,100],[60,190,110,90]];return e.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:r}).map((s,l)=>{const t=a[l%a.length];return e.jsx("div",{className:"flex gap-4",children:t.map((i,o)=>e.jsx("div",{className:n,style:{width:i,height:12}},o))},l)})})}function m({cards:r=4}){return e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Array.from({length:r}).map((a,s)=>e.jsx("div",{className:`${n} h-20`},s))})}export{m as C,c as T};
1
+ import{j as e}from"./index-eKvCyU64.js";const n="rounded-[4px] bg-[var(--border)] animate-pulse";function c({rows:r=5}){const a=[[60,200,80,120],[60,160,100,80],[60,220,70,140],[60,180,90,100],[60,190,110,90]];return e.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:r}).map((s,l)=>{const t=a[l%a.length];return e.jsx("div",{className:"flex gap-4",children:t.map((i,o)=>e.jsx("div",{className:n,style:{width:i,height:12}},o))},l)})})}function m({cards:r=4}){return e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Array.from({length:r}).map((a,s)=>e.jsx("div",{className:`${n} h-20`},s))})}export{m as C,c as T};
@@ -1 +1 @@
1
- import{a as t,j as e}from"./index-GPUbNOkg.js";import{I as c,C as r}from"./DocsPrimitives-2csfHzW_.js";import{E as n}from"./external-link-BYaw3Ovt.js";import"./copy-CukaPL3b.js";const o=[{action:"create tasks",desc:"describe what you want done, overlord dispatches to a worker"},{action:"list & monitor tasks",desc:"check status, read execution logs, track progress"},{action:"cancel & retry tasks",desc:"manage task lifecycle"},{action:"confirm pipeline stages",desc:"approve or provide input for suspended stages"},{action:"manage projects",desc:"list projects, view members"},{action:"check cluster health",desc:"see worker status, online workers, queue depth"},{action:"search",desc:"find tasks, projects, and workers by keyword"},{action:"read notifications",desc:"check and clear your notification inbox"}],d=['create a task in project "frontend" to fix the login page styling',"what tasks are running right now?","show me the logs for task 42","how many workers are online?","cancel task 15"],i=[{name:"claude code",url:"https://claude.com/claude-code"},{name:"cursor",url:"https://cursor.com/cli"},{name:"windsurf",url:"https://windsurf.com"},{name:"codex",url:"https://openai.com/codex"}];function u(){t();const a=typeof window<"u"?window.location.origin:"https://your-server";return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."})}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// install"}),e.jsx(c,{code:"npx skills add overlord-run/skill"})]}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// configure — set these environment variables"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=",e.jsx("span",{className:"text-[var(--accent)]",children:a})]}),e.jsx(r,{text:`export OVERLORD_SERVER=${a}`})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"your-token"})]}),e.jsx(r,{text:"export OVERLORD_TOKEN=your-token"})]})]}),e.jsxs("p",{className:"text-[11px] text-[var(--text-muted)]",children:["// create a token at ",e.jsx("a",{href:"/access-tokens",className:"text-[var(--accent)] hover:underline",children:"/access-tokens"})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> capabilities"}),e.jsx("div",{className:"space-y-2",children:o.map(s=>e.jsxs("div",{className:"flex items-start gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("span",{className:"shrink-0 text-xs font-medium text-[var(--text-primary)]",children:s.action}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.desc]})]},s.action))})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> example usage"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:"// just ask your ai agent naturally"}),d.map(s=>e.jsx("div",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:e.jsxs("code",{className:"text-xs text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> "}),s]})},s))]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> compatible tools"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:i.map(s=>e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2.5 text-xs text-[var(--text-primary)] transition-colors hover:border-[var(--accent)]",children:[s.name,e.jsx(n,{className:"h-3 w-3 text-[var(--text-muted)]"})]},s.name))}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:"// and any ai coding assistant that supports the skills protocol"})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["// open source:"," ",e.jsx("a",{href:"https://github.com/overlord-run/skill",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent)] hover:underline",children:"github.com/overlord-run/skill"})]})})]})}export{u as default};
1
+ import{a as t,j as e}from"./index-eKvCyU64.js";import{I as c,C as r}from"./DocsPrimitives-BMgSDhur.js";import{E as n}from"./external-link-DjBNV7ga.js";import"./copy-DEWCNXDf.js";const o=[{action:"create tasks",desc:"describe what you want done, overlord dispatches to a worker"},{action:"list & monitor tasks",desc:"check status, read execution logs, track progress"},{action:"cancel & retry tasks",desc:"manage task lifecycle"},{action:"confirm pipeline stages",desc:"approve or provide input for suspended stages"},{action:"manage projects",desc:"list projects, view members"},{action:"check cluster health",desc:"see worker status, online workers, queue depth"},{action:"search",desc:"find tasks, projects, and workers by keyword"},{action:"read notifications",desc:"check and clear your notification inbox"}],d=['create a task in project "frontend" to fix the login page styling',"what tasks are running right now?","show me the logs for task 42","how many workers are online?","cancel task 15"],i=[{name:"claude code",url:"https://claude.com/claude-code"},{name:"cursor",url:"https://cursor.com/cli"},{name:"windsurf",url:"https://windsurf.com"},{name:"codex",url:"https://openai.com/codex"}];function u(){t();const a=typeof window<"u"?window.location.origin:"https://your-server";return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."})}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// install"}),e.jsx(c,{code:"npx skills add overlord-run/skill"})]}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// configure — set these environment variables"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=",e.jsx("span",{className:"text-[var(--accent)]",children:a})]}),e.jsx(r,{text:`export OVERLORD_SERVER=${a}`})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"your-token"})]}),e.jsx(r,{text:"export OVERLORD_TOKEN=your-token"})]})]}),e.jsxs("p",{className:"text-[11px] text-[var(--text-muted)]",children:["// create a token at ",e.jsx("a",{href:"/access-tokens",className:"text-[var(--accent)] hover:underline",children:"/access-tokens"})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> capabilities"}),e.jsx("div",{className:"space-y-2",children:o.map(s=>e.jsxs("div",{className:"flex items-start gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("span",{className:"shrink-0 text-xs font-medium text-[var(--text-primary)]",children:s.action}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.desc]})]},s.action))})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> example usage"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:"// just ask your ai agent naturally"}),d.map(s=>e.jsx("div",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:e.jsxs("code",{className:"text-xs text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> "}),s]})},s))]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> compatible tools"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:i.map(s=>e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2.5 text-xs text-[var(--text-primary)] transition-colors hover:border-[var(--accent)]",children:[s.name,e.jsx(n,{className:"h-3 w-3 text-[var(--text-muted)]"})]},s.name))}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:"// and any ai coding assistant that supports the skills protocol"})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["// open source:"," ",e.jsx("a",{href:"https://github.com/overlord-run/skill",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent)] hover:underline",children:"github.com/overlord-run/skill"})]})})]})}export{u as default};
@@ -0,0 +1,21 @@
1
+ import{c as oe,a as xe,r as n,z as A,h as f,j as e,H as zt,t as W,v as Ee,A as Wt,f as Xt,B as Ht,q as Vt,s as Jt,k as dt,p as y,R as Qt,L as ie,l as mt,m as Yt,X as Se,n as Zt,x as es,U as ts,b as ss,G as _t,F as as}from"./index-eKvCyU64.js";import{u as rs}from"./task.store-BDZwafPm.js";import{u as ns,g as ls,a as pt,M as cs,H as is}from"./ConfirmStageDialog-BOGr-qSN.js";import{P as ut}from"./PtyTerminal-BYXg_ahq.js";import{S as ht}from"./Select-BAl7H-Y0.js";import{b as os,f as Y,c as xs}from"./date-RFA7-ZGs.js";import{a as Ct}from"./status-colors-yfNzOmz-.js";import{a as ft}from"./agent-type-options-BVIYXf2V.js";import{T as ds,g as Z}from"./task-constants-BWLt-ivk.js";import{T as ms}from"./Tooltip-Bl8LCgWr.js";import{A as ps}from"./arrow-left-CTo0KHGY.js";import{R as St}from"./rotate-ccw-CZR8KOZn.js";import{G as us}from"./git-fork-cRLOBM6a.js";import{P as vt}from"./play-Cqf1Kvc7.js";import{E as gt}from"./external-link-DjBNV7ga.js";import{L as Tt}from"./loader-circle-B_f_h4fq.js";import{S as hs}from"./skip-forward-BqiRx2ZQ.js";import{F as bt}from"./file-text-DHEz_RFq.js";import"./chevron-down-B0Leook1.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const fs=oe("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
7
+ * @license lucide-react v0.469.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const vs=oe("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
12
+ * @license lucide-react v0.469.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const gs=oe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
17
+ * @license lucide-react v0.469.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const bs=oe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);function js(l,c){const a=new Date(l).getTime()-Date.now();if(a<=0)return c("tasks.tunnel_expired");const r=Math.floor(a/36e5),t=Math.floor(a%36e5/6e4);return r>0?c("tasks.tunnel_expires_hm",{h:r,m:t}):c("tasks.tunnel_expires_m",{m:t})}function jt(l){switch(l){case"CONNECTED":return"var(--accent)";case"STARTING":return"var(--warning)";case"EXPIRED":return"var(--text-muted)";default:return"var(--text-muted)"}}function Nt(l,c){switch(l){case"IDLE":case"CLOSED":return c("tasks.tunnel_idle");case"STARTING":return c("tasks.tunnel_starting");case"CONNECTED":return c("tasks.tunnel_connected");case"EXPIRED":return c("tasks.tunnel_expired");case"CLOSING":return c("tasks.tunnel_closing");default:return String(l).toLowerCase()}}function Ns({taskId:l,taskFinished:c,compact:a}){const{t:r}=xe(),[t,x]=n.useState(A.IDLE),[m,_]=n.useState(null),[h,P]=n.useState(null),[R,ee]=n.useState(""),[d,C]=n.useState(!1),[de,O]=n.useState(!1),F=n.useRef(null),$=n.useCallback(async()=>{try{const v=await f.get(`web/workspace-tunnel/${l}/status`).json();x(v.status),_(v.tunnelUrl??null),P(v.expiresAt??null),(v.status==="EXPIRED"||v.status==="IDLE"||v.status==="CLOSED")&&S()}catch{}},[l]);function me(){S(),F.current=setInterval($,5e3)}function S(){F.current&&(clearInterval(F.current),F.current=null)}n.useEffect(()=>{c&&(t===A.STARTING||t===A.CONNECTED)&&(x(A.IDLE),_(null),S())},[c,t]),n.useEffect(()=>{if(t!=="CONNECTED"||!h)return;const v=()=>{const T=js(h,r);ee(T),T===r("tasks.tunnel_expired")&&(x(A.EXPIRED),_(null),S())};v();const D=setInterval(v,3e4);return()=>clearInterval(D)},[t,h]),n.useEffect(()=>()=>S(),[]),n.useEffect(()=>{c||$()},[$,c]);async function X(){C(!0);try{await f.post(`web/workspace-tunnel/${l}/start`),x(A.STARTING),me()}catch(v){let D=r("tasks.tunnel_start_failed");try{if(v instanceof zt){const T=await v.response.json();T!=null&&T.error&&(D=T.error,/code.*not found|ENOENT.*code|spawn code/i.test(D)&&(D+=". "+r("tasks.tunnel_install_code_hint")))}}catch{}W.error(D)}finally{C(!1)}}async function M(){C(!0);try{await f.post(`web/workspace-tunnel/${l}/stop`),x(A.IDLE),_(null),S()}catch{}finally{C(!1)}}async function U(){m&&(await navigator.clipboard.writeText(m),O(!0),setTimeout(()=>O(!1),2e3))}return a?e.jsxs("div",{className:"flex items-center gap-2 font-mono lowercase text-xs",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"ide_tunnel:"}),e.jsx("span",{style:{color:jt(t)},children:Nt(t,r)}),(t==="IDLE"||t==="CLOSED"||t==="EXPIRED")&&e.jsx("button",{onClick:X,disabled:d,className:"rounded-[4px] px-2 py-1 text-[var(--info)] disabled:opacity-50",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:r(d?"tasks.tunnel_starting":"tasks.tunnel_start")}),t==="CONNECTED"&&m&&e.jsx("a",{href:m.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] px-2 py-1 text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:r("tasks.tunnel_open_in_cursor")})]}):e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 font-mono lowercase",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.tunnel_header")}),e.jsxs("span",{className:"text-xs",style:{color:jt(t)},children:["● ",Nt(t,r)]})]}),t==="CONNECTED"&&h&&e.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["// ",R]}),t==="CONNECTED"&&m&&e.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"flex-1 truncate text-xs text-[var(--text-primary)]",children:m}),e.jsxs("button",{onClick:U,className:"shrink-0 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":r("tasks.tunnel_copy_url"),children:["[",r("common.copy"),"]"]})]}),de&&e.jsx("p",{className:"mb-2 text-xs text-[var(--accent)]",children:r("tasks.tunnel_copied")}),t==="STARTING"&&e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("tasks.tunnel_waiting")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(t==="IDLE"||t==="CLOSED")&&e.jsx("button",{onClick:X,disabled:d,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:r(d?"tasks.tunnel_starting_button":"tasks.tunnel_start_button")}),t==="STARTING"&&e.jsx("button",{onClick:M,disabled:d,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:r(d?"tasks.tunnel_stopping":"tasks.tunnel_cancel")}),t==="CONNECTED"&&m&&e.jsxs(e.Fragment,{children:[e.jsx("a",{href:m.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:r("tasks.tunnel_open_cursor")}),e.jsx("a",{href:m.replace(/^https?:/,"vscode:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("tasks.tunnel_open_vscode")}),e.jsx("button",{onClick:M,disabled:d,className:"rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors disabled:opacity-50",children:r(d?"tasks.tunnel_stopping":"tasks.tunnel_stop")})]}),t==="EXPIRED"&&e.jsx("button",{onClick:X,disabled:d,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:r(d?"tasks.tunnel_starting_button":"tasks.tunnel_restart")})]})]})}function ys({isOpen:l,onClose:c,onConfirm:a,taskId:r,isLoading:t}){const{t:x}=xe();return e.jsx(Ee,{isOpen:l,onClose:c,onConfirm:a,title:x("tasks.cancel_task_title"),message:x("tasks.cancel_task_message",{id:String(r)}),confirmLabel:x("tasks.cancel_task_confirm_label"),confirmVariant:"danger",isLoading:t})}function ks({isOpen:l,onClose:c,onConfirm:a,taskId:r,mrUrl:t,isLoading:x,reuseWorkspace:m,onReuseWorkspaceChange:_}){const{t:h}=xe(),P=t?h("tasks.retry_message_with_mr",{id:String(r),url:t}):h("tasks.retry_message_without_mr",{id:String(r)});return e.jsx(Ee,{isOpen:l,onClose:c,onConfirm:a,title:h("tasks.retry_title"),message:P,confirmLabel:h("tasks.retry_confirm_label"),confirmVariant:"accent",isLoading:x,children:e.jsxs("label",{className:"flex items-center gap-2 mt-3 text-[var(--text-muted)] text-xs cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:R=>_(R.target.checked),className:"w-3.5 h-3.5 cursor-pointer accent-[var(--accent)]"}),h("tasks.reuse_workspace_label")]})})}const _e=["implement","test","verify","review","simplify","submit"];function Te(l){if(typeof l=="string")try{return Te(JSON.parse(l))}catch{return null}if(!l||typeof l!="object")return null;const c=l.stages;if(!Array.isArray(c)||c.length===0)return null;const a=c.map(r=>r&&typeof r=="object"?r.name:null).filter(r=>typeof r=="string"&&r.length>0);return a.length===c.length?a:null}function ws(l){if(!l.configSnapshot)return _e;try{const c=JSON.parse(l.configSnapshot);return Te(c.pipeline)??Te(c)??_e}catch{return _e}}function _s(l){switch(l){case"stage_change":return"text-[var(--accent)]";case"info":return"text-[var(--text-secondary)]";case"warning":return"text-[var(--warning)]";case"error":return"text-[var(--destructive)]";case"system":return"text-[var(--info)]";default:return"text-[var(--text-muted)]"}}function Ce({status:l,agentType:c}){const a=Ct(l),r=Z(c);return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-0.5 text-xs",style:{color:a},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-[3px]",style:{backgroundColor:a}}),l.toLowerCase()," / ",r]})}function yt({stages:l,runningBg:c="bg-[#1a1a1a]",py:a="py-1.5"}){return e.jsx(e.Fragment,{children:l.map(r=>{const t=r.status==="completed",x=r.status==="running",m=r.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 ${a} ${x?c:""}`,children:[t&&e.jsx(as,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),x&&e.jsx(Tt,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),m&&e.jsx(Se,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),r.status==="pending"&&e.jsx(fs,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs",style:{color:t?"var(--accent)":x?"#e5e5e5":m?"var(--destructive)":"#525252",fontWeight:x?500:400},children:x?`> ${r.name}`:r.name})]},r.name)})})}function kt({task:l,ptyStatus:c,displayAgentType:a,t:r,gap:t="gap-2 md:gap-3"}){return e.jsxs("div",{className:`flex items-center ${t}`,children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:r("tasks.pty_terminal")}),e.jsxs("span",{className:`inline-flex items-center gap-1 text-[11px] ${c==="connected"?"text-[var(--accent)]":c==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${c==="connected"?"bg-[var(--accent)]":c==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),r(`tasks.${c}`)]}),e.jsx("span",{className:"text-[11px]",style:{color:Ct(l.status)},children:l.status.toLowerCase()}),l.currentStage&&e.jsxs("span",{className:"hidden md:inline text-[11px] text-[var(--accent)]",children:[r("tasks.stage"),": ",l.currentStage]}),e.jsxs("span",{className:"hidden md:inline text-[11px] text-[var(--text-muted)]",children:["agent: ",a]}),l.workerName&&e.jsxs("span",{className:"hidden md:inline text-[11px] text-[var(--text-muted)]",children:["worker: ",l.workerName]})]})}function wt({isFinished:l,takeoverState:c,ptyRef:a,t:r}){return e.jsxs(e.Fragment,{children:[!l&&c==="auto"&&e.jsxs("button",{onClick:()=>{var t;return(t=a.current)==null?void 0:t.requestTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-10 md:h-8 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:[e.jsx(is,{className:"h-3 w-3"}),r("tasks.take_over")]}),!l&&c==="manual"&&e.jsxs("button",{onClick:()=>{var t;return(t=a.current)==null?void 0:t.releaseTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-10 md:h-8 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(St,{className:"h-3 w-3"}),r("tasks.restore_auto")]})]})}function Cs(l){const c=ws(l),a=l.currentStage?c.indexOf(l.currentStage):-1;return c.map((r,t)=>{let x="pending";return l.status===y.COMPLETED?x="completed":l.status===y.FAILED&&t<=a?x=t===a?"failed":"completed":a>=0&&(t<a?x="completed":t===a&&(x="running")),{name:r,status:x}})}function z(l,c){if(!l||!c)return null;const a=l.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),r=c.split("/").map(encodeURIComponent).join("/");return l.gitPlatform===_t.GITLAB?`${a}/-/tree/${r}`:`${a}/tree/${r}`}function Ss(l,c){if(!l)return null;const a=l.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),r=c.split("/").map(encodeURIComponent).join("/");return l.gitPlatform===_t.GITLAB?`${a}/-/tree/${r}/docs/specs`:`${a}/tree/${r}/docs/specs`}function Xs(){var it,ot,xt;const{id:l}=Wt(),c=Xt(),{t:a}=xe(),r=rs(s=>s.cancelTask),[t,x]=n.useState(null),[m,_]=n.useState(null),[h,P]=n.useState([]),[R,ee]=n.useState(!0),[d,C]=n.useState(null),[de,O]=n.useState(!1),[F,$]=n.useState(!1),[me,S]=n.useState(!1),[X,M]=n.useState(!1),[U,v]=n.useState(["claude"]),[D,T]=n.useState(""),[Le,De]=n.useState(!1),[Ie,Re]=n.useState(!1),[Et,$e]=n.useState(!1),[Lt,Me]=n.useState(!1),[Dt,Ae]=n.useState(!1),[Pe,Oe]=n.useState(""),[Fe,Ue]=n.useState(""),[qe,Be]=n.useState("append"),[Ge,pe]=n.useState(!1),[Ke,It]=Ht(),[N,ue]=n.useState("terminal"),[ze,We]=n.useState([]),[te,Xe]=n.useState(0),[H,q]=n.useState(0),[V,He]=n.useState(""),[se,Rt]=n.useState(""),[$t,he]=n.useState(!1),[Mt,Ve]=n.useState(!1),[B,fe]=n.useState(null),[Je,ve]=n.useState("disconnected"),[ge,be]=n.useState("auto"),J=n.useRef(null),Qe=n.useRef(null),At=ns(),[Ye,Ze]=n.useState([]),o=Number(l),g=t?ds.includes(t.status):!1;Vt(t?Jt(t,100):null);const E=n.useCallback(async()=>{try{const s=await f.get(`web/tasks/${o}`).json();x(s)}catch{}},[o]),ae=n.useCallback(async()=>{try{const s=await f.get(`web/tasks/${o}/logs`).json();P(s.lines)}catch{}},[o]),G=n.useCallback(async()=>{try{const s=await f.get(`web/tasks/${o}/pending-confirm`).json();C(s.confirm)}catch{C(null)}},[o]),et=n.useCallback(async()=>{he(!0);try{const s=new URLSearchParams;s.set("limit","50"),s.set("offset",String(H*50)),V&&s.set("type",V),se&&s.set("search",se);const i=await f.get(`web/tasks/${o}/events?${s}`).json();We(i.events),Xe(i.total)}catch{}finally{he(!1)}},[o,H,V,se]);n.useEffect(()=>{N==="logs"&&et()},[N,et]),n.useEffect(()=>{N==="pipeline"&&!g&&f.get(`web/workspaces/${o}`).json().then(fe).catch(()=>fe(null))},[N,o,g]);const K=dt(s=>s.lastEvent),tt=dt(s=>s.eventSeq);n.useEffect(()=>{ee(!0),x(null),_(null),P([]),C(null),fe(null),We([]),Xe(0),q(0),he(!1),Promise.all([E(),ae(),G()]).finally(()=>ee(!1))},[E,ae,G]),n.useEffect(()=>{t!=null&&t.projectKey&&f.get(`web/projects/${t.projectKey}`).json().then(_).catch(()=>_(null))},[t==null?void 0:t.projectKey]),n.useEffect(()=>{if(!t)return;let s=!1;return(async()=>{try{const i=[],p=[];let u=t.sourceTaskId??null,L=0;for(;u!=null&&L<2;){const w=await f.get(`web/tasks/${u}`).json();p.unshift({id:w.id,taskMode:w.taskMode??"develop"}),u=w.sourceTaskId??null,L++}i.push(...p),i.push({id:t.id,taskMode:t.taskMode??"develop"});const I=await f.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(t.id),limit:"20"})}`).json();for(const w of I.data??[])i.push({id:w.id,taskMode:w.taskMode??"develop"});s||Ze(i)}catch{s||Ze([])}})(),()=>{s=!0}},[t==null?void 0:t.id,t==null?void 0:t.sourceTaskId,t==null?void 0:t.taskMode]),n.useEffect(()=>{!K||tt===0||(K.event==="task_status_changed"&&K.taskId===o||K.event==="task_created"&&K.taskId===o)&&(E(),G())},[tt,K,o,E,G]),n.useEffect(()=>{if(g)return;const i=setInterval(()=>{document.visibilityState!=="hidden"&&Promise.all([E(),ae(),G()])},15e3);return()=>clearInterval(i)},[g,E,ae,G]);const st=n.useCallback(()=>C(null),[]),re=n.useCallback(()=>{C(null),E()},[E]),Pt=(t==null?void 0:t.status)===y.FAILED||(t==null?void 0:t.status)===y.CANCELLED,je=(t==null?void 0:t.status)===y.COMPLETED||(t==null?void 0:t.status)===y.FAILED||(t==null?void 0:t.status)===y.CANCELLED,Ot=(t==null?void 0:t.status)===y.COMPLETED&&(!(t!=null&&t.taskMode)||(t==null?void 0:t.taskMode)==="develop");n.useEffect(()=>{Ke.get("action")==="fork"&&t&&!R&&(je&&at(),It(s=>(s.delete("action"),s),{replace:!0}))},[t,R,Ke,je]);async function Ft(){$e(!0);try{await r(o),O(!1),await E()}finally{$e(!1)}}async function Ut(){Me(!0);try{await f.post(`web/tasks/${o}/retry`,{json:{reuseWorkspace:Ge}}),$(!1),pe(!1),await E()}finally{Me(!1)}}function at(){Oe(""),Ue(""),Be("append"),S(!0)}async function qt(){Ae(!0);try{const s=Pe.trim()||void 0,i=await f.post(`web/tasks/${o}/fork`,{json:{description:s,descriptionMode:s?qe:void 0,agentType:Fe||void 0}}).json();S(!1),W.success(a("tasks.fork_success")),c(`/tasks/${i.task.id}`)}catch{W.error(a("tasks.fork_error"))}finally{Ae(!1)}}async function Bt(){if(t){Re(!0);try{await f.post(`web/tasks/${o}/review`,{json:{agentTypes:U.length>0?U:["claude"],description:D.trim()||void 0,skipFix:Le||void 0}}).json(),M(!1),T(""),De(!1),c(`/review/${o}`)}catch(s){const i=s instanceof Error?s.message:String(s);W.error(i)}finally{Re(!1)}}}const j=n.useMemo(()=>t?Cs(t):[],[t==null?void 0:t.configSnapshot,t==null?void 0:t.currentStage,t==null?void 0:t.status]),Ne=j.findIndex(s=>s.status==="running"),ne=n.useMemo(()=>{if(!(t!=null&&t.configSnapshot))return[];try{const s=JSON.parse(t.configSnapshot);return Array.isArray(s.defaultReviewers)?s.defaultReviewers:[]}catch{return[]}},[t==null?void 0:t.configSnapshot]);if(n.useEffect(()=>{ne.length>0&&v(ne)},[ne.join(",")]),R)return e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("tasks.loading_task")})});if(!t)return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:a("tasks.task_not_found")}),e.jsxs("button",{onClick:()=>c("/tasks"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",a("tasks.back_to_tasks")]})]});const k=t.status===y.QUEUED&&t.queuePosition!=null&&t.queueTotal!=null?{position:t.queuePosition,total:t.queueTotal}:null,b=os(t.startedAt,t.completedAt),Q=ls(t),ye=Z(t.agentType),Gt=[{value:"",label:a("tasks.fork_agent_type_placeholder",{agent:Z(Q)})},...ft(Z,Q)],le=`${a("tasks.status_suspended")} / ${ye}`,rt=k?e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"queue"}),e.jsxs("span",{className:"text-[var(--info)]",children:["#",k.position," / ",k.total]})]}):null,nt=t.taskMode&&t.taskMode!=="develop"?e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-bold uppercase",style:t.taskMode==="plan"?{color:"#3b82f6",backgroundColor:"rgba(59,130,246,0.12)"}:{color:"#a855f7",backgroundColor:"rgba(168,85,247,0.12)"},children:t.taskMode}):null,ce=Ye.length>1?e.jsx("div",{className:"flex items-center gap-1 text-xs text-[var(--text-secondary)]",children:Ye.map((s,i)=>e.jsxs(Qt.Fragment,{children:[i>0&&e.jsx("span",{className:"text-[var(--text-muted)]",children:"→"}),e.jsxs(ie,{to:`/tasks/${s.id}`,className:s.id===t.id?"text-[var(--accent)]":"text-[var(--info)] hover:underline",children:[s.taskMode," #",s.id]})]},s.id))}):t.sourceTaskId?e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["source:"," ",e.jsxs(ie,{to:`/tasks/${t.sourceTaskId}`,className:"text-[var(--info)] hover:underline",children:["#",t.sourceTaskId]})]}):null,lt=e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>c("/tasks"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(ps,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",title:Yt(t),children:["#",t.id," ",mt(t,80)]}),nt]}),ce&&e.jsx("div",{className:"text-[11px]",children:ce})]})]}),ke=e.jsxs("div",{className:"hidden md:flex items-center gap-4 border-b border-[var(--border)] bg-[var(--bg-primary)] px-5 shrink-0",style:{height:44},children:[e.jsx(Ce,{status:t.status,agentType:t.agentType}),nt,b&&e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// time cost: ",b]}),k&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsx("span",{className:"text-xs text-[var(--info)]",children:a("tasks.queue_position",{position:String(k.position),total:String(k.total)})})]}),e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs(ie,{to:`/projects/${t.projectKey}`,className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:["project: ",e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),t.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["branch: ",z(m,t.branch)?e.jsx("a",{href:z(m,t.branch),target:"_blank",rel:"noopener noreferrer",className:"text-[var(--text-primary)] hover:text-[var(--info)] hover:underline transition-colors",children:t.branch}):e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch})]})]}),t.mrUrl&&/^https?:\/\//.test(t.mrUrl)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline",children:["MR: ",((it=t.mrUrl.match(/!?\d+$/))==null?void 0:it[0])??"view"]})]}),ce&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),ce]})]}),ct=e.jsxs("div",{className:"flex items-center gap-3 border-t border-[var(--border)] bg-[var(--bg-primary)] px-4 md:px-5 shrink-0",style:{height:48},children:[!g&&e.jsxs("button",{onClick:()=>O(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--destructive)]/10 px-3 h-8 text-[11px] font-medium text-[var(--destructive)]",children:[e.jsx(Se,{className:"h-3 w-3"}),a("tasks.cancel_task")]}),Pt&&e.jsxs("button",{onClick:()=>$(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-3 h-8 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors cursor-pointer",children:[e.jsx(St,{className:"h-3 w-3"}),a("tasks.retry_task")]}),je&&e.jsxs("button",{onClick:at,className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-3 h-8 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors cursor-pointer",children:[e.jsx(us,{className:"h-3 w-3"}),a("tasks.fork_task")]}),Ot&&e.jsxs("button",{onClick:()=>M(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] px-3 h-8 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(vt,{className:"h-3 w-3"}),a("review.launch")]}),t.workerId&&!g&&e.jsxs("button",{onClick:()=>{ue("pipeline"),setTimeout(()=>{var s,i;(i=(s=Qe.current)==null?void 0:s.scrollIntoView)==null||i.call(s,{behavior:"smooth",block:"center"})},50)},className:"hidden lg:flex items-center justify-center gap-1.5 rounded-[4px] px-3 h-8 text-[11px] font-medium text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:[e.jsx(gt,{className:"h-3 w-3"}),a("tasks.cursor_tunnel")]})]}),Kt=e.jsxs("div",{className:"hidden w-[280px] shrink-0 flex-col gap-6 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-4 lg:flex",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.pipeline_stages")}),e.jsx(yt,{stages:j})]}),b&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-[11px] text-[var(--text-secondary)]",children:["// time cost: ",b]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.activity_log")}),h.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:h.slice(0,8).map((s,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]}),we=e.jsxs(e.Fragment,{children:[e.jsx(ys,{isOpen:de,onClose:()=>O(!1),onConfirm:Ft,taskId:o,isLoading:Et}),e.jsx(ks,{isOpen:F,onClose:()=>{$(!1),pe(!1)},onConfirm:Ut,taskId:o,mrUrl:t.mrUrl??void 0,isLoading:Lt,reuseWorkspace:Ge,onReuseWorkspaceChange:pe}),e.jsx(Ee,{isOpen:me,onClose:()=>S(!1),onConfirm:qt,title:a("tasks.fork_task"),message:a("tasks.fork_task_desc"),confirmLabel:a("tasks.fork_task"),confirmVariant:"accent",isLoading:Dt,children:e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["fork of #",o]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx(ht,{value:Fe,onChange:Ue,options:Gt})]}),e.jsx("textarea",{value:Pe,onChange:s=>Oe(s.target.value),placeholder:a("tasks.fork_description_placeholder"),rows:4,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 text-[11px] text-[var(--text-secondary)]",children:[e.jsx("input",{type:"checkbox",checked:qe==="replace",onChange:s=>Be(s.target.checked?"replace":"append"),className:"mt-0.5 h-3.5 w-3.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] accent-[var(--accent)]"}),e.jsxs("span",{children:[a("tasks.fork_replace_description"),e.jsx("span",{className:"mt-1 block text-[10px] text-[var(--text-muted)]",children:a("tasks.fork_append_hint")})]})]})]})}),X&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 font-mono",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("review.launch")}),e.jsx("button",{onClick:()=>M(!1),className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(Se,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsxs("p",{className:"text-[11px] text-[var(--text-muted)]",children:["task #",o," — ",a("review.select_agents")]}),ne.length>0&&e.jsx("span",{className:"rounded-[4px] border border-amber-500/40 bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-500",children:"using project defaults"})]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:ft(Z).map(s=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:U.includes(s.value),onChange:()=>v(i=>i.includes(s.value)?i.filter(p=>p!==s.value):[...i,s.value]),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:s.label})]},s.value))}),e.jsx("textarea",{value:D,onChange:s=>T(s.target.value),placeholder:a("review.description_placeholder"),rows:3,className:"mb-3 w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("label",{className:"mb-4 flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:Le,onChange:s=>De(s.target.checked),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-muted)]",children:a("review.skip_fix_label")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:Bt,disabled:Ie||U.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(vt,{className:"h-3 w-3"}),a(Ie?"common.processing":"review.launch")]}),e.jsx("button",{onClick:()=>M(!1),className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")})]})]})})]});return Mt&&N==="terminal"?e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[var(--bg-primary)] font-mono lowercase h-screen",style:{height:"100dvh",paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[ke,e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 shrink-0",style:{height:36,backgroundColor:"#111111"},children:[e.jsx(kt,{task:t,ptyStatus:Je,displayAgentType:Q,t:a,gap:"gap-3"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wt,{isFinished:g,takeoverState:ge,ptyRef:J,t:a}),e.jsx("button",{onClick:()=>Ve(!1),className:"flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1 text-[var(--text-muted)]",children:e.jsx(bs,{className:"h-3 w-3"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(ut,{ref:J,taskId:o,sessionId:t.currentSessionId??void 0,taskFinished:g,onStatusChange:ve,onTakeoverChange:be})}),ct,we]}):t.status===y.SUSPENDED?e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[lt,ke,e.jsx("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0",style:{backgroundColor:"rgba(245,158,11,0.08)",borderColor:"rgba(245,158,11,0.2)",color:"var(--warning)"},children:a("tasks.task_suspended_banner")}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row gap-4 md:gap-6 p-4 md:p-6 overflow-y-auto",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[e.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[e.jsxs("span",{className:"text-xl font-bold text-[var(--text-primary)]",children:["#",t.id]}),e.jsx("span",{className:"text-base text-[var(--text-secondary)] truncate max-w-[60%]",children:e.jsx(ms,{content:Zt(t),children:mt(t,200)})}),e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:le})]}),e.jsx("div",{className:"flex items-center gap-2 md:hidden",children:e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:le})}),d&&e.jsxs("div",{className:"rounded-[4px] border p-4",style:{borderColor:"rgba(245,158,11,0.27)",backgroundColor:"#1a1a1a"},children:[e.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:a("tasks.pending_confirmation")}),e.jsx("p",{className:"mb-3 text-xs text-[var(--text-secondary)]",children:d.prompt??a("tasks.pipeline_requires_confirmation")}),e.jsx("div",{className:"mb-3 flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"stage"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:d.stageName})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:flex-wrap md:gap-3",children:[e.jsx("button",{onClick:async()=>{try{await f.post(`web/tasks/${o}/confirm-stage`,{json:{stageName:d.stageName,approved:!0,feedback:""}}),re()}catch{W.error(a("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] bg-[var(--accent)] px-4 py-2.5 md:py-2 text-[11px] font-bold text-[#0c0c0c]",children:a("tasks.confirm_and_proceed")}),e.jsx("button",{onClick:async()=>{try{await f.post(`web/tasks/${o}/confirm-stage`,{json:{stageName:d.stageName,approved:!1,feedback:""}}),re()}catch{W.error(a("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] bg-[#1a1a1a] px-4 py-2.5 md:py-2 text-[11px] text-[var(--destructive)]",style:{border:"1px solid rgba(239,68,68,0.27)"},children:a("tasks.reject")})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"status"}),e.jsx("span",{className:"font-bold text-[var(--warning)]",children:le})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:Y(t.createdAt)})]})]})]}),e.jsx("div",{className:"hidden md:flex flex-wrap items-center gap-2 py-2",children:j.map((s,i)=>{const p=s.status==="failed",u=s.status==="completed",L=s.status==="running"&&t.status===y.SUSPENDED,I=p?"var(--destructive)":u?"var(--accent)":L?"var(--warning)":"#525252",w=p?"rgba(239,68,68,0.12)":u?"rgba(34,197,94,0.12)":L?"rgba(245,158,11,0.12)":"transparent";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px]",style:{color:I,backgroundColor:w,fontWeight:L?700:400,border:L?`1px solid ${I}`:void 0},children:L?"confirm":`${s.name}${u?" ✓":p?" ✗":""}`}),i<j.length-1&&e.jsx("div",{className:"h-px w-6 bg-[var(--border)]"})]},s.name)})}),e.jsxs("div",{className:"hidden md:block min-h-[200px] flex-1 rounded-[4px] border border-[var(--border)] bg-[#0c0c0c] p-4",children:[e.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:a("tasks.pty_output")}),e.jsxs("div",{className:"flex flex-col gap-1",children:[h.slice(-10).map((s,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-secondary)]",children:s},i)),h.length===0&&e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_output")})]})]})]}),e.jsxs("div",{className:"hidden w-[280px] shrink-0 flex-col gap-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:flex",children:[e.jsx("span",{className:"text-[13px] font-bold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"status"}),e.jsx("span",{className:"font-bold text-[var(--warning)]",children:le})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:a("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2",children:j.map(s=>{const i=s.status==="completed"?"var(--info)":s.status==="failed"?"var(--destructive)":s.status==="running"?"var(--warning)":"#525252",p=s.status==="failed"?"var(--destructive)":s.status==="running"?"var(--warning)":"#a3a3a3",u=s.status==="completed"?"completed":s.status==="running"?"suspended":s.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[4px]",style:{backgroundColor:i}}),e.jsxs("span",{className:"text-[11px]",style:{color:p,fontWeight:s.status==="running"?700:400},children:[s.name," ",u]})]},s.name)})}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsx("div",{className:"flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:Y(t.createdAt)})]})})]})]}),d&&e.jsx(pt,{isOpen:!!d,onClose:st,taskId:o,stageName:d.stageName,timeoutSeconds:Math.ceil(d.timeout/1e3),confirmType:d.confirmType,onSubmitted:re}),we]}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden font-mono lowercase",children:[lt,e.jsxs("div",{className:"flex flex-wrap items-center gap-3 gap-y-1 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-2 shrink-0 md:hidden",children:[e.jsx(Ce,{status:t.status,agentType:t.agentType}),b&&e.jsxs("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:["// time cost: ",b]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:t.projectKey}),t.workerName&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:t.workerName}),t.branch&&(z(m,t.branch)?e.jsx("a",{href:z(m,t.branch),target:"_blank",rel:"noopener noreferrer",className:"shrink-0 text-[11px] text-[var(--text-muted)] hover:text-[var(--info)] hover:underline truncate max-w-[80px] md:max-w-[120px] transition-colors",children:t.branch}):e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)] truncate max-w-[80px] md:max-w-[120px]",children:t.branch}))]}),ke,t.errorMessage&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-6 py-2 text-xs shrink-0 bg-[var(--destructive)]/10 text-[var(--destructive)]",style:{borderColor:"rgba(239,68,68,0.2)"},children:["// error: ",t.errorMessage]}),k&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0 text-[var(--info)]",style:{backgroundColor:"color-mix(in srgb, var(--info) 8%, transparent)",borderColor:"color-mix(in srgb, var(--info) 20%, transparent)"},children:[e.jsx(vs,{className:"h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{children:[a("tasks.queue_position_banner",{position:String(k.position),total:String(k.total)}),k.position>1?` — ${a("tasks.queue_ahead",{count:String(k.position-1)})}`:` — ${a("tasks.queue_next")}`]})]}),d&&e.jsx(pt,{isOpen:!!d,onClose:st,taskId:o,stageName:d.stageName,timeoutSeconds:Math.ceil(d.timeout/1e3),confirmType:d.confirmType,onSubmitted:re}),e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"flex items-center border-b border-[var(--border)] shrink-0 overflow-x-auto no-scrollbar",children:["terminal","pipeline","logs","detail"].map(s=>e.jsx("button",{onClick:()=>ue(s),className:`shrink-0 whitespace-nowrap px-4 py-2.5 text-xs transition-colors ${N===s?"border-b-2 border-[var(--accent)] text-[var(--accent)] font-medium":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(s==="terminal"?"tasks.terminal":s==="pipeline"?"tasks.pipeline_tab":s==="logs"?"tasks.logs":"tasks.detail_tab")},s))}),N==="terminal"&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-3 md:px-5 shrink-0",style:{height:36,backgroundColor:"#111111"},children:[e.jsx(kt,{task:t,ptyStatus:Je,displayAgentType:Q,t:a}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wt,{isFinished:g,takeoverState:ge,ptyRef:J,t:a}),!g&&ge==="requesting"&&e.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 h-10 md:h-8 text-[11px] text-[var(--warning)]",children:[e.jsx(Tt,{className:"h-3 w-3 animate-spin"}),a("tasks.requesting_takeover")]}),!g&&t.currentStage&&e.jsxs("button",{className:"hidden md:flex items-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-2.5 h-10 md:h-8 text-[11px] text-[var(--text-muted)]",children:[e.jsx(hs,{className:"h-3 w-3"}),a("tasks.skip_stage")]}),e.jsx("button",{onClick:()=>Ve(!0),className:"hidden md:flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 h-10 md:h-8 text-[var(--text-muted)]",children:e.jsx(gs,{className:"h-3 w-3"})})]})]}),e.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-2 shrink-0 md:hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.currentStage&&e.jsxs("span",{className:"text-[11px] font-semibold text-[var(--accent)]",children:[a("tasks.stage"),": ",t.currentStage]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",Q]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsx("div",{className:"overflow-x-auto no-scrollbar pr-4",style:{borderRadius:0},children:e.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[e.jsx("span",{className:"shrink-0 text-[11px] font-bold text-[var(--accent)]",children:a("tasks.stage_progress")}),j.map((s,i)=>{const p=s.status==="completed",u=s.status==="running",I=s.status==="failed"?"var(--destructive)":p||u?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"shrink-0 text-[11px] leading-normal whitespace-nowrap",style:{color:I,fontWeight:u?600:400},children:[s.name,p?" ✓":u?" ...":""]}),i<j.length-1&&e.jsx("div",{className:"mx-1.5 h-px w-4 shrink-0",style:{backgroundColor:I}})]},s.name)})]})})]}),At?e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(cs,{ref:J,taskId:o,sessionId:t.currentSessionId??void 0,taskFinished:g,onStatusChange:ve,onTakeoverChange:be})}):e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(ut,{ref:J,taskId:o,sessionId:t.currentSessionId??void 0,taskFinished:g,onStatusChange:ve,onTakeoverChange:be})}),ct]}),N==="pipeline"&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("div",{className:"mb-4 md:mb-5 overflow-x-auto no-scrollbar",style:{borderRadius:0},children:e.jsx("div",{className:"flex items-center py-5",children:j.map((s,i)=>{const p=s.status==="completed",u=s.status==="running",w=s.status==="failed"?"var(--destructive)":p||u?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",style:{flex:i<j.length-1?1:void 0},children:[e.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[e.jsxs("div",{className:"flex h-6 w-6 md:h-7 md:w-7 items-center justify-center rounded-full shrink-0",style:{backgroundColor:w},children:[p&&e.jsx("span",{className:"text-[11px] md:text-xs font-semibold text-[#0c0c0c]",children:"✓"}),u&&e.jsx("span",{className:"h-2 w-2 md:h-2.5 md:w-2.5 rounded-full bg-[#0c0c0c]"})]}),e.jsx("span",{className:"text-[11px] leading-normal font-medium whitespace-nowrap",style:{color:w},children:s.name})]}),i<j.length-1&&e.jsx("div",{className:"mx-1 md:mx-2 h-0.5 flex-1 min-w-3 rounded-full",style:{backgroundColor:i<(Ne>=0?Ne:0)?"var(--accent)":"#525252"}})]},s.name)})})}),t.currentStage&&e.jsxs("div",{className:"mb-4 md:mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 text-xs leading-relaxed",children:[e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// stage: ",t.currentStage," (",Ne+1,"/",j.length,")"]}),t.startedAt&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",Y(t.startedAt).replace(" ago","")]}),b&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",b]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// retries: ",t.retryCount,"/2"]})]}),!t.currentStage&&b&&e.jsx("div",{className:"mb-4 md:mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 text-xs leading-relaxed",children:e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",b]})}),e.jsx("button",{onClick:()=>ue("terminal"),className:"flex-1 min-h-[100px] rounded-[4px] border border-dashed border-[var(--border)] flex items-center justify-center gap-2 text-[11px] text-[var(--text-muted)] hover:border-[var(--accent)] hover:text-[var(--accent)] transition-colors",children:e.jsxs("span",{children:["// ",a("tasks.view_terminal")]})}),e.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"branch"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch??"-"})]}),rt]})]}),e.jsxs("div",{className:"flex flex-col gap-6 mt-4 lg:hidden",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.pipeline_stages")}),e.jsx(yt,{stages:j,runningBg:"bg-[var(--bg-input)]",py:"py-2"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.activity_log")}),h.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:h.slice(-12).map((s,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]})]}),N==="logs"&&e.jsxs("div",{className:"flex flex-1 flex-col gap-3 md:gap-5 overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)] md:hidden",children:a("tasks.task_logs")}),e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:gap-3",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar md:hidden",children:["","error","system"].map(s=>e.jsx("button",{onClick:()=>{He(s),q(0)},className:`shrink-0 rounded-[4px] px-2.5 py-1 text-[11px] ${V===s?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)]"}`,children:s||"all"},s))}),e.jsx("div",{className:"hidden md:block",children:e.jsx(ht,{value:V,onChange:s=>{He(s),q(0)},options:[{value:"",label:"all"},{value:"stage_change",label:"stage_change"},{value:"info",label:"info"},{value:"warning",label:"warning"},{value:"error",label:"error"},{value:"system",label:"system"}],className:"w-36"})}),e.jsxs("div",{className:"flex flex-1 items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:[e.jsx(es,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("tasks.search_logs"),value:se,onChange:s=>{Rt(s.target.value),q(0)},className:"flex-1 bg-transparent text-xs text-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)]"})]})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[ze.map((s,i)=>e.jsxs("div",{className:`flex items-start md:items-center gap-2 md:gap-4 rounded-[4px] px-2 md:px-3 py-2 text-[11px] md:text-xs ${i%2===0?"bg-[var(--bg-card)]":""}`,children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:new Date(s.timestamp).toLocaleTimeString("en-US",{hour12:!1})}),e.jsx("span",{className:`shrink-0 font-medium ${_s(s.type)}`,children:s.type}),e.jsx("span",{className:"min-w-0 break-words md:truncate text-[var(--text-primary)]",children:s.message})]},s.id)),ze.length===0&&!$t&&e.jsx("p",{className:"py-8 text-center text-xs text-[var(--text-muted)]",children:a("tasks.no_log_entries")})]}),te>50&&e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[Array.from({length:Math.ceil(te/50)}).slice(0,5).map((s,i)=>e.jsx("button",{onClick:()=>q(i),className:`rounded-[4px] px-2 py-1 text-xs ${H===i?"bg-[var(--accent)] text-black font-medium":"text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:i+1},i)),Math.ceil(te/50)>5&&e.jsx("button",{onClick:()=>q(H+1),disabled:H>=Math.ceil(te/50)-1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] disabled:opacity-30",children:">"})]})]}),N==="detail"&&e.jsxs("div",{className:"flex flex-1 flex-col gap-4 md:gap-5 overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(ts,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.detail_basic_info")})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.detail_creator")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.creatorName??"-"})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("common.created_at")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:xs(t.createdAt)}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:Y(t.createdAt)})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("common.status")}),e.jsx(Ce,{status:t.status,agentType:t.agentType})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.detail_project")}),e.jsx(ie,{to:`/projects/${t.projectKey}`,className:"text-xs text-[var(--info)] hover:underline transition-colors",children:t.projectKey})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.detail_worker")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:ye})]}),b&&e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.detail_time_cost")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:b})]}),t.branch&&e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.detail_branch")}),z(m,t.branch)?e.jsx("a",{href:z(m,t.branch),target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline transition-colors truncate",children:t.branch}):e.jsx("span",{className:"text-xs text-[var(--text-primary)] truncate",children:t.branch})]}),t.mrUrl&&/^https?:\/\//.test(t.mrUrl)&&e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.mr_link")}),e.jsx("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline truncate",children:((ot=t.mrUrl.match(/!?\d+$/))==null?void 0:ot[0])??"view"})]})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(bt,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.detail_task_name")})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[t.name&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.detail_ai_name")}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t.name})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.detail_task_id")}),e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["#",t.id]})]}),t.sourcePlatform&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.detail_source")}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:t.sourcePlatform})]})]})]}),t.taskMode==="plan"&&t.status===y.COMPLETED&&(()=>{let s="main";if(t.configSnapshot)try{const p=JSON.parse(t.configSnapshot);p.defaultBranch&&(s=p.defaultBranch)}catch{}const i=Ss(m,s);return i?e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(bt,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("plan.view_spec")})]}),e.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["the spec document was pushed to ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:s})," at ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"docs/specs/"})]}),e.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--info)] hover:underline transition-colors",children:[e.jsx(gt,{className:"h-3 w-3"}),a("plan.view_spec")]})]}):null})(),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(ss,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.detail_description")})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[#0c0c0c] p-4 overflow-x-auto",children:e.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--text-secondary)] font-mono",children:t.description})})]})]})]}),N==="terminal"&&Kt,N==="pipeline"&&e.jsxs("div",{className:"hidden w-[420px] shrink-0 flex-col gap-5 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-5 lg:flex",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"creator"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.creatorName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("common.created_at")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:Y(t.createdAt)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:ye})]}),b&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"time cost"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:b})]}),rt]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.workspace_section")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[e.jsxs("div",{className:"flex min-w-0 justify-between",children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:"branch"}),e.jsx("span",{className:"ml-4 min-w-0 truncate text-[var(--text-primary)]",children:t.branch??(B==null?void 0:B.branch)??"-"})]}),e.jsxs("div",{className:"flex min-w-0 justify-between",children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:"worktree"}),e.jsx("span",{className:"ml-4 min-w-0 truncate text-[var(--text-primary)]",children:(B==null?void 0:B.path)??"-"})]}),t.mrUrl&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("tasks.mr_link")}),e.jsx("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-[var(--info)] hover:underline",children:((xt=t.mrUrl.match(/!?\d+$/))==null?void 0:xt[0])??"view"})]})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{ref:Qe,className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.cursor_tunnel_section")}),t.workerId?e.jsx(Ns,{taskId:o,taskFinished:g,compact:!0}):e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.no_worker_assigned")})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2 text-xs",children:j.map(s=>{const i=s.status==="completed"?"✓":s.status==="running"?"→":"·",p=s.status==="running"?"var(--accent)":s.status==="completed"?"var(--info)":s.status==="failed"?"var(--destructive)":"#525252",u=s.status==="completed"?"done":s.status==="running"?"running...":s.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-semibold",style:{color:p},children:i}),e.jsx("span",{className:s.status==="running"?"font-medium":"",style:{color:p},children:s.name}),e.jsxs("span",{className:"text-[11px]",style:{color:"#525252"},children:["— ",u]})]},s.name)})})]})]})]}),we]})}export{Xs as default};
@@ -0,0 +1,19 @@
1
+ import{j as e}from"./index-eKvCyU64.js";import{a as s}from"./DocsPrimitives-BMgSDhur.js";import"./copy-DEWCNXDf.js";const a=`ov task create -d "implement oauth login" -p WEB -t feat
2
+ ov task plan -d "design auth system" -p WEB
3
+ ov task review 42 --agent codex,cursor
4
+ ov task fork 42 -d "retry with a simpler approach"`,r=`develop "implement oauth login" --project WEB --type feat
5
+ plan "design auth system" --project WEB
6
+ review #42 --agent codex,cursor
7
+ fork #42 "retry with a simpler approach"`,t=`QUEUED → ASSIGNED → RUNNING → [SUSPENDED ↔ RUNNING]* → COMPLETED
8
+
9
+ FAILED ←────────────────────────┘
10
+
11
+ CANCELLED`,c=`plan task ──(decompose)──▶ develop task₁
12
+ └──────────▶ develop task₂
13
+ └──────────▶ develop task₃
14
+
15
+ develop task ──(round 1)──▶ review task₁ (codex)
16
+ │ └▶ review task₂ (cursor)
17
+ └──(round 2)──▶ review task₃ (claude)
18
+
19
+ all review tasks point back to the same original develop task via sourceTaskId`;function i(){return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// task guide"}),e.jsx("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:"how task modes, task types, forks, and task relationships work in overlord."})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> the model in one sentence"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"task mode"})," chooses the workflow."]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"task type"})," describes the intent of develop work."]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"fork"})," is a creation strategy, not a mode."]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"source task id"})," links related tasks together."]})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> task modes"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"mode"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"when to use it"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"result"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"develop"})}),e.jsx("td",{className:"py-2 pr-4",children:"you already want implementation work to start"}),e.jsx("td",{className:"py-2",children:"code or docs changes on a working branch"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"plan"})}),e.jsx("td",{className:"py-2 pr-4",children:"the requirement needs discovery, discussion, or decomposition first"}),e.jsxs("td",{className:"py-2",children:["a spec in ",e.jsx("code",{children:"docs/specs/"}),", then save-or-decompose"]})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"review"})}),e.jsx("td",{className:"py-2 pr-4",children:"a completed develop task needs cross-model review"}),e.jsx("td",{className:"py-2",children:"review findings, plus optional fix work"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> task types"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"task types mainly describe the intent of develop work and help branch naming stay readable."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"type"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"use it for"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"feat"})}),e.jsx("td",{className:"py-2",children:"new functionality"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"fix"})}),e.jsx("td",{className:"py-2",children:"bug fixes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"refactor"})}),e.jsx("td",{className:"py-2",children:"internal restructuring without intended behavior change"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"docs"})}),e.jsx("td",{className:"py-2",children:"documentation work"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"chore"})}),e.jsx("td",{className:"py-2",children:"maintenance and operational cleanup"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> related concepts"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("p",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"fork"})," creates a new task from an old one. it is not another task mode."]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"source task id"})," links plan -> develop, develop -> review, and source -> fork chains."]}),e.jsxs("p",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"status"})," is separate from both mode and type. queued, running, suspended, completed, failed, and cancelled are lifecycle states."]})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> which one should i use?"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("p",{children:["start implementation now -> ",e.jsx("code",{className:"text-[var(--accent)]",children:"develop"})]}),e.jsxs("p",{children:["shape the requirement first -> ",e.jsx("code",{className:"text-[var(--accent)]",children:"plan"})]}),e.jsxs("p",{children:["inspect finished code from another agent -> ",e.jsx("code",{className:"text-[var(--accent)]",children:"review"})]}),e.jsxs("p",{children:["retry or continue previous work -> ",e.jsx("code",{className:"text-[var(--accent)]",children:"fork"})]})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> entry points"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"goal"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"where to do it"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"normal implementation task"}),e.jsxs("td",{className:"py-2",children:["web task create, ",e.jsx("code",{children:"ov task create"}),", or ",e.jsx("code",{children:"develop ..."})]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"interactive planning session"}),e.jsxs("td",{className:"py-2",children:[e.jsx("code",{children:"/plan"}),", ",e.jsx("code",{children:"ov task plan"}),", or ",e.jsx("code",{children:"plan ..."})]})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"review a completed develop task"}),e.jsxs("td",{className:"py-2",children:[e.jsx("code",{children:"/review"}),", ",e.jsx("code",{children:"ov task review"}),", or ",e.jsx("code",{children:"review ..."})]})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> cli examples"}),e.jsx(s,{code:a})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> bot examples"}),e.jsx(s,{code:r})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> lifecycle overview"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"all three modes share the same state machine. suspended means the task is waiting for external input — a developer decision — before it can continue."}),e.jsx(s,{code:t}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"status"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"meaning"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"queued"})}),e.jsx("td",{className:"py-2",children:"waiting to be assigned to a worker"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"assigned"})}),e.jsx("td",{className:"py-2",children:"worker selected, preparing to execute"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"running"})}),e.jsx("td",{className:"py-2",children:"agent active, pipeline stages executing"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"suspended"})}),e.jsx("td",{className:"py-2",children:"paused at a confirm gate — waiting for developer input"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"completed"})}),e.jsx("td",{className:"py-2",children:"all pipeline stages finished successfully"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"failed"})}),e.jsx("td",{className:"py-2",children:"unrecoverable error during execution"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"cancelled"})}),e.jsx("td",{className:"py-2",children:"explicitly cancelled, or rejected as not-selected reviewer"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> develop mode lifecycle"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the standard implementation workflow. most tasks in overlord are develop tasks."}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("p",{children:["1. create task via web / bot / cli — ",e.jsx("code",{className:"text-[var(--accent)]",children:"taskMode='develop'"})]}),e.jsxs("p",{children:["2. scheduler assigns a worker → sends ",e.jsx("code",{className:"text-[var(--accent)]",children:"ExecuteTaskFrame"})]}),e.jsxs("p",{children:["3. worker creates branch ",e.jsx("code",{className:"text-[var(--accent)]",children:"{taskType}/#ID-slug"})," and a fresh worktree"]}),e.jsx("p",{children:"4. project pipeline runs stage by stage in the pty terminal"}),e.jsxs("p",{children:["5. if a stage has ",e.jsx("code",{className:"text-[var(--accent)]",children:"requireConfirm"})," → task moves ",e.jsx("code",{className:"text-[var(--accent)]",children:"running → suspended"})]}),e.jsxs("p",{children:["6. developer approves or rejects → task resumes ",e.jsx("code",{className:"text-[var(--accent)]",children:"suspended → running"})]}),e.jsxs("p",{children:["7. all stages done → ",e.jsx("code",{className:"text-[var(--accent)]",children:"completed"}),", branch preserved, mr/pr created"]})]}),e.jsx("div",{className:"overflow-x-auto mt-2",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"workspace"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"details"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"branch"}),e.jsxs("td",{className:"py-2",children:["new ",e.jsx("code",{className:"text-[var(--accent)]",children:"{taskType}/#ID-slug"})]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"worktree"}),e.jsx("td",{className:"py-2",children:"new independent worktree per task"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"after completion"}),e.jsx("td",{className:"py-2",children:"branch kept, mr/pr created"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> plan mode lifecycle"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"an interactive planning session. the agent reads the codebase, discusses requirements via pty, writes a spec, then waits for a developer decision."}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("p",{children:["1. create via bot ",e.jsx("code",{className:"text-[var(--accent)]",children:'plan "..." --project KEY'})," / web /plan / cli ",e.jsx("code",{className:"text-[var(--accent)]",children:"ov task plan"})]}),e.jsxs("p",{children:["2. worker creates temp branch ",e.jsxs("code",{className:"text-[var(--accent)]",children:["plan-tmp-","{taskId}"]})," based on ",e.jsx("code",{className:"text-[var(--accent)]",children:"defaultBranch"})]}),e.jsx("p",{children:"3. pipeline runs four stages:"}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("code",{className:"text-[var(--accent)]",children:"analyze"}),": agent reads the project codebase"]}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("code",{className:"text-[var(--accent)]",children:"discuss"}),": interactive pty conversation with developer about requirements"]}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("code",{className:"text-[var(--accent)]",children:"document"}),": spec written to ",e.jsx("code",{className:"text-[var(--accent)]",children:"docs/specs/YYYY-MM-DD-slug.md"}),", committed to temp branch"]}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("code",{className:"text-[var(--accent)]",children:"confirm"})," (confirmType: plan_decompose): task moves ",e.jsx("code",{className:"text-[var(--accent)]",children:"running → suspended"})]}),e.jsx("p",{children:"4. developer decides:"}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"decompose into tasks"})," (approve) → ",e.jsx("code",{className:"text-[var(--accent)]",children:"suspended → running"}),", agent creates develop tasks from spec → ",e.jsx("code",{className:"text-[var(--accent)]",children:"completed"})]}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"save spec only"})," (reject) → spec already pushed to defaultBranch → ",e.jsx("code",{className:"text-[var(--accent)]",children:"completed"})," immediately"]})]}),e.jsx("div",{className:"overflow-x-auto mt-2",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"workspace"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"details"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"branch"}),e.jsxs("td",{className:"py-2",children:["temp ",e.jsxs("code",{className:"text-[var(--accent)]",children:["plan-tmp-","{taskId}"]})," based on defaultBranch"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"spec location"}),e.jsx("td",{className:"py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"docs/specs/YYYY-MM-DD-slug.md"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"after completion"}),e.jsx("td",{className:"py-2",children:"spec pushed to defaultBranch, temp branch deleted"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> review mode lifecycle"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"cross-model code review in three phases: parallel review → aggregated report → optional fix."}),e.jsx("p",{className:"text-xs text-[var(--accent)]",children:"phase 1 — parallel review"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("p",{children:['1. trigger via web "launch review" / bot ',e.jsx("code",{className:"text-[var(--accent)]",children:"review #42 --agent codex,cursor"})," / cli ",e.jsx("code",{className:"text-[var(--accent)]",children:"ov task review 42"})]}),e.jsx("p",{children:"2. pre-checks: source task must be a completed develop task, source branch must exist"}),e.jsxs("p",{children:["3. one review task created per agentType (",e.jsx("code",{className:"text-[var(--accent)]",children:"taskMode='review'"}),"), inheriting source task's configSnapshot"]}),e.jsxs("p",{children:["4. redis records this round: ",e.jsxs("code",{className:"text-[var(--accent)]",children:["review_round:","{sourceTaskId}:{round}"]})]}),e.jsxs("p",{children:["5. each review task gets a worker, creates branch ",e.jsxs("code",{className:"text-[var(--accent)]",children:["review-tmp-","{taskId}"]})," based on source task branch"]}),e.jsx("p",{children:"6. pipeline stages per review task:"}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("code",{className:"text-[var(--accent)]",children:"review"}),": fetch diff, read code, run tests"]}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("code",{className:"text-[var(--accent)]",children:"report"}),": generate structured report json, send via ",e.jsx("code",{className:"text-[var(--accent)]",children:"review_report"})," frame"]}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("code",{className:"text-[var(--accent)]",children:"fix"})," (requireConfirm): task moves ",e.jsx("code",{className:"text-[var(--accent)]",children:"running → suspended"})]})]}),e.jsx("p",{className:"text-xs text-[var(--accent)] pt-2",children:"phase 2 — aggregated report"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("p",{children:["7. server ReviewReportHandler on each ",e.jsx("code",{className:"text-[var(--accent)]",children:"review_report"})," frame:"]}),e.jsxs("p",{className:"pl-4",children:["— stores report in redis: ",e.jsxs("code",{className:"text-[var(--accent)]",children:["review_report:","{taskId}"]})," (24h ttl)"]}),e.jsxs("p",{className:"pl-4",children:["— tracks reported count in: ",e.jsxs("code",{className:"text-[var(--accent)]",children:["review_reported:","{sourceTaskId}:{round}"]})]}),e.jsxs("p",{className:"pl-4",children:["— all reported → emits ",e.jsx("code",{className:"text-[var(--accent)]",children:"review_round_complete"})," event → websocket push to browser"]}),e.jsx("p",{children:"8. web switches automatically from progress view to report view:"}),e.jsx("p",{className:"pl-4",children:"— progress view (tasks still running): per-agent cards with embedded pty terminals"}),e.jsx("p",{className:"pl-4",children:"— report view (all suspended): aggregated issue list sorted by severity, action buttons"})]}),e.jsx("p",{className:"text-xs text-[var(--accent)] pt-2",children:"phase 3 — fix decision"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsx("p",{children:"9. three actions available from the report view:"}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"fix"}),": POST approve-fix → selected review task ",e.jsx("code",{className:"text-[var(--accent)]",children:"suspended → running"})," (runs fix stage), others → cancelled"]}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"no fix needed"}),": POST skip-fix → all suspended review tasks → completed"]}),e.jsxs("p",{className:"pl-4",children:["— ",e.jsx("span",{className:"text-[var(--accent)]",children:"review again"}),": POST review → new round, round number increments"]}),e.jsx("p",{children:"10. fix complete → review task completed, changes pushed back to source task branch, temp branch deleted"})]}),e.jsx("div",{className:"overflow-x-auto mt-2",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"workspace"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"details"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"branch"}),e.jsxs("td",{className:"py-2",children:["temp ",e.jsxs("code",{className:"text-[var(--accent)]",children:["review-tmp-","{taskId}"]})," based on source task branch"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"report storage"}),e.jsxs("td",{className:"py-2",children:["redis ",e.jsxs("code",{className:"text-[var(--accent)]",children:["review_report:","{taskId}"]}),", 24h ttl"]})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"after fix"}),e.jsx("td",{className:"py-2",children:"changes pushed to source task branch, temp branch deleted"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> task relationships"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["tasks are linked via ",e.jsx("code",{className:"text-[var(--accent)]",children:"sourceTaskId"}),". the task detail page shows the full relationship chain."]}),e.jsx(s,{code:c}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("p",{children:[e.jsx("code",{className:"text-[var(--accent)]",children:"plan → develop"}),": sourceTaskId on each develop task points to the originating plan task"]}),e.jsxs("p",{children:[e.jsx("code",{className:"text-[var(--accent)]",children:"develop → review"}),": sourceTaskId on each review task points to the source develop task"]}),e.jsxs("p",{children:[e.jsx("code",{className:"text-[var(--accent)]",children:"source → fork"}),": sourceTaskId on the fork task points to the original task"]}),e.jsx("p",{children:"every review round — including round 2, 3, etc — still points back to the same original develop task"})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> redis keys"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"review-related state is stored in redis with a 24-hour ttl. no additional database tables are used."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"key"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"purpose"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"ttl"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("code",{className:"text-[var(--accent)]",children:["review_report:","{taskId}"]})}),e.jsx("td",{className:"py-2 pr-4",children:"review report json (summary + issues[])"}),e.jsx("td",{className:"py-2",children:"24h"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("code",{className:"text-[var(--accent)]",children:["review_round_count:","{sourceTaskId}"]})}),e.jsx("td",{className:"py-2 pr-4",children:"current round number for a source task"}),e.jsx("td",{className:"py-2",children:"24h"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("code",{className:"text-[var(--accent)]",children:["review_round:","{sourceTaskId}:{round}"]})}),e.jsx("td",{className:"py-2 pr-4",children:"taskIds belonging to this round"}),e.jsx("td",{className:"py-2",children:"24h"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("code",{className:"text-[var(--accent)]",children:["review_reported:","{sourceTaskId}:{round}"]})}),e.jsx("td",{className:"py-2 pr-4",children:"set of taskIds that have submitted reports this round"}),e.jsx("td",{className:"py-2",children:"24h"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> api endpoints"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["review-specific endpoints. standard task crud uses ",e.jsx("code",{className:"text-[var(--accent)]",children:"POST /api/web/tasks"})," with a ",e.jsx("code",{className:"text-[var(--accent)]",children:"taskMode"})," body field."]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"method"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"endpoint"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"purpose"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"POST"})}),e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"/api/web/tasks"})}),e.jsx("td",{className:"py-2",children:"create task — body.taskMode controls the mode (develop / plan / review)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"POST"})}),e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"/api/web/tasks/:id/review"})}),e.jsxs("td",{className:"py-2",children:["launch a review round — body: ","{ agentTypes: string[] }"]})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"GET"})}),e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"/api/web/tasks/:id/reviews"})}),e.jsx("td",{className:"py-2",children:"fetch all review tasks + redis reports for a develop task"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"POST"})}),e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"/api/web/tasks/:id/approve-fix"})}),e.jsx("td",{className:"py-2",children:"confirm fix — selected review task suspended → running, others → cancelled"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"POST"})}),e.jsx("td",{className:"py-2 pr-4",children:e.jsx("code",{className:"text-[var(--accent)]",children:"/api/web/tasks/:id/skip-fix"})}),e.jsx("td",{className:"py-2",children:"skip fix — all suspended review tasks → completed"})]})]})]})})]})]})]})}export{i as default};
@@ -0,0 +1 @@
1
+ import{R as pe,f as J,a as $,p as u,j as e,l as ee,n as me,u as ue,i as he,r,h as P,X as be,k as ve,w as fe,H as ge,t as W,x as ye,y as V,m as je}from"./index-eKvCyU64.js";import{u as X}from"./task.store-BDZwafPm.js";import{T as te}from"./TaskStatusBadge-BdNFkrjU.js";import{f as se}from"./date-RFA7-ZGs.js";import{T as ke}from"./Tooltip-Bl8LCgWr.js";import{G as re}from"./git-fork-cRLOBM6a.js";import{S as A}from"./Select-BAl7H-Y0.js";import{a as Ne}from"./task-constants-BWLt-ivk.js";import{g as Ce}from"./agent-type-options-BVIYXf2V.js";import{C as we}from"./copy-DEWCNXDf.js";import{E as Y}from"./EmptyState-Di2nOiOt.js";import{T as Z}from"./Skeleton-DA5o8Wqi.js";import{P as Se}from"./plus-DwBKB0x6.js";import{C as _e}from"./chevron-left-59qctCaF.js";import{C as Te}from"./chevron-right-XfJqITCa.js";import"./status-colors-yfNzOmz-.js";import"./chevron-down-B0Leook1.js";const Ee=pe.memo(function({task:s}){const d=J(),{t:c}=$(),x=(a,b)=>c(`common.${a}`,{n:b}),i=s.status===u.COMPLETED||s.status===u.FAILED||s.status===u.CANCELLED;return e.jsxs("tr",{onClick:()=>d(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:e.jsx(ke,{content:me(s),children:ee(s)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(te,{status:s.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.developerName??s.creatorName??"-"}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.workerName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:e.jsxs("span",{className:"flex items-center gap-2",children:[se(s.createdAt,x),i&&e.jsx("button",{onClick:a=>{a.stopPropagation(),d(`/tasks/${s.id}?action=fork`)},className:"shrink-0 rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] hover:bg-[var(--bg-input)] transition-colors",title:c("tasks.fork_task"),children:e.jsx(re,{className:"h-3 w-3"})})]})})]})});function De({isOpen:n,onClose:s,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:a}=$();ue(o=>o.user);const b=he(),[p,K]=r.useState(""),[h,B]=r.useState(""),[m,I]=r.useState("feat"),[k,C]=r.useState(""),[w,S]=r.useState(""),[f,_]=r.useState(""),[g,y]=r.useState(""),[T,O]=r.useState(""),[M,R]=r.useState([]),[z,N]=r.useState(""),j=d.find(o=>o.key===p),H=Ce(o=>o,j==null?void 0:j.agentType);r.useEffect(()=>{if(!n||(K(""),B(""),I("feat"),C(""),S(""),_(""),y(""),O(""),N(""),!b))return;const o=new AbortController;return P.get("admin/developers",{signal:o.signal}).json().then(R).catch(()=>{}),()=>o.abort()},[n,b]),r.useEffect(()=>{if(!n)return;function o(D){D.key==="Escape"&&s()}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n,s]);async function E(o){if(o.preventDefault(),N(""),!p||!h.trim()){N(a("tasks.project_and_description_required"));return}try{await x({projectKey:p,description:h.trim(),workerId:g||void 0,developerId:T?Number(T):void 0,taskType:m,branchSlug:w.trim()||void 0,agentType:k||void 0,targetBranch:f.trim()||void 0})}catch(D){const L=D instanceof Error?D.message:a("tasks.failed_to_create_task");N(L)}}return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&s()},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:s,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(be,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:E,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.project")}),e.jsx(A,{value:p,onChange:K,options:d.map(o=>({value:o.key,label:o.name})),placeholder:a(c?"common.loading":"tasks.select_project"),disabled:c})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_type")}),e.jsx(A,{value:m,onChange:I,options:Ne})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx(A,{value:k,onChange:C,options:H})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_description")}),e.jsx("textarea",{value:h,onChange:o=>B(o.target.value),placeholder:a("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_worker")}),e.jsx("input",{type:"text",value:g,onChange:o=>y(o.target.value),placeholder:a("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.branch_slug")}),e.jsx("input",{type:"text",value:w,onChange:o=>S(o.target.value),placeholder:a("tasks.branch_slug_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_branch")}),e.jsx("input",{type:"text",value:f,onChange:o=>_(o.target.value),placeholder:a("tasks.target_branch_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),b&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(A,{value:T,onChange:O,options:M.map(o=>({value:String(o.id),label:o.name})),placeholder:a("tasks.select_developer")})]}),z&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:z})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:s,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:i||!p||!h.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:a(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function Fe({isOpen:n,onClose:s,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:a}=$();return!x||!n?null:e.jsx("div",{onClick:s,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:b=>b.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(we,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",x.id," · ",x.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:x.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:s,disabled:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>c(x.id),style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:d,disabled:i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1},children:a(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function Pe({task:n}){const s=J(),d=n.status===u.COMPLETED||n.status===u.FAILED||n.status===u.CANCELLED;return e.jsxs("div",{onClick:()=>s(`/tasks/${n.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2",title:je(n),children:["#",n.id," ",ee(n)]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),s(`/tasks/${n.id}?action=fork`)},className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:e.jsx(re,{className:"h-3 w-3"})}),e.jsx(te,{status:n.status})]})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:se(n.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.workerName})]})]})]})}const Ae=[{key:"all",labelKey:"tasks.tab_all"},{key:u.RUNNING,labelKey:"tasks.tab_running"},{key:u.QUEUED,labelKey:"tasks.tab_queued"},{key:u.COMPLETED,labelKey:"tasks.tab_completed"},{key:u.FAILED,labelKey:"tasks.tab_failed"},{key:u.CANCELLED,labelKey:"tasks.tab_cancelled"}],Ie=20;function Ye(){const n=J(),{t:s}=$(),{tasks:d,loading:c,fetchTasks:x}=X(),i=ve(t=>t.taskSeq),[a,b]=r.useState("all"),[p,K]=r.useState(""),[h,B]=r.useState(""),[m,I]=r.useState(""),[k,C]=r.useState(void 0),[w,S]=r.useState([]),f=X(t=>t.nextCursor),[_,g]=r.useState(!1);fe(r.useMemo(()=>e.jsxs("button",{onClick:()=>g(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(Se,{className:"h-3.5 w-3.5"}),s("tasks.new_task")]}),[s]));const[y,T]=r.useState([]),[O,M]=r.useState(!1),[R,z]=r.useState([]),[N,j]=r.useState(!1),[H,E]=r.useState(!1),[o,D]=r.useState(null),[L,q]=r.useState(null),G=r.useCallback(t=>{const l={limit:String(Ie)};return a!=="all"&&(l.status=a),p&&(l.projectKey=p),h&&(l.developerId=h),t&&(l.cursor=t),l},[a,p,h]);r.useEffect(()=>{x(G(k))},[G,k,x,i]),r.useEffect(()=>{C(void 0),S([])},[a,p,h]),r.useEffect(()=>{let t=!1;return(async()=>{try{const[v,xe]=await Promise.all([P.get("web/projects").json(),P.get("web/projects/-/developers").json()]);if(t)return;T(v),z(xe)}catch{}})(),()=>{t=!0}},[]),r.useEffect(()=>{if(!_||y.length>0)return;M(!0);let t=!1;return(async()=>{try{const v=await P.get("web/projects").json();t||T(v)}catch{}finally{t||M(!1)}})(),()=>{t=!0}},[_,y.length]);const ae=r.useCallback(async t=>{j(!0);try{const l=await P.post("web/tasks",{json:{projectKey:t.projectKey,description:t.description,workerId:t.workerId,developerId:t.developerId,taskType:t.taskType,branchSlug:t.branchSlug,agentType:t.agentType,targetBranch:t.targetBranch}}).json();g(!1),n(`/tasks/${l.task.id}`)}catch(l){if(l instanceof ge&&l.response.status===409){try{const v=await l.response.json();if(v.confirmRequired){D({id:v.confirmRequired.taskId,description:v.confirmRequired.message,status:"active"}),q(t),g(!1),E(!0);return}}catch{}W.error(s("tasks.similar_task_exists"))}else{const v=l instanceof Error?l.message:String(l);W.error(v)}}finally{j(!1)}},[n]),oe=r.useCallback(async()=>{if(L){j(!0);try{const t=await P.post("web/tasks",{json:{...L,force:!0}}).json();E(!1),q(null),n(`/tasks/${t.task.id}`)}finally{j(!1)}}},[L,n]),F=r.useMemo(()=>{if(!m.trim())return d;const t=m.toLowerCase();return d.filter(l=>(l.name??"").toLowerCase().includes(t)||l.description.toLowerCase().includes(t)||String(l.id).includes(m))},[d,m]),ne=r.useCallback(()=>{f&&(S(t=>[...t,k??""]),C(f))},[f,k]),le=r.useCallback(()=>{S(t=>{if(t.length===0)return t;const l=t.slice(0,-1);return C(t.at(-1)||void 0),l})},[]),ce=w.length+1,ie=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...y.map(t=>({value:t.key,label:t.name}))],[y,s]),de=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...R.map(t=>({value:String(t.id),label:t.name}))],[R,s]),Q=s(m?"tasks.try_adjusting_search":"tasks.create_first_task"),U=m?void 0:e.jsx("button",{onClick:()=>g(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:s("tasks.create_task")});return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar pr-4 md:pr-0",children:Ae.map(t=>e.jsx("button",{onClick:()=>b(t.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${a===t.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:s(t.labelKey)},t.key))}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative md:w-52",children:[e.jsx(ye,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:s("tasks.search_tasks"),value:m,onChange:t=>I(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),m&&e.jsx("button",{onClick:()=>I(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]}),e.jsx(A,{value:p,onChange:K,options:ie,className:"md:w-40"}),e.jsx(A,{value:h,onChange:B,options:de,className:"md:w-40"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:s("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.time")})]})}),e.jsxs("tbody",{children:[c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Z,{rows:5})})}),!c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U})})}),F.map(t=>e.jsx(Ee,{task:t},t.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[c&&F.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(Z,{rows:5})}),!c&&F.length===0&&e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U}),F.map(t=>e.jsx(Pe,{task:t},t.id))]}),(w.length>0||f)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",ce]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:le,disabled:w.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(_e,{className:"h-3.5 w-3.5"}),s("tasks.prev")]}),e.jsxs("button",{onClick:ne,disabled:!f,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[s("common.next"),e.jsx(Te,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(De,{isOpen:_,onClose:()=>g(!1),projects:y,projectsLoading:O,onSubmit:ae,isSubmitting:N}),e.jsx(Fe,{isOpen:H,onClose:()=>{E(!1),q(null)},onForceCreate:oe,onViewExisting:t=>{E(!1),q(null),n(`/tasks/${t}`)},similarTask:o,isLoading:N})]})}export{Ye as default};
@@ -1 +1 @@
1
- import{a as l,j as a}from"./index-GPUbNOkg.js";import{a as u}from"./status-colors-C_RhLQKM.js";const r={QUEUED:"tasks.status_queued",ASSIGNED:"tasks.status_assigned",RUNNING:"tasks.status_running",SUSPENDED:"tasks.status_suspended",COMPLETED:"tasks.status_completed",FAILED:"tasks.status_failed",CANCELLED:"tasks.status_cancelled"};function E({status:s}){const{t:e}=l(),t=r[s],n=t?e(t):(s??"unknown").toLowerCase(),o=u(s);return a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs",style:{color:o},children:[a.jsx("span",{style:{fontSize:"0.6rem"},children:"●"}),n]})}export{E as T};
1
+ import{a as l,j as a}from"./index-eKvCyU64.js";import{a as u}from"./status-colors-yfNzOmz-.js";const r={QUEUED:"tasks.status_queued",ASSIGNED:"tasks.status_assigned",RUNNING:"tasks.status_running",SUSPENDED:"tasks.status_suspended",COMPLETED:"tasks.status_completed",FAILED:"tasks.status_failed",CANCELLED:"tasks.status_cancelled"};function E({status:s}){const{t:e}=l(),t=r[s],n=t?e(t):(s??"unknown").toLowerCase(),o=u(s);return a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs",style:{color:o},children:[a.jsx("span",{style:{fontSize:"0.6rem"},children:"●"}),n]})}export{E as T};
@@ -0,0 +1,6 @@
1
+ import{c as ie,o as oe,h as A,p as S,a as M,r as i,k as q,q as ce,s as le,j as e,X as Z,v as de,f as xe,l as me,m as pe}from"./index-eKvCyU64.js";import{g as ee,M as ue,C as he,a as ve}from"./ConfirmStageDialog-BOGr-qSN.js";import{u as fe}from"./task.store-BDZwafPm.js";import{i as z,O as te}from"./OnboardingGuide-CqcX04SL.js";import{S as E}from"./Select-BAl7H-Y0.js";import{a as se}from"./status-colors-yfNzOmz-.js";import{a as ge}from"./date-RFA7-ZGs.js";import{T as G,a as J,g as be}from"./task-constants-BWLt-ivk.js";import{g as je}from"./agent-type-options-BVIYXf2V.js";import{u as ae}from"./useFetch-CVFGit7a.js";import{P as $}from"./plus-DwBKB0x6.js";import{C as ke}from"./chevron-down-B0Leook1.js";import{C as ye}from"./chevron-up-BW2PVBfH.js";import{W as Ne}from"./wifi-BJIfMBKB.js";import"./loader-circle-B_f_h4fq.js";import"./rotate-ccw-CZR8KOZn.js";import"./PtyTerminal-BYXg_ahq.js";import"./file-text-DHEz_RFq.js";import"./chevron-right-XfJqITCa.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Te=ie("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),ne="overlord_home_terminal";function we(){try{const t=localStorage.getItem(ne);if(t)return JSON.parse(t)}catch{}return{pinnedTaskIds:[],activeTaskId:null}}let Q="";function R(t){const a=JSON.stringify(t);a!==Q&&(Q=a,localStorage.setItem(ne,a))}const V=we(),Se=new Set([S.QUEUED,S.ASSIGNED,S.RUNNING,S.SUSPENDED]);let B=!1;const Ce=oe((t,a)=>({pinnedTaskIds:V.pinnedTaskIds,activeTaskId:V.activeTaskId,taskMetas:{},stageConfirm:null,loading:!1,setActiveTask:s=>{t({activeTaskId:s}),R({pinnedTaskIds:a().pinnedTaskIds,activeTaskId:s})},pinTask:s=>{const{pinnedTaskIds:n}=a();if(n.includes(s))return;const c=[...n,s];t({pinnedTaskIds:c}),R({pinnedTaskIds:c,activeTaskId:a().activeTaskId})},unpinTask:s=>{const{pinnedTaskIds:n,activeTaskId:c,taskMetas:m}=a(),r=n.filter(v=>v!==s),d=c===s?r[0]??null:c,{[s]:h,...o}=m;t({pinnedTaskIds:r,activeTaskId:d,taskMetas:o}),R({pinnedTaskIds:r,activeTaskId:d})},loadActiveTasks:async()=>{if(!B){B=!0,t({loading:!0});try{const n=(await A.get("web/tasks",{searchParams:{limit:"30"}}).json()).data.filter(o=>Se.has(o.status)),c={};for(const o of n)c[o.id]={id:o.id,name:o.name,description:o.description,status:o.status,projectKey:o.projectKey,workerName:o.workerName??null,agentType:ee(o),currentStage:o.currentStage,currentSessionId:o.currentSessionId,updatedAt:o.updatedAt};const r=[...n].sort((o,v)=>v.updatedAt.localeCompare(o.updatedAt)).map(o=>o.id),{activeTaskId:d}=a(),h=d&&r.includes(d)?d:r[0]??null;t({taskMetas:c,pinnedTaskIds:r,activeTaskId:h}),R({pinnedTaskIds:r,activeTaskId:h})}catch{}finally{B=!1,t({loading:!1})}}},fetchStageConfirm:async s=>{try{const n=await A.get(`web/tasks/${s}/pending-confirm`).json();t({stageConfirm:n.confirm})}catch{t({stageConfirm:null})}},clearStageConfirm:()=>t({stageConfirm:null}),updateTaskMeta:(s,n)=>{const{taskMetas:c}=a(),m=c[s];m&&t({taskMetas:{...c,[s]:{...m,...n}}})}}));function _e(){const[t,a]=i.useState(()=>z());i.useEffect(()=>{const n=()=>a(!0),c=()=>a(z());return window.addEventListener("onboarding-dismissed",n),window.addEventListener("storage",c),()=>{window.removeEventListener("onboarding-dismissed",n),window.removeEventListener("storage",c)}},[]);const{data:s}=ae(()=>t?Promise.resolve(null):A.get("web/dashboard/stats").json(),[t]);return t||!s?null:{activeTasks:(s.active_tasks??0)+(s.queued_tasks??0),totalWorkers:s.online_workers??0,totalProjects:s.project_count??0,totalDevelopers:s.developer_count??0}}function Ie({taskId:t,confirm:a,onSubmitted:s}){const{t:n}=M(),[c,m]=i.useState(a.timeout),[r,d]=i.useState(!1),[h,o]=i.useState(!1),v=a.confirmType==="plan_review"||a.confirmType==="code_review",u=a.confirmType==="plan_decompose";i.useEffect(()=>{m(a.timeout);const b=setInterval(()=>{m(N=>N<=1?(clearInterval(b),0):N-1)},1e3);return()=>clearInterval(b)},[a.timeout,a.stageName]);const g=i.useCallback(async b=>{d(!0);try{await A.post(`web/tasks/${t}/confirm-stage`,{json:{stageName:a.stageName,approved:b}}),s()}catch{}finally{d(!1)}},[t,a.stageName,s]);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b-2 border-[var(--warning)] bg-[var(--warning)]/10 px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(he,{className:"h-3.5 w-3.5 shrink-0 text-[var(--warning)]"}),e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["// stage: ",a.stageName]}),e.jsx("span",{className:"shrink-0 text-xs text-[var(--warning)]",children:ge(c)})]}),e.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:u?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>g(!1),disabled:r,className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:n("tasks.reject_plan_decompose")}),e.jsx("button",{onClick:()=>g(!0),disabled:r,className:"rounded-[4px] bg-[var(--accent)] px-2 py-1 text-[11px] text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:n(r?"tasks.stage_submitting":"tasks.approve_plan_decompose")})]}):v?e.jsx("button",{onClick:()=>o(!0),className:"rounded-[4px] bg-[var(--accent)] px-2 py-1 text-[11px] text-black hover:opacity-90 transition-opacity",children:a.confirmType==="plan_review"?n("tasks.approve_plan"):n("tasks.approve_review")}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>g(!1),disabled:r,className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:n("tasks.reject")}),e.jsx("button",{onClick:()=>g(!0),disabled:r,className:"rounded-[4px] bg-[var(--accent)] px-2 py-1 text-[11px] text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:n(r?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})})]}),v&&e.jsx(ve,{isOpen:h,onClose:()=>o(!1),taskId:t,stageName:a.stageName,timeoutSeconds:Math.ceil(a.timeout/1e3),confirmType:a.confirmType,onSubmitted:s})]})}function Ee({projectKey:t,onProjectChange:a,onCreated:s}){const{t:n}=M(),c=fe(x=>x.createTask),[m,r]=i.useState(""),[d,h]=i.useState("feat"),[o,v]=i.useState(void 0),[u,g]=i.useState(!1),[b,N]=i.useState(!1),[L,D]=i.useState(!1),{data:C}=ae(()=>A.get("web/projects").json(),[]),j=i.useMemo(()=>{const x=(C??[]).map(F=>({value:F.key,label:F.key}));return[{value:"",label:n("terminal_home.all_projects")},...x]},[C,n]),k=i.useMemo(()=>(C??[]).find(x=>x.key===t)??null,[C,t]),T=i.useMemo(()=>je(x=>x,k==null?void 0:k.agentType),[k==null?void 0:k.agentType]),_=i.useRef(!1);i.useEffect(()=>{if(!_.current){if(t){_.current=!0;return}j.length>1&&(a(j[1].value),_.current=!0)}},[t,j,a]),i.useEffect(()=>{v(void 0)},[t]);const p=o??"",O=i.useCallback(x=>{v(x||void 0)},[]),w=!!t&&!!m.trim();function f(){w&&N(!0)}async function I(){if(N(!1),!!w){g(!0);try{const x=await c({projectKey:t,description:m.trim(),taskType:d,agentType:o||void 0});r(""),s(x.id)}catch{}finally{g(!1)}}}const U=n("terminal_home.confirm_create_message").replace("{taskType}",d).replace("{projectKey}",t).replace("{description}",m.trim()),P="flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex items-center gap-2 border-b border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:[e.jsx("div",{className:"w-[140px]",children:e.jsx(E,{value:t,onChange:a,options:j,placeholder:n("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(E,{value:d,onChange:h,options:J})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(E,{value:p,onChange:O,options:T,placeholder:n("tasks.form_agent_type"),disabled:u||!t})}),e.jsx("input",{type:"text",value:m,onChange:x=>r(x.target.value),onKeyDown:x=>x.key==="Enter"&&f(),placeholder:n("terminal_home.task_description_placeholder"),className:P,disabled:u}),e.jsxs("button",{onClick:f,disabled:u||!w,className:"flex items-center gap-1 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:[e.jsx($,{className:"h-3 w-3"}),n(u?"common.creating":"terminal_home.new_task")]})]}),e.jsx("div",{className:"md:hidden border-b border-[var(--border)] bg-[var(--bg-card)]",children:L?e.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(E,{value:t,onChange:a,options:j,placeholder:n("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(E,{value:d,onChange:h,options:J})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(E,{value:p,onChange:O,options:T,placeholder:n("tasks.form_agent_type"),disabled:u||!t})}),e.jsx("button",{onClick:()=>D(!1),className:"p-1 text-[var(--text-muted)]",children:e.jsx(Z,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:m,onChange:x=>r(x.target.value),onKeyDown:x=>x.key==="Enter"&&f(),placeholder:n("terminal_home.task_description_placeholder"),className:P,disabled:u}),e.jsx("button",{onClick:f,disabled:u||!w,className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:e.jsx($,{className:"h-3 w-3"})})]})]}):e.jsxs("button",{onClick:()=>D(!0),className:"flex w-full items-center justify-center gap-1 py-2 text-xs text-[var(--accent)] hover:opacity-80",children:[e.jsx($,{className:"h-3.5 w-3.5"}),n("terminal_home.new_task")]})}),e.jsx(de,{isOpen:b,onClose:()=>N(!1),onConfirm:I,title:n("terminal_home.confirm_create_title"),message:U,confirmVariant:"accent",confirmLabel:n("terminal_home.new_task"),isLoading:u})]})}function Y({status:t,size:a}){const s=t===S.SUSPENDED,n=se(t),c=a==="sm"?"h-1.5 w-1.5":"h-2 w-2";return e.jsx("span",{className:`${c} shrink-0 rounded-full ${s?"animate-pulse":""}`,style:{backgroundColor:s?"var(--warning)":n}})}function Ae({tasks:t,activeId:a,onSelect:s,onUnpin:n,children:c}){const m=xe();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex flex-col border-r border-[var(--border)] bg-[var(--bg-card)] overflow-y-auto",style:{width:200,minWidth:200},children:[e.jsx("div",{className:"border-b border-[var(--border)] px-3 py-2",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// active tasks"})}),t.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):e.jsx("div",{className:"flex-1",children:t.map(r=>{const d=r.id===a;return e.jsxs("div",{onClick:()=>s(r.id),className:`group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${d?"bg-[var(--accent)]/10 text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.jsx(Y,{status:r.status,size:"md"}),e.jsxs("div",{className:"flex-1 min-w-0",title:pe(r),children:[e.jsxs("div",{className:"truncate text-xs",children:["#",r.id," ",me(r)]}),e.jsx("div",{className:"text-[10px] text-[var(--text-muted)]",children:r.projectKey})]}),e.jsx("button",{onClick:h=>{h.stopPropagation(),n(r.id)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--text-primary)]",title:"unpin",children:e.jsx(Z,{className:"h-3 w-3"})}),e.jsx("button",{onClick:h=>{h.stopPropagation(),m(`/tasks/${r.id}`)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--accent)]",title:"open detail",children:e.jsx("span",{className:"text-[10px] leading-none",children:"→"})})]},r.id)})})]}),e.jsxs("div",{className:"flex flex-col md:hidden",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar border-b border-[var(--border)] bg-[var(--bg-card)] px-2",style:{height:44},children:t.length===0?e.jsx("div",{className:"flex items-center justify-center w-full",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):t.map(r=>{const d=r.id===a;return e.jsxs("button",{onClick:()=>s(r.id),className:`flex shrink-0 items-center gap-1.5 px-3 border-b-2 transition-colors ${d?"border-[var(--accent)] text-[var(--text-primary)]":"border-transparent text-[var(--text-secondary)]"}`,style:{height:44},children:[e.jsx(Y,{status:r.status,size:"sm"}),e.jsxs("span",{className:"text-[11px] whitespace-nowrap",children:["#",r.id]})]},r.id)})}),c]})]})}function Me({task:t,takeoverState:a,onTakeover:s,onRelease:n}){const c=se(t.status),m=be(t.agentType),r=ee(t);return e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:36,minHeight:36},children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:t.projectKey}),e.jsxs("span",{className:"text-[11px]",style:{color:c},children:[t.status.toLowerCase()," / ",m]}),t.currentStage&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"hidden md:inline text-[11px] text-[var(--text-muted)]",children:["// stage: ",t.currentStage]}),e.jsxs("span",{className:"md:hidden text-[11px] text-[var(--text-muted)]",children:["stage: ",t.currentStage]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",r]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsx("div",{className:"flex items-center gap-1"})]})}function De({task:t,ptyStatus:a}){const s=a==="connected";return e.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:28,minHeight:28},children:[e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:t.currentStage?`stage: ${t.currentStage}`:`task #${t.id}`}),e.jsxs("span",{className:`flex items-center gap-1 text-[10px] ${s?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:[s?e.jsx(Ne,{className:"h-2.5 w-2.5"}):e.jsx(Te,{className:"h-2.5 w-2.5"}),s?"connected":a]})]})}function K({onboardingData:t}){const[a,s]=i.useState(!1),{t:n}=M();return t?a?e.jsxs("div",{className:"border-b border-[var(--accent)]/30",children:[e.jsxs("button",{onClick:()=>s(!1),className:"flex w-full items-center justify-between bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:n("onboarding.getting_started")}),e.jsx(ye,{className:"h-3 w-3 text-[var(--text-muted)]"})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx(te,{data:t})})]}):e.jsxs("button",{onClick:()=>s(!0),className:"flex w-full items-center justify-between border-b border-[var(--accent)]/30 bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",style:{height:36},children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:n("onboarding.getting_started")}),e.jsx(ke,{className:"h-3 w-3 text-[var(--text-muted)]"})]}):null}function X({onboardingData:t}){const{t:a}=M();return e.jsx("div",{className:`flex flex-1 flex-col items-center p-4 md:p-6 ${t?"overflow-auto":"justify-center"}`,children:t?e.jsx("div",{className:"w-full max-w-lg",children:e.jsx(te,{data:t})}):e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"mb-3 text-3xl text-[var(--border)]",children:[">","_"]}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("terminal_home.no_active_tasks")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("terminal_home.create_task_hint")})]})})}function Ze(){const{t}=M(),{pinnedTaskIds:a,activeTaskId:s,taskMetas:n,stageConfirm:c,loading:m,setActiveTask:r,pinTask:d,unpinTask:h,loadActiveTasks:o,fetchStageConfirm:v,clearStageConfirm:u,updateTaskMeta:g}=Ce(),b=i.useRef(null),[N,L]=i.useState("disconnected"),[D,C]=i.useState("auto"),[j,k]=i.useState(""),T=q(l=>l.lastEvent),_=q(l=>l.status),p=s?n[s]??null:null,O=p?G.includes(p.status):!1,w=i.useRef(!1);i.useEffect(()=>{!w.current&&p&&(k(p.projectKey),w.current=!0)},[p]);const f=i.useMemo(()=>{const l=a.map(y=>n[y]).filter(Boolean);return j?l.filter(y=>y.projectKey===j):l},[a,n,j]);i.useEffect(()=>{f.length>0&&s&&!f.some(l=>l.id===s)&&r(f[0].id)},[f,s,r]);const I=_e();ce(p?le(p):null),i.useEffect(()=>{o()},[o]),i.useEffect(()=>{s&&(p==null?void 0:p.status)===S.SUSPENDED?v(s):u()},[s,p==null?void 0:p.status,v,u]),i.useEffect(()=>{if(T){if(T.event==="task_status_changed"){const{taskId:l,status:y,currentStage:H}=T,W={status:y,updatedAt:new Date().toISOString()};H!==void 0&&(W.currentStage=H),g(l,W),y===S.SUSPENDED&&l===s&&v(l),G.includes(y)&&l===s&&u()}T.event==="task_created"&&o()}},[T,s,v,u,g,o]),i.useEffect(()=>{if(_==="connected")return;const y=setInterval(()=>{document.visibilityState!=="hidden"&&o()},15e3);return()=>clearInterval(y)},[_,o]);const U=i.useCallback(l=>{d(l),r(l),o()},[d,r,o]),P=i.useCallback(()=>{u(),o()},[u,o]),x=i.useCallback(()=>{var l;(l=b.current)==null||l.requestTakeover()},[]),F=i.useCallback(()=>{var l;(l=b.current)==null||l.releaseTakeover()},[]);if(m&&a.length===0)return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("common.loading")})});const re=f.length>0;return e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsx(Ee,{projectKey:j,onProjectChange:k,onCreated:U}),e.jsx("div",{className:"flex flex-col md:flex-row flex-1 overflow-hidden",children:re?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{tasks:f,activeId:s,onSelect:r,onUnpin:h,children:e.jsx("div",{className:"md:hidden",children:e.jsx(K,{onboardingData:I})})}),e.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:p?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(K,{onboardingData:I})}),e.jsx(Me,{task:p,takeoverState:D,onTakeover:x,onRelease:F}),c&&s&&e.jsx(Ie,{taskId:s,confirm:c,onSubmitted:P}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(ue,{taskId:s,sessionId:p.currentSessionId??void 0,taskFinished:O,onStatusChange:L,onTakeoverChange:C,ref:b},s)}),e.jsx(De,{task:p,ptyStatus:N})]}):e.jsx(X,{onboardingData:I})})]}):e.jsx(X,{onboardingData:I})})]})}export{Ze as default};