@overlordai/server 1.0.38 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/database/repositories/machine.repository.d.ts +2 -0
- package/dist/database/repositories/machine.repository.d.ts.map +1 -1
- package/dist/database/repositories/machine.repository.js +4 -0
- package/dist/database/repositories/machine.repository.js.map +1 -1
- package/dist/dispatcher/heartbeat.service.d.ts +2 -1
- package/dist/dispatcher/heartbeat.service.d.ts.map +1 -1
- package/dist/dispatcher/heartbeat.service.js +4 -1
- package/dist/dispatcher/heartbeat.service.js.map +1 -1
- package/dist/web/worker-channel.gateway.d.ts.map +1 -1
- package/dist/web/worker-channel.gateway.js +1 -1
- package/dist/web/worker-channel.gateway.js.map +1 -1
- package/package.json +2 -2
- package/public/assets/{AccessTokensPage-oPweGG_z.js → AccessTokensPage-DuICKFJy.js} +1 -1
- package/public/assets/{AdminPage-Dw1ng1n4.js → AdminPage-B8Yq8GnM.js} +1 -1
- package/public/assets/{ApiReferencePage-FUskCdjw.js → ApiReferencePage-DZDCJQI4.js} +1 -1
- package/public/assets/{AuditLogPage-nwiONLEk.js → AuditLogPage-MoCRMzqP.js} +1 -1
- package/public/assets/{BotManage-D2QsEBCS.js → BotManage-CVWwoYy3.js} +1 -1
- package/public/assets/{CliReferencePage-BdzdHAsN.js → CliReferencePage-DVB7E2Jv.js} +1 -1
- package/public/assets/{DeveloperManage-C8-2MMwr.js → DeveloperManage-BtO-lkvD.js} +1 -1
- package/public/assets/{EditProjectPage-DPTc1yRc.js → EditProjectPage-Bl2LyAeT.js} +1 -1
- package/public/assets/{EmptyState-CEWQv5SU.js → EmptyState-Bvs1SJo_.js} +1 -1
- package/public/assets/{HomePage-BkKwaAgJ.js → HomePage-BSubk1iR.js} +1 -1
- package/public/assets/{LandingPage-BBF_PnWk.js → LandingPage-COmKh2PR.js} +1 -1
- package/public/assets/{LoginPage-BXdJBXbE.js → LoginPage-DFIy5_AG.js} +1 -1
- package/public/assets/{MachineDetailPage-DeLR95cj.js → MachineDetailPage-BLOhWYiw.js} +1 -1
- package/public/assets/MachineListPage-CIqrEM7O.js +6 -0
- package/public/assets/{NotFoundPage-CDsk2FBZ.js → NotFoundPage-BqLQpkaf.js} +1 -1
- package/public/assets/{PipelineEditorPage-DRxoetje.js → PipelineEditorPage-CyOhoLwR.js} +1 -1
- package/public/assets/{ProfilePage-DYw8NzPC.js → ProfilePage-D8UfMNDf.js} +1 -1
- package/public/assets/{ProjectDetailPage-BVi8nkb1.js → ProjectDetailPage-8DxQkhBt.js} +1 -1
- package/public/assets/{ProjectListPage-BJxuXui-.js → ProjectListPage-Dwcp60o1.js} +1 -1
- package/public/assets/{QuickAuth-CAi3n0Qs.js → QuickAuth-CWpVD-8o.js} +1 -1
- package/public/assets/{RemoveMemberConfirmDialog-sqtFnOvO.js → RemoveMemberConfirmDialog-DQ3dXuC6.js} +1 -1
- package/public/assets/{Select-CRpdafWl.js → Select-GhXJ5uKF.js} +1 -1
- package/public/assets/{SettingsPage-B9lw8C-c.js → SettingsPage-DDsctH7X.js} +1 -1
- package/public/assets/{Skeleton-CbeWT2zl.js → Skeleton-CSAb9g25.js} +1 -1
- package/public/assets/{SkillPage-Bq35rago.js → SkillPage-CtZTtfF8.js} +1 -1
- package/public/assets/{TaskDetailPage-C4ICC3OM.js → TaskDetailPage-CgT_txYn.js} +1 -1
- package/public/assets/{TaskListPage-CUHGBvyU.js → TaskListPage-D_tZ75c7.js} +1 -1
- package/public/assets/{TaskStatusBadge-C6DS5OWP.js → TaskStatusBadge-yxoaV45g.js} +1 -1
- package/public/assets/{TokenManage-B4uqYclW.js → TokenManage-DWk-4hAE.js} +1 -1
- package/public/assets/{TotpSetupPage-CEGN1xn8.js → TotpSetupPage-C3IixO0t.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-CwuvVUoB.js → WorkerSetupGuidePage-CuXz1Cp5.js} +1 -1
- package/public/assets/{arrow-left-BXI8dEuv.js → arrow-left-tpTJv4kJ.js} +1 -1
- package/public/assets/{arrow-right-BvAzhW8L.js → arrow-right-DpePBWE7.js} +1 -1
- package/public/assets/{bot-BsTtqvxQ.js → bot-BChGjdPm.js} +1 -1
- package/public/assets/{chevron-right-CHP2kF25.js → chevron-right-B-JssgBf.js} +1 -1
- package/public/assets/{copy-CTHNYjlv.js → copy-MDuQXvvx.js} +1 -1
- package/public/assets/{external-link-CAJ7Idcz.js → external-link-ExQuyXwZ.js} +1 -1
- package/public/assets/{index-BwKDWAeG.js → index-CtAu_XZ5.js} +2 -2
- package/public/assets/{key-BgCZ-y1U.js → key-Cix4k6UI.js} +1 -1
- package/public/assets/{loader-circle-DfGhh0Ty.js → loader-circle-COcLl-bl.js} +1 -1
- package/public/assets/{pencil-Bq3Z1U82.js → pencil-KZjOYmxG.js} +1 -1
- package/public/assets/{plus-kyLBS24g.js → plus-B1SMCBOe.js} +1 -1
- package/public/assets/{rotate-ccw-DSGQ_NEe.js → rotate-ccw-DpBJ4jZw.js} +1 -1
- package/public/assets/{scroll-text-D2EdgNAO.js → scroll-text-CrlR_VG0.js} +1 -1
- package/public/assets/{settings-CZ6ELt0Z.js → settings-H-4c0_mh.js} +1 -1
- package/public/assets/{task.store-DT4yU2EV.js → task.store-ATNoa4p7.js} +1 -1
- package/public/assets/{trash-2-CNnnORdj.js → trash-2-BzT2LBkf.js} +1 -1
- package/public/assets/{users-DbVTGZbU.js → users-BsLS_-Dg.js} +1 -1
- package/public/index.html +1 -1
- package/public/assets/MachineListPage-D79p6rD6.js +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as S,r as s,j as e,f as w,d as D,o as F,K as A,x as I,l as O}from"./index-BwKDWAeG.js";import{K as T}from"./key-BgCZ-y1U.js";import{C as R}from"./copy-CTHNYjlv.js";import{E as $}from"./external-link-CAJ7Idcz.js";import{E as P}from"./EmptyState-CEWQv5SU.js";import{T as B}from"./Skeleton-CbeWT2zl.js";import{P as J}from"./plus-kyLBS24g.js";function K({isOpen:a,onClose:x,onCreated:y}){const{t:n}=S(),[t,c]=s.useState(""),[d,m]=s.useState(!1),[b,v]=s.useState(""),p=()=>{c(""),v(""),x()},l=async()=>{if(v(""),!t.trim()){v(n("admin.pat_label_required"));return}try{m(!0);const o=await w.post("admin/worker-tokens",{json:{label:t.trim()}}).json();c(""),y({token:o.token,id:o.id})}catch(o){const f=o instanceof Error?o.message:n("admin.pat_failed_to_generate");v(f)}finally{m(!1)}};return a?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&p()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(T,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:n("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[b&&e.jsx("div",{className:"border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",style:{borderRadius:"4px"},children:b}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:n("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("admin.label")}),e.jsx("input",{type:"text",placeholder:n("admin.pat_label_placeholder"),value:t,onChange:o=>c(o.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:o=>{o.key==="Enter"&&l()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:n("admin.label_identifies_machine")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:p,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:n("common.cancel")}),e.jsx("button",{onClick:l,disabled:d,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:n(d?"admin.generating":"admin.generate")})]})]})}):null}const V=3e3,W=600*1e3;function z({isOpen:a,token:x,tokenId:y,onClose:n}){const{t}=S(),[c,d]=s.useState("command"),[m,b]=s.useState(!1),[v,p]=s.useState(!1),[l,o]=s.useState(""),[f,g]=s.useState(null),i=s.useRef(void 0),N=s.useRef(Date.now()),j=D(),_=typeof window<"u"?window.location.origin:"https://overlord.example.com",k=`overlord setup worker --token ${x} --server ${_}`,C=async()=>{try{await navigator.clipboard.writeText(x),b(!0),setTimeout(()=>b(!1),2e3)}catch{}},r=async()=>{try{await navigator.clipboard.writeText(k),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},L=s.useCallback(async()=>{try{const h=await w.get(`admin/worker-tokens/${y}/status`).json();h.status==="used"&&h.machine_name&&(d("success"),o(h.machine_name),g(h.machine_id??null),i.current&&clearInterval(i.current))}catch{}Date.now()-N.current>W&&(d("timeout"),i.current&&clearInterval(i.current))},[y]),E=()=>{d("waiting"),N.current=Date.now(),i.current=setInterval(L,V)};s.useEffect(()=>()=>{i.current&&clearInterval(i.current)},[]);const M=()=>{n(),f&&j(`/machines/${f}`)};if(!a)return null;const u={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:h=>{h.target===h.currentTarget&&n()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...u,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("admin.run_command_desc")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:x}),e.jsx("button",{onClick:C,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:m?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{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 border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsxs("code",{className:"block break-all pr-20 text-xs text-[var(--accent)]",children:["$ ",k]}),e.jsx("button",{onClick:r,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:v?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:t("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:t("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:t("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[t("admin.machine"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:l})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),e.jsx("button",{onClick:E,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:u,children:t("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),e.jsxs("button",{onClick:M,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:u,children:[e.jsx($,{className:"h-3 w-3"}),t("admin.view_machine")]})]})]})]})})}function Z(){const{t:a}=S(),[x,y]=s.useState([]),[n,t]=s.useState(!0),[c,d]=s.useState(!1),[m,b]=s.useState(null),[v,p]=s.useState(!1),[l,o]=s.useState(null),[f,g]=s.useState(!1),[i,N]=s.useState(!1),j=s.useCallback(async()=>{try{t(!0);const r=await w.get("admin/worker-tokens").json();y(r)}catch{}finally{t(!1)}},[]);s.useEffect(()=>{j()},[j]);const _=async()=>{if(l){g(!0);try{await w.post(`admin/worker-tokens/${l.id}/revoke`),p(!1),o(null),j()}catch{}finally{g(!1)}}},k=r=>{d(!1),b(r),j()},C=r=>{switch(r){case"active":return"text-green-400";case"used":return"text-blue-400";case"revoked":return"text-red-400";case"expired":return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}};return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",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",onClick:()=>d(!0),children:[e.jsx(J,{className:"h-3.5 w-3.5"}),a("admin.generate_token")]})]}),!n&&x.some(r=>r.status==="revoked")&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>N(!i),className:`text-xs transition-colors ${i?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(i?"admin.hide_revoked":"admin.show_revoked")})}),n?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(B,{rows:3})}):x.filter(r=>i||r.status!=="revoked").length===0?e.jsx(P,{icon:A,title:a("admin.no_worker_tokens"),description:a("admin.generate_token_desc"),actionLabel:a("admin.generate_token"),onAction:()=>d(!0)}):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)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:x.filter(r=>i||r.status!=="revoked").map(r=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:r.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:r.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:C(r.status),children:r.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:r.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(r.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:r.status==="active"&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{o(r),p(!0)},children:[e.jsx(I,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},r.id))})]})}),e.jsx(K,{isOpen:c,onClose:()=>d(!1),onCreated:k}),m&&e.jsx(z,{isOpen:!!m,token:m.token,tokenId:m.id,onClose:()=>b(null)}),e.jsx(O,{isOpen:v,onClose:()=>{p(!1),o(null)},onConfirm:_,title:a("admin.revoke_token"),message:a("admin.revoke_token_confirm",{label:(l==null?void 0:l.label)??""}),confirmLabel:a("admin.revoke"),confirmVariant:"danger",isLoading:f})]})}export{Z as default};
|
|
1
|
+
import{a as S,r as s,j as e,f as w,d as D,o as F,K as A,x as I,l as O}from"./index-CtAu_XZ5.js";import{K as T}from"./key-Cix4k6UI.js";import{C as R}from"./copy-MDuQXvvx.js";import{E as $}from"./external-link-ExQuyXwZ.js";import{E as P}from"./EmptyState-Bvs1SJo_.js";import{T as B}from"./Skeleton-CSAb9g25.js";import{P as J}from"./plus-B1SMCBOe.js";function K({isOpen:a,onClose:x,onCreated:y}){const{t:n}=S(),[t,c]=s.useState(""),[d,m]=s.useState(!1),[b,v]=s.useState(""),p=()=>{c(""),v(""),x()},l=async()=>{if(v(""),!t.trim()){v(n("admin.pat_label_required"));return}try{m(!0);const o=await w.post("admin/worker-tokens",{json:{label:t.trim()}}).json();c(""),y({token:o.token,id:o.id})}catch(o){const f=o instanceof Error?o.message:n("admin.pat_failed_to_generate");v(f)}finally{m(!1)}};return a?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&p()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(T,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:n("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[b&&e.jsx("div",{className:"border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",style:{borderRadius:"4px"},children:b}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:n("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("admin.label")}),e.jsx("input",{type:"text",placeholder:n("admin.pat_label_placeholder"),value:t,onChange:o=>c(o.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:o=>{o.key==="Enter"&&l()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:n("admin.label_identifies_machine")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:p,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:n("common.cancel")}),e.jsx("button",{onClick:l,disabled:d,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:n(d?"admin.generating":"admin.generate")})]})]})}):null}const V=3e3,W=600*1e3;function z({isOpen:a,token:x,tokenId:y,onClose:n}){const{t}=S(),[c,d]=s.useState("command"),[m,b]=s.useState(!1),[v,p]=s.useState(!1),[l,o]=s.useState(""),[f,g]=s.useState(null),i=s.useRef(void 0),N=s.useRef(Date.now()),j=D(),_=typeof window<"u"?window.location.origin:"https://overlord.example.com",k=`overlord setup worker --token ${x} --server ${_}`,C=async()=>{try{await navigator.clipboard.writeText(x),b(!0),setTimeout(()=>b(!1),2e3)}catch{}},r=async()=>{try{await navigator.clipboard.writeText(k),p(!0),setTimeout(()=>p(!1),2e3)}catch{}},L=s.useCallback(async()=>{try{const h=await w.get(`admin/worker-tokens/${y}/status`).json();h.status==="used"&&h.machine_name&&(d("success"),o(h.machine_name),g(h.machine_id??null),i.current&&clearInterval(i.current))}catch{}Date.now()-N.current>W&&(d("timeout"),i.current&&clearInterval(i.current))},[y]),E=()=>{d("waiting"),N.current=Date.now(),i.current=setInterval(L,V)};s.useEffect(()=>()=>{i.current&&clearInterval(i.current)},[]);const M=()=>{n(),f&&j(`/machines/${f}`)};if(!a)return null;const u={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:h=>{h.target===h.currentTarget&&n()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...u,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t("admin.run_command_desc")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:x}),e.jsx("button",{onClick:C,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:m?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{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 border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsxs("code",{className:"block break-all pr-20 text-xs text-[var(--accent)]",children:["$ ",k]}),e.jsx("button",{onClick:r,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:v?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"h-3 w-3"})," ",t("common.copy")]})})]})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:t("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:t("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:t("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[t("admin.machine"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:l})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),e.jsx("button",{onClick:E,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:u,children:t("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:t("common.close")}),e.jsxs("button",{onClick:M,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-[#0C0C0C] transition-opacity hover:opacity-80",style:u,children:[e.jsx($,{className:"h-3 w-3"}),t("admin.view_machine")]})]})]})]})})}function Z(){const{t:a}=S(),[x,y]=s.useState([]),[n,t]=s.useState(!0),[c,d]=s.useState(!1),[m,b]=s.useState(null),[v,p]=s.useState(!1),[l,o]=s.useState(null),[f,g]=s.useState(!1),[i,N]=s.useState(!1),j=s.useCallback(async()=>{try{t(!0);const r=await w.get("admin/worker-tokens").json();y(r)}catch{}finally{t(!1)}},[]);s.useEffect(()=>{j()},[j]);const _=async()=>{if(l){g(!0);try{await w.post(`admin/worker-tokens/${l.id}/revoke`),p(!1),o(null),j()}catch{}finally{g(!1)}}},k=r=>{d(!1),b(r),j()},C=r=>{switch(r){case"active":return"text-green-400";case"used":return"text-blue-400";case"revoked":return"text-red-400";case"expired":return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}};return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",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",onClick:()=>d(!0),children:[e.jsx(J,{className:"h-3.5 w-3.5"}),a("admin.generate_token")]})]}),!n&&x.some(r=>r.status==="revoked")&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>N(!i),className:`text-xs transition-colors ${i?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(i?"admin.hide_revoked":"admin.show_revoked")})}),n?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(B,{rows:3})}):x.filter(r=>i||r.status!=="revoked").length===0?e.jsx(P,{icon:A,title:a("admin.no_worker_tokens"),description:a("admin.generate_token_desc"),actionLabel:a("admin.generate_token"),onAction:()=>d(!0)}):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)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:x.filter(r=>i||r.status!=="revoked").map(r=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:r.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:r.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:C(r.status),children:r.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(r.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:r.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(r.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:r.status==="active"&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{o(r),p(!0)},children:[e.jsx(I,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},r.id))})]})}),e.jsx(K,{isOpen:c,onClose:()=>d(!1),onCreated:k}),m&&e.jsx(z,{isOpen:!!m,token:m.token,tokenId:m.id,onClose:()=>b(null)}),e.jsx(O,{isOpen:v,onClose:()=>{p(!1),o(null)},onConfirm:_,title:a("admin.revoke_token"),message:a("admin.revoke_token_confirm",{label:(l==null?void 0:l.label)??""}),confirmLabel:a("admin.revoke"),confirmVariant:"danger",isLoading:f})]})}export{Z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as A,d as he,u as Y,a as fe,r as F,j as v,f as J,t as me}from"./index-
|
|
1
|
+
import{R as A,d as he,u as Y,a as fe,r as F,j as v,f as J,t as me}from"./index-CtAu_XZ5.js";var ge=Object.defineProperty,T=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable,W=(u,a,i)=>a in u?ge(u,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[a]=i,j=(u,a)=>{for(var i in a||(a={}))V.call(a,i)&&W(u,i,a[i]);if(T)for(var i of T(a))X.call(a,i)&&W(u,i,a[i]);return u},k=(u,a)=>{var i={};for(var c in u)V.call(u,c)&&a.indexOf(c)<0&&(i[c]=u[c]);if(u!=null&&T)for(var c of T(u))a.indexOf(c)<0&&X.call(u,c)&&(i[c]=u[c]);return i};/**
|
|
2
2
|
* @license QR Code generator library (TypeScript)
|
|
3
3
|
* Copyright (c) Project Nayuki.
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c,d as x,a as d,j as e,o as a}from"./index-
|
|
1
|
+
import{c,d as x,a as d,j as e,o as a}from"./index-CtAu_XZ5.js";import{K as l}from"./key-Cix4k6UI.js";import{S as m}from"./settings-H-4c0_mh.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
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandingPage-COmKh2PR.js","assets/arrow-right-DpePBWE7.js","assets/bot-BChGjdPm.js","assets/users-BsLS_-Dg.js","assets/copy-MDuQXvvx.js","assets/HomePage-BSubk1iR.js","assets/protocol-C5uQmiiB.js","assets/TaskStatusBadge-yxoaV45g.js","assets/Skeleton-CSAb9g25.js","assets/chevron-right-B-JssgBf.js","assets/TaskListPage-D_tZ75c7.js","assets/task.store-ATNoa4p7.js","assets/Select-GhXJ5uKF.js","assets/EmptyState-Bvs1SJo_.js","assets/plus-B1SMCBOe.js","assets/TaskDetailPage-CgT_txYn.js","assets/arrow-left-tpTJv4kJ.js","assets/rotate-ccw-DpBJ4jZw.js","assets/external-link-ExQuyXwZ.js","assets/loader-circle-COcLl-bl.js","assets/TaskDetailPage-Beg8tuEN.css","assets/MachineListPage-CIqrEM7O.js","assets/WorkerSetupGuidePage-CuXz1Cp5.js","assets/key-Cix4k6UI.js","assets/settings-H-4c0_mh.js","assets/MachineDetailPage-BLOhWYiw.js","assets/trash-2-BzT2LBkf.js","assets/ProjectListPage-Dwcp60o1.js","assets/ProjectDetailPage-8DxQkhBt.js","assets/RemoveMemberConfirmDialog-DQ3dXuC6.js","assets/pencil-KZjOYmxG.js","assets/EditProjectPage-Bl2LyAeT.js","assets/PipelineEditorPage-CyOhoLwR.js","assets/AccessTokensPage-DuICKFJy.js","assets/CliReferencePage-DVB7E2Jv.js","assets/QuickAuth-CWpVD-8o.js","assets/ApiReferencePage-DZDCJQI4.js","assets/SkillPage-CtZTtfF8.js","assets/AdminPage-B8Yq8GnM.js","assets/scroll-text-CrlR_VG0.js","assets/DeveloperManage-BtO-lkvD.js","assets/BotManage-CVWwoYy3.js","assets/TokenManage-DWk-4hAE.js","assets/AuditLogPage-MoCRMzqP.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var Cy=Object.defineProperty;var Jm=u=>{throw TypeError(u)};var My=(u,r,c)=>r in u?Cy(u,r,{enumerable:!0,configurable:!0,writable:!0,value:c}):u[r]=c;var wt=(u,r,c)=>My(u,typeof r!="symbol"?r+"":r,c),hc=(u,r,c)=>r.has(u)||Jm("Cannot "+c);var U=(u,r,c)=>(hc(u,r,"read from private field"),c?c.call(u):r.get(u)),It=(u,r,c)=>r.has(u)?Jm("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(u):r.set(u,c),Vt=(u,r,c,o)=>(hc(u,r,"write to private field"),o?o.call(u,c):r.set(u,c),c),ge=(u,r,c)=>(hc(u,r,"access private method"),c);var $m=(u,r,c,o)=>({set _(f){Vt(u,r,f,c)},get _(){return U(u,r,o)}});(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))o(f);new MutationObserver(f=>{for(const m of f)if(m.type==="childList")for(const p of m.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&o(p)}).observe(document,{childList:!0,subtree:!0});function c(f){const m={};return f.integrity&&(m.integrity=f.integrity),f.referrerPolicy&&(m.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?m.credentials="include":f.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function o(f){if(f.ep)return;f.ep=!0;const m=c(f);fetch(f.href,m)}})();function Ny(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var pc={exports:{}},ei={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -209,4 +209,4 @@ Please change the parent <Route path="${L}"> to <Route path="${L==="/"?"*":`${L}
|
|
|
209
209
|
* This source code is licensed under the ISC license.
|
|
210
210
|
* See the LICENSE file in the root directory of this source tree.
|
|
211
211
|
*/const $v=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),hh=u=>{let r;const c=new Set,o=(h,j)=>{const S=typeof h=="function"?h(r):h;if(!Object.is(S,r)){const D=r;r=j??(typeof S!="object"||S===null)?S:Object.assign({},r,S),c.forEach(V=>V(r,D))}},f=()=>r,T={setState:o,getState:f,getInitialState:()=>g,subscribe:h=>(c.add(h),()=>c.delete(h))},g=r=u(o,f,T);return T},Wv=(u=>u?hh(u):hh),Fv=u=>u;function Iv(u,r=Fv){const c=Ru.useSyncExternalStore(u.subscribe,Ru.useCallback(()=>r(u.getState()),[u,r]),Ru.useCallback(()=>r(u.getInitialState()),[u,r]));return Ru.useDebugValue(c),c}const ph=u=>{const r=Wv(u),c=o=>Iv(r,o);return Object.assign(c,r),c},Qh=(u=>u?ph(u):ph),zu="overlord-access-token",Au="overlord-refresh-token",lt={getAccessToken(){return localStorage.getItem(zu)},setAccessToken(u){localStorage.setItem(zu,u)},getRefreshToken(){return localStorage.getItem(Au)},setRefreshToken(u){localStorage.setItem(Au,u)},setTokens(u,r){localStorage.setItem(zu,u),localStorage.setItem(Au,r)},clearTokens(){localStorage.removeItem(zu),localStorage.removeItem(Au)},parseToken(u){try{const r=u.split(".")[1];return JSON.parse(atob(r))}catch{return null}},hasScope(u,r){const c=lt.parseToken(u);return c?c.scope===r:!1},isExpired(u){const r=lt.parseToken(u);return!r||typeof r.exp!="number"?!0:Date.now()/1e3>r.exp-30}},$a=Qh((u,r)=>({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1,initializing:!0,initialize:()=>{const c=lt.getAccessToken();if(c&&!lt.isExpired(c)){const o=lt.parseToken(c),f=(o==null?void 0:o.name)??"";u({accessToken:c,user:o?{id:o.sub,username:f,display_name:f,role:o.role}:null,requireTotpSetup:lt.hasScope(c,"totp_setup"),initializing:!1})}else lt.getRefreshToken()?r().refresh().catch(()=>{lt.clearTokens()}).finally(()=>{u({initializing:!1})}):u({initializing:!1})},login:async c=>{var T;const o=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!o.ok){const g=await o.json().catch(()=>({message:"Login failed"})),h=((T=g.error)==null?void 0:T.message)??g.message??"Login failed";throw new Error(h)}const f=await o.json();if(f.totpSetup){lt.setAccessToken(f.accessToken),u({accessToken:f.accessToken,user:null,requireTotpSetup:!0});return}lt.setTokens(f.accessToken,f.refreshToken);const m=lt.parseToken(f.accessToken),p=(m==null?void 0:m.name)??"";u({accessToken:f.accessToken,user:m?{id:m.sub,username:p,display_name:p,role:m.role}:null,requireTotpSetup:!1,sessionExpired:!1})},logout:()=>{const c=lt.getRefreshToken();c&&fetch("/api/auth/logout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:c})}).catch(()=>{}),lt.clearTokens(),u({accessToken:null,user:null,requireTotpSetup:!1,sessionExpired:!1})},refresh:async()=>{const c=lt.getRefreshToken();if(!c)throw r().logout(),u({sessionExpired:!0}),new Error("No refresh token");const o=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:c})});if(!o.ok)throw r().logout(),u({sessionExpired:!0}),new Error("Refresh failed");const f=await o.json();lt.setTokens(f.accessToken,f.refreshToken);const m=lt.parseToken(f.accessToken),p=(m==null?void 0:m.name)??"";u({accessToken:f.accessToken,user:m?{id:m.sub,username:p,display_name:p,role:m.role}:null})},setSessionExpired:c=>{u({sessionExpired:c})}})),Vh="overlord-theme";function Pv(){try{const u=localStorage.getItem(Vh);if(u==="light"||u==="dark"||u==="system")return u}catch{}return"dark"}function _h(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}const Zh=Qh(u=>{const r=Pv(),c=r==="system"?_h():r;return{theme:r,resolved:c,setTheme:o=>{localStorage.setItem(Vh,o);const f=o==="system"?_h():o;u({theme:o,resolved:f})},setResolved:o=>{u({resolved:o})}}}),e0={common:{cancel:"cancel",confirm:"confirm",save:"save",delete:"delete",edit:"edit",create:"create",copy:"copy",copied:"copied",close:"close",back:"back",back_to_site:"back to site",go_back:"go_back",go_home:"go_home",dismiss:"dismiss",retry:"retry",loading:"// loading...",processing:"processing...",creating:"creating...",saving:"saving...",updating:"updating...",verifying:"verifying...",signing_in:"signing in...",just_now:"just now",never:"never",previous:"previous",next:"next",error:"error",success:"success",failed:"failed",active:"active",inactive:"inactive",enabled:"enabled",disabled:"disabled",showing_entries:"showing {start}-{end} of {total}",no_results:"no results found",runtime_error:"// runtime_error",an_unexpected_error_occurred:"an unexpected error occurred",reload:"reload",not_found:"404",page_not_found:"// page_not_found",the_page_does_not_exist:"the page you are looking for does not exist or has been moved.",not_found_terminal_error:"error: requested not found - page does not exist",not_set:"not set",view_all:"view_all",discard:"discard",save_changes:"save_changes",add:"add",remove:"remove",search:"search",actions:"actions",name:"name",status:"status",role:"role",description:"description",type:"type",created_at:"created_at",ago:"{time} ago",m_ago:"{n}m ago",h_ago:"{n}h ago",d_ago:"{n}d ago",navigation:"// navigation",docs_section:"// docs",admin_section:"// admin",overlord:"overlord",logout:"logout",logout_title:"// logout",logout_message:"are you sure you want to log out?",log_out:"log out",profile:"profile",search_placeholder:"search...",search_input_placeholder:"search tasks, machines, projects...",no_search_results:'// no results for "{query}"',navigate_hint:"navigate",select_hint:"select",close_hint:"close",notifications:"notifications",mark_all_read:"mark all read",no_notifications:"// no notifications",mark_as_read:"mark as read",switch_to_light:"switch to light mode",switch_to_dark:"switch to dark mode",light_mode:"light mode",dark_mode:"dark mode",dismiss_notification:"dismiss",breadcrumb_dashboard:"dashboard",breadcrumb_dashboard_sub:"active overview",breadcrumb_tasks:"tasks",breadcrumb_tasks_sub:"queue management",breadcrumb_machines:"machines",breadcrumb_machines_sub:"fleet status",breadcrumb_projects:"projects",breadcrumb_projects_sub:"repository index",breadcrumb_admin:"admin",breadcrumb_admin_sub:"system control",breadcrumb_profile:"profile",breadcrumb_profile_sub:"user settings",breadcrumb_access_tokens:"access_tokens",breadcrumb_access_tokens_sub:"personal api tokens",breadcrumb_docs:"docs",breadcrumb_docs_sub:"documentation",breadcrumb_docs_cli:"docs",breadcrumb_docs_cli_sub:"cli",breadcrumb_docs_api:"docs",breadcrumb_docs_api_sub:"api",breadcrumb_docs_skill:"docs",breadcrumb_docs_skill_sub:"skill",error_default_title:"something went wrong",error_default_message:"an unexpected error occurred. please try again."},auth:{sign_in:"sign in",username:"username",enter_username:"enter username",password:"password",enter_password:"enter password",ai_powered_development_system:"// ai-powered development system",username_and_password_required:"username and password are required.",login_failed:"login failed",invalid_totp_code:"invalid totp code",two_factor_verification:"// 2fa verification",enter_totp_code:"enter your totp code",please_enter_valid_6_digit_code:"please enter a valid 6-digit code.",session_expired:"session_expired",session_expired_message:"// your session has expired. please log in again.",go_to_login:"go_to_login",totp_setup_title:"2fa_setup",totp_setup_subtitle:"// scan the qr code with your authenticator app",scan_with_authenticator:"scan this qr code with your authenticator app (google authenticator, authy, etc.)",manual_entry_key:"manual_entry_key",enter_verification_code:"enter the 6-digit verification code from your authenticator app",verification_code:"verification code",enter_6_digit_code:"enter 6-digit code",verify_and_enable:"verify_and_enable",totp_setup_complete:"2fa setup complete",totp_setup_complete_login_again:"2fa setup complete! please log in again.",totp_setup_failed:"verification failed. please try again.",totp_setup_footer:"// you must complete this setup before accessing the application",totp_manual_entry:"// or enter this key manually",verify:"verify",initializing:"// initializing...",failed_to_init_totp:"failed to initialize totp setup"},dashboard:{title:"dashboard",subtitle:"// system overview",active_tasks:"active_tasks",queued_tasks:"queued_tasks",online_workers:"online_workers",completed_today:"completed_today",task_success_rate:"> task_success_rate",last_7_days:"last 7 days",recent_tasks:"> recent_tasks",no_tasks_yet:"// no tasks yet",worker_status:"> worker_status",no_workers_registered:"// no workers registered",recent_activity:"> recent_activity",no_recent_activity:"// no recent activity",daily_breakdown_not_available:"// daily breakdown not available",slots:"slots",online:"online",idle:"idle",offline:"offline"},tasks:{title:"tasks",subtitle:"// queue management",create_task:"create_task",new_task:"new_task",task_description:"task_description",describe_task_placeholder:"describe the development task in detail...",project:"project",select_project:"select project...",target_machine:"target_machine (optional)",any_able:"any able",assign_developer:"assign_developer (admin only)",select_developer:"select developer...",search_tasks:"search_tasks...",id:"id",description_col:"description",status_col:"status",project_col:"project",worker:"worker",time:"time",stage:"stage",no_tasks_found:"no_tasks_found",try_adjusting_search:"try adjusting your search query",create_first_task:"create your first task to get started",tab_all:"all",tab_running:"running",tab_queued:"queued",tab_completed:"completed",tab_failed:"failed",tab_cancelled:"cancelled",status_queued:"queued",status_assigned:"assigned",status_running:"running",status_suspended:"suspended",status_completed:"completed",status_failed:"failed",status_cancelled:"cancelled",similar_task_exists:"a similar task already exists.",confirm_create_similar:"are you sure you want to create this task?",view_existing:"view_existing",force_create:"force_create",cancel_task:"cancel",retry_task:"retry",cursor_tunnel:"cursor_tunnel",skip_stage:"skip stage",take_over:"take_over",release_control:"release_control",connected:"connected",disconnected:"disconnected",connecting:"connecting",terminal:"terminal",pipeline_tab:"pipeline",logs:"logs",task_not_found:"// task_not_found",task_does_not_exist:"this task does not exist or has been deleted.",back_to_tasks:"back_to_tasks",task_detail_subtitle:"#{id} {desc}",cancel_task_title:"cancel_task",task_cancelled:"task cancelled.",failed_to_cancel_task:"failed to cancel task.",task_retried:"task has been retried.",failed_to_retry_task:"failed to retry task.",retry_mr_title:"retry_mr",retry_mr_confirm:"retry creating the merge request for task #{id}?",mr_retry_submitted:"mr retry submitted.",failed_to_retry_mr:"failed to retry mr.",activity_log:"> activity_log",pipeline_section:"> pipeline",no_pipeline:"// no pipeline configured",no_activity:"// no activity yet",confirm_stage:"confirm_stage",confirm_stage_message:'confirm execution of stage "{name}"? this will proceed with the pipeline.',stage_confirmed:"stage confirmed.",failed_to_confirm_stage:"failed to confirm stage.",loading_task:"// loading task...",task_suspended_banner:"// task suspended — waiting for user confirmation",pending_confirmation:"> pending_confirmation",pipeline_requires_confirmation:"the pipeline requires confirmation before proceeding.",confirm_and_proceed:"confirm_and_proceed",confirm_failed:"failed to confirm stage",reject:"reject",pty_terminal:"// pty terminal",view_terminal:"switch to terminal tab",restore_auto:"restore auto",requesting_takeover:"requesting...",pipeline_stages:"// pipeline stages",task_info:"> task_info",stage_timeline:"> stage_timeline",workspace_section:"> workspace",no_machine_assigned:"// no machine assigned",no_output:"// no output",pty_output:"> pty_output",stage_progress:"> stage_progress",task_logs:"> task_logs",search_logs:"search logs...",no_log_entries:"// no log entries",prev:"prev",cursor_tunnel_section:"> cursor_tunnel",auto_pipeline:"auto_pipeline",auto_mode:"auto_mode",manual_takeover:"manual_takeover",takeover_denied:"takeover_denied",requesting_takeover_ellipsis:"requesting_takeover...",take_over_label:"take over",release_label:"release",create_task_page_title:"// create_task",create_task_page_subtitle:"// submit a new task for processing",form_project_label:"project",form_description_label:"description",form_description_placeholder:"describe the task for the ai agent...",form_machine_preference:"machine_preference",form_machine_placeholder:"optional: machine id or name (--on)",form_machine_hint:"leave empty for automatic machine selection.",form_agent_type:"agent_type",form_agent_type_placeholder:"default (from project config)",form_select_project:"select a project",form_create_task:"create task",project_and_description_required:"project and description are required.",failed_to_create_task:"failed to create task.",tunnel_idle:"idle",tunnel_starting:"starting...",tunnel_connected:"connected",tunnel_expired:"expired",tunnel_closing:"closing...",tunnel_start:"start",tunnel_open_in_cursor:"open_in_cursor",tunnel_header:"> cursor_tunnel",tunnel_copied:"// copied to clipboard",tunnel_waiting:"// waiting for connection url...",tunnel_start_button:"> start_tunnel",tunnel_starting_button:"// starting...",tunnel_stopping:"// stopping...",tunnel_cancel:"> cancel",tunnel_open_cursor:"> open_in_cursor",tunnel_open_vscode:"> open_in_vscode",tunnel_stop:"> stop_tunnel",tunnel_restart:"> restart_tunnel",tunnel_copy_url:"copy url",tunnel_expires_hm:"expires in {h}h {m}m",tunnel_expires_m:"expires in {m}m",dedup_title:"> similar_task_exists",dedup_description:"// a similar task was found that may already address your request",dedup_create_anyway:"create anyway",stage_choose_option:"// choose an option",stage_your_response:"your_response",stage_type_answer:"type your answer...",stage_submitting:"submitting...",stage_continue:"continue",stage_submit:"submit",cancel_task_message:"are you sure you want to cancel task #{id}? this will terminate the running agent and cannot be undone.",cancel_task_confirm_label:"cancel task",retry_title:"retry_task",retry_confirm_label:"retry",retry_message_with_mr:"task #{id} has an existing mr ({url}). retrying will create a new attempt on the same branch. continue?",retry_message_without_mr:"are you sure you want to retry task #{id}? this will create a new execution attempt."},machines:{title:"machines",subtitle:"// fleet status",fleet:"fleet",setup_guide:"setup_guide",all_statuses:"all",register_worker:"register_worker",no_machines_found:"no_machines_found",no_machines_registered:"no machines have registered yet",try_changing_status_filter:"try changing the status filter",view_setup_guide:"view_setup_guide",online:"online",offline:"offline",draining:"draining",cpu:"cpu",mem:"mem",disk:"disk",tasks_slots:"tasks: {active}/{max} slots",back_to_machines:"back_to_machines",drain:"drain",undrain:"undrain",last_heartbeat:"last_heartbeat: {time}",resource_usage:"> resource_usage",connection_info:"> connection_info",capabilities:"> capabilities",current_tasks:"> current_tasks",no_capabilities:"// no capabilities reported",no_running_tasks:"// no running tasks",host:"host",port:"port",os:"os",cpu_model:"cpu_model",cpu_cores:"cpu_cores",memory:"memory",total_slots:"total_slots",confirm_drain:"drain_machine",confirm_drain_message:'drain machine "{name}"? it will finish current tasks but accept no new ones.',machine_drained:"machine drain initiated.",machine_undrained:"machine undrain initiated.",failed_to_update_machine:"failed to update machine status.",worker_setup_title:"worker_setup_guide",worker_setup_subtitle:"// register a new worker machine with overlord",step_1_title:"01. generate a registration token",step_1_desc:"generate a one-time registration token from the admin panel.",step_2_title:"02. install the worker cli",step_2_desc:"install the overlord worker cli on the target machine.",step_3_title:"03. register the worker",step_3_desc:"run the register command with your token and server url.",step_4_title:"04. start the worker",step_4_desc:"start the worker daemon. it will connect to overlord and begin accepting tasks.",generate_token:"generate_token",worker_token_modal_title:"worker_registration_token",worker_token_modal_message:"// copy this token now. it will not be shown again.",loading_machine:"// loading machine...",machine_not_found:"// machine not found",draining_warning:"// this machine is draining — no new tasks will be assigned",draining_active_tasks:"active tasks will continue to run until completion",active_tasks:"> active_tasks",no_active_tasks:"// no active tasks on this machine",machine_info:"> machine_info",unknown:"unknown",n_a:"n/a",id:"id",description:"description",stage:"stage",no_capabilities_short:"// no capabilities",slots:"slots",status_label:"status",undrain_machine_title:"> undrain_machine",drain_machine_title:"> drain_machine",undrain_confirm:"are you sure you want to undrain {name}? the machine will start accepting new tasks again.",drain_confirm:"are you sure you want to drain {name}? running tasks will complete, but no new tasks will be assigned until the machine is undrained.",decommission:"decommission",decommission_title:"> decommission_machine",decommission_confirm:'permanently decommission "{name}"? active tasks will be failed or re-queued, and the worker will be disconnected. this cannot be undone.',decommissioned:"decommissioned",machine_id:"machine_id",setup_header_desc:"// follow these steps to add a new worker machine to your overlord cluster.",prerequisites:"// prerequisites",prereq_machine:"linux or macos machine with at least 2 cpu cores and 4gb ram",prereq_node:"node.js 18+ and pnpm installed",prereq_git:"git installed (2.25+)",prereq_network:"network access to the overlord server",prereq_token:"admin-generated worker registration token",step_generate_token:"generate_worker_token",step_generate_token_desc:"// create a one-time registration token from the admin panel. each token can register exactly one worker.",go_to_token_management:"go_to_token_management",step_install_worker:"install_worker_package",step_install_worker_desc:"// install the overlord worker package globally via npm.",step_configure_env:"configure_environment",step_configure_env_desc:"// create a .env file in ~/.overlord-worker/ or set environment variables.",env_host:"overlord server address (required)",env_worker_token:"one-time registration token (required for first run)",env_machine_name:"display name (defaults to hostname)",env_workspace_root:"task workspace directory (defaults to ~/.overlord-worker/workspaces)",env_max_slots:"max concurrent tasks (defaults to 2)",step_start_worker:"start_worker",step_start_worker_desc:"// start the worker process. it will register with the server and begin accepting tasks.",or_run_as_service:"// or run as a system service for auto-restart:",setup_wizard_option:"// option a: interactive setup wizard (recommended)",manual_config_option:"// option b: manual configuration",start_note_setup_wizard:"// if you used the setup wizard, the worker may already be running.",step_verify_connection:"verify_connection",step_verify_connection_desc:'// once the worker connects, it will appear in the machines list with a "healthy" status.',verify_how_to:"// how to verify:",verify_check_machines:"check the machines page for your new worker",verify_status:'status should show "healthy" within 30 seconds',verify_capabilities:"worker capabilities are auto-detected on first heartbeat",last_heartbeat_label:"last_heartbeat",worker_version:"worker_version",reg_title:"// worker_registration",reg_subtitle:"> register a new worker node",reg_step_generate_token:"generate_token",reg_step_install_worker:"install_worker",reg_step_waiting_activation:"waiting_activation",reg_step_activated:"activated",reg_click_to_generate:"// click to generate a one-time registration token",reg_token_generated:"// token generated successfully",reg_install_command:"// install cli & worker:",reg_run_setup:"// run setup on worker machine:",reg_running_installation:"// running installation on target machine",reg_installed_wait:"i've installed → wait for activation",reg_listening_for_worker:"listening for worker connection...",reg_worker_connected:"// worker connected",reg_waiting_for_worker:"// waiting for worker to connect...",reg_worker_activated:"worker {name} activated!",reg_worker_registered:"// worker successfully registered",reg_done:"done",reg_completed:"// completed"},projects:{title:"projects",subtitle:"// repository index",create_project:"create_project",no_projects_yet:"no_projects_yet",create_first_project:"create your first project to get started",key:"key",name:"name",repository:"repository",agent:"agent",project_info:"> project_info",repo_url:"repo_url",default_branch:"default_branch",git_platform:"git_platform",agent_type:"agent_type",max_turns:"max_turns",allowed_tools:"allowed_tools",auto_merge:"auto_merge",tasks_count:"tasks",last_activity:"last_activity",members:"> members",developer:"developer",role:"role",added_at:"added_at",add_member:"add_member",remove_member:"remove_member",remove_member_confirm:"remove {name} from this project?",member_added:"member added.",member_removed:"member removed.",failed_to_add_member:"failed to add member.",member_already_exists:"this developer is already a member of this project.",failed_to_remove_member:"failed to remove member.",pipeline:"> pipeline",add_stage:"+ add_stage",recent_tasks:"> recent_tasks",no_recent_tasks:"// no recent tasks",edit_project:"edit project",delete_project:"delete_project",delete_project_confirm:'delete project "{name}"? this cannot be undone.',project_deleted:"project deleted.",failed_to_delete_project:"failed to delete project.",project_name:"project_name",project_name_placeholder:"my awesome project",project_key:"project_key",project_key_placeholder:"my-project",project_key_hint:"// unique identifier (lowercase, alphanumeric, hyphens)",ssh_url:"ssh_url",ssh_url_placeholder:"git@github.com:org/repo.git",ssh_url_hint:"// optional — workers prefer ssh for git operations",repo_url_placeholder:"https://github.com/org/repo.git",main:"main",github:"github",gitlab:"gitlab",gitea:"gitea",claude:"claude",cursor:"cursor",codex:"codex",custom:"custom",tools_placeholder:"tool1, tool2, ...",add_project_desc:"// add a new project to overlord",project_created:"project created.",failed_to_create_project:"failed to create project.",update_project_desc:"// update project configuration",save_changes:"save_changes",basic_info:"> basic_info",agent_config:"> agent_config",security:"> security",pipeline_section:"> pipeline",edit_pipeline:"> edit_pipeline",pty_output_filter:"pty_output_filter",git_clean:"git_clean",workspace_root:"workspace_root",agent_command:"agent_command",member_role:"member",maintainer_role:"maintainer",select_developer:"select developer...",select_role:"select role...",adding:"adding...",project_not_found:"// project not found",back_to_projects:"back to projects",no_members_yet:"// no members yet",no_tasks_for_project:"// no tasks for this project yet",no_pipeline_configured:"// no pipeline configured",confirm_label:"confirm",id:"id",description:"description",status:"status",created:"created",project_saved:"project saved",failed_to_save_project:"failed to save project",invalid_pipeline_json:"invalid pipeline json",setup_commands:"setup_commands",post_command:"post_command",environment:"> environment",add_member_title:"// add_member",edit_project_title:"edit project"},pipeline:{title:"pipeline_editor",subtitle:"-- {key}",save:"save",cancel:"cancel",json_toggle:"json",add_stage:"add_stage",stage_properties:"> stage_properties",stage_name:"stage_name",executor:"executor",timeout:"timeout",max_turns:"max_turns",confirm_required:"confirm_required",on_failure:"on_failure",goto:"goto",max_loops:"max_loops",stop:"stop",stage_commands:"> stage_commands",environment:"> environment",commands_placeholder:"# commands to execute in this stage...",env_placeholder:"KEY=value (one per line)",no_stages:"// no stages defined",select_stage:"// select a stage to edit properties",saved:"pipeline saved",failed_to_save:"failed to save pipeline",failed_to_load:"failed to load pipeline.",irreversible:"irreversible",loading_pipeline:"// loading pipeline...",unnamed:"unnamed",editing:"// editing: {name}",name:"name",confirm_mode:"confirm_mode",confirm_timeout:"confirm_timeout",overrides:"// overrides",pty_only:"pty_only",allowed_tools:"allowed_tools",on_failure_section:"// on_failure",goto_stage:"goto_stage",up:"up",down:"down",failed_to_load_project:"failed to load project",delete_stage:"delete stage"},profile:{title:"profile",subtitle:"// user settings",profile_info:"> profile_info",username:"username",git_name:"git_name",git_email:"git_email",status:"status",created_at:"created_at",edit_git_info:"edit_git_info",change_password:"> change_password",current_password:"current_password",new_password:"new_password",confirm_password:"confirm_password",current_password_required:"current password is required.",new_password_required:"new password is required.",passwords_do_not_match:"new passwords do not match.",password_changed:"password changed successfully.",failed_to_change_password:"failed to change password.",update_password:"update_password",two_factor_auth:"> two-factor_authentication",two_fa_enabled:"2fa is enabled",two_fa_not_setup:"2fa is not set up",regenerate_2fa_warning:`// regenerating 2fa will invalidate your current authenticator app setup.
|
|
212
|
-
you will need to set up 2fa again on your next login.`,regenerate_2fa:"regenerate_2fa",regenerating:"regenerating...",access_tokens:"access_tokens",access_tokens_desc:"// manage personal access tokens for cli & api",git_info_updated:"git info updated.",failed_to_update_git_info:"failed to update git info.",two_fa_reset:"2fa has been reset. please set up your authenticator again on next login.",failed_to_regenerate_2fa:"failed to regenerate 2fa.",failed_to_load_profile:"failed to load profile.",unable_to_load_profile:"// unable to load profile information",personal_settings:"// personal settings",password_length_10_20:"password must be between 10 and 20 characters.",password_hint_10_20:"// 10-20 characters, letters, numbers, and special characters",current_totp_code:"current_totp_code",totp_code_placeholder:"6-digit code",totp_code_required:"please enter your current 6-digit totp code to regenerate 2fa.",two_fa_regenerated:"2fa regenerated. you will need to set it up again on next login.",totp_code_invalid:"invalid totp code or failed to regenerate 2fa."},access_tokens:{title:"access_tokens",subtitle:"// personal access tokens",create_token:"create_token",no_tokens:"no_personal_access_tokens",create_token_desc:"create a token to authenticate with the cli or api",copy_token_warning:"// copy your token now. you will not be able to see it again.",token_name:"token_name",token_name_placeholder:"my-cli-token",expires_in:"expires_in",days_30:"30 days",days_90:"90 days",days_365:"365 days",no_expiry:"no expiry",token_created:"token created.",failed_to_create_token:"failed to create token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",failed_to_load_tokens:"failed to load tokens.",revoke:"revoke",revoke_token:"revoke_token",last_used:"last_used",expires_at:"expires_at",token:"token",created:"created",expires:"expires",revoke_confirm:'are you sure you want to revoke "{name}"? this action cannot be undone.',create_personal_access_token:"// create personal access token",tokens_authenticate_desc:"// tokens authenticate the ov cli and api requests",revoke_token_title:"// revoke token",token_label_required:"token label is required."},admin:{title:"admin",subtitle:"// system control",tab_developers:"developers",tab_bots:"bots",tab_tokens:"worker_tokens",tab_audit_logs:"audit_logs",tab_settings:"settings",developers_title:"admin / developers",developers_subtitle:"// developer account management",create_developer:"create_developer",search_developers:"search developers...",no_matching_developers:"no_matching_developers",no_developers_found:"no_developers_found",try_adjusting_search:"try adjusting your search query",username:"username",display_name:"display_name",role:"role",status:"status",two_fa_status:"2fa_status",dev_name:"dev_name",totp:"totp",reset_2fa:"reset 2fa",deactivate:"deactivate",activate:"activate",create_developer_title:"create_developer",create_developer_desc:"// add a new developer account",edit_developer_title:"edit_developer",edit_developer_desc:"// update developer account settings",developer_created:"developer created.",developer_updated:"developer updated.",failed_to_create_developer:"failed to create developer",failed_to_update_developer:"failed to update developer",confirm_reset_2fa:'reset 2fa for "{name}"? they will need to set up 2fa again on next login.',two_fa_reset:"2fa has been reset.",failed_to_reset_2fa:"failed to reset 2fa",confirm_deactivate:'deactivate "{name}"? they will not be able to log in.',confirm_activate:'activate "{name}"?',developer_deactivated:"developer deactivated.",developer_activated:"developer activated.",failed_to_update_status:"failed to update developer status.",create_first_developer:"create your first developer to get started",all_fields_required:"all fields are required.",password_length_error:"password must be between 10 and 20 characters.",password_complexity_error:"password must contain at least one letter, one digit, and one special character.",password_hint:"// must be 10-20 characters with letters, digits, and special characters.",display_name_required:"display name is required.",demote_self_warning:"you are about to demote yourself from admin. the system must have at least one admin. please verify another admin exists before proceeding.",demote_self_inline_warning:"// warning: you are demoting yourself from admin. ensure at least one other admin exists.",reset_2fa_confirm_message:"are you sure you want to reset two-factor authentication for",reset_2fa_audit_note:"// the user will be required to set up 2fa again on their next login. this action is recorded in the audit log.",resetting:"resetting...",bots_title:"admin / bots",bots_subtitle:"// bot instance management",create_bot:"create_bot",no_bots_configured:"no_bots_configured",add_bot_desc:"add a bot instance to enable chat integrations with lark or slack",bot_name:"bot_name",platform:"platform",app_id:"app_id",lark:"lark",slack:"slack",delete_bot:"delete_bot",delete_bot_confirm:'delete bot "{name}"? this cannot be undone.',bot_deleted:"bot deleted.",failed_to_delete_bot:"failed to delete bot.",bot_created:"bot created.",failed_to_create_bot:"failed to create bot",chat_bindings:"chat_bindings",chat_bindings_subtitle:"// all integrations",no_chat_bindings:"// no chat bindings configured",chat_id:"chat_id",chat_name:"chat_name",project:"project",bot:"bot",edit_bot:"edit_bot",name_and_app_id_required:"name and app id are required.",app_secret_required:"app secret is required for new bots.",app_secret:"app_secret",app_secret_keep_current:"app_secret (leave empty to keep current)",webhook_url_optional:"webhook_url (optional)",lark_feishu:"lark_(feishu)",failed_to_update_bot:"failed to update bot",no_chat_bindings_for_bot:"// no chat bindings configured for this bot.",add_chat_binding_desc:"// add chat binding",add_binding:"add_binding",failed_to_add_binding:"failed to add binding",tokens_title:"admin / worker_tokens",tokens_subtitle:"// worker registration token management",generate_token:"generate_token",no_worker_tokens:"no_worker_tokens",generate_token_desc:"generate a token to register a new worker machine",label:"label",purpose:"purpose",expires_at:"expires_at",token_generated:"token generated.",failed_to_generate_token:"failed to generate token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",revoke_token:"revoke_token",revoke_token_confirm:'revoke token "{label}"? this cannot be undone.',show_revoked:"show revoked",hide_revoked:"hide revoked",audit_title:"admin / audit_logs",audit_subtitle:"// system activity audit trail",all_actions:"all_actions",filter_by_user:"filter by user...",no_audit_entries:"no_audit_log_entries",audit_logs_appear:"audit logs will appear here as actions are performed in the system",timestamp:"timestamp",user_id:"user_id",action:"action",resource:"resource",detail:"detail",ip:"ip",action_login:"login",action_logout:"logout",action_create:"create",action_update:"update",action_delete:"delete",action_revoke:"revoke",action_reset_2fa:"reset_2fa",action_generate_token:"generate_token",showing_entries:"showing {count} entries",revoke:"revoke",generate_worker_token_title:"> generate_worker_token",create_one_time_token:"// create a one-time registration token",label_identifies_machine:"// identifies which machine this token is for",generating:"generating...",generate:"generate",worker_registered:"> worker_registered",worker_token_generated:"> worker_token_generated",run_command_desc:"// run this command on the target machine to register the worker",token_shown_once:"// this token will only be shown once. copy the command before closing.",setup_command:"setup command",waiting_for_worker:"// waiting for worker to register...",token_not_yet_used:"// token not yet used. the worker can still register later using this token.",worker_registered_success:"// worker registered successfully",machine:"machine",copied_wait_for_worker:"copied — wait_for_worker",close_worker_can_register:"close // worker can still register",view_machine:"view_machine",label_required:"label is required.",settings_title:"admin / settings",settings_subtitle:"// global system configuration",save_settings:"save_settings",settings_saved:"settings saved",failed_to_save_settings:"failed to save settings",loading_settings:"// loading settings...",scheduling:"> scheduling",heartbeat:"> heartbeat",output:"> output",defaults:"> defaults",max_concurrent_tasks:"max_concurrent_tasks_per_machine",max_concurrent_tasks_desc:"// maximum number of tasks a single worker can run simultaneously",task_timeout:"task_timeout_minutes",task_timeout_desc:"// auto-cancel tasks after this many minutes of inactivity",heartbeat_interval:"heartbeat_interval_seconds",heartbeat_interval_desc:"// expected interval between worker heartbeats",machine_offline_threshold:"machine_offline_threshold_seconds",machine_offline_threshold_desc:"// mark machine offline after missing heartbeats for this duration",default_agent_type:"default_agent_type",default_agent_type_desc:"// default agent type for new projects",server_url:"server_url",server_url_desc:"// public server url used in worker setup instructions",chat_binding_title:"// chat_bindings — {name}",chat_binding_no_bindings:"// no chat bindings configured for this bot.",chat_binding_add:"// add chat binding",chat_binding_id_placeholder:"platform chat/group id",chat_binding_name_placeholder:"display name for the chat",chat_binding_select_project:"select project...",chat_binding_all_fields_required:"all fields are required.",chat_binding_adding:"adding...",pat_label_required:"label is required.",pat_failed_to_generate:"failed to generate token",pat_label_placeholder:"e.g. build-server-03"},landing:{overlord:"overlord",version_badge:"v1.0 — full automation platform",hero_line1:"your machines. your subscriptions.",hero_highlight:"full automation.",hero_desc:"orchestrate ai coding agents across your entire fleet. create tasks, watch them execute in real time, and merge the results — all from one dashboard.",get_started:"get_started",read_docs:"read_docs",how_it_works:"how it works",three_steps:"three steps from idea to merged code.",step_n:"step {n}",step_define:"define",step_define_desc:"describe your task in plain language — bug fixes, features, refactors. attach context and assign to any project.",step_dispatch:"dispatch",step_dispatch_desc:"overlord routes the task to the best available worker and ai agent. execution starts immediately across your fleet.",step_monitor:"monitor & take over",step_monitor_desc:"watch real-time progress via the built-in terminal. jump in at any point to guide, correct, or take full control.",everything_you_need:"everything you need",complete_platform:"a complete platform for ai-assisted software development.",feature_terminal:"real-time pty terminal",feature_terminal_desc:"stream live agent output directly in the browser. full xterm.js integration with scrollback and search.",feature_multi_agent:"multi-agent support",feature_multi_agent_desc:"first-class support for claude code, cursor, and codex. route tasks to the right agent automatically.",feature_routing:"smart task routing",feature_routing_desc:"intelligent scheduling across your machine fleet. tasks land on the best available worker every time.",feature_pipeline:"pipeline automation",feature_pipeline_desc:"chain tasks into multi-stage pipelines. build, test, and deploy in one continuous flow.",feature_collab:"team collaboration",feature_collab_desc:"project-level permissions, audit logs, and shared dashboards. keep your whole team in sync.",feature_security:"secure by design",feature_security_desc:"totp two-factor auth, scoped api tokens, and full audit trail. enterprise-ready from day one.",install_title:"get up and running",install_desc:"three components, three commands. deploy in minutes.",install_command:"npm install -g @overlordai/developer-cli",setup_step_1_title:"deploy the server",setup_step_1_desc:"install overlord and start the central server. it manages all tasks, authentication, and real-time communication.",setup_step_1_command:"npm install -g @overlordai/cli && overlord install",setup_step_1_link:"installation guide",setup_step_2_title:"register workers",setup_step_2_desc:"set up worker machines that execute tasks. each worker runs ai agents in isolated workspaces with full git integration.",setup_step_2_command:"overlord-worker setup --host https://your-server.com --token <token>",setup_step_2_link:"worker setup guide",setup_step_3_title:"connect as developer",setup_step_3_desc:"install the developer cli to create tasks, attach to running sessions, and monitor progress from your terminal.",setup_step_3_command:"npm install -g @overlordai/developer-cli && ov login",setup_step_3_link:"development workflow",go_to_app:"go_to_app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli",cli_subtitle:"// command-line tools",api_reference:"api",api_subtitle:"// rest api endpoints",quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header"}};function t0(u,r){const c=r.split(".");let o=u;for(const f of c){if(o==null||typeof o!="object")return r;o=o[f]}return typeof o=="string"?o:r}function a0(u,r){return r?u.replace(/\{(\w+)\}/g,(c,o)=>r[o]!=null?String(r[o]):`{${o}}`):u}function Hu(u,r){return a0(t0(e0,u),r)}function ta(){return{t:x.useCallback((r,c)=>Hu(r,c),[])}}function Kh(){const{theme:u,setTheme:r}=Zh(),{t:c}=ta(),o=u==="dark"||u==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches,f=()=>{r(o?"light":"dark")};return _.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":c(o?"common.switch_to_light":"common.switch_to_dark"),title:c(o?"common.light_mode":"common.dark_mode"),children:o?_.jsx(Zv,{size:16}):_.jsx(Bv,{size:16})})}class Ac extends Error{constructor(c,o,f){const m=c.status||c.status===0?c.status:"",p=c.statusText??"",T=`${m} ${p}`.trim(),g=T?`status code ${T}`:"an unknown error";super(`Request failed with ${g}: ${o.method} ${o.url}`);wt(this,"response");wt(this,"request");wt(this,"options");this.name="HTTPError",this.response=c,this.request=o,this.options=f}}class Jh extends Error{constructor(c){let o="Non-error value was thrown";try{typeof c=="string"?o=c:c&&typeof c=="object"&&"message"in c&&typeof c.message=="string"&&(o=c.message)}catch{}super(o);wt(this,"name","NonError");wt(this,"value");this.value=c}}class Tc extends Error{constructor(c){const o=c!=null&&c.cause?c.cause instanceof Error?c.cause:new Jh(c.cause):void 0;super(c!=null&&c.code?`Forced retry: ${c.code}`:"Forced retry",o?{cause:o}:void 0);wt(this,"name","ForceRetryError");wt(this,"customDelay");wt(this,"code");wt(this,"customRequest");this.customDelay=c==null?void 0:c.delay,this.code=c==null?void 0:c.code,this.customRequest=c==null?void 0:c.request}}const yh=(()=>{let u=!1,r=!1;const c=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(c&&o)try{r=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return u&&!r})(),l0=typeof globalThis.AbortController=="function",$h=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",n0=typeof globalThis.ReadableStream=="function",i0=typeof globalThis.FormData=="function",Wh=["get","post","put","patch","head","delete"],u0={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},kc=2147483647,r0=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Fh=Symbol("stop");class Ih{constructor(r){wt(this,"options");this.options=r}}const o0=u=>new Ih(u),c0={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},s0={next:!0},f0={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},d0=u=>{if(!u)return 0;if(u instanceof FormData){let r=0;for(const[c,o]of u)r+=r0,r+=new TextEncoder().encode(`Content-Disposition: form-data; name="${c}"`).length,r+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return r}if(u instanceof Blob)return u.size;if(u instanceof ArrayBuffer)return u.byteLength;if(typeof u=="string")return new TextEncoder().encode(u).length;if(u instanceof URLSearchParams)return new TextEncoder().encode(u.toString()).length;if("byteLength"in u)return u.byteLength;if(typeof u=="object"&&u!==null)try{const r=JSON.stringify(u);return new TextEncoder().encode(r).length}catch{return 0}return 0},Ph=(u,r,c)=>{let o,f=0;return u.pipeThrough(new TransformStream({transform(m,p){if(p.enqueue(m),o){f+=o.byteLength;let T=r===0?0:f/r;T>=1&&(T=1-Number.EPSILON),c==null||c({percent:T,totalBytes:Math.max(r,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,c==null||c({percent:1,totalBytes:Math.max(r,f),transferredBytes:f},o))}}))},m0=(u,r)=>{if(!u.body)return u;if(u.status===204)return new Response(null,{status:u.status,statusText:u.statusText,headers:u.headers});const c=Math.max(0,Number(u.headers.get("content-length"))||0);return new Response(Ph(u.body,c,r),{status:u.status,statusText:u.statusText,headers:u.headers})},h0=(u,r,c)=>{if(!u.body)return u;const o=d0(c??u.body);return new Request(u,{duplex:"half",body:Ph(u.body,o,r)})},_l=u=>u!==null&&typeof u=="object",Ou=(...u)=>{for(const r of u)if((!_l(r)||Array.isArray(r))&&r!==void 0)throw new TypeError("The `options` argument must be an object");return Vc({},...u)},ep=(u={},r={})=>{const c=new globalThis.Headers(u),o=r instanceof globalThis.Headers,f=new globalThis.Headers(r);for(const[m,p]of f.entries())o&&p==="undefined"||p===void 0?c.delete(m):c.set(m,p);return c};function Cu(u,r,c){return Object.hasOwn(r,c)&&r[c]===void 0?[]:Vc(u[c]??[],r[c]??[])}const tp=(u={},r={})=>({beforeRequest:Cu(u,r,"beforeRequest"),beforeRetry:Cu(u,r,"beforeRetry"),afterResponse:Cu(u,r,"afterResponse"),beforeError:Cu(u,r,"beforeError")}),p0=(u,r)=>{const c=new URLSearchParams;for(const o of[u,r])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,m]of o.entries())c.append(f,m);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");c.append(String(f[0]),String(f[1]))}else if(_l(o))for(const[f,m]of Object.entries(o))m!==void 0&&c.append(f,String(m));else{const f=new URLSearchParams(o);for(const[m,p]of f.entries())c.append(m,p)}return c},Vc=(...u)=>{let r={},c={},o={},f;const m=[];for(const p of u)if(Array.isArray(p))Array.isArray(r)||(r=[]),r=[...r,...p];else if(_l(p)){for(let[T,g]of Object.entries(p)){if(T==="signal"&&g instanceof globalThis.AbortSignal){m.push(g);continue}if(T==="context"){if(g!=null&&(!_l(g)||Array.isArray(g)))throw new TypeError("The `context` option must be an object");r={...r,context:g==null?{}:{...r.context,...g}};continue}if(T==="searchParams"){g==null?f=void 0:f=f===void 0?g:p0(f,g);continue}_l(g)&&T in r&&(g=Vc(r[T],g)),r={...r,[T]:g}}_l(p.hooks)&&(o=tp(o,p.hooks),r.hooks=o),_l(p.headers)&&(c=ep(c,p.headers),r.headers=c)}return f!==void 0&&(r.searchParams=f),m.length>0&&(m.length===1?r.signal=m[0]:$h?r.signal=AbortSignal.any(m):r.signal=m.at(-1)),r},_0=u=>Wh.includes(u)?u.toUpperCase():u,y0=["get","put","head","delete","options","trace"],g0=[408,413,429,500,502,503,504],v0=[413,429,503],gh={limit:2,methods:y0,statusCodes:g0,afterStatusCodes:v0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:u=>.3*2**(u-1)*1e3,jitter:void 0,retryOnTimeout:!1},b0=(u={})=>{if(typeof u=="number")return{...gh,limit:u};if(u.methods&&!Array.isArray(u.methods))throw new Error("retry.methods must be an array");if(u.methods&&(u.methods=u.methods.map(c=>c.toLowerCase())),u.statusCodes&&!Array.isArray(u.statusCodes))throw new Error("retry.statusCodes must be an array");const r=Object.fromEntries(Object.entries(u).filter(([,c])=>c!==void 0));return{...gh,...r}};class Oc extends Error{constructor(c){super(`Request timed out: ${c.method} ${c.url}`);wt(this,"request");this.name="TimeoutError",this.request=c}}async function x0(u,r,c,o){return new Promise((f,m)=>{const p=setTimeout(()=>{c&&c.abort(),m(new Oc(u))},o.timeout);o.fetch(u,r).then(f).catch(m).then(()=>{clearTimeout(p)})})}async function S0(u,{signal:r}){return new Promise((c,o)=>{r&&(r.throwIfAborted(),r.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(r.reason)}const m=setTimeout(()=>{r==null||r.removeEventListener("abort",f),c()},u)})}const E0=(u,r)=>{const c={};for(const o in r)Object.hasOwn(r,o)&&!(o in f0)&&!(o in c0)&&(!(o in u)||o in s0)&&(c[o]=r[o]);return c},T0=u=>u===void 0?!1:Array.isArray(u)?u.length>0:u instanceof URLSearchParams?u.size>0:typeof u=="object"?Object.keys(u).length>0:typeof u=="string"?u.trim().length>0:!!u;function k0(u){return u instanceof Ac||(u==null?void 0:u.name)===Ac.name}function w0(u){return u instanceof Oc||(u==null?void 0:u.name)===Oc.name}var Vu,ap,Zt,Lt,nt,Q,Ja,Pt,yl,ie,Lu,lp,Cc,Bu,Ka,Mc,np,li,Yu,Nc;const ii=class ii{constructor(r,c={}){It(this,ie);wt(this,"request");It(this,Zt);It(this,Lt,0);It(this,nt);It(this,Q);It(this,Ja);It(this,Pt);It(this,yl);var f,m,p;if(Vt(this,nt,r),Vt(this,Q,{...c,headers:ep(U(this,nt).headers,c.headers),hooks:tp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},c.hooks),method:_0(c.method??U(this,nt).method??"GET"),prefixUrl:String(c.prefixUrl||""),retry:b0(c.retry),throwHttpErrors:c.throwHttpErrors??!0,timeout:c.timeout??1e4,fetch:c.fetch??globalThis.fetch.bind(globalThis),context:c.context??{}}),typeof U(this,nt)!="string"&&!(U(this,nt)instanceof URL||U(this,nt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,Q).prefixUrl&&typeof U(this,nt)=="string"){if(U(this,nt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,Q).prefixUrl.endsWith("/")||(U(this,Q).prefixUrl+="/"),Vt(this,nt,U(this,Q).prefixUrl+U(this,nt))}l0&&$h&&(Vt(this,Pt,U(this,Q).signal??U(this,nt).signal),Vt(this,Zt,new globalThis.AbortController),U(this,Q).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Zt).signal]):U(this,Zt).signal),yh&&(U(this,Q).duplex="half"),U(this,Q).json!==void 0&&(U(this,Q).body=((m=(f=U(this,Q)).stringifyJson)==null?void 0:m.call(f,U(this,Q).json))??JSON.stringify(U(this,Q).json),U(this,Q).headers.set("content-type",U(this,Q).headers.get("content-type")??"application/json"));const o=c.headers&&new globalThis.Headers(c.headers).has("content-type");if(U(this,nt)instanceof globalThis.Request&&(i0&&U(this,Q).body instanceof globalThis.FormData||U(this,Q).body instanceof URLSearchParams)&&!o&&U(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(U(this,nt),U(this,Q)),T0(U(this,Q).searchParams)){const g="?"+(typeof U(this,Q).searchParams=="string"?U(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ge(p=ii,Vu,ap).call(p,U(this,Q).searchParams)).toString()),h=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,g);this.request=new globalThis.Request(h,U(this,Q))}if(U(this,Q).onUploadProgress){if(typeof U(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!yh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ge(this,ie,Nc).call(this,this.request,U(this,Q).body??void 0)}}static create(r,c){var p,T,g;const o=new ii(r,c),f=async()=>{var j,S,D,V,q,H,B,L,P,F,me,fe;if(typeof U(o,Q).timeout=="number"&&U(o,Q).timeout>kc)throw new RangeError(`The \`timeout\` option cannot be greater than ${kc}`);await Promise.resolve();let h=await ge(j=o,ie,np).call(j);for(const K of U(o,Q).hooks.afterResponse){const X=ge(S=o,ie,Cc).call(S,h.clone());let ve;try{ve=await K(o.request,ge(D=o,ie,li).call(D),X,{retryCount:U(o,Lt)})}catch(Ze){throw ge(V=o,ie,Ka).call(V,X),ge(q=o,ie,Ka).call(q,h),Ze}if(ve instanceof Ih)throw ge(H=o,ie,Ka).call(H,X),ge(B=o,ie,Ka).call(B,h),new Tc(ve.options);const De=ve instanceof globalThis.Response?ve:h;X!==De&&ge(L=o,ie,Ka).call(L,X),h!==De&&ge(P=o,ie,Ka).call(P,h),h=De}if(ge(F=o,ie,Cc).call(F,h),!h.ok&&(typeof U(o,Q).throwHttpErrors=="function"?U(o,Q).throwHttpErrors(h.status):U(o,Q).throwHttpErrors)){let K=new Ac(h,o.request,ge(me=o,ie,li).call(me));for(const X of U(o,Q).hooks.beforeError)K=await X(K,{retryCount:U(o,Lt)});throw K}if(U(o,Q).onDownloadProgress){if(typeof U(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!n0)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const K=h.clone();return ge(fe=o,ie,Ka).call(fe,h),m0(K,U(o,Q).onDownloadProgress)}return h},m=ge(p=o,ie,Mc).call(p,f).finally(()=>{var j,S;const h=U(o,Ja);ge(j=o,ie,Bu).call(j,(h==null?void 0:h.body)??void 0),ge(S=o,ie,Bu).call(S,o.request.body??void 0)});for(const[h,j]of Object.entries(u0))h==="bytes"&&typeof((g=(T=globalThis.Response)==null?void 0:T.prototype)==null?void 0:g.bytes)!="function"||(m[h]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||j);const S=await m;if(h==="json"){if(S.status===204)return"";const D=await S.text();return D===""?"":c.parseJson?c.parseJson(D):JSON.parse(D)}return S[h]()});return m}};Vu=new WeakSet,ap=function(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof URLSearchParams)?Object.fromEntries(Object.entries(r).filter(([,c])=>c!==void 0)):r},Zt=new WeakMap,Lt=new WeakMap,nt=new WeakMap,Q=new WeakMap,Ja=new WeakMap,Pt=new WeakMap,yl=new WeakMap,ie=new WeakSet,Lu=function(){const r=U(this,Q).retry.delay(U(this,Lt));let c=r;U(this,Q).retry.jitter===!0?c=Math.random()*r:typeof U(this,Q).retry.jitter=="function"&&(c=U(this,Q).retry.jitter(r),(!Number.isFinite(c)||c<0)&&(c=r));const o=U(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,c)},lp=async function(r){if($m(this,Lt)._++,U(this,Lt)>U(this,Q).retry.limit)throw r;const c=r instanceof Error?r:new Jh(r);if(c instanceof Tc)return c.customDelay??ge(this,ie,Lu).call(this);if(!U(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw r;if(U(this,Q).retry.shouldRetry!==void 0){const o=await U(this,Q).retry.shouldRetry({error:c,retryCount:U(this,Lt)});if(o===!1)throw r;if(o===!0)return ge(this,ie,Lu).call(this)}if(w0(r)&&!U(this,Q).retry.retryOnTimeout)throw r;if(k0(r)){if(!U(this,Q).retry.statusCodes.includes(r.response.status))throw r;const o=r.response.headers.get("Retry-After")??r.response.headers.get("RateLimit-Reset")??r.response.headers.get("X-RateLimit-Retry-After")??r.response.headers.get("X-RateLimit-Reset")??r.response.headers.get("X-Rate-Limit-Reset");if(o&&U(this,Q).retry.afterStatusCodes.includes(r.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=U(this,Q).retry.maxRetryAfter??f;return f<m?f:m}if(r.response.status===413)throw r}return ge(this,ie,Lu).call(this)},Cc=function(r){return U(this,Q).parseJson&&(r.json=async()=>U(this,Q).parseJson(await r.text())),r},Bu=function(r){r&&r.cancel().catch(()=>{})},Ka=function(r){ge(this,ie,Bu).call(this,r.body??void 0)},Mc=async function(r){try{return await r()}catch(c){const o=Math.min(await ge(this,ie,lp).call(this,c),kc);if(U(this,Lt)<1)throw c;if(await S0(o,U(this,Pt)?{signal:U(this,Pt)}:{}),c instanceof Tc&&c.customRequest){const f=U(this,Q).signal?new globalThis.Request(c.customRequest,{signal:U(this,Q).signal}):new globalThis.Request(c.customRequest);ge(this,ie,Yu).call(this,f)}for(const f of U(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ge(this,ie,li).call(this),error:c,retryCount:U(this,Lt)});if(m instanceof globalThis.Request){ge(this,ie,Yu).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===Fh)return}return ge(this,ie,Mc).call(this,r)}},np=async function(){var c;(c=U(this,Zt))!=null&&c.signal.aborted&&(Vt(this,Zt,new globalThis.AbortController),U(this,Q).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Zt).signal]):U(this,Zt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,Q).signal}));for(const o of U(this,Q).hooks.beforeRequest){const f=await o(this.request,ge(this,ie,li).call(this),{retryCount:U(this,Lt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ge(this,ie,Yu).call(this,f);break}}const r=E0(this.request,U(this,Q));return Vt(this,Ja,this.request),this.request=U(this,Ja).clone(),U(this,Q).timeout===!1?U(this,Q).fetch(U(this,Ja),r):x0(U(this,Ja),r,U(this,Zt),U(this,Q))},li=function(){if(!U(this,yl)){const{hooks:r,...c}=U(this,Q);Vt(this,yl,Object.freeze(c))}return U(this,yl)},Yu=function(r){Vt(this,yl,void 0),this.request=ge(this,ie,Nc).call(this,r)},Nc=function(r,c){return!U(this,Q).onUploadProgress||!r.body?r:h0(r,U(this,Q).onUploadProgress,c??U(this,Q).body??void 0)},It(ii,Vu);let Qu=ii;/*! MIT License © Sindre Sorhus */const Dc=u=>{const r=(c,o)=>Qu.create(c,Ou(u,o));for(const c of Wh)r[c]=(o,f)=>Qu.create(o,Ou(u,f,{method:c}));return r.create=c=>Dc(Ou(c)),r.extend=c=>(typeof c=="function"&&(c=c(u??{})),Dc(Ou(u,c))),r.stop=Fh,r.retry=o0,r},vh=Dc();let wc=!1,Rc=null;const Gu=vh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[u=>{const r=$a.getState().accessToken;r&&u.headers.set("Authorization",`Bearer ${r}`)}],afterResponse:[async(u,r,c)=>{if(c.status===401){wc||(wc=!0,Rc=$a.getState().refresh().finally(()=>{wc=!1,setTimeout(()=>{Rc=null},0)}));try{await Rc}catch{throw c}const o=$a.getState().accessToken;return o&&u.headers.set("Authorization",`Bearer ${o}`),vh(u,r)}}]}}),R0=3e4;function j0(u){if(u.link)return u.link;const r=(u.title+" "+u.body).match(/task\s*#?(\d+)/i);if(r)return`/tasks/${r[1]}`;const c=(u.title+" "+u.body).match(/machine\s+(\S+)/i);return c?`/machines/${c[1]}`:null}function ip(){const u=gl(),[r,c]=x.useState([]),[o,f]=x.useState(0),[m,p]=x.useState(!1),[T,g]=x.useState(!1),h=x.useRef(null),{t:j}=ta(),S=x.useCallback(async()=>{try{g(!0);const q=await Gu.get("web/notifications",{searchParams:{limit:"20"}}).json();c(q.data),f(q.data.filter(H=>!H.isRead).length)}catch{}finally{g(!1)}},[]);x.useEffect(()=>{S();const q=setInterval(S,R0);return()=>clearInterval(q)},[S]),x.useEffect(()=>{function q(H){h.current&&!h.current.contains(H.target)&&p(!1)}return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]);const D=async q=>{try{await Gu.post(`web/notifications/${q}/read`),c(H=>H.map(B=>B.id===q?{...B,isRead:!0}:B)),f(H=>Math.max(0,H-1))}catch{}},V=async()=>{try{await Gu.post("web/notifications/read-all"),c(q=>q.map(H=>({...H,isRead:!0}))),f(0)}catch{}};return _.jsxs("div",{className:"relative",ref:h,children:[_.jsxs("button",{type:"button",onClick:()=>p(q=>!q),"aria-label":j("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[_.jsx(jv,{size:16}),o>0&&_.jsx("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-[var(--destructive)] px-1 text-[10px] font-bold text-white",children:o})]}),m&&_.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-80 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[_.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm font-semibold",children:j("common.notifications")}),o>0&&_.jsxs("button",{type:"button",onClick:V,className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(zv,{className:"h-3.5 w-3.5"}),j("common.mark_all_read")]})]}),_.jsx("div",{className:"max-h-80 overflow-y-auto",children:T&&r.length===0?_.jsx("div",{className:"flex justify-center py-8",children:_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r.length===0?_.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[_.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),_.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:j("common.no_notifications")})]}):r.map(q=>{const H=j0(q);return _.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${H?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${q.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(q.isRead||D(q.id),p(!1),u(H))},children:[_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"text-sm font-medium",children:q.title}),_.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:q.body}),_.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(q.createdAt).toLocaleString()})]}),!q.isRead&&_.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),D(q.id)},"aria-label":j("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:_.jsx(Av,{className:"h-3.5 w-3.5"})})]},q.id)})})]})]})}function z0(u){return{tasks:u.tasks.map(r=>({type:"task",id:r.id,title:`#${r.id} ${r.description}`,subtitle:`${r.status} · ${r.project_key}`})),machines:u.machines.map(r=>({type:"machine",id:r.id,title:r.name,subtitle:`${r.hostname} · ${r.status}`})),projects:u.projects.map(r=>({type:"project",id:r.key,title:r.name,subtitle:r.repository}))}}const A0=300,bh={tasks:Vv,machines:Qc,projects:Nv},O0={tasks:"tasks",machines:"machines",projects:"projects"};function C0(){const[u,r]=x.useState(""),[c,o]=x.useState({tasks:[],machines:[],projects:[]}),[f,m]=x.useState(!1),[p,T]=x.useState(!1),[g,h]=x.useState(0),j=x.useRef(null),S=x.useRef(null),D=x.useRef(void 0),V=gl(),{t:q}=ta(),H=[...c.tasks,...c.machines,...c.projects],B=x.useCallback(async K=>{if(!K.trim()){o({tasks:[],machines:[],projects:[]});return}try{m(!0);const X=await Gu.get("web/search",{searchParams:{q:K}}).json();o(z0(X)),h(0)}catch{}finally{m(!1)}},[]);x.useEffect(()=>(D.current&&clearTimeout(D.current),D.current=setTimeout(()=>B(u),A0),()=>{D.current&&clearTimeout(D.current)}),[u,B]),x.useEffect(()=>{function K(X){X.key==="/"&&!p&&!(X.target instanceof HTMLInputElement||X.target instanceof HTMLTextAreaElement)&&(X.preventDefault(),T(!0)),X.key==="Escape"&&p&&(X.preventDefault(),L())}return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[p]),x.useEffect(()=>{p&&setTimeout(()=>{var K;return(K=S.current)==null?void 0:K.focus()},50)},[p]);const L=()=>{T(!1),r(""),o({tasks:[],machines:[],projects:[]}),h(0)},P=K=>{switch(L(),K.type){case"task":V(`/tasks/${K.id}`);break;case"machine":V(`/machines/${K.id}`);break;case"project":V(`/projects/${K.id}`);break}},F=K=>{K.key==="ArrowDown"?(K.preventDefault(),h(X=>Math.min(X+1,H.length-1))):K.key==="ArrowUp"?(K.preventDefault(),h(X=>Math.max(X-1,0))):K.key==="Enter"&&H[g]&&(K.preventDefault(),P(H[g]))},me=H.length>0;let fe=0;return _.jsxs(_.Fragment,{children:[_.jsxs("button",{type:"button",onClick:()=>T(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[_.jsx(Gv,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:q("common.search_placeholder")}),_.jsx("kbd",{className:"ml-2 rounded border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:"/"})]}),p&&_.jsx("div",{ref:j,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:K=>{K.target===j.current&&L()},children:_.jsxs("div",{className:"w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl",style:{fontFamily:"'JetBrains Mono', monospace"},children:[_.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),_.jsx("input",{ref:S,type:"text",placeholder:q("common.search_input_placeholder"),value:u,onChange:K=>r(K.target.value),onKeyDown:F,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),f&&_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),_.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:u.trim()&&!me&&!f?_.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:q("common.no_search_results",{query:u})}):Object.keys(bh).map(K=>{const X=c[K];if(X.length===0)return null;const ve=bh[K],De=fe;return fe+=X.length,_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[_.jsx(ve,{className:"h-3 w-3"}),_.jsx("span",{className:"text-[10px] uppercase tracking-wider",children:O0[K]})]}),X.map((Ze,rt)=>{const Ke=De+rt,ot=Ke===g;return _.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${ot?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>P(Ze),onMouseEnter:()=>h(Ke),children:[_.jsx("span",{className:`text-xs ${ot?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:ot?">":" "}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"truncate text-sm",children:Ze.title}),Ze.subtitle&&_.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:Ze.subtitle})]})]},`${Ze.type}-${Ze.id}`)})]},K)})}),_.jsxs("div",{className:"flex items-center gap-4 border-t border-[var(--border)] px-4 py-2",children:[_.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"↑↓"})," ",q("common.navigate_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"↵"})," ",q("common.select_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"esc"})," ",q("common.close_hint")]})]})]})})]})}const M0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function N0({isOpen:u,onClose:r,onConfirm:c,title:o,message:f,confirmVariant:m="danger",isLoading:p,...T}){const{t:g}=ta(),h=T.confirmLabel??g("common.confirm"),j=T.cancelLabel??g("common.cancel");if(!u)return null;const S=M0[m];return _.jsx("div",{onClick:r,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:_.jsxs("div",{onClick:D=>D.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:[_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[_.jsx(Xh,{style:{width:"1rem",height:"1rem"}}),o]})}),_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),_.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[_.jsx("button",{type:"button",onClick:r,disabled:p,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,transition:"color 0.15s, border-color 0.15s"},children:j}),_.jsx("button",{type:"button",onClick:c,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:S,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:p?"not-allowed":"pointer",opacity:p?.7:1},children:p?g("common.processing"):h})]})]})})}const up=x.createContext({setActions:()=>{}});function Ab(u){const{setActions:r}=x.useContext(up);x.useEffect(()=>(r(u),()=>r(null)),[u,r])}const rp=x.createContext({setSubtitle:()=>{}});function Ob(u){const{setSubtitle:r}=x.useContext(rp);x.useEffect(()=>(r(u),()=>r(null)),[u,r])}const D0=[{to:"/home",label:"dashboard",icon:Yh},{to:"/tasks",label:"tasks",icon:Gh},{to:"/machines",label:"machines",icon:Qc},{to:"/projects",label:"projects",icon:Dv},{to:"/access-tokens",label:"access_tokens",icon:qv}],U0=[{to:"/docs/cli",label:"cli",icon:Kv},{to:"/docs/api",label:"api",icon:Mv},{to:"/docs/skill",label:"skill",icon:Qv}],q0=[{to:"/admin",label:"admin",icon:Xv}],H0=[{to:"/home",label:"dashboard",icon:Yh},{to:"/tasks",label:"tasks",icon:Gh},{to:"/machines",label:"machines",icon:Qc},{to:"/profile",label:"profile",icon:Jv}],Mu={"/home":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/machines":{title:"common.breadcrumb_machines",subtitle:"common.breadcrumb_machines_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_access_tokens",subtitle:"common.breadcrumb_access_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"}};function L0(u){const{t:r}=ta();if(Mu[u]){const o=Mu[u];return{title:r(o.title),subtitle:r(o.subtitle)}}const c="/"+u.split("/").filter(Boolean)[0];if(Mu[c]){const o=Mu[c],f=u.split("/").filter(Boolean).slice(1).join(" / ");return{title:r(o.title),subtitle:f||r(o.subtitle)}}return{title:u.slice(1).replace(/\//g," // ")||"home"}}function B0(u,r){return u==="/home"?r==="/home":r.startsWith(u)}function Y0(){const u=Yt(),{t:r}=ta();return _.jsx("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)] md:hidden",style:{height:60,paddingTop:8,paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:H0.map(({to:c,label:o,icon:f})=>{const m=B0(c,u.pathname);return _.jsxs(ni,{to:c,className:"flex flex-col items-center gap-1",style:{width:70},children:[_.jsx(f,{size:18,className:m?"text-[var(--accent)]":"text-[var(--text-muted)]"}),_.jsx("span",{className:`text-[8px] lowercase ${m?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:{dashboard:r("dashboard.title"),tasks:r("tasks.title"),machines:r("machines.title"),profile:r("common.profile")}[o]??o})]},c)})})}function G0(){const u=gl(),{t:r}=ta();return _.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:56,minHeight:56},children:[_.jsxs("button",{onClick:()=>u("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:_.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),_.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:r("common.overlord")})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(ip,{}),_.jsx(Kh,{})]})]})}function X0(){const{user:u,logout:r}=$a(),c=gl(),[o,f]=x.useState(!1),m=(u==null?void 0:u.role)==="admin",{t:p}=ta(),T=()=>{r(),c("/login")};return _.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)]",style:{width:240,minWidth:240,backgroundColor:"var(--bg-card)"},children:[_.jsx("div",{className:"flex items-center px-5",style:{height:48},children:_.jsxs("button",{onClick:()=>c("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:_.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),_.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:p("common.overlord")})]})}),_.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[_.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.navigation")}),D0.map(({to:g,label:h,icon:j})=>_.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>_.jsxs(_.Fragment,{children:[_.jsx(j,{size:14,style:{flexShrink:0}}),_.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g)),_.jsx("div",{className:"mb-2 mt-4 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.docs_section")}),U0.map(({to:g,label:h,icon:j})=>_.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>_.jsxs(_.Fragment,{children:[_.jsx(j,{size:14,style:{flexShrink:0}}),_.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g)),m&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"mb-2 mt-4 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.admin_section")}),q0.map(({to:g,label:h,icon:j})=>_.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>_.jsxs(_.Fragment,{children:[_.jsx(j,{size:14,style:{flexShrink:0}}),_.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g))]})]}),_.jsx("div",{className:"border-t border-[var(--border)] p-3",children:_.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[_.jsx("button",{onClick:()=>c("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:p("common.profile"),children:((u==null?void 0:u.username)??"u")[0].toUpperCase()}),_.jsxs("button",{onClick:()=>c("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:p("common.profile"),children:[_.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(u==null?void 0:u.username)??"user"}),_.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(u==null?void 0:u.role)??"user"})]}),_.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":p("common.log_out"),children:_.jsx(Lv,{size:14})})]})}),_.jsx(N0,{isOpen:o,onClose:()=>f(!1),onConfirm:T,title:p("common.logout_title"),message:p("common.logout_message"),confirmLabel:p("common.logout"),confirmVariant:"warning"})]})}function Q0({headerActions:u,subtitleOverride:r}){const c=Yt(),{title:o,subtitle:f}=L0(c.pathname),m=r??f;return _.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[_.jsxs("div",{className:"text-sm lowercase",style:{fontFamily:"'JetBrains Mono', monospace"},children:[_.jsx("span",{style:{color:"var(--text-primary)"},children:o}),m&&_.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",m]})]}),_.jsxs("div",{className:"flex items-center gap-3",children:[u,_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(C0,{}),_.jsx(ip,{}),_.jsx(Kh,{})]})]})]})}function V0(){const[u,r]=x.useState(null),[c,o]=x.useState(null);return _.jsxs("div",{className:"flex h-screen font-mono",children:[_.jsx(X0,{}),_.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[_.jsx(G0,{}),_.jsx(Q0,{headerActions:u,subtitleOverride:c}),_.jsx("main",{className:"flex-1 overflow-auto bg-[var(--bg-primary)] p-4 md:p-6",children:_.jsx(up.Provider,{value:{setActions:r},children:_.jsx(rp.Provider,{value:{setSubtitle:o},children:_.jsx(Qg,{})})})}),_.jsx(Y0,{})]})]})}function Nu({children:u,requireAdmin:r=!1}){const{accessToken:c,user:o,requireTotpSetup:f,initializing:m}=$a(),p=Yt();return m?_.jsx("div",{className:"flex h-screen items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):c?f?p.pathname!=="/totp-setup"?_.jsx(Du,{to:"/totp-setup",replace:!0}):_.jsx(_.Fragment,{children:u}):r&&(o==null?void 0:o.role)!=="admin"?_.jsx(Du,{to:"/home",replace:!0}):_.jsx(_.Fragment,{children:u}):_.jsx(Du,{to:"/login",state:{from:p},replace:!0})}function Z0({children:u}){const{theme:r,resolved:c,setResolved:o}=Zh();return x.useEffect(()=>{if(r!=="system"){o(r);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=p=>o(p.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[r,o]),x.useEffect(()=>{document.documentElement.classList.toggle("dark",c==="dark")},[c]),_.jsx(_.Fragment,{children:u})}class K0 extends x.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r;return this.state.hasError?_.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8",children:[_.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Hu("common.runtime_error")}),_.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((r=this.state.error)==null?void 0:r.message)||Hu("common.an_unexpected_error_occurred")}),_.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(Yv,{className:"h-3.5 w-3.5"}),Hu("common.reload")]})]}):this.props.children}}function J0({isOpen:u}){const r=gl(),{logout:c,setSessionExpired:o}=$a(),{t:f}=ta();function m(){c(),o(!1),r("/login")}return u?_.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[_.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),_.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:_.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[_.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:_.jsx(Hv,{className:"h-7 w-7 text-[var(--warning)]"})}),_.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),_.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),_.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:m,children:f("auth.go_to_login")})]})})]}):null}const xh=5;let ba=[];const Uc=new Set;function op(){Uc.forEach(u=>u())}function $0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(u,r,c=4e3){const o=$0();return ba=[...ba,{id:o,variant:u,message:r,duration:c}],ba.length>xh&&(ba=ba.slice(ba.length-xh)),op(),o}Wa.success=(u,r)=>Wa("success",u,r);Wa.error=(u,r)=>Wa("error",u,r);Wa.warning=(u,r)=>Wa("warning",u,r);Wa.info=(u,r)=>Wa("info",u,r);function W0(u){ba=ba.filter(r=>r.id!==u),op()}function F0(){const[,u]=x.useState(0);return x.useEffect(()=>{const r=()=>u(c=>c+1);return Uc.add(r),()=>{Uc.delete(r)}},[]),ba}const I0={success:{icon:Ov,borderColor:"var(--accent)"},error:{icon:Cv,borderColor:"var(--destructive)"},warning:{icon:Xh,borderColor:"var(--warning)"},info:{icon:Uv,borderColor:"var(--info)"}};function P0({item:u}){const r=I0[u.variant],c=r.icon,{t:o}=ta(),f=x.useCallback(()=>W0(u.id),[u.id]);return x.useEffect(()=>{if(!u.duration)return;const m=setTimeout(f,u.duration);return()=>clearTimeout(m)},[u.duration,f]),_.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${r.borderColor}`},role:"alert",children:[_.jsx(c,{className:"h-4 w-4 shrink-0",style:{color:r.borderColor}}),_.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:u.message}),_.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:_.jsx($v,{className:"h-3.5 w-3.5"})})]})}function eb(){const u=F0();return u.length===0?null:_.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:u.map(r=>_.jsx("div",{className:"pointer-events-auto",children:_.jsx(P0,{item:r})},r.id))})}const tb=x.lazy(()=>Ce(()=>import("./LandingPage-BBF_PnWk.js"),__vite__mapDeps([0,1,2,3,4]))),ab=x.lazy(()=>Ce(()=>import("./LoginPage-BXdJBXbE.js"),[])),lb=x.lazy(()=>Ce(()=>import("./TotpSetupPage-CEGN1xn8.js"),[])),nb=x.lazy(()=>Ce(()=>import("./NotFoundPage-CDsk2FBZ.js"),[])),ib=x.lazy(()=>Ce(()=>import("./HomePage-BkKwaAgJ.js"),__vite__mapDeps([5,6,7,8,9,1]))),ub=x.lazy(()=>Ce(()=>import("./TaskListPage-CUHGBvyU.js"),__vite__mapDeps([10,11,7,12,4,13,8,14]))),rb=x.lazy(()=>Ce(()=>import("./TaskDetailPage-C4ICC3OM.js"),__vite__mapDeps([15,11,12,16,17,18,19,20]))),ob=x.lazy(()=>Ce(()=>import("./MachineListPage-D79p6rD6.js"),__vite__mapDeps([21,6,22,23,24,4,19,12,13,8,14]))),cb=x.lazy(()=>Ce(()=>import("./MachineDetailPage-DeLR95cj.js"),__vite__mapDeps([25,6,26,16]))),sb=x.lazy(()=>Ce(()=>import("./WorkerSetupGuidePage-CwuvVUoB.js"),__vite__mapDeps([22,23,24]))),fb=x.lazy(()=>Ce(()=>import("./ProjectListPage-BJxuXui-.js"),__vite__mapDeps([27,6,12,13,8,14]))),db=x.lazy(()=>Ce(()=>import("./ProjectDetailPage-BVi8nkb1.js"),__vite__mapDeps([28,6,29,12,30,26,14]))),mb=x.lazy(()=>Ce(()=>import("./EditProjectPage-DPTc1yRc.js"),__vite__mapDeps([31,6,12,29,14]))),hb=x.lazy(()=>Ce(()=>import("./PipelineEditorPage-DRxoetje.js"),__vite__mapDeps([32,12]))),pb=x.lazy(()=>Ce(()=>import("./ProfilePage-DYw8NzPC.js"),[])),_b=x.lazy(()=>Ce(()=>import("./AccessTokensPage-oPweGG_z.js"),__vite__mapDeps([33,12,13,8,14,4,26]))),yb=x.lazy(()=>Ce(()=>import("./CliReferencePage-BdzdHAsN.js"),__vite__mapDeps([34,35,4,14]))),gb=x.lazy(()=>Ce(()=>import("./ApiReferencePage-FUskCdjw.js"),__vite__mapDeps([36,35,4,14]))),vb=x.lazy(()=>Ce(()=>import("./SkillPage-Bq35rago.js"),__vite__mapDeps([37,18,4]))),bb=x.lazy(()=>Ce(()=>import("./AdminPage-Dw1ng1n4.js"),__vite__mapDeps([38,3,2,39,24]))),xb=x.lazy(()=>Ce(()=>import("./DeveloperManage-C8-2MMwr.js"),__vite__mapDeps([40,12,13,8,14,3,30,17]))),Sb=x.lazy(()=>Ce(()=>import("./BotManage-D2QsEBCS.js"),__vite__mapDeps([41,12,26,14,13,8,2,30]))),Eb=x.lazy(()=>Ce(()=>import("./TokenManage-B4uqYclW.js"),__vite__mapDeps([42,23,4,18,13,8,14]))),Tb=x.lazy(()=>Ce(()=>import("./AuditLogPage-nwiONLEk.js"),__vite__mapDeps([43,12,13,8,39,9]))),kb=x.lazy(()=>Ce(()=>import("./SettingsPage-B9lw8C-c.js"),[]));function wb(){return _.jsx("div",{className:"flex h-full items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function Rb(){const u=$a(r=>r.sessionExpired);return _.jsxs(Z0,{children:[_.jsx(eb,{}),_.jsx(K0,{children:_.jsxs(_v,{children:[_.jsx(J0,{isOpen:u}),_.jsx(x.Suspense,{fallback:_.jsx(wb,{}),children:_.jsxs(Zg,{children:[_.jsx(we,{path:"/",element:_.jsx(tb,{})}),_.jsx(we,{path:"/login",element:_.jsx(ab,{})}),_.jsx(we,{path:"/totp-setup",element:_.jsx(Nu,{children:_.jsx(lb,{})})}),_.jsxs(we,{element:_.jsx(Nu,{children:_.jsx(V0,{})}),children:[_.jsx(we,{path:"/home",element:_.jsx(ib,{})}),_.jsx(we,{path:"/tasks",element:_.jsx(ub,{})}),_.jsx(we,{path:"/tasks/:id",element:_.jsx(rb,{})}),_.jsx(we,{path:"/machines",element:_.jsx(ob,{})}),_.jsx(we,{path:"/machines/setup",element:_.jsx(Nu,{requireAdmin:!0,children:_.jsx(sb,{})})}),_.jsx(we,{path:"/machines/:id",element:_.jsx(cb,{})}),_.jsx(we,{path:"/projects",element:_.jsx(fb,{})}),_.jsx(we,{path:"/projects/:key",element:_.jsx(db,{})}),_.jsx(we,{path:"/projects/:key/edit",element:_.jsx(mb,{})}),_.jsx(we,{path:"/projects/:key/pipeline",element:_.jsx(hb,{})}),_.jsx(we,{path:"/profile",element:_.jsx(pb,{})}),_.jsx(we,{path:"/access-tokens",element:_.jsx(_b,{})}),_.jsx(we,{path:"/docs/cli",element:_.jsx(yb,{})}),_.jsx(we,{path:"/docs/api",element:_.jsx(gb,{})}),_.jsx(we,{path:"/docs/skill",element:_.jsx(vb,{})}),_.jsxs(we,{path:"/admin",element:_.jsx(Nu,{requireAdmin:!0,children:_.jsx(bb,{})}),children:[_.jsx(we,{index:!0,element:_.jsx(Du,{to:"developers",replace:!0})}),_.jsx(we,{path:"developers",element:_.jsx(xb,{})}),_.jsx(we,{path:"bots",element:_.jsx(Sb,{})}),_.jsx(we,{path:"tokens",element:_.jsx(Eb,{})}),_.jsx(we,{path:"audit-logs",element:_.jsx(Tb,{})}),_.jsx(we,{path:"settings",element:_.jsx(kb,{})})]})]}),_.jsx(we,{path:"*",element:_.jsx(nb,{})})]})})]})})]})}$a.getState().initialize();Qy.createRoot(document.getElementById("root")).render(_.jsx(x.StrictMode,{children:_.jsx(Rb,{})}));export{Av as C,Ac as H,qv as K,Hh as L,Du as N,Qg as O,Ru as R,Xv as S,Kh as T,$v as X,ta as a,Kv as b,ze as c,gl as d,Yt as e,Gu as f,Hu as g,Ab as h,Gv as i,_ as j,Gh as k,N0 as l,zb as m,Ob as n,Ov as o,Qh as p,Qc as q,x as r,Xh as s,Wa as t,$a as u,Yv as v,ni as w,Cv as x};
|
|
212
|
+
you will need to set up 2fa again on your next login.`,regenerate_2fa:"regenerate_2fa",regenerating:"regenerating...",access_tokens:"access_tokens",access_tokens_desc:"// manage personal access tokens for cli & api",git_info_updated:"git info updated.",failed_to_update_git_info:"failed to update git info.",two_fa_reset:"2fa has been reset. please set up your authenticator again on next login.",failed_to_regenerate_2fa:"failed to regenerate 2fa.",failed_to_load_profile:"failed to load profile.",unable_to_load_profile:"// unable to load profile information",personal_settings:"// personal settings",password_length_10_20:"password must be between 10 and 20 characters.",password_hint_10_20:"// 10-20 characters, letters, numbers, and special characters",current_totp_code:"current_totp_code",totp_code_placeholder:"6-digit code",totp_code_required:"please enter your current 6-digit totp code to regenerate 2fa.",two_fa_regenerated:"2fa regenerated. you will need to set it up again on next login.",totp_code_invalid:"invalid totp code or failed to regenerate 2fa."},access_tokens:{title:"access_tokens",subtitle:"// personal access tokens",create_token:"create_token",no_tokens:"no_personal_access_tokens",create_token_desc:"create a token to authenticate with the cli or api",copy_token_warning:"// copy your token now. you will not be able to see it again.",token_name:"token_name",token_name_placeholder:"my-cli-token",expires_in:"expires_in",days_30:"30 days",days_90:"90 days",days_365:"365 days",no_expiry:"no expiry",token_created:"token created.",failed_to_create_token:"failed to create token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",failed_to_load_tokens:"failed to load tokens.",revoke:"revoke",revoke_token:"revoke_token",last_used:"last_used",expires_at:"expires_at",token:"token",created:"created",expires:"expires",revoke_confirm:'are you sure you want to revoke "{name}"? this action cannot be undone.',create_personal_access_token:"// create personal access token",tokens_authenticate_desc:"// tokens authenticate the ov cli and api requests",revoke_token_title:"// revoke token",token_label_required:"token label is required."},admin:{title:"admin",subtitle:"// system control",tab_developers:"developers",tab_bots:"bots",tab_tokens:"worker_tokens",tab_audit_logs:"audit_logs",tab_settings:"settings",developers_title:"admin / developers",developers_subtitle:"// developer account management",create_developer:"create_developer",search_developers:"search developers...",no_matching_developers:"no_matching_developers",no_developers_found:"no_developers_found",try_adjusting_search:"try adjusting your search query",username:"username",display_name:"display_name",role:"role",status:"status",two_fa_status:"2fa_status",dev_name:"dev_name",totp:"totp",reset_2fa:"reset 2fa",deactivate:"deactivate",activate:"activate",create_developer_title:"create_developer",create_developer_desc:"// add a new developer account",edit_developer_title:"edit_developer",edit_developer_desc:"// update developer account settings",developer_created:"developer created.",developer_updated:"developer updated.",failed_to_create_developer:"failed to create developer",failed_to_update_developer:"failed to update developer",confirm_reset_2fa:'reset 2fa for "{name}"? they will need to set up 2fa again on next login.',two_fa_reset:"2fa has been reset.",failed_to_reset_2fa:"failed to reset 2fa",confirm_deactivate:'deactivate "{name}"? they will not be able to log in.',confirm_activate:'activate "{name}"?',developer_deactivated:"developer deactivated.",developer_activated:"developer activated.",failed_to_update_status:"failed to update developer status.",create_first_developer:"create your first developer to get started",all_fields_required:"all fields are required.",password_length_error:"password must be between 10 and 20 characters.",password_complexity_error:"password must contain at least one letter, one digit, and one special character.",password_hint:"// must be 10-20 characters with letters, digits, and special characters.",display_name_required:"display name is required.",demote_self_warning:"you are about to demote yourself from admin. the system must have at least one admin. please verify another admin exists before proceeding.",demote_self_inline_warning:"// warning: you are demoting yourself from admin. ensure at least one other admin exists.",reset_2fa_confirm_message:"are you sure you want to reset two-factor authentication for",reset_2fa_audit_note:"// the user will be required to set up 2fa again on their next login. this action is recorded in the audit log.",resetting:"resetting...",bots_title:"admin / bots",bots_subtitle:"// bot instance management",create_bot:"create_bot",no_bots_configured:"no_bots_configured",add_bot_desc:"add a bot instance to enable chat integrations with lark or slack",bot_name:"bot_name",platform:"platform",app_id:"app_id",lark:"lark",slack:"slack",delete_bot:"delete_bot",delete_bot_confirm:'delete bot "{name}"? this cannot be undone.',bot_deleted:"bot deleted.",failed_to_delete_bot:"failed to delete bot.",bot_created:"bot created.",failed_to_create_bot:"failed to create bot",chat_bindings:"chat_bindings",chat_bindings_subtitle:"// all integrations",no_chat_bindings:"// no chat bindings configured",chat_id:"chat_id",chat_name:"chat_name",project:"project",bot:"bot",edit_bot:"edit_bot",name_and_app_id_required:"name and app id are required.",app_secret_required:"app secret is required for new bots.",app_secret:"app_secret",app_secret_keep_current:"app_secret (leave empty to keep current)",webhook_url_optional:"webhook_url (optional)",lark_feishu:"lark_(feishu)",failed_to_update_bot:"failed to update bot",no_chat_bindings_for_bot:"// no chat bindings configured for this bot.",add_chat_binding_desc:"// add chat binding",add_binding:"add_binding",failed_to_add_binding:"failed to add binding",tokens_title:"admin / worker_tokens",tokens_subtitle:"// worker registration token management",generate_token:"generate_token",no_worker_tokens:"no_worker_tokens",generate_token_desc:"generate a token to register a new worker machine",label:"label",purpose:"purpose",expires_at:"expires_at",token_generated:"token generated.",failed_to_generate_token:"failed to generate token.",token_revoked:"token revoked.",failed_to_revoke_token:"failed to revoke token.",revoke_token:"revoke_token",revoke_token_confirm:'revoke token "{label}"? this cannot be undone.',show_revoked:"show revoked",hide_revoked:"hide revoked",audit_title:"admin / audit_logs",audit_subtitle:"// system activity audit trail",all_actions:"all_actions",filter_by_user:"filter by user...",no_audit_entries:"no_audit_log_entries",audit_logs_appear:"audit logs will appear here as actions are performed in the system",timestamp:"timestamp",user_id:"user_id",action:"action",resource:"resource",detail:"detail",ip:"ip",action_login:"login",action_logout:"logout",action_create:"create",action_update:"update",action_delete:"delete",action_revoke:"revoke",action_reset_2fa:"reset_2fa",action_generate_token:"generate_token",showing_entries:"showing {count} entries",revoke:"revoke",generate_worker_token_title:"> generate_worker_token",create_one_time_token:"// create a one-time registration token",label_identifies_machine:"// identifies which machine this token is for",generating:"generating...",generate:"generate",worker_registered:"> worker_registered",worker_token_generated:"> worker_token_generated",run_command_desc:"// run this command on the target machine to register the worker",token_shown_once:"// this token will only be shown once. copy the command before closing.",setup_command:"setup command",waiting_for_worker:"// waiting for worker to register...",token_not_yet_used:"// token not yet used. the worker can still register later using this token.",worker_registered_success:"// worker registered successfully",machine:"machine",copied_wait_for_worker:"copied — wait_for_worker",close_worker_can_register:"close // worker can still register",view_machine:"view_machine",label_required:"label is required.",settings_title:"admin / settings",settings_subtitle:"// global system configuration",save_settings:"save_settings",settings_saved:"settings saved",failed_to_save_settings:"failed to save settings",loading_settings:"// loading settings...",scheduling:"> scheduling",heartbeat:"> heartbeat",output:"> output",defaults:"> defaults",max_concurrent_tasks:"max_concurrent_tasks_per_machine",max_concurrent_tasks_desc:"// maximum number of tasks a single worker can run simultaneously",task_timeout:"task_timeout_minutes",task_timeout_desc:"// auto-cancel tasks after this many minutes of inactivity",heartbeat_interval:"heartbeat_interval_seconds",heartbeat_interval_desc:"// expected interval between worker heartbeats",machine_offline_threshold:"machine_offline_threshold_seconds",machine_offline_threshold_desc:"// mark machine offline after missing heartbeats for this duration",default_agent_type:"default_agent_type",default_agent_type_desc:"// default agent type for new projects",server_url:"server_url",server_url_desc:"// public server url used in worker setup instructions",chat_binding_title:"// chat_bindings — {name}",chat_binding_no_bindings:"// no chat bindings configured for this bot.",chat_binding_add:"// add chat binding",chat_binding_id_placeholder:"platform chat/group id",chat_binding_name_placeholder:"display name for the chat",chat_binding_select_project:"select project...",chat_binding_all_fields_required:"all fields are required.",chat_binding_adding:"adding...",pat_label_required:"label is required.",pat_failed_to_generate:"failed to generate token",pat_label_placeholder:"e.g. build-server-03"},landing:{overlord:"overlord",version_badge:"v1.0 — full automation platform",hero_line1:"your machines. your subscriptions.",hero_highlight:"full automation.",hero_desc:"orchestrate ai coding agents across your entire fleet. create tasks, watch them execute in real time, and merge the results — all from one dashboard.",get_started:"get_started",read_docs:"read_docs",how_it_works:"how it works",three_steps:"three steps from idea to merged code.",step_n:"step {n}",step_define:"define",step_define_desc:"describe your task in plain language — bug fixes, features, refactors. attach context and assign to any project.",step_dispatch:"dispatch",step_dispatch_desc:"overlord routes the task to the best available worker and ai agent. execution starts immediately across your fleet.",step_monitor:"monitor & take over",step_monitor_desc:"watch real-time progress via the built-in terminal. jump in at any point to guide, correct, or take full control.",everything_you_need:"everything you need",complete_platform:"a complete platform for ai-assisted software development.",feature_terminal:"real-time pty terminal",feature_terminal_desc:"stream live agent output directly in the browser. full xterm.js integration with scrollback and search.",feature_multi_agent:"multi-agent support",feature_multi_agent_desc:"first-class support for claude code, cursor, and codex. route tasks to the right agent automatically.",feature_routing:"smart task routing",feature_routing_desc:"intelligent scheduling across your machine fleet. tasks land on the best available worker every time.",feature_pipeline:"pipeline automation",feature_pipeline_desc:"chain tasks into multi-stage pipelines. build, test, and deploy in one continuous flow.",feature_collab:"team collaboration",feature_collab_desc:"project-level permissions, audit logs, and shared dashboards. keep your whole team in sync.",feature_security:"secure by design",feature_security_desc:"totp two-factor auth, scoped api tokens, and full audit trail. enterprise-ready from day one.",install_title:"get up and running",install_desc:"three components, three commands. deploy in minutes.",install_command:"npm install -g @overlordai/developer-cli",setup_step_1_title:"deploy the server",setup_step_1_desc:"install overlord and start the central server. it manages all tasks, authentication, and real-time communication.",setup_step_1_command:"npm install -g @overlordai/cli && overlord install",setup_step_1_link:"installation guide",setup_step_2_title:"register workers",setup_step_2_desc:"set up worker machines that execute tasks. each worker runs ai agents in isolated workspaces with full git integration.",setup_step_2_command:"overlord-worker setup --host https://your-server.com --token <token>",setup_step_2_link:"worker setup guide",setup_step_3_title:"connect as developer",setup_step_3_desc:"install the developer cli to create tasks, attach to running sessions, and monitor progress from your terminal.",setup_step_3_command:"npm install -g @overlordai/developer-cli && ov login",setup_step_3_link:"development workflow",go_to_app:"go_to_app",documentation:"documentation",api:"api",copy_install_command:"copy install command"},docs:{cli_reference:"cli",cli_subtitle:"// command-line tools",api_reference:"api",api_subtitle:"// rest api endpoints",quick_start:"// quick start",developer_cli:"developer cli (ov)",admin_cli:"admin cli (overlord)",authentication:"// authentication",usage:"usage",flags:"flags",example:"example",request_body:"request body",response:"response",quick_start_with_token:"// quick start with your token",replace_token_hint:"// replace <your-token> with the actual token value from your access tokens page",cli_tools_desc:"// overlord provides two cli tools: {ov} (developer cli) and {overlord} (admin/ops cli)",api_base_url_desc:"// base url: {url} · all endpoints return json · auth via bearer token in authorization header"}};function t0(u,r){const c=r.split(".");let o=u;for(const f of c){if(o==null||typeof o!="object")return r;o=o[f]}return typeof o=="string"?o:r}function a0(u,r){return r?u.replace(/\{(\w+)\}/g,(c,o)=>r[o]!=null?String(r[o]):`{${o}}`):u}function Hu(u,r){return a0(t0(e0,u),r)}function ta(){return{t:x.useCallback((r,c)=>Hu(r,c),[])}}function Kh(){const{theme:u,setTheme:r}=Zh(),{t:c}=ta(),o=u==="dark"||u==="system"&&typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches,f=()=>{r(o?"light":"dark")};return _.jsx("button",{onClick:f,className:"flex items-center gap-1.5 rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]","aria-label":c(o?"common.switch_to_light":"common.switch_to_dark"),title:c(o?"common.light_mode":"common.dark_mode"),children:o?_.jsx(Zv,{size:16}):_.jsx(Bv,{size:16})})}class Ac extends Error{constructor(c,o,f){const m=c.status||c.status===0?c.status:"",p=c.statusText??"",T=`${m} ${p}`.trim(),g=T?`status code ${T}`:"an unknown error";super(`Request failed with ${g}: ${o.method} ${o.url}`);wt(this,"response");wt(this,"request");wt(this,"options");this.name="HTTPError",this.response=c,this.request=o,this.options=f}}class Jh extends Error{constructor(c){let o="Non-error value was thrown";try{typeof c=="string"?o=c:c&&typeof c=="object"&&"message"in c&&typeof c.message=="string"&&(o=c.message)}catch{}super(o);wt(this,"name","NonError");wt(this,"value");this.value=c}}class Tc extends Error{constructor(c){const o=c!=null&&c.cause?c.cause instanceof Error?c.cause:new Jh(c.cause):void 0;super(c!=null&&c.code?`Forced retry: ${c.code}`:"Forced retry",o?{cause:o}:void 0);wt(this,"name","ForceRetryError");wt(this,"customDelay");wt(this,"code");wt(this,"customRequest");this.customDelay=c==null?void 0:c.delay,this.code=c==null?void 0:c.code,this.customRequest=c==null?void 0:c.request}}const yh=(()=>{let u=!1,r=!1;const c=typeof globalThis.ReadableStream=="function",o=typeof globalThis.Request=="function";if(c&&o)try{r=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type")}catch(f){if(f instanceof Error&&f.message==="unsupported BodyInit type")return!1;throw f}return u&&!r})(),l0=typeof globalThis.AbortController=="function",$h=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",n0=typeof globalThis.ReadableStream=="function",i0=typeof globalThis.FormData=="function",Wh=["get","post","put","patch","head","delete"],u0={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},kc=2147483647,r0=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,Fh=Symbol("stop");class Ih{constructor(r){wt(this,"options");this.options=r}}const o0=u=>new Ih(u),c0={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},s0={next:!0},f0={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},d0=u=>{if(!u)return 0;if(u instanceof FormData){let r=0;for(const[c,o]of u)r+=r0,r+=new TextEncoder().encode(`Content-Disposition: form-data; name="${c}"`).length,r+=typeof o=="string"?new TextEncoder().encode(o).length:o.size;return r}if(u instanceof Blob)return u.size;if(u instanceof ArrayBuffer)return u.byteLength;if(typeof u=="string")return new TextEncoder().encode(u).length;if(u instanceof URLSearchParams)return new TextEncoder().encode(u.toString()).length;if("byteLength"in u)return u.byteLength;if(typeof u=="object"&&u!==null)try{const r=JSON.stringify(u);return new TextEncoder().encode(r).length}catch{return 0}return 0},Ph=(u,r,c)=>{let o,f=0;return u.pipeThrough(new TransformStream({transform(m,p){if(p.enqueue(m),o){f+=o.byteLength;let T=r===0?0:f/r;T>=1&&(T=1-Number.EPSILON),c==null||c({percent:T,totalBytes:Math.max(r,f),transferredBytes:f},o)}o=m},flush(){o&&(f+=o.byteLength,c==null||c({percent:1,totalBytes:Math.max(r,f),transferredBytes:f},o))}}))},m0=(u,r)=>{if(!u.body)return u;if(u.status===204)return new Response(null,{status:u.status,statusText:u.statusText,headers:u.headers});const c=Math.max(0,Number(u.headers.get("content-length"))||0);return new Response(Ph(u.body,c,r),{status:u.status,statusText:u.statusText,headers:u.headers})},h0=(u,r,c)=>{if(!u.body)return u;const o=d0(c??u.body);return new Request(u,{duplex:"half",body:Ph(u.body,o,r)})},_l=u=>u!==null&&typeof u=="object",Ou=(...u)=>{for(const r of u)if((!_l(r)||Array.isArray(r))&&r!==void 0)throw new TypeError("The `options` argument must be an object");return Vc({},...u)},ep=(u={},r={})=>{const c=new globalThis.Headers(u),o=r instanceof globalThis.Headers,f=new globalThis.Headers(r);for(const[m,p]of f.entries())o&&p==="undefined"||p===void 0?c.delete(m):c.set(m,p);return c};function Cu(u,r,c){return Object.hasOwn(r,c)&&r[c]===void 0?[]:Vc(u[c]??[],r[c]??[])}const tp=(u={},r={})=>({beforeRequest:Cu(u,r,"beforeRequest"),beforeRetry:Cu(u,r,"beforeRetry"),afterResponse:Cu(u,r,"afterResponse"),beforeError:Cu(u,r,"beforeError")}),p0=(u,r)=>{const c=new URLSearchParams;for(const o of[u,r])if(o!==void 0)if(o instanceof URLSearchParams)for(const[f,m]of o.entries())c.append(f,m);else if(Array.isArray(o))for(const f of o){if(!Array.isArray(f)||f.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");c.append(String(f[0]),String(f[1]))}else if(_l(o))for(const[f,m]of Object.entries(o))m!==void 0&&c.append(f,String(m));else{const f=new URLSearchParams(o);for(const[m,p]of f.entries())c.append(m,p)}return c},Vc=(...u)=>{let r={},c={},o={},f;const m=[];for(const p of u)if(Array.isArray(p))Array.isArray(r)||(r=[]),r=[...r,...p];else if(_l(p)){for(let[T,g]of Object.entries(p)){if(T==="signal"&&g instanceof globalThis.AbortSignal){m.push(g);continue}if(T==="context"){if(g!=null&&(!_l(g)||Array.isArray(g)))throw new TypeError("The `context` option must be an object");r={...r,context:g==null?{}:{...r.context,...g}};continue}if(T==="searchParams"){g==null?f=void 0:f=f===void 0?g:p0(f,g);continue}_l(g)&&T in r&&(g=Vc(r[T],g)),r={...r,[T]:g}}_l(p.hooks)&&(o=tp(o,p.hooks),r.hooks=o),_l(p.headers)&&(c=ep(c,p.headers),r.headers=c)}return f!==void 0&&(r.searchParams=f),m.length>0&&(m.length===1?r.signal=m[0]:$h?r.signal=AbortSignal.any(m):r.signal=m.at(-1)),r},_0=u=>Wh.includes(u)?u.toUpperCase():u,y0=["get","put","head","delete","options","trace"],g0=[408,413,429,500,502,503,504],v0=[413,429,503],gh={limit:2,methods:y0,statusCodes:g0,afterStatusCodes:v0,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:u=>.3*2**(u-1)*1e3,jitter:void 0,retryOnTimeout:!1},b0=(u={})=>{if(typeof u=="number")return{...gh,limit:u};if(u.methods&&!Array.isArray(u.methods))throw new Error("retry.methods must be an array");if(u.methods&&(u.methods=u.methods.map(c=>c.toLowerCase())),u.statusCodes&&!Array.isArray(u.statusCodes))throw new Error("retry.statusCodes must be an array");const r=Object.fromEntries(Object.entries(u).filter(([,c])=>c!==void 0));return{...gh,...r}};class Oc extends Error{constructor(c){super(`Request timed out: ${c.method} ${c.url}`);wt(this,"request");this.name="TimeoutError",this.request=c}}async function x0(u,r,c,o){return new Promise((f,m)=>{const p=setTimeout(()=>{c&&c.abort(),m(new Oc(u))},o.timeout);o.fetch(u,r).then(f).catch(m).then(()=>{clearTimeout(p)})})}async function S0(u,{signal:r}){return new Promise((c,o)=>{r&&(r.throwIfAborted(),r.addEventListener("abort",f,{once:!0}));function f(){clearTimeout(m),o(r.reason)}const m=setTimeout(()=>{r==null||r.removeEventListener("abort",f),c()},u)})}const E0=(u,r)=>{const c={};for(const o in r)Object.hasOwn(r,o)&&!(o in f0)&&!(o in c0)&&(!(o in u)||o in s0)&&(c[o]=r[o]);return c},T0=u=>u===void 0?!1:Array.isArray(u)?u.length>0:u instanceof URLSearchParams?u.size>0:typeof u=="object"?Object.keys(u).length>0:typeof u=="string"?u.trim().length>0:!!u;function k0(u){return u instanceof Ac||(u==null?void 0:u.name)===Ac.name}function w0(u){return u instanceof Oc||(u==null?void 0:u.name)===Oc.name}var Vu,ap,Zt,Lt,nt,Q,Ja,Pt,yl,ie,Lu,lp,Cc,Bu,Ka,Mc,np,li,Yu,Nc;const ii=class ii{constructor(r,c={}){It(this,ie);wt(this,"request");It(this,Zt);It(this,Lt,0);It(this,nt);It(this,Q);It(this,Ja);It(this,Pt);It(this,yl);var f,m,p;if(Vt(this,nt,r),Vt(this,Q,{...c,headers:ep(U(this,nt).headers,c.headers),hooks:tp({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},c.hooks),method:_0(c.method??U(this,nt).method??"GET"),prefixUrl:String(c.prefixUrl||""),retry:b0(c.retry),throwHttpErrors:c.throwHttpErrors??!0,timeout:c.timeout??1e4,fetch:c.fetch??globalThis.fetch.bind(globalThis),context:c.context??{}}),typeof U(this,nt)!="string"&&!(U(this,nt)instanceof URL||U(this,nt)instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(U(this,Q).prefixUrl&&typeof U(this,nt)=="string"){if(U(this,nt).startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");U(this,Q).prefixUrl.endsWith("/")||(U(this,Q).prefixUrl+="/"),Vt(this,nt,U(this,Q).prefixUrl+U(this,nt))}l0&&$h&&(Vt(this,Pt,U(this,Q).signal??U(this,nt).signal),Vt(this,Zt,new globalThis.AbortController),U(this,Q).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Zt).signal]):U(this,Zt).signal),yh&&(U(this,Q).duplex="half"),U(this,Q).json!==void 0&&(U(this,Q).body=((m=(f=U(this,Q)).stringifyJson)==null?void 0:m.call(f,U(this,Q).json))??JSON.stringify(U(this,Q).json),U(this,Q).headers.set("content-type",U(this,Q).headers.get("content-type")??"application/json"));const o=c.headers&&new globalThis.Headers(c.headers).has("content-type");if(U(this,nt)instanceof globalThis.Request&&(i0&&U(this,Q).body instanceof globalThis.FormData||U(this,Q).body instanceof URLSearchParams)&&!o&&U(this,Q).headers.delete("content-type"),this.request=new globalThis.Request(U(this,nt),U(this,Q)),T0(U(this,Q).searchParams)){const g="?"+(typeof U(this,Q).searchParams=="string"?U(this,Q).searchParams.replace(/^\?/,""):new URLSearchParams(ge(p=ii,Vu,ap).call(p,U(this,Q).searchParams)).toString()),h=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,g);this.request=new globalThis.Request(h,U(this,Q))}if(U(this,Q).onUploadProgress){if(typeof U(this,Q).onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!yh)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=ge(this,ie,Nc).call(this,this.request,U(this,Q).body??void 0)}}static create(r,c){var p,T,g;const o=new ii(r,c),f=async()=>{var j,S,D,V,q,H,B,L,P,F,me,fe;if(typeof U(o,Q).timeout=="number"&&U(o,Q).timeout>kc)throw new RangeError(`The \`timeout\` option cannot be greater than ${kc}`);await Promise.resolve();let h=await ge(j=o,ie,np).call(j);for(const K of U(o,Q).hooks.afterResponse){const X=ge(S=o,ie,Cc).call(S,h.clone());let ve;try{ve=await K(o.request,ge(D=o,ie,li).call(D),X,{retryCount:U(o,Lt)})}catch(Ze){throw ge(V=o,ie,Ka).call(V,X),ge(q=o,ie,Ka).call(q,h),Ze}if(ve instanceof Ih)throw ge(H=o,ie,Ka).call(H,X),ge(B=o,ie,Ka).call(B,h),new Tc(ve.options);const De=ve instanceof globalThis.Response?ve:h;X!==De&&ge(L=o,ie,Ka).call(L,X),h!==De&&ge(P=o,ie,Ka).call(P,h),h=De}if(ge(F=o,ie,Cc).call(F,h),!h.ok&&(typeof U(o,Q).throwHttpErrors=="function"?U(o,Q).throwHttpErrors(h.status):U(o,Q).throwHttpErrors)){let K=new Ac(h,o.request,ge(me=o,ie,li).call(me));for(const X of U(o,Q).hooks.beforeError)K=await X(K,{retryCount:U(o,Lt)});throw K}if(U(o,Q).onDownloadProgress){if(typeof U(o,Q).onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!n0)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const K=h.clone();return ge(fe=o,ie,Ka).call(fe,h),m0(K,U(o,Q).onDownloadProgress)}return h},m=ge(p=o,ie,Mc).call(p,f).finally(()=>{var j,S;const h=U(o,Ja);ge(j=o,ie,Bu).call(j,(h==null?void 0:h.body)??void 0),ge(S=o,ie,Bu).call(S,o.request.body??void 0)});for(const[h,j]of Object.entries(u0))h==="bytes"&&typeof((g=(T=globalThis.Response)==null?void 0:T.prototype)==null?void 0:g.bytes)!="function"||(m[h]=async()=>{o.request.headers.set("accept",o.request.headers.get("accept")||j);const S=await m;if(h==="json"){if(S.status===204)return"";const D=await S.text();return D===""?"":c.parseJson?c.parseJson(D):JSON.parse(D)}return S[h]()});return m}};Vu=new WeakSet,ap=function(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof URLSearchParams)?Object.fromEntries(Object.entries(r).filter(([,c])=>c!==void 0)):r},Zt=new WeakMap,Lt=new WeakMap,nt=new WeakMap,Q=new WeakMap,Ja=new WeakMap,Pt=new WeakMap,yl=new WeakMap,ie=new WeakSet,Lu=function(){const r=U(this,Q).retry.delay(U(this,Lt));let c=r;U(this,Q).retry.jitter===!0?c=Math.random()*r:typeof U(this,Q).retry.jitter=="function"&&(c=U(this,Q).retry.jitter(r),(!Number.isFinite(c)||c<0)&&(c=r));const o=U(this,Q).retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(o,c)},lp=async function(r){if($m(this,Lt)._++,U(this,Lt)>U(this,Q).retry.limit)throw r;const c=r instanceof Error?r:new Jh(r);if(c instanceof Tc)return c.customDelay??ge(this,ie,Lu).call(this);if(!U(this,Q).retry.methods.includes(this.request.method.toLowerCase()))throw r;if(U(this,Q).retry.shouldRetry!==void 0){const o=await U(this,Q).retry.shouldRetry({error:c,retryCount:U(this,Lt)});if(o===!1)throw r;if(o===!0)return ge(this,ie,Lu).call(this)}if(w0(r)&&!U(this,Q).retry.retryOnTimeout)throw r;if(k0(r)){if(!U(this,Q).retry.statusCodes.includes(r.response.status))throw r;const o=r.response.headers.get("Retry-After")??r.response.headers.get("RateLimit-Reset")??r.response.headers.get("X-RateLimit-Retry-After")??r.response.headers.get("X-RateLimit-Reset")??r.response.headers.get("X-Rate-Limit-Reset");if(o&&U(this,Q).retry.afterStatusCodes.includes(r.response.status)){let f=Number(o)*1e3;Number.isNaN(f)?f=Date.parse(o)-Date.now():f>=Date.parse("2024-01-01")&&(f-=Date.now());const m=U(this,Q).retry.maxRetryAfter??f;return f<m?f:m}if(r.response.status===413)throw r}return ge(this,ie,Lu).call(this)},Cc=function(r){return U(this,Q).parseJson&&(r.json=async()=>U(this,Q).parseJson(await r.text())),r},Bu=function(r){r&&r.cancel().catch(()=>{})},Ka=function(r){ge(this,ie,Bu).call(this,r.body??void 0)},Mc=async function(r){try{return await r()}catch(c){const o=Math.min(await ge(this,ie,lp).call(this,c),kc);if(U(this,Lt)<1)throw c;if(await S0(o,U(this,Pt)?{signal:U(this,Pt)}:{}),c instanceof Tc&&c.customRequest){const f=U(this,Q).signal?new globalThis.Request(c.customRequest,{signal:U(this,Q).signal}):new globalThis.Request(c.customRequest);ge(this,ie,Yu).call(this,f)}for(const f of U(this,Q).hooks.beforeRetry){const m=await f({request:this.request,options:ge(this,ie,li).call(this),error:c,retryCount:U(this,Lt)});if(m instanceof globalThis.Request){ge(this,ie,Yu).call(this,m);break}if(m instanceof globalThis.Response)return m;if(m===Fh)return}return ge(this,ie,Mc).call(this,r)}},np=async function(){var c;(c=U(this,Zt))!=null&&c.signal.aborted&&(Vt(this,Zt,new globalThis.AbortController),U(this,Q).signal=U(this,Pt)?AbortSignal.any([U(this,Pt),U(this,Zt).signal]):U(this,Zt).signal,this.request=new globalThis.Request(this.request,{signal:U(this,Q).signal}));for(const o of U(this,Q).hooks.beforeRequest){const f=await o(this.request,ge(this,ie,li).call(this),{retryCount:U(this,Lt)});if(f instanceof Response)return f;if(f instanceof globalThis.Request){ge(this,ie,Yu).call(this,f);break}}const r=E0(this.request,U(this,Q));return Vt(this,Ja,this.request),this.request=U(this,Ja).clone(),U(this,Q).timeout===!1?U(this,Q).fetch(U(this,Ja),r):x0(U(this,Ja),r,U(this,Zt),U(this,Q))},li=function(){if(!U(this,yl)){const{hooks:r,...c}=U(this,Q);Vt(this,yl,Object.freeze(c))}return U(this,yl)},Yu=function(r){Vt(this,yl,void 0),this.request=ge(this,ie,Nc).call(this,r)},Nc=function(r,c){return!U(this,Q).onUploadProgress||!r.body?r:h0(r,U(this,Q).onUploadProgress,c??U(this,Q).body??void 0)},It(ii,Vu);let Qu=ii;/*! MIT License © Sindre Sorhus */const Dc=u=>{const r=(c,o)=>Qu.create(c,Ou(u,o));for(const c of Wh)r[c]=(o,f)=>Qu.create(o,Ou(u,f,{method:c}));return r.create=c=>Dc(Ou(c)),r.extend=c=>(typeof c=="function"&&(c=c(u??{})),Dc(Ou(u,c))),r.stop=Fh,r.retry=o0,r},vh=Dc();let wc=!1,Rc=null;const Gu=vh.create({prefixUrl:"/api",timeout:3e4,hooks:{beforeRequest:[u=>{const r=$a.getState().accessToken;r&&u.headers.set("Authorization",`Bearer ${r}`)}],afterResponse:[async(u,r,c)=>{if(c.status===401){wc||(wc=!0,Rc=$a.getState().refresh().finally(()=>{wc=!1,setTimeout(()=>{Rc=null},0)}));try{await Rc}catch{throw c}const o=$a.getState().accessToken;return o&&u.headers.set("Authorization",`Bearer ${o}`),vh(u,r)}}]}}),R0=3e4;function j0(u){if(u.link)return u.link;const r=(u.title+" "+u.body).match(/task\s*#?(\d+)/i);if(r)return`/tasks/${r[1]}`;const c=(u.title+" "+u.body).match(/machine\s+(\S+)/i);return c?`/machines/${c[1]}`:null}function ip(){const u=gl(),[r,c]=x.useState([]),[o,f]=x.useState(0),[m,p]=x.useState(!1),[T,g]=x.useState(!1),h=x.useRef(null),{t:j}=ta(),S=x.useCallback(async()=>{try{g(!0);const q=await Gu.get("web/notifications",{searchParams:{limit:"20"}}).json();c(q.data),f(q.data.filter(H=>!H.isRead).length)}catch{}finally{g(!1)}},[]);x.useEffect(()=>{S();const q=setInterval(S,R0);return()=>clearInterval(q)},[S]),x.useEffect(()=>{function q(H){h.current&&!h.current.contains(H.target)&&p(!1)}return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[]);const D=async q=>{try{await Gu.post(`web/notifications/${q}/read`),c(H=>H.map(B=>B.id===q?{...B,isRead:!0}:B)),f(H=>Math.max(0,H-1))}catch{}},V=async()=>{try{await Gu.post("web/notifications/read-all"),c(q=>q.map(H=>({...H,isRead:!0}))),f(0)}catch{}};return _.jsxs("div",{className:"relative",ref:h,children:[_.jsxs("button",{type:"button",onClick:()=>p(q=>!q),"aria-label":j("common.notifications"),className:"relative inline-flex items-center justify-center rounded-[4px] p-2 text-[var(--text-secondary)] transition-colors hover:bg-[var(--border)] hover:text-[var(--text-primary)]",children:[_.jsx(jv,{size:16}),o>0&&_.jsx("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-[var(--destructive)] px-1 text-[10px] font-bold text-white",children:o})]}),m&&_.jsxs("div",{className:"absolute right-0 top-full z-50 mt-2 w-80 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",children:[_.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm font-semibold",children:j("common.notifications")}),o>0&&_.jsxs("button",{type:"button",onClick:V,className:"inline-flex items-center gap-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(zv,{className:"h-3.5 w-3.5"}),j("common.mark_all_read")]})]}),_.jsx("div",{className:"max-h-80 overflow-y-auto",children:T&&r.length===0?_.jsx("div",{className:"flex justify-center py-8",children:_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r.length===0?_.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[_.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),_.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:j("common.no_notifications")})]}):r.map(q=>{const H=j0(q);return _.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 transition-colors ${H?"cursor-pointer hover:bg-[var(--bg-input)]":""} ${q.isRead?"opacity-60":"bg-[var(--accent)]/5"}`,onClick:()=>{H&&(q.isRead||D(q.id),p(!1),u(H))},children:[_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"text-sm font-medium",children:q.title}),_.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:q.body}),_.jsx("p",{className:"mt-1 text-xs text-[var(--text-secondary)] opacity-60",children:new Date(q.createdAt).toLocaleString()})]}),!q.isRead&&_.jsx("button",{type:"button",onClick:B=>{B.stopPropagation(),D(q.id)},"aria-label":j("common.mark_as_read"),className:"shrink-0 rounded-[4px] p-1 text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:_.jsx(Av,{className:"h-3.5 w-3.5"})})]},q.id)})})]})]})}function z0(u){return{tasks:u.tasks.map(r=>({type:"task",id:r.id,title:`#${r.id} ${r.description}`,subtitle:`${r.status} · ${r.project_key}`})),machines:u.machines.map(r=>({type:"machine",id:r.id,title:r.name,subtitle:`${r.hostname} · ${r.status}`})),projects:u.projects.map(r=>({type:"project",id:r.key,title:r.name,subtitle:r.repository}))}}const A0=300,bh={tasks:Vv,machines:Qc,projects:Nv},O0={tasks:"tasks",machines:"machines",projects:"projects"};function C0(){const[u,r]=x.useState(""),[c,o]=x.useState({tasks:[],machines:[],projects:[]}),[f,m]=x.useState(!1),[p,T]=x.useState(!1),[g,h]=x.useState(0),j=x.useRef(null),S=x.useRef(null),D=x.useRef(void 0),V=gl(),{t:q}=ta(),H=[...c.tasks,...c.machines,...c.projects],B=x.useCallback(async K=>{if(!K.trim()){o({tasks:[],machines:[],projects:[]});return}try{m(!0);const X=await Gu.get("web/search",{searchParams:{q:K}}).json();o(z0(X)),h(0)}catch{}finally{m(!1)}},[]);x.useEffect(()=>(D.current&&clearTimeout(D.current),D.current=setTimeout(()=>B(u),A0),()=>{D.current&&clearTimeout(D.current)}),[u,B]),x.useEffect(()=>{function K(X){X.key==="/"&&!p&&!(X.target instanceof HTMLInputElement||X.target instanceof HTMLTextAreaElement)&&(X.preventDefault(),T(!0)),X.key==="Escape"&&p&&(X.preventDefault(),L())}return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[p]),x.useEffect(()=>{p&&setTimeout(()=>{var K;return(K=S.current)==null?void 0:K.focus()},50)},[p]);const L=()=>{T(!1),r(""),o({tasks:[],machines:[],projects:[]}),h(0)},P=K=>{switch(L(),K.type){case"task":V(`/tasks/${K.id}`);break;case"machine":V(`/machines/${K.id}`);break;case"project":V(`/projects/${K.id}`);break}},F=K=>{K.key==="ArrowDown"?(K.preventDefault(),h(X=>Math.min(X+1,H.length-1))):K.key==="ArrowUp"?(K.preventDefault(),h(X=>Math.max(X-1,0))):K.key==="Enter"&&H[g]&&(K.preventDefault(),P(H[g]))},me=H.length>0;let fe=0;return _.jsxs(_.Fragment,{children:[_.jsxs("button",{type:"button",onClick:()=>T(!0),className:"flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)]",children:[_.jsx(Gv,{className:"h-3.5 w-3.5"}),_.jsx("span",{children:q("common.search_placeholder")}),_.jsx("kbd",{className:"ml-2 rounded border border-[var(--border)] bg-[var(--bg-primary)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:"/"})]}),p&&_.jsx("div",{ref:j,className:"fixed inset-0 z-[100] flex items-start justify-center pt-[15vh]",style:{backgroundColor:"rgba(0, 0, 0, 0.6)"},onClick:K=>{K.target===j.current&&L()},children:_.jsxs("div",{className:"w-full max-w-[640px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-2xl",style:{fontFamily:"'JetBrains Mono', monospace"},children:[_.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3",children:[_.jsx("span",{className:"text-sm text-[var(--accent)]",children:"/"}),_.jsx("input",{ref:S,type:"text",placeholder:q("common.search_input_placeholder"),value:u,onChange:K=>r(K.target.value),onKeyDown:F,className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none"}),f&&_.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})]}),_.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:u.trim()&&!me&&!f?_.jsx("div",{className:"py-10 text-center text-xs text-[var(--text-muted)]",children:q("common.no_search_results",{query:u})}):Object.keys(bh).map(K=>{const X=c[K];if(X.length===0)return null;const ve=bh[K],De=fe;return fe+=X.length,_.jsxs("div",{children:[_.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-[var(--text-muted)]",children:[_.jsx(ve,{className:"h-3 w-3"}),_.jsx("span",{className:"text-[10px] uppercase tracking-wider",children:O0[K]})]}),X.map((Ze,rt)=>{const Ke=De+rt,ot=Ke===g;return _.jsxs("button",{type:"button",className:`flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors ${ot?"bg-[var(--accent)]/10 text-[var(--accent)]":"hover:bg-[var(--bg-input)]"}`,onClick:()=>P(Ze),onMouseEnter:()=>h(Ke),children:[_.jsx("span",{className:`text-xs ${ot?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:ot?">":" "}),_.jsxs("div",{className:"min-w-0 flex-1",children:[_.jsx("p",{className:"truncate text-sm",children:Ze.title}),Ze.subtitle&&_.jsx("p",{className:"truncate text-xs text-[var(--text-muted)]",children:Ze.subtitle})]})]},`${Ze.type}-${Ze.id}`)})]},K)})}),_.jsxs("div",{className:"flex items-center gap-4 border-t border-[var(--border)] px-4 py-2",children:[_.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"↑↓"})," ",q("common.navigate_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"↵"})," ",q("common.select_hint")]}),_.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-[var(--text-muted)]",children:[_.jsx("kbd",{className:"rounded border border-[var(--border)] px-1",children:"esc"})," ",q("common.close_hint")]})]})]})})]})}const M0={danger:"var(--destructive)",warning:"var(--warning)",accent:"var(--accent)"};function N0({isOpen:u,onClose:r,onConfirm:c,title:o,message:f,confirmVariant:m="danger",isLoading:p,...T}){const{t:g}=ta(),h=T.confirmLabel??g("common.confirm"),j=T.cancelLabel??g("common.cancel");if(!u)return null;const S=M0[m];return _.jsx("div",{onClick:r,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:_.jsxs("div",{onClick:D=>D.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:[_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[_.jsx(Xh,{style:{width:"1rem",height:"1rem"}}),o]})}),_.jsx("div",{style:{marginBottom:"1.25rem"},children:_.jsx("p",{style:{color:"var(--text-muted)",fontSize:"0.75rem",lineHeight:"1.5"},children:f})}),_.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[_.jsx("button",{type:"button",onClick:r,disabled:p,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,transition:"color 0.15s, border-color 0.15s"},children:j}),_.jsx("button",{type:"button",onClick:c,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:S,color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:p?"not-allowed":"pointer",opacity:p?.7:1},children:p?g("common.processing"):h})]})]})})}const up=x.createContext({setActions:()=>{}});function Ab(u){const{setActions:r}=x.useContext(up);x.useEffect(()=>(r(u),()=>r(null)),[u,r])}const rp=x.createContext({setSubtitle:()=>{}});function Ob(u){const{setSubtitle:r}=x.useContext(rp);x.useEffect(()=>(r(u),()=>r(null)),[u,r])}const D0=[{to:"/home",label:"dashboard",icon:Yh},{to:"/tasks",label:"tasks",icon:Gh},{to:"/machines",label:"machines",icon:Qc},{to:"/projects",label:"projects",icon:Dv},{to:"/access-tokens",label:"access_tokens",icon:qv}],U0=[{to:"/docs/cli",label:"cli",icon:Kv},{to:"/docs/api",label:"api",icon:Mv},{to:"/docs/skill",label:"skill",icon:Qv}],q0=[{to:"/admin",label:"admin",icon:Xv}],H0=[{to:"/home",label:"dashboard",icon:Yh},{to:"/tasks",label:"tasks",icon:Gh},{to:"/machines",label:"machines",icon:Qc},{to:"/profile",label:"profile",icon:Jv}],Mu={"/home":{title:"common.breadcrumb_dashboard",subtitle:"common.breadcrumb_dashboard_sub"},"/tasks":{title:"common.breadcrumb_tasks",subtitle:"common.breadcrumb_tasks_sub"},"/machines":{title:"common.breadcrumb_machines",subtitle:"common.breadcrumb_machines_sub"},"/projects":{title:"common.breadcrumb_projects",subtitle:"common.breadcrumb_projects_sub"},"/admin":{title:"common.breadcrumb_admin",subtitle:"common.breadcrumb_admin_sub"},"/profile":{title:"common.breadcrumb_profile",subtitle:"common.breadcrumb_profile_sub"},"/access-tokens":{title:"common.breadcrumb_access_tokens",subtitle:"common.breadcrumb_access_tokens_sub"},"/docs":{title:"common.breadcrumb_docs",subtitle:"common.breadcrumb_docs_sub"},"/docs/cli":{title:"common.breadcrumb_docs_cli",subtitle:"common.breadcrumb_docs_cli_sub"},"/docs/api":{title:"common.breadcrumb_docs_api",subtitle:"common.breadcrumb_docs_api_sub"},"/docs/skill":{title:"common.breadcrumb_docs_skill",subtitle:"common.breadcrumb_docs_skill_sub"}};function L0(u){const{t:r}=ta();if(Mu[u]){const o=Mu[u];return{title:r(o.title),subtitle:r(o.subtitle)}}const c="/"+u.split("/").filter(Boolean)[0];if(Mu[c]){const o=Mu[c],f=u.split("/").filter(Boolean).slice(1).join(" / ");return{title:r(o.title),subtitle:f||r(o.subtitle)}}return{title:u.slice(1).replace(/\//g," // ")||"home"}}function B0(u,r){return u==="/home"?r==="/home":r.startsWith(u)}function Y0(){const u=Yt(),{t:r}=ta();return _.jsx("nav",{className:"flex items-center justify-around border-t border-[var(--border)] bg-[var(--bg-card)] md:hidden",style:{height:60,paddingTop:8,paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:H0.map(({to:c,label:o,icon:f})=>{const m=B0(c,u.pathname);return _.jsxs(ni,{to:c,className:"flex flex-col items-center gap-1",style:{width:70},children:[_.jsx(f,{size:18,className:m?"text-[var(--accent)]":"text-[var(--text-muted)]"}),_.jsx("span",{className:`text-[8px] lowercase ${m?"font-bold text-[var(--accent)]":"text-[var(--text-muted)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:{dashboard:r("dashboard.title"),tasks:r("tasks.title"),machines:r("machines.title"),profile:r("common.profile")}[o]??o})]},c)})})}function G0(){const u=gl(),{t:r}=ta();return _.jsxs("header",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:hidden",style:{height:56,minHeight:56},children:[_.jsxs("button",{onClick:()=>u("/home"),className:"flex items-center gap-2",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:_.jsx("span",{className:"text-sm font-semibold",style:{color:"#0C0C0C"},children:"~"})}),_.jsx("span",{className:"text-sm font-bold lowercase text-[var(--text-primary)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:r("common.overlord")})]}),_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(ip,{}),_.jsx(Kh,{})]})]})}function X0(){const{user:u,logout:r}=$a(),c=gl(),[o,f]=x.useState(!1),m=(u==null?void 0:u.role)==="admin",{t:p}=ta(),T=()=>{r(),c("/login")};return _.jsxs("aside",{className:"hidden md:flex flex-col border-r border-[var(--border)]",style:{width:240,minWidth:240,backgroundColor:"var(--bg-card)"},children:[_.jsx("div",{className:"flex items-center px-5",style:{height:48},children:_.jsxs("button",{onClick:()=>c("/home"),className:"flex items-center gap-2.5",style:{background:"none",border:"none",padding:0},children:[_.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-[4px] bg-[var(--accent)]",style:{fontFamily:"'JetBrains Mono', monospace"},children:_.jsx("span",{className:"text-lg font-semibold",style:{color:"#0C0C0C"},children:"~"})}),_.jsx("span",{className:"text-base font-bold lowercase tracking-tight",style:{color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:p("common.overlord")})]})}),_.jsxs("nav",{className:"flex-1 px-3 pt-2",children:[_.jsx("div",{className:"mb-2 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.navigation")}),D0.map(({to:g,label:h,icon:j})=>_.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>_.jsxs(_.Fragment,{children:[_.jsx(j,{size:14,style:{flexShrink:0}}),_.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g)),_.jsx("div",{className:"mb-2 mt-4 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.docs_section")}),U0.map(({to:g,label:h,icon:j})=>_.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>_.jsxs(_.Fragment,{children:[_.jsx(j,{size:14,style:{flexShrink:0}}),_.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g)),m&&_.jsxs(_.Fragment,{children:[_.jsx("div",{className:"mb-2 mt-4 px-3 text-xs lowercase",style:{color:"var(--text-muted)"},children:p("common.admin_section")}),q0.map(({to:g,label:h,icon:j})=>_.jsx(ni,{to:g,className:({isActive:S})=>`flex items-center gap-2.5 px-3 py-1.5 text-sm lowercase transition-colors ${S?"text-[var(--accent)] bg-[var(--accent)]/5":"text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,style:{fontFamily:"'JetBrains Mono', monospace"},children:({isActive:S})=>_.jsxs(_.Fragment,{children:[_.jsx(j,{size:14,style:{flexShrink:0}}),_.jsx("span",{children:S?`> ${h}`:` ${h}`})]})},g))]})]}),_.jsx("div",{className:"border-t border-[var(--border)] p-3",children:_.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[_.jsx("button",{onClick:()=>c("/profile"),className:"flex h-7 w-7 items-center justify-center text-xs font-bold text-black transition-opacity hover:opacity-80",style:{backgroundColor:"var(--accent)",borderRadius:4,flexShrink:0},title:p("common.profile"),children:((u==null?void 0:u.username)??"u")[0].toUpperCase()}),_.jsxs("button",{onClick:()=>c("/profile"),className:"min-w-0 flex-1 text-left transition-colors hover:opacity-80",title:p("common.profile"),children:[_.jsx("div",{className:"truncate text-sm lowercase",style:{color:"var(--text-primary)"},children:(u==null?void 0:u.username)??"user"}),_.jsx("div",{className:"truncate text-xs lowercase",style:{color:"var(--text-muted)"},children:(u==null?void 0:u.role)??"user"})]}),_.jsx("button",{onClick:()=>f(!0),className:"p-1 text-[var(--text-secondary)] transition-colors hover:text-[var(--accent)]","aria-label":p("common.log_out"),children:_.jsx(Lv,{size:14})})]})}),_.jsx(N0,{isOpen:o,onClose:()=>f(!1),onConfirm:T,title:p("common.logout_title"),message:p("common.logout_message"),confirmLabel:p("common.logout"),confirmVariant:"warning"})]})}function Q0({headerActions:u,subtitleOverride:r}){const c=Yt(),{title:o,subtitle:f}=L0(c.pathname),m=r??f;return _.jsxs("header",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5",style:{height:48,minHeight:48,backgroundColor:"var(--bg-card)"},children:[_.jsxs("div",{className:"text-sm lowercase",style:{fontFamily:"'JetBrains Mono', monospace"},children:[_.jsx("span",{style:{color:"var(--text-primary)"},children:o}),m&&_.jsxs("span",{style:{color:"var(--text-muted)"},children:[" ","// ",m]})]}),_.jsxs("div",{className:"flex items-center gap-3",children:[u,_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(C0,{}),_.jsx(ip,{}),_.jsx(Kh,{})]})]})]})}function V0(){const[u,r]=x.useState(null),[c,o]=x.useState(null);return _.jsxs("div",{className:"flex h-screen font-mono",children:[_.jsx(X0,{}),_.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[_.jsx(G0,{}),_.jsx(Q0,{headerActions:u,subtitleOverride:c}),_.jsx("main",{className:"flex-1 overflow-auto bg-[var(--bg-primary)] p-4 md:p-6",children:_.jsx(up.Provider,{value:{setActions:r},children:_.jsx(rp.Provider,{value:{setSubtitle:o},children:_.jsx(Qg,{})})})}),_.jsx(Y0,{})]})]})}function Nu({children:u,requireAdmin:r=!1}){const{accessToken:c,user:o,requireTotpSetup:f,initializing:m}=$a(),p=Yt();return m?_.jsx("div",{className:"flex h-screen items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})}):c?f?p.pathname!=="/totp-setup"?_.jsx(Du,{to:"/totp-setup",replace:!0}):_.jsx(_.Fragment,{children:u}):r&&(o==null?void 0:o.role)!=="admin"?_.jsx(Du,{to:"/home",replace:!0}):_.jsx(_.Fragment,{children:u}):_.jsx(Du,{to:"/login",state:{from:p},replace:!0})}function Z0({children:u}){const{theme:r,resolved:c,setResolved:o}=Zh();return x.useEffect(()=>{if(r!=="system"){o(r);return}const f=window.matchMedia("(prefers-color-scheme: dark)");o(f.matches?"dark":"light");const m=p=>o(p.matches?"dark":"light");return f.addEventListener("change",m),()=>f.removeEventListener("change",m)},[r,o]),x.useEffect(()=>{document.documentElement.classList.toggle("dark",c==="dark")},[c]),_.jsx(_.Fragment,{children:u})}class K0 extends x.Component{constructor(r){super(r),this.state={hasError:!1,error:null}}static getDerivedStateFromError(r){return{hasError:!0,error:r}}render(){var r;return this.state.hasError?_.jsxs("div",{className:"flex h-full min-h-[300px] flex-col items-center justify-center gap-4 p-8",children:[_.jsx("span",{className:"text-lg font-bold text-[var(--destructive)]",children:Hu("common.runtime_error")}),_.jsx("p",{className:"max-w-md text-center text-xs text-[var(--text-muted)]",children:((r=this.state.error)==null?void 0:r.message)||Hu("common.an_unexpected_error_occurred")}),_.jsxs("button",{onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[_.jsx(Yv,{className:"h-3.5 w-3.5"}),Hu("common.reload")]})]}):this.props.children}}function J0({isOpen:u}){const r=gl(),{logout:c,setSessionExpired:o}=$a(),{t:f}=ta();function m(){c(),o(!1),r("/login")}return u?_.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[_.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),_.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:_.jsxs("div",{className:"flex flex-col items-center px-8 py-10",children:[_.jsx("div",{className:"mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--warning)]/10",children:_.jsx(Hv,{className:"h-7 w-7 text-[var(--warning)]"})}),_.jsx("h3",{className:"mb-2 text-base font-bold text-[var(--text-primary)]",children:f("auth.session_expired")}),_.jsx("p",{className:"mb-8 text-center text-xs text-[var(--text-secondary)]",children:f("auth.session_expired_message")}),_.jsx("button",{type:"button",className:"w-full rounded-[4px] bg-[var(--accent)] px-3 py-2.5 text-xs font-medium text-black hover:opacity-90 transition-opacity",onClick:m,children:f("auth.go_to_login")})]})})]}):null}const xh=5;let ba=[];const Uc=new Set;function op(){Uc.forEach(u=>u())}function $0(){return`${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Wa(u,r,c=4e3){const o=$0();return ba=[...ba,{id:o,variant:u,message:r,duration:c}],ba.length>xh&&(ba=ba.slice(ba.length-xh)),op(),o}Wa.success=(u,r)=>Wa("success",u,r);Wa.error=(u,r)=>Wa("error",u,r);Wa.warning=(u,r)=>Wa("warning",u,r);Wa.info=(u,r)=>Wa("info",u,r);function W0(u){ba=ba.filter(r=>r.id!==u),op()}function F0(){const[,u]=x.useState(0);return x.useEffect(()=>{const r=()=>u(c=>c+1);return Uc.add(r),()=>{Uc.delete(r)}},[]),ba}const I0={success:{icon:Ov,borderColor:"var(--accent)"},error:{icon:Cv,borderColor:"var(--destructive)"},warning:{icon:Xh,borderColor:"var(--warning)"},info:{icon:Uv,borderColor:"var(--info)"}};function P0({item:u}){const r=I0[u.variant],c=r.icon,{t:o}=ta(),f=x.useCallback(()=>W0(u.id),[u.id]);return x.useEffect(()=>{if(!u.duration)return;const m=setTimeout(f,u.duration);return()=>clearTimeout(m)},[u.duration,f]),_.jsxs("div",{className:"flex items-center gap-3 rounded-[4px] bg-[var(--bg-card)] px-4 py-3 shadow-lg",style:{borderLeft:`3px solid ${r.borderColor}`},role:"alert",children:[_.jsx(c,{className:"h-4 w-4 shrink-0",style:{color:r.borderColor}}),_.jsx("p",{className:"flex-1 text-xs text-[var(--text-primary)]",children:u.message}),_.jsx("button",{onClick:f,className:"shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]","aria-label":o("common.dismiss_notification"),children:_.jsx($v,{className:"h-3.5 w-3.5"})})]})}function eb(){const u=F0();return u.length===0?null:_.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-[9999] flex w-80 max-w-[calc(100vw-2rem)] flex-col gap-2",children:u.map(r=>_.jsx("div",{className:"pointer-events-auto",children:_.jsx(P0,{item:r})},r.id))})}const tb=x.lazy(()=>Ce(()=>import("./LandingPage-COmKh2PR.js"),__vite__mapDeps([0,1,2,3,4]))),ab=x.lazy(()=>Ce(()=>import("./LoginPage-DFIy5_AG.js"),[])),lb=x.lazy(()=>Ce(()=>import("./TotpSetupPage-C3IixO0t.js"),[])),nb=x.lazy(()=>Ce(()=>import("./NotFoundPage-BqLQpkaf.js"),[])),ib=x.lazy(()=>Ce(()=>import("./HomePage-BSubk1iR.js"),__vite__mapDeps([5,6,7,8,9,1]))),ub=x.lazy(()=>Ce(()=>import("./TaskListPage-D_tZ75c7.js"),__vite__mapDeps([10,11,7,12,4,13,8,14]))),rb=x.lazy(()=>Ce(()=>import("./TaskDetailPage-CgT_txYn.js"),__vite__mapDeps([15,11,12,16,17,18,19,20]))),ob=x.lazy(()=>Ce(()=>import("./MachineListPage-CIqrEM7O.js"),__vite__mapDeps([21,6,22,23,24,4,19,12,13,8,14]))),cb=x.lazy(()=>Ce(()=>import("./MachineDetailPage-BLOhWYiw.js"),__vite__mapDeps([25,6,26,16]))),sb=x.lazy(()=>Ce(()=>import("./WorkerSetupGuidePage-CuXz1Cp5.js"),__vite__mapDeps([22,23,24]))),fb=x.lazy(()=>Ce(()=>import("./ProjectListPage-Dwcp60o1.js"),__vite__mapDeps([27,6,12,13,8,14]))),db=x.lazy(()=>Ce(()=>import("./ProjectDetailPage-8DxQkhBt.js"),__vite__mapDeps([28,6,29,12,30,26,14]))),mb=x.lazy(()=>Ce(()=>import("./EditProjectPage-Bl2LyAeT.js"),__vite__mapDeps([31,6,12,29,14]))),hb=x.lazy(()=>Ce(()=>import("./PipelineEditorPage-CyOhoLwR.js"),__vite__mapDeps([32,12]))),pb=x.lazy(()=>Ce(()=>import("./ProfilePage-D8UfMNDf.js"),[])),_b=x.lazy(()=>Ce(()=>import("./AccessTokensPage-DuICKFJy.js"),__vite__mapDeps([33,12,13,8,14,4,26]))),yb=x.lazy(()=>Ce(()=>import("./CliReferencePage-DVB7E2Jv.js"),__vite__mapDeps([34,35,4,14]))),gb=x.lazy(()=>Ce(()=>import("./ApiReferencePage-DZDCJQI4.js"),__vite__mapDeps([36,35,4,14]))),vb=x.lazy(()=>Ce(()=>import("./SkillPage-CtZTtfF8.js"),__vite__mapDeps([37,18,4]))),bb=x.lazy(()=>Ce(()=>import("./AdminPage-B8Yq8GnM.js"),__vite__mapDeps([38,3,2,39,24]))),xb=x.lazy(()=>Ce(()=>import("./DeveloperManage-BtO-lkvD.js"),__vite__mapDeps([40,12,13,8,14,3,30,17]))),Sb=x.lazy(()=>Ce(()=>import("./BotManage-CVWwoYy3.js"),__vite__mapDeps([41,12,26,14,13,8,2,30]))),Eb=x.lazy(()=>Ce(()=>import("./TokenManage-DWk-4hAE.js"),__vite__mapDeps([42,23,4,18,13,8,14]))),Tb=x.lazy(()=>Ce(()=>import("./AuditLogPage-MoCRMzqP.js"),__vite__mapDeps([43,12,13,8,39,9]))),kb=x.lazy(()=>Ce(()=>import("./SettingsPage-DDsctH7X.js"),[]));function wb(){return _.jsx("div",{className:"flex h-full items-center justify-center",children:_.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-[var(--border)] border-t-[var(--accent)]"})})}function Rb(){const u=$a(r=>r.sessionExpired);return _.jsxs(Z0,{children:[_.jsx(eb,{}),_.jsx(K0,{children:_.jsxs(_v,{children:[_.jsx(J0,{isOpen:u}),_.jsx(x.Suspense,{fallback:_.jsx(wb,{}),children:_.jsxs(Zg,{children:[_.jsx(we,{path:"/",element:_.jsx(tb,{})}),_.jsx(we,{path:"/login",element:_.jsx(ab,{})}),_.jsx(we,{path:"/totp-setup",element:_.jsx(Nu,{children:_.jsx(lb,{})})}),_.jsxs(we,{element:_.jsx(Nu,{children:_.jsx(V0,{})}),children:[_.jsx(we,{path:"/home",element:_.jsx(ib,{})}),_.jsx(we,{path:"/tasks",element:_.jsx(ub,{})}),_.jsx(we,{path:"/tasks/:id",element:_.jsx(rb,{})}),_.jsx(we,{path:"/machines",element:_.jsx(ob,{})}),_.jsx(we,{path:"/machines/setup",element:_.jsx(Nu,{requireAdmin:!0,children:_.jsx(sb,{})})}),_.jsx(we,{path:"/machines/:id",element:_.jsx(cb,{})}),_.jsx(we,{path:"/projects",element:_.jsx(fb,{})}),_.jsx(we,{path:"/projects/:key",element:_.jsx(db,{})}),_.jsx(we,{path:"/projects/:key/edit",element:_.jsx(mb,{})}),_.jsx(we,{path:"/projects/:key/pipeline",element:_.jsx(hb,{})}),_.jsx(we,{path:"/profile",element:_.jsx(pb,{})}),_.jsx(we,{path:"/access-tokens",element:_.jsx(_b,{})}),_.jsx(we,{path:"/docs/cli",element:_.jsx(yb,{})}),_.jsx(we,{path:"/docs/api",element:_.jsx(gb,{})}),_.jsx(we,{path:"/docs/skill",element:_.jsx(vb,{})}),_.jsxs(we,{path:"/admin",element:_.jsx(Nu,{requireAdmin:!0,children:_.jsx(bb,{})}),children:[_.jsx(we,{index:!0,element:_.jsx(Du,{to:"developers",replace:!0})}),_.jsx(we,{path:"developers",element:_.jsx(xb,{})}),_.jsx(we,{path:"bots",element:_.jsx(Sb,{})}),_.jsx(we,{path:"tokens",element:_.jsx(Eb,{})}),_.jsx(we,{path:"audit-logs",element:_.jsx(Tb,{})}),_.jsx(we,{path:"settings",element:_.jsx(kb,{})})]})]}),_.jsx(we,{path:"*",element:_.jsx(nb,{})})]})})]})})]})}$a.getState().initialize();Qy.createRoot(document.getElementById("root")).render(_.jsx(x.StrictMode,{children:_.jsx(Rb,{})}));export{Av as C,Ac as H,qv as K,Hh as L,Du as N,Qg as O,Ru as R,Xv as S,Kh as T,$v as X,ta as a,Kv as b,ze as c,gl as d,Yt as e,Gu as f,Hu as g,Ab as h,Gv as i,_ as j,Gh as k,N0 as l,zb as m,Ob as n,Ov as o,Qh as p,Qc as q,x as r,Xh as s,Wa as t,$a as u,Yv as v,ni as w,Cv as x};
|