@overlordai/server 1.0.131 → 1.0.132

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/adapters/lark/lark.controller.d.ts.map +1 -1
  2. package/dist/adapters/lark/lark.controller.js +16 -1
  3. package/dist/adapters/lark/lark.controller.js.map +1 -1
  4. package/dist/adapters/slack/slack.controller.d.ts.map +1 -1
  5. package/dist/adapters/slack/slack.controller.js +35 -19
  6. package/dist/adapters/slack/slack.controller.js.map +1 -1
  7. package/dist/dispatcher/heartbeat.service.js +2 -2
  8. package/dist/dispatcher/heartbeat.service.js.map +1 -1
  9. package/dist/dispatcher/task-creation.service.d.ts +3 -1
  10. package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
  11. package/dist/dispatcher/task-creation.service.js +16 -2
  12. package/dist/dispatcher/task-creation.service.js.map +1 -1
  13. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  14. package/dist/notifier/notification-consumer.js +21 -0
  15. package/dist/notifier/notification-consumer.js.map +1 -1
  16. package/dist/web/task.controller.d.ts +12 -2
  17. package/dist/web/task.controller.d.ts.map +1 -1
  18. package/dist/web/task.controller.js +14 -6
  19. package/dist/web/task.controller.js.map +1 -1
  20. package/package.json +4 -4
  21. package/public/assets/{AccessTokensPage-B1G2-mUi.js → AccessTokensPage-DCFrCMzE.js} +1 -1
  22. package/public/assets/{AdminPage-BfQmSXQa.js → AdminPage-BvFj4q7-.js} +1 -1
  23. package/public/assets/{AgentCliPage-D7QPKJpY.js → AgentCliPage-B9B64zCv.js} +1 -1
  24. package/public/assets/{ApiReferencePage-DIYFxzq0.js → ApiReferencePage-DvMZOSc3.js} +1 -1
  25. package/public/assets/{ArchitecturePage-DZqBL3l7.js → ArchitecturePage-1LCElBkH.js} +1 -1
  26. package/public/assets/{AuditLogPage-BGxaXcKz.js → AuditLogPage-DTmZ-f__.js} +1 -1
  27. package/public/assets/{BindPlatformPage-rtjDTUn-.js → BindPlatformPage-DSIzkccU.js} +1 -1
  28. package/public/assets/{BotIntegrationPage-DhApmTBA.js → BotIntegrationPage-B8awI2LD.js} +1 -1
  29. package/public/assets/{BotManage-Db0KRZ8H.js → BotManage-CofWqcVs.js} +1 -1
  30. package/public/assets/{BotSetupPage-BKSV06rk.js → BotSetupPage-r2UPpNNb.js} +1 -1
  31. package/public/assets/{ChangelogPage-C3gSpp3g.js → ChangelogPage-az9QSZvX.js} +1 -1
  32. package/public/assets/{CliReferencePage-ejyySCuq.js → CliReferencePage-EPI6nOO3.js} +1 -1
  33. package/public/assets/{DeploymentPage-Cq1gui8d.js → DeploymentPage-CYaF1OrQ.js} +1 -1
  34. package/public/assets/{DevWorkflowPage-CqU3wVnM.js → DevWorkflowPage-Osg4WAt3.js} +1 -1
  35. package/public/assets/{DeveloperManage-CpSvUtkr.js → DeveloperManage-BWOYBP-t.js} +1 -1
  36. package/public/assets/{DeveloperSetupPage-bXuJM2eH.js → DeveloperSetupPage-DF7Xs0c9.js} +1 -1
  37. package/public/assets/{DocsIndexPage-D_GPFyTY.js → DocsIndexPage-BSAn3ZJa.js} +1 -1
  38. package/public/assets/{DocsLayout-BY6F_ywj.js → DocsLayout-CKlbtNeH.js} +1 -1
  39. package/public/assets/{DocsPrimitives-DX-7e1im.js → DocsPrimitives-D0E69i2N.js} +1 -1
  40. package/public/assets/{EditProjectPage-D0JZ_TKw.js → EditProjectPage-CABV9tuN.js} +1 -1
  41. package/public/assets/{EmptyState-mJyWr5uH.js → EmptyState-CytgiY9L.js} +1 -1
  42. package/public/assets/{EnvVariablesPage-fLXzba5e.js → EnvVariablesPage-D9Ja85G7.js} +1 -1
  43. package/public/assets/HomePage-M-fiv0p_.js +1 -0
  44. package/public/assets/{InfoRow-Y1sU0G2n.js → InfoRow-enN7id8N.js} +1 -1
  45. package/public/assets/{InstallationPage-BI1eTsYg.js → InstallationPage-CUgF5YTY.js} +1 -1
  46. package/public/assets/{LandingPage-B29hFr5l.js → LandingPage-DKnU-mvA.js} +1 -1
  47. package/public/assets/{LocalDevelopmentPage-DKZu2NH2.js → LocalDevelopmentPage-CA3xCluE.js} +1 -1
  48. package/public/assets/{LoginPage-DxhouRBW.js → LoginPage-BbyRZjiW.js} +1 -1
  49. package/public/assets/{MetricBar-eTMDxsUA.js → MetricBar-CEMnsJOi.js} +1 -1
  50. package/public/assets/{NotFoundPage-C0EcsleR.js → NotFoundPage-CMuv-KhW.js} +1 -1
  51. package/public/assets/{OnboardingGuide-Da2v37e-.js → OnboardingGuide-DNTJ78K8.js} +1 -1
  52. package/public/assets/{PermissionsPage-gn5TccJJ.js → PermissionsPage-g_8tHOBE.js} +1 -1
  53. package/public/assets/{PipelineConfigPage-Dpg_1f8s.js → PipelineConfigPage-B2LYXsq5.js} +1 -1
  54. package/public/assets/{PipelineEditorPage-EWSpEJ5f.js → PipelineEditorPage-DcWEfi_A.js} +1 -1
  55. package/public/assets/{ProfilePage-DELsbzEP.js → ProfilePage-CIDz5YeD.js} +1 -1
  56. package/public/assets/{ProjectDetailPage-CNiRP1xl.js → ProjectDetailPage-C9pM6Woi.js} +1 -1
  57. package/public/assets/{ProjectListPage-CYcEgWyH.js → ProjectListPage-DDiQLEie.js} +1 -1
  58. package/public/assets/{PtyTerminal-BnlhlDB0.js → PtyTerminal-VS56WKLO.js} +5 -5
  59. package/public/assets/{QuickAuth-BJjb8FUv.js → QuickAuth-DLFmIjpX.js} +1 -1
  60. package/public/assets/{RemoveMemberConfirmDialog-DTCM7tSO.js → RemoveMemberConfirmDialog-DV3LHFVJ.js} +1 -1
  61. package/public/assets/{Select-DqguHTDG.js → Select-Cnz6OMVU.js} +1 -1
  62. package/public/assets/{SettingsPage-DZJf1o-J.js → SettingsPage-D_-cbHE0.js} +1 -1
  63. package/public/assets/{Skeleton-D6Pa0ZVm.js → Skeleton-Kj4rVptL.js} +1 -1
  64. package/public/assets/{SkillPage-BvcpkVCR.js → SkillPage-CTvQUNvZ.js} +1 -1
  65. package/public/assets/TaskDetailPage-lkhZX_5H.js +26 -0
  66. package/public/assets/{TaskListPage-wY64PBlG.js → TaskListPage-CVA7Ujw9.js} +1 -1
  67. package/public/assets/{TaskStatusBadge-mCwzxB1W.js → TaskStatusBadge-Z50SCZY9.js} +1 -1
  68. package/public/assets/TerminalHomePage-UBr5yN3b.js +11 -0
  69. package/public/assets/{TokenManage-CyUVin7L.js → TokenManage-30D7q4lk.js} +1 -1
  70. package/public/assets/{Tooltip-BPOc-WnR.js → Tooltip-DZz2zdfO.js} +1 -1
  71. package/public/assets/{TotpSetupPage-DjccU57R.js → TotpSetupPage-D4jIjEla.js} +1 -1
  72. package/public/assets/{WorkerDetailPage-CE4-kfOS.js → WorkerDetailPage-bOwxux_n.js} +1 -1
  73. package/public/assets/{WorkerListPage-C0rAZuEy.js → WorkerListPage-DEiTRhPm.js} +1 -1
  74. package/public/assets/{WorkerOperationsPage-B3P0RNCo.js → WorkerOperationsPage-DW9AJtYD.js} +1 -1
  75. package/public/assets/{WorkerSetupGuidePage-m-iSn-iM.js → WorkerSetupGuidePage-BOvjn4RL.js} +1 -1
  76. package/public/assets/{WorkerSetupPage-CLOruE6A.js → WorkerSetupPage-C2r1Zi4Z.js} +1 -1
  77. package/public/assets/{arrow-left-PTRz8m1_.js → arrow-left-BDSgdusw.js} +1 -1
  78. package/public/assets/{arrow-right-DZEEeomG.js → arrow-right-BOajnkxo.js} +1 -1
  79. package/public/assets/{bot-DO5AEPZ9.js → bot-DsoXb524.js} +1 -1
  80. package/public/assets/{chevron-left-xzCRCgCf.js → chevron-left-yEb7hDVz.js} +1 -1
  81. package/public/assets/{chevron-right-BbeAvkMB.js → chevron-right-9GGZyR6N.js} +1 -1
  82. package/public/assets/{copy-DS3maJzX.js → copy-BdjIQVZg.js} +1 -1
  83. package/public/assets/{download-CAQcL8_2.js → download-eHZL3vO4.js} +1 -1
  84. package/public/assets/{external-link-FvIHStgA.js → external-link-CTxKtfbP.js} +1 -1
  85. package/public/assets/{git-fork-BP1TgVm_.js → git-fork-kMVtB1dL.js} +1 -1
  86. package/public/assets/{index-CbvYIryv.js → index-DAkTgbWG.js} +42 -42
  87. package/public/assets/{key-BvFrEADj.js → key-BKjhjxj3.js} +1 -1
  88. package/public/assets/{loader-circle-BMEwIEOC.js → loader-circle-BIYdUuqZ.js} +1 -1
  89. package/public/assets/{pencil-BqFS4_42.js → pencil-CurfHMN9.js} +1 -1
  90. package/public/assets/{plus-DD4TjVZi.js → plus-BxG7xxLK.js} +1 -1
  91. package/public/assets/{rotate-ccw-DPfDjC5H.js → rotate-ccw-DtrN6ZsT.js} +1 -1
  92. package/public/assets/{scroll-text-Cdl7phHH.js → scroll-text-CPH0IqKe.js} +1 -1
  93. package/public/assets/{settings-CsNMSeUW.js → settings-D9SSpSrL.js} +1 -1
  94. package/public/assets/{status-colors-DzMGFhKZ.js → status-colors-CpMMYfaI.js} +1 -1
  95. package/public/assets/{task-constants-DmpuTnwm.js → task-constants-OaoZ8T7Y.js} +1 -1
  96. package/public/assets/{trash-2-Dyd_X4uS.js → trash-2-4Pl5hgn8.js} +1 -1
  97. package/public/assets/{useFetch-Czyzp06l.js → useFetch-D61cXB6a.js} +1 -1
  98. package/public/assets/{users-Cok9LpO-.js → users-BKtzHB7o.js} +1 -1
  99. package/public/assets/{wifi-U3S68mli.js → wifi-CR4plBsH.js} +1 -1
  100. package/public/assets/{workflow-CbWymCow.js → workflow-0ws12_jq.js} +1 -1
  101. package/public/index.html +1 -1
  102. package/public/manifest.webmanifest +1 -1
  103. package/public/sw.js +1 -1
  104. package/public/assets/HomePage-kOecxD0_.js +0 -1
  105. package/public/assets/TaskDetailPage-Bj7vrwv0.js +0 -26
  106. package/public/assets/TerminalHomePage-DmYjzI7b.js +0 -11
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CbvYIryv.js";/**
1
+ import{c as e}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CbvYIryv.js";/**
1
+ import{c as e}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-CbvYIryv.js";/**
1
+ import{c as a}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CbvYIryv.js";/**
1
+ import{c as e}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-CbvYIryv.js";/**
1
+ import{c as t}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-CbvYIryv.js";/**
1
+ import{c as a}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-CbvYIryv.js";/**
1
+ import{c as a}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{W as r,p as e,a1 as s,a2 as u,Y as a}from"./index-CbvYIryv.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};
1
+ import{W as r,p as e,a1 as s,a2 as u,Y as a}from"./index-DAkTgbWG.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};
@@ -1 +1 @@
1
- import{o as i,h as n,p as c,F as T}from"./index-CbvYIryv.js";const h=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})}})),u=[c.COMPLETED,c.FAILED,c.CANCELLED],b=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],k=Object.values(T).map(t=>({value:t,label:t})),_=[{value:"",label:"default"},...k];export{_ as A,k as C,u as T,b as a,h as u};
1
+ import{o as T,h as n,p as c,F as i}from"./index-DAkTgbWG.js";const h=T((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})}})),u=[c.COMPLETED,c.FAILED,c.CANCELLED],b=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],k=Object.values(i).map(t=>({value:t,label:t})),E=[{value:"",label:"default"},...k];function _(t){return(t??i.CLAUDE).toLowerCase()}export{E as A,k as C,u as T,b as a,_ as g,h as u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CbvYIryv.js";/**
1
+ import{c as e}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as e}from"./index-CbvYIryv.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};
1
+ import{r as e}from"./index-DAkTgbWG.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};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CbvYIryv.js";/**
1
+ import{c as e}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CbvYIryv.js";/**
1
+ import{c as e}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-CbvYIryv.js";/**
1
+ import{c}from"./index-DAkTgbWG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
package/public/index.html CHANGED
@@ -28,7 +28,7 @@
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-CbvYIryv.js"></script>
31
+ <script type="module" crossorigin src="/assets/index-DAkTgbWG.js"></script>
32
32
  <link rel="stylesheet" crossorigin href="/assets/index-DMWyyiI3.css">
33
33
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
34
34
  <body>
@@ -1 +1 @@
1
- {"name":"Overlord","short_name":"Overlord","description":"AI Agent Fleet Management","start_url":"/","display":"standalone","background_color":"#171717","theme_color":"#22C55E","lang":"en","scope":"/","icons":[{"src":"icon-192x192.png","sizes":"192x192","type":"image/png","purpose":"any"},{"src":"icon-512x512.png","sizes":"512x512","type":"image/png","purpose":"any"},{"src":"icon-maskable-192x192.png","sizes":"192x192","type":"image/png","purpose":"maskable"},{"src":"icon-maskable-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}]}
1
+ {"name":"Overlord","short_name":"Overlord","description":"AI Agent Fleet Management","start_url":"/","display":"standalone","background_color":"#171717","theme_color":"#22C55E","lang":"en","scope":"/","orientation":"portrait","icons":[{"src":"icon-192x192.png","sizes":"192x192","type":"image/png","purpose":"any"},{"src":"icon-512x512.png","sizes":"512x512","type":"image/png","purpose":"any"},{"src":"icon-maskable-192x192.png","sizes":"192x192","type":"image/png","purpose":"maskable"},{"src":"icon-maskable-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}]}
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 u={};const a=s=>l(s,r),o={module:{uri:r},exports:u,require:a};e[r]=Promise.all(i.map(s=>o[s]||a(s))).then(s=>(n(...s),u))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"94e1e02326ac94f4575d266bf1407bec"},{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-CbWymCow.js",revision:null},{url:"assets/wifi-U3S68mli.js",revision:null},{url:"assets/users-Cok9LpO-.js",revision:null},{url:"assets/useFetch-Czyzp06l.js",revision:null},{url:"assets/trash-2-Dyd_X4uS.js",revision:null},{url:"assets/task-constants-DmpuTnwm.js",revision:null},{url:"assets/status-colors-DzMGFhKZ.js",revision:null},{url:"assets/settings-CsNMSeUW.js",revision:null},{url:"assets/scroll-text-Cdl7phHH.js",revision:null},{url:"assets/rotate-ccw-DPfDjC5H.js",revision:null},{url:"assets/plus-DD4TjVZi.js",revision:null},{url:"assets/pencil-BqFS4_42.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-BMEwIEOC.js",revision:null},{url:"assets/key-BvFrEADj.js",revision:null},{url:"assets/index-DMWyyiI3.css",revision:null},{url:"assets/index-CbvYIryv.js",revision:null},{url:"assets/git-fork-BP1TgVm_.js",revision:null},{url:"assets/external-link-FvIHStgA.js",revision:null},{url:"assets/download-CAQcL8_2.js",revision:null},{url:"assets/date-RFA7-ZGs.js",revision:null},{url:"assets/copy-DS3maJzX.js",revision:null},{url:"assets/chevron-right-BbeAvkMB.js",revision:null},{url:"assets/chevron-left-xzCRCgCf.js",revision:null},{url:"assets/bot-DO5AEPZ9.js",revision:null},{url:"assets/arrow-right-DZEEeomG.js",revision:null},{url:"assets/arrow-left-PTRz8m1_.js",revision:null},{url:"assets/WorkerSetupPage-CLOruE6A.js",revision:null},{url:"assets/WorkerSetupGuidePage-m-iSn-iM.js",revision:null},{url:"assets/WorkerOperationsPage-B3P0RNCo.js",revision:null},{url:"assets/WorkerListPage-C0rAZuEy.js",revision:null},{url:"assets/WorkerDetailPage-CE4-kfOS.js",revision:null},{url:"assets/TotpSetupPage-DjccU57R.js",revision:null},{url:"assets/Tooltip-BPOc-WnR.js",revision:null},{url:"assets/TokenManage-CyUVin7L.js",revision:null},{url:"assets/TerminalHomePage-DmYjzI7b.js",revision:null},{url:"assets/TaskStatusBadge-mCwzxB1W.js",revision:null},{url:"assets/TaskListPage-wY64PBlG.js",revision:null},{url:"assets/TaskDetailPage-Bj7vrwv0.js",revision:null},{url:"assets/SkillPage-BvcpkVCR.js",revision:null},{url:"assets/Skeleton-D6Pa0ZVm.js",revision:null},{url:"assets/SettingsPage-DZJf1o-J.js",revision:null},{url:"assets/Select-DqguHTDG.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-DTCM7tSO.js",revision:null},{url:"assets/QuickAuth-BJjb8FUv.js",revision:null},{url:"assets/PtyTerminal-BnlhlDB0.js",revision:null},{url:"assets/PtyTerminal-Beg8tuEN.css",revision:null},{url:"assets/ProjectListPage-CYcEgWyH.js",revision:null},{url:"assets/ProjectDetailPage-CNiRP1xl.js",revision:null},{url:"assets/ProfilePage-DELsbzEP.js",revision:null},{url:"assets/PipelineEditorPage-EWSpEJ5f.js",revision:null},{url:"assets/PipelineConfigPage-Dpg_1f8s.js",revision:null},{url:"assets/PermissionsPage-gn5TccJJ.js",revision:null},{url:"assets/OnboardingGuide-Da2v37e-.js",revision:null},{url:"assets/NotFoundPage-C0EcsleR.js",revision:null},{url:"assets/MetricBar-eTMDxsUA.js",revision:null},{url:"assets/LoginPage-DxhouRBW.js",revision:null},{url:"assets/LocalDevelopmentPage-DKZu2NH2.js",revision:null},{url:"assets/LandingPage-B29hFr5l.js",revision:null},{url:"assets/InstallationPage-BI1eTsYg.js",revision:null},{url:"assets/InfoRow-Y1sU0G2n.js",revision:null},{url:"assets/HomePage-kOecxD0_.js",revision:null},{url:"assets/EnvVariablesPage-fLXzba5e.js",revision:null},{url:"assets/EmptyState-mJyWr5uH.js",revision:null},{url:"assets/EditProjectPage-D0JZ_TKw.js",revision:null},{url:"assets/DocsPrimitives-DX-7e1im.js",revision:null},{url:"assets/DocsLayout-BY6F_ywj.js",revision:null},{url:"assets/DocsIndexPage-D_GPFyTY.js",revision:null},{url:"assets/DeveloperSetupPage-bXuJM2eH.js",revision:null},{url:"assets/DeveloperManage-CpSvUtkr.js",revision:null},{url:"assets/DevWorkflowPage-CqU3wVnM.js",revision:null},{url:"assets/DeploymentPage-Cq1gui8d.js",revision:null},{url:"assets/CliReferencePage-ejyySCuq.js",revision:null},{url:"assets/ChangelogPage-C3gSpp3g.js",revision:null},{url:"assets/BotSetupPage-BKSV06rk.js",revision:null},{url:"assets/BotManage-Db0KRZ8H.js",revision:null},{url:"assets/BotIntegrationPage-DhApmTBA.js",revision:null},{url:"assets/BindPlatformPage-rtjDTUn-.js",revision:null},{url:"assets/AuditLogPage-BGxaXcKz.js",revision:null},{url:"assets/ArchitecturePage-DZqBL3l7.js",revision:null},{url:"assets/ApiReferencePage-DIYFxzq0.js",revision:null},{url:"assets/AgentCliPage-D7QPKJpY.js",revision:null},{url:"assets/AdminPage-BfQmSXQa.js",revision:null},{url:"assets/AccessTokensPage-B1G2-mUi.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"manifest.webmanifest",revision:"fefa2ba09d815fe1773d1fdaaf97d9e5"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"))),s.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new s.CacheFirst({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),s.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new s.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new s.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3})]}),"GET")});
1
+ if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let a={};const u=s=>l(s,r),o={module:{uri:r},exports:a,require:u};e[r]=Promise.all(i.map(s=>o[s]||u(s))).then(s=>(n(...s),a))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"71f32c35004c96ec81f14cc51f6b095f"},{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-0ws12_jq.js",revision:null},{url:"assets/wifi-CR4plBsH.js",revision:null},{url:"assets/users-BKtzHB7o.js",revision:null},{url:"assets/useFetch-D61cXB6a.js",revision:null},{url:"assets/trash-2-4Pl5hgn8.js",revision:null},{url:"assets/task-constants-OaoZ8T7Y.js",revision:null},{url:"assets/status-colors-CpMMYfaI.js",revision:null},{url:"assets/settings-D9SSpSrL.js",revision:null},{url:"assets/scroll-text-CPH0IqKe.js",revision:null},{url:"assets/rotate-ccw-DtrN6ZsT.js",revision:null},{url:"assets/plus-BxG7xxLK.js",revision:null},{url:"assets/pencil-CurfHMN9.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-BIYdUuqZ.js",revision:null},{url:"assets/key-BKjhjxj3.js",revision:null},{url:"assets/index-DMWyyiI3.css",revision:null},{url:"assets/index-DAkTgbWG.js",revision:null},{url:"assets/git-fork-kMVtB1dL.js",revision:null},{url:"assets/external-link-CTxKtfbP.js",revision:null},{url:"assets/download-eHZL3vO4.js",revision:null},{url:"assets/date-RFA7-ZGs.js",revision:null},{url:"assets/copy-BdjIQVZg.js",revision:null},{url:"assets/chevron-right-9GGZyR6N.js",revision:null},{url:"assets/chevron-left-yEb7hDVz.js",revision:null},{url:"assets/bot-DsoXb524.js",revision:null},{url:"assets/arrow-right-BOajnkxo.js",revision:null},{url:"assets/arrow-left-BDSgdusw.js",revision:null},{url:"assets/WorkerSetupPage-C2r1Zi4Z.js",revision:null},{url:"assets/WorkerSetupGuidePage-BOvjn4RL.js",revision:null},{url:"assets/WorkerOperationsPage-DW9AJtYD.js",revision:null},{url:"assets/WorkerListPage-DEiTRhPm.js",revision:null},{url:"assets/WorkerDetailPage-bOwxux_n.js",revision:null},{url:"assets/TotpSetupPage-D4jIjEla.js",revision:null},{url:"assets/Tooltip-DZz2zdfO.js",revision:null},{url:"assets/TokenManage-30D7q4lk.js",revision:null},{url:"assets/TerminalHomePage-UBr5yN3b.js",revision:null},{url:"assets/TaskStatusBadge-Z50SCZY9.js",revision:null},{url:"assets/TaskListPage-CVA7Ujw9.js",revision:null},{url:"assets/TaskDetailPage-lkhZX_5H.js",revision:null},{url:"assets/SkillPage-CTvQUNvZ.js",revision:null},{url:"assets/Skeleton-Kj4rVptL.js",revision:null},{url:"assets/SettingsPage-D_-cbHE0.js",revision:null},{url:"assets/Select-Cnz6OMVU.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-DV3LHFVJ.js",revision:null},{url:"assets/QuickAuth-DLFmIjpX.js",revision:null},{url:"assets/PtyTerminal-VS56WKLO.js",revision:null},{url:"assets/PtyTerminal-Beg8tuEN.css",revision:null},{url:"assets/ProjectListPage-DDiQLEie.js",revision:null},{url:"assets/ProjectDetailPage-C9pM6Woi.js",revision:null},{url:"assets/ProfilePage-CIDz5YeD.js",revision:null},{url:"assets/PipelineEditorPage-DcWEfi_A.js",revision:null},{url:"assets/PipelineConfigPage-B2LYXsq5.js",revision:null},{url:"assets/PermissionsPage-g_8tHOBE.js",revision:null},{url:"assets/OnboardingGuide-DNTJ78K8.js",revision:null},{url:"assets/NotFoundPage-CMuv-KhW.js",revision:null},{url:"assets/MetricBar-CEMnsJOi.js",revision:null},{url:"assets/LoginPage-BbyRZjiW.js",revision:null},{url:"assets/LocalDevelopmentPage-CA3xCluE.js",revision:null},{url:"assets/LandingPage-DKnU-mvA.js",revision:null},{url:"assets/InstallationPage-CUgF5YTY.js",revision:null},{url:"assets/InfoRow-enN7id8N.js",revision:null},{url:"assets/HomePage-M-fiv0p_.js",revision:null},{url:"assets/EnvVariablesPage-D9Ja85G7.js",revision:null},{url:"assets/EmptyState-CytgiY9L.js",revision:null},{url:"assets/EditProjectPage-CABV9tuN.js",revision:null},{url:"assets/DocsPrimitives-D0E69i2N.js",revision:null},{url:"assets/DocsLayout-CKlbtNeH.js",revision:null},{url:"assets/DocsIndexPage-BSAn3ZJa.js",revision:null},{url:"assets/DeveloperSetupPage-DF7Xs0c9.js",revision:null},{url:"assets/DeveloperManage-BWOYBP-t.js",revision:null},{url:"assets/DevWorkflowPage-Osg4WAt3.js",revision:null},{url:"assets/DeploymentPage-CYaF1OrQ.js",revision:null},{url:"assets/CliReferencePage-EPI6nOO3.js",revision:null},{url:"assets/ChangelogPage-az9QSZvX.js",revision:null},{url:"assets/BotSetupPage-r2UPpNNb.js",revision:null},{url:"assets/BotManage-CofWqcVs.js",revision:null},{url:"assets/BotIntegrationPage-B8awI2LD.js",revision:null},{url:"assets/BindPlatformPage-DSIzkccU.js",revision:null},{url:"assets/AuditLogPage-DTmZ-f__.js",revision:null},{url:"assets/ArchitecturePage-1LCElBkH.js",revision:null},{url:"assets/ApiReferencePage-DvMZOSc3.js",revision:null},{url:"assets/AgentCliPage-B9B64zCv.js",revision:null},{url:"assets/AdminPage-BvFj4q7-.js",revision:null},{url:"assets/AccessTokensPage-DCFrCMzE.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{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-CbvYIryv.js";import{T as C}from"./TaskStatusBadge-mCwzxB1W.js";import{T as y}from"./Skeleton-D6Pa0ZVm.js";import{O as z}from"./OnboardingGuide-Da2v37e-.js";import{f as _}from"./date-RFA7-ZGs.js";import{g as H}from"./status-colors-DzMGFhKZ.js";import{u as b}from"./useFetch-Czyzp06l.js";import{T as R}from"./Tooltip-BPOc-WnR.js";import{A as k}from"./arrow-right-DZEEeomG.js";import"./chevron-right-BbeAvkMB.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-4 md:hidden",children:e.jsx("span",{className:"text-base font-bold text-[var(--accent)]",children:a("dashboard.title")})}),e.jsx("div",{className:"mb-6 md:mb-8 grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children: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,26 +0,0 @@
1
- import{c as Q,a as Y,r,h as g,j as e,M as ot,z as A,H as xt,t as J,v as ke,A as dt,f as mt,B as pt,q as ut,s as ht,k as Ke,p as D,l as We,m as ft,L as vt,X as ve,E as Xe,n as bt,x as gt,G as jt}from"./index-CbvYIryv.js";import{u as Nt,T as yt}from"./task-constants-DmpuTnwm.js";import{C as kt,H as He,P as Ve}from"./PtyTerminal-BnlhlDB0.js";import{a as wt,b as _t,f as re}from"./date-RFA7-ZGs.js";import{S as Ct}from"./Select-DqguHTDG.js";import{a as St}from"./status-colors-DzMGFhKZ.js";import{T as Et}from"./Tooltip-BPOc-WnR.js";import{A as Tt}from"./arrow-left-PTRz8m1_.js";import{R as be}from"./rotate-ccw-DPfDjC5H.js";import{G as Lt}from"./git-fork-BP1TgVm_.js";import{E as Dt}from"./external-link-FvIHStgA.js";import{L as ge}from"./loader-circle-BMEwIEOC.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 Je=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 It=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 $t=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 Rt=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 Pt=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 Qe({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(ot,{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(kt,{className:"h-3.5 w-3.5"}),wt(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 At(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 Ye(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 Ze(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 Ft({taskId:l,taskFinished:c,compact:a}){const{t:n}=Y(),[t,m]=r.useState(A.IDLE),[p,b]=r.useState(null),[u,_]=r.useState(null),[C,$]=r.useState(""),[o,j]=r.useState(!1),[le,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 ce(){S(),M.current=setInterval(R,5e3)}function S(){M.current&&(clearInterval(M.current),M.current=null)}r.useEffect(()=>{c&&(t===A.STARTING||t===A.CONNECTED)&&(m(A.IDLE),b(null),S())},[c,t]),r.useEffect(()=>{if(t!=="CONNECTED"||!u)return;const f=()=>{const E=At(u,n);$(E),E===n("tasks.tunnel_expired")&&(m(A.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(A.STARTING),ce()}catch(f){let I=n("tasks.tunnel_start_failed");try{if(f instanceof xt){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(A.IDLE),b(null),S()}catch{}finally{j(!1)}}async function ie(){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:Ye(t)},children:Ze(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:Ye(t)},children:["● ",Ze(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:ie,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"),"]"]})]}),le&&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 Mt({isOpen:l,onClose:c,onConfirm:a,taskId:n,isLoading:t}){const{t:m}=Y();return e.jsx(ke,{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 Ot({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(ke,{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 je=["implement","test","verify","review","simplify","submit"];function ye(l){if(typeof l=="string")try{return ye(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 qt(l){if(!l.configSnapshot)return je;try{const c=JSON.parse(l.configSnapshot);return ye(c.pipeline)??ye(c)??je}catch{return je}}function Ut(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 Ne({status:l}){const c=St(l);return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-0.5 text-xs",style:{color:c},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-[3px]",style:{backgroundColor:c}}),l.toLowerCase()]})}function Gt(l){const c=qt(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 ne(l,c){if(!l||!c)return null;const a=l.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),n=c.split("/").map(encodeURIComponent).join("/");return l.gitPlatform===jt.GITLAB?`${a}/-/tree/${n}`:`${a}/tree/${n}`}function ts(){var ze,Be;const{id:l}=dt(),c=mt(),{t:a}=Y(),n=Nt(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),[le,F]=r.useState(!1),[M,R]=r.useState(!1),[ce,S]=r.useState(!1),[K,W]=r.useState(!1),[ie,f]=r.useState(!1),[I,E]=r.useState(!1),[we,_e]=r.useState(""),[Ce,oe]=r.useState(!1),[Se,et]=pt(),[k,xe]=r.useState("terminal"),[Ee,Te]=r.useState([]),[Z,Le]=r.useState(0),[X,O]=r.useState(0),[H,De]=r.useState(""),[ee,tt]=r.useState(""),[st,de]=r.useState(!1),[at,Ie]=r.useState(!1),[q,me]=r.useState(null),[T,$e]=r.useState("disconnected"),[V,Re]=r.useState("auto"),U=r.useRef(null),Pe=r.useRef(null),x=Number(l),v=t?yt.includes(t.status):!1;ut(t?ht(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]),Ae=r.useCallback(async()=>{de(!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();Te(i.events),Le(i.total)}catch{}finally{de(!1)}},[x,X,H,ee]);r.useEffect(()=>{k==="logs"&&Ae()},[k,Ae]),r.useEffect(()=>{k==="pipeline"&&!v&&g.get(`web/workspaces/${x}`).json().then(me).catch(()=>me(null))},[k,x,v]);const z=Ke(s=>s.lastEvent),Fe=Ke(s=>s.eventSeq);r.useEffect(()=>{$(!0),m(null),b(null),_([]),j(null),me(null),Te([]),Le(0),O(0),de(!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||Fe===0||(z.event==="task_status_changed"&&z.taskId===x||z.event==="task_created"&&z.taskId===x)&&(L(),G())},[Fe,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 Me=r.useCallback(()=>j(null),[]),se=r.useCallback(()=>{j(null),L()},[L]),rt=(t==null?void 0:t.status)===D.FAILED||(t==null?void 0:t.status)===D.CANCELLED,pe=(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(()=>{Se.get("action")==="fork"&&t&&!C&&(pe&&Oe(),et(s=>(s.delete("action"),s),{replace:!0}))},[t,C,Se,pe]);async function nt(){W(!0);try{await n(x),F(!1),await L()}finally{W(!1)}}async function lt(){f(!0);try{await g.post(`web/tasks/${x}/retry`,{json:{reuseWorkspace:Ce}}),R(!1),oe(!1),await L()}finally{f(!1)}}function Oe(){_e(""),S(!0)}async function ct(){E(!0);try{const s=await g.post(`web/tasks/${x}/fork`,{json:{description:we||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?Gt(t):[],[t==null?void 0:t.configSnapshot,t==null?void 0:t.currentStage,t==null?void 0:t.status]),ue=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=_t(t.startedAt,t.completedAt),qe=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,Ue=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(Tt,{className:"h-4 w-4"})}),e.jsxs("span",{className:"line-clamp-2 text-sm font-medium text-[var(--text-primary)]",title:ft(t),children:["#",t.id," ",We(t,100)]})]}),he=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(Ne,{status:t.status}),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(vt,{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: ",ne(p,t.branch)?e.jsx("a",{href:ne(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: ",((ze=t.mrUrl.match(/!?\d+$/))==null?void 0:ze[0])??"view"]})]})]}),Ge=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(ve,{className:"h-3 w-3"}),a("tasks.cancel_task")]}),rt&&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(be,{className:"h-3 w-3"}),a("tasks.retry_task")]}),pe&&e.jsxs("button",{onClick:Oe,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(Lt,{className:"h-3 w-3"}),a("tasks.fork_task")]}),t.workerId&&!v&&e.jsxs("button",{onClick:()=>{xe("pipeline"),setTimeout(()=>{var s,i;(i=(s=Pe.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(Dt,{className:"h-3 w-3"}),a("tasks.cursor_tunnel")]})]}),it=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(Xe,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),d&&e.jsx(ge,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),h&&e.jsx(ve,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),s.status==="pending"&&e.jsx(Je,{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")})]})]}),fe=e.jsxs(e.Fragment,{children:[e.jsx(Mt,{isOpen:le,onClose:()=>F(!1),onConfirm:nt,taskId:x,isLoading:K}),e.jsx(Ot,{isOpen:M,onClose:()=>{R(!1),oe(!1)},onConfirm:lt,taskId:x,mrUrl:t.mrUrl??void 0,isLoading:ie,reuseWorkspace:Ce,onReuseWorkspaceChange:oe}),e.jsx(ke,{isOpen:ce,onClose:()=>S(!1),onConfirm:ct,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:we,onChange:s=>_e(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 at&&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:[he,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.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(He,{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(be,{className:"h-3 w-3"}),a("tasks.restore_auto")]}),t.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--accent)]",children:[a("tasks.stage"),": ",t.currentStage]}),e.jsx("button",{onClick:()=>Ie(!1),className:"flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1 text-[var(--text-muted)]",children:e.jsx(Rt,{className:"h-3 w-3"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(Ve,{ref:U,taskId:x,sessionId:t.currentSessionId??void 0,taskFinished:v,onStatusChange:$e,onTakeoverChange:Re})}),Ge,fe]}):t.status===D.SUSPENDED?e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[Ue,he,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(Et,{content:bt(t),children:We(t,200)})}),e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:a("tasks.status_suspended")})]}),e.jsx("div",{className:"flex items-center gap-2 md:hidden",children:e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:a("tasks.status_suspended")})}),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:"suspended"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:re(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",P=s.status==="running"&&t.status===D.SUSPENDED,B=d?"var(--destructive)":h?"var(--accent)":P?"var(--warning)":"#525252",ae=d?"rgba(239,68,68,0.12)":h?"rgba(34,197,94,0.12)":P?"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:ae,fontWeight:P?700:400,border:P?`1px solid ${B}`:void 0},children:P?"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:"suspended"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:a("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2",children: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:re(t.createdAt)})]})})]})]}),o&&e.jsx(Qe,{isOpen:!!o,onClose:Me,taskId:x,stageName:o.stageName,timeoutSeconds:Math.ceil(o.timeout/1e3),onSubmitted:se}),fe]}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden font-mono lowercase",children:[Ue,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(Ne,{status:t.status}),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&&(ne(p,t.branch)?e.jsx("a",{href:ne(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}))]}),he,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(It,{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(Qe,{isOpen:!!o,onClose:Me,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:()=>xe(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.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(He,{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(be,{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(ge,{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(Pt,{className:"h-3 w-3"}),a("tasks.skip_stage")]}),e.jsx("button",{onClick:()=>Ie(!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($t,{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(Ne,{status:t.status}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["on ",t.workerName]})]}),e.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:a("tasks.stage_progress")}),e.jsx("div",{className:"mt-2 overflow-x-auto no-scrollbar pr-4",style:{borderRadius:0},children:e.jsx("div",{className:"flex items-center gap-1 py-0.5",children: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(Ve,{ref:U,taskId:x,sessionId:t.currentSessionId??void 0,taskFinished:v,onStatusChange:$e,onTakeoverChange:Re})}),Ge]}),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",ae=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:ae},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:ae},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<(ue>=0?ue: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," (",ue+1,"/",N.length,")"]}),t.startedAt&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",re(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:()=>xe("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??"-"})]}),qe]})]}),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(Xe,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),d&&e.jsx(ge,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),h&&e.jsx(ve,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),s.status==="pending"&&e.jsx(Je,{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:()=>{De(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(Ct,{value:H,onChange:s=>{De(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(gt,{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=>{tt(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:[Ee.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 ${Ut(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)),Ee.length===0&&!st&&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"&&it,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:re(t.createdAt)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.agentType??"claude"})]}),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})]}),qe]})]}),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:((Be=t.mrUrl.match(/!?\d+$/))==null?void 0:Be[0])??"view"})]})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{ref:Pe,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(Ft,{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)})})]})]})]}),fe]})}export{ts as default};
@@ -1,11 +0,0 @@
1
- import{c as Z,o as ce,h as M,p as y,a as P,r as c,k as q,q as le,s as oe,j as e,X as ee,v as de,f as xe,l as me,m as ue}from"./index-CbvYIryv.js";import{T as H,u as pe,a as z,C as G}from"./task-constants-DmpuTnwm.js";import{P as he,H as fe,C as ve}from"./PtyTerminal-BnlhlDB0.js";import{i as J,O as te}from"./OnboardingGuide-Da2v37e-.js";import{S as C,C as ge}from"./Select-DqguHTDG.js";import{a as se}from"./status-colors-DzMGFhKZ.js";import{a as be}from"./date-RFA7-ZGs.js";import{u as ae}from"./useFetch-Czyzp06l.js";import{P as $}from"./plus-DD4TjVZi.js";import{R as je}from"./rotate-ccw-DPfDjC5H.js";import{W as ke}from"./wifi-U3S68mli.js";import"./chevron-right-BbeAvkMB.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 Ne=Z("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
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 ye=Z("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),ne="overlord_home_terminal";function we(){try{const t=localStorage.getItem(ne);if(t)return JSON.parse(t)}catch{}return{pinnedTaskIds:[],activeTaskId:null}}let Y="";function U(t){const a=JSON.stringify(t);a!==Y&&(Y=a,localStorage.setItem(ne,a))}const Q=we(),Te=new Set([y.QUEUED,y.ASSIGNED,y.RUNNING,y.SUSPENDED]);let L=!1;const Se=ce((t,a)=>({pinnedTaskIds:Q.pinnedTaskIds,activeTaskId:Q.activeTaskId,taskMetas:{},stageConfirm:null,loading:!1,setActiveTask:s=>{t({activeTaskId:s}),U({pinnedTaskIds:a().pinnedTaskIds,activeTaskId:s})},pinTask:s=>{const{pinnedTaskIds:n}=a();if(n.includes(s))return;const l=[...n,s];t({pinnedTaskIds:l}),U({pinnedTaskIds:l,activeTaskId:a().activeTaskId})},unpinTask:s=>{const{pinnedTaskIds:n,activeTaskId:l,taskMetas:x}=a(),r=n.filter(h=>h!==s),d=l===s?r[0]??null:l,{[s]:p,...i}=x;t({pinnedTaskIds:r,activeTaskId:d,taskMetas:i}),U({pinnedTaskIds:r,activeTaskId:d})},loadActiveTasks:async()=>{if(!L){L=!0,t({loading:!0});try{const n=(await M.get("web/tasks",{searchParams:{limit:"30"}}).json()).data.filter(i=>Te.has(i.status)),l={};for(const i of n)l[i.id]={id:i.id,name:i.name,description:i.description,status:i.status,projectKey:i.projectKey,currentStage:i.currentStage,currentSessionId:i.currentSessionId,updatedAt:i.updatedAt};const r=[...n].sort((i,h)=>h.updatedAt.localeCompare(i.updatedAt)).map(i=>i.id),{activeTaskId:d}=a(),p=d&&r.includes(d)?d:r[0]??null;t({taskMetas:l,pinnedTaskIds:r,activeTaskId:p}),U({pinnedTaskIds:r,activeTaskId:p})}catch{}finally{L=!1,t({loading:!1})}}},fetchStageConfirm:async s=>{try{const n=await M.get(`web/tasks/${s}/pending-confirm`).json();t({stageConfirm:n.confirm})}catch{t({stageConfirm:null})}},clearStageConfirm:()=>t({stageConfirm:null}),updateTaskMeta:(s,n)=>{const{taskMetas:l}=a(),x=l[s];x&&t({taskMetas:{...l,[s]:{...x,...n}}})}}));function Ce(){const[t,a]=c.useState(()=>J());c.useEffect(()=>{const n=()=>a(!0),l=()=>a(J());return window.addEventListener("onboarding-dismissed",n),window.addEventListener("storage",l),()=>{window.removeEventListener("onboarding-dismissed",n),window.removeEventListener("storage",l)}},[]);const{data:s}=ae(()=>t?Promise.resolve(null):M.get("web/dashboard/stats").json(),[t]);return t||!s?null:{activeTasks:(s.active_tasks??0)+(s.queued_tasks??0),totalWorkers:s.online_workers??0,totalProjects:s.project_count??0,totalDevelopers:s.developer_count??0}}function _e({taskId:t,confirm:a,onSubmitted:s}){const{t:n}=P(),[l,x]=c.useState(a.timeout),[r,d]=c.useState(!1);c.useEffect(()=>{x(a.timeout);const i=setInterval(()=>{x(h=>h<=1?(clearInterval(i),0):h-1)},1e3);return()=>clearInterval(i)},[a.timeout,a.stageName]);const p=c.useCallback(async i=>{d(!0);try{await M.post(`web/tasks/${t}/confirm-stage`,{json:{stageName:a.stageName,approved:i}}),s()}catch{}finally{d(!1)}},[t,a.stageName,s]);return e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b-2 border-[var(--warning)] bg-[var(--warning)]/10 px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ve,{className:"h-3.5 w-3.5 shrink-0 text-[var(--warning)]"}),e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["// stage: ",a.stageName]}),e.jsx("span",{className:"shrink-0 text-xs text-[var(--warning)]",children:be(l)})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("button",{onClick:()=>p(!1),disabled:r,className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:n("tasks.reject")}),e.jsx("button",{onClick:()=>p(!0),disabled:r,className:"rounded-[4px] bg-[var(--accent)] px-2 py-1 text-[11px] text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:n(r?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})}function Ie({projectKey:t,onProjectChange:a,onCreated:s}){const{t:n}=P(),l=pe(u=>u.createTask),[x,r]=c.useState(""),[d,p]=c.useState("feat"),[i,h]=c.useState(void 0),[f,_]=c.useState(!1),[I,E]=c.useState(!1),[F,D]=c.useState(!1),{data:w}=ae(()=>M.get("web/projects").json(),[]),v=c.useMemo(()=>{const u=(w??[]).map(R=>({value:R.key,label:R.key}));return[{value:"",label:n("terminal_home.all_projects")},...u]},[w,n]),g=c.useMemo(()=>(w??[]).find(u=>u.key===t)??null,[w,t]),b=c.useRef(!1);c.useEffect(()=>{if(!b.current){if(t){b.current=!0;return}v.length>1&&(a(v[1].value),b.current=!0)}},[t,v,a]),c.useEffect(()=>{h(void 0)},[t]);const A=i??(g==null?void 0:g.agentType)??"",m=c.useCallback(u=>{if(!g||u===g.agentType){h(void 0);return}h(u)},[g]),T=!!t&&!!x.trim();function N(){T&&E(!0)}async function k(){if(E(!1),!!T){_(!0);try{const u=await l({projectKey:t,description:x.trim(),taskType:d,agentType:i||void 0});r(""),s(u.id)}catch{}finally{_(!1)}}}const S=n("terminal_home.confirm_create_message").replace("{taskType}",d).replace("{projectKey}",t).replace("{description}",x.trim()),O="flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex items-center gap-2 border-b border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:[e.jsx("div",{className:"w-[140px]",children:e.jsx(C,{value:t,onChange:a,options:v,placeholder:n("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(C,{value:d,onChange:p,options:z})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(C,{value:A,onChange:m,options:G,placeholder:n("tasks.form_agent_type"),disabled:f||!t})}),e.jsx("input",{type:"text",value:x,onChange:u=>r(u.target.value),onKeyDown:u=>u.key==="Enter"&&N(),placeholder:n("terminal_home.task_description_placeholder"),className:O,disabled:f}),e.jsxs("button",{onClick:N,disabled:f||!T,className:"flex items-center gap-1 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:[e.jsx($,{className:"h-3 w-3"}),n(f?"common.creating":"terminal_home.new_task")]})]}),e.jsx("div",{className:"md:hidden border-b border-[var(--border)] bg-[var(--bg-card)]",children:F?e.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(C,{value:t,onChange:a,options:v,placeholder:n("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(C,{value:d,onChange:p,options:z})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(C,{value:A,onChange:m,options:G,placeholder:n("tasks.form_agent_type"),disabled:f||!t})}),e.jsx("button",{onClick:()=>D(!1),className:"p-1 text-[var(--text-muted)]",children:e.jsx(ee,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:x,onChange:u=>r(u.target.value),onKeyDown:u=>u.key==="Enter"&&N(),placeholder:n("terminal_home.task_description_placeholder"),className:O,disabled:f}),e.jsx("button",{onClick:N,disabled:f||!T,className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:e.jsx($,{className:"h-3 w-3"})})]})]}):e.jsxs("button",{onClick:()=>D(!0),className:"flex w-full items-center justify-center gap-1 py-2 text-xs text-[var(--accent)] hover:opacity-80",children:[e.jsx($,{className:"h-3.5 w-3.5"}),n("terminal_home.new_task")]})}),e.jsx(de,{isOpen:I,onClose:()=>E(!1),onConfirm:k,title:n("terminal_home.confirm_create_title"),message:S,confirmVariant:"accent",confirmLabel:n("terminal_home.new_task"),isLoading:f})]})}function V({status:t,size:a}){const s=t===y.SUSPENDED,n=se(t),l=a==="sm"?"h-1.5 w-1.5":"h-2 w-2";return e.jsx("span",{className:`${l} shrink-0 rounded-full ${s?"animate-pulse":""}`,style:{backgroundColor:s?"var(--warning)":n}})}function Ee({tasks:t,activeId:a,onSelect:s,onUnpin:n,children:l}){const x=xe();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex flex-col border-r border-[var(--border)] bg-[var(--bg-card)] overflow-y-auto",style:{width:200,minWidth:200},children:[e.jsx("div",{className:"border-b border-[var(--border)] px-3 py-2",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// active tasks"})}),t.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):e.jsx("div",{className:"flex-1",children:t.map(r=>{const d=r.id===a;return e.jsxs("div",{onClick:()=>s(r.id),className:`group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${d?"bg-[var(--accent)]/10 text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.jsx(V,{status:r.status,size:"md"}),e.jsxs("div",{className:"flex-1 min-w-0",title:ue(r),children:[e.jsxs("div",{className:"truncate text-xs",children:["#",r.id," ",me(r)]}),e.jsx("div",{className:"text-[10px] text-[var(--text-muted)]",children:r.projectKey})]}),e.jsx("button",{onClick:p=>{p.stopPropagation(),n(r.id)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--text-primary)]",title:"unpin",children:e.jsx(ee,{className:"h-3 w-3"})}),e.jsx("button",{onClick:p=>{p.stopPropagation(),x(`/tasks/${r.id}`)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--accent)]",title:"open detail",children:e.jsx("span",{className:"text-[10px] leading-none",children:"→"})})]},r.id)})})]}),e.jsxs("div",{className:"flex flex-col md:hidden",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar border-b border-[var(--border)] bg-[var(--bg-card)] px-2",style:{height:44},children:t.length===0?e.jsx("div",{className:"flex items-center justify-center w-full",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):t.map(r=>{const d=r.id===a;return e.jsxs("button",{onClick:()=>s(r.id),className:`flex shrink-0 items-center gap-1.5 px-3 border-b-2 transition-colors ${d?"border-[var(--accent)] text-[var(--text-primary)]":"border-transparent text-[var(--text-secondary)]"}`,style:{height:44},children:[e.jsx(V,{status:r.status,size:"sm"}),e.jsxs("span",{className:"text-[11px] whitespace-nowrap",children:["#",r.id]})]},r.id)})}),l]})]})}function Ae({task:t,takeoverState:a,onTakeover:s,onRelease:n}){const l=se(t.status),x=a==="manual";return e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:36,minHeight:36},children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:t.projectKey}),e.jsx("span",{className:"text-[11px]",style:{color:l},children:t.status.toLowerCase()}),t.currentStage&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["// ",t.currentStage]})]}),e.jsx("div",{className:"flex items-center gap-1",children:!H.includes(t.status)&&(x?e.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 rounded-[4px] px-2.5 py-0.5 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(je,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden md:inline",children:"restore auto"})]}):e.jsxs("button",{onClick:s,disabled:a==="requesting",className:"flex items-center gap-1.5 rounded-[4px] px-2.5 py-0.5 text-[11px] font-medium text-[var(--warning)] disabled:opacity-50",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:[e.jsx(fe,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden md:inline",children:"take over"})]}))})]})}function Me({task:t,ptyStatus:a}){const s=a==="connected";return e.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:28,minHeight:28},children:[e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:t.currentStage?`stage: ${t.currentStage}`:`task #${t.id}`}),e.jsxs("span",{className:`flex items-center gap-1 text-[10px] ${s?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:[s?e.jsx(ke,{className:"h-2.5 w-2.5"}):e.jsx(ye,{className:"h-2.5 w-2.5"}),s?"connected":a]})]})}function K({onboardingData:t}){const[a,s]=c.useState(!1),{t:n}=P();return t?a?e.jsxs("div",{className:"border-b border-[var(--accent)]/30",children:[e.jsxs("button",{onClick:()=>s(!1),className:"flex w-full items-center justify-between bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:n("onboarding.getting_started")}),e.jsx(Ne,{className:"h-3 w-3 text-[var(--text-muted)]"})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx(te,{data:t})})]}):e.jsxs("button",{onClick:()=>s(!0),className:"flex w-full items-center justify-between border-b border-[var(--accent)]/30 bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",style:{height:36},children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:n("onboarding.getting_started")}),e.jsx(ge,{className:"h-3 w-3 text-[var(--text-muted)]"})]}):null}function X({onboardingData:t}){const{t:a}=P();return e.jsx("div",{className:`flex flex-1 flex-col items-center p-4 md:p-6 ${t?"overflow-auto":"justify-center"}`,children:t?e.jsx("div",{className:"w-full max-w-lg",children:e.jsx(te,{data:t})}):e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"mb-3 text-3xl text-[var(--border)]",children:[">","_"]}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("terminal_home.no_active_tasks")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("terminal_home.create_task_hint")})]})})}function ze(){const{t}=P(),{pinnedTaskIds:a,activeTaskId:s,taskMetas:n,stageConfirm:l,loading:x,setActiveTask:r,pinTask:d,unpinTask:p,loadActiveTasks:i,fetchStageConfirm:h,clearStageConfirm:f,updateTaskMeta:_}=Se(),I=c.useRef(null),[E,F]=c.useState("disconnected"),[D,w]=c.useState("auto"),[v,g]=c.useState(""),b=q(o=>o.lastEvent),A=q(o=>o.status),m=s?n[s]??null:null,T=m?H.includes(m.status):!1,N=c.useRef(!1);c.useEffect(()=>{!N.current&&m&&(g(m.projectKey),N.current=!0)},[m]);const k=c.useMemo(()=>{const o=a.map(j=>n[j]).filter(Boolean);return v?o.filter(j=>j.projectKey===v):o},[a,n,v]);c.useEffect(()=>{k.length>0&&s&&!k.some(o=>o.id===s)&&r(k[0].id)},[k,s,r]);const S=Ce();le(m?oe(m):null),c.useEffect(()=>{i()},[i]),c.useEffect(()=>{s&&(m==null?void 0:m.status)===y.SUSPENDED?h(s):f()},[s,m==null?void 0:m.status,h,f]),c.useEffect(()=>{if(b){if(b.event==="task_status_changed"){const{taskId:o,status:j,currentStage:B}=b,W={status:j,updatedAt:new Date().toISOString()};B!==void 0&&(W.currentStage=B),_(o,W),j===y.SUSPENDED&&o===s&&h(o),H.includes(j)&&o===s&&f()}b.event==="task_created"&&i()}},[b,s,h,f,_,i]),c.useEffect(()=>{if(A==="connected")return;const j=setInterval(()=>{document.visibilityState!=="hidden"&&i()},15e3);return()=>clearInterval(j)},[A,i]);const O=c.useCallback(o=>{d(o),r(o),i()},[d,r,i]),u=c.useCallback(()=>{f(),i()},[f,i]),R=c.useCallback(()=>{var o;(o=I.current)==null||o.requestTakeover()},[]),re=c.useCallback(()=>{var o;(o=I.current)==null||o.releaseTakeover()},[]);if(x&&a.length===0)return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("common.loading")})});const ie=k.length>0;return e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsx(Ie,{projectKey:v,onProjectChange:g,onCreated:O}),e.jsx("div",{className:"flex flex-col md:flex-row flex-1 overflow-hidden",children:ie?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{tasks:k,activeId:s,onSelect:r,onUnpin:p,children:e.jsx("div",{className:"md:hidden",children:e.jsx(K,{onboardingData:S})})}),e.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:m?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(K,{onboardingData:S})}),e.jsx(Ae,{task:m,takeoverState:D,onTakeover:R,onRelease:re}),l&&s&&e.jsx(_e,{taskId:s,confirm:l,onSubmitted:u}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(he,{taskId:s,sessionId:m.currentSessionId??void 0,taskFinished:T,onStatusChange:F,onTakeoverChange:w,ref:I},s)}),e.jsx(Me,{task:m,ptyStatus:E})]}):e.jsx(X,{onboardingData:S})})]}):e.jsx(X,{onboardingData:S})})]})}export{ze as default};