@overlordai/server 1.0.137 → 1.0.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/help-text.js +1 -1
- package/dist/adapters/help-text.js.map +1 -1
- package/package.json +4 -4
- package/public/assets/{AccessTokensPage-DzCubELz.js → AccessTokensPage-BhddWVW1.js} +1 -1
- package/public/assets/{AdminPage-D7h4T4wf.js → AdminPage-pfvAHWMr.js} +1 -1
- package/public/assets/{AgentCliPage--LPNJMI-.js → AgentCliPage-C345jDjj.js} +1 -1
- package/public/assets/{ApiReferencePage-DsO1bm8_.js → ApiReferencePage-DHLXt2i6.js} +1 -1
- package/public/assets/{ArchitecturePage-C3MSO7cd.js → ArchitecturePage-C6I9_3Gs.js} +1 -1
- package/public/assets/{AuditLogPage-DlQ5mzaL.js → AuditLogPage-CdIyX0zS.js} +1 -1
- package/public/assets/{BindPlatformPage-DG2_3xTc.js → BindPlatformPage-KFs9i2uA.js} +1 -1
- package/public/assets/{BotIntegrationPage-D_sm60MJ.js → BotIntegrationPage-DCFZPk-7.js} +1 -1
- package/public/assets/{BotManage-BjrBpGMh.js → BotManage-XcDpO3JL.js} +1 -1
- package/public/assets/{BotSetupPage-CVDWVHCo.js → BotSetupPage-VWtZWkVa.js} +1 -1
- package/public/assets/{ChangelogPage-DHwmjI6b.js → ChangelogPage-BbOP-JLv.js} +1 -1
- package/public/assets/{CliReferencePage-DAVzlgr5.js → CliReferencePage-DtYHgbSY.js} +1 -1
- package/public/assets/{DeploymentPage-Dp0BZmOt.js → DeploymentPage-BtlkcDYB.js} +1 -1
- package/public/assets/{DevWorkflowPage-BX3o85ji.js → DevWorkflowPage-CxXMRR-3.js} +1 -1
- package/public/assets/{DeveloperManage-CZS8Aelu.js → DeveloperManage-BcBr_3L_.js} +1 -1
- package/public/assets/{DeveloperSetupPage-BwxQxu4Q.js → DeveloperSetupPage-DZ4yMaW5.js} +1 -1
- package/public/assets/{DocsIndexPage-DzOLsTxv.js → DocsIndexPage-BLlkapm4.js} +1 -1
- package/public/assets/{DocsLayout-BoJzjWGl.js → DocsLayout-MaagZ0kw.js} +1 -1
- package/public/assets/{DocsPrimitives-ChDUPiBX.js → DocsPrimitives-OHFIHBcn.js} +1 -1
- package/public/assets/{EditProjectPage-B03Yl-e6.js → EditProjectPage-C3QK8nE_.js} +1 -1
- package/public/assets/{EmptyState-9X3AnR5S.js → EmptyState-C3ql5j5L.js} +1 -1
- package/public/assets/{EnvVariablesPage-Bo49XeoO.js → EnvVariablesPage-DckuYIoH.js} +1 -1
- package/public/assets/{HomePage-Cux4m5Hs.js → HomePage-zewuW5E4.js} +1 -1
- package/public/assets/{InfoRow-BHpyhwga.js → InfoRow-D5t0RpaR.js} +1 -1
- package/public/assets/{InstallationPage-kFKhoL5F.js → InstallationPage-DUCocNLA.js} +1 -1
- package/public/assets/{LandingPage-DEFMVvU3.js → LandingPage-y9pKUede.js} +1 -1
- package/public/assets/{LocalDevelopmentPage-DuiTmf-_.js → LocalDevelopmentPage-CJBGPeYo.js} +1 -1
- package/public/assets/{LoginPage-BcFvfl5i.js → LoginPage-WGOUh3Zl.js} +1 -1
- package/public/assets/{MetricBar-CTlA6_IU.js → MetricBar-CWCoyjWv.js} +1 -1
- package/public/assets/{MobileTerminalShell-GSwjTHBM.js → MobileTerminalShell-By5L8I0_.js} +1 -1
- package/public/assets/{NotFoundPage-BcbslwKM.js → NotFoundPage-NHnxMNCC.js} +1 -1
- package/public/assets/{OnboardingGuide-BfWQ-dXm.js → OnboardingGuide-DalnDVPS.js} +1 -1
- package/public/assets/{PermissionsPage-BQJUg9Fi.js → PermissionsPage-Dt4llTFV.js} +1 -1
- package/public/assets/{PipelineConfigPage-CgwwxPXR.js → PipelineConfigPage-CIojkTYx.js} +1 -1
- package/public/assets/{PipelineEditorPage-DwYb52qa.js → PipelineEditorPage-BZ96tFxp.js} +1 -1
- package/public/assets/{ProfilePage-DD1SVNa3.js → ProfilePage-YrqpghqL.js} +1 -1
- package/public/assets/{ProjectDetailPage-BqJ2Fm3W.js → ProjectDetailPage-CM5bfJmU.js} +1 -1
- package/public/assets/{ProjectListPage-CQMvn3Xu.js → ProjectListPage-DC1Kc7Lb.js} +1 -1
- package/public/assets/{QuickAuth-DCRj6Na5.js → QuickAuth-rpWKeLO_.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-BEO7AzLs.js → RemoveMemberConfirmDialog-DZAmLAes.js} +1 -1
- package/public/assets/{Select-C4WWRtUb.js → Select-C-ttiP28.js} +1 -1
- package/public/assets/{SettingsPage-CE1_p76c.js → SettingsPage-C7ErXyNZ.js} +1 -1
- package/public/assets/{Skeleton-BJOsoq56.js → Skeleton-joUgi0KR.js} +1 -1
- package/public/assets/{SkillPage-DiB1yG-G.js → SkillPage-C3fKU78U.js} +1 -1
- package/public/assets/TaskDetailPage-CoYa78-E.js +26 -0
- package/public/assets/{TaskListPage-wQI3AsXX.js → TaskListPage-BqyEs5a5.js} +1 -1
- package/public/assets/{TaskStatusBadge-CkZpqofQ.js → TaskStatusBadge-DHw2HKgB.js} +1 -1
- package/public/assets/{TerminalHomePage-BTTWM9CB.js → TerminalHomePage-Dr6u8qQW.js} +1 -1
- package/public/assets/{TokenManage-p87Lj8X8.js → TokenManage-Cg_B-8Nh.js} +1 -1
- package/public/assets/{Tooltip-BinmnSIJ.js → Tooltip-C5YjudXm.js} +1 -1
- package/public/assets/{TotpSetupPage-DTUi50Qb.js → TotpSetupPage-BnxSNEq7.js} +1 -1
- package/public/assets/{WorkerDetailPage-BAhER03s.js → WorkerDetailPage-CZPkIYBS.js} +1 -1
- package/public/assets/{WorkerListPage-DNId8AgR.js → WorkerListPage-D50gtKFZ.js} +1 -1
- package/public/assets/{WorkerOperationsPage-BpHrkSr7.js → WorkerOperationsPage-C4PArGPr.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-CqXljpZK.js → WorkerSetupGuidePage-r4f3o1z6.js} +1 -1
- package/public/assets/{WorkerSetupPage-B4yryZIy.js → WorkerSetupPage-C8IoFobt.js} +1 -1
- package/public/assets/{agent-type-options-BgbZ38kq.js → agent-type-options-B1aNX95r.js} +1 -1
- package/public/assets/{arrow-left-BoGcsEnf.js → arrow-left-kFMv2goM.js} +1 -1
- package/public/assets/{arrow-right-DB5oTkjP.js → arrow-right-iDt-dafx.js} +1 -1
- package/public/assets/{bot-CyfjFe4X.js → bot-ChxoWTEC.js} +1 -1
- package/public/assets/{chevron-left-KTqiQQbd.js → chevron-left-CjZsnHH6.js} +1 -1
- package/public/assets/{chevron-right-gIXSd08u.js → chevron-right-bRokRq2n.js} +1 -1
- package/public/assets/{copy-DOPid5AM.js → copy-DTL-jbDm.js} +1 -1
- package/public/assets/{download-C0FhyYFB.js → download-B7XilVjT.js} +1 -1
- package/public/assets/{external-link--d8U10It.js → external-link-CFjZxTQ5.js} +1 -1
- package/public/assets/{file-text-DZ6D2Yh1.js → file-text-oQMnmgkw.js} +1 -1
- package/public/assets/{git-fork-viGyzUTQ.js → git-fork-JOmnLsHO.js} +1 -1
- package/public/assets/{index-B_kGxeQJ.js → index-DHpBdv1F.js} +2 -2
- package/public/assets/{key-B6CnRxYC.js → key-BBeR1F9r.js} +1 -1
- package/public/assets/{loader-circle-DpnL7c1U.js → loader-circle-4X_s6z-L.js} +1 -1
- package/public/assets/{pencil-Dp98Bbvh.js → pencil-er_Z36Ro.js} +1 -1
- package/public/assets/{plus-BB9YPbWy.js → plus-E_rJxJAi.js} +1 -1
- package/public/assets/{rotate-ccw-CteSQ0J5.js → rotate-ccw-DKJbe7VX.js} +1 -1
- package/public/assets/{scroll-text-Dl6Lw1pl.js → scroll-text-DTD9Dg9z.js} +1 -1
- package/public/assets/{settings-Cqt0afZk.js → settings-DaAAUDK3.js} +1 -1
- package/public/assets/{status-colors-CHYNtGzc.js → status-colors-DJc_fXaW.js} +1 -1
- package/public/assets/{task-constants-DrQlHs7Y.js → task-constants-CsjB14wR.js} +1 -1
- package/public/assets/{trash-2-C2F0EkQq.js → trash-2-DUEEg0-a.js} +1 -1
- package/public/assets/{useFetch-CHG6h3HA.js → useFetch-CIp8RQub.js} +1 -1
- package/public/assets/{users-BSVeMP0f.js → users-DyJLLqVQ.js} +1 -1
- package/public/assets/{wifi-C2hMOg8-.js → wifi-BOM9bCKp.js} +1 -1
- package/public/assets/{workflow-CXpYdinq.js → workflow-DCr-oujx.js} +1 -1
- package/public/index.html +1 -1
- package/public/sw.js +1 -1
- package/public/assets/TaskDetailPage-BreGOW7F.js +0 -26
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{c as Y,a as Z,r as l,h as j,j as e,M as kt,z as P,H as wt,t as Q,v as _e,A as _t,f as Ct,B as St,q as Tt,s as Et,k as Qe,p as L,l as Ye,m as Lt,L as Ze,X as it,n as Dt,x as It,U as $t,b as At,G as Pt,E as Rt}from"./index-B_kGxeQJ.js";import{u as Ft,T as Mt,g as ce}from"./task-constants-DrQlHs7Y.js";import{C as Ot,u as Ut,g as qt,P as et,M as Bt,H as Gt}from"./MobileTerminalShell-GSwjTHBM.js";import{a as Kt,b as zt,f as J,c as Wt}from"./date-RFA7-ZGs.js";import{S as tt}from"./Select-C4WWRtUb.js";import{a as ot}from"./status-colors-CHYNtGzc.js";import{a as Xt}from"./agent-type-options-BgbZ38kq.js";import{T as Ht}from"./Tooltip-BinmnSIJ.js";import{A as Vt}from"./arrow-left-BoGcsEnf.js";import{R as xt}from"./rotate-ccw-CteSQ0J5.js";import{G as Jt}from"./git-fork-viGyzUTQ.js";import{E as Qt}from"./external-link--d8U10It.js";import{L as dt}from"./loader-circle-DpnL7c1U.js";import{F as Yt}from"./file-text-DZ6D2Yh1.js";import"./pencil-Dp98Bbvh.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 Zt=Y("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 es=Y("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 ts=Y("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 ss=Y("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"}]]);/**
|
|
22
|
-
* @license lucide-react v0.469.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const as=Y("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);function st({isOpen:n,onClose:c,taskId:s,stageName:r,timeoutSeconds:t,onSubmitted:o}){const{t:m}=Z(),[h,p]=l.useState(t),[_,C]=l.useState(!1);l.useEffect(()=>{if(!n)return;p(t);const x=setInterval(()=>{p(N=>N<=1?(clearInterval(x),0):N-1)},1e3);return()=>clearInterval(x)},[n,t]),l.useEffect(()=>{h===0&&n&&c()},[h,n,c]);const I=l.useCallback(async x=>{C(!0);try{await j.post(`web/tasks/${s}/confirm-stage`,{json:{stageName:r,approved:x}}),o==null||o(),c()}catch{}finally{C(!1)}},[s,r,c,o]);return n?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(kt,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// stage: ",r]})]}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--text-muted)]",children:[e.jsx(Ot,{className:"h-3.5 w-3.5"}),Kt(h)]})]}),e.jsx("div",{className:"space-y-4 px-5 py-5",children:e.jsx("p",{className:"whitespace-pre-wrap text-xs text-[var(--text-primary)]",children:m("tasks.confirm_stage_message",{name:r})})}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",disabled:_,onClick:()=>I(!1),children:m("tasks.reject")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:_,onClick:()=>I(!0),children:m(_?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})]}):null}function rs(n,c){const s=new Date(n).getTime()-Date.now();if(s<=0)return c("tasks.tunnel_expired");const r=Math.floor(s/36e5),t=Math.floor(s%36e5/6e4);return r>0?c("tasks.tunnel_expires_hm",{h:r,m:t}):c("tasks.tunnel_expires_m",{m:t})}function at(n){switch(n){case"CONNECTED":return"var(--accent)";case"STARTING":return"var(--warning)";case"EXPIRED":return"var(--text-muted)";default:return"var(--text-muted)"}}function rt(n,c){switch(n){case"IDLE":case"CLOSED":return c("tasks.tunnel_idle");case"STARTING":return c("tasks.tunnel_starting");case"CONNECTED":return c("tasks.tunnel_connected");case"EXPIRED":return c("tasks.tunnel_expired");case"CLOSING":return c("tasks.tunnel_closing");default:return String(n).toLowerCase()}}function ns({taskId:n,taskFinished:c,compact:s}){const{t:r}=Z(),[t,o]=l.useState(P.IDLE),[m,h]=l.useState(null),[p,_]=l.useState(null),[C,I]=l.useState(""),[x,N]=l.useState(!1),[ie,R]=l.useState(!1),F=l.useRef(null),$=l.useCallback(async()=>{try{const u=await j.get(`web/workspace-tunnel/${n}/status`).json();o(u.status),h(u.tunnelUrl??null),_(u.expiresAt??null),(u.status==="EXPIRED"||u.status==="IDLE"||u.status==="CLOSED")&&S()}catch{}},[n]);function oe(){S(),F.current=setInterval($,5e3)}function S(){F.current&&(clearInterval(F.current),F.current=null)}l.useEffect(()=>{c&&(t===P.STARTING||t===P.CONNECTED)&&(o(P.IDLE),h(null),S())},[c,t]),l.useEffect(()=>{if(t!=="CONNECTED"||!p)return;const u=()=>{const T=rs(p,r);I(T),T===r("tasks.tunnel_expired")&&(o(P.EXPIRED),h(null),S())};u();const D=setInterval(u,3e4);return()=>clearInterval(D)},[t,p]),l.useEffect(()=>()=>S(),[]),l.useEffect(()=>{c||$()},[$,c]);async function K(){N(!0);try{await j.post(`web/workspace-tunnel/${n}/start`),o(P.STARTING),oe()}catch(u){let D=r("tasks.tunnel_start_failed");try{if(u instanceof wt){const T=await u.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{}Q.error(D)}finally{N(!1)}}async function z(){N(!0);try{await j.post(`web/workspace-tunnel/${n}/stop`),o(P.IDLE),h(null),S()}catch{}finally{N(!1)}}async function xe(){m&&(await navigator.clipboard.writeText(m),R(!0),setTimeout(()=>R(!1),2e3))}return s?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:at(t)},children:rt(t,r)}),(t==="IDLE"||t==="CLOSED"||t==="EXPIRED")&&e.jsx("button",{onClick:K,disabled:x,className:"rounded-[4px] px-2 py-1 text-[var(--info)] disabled:opacity-50",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:r(x?"tasks.tunnel_starting":"tasks.tunnel_start")}),t==="CONNECTED"&&m&&e.jsx("a",{href:m.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] px-2 py-1 text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:r("tasks.tunnel_open_in_cursor")})]}):e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 font-mono lowercase",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.tunnel_header")}),e.jsxs("span",{className:"text-xs",style:{color:at(t)},children:["● ",rt(t,r)]})]}),t==="CONNECTED"&&p&&e.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["// ",C]}),t==="CONNECTED"&&m&&e.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"flex-1 truncate text-xs text-[var(--text-primary)]",children:m}),e.jsxs("button",{onClick:xe,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"),"]"]})]}),ie&&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:K,disabled:x,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(x?"tasks.tunnel_starting_button":"tasks.tunnel_start_button")}),t==="STARTING"&&e.jsx("button",{onClick:z,disabled:x,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(x?"tasks.tunnel_stopping":"tasks.tunnel_cancel")}),t==="CONNECTED"&&m&&e.jsxs(e.Fragment,{children:[e.jsx("a",{href:m.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:r("tasks.tunnel_open_cursor")}),e.jsx("a",{href:m.replace(/^https?:/,"vscode:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("tasks.tunnel_open_vscode")}),e.jsx("button",{onClick:z,disabled:x,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(x?"tasks.tunnel_stopping":"tasks.tunnel_stop")})]}),t==="EXPIRED"&&e.jsx("button",{onClick:K,disabled:x,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(x?"tasks.tunnel_starting_button":"tasks.tunnel_restart")})]})]})}function ls({isOpen:n,onClose:c,onConfirm:s,taskId:r,isLoading:t}){const{t:o}=Z();return e.jsx(_e,{isOpen:n,onClose:c,onConfirm:s,title:o("tasks.cancel_task_title"),message:o("tasks.cancel_task_message",{id:String(r)}),confirmLabel:o("tasks.cancel_task_confirm_label"),confirmVariant:"danger",isLoading:t})}function cs({isOpen:n,onClose:c,onConfirm:s,taskId:r,mrUrl:t,isLoading:o,reuseWorkspace:m,onReuseWorkspaceChange:h}){const{t:p}=Z(),_=t?p("tasks.retry_message_with_mr",{id:String(r),url:t}):p("tasks.retry_message_without_mr",{id:String(r)});return e.jsx(_e,{isOpen:n,onClose:c,onConfirm:s,title:p("tasks.retry_title"),message:_,confirmLabel:p("tasks.retry_confirm_label"),confirmVariant:"accent",isLoading:o,children:e.jsxs("label",{className:"flex items-center gap-2 mt-3 text-[var(--text-muted)] text-xs cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:C=>h(C.target.checked),className:"w-3.5 h-3.5 cursor-pointer accent-[var(--accent)]"}),p("tasks.reuse_workspace_label")]})})}const ke=["implement","test","verify","review","simplify","submit"];function we(n){if(typeof n=="string")try{return we(JSON.parse(n))}catch{return null}if(!n||typeof n!="object")return null;const c=n.stages;if(!Array.isArray(c)||c.length===0)return null;const s=c.map(r=>r&&typeof r=="object"?r.name:null).filter(r=>typeof r=="string"&&r.length>0);return s.length===c.length?s:null}function is(n){if(!n.configSnapshot)return ke;try{const c=JSON.parse(n.configSnapshot);return we(c.pipeline)??we(c)??ke}catch{return ke}}function os(n){switch(n){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 le({status:n,agentType:c}){const s=ot(n),r=ce(c);return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-0.5 text-xs",style:{color:s},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-[3px]",style:{backgroundColor:s}}),n.toLowerCase()," / ",r]})}function nt({stages:n,runningBg:c="bg-[#1a1a1a]",py:s="py-1.5"}){return e.jsx(e.Fragment,{children:n.map(r=>{const t=r.status==="completed",o=r.status==="running",m=r.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 ${s} ${o?c:""}`,children:[t&&e.jsx(Rt,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),o&&e.jsx(dt,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),m&&e.jsx(it,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),r.status==="pending"&&e.jsx(Zt,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs",style:{color:t?"var(--accent)":o?"#e5e5e5":m?"var(--destructive)":"#525252",fontWeight:o?500:400},children:o?`> ${r.name}`:r.name})]},r.name)})})}function lt({task:n,ptyStatus:c,displayAgentType:s,t:r,gap:t="gap-2 md:gap-3"}){return e.jsxs("div",{className:`flex items-center ${t}`,children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:r("tasks.pty_terminal")}),e.jsxs("span",{className:`inline-flex items-center gap-1 text-[11px] ${c==="connected"?"text-[var(--accent)]":c==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${c==="connected"?"bg-[var(--accent)]":c==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),r(`tasks.${c}`)]}),e.jsx("span",{className:"text-[11px]",style:{color:ot(n.status)},children:n.status.toLowerCase()}),n.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--accent)]",children:[r("tasks.stage"),": ",n.currentStage]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",s]}),n.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",n.workerName]})]})}function ct({isFinished:n,takeoverState:c,ptyRef:s,t:r}){return e.jsxs(e.Fragment,{children:[!n&&c==="auto"&&e.jsxs("button",{onClick:()=>{var t;return(t=s.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(Gt,{className:"h-3 w-3"}),r("tasks.take_over")]}),!n&&c==="manual"&&e.jsxs("button",{onClick:()=>{var t;return(t=s.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(xt,{className:"h-3 w-3"}),r("tasks.restore_auto")]})]})}function xs(n){const c=is(n),s=n.currentStage?c.indexOf(n.currentStage):-1;return c.map((r,t)=>{let o="pending";return n.status===L.COMPLETED?o="completed":n.status===L.FAILED&&t<=s?o=t===s?"failed":"completed":s>=0&&(t<s?o="completed":t===s&&(o="running")),{name:r,status:o}})}function G(n,c){if(!n||!c)return null;const s=n.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),r=c.split("/").map(encodeURIComponent).join("/");return n.gitPlatform===Pt.GITLAB?`${s}/-/tree/${r}`:`${s}/tree/${r}`}function Cs(){var He,Ve,Je;const{id:n}=_t(),c=Ct(),{t:s}=Z(),r=Ft(a=>a.cancelTask),[t,o]=l.useState(null),[m,h]=l.useState(null),[p,_]=l.useState([]),[C,I]=l.useState(!0),[x,N]=l.useState(null),[ie,R]=l.useState(!1),[F,$]=l.useState(!1),[oe,S]=l.useState(!1),[K,z]=l.useState(!1),[xe,u]=l.useState(!1),[D,T]=l.useState(!1),[Ce,Se]=l.useState(""),[Te,Ee]=l.useState(""),[Le,De]=l.useState("append"),[Ie,de]=l.useState(!1),[$e,mt]=St(),[k,me]=l.useState("terminal"),[Ae,Pe]=l.useState([]),[ee,Re]=l.useState(0),[W,M]=l.useState(0),[X,Fe]=l.useState(""),[te,pt]=l.useState(""),[ut,pe]=l.useState(!1),[ht,Me]=l.useState(!1),[O,ue]=l.useState(null),[Oe,he]=l.useState("disconnected"),[fe,ve]=l.useState("auto"),H=l.useRef(null),Ue=l.useRef(null),ft=Ut(),d=Number(n),f=t?Mt.includes(t.status):!1;Tt(t?Et(t,100):null);const E=l.useCallback(async()=>{try{const a=await j.get(`web/tasks/${d}`).json();o(a)}catch{}},[d]),se=l.useCallback(async()=>{try{const a=await j.get(`web/tasks/${d}/logs`).json();_(a.lines)}catch{}},[d]),U=l.useCallback(async()=>{try{const a=await j.get(`web/tasks/${d}/pending-confirm`).json();N(a.confirm)}catch{N(null)}},[d]),qe=l.useCallback(async()=>{pe(!0);try{const a=new URLSearchParams;a.set("limit","50"),a.set("offset",String(W*50)),X&&a.set("type",X),te&&a.set("search",te);const i=await j.get(`web/tasks/${d}/events?${a}`).json();Pe(i.events),Re(i.total)}catch{}finally{pe(!1)}},[d,W,X,te]);l.useEffect(()=>{k==="logs"&&qe()},[k,qe]),l.useEffect(()=>{k==="pipeline"&&!f&&j.get(`web/workspaces/${d}`).json().then(ue).catch(()=>ue(null))},[k,d,f]);const q=Qe(a=>a.lastEvent),Be=Qe(a=>a.eventSeq);l.useEffect(()=>{I(!0),o(null),h(null),_([]),N(null),ue(null),Pe([]),Re(0),M(0),pe(!1),Promise.all([E(),se(),U()]).finally(()=>I(!1))},[E,se,U]),l.useEffect(()=>{t!=null&&t.projectKey&&j.get(`web/projects/${t.projectKey}`).json().then(h).catch(()=>h(null))},[t==null?void 0:t.projectKey]),l.useEffect(()=>{!q||Be===0||(q.event==="task_status_changed"&&q.taskId===d||q.event==="task_created"&&q.taskId===d)&&(E(),U())},[Be,q,d,E,U]),l.useEffect(()=>{if(f)return;const i=setInterval(()=>{document.visibilityState!=="hidden"&&Promise.all([E(),se(),U()])},15e3);return()=>clearInterval(i)},[f,E,se,U]);const Ge=l.useCallback(()=>N(null),[]),ae=l.useCallback(()=>{N(null),E()},[E]),vt=(t==null?void 0:t.status)===L.FAILED||(t==null?void 0:t.status)===L.CANCELLED,be=(t==null?void 0:t.status)===L.COMPLETED||(t==null?void 0:t.status)===L.FAILED||(t==null?void 0:t.status)===L.CANCELLED;l.useEffect(()=>{$e.get("action")==="fork"&&t&&!C&&(be&&Ke(),mt(a=>(a.delete("action"),a),{replace:!0}))},[t,C,$e,be]);async function bt(){z(!0);try{await r(d),R(!1),await E()}finally{z(!1)}}async function gt(){u(!0);try{await j.post(`web/tasks/${d}/retry`,{json:{reuseWorkspace:Ie}}),$(!1),de(!1),await E()}finally{u(!1)}}function Ke(){Se(""),Ee(""),De("append"),S(!0)}async function jt(){T(!0);try{const a=Ce.trim()||void 0,i=await j.post(`web/tasks/${d}/fork`,{json:{description:a,descriptionMode:a?Le:void 0,agentType:Te||void 0}}).json();S(!1),Q.success(s("tasks.fork_success")),c(`/tasks/${i.task.id}`)}catch{Q.error(s("tasks.fork_error"))}finally{T(!1)}}const y=l.useMemo(()=>t?xs(t):[],[t==null?void 0:t.configSnapshot,t==null?void 0:t.currentStage,t==null?void 0:t.status]),ge=y.findIndex(a=>a.status==="running");if(C)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:s("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:s("tasks.task_not_found")}),e.jsxs("button",{onClick:()=>c("/tasks"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",s("tasks.back_to_tasks")]})]});const w=t.status===L.QUEUED&&t.queuePosition!=null&&t.queueTotal!=null?{position:t.queuePosition,total:t.queueTotal}:null,v=zt(t.startedAt,t.completedAt),V=qt(t),je=ce(t.agentType),Nt=[{value:"",label:s("tasks.fork_agent_type_placeholder",{agent:ce(V)})},...Xt(ce,V)],re=`${s("tasks.status_suspended")} / ${je}`,ze=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,We=e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>c("/tasks"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(Vt,{className:"h-4 w-4"})}),e.jsxs("span",{className:"line-clamp-2 text-sm font-medium text-[var(--text-primary)]",title:Lt(t),children:["#",t.id," ",Ye(t,100)]})]}),Ne=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(le,{status:t.status,agentType:t.agentType}),v&&e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// time cost: ",v]}),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:s("tasks.queue_position",{position:String(w.position),total:String(w.total)})})]}),e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs(Ze,{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: ",G(m,t.branch)?e.jsx("a",{href:G(m,t.branch),target:"_blank",rel:"noopener noreferrer",className:"text-[var(--text-primary)] hover:text-[var(--info)] hover:underline transition-colors",children:t.branch}):e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch})]})]}),t.mrUrl&&/^https?:\/\//.test(t.mrUrl)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline",children:["MR: ",((He=t.mrUrl.match(/!?\d+$/))==null?void 0:He[0])??"view"]})]})]}),Xe=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:[!f&&e.jsxs("button",{onClick:()=>R(!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(it,{className:"h-3 w-3"}),s("tasks.cancel_task")]}),vt&&e.jsxs("button",{onClick:()=>$(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-3 h-8 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors cursor-pointer",children:[e.jsx(xt,{className:"h-3 w-3"}),s("tasks.retry_task")]}),be&&e.jsxs("button",{onClick:Ke,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(Jt,{className:"h-3 w-3"}),s("tasks.fork_task")]}),t.workerId&&!f&&e.jsxs("button",{onClick:()=>{me("pipeline"),setTimeout(()=>{var a,i;(i=(a=Ue.current)==null?void 0:a.scrollIntoView)==null||i.call(a,{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(Qt,{className:"h-3 w-3"}),s("tasks.cursor_tunnel")]})]}),yt=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:s("tasks.pipeline_stages")}),e.jsx(nt,{stages:y})]}),v&&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: ",v]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:s("tasks.activity_log")}),p.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:p.slice(0,8).map((a,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:a},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.no_activity")})]})]}),ye=e.jsxs(e.Fragment,{children:[e.jsx(ls,{isOpen:ie,onClose:()=>R(!1),onConfirm:bt,taskId:d,isLoading:K}),e.jsx(cs,{isOpen:F,onClose:()=>{$(!1),de(!1)},onConfirm:gt,taskId:d,mrUrl:t.mrUrl??void 0,isLoading:xe,reuseWorkspace:Ie,onReuseWorkspaceChange:de}),e.jsx(_e,{isOpen:oe,onClose:()=>S(!1),onConfirm:jt,title:s("tasks.fork_task"),message:s("tasks.fork_task_desc"),confirmLabel:s("tasks.fork_task"),confirmVariant:"accent",isLoading:D,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 #",d]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.form_agent_type")}),e.jsx(tt,{value:Te,onChange:Ee,options:Nt})]}),e.jsx("textarea",{value:Ce,onChange:a=>Se(a.target.value),placeholder:s("tasks.fork_description_placeholder"),rows:4,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 text-[11px] text-[var(--text-secondary)]",children:[e.jsx("input",{type:"checkbox",checked:Le==="replace",onChange:a=>De(a.target.checked?"replace":"append"),className:"mt-0.5 h-3.5 w-3.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] accent-[var(--accent)]"}),e.jsxs("span",{children:[s("tasks.fork_replace_description"),e.jsx("span",{className:"mt-1 block text-[10px] text-[var(--text-muted)]",children:s("tasks.fork_append_hint")})]})]})]})})]});return ht&&k==="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:[Ne,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(lt,{task:t,ptyStatus:Oe,displayAgentType:V,t:s,gap:"gap-3"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ct,{isFinished:f,takeoverState:fe,ptyRef:H,t:s}),e.jsx("button",{onClick:()=>Me(!1),className:"flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1 text-[var(--text-muted)]",children:e.jsx(ss,{className:"h-3 w-3"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(et,{ref:H,taskId:d,sessionId:t.currentSessionId??void 0,taskFinished:f,onStatusChange:he,onTakeoverChange:ve})}),Xe,ye]}):t.status===L.SUSPENDED?e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[We,Ne,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:s("tasks.task_suspended_banner")}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row gap-4 md:gap-6 p-4 md:p-6 overflow-y-auto",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[e.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[e.jsxs("span",{className:"text-xl font-bold text-[var(--text-primary)]",children:["#",t.id]}),e.jsx("span",{className:"text-base text-[var(--text-secondary)] truncate max-w-[60%]",children:e.jsx(Ht,{content:Dt(t),children:Ye(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:re})]}),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:re})}),x&&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:s("tasks.pending_confirmation")}),e.jsx("p",{className:"mb-3 text-xs text-[var(--text-secondary)]",children:x.prompt??s("tasks.pipeline_requires_confirmation")}),e.jsx("div",{className:"mb-3 flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"stage"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:x.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 j.post(`web/tasks/${d}/confirm-stage`,{json:{stageName:x.stageName,approved:!0}}),ae()}catch{Q.error(s("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:s("tasks.confirm_and_proceed")}),e.jsx("button",{onClick:async()=>{try{await j.post(`web/tasks/${d}/confirm-stage`,{json:{stageName:x.stageName,approved:!1}}),ae()}catch{Q.error(s("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:s("tasks.reject")})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:s("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:re})]}),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:J(t.createdAt)})]})]})]}),e.jsx("div",{className:"hidden md:flex flex-wrap items-center gap-2 py-2",children:y.map((a,i)=>{const b=a.status==="failed",g=a.status==="completed",A=a.status==="running"&&t.status===L.SUSPENDED,B=b?"var(--destructive)":g?"var(--accent)":A?"var(--warning)":"#525252",ne=b?"rgba(239,68,68,0.12)":g?"rgba(34,197,94,0.12)":A?"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:B,backgroundColor:ne,fontWeight:A?700:400,border:A?`1px solid ${B}`:void 0},children:A?"confirm":`${a.name}${g?" ✓":b?" ✗":""}`}),i<y.length-1&&e.jsx("div",{className:"h-px w-6 bg-[var(--border)]"})]},a.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:s("tasks.pty_output")}),e.jsxs("div",{className:"flex flex-col gap-1",children:[p.slice(-10).map((a,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-secondary)]",children:a},i)),p.length===0&&e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:s("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:s("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:re})]}),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:s("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2",children:y.map(a=>{const i=a.status==="completed"?"var(--info)":a.status==="failed"?"var(--destructive)":a.status==="running"?"var(--warning)":"#525252",b=a.status==="failed"?"var(--destructive)":a.status==="running"?"var(--warning)":"#a3a3a3",g=a.status==="completed"?"completed":a.status==="running"?"suspended":a.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[4px]",style:{backgroundColor:i}}),e.jsxs("span",{className:"text-[11px]",style:{color:b,fontWeight:a.status==="running"?700:400},children:[a.name," ",g]})]},a.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:J(t.createdAt)})]})})]})]}),x&&e.jsx(st,{isOpen:!!x,onClose:Ge,taskId:d,stageName:x.stageName,timeoutSeconds:Math.ceil(x.timeout/1e3),onSubmitted:ae}),ye]}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden font-mono lowercase",children:[We,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(le,{status:t.status,agentType:t.agentType}),v&&e.jsxs("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:["// time cost: ",v]}),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&&(G(m,t.branch)?e.jsx("a",{href:G(m,t.branch),target:"_blank",rel:"noopener noreferrer",className:"shrink-0 text-[11px] text-[var(--text-muted)] hover:text-[var(--info)] hover:underline truncate max-w-[80px] md:max-w-[120px] transition-colors",children:t.branch}):e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)] truncate max-w-[80px] md:max-w-[120px]",children:t.branch}))]}),Ne,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(es,{className:"h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{children:[s("tasks.queue_position_banner",{position:String(w.position),total:String(w.total)}),w.position>1?` — ${s("tasks.queue_ahead",{count:String(w.position-1)})}`:` — ${s("tasks.queue_next")}`]})]}),x&&e.jsx(st,{isOpen:!!x,onClose:Ge,taskId:d,stageName:x.stageName,timeoutSeconds:Math.ceil(x.timeout/1e3),onSubmitted:ae}),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(a=>e.jsx("button",{onClick:()=>me(a),className:`shrink-0 whitespace-nowrap px-4 py-2.5 text-xs transition-colors ${k===a?"border-b-2 border-[var(--accent)] text-[var(--accent)] font-medium":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:s(a==="terminal"?"tasks.terminal":a==="pipeline"?"tasks.pipeline_tab":a==="logs"?"tasks.logs":"tasks.detail_tab")},a))}),k==="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(lt,{task:t,ptyStatus:Oe,displayAgentType:V,t:s}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ct,{isFinished:f,takeoverState:fe,ptyRef:H,t:s}),!f&&fe==="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(dt,{className:"h-3 w-3 animate-spin"}),s("tasks.requesting_takeover")]}),!f&&t.currentStage&&e.jsxs("button",{className:"hidden md:flex items-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-2.5 h-10 md:h-8 text-[11px] text-[var(--text-muted)]",children:[e.jsx(as,{className:"h-3 w-3"}),s("tasks.skip_stage")]}),e.jsx("button",{onClick:()=>Me(!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(ts,{className:"h-3 w-3"})})]})]}),e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-4 py-2 shrink-0 md:hidden",children:[e.jsx(le,{status:t.status,agentType:t.agentType}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",V]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:s("tasks.stage_progress")}),e.jsx("div",{className:"mt-2 overflow-x-auto no-scrollbar pr-4",style:{borderRadius:0},children:e.jsx("div",{className:"flex items-center gap-1 py-0.5",children:y.map((a,i)=>{const b=a.status==="completed",g=a.status==="running",B=a.status==="failed"?"var(--destructive)":b||g?"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:B,fontWeight:g?600:400},children:[a.name,b?" ✓":g?" ...":""]}),i<y.length-1&&e.jsx("div",{className:"mx-1.5 h-px w-4 shrink-0",style:{backgroundColor:B}})]},a.name)})})})]}),ft?e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(Bt,{ref:H,taskId:d,sessionId:t.currentSessionId??void 0,taskFinished:f,onStatusChange:he,onTakeoverChange:ve})}):e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(et,{ref:H,taskId:d,sessionId:t.currentSessionId??void 0,taskFinished:f,onStatusChange:he,onTakeoverChange:ve})}),Xe]}),k==="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:y.map((a,i)=>{const b=a.status==="completed",g=a.status==="running",ne=a.status==="failed"?"var(--destructive)":b||g?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",style:{flex:i<y.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:ne},children:[b&&e.jsx("span",{className:"text-[11px] md:text-xs font-semibold text-[#0c0c0c]",children:"✓"}),g&&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:ne},children:a.name})]}),i<y.length-1&&e.jsx("div",{className:"mx-1 md:mx-2 h-0.5 flex-1 min-w-3 rounded-full",style:{backgroundColor:i<(ge>=0?ge:0)?"var(--accent)":"#525252"}})]},a.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," (",ge+1,"/",y.length,")"]}),t.startedAt&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",J(t.startedAt).replace(" ago","")]}),v&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",v]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// retries: ",t.retryCount,"/2"]})]}),!t.currentStage&&v&&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: ",v]})}),e.jsx("button",{onClick:()=>me("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:["// ",s("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:s("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??"-"})]}),ze]})]}),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:s("tasks.pipeline_stages")}),e.jsx(nt,{stages:y,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:s("tasks.activity_log")}),p.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:p.slice(-12).map((a,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:a},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.no_activity")})]})]})]}),k==="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:s("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(a=>e.jsx("button",{onClick:()=>{Fe(a),M(0)},className:`shrink-0 rounded-[4px] px-2.5 py-1 text-[11px] ${X===a?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)]"}`,children:a||"all"},a))}),e.jsx("div",{className:"hidden md:block",children:e.jsx(tt,{value:X,onChange:a=>{Fe(a),M(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(It,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:s("tasks.search_logs"),value:te,onChange:a=>{pt(a.target.value),M(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:[Ae.map((a,i)=>e.jsxs("div",{className:`flex items-start md:items-center gap-2 md:gap-4 rounded-[4px] px-2 md:px-3 py-2 text-[11px] md:text-xs ${i%2===0?"bg-[var(--bg-card)]":""}`,children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:new Date(a.timestamp).toLocaleTimeString("en-US",{hour12:!1})}),e.jsx("span",{className:`shrink-0 font-medium ${os(a.type)}`,children:a.type}),e.jsx("span",{className:"min-w-0 break-words md:truncate text-[var(--text-primary)]",children:a.message})]},a.id)),Ae.length===0&&!ut&&e.jsx("p",{className:"py-8 text-center text-xs text-[var(--text-muted)]",children:s("tasks.no_log_entries")})]}),ee>50&&e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[Array.from({length:Math.ceil(ee/50)}).slice(0,5).map((a,i)=>e.jsx("button",{onClick:()=>M(i),className:`rounded-[4px] px-2 py-1 text-xs ${W===i?"bg-[var(--accent)] text-black font-medium":"text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:i+1},i)),Math.ceil(ee/50)>5&&e.jsx("button",{onClick:()=>M(W+1),disabled:W>=Math.ceil(ee/50)-1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] disabled:opacity-30",children:">"})]})]}),k==="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($t,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:s("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:s("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:s("common.created_at")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:Wt(t.createdAt)}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:J(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:s("common.status")}),e.jsx(le,{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:s("tasks.detail_project")}),e.jsx(Ze,{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:s("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:s("tasks.form_agent_type")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:je})]}),v&&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:s("tasks.detail_time_cost")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:v})]}),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:s("tasks.detail_branch")}),G(m,t.branch)?e.jsx("a",{href:G(m,t.branch),target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline transition-colors truncate",children:t.branch}):e.jsx("span",{className:"text-xs text-[var(--text-primary)] truncate",children:t.branch})]}),t.mrUrl&&/^https?:\/\//.test(t.mrUrl)&&e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.mr_link")}),e.jsx("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline truncate",children:((Ve=t.mrUrl.match(/!?\d+$/))==null?void 0:Ve[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(Yt,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:s("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:s("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:s("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:s("tasks.detail_source")}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:t.sourcePlatform})]})]})]}),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(At,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:s("tasks.detail_description")})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[#0c0c0c] p-4 overflow-x-auto",children:e.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--text-secondary)] font-mono",children:t.description})})]})]})]}),k==="terminal"&&yt,k==="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:s("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:s("common.created_at")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:J(t.createdAt)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:s("tasks.form_agent_type")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:je})]}),v&&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:v})]}),ze]})]}),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:s("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??(O==null?void 0:O.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:(O==null?void 0:O.path)??"-"})]}),t.mrUrl&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:s("tasks.mr_link")}),e.jsx("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-[var(--info)] hover:underline",children:((Je=t.mrUrl.match(/!?\d+$/))==null?void 0:Je[0])??"view"})]})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{ref:Ue,className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:s("tasks.cursor_tunnel_section")}),t.workerId?e.jsx(ns,{taskId:d,taskFinished:f,compact:!0}):e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("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:s("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2 text-xs",children:y.map(a=>{const i=a.status==="completed"?"✓":a.status==="running"?"→":"·",b=a.status==="running"?"var(--accent)":a.status==="completed"?"var(--info)":a.status==="failed"?"var(--destructive)":"#525252",g=a.status==="completed"?"done":a.status==="running"?"running...":a.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-semibold",style:{color:b},children:i}),e.jsx("span",{className:a.status==="running"?"font-medium":"",style:{color:b},children:a.name}),e.jsxs("span",{className:"text-[11px]",style:{color:"#525252"},children:["— ",g]})]},a.name)})})]})]})]}),ye]})}export{Cs as default};
|