@overlordai/server 1.0.44 → 1.0.45

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 (84) hide show
  1. package/dist/database/repositories/task.repository.d.ts +1 -0
  2. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  3. package/dist/database/repositories/task.repository.js +12 -0
  4. package/dist/database/repositories/task.repository.js.map +1 -1
  5. package/dist/dispatcher/dispatcher.service.d.ts +2 -0
  6. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  7. package/dist/dispatcher/dispatcher.service.js +20 -0
  8. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  9. package/dist/web/task.controller.d.ts +35 -2
  10. package/dist/web/task.controller.d.ts.map +1 -1
  11. package/dist/web/task.controller.js +12 -2
  12. package/dist/web/task.controller.js.map +1 -1
  13. package/dist/web/worker-channel.gateway.d.ts.map +1 -1
  14. package/dist/web/worker-channel.gateway.js +6 -0
  15. package/dist/web/worker-channel.gateway.js.map +1 -1
  16. package/package.json +2 -2
  17. package/public/assets/AccessTokensPage-BfnD9Iq1.js +1 -0
  18. package/public/assets/{AdminPage-WUf_DH26.js → AdminPage-DAdc1aYl.js} +1 -1
  19. package/public/assets/ApiReferencePage-D5bxbl32.js +1 -0
  20. package/public/assets/{AuditLogPage-DARHQlvl.js → AuditLogPage-DNHuGrbA.js} +7 -2
  21. package/public/assets/{BotManage-CJqrHdGB.js → BotManage-DcubGYNM.js} +1 -1
  22. package/public/assets/CliReferencePage-1IQb_18H.js +4 -0
  23. package/public/assets/{DeveloperManage-BPZREf7l.js → DeveloperManage-D19Be0bq.js} +1 -1
  24. package/public/assets/EditProjectPage-CUq3YnL9.js +2 -0
  25. package/public/assets/{EmptyState-DzCKambS.js → EmptyState-C6pl-fmx.js} +1 -1
  26. package/public/assets/HomePage-DDcke6KF.js +1 -0
  27. package/public/assets/LandingPage-B9qdImIR.js +26 -0
  28. package/public/assets/{LoginPage-B3p2RAhz.js → LoginPage-ZuDHpVDO.js} +1 -1
  29. package/public/assets/MachineDetailPage-BFiOZP9o.js +1 -0
  30. package/public/assets/MachineListPage-DuynA1Fy.js +6 -0
  31. package/public/assets/{NotFoundPage-TPG6sDNi.js → NotFoundPage-DGJi_8PE.js} +1 -1
  32. package/public/assets/{PipelineEditorPage-C3yCVmcn.js → PipelineEditorPage-BVvZPEJ5.js} +1 -1
  33. package/public/assets/{ProfilePage-BpF9U5Z_.js → ProfilePage-DxZI6bWN.js} +1 -1
  34. package/public/assets/ProjectDetailPage-5QV2RtDD.js +7 -0
  35. package/public/assets/ProjectListPage-BpGHRc3A.js +6 -0
  36. package/public/assets/{QuickAuth-BI0Tx9ne.js → QuickAuth-Dc7ZSFup.js} +1 -1
  37. package/public/assets/RemoveMemberConfirmDialog-fX5QtE50.js +6 -0
  38. package/public/assets/{Select-CPqSszMb.js → Select-CI29u-rR.js} +2 -2
  39. package/public/assets/{SettingsPage-BJVgLzVg.js → SettingsPage-DWR2r67s.js} +1 -1
  40. package/public/assets/{Skeleton-CY9tzQX6.js → Skeleton-FjHq0xtc.js} +1 -1
  41. package/public/assets/{TaskDetailPage-DMoXJ7Sh.js → TaskDetailPage-D1VmY43e.js} +7 -7
  42. package/public/assets/TaskListPage-DvjPxlMS.js +1 -0
  43. package/public/assets/{TaskStatusBadge-Dl69wpxH.js → TaskStatusBadge-DBm4u0Hu.js} +1 -1
  44. package/public/assets/TokenManage-t44NnmaR.js +1 -0
  45. package/public/assets/{TotpSetupPage-EHohoQr_.js → TotpSetupPage-DOGWrqB6.js} +1 -1
  46. package/public/assets/{WorkerSetupGuidePage-9Z7LKYBn.js → WorkerSetupGuidePage-CEIv1MTN.js} +1 -1
  47. package/public/assets/{arrow-left-BTuWsVB2.js → arrow-left-B_Wt2yqc.js} +1 -1
  48. package/public/assets/{arrow-right-B9x1F1gE.js → arrow-right-D2IR7djk.js} +1 -1
  49. package/public/assets/{bot-Dr86mLtd.js → bot-C3fIKd-I.js} +1 -1
  50. package/public/assets/{copy-CQsonKZY.js → copy-s5DfTWQm.js} +1 -1
  51. package/public/assets/{external-link-BpHI4mME.js → external-link-CINotlqA.js} +1 -1
  52. package/public/assets/index-BwfyjudA.css +1 -0
  53. package/public/assets/index-Cg6K4aRG.js +207 -0
  54. package/public/assets/{key-CN5iSZmy.js → key-B_A2sL4D.js} +1 -1
  55. package/public/assets/{loader-circle-t2hVF1ss.js → loader-circle-CaGKX8EV.js} +1 -1
  56. package/public/assets/{pencil-C9FcKtr5.js → pencil-C2IdswnN.js} +1 -1
  57. package/public/assets/{plus-58oQJgAF.js → plus-B6X_qZtX.js} +1 -1
  58. package/public/assets/protocol-C4f2G7mk.js +1 -0
  59. package/public/assets/{rotate-ccw-Cd08QlGT.js → rotate-ccw-DMxEN3xn.js} +1 -1
  60. package/public/assets/{scroll-text-B2DWPewZ.js → scroll-text-D9V4g5t_.js} +1 -1
  61. package/public/assets/{settings-D9FZzg11.js → settings-CD2kB-Z7.js} +1 -1
  62. package/public/assets/{task.store-B1HbDqca.js → task.store-KG-6fhl8.js} +1 -1
  63. package/public/assets/{trash-2-0XZvPD__.js → trash-2-BI3guxl6.js} +1 -1
  64. package/public/assets/{users-vLcPWGEp.js → users-DL4F_cGf.js} +1 -1
  65. package/public/favicon.svg +2 -2
  66. package/public/index.html +3 -3
  67. package/public/assets/AccessTokensPage-CuDIq3mK.js +0 -1
  68. package/public/assets/ApiReferencePage-B4VEeopm.js +0 -1
  69. package/public/assets/CliReferencePage-DdShMz7c.js +0 -8
  70. package/public/assets/EditProjectPage-CSRXhvIJ.js +0 -2
  71. package/public/assets/HomePage-D4-N3McT.js +0 -1
  72. package/public/assets/LandingPage-CponhSIC.js +0 -36
  73. package/public/assets/MachineDetailPage-B1Mvy6B-.js +0 -1
  74. package/public/assets/MachineListPage-DklA4fO_.js +0 -6
  75. package/public/assets/ProjectDetailPage-D-DQIT-o.js +0 -7
  76. package/public/assets/ProjectListPage-CkUyPRWX.js +0 -6
  77. package/public/assets/RemoveMemberConfirmDialog-8DleD0Hw.js +0 -6
  78. package/public/assets/SkillPage-BALXQsF3.js +0 -1
  79. package/public/assets/TaskListPage-Devlwdac.js +0 -1
  80. package/public/assets/TokenManage-BvE5noxb.js +0 -1
  81. package/public/assets/chevron-right-Cnu_BlwV.js +0 -6
  82. package/public/assets/index-CQojj7Zu.css +0 -1
  83. package/public/assets/index-MlIm5Zqq.js +0 -212
  84. package/public/assets/protocol-C5uQmiiB.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-MlIm5Zqq.js";/**
