@overlordai/server 1.0.133 → 1.0.134
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/database/migrations/007-worker-capability-state.sql +5 -0
- package/dist/database/repositories/worker.repository.d.ts +12 -0
- package/dist/database/repositories/worker.repository.d.ts.map +1 -1
- package/dist/database/repositories/worker.repository.js +40 -0
- package/dist/database/repositories/worker.repository.js.map +1 -1
- package/dist/dispatcher/capability.service.d.ts +20 -7
- package/dist/dispatcher/capability.service.d.ts.map +1 -1
- package/dist/dispatcher/capability.service.js +171 -42
- package/dist/dispatcher/capability.service.js.map +1 -1
- package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
- package/dist/dispatcher/scheduler.service.js +58 -15
- package/dist/dispatcher/scheduler.service.js.map +1 -1
- package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
- package/dist/dispatcher/task-creation.service.js +3 -1
- package/dist/dispatcher/task-creation.service.js.map +1 -1
- package/dist/dispatcher/worker-selector.d.ts +4 -0
- package/dist/dispatcher/worker-selector.d.ts.map +1 -1
- package/dist/dispatcher/worker-selector.js +9 -0
- package/dist/dispatcher/worker-selector.js.map +1 -1
- package/dist/web/frame-handlers/progress.handler.d.ts +3 -1
- package/dist/web/frame-handlers/progress.handler.d.ts.map +1 -1
- package/dist/web/frame-handlers/progress.handler.js +41 -5
- package/dist/web/frame-handlers/progress.handler.js.map +1 -1
- package/dist/web/worker-channel.gateway.d.ts +3 -1
- package/dist/web/worker-channel.gateway.d.ts.map +1 -1
- package/dist/web/worker-channel.gateway.js +5 -2
- package/dist/web/worker-channel.gateway.js.map +1 -1
- package/dist/web/worker-web.controller.d.ts +161 -5
- package/dist/web/worker-web.controller.d.ts.map +1 -1
- package/dist/web/worker-web.controller.js +69 -9
- package/dist/web/worker-web.controller.js.map +1 -1
- package/package.json +4 -4
- package/public/assets/{AccessTokensPage-B_di-j0j.js → AccessTokensPage-BoVgUrzP.js} +1 -1
- package/public/assets/AdminPage-P2z0Fl0Y.js +1 -0
- package/public/assets/{AgentCliPage-CiSE6MOL.js → AgentCliPage-C7GiYV6z.js} +2 -2
- package/public/assets/{ApiReferencePage-Cv1THMOi.js → ApiReferencePage-Kzj97VkN.js} +1 -1
- package/public/assets/{ArchitecturePage-H1WtP2sH.js → ArchitecturePage-Dj1I7Lif.js} +1 -1
- package/public/assets/{AuditLogPage-Q-izWOoJ.js → AuditLogPage-D1OTE5S1.js} +1 -1
- package/public/assets/{BindPlatformPage-S-s2YO1G.js → BindPlatformPage-CUbHhfZo.js} +1 -1
- package/public/assets/{BotIntegrationPage-CzgR3bDN.js → BotIntegrationPage-Cz1-B_ag.js} +1 -1
- package/public/assets/{BotManage-Cmb0u2y7.js → BotManage-DGCb_1uD.js} +1 -1
- package/public/assets/{BotSetupPage-DCuRv9lx.js → BotSetupPage-DEj-NMfd.js} +1 -1
- package/public/assets/{ChangelogPage-DGVNwh9w.js → ChangelogPage-DerOZcUF.js} +1 -1
- package/public/assets/{CliReferencePage-DKZZacin.js → CliReferencePage-kHDw2pA7.js} +1 -1
- package/public/assets/{DeploymentPage-Cd_K6k-C.js → DeploymentPage-B5XPM33m.js} +1 -1
- package/public/assets/{DevWorkflowPage-DY1Kcsg7.js → DevWorkflowPage-CdyR3M_a.js} +1 -1
- package/public/assets/{DeveloperManage-BnhZ_Aqp.js → DeveloperManage-CADxGSzH.js} +1 -1
- package/public/assets/{DeveloperSetupPage-C3519X2U.js → DeveloperSetupPage-TGy2mo4p.js} +1 -1
- package/public/assets/{DocsIndexPage-BXNlGsUi.js → DocsIndexPage-CKLFPHA9.js} +6 -11
- package/public/assets/DocsLayout-j09z0-2-.js +1 -0
- package/public/assets/{DocsPrimitives-DNdGlGlH.js → DocsPrimitives-BjKzQarf.js} +1 -1
- package/public/assets/EditProjectPage-YrALdZ6_.js +2 -0
- package/public/assets/{EmptyState-9Eqw0iR8.js → EmptyState-c4IsGUGS.js} +1 -1
- package/public/assets/{EnvVariablesPage-Cddaji3m.js → EnvVariablesPage-DUV5GbgH.js} +1 -1
- package/public/assets/HomePage-Bd0qbwuy.js +1 -0
- package/public/assets/{InfoRow-C3ZXZz4q.js → InfoRow-OjQK-lfD.js} +1 -1
- package/public/assets/{InstallationPage-BTbG8z22.js → InstallationPage-QKu8ZH_9.js} +1 -1
- package/public/assets/{LandingPage-DpdvNKYz.js → LandingPage-9OL5ViAD.js} +1 -1
- package/public/assets/{LocalDevelopmentPage-CqPNGlUK.js → LocalDevelopmentPage-DktRuJdo.js} +1 -1
- package/public/assets/{LoginPage-CzJDQ0H0.js → LoginPage-zjkljmUG.js} +1 -1
- package/public/assets/{MetricBar-CixGVqjI.js → MetricBar-Ct-6XoF8.js} +1 -1
- package/public/assets/{NotFoundPage-DdxosdYc.js → NotFoundPage-DpUSdTHq.js} +1 -1
- package/public/assets/{OnboardingGuide-C1-sQUW7.js → OnboardingGuide-DniYFVLU.js} +1 -1
- package/public/assets/{PermissionsPage-Db7ynPhr.js → PermissionsPage-AtbdWCh6.js} +1 -1
- package/public/assets/{PipelineConfigPage-DM_btq4K.js → PipelineConfigPage-ByKxXAqM.js} +1 -1
- package/public/assets/{PipelineEditorPage-CAO4j2sA.js → PipelineEditorPage-BmkHpPoJ.js} +1 -1
- package/public/assets/ProfilePage-D3DWeoQM.js +1 -0
- package/public/assets/{ProjectDetailPage-B9my9oLw.js → ProjectDetailPage-DcxPgXCF.js} +1 -1
- package/public/assets/ProjectListPage-B2LJx5SB.js +6 -0
- package/public/assets/{PtyTerminal-C9Bp0uS_.js → PtyTerminal-BQ2UYeLe.js} +1 -1
- package/public/assets/{QuickAuth-C1XxLYNZ.js → QuickAuth-DbXnLBbA.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-gohLNDc5.js → RemoveMemberConfirmDialog-DgXwrcbD.js} +1 -1
- package/public/assets/{Select-CkMgU0Lq.js → Select-CKozUJa5.js} +1 -1
- package/public/assets/{SettingsPage-Crc4EZDF.js → SettingsPage-Dc7kQQ-U.js} +1 -1
- package/public/assets/{Skeleton-DI-HCY-N.js → Skeleton-1CByoX9G.js} +1 -1
- package/public/assets/{SkillPage-SmsZWW8c.js → SkillPage-C5bC1S4B.js} +1 -1
- package/public/assets/TaskDetailPage-Bci7hNZD.js +26 -0
- package/public/assets/TaskListPage-CysAqfJ7.js +1 -0
- package/public/assets/{TaskStatusBadge-B49xL6ug.js → TaskStatusBadge-BQr1iwes.js} +1 -1
- package/public/assets/TerminalHomePage-AG4elUye.js +11 -0
- package/public/assets/TokenManage-CaQAVdV3.js +1 -0
- package/public/assets/{Tooltip-DrIj1IXL.js → Tooltip-D_CBrTO_.js} +1 -1
- package/public/assets/{TotpSetupPage-B81U1CZB.js → TotpSetupPage-hm7e8ja5.js} +1 -1
- package/public/assets/WorkerDetailPage-B1Dx_37R.js +1 -0
- package/public/assets/WorkerListPage-BS3r46aW.js +6 -0
- package/public/assets/{WorkerOperationsPage-CcfPJ-Vx.js → WorkerOperationsPage-EplOzeIS.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-C_GA4jv_.js → WorkerSetupGuidePage-Bj7AFF_z.js} +1 -1
- package/public/assets/{WorkerSetupPage-hV7T8eEi.js → WorkerSetupPage-C3mkq4zM.js} +1 -1
- package/public/assets/agent-type-options-DUkN669t.js +1 -0
- package/public/assets/{arrow-left-BwtdfCwD.js → arrow-left-BPE0QXvK.js} +1 -1
- package/public/assets/{arrow-right-BQPypZRF.js → arrow-right-BdXr5iFo.js} +1 -1
- package/public/assets/{bot-3i2pb58N.js → bot-CNZBTp4c.js} +1 -1
- package/public/assets/{chevron-left-6cPJJmnY.js → chevron-left-BhcTbOUx.js} +1 -1
- package/public/assets/{chevron-right-DxtB9dXk.js → chevron-right-BuhDQxo4.js} +1 -1
- package/public/assets/{copy-BckVr8cJ.js → copy-cloBpe4U.js} +1 -1
- package/public/assets/{download-DnrLGHSN.js → download-BxlPrmML.js} +1 -1
- package/public/assets/{external-link-BWs-24k_.js → external-link-Clr8ygf6.js} +1 -1
- package/public/assets/file-text-KFjDZaJL.js +6 -0
- package/public/assets/{git-fork-DxuKN6TL.js → git-fork-CBlyXbge.js} +1 -1
- package/public/assets/index-D6SjJWkw.css +1 -0
- package/public/assets/{index-D3ZK8e35.js → index-DJl-vKpg.js} +28 -28
- package/public/assets/{key-BjxaakEN.js → key-BwIOi-0U.js} +1 -1
- package/public/assets/{loader-circle-fKTUhuFx.js → loader-circle-CF4O3sgn.js} +1 -1
- package/public/assets/{pencil-BGn762Xd.js → pencil-BKwPd_Fv.js} +1 -1
- package/public/assets/{plus-DfeF35ew.js → plus-Dy384KeJ.js} +1 -1
- package/public/assets/{rotate-ccw-DnJi9esb.js → rotate-ccw-BqKuF1OZ.js} +1 -1
- package/public/assets/{scroll-text-CDAXkr64.js → scroll-text-BQnKZlDZ.js} +1 -1
- package/public/assets/{settings-BQ40mw10.js → settings-iP7F66C4.js} +1 -1
- package/public/assets/{status-colors-BgploKhY.js → status-colors-D3fj6h6e.js} +1 -1
- package/public/assets/task-constants-q2zc7hX5.js +1 -0
- package/public/assets/{trash-2-B6XaTY-0.js → trash-2-CYF0CqNA.js} +1 -1
- package/public/assets/{useFetch-CSoNR_l8.js → useFetch-CyCGABKu.js} +1 -1
- package/public/assets/{users-DI9FgcZa.js → users-BQ-sAhp6.js} +1 -1
- package/public/assets/{wifi-D9JcPn5X.js → wifi-DKdwzLvS.js} +1 -1
- package/public/assets/{workflow-DRETOaoe.js → workflow-DlF_hAtY.js} +1 -1
- package/public/index.html +2 -2
- package/public/sw.js +1 -1
- package/public/assets/AdminPage-DIyGC-b1.js +0 -1
- package/public/assets/DocsLayout-CZh1AEB5.js +0 -1
- package/public/assets/EditProjectPage-BMsLYq9D.js +0 -2
- package/public/assets/HomePage-CRZSG4wX.js +0 -1
- package/public/assets/ProfilePage-5b64UEF7.js +0 -1
- package/public/assets/ProjectListPage-D0ArUg7q.js +0 -6
- package/public/assets/TaskDetailPage-cjzjPYPW.js +0 -26
- package/public/assets/TaskListPage-BCj8HmhB.js +0 -1
- package/public/assets/TerminalHomePage-BmShj9-L.js +0 -11
- package/public/assets/TokenManage-CXGZwaVK.js +0 -1
- package/public/assets/WorkerDetailPage-D3l1CEg-.js +0 -1
- package/public/assets/WorkerListPage-CR3ptj-n.js +0 -6
- package/public/assets/index-DMWyyiI3.css +0 -1
- package/public/assets/task-constants-eOji5WUw.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as r,p as e,
|
|
1
|
+
import{W as r,p as e,a2 as s,a3 as u,Z as a}from"./index-DJl-vKpg.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 i,h as n,p as c,F as k}from"./index-DJl-vKpg.js";import{g as T}from"./agent-type-options-DUkN669t.js";const b=i((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 f=await n.get("web/tasks",{searchParams:e,signal:o.signal}).json();if(r()._fetchTasksRequestId!==l)return;t({tasks:f.data,nextCursor:f.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 n.get(`web/tasks/${a}`).json();t({currentTask:s})}catch(s){t({error:s instanceof Error?s.message:"Failed to fetch task"})}finally{t({loading:!1})}},createTask:async a=>{t({error:null});try{const s=await n.post("web/tasks",{json:a}).json();return t(o=>({tasks:[s,...o.tasks]})),s}catch(s){throw t({error:s instanceof Error?s.message:"Failed to create task"}),s}},cancelTask:async a=>{t({error:null});try{await n.post(`web/tasks/${a}/cancel`);const{currentTask:s}=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})}})),p=[c.COMPLETED,c.FAILED,c.CANCELLED],E=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],d=T(t=>t);[...d];function _(t){return(t??k.CLAUDE).toLowerCase()}export{p as T,E as a,_ as g,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-DJl-vKpg.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-DJl-vKpg.js"></script>
|
|
32
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D6SjJWkw.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 o={};const u=s=>l(s,r),a={module:{uri:r},exports:o,require:u};e[r]=Promise.all(i.map(s=>a[s]||u(s))).then(s=>(n(...s),o))}}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:"34e61dd170335e5d86dd7e2e8a60f08b"},{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-DlF_hAtY.js",revision:null},{url:"assets/wifi-DKdwzLvS.js",revision:null},{url:"assets/users-BQ-sAhp6.js",revision:null},{url:"assets/useFetch-CyCGABKu.js",revision:null},{url:"assets/trash-2-CYF0CqNA.js",revision:null},{url:"assets/task-constants-q2zc7hX5.js",revision:null},{url:"assets/status-colors-D3fj6h6e.js",revision:null},{url:"assets/settings-iP7F66C4.js",revision:null},{url:"assets/scroll-text-BQnKZlDZ.js",revision:null},{url:"assets/rotate-ccw-BqKuF1OZ.js",revision:null},{url:"assets/plus-Dy384KeJ.js",revision:null},{url:"assets/pencil-BKwPd_Fv.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-CF4O3sgn.js",revision:null},{url:"assets/key-BwIOi-0U.js",revision:null},{url:"assets/index-DJl-vKpg.js",revision:null},{url:"assets/index-D6SjJWkw.css",revision:null},{url:"assets/git-fork-CBlyXbge.js",revision:null},{url:"assets/file-text-KFjDZaJL.js",revision:null},{url:"assets/external-link-Clr8ygf6.js",revision:null},{url:"assets/download-BxlPrmML.js",revision:null},{url:"assets/date-RFA7-ZGs.js",revision:null},{url:"assets/copy-cloBpe4U.js",revision:null},{url:"assets/chevron-right-BuhDQxo4.js",revision:null},{url:"assets/chevron-left-BhcTbOUx.js",revision:null},{url:"assets/bot-CNZBTp4c.js",revision:null},{url:"assets/arrow-right-BdXr5iFo.js",revision:null},{url:"assets/arrow-left-BPE0QXvK.js",revision:null},{url:"assets/agent-type-options-DUkN669t.js",revision:null},{url:"assets/WorkerSetupPage-C3mkq4zM.js",revision:null},{url:"assets/WorkerSetupGuidePage-Bj7AFF_z.js",revision:null},{url:"assets/WorkerOperationsPage-EplOzeIS.js",revision:null},{url:"assets/WorkerListPage-BS3r46aW.js",revision:null},{url:"assets/WorkerDetailPage-B1Dx_37R.js",revision:null},{url:"assets/TotpSetupPage-hm7e8ja5.js",revision:null},{url:"assets/Tooltip-D_CBrTO_.js",revision:null},{url:"assets/TokenManage-CaQAVdV3.js",revision:null},{url:"assets/TerminalHomePage-AG4elUye.js",revision:null},{url:"assets/TaskStatusBadge-BQr1iwes.js",revision:null},{url:"assets/TaskListPage-CysAqfJ7.js",revision:null},{url:"assets/TaskDetailPage-Bci7hNZD.js",revision:null},{url:"assets/SkillPage-C5bC1S4B.js",revision:null},{url:"assets/Skeleton-1CByoX9G.js",revision:null},{url:"assets/SettingsPage-Dc7kQQ-U.js",revision:null},{url:"assets/Select-CKozUJa5.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-DgXwrcbD.js",revision:null},{url:"assets/QuickAuth-DbXnLBbA.js",revision:null},{url:"assets/PtyTerminal-Beg8tuEN.css",revision:null},{url:"assets/PtyTerminal-BQ2UYeLe.js",revision:null},{url:"assets/ProjectListPage-B2LJx5SB.js",revision:null},{url:"assets/ProjectDetailPage-DcxPgXCF.js",revision:null},{url:"assets/ProfilePage-D3DWeoQM.js",revision:null},{url:"assets/PipelineEditorPage-BmkHpPoJ.js",revision:null},{url:"assets/PipelineConfigPage-ByKxXAqM.js",revision:null},{url:"assets/PermissionsPage-AtbdWCh6.js",revision:null},{url:"assets/OnboardingGuide-DniYFVLU.js",revision:null},{url:"assets/NotFoundPage-DpUSdTHq.js",revision:null},{url:"assets/MetricBar-Ct-6XoF8.js",revision:null},{url:"assets/LoginPage-zjkljmUG.js",revision:null},{url:"assets/LocalDevelopmentPage-DktRuJdo.js",revision:null},{url:"assets/LandingPage-9OL5ViAD.js",revision:null},{url:"assets/InstallationPage-QKu8ZH_9.js",revision:null},{url:"assets/InfoRow-OjQK-lfD.js",revision:null},{url:"assets/HomePage-Bd0qbwuy.js",revision:null},{url:"assets/EnvVariablesPage-DUV5GbgH.js",revision:null},{url:"assets/EmptyState-c4IsGUGS.js",revision:null},{url:"assets/EditProjectPage-YrALdZ6_.js",revision:null},{url:"assets/DocsPrimitives-BjKzQarf.js",revision:null},{url:"assets/DocsLayout-j09z0-2-.js",revision:null},{url:"assets/DocsIndexPage-CKLFPHA9.js",revision:null},{url:"assets/DeveloperSetupPage-TGy2mo4p.js",revision:null},{url:"assets/DeveloperManage-CADxGSzH.js",revision:null},{url:"assets/DevWorkflowPage-CdyR3M_a.js",revision:null},{url:"assets/DeploymentPage-B5XPM33m.js",revision:null},{url:"assets/CliReferencePage-kHDw2pA7.js",revision:null},{url:"assets/ChangelogPage-DerOZcUF.js",revision:null},{url:"assets/BotSetupPage-DEj-NMfd.js",revision:null},{url:"assets/BotManage-DGCb_1uD.js",revision:null},{url:"assets/BotIntegrationPage-Cz1-B_ag.js",revision:null},{url:"assets/BindPlatformPage-CUbHhfZo.js",revision:null},{url:"assets/AuditLogPage-D1OTE5S1.js",revision:null},{url:"assets/ArchitecturePage-Dj1I7Lif.js",revision:null},{url:"assets/ApiReferencePage-Kzj97VkN.js",revision:null},{url:"assets/AgentCliPage-C7GiYV6z.js",revision:null},{url:"assets/AdminPage-P2z0Fl0Y.js",revision:null},{url:"assets/AccessTokensPage-BoVgUrzP.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:"e3100788a89f54481dbd663d57df57a6"}],{}),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,U as d,j as t,$ as m,a0 as l}from"./index-D3ZK8e35.js";import{U as c}from"./users-DI9FgcZa.js";import{B as b}from"./bot-3i2pb58N.js";import{S as p}from"./scroll-text-CDAXkr64.js";import{S as x}from"./settings-BQ40mw10.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{a as i,g as x,j as a,L as d,b as m,Z as b,M as p,_ as u,e as v,$ as f,a0 as h}from"./index-D3ZK8e35.js";import{A as j}from"./arrow-left-BwtdfCwD.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,2 +0,0 @@
|
|
|
1
|
-
import{A as xe,f as ue,a as me,r as s,G as v,F as j,h as d,j as e,L as be,J as Y,t as c}from"./index-D3ZK8e35.js";import{S as Z}from"./Select-CkMgU0Lq.js";import{U as ve,A as je,R as he}from"./RemoveMemberConfirmDialog-gohLNDc5.js";import{P as ge}from"./plus-DfeF35ew.js";function _e(){const{key:n}=xe(),l=ue(),{t:r}=me(),[a,ee]=s.useState(null),[h,te]=s.useState([]),[re,se]=s.useState(!0),[C,g]=s.useState(!1),[y,S]=s.useState(""),[f,T]=s.useState(""),[M,I]=s.useState(""),[R,A]=s.useState(v.GITHUB),[P,U]=s.useState(""),[O,G]=s.useState(j.CLAUDE),[E,$]=s.useState("50"),[D,L]=s.useState(""),[B,F]=s.useState(""),[J,q]=s.useState(""),[z,H]=s.useState("0"),[p,N]=s.useState(""),[K,k]=s.useState(null),[x,_]=s.useState(""),[W,u]=s.useState(!1),[ae,X]=s.useState(!1),[i,w]=s.useState(null),[oe,Q]=s.useState(!1),m=s.useCallback(async()=>{if(n)try{const[t,b]=await Promise.all([d.get(`web/projects/${n}`).json(),d.get(`web/projects/${n}/members`).json().catch(()=>[])]);if(ee(t),te(b),k(t.gitTokenMasked??null),S(t.name),T(t.repoUrl),I(t.sshUrl??""),A(t.gitPlatform),U(t.defaultBranch),G(t.agentType),$(String(t.maxTurns)),L(t.workspaceRoot??""),F(t.setupCommands??""),q(t.testCommand??""),H(String(t.ptyOutputFilter??0)),t.pipeline)try{N(JSON.stringify(JSON.parse(t.pipeline),null,2))}catch{N(t.pipeline)}}catch{}finally{se(!1)}},[n]);s.useEffect(()=>{m()},[m]);async function ne(t){if(t.preventDefault(),!a)return;g(!0);let b=null;if(p.trim())try{JSON.parse(p),b=p.trim()}catch{c.error(r("projects.invalid_pipeline_json")),g(!1);return}try{await d.put(`web/projects/${a.key}`,{json:{name:y,repoUrl:f,sshUrl:M||null,defaultBranch:P,gitPlatform:R,agentType:O,maxTurns:parseInt(E,10)||50,workspaceRoot:D||null,setupCommands:B||null,testCommand:J||null,ptyOutputFilter:parseInt(z,10)||0,pipeline:b}}),c.success(r("projects.project_saved")),l(`/projects/${a.key}`)}catch(V){const pe=V instanceof Error?V.message:r("projects.failed_to_save_project");c.error(pe)}finally{g(!1)}}function le(){l(`/projects/${n}`)}async function ce(){if(!(!a||!x.trim())){u(!0);try{const t=await d.put(`web/projects/${a.key}/git-token`,{json:{token:x.trim()}}).json();k(t.gitTokenMasked),_(""),c.success(r("projects.git_token_saved"))}catch{c.error(r("projects.git_token_failed"))}finally{u(!1)}}}async function ie(){if(a){u(!0);try{await d.delete(`web/projects/${a.key}/git-token`),k(null),_(""),c.success(r("projects.git_token_cleared"))}catch{c.error(r("projects.git_token_failed"))}finally{u(!1)}}}async function de(){if(!(!a||!i)){Q(!0);try{await d.delete(`web/projects/${a.key}/members`,{searchParams:{developerId:String(i.developerId)}}),await m()}catch{}finally{Q(!1),w(null)}}}return re?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):a?e.jsxs("form",{onSubmit:ne,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:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l(`/projects/${a.key}`),children:a.key})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r("common.edit")})]}),e.jsx("h1",{className:"text-lg font-bold text-[var(--text-primary)] mb-4",children:r("projects.edit_project_title")}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_400px]",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.basic_info")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(o,{label:r("projects.key"),children:e.jsx("input",{type:"text",value:a.key,readOnly:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-muted)] outline-none opacity-60 cursor-not-allowed"})}),e.jsx(o,{label:r("projects.name"),children:e.jsx("input",{type:"text",value:y,onChange:t=>S(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(o,{label:r("projects.repo_url"),children:e.jsx("input",{type:"text",value:f,onChange:t=>T(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsxs(o,{label:r("projects.ssh_url"),children:[e.jsx("input",{type:"text",value:M,onChange:t=>I(t.target.value),placeholder:r("projects.ssh_url_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:r("projects.ssh_url_hint")})]}),e.jsx(o,{label:r("projects.git_platform"),children:e.jsx(Z,{value:R,onChange:t=>A(t),options:[{value:v.GITHUB,label:r("projects.github")},{value:v.GITLAB,label:r("projects.gitlab")},{value:v.GITEA,label:r("projects.gitea")}]})}),e.jsx(o,{label:r("projects.default_branch"),children:e.jsx("input",{type:"text",value:P,onChange:t=>U(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),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.agent_config")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(o,{label:r("projects.agent_type"),children:e.jsx(Z,{value:O,onChange:t=>G(t),options:[{value:j.CLAUDE,label:r("projects.claude")},{value:j.CURSOR,label:r("projects.cursor")},{value:j.CODEX,label:r("projects.codex")}]})}),e.jsx(o,{label:r("projects.max_turns"),children:e.jsx("input",{type:"number",value:E,onChange:t=>$(t.target.value),min:1,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(o,{label:r("projects.workspace_root"),children:e.jsx("input",{type:"text",value:D,onChange:t=>L(t.target.value),placeholder:"/path/to/workspace",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),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.environment")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(o,{label:r("projects.setup_commands"),children:e.jsx("textarea",{value:B,onChange:t=>F(t.target.value),rows:3,placeholder:`npm install
|
|
2
|
-
npm run build`,className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(o,{label:r("projects.post_command"),children:e.jsx("input",{type:"text",value:J,onChange:t=>q(t.target.value),placeholder:"npm test",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),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.security")}),e.jsx("div",{className:"space-y-3",children:e.jsx(o,{label:r("projects.pty_output_filter"),children:e.jsx("input",{type:"text",value:z,onChange:t=>H(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})})]})]}),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.git_token")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(o,{label:r("projects.git_token_label"),children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:K??r("common.not_set")})})}),e.jsxs(o,{label:r("projects.git_token_set"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"password",value:x,onChange:t=>_(t.target.value),placeholder:"ghp_xxxx...",className:"min-w-0 flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("button",{type:"button",disabled:W||!x.trim(),onClick:ce,className:"shrink-0 rounded-[4px] bg-[var(--accent)] px-3 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:r("common.save")})]}),e.jsx("p",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:r("projects.git_token_hint")})]}),K&&e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{type:"button",disabled:W,onClick:ie,className:"rounded-[4px] border border-[var(--destructive)] px-3 py-1.5 text-xs text-[var(--destructive)] hover:opacity-70 transition-opacity disabled:opacity-50",children:r("projects.git_token_clear")})})]})]}),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.pipeline_section")}),e.jsx(be,{to:"/projects/"+n+"/pipeline",className:"text-xs text-[var(--accent)] hover:underline",children:r("projects.edit_pipeline")})]}),e.jsx("textarea",{value:p,onChange:t=>N(t.target.value),rows:20,spellCheck:!1,placeholder:'{"stages": []}',className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]",style:{fontFamily:'"JetBrains Mono", monospace',textTransform:"none"}})]}),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")}),e.jsxs("button",{type:"button",onClick:()=>X(!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(ge,{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:"space-y-2",children:h.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-[var(--accent)]/20 text-xs font-bold text-[var(--accent)]",children:(t.developerName??String(t.developerId)).charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"ml-2 rounded-[4px] px-1.5 py-0.5 text-[11px] font-medium",style:{color:t.role===Y.MAINTAINER?"var(--warning)":"var(--text-secondary)",background:t.role===Y.MAINTAINER?"rgba(245,158,11,0.1)":"rgba(163,163,163,0.1)"},children:t.role})]})]}),e.jsx("button",{type:"button",onClick:()=>w(t),className:"text-[var(--destructive)] hover:opacity-70 transition-opacity","aria-label":r("projects.remove_member"),children:e.jsx(ve,{className:"h-3.5 w-3.5"})})]},t.developerId))})]})]})]}),e.jsxs("div",{className:"mt-8 flex items-center justify-end gap-3 border-t border-[var(--border)] pt-6",children:[e.jsx("button",{type:"button",onClick:le,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("common.discard")}),e.jsx("button",{type:"submit",disabled:C||!y||!f,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:r(C?"common.saving":"projects.save_changes")})]}),e.jsx(je,{isOpen:ae,onClose:()=>X(!1),projectKey:a.key,existingMemberIds:h.map(t=>t.developerId),onAdded:m}),e.jsx(he,{isOpen:!!i,onClose:()=>w(null),onConfirm:de,memberName:i?i.developerName??`#${i.developerId}`:"",loading:oe})]}):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")})]})}function o({label:n,children:l}){return e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start gap-1 sm:gap-3",children:[e.jsx("label",{className:"sm:w-36 shrink-0 sm:pt-2 text-xs text-[var(--text-muted)]",children:n}),e.jsx("div",{className:"min-w-0 flex-1",children:l})]})}export{_e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as M,a as I,i as W,k as A,r as D,j as e,L as f,l as $,m as F,n as P,W as N,h}from"./index-D3ZK8e35.js";import{T as C}from"./TaskStatusBadge-B49xL6ug.js";import{T as y}from"./Skeleton-DI-HCY-N.js";import{O as z}from"./OnboardingGuide-C1-sQUW7.js";import{f as _}from"./date-RFA7-ZGs.js";import{g as H}from"./status-colors-BgploKhY.js";import{u as b}from"./useFetch-CSoNR_l8.js";import{T as R}from"./Tooltip-DrIj1IXL.js";import{A as k}from"./arrow-right-BQPypZRF.js";import"./chevron-right-DxtB9dXk.js";const B=3e5,G=[{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"}],V=["sun","mon","tue","wed","thu","fri","sat"];function Y(){const d=new Date;return Array.from({length:7},(a,o)=>{const r=new Date(d);r.setDate(r.getDate()-(6-o));const n=String(r.getMonth()+1).padStart(2,"0"),l=String(r.getDate()).padStart(2,"0");return{label:V[r.getDay()],date:`${n}/${l}`}})}function J({dailyRates:d,dailyCounts:a,overallRate:o}){const{t:r}=I(),n=Y(),l=Math.max(...d,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:[o,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("dashboard.last_7_days")})]}),e.jsx("div",{className:"flex gap-2",style:{height:80},children:n.map(({label:c,date:t},x)=>{const i=d[x]??0,m=a[x]??0,v=r(m===1?"dashboard.task_total":"dashboard.tasks_total"),u=l>0?Math.max(i/l*100,4):4;return e.jsxs(R,{content:`${c} ${t} — ${i}% (${m} ${v})`,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:`${u}%`,backgroundColor:i>=80?"var(--accent)":i>=50?"var(--warning)":"var(--destructive)"}})}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:c})]},c)})})]})}function le(){const d=M(),{t:a}=I(),o=W(),r=A(s=>s.taskSeq),n=A(s=>s.workerSeq),[l,c]=D.useState(0),{data:t,loading:x}=b(()=>h.get("web/dashboard/stats",{searchParams:{tz:String(new Date().getTimezoneOffset())}}).json(),[l,r,n]),{data:i,loading:m}=b(()=>h.get("web/dashboard/recent-tasks",{searchParams:{limit:"5"}}).json(),[l,r]),{data:v,loading:u}=b(()=>h.get("web/workers").json(),[l,n]),{data:K,loading:q}=b(()=>h.get("web/dashboard/recent-activity").json(),[]);D.useEffect(()=>{const s=setInterval(()=>{c(p=>p+1)},B);return()=>clearInterval(s)},[]);const w=(t==null?void 0:t.success_rate_daily)??null,E=(t==null?void 0:t.task_count_daily)??[],S=(t==null?void 0:t.task_success_rate_7d)??0,T=i??[],g=v??[],L=K??[];function O(s){switch(s){case N.ONLINE:return a("dashboard.online");case N.DRAINING:return a("dashboard.idle");case N.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-6 md:mb-8 grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children:G.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),":"]}),x?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(z,{data:{activeTasks:((t==null?void 0:t.active_tasks)??0)+((t==null?void 0:t.queued_tasks)??0),totalWorkers:g.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:x?e.jsx("div",{className:"h-24 animate-pulse rounded-[4px] bg-[var(--bg-input)]"}):w?e.jsx(J,{dailyRates:w,dailyCounts:E,overallRate:S}):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:[S,"%"]}),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(f,{to:"/tasks",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[a("common.view_all")," ",e.jsx(k,{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:m?e.jsx(y,{rows:4}):T.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:T.map(s=>e.jsxs("div",{onClick:()=>d(`/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:F(s),children:["#",s.id," ",$(s)]}),e.jsx("span",{className:"shrink-0",children:e.jsx(C,{status:s.status})})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:_(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(R,{content:P(s),children:$(s,40)})}),e.jsx("span",{className:"hidden md:inline",children:e.jsx(C,{status:s.status})}),e.jsx("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:_(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(f,{to:"/workers",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[a("common.view_all")," ",e.jsx(k,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:u?e.jsx(y,{rows:3}):g.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:g.map(s=>e.jsxs("div",{onClick:()=>d(`/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:H(s.status)},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),O(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")}),o&&e.jsxs(f,{to:"/admin/audit-logs",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[a("common.view_all")," ",e.jsx(k,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-3 md:p-4",children:q?e.jsx(y,{rows:4}):L.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:L.map(s=>{const p=s.message.match(/task\s*#?(\d+)/i),j=p?p[1]:null;return e.jsxs("div",{className:`flex min-w-0 flex-col gap-1 rounded-[4px] border-b border-[var(--border-row)] px-2 py-2 transition-colors last:border-b-0 md:flex-row md:items-start md:gap-3 md:rounded-none md:px-0 ${j?"cursor-pointer hover:bg-[var(--bg-input)]":""}`,onClick:()=>j&&d(`/tasks/${j}`),children:[e.jsx("span",{className:"shrink-0 whitespace-nowrap text-[11px] text-[var(--text-muted)] md:text-xs",children:_(s.timestamp)}),e.jsx("span",{className:"min-w-0 break-words text-[11px] leading-relaxed text-[var(--text-secondary)] md:truncate md:text-xs md:leading-normal",children:s.message})]},s.id)})})})]})]})]})}export{le 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,U as I,V,v as $,h as p,t as c}from"./index-D3ZK8e35.js";import{v as K}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-C3ZXZz4q.js";import{u as M}from"./useFetch-CSoNR_l8.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:D}=M(()=>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 O(){if(n(""),!x){n(r("profile.current_password_required"));return}if(!d){n(r("profile.new_password_required"));return}const a=K(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")),_(""),D()}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:O,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(V,{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.133"]}),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,6 +0,0 @@
|
|
|
1
|
-
import{c as R,a as z,r as o,G as m,F as u,j as e,h as E,f as G,w as I}from"./index-D3ZK8e35.js";import{S as A}from"./Select-CkMgU0Lq.js";import{E as D}from"./EmptyState-9Eqw0iR8.js";import{T as H}from"./Skeleton-DI-HCY-N.js";import{t as M}from"./date-RFA7-ZGs.js";import{u as J}from"./useFetch-CSoNR_l8.js";import{P as O}from"./plus-DfeF35ew.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 q=R("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),b={width:"100%",padding:"0.5rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},i={display:"block",color:"var(--text-secondary)",fontSize:"0.7rem",marginBottom:"0.25rem",fontFamily:"'JetBrains Mono', monospace"};function W({isOpen:d,onClose:a,onCreated:h}){const{t}=z(),[n,j]=o.useState(""),[l,s]=o.useState(""),[c,p]=o.useState(""),[f,C]=o.useState(""),[_,k]=o.useState("main"),[S,N]=o.useState(m.GITHUB),[B,F]=o.useState(u.CLAUDE),[x,T]=o.useState(!1),[w,g]=o.useState("");o.useEffect(()=>{d&&U()},[d]);function U(){j(""),s(""),p(""),C(""),k("main"),N(m.GITHUB),F(u.CLAUDE),g("")}function y(){U(),a()}async function P(r){r.preventDefault(),g(""),T(!0);try{const v=await E.post("admin/projects",{json:{name:n,key:l,repoUrl:c,sshUrl:f||void 0,defaultBranch:_,gitPlatform:S,agentType:B}}).json();h(v),y()}catch(v){const L=v instanceof Error?v.message:t("projects.failed_to_create_project");g(L)}finally{T(!1)}}return d?e.jsx("div",{onClick:y,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))",padding:"1rem"},children:e.jsxs("div",{onClick:r=>r.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600},children:["> ",t("projects.create_project")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:t("projects.add_project_desc")})]}),w&&e.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.7rem"},children:w}),e.jsxs("form",{onSubmit:P,style:{display:"flex",flexDirection:"column",gap:"0.875rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.project_name")}),e.jsx("input",{type:"text",value:n,onChange:r=>j(r.target.value),placeholder:t("projects.project_name_placeholder"),required:!0,autoFocus:!0,style:b,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.project_key")}),e.jsx("input",{type:"text",value:l,onChange:r=>s(r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:t("projects.project_key_placeholder"),required:!0,style:b,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:t("projects.project_key_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.repo_url")}),e.jsx("input",{type:"text",value:c,onChange:r=>p(r.target.value),placeholder:t("projects.repo_url_placeholder"),required:!0,style:b,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.ssh_url")}),e.jsx("input",{type:"text",value:f,onChange:r=>C(r.target.value),placeholder:t("projects.ssh_url_placeholder"),style:b,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:t("projects.ssh_url_hint")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.default_branch")}),e.jsx("input",{type:"text",value:_,onChange:r=>k(r.target.value),placeholder:t("projects.main"),style:b,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.git_platform")}),e.jsx(A,{value:S,onChange:r=>N(r),options:[{value:m.GITHUB,label:t("projects.github")},{value:m.GITLAB,label:t("projects.gitlab")},{value:m.GITEA,label:t("projects.gitea")}]})]}),e.jsxs("div",{children:[e.jsx("label",{style:i,children:t("projects.agent_type")}),e.jsx(A,{value:B,onChange:r=>F(r),options:[{value:u.CLAUDE,label:t("projects.claude")},{value:u.CURSOR,label:t("projects.cursor")},{value:u.CODEX,label:t("projects.codex")}]})]})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("button",{type:"button",onClick:y,disabled:x,style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"color 0.15s, border-color 0.15s"},className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",children:t("common.cancel")}),e.jsx("button",{type:"submit",disabled:x||!n||!l||!c,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:x||!n||!l||!c?"not-allowed":"pointer",opacity:x||!n||!l||!c?.7:1},children:t(x?"common.creating":"common.create")})]})]})]})}):null}function ee(){const d=G(),{t:a}=z(),[h,t]=o.useState(!1),{data:n,loading:j,refetch:l}=J(()=>E.get("web/projects").json(),[]);return I(o.useMemo(()=>e.jsxs("button",{onClick:()=>t(!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(O,{className:"h-3.5 w-3.5"}),a("projects.create_project")]}),[a])),e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8",children:[j?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(H,{rows:4})}):!n||n.length===0?e.jsx(D,{icon:q,title:a("projects.no_projects_yet"),description:a("projects.create_first_project"),actionLabel:a("projects.create_project"),onAction:()=>t(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:n.map(s=>e.jsxs("div",{onClick:()=>d(`/projects/${s.key}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--accent)]",children:s.key}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.taskCount??0," tasks"]})]}),e.jsx("span",{className:"mt-1 block text-[11px] text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:"mt-0.5 block text-[11px] text-[var(--text-muted)]",children:s.agentType})]},s.key))}),e.jsxs("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"grid grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-2.5 text-xs font-medium text-[var(--text-muted)]",children:[e.jsx("span",{children:"#"}),e.jsx("span",{children:a("projects.key")}),e.jsx("span",{children:a("projects.name")}),e.jsx("span",{children:a("projects.members")}),e.jsx("span",{children:a("projects.tasks_count")}),e.jsx("span",{children:a("projects.last_activity")})]}),n.map((s,c)=>e.jsxs("div",{onClick:()=>d(`/projects/${s.key}`),className:"grid cursor-pointer grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors items-center",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:c+1}),e.jsx("span",{className:"truncate text-xs text-[var(--accent)]",children:s.key}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-xs text-[var(--text-primary)]",children:s.name}),e.jsxs("span",{className:"block truncate text-[11px] text-[var(--text-muted)]",children:[s.agentType," · ",s.repoUrl.replace(/^https?:\/\//,"").split("/").slice(-2).join("/")]})]}),e.jsx("div",{className:"flex items-center",children:e.jsxs("div",{className:"flex -space-x-1.5",children:[(s.members??[]).map(p=>e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--accent)]/20 text-[11px] font-bold text-[var(--accent)]",title:p.name,children:p.name.charAt(0).toUpperCase()},p.id)),(s.memberCount??0)>5&&e.jsxs("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--bg-input)] text-[11px] text-[var(--text-muted)]",children:["+",s.memberCount-5]})]})}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:s.taskCount??0}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:M(s.lastActivity??null)})]},s.key))]})]}),e.jsx(W,{isOpen:h,onClose:()=>t(!1),onCreated:l})]})}export{ee as default};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{c as Q,a as Y,r,h as g,j as e,M as ut,z as P,H as ht,t as J,v as Ce,A as ft,f as vt,B as bt,q as gt,s as jt,k as Ve,p as D,l as Je,m as Nt,L as yt,X as ge,E as Qe,n as kt,x as wt,G as _t}from"./index-D3ZK8e35.js";import{u as Ct,T as St,g as rt}from"./task-constants-eOji5WUw.js";import{C as Et,g as Tt,H as Ye,P as Ze}from"./PtyTerminal-C9Bp0uS_.js";import{a as Lt,b as Dt,f as ne}from"./date-RFA7-ZGs.js";import{S as It}from"./Select-CkMgU0Lq.js";import{a as we}from"./status-colors-BgploKhY.js";import{T as $t}from"./Tooltip-DrIj1IXL.js";import{A as Rt}from"./arrow-left-BwtdfCwD.js";import{R as je}from"./rotate-ccw-DnJi9esb.js";import{G as At}from"./git-fork-DxuKN6TL.js";import{E as Pt}from"./external-link-BWs-24k_.js";import{L as Ne}from"./loader-circle-fKTUhuFx.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 et=Q("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 Ft=Q("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 Mt=Q("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 Ot=Q("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 qt=Q("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 tt({isOpen:l,onClose:c,taskId:a,stageName:n,timeoutSeconds:t,onSubmitted:m}){const{t:p}=Y(),[b,u]=r.useState(t),[_,C]=r.useState(!1);r.useEffect(()=>{if(!l)return;u(t);const o=setInterval(()=>{u(j=>j<=1?(clearInterval(o),0):j-1)},1e3);return()=>clearInterval(o)},[l,t]),r.useEffect(()=>{b===0&&l&&c()},[b,l,c]);const $=r.useCallback(async o=>{C(!0);try{await g.post(`web/tasks/${a}/confirm-stage`,{json:{stageName:n,approved:o}}),m==null||m(),c()}catch{}finally{C(!1)}},[a,n,c,m]);return l?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(ut,{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(Et,{className:"h-3.5 w-3.5"}),Lt(b)]})]}),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:p("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:_,onClick:()=>$(!1),children:p("tasks.reject")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:_,onClick:()=>$(!0),children:p(_?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})]}):null}function Ut(l,c){const a=new Date(l).getTime()-Date.now();if(a<=0)return c("tasks.tunnel_expired");const n=Math.floor(a/36e5),t=Math.floor(a%36e5/6e4);return n>0?c("tasks.tunnel_expires_hm",{h:n,m:t}):c("tasks.tunnel_expires_m",{m:t})}function st(l){switch(l){case"CONNECTED":return"var(--accent)";case"STARTING":return"var(--warning)";case"EXPIRED":return"var(--text-muted)";default:return"var(--text-muted)"}}function at(l,c){switch(l){case"IDLE":case"CLOSED":return c("tasks.tunnel_idle");case"STARTING":return c("tasks.tunnel_starting");case"CONNECTED":return c("tasks.tunnel_connected");case"EXPIRED":return c("tasks.tunnel_expired");case"CLOSING":return c("tasks.tunnel_closing");default:return String(l).toLowerCase()}}function Gt({taskId:l,taskFinished:c,compact:a}){const{t:n}=Y(),[t,m]=r.useState(P.IDLE),[p,b]=r.useState(null),[u,_]=r.useState(null),[C,$]=r.useState(""),[o,j]=r.useState(!1),[ce,F]=r.useState(!1),M=r.useRef(null),R=r.useCallback(async()=>{try{const f=await g.get(`web/workspace-tunnel/${l}/status`).json();m(f.status),b(f.tunnelUrl??null),_(f.expiresAt??null),(f.status==="EXPIRED"||f.status==="IDLE"||f.status==="CLOSED")&&S()}catch{}},[l]);function ie(){S(),M.current=setInterval(R,5e3)}function S(){M.current&&(clearInterval(M.current),M.current=null)}r.useEffect(()=>{c&&(t===P.STARTING||t===P.CONNECTED)&&(m(P.IDLE),b(null),S())},[c,t]),r.useEffect(()=>{if(t!=="CONNECTED"||!u)return;const f=()=>{const E=Ut(u,n);$(E),E===n("tasks.tunnel_expired")&&(m(P.EXPIRED),b(null),S())};f();const I=setInterval(f,3e4);return()=>clearInterval(I)},[t,u]),r.useEffect(()=>()=>S(),[]),r.useEffect(()=>{c||R()},[R,c]);async function K(){j(!0);try{await g.post(`web/workspace-tunnel/${l}/start`),m(P.STARTING),ie()}catch(f){let I=n("tasks.tunnel_start_failed");try{if(f instanceof ht){const E=await f.response.json();E!=null&&E.error&&(I=E.error,/code.*not found|ENOENT.*code|spawn code/i.test(I)&&(I+=". "+n("tasks.tunnel_install_code_hint")))}}catch{}J.error(I)}finally{j(!1)}}async function W(){j(!0);try{await g.post(`web/workspace-tunnel/${l}/stop`),m(P.IDLE),b(null),S()}catch{}finally{j(!1)}}async function oe(){p&&(await navigator.clipboard.writeText(p),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:st(t)},children:at(t,n)}),(t==="IDLE"||t==="CLOSED"||t==="EXPIRED")&&e.jsx("button",{onClick:K,disabled:o,className:"rounded-[4px] px-2 py-1 text-[var(--info)] disabled:opacity-50",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:n(o?"tasks.tunnel_starting":"tasks.tunnel_start")}),t==="CONNECTED"&&p&&e.jsx("a",{href:p.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] px-2 py-1 text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children: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:st(t)},children:["● ",at(t,n)]})]}),t==="CONNECTED"&&u&&e.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["// ",C]}),t==="CONNECTED"&&p&&e.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"flex-1 truncate text-xs text-[var(--text-primary)]",children:p}),e.jsxs("button",{onClick:oe,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"),"]"]})]}),ce&&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:K,disabled:o,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:n(o?"tasks.tunnel_starting_button":"tasks.tunnel_start_button")}),t==="STARTING"&&e.jsx("button",{onClick:W,disabled:o,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:n(o?"tasks.tunnel_stopping":"tasks.tunnel_cancel")}),t==="CONNECTED"&&p&&e.jsxs(e.Fragment,{children:[e.jsx("a",{href:p.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:n("tasks.tunnel_open_cursor")}),e.jsx("a",{href:p.replace(/^https?:/,"vscode:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:n("tasks.tunnel_open_vscode")}),e.jsx("button",{onClick:W,disabled:o,className:"rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors disabled:opacity-50",children:n(o?"tasks.tunnel_stopping":"tasks.tunnel_stop")})]}),t==="EXPIRED"&&e.jsx("button",{onClick:K,disabled:o,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:n(o?"tasks.tunnel_starting_button":"tasks.tunnel_restart")})]})]})}function zt({isOpen:l,onClose:c,onConfirm:a,taskId:n,isLoading:t}){const{t:m}=Y();return e.jsx(Ce,{isOpen:l,onClose:c,onConfirm:a,title:m("tasks.cancel_task_title"),message:m("tasks.cancel_task_message",{id:String(n)}),confirmLabel:m("tasks.cancel_task_confirm_label"),confirmVariant:"danger",isLoading:t})}function Bt({isOpen:l,onClose:c,onConfirm:a,taskId:n,mrUrl:t,isLoading:m,reuseWorkspace:p,onReuseWorkspaceChange:b}){const{t:u}=Y(),_=t?u("tasks.retry_message_with_mr",{id:String(n),url:t}):u("tasks.retry_message_without_mr",{id:String(n)});return e.jsx(Ce,{isOpen:l,onClose:c,onConfirm:a,title:u("tasks.retry_title"),message:_,confirmLabel:u("tasks.retry_confirm_label"),confirmVariant:"accent",isLoading:m,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:p,onChange:C=>b(C.target.checked),className:"w-3.5 h-3.5 cursor-pointer accent-[var(--accent)]"}),u("tasks.reuse_workspace_label")]})})}const ye=["implement","test","verify","review","simplify","submit"];function _e(l){if(typeof l=="string")try{return _e(JSON.parse(l))}catch{return null}if(!l||typeof l!="object")return null;const c=l.stages;if(!Array.isArray(c)||c.length===0)return null;const a=c.map(n=>n&&typeof n=="object"?n.name:null).filter(n=>typeof n=="string"&&n.length>0);return a.length===c.length?a:null}function Kt(l){if(!l.configSnapshot)return ye;try{const c=JSON.parse(l.configSnapshot);return _e(c.pipeline)??_e(c)??ye}catch{return ye}}function Wt(l){switch(l){case"stage_change":return"text-[var(--accent)]";case"info":return"text-[var(--text-secondary)]";case"warning":return"text-[var(--warning)]";case"error":return"text-[var(--destructive)]";case"system":return"text-[var(--info)]";default:return"text-[var(--text-muted)]"}}function ke({status:l,agentType:c}){const a=we(l),n=rt(c);return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-0.5 text-xs",style:{color:a},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-[3px]",style:{backgroundColor:a}}),l.toLowerCase()," / ",n]})}function Xt(l){const c=Kt(l),a=l.currentStage?c.indexOf(l.currentStage):-1;return c.map((n,t)=>{let m="pending";return l.status===D.COMPLETED?m="completed":l.status===D.FAILED&&t<=a?m=t===a?"failed":"completed":a>=0&&(t<a?m="completed":t===a&&(m="running")),{name:n,status:m}})}function le(l,c){if(!l||!c)return null;const a=l.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),n=c.split("/").map(encodeURIComponent).join("/");return l.gitPlatform===_t.GITLAB?`${a}/-/tree/${n}`:`${a}/tree/${n}`}function ls(){var Xe,He;const{id:l}=ft(),c=vt(),{t:a}=Y(),n=Ct(s=>s.cancelTask),[t,m]=r.useState(null),[p,b]=r.useState(null),[u,_]=r.useState([]),[C,$]=r.useState(!0),[o,j]=r.useState(null),[ce,F]=r.useState(!1),[M,R]=r.useState(!1),[ie,S]=r.useState(!1),[K,W]=r.useState(!1),[oe,f]=r.useState(!1),[I,E]=r.useState(!1),[Se,Ee]=r.useState(""),[Te,xe]=r.useState(!1),[Le,nt]=bt(),[k,de]=r.useState("terminal"),[De,Ie]=r.useState([]),[Z,$e]=r.useState(0),[X,O]=r.useState(0),[H,Re]=r.useState(""),[ee,lt]=r.useState(""),[ct,me]=r.useState(!1),[it,Ae]=r.useState(!1),[q,pe]=r.useState(null),[T,Pe]=r.useState("disconnected"),[V,Fe]=r.useState("auto"),U=r.useRef(null),Me=r.useRef(null),x=Number(l),v=t?St.includes(t.status):!1;gt(t?jt(t,100):null);const L=r.useCallback(async()=>{try{const s=await g.get(`web/tasks/${x}`).json();m(s)}catch{}},[x]),te=r.useCallback(async()=>{try{const s=await g.get(`web/tasks/${x}/logs`).json();_(s.lines)}catch{}},[x]),G=r.useCallback(async()=>{try{const s=await g.get(`web/tasks/${x}/pending-confirm`).json();j(s.confirm)}catch{j(null)}},[x]),Oe=r.useCallback(async()=>{me(!0);try{const s=new URLSearchParams;s.set("limit","50"),s.set("offset",String(X*50)),H&&s.set("type",H),ee&&s.set("search",ee);const i=await g.get(`web/tasks/${x}/events?${s}`).json();Ie(i.events),$e(i.total)}catch{}finally{me(!1)}},[x,X,H,ee]);r.useEffect(()=>{k==="logs"&&Oe()},[k,Oe]),r.useEffect(()=>{k==="pipeline"&&!v&&g.get(`web/workspaces/${x}`).json().then(pe).catch(()=>pe(null))},[k,x,v]);const z=Ve(s=>s.lastEvent),qe=Ve(s=>s.eventSeq);r.useEffect(()=>{$(!0),m(null),b(null),_([]),j(null),pe(null),Ie([]),$e(0),O(0),me(!1),Promise.all([L(),te(),G()]).finally(()=>$(!1))},[L,te,G]),r.useEffect(()=>{t!=null&&t.projectKey&&g.get(`web/projects/${t.projectKey}`).json().then(b).catch(()=>b(null))},[t==null?void 0:t.projectKey]),r.useEffect(()=>{!z||qe===0||(z.event==="task_status_changed"&&z.taskId===x||z.event==="task_created"&&z.taskId===x)&&(L(),G())},[qe,z,x,L,G]),r.useEffect(()=>{if(v)return;const i=setInterval(()=>{document.visibilityState!=="hidden"&&Promise.all([L(),te(),G()])},15e3);return()=>clearInterval(i)},[v,L,te,G]);const Ue=r.useCallback(()=>j(null),[]),se=r.useCallback(()=>{j(null),L()},[L]),ot=(t==null?void 0:t.status)===D.FAILED||(t==null?void 0:t.status)===D.CANCELLED,ue=(t==null?void 0:t.status)===D.COMPLETED||(t==null?void 0:t.status)===D.FAILED||(t==null?void 0:t.status)===D.CANCELLED;r.useEffect(()=>{Le.get("action")==="fork"&&t&&!C&&(ue&&Ge(),nt(s=>(s.delete("action"),s),{replace:!0}))},[t,C,Le,ue]);async function xt(){W(!0);try{await n(x),F(!1),await L()}finally{W(!1)}}async function dt(){f(!0);try{await g.post(`web/tasks/${x}/retry`,{json:{reuseWorkspace:Te}}),R(!1),xe(!1),await L()}finally{f(!1)}}function Ge(){Ee(""),S(!0)}async function mt(){E(!0);try{const s=await g.post(`web/tasks/${x}/fork`,{json:{description:Se||void 0}}).json();S(!1),J.success(a("tasks.fork_success")),c(`/tasks/${s.task.id}`)}catch{J.error(a("tasks.fork_error"))}finally{E(!1)}}const N=r.useMemo(()=>t?Xt(t):[],[t==null?void 0:t.configSnapshot,t==null?void 0:t.currentStage,t==null?void 0:t.status]),he=N.findIndex(s=>s.status==="running");if(C)return e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("tasks.loading_task")})});if(!t)return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:a("tasks.task_not_found")}),e.jsxs("button",{onClick:()=>c("/tasks"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",a("tasks.back_to_tasks")]})]});const w=t.status===D.QUEUED&&t.queuePosition!=null&&t.queueTotal!=null?{position:t.queuePosition,total:t.queueTotal}:null,y=Dt(t.startedAt,t.completedAt),fe=Tt(t),ze=rt(t.agentType),ae=`${a("tasks.status_suspended")} / ${ze}`,Be=w?e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"queue"}),e.jsxs("span",{className:"text-[var(--info)]",children:["#",w.position," / ",w.total]})]}):null,Ke=e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>c("/tasks"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(Rt,{className:"h-4 w-4"})}),e.jsxs("span",{className:"line-clamp-2 text-sm font-medium text-[var(--text-primary)]",title:Nt(t),children:["#",t.id," ",Je(t,100)]})]}),ve=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(ke,{status:t.status,agentType:t.agentType}),y&&e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// time cost: ",y]}),w&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsx("span",{className:"text-xs text-[var(--info)]",children:a("tasks.queue_position",{position:String(w.position),total:String(w.total)})})]}),e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs(yt,{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: ",le(p,t.branch)?e.jsx("a",{href:le(p,t.branch),target:"_blank",rel:"noopener noreferrer",className:"text-[var(--text-primary)] hover:text-[var(--info)] hover:underline transition-colors",children:t.branch}):e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch})]})]}),t.mrUrl&&/^https?:\/\//.test(t.mrUrl)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline",children:["MR: ",((Xe=t.mrUrl.match(/!?\d+$/))==null?void 0:Xe[0])??"view"]})]})]}),We=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(ge,{className:"h-3 w-3"}),a("tasks.cancel_task")]}),ot&&e.jsxs("button",{onClick:()=>R(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-3 h-8 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors cursor-pointer",children:[e.jsx(je,{className:"h-3 w-3"}),a("tasks.retry_task")]}),ue&&e.jsxs("button",{onClick:Ge,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(At,{className:"h-3 w-3"}),a("tasks.fork_task")]}),t.workerId&&!v&&e.jsxs("button",{onClick:()=>{de("pipeline"),setTimeout(()=>{var s,i;(i=(s=Me.current)==null?void 0:s.scrollIntoView)==null||i.call(s,{behavior:"smooth",block:"center"})},50)},className:"hidden lg:flex items-center justify-center gap-1.5 rounded-[4px] px-3 h-8 text-[11px] font-medium text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:[e.jsx(Pt,{className:"h-3 w-3"}),a("tasks.cursor_tunnel")]})]}),pt=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")}),N.map(s=>{const i=s.status==="completed",d=s.status==="running",h=s.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 py-1.5 ${d?"bg-[#1a1a1a]":""}`,children:[i&&e.jsx(Qe,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),d&&e.jsx(Ne,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),h&&e.jsx(ge,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),s.status==="pending"&&e.jsx(et,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs",style:{color:i?"var(--accent)":d?"#e5e5e5":h?"var(--destructive)":"#525252",fontWeight:d?500:400},children:d?`> ${s.name}`:s.name})]},s.name)})]}),y&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-[11px] text-[var(--text-secondary)]",children:["// time cost: ",y]}),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,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]}),be=e.jsxs(e.Fragment,{children:[e.jsx(zt,{isOpen:ce,onClose:()=>F(!1),onConfirm:xt,taskId:x,isLoading:K}),e.jsx(Bt,{isOpen:M,onClose:()=>{R(!1),xe(!1)},onConfirm:dt,taskId:x,mrUrl:t.mrUrl??void 0,isLoading:oe,reuseWorkspace:Te,onReuseWorkspaceChange:xe}),e.jsx(Ce,{isOpen:ie,onClose:()=>S(!1),onConfirm:mt,title:a("tasks.fork_task"),message:a("tasks.fork_task_desc"),confirmLabel:a("tasks.fork_task"),confirmVariant:"accent",isLoading:I,children:e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["fork of #",x]}),e.jsx("textarea",{value:Se,onChange:s=>Ee(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 it&&k==="terminal"?e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[var(--bg-primary)] font-mono lowercase h-screen",style:{height:"100dvh",paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[ve,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] ${T==="connected"?"text-[var(--accent)]":T==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${T==="connected"?"bg-[var(--accent)]":T==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),a(`tasks.${T}`)]}),e.jsx("span",{className:"text-[11px]",style:{color:we(t.status)},children:t.status.toLowerCase()}),t.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--accent)]",children:[a("tasks.stage"),": ",t.currentStage]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",fe]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!v&&V==="auto"&&e.jsxs("button",{onClick:()=>{var s;return(s=U.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(Ye,{className:"h-3 w-3"}),a("tasks.take_over")]}),!v&&V==="manual"&&e.jsxs("button",{onClick:()=>{var s;return(s=U.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(je,{className:"h-3 w-3"}),a("tasks.restore_auto")]}),e.jsx("button",{onClick:()=>Ae(!1),className:"flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1 text-[var(--text-muted)]",children:e.jsx(Ot,{className:"h-3 w-3"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(Ze,{ref:U,taskId:x,sessionId:t.currentSessionId??void 0,taskFinished:v,onStatusChange:Pe,onTakeoverChange:Fe})}),We,be]}):t.status===D.SUSPENDED?e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[Ke,ve,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($t,{content:kt(t),children:Je(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:ae})]}),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:ae})}),o&&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:o.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:o.stageName})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:flex-wrap md:gap-3",children:[e.jsx("button",{onClick:async()=>{try{await g.post(`web/tasks/${x}/confirm-stage`,{json:{stageName:o.stageName,approved:!0}}),se()}catch{J.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 g.post(`web/tasks/${x}/confirm-stage`,{json:{stageName:o.stageName,approved:!1}}),se()}catch{J.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:ae})]}),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:ne(t.createdAt)})]})]})]}),e.jsx("div",{className:"hidden md:flex flex-wrap items-center gap-2 py-2",children:N.map((s,i)=>{const d=s.status==="failed",h=s.status==="completed",A=s.status==="running"&&t.status===D.SUSPENDED,B=d?"var(--destructive)":h?"var(--accent)":A?"var(--warning)":"#525252",re=d?"rgba(239,68,68,0.12)":h?"rgba(34,197,94,0.12)":A?"rgba(245,158,11,0.12)":"transparent";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px]",style:{color:B,backgroundColor:re,fontWeight:A?700:400,border:A?`1px solid ${B}`:void 0},children:A?"confirm":`${s.name}${h?" ✓":d?" ✗":""}`}),i<N.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,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-secondary)]",children:s},i)),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:ae})]}),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:N.map(s=>{const i=s.status==="completed"?"var(--info)":s.status==="failed"?"var(--destructive)":s.status==="running"?"var(--warning)":"#525252",d=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:i}}),e.jsxs("span",{className:"text-[11px]",style:{color:d,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:ne(t.createdAt)})]})})]})]}),o&&e.jsx(tt,{isOpen:!!o,onClose:Ue,taskId:x,stageName:o.stageName,timeoutSeconds:Math.ceil(o.timeout/1e3),onSubmitted:se}),be]}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden font-mono lowercase",children:[Ke,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(ke,{status:t.status,agentType:t.agentType}),y&&e.jsxs("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:["// time cost: ",y]}),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&&(le(p,t.branch)?e.jsx("a",{href:le(p,t.branch),target:"_blank",rel:"noopener noreferrer",className:"shrink-0 text-[11px] text-[var(--text-muted)] hover:text-[var(--info)] hover:underline truncate max-w-[80px] md:max-w-[120px] transition-colors",children:t.branch}):e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)] truncate max-w-[80px] md:max-w-[120px]",children:t.branch}))]}),ve,t.errorMessage&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-6 py-2 text-xs shrink-0 bg-[var(--destructive)]/10 text-[var(--destructive)]",style:{borderColor:"rgba(239,68,68,0.2)"},children:["// error: ",t.errorMessage]}),w&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0 text-[var(--info)]",style:{backgroundColor:"color-mix(in srgb, var(--info) 8%, transparent)",borderColor:"color-mix(in srgb, var(--info) 20%, transparent)"},children:[e.jsx(Ft,{className:"h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{children:[a("tasks.queue_position_banner",{position:String(w.position),total:String(w.total)}),w.position>1?` — ${a("tasks.queue_ahead",{count:String(w.position-1)})}`:` — ${a("tasks.queue_next")}`]})]}),o&&e.jsx(tt,{isOpen:!!o,onClose:Ue,taskId:x,stageName:o.stageName,timeoutSeconds:Math.ceil(o.timeout/1e3),onSubmitted:se}),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:()=>de(s),className:`shrink-0 whitespace-nowrap px-4 py-2.5 text-xs transition-colors ${k===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))}),k==="terminal"&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-3 md:px-5 shrink-0",style:{height:36,backgroundColor:"#111111"},children:[e.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] ${T==="connected"?"text-[var(--accent)]":T==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${T==="connected"?"bg-[var(--accent)]":T==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),a(`tasks.${T}`)]}),e.jsx("span",{className:"text-[11px]",style:{color:we(t.status)},children:t.status.toLowerCase()}),t.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--accent)]",children:[a("tasks.stage"),": ",t.currentStage]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",fe]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[!v&&V==="auto"&&e.jsxs("button",{onClick:()=>{var s;return(s=U.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(Ye,{className:"h-3 w-3"}),a("tasks.take_over")]}),!v&&V==="manual"&&e.jsxs("button",{onClick:()=>{var s;return(s=U.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(je,{className:"h-3 w-3"}),a("tasks.restore_auto")]}),!v&&V==="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(Ne,{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(qt,{className:"h-3 w-3"}),a("tasks.skip_stage")]}),e.jsx("button",{onClick:()=>Ae(!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(Mt,{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(ke,{status:t.status,agentType:t.agentType}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",fe]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children: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:N.map((s,i)=>{const d=s.status==="completed",h=s.status==="running",B=s.status==="failed"?"var(--destructive)":d||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:B,fontWeight:h?600:400},children:[s.name,d?" ✓":h?" ...":""]}),i<N.length-1&&e.jsx("div",{className:"mx-1.5 h-px w-4 shrink-0",style:{backgroundColor:B}})]},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:U,taskId:x,sessionId:t.currentSessionId??void 0,taskFinished:v,onStatusChange:Pe,onTakeoverChange:Fe})}),We]}),k==="pipeline"&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("div",{className:"mb-4 md:mb-5 overflow-x-auto no-scrollbar",style:{borderRadius:0},children:e.jsx("div",{className:"flex items-center py-5",children:N.map((s,i)=>{const d=s.status==="completed",h=s.status==="running",re=s.status==="failed"?"var(--destructive)":d||h?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",style:{flex:i<N.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:re},children:[d&&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:re},children:s.name})]}),i<N.length-1&&e.jsx("div",{className:"mx-1 md:mx-2 h-0.5 flex-1 min-w-3 rounded-full",style:{backgroundColor:i<(he>=0?he: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," (",he+1,"/",N.length,")"]}),t.startedAt&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",ne(t.startedAt).replace(" ago","")]}),y&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",y]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// retries: ",t.retryCount,"/2"]})]}),!t.currentStage&&y&&e.jsx("div",{className:"mb-4 md:mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 text-xs leading-relaxed",children:e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",y]})}),e.jsx("button",{onClick:()=>de("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??"-"})]}),Be]})]}),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")}),N.map(s=>{const i=s.status==="completed",d=s.status==="running",h=s.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 py-2 ${d?"bg-[var(--bg-input)]":""}`,children:[i&&e.jsx(Qe,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),d&&e.jsx(Ne,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),h&&e.jsx(ge,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),s.status==="pending"&&e.jsx(et,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs leading-normal",style:{color:i?"var(--accent)":d?"var(--text-primary)":h?"var(--destructive)":"#525252",fontWeight:d?500:400},children:d?`> ${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,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:s},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a("tasks.no_activity")})]})]})]}),k==="logs"&&e.jsxs("div",{className:"flex flex-1 flex-col gap-3 md:gap-5 overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)] md:hidden",children: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:()=>{Re(s),O(0)},className:`shrink-0 rounded-[4px] px-2.5 py-1 text-[11px] ${H===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(It,{value:H,onChange:s=>{Re(s),O(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(wt,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("tasks.search_logs"),value:ee,onChange:s=>{lt(s.target.value),O(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:[De.map((s,i)=>e.jsxs("div",{className:`flex items-start md:items-center gap-2 md:gap-4 rounded-[4px] px-2 md:px-3 py-2 text-[11px] md:text-xs ${i%2===0?"bg-[var(--bg-card)]":""}`,children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:new Date(s.timestamp).toLocaleTimeString("en-US",{hour12:!1})}),e.jsx("span",{className:`shrink-0 font-medium ${Wt(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)),De.length===0&&!ct&&e.jsx("p",{className:"py-8 text-center text-xs text-[var(--text-muted)]",children:a("tasks.no_log_entries")})]}),Z>50&&e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[Array.from({length:Math.ceil(Z/50)}).slice(0,5).map((s,i)=>e.jsx("button",{onClick:()=>O(i),className:`rounded-[4px] px-2 py-1 text-xs ${X===i?"bg-[var(--accent)] text-black font-medium":"text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:i+1},i)),Math.ceil(Z/50)>5&&e.jsx("button",{onClick:()=>O(X+1),disabled:X>=Math.ceil(Z/50)-1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] disabled:opacity-30",children:">"})]})]})]}),k==="terminal"&&pt,k==="pipeline"&&e.jsxs("div",{className:"hidden w-[420px] shrink-0 flex-col gap-5 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-5 lg:flex",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children: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:ne(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:ze})]}),y&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"time cost"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:y})]}),Be]})]}),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??(q==null?void 0:q.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:(q==null?void 0:q.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:((He=t.mrUrl.match(/!?\d+$/))==null?void 0:He[0])??"view"})]})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{ref:Me,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(Gt,{taskId:x,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:N.map(s=>{const i=s.status==="completed"?"✓":s.status==="running"?"→":"·",d=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:d},children:i}),e.jsx("span",{className:s.status==="running"?"font-medium":"",style:{color:d},children:s.name}),e.jsxs("span",{className:"text-[11px]",style:{color:"#525252"},children:["— ",h]})]},s.name)})})]})]})]}),be]})}export{ls as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as pe,f as $,a as O,p as m,j as e,l as X,n as me,u as ue,i as be,r,h as E,X as ve,k as he,w as fe,H as ge,t as Q,x as ye,y as U,m as je}from"./index-D3ZK8e35.js";import{a as ke,A as Ne,u as W}from"./task-constants-eOji5WUw.js";import{T as Z}from"./TaskStatusBadge-B49xL6ug.js";import{f as ee}from"./date-RFA7-ZGs.js";import{T as Ce}from"./Tooltip-DrIj1IXL.js";import{G as te}from"./git-fork-DxuKN6TL.js";import{S as P}from"./Select-CkMgU0Lq.js";import{C as we}from"./copy-BckVr8cJ.js";import{E as Y}from"./EmptyState-9Eqw0iR8.js";import{T as V}from"./Skeleton-DI-HCY-N.js";import{P as Se}from"./plus-DfeF35ew.js";import{C as _e}from"./chevron-left-6cPJJmnY.js";import{C as Te}from"./chevron-right-DxtB9dXk.js";import"./status-colors-BgploKhY.js";const Ee=pe.memo(function({task:s}){const d=$(),{t:c}=O(),x=(a,v)=>c(`common.${a}`,{n:v}),i=s.status===m.COMPLETED||s.status===m.FAILED||s.status===m.CANCELLED;return e.jsxs("tr",{onClick:()=>d(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:e.jsx(Ce,{content:me(s),children:X(s)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(Z,{status:s.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.developerName??s.creatorName??"-"}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.workerName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:e.jsxs("span",{className:"flex items-center gap-2",children:[ee(s.createdAt,x),i&&e.jsx("button",{onClick:a=>{a.stopPropagation(),d(`/tasks/${s.id}?action=fork`)},className:"shrink-0 rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] hover:bg-[var(--bg-input)] transition-colors",title:c("tasks.fork_task"),children:e.jsx(te,{className:"h-3 w-3"})})]})})]})});function Pe({isOpen:n,onClose:s,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:a}=O();ue(o=>o.user);const v=be(),[u,A]=r.useState(""),[b,I]=r.useState(""),[p,D]=r.useState("feat"),[k,C]=r.useState(""),[w,S]=r.useState(""),[y,_]=r.useState(""),[h,j]=r.useState(""),[L,R]=r.useState([]),[F,N]=r.useState("");r.useEffect(()=>{if(!n||(A(""),I(""),D("feat"),C(""),S(""),_(""),j(""),N(""),!v))return;const o=new AbortController;return E.get("admin/developers",{signal:o.signal}).json().then(R).catch(()=>{}),()=>o.abort()},[n,v]),r.useEffect(()=>{if(!n)return;function o(f){f.key==="Escape"&&s()}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n,s]);async function z(o){if(o.preventDefault(),N(""),!u||!b.trim()){N(a("tasks.project_and_description_required"));return}try{await x({projectKey:u,description:b.trim(),workerId:y||void 0,developerId:h?Number(h):void 0,taskType:p,branchSlug:w.trim()||void 0,agentType:k||void 0})}catch(f){const B=f instanceof Error?f.message:a("tasks.failed_to_create_task");N(B)}}return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&s()},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:s,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(ve,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:z,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.project")}),e.jsx(P,{value:u,onChange:A,options:d.map(o=>({value:o.key,label:o.name})),placeholder:a(c?"common.loading":"tasks.select_project"),disabled:c})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_type")}),e.jsx(P,{value:p,onChange:D,options:ke})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx(P,{value:k,onChange:C,options:Ne})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_description")}),e.jsx("textarea",{value:b,onChange:o=>I(o.target.value),placeholder:a("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_worker")}),e.jsx("input",{type:"text",value:y,onChange:o=>_(o.target.value),placeholder:a("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.branch_slug")}),e.jsx("input",{type:"text",value:w,onChange:o=>S(o.target.value),placeholder:a("tasks.branch_slug_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),v&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(P,{value:h,onChange:j,options:L.map(o=>({value:String(o.id),label:o.name})),placeholder:a("tasks.select_developer")})]}),F&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:F})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:s,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:i||!u||!b.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:a(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function De({isOpen:n,onClose:s,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:a}=O();return!x||!n?null:e.jsx("div",{onClick:s,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:v=>v.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(we,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",x.id," · ",x.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:x.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:s,disabled:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>c(x.id),style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:d,disabled:i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1},children:a(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function Fe({task:n}){const s=$(),d=n.status===m.COMPLETED||n.status===m.FAILED||n.status===m.CANCELLED;return e.jsxs("div",{onClick:()=>s(`/tasks/${n.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2",title:je(n),children:["#",n.id," ",X(n)]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),s(`/tasks/${n.id}?action=fork`)},className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:e.jsx(te,{className:"h-3 w-3"})}),e.jsx(Z,{status:n.status})]})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:ee(n.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.workerName})]})]})]})}const Ae=[{key:"all",labelKey:"tasks.tab_all"},{key:m.RUNNING,labelKey:"tasks.tab_running"},{key:m.QUEUED,labelKey:"tasks.tab_queued"},{key:m.COMPLETED,labelKey:"tasks.tab_completed"},{key:m.FAILED,labelKey:"tasks.tab_failed"},{key:m.CANCELLED,labelKey:"tasks.tab_cancelled"}],Ie=20;function We(){const n=$(),{t:s}=O(),{tasks:d,loading:c,fetchTasks:x}=W(),i=he(t=>t.taskSeq),[a,v]=r.useState("all"),[u,A]=r.useState(""),[b,I]=r.useState(""),[p,D]=r.useState(""),[k,C]=r.useState(void 0),[w,S]=r.useState([]),y=W(t=>t.nextCursor),[_,h]=r.useState(!1);fe(r.useMemo(()=>e.jsxs("button",{onClick:()=>h(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(Se,{className:"h-3.5 w-3.5"}),s("tasks.new_task")]}),[s]));const[j,L]=r.useState([]),[R,F]=r.useState(!1),[N,z]=r.useState([]),[o,f]=r.useState(!1),[B,K]=r.useState(!1),[se,re]=r.useState(null),[q,M]=r.useState(null),G=r.useCallback(t=>{const l={limit:String(Ie)};return a!=="all"&&(l.status=a),u&&(l.projectKey=u),b&&(l.developerId=b),t&&(l.cursor=t),l},[a,u,b]);r.useEffect(()=>{x(G(k))},[G,k,x,i]),r.useEffect(()=>{C(void 0),S([])},[a,u,b]),r.useEffect(()=>{let t=!1;return(async()=>{try{const[g,xe]=await Promise.all([E.get("web/projects").json(),E.get("web/projects/-/developers").json()]);if(t)return;L(g),z(xe)}catch{}})(),()=>{t=!0}},[]),r.useEffect(()=>{if(!_||j.length>0)return;F(!0);let t=!1;return(async()=>{try{const g=await E.get("web/projects").json();t||L(g)}catch{}finally{t||F(!1)}})(),()=>{t=!0}},[_,j.length]);const ae=r.useCallback(async t=>{f(!0);try{const l=await E.post("web/tasks",{json:{projectKey:t.projectKey,description:t.description,workerId:t.workerId,developerId:t.developerId,taskType:t.taskType,branchSlug:t.branchSlug,agentType:t.agentType}}).json();h(!1),n(`/tasks/${l.task.id}`)}catch(l){if(l instanceof ge&&l.response.status===409){try{const g=await l.response.json();if(g.confirmRequired){re({id:g.confirmRequired.taskId,description:g.confirmRequired.message,status:"active"}),M(t),h(!1),K(!0);return}}catch{}Q.error(s("tasks.similar_task_exists"))}else{const g=l instanceof Error?l.message:String(l);Q.error(g)}}finally{f(!1)}},[n]),oe=r.useCallback(async()=>{if(q){f(!0);try{const t=await E.post("web/tasks",{json:{...q,force:!0}}).json();K(!1),M(null),n(`/tasks/${t.task.id}`)}finally{f(!1)}}},[q,n]),T=r.useMemo(()=>{if(!p.trim())return d;const t=p.toLowerCase();return d.filter(l=>(l.name??"").toLowerCase().includes(t)||l.description.toLowerCase().includes(t)||String(l.id).includes(p))},[d,p]),ne=r.useCallback(()=>{y&&(S(t=>[...t,k??""]),C(y))},[y,k]),le=r.useCallback(()=>{S(t=>{if(t.length===0)return t;const l=t.slice(0,-1);return C(t.at(-1)||void 0),l})},[]),ce=w.length+1,ie=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...j.map(t=>({value:t.key,label:t.name}))],[j,s]),de=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...N.map(t=>({value:String(t.id),label:t.name}))],[N,s]),H=s(p?"tasks.try_adjusting_search":"tasks.create_first_task"),J=p?void 0:e.jsx("button",{onClick:()=>h(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:s("tasks.create_task")});return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar pr-4 md:pr-0",children:Ae.map(t=>e.jsx("button",{onClick:()=>v(t.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${a===t.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:s(t.labelKey)},t.key))}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative md:w-52",children:[e.jsx(ye,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:s("tasks.search_tasks"),value:p,onChange:t=>D(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),p&&e.jsx("button",{onClick:()=>D(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]}),e.jsx(P,{value:u,onChange:A,options:ie,className:"md:w-40"}),e.jsx(P,{value:b,onChange:I,options:de,className:"md:w-40"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:s("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.time")})]})}),e.jsxs("tbody",{children:[c&&T.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(V,{rows:5})})}),!c&&T.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Y,{icon:U,title:s("tasks.no_tasks_found"),description:H,action:J})})}),T.map(t=>e.jsx(Ee,{task:t},t.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[c&&T.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(V,{rows:5})}),!c&&T.length===0&&e.jsx(Y,{icon:U,title:s("tasks.no_tasks_found"),description:H,action:J}),T.map(t=>e.jsx(Fe,{task:t},t.id))]}),(w.length>0||y)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",ce]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:le,disabled:w.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(_e,{className:"h-3.5 w-3.5"}),s("tasks.prev")]}),e.jsxs("button",{onClick:ne,disabled:!y,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[s("common.next"),e.jsx(Te,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(Pe,{isOpen:_,onClose:()=>h(!1),projects:j,projectsLoading:R,onSubmit:ae,isSubmitting:o}),e.jsx(De,{isOpen:B,onClose:()=>{K(!1),M(null)},onForceCreate:oe,onViewExisting:t=>{K(!1),M(null),n(`/tasks/${t}`)},similarTask:se,isLoading:o})]})}export{We as default};
|