@overlordai/server 1.0.178 → 1.0.179

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 (123) hide show
  1. package/dist/adapters/help-text.d.ts.map +1 -1
  2. package/dist/adapters/help-text.js +3 -2
  3. package/dist/adapters/help-text.js.map +1 -1
  4. package/dist/adapters/nlu.service.js +4 -4
  5. package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
  6. package/dist/dispatcher/task-creation.service.js +3 -1
  7. package/dist/dispatcher/task-creation.service.js.map +1 -1
  8. package/package.json +4 -4
  9. package/public/assets/{AccessTokensPage-1EKC1hiZ.js → AccessTokensPage-BbryzvnM.js} +1 -1
  10. package/public/assets/{AdminPage-51tboyFu.js → AdminPage-BultWF7a.js} +1 -1
  11. package/public/assets/AgentCliPage-SW_JKwzo.js +5 -0
  12. package/public/assets/{ApiReferencePage-TgiwRipe.js → ApiReferencePage-BawqrcYL.js} +1 -1
  13. package/public/assets/{ArchitecturePage-BzeZql6h.js → ArchitecturePage-FWLevT4m.js} +1 -1
  14. package/public/assets/{AuditLogPage-y6n7Px8g.js → AuditLogPage-DrxyZ_N_.js} +1 -1
  15. package/public/assets/{AutomationCreatePage-CajNO4bS.js → AutomationCreatePage-CWA--vuT.js} +1 -1
  16. package/public/assets/{AutomationDetailPage-Dgf3Tb9C.js → AutomationDetailPage-BFNJn9l0.js} +1 -1
  17. package/public/assets/{AutomationEditPage-DYaZj31T.js → AutomationEditPage-y5p6I8v9.js} +1 -1
  18. package/public/assets/{AutomationListPage-DxPUmPbs.js → AutomationListPage-Bhgxxu6_.js} +1 -1
  19. package/public/assets/{AutomationRunDetailPage-DmNxMDk5.js → AutomationRunDetailPage-eRVHSPgi.js} +1 -1
  20. package/public/assets/{BindPlatformPage-MYeCpBFT.js → BindPlatformPage-JgPH-GyV.js} +1 -1
  21. package/public/assets/{BotIntegrationPage-Dnk8iYbr.js → BotIntegrationPage-yO7OUlpc.js} +1 -1
  22. package/public/assets/{BotManage-96DyyPVc.js → BotManage-BwplAxcP.js} +1 -1
  23. package/public/assets/{BotSetupPage-esAmTt5X.js → BotSetupPage-vF-1zbQt.js} +1 -1
  24. package/public/assets/{ChangelogPage-BZmrhbzu.js → ChangelogPage-Dvz1CT1l.js} +1 -1
  25. package/public/assets/{Checkbox-CQt3GUhI.js → Checkbox-Cv1IaY0N.js} +1 -1
  26. package/public/assets/{CliReferencePage-D-PUOTbI.js → CliReferencePage-CcCgOSoY.js} +3 -3
  27. package/public/assets/{ConfirmStageDialog-DIsZM7QS.js → ConfirmStageDialog-pDcoEYGK.js} +1 -1
  28. package/public/assets/{ConnectorsManage-v8CzbHwB.js → ConnectorsManage-B8aIKAfR.js} +1 -1
  29. package/public/assets/{ConnectorsPage-Czxmo0rf.js → ConnectorsPage-DpvBzw0u.js} +1 -1
  30. package/public/assets/{DeploymentPage-BmfGIQ--.js → DeploymentPage-2CGTHVvc.js} +1 -1
  31. package/public/assets/{DevWorkflowPage-BwP87xBb.js → DevWorkflowPage-C9dwRqkd.js} +1 -1
  32. package/public/assets/{DeveloperManage-Bu-dU6qo.js → DeveloperManage-CP4AFGVd.js} +1 -1
  33. package/public/assets/{DeveloperSetupPage-PXns-tkJ.js → DeveloperSetupPage-CAUfLPib.js} +1 -1
  34. package/public/assets/{DocsIndexPage-DHYB2eq5.js → DocsIndexPage-_KFl66Pi.js} +1 -1
  35. package/public/assets/{DocsLayout-DLxSnG0D.js → DocsLayout-yhAysfLb.js} +1 -1
  36. package/public/assets/{DocsPrimitives-D7h19aXG.js → DocsPrimitives-BLjrk7dq.js} +1 -1
  37. package/public/assets/{EditProjectPage-BC0UDNOv.js → EditProjectPage-C-i9mvrD.js} +1 -1
  38. package/public/assets/{EmptyState-CMDagsi4.js → EmptyState-DCvtEuqr.js} +1 -1
  39. package/public/assets/{EnvVariablesPage-BB7ahnB1.js → EnvVariablesPage-DHlRltEG.js} +1 -1
  40. package/public/assets/{HomePage-CssNquOH.js → HomePage-zVLfdxgB.js} +1 -1
  41. package/public/assets/{InfoRow-BxIE0xaA.js → InfoRow-0V76rcDX.js} +1 -1
  42. package/public/assets/{InstallationPage-CcJ0J1Zn.js → InstallationPage-CF5KJSiH.js} +1 -1
  43. package/public/assets/{LandingPage-BiMt64NW.js → LandingPage-BZ2OW2Tp.js} +1 -1
  44. package/public/assets/{LocalDevelopmentPage-D4FSxH3d.js → LocalDevelopmentPage-CHzphJ7-.js} +1 -1
  45. package/public/assets/{LoginPage-dLNo1JNx.js → LoginPage-BvkNtbOH.js} +1 -1
  46. package/public/assets/{MetricBar-kakUenDO.js → MetricBar-8IDBuyjQ.js} +1 -1
  47. package/public/assets/{MultiSelect-CmPlPDVq.js → MultiSelect-DqMAwXWW.js} +1 -1
  48. package/public/assets/{NotFoundPage-ohSBiBT-.js → NotFoundPage-3hbcgIgf.js} +1 -1
  49. package/public/assets/{OnboardingGuide-cHKCR0M5.js → OnboardingGuide-BZhFBXTO.js} +1 -1
  50. package/public/assets/{PermissionsPage-7-IPdVXg.js → PermissionsPage-CrRmJEWi.js} +1 -1
  51. package/public/assets/{PipelineConfigPage-BX6JMHM4.js → PipelineConfigPage-QOFAuIzF.js} +1 -1
  52. package/public/assets/{PipelineEditorPage-BeNxSKH5.js → PipelineEditorPage-BiDBe2GM.js} +1 -1
  53. package/public/assets/{PlanPage-B7z3l_2F.js → PlanPage-Bi6aA-yb.js} +1 -1
  54. package/public/assets/{ProfilePage-DwsnCrys.js → ProfilePage-D3BwamWo.js} +1 -1
  55. package/public/assets/{ProjectDetailPage-CzLqL69C.js → ProjectDetailPage-Crv53lJf.js} +1 -1
  56. package/public/assets/{ProjectListPage-Do-9PkUN.js → ProjectListPage-BHkBlY4i.js} +1 -1
  57. package/public/assets/{PtyTerminal-Z14rUlQy.js → PtyTerminal-fX-mJfnE.js} +1 -1
  58. package/public/assets/{QuickAuth-CX1phe7h.js → QuickAuth-Bg6-rI5M.js} +1 -1
  59. package/public/assets/{RemoveMemberConfirmDialog-DI3-C2N9.js → RemoveMemberConfirmDialog-DCvjYeqR.js} +1 -1
  60. package/public/assets/{ReviewAggregatePage-tiy7PRsr.js → ReviewAggregatePage-vilyKtbQ.js} +1 -1
  61. package/public/assets/{ReviewPage-CmbUljfI.js → ReviewPage-B1moD3qH.js} +1 -1
  62. package/public/assets/{Select-LGk_EawR.js → Select-Buxh6kTz.js} +1 -1
  63. package/public/assets/{SettingsPage-BpS56Ttu.js → SettingsPage-e_KlSeOd.js} +1 -1
  64. package/public/assets/{Skeleton-DaeQHyTP.js → Skeleton-Cxko1u3z.js} +1 -1
  65. package/public/assets/{SkillPage-BexkozUK.js → SkillPage-BLXLZ_br.js} +1 -1
  66. package/public/assets/TaskDetailPage-DSf2vDDR.js +21 -0
  67. package/public/assets/{TaskGuidePage-C5Ed0gO0.js → TaskGuidePage-BW1rBO-9.js} +1 -1
  68. package/public/assets/{TaskListPage-CdajIIwz.js → TaskListPage-hB72kn3H.js} +1 -1
  69. package/public/assets/{TaskStatusBadge-CuTVIvqD.js → TaskStatusBadge-C_WHXkor.js} +1 -1
  70. package/public/assets/{TerminalHomePage-Cs3JoG8j.js → TerminalHomePage-DQ7h-pKm.js} +1 -1
  71. package/public/assets/{TokenManage-BeDY8n-U.js → TokenManage-BS68pVIn.js} +1 -1
  72. package/public/assets/{Tooltip-DjIk-pqB.js → Tooltip-CoGldvyP.js} +1 -1
  73. package/public/assets/{TotpSetupPage-C_NjLBdt.js → TotpSetupPage-DSO6vRsM.js} +1 -1
  74. package/public/assets/{WorkerDetailPage-CuuvI6Fx.js → WorkerDetailPage-CtSdGuiT.js} +1 -1
  75. package/public/assets/{WorkerListPage-70g7vy3m.js → WorkerListPage-BPjiOimX.js} +1 -1
  76. package/public/assets/{WorkerOperationsPage-BL4BZ45w.js → WorkerOperationsPage-S0sYpBVA.js} +1 -1
  77. package/public/assets/{WorkerSetupGuidePage-jnyL_uM0.js → WorkerSetupGuidePage-Cz8jZzlP.js} +1 -1
  78. package/public/assets/{WorkerSetupPage-ChyjqvnS.js → WorkerSetupPage-DP-Gua4N.js} +1 -1
  79. package/public/assets/agent-type-options-BO0L8qFm.js +1 -0
  80. package/public/assets/{arrow-left-BL1QzlAp.js → arrow-left-DsnDpdp1.js} +1 -1
  81. package/public/assets/{arrow-right-BrrN-7YA.js → arrow-right-SYbE07-f.js} +1 -1
  82. package/public/assets/{bot-D-zp4qz4.js → bot-Te-gb92X.js} +1 -1
  83. package/public/assets/{chevron-down-BOgq_PNA.js → chevron-down-BOM9LZkG.js} +1 -1
  84. package/public/assets/{chevron-left-BPO7Bb6l.js → chevron-left-D9tS8E5I.js} +1 -1
  85. package/public/assets/{chevron-right-DHCIokyJ.js → chevron-right-Cjz_w39s.js} +1 -1
  86. package/public/assets/{chevron-up-wO9VgMYB.js → chevron-up-DP7_Tzsv.js} +1 -1
  87. package/public/assets/{circle-alert-DkW4_zyQ.js → circle-alert-7ekwM0mg.js} +1 -1
  88. package/public/assets/{clock-BbJkwoCd.js → clock-BSGAvAVI.js} +1 -1
  89. package/public/assets/{copy-BBOWX6ou.js → copy-CYXyA9yV.js} +1 -1
  90. package/public/assets/{developer-options-PMfL5Zv7.js → developer-options-DMIpNxfA.js} +1 -1
  91. package/public/assets/{download-CbWraeN_.js → download-BiTSnXRZ.js} +1 -1
  92. package/public/assets/{external-link-CEkNn2LX.js → external-link-BjNbjJjr.js} +1 -1
  93. package/public/assets/{git-fork-B775P9bq.js → git-fork-Cl-h0DTv.js} +1 -1
  94. package/public/assets/{index-Dh1GMLID.js → index--5cyM8L1.js} +3 -3
  95. package/public/assets/{index-DwFw8jxe.css → index-CTXH5Ib6.css} +1 -1
  96. package/public/assets/{key-Dl9aLBg3.js → key-BzsEyvw2.js} +1 -1
  97. package/public/assets/{link-2-BBq5JW-o.js → link-2-CmHbsrSO.js} +1 -1
  98. package/public/assets/{loader-circle-wSNLBiy-.js → loader-circle-DgwRTB3H.js} +1 -1
  99. package/public/assets/{pencil-ZFPPMxtk.js → pencil-CxmtoC0o.js} +1 -1
  100. package/public/assets/{play-DX-9yzZV.js → play-Ba8VDpNy.js} +1 -1
  101. package/public/assets/{plug-BxGp3gAo.js → plug-B19phlnq.js} +1 -1
  102. package/public/assets/{plus-Cn46sPb9.js → plus-jUKyQIr2.js} +1 -1
  103. package/public/assets/{power-PnMndXJz.js → power-DQyycfkW.js} +1 -1
  104. package/public/assets/{rotate-ccw-zdevuzi_.js → rotate-ccw-EMxH_to4.js} +1 -1
  105. package/public/assets/{scroll-text-BGkAQAvr.js → scroll-text-pA_y69Ov.js} +1 -1
  106. package/public/assets/{settings-CfrsrJUV.js → settings-DAb4HsMD.js} +1 -1
  107. package/public/assets/{skip-forward-ckOfJ8QF.js → skip-forward-CqSyF3tK.js} +1 -1
  108. package/public/assets/{status-colors-DC-m2CdG.js → status-colors-B460F2ZH.js} +1 -1
  109. package/public/assets/{task-agent-ZWBurVoa.js → task-agent-Cx6Aibwn.js} +1 -1
  110. package/public/assets/{task-constants-DfpO4NY9.js → task-constants-BNLUt-jR.js} +1 -1
  111. package/public/assets/{task.store-B461yHYH.js → task.store-DzA1A6GX.js} +1 -1
  112. package/public/assets/{timer-BFPhC5N0.js → timer-DSCxqEFg.js} +1 -1
  113. package/public/assets/{trash-2-CaIOqYj_.js → trash-2-DKVPzjZC.js} +1 -1
  114. package/public/assets/{useFetch-CJMNf1mK.js → useFetch-O3XBp_Gw.js} +1 -1
  115. package/public/assets/{users-BCrPK5sS.js → users-2xZaXYNg.js} +1 -1
  116. package/public/assets/{wifi-Cm-x6iNY.js → wifi-BJaHHkkn.js} +1 -1
  117. package/public/assets/{workflow-Burj_14o.js → workflow-D7dtHNTX.js} +1 -1
  118. package/public/assets/{zap-BAYG3kyF.js → zap-BLh2ptQ-.js} +1 -1
  119. package/public/index.html +10 -2
  120. package/public/sw.js +1 -1
  121. package/public/assets/AgentCliPage-HVXHK2Or.js +0 -3
  122. package/public/assets/TaskDetailPage-CElleGRa.js +0 -21
  123. package/public/assets/agent-type-options-BpMI3Naw.js +0 -1
