@overlordai/server 1.0.124 → 1.0.126
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/adapter.interface.d.ts +2 -2
- package/dist/adapters/adapter.interface.d.ts.map +1 -1
- package/dist/adapters/help-text.js +1 -1
- package/dist/adapters/help-text.js.map +1 -1
- package/dist/adapters/lark/lark-card.builder.d.ts.map +1 -1
- package/dist/adapters/lark/lark-card.builder.js +11 -1
- package/dist/adapters/lark/lark-card.builder.js.map +1 -1
- package/dist/adapters/lark/lark.adapter.d.ts +1 -1
- package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
- package/dist/adapters/lark/lark.adapter.js +4 -3
- package/dist/adapters/lark/lark.adapter.js.map +1 -1
- package/dist/adapters/lark/lark.controller.js +1 -1
- package/dist/adapters/lark/lark.controller.js.map +1 -1
- package/dist/adapters/slack/slack-block.builder.d.ts.map +1 -1
- package/dist/adapters/slack/slack-block.builder.js +11 -1
- package/dist/adapters/slack/slack-block.builder.js.map +1 -1
- package/dist/adapters/slack/slack.adapter.d.ts +1 -1
- package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
- package/dist/adapters/slack/slack.adapter.js +2 -2
- package/dist/adapters/slack/slack.adapter.js.map +1 -1
- package/dist/adapters/slack/slack.controller.js +2 -2
- package/dist/adapters/slack/slack.controller.js.map +1 -1
- package/dist/common/string-utils.d.ts +3 -1
- package/dist/common/string-utils.d.ts.map +1 -1
- package/dist/common/string-utils.js +16 -3
- package/dist/common/string-utils.js.map +1 -1
- package/dist/common/task-agent.d.ts +3 -0
- package/dist/common/task-agent.d.ts.map +1 -0
- package/dist/common/task-agent.js +21 -0
- package/dist/common/task-agent.js.map +1 -0
- package/dist/common/task-time-cost.d.ts +3 -0
- package/dist/common/task-time-cost.d.ts.map +1 -0
- package/dist/common/task-time-cost.js +28 -0
- package/dist/common/task-time-cost.js.map +1 -0
- package/dist/dispatcher/dispatcher.service.js +1 -1
- package/dist/dispatcher/dispatcher.service.js.map +1 -1
- package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
- package/dist/dispatcher/scheduler.service.js +22 -1
- package/dist/dispatcher/scheduler.service.js.map +1 -1
- package/dist/dispatcher/state-machine.d.ts +1 -1
- package/dist/dispatcher/state-machine.js +2 -2
- package/dist/dispatcher/state-machine.js.map +1 -1
- package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
- package/dist/dispatcher/task-creation.service.js +4 -2
- package/dist/dispatcher/task-creation.service.js.map +1 -1
- package/dist/dispatcher/task-lifecycle.service.js +4 -4
- package/dist/dispatcher/task-lifecycle.service.js.map +1 -1
- package/dist/dispatcher/worker-connection.manager.d.ts +1 -1
- package/dist/dispatcher/worker-connection.manager.d.ts.map +1 -1
- package/dist/dispatcher/worker-connection.manager.js +11 -3
- package/dist/dispatcher/worker-connection.manager.js.map +1 -1
- package/dist/dispatcher/worker-selector.d.ts.map +1 -1
- package/dist/dispatcher/worker-selector.js +16 -2
- package/dist/dispatcher/worker-selector.js.map +1 -1
- package/dist/notifier/notification-consumer.d.ts +7 -2
- package/dist/notifier/notification-consumer.d.ts.map +1 -1
- package/dist/notifier/notification-consumer.js +35 -13
- package/dist/notifier/notification-consumer.js.map +1 -1
- package/dist/web/dashboard.controller.d.ts +1 -0
- package/dist/web/dashboard.controller.d.ts.map +1 -1
- package/dist/web/dashboard.service.d.ts +4 -1
- package/dist/web/dashboard.service.d.ts.map +1 -1
- package/dist/web/dashboard.service.js +17 -9
- package/dist/web/dashboard.service.js.map +1 -1
- package/dist/web/project.controller.d.ts +1 -1
- package/dist/web/project.controller.d.ts.map +1 -1
- package/dist/web/project.controller.js +12 -5
- package/dist/web/project.controller.js.map +1 -1
- package/dist/web/pty.gateway.d.ts.map +1 -1
- package/dist/web/pty.gateway.js +7 -2
- package/dist/web/pty.gateway.js.map +1 -1
- package/dist/web/task.controller.d.ts +1 -1
- package/dist/web/task.controller.d.ts.map +1 -1
- package/dist/web/task.controller.js +3 -13
- package/dist/web/task.controller.js.map +1 -1
- package/dist/web/worker-channel.gateway.d.ts +1 -0
- package/dist/web/worker-channel.gateway.d.ts.map +1 -1
- package/dist/web/worker-channel.gateway.js +14 -2
- package/dist/web/worker-channel.gateway.js.map +1 -1
- package/package.json +4 -4
- package/public/assets/{AccessTokensPage-Cr097v40.js → AccessTokensPage-Ck9KudgP.js} +1 -1
- package/public/assets/AdminPage-BKWbP0n2.js +1 -0
- package/public/assets/{AgentCliPage-0DYkyCFU.js → AgentCliPage-Bex4ulEr.js} +1 -1
- package/public/assets/ApiReferencePage-CTkJqTdJ.js +1 -0
- package/public/assets/{ArchitecturePage-QnOTiWty.js → ArchitecturePage-8SxZccYN.js} +1 -1
- package/public/assets/AuditLogPage-BLzj5y_X.js +1 -0
- package/public/assets/{BindPlatformPage-ot7gVchX.js → BindPlatformPage-D45esrNl.js} +1 -1
- package/public/assets/{BotIntegrationPage-BtyfG2XP.js → BotIntegrationPage-BhDYugrQ.js} +1 -1
- package/public/assets/{BotManage-BZAdr9Ef.js → BotManage-CbUW-s4b.js} +1 -1
- package/public/assets/{BotSetupPage-DHPQWTKC.js → BotSetupPage-DnwaG9Z7.js} +1 -1
- package/public/assets/{ChangelogPage-AEZ8l4_F.js → ChangelogPage-ROnloca6.js} +1 -1
- package/public/assets/CliReferencePage-C-Lw0uAV.js +14 -0
- package/public/assets/{DeploymentPage-DoLblVvb.js → DeploymentPage-Cm8hl7PF.js} +1 -1
- package/public/assets/{DevWorkflowPage-DejRDBZS.js → DevWorkflowPage-DTjFXI4G.js} +1 -1
- package/public/assets/{DeveloperManage-Cp8HZ0D6.js → DeveloperManage-4o7ML8ff.js} +1 -1
- package/public/assets/{DeveloperSetupPage-BR9jE9u9.js → DeveloperSetupPage-BQhIuXLe.js} +1 -1
- package/public/assets/{DocsIndexPage-DFjTwAEC.js → DocsIndexPage-CoUUKiVh.js} +1 -1
- package/public/assets/DocsLayout-Br7yGyG5.js +1 -0
- package/public/assets/{DocsPrimitives-BXzC3C_T.js → DocsPrimitives-DuiNLMTd.js} +1 -1
- package/public/assets/{EditProjectPage-BAdWNM1Q.js → EditProjectPage-C_vbQdR2.js} +1 -1
- package/public/assets/{EmptyState-CSnE65GT.js → EmptyState-aKMHLBhj.js} +1 -1
- package/public/assets/{EnvVariablesPage-CG4TuCIN.js → EnvVariablesPage-gbqhCWCv.js} +1 -1
- package/public/assets/HomePage-Sfw7oH7M.js +1 -0
- package/public/assets/{InfoRow-CUxNs9ne.js → InfoRow-BQI_KKyp.js} +1 -1
- package/public/assets/{InstallationPage-C679ErXI.js → InstallationPage-Ce0qD1m-.js} +1 -1
- package/public/assets/{LandingPage-E8pwfBvz.js → LandingPage-1SiyCrIO.js} +1 -1
- package/public/assets/{LocalDevelopmentPage-D6ILnSoo.js → LocalDevelopmentPage-tuixvO86.js} +1 -1
- package/public/assets/{LoginPage-D_DPwVwn.js → LoginPage-D7C2GvH2.js} +1 -1
- package/public/assets/{MetricBar-8GF9L_i9.js → MetricBar-DaWuVJHZ.js} +1 -1
- package/public/assets/{NotFoundPage-Cw8H-got.js → NotFoundPage-B2K-657t.js} +1 -1
- package/public/assets/{OnboardingGuide-CYh6h81Z.js → OnboardingGuide-Cj_QW_kH.js} +1 -1
- package/public/assets/{PermissionsPage-BJ5ucT9C.js → PermissionsPage-D4ZeOpEb.js} +1 -1
- package/public/assets/{PipelineConfigPage-CmFPv119.js → PipelineConfigPage-DaCDhd-P.js} +1 -1
- package/public/assets/{PipelineEditorPage-6adMKyts.js → PipelineEditorPage-rM_yORd4.js} +2 -2
- package/public/assets/ProfilePage-DshUwwog.js +1 -0
- package/public/assets/ProjectDetailPage-BMKog_vR.js +7 -0
- package/public/assets/{ProjectListPage-DrLdH4Ei.js → ProjectListPage-C5U_Q6m_.js} +2 -2
- package/public/assets/{PtyTerminal-gy77drbY.js → PtyTerminal-DJ4ToCWx.js} +2 -2
- package/public/assets/{QuickAuth-xZnzkGvb.js → QuickAuth-BPSm4iQz.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-B5OQbjQg.js → RemoveMemberConfirmDialog-GYx2AH26.js} +2 -2
- package/public/assets/{Select-Do5DXb3j.js → Select-CvM411zU.js} +1 -1
- package/public/assets/{SettingsPage-Bw9JmWan.js → SettingsPage-_cXRQuuA.js} +1 -1
- package/public/assets/{Skeleton-CW5d7fJ4.js → Skeleton-qXDikSxR.js} +1 -1
- package/public/assets/{SkillPage-C-ShsZGo.js → SkillPage-C3wTzd5o.js} +1 -1
- package/public/assets/TaskDetailPage-BQY6iia7.js +26 -0
- package/public/assets/TaskListPage-D6iQoHz7.js +1 -0
- package/public/assets/{TaskStatusBadge--oACnBUb.js → TaskStatusBadge-CJTrG6-l.js} +1 -1
- package/public/assets/TerminalHomePage-BFyQcEXU.js +11 -0
- package/public/assets/{TokenManage-D0UL7DBv.js → TokenManage-C5GQ1LB8.js} +1 -1
- package/public/assets/{Tooltip-BQSpwoKv.js → Tooltip-DYbD-tQw.js} +1 -1
- package/public/assets/{TotpSetupPage-D9iUn0_Y.js → TotpSetupPage-C09YtAXD.js} +1 -1
- package/public/assets/WorkerDetailPage-DhtIXNEC.js +1 -0
- package/public/assets/{WorkerListPage-B47Wc0zs.js → WorkerListPage-B_K4x-PV.js} +2 -2
- package/public/assets/{WorkerOperationsPage-XuqS7u-Y.js → WorkerOperationsPage-BZN-hLvH.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-D_fyqLD7.js → WorkerSetupGuidePage-DNy2wbA9.js} +1 -1
- package/public/assets/{WorkerSetupPage-C-xmBIhD.js → WorkerSetupPage-VBsAuhUc.js} +1 -1
- package/public/assets/{arrow-left-BmBtPvqR.js → arrow-left-B5R31ze1.js} +1 -1
- package/public/assets/{arrow-right-DQ5XDN6Z.js → arrow-right-C10sjQNz.js} +1 -1
- package/public/assets/{bot-DUC6k0o_.js → bot-J2o7uWlo.js} +1 -1
- package/public/assets/chevron-left-B5ojlwvf.js +6 -0
- package/public/assets/{chevron-right-D5yuBhvf.js → chevron-right-Yoiq-SRa.js} +1 -1
- package/public/assets/{copy-DsibVBOY.js → copy-BpM8iA-r.js} +1 -1
- package/public/assets/date-RFA7-ZGs.js +1 -0
- package/public/assets/{download-BLkgWRTq.js → download-DMI0uxkZ.js} +1 -1
- package/public/assets/{external-link-oEMmDqkw.js → external-link-BgyHxzCy.js} +1 -1
- package/public/assets/{git-fork-nMDIqkn8.js → git-fork-BSMVuD3x.js} +1 -1
- package/public/assets/index-DMWyyiI3.css +1 -0
- package/public/assets/{index-Cxiuct-Z.js → index-XDDf1Oy_.js} +42 -42
- package/public/assets/{key-CFQniqbQ.js → key-y6VWhViZ.js} +1 -1
- package/public/assets/{loader-circle-gHkPMihD.js → loader-circle-CMxLiCu8.js} +1 -1
- package/public/assets/{pencil-B01ssnBx.js → pencil-CUs1Ii2-.js} +1 -1
- package/public/assets/{plus-26O7XffR.js → plus-R7zuZ-Lg.js} +1 -1
- package/public/assets/{rotate-ccw-EIYq8PBk.js → rotate-ccw-B1uEgqoV.js} +1 -1
- package/public/assets/{scroll-text-BHCR_iaD.js → scroll-text-CL3s7j9w.js} +1 -1
- package/public/assets/{settings-beF7O3lb.js → settings-IoIv8DUf.js} +1 -1
- package/public/assets/status-colors-JE6CIHvW.js +1 -0
- package/public/assets/task-constants-DkWAZdpz.js +1 -0
- package/public/assets/{trash-2-BJmwr4y8.js → trash-2-BYatp6Y5.js} +1 -1
- package/public/assets/{useFetch-DiJtqzkU.js → useFetch-D6-vLVQP.js} +1 -1
- package/public/assets/{users-C17f7r3H.js → users-C3jRdgS-.js} +1 -1
- package/public/assets/{wifi-CJ7w56-5.js → wifi-B8ZV0Cuq.js} +1 -1
- package/public/assets/{workflow-DNH-yZBI.js → workflow-GXjmJAuH.js} +1 -1
- package/public/index.html +2 -2
- package/public/sw.js +1 -1
- package/public/assets/AdminPage-VIOLrGFx.js +0 -1
- package/public/assets/ApiReferencePage-B9a_wvSq.js +0 -1
- package/public/assets/AuditLogPage-B2V_M9t2.js +0 -6
- package/public/assets/CliReferencePage-Yr_43MGe.js +0 -14
- package/public/assets/DocsLayout-DC5Tkwza.js +0 -1
- package/public/assets/HomePage-BqlvkHSs.js +0 -1
- package/public/assets/ProfilePage-Ce-x-H8n.js +0 -1
- package/public/assets/ProjectDetailPage-DXZrEF_O.js +0 -7
- package/public/assets/TaskDetailPage-BakBoast.js +0 -26
- package/public/assets/TaskListPage--IQPCrtx.js +0 -1
- package/public/assets/TerminalHomePage-DCoze8O0.js +0 -11
- package/public/assets/WorkerDetailPage-D3Jzaen0.js +0 -1
- package/public/assets/date-BdNtiQTP.js +0 -1
- package/public/assets/index-zA1n63-W.css +0 -1
- package/public/assets/status-colors-BH60BXIE.js +0 -1
- package/public/assets/task-constants-CJk15ylu.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{W as r,p as e,a1 as s,a2 as u,Y as a}from"./index-XDDf1Oy_.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--info)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const o={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return o[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,o as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as k,h as c,p as f,F as T}from"./index-XDDf1Oy_.js";const b=k((t,r)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0,fetchTasks:async a=>{const s=r()._fetchTasksAbort;s&&s.abort();const o=new AbortController,l=r()._fetchTasksRequestId+1;t({loading:!0,error:null,_fetchTasksAbort:o,_fetchTasksRequestId:l});try{const e={};a!=null&&a.status&&(e.status=a.status),a!=null&&a.projectKey&&(e.projectKey=a.projectKey),a!=null&&a.developerId&&(e.developerId=a.developerId),a!=null&&a.cursor&&(e.cursor=a.cursor),a!=null&&a.limit&&(e.limit=String(a.limit));const n=await c.get("web/tasks",{searchParams:e,signal:o.signal}).json();if(r()._fetchTasksRequestId!==l)return;a!=null&&a.cursor?t(i=>({tasks:[...i.tasks,...n.data],nextCursor:n.nextCursor??null,_fetchTasksAbort:null})):t({tasks:n.data,nextCursor:n.nextCursor??null,_fetchTasksAbort:null})}catch(e){if(e instanceof DOMException&&e.name==="AbortError")return;r()._fetchTasksRequestId===l&&t({error:e instanceof Error?e.message:"Failed to fetch tasks"})}finally{r()._fetchTasksRequestId===l&&t({loading:!1,_fetchTasksAbort:null})}},fetchTask:async a=>{t({loading:!0,error:null});try{const s=await c.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 c.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 c.post(`web/tasks/${a}/cancel`);const{currentTask:s}=r();(s==null?void 0:s.id)===a&&await r().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,_fetchTasksAbort:null,_fetchTasksRequestId:0})}})),u=[f.COMPLETED,f.FAILED,f.CANCELLED],_=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],d=Object.values(T).map(t=>({value:t,label:t})),E=[{value:"",label:"default"},...d];export{E as A,d as C,u as T,_ as a,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-XDDf1Oy_.js";function p(s,l){const[i,d]=e.useState(null),[R,a]=e.useState(!0),[m,o]=e.useState(null),f=e.useRef(s);f.current=s;const r=e.useRef(0),t=e.useRef(!0),u=e.useCallback(async()=>{const c=++r.current;a(!0),o(null);try{const n=await f.current();t.current&&c===r.current&&d(n)}catch(n){if(t.current&&c===r.current){const E=n instanceof Error?n.message:"An unexpected error occurred";o(E)}}finally{t.current&&c===r.current&&a(!1)}},l);return e.useEffect(()=>{u()},[u]),e.useEffect(()=>()=>{t.current=!1,r.current+=1},[]),{data:i,loading:R,error:m,refetch:u}}export{p as u};
|
package/public/index.html
CHANGED
|
@@ -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-XDDf1Oy_.js"></script>
|
|
32
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DMWyyiI3.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 u={};const o=s=>l(s,r),a={module:{uri:r},exports:u,require:o};e[r]=Promise.all(i.map(s=>a[s]||o(s))).then(s=>(n(...s),u))}}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:"ae4ea8cc78601c6719b6e3ef1b29684c"},{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/workflow-GXjmJAuH.js",revision:null},{url:"assets/wifi-B8ZV0Cuq.js",revision:null},{url:"assets/users-C3jRdgS-.js",revision:null},{url:"assets/useFetch-D6-vLVQP.js",revision:null},{url:"assets/trash-2-BYatp6Y5.js",revision:null},{url:"assets/task-constants-DkWAZdpz.js",revision:null},{url:"assets/status-colors-JE6CIHvW.js",revision:null},{url:"assets/settings-IoIv8DUf.js",revision:null},{url:"assets/scroll-text-CL3s7j9w.js",revision:null},{url:"assets/rotate-ccw-B1uEgqoV.js",revision:null},{url:"assets/plus-R7zuZ-Lg.js",revision:null},{url:"assets/pencil-CUs1Ii2-.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-CMxLiCu8.js",revision:null},{url:"assets/key-y6VWhViZ.js",revision:null},{url:"assets/index-XDDf1Oy_.js",revision:null},{url:"assets/index-DMWyyiI3.css",revision:null},{url:"assets/git-fork-BSMVuD3x.js",revision:null},{url:"assets/external-link-BgyHxzCy.js",revision:null},{url:"assets/download-DMI0uxkZ.js",revision:null},{url:"assets/date-RFA7-ZGs.js",revision:null},{url:"assets/copy-BpM8iA-r.js",revision:null},{url:"assets/chevron-right-Yoiq-SRa.js",revision:null},{url:"assets/chevron-left-B5ojlwvf.js",revision:null},{url:"assets/bot-J2o7uWlo.js",revision:null},{url:"assets/arrow-right-C10sjQNz.js",revision:null},{url:"assets/arrow-left-B5R31ze1.js",revision:null},{url:"assets/WorkerSetupPage-VBsAuhUc.js",revision:null},{url:"assets/WorkerSetupGuidePage-DNy2wbA9.js",revision:null},{url:"assets/WorkerOperationsPage-BZN-hLvH.js",revision:null},{url:"assets/WorkerListPage-B_K4x-PV.js",revision:null},{url:"assets/WorkerDetailPage-DhtIXNEC.js",revision:null},{url:"assets/TotpSetupPage-C09YtAXD.js",revision:null},{url:"assets/Tooltip-DYbD-tQw.js",revision:null},{url:"assets/TokenManage-C5GQ1LB8.js",revision:null},{url:"assets/TerminalHomePage-BFyQcEXU.js",revision:null},{url:"assets/TaskStatusBadge-CJTrG6-l.js",revision:null},{url:"assets/TaskListPage-D6iQoHz7.js",revision:null},{url:"assets/TaskDetailPage-BQY6iia7.js",revision:null},{url:"assets/SkillPage-C3wTzd5o.js",revision:null},{url:"assets/Skeleton-qXDikSxR.js",revision:null},{url:"assets/SettingsPage-_cXRQuuA.js",revision:null},{url:"assets/Select-CvM411zU.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-GYx2AH26.js",revision:null},{url:"assets/QuickAuth-BPSm4iQz.js",revision:null},{url:"assets/PtyTerminal-DJ4ToCWx.js",revision:null},{url:"assets/PtyTerminal-Beg8tuEN.css",revision:null},{url:"assets/ProjectListPage-C5U_Q6m_.js",revision:null},{url:"assets/ProjectDetailPage-BMKog_vR.js",revision:null},{url:"assets/ProfilePage-DshUwwog.js",revision:null},{url:"assets/PipelineEditorPage-rM_yORd4.js",revision:null},{url:"assets/PipelineConfigPage-DaCDhd-P.js",revision:null},{url:"assets/PermissionsPage-D4ZeOpEb.js",revision:null},{url:"assets/OnboardingGuide-Cj_QW_kH.js",revision:null},{url:"assets/NotFoundPage-B2K-657t.js",revision:null},{url:"assets/MetricBar-DaWuVJHZ.js",revision:null},{url:"assets/LoginPage-D7C2GvH2.js",revision:null},{url:"assets/LocalDevelopmentPage-tuixvO86.js",revision:null},{url:"assets/LandingPage-1SiyCrIO.js",revision:null},{url:"assets/InstallationPage-Ce0qD1m-.js",revision:null},{url:"assets/InfoRow-BQI_KKyp.js",revision:null},{url:"assets/HomePage-Sfw7oH7M.js",revision:null},{url:"assets/EnvVariablesPage-gbqhCWCv.js",revision:null},{url:"assets/EmptyState-aKMHLBhj.js",revision:null},{url:"assets/EditProjectPage-C_vbQdR2.js",revision:null},{url:"assets/DocsPrimitives-DuiNLMTd.js",revision:null},{url:"assets/DocsLayout-Br7yGyG5.js",revision:null},{url:"assets/DocsIndexPage-CoUUKiVh.js",revision:null},{url:"assets/DeveloperSetupPage-BQhIuXLe.js",revision:null},{url:"assets/DeveloperManage-4o7ML8ff.js",revision:null},{url:"assets/DevWorkflowPage-DTjFXI4G.js",revision:null},{url:"assets/DeploymentPage-Cm8hl7PF.js",revision:null},{url:"assets/CliReferencePage-C-Lw0uAV.js",revision:null},{url:"assets/ChangelogPage-ROnloca6.js",revision:null},{url:"assets/BotSetupPage-DnwaG9Z7.js",revision:null},{url:"assets/BotManage-CbUW-s4b.js",revision:null},{url:"assets/BotIntegrationPage-BhDYugrQ.js",revision:null},{url:"assets/BindPlatformPage-D45esrNl.js",revision:null},{url:"assets/AuditLogPage-BLzj5y_X.js",revision:null},{url:"assets/ArchitecturePage-8SxZccYN.js",revision:null},{url:"assets/ApiReferencePage-CTkJqTdJ.js",revision:null},{url:"assets/AgentCliPage-Bex4ulEr.js",revision:null},{url:"assets/AdminPage-BKWbP0n2.js",revision:null},{url:"assets/AccessTokensPage-Ck9KudgP.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:"fefa2ba09d815fe1773d1fdaaf97d9e5"}],{}),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 +0,0 @@
|
|
|
1
|
-
import{a as i,K as d,j as t,Y as m,Z as l}from"./index-Cxiuct-Z.js";import{U as c}from"./users-C17f7r3H.js";import{B as b}from"./bot-DUC6k0o_.js";import{S as p}from"./scroll-text-BHCR_iaD.js";import{S as x}from"./settings-beF7O3lb.js";function h(){const{t:a}=i(),r=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:c},{to:"/admin/bots",label:a("admin.tab_bots"),icon:b},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:d},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:p},{to:"/admin/settings",label:a("admin.tab_settings"),icon:x}];return t.jsxs("div",{children:[t.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar pr-4 md:pr-0",children:r.map(({to:e,label:o,icon:s})=>t.jsxs(m,{to:e,className:({isActive:n})=>`flex shrink-0 whitespace-nowrap items-center gap-2 border-b-2 px-4 py-3 md:py-2 text-sm transition-colors ${n?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[t.jsx(s,{size:16}),o]},e))}),t.jsx(l,{})]})}export{h as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as d,a as o,q as p,r as n,j as t}from"./index-Cxiuct-Z.js";import{Q as c}from"./QuickAuth-xZnzkGvb.js";import{P as h}from"./plus-26O7XffR.js";import"./copy-DsibVBOY.js";const l={GET:"text-green-400",POST:"text-blue-400",PUT:"text-yellow-400",DELETE:"text-red-400"},m=[{title:"authentication",prefix:"/api/auth",endpoints:[{method:"POST",path:"/login",description:"authenticate with username + password (optional totpCode)",auth:"none",body:'{ "username": "string", "password": "string", "totpCode?": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/refresh",description:"refresh access token (rotates refresh token)",auth:"none",body:'{ "refreshToken": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/logout",description:"invalidate refresh token",auth:"jwt",body:'{ "refreshToken": "string" }'}]},{title:"tasks",prefix:"/api/web/tasks",endpoints:[{method:"GET",path:"",description:"list tasks with optional filters",auth:"jwt",response:'[ { "id": 1, "description": "...", "status": "RUNNING", ... } ]'},{method:"POST",path:"",description:"create a new task (name is AI-generated if LLM is configured, otherwise null)",auth:"jwt",body:'{ "projectKey": "string", "description": "string", "workerId?": "string", "taskType?": "feat|fix|refactor|docs|chore", "branchSlug?": "string" }',response:'{ "id": 1, "description": "...", "name": "string | null", "branchSlug": "string | null", "status": "PENDING", ... }'},{method:"GET",path:"/:id",description:"get task details",auth:"jwt"},{method:"POST",path:"/:id/cancel",description:"cancel a running task",auth:"jwt"},{method:"POST",path:"/:id/retry",description:"retry a failed task",auth:"jwt"},{method:"POST",path:"/:id/confirm-stage",description:"confirm/choose/input for suspended stage",auth:"jwt",body:'{ "stageIndex": "number", "result": "string" }'},{method:"POST",path:"/:id/pty-token",description:"get pty websocket token",auth:"jwt"}]},{title:"workers",prefix:"/api/web/workers",endpoints:[{method:"GET",path:"",description:"list all workers",auth:"jwt"},{method:"GET",path:"/:id",description:"get worker details",auth:"jwt"},{method:"GET",path:"/:id/tasks",description:"list tasks assigned to a worker",auth:"jwt"},{method:"POST",path:"/:id/drain",description:"start draining a worker",auth:"jwt"},{method:"POST",path:"/:id/undrain",description:"cancel worker drain",auth:"jwt"}]},{title:"projects",prefix:"/api/web/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"GET",path:"/:key",description:"get project details",auth:"jwt"}]},{title:"profile",prefix:"/api/web/profile",endpoints:[{method:"GET",path:"",description:"get current user profile",auth:"jwt"},{method:"PUT",path:"",description:"update profile (gitName, gitEmail)",auth:"jwt",body:'{ "gitName?": "string", "gitEmail?": "string" }'},{method:"PUT",path:"/password",description:"change password",auth:"jwt",body:'{ "currentPassword": "string", "newPassword": "string" }'},{method:"POST",path:"/totp/setup",description:"initialize totp setup",auth:"jwt"},{method:"POST",path:"/totp/verify",description:"verify totp setup code",auth:"jwt",body:'{ "code": "string" }'},{method:"GET",path:"/tokens",description:"list personal access tokens",auth:"jwt"},{method:"POST",path:"/tokens",description:"create a personal access token",auth:"jwt",body:'{ "label": "string", "expiresAt?": "string" }'},{method:"POST",path:"/tokens/:id/revoke",description:"revoke a token",auth:"jwt"},{method:"POST",path:"/bind-platform",description:"link a chat platform account using a one-time bind token",auth:"jwt",body:'{ "token": "string" }',response:'{ "success": true, "platform": "lark" }'}]},{title:"workspaces & tunnels",prefix:"/api/web",endpoints:[{method:"GET",path:"/workspaces/:taskId",description:"get workspace for a task",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/start",description:"start a cursor remote tunnel",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/stop",description:"stop a running tunnel",auth:"jwt"},{method:"GET",path:"/workspace-tunnel/:taskId/status",description:"get tunnel status",auth:"jwt"}]},{title:"dashboard",prefix:"/api/web/dashboard",endpoints:[{method:"GET",path:"/stats",description:"get dashboard statistics",auth:"jwt"},{method:"GET",path:"/recent-tasks",description:"get recent tasks for dashboard",auth:"jwt"},{method:"GET",path:"/recent-activity",description:"get recent activity feed",auth:"jwt"}]},{title:"notifications",prefix:"/api/web/notifications",endpoints:[{method:"GET",path:"",description:"list notifications with cursor pagination",auth:"jwt"},{method:"POST",path:"/:id/read",description:"mark a notification as read",auth:"jwt"},{method:"POST",path:"/read-all",description:"mark all notifications as read",auth:"jwt"}]},{title:"search",prefix:"/api/web",endpoints:[{method:"GET",path:"/search?q=query",description:"global search across tasks, workers, projects",auth:"jwt"}]},{title:"admin — developers",prefix:"/api/admin/developers",endpoints:[{method:"GET",path:"",description:"list all developers",auth:"jwt"},{method:"POST",path:"",description:"create a developer",auth:"jwt",body:'{ "name": "string", "password": "string", "role": "string", "gitName": "string", "gitEmail": "string" }'},{method:"PUT",path:"/:id",description:"update developer",auth:"jwt"},{method:"PUT",path:"/:id/reset-totp",description:"reset developer totp",auth:"jwt"}]},{title:"admin — projects",prefix:"/api/admin/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"POST",path:"",description:"create a project",auth:"jwt"},{method:"PUT",path:"/:key",description:"update project (including pipeline)",auth:"jwt"},{method:"DELETE",path:"/:key",description:"delete a project",auth:"jwt"},{method:"GET",path:"/:key/members",description:"get project members",auth:"jwt"},{method:"POST",path:"/:key/members",description:"add project member",auth:"jwt"},{method:"DELETE",path:"/:key/members?developerId=N",description:"remove project member",auth:"jwt"}]},{title:"admin — worker tokens",prefix:"/api/admin/worker-tokens",endpoints:[{method:"GET",path:"",description:"list all worker enrollment tokens",auth:"jwt"},{method:"POST",path:"",description:"generate a new worker token",auth:"jwt"},{method:"POST",path:"/:id/revoke",description:"revoke a worker token",auth:"jwt"},{method:"GET",path:"/:id/status",description:"get token status and linked worker",auth:"jwt"}]},{title:"admin — workers",prefix:"/api/admin/workers",endpoints:[{method:"GET",path:"",description:"list all workers (admin)",auth:"jwt"},{method:"PUT",path:"/:id",description:"update worker status",auth:"jwt",body:'{ "status?": "string" }'}]},{title:"admin — bots",prefix:"/api/admin/bots",endpoints:[{method:"GET",path:"",description:"list bot instances",auth:"jwt"},{method:"POST",path:"",description:"create a bot instance",auth:"jwt"},{method:"GET",path:"/:id/bindings",description:"get group bindings for a bot",auth:"jwt"},{method:"POST",path:"/:id/bindings",description:"create a group binding",auth:"jwt"},{method:"DELETE",path:"/:id/bindings",description:"delete a group binding",auth:"jwt"}]},{title:"admin — audit & settings",prefix:"/api/admin",endpoints:[{method:"GET",path:"/audit-logs",description:"query audit log with filters",auth:"jwt"},{method:"GET",path:"/settings",description:"get all system settings",auth:"jwt"},{method:"PUT",path:"/settings",description:"update system settings",auth:"jwt"}]},{title:"websocket",prefix:"",endpoints:[{method:"GET",path:"WS /ws/pty/:taskId",description:'pty terminal websocket — first obtain a channel token via POST /api/web/tasks/:taskId/pty-token, then send an auth frame after connection: { type: "auth", token: "<jwt>", channelToken: "<channel-token>" }',auth:"jwt"},{method:"GET",path:"WS /api/workers/pty/:taskId",description:'worker pty websocket — auth via frame: { type: "auth", workerJwt: "<worker-jwt>", channelToken: "<channel-token>" }',auth:"worker-token"}]}];function u({ep:e,prefix:a}){const[s,i]=n.useState(!1),{t:r}=o();return t.jsxs("div",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 sm:gap-3 px-3 md:px-4 py-2.5 text-left transition-colors hover:bg-[var(--bg-input)] min-w-0",onClick:()=>i(!s),children:[t.jsx("span",{className:`w-12 shrink-0 text-xs font-bold ${l[e.method]}`,children:e.method}),t.jsxs("code",{className:"flex-1 text-xs text-[var(--text-primary)] truncate min-w-0",children:[a,e.path]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate max-w-[200px]",children:["// ",e.description]})]}),s&&t.jsxs("div",{className:"border-t border-[var(--border-row)] bg-[var(--bg-primary)] px-3 md:px-4 py-3 space-y-2",children:[t.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// ",e.description]}),t.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[t.jsx("span",{className:"text-[var(--text-muted)]",children:"auth:"}),t.jsx("span",{className:e.auth==="none"?"text-[var(--text-muted)]":"text-[var(--accent)]",children:e.auth})]}),e.body&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.request_body")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.body})]}),e.response&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.response")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.response})]})]})]})}function g(){const e=d(),{t:a}=o();return p(n.useMemo(()=>t.jsxs("button",{onClick:()=>e("/access-tokens"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[t.jsx(h,{className:"h-3.5 w-3.5"}),a("access_tokens.create_token")]}),[e,a])),t.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[t.jsx("div",{className:"mb-8",children:t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.api_base_url_desc",{url:"http://localhost:9000"})})}),t.jsx(c,{mode:"api"}),t.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.authentication")}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"jwt"}),t.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["obtained via /api/auth/login — pass as ",t.jsx("code",{children:"authorization: bearer <token>"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"pat"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"personal access token — same header format, for cli/api usage"})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-yellow-400",children:"worker-token"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"enrollment token for worker registration — used during initial handshake"})]})]}),t.jsx("div",{className:"space-y-6",children:m.map(s=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-2 text-sm text-[var(--accent)]",children:["> ",s.title]}),t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s.endpoints.map((i,r)=>t.jsx(u,{ep:i,prefix:s.prefix},`${i.method}-${i.path}-${r}`))})]},s.title))})]})}export{g as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as C,a as S,r,h as k,j as e,s as L}from"./index-Cxiuct-Z.js";import{S as E}from"./Select-Do5DXb3j.js";import{E as T}from"./EmptyState-CSnE65GT.js";import{T as A}from"./Skeleton-CW5d7fJ4.js";import{S as F}from"./scroll-text-BHCR_iaD.js";import{C as I}from"./chevron-right-D5yuBhvf.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 P=C("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);function $(){const{t:a}=S(),v=[{value:"",label:a("admin.all_actions")},{value:"login",label:a("admin.action_login")},{value:"logout",label:a("admin.action_logout")},{value:"create",label:a("admin.action_create")},{value:"update",label:a("admin.action_update")},{value:"delete",label:a("admin.action_delete")},{value:"revoke",label:a("admin.action_revoke")},{value:"reset_2fa",label:a("admin.action_reset_2fa")},{value:"generate_token",label:a("admin.action_generate_token")}],[n,b]=r.useState([]),[f,u]=r.useState(!0),[i,j]=r.useState(""),[o,g]=r.useState(""),[N,c]=r.useState(void 0),[x,m]=r.useState([]),[l,w]=r.useState(void 0),d=r.useCallback(async t=>{try{u(!0);const s={limit:"50"};t&&(s.cursor=t),i&&(s.action=i),o&&(s.user=o);const h=await k.get("admin/audit-logs",{searchParams:s}).json();b(h.data),w(h.nextCursor)}catch{}finally{u(!1)}},[i,o]);r.useEffect(()=>{c(void 0),m([]),d()},[d]);function _(){l&&(m(t=>[...t,N??""]),c(l),d(l))}function y(){if(x.length===0)return;const t=[...x],s=t.pop();m(t),c(s||void 0),d(s||void 0)}function p(t){return t.startsWith("delete")||t==="revoke"?"text-[var(--destructive)]":t.startsWith("create")||t==="generate_token"?"text-[var(--accent)]":t.startsWith("update")||t==="reset_2fa"?"text-[var(--warning)]":t==="login"?"text-[var(--info)]":"text-[var(--text-secondary)]"}return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.audit_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.audit_subtitle")})]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsx(E,{value:i,onChange:j,options:v}),e.jsxs("div",{className:"relative w-full max-w-xs",children:[e.jsx(L,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.filter_by_user"),value:o,onChange:t=>g(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),f?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(A,{rows:5})}):n.length===0?e.jsx(T,{icon:F,title:a("admin.no_audit_entries"),description:a("admin.audit_logs_appear")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block 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)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.timestamp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.user_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.action")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.resource")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.detail")}),e.jsx("th",{className:"pb-2 font-normal",children:a("admin.ip")})]})}),e.jsx("tbody",{children:n.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"whitespace-nowrap py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleString()}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.userId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:p(t.action),children:t.action})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.resource}),e.jsx("td",{className:"max-w-xs truncate py-2.5 pr-4 text-[var(--text-muted)]",children:t.detail}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:t.ip})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:n.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] mb-1",children:new Date(t.createdAt).toLocaleString()}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2 mb-1",children:[e.jsx("span",{className:`shrink-0 text-[11px] ${p(t.action)}`,children:t.action}),e.jsx("span",{className:"min-w-0 truncate text-[11px] text-[var(--text-secondary)]",children:t.resource})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] truncate",children:t.detail}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[11px] text-[var(--text-muted)]",children:[e.jsxs("span",{children:["User: ",t.userId]}),e.jsx("span",{children:t.ip})]})]},t.id))}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("admin.showing_entries",{count:String(n.length)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",disabled:x.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:y,children:[e.jsx(P,{className:"h-3.5 w-3.5"}),a("common.previous")]}),e.jsxs("button",{type:"button",disabled:!l,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:_,children:[a("common.next"),e.jsx(I,{className:"h-3.5 w-3.5"})]})]})]})]})]})}export{$ as default};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{f as l,a as n,q as p,r as d,j as e,C as m}from"./index-Cxiuct-Z.js";import{Q as x}from"./QuickAuth-xZnzkGvb.js";import{P as u}from"./plus-26O7XffR.js";import{C as v}from"./copy-DsibVBOY.js";const g=[{command:"ov setup",description:"quick setup — configure server connection and authenticate in one step",usage:"ov setup [--server <url>] [--token <token>]",flags:[{flag:"--server <url>",desc:"overlord server url"},{flag:"--token <token>",desc:"personal access token (skips prompt)"}],example:`ov setup
|
|
2
|
-
> Overlord server URL: http://localhost:9000
|
|
3
|
-
> Personal Access Token: ov_pat_xxxxx
|
|
4
|
-
✓ Connected to http://localhost:9000
|
|
5
|
-
✓ Authenticated as admin (admin)`},{command:"ov login",description:"authenticate with the overlord server using a personal access token",usage:"ov login",example:`ov login
|
|
6
|
-
> Enter server URL: http://localhost:9000
|
|
7
|
-
> Enter PAT: ov_pat_xxxxx
|
|
8
|
-
✓ Logged in as admin`},{command:"ov logout",description:"clear stored credentials",usage:"ov logout"},{command:"ov whoami",description:"show current authenticated user and platform bind status",usage:"ov whoami [--json]",flags:[{flag:"--json",desc:"output as json"}],example:`ov whoami
|
|
9
|
-
Name: admin
|
|
10
|
-
Email: admin@overlord.dev
|
|
11
|
-
Role: admin
|
|
12
|
-
Status: active
|
|
13
|
-
Lark: linked
|
|
14
|
-
Slack: not linked`},{command:"ov task create",description:"create a new task",usage:"ov task create -d <description> [-p <project>] [--on <worker>] [--agent <type>] [--branch <slug>]",flags:[{flag:"-d, --description",desc:"task description (required unless -f)"},{flag:"-p, --project",desc:"project key to assign the task to"},{flag:"--on",desc:"target worker id (optional)"},{flag:"--agent",desc:"agent type: claude, cursor, codex (overrides project default)"},{flag:"--branch",desc:"custom branch slug for the task"},{flag:"-t, --type",desc:"task type: feat, fix, refactor, docs, chore"},{flag:"-f, --file",desc:"create task from yaml file"}],example:'ov task create -d "fix login bug" -p overlord --agent cursor --branch fix-login'},{command:"ov task list",description:"list all tasks with optional filters",usage:"ov task list [--status <status>] [-p <project>]",flags:[{flag:"--status",desc:"filter by status (RUNNING, QUEUED, COMPLETED, FAILED, CANCELLED)"},{flag:"-p, --project",desc:"filter by project key"}]},{command:"ov task show <id>",description:"show detailed information about a task",usage:"ov task show <task_id>"},{command:"ov task fork <id>",description:"fork a completed or failed task",usage:"ov task fork <task_id> [-d <description>]",flags:[{flag:"-d, --description",desc:"new description (optional, reuses original if omitted)"}],example:'ov task fork 42 -d "retry with different approach"'},{command:"ov task cancel <id>",description:"cancel a running or queued task",usage:"ov task cancel <task_id>"},{command:"ov task retry <id>",description:"retry a failed task",usage:"ov task retry <task_id>"},{command:"ov task fork <id>",description:"fork a completed or failed task",usage:'ov task fork <task_id> ["new description"]'},{command:"ov task logs <id>",description:"view task logs (streams via pty if active, fetches historical otherwise)",usage:"ov task logs <task_id> [--json]",flags:[{flag:"--json",desc:"output as json"}]},{command:"ov task confirm <id>",description:"confirm a suspended task stage",usage:"ov task confirm <task_id> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to confirm (required)"}]},{command:"ov task choose <id> <option>",description:"submit a choice for a suspended task",usage:"ov task choose <task_id> <option> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to respond to (required)"}]},{command:"ov task input <id> <text>",description:"submit text input for a suspended task",usage:"ov task input <task_id> <text> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to respond to (required)"}]},{command:"ov attach <id>",description:"connect to a task pty terminal",usage:"ov attach <task_id> [--watch] [--takeover] [--session <id>]",flags:[{flag:"--watch",desc:"read-only observer mode"},{flag:"--takeover",desc:"take over pty control from current user"},{flag:"--session <id>",desc:"session id for takeover"}]},{command:"ov project list",description:"list all projects",usage:"ov project list"},{command:"ov project show <key>",description:"show project details",usage:"ov project show <project_key>"},{command:"ov worker list",description:"list all registered workers",usage:"ov worker list"},{command:"ov worker show <id>",description:"show worker details",usage:"ov worker show <worker_id>"},{command:"ov notifications",description:"view your notifications",usage:"ov notifications [--all] [--json]",flags:[{flag:"--all",desc:"show all notifications (including read)"},{flag:"--json",desc:"output as json"}]},{command:"ov notifications read <id>",description:"mark a notification as read",usage:"ov notifications read <notification_id>"},{command:"ov search <query>",description:"search across tasks, workers, and projects",usage:"ov search <query>"},{command:"ov config set <key> <value>",description:"set a configuration value",usage:"ov config set <key> <value>",flags:[{flag:"server",desc:"overlord server url"},{flag:"default-project",desc:"default project key"},{flag:"output-format",desc:"output format (table, json)"},{flag:"color",desc:"enable/disable color (true/false)"}]},{command:"ov config get <key>",description:"get a configuration value",usage:"ov config get <key>"},{command:"ov config list",description:"list all configuration values",usage:"ov config list [--json]"},{command:"ov status",description:"show server connectivity, current user, and cluster overview",usage:"ov status [--json]"},{command:"ov upgrade",description:"upgrade ov cli to the latest version",usage:"ov upgrade"}],f=[{command:"overlord install",description:"interactive server installation wizard — checks environment, configures database, creates admin account",usage:"overlord install"},{command:"overlord setup worker",description:"interactive worker setup wizard — configures connection, writes .env, registers service",usage:"overlord setup worker"},{command:"overlord start [component]",description:"start server or worker services (systemd / launchd)",usage:"overlord start [server|worker]"},{command:"overlord stop [component]",description:"stop running processes",usage:"overlord stop [server|worker]"},{command:"overlord status",description:"show process status table (pid, cpu, memory, uptime)",usage:"overlord status"},{command:"overlord logs [component]",description:"view server or worker logs",usage:"overlord logs [server|worker] [--lines <n>]"},{command:"overlord doctor",description:"run system diagnostics",usage:"overlord doctor"},{command:"overlord upgrade",description:"upgrade to the latest release",usage:"overlord upgrade"},{command:"overlord backup",description:"backup server configuration (.env) and database",usage:"overlord backup [/path/to/backup]"},{command:"overlord backup worker",description:"backup worker configuration (.env) and JWT token",usage:"overlord backup worker [/path/to/backup]"}];function o({text:a}){const[t,r]=d.useState(!1),{t:s}=n();return e.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(a),r(!0),setTimeout(()=>r(!1),2e3)},className:"rounded-[4px] p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",title:s("common.copy"),children:t?e.jsx(m,{className:"h-3 w-3 text-[var(--accent)]"}):e.jsx(v,{className:"h-3 w-3"})})}function c({title:a,commands:t}){const{t:r}=n();return e.jsxs("div",{children:[e.jsxs("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:["> ",a]}),e.jsx("div",{className:"space-y-3",children:t.map(s=>e.jsxs("details",{className:"group rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("summary",{className:"flex cursor-pointer items-center justify-between px-3 md:px-4 py-3 hover:bg-[var(--bg-input)] transition-colors",children:e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("code",{className:"text-xs text-[var(--accent)] shrink-0",children:s.command}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate",children:["// ",s.description]})]})}),e.jsxs("div",{className:"border-t border-[var(--border)] px-3 md:px-4 py-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] uppercase tracking-wider text-[var(--text-muted)]",children:r("docs.usage")}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsx("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",children:s.usage}),e.jsx(o,{text:s.usage})]})]}),s.flags&&s.flags.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] uppercase tracking-wider text-[var(--text-muted)]",children:r("docs.flags")}),e.jsx("div",{className:"space-y-1",children:s.flags.map(i=>e.jsxs("div",{className:"flex items-start gap-3 text-xs",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:i.flag}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:i.desc})]},i.flag))})]}),s.example&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] uppercase tracking-wider text-[var(--text-muted)]",children:r("docs.example")}),e.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-secondary)] whitespace-pre-wrap overflow-x-auto",children:s.example})]})]})]},s.command))})]})}function w(){const a=l(),{t}=n();return p(d.useMemo(()=>e.jsxs("button",{onClick:()=>a("/access-tokens"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(u,{className:"h-3.5 w-3.5"}),t("access_tokens.create_token")]}),[a,t])),e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("docs.cli_tools_desc",{ov:"ov",overlord:"overlord"})})}),e.jsx(x,{mode:"cli"}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("docs.quick_start")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] uppercase tracking-wider text-[var(--text-muted)]",children:"1. install"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsx("code",{className:"text-xs text-[var(--accent)] whitespace-nowrap",children:"npm install -g @overlordai/developer-cli"}),e.jsx(o,{text:"npm install -g @overlordai/developer-cli"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] uppercase tracking-wider text-[var(--text-muted)]",children:"2. setup"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"ov setup"}),e.jsx(o,{text:"ov setup"})]})]})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(c,{title:t("docs.developer_cli"),commands:g}),e.jsx(c,{title:t("docs.admin_cli"),commands:f})]}),e.jsxs("div",{className:"mt-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> ai agent skill"}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] uppercase tracking-wider text-[var(--text-muted)]",children:"install"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"npx skills add overlord-run/skill"}),e.jsx(o,{text:"npx skills add overlord-run/skill"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] uppercase tracking-wider text-[var(--text-muted)]",children:"configure"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=https://your-server.com"]}),e.jsx(o,{text:"export OVERLORD_SERVER=https://your-server.com"})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=your-token"]}),e.jsx(o,{text:"export OVERLORD_TOKEN=your-token"})]})]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// once installed, your ai agent can create tasks, check status, read logs, and manage projects on your behalf."})]})]})}export{w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as i,g as x,j as a,L as d,b as m,U as b,M as p,V as u,e as v,Y as f,Z as h}from"./index-Cxiuct-Z.js";import{A as j}from"./arrow-left-BmBtPvqR.js";const o=[{to:"/docs/cli",label:"cli",icon:m},{to:"/docs/api",label:"api",icon:b},{to:"/docs/bot",label:"bot",icon:p},{to:"/docs/skill",label:"skill",icon:u},{to:"/docs/all",label:"all",icon:v}],k=new Set(o.map(s=>s.to));function y(){const{t:s}=i(),r=x(),t=!k.has(r.pathname);return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("nav",{className:"flex items-center border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:px-6 overflow-x-auto no-scrollbar",children:[t&&a.jsxs(d,{to:"/docs/all",className:"mr-3 shrink-0 flex items-center gap-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[a.jsx(j,{size:12}),s("docs.docs_back")]}),o.map(({to:e,label:l,icon:c})=>a.jsxs(f,{to:e,className:({isActive:n})=>`flex items-center gap-1.5 px-3 py-3 text-xs lowercase border-b-2 transition-colors shrink-0 ${n||t&&e==="/docs/all"?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[a.jsx(c,{size:14}),a.jsx("span",{children:l})]},e))]}),a.jsx("main",{className:"flex-1 overflow-auto p-4 md:p-6",children:a.jsx(h,{})})]})}export{y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as O,a as D,i as M,k as S,r as T,j as e,L as u,l as L,W as j,h as x}from"./index-Cxiuct-Z.js";import{T as A}from"./TaskStatusBadge--oACnBUb.js";import{T as g}from"./Skeleton-CW5d7fJ4.js";import{O as W}from"./OnboardingGuide-CYh6h81Z.js";import{f}from"./date-BdNtiQTP.js";import{g as F}from"./status-colors-BH60BXIE.js";import{u as m}from"./useFetch-DiJtqzkU.js";import{T as $}from"./Tooltip-BQSpwoKv.js";import{A as N}from"./arrow-right-DQ5XDN6Z.js";import"./chevron-right-D5yuBhvf.js";const P=3e5,z=[{type:"fraction",numerator:"active_tasks",denominator:"queued_tasks",labelKey:"dashboard.tasks_active_queued"},{type:"simple",key:"online_workers",labelKey:"dashboard.online_workers"},{type:"simple",key:"completed_today",labelKey:"dashboard.completed_all_today"},{type:"simple",key:"completed_by_user_today",labelKey:"dashboard.completed_by_you_today"}],B=["sun","mon","tue","wed","thu","fri","sat"];function G(){const l=new Date;return Array.from({length:7},(a,c)=>{const r=new Date(l);r.setDate(r.getDate()-(6-c));const n=String(r.getMonth()+1).padStart(2,"0"),d=String(r.getDate()).padStart(2,"0");return{label:B[r.getDay()],date:`${n}/${d}`}})}function H({dailyRates:l,overallRate:a}){const{t:c}=D(),r=G(),n=Math.max(...l,1);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[a,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:c("dashboard.last_7_days")})]}),e.jsx("div",{className:"flex gap-2",style:{height:80},children:r.map(({label:d,date:p},t)=>{const i=l[t]??0,h=n>0?Math.max(i/n*100,4):4;return e.jsxs($,{content:`${d} ${p} — ${i}%`,className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("div",{className:"relative w-full h-full rounded-[4px] cursor-default",style:{backgroundColor:"rgba(34,197,94,0.1)"},children:e.jsx("div",{className:"absolute bottom-0 left-0 right-0 rounded-[4px]",style:{height:`${h}%`,backgroundColor:i>=80?"var(--accent)":i>=50?"var(--warning)":"var(--destructive)"}})}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:d})]},d)})})]})}function ae(){const l=O(),{t:a}=D(),c=M(),r=S(s=>s.taskSeq),n=S(s=>s.workerSeq),[d,p]=T.useState(0),{data:t,loading:i}=m(()=>x.get("web/dashboard/stats",{searchParams:{tz:String(new Date().getTimezoneOffset())}}).json(),[d,r,n]),{data:h,loading:I}=m(()=>x.get("web/dashboard/recent-tasks",{searchParams:{limit:"5"}}).json(),[d,r]),{data:R,loading:C}=m(()=>x.get("web/workers").json(),[d,n]),{data:K,loading:q}=m(()=>x.get("web/dashboard/recent-activity").json(),[]);T.useEffect(()=>{const s=setInterval(()=>{p(o=>o+1)},P);return()=>clearInterval(s)},[]);const y=(t==null?void 0:t.success_rate_daily)??null,_=(t==null?void 0:t.task_success_rate_7d)??0,w=h??[],b=R??[],k=K??[];function E(s){switch(s){case j.ONLINE:return a("dashboard.online");case j.DRAINING:return a("dashboard.idle");case j.OFFLINE:default:return a("dashboard.offline")}}return e.jsxs("div",{className:"mx-auto max-w-6xl overflow-hidden px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("div",{className:"mb-4 md:hidden",children:e.jsxs("span",{className:"text-base font-bold text-[var(--accent)]",children:["// ",a("dashboard.title")]})}),e.jsx("div",{className:"mb-6 md:mb-8 grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children:z.map(s=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-4",children:[e.jsxs("span",{className:"text-[11px] md:text-xs text-[var(--text-muted)]",children:[a(s.labelKey),":"]}),i?e.jsx("div",{className:"mt-1 h-6 md:h-8 w-12 md:w-16 animate-pulse rounded-[4px] bg-[var(--bg-input)]"}):e.jsx("div",{className:"mt-1 flex items-baseline gap-2",children:s.type==="fraction"?e.jsxs("span",{className:"text-2xl md:text-3xl font-bold text-[var(--text-primary)]",children:[(t==null?void 0:t[s.numerator])??0,e.jsx("span",{className:"text-base md:text-lg font-normal text-[var(--text-muted)]",children:"/"}),(t==null?void 0:t[s.denominator])??0]}):e.jsx("span",{className:"text-2xl md:text-3xl font-bold text-[var(--text-primary)]",children:(t==null?void 0:t[s.key])??0})})]},s.labelKey))}),e.jsx(W,{data:{activeTasks:((t==null?void 0:t.active_tasks)??0)+((t==null?void 0:t.queued_tasks)??0),totalWorkers:b.length,totalProjects:(t==null?void 0:t.project_count)??0,totalDevelopers:(t==null?void 0:t.developer_count)??0}}),e.jsxs("div",{className:"mb-6 grid gap-6 lg:grid-cols-3 items-stretch",children:[e.jsx("div",{className:"flex flex-col gap-6 lg:col-span-2",children:e.jsxs("div",{className:"flex flex-1 flex-col rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("div",{className:"border-b border-[var(--border)] px-5 py-3",children:e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("dashboard.task_success_rate")})}),e.jsx("div",{className:"flex flex-1 flex-col justify-center p-5",children:i?e.jsx("div",{className:"h-24 animate-pulse rounded-[4px] bg-[var(--bg-input)]"}):y?e.jsx(H,{dailyRates:y,overallRate:_}):e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[_,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("dashboard.daily_breakdown_not_available")})]})})]})}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] md:border",children:[e.jsxs("div",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("dashboard.recent_tasks")}),e.jsxs(u,{to:"/tasks",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[a("common.view_all")," ",e.jsx(N,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"flex md:hidden items-center justify-between px-3 py-3",children:e.jsx("h2",{className:"text-xs font-bold text-[var(--accent)]",children:a("dashboard.recent_tasks")})}),e.jsx("div",{className:"px-3 pb-3 md:px-5 md:pb-4 md:pt-0",children:I?e.jsx(g,{rows:4}):w.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("dashboard.no_tasks_yet")})]}):e.jsx("div",{className:"flex flex-col gap-2 md:gap-0",children:w.map(s=>e.jsxs("div",{onClick:()=>l(`/tasks/${s.id}`),className:"flex cursor-pointer items-center gap-3 rounded-[4px] border border-[var(--border)] p-3 transition-colors hover:bg-[var(--bg-input)] md:rounded-none md:border-0 md:border-b md:border-[var(--border-row)] md:p-0 md:py-2.5 last:md:border-b-0",children:[e.jsxs("div",{className:"flex-1 min-w-0 md:hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2",title:`#${s.id} ${s.name??s.description}`,children:["#",s.id," ",L(s)]}),e.jsx("span",{className:"shrink-0",children:e.jsx(A,{status:s.status})})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:f(s.createdAt)})]}),e.jsxs("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:["#",s.id]}),e.jsx("span",{className:"hidden md:inline flex-1 text-xs text-[var(--text-primary)] truncate",children:e.jsx($,{content:s.name??s.description,children:L(s,40)})}),e.jsx("span",{className:"hidden md:inline",children:e.jsx(A,{status:s.status})}),e.jsx("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:f(s.createdAt)})]},s.id))})})]})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("dashboard.worker_status")}),e.jsxs(u,{to:"/workers",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[a("common.view_all")," ",e.jsx(N,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:C?e.jsx(g,{rows:3}):b.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("dashboard.no_workers_registered")})]}):e.jsx("div",{className:"flex flex-col",children:b.map(s=>e.jsxs("div",{onClick:()=>l(`/workers/${s.id}`),className:"flex cursor-pointer items-center justify-between border-b border-[var(--border-row)] py-2.5 transition-colors hover:bg-[var(--bg-input)] last:border-b-0",children:[e.jsxs("div",{className:"min-w-0 flex-1 flex flex-col gap-0.5",children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:"truncate text-xs text-[var(--text-muted)]",children:s.host??"--"})]}),e.jsxs("div",{className:"shrink-0 flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:[s.activeSlots,"/",s.maxSlots," ",a("dashboard.slots")]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs",style:{color:F(s.status)},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),E(s.status)]})]})]},s.id))})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("dashboard.recent_activity")}),c&&e.jsxs(u,{to:"/admin/audit-logs",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[a("common.view_all")," ",e.jsx(N,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:q?e.jsx(g,{rows:4}):k.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("dashboard.no_recent_activity")})]}):e.jsx("div",{className:"flex flex-col",children:k.map(s=>{const o=s.message.match(/task\s*#?(\d+)/i),v=o?o[1]:null;return e.jsxs("div",{className:`flex min-w-0 items-start gap-3 border-b border-[var(--border-row)] py-2 last:border-b-0 ${v?"cursor-pointer hover:bg-[var(--bg-input)] transition-colors":""}`,onClick:()=>v&&l(`/tasks/${v}`),children:[e.jsx("span",{className:"shrink-0 text-xs text-[var(--text-muted)]",children:f(s.timestamp)}),e.jsx("span",{className:"min-w-0 truncate text-xs text-[var(--text-secondary)]",children:s.message})]},s.id)})})})]})]})]})}export{ae as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as A,u as F,f as T,r as s,j as e,L as z,K as I,O as K,p as $,h as p,t as c}from"./index-Cxiuct-Z.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-CUxNs9ne.js";import{u as V}from"./useFetch-DiJtqzkU.js";function Q(){var y,k,C,P;const{t:r}=A(),{logout:L}=F(),E=T(),[S,m]=s.useState(!1),{data:t,loading:U,refetch:O}=V(()=>p.get("web/profile").json(),[]),[x,u]=s.useState(""),[d,b]=s.useState(""),[f,v]=s.useState(""),[g,h]=s.useState(!1),[j,n]=s.useState(""),[i,_]=s.useState(""),[w,N]=s.useState(!1);async function D(){if(n(""),!x){n(r("profile.current_password_required"));return}if(!d){n(r("profile.new_password_required"));return}const a=M(d);if(a){n(r(a));return}if(d!==f){n(r("profile.passwords_do_not_match"));return}try{h(!0),await p.put("web/profile/password",{json:{currentPassword:x,newPassword:d}}),c.success(r("profile.password_changed")),u(""),b(""),v("")}catch(l){const q=l instanceof Error?l.message:r("profile.failed_to_change_password");n(q)}finally{h(!1)}}async function R(){if(!i||i.length!==6){c.error(r("profile.totp_code_required"));return}try{N(!0),await p.post("web/profile/totp/regenerate",{json:{code:i}}),c.success(r("profile.two_fa_regenerated")),_(""),O()}catch(a){const l=a instanceof Error?a.message:r("profile.totp_code_invalid");c.error(l)}finally{N(!1)}}return U?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")}),t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",label:r("profile.username"),value:t.name}),e.jsx(o,{variant:"fixed-label",label:r("common.role"),value:t.role}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_name"),value:t.gitName||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_email"),value:t.gitEmail||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.status"),value:t.status}),e.jsx(o,{variant:"fixed-label",label:r("profile.created_at"),value:new Date(t.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(o,{variant:"fixed-label",label:"lark",value:(y=t==null?void 0:t.platformUids)!=null&&y.lark?`${t.platformUids.lark.slice(0,12)}... ✓`:r("profile.not_linked")}),e.jsx(o,{variant:"fixed-label",label:"slack",value:(k=t==null?void 0:t.platformUids)!=null&&k.slack?`${t.platformUids.slack.slice(0,12)}... ✓`:r("profile.not_linked")})]}),(!((C=t==null?void 0:t.platformUids)!=null&&C.lark)||!((P=t==null?void 0:t.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:[j&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--destructive)]",children:j}),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:a=>u(a.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:a=>b(a.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:f,onChange:a=>v(a.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:D,disabled:g,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black disabled:opacity-50",children:r(g?"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:t!=null&&t.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")]})}),(t==null?void 0:t.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:a=>{const l=a.target.value.replace(/\D/g,"").slice(0,6);_(l)},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:R,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(z,{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(I,{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")})]})]}),e.jsxs("button",{onClick:()=>m(!0),className:"flex w-full items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--destructive)] text-left",children:[e.jsx(K,{size:16,className:"text-[var(--destructive)]"}),e.jsx("span",{className:"text-sm text-[var(--destructive)]",children:r("common.log_out")})]}),e.jsxs("div",{className:"pt-2 pb-4 text-center text-xs text-[var(--text-muted)]",children:["overlord v","1.0.124"]}),e.jsx($,{isOpen:S,onClose:()=>m(!1),onConfirm:()=>{L(),E("/login")},title:r("common.logout_title"),message:r("common.logout_message"),confirmLabel:r("common.logout"),confirmVariant:"warning"})]})}export{Q as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{c as O,a as I,j as e,p as E,x as U,f as R,u as q,i as K,r as x,E as A,q as B,l as H,F as J,h as v}from"./index-Cxiuct-Z.js";import{U as V,A as z,R as G}from"./RemoveMemberConfirmDialog-B5OQbjQg.js";import{T as Q}from"./Tooltip-BQSpwoKv.js";import{b as D}from"./date-BdNtiQTP.js";import{t as X}from"./status-colors-BH60BXIE.js";import{I as o}from"./InfoRow-CUxNs9ne.js";import{u as Y}from"./useFetch-DiJtqzkU.js";import{P as Z}from"./pencil-B01ssnBx.js";import{T as ee}from"./trash-2-BJmwr4y8.js";import{P as te}from"./plus-26O7XffR.js";import"./Select-Do5DXb3j.js";/**
|
|
2
|
-
* @license lucide-react v0.469.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const re=O("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function se({isOpen:n,onClose:l,onConfirm:r,projectName:m,loading:p}){const{t:j}=I();return e.jsx(E,{isOpen:n,onClose:l,onConfirm:r,title:`> ${j("projects.delete_project")}`,message:j("projects.delete_project_confirm",{name:m}),confirmLabel:j("projects.delete_project"),confirmVariant:"danger",isLoading:p})}function be(){const{key:n}=U(),l=R(),{t:r}=I(),m=q(t=>t.user),p=K(),[j,f]=x.useState(!1),[P,w]=x.useState(!1),[T,_]=x.useState(!1),[c,N]=x.useState(null),[$,k]=x.useState(!1),{data:a,loading:L,error:C,refetch:y}=Y(async()=>{if(!n)throw new Error("Missing project key");const[t,g,u]=await Promise.all([v.get(`web/projects/${n}`).json(),v.get(`web/projects/${n}/members`).json().catch(()=>[]),v.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(F=>F.data).catch(()=>[])]);let b=null;if(t.pipeline)try{b=JSON.parse(t.pipeline)}catch{}return{project:t,members:g,tasks:u,pipelineConfig:b}},[n]),s=(a==null?void 0:a.project)??null,h=(a==null?void 0:a.members)??[],M=(a==null?void 0:a.tasks)??[],d=(a==null?void 0:a.pipelineConfig)??null,i=p||h.some(t=>t.developerId===(m==null?void 0:m.id)&&t.role===A.MAINTAINER);B(x.useMemo(()=>s?e.jsxs(e.Fragment,{children:[i&&e.jsxs("button",{onClick:()=>l(`/projects/${s.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(Z,{className:"h-3 w-3"}),r("common.edit")]}),p&&e.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(ee,{className:"h-3 w-3"}),r("common.delete")]})]}):null,[s,i,p,l,r]));async function S(){if(s){w(!0);try{await v.delete(`admin/projects/${s.key}`),l("/projects")}catch{}finally{w(!1),f(!1)}}}async function W(){if(!(!s||!c)){k(!0);try{await v.delete(`web/projects/${s.key}/members`,{searchParams:{developerId:String(c.developerId)}}),await y()}catch{}finally{k(!1),N(null)}}}return L?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):C?e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--destructive)]",children:C}),e.jsx("button",{onClick:()=>y(),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("common.retry")})]}):s?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.key"),value:s.key}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.name"),value:s.name}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.repo_url"),value:s.repoUrl,href:s.repoUrl}),s.sshUrl&&e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.ssh_url"),value:s.sshUrl}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.git_platform"),value:s.gitPlatform}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_branch"),value:s.defaultBranch}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.agent_type"),value:s.agentType}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.max_turns"),value:String(s.maxTurns)}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.allowed_tools"),value:s.allowedTools??"all"}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_project"),value:s.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.members")}),i&&e.jsxs("button",{onClick:()=>_(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(te,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),h.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:r("projects.no_members_yet")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.added_at")}),i&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:r("common.actions")})]})}),e.jsx("tbody",{children:h.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:t.role===A.MAINTAINER?"var(--warning)":"var(--text-secondary)"},children:t.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(t.createdAt)}),i&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>N(t),className:"text-[var(--destructive)] hover:underline","aria-label":r("projects.remove_member"),children:e.jsx(V,{className:"h-3.5 w-3.5"})})})]},t.developerId))})]})})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.recent_tasks")}),M.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:r("projects.no_tasks_for_project")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.created")})]})}),e.jsx("tbody",{children:M.map(t=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>l(`/tasks/${t.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",t.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)]",children:e.jsx(Q,{content:t.name??t.description,children:H(t)})}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:X[t.status]},children:t.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(t.createdAt)})]},t.id))})]})})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:r("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),d!=null&&d.stages&&d.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:d.stages.map((t,g)=>{var u,b;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>l(`/projects/${s.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:t.label??t.name}),t.prompt&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",t.prompt.split(`
|
|
7
|
-
`)[0].slice(0,40)]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.requireConfirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:r("projects.confirm_label")})})]}),((u=t.onFailure)==null?void 0:u.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(J,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[11px] text-[var(--warning)]",children:["onFailure.goto: ",t.onFailure.goto,", maxLoops: ",t.onFailure.maxLoops]})]}),g<d.stages.length-1&&!((b=t.onFailure)!=null&&b.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(re,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},t.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:r("projects.no_pipeline_configured")}),i&&e.jsx("button",{onClick:()=>l(`/projects/${s.key}/pipeline`),className:"mt-3 flex w-full items-center justify-center gap-1.5 py-2 text-xs text-[var(--accent)] hover:text-[var(--accent)]",children:r("projects.add_stage")})]})})]}),e.jsx(se,{isOpen:j,onClose:()=>f(!1),onConfirm:S,projectName:s.name,loading:P}),e.jsx(z,{isOpen:T,onClose:()=>_(!1),projectKey:s.key,existingMemberIds:h.map(t=>t.developerId),onAdded:y}),e.jsx(G,{isOpen:!!c,onClose:()=>N(null),onConfirm:W,memberName:c?c.developerName??`#${c.developerId}`:"",loading:$})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("projects.project_not_found")}),e.jsx("button",{onClick:()=>l("/projects"),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("projects.back_to_projects")})]})}export{be as default};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{c as J,a as Q,r,h as b,j as e,M as rt,w as P,H as nt,t as V,p as be,x as lt,f as ct,y as it,o as ot,l as pe,k as qe,n as T,L as xt,X as ue,z as Ue,s as dt,G as mt}from"./index-Cxiuct-Z.js";import{u as pt,T as ut}from"./task-constants-CJk15ylu.js";import{C as ht,H as Ge,P as ze}from"./PtyTerminal-gy77drbY.js";import{a as ft,f as ae}from"./date-BdNtiQTP.js";import{S as vt}from"./Select-Do5DXb3j.js";import{a as bt}from"./status-colors-BH60BXIE.js";import{T as gt}from"./Tooltip-BQSpwoKv.js";import{A as jt}from"./arrow-left-BmBtPvqR.js";import{R as he}from"./rotate-ccw-EIYq8PBk.js";import{G as Nt}from"./git-fork-nMDIqkn8.js";import{E as yt}from"./external-link-oEMmDqkw.js";import{L as fe}from"./loader-circle-gHkPMihD.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 Ke=J("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 kt=J("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
12
|
-
* @license lucide-react v0.469.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const wt=J("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
17
|
-
* @license lucide-react v0.469.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const _t=J("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
22
|
-
* @license lucide-react v0.469.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const Ct=J("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 Be({isOpen:c,onClose:i,taskId:a,stageName:n,timeoutSeconds:t,onSubmitted:x}){const{t:o}=Q(),[g,u]=r.useState(t),[D,w]=r.useState(!1);r.useEffect(()=>{if(!c)return;u(t);const d=setInterval(()=>{u(N=>N<=1?(clearInterval(d),0):N-1)},1e3);return()=>clearInterval(d)},[c,t]),r.useEffect(()=>{g===0&&c&&i()},[g,c,i]);const $=r.useCallback(async d=>{w(!0);try{await b.post(`web/tasks/${a}/confirm-stage`,{json:{stageName:n,approved:d}}),x==null||x(),i()}catch{}finally{w(!1)}},[a,n,i,x]);return c?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(rt,{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(ht,{className:"h-3.5 w-3.5"}),ft(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:o("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:D,onClick:()=>$(!1),children:o("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:D,onClick:()=>$(!0),children:o(D?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})]}):null}function St(c,i){const a=new Date(c).getTime()-Date.now();if(a<=0)return i("tasks.tunnel_expired");const n=Math.floor(a/36e5),t=Math.floor(a%36e5/6e4);return n>0?i("tasks.tunnel_expires_hm",{h:n,m:t}):i("tasks.tunnel_expires_m",{m:t})}function We(c){switch(c){case"CONNECTED":return"var(--accent)";case"STARTING":return"var(--warning)";case"EXPIRED":return"var(--text-muted)";default:return"var(--text-muted)"}}function Xe(c,i){switch(c){case"IDLE":case"CLOSED":return i("tasks.tunnel_idle");case"STARTING":return i("tasks.tunnel_starting");case"CONNECTED":return i("tasks.tunnel_connected");case"EXPIRED":return i("tasks.tunnel_expired");case"CLOSING":return i("tasks.tunnel_closing");default:return String(c).toLowerCase()}}function Et({taskId:c,taskFinished:i,compact:a}){const{t:n}=Q(),[t,x]=r.useState(P.IDLE),[o,g]=r.useState(null),[u,D]=r.useState(null),[w,$]=r.useState(""),[d,N]=r.useState(!1),[ne,F]=r.useState(!1),A=r.useRef(null),I=r.useCallback(async()=>{try{const f=await b.get(`web/workspace-tunnel/${c}/status`).json();x(f.status),g(f.tunnelUrl??null),D(f.expiresAt??null),(f.status==="EXPIRED"||f.status==="IDLE"||f.status==="CLOSED")&&_()}catch{}},[c]);function le(){_(),A.current=setInterval(I,5e3)}function _(){A.current&&(clearInterval(A.current),A.current=null)}r.useEffect(()=>{i&&(t===P.STARTING||t===P.CONNECTED)&&(x(P.IDLE),g(null),_())},[i,t]),r.useEffect(()=>{if(t!=="CONNECTED"||!u)return;const f=()=>{const C=St(u,n);$(C),C===n("tasks.tunnel_expired")&&(x(P.EXPIRED),g(null),_())};f();const L=setInterval(f,3e4);return()=>clearInterval(L)},[t,u]),r.useEffect(()=>()=>_(),[]),r.useEffect(()=>{i||I()},[I,i]);async function z(){N(!0);try{await b.post(`web/workspace-tunnel/${c}/start`),x(P.STARTING),le()}catch(f){let L=n("tasks.tunnel_start_failed");try{if(f instanceof nt){const C=await f.response.json();C!=null&&C.error&&(L=C.error,/code.*not found|ENOENT.*code|spawn code/i.test(L)&&(L+=". "+n("tasks.tunnel_install_code_hint")))}}catch{}V.error(L)}finally{N(!1)}}async function K(){N(!0);try{await b.post(`web/workspace-tunnel/${c}/stop`),x(P.IDLE),g(null),_()}catch{}finally{N(!1)}}async function ce(){o&&(await navigator.clipboard.writeText(o),F(!0),setTimeout(()=>F(!1),2e3))}return a?e.jsxs("div",{className:"flex items-center gap-2 font-mono lowercase text-xs",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"ide_tunnel:"}),e.jsx("span",{style:{color:We(t)},children:Xe(t,n)}),(t==="IDLE"||t==="CLOSED"||t==="EXPIRED")&&e.jsx("button",{onClick:z,disabled:d,className:"rounded-[4px] px-2 py-1 text-[var(--info)] disabled:opacity-50",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:n(d?"tasks.tunnel_starting":"tasks.tunnel_start")}),t==="CONNECTED"&&o&&e.jsx("a",{href:o.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:We(t)},children:["● ",Xe(t,n)]})]}),t==="CONNECTED"&&u&&e.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["// ",w]}),t==="CONNECTED"&&o&&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:o}),e.jsxs("button",{onClick:ce,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"),"]"]})]}),ne&&e.jsx("p",{className:"mb-2 text-xs text-[var(--accent)]",children:n("tasks.tunnel_copied")}),t==="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:[(t==="IDLE"||t==="CLOSED")&&e.jsx("button",{onClick:z,disabled:d,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:n(d?"tasks.tunnel_starting_button":"tasks.tunnel_start_button")}),t==="STARTING"&&e.jsx("button",{onClick:K,disabled:d,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:n(d?"tasks.tunnel_stopping":"tasks.tunnel_cancel")}),t==="CONNECTED"&&o&&e.jsxs(e.Fragment,{children:[e.jsx("a",{href:o.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:o.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:K,disabled:d,className:"rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors disabled:opacity-50",children:n(d?"tasks.tunnel_stopping":"tasks.tunnel_stop")})]}),t==="EXPIRED"&&e.jsx("button",{onClick:z,disabled:d,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:n(d?"tasks.tunnel_starting_button":"tasks.tunnel_restart")})]})]})}function Tt({isOpen:c,onClose:i,onConfirm:a,taskId:n,isLoading:t}){const{t:x}=Q();return e.jsx(be,{isOpen:c,onClose:i,onConfirm:a,title:x("tasks.cancel_task_title"),message:x("tasks.cancel_task_message",{id:String(n)}),confirmLabel:x("tasks.cancel_task_confirm_label"),confirmVariant:"danger",isLoading:t})}function Dt({isOpen:c,onClose:i,onConfirm:a,taskId:n,mrUrl:t,isLoading:x,reuseWorkspace:o,onReuseWorkspaceChange:g}){const{t:u}=Q(),D=t?u("tasks.retry_message_with_mr",{id:String(n),url:t}):u("tasks.retry_message_without_mr",{id:String(n)});return e.jsx(be,{isOpen:c,onClose:i,onConfirm:a,title:u("tasks.retry_title"),message:D,confirmLabel:u("tasks.retry_confirm_label"),confirmVariant:"accent",isLoading:x,children:e.jsxs("label",{className:"flex items-center gap-2 mt-3 text-[var(--text-muted)] text-xs cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:w=>g(w.target.checked),className:"w-3.5 h-3.5 cursor-pointer accent-[var(--accent)]"}),u("tasks.reuse_workspace_label")]})})}function Lt(c){switch(c){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 ve({status:c}){const i=bt(c);return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-0.5 text-xs",style:{color:i},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-[3px]",style:{backgroundColor:i}}),c.toLowerCase()]})}function $t(c){let a=["implement","test","verify","review","submit"];if(c.configSnapshot)try{const t=JSON.parse(c.configSnapshot);if(t&&typeof t=="object"){const x=typeof t.pipeline=="string"?JSON.parse(t.pipeline):t.pipeline;x&&typeof x=="object"&&Array.isArray(x.stages)&&x.stages.length>0&&x.stages.every(o=>o&&typeof o=="object"&&typeof o.name=="string")&&(a=x.stages.map(o=>o.name))}}catch{}const n=c.currentStage?a.indexOf(c.currentStage):-1;return a.map((t,x)=>{let o="pending";return c.status===T.COMPLETED?o="completed":c.status===T.FAILED&&x<=n?o=x===n?"failed":"completed":n>=0&&(x<n?o="completed":x===n&&(o="running")),{name:t,status:o}})}function re(c,i){if(!c||!i)return null;const a=c.repoUrl.replace(/\.git$/,"").replace(/\/+$/,"");return c.gitPlatform===mt.GITLAB?`${a}/-/tree/${i}`:`${a}/tree/${i}`}function Bt(){var Me,Oe;const{id:c}=lt(),i=ct(),{t:a}=Q(),n=pt(s=>s.cancelTask),[t,x]=r.useState(null),[o,g]=r.useState(null),[u,D]=r.useState([]),[w,$]=r.useState(!0),[d,N]=r.useState(null),[ne,F]=r.useState(!1),[A,I]=r.useState(!1),[le,_]=r.useState(!1),[z,K]=r.useState(!1),[ce,f]=r.useState(!1),[L,C]=r.useState(!1),[ge,je]=r.useState(""),[Ne,ie]=r.useState(!1),[ye,He]=it(),[y,oe]=r.useState("terminal"),[ke,Ve]=r.useState([]),[Y,Je]=r.useState(0),[B,W]=r.useState(0),[X,we]=r.useState(""),[Z,Qe]=r.useState(""),[Ye,_e]=r.useState(!1),[Ze,Ce]=r.useState(!1),[M,Se]=r.useState(null),[S,Ee]=r.useState("disconnected"),[H,Te]=r.useState("auto"),O=r.useRef(null),De=r.useRef(null),m=Number(c),v=t?ut.includes(t.status):!1;ot(t?`#${t.id} ${pe(t,100)}`:null);const E=r.useCallback(async()=>{try{const s=await b.get(`web/tasks/${m}`).json();x(s)}catch{}},[m]),ee=r.useCallback(async()=>{try{const s=await b.get(`web/tasks/${m}/logs`).json();D(s.lines)}catch{}},[m]),q=r.useCallback(async()=>{try{const s=await b.get(`web/tasks/${m}/pending-confirm`).json();N(s.confirm)}catch{N(null)}},[m]),Le=r.useCallback(async()=>{_e(!0);try{const s=new URLSearchParams;s.set("limit","50"),s.set("offset",String(B*50)),X&&s.set("type",X),Z&&s.set("search",Z);const l=await b.get(`web/tasks/${m}/events?${s}`).json();Ve(l.events),Je(l.total)}catch{}finally{_e(!1)}},[m,B,X,Z]);r.useEffect(()=>{y==="logs"&&Le()},[y,Le]),r.useEffect(()=>{y==="pipeline"&&!v&&b.get(`web/workspaces/${m}`).json().then(Se).catch(()=>Se(null))},[y,m,v]);const U=qe(s=>s.lastEvent),$e=qe(s=>s.eventSeq);r.useEffect(()=>{$(!0),Promise.all([E(),ee(),q()]).finally(()=>$(!1))},[E,ee,q]),r.useEffect(()=>{t!=null&&t.projectKey&&b.get(`web/projects/${t.projectKey}`).json().then(g).catch(()=>g(null))},[t==null?void 0:t.projectKey]),r.useEffect(()=>{!U||$e===0||(U.event==="task_status_changed"&&U.taskId===m||U.event==="task_created"&&U.taskId===m)&&(E(),q())},[$e,U,m,E,q]),r.useEffect(()=>{if(v)return;const l=setInterval(()=>{document.visibilityState!=="hidden"&&Promise.all([E(),ee(),q()])},15e3);return()=>clearInterval(l)},[v,E,ee,q]);const Ie=r.useCallback(()=>N(null),[]),te=r.useCallback(()=>{N(null),E()},[E]);r.useEffect(()=>{ye.get("action")==="fork"&&t&&!w&&((t.status===T.COMPLETED||t.status===T.FAILED)&&Re(),He(l=>(l.delete("action"),l),{replace:!0}))},[t,w,ye]);async function et(){K(!0);try{await n(m),F(!1),await E()}finally{K(!1)}}async function tt(){f(!0);try{await b.post(`web/tasks/${m}/retry`,{json:{reuseWorkspace:Ne}}),I(!1),ie(!1),await E()}finally{f(!1)}}function Re(){je(""),_(!0)}async function st(){C(!0);try{const s=await b.post(`web/tasks/${m}/fork`,{json:{description:ge||void 0}}).json();_(!1),V.success(a("tasks.fork_success")),i(`/tasks/${s.task.id}`)}catch{V.error(a("tasks.fork_error"))}finally{C(!1)}}const j=r.useMemo(()=>t?$t(t):[],[t==null?void 0:t.configSnapshot,t==null?void 0:t.currentStage,t==null?void 0:t.status]),xe=j.findIndex(s=>s.status==="running");if(w)return e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("tasks.loading_task")})});if(!t)return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:a("tasks.task_not_found")}),e.jsxs("button",{onClick:()=>i("/tasks"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",a("tasks.back_to_tasks")]})]});const k=t.status===T.QUEUED&&t.queuePosition!=null&&t.queueTotal!=null?{position:t.queuePosition,total:t.queueTotal}:null,Pe=k?e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"queue"}),e.jsxs("span",{className:"text-[var(--info)]",children:["#",k.position," / ",k.total]})]}):null,Fe=e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>i("/tasks"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(jt,{className:"h-4 w-4"})}),e.jsxs("span",{className:"line-clamp-2 text-sm font-medium text-[var(--text-primary)]",title:`#${t.id} ${t.name??t.description}`,children:["#",t.id," ",pe(t,100)]})]}),de=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(ve,{status:t.status}),k&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsx("span",{className:"text-xs text-[var(--info)]",children:a("tasks.queue_position",{position:String(k.position),total:String(k.total)})})]}),e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs(xt,{to:`/projects/${t.projectKey}`,className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:["project: ",e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),t.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["branch: ",re(o,t.branch)?e.jsx("a",{href:re(o,t.branch),target:"_blank",rel:"noopener noreferrer",className:"text-[var(--text-primary)] hover:text-[var(--info)] hover:underline transition-colors",children:t.branch}):e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch})]})]}),t.mrUrl&&/^https?:\/\//.test(t.mrUrl)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline",children:["MR: ",((Me=t.mrUrl.match(/!?\d+$/))==null?void 0:Me[0])??"view"]})]})]}),Ae=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:()=>F(!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(ue,{className:"h-3 w-3"}),a("tasks.cancel_task")]}),t.status===T.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(he,{className:"h-3 w-3"}),a("tasks.retry_task")]}),(t.status===T.COMPLETED||t.status===T.FAILED)&&e.jsxs("button",{onClick:Re,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(Nt,{className:"h-3 w-3"}),a("tasks.fork_task")]}),t.workerId&&!v&&e.jsxs("button",{onClick:()=>{oe("pipeline"),setTimeout(()=>{var s,l;(l=(s=De.current)==null?void 0:s.scrollIntoView)==null||l.call(s,{behavior:"smooth",block:"center"})},50)},className:"hidden lg:flex items-center justify-center gap-1.5 rounded-[4px] px-3 h-8 text-[11px] font-medium text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:[e.jsx(yt,{className:"h-3 w-3"}),a("tasks.cursor_tunnel")]})]}),at=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")}),j.map(s=>{const l=s.status==="completed",p=s.status==="running",h=s.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 py-1.5 ${p?"bg-[#1a1a1a]":""}`,children:[l&&e.jsx(Ue,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),p&&e.jsx(fe,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),h&&e.jsx(ue,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),s.status==="pending"&&e.jsx(Ke,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs",style:{color:l?"var(--accent)":p?"#e5e5e5":h?"var(--destructive)":"#525252",fontWeight:p?500:400},children:p?`> ${s.name}`:s.name})]},s.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")}),u.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:u.slice(0,8).map((s,l)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},l))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]}),me=e.jsxs(e.Fragment,{children:[e.jsx(Tt,{isOpen:ne,onClose:()=>F(!1),onConfirm:et,taskId:m,isLoading:z}),e.jsx(Dt,{isOpen:A,onClose:()=>{I(!1),ie(!1)},onConfirm:tt,taskId:m,mrUrl:t.mrUrl??void 0,isLoading:ce,reuseWorkspace:Ne,onReuseWorkspaceChange:ie}),e.jsx(be,{isOpen:le,onClose:()=>_(!1),onConfirm:st,title:a("tasks.fork_task"),message:a("tasks.fork_task_desc"),confirmLabel:a("tasks.fork_task"),confirmVariant:"accent",isLoading:L,children:e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["fork of #",m]}),e.jsx("textarea",{value:ge,onChange:s=>je(s.target.value),placeholder:a("tasks.fork_description_placeholder"),rows:4,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"})]})})]});return Ze&&y==="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:[de,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] ${S==="connected"?"text-[var(--accent)]":S==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${S==="connected"?"bg-[var(--accent)]":S==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),a(`tasks.${S}`)]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!v&&H==="auto"&&e.jsxs("button",{onClick:()=>{var s;return(s=O.current)==null?void 0:s.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(Ge,{className:"h-3 w-3"}),a("tasks.take_over")]}),!v&&H==="manual"&&e.jsxs("button",{onClick:()=>{var s;return(s=O.current)==null?void 0:s.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(he,{className:"h-3 w-3"}),a("tasks.restore_auto")]}),t.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--accent)]",children:[a("tasks.stage"),": ",t.currentStage]}),e.jsx("button",{onClick:()=>Ce(!1),className:"flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1 text-[var(--text-muted)]",children:e.jsx(_t,{className:"h-3 w-3"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(ze,{ref:O,taskId:m,sessionId:t.currentSessionId??void 0,taskFinished:v,onStatusChange:Ee,onTakeoverChange:Te})}),Ae,me]}):t.status===T.SUSPENDED?e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[Fe,de,e.jsx("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0",style:{backgroundColor:"rgba(245,158,11,0.08)",borderColor:"rgba(245,158,11,0.2)",color:"var(--warning)"},children:a("tasks.task_suspended_banner")}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row gap-4 md:gap-6 p-4 md:p-6 overflow-y-auto",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[e.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[e.jsxs("span",{className:"text-xl font-bold text-[var(--text-primary)]",children:["#",t.id]}),e.jsx("span",{className:"text-base text-[var(--text-secondary)] truncate max-w-[60%]",children:e.jsx(gt,{content:t.name??t.description,children:pe(t,200)})}),e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children: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")})}),d&&e.jsxs("div",{className:"rounded-[4px] border p-4",style:{borderColor:"rgba(245,158,11,0.27)",backgroundColor:"#1a1a1a"},children:[e.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:a("tasks.pending_confirmation")}),e.jsx("p",{className:"mb-3 text-xs text-[var(--text-secondary)]",children:d.prompt??a("tasks.pipeline_requires_confirmation")}),e.jsx("div",{className:"mb-3 flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"stage"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:d.stageName})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:flex-wrap md:gap-3",children:[e.jsx("button",{onClick:async()=>{try{await b.post(`web/tasks/${m}/confirm-stage`,{json:{stageName:d.stageName,approved:!0}}),te()}catch{V.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 b.post(`web/tasks/${m}/confirm-stage`,{json:{stageName:d.stageName,approved:!1}}),te()}catch{V.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:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:ae(t.createdAt)})]})]})]}),e.jsx("div",{className:"hidden md:flex flex-wrap items-center gap-2 py-2",children:j.map((s,l)=>{const p=s.status==="failed",h=s.status==="completed",R=s.status==="running"&&t.status===T.SUSPENDED,G=p?"var(--destructive)":h?"var(--accent)":R?"var(--warning)":"#525252",se=p?"rgba(239,68,68,0.12)":h?"rgba(34,197,94,0.12)":R?"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:G,backgroundColor:se,fontWeight:R?700:400,border:R?`1px solid ${G}`:void 0},children:R?"confirm":`${s.name}${h?" ✓":p?" ✗":""}`}),l<j.length-1&&e.jsx("div",{className:"h-px w-6 bg-[var(--border)]"})]},s.name)})}),e.jsxs("div",{className:"hidden md:block min-h-[200px] flex-1 rounded-[4px] border border-[var(--border)] bg-[#0c0c0c] p-4",children:[e.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:a("tasks.pty_output")}),e.jsxs("div",{className:"flex flex-col gap-1",children:[u.slice(-10).map((s,l)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-secondary)]",children:s},l)),u.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:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:a("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2",children:j.map(s=>{const l=s.status==="completed"?"var(--info)":s.status==="failed"?"var(--destructive)":s.status==="running"?"var(--warning)":"#525252",p=s.status==="failed"?"var(--destructive)":s.status==="running"?"var(--warning)":"#a3a3a3",h=s.status==="completed"?"completed":s.status==="running"?"suspended":s.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[4px]",style:{backgroundColor:l}}),e.jsxs("span",{className:"text-[11px]",style:{color:p,fontWeight:s.status==="running"?700:400},children:[s.name," ",h]})]},s.name)})}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsx("div",{className:"flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:ae(t.createdAt)})]})})]})]}),d&&e.jsx(Be,{isOpen:!!d,onClose:Ie,taskId:m,stageName:d.stageName,timeoutSeconds:Math.ceil(d.timeout/1e3),onSubmitted:te}),me]}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden font-mono lowercase",children:[Fe,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(ve,{status:t.status}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:t.projectKey}),t.workerName&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:t.workerName}),t.branch&&(re(o,t.branch)?e.jsx("a",{href:re(o,t.branch),target:"_blank",rel:"noopener noreferrer",className:"shrink-0 text-[11px] text-[var(--text-muted)] hover:text-[var(--info)] hover:underline truncate max-w-[80px] md:max-w-[120px] transition-colors",children:t.branch}):e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)] truncate max-w-[80px] md:max-w-[120px]",children:t.branch}))]}),de,t.errorMessage&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-6 py-2 text-xs shrink-0 bg-[var(--destructive)]/10 text-[var(--destructive)]",style:{borderColor:"rgba(239,68,68,0.2)"},children:["// error: ",t.errorMessage]}),k&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0 text-[var(--info)]",style:{backgroundColor:"color-mix(in srgb, var(--info) 8%, transparent)",borderColor:"color-mix(in srgb, var(--info) 20%, transparent)"},children:[e.jsx(kt,{className:"h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{children:[a("tasks.queue_position_banner",{position:String(k.position),total:String(k.total)}),k.position>1?` — ${a("tasks.queue_ahead",{count:String(k.position-1)})}`:` — ${a("tasks.queue_next")}`]})]}),d&&e.jsx(Be,{isOpen:!!d,onClose:Ie,taskId:m,stageName:d.stageName,timeoutSeconds:Math.ceil(d.timeout/1e3),onSubmitted:te}),e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"flex items-center border-b border-[var(--border)] shrink-0 overflow-x-auto no-scrollbar",children:["terminal","pipeline","logs"].map(s=>e.jsx("button",{onClick:()=>oe(s),className:`shrink-0 whitespace-nowrap px-4 py-2.5 text-xs transition-colors ${y===s?"border-b-2 border-[var(--accent)] text-[var(--accent)] font-medium":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(s==="terminal"?"tasks.terminal":s==="pipeline"?"tasks.pipeline_tab":"tasks.logs")},s))}),y==="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] ${S==="connected"?"text-[var(--accent)]":S==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${S==="connected"?"bg-[var(--accent)]":S==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),a(`tasks.${S}`)]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!v&&H==="auto"&&e.jsxs("button",{onClick:()=>{var s;return(s=O.current)==null?void 0:s.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(Ge,{className:"h-3 w-3"}),a("tasks.take_over")]}),!v&&H==="manual"&&e.jsxs("button",{onClick:()=>{var s;return(s=O.current)==null?void 0:s.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(he,{className:"h-3 w-3"}),a("tasks.restore_auto")]}),!v&&H==="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(fe,{className:"h-3 w-3 animate-spin"}),a("tasks.requesting_takeover")]}),!v&&t.currentStage&&e.jsxs("button",{className:"hidden md:flex items-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-2.5 h-10 md:h-8 text-[11px] text-[var(--text-muted)]",children:[e.jsx(Ct,{className:"h-3 w-3"}),a("tasks.skip_stage")]}),e.jsx("button",{onClick:()=>Ce(!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(wt,{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(ve,{status:t.status}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["on ",t.workerName]})]}),e.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.stage_progress")}),e.jsx("div",{className:"mt-2 overflow-x-auto no-scrollbar pr-4",style:{borderRadius:0},children:e.jsx("div",{className:"flex items-center gap-1 py-0.5",children:j.map((s,l)=>{const p=s.status==="completed",h=s.status==="running",G=s.status==="failed"?"var(--destructive)":p||h?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"shrink-0 text-[11px] leading-normal whitespace-nowrap",style:{color:G,fontWeight:h?600:400},children:[s.name,p?" ✓":h?" ...":""]}),l<j.length-1&&e.jsx("div",{className:"mx-1.5 h-px w-4 shrink-0",style:{backgroundColor:G}})]},s.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 overflow-hidden",children:e.jsx(ze,{ref:O,taskId:m,sessionId:t.currentSessionId??void 0,taskFinished:v,onStatusChange:Ee,onTakeoverChange:Te})}),Ae]}),y==="pipeline"&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("div",{className:"mb-4 md:mb-5 overflow-x-auto no-scrollbar",style:{borderRadius:0},children:e.jsx("div",{className:"flex items-center py-5",children:j.map((s,l)=>{const p=s.status==="completed",h=s.status==="running",se=s.status==="failed"?"var(--destructive)":p||h?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",style:{flex:l<j.length-1?1:void 0},children:[e.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[e.jsxs("div",{className:"flex h-6 w-6 md:h-7 md:w-7 items-center justify-center rounded-full shrink-0",style:{backgroundColor:se},children:[p&&e.jsx("span",{className:"text-[11px] md:text-xs font-semibold text-[#0c0c0c]",children:"✓"}),h&&e.jsx("span",{className:"h-2 w-2 md:h-2.5 md:w-2.5 rounded-full bg-[#0c0c0c]"})]}),e.jsx("span",{className:"text-[11px] leading-normal font-medium whitespace-nowrap",style:{color:se},children:s.name})]}),l<j.length-1&&e.jsx("div",{className:"mx-1 md:mx-2 h-0.5 flex-1 min-w-3 rounded-full",style:{backgroundColor:l<(xe>=0?xe:0)?"var(--accent)":"#525252"}})]},s.name)})})}),t.currentStage&&e.jsxs("div",{className:"mb-4 md:mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 text-xs leading-relaxed",children:[e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// stage: ",t.currentStage," (",xe+1,"/",j.length,")"]}),t.startedAt&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",ae(t.startedAt).replace(" ago","")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// retries: ",t.retryCount,"/2"]})]}),e.jsx("button",{onClick:()=>oe("terminal"),className:"flex-1 min-h-[100px] rounded-[4px] border border-dashed border-[var(--border)] flex items-center justify-center gap-2 text-[11px] text-[var(--text-muted)] hover:border-[var(--accent)] hover:text-[var(--accent)] transition-colors",children:e.jsxs("span",{children:["// ",a("tasks.view_terminal")]})}),e.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"branch"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch??"-"})]}),Pe]})]}),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")}),j.map(s=>{const l=s.status==="completed",p=s.status==="running",h=s.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 py-2 ${p?"bg-[var(--bg-input)]":""}`,children:[l&&e.jsx(Ue,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),p&&e.jsx(fe,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),h&&e.jsx(ue,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),s.status==="pending"&&e.jsx(Ke,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs leading-normal",style:{color:l?"var(--accent)":p?"var(--text-primary)":h?"var(--destructive)":"#525252",fontWeight:p?500:400},children:p?`> ${s.name}`:s.name})]},s.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")}),u.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:u.slice(-12).map((s,l)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},l))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]})]}),y==="logs"&&e.jsxs("div",{className:"flex flex-1 flex-col gap-3 md:gap-5 overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)] md:hidden",children:a("tasks.task_logs")}),e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:gap-3",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar md:hidden",children:["","error","system"].map(s=>e.jsx("button",{onClick:()=>{we(s),W(0)},className:`shrink-0 rounded-[4px] px-2.5 py-1 text-[11px] ${X===s?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)]"}`,children:s||"all"},s))}),e.jsx("div",{className:"hidden md:block",children:e.jsx(vt,{value:X,onChange:s=>{we(s),W(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(dt,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("tasks.search_logs"),value:Z,onChange:s=>{Qe(s.target.value),W(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:[ke.map((s,l)=>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 ${l%2===0?"bg-[var(--bg-card)]":""}`,children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:new Date(s.timestamp).toLocaleTimeString("en-US",{hour12:!1})}),e.jsx("span",{className:`shrink-0 font-medium ${Lt(s.type)}`,children:s.type}),e.jsx("span",{className:"min-w-0 break-words md:truncate text-[var(--text-primary)]",children:s.message})]},s.id)),ke.length===0&&!Ye&&e.jsx("p",{className:"py-8 text-center text-xs text-[var(--text-muted)]",children:a("tasks.no_log_entries")})]}),Y>50&&e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[Array.from({length:Math.ceil(Y/50)}).slice(0,5).map((s,l)=>e.jsx("button",{onClick:()=>W(l),className:`rounded-[4px] px-2 py-1 text-xs ${B===l?"bg-[var(--accent)] text-black font-medium":"text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:l+1},l)),Math.ceil(Y/50)>5&&e.jsx("button",{onClick:()=>W(B+1),disabled:B>=Math.ceil(Y/50)-1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] disabled:opacity-30",children:">"})]})]})]}),y==="terminal"&&at,y==="pipeline"&&e.jsxs("div",{className:"hidden w-[420px] shrink-0 flex-col gap-5 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-5 lg:flex",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"creator"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.creatorName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("common.created_at")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:ae(t.createdAt)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.agentType??"claude"})]}),Pe]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.workspace_section")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[e.jsxs("div",{className:"flex min-w-0 justify-between",children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:"branch"}),e.jsx("span",{className:"ml-4 min-w-0 truncate text-[var(--text-primary)]",children:t.branch??(M==null?void 0:M.branch)??"-"})]}),e.jsxs("div",{className:"flex min-w-0 justify-between",children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:"worktree"}),e.jsx("span",{className:"ml-4 min-w-0 truncate text-[var(--text-primary)]",children:(M==null?void 0:M.path)??"-"})]}),t.mrUrl&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("tasks.mr_link")}),e.jsx("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-[var(--info)] hover:underline",children:((Oe=t.mrUrl.match(/!?\d+$/))==null?void 0:Oe[0])??"view"})]})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{ref:De,className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:a("tasks.cursor_tunnel_section")}),t.workerId?e.jsx(Et,{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:j.map(s=>{const l=s.status==="completed"?"✓":s.status==="running"?"→":"·",p=s.status==="running"?"var(--accent)":s.status==="completed"?"var(--info)":s.status==="failed"?"var(--destructive)":"#525252",h=s.status==="completed"?"done":s.status==="running"?"running...":s.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-semibold",style:{color:p},children:l}),e.jsx("span",{className:s.status==="running"?"font-medium":"",style:{color:p},children:s.name}),e.jsxs("span",{className:"text-[11px]",style:{color:"#525252"},children:["— ",h]})]},s.name)})})]})]})]}),me]})}export{Bt as default};
|