1
+ import{c as e}from"./index-Cg6K4aRG.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-MlIm5Zqq.js";/**
1
+ import{c as e}from"./index-Cg6K4aRG.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-MlIm5Zqq.js";/**
1
+ import{c as a}from"./index-Cg6K4aRG.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-MlIm5Zqq.js";/**
1
+ import{c as e}from"./index-Cg6K4aRG.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ var N=(E=>(E.QUEUED="QUEUED",E.ASSIGNED="ASSIGNED",E.RUNNING="RUNNING",E.SUSPENDED="SUSPENDED",E.COMPLETED="COMPLETED",E.FAILED="FAILED",E.CANCELLED="CANCELLED",E))(N||{}),r=(E=>(E.ONLINE="online",E.OFFLINE="offline",E.DRAINING="draining",E))(r||{}),D=(E=>(E.MAINTAINER="maintainer",E.MEMBER="member",E))(D||{}),I=(E=>(E.CLAUDE="claude",E.CURSOR="cursor",E.CODEX="codex",E.CUSTOM="custom",E))(I||{}),L=(E=>(E.GITLAB="gitlab",E.GITHUB="github",E.GITEA="gitea",E))(L||{});export{I as A,L as G,r as M,D as P,N as T};
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-MlIm5Zqq.js";/**
1
+ import{c as t}from"./index-Cg6K4aRG.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-MlIm5Zqq.js";/**
1
+ import{c as a}from"./index-Cg6K4aRG.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-MlIm5Zqq.js";/**
1
+ import{c as a}from"./index-Cg6K4aRG.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{p as i,f as o}from"./index-MlIm5Zqq.js";const f=i((t,l)=>({tasks:[],currentTask:null,loading:!1,nextCursor:null,fetchTasks:async s=>{t({loading:!0});try{const a={};s!=null&&s.status&&(a.status=s.status),s!=null&&s.projectKey&&(a.projectKey=s.projectKey),s!=null&&s.cursor&&(a.cursor=s.cursor),s!=null&&s.limit&&(a.limit=String(s.limit));const n=await o.get("web/tasks",{searchParams:a}).json();s!=null&&s.cursor?t(c=>({tasks:[...c.tasks,...n.data],nextCursor:n.nextCursor??null})):t({tasks:n.data,nextCursor:n.nextCursor??null})}finally{t({loading:!1})}},fetchTask:async s=>{t({loading:!0});try{const a=await o.get(`web/tasks/${s}`).json();t({currentTask:a})}finally{t({loading:!1})}},createTask:async s=>{const a=await o.post("web/tasks",{json:s}).json();return t(n=>({tasks:[a,...n.tasks]})),a},cancelTask:async s=>{await o.post(`web/tasks/${s}/cancel`);const{currentTask:a}=l();(a==null?void 0:a.id)===s&&await l().fetchTask(s)},reset:()=>{t({tasks:[],currentTask:null,loading:!1,nextCursor:null})}}));export{f as u};
1
+ import{p as i,f as o}from"./index-Cg6K4aRG.js";const f=i((t,l)=>({tasks:[],currentTask:null,loading:!1,nextCursor:null,fetchTasks:async s=>{t({loading:!0});try{const a={};s!=null&&s.status&&(a.status=s.status),s!=null&&s.projectKey&&(a.projectKey=s.projectKey),s!=null&&s.cursor&&(a.cursor=s.cursor),s!=null&&s.limit&&(a.limit=String(s.limit));const n=await o.get("web/tasks",{searchParams:a}).json();s!=null&&s.cursor?t(c=>({tasks:[...c.tasks,...n.data],nextCursor:n.nextCursor??null})):t({tasks:n.data,nextCursor:n.nextCursor??null})}finally{t({loading:!1})}},fetchTask:async s=>{t({loading:!0});try{const a=await o.get(`web/tasks/${s}`).json();t({currentTask:a})}finally{t({loading:!1})}},createTask:async s=>{const a=await o.post("web/tasks",{json:s}).json();return t(n=>({tasks:[a,...n.tasks]})),a},cancelTask:async s=>{await o.post(`web/tasks/${s}/cancel`);const{currentTask:a}=l();(a==null?void 0:a.id)===s&&await l().fetchTask(s)},reset:()=>{t({tasks:[],currentTask:null,loading:!1,nextCursor:null})}}));export{f as u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-MlIm5Zqq.js";/**
1
+ import{c as e}from"./index-Cg6K4aRG.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-MlIm5Zqq.js";/**
1
+ import{c as e}from"./index-Cg6K4aRG.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
- <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
2
2
  <rect width="32" height="32" rx="4" fill="#22C55E"/>
3
- <text x="16" y="23" text-anchor="middle" font-family="monospace" font-size="22" font-weight="600" fill="#0C0C0C">~</text>
3
+ <text x="16" y="22" text-anchor="middle" font-family="monospace" font-size="20" font-weight="600" fill="#0C0C0C">~</text>
4
4
  </svg>
package/public/index.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>overlord</title>
6
+ <title>Overlord</title>
7
7
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
@@ -11,8 +11,8 @@
11
11
  href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
12
12
  rel="stylesheet"
13
13
  />
14
- <script type="module" crossorigin src="/assets/index-MlIm5Zqq.js"></script>
15
- <link rel="stylesheet" crossorigin href="/assets/index-CQojj7Zu.css">
14
+ <script type="module" crossorigin src="/assets/index-Cg6K4aRG.js"></script>
15
+ <link rel="stylesheet" crossorigin href="/assets/index-BwfyjudA.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
@@ -1 +0,0 @@
1
- import{a as _,r as o,j as e,f as j,l as w,h as C,t as y,o as T,K as S}from"./index-MlIm5Zqq.js";import{S as D}from"./Select-CPqSszMb.js";import{E as A}from"./EmptyState-DzCKambS.js";import{T as E}from"./Skeleton-CY9tzQX6.js";import{P as L}from"./plus-58oQJgAF.js";import{C as R}from"./copy-CQsonKZY.js";import{T as M}from"./trash-2-0XZvPD__.js";function O({isOpen:t,onClose:i,onCreated:m}){const{t:s}=_(),[c,n]=o.useState(""),[d,x]=o.useState("never"),[u,v]=o.useState(!1),[p,l]=o.useState(""),b=[{value:"never",label:s("access_tokens.no_expiry")},{value:"30",label:s("access_tokens.days_30")},{value:"90",label:s("access_tokens.days_90")},{value:"365",label:s("access_tokens.days_365")}],h=()=>{n(""),x("never"),l(""),i()},f=async()=>{if(l(""),!c.trim()){l(s("access_tokens.token_label_required"));return}try{v(!0);const a=await j.post("web/profile/tokens",{json:{label:c.trim(),...d!=="never"&&{expiresAt:new Date(Date.now()+parseInt(d,10)*864e5).toISOString()}}}).json();n(""),x("never"),m({token:a.token,name:a.name})}catch(a){const k=a instanceof Error?a.message:s("access_tokens.failed_to_create_token");l(k)}finally{v(!1)}};return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]",onClick:h}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:s("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[p&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)]/30 bg-[var(--destructive)]/5 px-3 py-2 text-xs text-[var(--destructive)]",children:p}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:s("access_tokens.token_name_placeholder"),value:c,onChange:a=>n(a.target.value),onKeyDown:a=>{a.key==="Enter"&&f()},className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("access_tokens.expires")}),e.jsx(D,{value:d,onChange:x,options:b})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:h,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:s("common.cancel")}),e.jsx("button",{onClick:f,disabled:u,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:s(u?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function P({isOpen:t,onClose:i,onConfirm:m,tokenLabel:s,isLoading:c}){const{t:n}=_();return e.jsx(w,{isOpen:t,onClose:i,onConfirm:m,title:n("access_tokens.revoke_token_title"),message:n("access_tokens.revoke_confirm",{name:s}),confirmLabel:n("access_tokens.revoke"),confirmVariant:"danger",isLoading:c})}function $(t){if(!t)return"-";const i=new Date(t).getTime();if(Number.isNaN(i))return"-";const m=Date.now()-i,s=Math.floor(m/1e3);if(s<60)return`${s}s ago`;const c=Math.floor(s/60);if(c<60)return`${c}m ago`;const n=Math.floor(c/60);return n<24?`${n} hours ago`:`${Math.floor(n/24)}d ago`}function V(){const{t}=_(),[i,m]=o.useState([]),[s,c]=o.useState(!0),[n,d]=o.useState(!1),[x,u]=o.useState(null),[v,p]=o.useState(!1),[l,b]=o.useState(null),[h,f]=o.useState(null);C(o.useMemo(()=>e.jsxs("button",{onClick:()=>d(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black transition-opacity hover:opacity-90",children:[e.jsx(L,{className:"h-3.5 w-3.5"}),t("access_tokens.create_token")]}),[t]));const a=o.useCallback(async()=>{try{c(!0);const r=await j.get("web/profile/tokens").json();m(r)}catch{y.error(t("access_tokens.failed_to_load_tokens"))}finally{c(!1)}},[t]);o.useEffect(()=>{a()},[a]);const k=r=>{d(!1),u(r.token),p(!1),a()},g=async()=>{if(x)try{await navigator.clipboard.writeText(x),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},N=async()=>{if(l)try{f(l.id),await j.post(`web/profile/tokens/${l.id}/revoke`),y.success(t("access_tokens.token_revoked")),b(null),a()}catch{y.error(t("access_tokens.failed_to_revoke_token"))}finally{f(null)}};return e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[x&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs font-medium text-[var(--warning)]",children:t("access_tokens.copy_token_warning")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 break-all rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)]",children:x}),e.jsxs("button",{onClick:g,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[v?e.jsx(T,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(R,{className:"h-3.5 w-3.5"}),t(v?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>u(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:t("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s?e.jsx("div",{className:"p-4",children:e.jsx(E,{rows:3})}):i.length===0?e.jsx(A,{icon:S,title:t("access_tokens.no_tokens"),description:t("access_tokens.create_token_desc"),actionLabel:t("access_tokens.create_token"),onAction:()=>d(!0)}):e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:t("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:t("common.actions")})]})}),e.jsx("tbody",{children:i.map(r=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-[var(--text-primary)]",children:r.label}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:r.status==="active"?"text-green-400":"text-[var(--text-muted)]",children:r.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:r.lastUsedAt?$(r.lastUsedAt):t("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:r.expiresAt?new Date(r.expiresAt).toLocaleDateString():t("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:r.status==="active"&&e.jsxs("button",{onClick:()=>b(r),disabled:h===r.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(M,{className:"h-3 w-3"}),t("access_tokens.revoke")]})})]},r.id))})]})}),e.jsx(O,{isOpen:n,onClose:()=>d(!1),onCreated:k}),e.jsx(P,{isOpen:!!l,onClose:()=>b(null),onConfirm:N,tokenLabel:(l==null?void 0:l.label)??"",isLoading:h!==null})]})}export{V as default};
@@ -1 +0,0 @@
1
- import{d,a as n,h as p,r as o,j as t}from"./index-MlIm5Zqq.js";import{Q as c}from"./QuickAuth-BI0Tx9ne.js";import{P as h}from"./plus-58oQJgAF.js";import"./copy-CQsonKZY.js";const l={GET:"text-green-400",POST:"text-blue-400",PUT:"text-yellow-400",DELETE:"text-red-400"},m=[{title:"authentication",prefix:"/api/auth",endpoints:[{method:"POST",path:"/login",description:"authenticate with username + password (optional totpCode)",auth:"none",body:'{ "username": "string", "password": "string", "totpCode?": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/refresh",description:"refresh access token (rotates refresh token)",auth:"none",body:'{ "refreshToken": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/logout",description:"invalidate refresh token",auth:"jwt",body:'{ "refreshToken": "string" }'}]},{title:"tasks",prefix:"/api/web/tasks",endpoints:[{method:"GET",path:"",description:"list tasks with optional filters",auth:"jwt",response:'[ { "id": 1, "description": "...", "status": "RUNNING", ... } ]'},{method:"POST",path:"",description:"create a new task",auth:"jwt",body:'{ "projectKey": "string", "description": "string", "machineId?": "string" }'},{method:"GET",path:"/:id",description:"get task details",auth:"jwt"},{method:"POST",path:"/:id/cancel",description:"cancel a running task",auth:"jwt"},{method:"POST",path:"/:id/retry",description:"retry a failed task",auth:"jwt"},{method:"POST",path:"/:id/confirm-stage",description:"confirm/choose/input for suspended stage",auth:"jwt",body:'{ "stageIndex": "number", "result": "string" }'},{method:"POST",path:"/:id/pty-token",description:"get pty websocket token",auth:"jwt"}]},{title:"machines",prefix:"/api/web/machines",endpoints:[{method:"GET",path:"",description:"list all machines",auth:"jwt"},{method:"GET",path:"/:id",description:"get machine details",auth:"jwt"},{method:"GET",path:"/:id/tasks",description:"list tasks assigned to a machine",auth:"jwt"},{method:"POST",path:"/:id/drain",description:"start draining a machine",auth:"jwt"},{method:"POST",path:"/:id/undrain",description:"cancel machine drain",auth:"jwt"}]},{title:"projects",prefix:"/api/web/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"GET",path:"/:key",description:"get project details",auth:"jwt"}]},{title:"profile",prefix:"/api/web/profile",endpoints:[{method:"GET",path:"",description:"get current user profile",auth:"jwt"},{method:"PUT",path:"",description:"update profile (gitName, gitEmail)",auth:"jwt",body:'{ "gitName?": "string", "gitEmail?": "string" }'},{method:"PUT",path:"/password",description:"change password",auth:"jwt",body:'{ "currentPassword": "string", "newPassword": "string" }'},{method:"POST",path:"/totp/setup",description:"initialize totp setup",auth:"jwt"},{method:"POST",path:"/totp/verify",description:"verify totp setup code",auth:"jwt",body:'{ "code": "string" }'},{method:"GET",path:"/tokens",description:"list personal access tokens",auth:"jwt"},{method:"POST",path:"/tokens",description:"create a personal access token",auth:"jwt",body:'{ "label": "string", "expiresAt?": "string" }'},{method:"POST",path:"/tokens/:id/revoke",description:"revoke a token",auth:"jwt"}]},{title:"workspaces & tunnels",prefix:"/api/web",endpoints:[{method:"GET",path:"/workspaces/:taskId",description:"get workspace for a task",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/start",description:"start a cursor remote tunnel",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/stop",description:"stop a running tunnel",auth:"jwt"},{method:"GET",path:"/workspace-tunnel/:taskId/status",description:"get tunnel status",auth:"jwt"}]},{title:"dashboard",prefix:"/api/web/dashboard",endpoints:[{method:"GET",path:"/stats",description:"get dashboard statistics",auth:"jwt"},{method:"GET",path:"/recent-tasks",description:"get recent tasks for dashboard",auth:"jwt"},{method:"GET",path:"/recent-activity",description:"get recent activity feed",auth:"jwt"}]},{title:"notifications",prefix:"/api/web/notifications",endpoints:[{method:"GET",path:"",description:"list notifications with cursor pagination",auth:"jwt"},{method:"POST",path:"/:id/read",description:"mark a notification as read",auth:"jwt"},{method:"POST",path:"/read-all",description:"mark all notifications as read",auth:"jwt"}]},{title:"search",prefix:"/api/web",endpoints:[{method:"GET",path:"/search?q=query",description:"global search across tasks, machines, projects",auth:"jwt"}]},{title:"admin — developers",prefix:"/api/admin/developers",endpoints:[{method:"GET",path:"",description:"list all developers",auth:"jwt"},{method:"POST",path:"",description:"create a developer",auth:"jwt",body:'{ "name": "string", "password": "string", "role": "string", "gitName": "string", "gitEmail": "string" }'},{method:"PUT",path:"/:id",description:"update developer",auth:"jwt"},{method:"PUT",path:"/:id/reset-totp",description:"reset developer totp",auth:"jwt"}]},{title:"admin — projects",prefix:"/api/admin/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"POST",path:"",description:"create a project",auth:"jwt"},{method:"PUT",path:"/:key",description:"update project (including pipeline)",auth:"jwt"},{method:"DELETE",path:"/:key",description:"delete a project",auth:"jwt"},{method:"GET",path:"/:key/members",description:"get project members",auth:"jwt"},{method:"POST",path:"/:key/members",description:"add project member",auth:"jwt"},{method:"DELETE",path:"/:key/members?developerId=N",description:"remove project member",auth:"jwt"}]},{title:"admin — worker tokens",prefix:"/api/admin/worker-tokens",endpoints:[{method:"GET",path:"",description:"list all worker enrollment tokens",auth:"jwt"},{method:"POST",path:"",description:"generate a new worker token",auth:"jwt"},{method:"POST",path:"/:id/revoke",description:"revoke a worker token",auth:"jwt"},{method:"GET",path:"/:id/status",description:"get token status and linked machine",auth:"jwt"}]},{title:"admin — machines",prefix:"/api/admin/machines",endpoints:[{method:"GET",path:"",description:"list all machines (admin)",auth:"jwt"},{method:"PUT",path:"/:id",description:"update machine status",auth:"jwt",body:'{ "status?": "string" }'}]},{title:"admin — bots",prefix:"/api/admin/bots",endpoints:[{method:"GET",path:"",description:"list bot instances",auth:"jwt"},{method:"POST",path:"",description:"create a bot instance",auth:"jwt"},{method:"GET",path:"/:id/bindings",description:"get chat bindings for a bot",auth:"jwt"},{method:"POST",path:"/:id/bindings",description:"create a chat binding",auth:"jwt"},{method:"DELETE",path:"/:id/bindings",description:"delete a chat binding",auth:"jwt"}]},{title:"admin — audit & settings",prefix:"/api/admin",endpoints:[{method:"GET",path:"/audit-logs",description:"query audit log with filters",auth:"jwt"},{method:"GET",path:"/settings",description:"get all system settings",auth:"jwt"},{method:"PUT",path:"/settings",description:"update system settings",auth:"jwt"}]},{title:"websocket",prefix:"",endpoints:[{method:"GET",path:"WS /ws/pty/:taskId",description:'pty terminal websocket — first obtain a channel token via POST /api/web/tasks/:taskId/pty-token, then send an auth frame after connection: { type: "auth", token: "<jwt>", channelToken: "<channel-token>" }',auth:"jwt"},{method:"GET",path:"WS /api/workers/pty/:taskId",description:'worker pty websocket — auth via frame: { type: "auth", workerJwt: "<worker-jwt>", channelToken: "<channel-token>" }',auth:"worker-token"}]}];function x({ep:e,prefix:s}){const[a,i]=o.useState(!1),{t:r}=n();return t.jsxs("div",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[t.jsxs("button",{type:"button",className:"flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-[var(--bg-input)]",onClick:()=>i(!a),children:[t.jsx("span",{className:`w-12 shrink-0 text-xs font-bold ${l[e.method]}`,children:e.method}),t.jsxs("code",{className:"flex-1 text-xs text-[var(--text-primary)] truncate",children:[s,e.path]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate max-w-[200px]",children:["// ",e.description]})]}),a&&t.jsxs("div",{className:"border-t border-[var(--border-row)] bg-[var(--bg-primary)] px-4 py-3 space-y-2",children:[t.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// ",e.description]}),t.jsxs("div",{className:"flex items-center gap-2 text-[10px]",children:[t.jsx("span",{className:"text-[var(--text-muted)]",children:"auth:"}),t.jsx("span",{className:e.auth==="none"?"text-[var(--text-muted)]":"text-[var(--accent)]",children:e.auth})]}),e.body&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.request_body")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.body})]}),e.response&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[10px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:r("docs.response")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.response})]})]})]})}function g(){const e=d(),{t:s}=n();return p(o.useMemo(()=>t.jsxs("button",{onClick:()=>e("/access-tokens"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[t.jsx(h,{className:"h-3.5 w-3.5"}),s("access_tokens.create_token")]}),[e,s])),t.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[t.jsx("div",{className:"mb-8",children:t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("docs.api_base_url_desc",{url:"http://localhost:9000"})})}),t.jsx(c,{mode:"api"}),t.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("docs.authentication")}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"jwt"}),t.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["obtained via /api/auth/login — pass as ",t.jsx("code",{children:"authorization: bearer <token>"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"pat"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"personal access token — same header format, for cli/api usage"})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-yellow-400",children:"worker-token"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"enrollment token for worker registration — used during initial handshake"})]})]}),t.jsx("div",{className:"space-y-6",children:m.map(a=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-2 text-sm text-[var(--accent)]",children:["> ",a.title]}),t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:a.endpoints.map((i,r)=>t.jsx(x,{ep:i,prefix:a.prefix},`${i.method}-${i.path}-${r}`))})]},a.title))})]})}export{g as default};
@@ -1,8 +0,0 @@
1
- import{d as l,a as c,h as p,r as d,j as e,C as m}from"./index-MlIm5Zqq.js";import{Q as x}from"./QuickAuth-BI0Tx9ne.js";import{P as u}from"./plus-58oQJgAF.js";import{C as v}from"./copy-CQsonKZY.js";const g=[{command:"ov setup",description:"quick setup — configure server connection and authenticate in one step",usage:"ov setup [--server <url>] [--token <token>]",flags:[{flag:"--server <url>",desc:"overlord server url"},{flag:"--token <token>",desc:"personal access token (skips prompt)"}],example:`ov setup
2
- > Overlord server URL: http://localhost:9000
3
- > Personal Access Token: ov_pat_xxxxx
4
- ✓ Connected to http://localhost:9000
5
- ✓ Authenticated as admin (admin)`},{command:"ov login",description:"authenticate with the overlord server using a personal access token",usage:"ov login",example:`ov login
6
- > Enter server URL: http://localhost:9000
7
- > Enter PAT: ov_pat_xxxxx
8
- ✓ Logged in as admin`},{command:"ov logout",description:"clear stored credentials",usage:"ov logout"},{command:"ov whoami",description:"show current authenticated user",usage:"ov whoami"},{command:"ov task create",description:"create a new task",usage:"ov task create -d <description> [-p <project>] [--on <machine>]",flags:[{flag:"-d, --description",desc:"task description (required unless -f)"},{flag:"-p, --project",desc:"project key to assign the task to"},{flag:"--on",desc:"target machine id (optional)"},{flag:"-f, --file",desc:"create task from yaml file"}],example:'ov task create -d "fix login bug" -p overlord'},{command:"ov task list",description:"list all tasks with optional filters",usage:"ov task list [--status <status>] [-p <project>]",flags:[{flag:"--status",desc:"filter by status (RUNNING, QUEUED, COMPLETED, FAILED, CANCELLED)"},{flag:"-p, --project",desc:"filter by project key"}]},{command:"ov task show <id>",description:"show detailed information about a task",usage:"ov task show <task_id>"},{command:"ov task cancel <id>",description:"cancel a running or queued task",usage:"ov task cancel <task_id>"},{command:"ov task retry <id>",description:"retry a failed task",usage:"ov task retry <task_id>"},{command:"ov task logs <id>",description:"view task logs (streams via pty if active, fetches historical otherwise)",usage:"ov task logs <task_id> [--json]",flags:[{flag:"--json",desc:"output as json"}]},{command:"ov task confirm <id>",description:"confirm a suspended task stage",usage:"ov task confirm <task_id> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to confirm (required)"}]},{command:"ov task choose <id> <option>",description:"submit a choice for a suspended task",usage:"ov task choose <task_id> <option> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to respond to (required)"}]},{command:"ov task input <id> <text>",description:"submit text input for a suspended task",usage:"ov task input <task_id> <text> --stage <index>",flags:[{flag:"--stage <index>",desc:"stage index to respond to (required)"}]},{command:"ov attach <id>",description:"connect to a task pty terminal",usage:"ov attach <task_id> [--watch] [--takeover] [--session <id>]",flags:[{flag:"--watch",desc:"read-only observer mode"},{flag:"--takeover",desc:"take over pty control from current user"},{flag:"--session <id>",desc:"session id for takeover"}]},{command:"ov project list",description:"list all projects",usage:"ov project list"},{command:"ov project show <key>",description:"show project details",usage:"ov project show <project_key>"},{command:"ov machine list",description:"list all registered machines",usage:"ov machine list"},{command:"ov machine show <id>",description:"show machine details",usage:"ov machine show <machine_id>"},{command:"ov notifications",description:"view your notifications",usage:"ov notifications [--all] [--json]",flags:[{flag:"--all",desc:"show all notifications (including read)"},{flag:"--json",desc:"output as json"}]},{command:"ov notifications read <id>",description:"mark a notification as read",usage:"ov notifications read <notification_id>"},{command:"ov search <query>",description:"search across tasks, machines, and projects",usage:"ov search <query>"},{command:"ov config set <key> <value>",description:"set a configuration value",usage:"ov config set <key> <value>",flags:[{flag:"server",desc:"overlord server url"},{flag:"default-project",desc:"default project key"},{flag:"output-format",desc:"output format (table, json)"},{flag:"color",desc:"enable/disable color (true/false)"}]},{command:"ov config get <key>",description:"get a configuration value",usage:"ov config get <key>"},{command:"ov config list",description:"list all configuration values",usage:"ov config list [--json]"},{command:"ov status",description:"show server connectivity, current user, and cluster overview",usage:"ov status [--json]"},{command:"ov upgrade",description:"upgrade ov cli to the latest version",usage:"ov upgrade"}],h=[{command:"overlord install",description:"interactive server installation wizard — checks environment, configures database, creates admin account",usage:"overlord install"},{command:"overlord setup worker",description:"interactive worker setup wizard — configures connection, writes .env, registers service",usage:"overlord setup worker"},{command:"overlord start [component]",description:"start server or worker services (systemd / launchd)",usage:"overlord start [server|worker]"},{command:"overlord stop [component]",description:"stop running processes",usage:"overlord stop [server|worker]"},{command:"overlord status",description:"show process status table (pid, cpu, memory, uptime)",usage:"overlord status"},{command:"overlord logs [component]",description:"view server or worker logs",usage:"overlord logs [server|worker] [--lines <n>]"},{command:"overlord doctor",description:"run system diagnostics",usage:"overlord doctor"},{command:"overlord upgrade",description:"upgrade to the latest release",usage:"overlord upgrade"}];function o({text:a}){const[t,r]=d.useState(!1),{t:s}=c();return e.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(a),r(!0),setTimeout(()=>r(!1),2e3)},className:"rounded-[4px] p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",title:s("common.copy"),children:t?e.jsx(m,{className:"h-3 w-3 text-[var(--accent)]"}):e.jsx(v,{className:"h-3 w-3"})})}function n({title:a,commands:t}){const{t:r}=c();return e.jsxs("div",{children:[e.jsxs("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:["> ",a]}),e.jsx("div",{className:"space-y-3",children:t.map(s=>e.jsxs("details",{className:"group rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("summary",{className:"flex cursor-pointer items-center justify-between px-4 py-3 hover:bg-[var(--bg-input)] transition-colors",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:s.command}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.description]})]})}),e.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:r("docs.usage")}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--text-primary)]",children:s.usage}),e.jsx(o,{text:s.usage})]})]}),s.flags&&s.flags.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:r("docs.flags")}),e.jsx("div",{className:"space-y-1",children:s.flags.map(i=>e.jsxs("div",{className:"flex items-start gap-3 text-xs",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:i.flag}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:i.desc})]},i.flag))})]}),s.example&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:r("docs.example")}),e.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-secondary)] whitespace-pre-wrap",children:s.example})]})]})]},s.command))})]})}function b(){const a=l(),{t}=c();return p(d.useMemo(()=>e.jsxs("button",{onClick:()=>a("/access-tokens"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(u,{className:"h-3.5 w-3.5"}),t("access_tokens.create_token")]}),[a,t])),e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("docs.cli_tools_desc",{ov:"ov",overlord:"overlord"})})}),e.jsx(x,{mode:"cli"}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("docs.quick_start")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"1. install"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"npm install -g @overlordai/developer-cli"}),e.jsx(o,{text:"npm install -g @overlordai/developer-cli"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"2. setup"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"ov setup"}),e.jsx(o,{text:"ov setup"})]})]})]}),e.jsxs("div",{className:"space-y-8",children:[e.jsx(n,{title:t("docs.developer_cli"),commands:g}),e.jsx(n,{title:t("docs.admin_cli"),commands:h})]}),e.jsxs("div",{className:"mt-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> ai agent skill"}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"install"}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:"npx skills add overlord-run/skill"}),e.jsx(o,{text:"npx skills add overlord-run/skill"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-[var(--text-muted)]",children:"configure"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=https://your-server.com"]}),e.jsx(o,{text:"export OVERLORD_SERVER=https://your-server.com"})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=your-token"]}),e.jsx(o,{text:"export OVERLORD_TOKEN=your-token"})]})]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// once installed, your ai agent can create tasks, check status, read logs, and manage projects on your behalf."})]})]})}export{b as default};
@@ -1,2 +0,0 @@
1
- import{m as le,d as ce,a as de,r as a,f as u,j as e,L as ie,t as N}from"./index-MlIm5Zqq.js";import{G as m,A as d}from"./protocol-C5uQmiiB.js";import{S as Q}from"./Select-CPqSszMb.js";import{U as pe,A as xe,R as ue}from"./RemoveMemberConfirmDialog-8DleD0Hw.js";import{P as me}from"./plus-58oQJgAF.js";function fe(){const{key:o}=le(),l=ce(),{t:r}=de(),[n,V]=a.useState(null),[b,Y]=a.useState([]),[Z,ee]=a.useState(!0),[C,v]=a.useState(!1),[j,w]=a.useState(""),[h,_]=a.useState(""),[S,k]=a.useState(""),[M,T]=a.useState(m.GITHUB),[U,O]=a.useState(""),[P,I]=a.useState(d.CLAUDE),[R,A]=a.useState(""),[D,$]=a.useState("50"),[E,G]=a.useState(""),[L,B]=a.useState(""),[F,J]=a.useState(""),[q,z]=a.useState("0"),[g,H]=a.useState(!1),[i,f]=a.useState(""),[te,K]=a.useState(!1),[c,y]=a.useState(null),[re,W]=a.useState(!1),p=a.useCallback(async()=>{if(o)try{const[t,x]=await Promise.all([u.get(`web/projects/${o}`).json(),u.get(`web/projects/${o}/members`).json().catch(()=>[])]);if(V(t),Y(x),w(t.name),_(t.repoUrl),k(t.sshUrl??""),T(t.gitPlatform),O(t.defaultBranch),I(t.agentType),A(t.agentCommand??""),$(String(t.maxTurns)),G(t.workspaceRoot??""),B(t.setupCommands??""),J(t.testCommand??""),z(String(t.ptyOutputFilter??0)),H(t.isDefault),t.pipeline)try{f(JSON.stringify(JSON.parse(t.pipeline),null,2))}catch{f(t.pipeline)}}catch{}finally{ee(!1)}},[o]);a.useEffect(()=>{p()},[p]);async function ae(t){if(t.preventDefault(),!n)return;v(!0);let x=null;if(i.trim())try{JSON.parse(i),x=i.trim()}catch{N.error(r("projects.invalid_pipeline_json")),v(!1);return}try{await u.put(`web/projects/${n.key}`,{json:{name:j,repoUrl:h,sshUrl:S||null,defaultBranch:U,gitPlatform:M,agentType:P,agentCommand:R||null,maxTurns:parseInt(D,10)||50,workspaceRoot:E||null,setupCommands:L||null,testCommand:F||null,ptyOutputFilter:parseInt(q,10)||0,pipeline:x}}),N.success(r("projects.project_saved")),l(`/projects/${n.key}`)}catch(X){const oe=X instanceof Error?X.message:r("projects.failed_to_save_project");N.error(oe)}finally{v(!1)}}function se(){l(`/projects/${o}`)}async function ne(){if(!(!n||!c)){W(!0);try{await u.delete(`web/projects/${n.key}/members`,{searchParams:{developerId:String(c.developerId)}}),await p()}catch{}finally{W(!1),y(null)}}}return Z?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):n?e.jsxs("form",{onSubmit:ae,className:"mx-auto max-w-6xl px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l(`/projects/${n.key}`),children:n.key})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r("common.edit")})]}),e.jsx("h1",{className:"text-lg font-bold text-[var(--text-primary)] mb-4",children:r("projects.edit_project_title")}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_400px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.basic_info")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.key"),children:e.jsx("input",{type:"text",value:n.key,readOnly:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-muted)] outline-none opacity-60 cursor-not-allowed"})}),e.jsx(s,{label:r("projects.name"),children:e.jsx("input",{type:"text",value:j,onChange:t=>w(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.repo_url"),children:e.jsx("input",{type:"text",value:h,onChange:t=>_(t.target.value),required:!0,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsxs(s,{label:r("projects.ssh_url"),children:[e.jsx("input",{type:"text",value:S,onChange:t=>k(t.target.value),placeholder:r("projects.ssh_url_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:r("projects.ssh_url_hint")})]}),e.jsx(s,{label:r("projects.git_platform"),children:e.jsx(Q,{value:M,onChange:t=>T(t),options:[{value:m.GITHUB,label:r("projects.github")},{value:m.GITLAB,label:r("projects.gitlab")},{value:m.GITEA,label:r("projects.gitea")}]})}),e.jsx(s,{label:r("projects.default_branch"),children:e.jsx("input",{type:"text",value:U,onChange:t=>O(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.agent_config")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.agent_type"),children:e.jsx(Q,{value:P,onChange:t=>I(t),options:[{value:d.CLAUDE,label:r("projects.claude")},{value:d.CURSOR,label:r("projects.cursor")},{value:d.CODEX,label:r("projects.codex")},{value:d.CUSTOM,label:r("projects.custom")}]})}),e.jsx(s,{label:r("projects.agent_command"),children:e.jsx("input",{type:"text",value:R,onChange:t=>A(t.target.value),placeholder:"custom agent command",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.max_turns"),children:e.jsx("input",{type:"number",value:D,onChange:t=>$(t.target.value),min:1,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.workspace_root"),children:e.jsx("input",{type:"text",value:E,onChange:t=>G(t.target.value),placeholder:"/path/to/workspace",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.environment")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.setup_commands"),children:e.jsx("textarea",{value:L,onChange:t=>B(t.target.value),rows:3,placeholder:`npm install
2
- npm run build`,className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.post_command"),children:e.jsx("input",{type:"text",value:F,onChange:t=>J(t.target.value),placeholder:"npm test",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.security")}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(s,{label:r("projects.pty_output_filter"),children:e.jsx("input",{type:"text",value:q,onChange:t=>z(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})}),e.jsx(s,{label:r("projects.git_clean"),children:e.jsx("button",{type:"button",onClick:()=>H(!g),className:`relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors ${g?"bg-[var(--accent)]":"bg-[var(--border)]"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${g?"translate-x-6":"translate-x-1"}`})})})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.pipeline_section")}),e.jsx(ie,{to:"/projects/"+o+"/pipeline",className:"text-xs text-[var(--accent)] hover:underline",children:r("projects.edit_pipeline")})]}),e.jsx("textarea",{value:i,onChange:t=>f(t.target.value),rows:20,spellCheck:!1,placeholder:'{"stages": [], "defaults": {}}',className:"w-full resize-y rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]",style:{fontFamily:'"JetBrains Mono", monospace',textTransform:"none"}})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.members")}),e.jsxs("button",{type:"button",onClick:()=>K(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(me,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),b.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_members_yet")})]}):e.jsx("div",{className:"space-y-2",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full bg-[var(--accent)]/20 text-xs font-bold text-[var(--accent)]",children:(t.developerName??String(t.developerId)).charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"ml-2 rounded-[4px] px-1.5 py-0.5 text-[10px] font-medium",style:{color:t.role==="maintainer"?"var(--warning)":"var(--text-secondary)",background:t.role==="maintainer"?"rgba(245,158,11,0.1)":"rgba(163,163,163,0.1)"},children:t.role})]})]}),e.jsx("button",{type:"button",onClick:()=>y(t),className:"text-[var(--destructive)] hover:opacity-70 transition-opacity","aria-label":r("projects.remove_member"),children:e.jsx(pe,{className:"h-3.5 w-3.5"})})]},t.developerId))})]})]})]}),e.jsxs("div",{className:"mt-8 flex items-center justify-end gap-3 border-t border-[var(--border)] pt-6",children:[e.jsx("button",{type:"button",onClick:se,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("common.discard")}),e.jsx("button",{type:"submit",disabled:C||!j||!h,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:r(C?"common.saving":"projects.save_changes")})]}),e.jsx(xe,{isOpen:te,onClose:()=>K(!1),projectKey:n.key,existingMemberIds:b.map(t=>t.developerId),onAdded:p}),e.jsx(ue,{isOpen:!!c,onClose:()=>y(null),onConfirm:ne,memberName:c?c.developerName??`#${c.developerId}`:"",loading:re})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("projects.project_not_found")}),e.jsx("button",{onClick:()=>l("/projects"),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("projects.back_to_projects")})]})}function s({label:o,children:l}){return e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("label",{className:"w-36 shrink-0 pt-2 text-xs text-[var(--text-muted)]",children:o}),e.jsx("div",{className:"flex-1",children:l})]})}export{fe as default};
@@ -1 +0,0 @@
1
- import{u as I,r as n,j as e,X as z,C as X,L as N,d as Q,a as $,f as u}from"./index-MlIm5Zqq.js";import{M as h}from"./protocol-C5uQmiiB.js";import{T}from"./TaskStatusBadge-Dl69wpxH.js";import{T as w}from"./Skeleton-CY9tzQX6.js";import{C as U}from"./chevron-right-Cnu_BlwV.js";import{A as S}from"./arrow-right-B9x1F1gE.js";function W(){return[{id:"admin_create_project",title:"create your first project",description:"set up a project with a git repo and pipeline",link:"/projects",linkLabel:"go to projects",autoDetect:!0},{id:"admin_register_worker",title:"register a worker machine",description:"generate a token and set up a worker to run tasks",link:"/machines",linkLabel:"go to machines",autoDetect:!0},{id:"admin_create_developer",title:"create a developer account",description:"add team members who can create and monitor tasks",link:"/admin/developers",linkLabel:"manage developers",autoDetect:!0},{id:"admin_first_task",title:"create your first task",description:"verify the full pipeline works end-to-end",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}function Z(){return[{id:"lead_view_projects",title:"view your projects",description:"check the projects assigned to you",link:"/projects",linkLabel:"go to projects"},{id:"lead_configure_pipeline",title:"configure a pipeline",description:"set up stages for your project workflow",link:"/projects",linkLabel:"go to projects"},{id:"lead_add_member",title:"add a team member",description:"invite developers to your project",link:"/projects",linkLabel:"go to projects"},{id:"lead_first_task",title:"create your first task",description:"submit a task and watch it execute",link:"/tasks",linkLabel:"go to tasks"}]}function ee(){return[{id:"dev_install_cli",title:"install the ov cli",description:"npm install -g @overlordai/developer-cli",link:"/docs/cli",linkLabel:"cli"},{id:"dev_setup_cli",title:"run ov setup",description:"connect to the server and authenticate",link:"/docs/cli",linkLabel:"setup guide"},{id:"dev_view_projects",title:"explore projects",description:"browse available projects and their pipelines",link:"/projects",linkLabel:"go to projects"},{id:"dev_first_task",title:"create your first task",description:"submit a task via web or cli",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}const O="overlord_onboarding";function te(){try{const r=localStorage.getItem(O);if(r)return JSON.parse(r)}catch{}return{dismissed:!1,completed:{}}}function E(r){localStorage.setItem(O,JSON.stringify(r))}function se({data:r}){const s=I(i=>{var c;return(c=i.user)==null?void 0:c.role}),[o,a]=n.useState(te),d=s==="admin"?W():s==="lead"||s==="maintainer"?Z():ee(),l=n.useCallback(i=>{if(o.completed[i.id])return!0;if(!i.autoDetect)return!1;switch(i.id){case"admin_create_project":return r.totalProjects>0;case"admin_register_worker":return r.totalMachines>0;case"admin_create_developer":return r.totalDevelopers>1;case"admin_first_task":case"dev_first_task":return r.activeTasks>0;default:return!1}},[o.completed,r]),x=d.filter(l).length,p=x===d.length,k=n.useCallback(i=>{a(c=>{const f={...c,completed:{...c.completed,[i]:!c.completed[i]}};return E(f),f})},[]),v=n.useCallback(()=>{a(i=>{const c={...i,dismissed:!0};return E(c),c})},[]);if(o.dismissed)return null;const b=Math.round(x/d.length*100);return e.jsxs("div",{className:"mb-6 md:mb-8 rounded-[4px] border border-[var(--accent)]/30 bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:"// getting started"}),e.jsxs("span",{className:"text-[10px] text-[var(--text-muted)]",children:[x,"/",d.length," completed"]})]}),e.jsx("button",{onClick:v,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",title:"dismiss",children:e.jsx(z,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"h-0.5 bg-[var(--border)]",children:e.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-500",style:{width:`${b}%`}})}),e.jsx("div",{className:"divide-y divide-[var(--border)]",children:d.map(i=>{const c=l(i);return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("button",{onClick:()=>!i.autoDetect&&k(i.id),className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors ${c?"border-[var(--accent)] bg-[var(--accent)]":"border-[var(--border)] hover:border-[var(--text-muted)]"} ${i.autoDetect?"cursor-default":"cursor-pointer"}`,children:c&&e.jsx(X,{className:"h-2.5 w-2.5 text-black"})}),e.jsxs("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:`text-xs ${c?"text-[var(--text-muted)] line-through":"text-[var(--text-primary)]"}`,children:i.title}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)] truncate",children:i.description})]}),i.link&&!c&&e.jsxs(N,{to:i.link,className:"ml-3 flex shrink-0 items-center gap-1 text-[10px] text-[var(--accent)] hover:underline",children:[i.linkLabel," ",e.jsx(U,{className:"h-3 w-3"})]})]})]},i.id)})}),p&&e.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 text-center",children:[e.jsx("span",{className:"text-xs text-[var(--accent)]",children:"all set! you're ready to go."}),e.jsx("button",{onClick:v,className:"ml-3 text-[10px] text-[var(--text-muted)] underline hover:text-[var(--text-primary)]",children:"dismiss"})]})]})}const ae=3e4,re=[{key:"active_tasks",labelKey:"dashboard.active_tasks"},{key:"queued_tasks",labelKey:"dashboard.queued_tasks"},{key:"online_workers",labelKey:"dashboard.online_workers"},{key:"completed_today",labelKey:"dashboard.completed_today"}],ie=["mon","tue","wed","thu","fri","sat","sun"];function L(r){if(!r)return"-";const s=new Date(r).getTime();if(Number.isNaN(s))return"-";const o=Date.now()-s,a=Math.floor(o/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;const d=Math.floor(a/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`}function ne(r,s){return r.length<=s?r:r.slice(0,s)+"..."}function le({dailyRates:r,overallRate:s}){const{t:o}=$(),a=ie.map((l,x)=>({label:l,value:r[x]??0})),d=Math.max(...a.map(l=>l.value),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:[s,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:o("dashboard.last_7_days")})]}),e.jsx("div",{className:"flex gap-2",style:{height:80},children:a.map(l=>{const x=d>0?Math.max(l.value/d*100,4):4;return e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("div",{className:"relative w-full h-full rounded-[4px]",style:{backgroundColor:"rgba(34,197,94,0.1)"},children:e.jsx("div",{className:"absolute bottom-0 left-0 right-0 rounded-[4px]",style:{height:`${x}%`,backgroundColor:l.value>=80?"var(--accent)":l.value>=50?"var(--warning)":"var(--destructive)"}})}),e.jsx("span",{className:"shrink-0 text-[10px] text-[var(--text-muted)]",children:l.label})]},l.label)})})]})}function he(){const r=Q(),{t:s}=$(),o=I(t=>{var m;return((m=t.user)==null?void 0:m.role)==="admin"}),[a,d]=n.useState(null),[l,x]=n.useState([]),[p,k]=n.useState([]),[v,b]=n.useState([]),[i,c]=n.useState(0),[f,F]=n.useState(0),[C,K]=n.useState(!0),[P,G]=n.useState(!0),[q,B]=n.useState(!0),[H,J]=n.useState(!0),j=n.useCallback(async()=>{try{const t=await u.get("web/dashboard/stats").json();d(t)}catch{}finally{K(!1)}},[]),g=n.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-tasks",{searchParams:{limit:"5"}}).json();x(t)}catch{}finally{G(!1)}},[]),D=n.useCallback(async()=>{try{const t=await u.get("web/machines").json();k(t)}catch{}finally{B(!1)}},[]),M=n.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-activity").json();b(t)}catch{b([])}finally{J(!1)}},[]);n.useEffect(()=>{j(),g(),D(),M(),u.get("web/projects").json().then(t=>c(t.length)).catch(()=>{}),o&&u.get("admin/developers").json().then(t=>F(t.length)).catch(()=>{})},[j,g,D,M,o]);const y=n.useRef(null);n.useEffect(()=>(y.current=setInterval(()=>{j(),g()},ae),()=>{y.current&&clearInterval(y.current)}),[j,g]);const A=(a==null?void 0:a.success_rate_daily)??null,R=(a==null?void 0:a.task_success_rate_7d)??0;function V(t){switch(t){case h.ONLINE:return"var(--accent)";case h.DRAINING:return"var(--warning)";case h.OFFLINE:default:return"var(--text-muted)"}}function Y(t){switch(t){case h.ONLINE:return s("dashboard.online");case h.DRAINING:return s("dashboard.idle");case h.OFFLINE:default:return s("dashboard.offline")}}return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-6 md:py-8 font-mono",children:[e.jsx("div",{className:"mb-4 md:hidden",children:e.jsxs("span",{className:"text-base font-bold text-[var(--accent)]",children:["// ",s("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:re.map(({key:t,labelKey:m})=>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-[9px] md:text-xs text-[var(--text-muted)]",children:[s(m),":"]}),C?e.jsx("div",{className:"mt-1 h-6 md:h-8 w-12 md:w-16 animate-pulse rounded bg-[var(--bg-input)]"}):e.jsx("div",{className:"mt-1 flex items-baseline gap-2",children:e.jsx("span",{className:"text-2xl md:text-3xl font-bold text-[var(--text-primary)]",children:(a==null?void 0:a[t])??0})})]},t))}),e.jsx(se,{data:{activeTasks:((a==null?void 0:a.active_tasks)??0)+((a==null?void 0:a.queued_tasks)??0),totalMachines:p.length,totalProjects:i,totalDevelopers:f}}),e.jsxs("div",{className:"mb-6 grid gap-6 lg:grid-cols-3 items-stretch",children:[e.jsx("div",{className:"hidden md: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:s("dashboard.task_success_rate")})}),e.jsx("div",{className:"flex flex-1 flex-col justify-center p-5",children:C?e.jsx("div",{className:"h-24 animate-pulse rounded bg-[var(--bg-input)]"}):A?e.jsx(le,{dailyRates:A,overallRate:R}):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:[R,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("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:s("dashboard.recent_tasks")}),e.jsxs(N,{to:"/tasks",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{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:s("dashboard.recent_tasks")})}),e.jsx("div",{className:"px-3 pb-3 md:p-4",children:P?e.jsx(w,{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:s("dashboard.no_tasks_yet")})]}):e.jsx("div",{className:"flex flex-col gap-2 md:gap-0",children:l.map(t=>e.jsxs("div",{onClick:()=>r(`/tasks/${t.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-[10px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",t.id," ",t.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(T,{status:t.status})})]}),e.jsx("span",{className:"text-[9px] text-[var(--text-muted)] mt-1 block",children:L(t.createdAt)})]}),e.jsxs("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:["#",t.id]}),e.jsx("span",{className:"hidden md:inline flex-1 text-xs text-[var(--text-primary)] truncate",children:ne(t.description,40)}),e.jsx("span",{className:"hidden md:inline",children:e.jsx(T,{status:t.status})}),e.jsx("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:L(t.createdAt)})]},t.id))})})]})]}),e.jsxs("div",{className:"hidden md: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:s("dashboard.worker_status")}),e.jsxs(N,{to:"/machines",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:q?e.jsx(w,{rows:3}):p.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:s("dashboard.no_workers_registered")})]}):e.jsx("div",{className:"flex flex-col",children:p.map(t=>e.jsxs("div",{onClick:()=>r(`/machines/${t.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:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t.host??"--"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:[t.activeSlots,"/",t.maxSlots," ",s("dashboard.slots")]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs",style:{color:V(t.status)},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),Y(t.status)]})]})]},t.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:s("dashboard.recent_activity")}),o&&e.jsxs(N,{to:"/admin/audit-logs",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:H?e.jsx(w,{rows:4}):v.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:s("dashboard.no_recent_activity")})]}):e.jsx("div",{className:"flex flex-col",children:v.map(t=>{const m=t.message.match(/task\s*#?(\d+)/i),_=m?m[1]:null;return e.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border-row)] py-2 last:border-b-0 ${_?"cursor-pointer hover:bg-[var(--bg-input)] transition-colors":""}`,onClick:()=>_&&r(`/tasks/${_}`),children:[e.jsx("span",{className:"shrink-0 text-xs text-[var(--text-muted)]",children:L(t.timestamp)}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:t.message})]},t.id)})})})]})]})]})}export{he as default};
@@ -1,36 +0,0 @@
1
- import{c as n,u as m,a as h,j as e,T as p,L as l,b as x,S as y,r as g,C as v}from"./index-MlIm5Zqq.js";import{A as c}from"./arrow-right-B9x1F1gE.js";import{B as u}from"./bot-Dr86mLtd.js";import{U as b}from"./users-vLcPWGEp.js";import{C as j}from"./copy-CQsonKZY.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 f=n("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
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 _=n("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
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 k=n("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
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 N=n("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
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 w=n("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
27
- * @license lucide-react v0.469.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const K=n("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
32
- * @license lucide-react v0.469.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const M=n("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),d=[{icon:_,titleKey:"landing.step_define",descKey:"landing.step_define_desc"},{icon:k,titleKey:"landing.step_dispatch",descKey:"landing.step_dispatch_desc"},{icon:f,titleKey:"landing.step_monitor",descKey:"landing.step_monitor_desc"}],C=[{icon:x,titleKey:"landing.feature_terminal",descKey:"landing.feature_terminal_desc"},{icon:u,titleKey:"landing.feature_multi_agent",descKey:"landing.feature_multi_agent_desc"},{icon:N,titleKey:"landing.feature_routing",descKey:"landing.feature_routing_desc"},{icon:M,titleKey:"landing.feature_pipeline",descKey:"landing.feature_pipeline_desc"},{icon:b,titleKey:"landing.feature_collab",descKey:"landing.feature_collab_desc"},{icon:y,titleKey:"landing.feature_security",descKey:"landing.feature_security_desc"}],z=[{num:"01",titleKey:"landing.setup_step_1_title",descKey:"landing.setup_step_1_desc",commandKey:"landing.setup_step_1_command",linkLabel:"landing.setup_step_1_link",linkTo:"/docs/cli",icon:K},{num:"02",titleKey:"landing.setup_step_2_title",descKey:"landing.setup_step_2_desc",commandKey:"landing.setup_step_2_command",linkLabel:"landing.setup_step_2_link",linkTo:"/docs/cli",icon:w},{num:"03",titleKey:"landing.setup_step_3_title",descKey:"landing.setup_step_3_desc",commandKey:"landing.setup_step_3_command",linkLabel:"landing.setup_step_3_link",linkTo:"/docs/cli",icon:x}];function L({step:r,t:s}){const[t,a]=g.useState(!1),i=s(r.commandKey),o=async()=>{try{await navigator.clipboard.writeText(i),a(!0),setTimeout(()=>a(!1),2e3)}catch{}};return e.jsx("div",{className:"group rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] transition-shadow hover:shadow-md",children:e.jsxs("div",{className:"flex flex-col gap-4 p-5 sm:flex-row sm:items-start sm:gap-6",children:[e.jsxs("div",{className:"flex items-center gap-4 sm:w-56 sm:flex-shrink-0",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-[4px] bg-[var(--accent)]/10 text-[var(--accent)]",children:e.jsx(r.icon,{size:20})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-widest text-[var(--text-muted)]",children:s("landing.step_n",{n:r.num})}),e.jsx("h3",{className:"text-sm font-semibold text-[var(--text-primary)]",children:s(r.titleKey)})]})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs leading-relaxed text-[var(--text-secondary)]",children:s(r.descKey)}),e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-2.5",children:[e.jsxs("code",{className:"overflow-x-auto whitespace-nowrap text-[11px] text-[var(--text-primary)]",children:[e.jsx("span",{className:"select-none text-[var(--text-muted)]",children:"$ "}),i]}),e.jsx("button",{onClick:o,className:"ml-2 flex-shrink-0 rounded-[4px] p-1.5 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)]","aria-label":s("landing.copy_install_command"),children:t?e.jsx(v,{size:14,className:"text-[var(--accent)]"}):e.jsx(j,{size:14})})]}),e.jsx("div",{className:"mt-2",children:e.jsxs(l,{to:r.linkTo,className:"inline-flex items-center gap-1 text-[11px] text-[var(--accent)] transition-colors hover:brightness-110",children:[s(r.linkLabel),e.jsx(c,{size:12})]})})]})]})})}function G(){const s=m(a=>a.user)?"/home":"/login",{t}=h();return e.jsxs("div",{className:"min-h-screen bg-[var(--bg-primary)]",children:[e.jsx("nav",{className:"sticky top-0 z-50 border-b border-[var(--border)] bg-[var(--bg-primary)]/80 backdrop-blur-md",children:e.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center justify-between px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-[4px] bg-[var(--accent)]","aria-hidden":!0,style:{fontFamily:"'JetBrains Mono', monospace"},children:e.jsx("span",{className:"text-xl font-semibold",style:{color:"#0C0C0C"},children:"~"})}),e.jsx("span",{className:"text-lg font-bold text-[var(--text-primary)]",style:{fontSize:"20px",fontFamily:"'JetBrains Mono', monospace"},children:t("landing.overlord")})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(p,{}),e.jsx(l,{to:s,className:"text-xs font-medium text-[var(--accent)] transition-colors hover:opacity-80",children:t("landing.go_to_app")})]})]})}),e.jsxs("section",{className:"relative overflow-hidden",children:[e.jsx("div",{"aria-hidden":!0,className:"pointer-events-none absolute -top-40 left-1/2 h-[600px] w-[900px] -translate-x-1/2 rounded-full opacity-20 blur-3xl",style:{background:"radial-gradient(ellipse at center, var(--accent), transparent 70%)"}}),e.jsxs("div",{className:"relative mx-auto max-w-5xl px-4 pb-20 pt-24 text-center sm:px-6 sm:pb-28 sm:pt-32",children:[e.jsx("div",{className:"mb-6 inline-flex items-center rounded-full border border-[var(--accent)]/20 bg-[var(--accent)]/5 px-4 py-1.5 text-xs text-[var(--accent)]",children:t("landing.version_badge")}),e.jsxs("h1",{className:"text-3xl font-extrabold leading-tight tracking-tight text-[var(--text-primary)] sm:text-4xl md:text-5xl",children:[t("landing.hero_line1"),e.jsx("br",{}),e.jsx("span",{className:"text-[var(--accent)]",children:t("landing.hero_highlight")})]}),e.jsx("p",{className:"mx-auto mt-6 max-w-3xl text-sm leading-relaxed text-[var(--text-secondary)] sm:text-base",children:t("landing.hero_desc")}),e.jsxs("div",{className:"mt-10",children:[e.jsxs(l,{to:s,className:"inline-flex items-center gap-2 rounded-[4px] bg-[var(--accent)] px-8 py-3 text-sm font-semibold text-black shadow-lg shadow-[var(--accent)]/25 transition-all hover:brightness-110 active:scale-[0.98]",children:[t("landing.get_started"),e.jsx(c,{size:16})]}),e.jsxs(l,{to:"/docs/cli",className:"ml-4 inline-flex items-center gap-1 text-sm text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:[t("landing.read_docs")," ",e.jsx(c,{size:14})]})]})]})]}),e.jsx("section",{className:"border-t border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-20 sm:px-6 sm:py-28",children:[e.jsx("h2",{className:"text-center text-xl font-bold text-[var(--text-primary)] sm:text-2xl",children:t("landing.how_it_works")}),e.jsx("p",{className:"mx-auto mt-3 max-w-xl text-center text-sm text-[var(--text-secondary)]",children:t("landing.three_steps")}),e.jsx("div",{className:"mt-14 grid gap-8 sm:grid-cols-3",children:d.map((a,i)=>e.jsxs("div",{className:"relative text-center",children:[i<d.length-1&&e.jsx("div",{"aria-hidden":!0,className:"absolute right-0 top-8 hidden h-px w-8 translate-x-full bg-[var(--border)] sm:block"}),e.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-[var(--accent)]/10 text-[var(--accent)] text-sm font-bold",children:String(i+1).padStart(2,"0")}),e.jsx("div",{className:"mt-1 text-[10px] font-semibold uppercase tracking-widest text-[var(--text-muted)]",children:t("landing.step_n",{n:i+1})}),e.jsx("h3",{className:"mt-2 text-sm font-semibold text-[var(--text-primary)]",children:t(a.titleKey)}),e.jsx("p",{className:"mt-2 text-xs leading-relaxed text-[var(--text-secondary)]",children:t(a.descKey)})]},a.titleKey))})]})}),e.jsx("section",{className:"border-t border-[var(--border)]",children:e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-20 sm:px-6 sm:py-28",children:[e.jsx("h2",{className:"text-center text-xl font-bold text-[var(--text-primary)] sm:text-2xl",children:t("landing.everything_you_need")}),e.jsx("p",{className:"mx-auto mt-3 max-w-xl text-center text-sm text-[var(--text-secondary)]",children:t("landing.complete_platform")}),e.jsx("div",{className:"mt-14 grid gap-6 sm:grid-cols-2 lg:grid-cols-3",children:C.map(a=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 transition-shadow hover:shadow-md",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-[4px] bg-[var(--accent)]/10 text-[var(--accent)]",children:e.jsx(a.icon,{size:18})}),e.jsx("h3",{className:"mt-3 text-sm font-semibold text-[var(--text-primary)]",children:t(a.titleKey)}),e.jsx("p",{className:"mt-1.5 text-xs leading-relaxed text-[var(--text-secondary)]",children:t(a.descKey)})]},a.titleKey))})]})}),e.jsx("section",{className:"border-t border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-20 sm:px-6 sm:py-28",children:[e.jsx("h2",{className:"text-center text-xl font-bold text-[var(--text-primary)] sm:text-2xl",children:t("landing.install_title")}),e.jsx("p",{className:"mx-auto mt-3 max-w-xl text-center text-sm text-[var(--text-secondary)]",children:t("landing.install_desc")}),e.jsx("div",{className:"mt-14 space-y-4",children:z.map(a=>e.jsx(L,{step:a,t},a.num))}),e.jsx("div",{className:"mt-12 text-center",children:e.jsxs(l,{to:s,className:"inline-flex items-center gap-2 rounded-[4px] bg-[var(--accent)] px-8 py-3 text-sm font-semibold text-black shadow-lg shadow-[var(--accent)]/25 transition-all hover:brightness-110 active:scale-[0.98]",children:[t("landing.get_started"),e.jsx(c,{size:16})]})})]})}),e.jsx("footer",{className:"border-t border-[var(--border)]",children:e.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col items-center gap-4 px-4 py-8 text-xs text-[var(--text-secondary)] sm:flex-row sm:justify-between sm:px-6",children:[e.jsxs("span",{children:["© ",new Date().getFullYear()," ",t("landing.overlord")]}),e.jsxs("div",{className:"flex gap-6",children:[e.jsx("a",{href:"/docs/cli",className:"transition-colors hover:text-[var(--text-primary)]",children:t("landing.documentation")}),e.jsx("a",{href:"/docs/api",className:"transition-colors hover:text-[var(--text-primary)]",children:t("landing.api")})]})]})})]})}export{G as default};
@@ -1 +0,0 @@
1
- import{a as E,j as e,l as M,m as H,d as V,r as m,u as z,h as B,f as b,L as Q,s as C}from"./index-MlIm5Zqq.js";import{M as i,T as x}from"./protocol-C5uQmiiB.js";import{T as S}from"./trash-2-0XZvPD__.js";import{A as D}from"./arrow-left-BTuWsVB2.js";function q({isOpen:r,onClose:t,onConfirm:a,machineName:s,isDraining:o,loading:c}){const{t:d}=E();return e.jsx(M,{isOpen:r,onClose:t,onConfirm:a,title:d(o?"machines.undrain_machine_title":"machines.drain_machine_title"),message:o?d("machines.undrain_confirm",{name:s}):d("machines.drain_confirm",{name:s}),confirmLabel:d(o?"machines.undrain":"machines.drain"),confirmVariant:o?"accent":"warning",isLoading:c})}const J={[i.ONLINE]:"var(--accent)",[i.OFFLINE]:"var(--destructive)",[i.DRAINING]:"var(--warning)",[i.DECOMMISSIONED]:"var(--text-muted)"},K={[x.QUEUED]:"var(--text-muted)",[x.ASSIGNED]:"#60a5fa",[x.RUNNING]:"var(--accent)",[x.SUSPENDED]:"var(--warning)",[x.COMPLETED]:"var(--accent)",[x.FAILED]:"var(--destructive)",[x.CANCELLED]:"var(--text-muted)"};function g(r){return r?new Date(r).toLocaleString():"n/a"}function W(r){if(!r)return"never";const t=new Date(r).getTime();if(Number.isNaN(t))return"never";const a=Date.now()-t,s=Math.floor(a/1e3);if(s<60)return`${s}s ago`;const o=Math.floor(s/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}function I(r){return r>80?"var(--destructive)":r>60?"var(--warning)":"var(--accent)"}function se(){const{id:r}=H(),t=V(),{t:a}=E(),[s,o]=m.useState(null),[c,d]=m.useState([]),[L,O]=m.useState(!0),[$,h]=m.useState(!1),[T,y]=m.useState(!1),[A,u]=m.useState(!1),[U,w]=m.useState(!1),p=z(l=>{var v;return(v=l.user)==null?void 0:v.role});B(m.useMemo(()=>!s||s.status===i.DECOMMISSIONED?null:e.jsxs("div",{className:"flex items-center gap-2",children:[s.status===i.ONLINE&&e.jsxs("button",{onClick:()=>h(!0),className:"rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",a("machines.drain")]}),p==="admin"&&e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(S,{className:"h-3 w-3"}),a("machines.decommission")]})]}),[s,p,a]));const j=m.useCallback(async()=>{if(r)try{const[l,v]=await Promise.all([b.get(`web/machines/${r}`).json(),b.get(`web/machines/${r}/tasks`).json().catch(()=>[])]);o(l),d(v)}catch{}finally{O(!1)}},[r]);m.useEffect(()=>{j()},[j]);async function G(){if(s){y(!0);try{const l=s.status===i.DRAINING?"undrain":"drain";await b.post(`web/machines/${s.id}/${l}`),await j()}catch{}finally{y(!1),h(!1)}}}async function F(){if(s){w(!0);try{await b.delete(`admin/machines/${s.id}`),t("/machines")}catch{}finally{w(!1),u(!1)}}}if(L)return e.jsx("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("machines.loading_machine")})});if(!s)return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:a("machines.machine_not_found")}),e.jsxs("button",{onClick:()=>t("/machines"),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("machines.back_to_machines")]})]});const _=s.status===i.DRAINING,R=e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsx("button",{onClick:()=>t("/machines"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(D,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),e.jsxs("div",{className:"px-6 py-8",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(Q,{to:"/machines",className:"text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:a("machines.title")}),e.jsx("span",{className:"text-[var(--text-muted)]",children:"/"}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s.status!==i.DECOMMISSIONED&&e.jsxs("button",{onClick:()=>h(!0),className:"rounded-[4px] border border-[var(--accent)] px-4 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:["> ",a("machines.undrain")]}),p==="admin"&&s.status!==i.DECOMMISSIONED&&e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(S,{className:"h-3 w-3"}),a("machines.decommission")]})]})]}),e.jsx("div",{className:"mb-4",children:e.jsx("span",{className:"rounded-[4px] bg-[var(--warning)]/20 px-2.5 py-1 text-xs font-medium text-[var(--warning)]",children:a("machines.draining")})}),e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)]/40 bg-[var(--warning)]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(C,{className:"h-3.5 w-3.5 text-[var(--warning)]"}),e.jsx("span",{className:"text-xs text-[var(--warning)]",children:a("machines.draining_warning")})]}),e.jsx("p",{className:"text-xs text-[var(--warning)]/70 ml-5.5",children:a("machines.draining_active_tasks")})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-4",children:[e.jsx(N,{label:a("machines.cpu"),value:s.cpuUsage,unit:"%"}),e.jsx(N,{label:a("machines.memory"),value:s.memoryUsage,unit:"%"}),e.jsx(N,{label:a("machines.disk"),value:s.diskUsage,unit:"%"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("machines.slots")}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[s.activeSlots,"/",s.maxSlots]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.active_tasks")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:c.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_active_tasks")})]}):e.jsx(k,{tasks:c,navigate:t,t:a})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.capabilities")}),s.capabilities.length>0?e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:s.capabilities.map(l=>e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx("p",{className:"text-xs text-[var(--text-primary)]",children:l})},l))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_capabilities_short")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.machine_info")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(n,{label:a("machines.host"),value:s.host}),e.jsx(n,{label:a("machines.port"),value:String(s.port)}),s.sshUrl&&e.jsx(n,{label:"ssh url",value:s.sshUrl}),e.jsx(n,{label:a("machines.os"),value:s.os??a("machines.unknown")}),e.jsx(n,{label:a("machines.cpu_model"),value:s.cpuModel??a("machines.n_a")}),e.jsx(n,{label:a("machines.cpu_cores"),value:s.cpuCores!=null?String(s.cpuCores):a("machines.n_a")}),e.jsx(n,{label:a("machines.memory"),value:s.memoryGb!=null?`${s.memoryGb} gb`:a("machines.n_a")}),e.jsx(n,{label:a("machines.machine_id"),value:s.id}),e.jsx(n,{label:a("machines.last_heartbeat_label"),value:g(s.lastHeartbeat)}),e.jsx(n,{label:a("machines.slots"),value:`${s.activeSlots}/${s.maxSlots}`}),e.jsx(n,{label:a("machines.status_label"),value:s.status.toLowerCase()}),e.jsx(n,{label:a("machines.worker_version"),value:s.workerVersion??a("machines.n_a")})]})})]})]})]}),P=e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("button",{onClick:()=>t("/machines"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(D,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),s.status!==i.OFFLINE&&s.status!==i.DECOMMISSIONED&&e.jsxs("button",{onClick:()=>h(!0),className:"shrink-0 rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",a("machines.drain")]})]}),e.jsxs("div",{className:"px-6 py-8",children:[e.jsxs("button",{onClick:()=>t("/machines"),className:"mb-4 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:["< ",a("machines.back_to_machines")]}),e.jsxs("h1",{className:"mb-2 text-lg font-bold text-[var(--text-primary)] flex items-center gap-2",children:[s.name,e.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-normal",style:{color:J[s.status]},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),s.status.toLowerCase()]})]}),e.jsx("p",{className:"mb-6 text-xs text-[var(--text-muted)]",children:a("machines.last_heartbeat",{time:W(s.lastHeartbeat)})}),s.status===i.DECOMMISSIONED&&e.jsx("div",{className:"mb-6 rounded-[4px] border border-[var(--text-muted)]/40 bg-[var(--text-muted)]/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["this machine has been decommissioned",s.decommissionedAt?` on ${g(s.decommissionedAt)}`:""," and can no longer accept tasks."]})]})}),e.jsxs("div",{className:"mb-6 grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.resource_usage")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(f,{label:a("machines.cpu"),value:s.cpuUsage}),e.jsx(f,{label:a("machines.mem"),value:s.memoryUsage}),e.jsx(f,{label:a("machines.disk"),value:s.diskUsage})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.connection_info")}),e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(n,{label:a("machines.machine_id"),value:s.id}),e.jsx(n,{label:a("machines.host"),value:s.host}),e.jsx(n,{label:a("machines.port"),value:String(s.port)}),s.sshUrl&&e.jsx(n,{label:"ssh url",value:s.sshUrl}),e.jsx(n,{label:a("machines.os"),value:s.os??a("machines.unknown")}),e.jsx(n,{label:a("machines.cpu_model"),value:s.cpuModel??a("machines.n_a")}),e.jsx(n,{label:a("machines.cpu_cores"),value:s.cpuCores!=null?String(s.cpuCores):a("machines.n_a")}),e.jsx(n,{label:a("machines.memory"),value:s.memoryGb!=null?`${s.memoryGb} gb`:a("machines.n_a")}),e.jsx(n,{label:a("machines.last_heartbeat_label"),value:g(s.lastHeartbeat)}),e.jsx(n,{label:a("machines.slots"),value:`${s.activeSlots}/${s.maxSlots}`})]})]})]}),s.capabilities.length>0&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.capabilities")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.capabilities.map(l=>e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)]",children:l},l))})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsxs("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:[a("machines.current_tasks")," (",c.length,")"]}),c.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_active_tasks")})]}):e.jsx(k,{tasks:c,navigate:t,t:a})]})]})]});return e.jsxs(e.Fragment,{children:[_?R:P,e.jsx(q,{isOpen:$,onClose:()=>h(!1),onConfirm:G,machineName:s.name,isDraining:_,loading:T}),e.jsx(M,{isOpen:A,onClose:()=>u(!1),onConfirm:F,title:a("machines.decommission_title"),message:a("machines.decommission_confirm",{name:s.name}),confirmLabel:a("machines.decommission"),confirmVariant:"danger",isLoading:U})]})}function k({tasks:r,navigate:t,t:a}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.id")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.description")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.status_label")}),e.jsx("th",{className:"py-2 text-left font-normal text-[var(--text-muted)]",children:a("machines.stage")})]})}),e.jsx("tbody",{children:r.map(s=>e.jsxs("tr",{onClick:()=>t(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] hover:bg-[var(--bg-input)] transition-colors",children:[e.jsxs("td",{className:"py-2 pr-4 text-[var(--text-primary)]",children:["#",s.id]}),e.jsx("td",{className:"max-w-xs truncate py-2 pr-4 text-[var(--text-secondary)]",children:s.description}),e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("span",{style:{color:K[s.status]},children:["● ",s.status.toLowerCase()]})}),e.jsx("td",{className:"py-2 text-[var(--text-secondary)]",children:s.currentStage??"-"})]},s.id))})]})})}function N({label:r,value:t,unit:a}){return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[t,a]}),e.jsx("div",{className:"mt-3 h-1.5 w-full rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${t}%`,backgroundColor:I(t)}})})]})}function f({label:r,value:t}){return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-[var(--text-secondary)]",children:r}),e.jsxs("span",{className:"text-[var(--text-primary)]",children:[t,"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${t}%`,backgroundColor:I(t)}})})]})}function n({label:r,value:t}){return e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:r}),e.jsx("span",{className:"truncate text-[var(--text-primary)]",children:t})]})}export{se as default};
@@ -1,6 +0,0 @@
1
- import{c as B,a as I,j as e,r as s,f as C,X as K,o as q,d as W,u as H,h as V,q as O}from"./index-MlIm5Zqq.js";import{M as u}from"./protocol-C5uQmiiB.js";import X from"./WorkerSetupGuidePage-9Z7LKYBn.js";import{C as z}from"./copy-CQsonKZY.js";import{L as J}from"./loader-circle-t2hVF1ss.js";import{S as Q}from"./Select-CPqSszMb.js";import{E as Y}from"./EmptyState-DzCKambS.js";import{C as Z}from"./Skeleton-CY9tzQX6.js";import{P as ee}from"./plus-58oQJgAF.js";import"./key-CN5iSZmy.js";import"./settings-D9FZzg11.js";/**
2
- * @license lucide-react v0.469.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const te=B("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),F={[u.ONLINE]:"var(--accent)",[u.OFFLINE]:"var(--destructive)",[u.DRAINING]:"var(--warning)",[u.DECOMMISSIONED]:"var(--text-muted)"};function ae(a){return a>80?"var(--destructive)":a>60?"var(--warning)":"var(--accent)"}function re({machine:a,onPress:r}){const{t:i}=I();return e.jsxs("div",{onClick:r,className:`rounded border border-[var(--border)] bg-[var(--bg-card)] p-4 font-mono lowercase transition-colors ${r?"cursor-pointer hover:border-[var(--accent)]/40 hover:bg-[var(--bg-input)]":""}`,children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("h3",{className:"truncate text-sm text-[var(--text-primary)]",children:[e.jsx("span",{style:{color:F[a.status],fontSize:"0.6rem"},children:"●"})," ",a.name]}),e.jsx("span",{className:"text-xs",style:{color:F[a.status]},children:a.status})]}),e.jsxs("div",{className:"mb-3 text-xs text-[var(--text-muted)]",children:[a.host,a.os?`:${a.os}`:""]}),e.jsxs("div",{className:"mb-3 flex flex-col gap-2",children:[e.jsx(S,{label:i("machines.cpu"),value:a.cpuUsage}),e.jsx(S,{label:i("machines.mem"),value:a.memoryUsage}),e.jsx(S,{label:i("machines.disk"),value:a.diskUsage})]}),e.jsx("div",{className:"flex items-center justify-between text-xs",children:e.jsx("span",{className:"text-[var(--text-secondary)]",children:i("machines.tasks_slots",{active:String(a.activeSlots),max:String(a.maxSlots)})})}),a.capabilities.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:a.capabilities.map(t=>e.jsx("span",{className:"rounded border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:t},t))})]})}function S({label:a,value:r}){return e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-8 text-[var(--text-muted)]",children:a}),e.jsx("div",{className:"h-1.5 flex-1 rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${r}%`,backgroundColor:ae(r)}})}),e.jsxs("span",{className:"w-8 text-right text-[var(--text-secondary)]",children:[r,"%"]})]})}function se({isOpen:a,onClose:r,onRegistered:i}){const{t}=I(),[c,m]=s.useState(1),[d,h]=s.useState(!1),[o,v]=s.useState(""),[g,f]=s.useState(null),[y,b]=s.useState(""),[j,N]=s.useState(""),[l,x]=s.useState(!1),[_,w]=s.useState(!1),[P,E]=s.useState(""),[T,M]=s.useState(""),p=s.useRef(null),A={1:t("machines.reg_step_generate_token"),2:t("machines.reg_step_install_worker"),3:t("machines.reg_step_waiting_activation"),4:t("machines.reg_step_activated")};s.useEffect(()=>(a&&(m(1),v(""),f(null),b(""),N(""),x(!1),w(!1),E(""),M(""),h(!1)),()=>{p.current&&clearInterval(p.current)}),[a]);const $=async()=>{const n=y.trim();if(!n){N(t("admin.pat_label_required"));return}N(""),h(!0);try{const k=await C.post("admin/worker-tokens",{json:{label:n}}).json();v(k.token),f(k.tokenId),m(2)}catch{}finally{h(!1)}},D=typeof window<"u"?window.location.origin:"https://overlord.example.com",L=o?`overlord setup worker --token ${o} --server ${D}`:"",G=()=>{navigator.clipboard.writeText(o),x(!0),setTimeout(()=>x(!1),2e3)},R=()=>{navigator.clipboard.writeText(L),w(!0),setTimeout(()=>w(!1),2e3)},U=s.useCallback(()=>{g&&(m(3),p.current=setInterval(async()=>{try{const n=await C.get(`admin/worker-tokens/${g}/status`).json();n.used&&n.machineName&&(E(n.machineName),M(n.machineId??""),m(4),p.current&&clearInterval(p.current),i==null||i())}catch{}},3e3))},[g,i]);return s.useEffect(()=>()=>{p.current&&clearInterval(p.current)},[]),a?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center font-mono lowercase",children:[e.jsx("div",{className:"absolute inset-0 bg-[var(--bg-primary)]/60 backdrop-blur-sm",onClick:r}),e.jsxs("div",{className:"relative z-10 w-full max-w-[1080px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8",children:[e.jsx("button",{type:"button",onClick:r,className:"absolute right-4 top-4 text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:e.jsx(K,{className:"h-4 w-4"})}),e.jsx("h2",{className:"text-lg font-bold text-[var(--accent)]",children:t("machines.reg_title")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:t("machines.reg_subtitle")}),e.jsx("div",{className:"mt-6 flex items-center justify-center gap-2",children:[1,2,3,4].map((n,k)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:`rounded-[4px] px-3 py-1.5 text-[11px] font-bold ${n===c?"bg-[var(--accent)] text-black":n<c?"bg-[var(--accent)]/20 text-[var(--accent)]":"border border-[var(--border)] bg-[var(--bg-primary)] text-[var(--text-muted)]"}`,children:[n,". ",A[n]]}),k<3&&e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"→"})]},n))}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:`rounded-[4px] border p-4 ${c===1?"border-[var(--accent)] bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--accent)]",children:["> ",t("machines.reg_step_generate_token")]}),c===1&&!o?e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:t("machines.reg_click_to_generate")}),j&&e.jsx("p",{className:"text-[10px] text-red-400",children:j}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:t("admin.label")}),e.jsx("input",{type:"text",placeholder:t("admin.pat_label_placeholder"),value:y,onChange:n=>b(n.target.value),onKeyDown:n=>{n.key==="Enter"&&$()},className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-[11px] text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none"})]}),e.jsx("button",{type:"button",onClick:$,disabled:d,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black disabled:opacity-50",children:t(d?"admin.generating":"machines.reg_step_generate_token")})]}):o?e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:t("machines.reg_token_generated")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 pr-16",children:[e.jsx("code",{className:"block break-all text-[10px] text-[var(--text-primary)]",children:o}),e.jsx("button",{type:"button",onClick:G,className:"absolute right-2 top-1.5 text-[10px] text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:l?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(z,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] text-[var(--text-muted)]",children:t("admin.setup_command")}),e.jsxs("div",{className:"relative rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 pr-16",children:[e.jsxs("code",{className:"block break-all text-[10px] text-[var(--accent)]",children:["$ ",L]}),e.jsx("button",{type:"button",onClick:R,className:"absolute right-2 top-1.5 text-[10px] text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:_?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(z,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsx("div",{className:"rounded-[4px] border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-[10px] text-yellow-400",children:t("admin.token_shown_once")})]}):e.jsx("p",{className:"mt-2 text-[10px] text-[var(--text-muted)]",children:t("machines.reg_completed")})]}),e.jsxs("div",{className:`rounded-[4px] border p-4 ${c===2?"border-[var(--accent)] bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--text-primary)]",children:["> ",t("machines.reg_step_install_worker")]}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("machines.reg_running_installation")}),c>=2&&e.jsxs("div",{className:"mt-3 space-y-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3",children:[e.jsx("p",{className:"text-[10px] text-[var(--text-primary)]",children:"$ overlord setup worker"}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)]",children:"server url: https://..."}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)]",children:"worker token: ovw_..."}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)]",children:"machine name: my-worker"}),e.jsx("p",{className:"text-[10px] text-[var(--accent)]",children:"config written. starting worker..."}),c===2&&e.jsx("p",{className:"text-[10px] text-[var(--accent)] animate-pulse",children:"&block;"})]}),c===2&&e.jsx("button",{type:"button",onClick:U,className:"mt-3 rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black",children:t("machines.reg_installed_wait")})]}),e.jsxs("div",{className:`rounded-[4px] border p-4 ${c===3?"border-amber-500 bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--text-primary)]",children:["> ",t("machines.reg_step_waiting_activation")]}),c>=3?e.jsx("div",{className:"mt-3 flex flex-col items-center justify-center gap-3 py-6",children:c===3?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border-2 border-amber-500",children:e.jsx(J,{className:"h-5 w-5 animate-spin text-amber-500"})}),e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:t("machines.reg_listening_for_worker")})]}):e.jsx("p",{className:"text-[10px] text-[var(--accent)]",children:t("machines.reg_worker_connected")})}):e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("machines.reg_waiting_for_worker")})]}),e.jsxs("div",{className:`rounded-[4px] border p-4 ${c===4?"border-[var(--accent)] bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--text-primary)]",children:["> ",t("machines.reg_step_activated")]}),c===4?e.jsxs("div",{className:"mt-3 flex flex-col items-center justify-center gap-3 py-6",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-[var(--accent)]/20",children:e.jsx(q,{className:"h-6 w-6 text-[var(--accent)]"})}),e.jsx("p",{className:"text-xs font-bold text-[var(--accent)]",children:t("machines.reg_worker_activated",{name:P})}),T&&e.jsxs("p",{className:"text-[10px] text-[var(--text-muted)]",children:["machine_id: ",T]})]}):e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("machines.reg_worker_registered")})]})]}),c===4&&e.jsx("div",{className:"mt-6 flex justify-end",children:e.jsx("button",{type:"button",onClick:r,className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-xs font-bold text-black",children:t("machines.reg_done")})})]})]}):null}function be(){const a=W(),{t:r}=I(),[i,t]=s.useState([]),[c,m]=s.useState(!0),[d,h]=s.useState("all"),[o,v]=s.useState("fleet"),[g,f]=s.useState(!1),[y,b]=s.useState(0),j=H(l=>{var x;return(x=l.user)==null?void 0:x.role}),N=s.useMemo(()=>[{value:"all",label:r("machines.all_statuses")},{value:u.ONLINE,label:r("machines.online")},{value:u.OFFLINE,label:r("machines.offline")},{value:u.DRAINING,label:r("machines.draining")}],[r]);return V(s.useMemo(()=>j==="admin"?e.jsxs("button",{type:"button",onClick:()=>f(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",children:[e.jsx(ee,{size:14}),r("machines.register_worker")]}):null,[j,r])),s.useEffect(()=>{async function l(){m(!0);try{const x=new URLSearchParams;d!=="all"&&x.set("status",d);const _=await C.get("web/machines",{searchParams:x}).json();t(_)}catch{}finally{m(!1)}}l()},[d,y]),e.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between border-b border-[var(--border)]",children:[e.jsxs("div",{className:"flex",children:[e.jsxs("button",{type:"button",onClick:()=>{v("fleet"),b(l=>l+1)},className:`flex items-center gap-2 px-4 py-2.5 text-xs transition-colors ${o==="fleet"?"border-b-2 border-[var(--accent)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:[e.jsx(O,{size:14}),r("machines.fleet")]}),e.jsxs("button",{type:"button",onClick:()=>v("setup_guide"),className:`flex items-center gap-2 px-4 py-2.5 text-xs transition-colors ${o==="setup_guide"?"border-b-2 border-[var(--accent)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:[e.jsx(te,{size:14}),r("machines.setup_guide")]})]}),o==="fleet"&&e.jsx(Q,{value:d,onChange:h,options:N})]}),o==="fleet"?c?e.jsx(Z,{cards:6}):i.length===0?e.jsx(Y,{icon:O,title:r("machines.no_machines_found"),description:r(d!=="all"?"machines.try_changing_status_filter":"machines.no_machines_registered"),action:e.jsx("button",{type:"button",onClick:()=>v("setup_guide"),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:r("machines.view_setup_guide")})}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:i.map(l=>e.jsx(re,{machine:l,onPress:()=>a(`/machines/${l.id}`)},l.id))}):e.jsx(X,{}),e.jsx(se,{isOpen:g,onClose:()=>{f(!1),b(l=>l+1)},onRegistered:()=>{b(l=>l+1)}})]})}export{be as default};
@@ -1,7 +0,0 @@
1
- import{c as F,a as S,j as e,l as G,m as K,d as q,u as B,r as l,h as H,f as j,v as J}from"./index-MlIm5Zqq.js";import{T as d}from"./protocol-C5uQmiiB.js";import{U as Q,A as V,R as z}from"./RemoveMemberConfirmDialog-8DleD0Hw.js";import{P as W}from"./pencil-C9FcKtr5.js";import{T as X}from"./trash-2-0XZvPD__.js";import{P as Y}from"./plus-58oQJgAF.js";import"./Select-CPqSszMb.js";/**
2
- * @license lucide-react v0.469.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Z=F("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ee({isOpen:n,onClose:a,onConfirm:t,projectName:o,loading:p}){const{t:r}=S();return e.jsx(G,{isOpen:n,onClose:a,onConfirm:t,title:`> ${r("projects.delete_project")}`,message:r("projects.delete_project_confirm",{name:o}),confirmLabel:r("projects.delete_project"),confirmVariant:"danger",isLoading:p})}const te={[d.QUEUED]:"var(--text-muted)",[d.ASSIGNED]:"var(--info)",[d.RUNNING]:"var(--info)",[d.SUSPENDED]:"var(--warning)",[d.COMPLETED]:"var(--accent)",[d.FAILED]:"var(--destructive)",[d.CANCELLED]:"var(--text-muted)"};function D(n){return new Date(n).toLocaleString()}function de(){const{key:n}=K(),a=q(),{t}=S(),o=B(s=>s.user),p=(o==null?void 0:o.role)==="admin",[r,M]=l.useState(null),[u,P]=l.useState([]),i=p||u.some(s=>s.developerId===(o==null?void 0:o.id)&&s.role==="maintainer"),[w,L]=l.useState([]),[A,E]=l.useState(!0),[x,f]=l.useState(null),[I,N]=l.useState(!1),[T,k]=l.useState(!1),[$,_]=l.useState(!1),[m,y]=l.useState(null),[U,C]=l.useState(!1);H(l.useMemo(()=>r?e.jsxs(e.Fragment,{children:[i&&e.jsxs("button",{onClick:()=>a(`/projects/${r.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(W,{className:"h-3 w-3"}),t("common.edit")]}),p&&e.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(X,{className:"h-3 w-3"}),t("common.delete")]})]}):null,[r,i,p,a,t]));const v=l.useCallback(async()=>{if(n)try{const[s,g,h]=await Promise.all([j.get(`web/projects/${n}`).json(),j.get(`web/projects/${n}/members`).json().catch(()=>[]),j.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(b=>b.data).catch(()=>[])]);if(M(s),P(g),L(h),s.pipeline)try{f(JSON.parse(s.pipeline))}catch{f(null)}else f(null)}catch{}finally{E(!1)}},[n]);l.useEffect(()=>{v()},[v]);async function O(){if(r){k(!0);try{await j.delete(`admin/projects/${r.key}`),a("/projects")}catch{}finally{k(!1),N(!1)}}}async function R(){if(!(!r||!m)){C(!0);try{await j.delete(`web/projects/${r.key}/members`,{searchParams:{developerId:String(m.developerId)}}),await v()}catch{}finally{C(!1),y(null)}}}return A?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r?e.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>a("/projects"),children:t("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:t("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{label:t("projects.key"),value:r.key}),e.jsx(c,{label:t("projects.name"),value:r.name}),e.jsx(c,{label:t("projects.repo_url"),value:r.repoUrl,href:r.repoUrl}),r.sshUrl&&e.jsx(c,{label:t("projects.ssh_url"),value:r.sshUrl}),e.jsx(c,{label:t("projects.git_platform"),value:r.gitPlatform}),e.jsx(c,{label:t("projects.default_branch"),value:r.defaultBranch}),e.jsx(c,{label:t("projects.agent_type"),value:r.agentType}),e.jsx(c,{label:t("projects.max_turns"),value:String(r.maxTurns)}),e.jsx(c,{label:t("projects.allowed_tools"),value:r.allowedTools??"all"}),e.jsx(c,{label:t("projects.auto_merge"),value:r.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:t("projects.members")}),i&&e.jsxs("button",{onClick:()=>_(!0),className:"flex items-center gap-1.5 rounded bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(Y,{className:"h-3.5 w-3.5"}),t("projects.add_member")]})]}),u.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("projects.no_members_yet")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.added_at")}),i&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:t("common.actions")})]})}),e.jsx("tbody",{children:u.map(s=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:s.developerName??`#${s.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:s.role==="maintainer"?"var(--warning)":"var(--text-secondary)"},children:s.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)}),i&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>y(s),className:"text-[var(--destructive)] hover:underline","aria-label":t("projects.remove_member"),children:e.jsx(Q,{className:"h-3.5 w-3.5"})})})]},s.developerId))})]})})]}),e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:t("projects.recent_tasks")}),w.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("projects.no_tasks_for_project")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.created")})]})}),e.jsx("tbody",{children:w.map(s=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${s.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",s.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)]",children:s.description}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:te[s.status]},children:s.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)})]},s.id))})]})})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:t("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),x!=null&&x.stages&&x.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:x.stages.map((s,g)=>{var h,b;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>a(`/projects/${r.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:s.name}),s.command&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",s.command.split(`
7
- `)[0].slice(0,40)]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.confirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:t("projects.confirm_label")}),s.irreversible&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--destructive)]",style:{backgroundColor:"rgba(239,68,68,0.12)"},children:t("pipeline.irreversible")})]})]}),((h=s.onFailure)==null?void 0:h.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(J,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[10px] text-[var(--warning)]",children:["onFailure.goto: ",s.onFailure.goto,", maxLoops: ",s.onFailure.maxLoops]})]}),g<x.stages.length-1&&!((b=s.onFailure)!=null&&b.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(Z,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},s.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:t("projects.no_pipeline_configured")}),i&&e.jsx("button",{onClick:()=>a(`/projects/${r.key}/pipeline`),className:"mt-3 flex w-full items-center justify-center gap-1.5 py-2 text-xs text-[var(--accent)] hover:text-[var(--accent)]",children:t("projects.add_stage")})]})})]}),e.jsx(ee,{isOpen:I,onClose:()=>N(!1),onConfirm:O,projectName:r.name,loading:T}),e.jsx(V,{isOpen:$,onClose:()=>_(!1),projectKey:r.key,existingMemberIds:u.map(s=>s.developerId),onAdded:v}),e.jsx(z,{isOpen:!!m,onClose:()=>y(null),onConfirm:R,memberName:m?m.developerName??`#${m.developerId}`:"",loading:U})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("projects.project_not_found")}),e.jsx("button",{onClick:()=>a("/projects"),className:"mt-4 rounded border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:t("projects.back_to_projects")})]})}function c({label:n,value:a,href:t}){return e.jsxs("div",{className:"flex items-center gap-3 py-1",children:[e.jsx("span",{className:"w-32 shrink-0 text-xs text-[var(--text-muted)]",children:n}),t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"truncate text-sm text-[var(--accent)] hover:underline",children:a}):e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:a})]})}export{de as default};
@@ -1,6 +0,0 @@
1
- import{c as L,a as E,r as a,j as e,f as z,d as D,h as R}from"./index-MlIm5Zqq.js";import{G as h,A as b}from"./protocol-C5uQmiiB.js";import{S as F}from"./Select-CPqSszMb.js";import{E as G}from"./EmptyState-DzCKambS.js";import{T as I}from"./Skeleton-CY9tzQX6.js";import{P as H}from"./plus-58oQJgAF.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 O=L("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),v={width:"100%",padding:"0.5rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},p={display:"block",color:"var(--text-secondary)",fontSize:"0.7rem",marginBottom:"0.25rem",fontFamily:"'JetBrains Mono', monospace"};function J({isOpen:c,onClose:s,onCreated:u}){const{t:r}=E(),[n,l]=a.useState(""),[d,x]=a.useState(""),[i,g]=a.useState(""),[o,f]=a.useState(""),[m,S]=a.useState("main"),[k,N]=a.useState(h.GITHUB),[B,T]=a.useState(b.CLAUDE),[j,w]=a.useState(!1),[U,C]=a.useState("");a.useEffect(()=>{c&&A()},[c]);function A(){l(""),x(""),g(""),f(""),S("main"),N(h.GITHUB),T(b.CLAUDE),C("")}function _(){A(),s()}async function M(t){t.preventDefault(),C(""),w(!0);try{const y=await z.post("admin/projects",{json:{name:n,key:d,repoUrl:i,sshUrl:o||void 0,defaultBranch:m,gitPlatform:k,agentType:B}}).json();u(y),_()}catch(y){const P=y instanceof Error?y.message:r("projects.failed_to_create_project");C(P)}finally{w(!1)}}return c?e.jsx("div",{onClick:_,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:t=>t.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600},children:["> ",r("projects.create_project")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:r("projects.add_project_desc")})]}),U&&e.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.7rem"},children:U}),e.jsxs("form",{onSubmit:M,style:{display:"flex",flexDirection:"column",gap:"0.875rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:p,children:r("projects.project_name")}),e.jsx("input",{type:"text",value:n,onChange:t=>l(t.target.value),placeholder:r("projects.project_name_placeholder"),required:!0,autoFocus:!0,style:v,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:p,children:r("projects.project_key")}),e.jsx("input",{type:"text",value:d,onChange:t=>x(t.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:r("projects.project_key_placeholder"),required:!0,style:v,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:r("projects.project_key_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{style:p,children:r("projects.repo_url")}),e.jsx("input",{type:"text",value:i,onChange:t=>g(t.target.value),placeholder:r("projects.repo_url_placeholder"),required:!0,style:v,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:p,children:r("projects.ssh_url")}),e.jsx("input",{type:"text",value:o,onChange:t=>f(t.target.value),placeholder:r("projects.ssh_url_placeholder"),style:v,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:r("projects.ssh_url_hint")})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"0.75rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:p,children:r("projects.default_branch")}),e.jsx("input",{type:"text",value:m,onChange:t=>S(t.target.value),placeholder:r("projects.main"),style:v,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:p,children:r("projects.git_platform")}),e.jsx(F,{value:k,onChange:t=>N(t),options:[{value:h.GITHUB,label:r("projects.github")},{value:h.GITLAB,label:r("projects.gitlab")},{value:h.GITEA,label:r("projects.gitea")}]})]}),e.jsxs("div",{children:[e.jsx("label",{style:p,children:r("projects.agent_type")}),e.jsx(F,{value:B,onChange:t=>T(t),options:[{value:b.CLAUDE,label:r("projects.claude")},{value:b.CURSOR,label:r("projects.cursor")},{value:b.CODEX,label:r("projects.codex")},{value:b.CUSTOM,label:r("projects.custom")}]})]})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("button",{type:"button",onClick:_,disabled:j,style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"color 0.15s, border-color 0.15s"},className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",children:r("common.cancel")}),e.jsx("button",{type:"submit",disabled:j||!n||!d||!i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:j||!n||!d||!i?"not-allowed":"pointer",opacity:j||!n||!d||!i?.7:1},children:r(j?"common.creating":"common.create")})]})]})]})}):null}function $(c){if(!c)return"-";const s=new Date(c).getTime();if(Number.isNaN(s))return"-";const u=Date.now()-s,r=Math.floor(u/1e3);if(r<60)return`${r}s ago`;const n=Math.floor(r/60);if(n<60)return`${n}m ago`;const l=Math.floor(n/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function Y(){const c=D(),{t:s}=E(),[u,r]=a.useState([]),[n,l]=a.useState(!0),[d,x]=a.useState(!1);R(a.useMemo(()=>e.jsxs("button",{onClick:()=>x(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),s("projects.create_project")]}),[s]));async function i(){l(!0);try{const o=await z.get("web/projects").json();r(o)}catch{}finally{l(!1)}}a.useEffect(()=>{i()},[]);function g(o){i()}return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8",children:[n?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(I,{rows:4})}):u.length===0?e.jsx(G,{icon:O,title:s("projects.no_projects_yet"),description:s("projects.create_first_project"),actionLabel:s("projects.create_project"),onAction:()=>x(!0)}):e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"grid grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-2.5 text-xs font-medium text-[var(--text-muted)]",children:[e.jsx("span",{children:"#"}),e.jsx("span",{children:s("projects.key")}),e.jsx("span",{children:s("projects.name")}),e.jsx("span",{children:s("projects.members")}),e.jsx("span",{children:s("projects.tasks_count")}),e.jsx("span",{children:s("projects.last_activity")})]}),u.map((o,f)=>e.jsxs("div",{onClick:()=>c(`/projects/${o.key}`),className:"grid cursor-pointer grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors items-center",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:f+1}),e.jsx("span",{className:"truncate text-xs text-[var(--accent)]",children:o.key}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-xs text-[var(--text-primary)]",children:o.name}),e.jsxs("span",{className:"block truncate text-[10px] text-[var(--text-muted)]",children:[o.agentType," · ",o.repoUrl.replace(/^https?:\/\//,"").split("/").slice(-2).join("/")]})]}),e.jsx("div",{className:"flex items-center",children:e.jsxs("div",{className:"flex -space-x-1.5",children:[(o.members??[]).map(m=>e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--accent)]/20 text-[9px] font-bold text-[var(--accent)]",title:m.name,children:m.name.charAt(0).toUpperCase()},m.id)),(o.memberCount??0)>5&&e.jsxs("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--bg-input)] text-[9px] text-[var(--text-muted)]",children:["+",o.memberCount-5]})]})}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:o.taskCount??0}),e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:$(o.lastActivity??null)})]},o.key))]}),e.jsx(J,{isOpen:d,onClose:()=>x(!1),onCreated:g})]})}export{Y as default};
@@ -1,6 +0,0 @@
1
- import{c as w,a as _,r as s,j as e,X as R,f as g,l as C}from"./index-MlIm5Zqq.js";import{P as l}from"./protocol-C5uQmiiB.js";import{S as N}from"./Select-CPqSszMb.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 L=w("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);function $({isOpen:a,onClose:i,projectKey:d,existingMemberIds:m=[],onAdded:x}){const{t}=_(),[E,M]=s.useState([]),[o,u]=s.useState(""),[v,j]=s.useState(l.MEMBER),[p,f]=s.useState(!1),[y,b]=s.useState("");s.useEffect(()=>{if(!a)return;async function r(){try{const c=await g.get("web/projects/-/developers").json();M(c)}catch{}}r()},[a]);function n(){u(""),j(l.MEMBER),b(""),i()}async function k(r){if(r.preventDefault(),!!o){b(""),f(!0);try{await g.post(`web/projects/${d}/members`,{json:{developerId:parseInt(o,10),role:v}}),x(),n()}catch(c){const h=c instanceof Error?c.message:"",S=h.includes("409")?t("projects.member_already_exists"):h||t("projects.failed_to_add_member");b(S)}finally{f(!1)}}}return a?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)]",onClick:n}),e.jsx("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("form",{onSubmit:k,children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h3",{className:"text-sm text-[var(--text-primary)]",children:t("projects.add_member_title")}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:n,children:e.jsx(R,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:t("projects.developer")}),e.jsx(N,{value:o,onChange:u,options:E.filter(r=>!m.includes(r.id)).map(r=>({value:String(r.id),label:`${r.name} (${r.gitEmail})`})),placeholder:t("projects.select_developer")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:t("projects.role")}),e.jsx(N,{value:v,onChange:r=>j(r),options:[{value:l.MEMBER,label:t("projects.member_role")},{value:l.MAINTAINER,label:t("projects.maintainer_role")}]})]}),y&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:y})]}),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:p,onClick:n,children:t("common.cancel")}),e.jsx("button",{type:"submit",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:p||!o,children:t(p?"projects.adding":"projects.add_member")})]})]})})]}):null}function B({isOpen:a,onClose:i,onConfirm:d,memberName:m,loading:x}){const{t}=_();return e.jsx(C,{isOpen:a,onClose:i,onConfirm:d,title:`> ${t("projects.remove_member")}`,message:t("projects.remove_member_confirm",{name:m}),confirmLabel:t("common.remove"),confirmVariant:"danger",isLoading:x})}export{$ as A,B as R,L as U};
@@ -1 +0,0 @@
1
- import{a as c,j as e,r as n,C as o}from"./index-MlIm5Zqq.js";import{E as i}from"./external-link-BpHI4mME.js";import{C as d}from"./copy-CQsonKZY.js";function a({text:t}){const[s,r]=n.useState(!1);return e.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),2e3)},className:"rounded-[4px] p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:s?e.jsx(o,{className:"h-3 w-3 text-[var(--accent)]"}):e.jsx(d,{className:"h-3 w-3"})})}function x({text:t}){return e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:t}),e.jsx(a,{text:t})]})}const l=[{action:"create tasks",desc:"describe what you want done, overlord dispatches to a worker"},{action:"list & monitor tasks",desc:"check status, read execution logs, track progress"},{action:"cancel & retry tasks",desc:"manage task lifecycle"},{action:"confirm pipeline stages",desc:"approve or provide input for suspended stages"},{action:"manage projects",desc:"list projects, view members"},{action:"check cluster health",desc:"see machine status, online workers, queue depth"},{action:"search",desc:"find tasks, projects, and machines by keyword"},{action:"read notifications",desc:"check and clear your notification inbox"}],m=['create a task in project "frontend" to fix the login page styling',"what tasks are running right now?","show me the logs for task 42","how many machines are online?","cancel task 15"],p=[{name:"claude code",url:"https://claude.com/claude-code"},{name:"cursor",url:"https://cursor.com"},{name:"windsurf",url:"https://windsurf.com"},{name:"codex",url:"https://openai.com/codex"}];function b(){c();const t=typeof window<"u"?window.location.origin:"https://your-server";return e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."})}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// install"}),e.jsx(x,{text:"npx skills add overlord-run/skill"})]}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// configure — set these environment variables"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=",e.jsx("span",{className:"text-[var(--accent)]",children:t})]}),e.jsx(a,{text:`export OVERLORD_SERVER=${t}`})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"your-token"})]}),e.jsx(a,{text:"export OVERLORD_TOKEN=your-token"})]})]}),e.jsxs("p",{className:"text-[10px] text-[var(--text-muted)]",children:["// create a token at ",e.jsx("a",{href:"/access-tokens",className:"text-[var(--accent)] hover:underline",children:"/access-tokens"})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> capabilities"}),e.jsx("div",{className:"space-y-2",children:l.map(s=>e.jsxs("div",{className:"flex items-start gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("span",{className:"shrink-0 text-xs font-medium text-[var(--text-primary)]",children:s.action}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.desc]})]},s.action))})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> example usage"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:"// just ask your ai agent naturally"}),m.map(s=>e.jsx("div",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:e.jsxs("code",{className:"text-xs text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> "}),s]})},s))]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> compatible tools"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:p.map(s=>e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2.5 text-xs text-[var(--text-primary)] transition-colors hover:border-[var(--accent)]",children:[s.name,e.jsx(i,{className:"h-3 w-3 text-[var(--text-muted)]"})]},s.name))}),e.jsx("p",{className:"mt-2 text-[10px] text-[var(--text-muted)]",children:"// and any ai coding assistant that supports the skills protocol"})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["// open source:"," ",e.jsx("a",{href:"https://github.com/overlord-run/skill",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent)] hover:underline",children:"github.com/overlord-run/skill"})]})})]})}export{b as default};