@overlordai/server 1.0.74 → 1.0.76
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/database/repositories/task.repository.d.ts +1 -0
- package/dist/database/repositories/task.repository.d.ts.map +1 -1
- package/dist/database/repositories/task.repository.js +7 -0
- package/dist/database/repositories/task.repository.js.map +1 -1
- package/dist/web/frame-handlers/progress.handler.d.ts.map +1 -1
- package/dist/web/frame-handlers/progress.handler.js +4 -1
- package/dist/web/frame-handlers/progress.handler.js.map +1 -1
- package/dist/web/project.controller.d.ts +3 -2
- package/dist/web/project.controller.d.ts.map +1 -1
- package/dist/web/project.controller.js +10 -3
- package/dist/web/project.controller.js.map +1 -1
- package/package.json +4 -4
- package/public/assets/{AccessTokensPage-CdB7dPa2.js → AccessTokensPage-HdCYJa75.js} +1 -1
- package/public/assets/{AdminPage-BMqZ8KmR.js → AdminPage-D0DGfKeC.js} +1 -1
- package/public/assets/{ApiReferencePage--sktn6Aa.js → ApiReferencePage-CHgGzez9.js} +1 -1
- package/public/assets/{ArchitecturePage-CHBQWeQs.js → ArchitecturePage-BLaVm-RT.js} +1 -1
- package/public/assets/{AuditLogPage-Bnuwq2vl.js → AuditLogPage-ZQDfN6L2.js} +1 -1
- package/public/assets/{BindPlatformPage-CDCToHSq.js → BindPlatformPage-BlS6wVHU.js} +1 -1
- package/public/assets/{BotIntegrationPage-CPoRuqDV.js → BotIntegrationPage-huJbbEp5.js} +1 -1
- package/public/assets/{BotManage-YQribMl1.js → BotManage-aUmSjI1o.js} +1 -1
- package/public/assets/{BotSetupPage-C6t116Uf.js → BotSetupPage-Cv9n4JE8.js} +1 -1
- package/public/assets/{ChangelogPage-DSukekt5.js → ChangelogPage-BEihl-PT.js} +1 -1
- package/public/assets/{CliReferencePage-BGHrgANO.js → CliReferencePage-Bi4QqQW_.js} +1 -1
- package/public/assets/{DeploymentPage-4-FMuvw2.js → DeploymentPage-C13_DqXl.js} +1 -1
- package/public/assets/{DevWorkflowPage-Bmgk71xt.js → DevWorkflowPage-BN5U4PpB.js} +1 -1
- package/public/assets/{DeveloperManage-rLDNYCV1.js → DeveloperManage-CVkEj-GC.js} +2 -2
- package/public/assets/{DeveloperSetupPage-qWK3tgPL.js → DeveloperSetupPage-ee3KC_yg.js} +1 -1
- package/public/assets/DocsIndexPage-CcQ47yH4.js +31 -0
- package/public/assets/DocsLayout-BbUFudE1.js +1 -0
- package/public/assets/{DocsPrimitives-DmjVT75w.js → DocsPrimitives-D_xTbmba.js} +1 -1
- package/public/assets/{EditProjectPage-i9H0710Y.js → EditProjectPage-BoM1gu0v.js} +1 -1
- package/public/assets/{EmptyState-CZ813NtX.js → EmptyState-BQgUq8FU.js} +1 -1
- package/public/assets/{EnvVariablesPage-C65oYe5g.js → EnvVariablesPage-Cs_Vrd_A.js} +1 -1
- package/public/assets/{HomePage-nAdxD3nu.js → HomePage-BV0m_XJd.js} +1 -1
- package/public/assets/{InfoRow-DHgmgwrO.js → InfoRow-Co_nykFf.js} +1 -1
- package/public/assets/{InstallationPage-DIutucRJ.js → InstallationPage-yO4Ok1ZK.js} +1 -1
- package/public/assets/{LandingPage-BGnfUNlF.js → LandingPage-BSagkLUI.js} +7 -17
- package/public/assets/{LocalDevelopmentPage-CRoltkBj.js → LocalDevelopmentPage-DnZwN8ps.js} +1 -1
- package/public/assets/{LoginPage-fPcMwMCY.js → LoginPage-CTqF4VQa.js} +1 -1
- package/public/assets/{MetricBar-524799T_.js → MetricBar-DIYwY_X1.js} +1 -1
- package/public/assets/{NotFoundPage--d6u12uz.js → NotFoundPage-BYPR4ndS.js} +1 -1
- package/public/assets/{OnboardingGuide-DQnpV9bY.js → OnboardingGuide-CJKcE06d.js} +1 -1
- package/public/assets/{PermissionsPage-4_ol9vsQ.js → PermissionsPage-NyuAcw0g.js} +1 -1
- package/public/assets/{PipelineConfigPage-davXseud.js → PipelineConfigPage-Bt4TM7LK.js} +1 -1
- package/public/assets/{PipelineEditorPage-KbTGD5NV.js → PipelineEditorPage-C0CaNfhQ.js} +1 -1
- package/public/assets/ProfilePage-BNcja3TW.js +1 -0
- package/public/assets/{ProjectDetailPage-BrhVK3I7.js → ProjectDetailPage-BZbRE6zC.js} +1 -1
- package/public/assets/{ProjectListPage-DHwuyL4D.js → ProjectListPage-B1sWLmSr.js} +1 -1
- package/public/assets/{PtyTerminal-D6dJsjvW.js → PtyTerminal-4TaY1kgl.js} +4 -9
- package/public/assets/{QuickAuth-Bem_-NYM.js → QuickAuth-B9i5aIAm.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-CDIgH4fS.js → RemoveMemberConfirmDialog-PTZ4yZLA.js} +1 -1
- package/public/assets/{Select-CVzFPLV0.js → Select-DzcHkMFW.js} +1 -1
- package/public/assets/{SettingsPage-C6j7I-4h.js → SettingsPage-cljP-LVJ.js} +1 -1
- package/public/assets/{Skeleton-CtfLe0F_.js → Skeleton-BR0DoH0N.js} +1 -1
- package/public/assets/{SkillPage-DumTP7A2.js → SkillPage-CNmqjhZ1.js} +1 -1
- package/public/assets/TaskDetailPage-DVwaQllQ.js +21 -0
- package/public/assets/{TaskListPage-B5yEH2Oo.js → TaskListPage-C7a89N4m.js} +1 -1
- package/public/assets/{TaskStatusBadge-Bli_2jM_.js → TaskStatusBadge-D_Jw_cst.js} +1 -1
- package/public/assets/{TerminalHomePage-DsvAvF01.js → TerminalHomePage-CDy66NL4.js} +8 -3
- package/public/assets/{TokenManage-BihBGPKP.js → TokenManage-s1HsCpRE.js} +1 -1
- package/public/assets/{TotpSetupPage-BSTcP1Fh.js → TotpSetupPage-BDbdnX4M.js} +1 -1
- package/public/assets/WorkerDetailPage-BwTlDQuc.js +1 -0
- package/public/assets/{WorkerListPage-DQTvxg4j.js → WorkerListPage-CWn51Nsl.js} +1 -1
- package/public/assets/{WorkerOperationsPage-D6ACpx-F.js → WorkerOperationsPage-CMbnqwmO.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-DEZuW2vF.js → WorkerSetupGuidePage-Hu_9GEqj.js} +1 -1
- package/public/assets/{WorkerSetupPage-BvWWz121.js → WorkerSetupPage-ykJJzCFL.js} +1 -1
- package/public/assets/{arrow-left-Bn5LCLJl.js → arrow-left-CDuSMrWp.js} +1 -1
- package/public/assets/{arrow-right-CRTo4OdJ.js → arrow-right-3wSL_8gn.js} +1 -1
- package/public/assets/{bot-mqKcispY.js → bot-D_0cntUM.js} +1 -1
- package/public/assets/{chevron-right-BX_xO2Cu.js → chevron-right-BarF-1AB.js} +1 -1
- package/public/assets/code-xml-BgTCXCKf.js +6 -0
- package/public/assets/{copy-CKVgJH1_.js → copy-Btb09PwL.js} +1 -1
- package/public/assets/{download-DGs9YaDa.js → download-D9JgkXvp.js} +1 -1
- package/public/assets/{external-link-CXaFoLtw.js → external-link-4_nsu_co.js} +1 -1
- package/public/assets/index-CG1vw6aK.css +1 -0
- package/public/assets/{index-HEIAHSOv.js → index-XalE15Aa.js} +46 -46
- package/public/assets/{key-D78HfLQW.js → key-D4tKYtq0.js} +1 -1
- package/public/assets/layout-grid-SPgDVvMd.js +6 -0
- package/public/assets/{loader-circle-BIGOFbGI.js → loader-circle-D0LpN5IB.js} +1 -1
- package/public/assets/{message-square-DzZ7IOii.js → message-square-RhP4vE3x.js} +1 -1
- package/public/assets/{pencil-IaW_aqZ2.js → pencil-UTucmT5t.js} +1 -1
- package/public/assets/{plus-CU2DOaRd.js → plus-CBPo9p9z.js} +1 -1
- package/public/assets/{rotate-ccw-FCuCJvAr.js → rotate-ccw-Dg7_RL_a.js} +1 -1
- package/public/assets/{scroll-text-CN8OVOTI.js → scroll-text-Dyl0Pr4m.js} +1 -1
- package/public/assets/{settings-flkGsXSm.js → settings-D3lyLPwd.js} +1 -1
- package/public/assets/{status-colors-LJQDTyXq.js → status-colors-tZq0K5Ad.js} +1 -1
- package/public/assets/{task-constants-CUlfGa6V.js → task-constants-D7DvweHm.js} +1 -1
- package/public/assets/{trash-2-Bu9foptJ.js → trash-2-oqlQYQiX.js} +1 -1
- package/public/assets/{useFetch-BzAw29NB.js → useFetch-rAH39ftj.js} +1 -1
- package/public/assets/{users-8ddoVpqX.js → users-6K6_kLrk.js} +1 -1
- package/public/assets/{wifi-i1U-78I4.js → wifi-LKenGVZV.js} +1 -1
- package/public/assets/{workflow-DcMPEeFk.js → workflow-Ck4Lwoo5.js} +1 -1
- package/public/assets/zap-DHrFvUYe.js +6 -0
- package/public/index.html +3 -3
- package/public/sw.js +1 -1
- package/public/assets/DocsLayout-C5SUktWC.js +0 -41
- package/public/assets/ProfilePage-CGuydV0Y.js +0 -1
- package/public/assets/TaskDetailPage-Nrk0Mlqe.js +0 -21
- package/public/assets/WorkerDetailPage-CE5p6bj7.js +0 -1
- package/public/assets/index-CVFlBK8x.css +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as t}from"./index-XalE15Aa.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 r=t("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);export{r as L};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as r,l as e,
|
|
1
|
+
import{W as r,l as e,M as s,Q as u,I as a}from"./index-XalE15Aa.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--accent)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const c={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return c[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,c as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as f,g as n,l as c}from"./index-
|
|
1
|
+
import{k as f,g as n,l as c}from"./index-XalE15Aa.js";const T=f((t,e)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,fetchTasks:async a=>{const s=e()._fetchTasksAbort;s&&s.abort();const o=new AbortController;t({loading:!0,error:null,_fetchTasksAbort:o});try{const r={};a!=null&&a.status&&(r.status=a.status),a!=null&&a.projectKey&&(r.projectKey=a.projectKey),a!=null&&a.cursor&&(r.cursor=a.cursor),a!=null&&a.limit&&(r.limit=String(a.limit));const l=await n.get("web/tasks",{searchParams:r,signal:o.signal}).json();a!=null&&a.cursor?t(i=>({tasks:[...i.tasks,...l.data],nextCursor:l.nextCursor??null,_fetchTasksAbort:null})):t({tasks:l.data,nextCursor:l.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;t({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{t({loading:!1})}},fetchTask:async a=>{t({loading:!0,error:null});try{const s=await n.get(`web/tasks/${a}`).json();t({currentTask:s})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch task"})}finally{t({loading:!1})}},createTask:async a=>{t({error:null});try{const s=await n.post("web/tasks",{json:a}).json();return t(o=>({tasks:[s,...o.tasks]})),s}catch(s){throw t({error:s instanceof Error?s.message:"Failed to create task"}),s}},cancelTask:async a=>{t({error:null});try{await n.post(`web/tasks/${a}/cancel`);const{currentTask:s}=e();(s==null?void 0:s.id)===a&&await e().fetchTask(a)}catch(s){throw t({error:s instanceof Error?s.message:"Failed to cancel task"}),s}},reset:()=>{t({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null})}})),h=[c.COMPLETED,c.FAILED,c.CANCELLED],b=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}];export{h as T,b as a,T as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-XalE15Aa.js";function p(c,f){const[l,i]=e.useState(null),[d,u]=e.useState(!0),[R,a]=e.useState(null),o=e.useRef(c);o.current=c;const r=e.useRef(0),n=e.useCallback(async()=>{const s=++r.current;u(!0),a(null);try{const t=await o.current();s===r.current&&i(t)}catch(t){if(s===r.current){const g=t instanceof Error?t.message:"An unexpected error occurred";a(g)}}finally{s===r.current&&u(!1)}},f);return e.useEffect(()=>{n()},[n]),{data:l,loading:d,error:R,refetch:n}}export{p as u};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as a}from"./index-XalE15Aa.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 e=a("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);export{e as Z};
|
package/public/index.html
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover" />
|
|
6
6
|
<title>overlord</title>
|
|
7
7
|
<meta name="description" content="dispatch coding tasks across your machine fleet. ai agents execute in parallel — claude code, cursor, codex. pool subscriptions, trigger from anywhere, watch live terminal output." />
|
|
8
8
|
<meta property="og:title" content="overlord — a dev team that never sleeps" />
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
|
|
29
29
|
rel="stylesheet"
|
|
30
30
|
/>
|
|
31
|
-
<script type="module" crossorigin src="/assets/index-
|
|
32
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
31
|
+
<script type="module" crossorigin src="/assets/index-XalE15Aa.js"></script>
|
|
32
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CG1vw6aK.css">
|
|
33
33
|
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
34
34
|
<body>
|
|
35
35
|
<div id="root"></div>
|
package/public/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let
|
|
1
|
+
if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let a={};const u=s=>l(s,r),o={module:{uri:r},exports:a,require:u};e[r]=Promise.all(i.map(s=>o[s]||u(s))).then(s=>(n(...s),a))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"e9894620584ee2a9461dab657e730147"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"apple-touch-icon-152x152.png",revision:"8cc7ef3bc3aa19c3d8a29a58646d0636"},{url:"apple-touch-icon-120x120.png",revision:"7057fb6fb60df3fcf3cd49883db13be9"},{url:"assets/zap-DHrFvUYe.js",revision:null},{url:"assets/workflow-Ck4Lwoo5.js",revision:null},{url:"assets/wifi-LKenGVZV.js",revision:null},{url:"assets/users-6K6_kLrk.js",revision:null},{url:"assets/useFetch-rAH39ftj.js",revision:null},{url:"assets/trash-2-oqlQYQiX.js",revision:null},{url:"assets/task-constants-D7DvweHm.js",revision:null},{url:"assets/string-B39tzdVK.js",revision:null},{url:"assets/status-colors-tZq0K5Ad.js",revision:null},{url:"assets/settings-D3lyLPwd.js",revision:null},{url:"assets/scroll-text-Dyl0Pr4m.js",revision:null},{url:"assets/rotate-ccw-Dg7_RL_a.js",revision:null},{url:"assets/plus-CBPo9p9z.js",revision:null},{url:"assets/pencil-UTucmT5t.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/message-square-RhP4vE3x.js",revision:null},{url:"assets/loader-circle-D0LpN5IB.js",revision:null},{url:"assets/layout-grid-SPgDVvMd.js",revision:null},{url:"assets/key-D4tKYtq0.js",revision:null},{url:"assets/index-XalE15Aa.js",revision:null},{url:"assets/index-CG1vw6aK.css",revision:null},{url:"assets/external-link-4_nsu_co.js",revision:null},{url:"assets/download-D9JgkXvp.js",revision:null},{url:"assets/date-BdNtiQTP.js",revision:null},{url:"assets/copy-Btb09PwL.js",revision:null},{url:"assets/code-xml-BgTCXCKf.js",revision:null},{url:"assets/chevron-right-BarF-1AB.js",revision:null},{url:"assets/bot-D_0cntUM.js",revision:null},{url:"assets/arrow-right-3wSL_8gn.js",revision:null},{url:"assets/arrow-left-CDuSMrWp.js",revision:null},{url:"assets/WorkerSetupPage-ykJJzCFL.js",revision:null},{url:"assets/WorkerSetupGuidePage-Hu_9GEqj.js",revision:null},{url:"assets/WorkerOperationsPage-CMbnqwmO.js",revision:null},{url:"assets/WorkerListPage-CWn51Nsl.js",revision:null},{url:"assets/WorkerDetailPage-BwTlDQuc.js",revision:null},{url:"assets/TotpSetupPage-BDbdnX4M.js",revision:null},{url:"assets/TokenManage-s1HsCpRE.js",revision:null},{url:"assets/TerminalHomePage-CDy66NL4.js",revision:null},{url:"assets/TaskStatusBadge-D_Jw_cst.js",revision:null},{url:"assets/TaskListPage-C7a89N4m.js",revision:null},{url:"assets/TaskDetailPage-DVwaQllQ.js",revision:null},{url:"assets/SkillPage-CNmqjhZ1.js",revision:null},{url:"assets/Skeleton-BR0DoH0N.js",revision:null},{url:"assets/SettingsPage-cljP-LVJ.js",revision:null},{url:"assets/Select-DzcHkMFW.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-PTZ4yZLA.js",revision:null},{url:"assets/QuickAuth-B9i5aIAm.js",revision:null},{url:"assets/PtyTerminal-Beg8tuEN.css",revision:null},{url:"assets/PtyTerminal-4TaY1kgl.js",revision:null},{url:"assets/ProjectListPage-B1sWLmSr.js",revision:null},{url:"assets/ProjectDetailPage-BZbRE6zC.js",revision:null},{url:"assets/ProfilePage-BNcja3TW.js",revision:null},{url:"assets/PipelineEditorPage-C0CaNfhQ.js",revision:null},{url:"assets/PipelineConfigPage-Bt4TM7LK.js",revision:null},{url:"assets/PermissionsPage-NyuAcw0g.js",revision:null},{url:"assets/OnboardingGuide-CJKcE06d.js",revision:null},{url:"assets/NotFoundPage-BYPR4ndS.js",revision:null},{url:"assets/MetricBar-DIYwY_X1.js",revision:null},{url:"assets/LoginPage-CTqF4VQa.js",revision:null},{url:"assets/LocalDevelopmentPage-DnZwN8ps.js",revision:null},{url:"assets/LandingPage-BSagkLUI.js",revision:null},{url:"assets/InstallationPage-yO4Ok1ZK.js",revision:null},{url:"assets/InfoRow-Co_nykFf.js",revision:null},{url:"assets/HomePage-BV0m_XJd.js",revision:null},{url:"assets/EnvVariablesPage-Cs_Vrd_A.js",revision:null},{url:"assets/EmptyState-BQgUq8FU.js",revision:null},{url:"assets/EditProjectPage-BoM1gu0v.js",revision:null},{url:"assets/DocsPrimitives-D_xTbmba.js",revision:null},{url:"assets/DocsLayout-BbUFudE1.js",revision:null},{url:"assets/DocsIndexPage-CcQ47yH4.js",revision:null},{url:"assets/DeveloperSetupPage-ee3KC_yg.js",revision:null},{url:"assets/DeveloperManage-CVkEj-GC.js",revision:null},{url:"assets/DevWorkflowPage-BN5U4PpB.js",revision:null},{url:"assets/DeploymentPage-C13_DqXl.js",revision:null},{url:"assets/CliReferencePage-Bi4QqQW_.js",revision:null},{url:"assets/ChangelogPage-BEihl-PT.js",revision:null},{url:"assets/BotSetupPage-Cv9n4JE8.js",revision:null},{url:"assets/BotManage-aUmSjI1o.js",revision:null},{url:"assets/BotIntegrationPage-huJbbEp5.js",revision:null},{url:"assets/BindPlatformPage-BlS6wVHU.js",revision:null},{url:"assets/AuditLogPage-ZQDfN6L2.js",revision:null},{url:"assets/ArchitecturePage-BLaVm-RT.js",revision:null},{url:"assets/ApiReferencePage-CHgGzez9.js",revision:null},{url:"assets/AdminPage-D0DGfKeC.js",revision:null},{url:"assets/AccessTokensPage-HdCYJa75.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"manifest.webmanifest",revision:"c35fecd3fb20dd6d473c713737b26dd4"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"))),s.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new s.CacheFirst({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),s.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new s.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new s.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3})]}),"GET")});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{c as t,a as i,r as h,j as e,O as m,X as y,S as v,b,d as k,I as u}from"./index-HEIAHSOv.js";import{D as f}from"./download-DGs9YaDa.js";import{B as g}from"./bot-mqKcispY.js";import{M as j}from"./message-square-DzZ7IOii.js";import{G as w,W as M}from"./workflow-DcMPEeFk.js";import{S as N}from"./settings-flkGsXSm.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 z=t("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
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 l=t("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
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 _=t("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
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 S=t("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/**
|
|
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 H=t("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
|
|
27
|
-
* @license lucide-react v0.469.0 - ISC
|
|
28
|
-
*
|
|
29
|
-
* This source code is licensed under the ISC license.
|
|
30
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const L=t("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
|
|
32
|
-
* @license lucide-react v0.469.0 - ISC
|
|
33
|
-
*
|
|
34
|
-
* This source code is licensed under the ISC license.
|
|
35
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const C=t("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/**
|
|
37
|
-
* @license lucide-react v0.469.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const q=t("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]),A=[{category:"getting_started",items:[{to:"/docs/installation",label:"installation",icon:f},{to:"/docs/developer-setup",label:"developer_setup",icon:l},{to:"/docs/worker-setup",label:"worker_setup",icon:v},{to:"/docs/bot-setup",label:"bot_setup",icon:g}]},{category:"guides",items:[{to:"/docs/local-development",label:"local_dev",icon:S},{to:"/docs/worker-operations",label:"worker_ops",icon:z},{to:"/docs/deployment",label:"deployment",icon:C},{to:"/docs/bot-integration",label:"bot_integration",icon:j},{to:"/docs/pipeline-config",label:"pipeline",icon:w},{to:"/docs/dev-workflow",label:"dev_workflow",icon:M}]},{category:"reference",items:[{to:"/docs/cli",label:"cli",icon:b},{to:"/docs/api",label:"api",icon:l},{to:"/docs/skill",label:"skill",icon:q},{to:"/docs/permissions",label:"permissions",icon:k},{to:"/docs/env-variables",label:"env_vars",icon:N}]},{category:"other",items:[{to:"/docs/architecture",label:"architecture",icon:L},{to:"/docs/changelog",label:"changelog",icon:_}]}];function c({onNavClick:a}){const{t:s}=i();return e.jsx("nav",{className:"flex flex-col gap-4 py-4 px-3",children:A.map(({category:o,items:n})=>e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 px-2 text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--text-muted)"},children:s(`docs.docs_nav_${o}`)}),e.jsx("div",{className:"flex flex-col gap-0.5",children:n.map(({to:r,label:d,icon:p})=>e.jsxs(u,{to:r,onClick:a,className:({isActive:x})=>`flex items-center gap-2 rounded-[4px] px-2 py-1.5 text-xs lowercase transition-colors ${x?"bg-[var(--accent)]/10 text-[var(--accent)]":"text-[var(--text-secondary)] hover:bg-[var(--accent)]/5 hover:text-[var(--text-primary)]"}`,children:[e.jsx(p,{size:14,style:{flexShrink:0}}),e.jsx("span",{children:s(`docs.docs_${d}`)})]},r))})]},o))})}function W(){const{t:a}=i(),[s,o]=h.useState(!1);return e.jsxs("div",{className:"flex h-full",children:[e.jsx("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)] overflow-y-auto",style:{width:224,minWidth:224,backgroundColor:"var(--bg-card)"},children:e.jsx(c,{})}),e.jsxs("main",{className:"flex-1 overflow-auto p-6",children:[e.jsxs("button",{type:"button",onClick:()=>o(!0),className:"md:hidden mb-4 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-xs lowercase text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)] sticky top-0 z-10",children:[e.jsx(H,{size:14}),a("docs.docs_menu")]}),e.jsx(m,{})]}),s&&e.jsxs("div",{className:"md:hidden fixed inset-0 z-50 flex",children:[e.jsx("div",{className:"absolute inset-0 bg-black/50",onClick:()=>o(!1)}),e.jsxs("div",{className:"relative flex flex-col overflow-y-auto",style:{width:260,backgroundColor:"var(--bg-card)"},children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[e.jsx("span",{className:"text-sm font-semibold lowercase text-[var(--text-primary)]",children:a("docs.docs_menu")}),e.jsx("button",{type:"button",onClick:()=>o(!1),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(y,{size:16})})]}),e.jsx(c,{onNavClick:()=>o(!1)})]})]})]})}export{W as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as R,r as o,j as e,L as q,K as D,g as p,t as c}from"./index-HEIAHSOv.js";import{v as F}from"./password-CHk45-jw.js";import{I as s}from"./InfoRow-DHgmgwrO.js";import{u as T}from"./useFetch-BzAw29NB.js";function z(){var N,y,k,P;const{t:r}=R(),{data:a,loading:C,refetch:E}=T(()=>p.get("web/profile").json(),[]),[x,m]=o.useState(""),[d,b]=o.useState(""),[u,f]=o.useState(""),[v,g]=o.useState(!1),[h,l]=o.useState(""),[i,j]=o.useState(""),[w,_]=o.useState(!1);async function L(){if(l(""),!x){l(r("profile.current_password_required"));return}if(!d){l(r("profile.new_password_required"));return}const t=F(d);if(t){l(r(t));return}if(d!==u){l(r("profile.passwords_do_not_match"));return}try{g(!0),await p.put("web/profile/password",{json:{currentPassword:x,newPassword:d}}),c.success(r("profile.password_changed")),m(""),b(""),f("")}catch(n){const U=n instanceof Error?n.message:r("profile.failed_to_change_password");l(U)}finally{g(!1)}}async function S(){if(!i||i.length!==6){c.error(r("profile.totp_code_required"));return}try{_(!0),await p.post("web/profile/totp/regenerate",{json:{code:i}}),c.success(r("profile.two_fa_regenerated")),j(""),E()}catch(t){const n=t instanceof Error?t.message:r("profile.totp_code_invalid");c.error(n)}finally{_(!1)}}return C?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):e.jsxs("div",{className:"mx-auto max-w-xl space-y-8 px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("h1",{className:"text-lg text-[var(--text-primary)]",children:[r("profile.title")," ",e.jsx("span",{className:"text-[var(--text-muted)]",children:r("profile.personal_settings")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.profile_info")}),a?e.jsxs("div",{className:"space-y-2",children:[e.jsx(s,{variant:"fixed-label",label:r("profile.username"),value:a.name}),e.jsx(s,{variant:"fixed-label",label:r("common.role"),value:a.role}),e.jsx(s,{variant:"fixed-label",label:r("profile.git_name"),value:a.gitName||r("common.not_set")}),e.jsx(s,{variant:"fixed-label",label:r("profile.git_email"),value:a.gitEmail||r("common.not_set")}),e.jsx(s,{variant:"fixed-label",label:r("profile.status"),value:a.status}),e.jsx(s,{variant:"fixed-label",label:r("profile.created_at"),value:new Date(a.createdAt).toLocaleDateString()})]}):e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:r("profile.unable_to_load_profile")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.platform_accounts")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(s,{variant:"fixed-label",label:"lark",value:(N=a==null?void 0:a.platformUids)!=null&&N.lark?`${a.platformUids.lark.slice(0,12)}... ✓`:r("profile.not_linked")}),e.jsx(s,{variant:"fixed-label",label:"slack",value:(y=a==null?void 0:a.platformUids)!=null&&y.slack?`${a.platformUids.slack.slice(0,12)}... ✓`:r("profile.not_linked")})]}),(!((k=a==null?void 0:a.platformUids)!=null&&k.lark)||!((P=a==null?void 0:a.platformUids)!=null&&P.slack))&&e.jsx("p",{className:"mt-3 text-xs text-[var(--text-muted)]",children:r("profile.bind_hint")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.change_password")}),e.jsxs("div",{className:"space-y-4",children:[h&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--destructive)]",children:h}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_password")}),e.jsx("input",{type:"password",value:x,onChange:t=>m(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.new_password")}),e.jsx("input",{type:"password",value:d,onChange:t=>b(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:r("profile.password_hint_10_20")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.confirm_password")}),e.jsx("input",{type:"password",value:u,onChange:t=>f(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:L,disabled:v,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black disabled:opacity-50",children:r(v?"common.updating":"profile.update_password")})})]})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.two_factor_auth")}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm",children:a!=null&&a.totpEnabled?e.jsxs("span",{className:"text-[var(--accent)]",children:["● ",r("profile.two_fa_enabled")]}):e.jsxs("span",{className:"text-[var(--text-muted)]",children:["● ",r("profile.two_fa_not_setup")]})}),(a==null?void 0:a.totpEnabled)&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.regenerate_2fa_warning")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_totp_code")}),e.jsx("input",{type:"text",inputMode:"numeric",maxLength:6,placeholder:r("profile.totp_code_placeholder"),value:i,onChange:t=>{const n=t.target.value.replace(/\D/g,"").slice(0,6);j(n)},className:"w-full max-w-xs rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)] font-mono tracking-widest"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:S,disabled:w||i.length!==6,className:"rounded-[4px] border border-[var(--warning)] bg-transparent px-4 py-2 text-xs font-medium text-[var(--warning)] hover:bg-[var(--warning)] hover:text-black disabled:opacity-50 transition-colors",children:r(w?"profile.regenerating":"profile.regenerate_2fa")})})]})]})]}),e.jsxs(q,{to:"/access-tokens",className:"flex items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--accent)]",children:[e.jsx(D,{size:16,className:"text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[var(--text-primary)]",children:r("profile.access_tokens")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.access_tokens_desc")})]})]})]})}export{z as default};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{c as ee,a as X,r,g as j,j as e,q as D,s as $e,v as Ue,e as qe,m as ze,i as we,L as Be,X as le,l as K,w as _e,t as Ce,o as Ge}from"./index-HEIAHSOv.js";import{u as Ke,T as Xe}from"./task-constants-CUlfGa6V.js";import{C as We,H as Se,P as Ee}from"./PtyTerminal-D6dJsjvW.js";import{a as Ve,f as Z}from"./date-BdNtiQTP.js";import{M as He}from"./message-square-DzZ7IOii.js";import{S as Je}from"./Select-CVzFPLV0.js";import{a as Qe}from"./status-colors-LJQDTyXq.js";import{A as Ye}from"./arrow-left-Bn5LCLJl.js";import{R as ce}from"./rotate-ccw-FCuCJvAr.js";import{E as Ze}from"./external-link-CXaFoLtw.js";import{L as ie}from"./loader-circle-BIGOFbGI.js";/**
|
|
2
|
-
* @license lucide-react v0.469.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Te=ee("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 et=ee("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"}]]);/**
|
|
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 tt=ee("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"}]]);/**
|
|
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 st=ee("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 De({isOpen:i,onClose:x,taskId:a,stageName:n,timeoutSeconds:s,onSubmitted:o}){const{t:l}=X(),[g,_]=r.useState(s),[E,u]=r.useState(!1);r.useEffect(()=>{if(!i)return;_(s);const h=setInterval(()=>{_(N=>N<=1?(clearInterval(h),0):N-1)},1e3);return()=>clearInterval(h)},[i,s]),r.useEffect(()=>{g===0&&i&&x()},[g,i,x]);const C=r.useCallback(async h=>{u(!0);try{await j.post(`web/tasks/${a}/confirm-stage`,{json:{stageName:n,approved:h}}),o==null||o(),x()}catch{}finally{u(!1)}},[a,n,x,o]);return i?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(He,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// stage: ",n]})]}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--text-muted)]",children:[e.jsx(We,{className:"h-3.5 w-3.5"}),Ve(g)]})]}),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:l("tasks.confirm_stage_message",{name:n})})}),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:E,onClick:()=>C(!1),children:l("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:E,onClick:()=>C(!0),children:l(E?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})]}):null}function at(i,x){const a=new Date(i).getTime()-Date.now();if(a<=0)return x("tasks.tunnel_expired");const n=Math.floor(a/36e5),s=Math.floor(a%36e5/6e4);return n>0?x("tasks.tunnel_expires_hm",{h:n,m:s}):x("tasks.tunnel_expires_m",{m:s})}function Ie(i){switch(i){case"CONNECTED":return"var(--accent)";case"STARTING":return"var(--warning)";case"EXPIRED":return"var(--text-muted)";default:return"var(--text-muted)"}}function Le(i,x){switch(i){case"IDLE":case"CLOSED":return x("tasks.tunnel_idle");case"STARTING":return x("tasks.tunnel_starting");case"CONNECTED":return x("tasks.tunnel_connected");case"EXPIRED":return x("tasks.tunnel_expired");case"CLOSING":return x("tasks.tunnel_closing");default:return String(i).toLowerCase()}}function rt({taskId:i,taskFinished:x,compact:a}){const{t:n}=X(),[s,o]=r.useState(D.IDLE),[l,g]=r.useState(null),[_,E]=r.useState(null),[u,C]=r.useState(""),[h,N]=r.useState(!1),[te,I]=r.useState(!1),L=r.useRef(null),$=r.useCallback(async()=>{try{const y=await j.get(`web/workspace-tunnel/${i}/status`).json();o(y.status),g(y.tunnelUrl??null),E(y.expiresAt??null),(y.status==="EXPIRED"||y.status==="IDLE"||y.status==="CLOSED")&&S()}catch{}},[i]);function se(){S(),L.current=setInterval($,5e3)}function S(){L.current&&(clearInterval(L.current),L.current=null)}r.useEffect(()=>{x&&(s===D.STARTING||s===D.CONNECTED)&&(o(D.IDLE),g(null),S())},[x,s]),r.useEffect(()=>{if(s!=="CONNECTED"||!_)return;const y=()=>{const V=at(_,n);C(V),V===n("tasks.tunnel_expired")&&(o(D.EXPIRED),g(null),S())};y();const A=setInterval(y,3e4);return()=>clearInterval(A)},[s,_]),r.useEffect(()=>()=>S(),[]),r.useEffect(()=>{x||$()},[$,x]);async function f(){N(!0);try{await j.post(`web/workspace-tunnel/${i}/start`),o(D.STARTING),se()}catch{}finally{N(!1)}}async function R(){N(!0);try{await j.post(`web/workspace-tunnel/${i}/stop`),o(D.IDLE),g(null),S()}catch{}finally{N(!1)}}async function W(){l&&(await navigator.clipboard.writeText(l),I(!0),setTimeout(()=>I(!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:"cursor_tunnel:"}),e.jsx("span",{style:{color:Ie(s)},children:Le(s,n)}),(s==="IDLE"||s==="CLOSED"||s==="EXPIRED")&&e.jsx("button",{onClick:f,disabled:h,className:"rounded-[4px] px-2 py-1 text-[var(--info)] disabled:opacity-50",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:n(h?"tasks.tunnel_starting":"tasks.tunnel_start")}),s==="CONNECTED"&&l&&e.jsx("a",{href:l.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:n("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:n("tasks.tunnel_header")}),e.jsxs("span",{className:"text-xs",style:{color:Ie(s)},children:["● ",Le(s,n)]})]}),s==="CONNECTED"&&_&&e.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["// ",u]}),s==="CONNECTED"&&l&&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:l}),e.jsxs("button",{onClick:W,className:"shrink-0 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":n("tasks.tunnel_copy_url"),children:["[",n("common.copy"),"]"]})]}),te&&e.jsx("p",{className:"mb-2 text-xs text-[var(--accent)]",children:n("tasks.tunnel_copied")}),s==="STARTING"&&e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:n("tasks.tunnel_waiting")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(s==="IDLE"||s==="CLOSED")&&e.jsx("button",{onClick:f,disabled:h,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:n(h?"tasks.tunnel_starting_button":"tasks.tunnel_start_button")}),s==="STARTING"&&e.jsx("button",{onClick:R,disabled:h,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:n(h?"tasks.tunnel_stopping":"tasks.tunnel_cancel")}),s==="CONNECTED"&&l&&e.jsxs(e.Fragment,{children:[e.jsx("a",{href:l.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:n("tasks.tunnel_open_cursor")}),e.jsx("a",{href:l.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:n("tasks.tunnel_open_vscode")}),e.jsx("button",{onClick:R,disabled:h,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:n(h?"tasks.tunnel_stopping":"tasks.tunnel_stop")})]}),s==="EXPIRED"&&e.jsx("button",{onClick:f,disabled:h,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:n(h?"tasks.tunnel_starting_button":"tasks.tunnel_restart")})]})]})}function nt({isOpen:i,onClose:x,onConfirm:a,taskId:n,isLoading:s}){const{t:o}=X();return e.jsx($e,{isOpen:i,onClose:x,onConfirm:a,title:o("tasks.cancel_task_title"),message:o("tasks.cancel_task_message",{id:String(n)}),confirmLabel:o("tasks.cancel_task_confirm_label"),confirmVariant:"danger",isLoading:s})}function lt({isOpen:i,onClose:x,onConfirm:a,taskId:n,mrUrl:s,isLoading:o}){const{t:l}=X(),g=s?l("tasks.retry_message_with_mr",{id:String(n),url:s}):l("tasks.retry_message_without_mr",{id:String(n)});return e.jsx($e,{isOpen:i,onClose:x,onConfirm:a,title:l("tasks.retry_title"),message:g,confirmLabel:l("tasks.retry_confirm_label"),confirmVariant:"accent",isLoading:o})}function ct(i){switch(i){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 xe({status:i}){const x=Qe(i);return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-0.5 text-xs",style:{color:x},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-[3px]",style:{backgroundColor:x}}),i.toLowerCase()]})}function it(i){let a=["init","agent","completed"];if(i.configSnapshot)try{const s=JSON.parse(i.configSnapshot);if(s&&typeof s=="object"&&typeof s.pipeline=="string"){const o=JSON.parse(s.pipeline);o&&typeof o=="object"&&Array.isArray(o.stages)&&o.stages.length>0&&o.stages.every(l=>l&&typeof l=="object"&&typeof l.name=="string")&&(a=o.stages.map(l=>l.name))}}catch{}const n=i.currentStage?a.indexOf(i.currentStage):-1;return a.map((s,o)=>{let l="pending";return i.status===K.COMPLETED?l="completed":i.status===K.FAILED&&o<=n?l=o===n?"failed":"completed":n>=0&&(o<n?l="completed":o===n&&(l="running")),{name:s,status:l}})}function jt(){var ye,ke;const{id:i}=Ue(),x=qe(),{t:a}=X(),n=Ke(t=>t.cancelTask),[s,o]=r.useState(null),[l,g]=r.useState([]),[_,E]=r.useState(!0),[u,C]=r.useState(null),[h,N]=r.useState(!1),[te,I]=r.useState(!1),[L,$]=r.useState(!1),[se,S]=r.useState(!1),[f,R]=r.useState("terminal"),[W,y]=r.useState([]),[A,V]=r.useState(0),[q,z]=r.useState(0),[B,oe]=r.useState(""),[H,Re]=r.useState(""),[Ae,de]=r.useState(!1),[Pe,me]=r.useState(!1),[P,pe]=r.useState(null),[k,ue]=r.useState("disconnected"),[G,he]=r.useState("auto"),F=r.useRef(null),fe=r.useRef(null),m=Number(i),v=s?Xe.includes(s.status):!1;ze(s?`#${s.id} ${s.description}`:null);const w=r.useCallback(async()=>{try{const t=await j.get(`web/tasks/${m}`).json();o(t)}catch{}},[m]),J=r.useCallback(async()=>{try{const t=await j.get(`web/tasks/${m}/logs`).json();g(t.lines)}catch{}},[m]),O=r.useCallback(async()=>{try{const t=await j.get(`web/tasks/${m}/pending-confirm`).json();C(t.confirm)}catch{C(null)}},[m]),ve=r.useCallback(async()=>{de(!0);try{const t=new URLSearchParams;t.set("limit","50"),t.set("offset",String(q*50)),B&&t.set("type",B),H&&t.set("search",H);const c=await j.get(`web/tasks/${m}/events?${t}`).json();y(c.events),V(c.total)}catch{}finally{de(!1)}},[m,q,B,H]);r.useEffect(()=>{f==="logs"&&ve()},[f,ve]),r.useEffect(()=>{f==="pipeline"&&!v&&j.get(`web/workspaces/${m}`).json().then(pe).catch(()=>pe(null))},[f,m,v]);const M=we(t=>t.lastEvent),be=we(t=>t.eventSeq);r.useEffect(()=>{E(!0),Promise.all([w(),J(),O()]).finally(()=>E(!1))},[w,J,O]),r.useEffect(()=>{!M||be===0||(M.event==="task_status_changed"&&M.taskId===m||M.event==="task_created"&&M.taskId===m)&&(w(),O())},[be,M,m,w,O]),r.useEffect(()=>{if(v)return;const c=setInterval(()=>{document.visibilityState!=="hidden"&&Promise.all([w(),J(),O()])},15e3);return()=>clearInterval(c)},[v,w,J,O]);const ge=r.useCallback(()=>C(null),[]),Q=r.useCallback(()=>{C(null),w()},[w]);async function Fe(){$(!0);try{await n(m),N(!1),await w()}finally{$(!1)}}async function Oe(){S(!0);try{await j.post(`web/tasks/${m}/retry`),I(!1),await w()}finally{S(!1)}}const b=r.useMemo(()=>s?it(s):[],[s==null?void 0:s.configSnapshot,s==null?void 0:s.currentStage,s==null?void 0:s.status]),ae=b.findIndex(t=>t.status==="running");if(_)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(!s)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:()=>x("/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 je=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:()=>x("/tasks"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(Ye,{className:"h-4 w-4"})}),e.jsxs("span",{className:"line-clamp-2 text-sm font-medium text-[var(--text-primary)]",children:["#",s.id," ",s.description]})]}),re=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(xe,{status:s.status}),e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs(Be,{to:`/projects/${s.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:s.projectKey})]}),s.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: ",e.jsx("span",{className:"text-[var(--text-primary)]",children:s.branch})]})]}),s.mrUrl&&/^https?:\/\//.test(s.mrUrl)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("a",{href:s.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline",children:["MR: ",((ye=s.mrUrl.match(/!?\d+$/))==null?void 0:ye[0])??"view"]})]})]}),Ne=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:[!v&&e.jsxs("button",{onClick:()=>N(!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(le,{className:"h-3 w-3"}),a("tasks.cancel_task")]}),s.status===K.FAILED&&e.jsxs("button",{onClick:()=>I(!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(ce,{className:"h-3 w-3"}),a("tasks.retry_task")]}),s.workerId&&!v&&e.jsxs("button",{onClick:()=>{R("pipeline"),setTimeout(()=>{var t,c;(c=(t=fe.current)==null?void 0:t.scrollIntoView)==null||c.call(t,{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(Ze,{className:"h-3 w-3"}),a("tasks.cursor_tunnel")]})]}),Me=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")}),b.map(t=>{const c=t.status==="completed",d=t.status==="running",p=t.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 py-1.5 ${d?"bg-[#1a1a1a]":""}`,children:[c&&e.jsx(_e,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),d&&e.jsx(ie,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),p&&e.jsx(le,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),t.status==="pending"&&e.jsx(Te,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs",style:{color:c?"var(--accent)":d?"#e5e5e5":p?"var(--destructive)":"#525252",fontWeight:d?500:400},children:d?`> ${t.name}`:t.name})]},t.name)})]}),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")}),l.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:l.slice(0,8).map((t,c)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:t},c))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]}),ne=e.jsxs(e.Fragment,{children:[e.jsx(nt,{isOpen:h,onClose:()=>N(!1),onConfirm:Fe,taskId:m,isLoading:L}),e.jsx(lt,{isOpen:te,onClose:()=>I(!1),onConfirm:Oe,taskId:m,mrUrl:s.mrUrl??void 0,isLoading:se})]});return Pe&&f==="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:[re,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.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.pty_terminal")}),e.jsxs("span",{className:`inline-flex items-center gap-1 text-[11px] ${k==="connected"?"text-[var(--accent)]":k==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${k==="connected"?"bg-[var(--accent)]":k==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),a(`tasks.${k}`)]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!v&&G==="auto"&&e.jsxs("button",{onClick:()=>{var t;return(t=F.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(Se,{className:"h-3 w-3"}),a("tasks.take_over")]}),!v&&G==="manual"&&e.jsxs("button",{onClick:()=>{var t;return(t=F.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(ce,{className:"h-3 w-3"}),a("tasks.restore_auto")]}),s.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--accent)]",children:[a("tasks.stage"),": ",s.currentStage]}),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(tt,{className:"h-3 w-3"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1",children:e.jsx(Ee,{ref:F,taskId:m,sessionId:s.currentSessionId??void 0,taskFinished:v,onStatusChange:ue,onTakeoverChange:he})}),Ne,ne]}):s.status===K.SUSPENDED?e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[je,re,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:["#",s.id]}),e.jsx("span",{className:"text-base text-[var(--text-secondary)]",children:s.description}),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:a("tasks.status_suspended")})]}),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:a("tasks.status_suspended")})}),u&&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.prompt??a("tasks.pipeline_requires_confirmation")}),e.jsx("div",{className:"mb-3 flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"stage"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:u.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/${m}/confirm-stage`,{json:{stageName:u.stageName,approved:!0}}),Q()}catch{Ce.error(a("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] bg-[var(--accent)] px-4 py-2.5 md:py-2 text-[11px] font-bold text-[#0c0c0c]",children:a("tasks.confirm_and_proceed")}),e.jsx("button",{onClick:async()=>{try{await j.post(`web/tasks/${m}/confirm-stage`,{json:{stageName:u.stageName,approved:!1}}),Q()}catch{Ce.error(a("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] bg-[#1a1a1a] px-4 py-2.5 md:py-2 text-[11px] text-[var(--destructive)]",style:{border:"1px solid rgba(239,68,68,0.27)"},children:a("tasks.reject")})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"status"}),e.jsx("span",{className:"font-bold text-[var(--warning)]",children:"suspended"})]}),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:s.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:s.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:Z(s.createdAt)})]})]})]}),e.jsx("div",{className:"hidden md:flex flex-wrap items-center gap-2 py-2",children:b.map((t,c)=>{const d=t.status==="failed",p=t.status==="completed",T=t.status==="running"&&s.status===K.SUSPENDED,U=d?"var(--destructive)":p?"var(--accent)":T?"var(--warning)":"#525252",Y=d?"rgba(239,68,68,0.12)":p?"rgba(34,197,94,0.12)":T?"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:U,backgroundColor:Y,fontWeight:T?700:400,border:T?`1px solid ${U}`:void 0},children:T?"confirm":`${t.name}${p?" ✓":d?" ✗":""}`}),c<b.length-1&&e.jsx("div",{className:"h-px w-6 bg-[var(--border)]"})]},t.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:[l.slice(-10).map((t,c)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-secondary)]",children:t},c)),l.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:"suspended"})]}),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:s.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:s.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:b.map(t=>{const c=t.status==="completed"?"var(--accent)":t.status==="failed"?"var(--destructive)":t.status==="running"?"var(--warning)":"#525252",d=t.status==="failed"?"var(--destructive)":t.status==="running"?"var(--warning)":"#a3a3a3",p=t.status==="completed"?"completed":t.status==="running"?"suspended":t.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:d,fontWeight:t.status==="running"?700:400},children:[t.name," ",p]})]},t.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:Z(s.createdAt)})]})})]})]}),u&&e.jsx(De,{isOpen:!!u,onClose:ge,taskId:m,stageName:u.stageName,timeoutSeconds:Math.ceil(u.timeout/1e3),onSubmitted:Q}),ne]}):e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[je,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(xe,{status:s.status}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:s.projectKey}),s.workerName&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:s.workerName}),s.branch&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)] truncate max-w-[120px]",children:s.branch})]}),re,s.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: ",s.errorMessage]}),u&&e.jsx(De,{isOpen:!!u,onClose:ge,taskId:m,stageName:u.stageName,timeoutSeconds:Math.ceil(u.timeout/1e3),onSubmitted:Q}),e.jsxs("div",{className:"flex min-h-0 flex-1",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("div",{className:"flex items-center border-b border-[var(--border)] shrink-0 overflow-x-auto no-scrollbar",children:["terminal","pipeline","logs"].map(t=>e.jsx("button",{onClick:()=>R(t),className:`shrink-0 whitespace-nowrap px-4 py-2.5 text-xs transition-colors ${f===t?"border-b-2 border-[var(--accent)] text-[var(--accent)] font-medium":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(t==="terminal"?"tasks.terminal":t==="pipeline"?"tasks.pipeline_tab":"tasks.logs")},t))}),f==="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.jsxs("div",{className:"flex items-center gap-2 md:gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:a("tasks.pty_terminal")}),e.jsxs("span",{className:`inline-flex items-center gap-1 text-[11px] ${k==="connected"?"text-[var(--accent)]":k==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${k==="connected"?"bg-[var(--accent)]":k==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),a(`tasks.${k}`)]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!v&&G==="auto"&&e.jsxs("button",{onClick:()=>{var t;return(t=F.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(Se,{className:"h-3 w-3"}),a("tasks.take_over")]}),!v&&G==="manual"&&e.jsxs("button",{onClick:()=>{var t;return(t=F.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(ce,{className:"h-3 w-3"}),a("tasks.restore_auto")]}),!v&&G==="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(ie,{className:"h-3 w-3 animate-spin"}),a("tasks.requesting_takeover")]}),!v&&s.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(st,{className:"h-3 w-3"}),a("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(et,{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(xe,{status:s.status}),s.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["on ",s.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:a("tasks.stage_progress")}),e.jsx("div",{className:"mt-2 flex items-center gap-1 overflow-x-auto no-scrollbar pr-4",children:b.map((t,c)=>{const d=t.status==="completed",p=t.status==="running",U=t.status==="failed"?"var(--destructive)":d||p?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"shrink-0 text-[11px] whitespace-nowrap",style:{color:U,fontWeight:p?600:400},children:[t.name,d?" ✓":p?" ...":""]}),c<b.length-1&&e.jsx("div",{className:"mx-1.5 h-px w-4 shrink-0",style:{backgroundColor:U}})]},t.name)})})]}),e.jsx("div",{className:"px-4 pt-3 pb-1 shrink-0 md:hidden",children:e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.pty_output")})}),e.jsx("div",{className:"min-h-0 flex-1 md:min-h-0",children:e.jsx(Ee,{ref:F,taskId:m,sessionId:s.currentSessionId??void 0,taskFinished:v,onStatusChange:ue,onTakeoverChange:he})}),Ne]}),f==="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:"flex items-center py-4 mb-4 md:mb-5 overflow-x-auto no-scrollbar",children:b.map((t,c)=>{const d=t.status==="completed",p=t.status==="running",Y=t.status==="failed"?"var(--destructive)":d||p?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",style:{flex:c<b.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:Y},children:[d&&e.jsx("span",{className:"text-[11px] md:text-xs font-semibold text-[#0c0c0c]",children:"✓"}),p&&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] font-medium whitespace-nowrap",style:{color:Y},children:t.name})]}),c<b.length-1&&e.jsx("div",{className:"mx-1 md:mx-2 h-0.5 flex-1 min-w-3 rounded-full",style:{backgroundColor:c<(ae>=0?ae:0)?"var(--accent)":"#525252"}})]},t.name)})}),s.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: ",s.currentStage," (",ae+1,"/",b.length,")"]}),s.startedAt&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",Z(s.startedAt).replace(" ago","")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// retries: ",s.retryCount,"/2"]})]}),e.jsx("button",{onClick:()=>R("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:s.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:s.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:s.branch??"-"})]})]})]}),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")}),b.map(t=>{const c=t.status==="completed",d=t.status==="running",p=t.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 py-1.5 ${d?"bg-[var(--bg-input)]":""}`,children:[c&&e.jsx(_e,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),d&&e.jsx(ie,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),p&&e.jsx(le,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),t.status==="pending"&&e.jsx(Te,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs",style:{color:c?"var(--accent)":d?"var(--text-primary)":p?"var(--destructive)":"#525252",fontWeight:d?500:400},children:d?`> ${t.name}`:t.name})]},t.name)})]}),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")}),l.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:l.slice(-12).map((t,c)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:t},c))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]})]}),f==="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(t=>e.jsx("button",{onClick:()=>{oe(t),z(0)},className:`shrink-0 rounded-[4px] px-2.5 py-1 text-[11px] ${B===t?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)]"}`,children:t||"all"},t))}),e.jsx("div",{className:"hidden md:block",children:e.jsx(Je,{value:B,onChange:t=>{oe(t),z(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(Ge,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("tasks.search_logs"),value:H,onChange:t=>{Re(t.target.value),z(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:[W.map((t,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(t.timestamp).toLocaleTimeString("en-US",{hour12:!1})}),e.jsx("span",{className:`shrink-0 font-medium ${ct(t.type)}`,children:t.type}),e.jsx("span",{className:"min-w-0 break-words md:truncate text-[var(--text-primary)]",children:t.message})]},t.id)),W.length===0&&!Ae&&e.jsx("p",{className:"py-8 text-center text-xs text-[var(--text-muted)]",children:a("tasks.no_log_entries")})]}),A>50&&e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[Array.from({length:Math.ceil(A/50)}).slice(0,5).map((t,c)=>e.jsx("button",{onClick:()=>z(c),className:`rounded-[4px] px-2 py-1 text-xs ${q===c?"bg-[var(--accent)] text-black font-medium":"text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:c+1},c)),Math.ceil(A/50)>5&&e.jsx("button",{onClick:()=>z(q+1),disabled:q>=Math.ceil(A/50)-1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] disabled:opacity-30",children:">"})]})]})]}),f==="terminal"&&Me,f==="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:s.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:s.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:s.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created_at"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:Z(s.createdAt)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"agent_type"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:s.agentType??"claude"})]})]})]}),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 justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"branch"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:s.branch??(P==null?void 0:P.branch)??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worktree"}),e.jsx("span",{className:"ml-4 truncate text-[var(--text-primary)]",children:(P==null?void 0:P.path)??"-"})]}),s.mrUrl&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"mr_link"}),e.jsx("a",{href:s.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-[var(--info)] hover:underline",children:((ke=s.mrUrl.match(/!?\d+$/))==null?void 0:ke[0])??"view"})]})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{ref:fe,className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.cursor_tunnel_section")}),s.workerId?e.jsx(rt,{taskId:m,taskFinished:v,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:b.map(t=>{const c=t.status==="completed"?"✓":t.status==="running"?"→":"·",d=t.status==="completed"||t.status==="running"?"var(--accent)":t.status==="failed"?"var(--destructive)":"#525252",p=t.status==="completed"?"done":t.status==="running"?"running...":t.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-semibold",style:{color:d},children:c}),e.jsx("span",{className:t.status==="running"?"font-medium":"",style:{color:d},children:t.name}),e.jsxs("span",{className:"text-[11px]",style:{color:"#525252"},children:["— ",p]})]},t.name)})})]})]})]}),ne]})}export{jt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as u,j as e,s as O,v as W,e as G,r as m,u as H,n as P,W as c,D,L as R,x as S,g as h}from"./index-HEIAHSOv.js";import{t as V,b as $}from"./date-BdNtiQTP.js";import{w as z,b as B,t as q}from"./status-colors-LJQDTyXq.js";import{I as i}from"./InfoRow-DHgmgwrO.js";import{M as N}from"./MetricBar-524799T_.js";import{u as J}from"./useFetch-BzAw29NB.js";import{T as I}from"./trash-2-Bu9foptJ.js";import{A as K}from"./arrow-left-Bn5LCLJl.js";function Q({isOpen:t,onClose:a,onConfirm:r,workerName:o,isDraining:l,loading:j}){const{t:d}=u();return e.jsx(O,{isOpen:t,onClose:a,onConfirm:r,title:d(l?"workers.undrain_worker_title":"workers.drain_worker_title"),message:l?d("workers.undrain_confirm",{name:o}):d("workers.drain_confirm",{name:o}),confirmLabel:d(l?"workers.undrain":"workers.drain"),confirmVariant:l?"accent":"warning",isLoading:j})}function ne(){const{id:t}=W(),a=G(),{t:r}=u(),[o,l]=m.useState(!1),[j,d]=m.useState(!1),[A,p]=m.useState(!1),[E,y]=m.useState(!1),w=H(n=>{var v;return(v=n.user)==null?void 0:v.role}),{data:x,loading:F,error:_,refetch:C}=J(async()=>{if(!t)throw new Error("Missing worker ID");const[n,v]=await Promise.all([h.get(`web/workers/${t}`).json(),h.get(`web/workers/${t}/tasks`).json().catch(()=>[])]);return{worker:n,tasks:v}},[t]),s=(x==null?void 0:x.worker)??null,g=(x==null?void 0:x.tasks)??[];P(m.useMemo(()=>!s||s.status===c.DECOMMISSIONED?null:e.jsxs("div",{className:"flex items-center gap-2",children:[s.status===c.ONLINE&&e.jsxs("button",{onClick:()=>l(!0),className:"rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",r("workers.drain")]}),w===D.ADMIN&&e.jsxs("button",{onClick:()=>p(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(I,{className:"h-3 w-3"}),r("workers.decommission")]})]}),[s,w,r]));async function T(){if(s){d(!0);try{const n=s.status===c.DRAINING?"undrain":"drain";await h.post(`web/workers/${s.id}/${n}`),await C()}catch{}finally{d(!1),l(!1)}}}async function U(){if(s){y(!0);try{await h.delete(`admin/workers/${s.id}`),a("/workers")}catch{}finally{y(!1),p(!1)}}}if(F)return e.jsx("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("workers.loading_worker")})});if(_)return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--destructive)]",children:_}),e.jsx("button",{onClick:()=>C(),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:r("common.retry")})]});if(!s)return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:r("workers.worker_not_found")}),e.jsxs("button",{onClick:()=>a("/workers"),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:["< ",r("workers.back_to_workers")]})]});const b=s.status===c.DRAINING,k=s.status!==c.DECOMMISSIONED;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("button",{onClick:()=>a("/workers"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(K,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),!b&&s.status!==c.OFFLINE&&k&&e.jsxs("button",{onClick:()=>l(!0),className:"shrink-0 rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",r("workers.drain")]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[b?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(R,{to:"/workers",className:"text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:r("workers.title")}),e.jsx("span",{className:"text-[var(--text-muted)]",children:"/"}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[k&&e.jsxs("button",{onClick:()=>l(!0),className:"rounded-[4px] border border-[var(--accent)] px-4 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:["> ",r("workers.undrain")]}),w===D.ADMIN&&k&&e.jsxs("button",{onClick:()=>p(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(I,{className:"h-3 w-3"}),r("workers.decommission")]})]})]}),e.jsx("div",{className:"mb-4",children:e.jsx("span",{className:"rounded-[4px] bg-[var(--warning)]/20 px-2.5 py-1 text-xs font-medium text-[var(--warning)]",children:r("workers.draining")})}),e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)]/40 bg-[var(--warning)]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(S,{className:"h-3.5 w-3.5 text-[var(--warning)]"}),e.jsx("span",{className:"text-xs text-[var(--warning)]",children:r("workers.draining_warning")})]}),e.jsx("p",{className:"text-xs text-[var(--warning)]/70 ml-5.5",children:r("workers.draining_active_tasks")})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-4",children:[e.jsx(f,{label:r("workers.cpu"),value:s.cpuUsage,unit:"%"}),e.jsx(f,{label:r("workers.memory"),value:s.memoryUsage,unit:"%"}),e.jsx(f,{label:r("workers.disk"),value:s.diskUsage,unit:"%"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("workers.slots")}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[s.activeSlots,"/",s.maxSlots]})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>a("/workers"),className:"mb-4 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:["< ",r("workers.back_to_workers")]}),e.jsxs("h1",{className:"mb-2 text-lg font-bold text-[var(--text-primary)] flex items-center gap-2",children:[s.name,e.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-normal",style:{color:z[s.status]},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),s.status.toLowerCase()]})]}),e.jsx("p",{className:"mb-6 text-xs text-[var(--text-muted)]",children:r("workers.last_heartbeat",{time:V(s.lastHeartbeat,"never")})}),s.status===c.DECOMMISSIONED&&e.jsx("div",{className:"mb-6 rounded-[4px] border border-[var(--text-muted)]/40 bg-[var(--text-muted)]/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["this worker has been decommissioned",s.decommissionedAt?` on ${$(s.decommissionedAt)}`:""," and can no longer accept tasks."]})]})}),e.jsxs("div",{className:"mb-6 grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.resource_usage")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(N,{label:r("workers.cpu"),value:s.cpuUsage}),e.jsx(N,{label:r("workers.mem"),value:s.memoryUsage}),e.jsx(N,{label:r("workers.disk"),value:s.diskUsage})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.connection_info")}),e.jsx(M,{worker:s})]})]})]}),b?e.jsxs(e.Fragment,{children:[e.jsx(L,{title:r("workers.active_tasks"),tasks:g,navigate:a}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:r("workers.capabilities")}),s.capabilities.length>0?e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:s.capabilities.map(n=>e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx("p",{className:"text-xs text-[var(--text-primary)]",children:n})},n))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("workers.no_capabilities_short")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:r("workers.worker_info")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:e.jsx(M,{worker:s,showExtended:!0})})]})]}):e.jsxs(e.Fragment,{children:[s.capabilities.length>0&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.capabilities")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.capabilities.map(n=>e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)]",children:n},n))})]}),e.jsx(L,{title:`${r("workers.current_tasks")} (${g.length})`,tasks:g,navigate:a})]})]})]}),e.jsx(Q,{isOpen:o,onClose:()=>l(!1),onConfirm:T,workerName:s.name,isDraining:b,loading:j}),e.jsx(O,{isOpen:A,onClose:()=>p(!1),onConfirm:U,title:r("workers.decommission_title"),message:r("workers.decommission_confirm",{name:s.name}),confirmLabel:r("workers.decommission"),confirmVariant:"danger",isLoading:E})]})}function M({worker:t,showExtended:a=!1}){const{t:r}=u();return e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(i,{label:r("workers.worker_id"),value:t.id}),e.jsx(i,{label:r("workers.host"),value:t.host}),e.jsx(i,{label:r("workers.port"),value:String(t.port)}),e.jsx(i,{label:r("workers.os"),value:t.os??r("workers.unknown")}),e.jsx(i,{label:r("workers.cpu_model"),value:t.cpuModel??r("workers.n_a")}),e.jsx(i,{label:r("workers.cpu_cores"),value:t.cpuCores!=null?String(t.cpuCores):r("workers.n_a")}),e.jsx(i,{label:r("workers.memory"),value:t.memoryGb!=null?`${t.memoryGb} gb`:r("workers.n_a")}),e.jsx(i,{label:r("workers.last_heartbeat_label"),value:$(t.lastHeartbeat)}),e.jsx(i,{label:r("workers.slots"),value:`${t.activeSlots}/${t.maxSlots}`}),a&&e.jsxs(e.Fragment,{children:[e.jsx(i,{label:r("workers.status_label"),value:t.status.toLowerCase()}),e.jsx(i,{label:r("workers.worker_version"),value:t.workerVersion??r("workers.n_a")})]})]})}function L({title:t,tasks:a,navigate:r}){const{t:o}=u();return e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:t}),a.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:o("workers.no_active_tasks")})]}):e.jsx(X,{tasks:a,navigate:r})]})}function X({tasks:t,navigate:a}){const{t:r}=u();return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.id")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.description")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.status_label")}),e.jsx("th",{className:"py-2 text-left font-normal text-[var(--text-muted)]",children:r("workers.stage")})]})}),e.jsx("tbody",{children:t.map(o=>e.jsxs("tr",{onClick:()=>a(`/tasks/${o.id}`),className:"cursor-pointer border-b border-[var(--border-row)] hover:bg-[var(--bg-input)] transition-colors",children:[e.jsxs("td",{className:"py-2 pr-4 text-[var(--text-primary)]",children:["#",o.id]}),e.jsx("td",{className:"max-w-xs truncate py-2 pr-4 text-[var(--text-secondary)]",children:o.description}),e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("span",{style:{color:q[o.status]},children:["● ",o.status.toLowerCase()]})}),e.jsx("td",{className:"py-2 text-[var(--text-secondary)]",children:o.currentStage??"-"})]},o.id))})]})})}function f({label:t,value:a,unit:r}){const o=Math.round(a*100);return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[o,r]}),e.jsx("div",{className:"mt-3 h-1.5 w-full rounded-[2px] bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-[2px] transition-all",style:{width:`${o}%`,backgroundColor:B(a)}})})]})}export{ne as default};
|