@@ -1,3 +0,0 @@
1
- import{j as e}from"./index-Dh1GMLID.js";import{a as s}from"./DocsPrimitives-D7h19aXG.js";import"./copy-BBOWX6ou.js";function d(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// agent cli integration"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["overlord supports three ai agent clis. each project configures an ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent_type"})," that determines which cli the worker uses to execute tasks. the prompt is written to pty stdin after the cli starts — not passed as a cli argument."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// supported agents"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"agent"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli binary"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config value"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"subscription"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"claude code"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:"anthropic / claude"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"cursor agent"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})}),e.jsx("td",{className:"px-3 py-2",children:"cursor"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"openai codex"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:"openai"})]})]})]})}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// the cursor agent cli binary is ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"}),", not ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"}),". the config value ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})," maps to the ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})," binary."]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// permission strategy"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["all agents run in fully automated mode by default. the ",e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})," project config controls the permission level:"]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"allowedTools"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"claude"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cursor"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"codex"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"null (default)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-skip-permissions"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-bypass-approvals-and-sandbox"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"specific value"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--allowedTools <value>"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--full-auto"})})]})]})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// cli flag mapping"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"claude code"}),e.jsx(s,{code:"claude --dangerously-skip-permissions [--allowedTools <tools>] [--plugin-dir <path>]"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--allowedTools"})," or ",e.jsx("code",{children:"--dangerously-skip-permissions"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--plugin-dir <path>"})}),e.jsx("td",{className:"px-3 py-2",children:"load custom skills/plugins"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:".claude.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:".credentials.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"settings.json"})," from real home. pre-trusts worktree in ",e.jsx("code",{className:"text-[var(--accent)]",children:"trustedDirectories"}),"."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"cursor agent"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--warning)]/30 bg-[var(--warning)]/5 px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--warning)]",children:'⚠ macos limitation: cursor agent stores auth tokens in macos keychain, which requires a gui login session. headless workers (launchd/ssh) cannot access keychain and will fail with "keychain operation timed out". cursor agent is currently only supported on linux workers.'})}),e.jsx(s,{code:"agent --yolo --approve-mcps"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"flag"}),e.jsx("th",{className:"px-3 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:"px-3 py-2",children:e.jsx("code",{children:"--yolo"})}),e.jsx("td",{className:"px-3 py-2",children:"skip all confirmation prompts (alias for --force)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"line-through opacity-50",children:"--trust"})}),e.jsx("td",{className:"px-3 py-2",children:"removed — only works in headless/print mode. trust is auto-accepted via pty."})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:"auto-approve mcp servers"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: relies on workspace-manager's xdg ",e.jsx("code",{className:"text-[var(--accent)]",children:".config/"})," symlink."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"openai codex"}),e.jsx(s,{code:"codex --dangerously-bypass-approvals-and-sandbox"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsx("tbody",{className:"text-[var(--text-secondary)]",children:e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--dangerously-bypass-approvals-and-sandbox"})," or ",e.jsx("code",{children:"--full-auto"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]})})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.codex"})," directory if it exists."]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// configsnapshot fields"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"project-level config fields passed to executors:"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"type"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"used by"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentType"})}),e.jsx("td",{className:"px-3 py-2",children:"claude | cursor | codex"}),e.jsx("td",{className:"px-3 py-2",children:"all"}),e.jsx("td",{className:"px-3 py-2",children:"which cli to spawn"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude, codex"}),e.jsx("td",{className:"px-3 py-2",children:"permission strategy control"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude"}),e.jsx("td",{className:"px-3 py-2",children:"plugin directory path"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"maxTurns"})}),e.jsx("td",{className:"px-3 py-2",children:"number"}),e.jsx("td",{className:"px-3 py-2",children:"stage monitor"}),e.jsx("td",{className:"px-3 py-2",children:"max stage retry loops"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"pipeline"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"pipeline compiler"}),e.jsx("td",{className:"px-3 py-2",children:"custom pipeline json (null = default 6-stage)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentEnv"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"extra env vars json merged into pty env"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"json array of shell commands run before agent starts (120s timeout each)"})]})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// git hooks"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["worker creates isolated git worktrees for each task. by default, project-level git hooks (husky, lefthook, etc.) are not installed because ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," is not run automatically. use the project's ",e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})," field to install hooks before the agent starts."]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"hook tool"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"setupCommands"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"husky"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx husky install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"lefthook"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx lefthook install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"simple-git-hooks"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx simple-git-hooks"]'})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"native (.githooks/)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["git config core.hooksPath .githooks"]'})})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the lightest option is native git hooks — commit hook scripts to a ",e.jsx("code",{className:"text-[var(--accent)]",children:".githooks/"})," directory in your repo, then use a single ",e.jsx("code",{className:"text-[var(--accent)]",children:"git config"})," command. no ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," needed."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// capability detection"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"workers auto-detect installed agent clis on startup and report capabilities to the server. if a capability degrades at runtime (auth failure, rate limit), the server temporarily removes it. it auto-recovers when the next task execution succeeds."}),e.jsx(s,{code:`which claude && claude --version → capability: 'claude'
2
- which agent && agent --version → capability: 'cursor'
3
- which codex && codex --version → capability: 'codex'`})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// default pipeline"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the default pipeline has 7 stages:"}),e.jsx("div",{className:"flex flex-wrap items-center gap-1 text-xs",children:["implement","test","verify","review","simplify","rebase","submit"].map((a,t)=>e.jsxs("span",{children:[e.jsx("code",{className:"rounded-[4px] bg-[var(--bg-primary)] px-2 py-0.5 text-[var(--accent)]",children:a}),t<6&&e.jsx("span",{className:"mx-1 text-[var(--text-muted)]",children:"→"})]},a))}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the ",e.jsx("code",{className:"text-[var(--accent)]",children:"verify"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"review"})," stages loop back to ",e.jsx("code",{className:"text-[var(--accent)]",children:"implement"})," on failure (max 3 loops). the ",e.jsx("code",{className:"text-[var(--accent)]",children:"simplify"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"rebase"})," stages loop back to themselves on failure (max 3 loops)."]})]})]})})}export{d as default};
@@ -1,21 +0,0 @@
1
- import{c as xe,a as de,r as n,A as P,h,j as e,H as Xt,t as $,s as Te,B as Vt,f as Qt,F as Yt,p as Zt,q as es,k as vt,o as k,R as ts,L as ie,l as gt,m as ss,X as Se,y as as,U as rs,G as bt,b as ns,I as Lt,J as ls}from"./index-Dh1GMLID.js";import{u as cs}from"./task.store-B461yHYH.js";import{P as jt}from"./PtyTerminal-Z14rUlQy.js";import{C as Nt}from"./ConfirmStageDialog-DIsZM7QS.js";import{C as oe}from"./Checkbox-CQt3GUhI.js";import{S as yt}from"./Select-LGk_EawR.js";import{b as is,f as Y,c as os}from"./date-CmcdoD87.js";import{a as It}from"./status-colors-DC-m2CdG.js";import{g as xs,H as ds}from"./task-agent-ZWBurVoa.js";import{a as kt}from"./agent-type-options-BpMI3Naw.js";import{T as ms,g as Z}from"./task-constants-DfpO4NY9.js";import{T as ps}from"./Tooltip-DjIk-pqB.js";import{A as us}from"./arrow-left-BL1QzlAp.js";import{R as Dt}from"./rotate-ccw-zdevuzi_.js";import{G as hs}from"./git-fork-B775P9bq.js";import{P as wt}from"./play-DX-9yzZV.js";import{E as we}from"./external-link-CEkNn2LX.js";import{L as Rt}from"./loader-circle-wSNLBiy-.js";import{S as fs}from"./skip-forward-ckOfJ8QF.js";import"./clock-BbJkwoCd.js";import"./chevron-down-BOgq_PNA.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 vs=xe("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 gs=xe("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 bs=xe("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 js=xe("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 Ns(l,i){const a=new Date(l).getTime()-Date.now();if(a<=0)return i("tasks.tunnel_expired");const r=Math.floor(a/36e5),t=Math.floor(a%36e5/6e4);return r>0?i("tasks.tunnel_expires_hm",{h:r,m:t}):i("tasks.tunnel_expires_m",{m:t})}function _t(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 Ct(l,i){switch(l){case"IDLE":case"CLOSED":return i("tasks.tunnel_idle");case"STARTING":return i("tasks.tunnel_starting");case"CONNECTED":return i("tasks.tunnel_connected");case"EXPIRED":return i("tasks.tunnel_expired");case"CLOSING":return i("tasks.tunnel_closing");default:return String(l).toLowerCase()}}function ys({taskId:l,taskFinished:i,compact:a}){const{t:r}=de(),[t,d]=n.useState(P.IDLE),[p,C]=n.useState(null),[f,M]=n.useState(null),[W,ee]=n.useState(""),[o,S]=n.useState(!1),[me,O]=n.useState(!1),F=n.useRef(null),R=n.useCallback(async()=>{try{const v=await h.get(`web/workspace-tunnel/${l}/status`).json();d(v.status),C(v.tunnelUrl??null),M(v.expiresAt??null),(v.status==="EXPIRED"||v.status==="IDLE"||v.status==="CLOSED")&&E()}catch{}},[l]);function pe(){E(),F.current=setInterval(R,5e3)}function E(){F.current&&(clearInterval(F.current),F.current=null)}n.useEffect(()=>{i&&(t===P.STARTING||t===P.CONNECTED)&&(d(P.IDLE),C(null),E())},[i,t]),n.useEffect(()=>{if(t!=="CONNECTED"||!f)return;const v=()=>{const T=Ns(f,r);ee(T),T===r("tasks.tunnel_expired")&&(d(P.EXPIRED),C(null),E())};v();const D=setInterval(v,3e4);return()=>clearInterval(D)},[t,f]),n.useEffect(()=>()=>E(),[]),n.useEffect(()=>{i||R()},[R,i]);async function H(){S(!0);try{await h.post(`web/workspace-tunnel/${l}/start`),d(P.STARTING),pe()}catch(v){let D=r("tasks.tunnel_start_failed");try{if(v instanceof Xt){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{}$.error(D)}finally{S(!1)}}async function A(){S(!0);try{await h.post(`web/workspace-tunnel/${l}/stop`),d(P.IDLE),C(null),E()}catch{}finally{S(!1)}}async function U(){p&&(await navigator.clipboard.writeText(p),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:_t(t)},children:Ct(t,r)}),(t==="IDLE"||t==="CLOSED"||t==="EXPIRED")&&e.jsx("button",{onClick:H,disabled:o,className:"rounded-[4px] px-2 py-1 text-[var(--info)] disabled:opacity-50",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:r(o?"tasks.tunnel_starting":"tasks.tunnel_start")}),t==="CONNECTED"&&p&&e.jsx("a",{href:p.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:_t(t)},children:["● ",Ct(t,r)]})]}),t==="CONNECTED"&&f&&e.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["// ",W]}),t==="CONNECTED"&&p&&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:p}),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"),"]"]})]}),me&&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:H,disabled:o,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(o?"tasks.tunnel_starting_button":"tasks.tunnel_start_button")}),t==="STARTING"&&e.jsx("button",{onClick:A,disabled:o,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(o?"tasks.tunnel_stopping":"tasks.tunnel_cancel")}),t==="CONNECTED"&&p&&e.jsxs(e.Fragment,{children:[e.jsx("a",{href:p.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:p.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:A,disabled:o,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(o?"tasks.tunnel_stopping":"tasks.tunnel_stop")})]}),t==="EXPIRED"&&e.jsx("button",{onClick:H,disabled:o,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(o?"tasks.tunnel_starting_button":"tasks.tunnel_restart")})]})]})}function ks({isOpen:l,onClose:i,onConfirm:a,taskId:r,isLoading:t}){const{t:d}=de();return e.jsx(Te,{isOpen:l,onClose:i,onConfirm:a,title:d("tasks.cancel_task_title"),message:d("tasks.cancel_task_message",{id:String(r)}),confirmLabel:d("tasks.cancel_task_confirm_label"),confirmVariant:"danger",isLoading:t})}function ws({isOpen:l,onClose:i,onConfirm:a,taskId:r,mrUrl:t,isLoading:d,reuseWorkspace:p,onReuseWorkspaceChange:C}){const{t:f}=de(),M=t?f("tasks.retry_message_with_mr",{id:String(r),url:t}):f("tasks.retry_message_without_mr",{id:String(r)});return e.jsx(Te,{isOpen:l,onClose:i,onConfirm:a,title:f("tasks.retry_title"),message:M,confirmLabel:f("tasks.retry_confirm_label"),confirmVariant:"accent",isLoading:d,children:e.jsx(oe,{checked:p,onCheckedChange:C,label:f("tasks.reuse_workspace_label"),containerClassName:"mt-3",labelClassName:"text-[var(--text-muted)]"})})}const _e=["implement","test","verify","review","simplify","rebase","submit"],_s=["analyze","discuss","document","confirm"],Cs=["review","report","fix"],Ss=["review","report"],Es=["analyze"];function Ee(l){if(typeof l=="string")try{return Ee(JSON.parse(l))}catch{return null}if(!l||typeof l!="object")return null;const i=l.stages;if(!Array.isArray(i)||i.length===0)return null;const a=i.map(r=>r&&typeof r=="object"?r.name:null).filter(r=>typeof r=="string"&&r.length>0);return a.length===i.length?a:null}function Ts(l){if(l.taskMode==="plan")return _s;if(l.taskMode==="automation")return Es;if(l.taskMode==="review"){let i=!1;if(l.configSnapshot)try{i=!!JSON.parse(l.configSnapshot).skipFix}catch{}return i?Ss:Cs}if(!l.configSnapshot)return _e;try{const i=JSON.parse(l.configSnapshot);return Ee(i.pipeline)??Ee(i)??_e}catch{return _e}}function Ls(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:i}){const a=It(l),r=Z(i);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 St({stages:l,runningBg:i="bg-[#1a1a1a]",py:a="py-1.5"}){return e.jsx(e.Fragment,{children:l.map(r=>{const t=r.status==="completed",d=r.status==="running",p=r.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 ${a} ${d?i:""}`,children:[t&&e.jsx(ls,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),d&&e.jsx(Rt,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),p&&e.jsx(Se,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),r.status==="pending"&&e.jsx(vs,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs",style:{color:t?"var(--accent)":d?"#e5e5e5":p?"var(--destructive)":"#525252",fontWeight:d?500:400},children:d?`> ${r.name}`:r.name})]},r.name)})})}function Et({task:l,ptyStatus:i,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] ${i==="connected"?"text-[var(--accent)]":i==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${i==="connected"?"bg-[var(--accent)]":i==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),r(`tasks.${i}`)]}),e.jsx("span",{className:"text-[11px]",style:{color:It(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 Tt({isFinished:l,takeoverState:i,ptyRef:a,t:r}){return e.jsxs(e.Fragment,{children:[!l&&i==="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(ds,{className:"h-3 w-3"}),r("tasks.take_over")]}),!l&&i==="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(Dt,{className:"h-3 w-3"}),r("tasks.restore_auto")]})]})}function Is(l){const i=Ts(l),a=l.currentStage?i.indexOf(l.currentStage):-1;return i.map((r,t)=>{let d="pending";return l.status===k.COMPLETED?d="completed":l.status===k.FAILED&&t<=a?d=t===a?"failed":"completed":a>=0&&(t<a?d="completed":t===a&&(d="running")),{name:r,status:d}})}function K(l,i){if(!l||!i)return null;const a=l.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),r=i.split("/").map(encodeURIComponent).join("/");return l.gitPlatform===Lt.GITLAB?`${a}/-/tree/${r}`:`${a}/tree/${r}`}function Ds(l,i){if(!l)return null;const a=l.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),r=i.split("/").map(encodeURIComponent).join("/");return l.gitPlatform===Lt.GITLAB?`${a}/-/tree/${r}/docs/specs`:`${a}/tree/${r}/docs/specs`}function ea(){var ut,ht,ft;const{id:l}=Vt(),i=Qt(),{t:a}=de(),r=cs(s=>s.cancelTask),[t,d]=n.useState(null),[p,C]=n.useState(null),[f,M]=n.useState([]),[W,ee]=n.useState(!0),[o,S]=n.useState(null),[me,O]=n.useState(!1),[F,R]=n.useState(!1),[pe,E]=n.useState(!1),[H,A]=n.useState(!1),[U,v]=n.useState(["claude"]),[D,T]=n.useState(""),[Le,Ie]=n.useState(!1),[De,Re]=n.useState(""),[Ae,Pe]=n.useState(!1),[At,$e]=n.useState(!1),[Pt,Me]=n.useState(!1),[$t,Oe]=n.useState(!1),[Fe,Ue]=n.useState(""),[qe,Be]=n.useState(""),[Ge,ze]=n.useState("append"),[Ke,ue]=n.useState(!1),[We,Mt]=Yt(),[N,he]=n.useState("terminal"),[He,Je]=n.useState([]),[te,Xe]=n.useState(0),[J,q]=n.useState(0),[X,Ve]=n.useState(""),[se,Ot]=n.useState(""),[Ft,fe]=n.useState(!1),[Ut,Qe]=n.useState(!1),[B,ve]=n.useState(null),[Ye,Ze]=n.useState("disconnected"),[ge,et]=n.useState("auto"),ae=n.useRef(null),tt=n.useRef(null),[st,at]=n.useState([]),[rt,nt]=n.useState([]),x=Number(l),b=t?ms.includes(t.status):!1;Zt(t?es(t,100):null);const L=n.useCallback(async()=>{try{const s=await h.get(`web/tasks/${x}`).json();d(s)}catch{}},[x]),re=n.useCallback(async()=>{try{const s=await h.get(`web/tasks/${x}/logs`).json();M(s.lines)}catch{}},[x]),G=n.useCallback(async()=>{try{const s=await h.get(`web/tasks/${x}/pending-confirm`).json();S(s.confirm)}catch{S(null)}},[x]),lt=n.useCallback(async()=>{fe(!0);try{const s=new URLSearchParams;s.set("limit","50"),s.set("offset",String(J*50)),X&&s.set("type",X),se&&s.set("search",se);const c=await h.get(`web/tasks/${x}/events?${s}`).json();Je(c.events),Xe(c.total)}catch{}finally{fe(!1)}},[x,J,X,se]);n.useEffect(()=>{N==="logs"&&lt()},[N,lt]),n.useEffect(()=>{N==="pipeline"&&!b&&h.get(`web/workspaces/${x}`).json().then(ve).catch(()=>ve(null))},[N,x,b]);const z=vt(s=>s.lastEvent),ct=vt(s=>s.eventSeq);n.useEffect(()=>{ee(!0),d(null),C(null),M([]),S(null),ve(null),Je([]),Xe(0),q(0),fe(!1),nt([]),Promise.all([L(),re(),G()]).finally(()=>ee(!1)),h.get(`web/tasks/${x}/external-links`).json().then(nt).catch(()=>{})},[x,L,re,G]),n.useEffect(()=>{t!=null&&t.projectKey&&h.get(`web/projects/${t.projectKey}`).json().then(C).catch(()=>C(null))},[t==null?void 0:t.projectKey]),n.useEffect(()=>{if(!t)return;let s=!1;return(async()=>{try{const c=[],m=[];let u=t.sourceTaskId??null,y=0;for(;u!=null&&y<2;){const _=await h.get(`web/tasks/${u}`).json();m.unshift({id:_.id,taskMode:_.taskMode??"develop"}),u=_.sourceTaskId??null,y++}c.push(...m),c.push({id:t.id,taskMode:t.taskMode??"develop"});const I=await h.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(t.id),limit:"20"})}`).json();for(const _ of I.data??[])c.push({id:_.id,taskMode:_.taskMode??"develop"});s||at(c)}catch{s||at([])}})(),()=>{s=!0}},[t==null?void 0:t.id,t==null?void 0:t.sourceTaskId,t==null?void 0:t.taskMode]),n.useEffect(()=>{!z||ct===0||(z.event==="task_status_changed"&&z.taskId===x||z.event==="task_created"&&z.taskId===x)&&(L(),G())},[ct,z,x,L,G]),n.useEffect(()=>{if(b)return;const c=setInterval(()=>{document.visibilityState!=="hidden"&&Promise.all([L(),re(),G()])},15e3);return()=>clearInterval(c)},[b,L,re,G]);const it=n.useCallback(()=>S(null),[]),V=n.useCallback(()=>{S(null),L()},[L]),qt=(t==null?void 0:t.status)===k.FAILED||(t==null?void 0:t.status)===k.CANCELLED,be=(t==null?void 0:t.status)===k.COMPLETED||(t==null?void 0:t.status)===k.FAILED||(t==null?void 0:t.status)===k.CANCELLED,Bt=(t==null?void 0:t.status)===k.COMPLETED&&(!(t!=null&&t.taskMode)||(t==null?void 0:t.taskMode)==="develop");n.useEffect(()=>{We.get("action")==="fork"&&t&&!W&&(be&&ot(),Mt(s=>(s.delete("action"),s),{replace:!0}))},[t,W,We,be]);async function Gt(){$e(!0);try{await r(x),O(!1),await L()}finally{$e(!1)}}async function zt(){Me(!0);try{await h.post(`web/tasks/${x}/retry`,{json:{reuseWorkspace:Ke}}),R(!1),ue(!1),await L()}finally{Me(!1)}}function ot(){Ue(""),Be(""),ze("append"),E(!0)}async function Kt(){Oe(!0);try{const s=Fe.trim()||void 0,c=await h.post(`web/tasks/${x}/fork`,{json:{description:s,descriptionMode:s?Ge:void 0,agentType:qe||void 0}}).json();E(!1),$.success(a("tasks.fork_success")),i(`/tasks/${c.task.id}`)}catch{$.error(a("tasks.fork_error"))}finally{Oe(!1)}}async function Wt(){if(t){Pe(!0);try{await h.post(`web/tasks/${x}/review`,{json:{agentTypes:U.length>0?U:["claude"],description:D.trim()||void 0,skipFix:Le||void 0,issueRef:De.trim()||void 0}}).json(),A(!1),T(""),Ie(!1),Re(""),i(`/review/${x}`)}catch(s){const c=s instanceof Error?s.message:String(s);$.error(c)}finally{Pe(!1)}}}const j=n.useMemo(()=>t?Is(t):[],[t==null?void 0:t.configSnapshot,t==null?void 0:t.currentStage,t==null?void 0:t.status]),je=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(",")]),W)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:()=>i("/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 w=t.status===k.QUEUED&&t.queuePosition!=null&&t.queueTotal!=null?{position:t.queuePosition,total:t.queueTotal}:null,g=is(t.startedAt,t.completedAt),Q=xs(t),Ne=Z(t.agentType),Ht=[{value:"",label:a("tasks.fork_agent_type_placeholder",{agent:Z(Q)})},...kt(Z,Q)],le=`${a("tasks.status_suspended")} / ${Ne}`,xt=w?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:["#",w.position," / ",w.total]})]}):null,dt=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=st.length>1?e.jsx("div",{className:"flex items-center gap-1 text-xs text-[var(--text-secondary)]",children:st.map((s,c)=>e.jsxs(ts.Fragment,{children:[c>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,mt=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:()=>i("/tasks"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(us,{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)] preserve-case",title:ss(t),children:["#",t.id," ",gt(t,80)]}),dt]}),ce&&e.jsx("div",{className:"text-[11px]",children:ce})]})]}),ye=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}),dt,g&&e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// time cost: ",g]}),w&&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(w.position),total:String(w.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: ",K(p,t.branch)?e.jsx("a",{href:K(p,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: ",((ut=t.mrUrl.match(/!?\d+$/))==null?void 0:ut[0])??"view"]})]}),ce&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),ce]})]}),pt=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:[!b&&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")]}),qt&&e.jsxs("button",{onClick:()=>R(!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(Dt,{className:"h-3 w-3"}),a("tasks.retry_task")]}),be&&e.jsxs("button",{onClick:ot,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(hs,{className:"h-3 w-3"}),a("tasks.fork_task")]}),Bt&&e.jsxs("button",{onClick:()=>A(!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(wt,{className:"h-3 w-3"}),a("review.launch")]}),t.workerId&&!b&&e.jsxs("button",{onClick:()=>{he("pipeline"),setTimeout(()=>{var s,c;(c=(s=tt.current)==null?void 0:s.scrollIntoView)==null||c.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(we,{className:"h-3 w-3"}),a("tasks.cursor_tunnel")]})]}),Jt=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(St,{stages:j})]}),g&&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: ",g]}),rt.length>0&&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.external_refs")}),rt.map((s,c)=>e.jsxs("a",{href:s.externalIssueUrl.startsWith("http")?s.externalIssueUrl:"#",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-[11px] text-[var(--accent)] hover:underline",children:[e.jsx(we,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"capitalize",children:s.connectorPlatform}),": ",s.externalIssueId]},c))]}),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")}),f.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:f.slice(0,8).map((s,c)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},c))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]}),ke=e.jsxs(e.Fragment,{children:[e.jsx(ks,{isOpen:me,onClose:()=>O(!1),onConfirm:Gt,taskId:x,isLoading:At}),e.jsx(ws,{isOpen:F,onClose:()=>{R(!1),ue(!1)},onConfirm:zt,taskId:x,mrUrl:t.mrUrl??void 0,isLoading:Pt,reuseWorkspace:Ke,onReuseWorkspaceChange:ue}),e.jsx(Te,{isOpen:pe,onClose:()=>E(!1),onConfirm:Kt,title:a("tasks.fork_task"),message:a("tasks.fork_task_desc"),confirmLabel:a("tasks.fork_task"),confirmVariant:"accent",isLoading:$t,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 #",x]}),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(yt,{value:qe,onChange:Be,options:Ht})]}),e.jsx("textarea",{value:Fe,onChange:s=>Ue(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.jsx(oe,{checked:Ge==="replace",onCheckedChange:s=>ze(s?"replace":"append"),label: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")})]}),containerClassName:"w-full items-start rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 text-[11px] text-[var(--text-secondary)]",indicatorClassName:"mt-0.5",labelClassName:"text-[11px] text-[var(--text-secondary)]"})]})}),H&&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:()=>A(!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 #",x," — ",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:kt(Z).map(s=>e.jsx(oe,{checked:U.includes(s.value),onCheckedChange:()=>v(c=>c.includes(s.value)?c.filter(m=>m!==s.value):[...c,s.value]),label:s.label,containerClassName:"w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors"},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.jsx(oe,{checked:Le,onCheckedChange:Ie,label:a("review.skip_fix_label"),containerClassName:"mb-3 w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors",labelClassName:"text-[var(--text-muted)]"}),e.jsx("input",{value:De,onChange:s=>Re(s.target.value),placeholder:"--ref: Figma/Jira/Sentry URL",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)]"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:Wt,disabled:Ae||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(wt,{className:"h-3 w-3"}),a(Ae?"common.processing":"review.launch")]}),e.jsx("button",{onClick:()=>A(!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 Ut&&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:[ye,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(Et,{task:t,ptyStatus:Ye,displayAgentType:Q,t:a,gap:"gap-3"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Tt,{isFinished:b,takeoverState:ge,ptyRef:ae,t:a}),e.jsx("button",{onClick:()=>Qe(!1),className:"flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1 text-[var(--text-muted)]",children:e.jsx(js,{className:"h-3 w-3"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(jt,{ref:ae,taskId:x,sessionId:t.currentSessionId??void 0,taskFinished:b,onStatusChange:Ze,onTakeoverChange:et})}),pt,ke]}):t.status===k.SUSPENDED?e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[mt,ye,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%] preserve-case",children:e.jsx(ps,{content:t.description,children:gt(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})}),o&&(()=>{const s=o.confirmType,c=s==="plan_decompose",m=s==="plan_review"||s==="code_review",u=s==="plan_review"?a("tasks.plan_review_message",{name:o.stageName}):c?o.prompt==="SPEC_PUSH_FAILED"?a("tasks.plan_decompose_push_failed_message"):a("tasks.plan_decompose_message"):s==="code_review"?a("tasks.code_review_message",{name:o.stageName}):o.prompt??a("tasks.pipeline_requires_confirmation"),y=a(s==="plan_review"?"tasks.approve_plan":c?"tasks.approve_plan_decompose":s==="code_review"?"tasks.approve_review":"tasks.confirm_and_proceed"),I=a(c?"tasks.reject_plan_decompose":m?"tasks.request_changes":"tasks.reject");return 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:u}),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:o.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 h.post(`web/tasks/${x}/confirm-stage`,{json:{stageName:o.stageName,approved:!0,feedback:""}}),V()}catch{$.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:y}),e.jsx("button",{onClick:async()=>{try{await h.post(`web/tasks/${x}/confirm-stage`,{json:{stageName:o.stageName,approved:!1,feedback:""}}),V()}catch{$.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:I})]})]})})(),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,c)=>{const m=s.status==="failed",u=s.status==="completed",y=s.status==="running"&&t.status===k.SUSPENDED,I=m?"var(--destructive)":u?"var(--accent)":y?"var(--warning)":"#525252",_=m?"rgba(239,68,68,0.12)":u?"rgba(34,197,94,0.12)":y?"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:_,fontWeight:y?700:400,border:y?`1px solid ${I}`:void 0},children:y?"confirm":`${s.name}${u?" ✓":m?" ✗":""}`}),c<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:[f.slice(-10).map((s,c)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-secondary)]",children:s},c)),f.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 c=s.status==="completed"?"var(--info)":s.status==="failed"?"var(--destructive)":s.status==="running"?"var(--warning)":"#525252",m=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:c}}),e.jsxs("span",{className:"text-[11px]",style:{color:m,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)})]})})]})]}),o&&e.jsx(Nt,{isOpen:!!o,onClose:it,taskId:x,stageName:o.stageName,timeoutSeconds:o.timeout,confirmType:o.confirmType,prompt:o.prompt,onSubmitted:V}),ke]}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden font-mono lowercase",children:[mt,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}),g&&e.jsxs("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:["// time cost: ",g]}),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&&(K(p,t.branch)?e.jsx("a",{href:K(p,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}))]}),ye,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]}),w&&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(gs,{className:"h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{children:[a("tasks.queue_position_banner",{position:String(w.position),total:String(w.total)}),w.position>1?` — ${a("tasks.queue_ahead",{count:String(w.position-1)})}`:` — ${a("tasks.queue_next")}`]})]}),o&&e.jsx(Nt,{isOpen:!!o,onClose:it,taskId:x,stageName:o.stageName,timeoutSeconds:o.timeout,confirmType:o.confirmType,prompt:o.prompt,onSubmitted:V}),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:()=>he(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(Et,{task:t,ptyStatus:Ye,displayAgentType:Q,t:a}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Tt,{isFinished:b,takeoverState:ge,ptyRef:ae,t:a}),!b&&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(Rt,{className:"h-3 w-3 animate-spin"}),a("tasks.requesting_takeover")]}),!b&&t.currentStage&&t.status==="SUSPENDED"&&e.jsxs("button",{onClick:async()=>{try{await h.post(`web/tasks/${x}/confirm-stage`,{json:{stageName:t.currentStage,approved:!1,feedback:""}}),V()}catch{$.error(a("tasks.confirm_failed"))}},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)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(fs,{className:"h-3 w-3"}),a("tasks.skip_stage")]}),e.jsx("button",{onClick:()=>Qe(!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(bs,{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,c)=>{const m=s.status==="completed",u=s.status==="running",I=s.status==="failed"?"var(--destructive)":m||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,m?" ✓":u?" ...":""]}),c<j.length-1&&e.jsx("div",{className:"mx-1.5 h-px w-4 shrink-0",style:{backgroundColor:I}})]},s.name)})]})})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(jt,{ref:ae,taskId:x,sessionId:t.currentSessionId??void 0,taskFinished:b,onStatusChange:Ze,onTakeoverChange:et})}),pt]}),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,c)=>{const m=s.status==="completed",u=s.status==="running",_=s.status==="failed"?"var(--destructive)":m||u?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",style:{flex:c<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:_},children:[m&&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:_},children:s.name})]}),c<j.length-1&&e.jsx("div",{className:"mx-1 md:mx-2 h-0.5 flex-1 min-w-3 rounded-full",style:{backgroundColor:c<(je>=0?je: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," (",je+1,"/",j.length,")"]}),t.startedAt&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",Y(t.startedAt).replace(" ago","")]}),g&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",g]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// retries: ",t.retryCount,"/2"]})]}),!t.currentStage&&g&&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: ",g]})}),e.jsx("button",{onClick:()=>he("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??"-"})]}),xt]})]}),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(St,{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")}),f.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:f.slice(-12).map((s,c)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},c))}):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:()=>{Ve(s),q(0)},className:`shrink-0 rounded-[4px] px-2.5 py-1 text-[11px] ${X===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(yt,{value:X,onChange:s=>{Ve(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(as,{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=>{Ot(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:[He.map((s,c)=>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 ${c%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 ${Ls(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)),He.length===0&&!Ft&&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,c)=>e.jsx("button",{onClick:()=>q(c),className:`rounded-[4px] px-2 py-1 text-xs ${J===c?"bg-[var(--accent)] text-black font-medium":"text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:c+1},c)),Math.ceil(te/50)>5&&e.jsx("button",{onClick:()=>q(J+1),disabled:J>=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(rs,{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:os(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:Ne})]}),g&&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:g})]}),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")}),K(p,t.branch)?e.jsx("a",{href:K(p,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:((ht=t.mrUrl.match(/!?\d+$/))==null?void 0:ht[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===k.COMPLETED&&(()=>{let s="main";if(t.configSnapshot)try{const m=JSON.parse(t.configSnapshot);m.defaultBranch&&(s=m.defaultBranch)}catch{}const c=Ds(p,s);return c?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:c,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(we,{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(ns,{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-[var(--bg-input)] 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"&&Jt,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:Ne})]}),g&&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:g})]}),xt]})]}),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:((ft=t.mrUrl.match(/!?\d+$/))==null?void 0:ft[0])??"view"})]})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{ref:tt,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(ys,{taskId:x,taskFinished:b,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 c=s.status==="completed"?"✓":s.status==="running"?"→":"·",m=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:m},children:c}),e.jsx("span",{className:s.status==="running"?"font-medium":"",style:{color:m},children:s.name}),e.jsxs("span",{className:"text-[11px]",style:{color:"#525252"},children:["— ",u]})]},s.name)})})]})]})]}),ke]})}export{ea as default};
@@ -1 +0,0 @@
1
- import{Q as t}from"./index-Dh1GMLID.js";const r=[t.CLAUDE,t.CODEX,t.CURSOR,t.PI];function i(e){return r.includes(e)}function u(e){return i(e)?[e,...r.filter(n=>n!==e)]:[...r]}function s(e,n){return u(n).map(o=>({value:o,label:e(o)}))}function a(e,n){return[{value:"",label:"auto"},...s(e,n)]}export{s as a,a as g};