@overlordai/server 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/common/error-filter.d.ts.map +1 -1
  2. package/dist/common/error-filter.js +16 -0
  3. package/dist/common/error-filter.js.map +1 -1
  4. package/dist/main.js +3 -2
  5. package/dist/main.js.map +1 -1
  6. package/package.json +4 -3
  7. package/public/assets/AccessTokensPage-BNaz9M2D.js +1 -0
  8. package/public/assets/AdminPage-BK3yXUTo.js +1 -0
  9. package/public/assets/ApiReferencePage-B5840y13.js +1 -0
  10. package/public/assets/AuditLogPage-CTyPeBTm.js +11 -0
  11. package/public/assets/BotManage-CfcannzE.js +6 -0
  12. package/public/assets/CliReferencePage-BkFni7kH.js +4 -0
  13. package/public/assets/DeveloperManage-qek3ScKE.js +16 -0
  14. package/public/assets/EditProjectPage-BJ1h9Teb.js +2 -0
  15. package/public/assets/EmptyState-BPAoLpts.js +6 -0
  16. package/public/assets/HomePage-BolSOHNk.js +1 -0
  17. package/public/assets/LandingPage-Bd51R0zG.js +26 -0
  18. package/public/assets/LoginPage-pvTUbSIt.js +1 -0
  19. package/public/assets/MachineDetailPage-BH-KZK-O.js +1 -0
  20. package/public/assets/MachineListPage-DKuE_lOr.js +6 -0
  21. package/public/assets/NotFoundPage-CEkbHGWM.js +1 -0
  22. package/public/assets/PipelineEditorPage-C-PHUced.js +3 -0
  23. package/public/assets/ProfilePage-9A1i3I4h.js +1 -0
  24. package/public/assets/ProjectDetailPage-DFmRizSR.js +7 -0
  25. package/public/assets/ProjectListPage-Dbj2OlMz.js +6 -0
  26. package/public/assets/QuickAuth-DRYnjdDV.js +1 -0
  27. package/public/assets/RemoveMemberConfirmDialog-B1Wfe6qD.js +6 -0
  28. package/public/assets/Select-Coph7K6I.js +6 -0
  29. package/public/assets/SettingsPage-YG6bu8P-.js +6 -0
  30. package/public/assets/Skeleton-DTD8fr3E.js +1 -0
  31. package/public/assets/TaskDetailPage-Beg8tuEN.css +32 -0
  32. package/public/assets/TaskDetailPage-DXSxtOVO.js +44 -0
  33. package/public/assets/TaskListPage-t4Dv8BDy.js +1 -0
  34. package/public/assets/TaskStatusBadge-CTYxCsEO.js +1 -0
  35. package/public/assets/TokenManage-CUQ3wwfj.js +1 -0
  36. package/public/assets/TotpSetupPage--DR3X8Ic.js +9 -0
  37. package/public/assets/WorkerSetupGuidePage-HEUz68fc.js +16 -0
  38. package/public/assets/arrow-left-EPKSp1wq.js +6 -0
  39. package/public/assets/arrow-right-CW48svkF.js +6 -0
  40. package/public/assets/bot-BlE3obwB.js +6 -0
  41. package/public/assets/copy-CljRO0MZ.js +6 -0
  42. package/public/assets/external-link-BOPlNQYO.js +6 -0
  43. package/public/assets/index-CluWJF_4.js +207 -0
  44. package/public/assets/index-DeEHxWoz.css +1 -0
  45. package/public/assets/key-OMhi1y8r.js +6 -0
  46. package/public/assets/loader-circle-DEx7RlNw.js +6 -0
  47. package/public/assets/pencil-BgpOCLzp.js +6 -0
  48. package/public/assets/plus-DMsT-oJS.js +6 -0
  49. package/public/assets/protocol-C4f2G7mk.js +1 -0
  50. package/public/assets/rotate-ccw-D8Wc0cH7.js +6 -0
  51. package/public/assets/scroll-text-B0kPxzfj.js +6 -0
  52. package/public/assets/settings-D3F-dJby.js +6 -0
  53. package/public/assets/task.store-bgSaXfA1.js +1 -0
  54. package/public/assets/trash-2-CpNRRu-J.js +6 -0
  55. package/public/assets/users-D0C2zcU6.js +6 -0
  56. package/public/favicon.svg +4 -0
  57. package/public/index.html +20 -0
@@ -0,0 +1,6 @@
1
+ import{c as O,a as k,j as e,r,f as _,X as z,o as F,d as P,u as A,h as G,q as S}from"./index-CluWJF_4.js";import{M as b}from"./protocol-C4f2G7mk.js";import B from"./WorkerSetupGuidePage-HEUz68fc.js";import{C as D}from"./copy-CljRO0MZ.js";import{L as R}from"./loader-circle-DEx7RlNw.js";import{S as U}from"./Select-Coph7K6I.js";import{E as W}from"./EmptyState-BPAoLpts.js";import{C as q}from"./Skeleton-DTD8fr3E.js";import{P as H}from"./plus-DMsT-oJS.js";import"./key-OMhi1y8r.js";import"./settings-D3F-dJby.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const V=O("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),C={[b.ONLINE]:"var(--accent)",[b.OFFLINE]:"var(--destructive)",[b.DRAINING]:"var(--warning)"};function X(a){return a>80?"var(--destructive)":a>60?"var(--warning)":"var(--accent)"}function J({machine:a,onPress:s}){const{t:i}=k();return e.jsxs("div",{onClick:s,className:`rounded border border-[var(--border)] bg-[var(--bg-card)] p-4 font-mono lowercase transition-colors ${s?"cursor-pointer hover:border-[var(--accent)]/40 hover:bg-[var(--bg-input)]":""}`,children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("h3",{className:"truncate text-sm text-[var(--text-primary)]",children:[e.jsx("span",{style:{color:C[a.status],fontSize:"0.6rem"},children:"●"})," ",a.name]}),e.jsx("span",{className:"text-xs",style:{color:C[a.status]},children:a.status})]}),e.jsxs("div",{className:"mb-3 text-xs text-[var(--text-muted)]",children:[a.host,":",a.port]}),e.jsxs("div",{className:"mb-3 flex flex-col gap-2",children:[e.jsx(y,{label:i("machines.cpu"),value:a.cpuUsage}),e.jsx(y,{label:i("machines.mem"),value:a.memoryUsage}),e.jsx(y,{label:i("machines.disk"),value:a.diskUsage})]}),e.jsx("div",{className:"flex items-center justify-between text-xs",children:e.jsx("span",{className:"text-[var(--text-secondary)]",children:i("machines.tasks_slots",{active:String(a.activeSlots),max:String(a.maxSlots)})})}),a.capabilities.length>0&&e.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:a.capabilities.map(t=>e.jsx("span",{className:"rounded border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:t},t))})]})}function y({label:a,value:s}){return e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"w-8 text-[var(--text-muted)]",children:a}),e.jsx("div",{className:"h-1.5 flex-1 rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${s}%`,backgroundColor:X(s)}})}),e.jsxs("span",{className:"w-8 text-right text-[var(--text-secondary)]",children:[s,"%"]})]})}function K({isOpen:a,onClose:s,onRegistered:i}){const{t}=k(),[n,m]=r.useState(1),[x,u]=r.useState(!1),[l,v]=r.useState(""),[h,g]=r.useState(null),[j,f]=r.useState(!1),[o,d]=r.useState(""),[N,w]=r.useState(""),p=r.useRef(null),I={1:t("machines.reg_step_generate_token"),2:t("machines.reg_step_install_worker"),3:t("machines.reg_step_waiting_activation"),4:t("machines.reg_step_activated")};r.useEffect(()=>(a&&(m(1),v(""),g(null),f(!1),d(""),w(""),u(!1)),()=>{p.current&&clearInterval(p.current)}),[a]);const $=async()=>{u(!0);try{const c=await _.post("admin/worker-tokens",{json:{label:`worker-reg-${Date.now()}`}}).json();v(c.token),g(c.tokenId),m(2)}catch{}finally{u(!1)}},M=()=>{navigator.clipboard.writeText(l),f(!0),setTimeout(()=>f(!1),2e3)},E=r.useCallback(()=>{h&&(m(3),p.current=setInterval(async()=>{try{const c=await _.get(`admin/worker-tokens/${h}/status`).json();c.used&&c.machineName&&(d(c.machineName),w(c.machineId??""),m(4),p.current&&clearInterval(p.current),i==null||i())}catch{}},3e3))},[h,i]);if(r.useEffect(()=>()=>{p.current&&clearInterval(p.current)},[]),!a)return null;const L=l.length>20?`${l.slice(0,12)}...${l.slice(-8)}`:l;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center font-mono lowercase",children:[e.jsx("div",{className:"absolute inset-0 bg-[var(--bg-primary)]/60 backdrop-blur-sm",onClick:s}),e.jsxs("div",{className:"relative z-10 w-full max-w-[1080px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8",children:[e.jsx("button",{type:"button",onClick:s,className:"absolute right-4 top-4 text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:e.jsx(z,{className:"h-4 w-4"})}),e.jsx("h2",{className:"text-lg font-bold text-[var(--accent)]",children:t("machines.reg_title")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:t("machines.reg_subtitle")}),e.jsx("div",{className:"mt-6 flex items-center justify-center gap-2",children:[1,2,3,4].map((c,T)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:`rounded-[4px] px-3 py-1.5 text-[11px] font-bold ${c===n?"bg-[var(--accent)] text-black":c<n?"bg-[var(--accent)]/20 text-[var(--accent)]":"border border-[var(--border)] bg-[var(--bg-primary)] text-[var(--text-muted)]"}`,children:[c,". ",I[c]]}),T<3&&e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"→"})]},c))}),e.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:`rounded-[4px] border p-4 ${n===1?"border-[var(--accent)] bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--accent)]",children:["> ",t("machines.reg_step_generate_token")]}),n===1&&!l?e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:t("machines.reg_click_to_generate")}),e.jsx("button",{type:"button",onClick:$,disabled:x,className:"mt-3 rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black disabled:opacity-50",children:t(x?"admin.generating":"machines.reg_step_generate_token")})]}):l?e.jsxs("div",{className:"mt-3 space-y-3",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:t("machines.reg_token_generated")}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-[11px] text-[var(--accent)]",children:L}),e.jsx("button",{type:"button",onClick:M,className:"text-[10px] text-[var(--text-muted)] hover:text-[var(--text-primary)]",children:j?e.jsx("span",{className:"text-[var(--accent)]",children:t("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(D,{className:"h-3 w-3"})," ",t("common.copy")]})})]}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)]",children:t("machines.reg_install_command")}),e.jsxs("div",{className:"space-y-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3",children:[e.jsx("p",{className:"text-[10px] text-[var(--text-primary)]",children:"$ npm install -g @overlordai/cli @overlordai/worker"}),e.jsx("p",{className:"text-[10px] text-[var(--accent)]",children:"$ overlord setup worker"})]})]}):e.jsx("p",{className:"mt-2 text-[10px] text-[var(--text-muted)]",children:t("machines.reg_completed")})]}),e.jsxs("div",{className:`rounded-[4px] border p-4 ${n===2?"border-[var(--accent)] bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--text-primary)]",children:["> ",t("machines.reg_step_install_worker")]}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("machines.reg_running_installation")}),n>=2&&e.jsxs("div",{className:"mt-3 space-y-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3",children:[e.jsx("p",{className:"text-[10px] text-[var(--text-primary)]",children:"$ overlord setup worker"}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)]",children:"server url: https://..."}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)]",children:"worker token: ovw_..."}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)]",children:"machine name: my-worker"}),e.jsx("p",{className:"text-[10px] text-[var(--accent)]",children:"config written. starting worker..."}),n===2&&e.jsx("p",{className:"text-[10px] text-[var(--accent)] animate-pulse",children:"&block;"})]}),n===2&&e.jsx("button",{type:"button",onClick:E,className:"mt-3 rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black",children:t("machines.reg_installed_wait")})]}),e.jsxs("div",{className:`rounded-[4px] border p-4 ${n===3?"border-amber-500 bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--text-primary)]",children:["> ",t("machines.reg_step_waiting_activation")]}),n>=3?e.jsx("div",{className:"mt-3 flex flex-col items-center justify-center gap-3 py-6",children:n===3?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-full border-2 border-amber-500",children:e.jsx(R,{className:"h-5 w-5 animate-spin text-amber-500"})}),e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:t("machines.reg_listening_for_worker")})]}):e.jsx("p",{className:"text-[10px] text-[var(--accent)]",children:t("machines.reg_worker_connected")})}):e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("machines.reg_waiting_for_worker")})]}),e.jsxs("div",{className:`rounded-[4px] border p-4 ${n===4?"border-[var(--accent)] bg-[var(--bg-primary)]":"border-[var(--border)] bg-[var(--bg-primary)]"}`,children:[e.jsxs("p",{className:"text-[13px] font-bold text-[var(--text-primary)]",children:["> ",t("machines.reg_step_activated")]}),n===4?e.jsxs("div",{className:"mt-3 flex flex-col items-center justify-center gap-3 py-6",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-[var(--accent)]/20",children:e.jsx(F,{className:"h-6 w-6 text-[var(--accent)]"})}),e.jsx("p",{className:"text-xs font-bold text-[var(--accent)]",children:t("machines.reg_worker_activated",{name:o})}),N&&e.jsxs("p",{className:"text-[10px] text-[var(--text-muted)]",children:["machine_id: ",N]})]}):e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:t("machines.reg_worker_registered")})]})]}),n===4&&e.jsx("div",{className:"mt-6 flex justify-end",children:e.jsx("button",{type:"button",onClick:s,className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-xs font-bold text-black",children:t("machines.reg_done")})})]})]})}function le(){const a=P(),{t:s}=k(),[i,t]=r.useState([]),[n,m]=r.useState(!0),[x,u]=r.useState("all"),[l,v]=r.useState("fleet"),[h,g]=r.useState(!1),j=A(o=>{var d;return(d=o.user)==null?void 0:d.role}),f=r.useMemo(()=>[{value:"all",label:s("machines.all_statuses")},{value:b.ONLINE,label:s("machines.online")},{value:b.OFFLINE,label:s("machines.offline")},{value:b.DRAINING,label:s("machines.draining")}],[s]);return G(r.useMemo(()=>j==="admin"?e.jsxs("button",{type:"button",onClick:()=>g(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",children:[e.jsx(H,{size:14}),s("machines.register_worker")]}):null,[j,s])),r.useEffect(()=>{async function o(){m(!0);try{const d=new URLSearchParams;x!=="all"&&d.set("status",x);const N=await _.get("web/machines",{searchParams:d}).json();t(N)}catch{}finally{m(!1)}}o()},[x]),e.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between border-b border-[var(--border)]",children:[e.jsxs("div",{className:"flex",children:[e.jsxs("button",{type:"button",onClick:()=>v("fleet"),className:`flex items-center gap-2 px-4 py-2.5 text-xs transition-colors ${l==="fleet"?"border-b-2 border-[var(--accent)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:[e.jsx(S,{size:14}),s("machines.fleet")]}),e.jsxs("button",{type:"button",onClick:()=>v("setup_guide"),className:`flex items-center gap-2 px-4 py-2.5 text-xs transition-colors ${l==="setup_guide"?"border-b-2 border-[var(--accent)] text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:[e.jsx(V,{size:14}),s("machines.setup_guide")]})]}),l==="fleet"&&e.jsx(U,{value:x,onChange:u,options:f})]}),l==="fleet"?n?e.jsx(q,{cards:6}):i.length===0?e.jsx(W,{icon:S,title:s("machines.no_machines_found"),description:s(x!=="all"?"machines.try_changing_status_filter":"machines.no_machines_registered"),action:e.jsx("button",{type:"button",onClick:()=>v("setup_guide"),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:s("machines.view_setup_guide")})}):e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:i.map(o=>e.jsx(J,{machine:o,onPress:()=>a(`/machines/${o.id}`)},o.id))}):e.jsx(B,{}),e.jsx(K,{isOpen:h,onClose:()=>g(!1),onRegistered:()=>{u("all")}})]})}export{le as default};
@@ -0,0 +1 @@
1
+ import{d as a,a as n,j as e,L as o}from"./index-CluWJF_4.js";function x(){const r=a(),{t}=n();return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--bg-primary)] p-8 font-mono",children:e.jsxs("div",{className:"flex flex-col items-center justify-center gap-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-12 py-16",children:[e.jsx("span",{className:"text-7xl font-bold text-[var(--border)]",children:t("common.not_found")}),e.jsx("span",{className:"text-base font-bold text-red-500",children:t("common.page_not_found")}),e.jsx("span",{className:"max-w-[340px] text-center text-xs text-[var(--text-muted)]",children:t("common.the_page_does_not_exist")}),e.jsxs("div",{className:"w-full max-w-[380px] rounded-[4px] bg-[#0C0C0C] px-4 py-3",children:[e.jsxs("p",{className:"font-mono text-xs leading-relaxed text-[var(--text-muted)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> overlord $"})," ",e.jsx("span",{className:"text-[#e4e4e4]",children:"page --get /unknown"})]}),e.jsx("p",{className:"mt-1 font-mono text-xs leading-relaxed text-red-500",children:t("common.not_found_terminal_error")})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(o,{to:"/",className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black transition-all hover:brightness-110",children:t("common.go_home")}),e.jsx("button",{type:"button",onClick:()=>r(-1),className:"rounded-[4px] border border-[var(--border)] bg-transparent px-5 py-2 text-[11px] font-bold text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",children:t("common.go_back")})]})]})})}export{x as default};
@@ -0,0 +1,3 @@
1
+ import{a as g,r as p,j as e,m as M,d as T,f as k,t as y}from"./index-CluWJF_4.js";import{S as B}from"./Select-Coph7K6I.js";const C={timeout:600,retries:0,confirm:!1,irreversible:!1};function D(){return{name:"",command:"",executor:"claude_code",timeout:600,retries:0,confirm:!1}}const F={claude_code:{label:"claude",color:"var(--accent)"},cursor:{label:"cursor",color:"var(--info)"},shell:{label:"shell",color:"var(--warning)"}};function V(t){switch(t){case"claude":case"claude_code":return"var(--accent)";case"cursor":return"var(--info)";case"shell":return"var(--warning)";default:return"#737373"}}function W({executor:t}){const o=F[t??"claude_code"]??F.claude_code;return e.jsx("span",{className:"inline-block rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase leading-none",style:{color:o.color,border:`1px solid ${o.color}`,opacity:.85},children:o.label})}function u({children:t}){return e.jsx("label",{className:"mb-1 block font-mono text-[11px] text-[var(--text-secondary)]",children:t})}function f({value:t,onChange:o,placeholder:n,type:r="text",className:a=""}){return e.jsx("input",{type:r,value:t,onChange:c=>o(c.target.value),placeholder:n,className:`w-full rounded border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none ${a}`})}function N({value:t,onChange:o,options:n,className:r=""}){return e.jsx(B,{value:t,onChange:o,options:n,className:r})}function $({checked:t,onChange:o}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>o(!t),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-[var(--border)] transition-colors ${t?"bg-[var(--accent)]":"bg-[var(--bg-primary)]"}`,children:e.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow transition-transform ${t?"translate-x-[18px]":"translate-x-[2px]"}`})})}function L({value:t,onChange:o,placeholder:n,rows:r=4}){return e.jsx("textarea",{value:t,onChange:a=>o(a.target.value),placeholder:n,rows:r,className:"w-full rounded border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs leading-relaxed text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none"})}function q({stage:t,index:o,selected:n,onSelect:r,onDelete:a}){const{t:c}=g(),l=t.confirm?t.type?`confirm:${t.type}`:"confirm":null;return e.jsxs("button",{type:"button",onClick:r,className:`group relative flex w-full items-start gap-3 rounded-[4px] border px-4 py-3 text-left transition-colors ${n?"border-[var(--accent)] bg-[var(--bg-card)]":"border-[var(--border)] bg-[var(--bg-card)] hover:border-[var(--text-muted)]"}`,style:{borderLeftWidth:3,borderLeftColor:V(t.executor)},children:[e.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[10px] text-[var(--text-muted)]",children:String(o+1).padStart(2,"0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs font-bold text-[var(--text-primary)]",children:t.name||"unnamed"}),e.jsx(W,{executor:t.executor})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 font-mono text-[10px] text-[var(--text-muted)]",children:[l&&e.jsx("span",{children:l}),t.timeout!=null&&e.jsxs("span",{children:["timeout:",t.timeout,"s"]})]})]}),e.jsx("button",{type:"button",onClick:x=>{x.stopPropagation(),a()},className:"mt-0.5 shrink-0 rounded p-0.5 text-[var(--text-muted)] opacity-0 transition-opacity hover:text-[var(--destructive)] group-hover:opacity-100","aria-label":c("pipeline.delete_stage"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})}function A({stage:t,onChange:o}){const{t:n}=g();return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-mono text-sm font-semibold text-[var(--accent)]",children:n("pipeline.stage_properties")}),e.jsx("p",{className:"font-mono text-[11px] text-[var(--text-muted)]",children:n("pipeline.editing",{name:t.name||n("pipeline.unnamed")})}),e.jsxs("div",{children:[e.jsx(u,{children:n("pipeline.name")}),e.jsx(f,{value:t.name,onChange:r=>o({name:r}),placeholder:n("pipeline.stage_name")})]}),e.jsxs("div",{children:[e.jsx(u,{children:n("pipeline.executor")}),e.jsx(N,{value:t.executor??"claude_code",onChange:r=>o({executor:r}),options:[{value:"claude_code",label:"claude_code"},{value:"cursor",label:"cursor"},{value:"shell",label:"shell"}]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(u,{children:n("pipeline.timeout")}),e.jsx(f,{type:"number",value:String(t.timeout??""),onChange:r=>o({timeout:r?parseInt(r,10):void 0}),placeholder:"600"})]}),e.jsxs("div",{children:[e.jsx(u,{children:n("pipeline.max_turns")}),e.jsx(f,{type:"number",value:String(t.max_turns??""),onChange:r=>o({max_turns:r?parseInt(r,10):void 0}),placeholder:"50"})]})]}),e.jsxs("div",{children:[e.jsx(u,{children:n("pipeline.confirm_mode")}),e.jsx(N,{value:t.confirm?t.type??"confirm":"none",onChange:r=>{o(r==="none"?{confirm:!1,type:void 0}:{confirm:!0,type:r})},options:[{value:"none",label:"none"},{value:"confirm",label:"confirm"},{value:"choice",label:"choice"},{value:"input",label:"input"}]})]}),t.confirm&&e.jsxs("div",{children:[e.jsx(u,{children:n("pipeline.confirm_timeout")}),e.jsx(f,{type:"number",value:String(t.confirm_timeout??""),onChange:r=>o({confirm_timeout:r?parseInt(r,10):void 0}),placeholder:"300"})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("p",{className:"mb-3 font-mono text-[11px] text-[var(--text-muted)]",children:n("pipeline.overrides")}),e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx(u,{children:n("pipeline.pty_only")}),e.jsx($,{checked:t.pty_only??!1,onChange:r=>o({pty_only:r})})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx(u,{children:n("pipeline.allowed_tools")}),e.jsx(f,{value:t.allowed_tools??"",onChange:r=>o({allowed_tools:r||void 0}),placeholder:"tool1, tool2, ..."})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:n("pipeline.irreversible")}),e.jsx($,{checked:t.irreversible??!1,onChange:r=>o({irreversible:r})})]})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("p",{className:"mb-3 font-mono text-[11px] text-[var(--text-muted)]",children:n("pipeline.on_failure_section")}),e.jsxs("div",{className:"mb-3",children:[e.jsx(u,{children:n("pipeline.on_failure")}),e.jsx(N,{value:t.onFailure?"goto":"stop",onChange:r=>{o(r==="stop"?{onFailure:void 0}:{onFailure:{goto:"",maxLoops:3}})},options:[{value:"stop",label:n("pipeline.stop")},{value:"goto",label:n("pipeline.goto_stage")}]})]}),t.onFailure&&e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(u,{children:n("pipeline.goto")}),e.jsx(f,{value:t.onFailure.goto,onChange:r=>{var a;return o({onFailure:{goto:r,maxLoops:((a=t.onFailure)==null?void 0:a.maxLoops)??3}})},placeholder:n("pipeline.stage_name")})]}),e.jsxs("div",{children:[e.jsx(u,{children:n("pipeline.max_loops")}),e.jsx(f,{type:"number",value:String(t.onFailure.maxLoops),onChange:r=>{var a;return o({onFailure:{goto:((a=t.onFailure)==null?void 0:a.goto)??"",maxLoops:r?parseInt(r,10):3}})},placeholder:"3"})]})]})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold text-[var(--accent)]",children:n("pipeline.stage_commands")}),e.jsx(L,{value:t.command??"",onChange:r=>o({command:r}),placeholder:n("pipeline.commands_placeholder"),rows:6})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold text-[var(--accent)]",children:n("pipeline.environment")}),e.jsx(L,{value:t.env?Object.entries(t.env).map(([r,a])=>`${r}=${a}`).join(`
2
+ `):"",onChange:r=>{if(!r.trim()){o({env:void 0});return}const a={};r.split(`
3
+ `).forEach(c=>{const l=c.indexOf("=");l>0&&(a[c.slice(0,l).trim()]=c.slice(l+1).trim())}),o({env:a})},placeholder:n("pipeline.env_placeholder"),rows:3})]})]})}function H({value:t,onChange:o,onSave:n,saving:r,projectName:a}){const{t:c}=g(),[l,x]=p.useState(null),[h,j]=p.useState(!1),i=(t==null?void 0:t.stages)??[],_=(t==null?void 0:t.defaults)??C,w=l!=null?i[l]??null:null,b=p.useCallback(s=>{o({stages:s,defaults:_})},[o,_]),E=p.useCallback(()=>{const s=[...i,D()];b(s),x(s.length-1)},[i,b]),I=p.useCallback(s=>{const d=i.filter((m,v)=>v!==s);b(d),l===s?x(d.length>0?Math.min(s,d.length-1):null):l!=null&&l>s&&x(l-1)},[i,l,b]),P=p.useCallback((s,d)=>{const m=i.map((v,O)=>O===s?{...v,...d}:v);b(m)},[i,b]),S=p.useCallback((s,d)=>{const m=d==="up"?s-1:s+1;if(m<0||m>=i.length)return;const v=[...i];[v[s],v[m]]=[v[m],v[s]],b(v),l===s?x(m):l===m&&x(s)},[i,l,b]),J=p.useMemo(()=>JSON.stringify(t??{stages:[],defaults:C},null,2),[t]);return e.jsxs("div",{className:"flex flex-col gap-0",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{type:"button",onClick:()=>j(s=>!s),className:`rounded-[4px] border px-2 py-1 font-mono text-[10px] transition-colors ${h?"border-[var(--accent)] text-[var(--accent)]":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:[c("pipeline.json_toggle")," ⇅"]})}),h&&e.jsx("pre",{className:"mb-4 max-h-[400px] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3 font-mono text-[11px] leading-relaxed text-[var(--text-primary)]",children:J}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[i.map((s,d)=>{var m;return e.jsxs("div",{children:[e.jsx(q,{stage:s,index:d,selected:l===d,onSelect:()=>x(d),onDelete:()=>I(d)}),d<i.length-1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"}),e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:"▼"}),e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"})]}),((m=s.onFailure)==null?void 0:m.goto)&&e.jsx("div",{className:"flex items-center justify-center gap-1.5 py-1",children:e.jsxs("span",{className:"text-[10px] text-[var(--warning)]",children:["↺ loop → ",s.onFailure.goto," (max ",s.onFailure.maxLoops,")"]})})]},`${d}-${s.name}`)}),l!=null&&i.length>1&&e.jsxs("div",{className:"flex items-center gap-1 pl-7 pt-2",children:[e.jsxs("button",{type:"button",disabled:l===0,onClick:()=>S(l,"up"),className:"rounded border border-[var(--border)] px-2 py-0.5 font-mono text-[10px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▲ ",c("pipeline.up")]}),e.jsxs("button",{type:"button",disabled:l===i.length-1,onClick:()=>S(l,"down"),className:"rounded border border-[var(--border)] px-2 py-0.5 font-mono text-[10px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▼ ",c("pipeline.down")]})]}),e.jsx("div",{className:"flex items-center justify-center py-3",children:e.jsxs("button",{type:"button",onClick:E,className:"flex items-center gap-1.5 rounded-[4px] border border-dashed border-[var(--border)] px-4 py-2 font-mono text-xs text-[var(--accent)] transition-colors hover:border-[var(--accent)] hover:bg-[var(--bg-secondary)]",children:[e.jsx("span",{className:"text-sm leading-none",children:"+"})," ",c("pipeline.add_stage")]})})]}),e.jsx("div",{className:"hidden w-[360px] shrink-0 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 lg:block",style:{alignSelf:"flex-start",position:"sticky",top:0},children:w?e.jsx(A,{stage:w,onChange:s=>P(l,s)}):e.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:e.jsx("p",{className:"font-mono text-xs text-[var(--text-muted)]",children:c("pipeline.select_stage")})})})]})]})}function G(){const{key:t}=M(),o=T(),{t:n}=g(),[r,a]=p.useState(null),[c,l]=p.useState(!0),[x,h]=p.useState(!1);p.useEffect(()=>{t&&k.get(`web/projects/${t}`).json().then(i=>{if(i.pipeline)try{a(JSON.parse(i.pipeline))}catch{a(null)}}).catch(()=>y.error(n("pipeline.failed_to_load_project"))).finally(()=>l(!1))},[t,n]);const j=p.useCallback(async()=>{if(t){h(!0);try{await k.put(`admin/projects/${t}`,{json:{pipeline:r?JSON.stringify(r):null}}),y.success(n("pipeline.saved"))}catch{y.error(n("pipeline.failed_to_save"))}finally{h(!1)}}},[t,r,n]);return c?e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:n("pipeline.loading_pipeline")})}):e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-8 py-5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-base font-medium text-[var(--text-primary)]",children:n("pipeline.title")}),e.jsx("span",{className:"text-sm text-[var(--text-muted)]",children:n("pipeline.subtitle",{key:t??""})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:j,disabled:x,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black disabled:opacity-50",children:n(x?"common.saving":"pipeline.save")}),e.jsx("button",{type:"button",onClick:()=>o(`/projects/${t}`),className:"rounded-[4px] border border-[var(--border)] px-4 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:n("pipeline.cancel")})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-8",children:e.jsx(H,{value:r,onChange:a,onSave:j,saving:x,projectName:t})})]})}export{G as default};
@@ -0,0 +1 @@
1
+ import{a as L,r as a,f as m,t as i,j as e,L as S,K as R}from"./index-CluWJF_4.js";function D(){const{t:r}=L(),[t,k]=a.useState(null),[P,u]=a.useState(!0),[x,f]=a.useState(""),[o,b]=a.useState(""),[v,g]=a.useState(""),[h,j]=a.useState(!1),[_,n]=a.useState(""),[c,w]=a.useState(""),[y,N]=a.useState(!1),p=a.useCallback(async()=>{try{u(!0);const s=await m.get("web/profile").json();k(s)}catch{i.error(r("profile.failed_to_load_profile"))}finally{u(!1)}},[r]);a.useEffect(()=>{p()},[p]);const C=async()=>{if(n(""),!x){n(r("profile.current_password_required"));return}if(!o){n(r("profile.new_password_required"));return}if(o.length<10||o.length>20){n(r("profile.password_length_10_20"));return}if(o!==v){n(r("profile.passwords_do_not_match"));return}try{j(!0),await m.put("web/profile/password",{json:{currentPassword:x,newPassword:o}}),i.success(r("profile.password_changed")),f(""),b(""),g("")}catch(s){const d=s instanceof Error?s.message:r("profile.failed_to_change_password");n(d)}finally{j(!1)}},E=async()=>{if(!c||c.length!==6){i.error(r("profile.totp_code_required"));return}try{N(!0),await m.post("web/profile/totp/regenerate",{json:{code:c}}),i.success(r("profile.two_fa_regenerated")),w(""),p()}catch(s){const d=s instanceof Error?s.message:r("profile.totp_code_invalid");i.error(d)}finally{N(!1)}};return P?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):e.jsxs("div",{className:"mx-auto max-w-xl space-y-8 px-6 py-8 font-mono lowercase",children:[e.jsxs("h1",{className:"text-lg text-[var(--text-primary)]",children:[r("profile.title")," ",e.jsx("span",{className:"text-[var(--text-muted)]",children:r("profile.personal_settings")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.profile_info")}),t?e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{label:r("profile.username"),value:t.name}),e.jsx(l,{label:r("common.role"),value:t.role}),e.jsx(l,{label:r("profile.git_name"),value:t.gitName||r("common.not_set")}),e.jsx(l,{label:r("profile.git_email"),value:t.gitEmail||r("common.not_set")}),e.jsx(l,{label:r("profile.status"),value:t.status}),e.jsx(l,{label:r("profile.created_at"),value:new Date(t.createdAt).toLocaleDateString()})]}):e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:r("profile.unable_to_load_profile")})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.change_password")}),e.jsxs("div",{className:"space-y-4",children:[_&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--destructive)]",children:_}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_password")}),e.jsx("input",{type:"password",value:x,onChange:s=>f(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.new_password")}),e.jsx("input",{type:"password",value:o,onChange:s=>b(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:r("profile.password_hint_10_20")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.confirm_password")}),e.jsx("input",{type:"password",value:v,onChange:s=>g(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:C,disabled:h,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black disabled:opacity-50",children:r(h?"common.updating":"profile.update_password")})})]})]}),e.jsxs("section",{className:"rounded-[4px] bg-[var(--bg-card)] border border-[var(--border)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("profile.two_factor_auth")}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex items-center gap-2 text-sm",children:t!=null&&t.totpEnabled?e.jsxs("span",{className:"text-[var(--accent)]",children:["● ",r("profile.two_fa_enabled")]}):e.jsxs("span",{className:"text-[var(--text-muted)]",children:["● ",r("profile.two_fa_not_setup")]})}),(t==null?void 0:t.totpEnabled)&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.regenerate_2fa_warning")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-secondary)]",children:r("profile.current_totp_code")}),e.jsx("input",{type:"text",inputMode:"numeric",maxLength:6,placeholder:r("profile.totp_code_placeholder"),value:c,onChange:s=>{const d=s.target.value.replace(/\D/g,"").slice(0,6);w(d)},className:"w-full max-w-xs rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--text-primary)] outline-none focus:border-[var(--accent)] font-mono tracking-widest"})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:E,disabled:y||c.length!==6,className:"rounded-[4px] border border-[var(--warning)] bg-transparent px-4 py-2 text-xs font-medium text-[var(--warning)] hover:bg-[var(--warning)] hover:text-black disabled:opacity-50 transition-colors",children:r(y?"profile.regenerating":"profile.regenerate_2fa")})})]})]})]}),e.jsxs(S,{to:"/access-tokens",className:"flex items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--accent)]",children:[e.jsx(R,{size:16,className:"text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-[var(--text-primary)]",children:r("profile.access_tokens")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("profile.access_tokens_desc")})]})]})]})}function l({label:r,value:t}){return e.jsxs("div",{className:"flex items-center gap-3 py-1",children:[e.jsx("span",{className:"w-28 shrink-0 text-xs text-[var(--text-muted)]",children:r}),e.jsx("span",{className:"text-sm text-[var(--text-primary)]",children:t})]})}export{D as default};
@@ -0,0 +1,7 @@
1
+ import{c as K,a as S,j as e,l as q,m as B,d as H,u as C,r as a,h as J,f as j,v as Q}from"./index-CluWJF_4.js";import{T as d}from"./protocol-C4f2G7mk.js";import{U as V,A as z,R as W}from"./RemoveMemberConfirmDialog-B1Wfe6qD.js";import{P as X}from"./pencil-BgpOCLzp.js";import{T as Y}from"./trash-2-CpNRRu-J.js";import{P as Z}from"./plus-DMsT-oJS.js";import"./Select-Coph7K6I.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ee=K("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function te({isOpen:n,onClose:l,onConfirm:t,projectName:m,loading:o}){const{t:r}=S();return e.jsx(q,{isOpen:n,onClose:l,onConfirm:t,title:`> ${r("projects.delete_project")}`,message:r("projects.delete_project_confirm",{name:m}),confirmLabel:r("projects.delete_project"),confirmVariant:"danger",isLoading:o})}const se={[d.QUEUED]:"var(--text-muted)",[d.ASSIGNED]:"var(--info)",[d.RUNNING]:"var(--info)",[d.SUSPENDED]:"var(--warning)",[d.COMPLETED]:"var(--accent)",[d.FAILED]:"var(--destructive)",[d.CANCELLED]:"var(--text-muted)"};function D(n){return new Date(n).toLocaleString()}function ie(){const{key:n}=B(),l=H(),{t}=S(),m=C(s=>s.user),o=(m==null?void 0:m.role)==="admin",[r,P]=a.useState(null),[y,L]=a.useState([]),[g,M]=a.useState([]),[A,E]=a.useState(!0),[i,b]=a.useState(null),[T,h]=a.useState(!1),[I,w]=a.useState(!1),[O,k]=a.useState(!1),[p,f]=a.useState(null),[R,_]=a.useState(!1);J(a.useMemo(()=>r?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>l(`/projects/${r.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(X,{className:"h-3 w-3"}),t("common.edit")]}),o&&e.jsxs("button",{onClick:()=>h(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(Y,{className:"h-3 w-3"}),t("common.delete")]})]}):null,[r,o,l,t]));const u=a.useCallback(async()=>{var s;if(n)try{const N=((s=C.getState().user)==null?void 0:s.role)==="admin",[x,v,F]=await Promise.all([j.get(`web/projects/${n}`).json(),N?j.get(`admin/projects/${n}/members`).json().catch(()=>[]):Promise.resolve([]),j.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(G=>G.data).catch(()=>[])]);if(P(x),L(v),M(F),x.pipeline)try{b(JSON.parse(x.pipeline))}catch{b(null)}else b(null)}catch{}finally{E(!1)}},[n]);a.useEffect(()=>{u()},[u]);async function $(){if(r){w(!0);try{await j.delete(`admin/projects/${r.key}`),l("/projects")}catch{}finally{w(!1),h(!1)}}}async function U(){if(!(!r||!p)){_(!0);try{await j.delete(`admin/projects/${r.key}/members`,{searchParams:{developerId:String(p.developerId)}}),await u()}catch{}finally{_(!1),f(null)}}}return A?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r?e.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>l("/projects"),children:t("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:t("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{label:t("projects.key"),value:r.key}),e.jsx(c,{label:t("projects.name"),value:r.name}),e.jsx(c,{label:t("projects.repo_url"),value:r.repoUrl}),e.jsx(c,{label:t("projects.git_platform"),value:r.gitPlatform}),e.jsx(c,{label:t("projects.default_branch"),value:r.defaultBranch}),e.jsx(c,{label:t("projects.agent_type"),value:r.agentType}),e.jsx(c,{label:t("projects.max_turns"),value:String(r.maxTurns)}),e.jsx(c,{label:t("projects.allowed_tools"),value:r.allowedTools??"all"}),e.jsx(c,{label:t("projects.auto_merge"),value:r.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:t("projects.members")}),o&&e.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1.5 rounded bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(Z,{className:"h-3.5 w-3.5"}),t("projects.add_member")]})]}),y.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("projects.no_members_yet")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.added_at")}),o&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:t("common.actions")})]})}),e.jsx("tbody",{children:y.map(s=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:s.developerId}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:s.role==="maintainer"?"var(--warning)":"var(--text-secondary)"},children:s.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)}),o&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>f(s),className:"text-[var(--destructive)] hover:underline","aria-label":t("projects.remove_member"),children:e.jsx(V,{className:"h-3.5 w-3.5"})})})]},s.developerId))})]})})]}),e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:t("projects.recent_tasks")}),g.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("projects.no_tasks_for_project")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.created")})]})}),e.jsx("tbody",{children:g.map(s=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>l(`/tasks/${s.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",s.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)]",children:s.description}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:se[s.status]},children:s.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)})]},s.id))})]})})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:t("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),i!=null&&i.stages&&i.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:i.stages.map((s,N)=>{var x,v;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>l(`/projects/${r.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:s.name}),s.command&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",s.command.split(`
7
+ `)[0].slice(0,40)]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.confirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:t("projects.confirm_label")}),s.irreversible&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--destructive)]",style:{backgroundColor:"rgba(239,68,68,0.12)"},children:t("pipeline.irreversible")})]})]}),((x=s.onFailure)==null?void 0:x.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(Q,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[10px] text-[var(--warning)]",children:["onFailure.goto: ",s.onFailure.goto,", maxLoops: ",s.onFailure.maxLoops]})]}),N<i.stages.length-1&&!((v=s.onFailure)!=null&&v.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(ee,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},s.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:t("projects.no_pipeline_configured")}),o&&e.jsx("button",{onClick:()=>l(`/projects/${r.key}/pipeline`),className:"mt-3 flex w-full items-center justify-center gap-1.5 py-2 text-xs text-[var(--accent)] hover:text-[var(--accent)]",children:t("projects.add_stage")})]})})]}),e.jsx(te,{isOpen:T,onClose:()=>h(!1),onConfirm:$,projectName:r.name,loading:I}),e.jsx(z,{isOpen:O,onClose:()=>k(!1),projectKey:r.key,onAdded:u}),e.jsx(W,{isOpen:!!p,onClose:()=>f(null),onConfirm:U,memberName:p?String(p.developerId):"",loading:R})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("projects.project_not_found")}),e.jsx("button",{onClick:()=>l("/projects"),className:"mt-4 rounded border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:t("projects.back_to_projects")})]})}function c({label:n,value:l}){return e.jsxs("div",{className:"flex items-center gap-3 py-1",children:[e.jsx("span",{className:"w-32 shrink-0 text-xs text-[var(--text-muted)]",children:n}),e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:l})]})}export{ie as default};
@@ -0,0 +1,6 @@
1
+ import{c as A,a as w,r as a,j as e,f as P,d as L,h as R}from"./index-CluWJF_4.js";import{G as b,A as p}from"./protocol-C4f2G7mk.js";import{S as F}from"./Select-Coph7K6I.js";import{E as G}from"./EmptyState-BPAoLpts.js";import{T as I}from"./Skeleton-DTD8fr3E.js";import{P as M}from"./plus-DMsT-oJS.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const D=A("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),f={width:"100%",padding:"0.5rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},m={display:"block",color:"var(--text-secondary)",fontSize:"0.7rem",marginBottom:"0.25rem",fontFamily:"'JetBrains Mono', monospace"};function H({isOpen:u,onClose:s,onCreated:g}){const{t}=w(),[n,x]=a.useState(""),[l,i]=a.useState(""),[c,v]=a.useState(""),[o,d]=a.useState("main"),[_,S]=a.useState(b.GITHUB),[k,B]=a.useState(p.CLAUDE),[j,N]=a.useState(!1),[T,h]=a.useState("");a.useEffect(()=>{u&&E()},[u]);function E(){x(""),i(""),v(""),d("main"),S(b.GITHUB),B(p.CLAUDE),h("")}function C(){E(),s()}async function U(r){r.preventDefault(),h(""),N(!0);try{const y=await P.post("admin/projects",{json:{name:n,key:l,repoUrl:c,defaultBranch:o,gitPlatform:_,agentType:k}}).json();g(y),C()}catch(y){const z=y instanceof Error?y.message:t("projects.failed_to_create_project");h(z)}finally{N(!1)}}return u?e.jsx("div",{onClick:C,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:r=>r.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600},children:["> ",t("projects.create_project")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:t("projects.add_project_desc")})]}),T&&e.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.7rem"},children:T}),e.jsxs("form",{onSubmit:U,style:{display:"flex",flexDirection:"column",gap:"0.875rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:m,children:t("projects.project_name")}),e.jsx("input",{type:"text",value:n,onChange:r=>x(r.target.value),placeholder:t("projects.project_name_placeholder"),required:!0,autoFocus:!0,style:f,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:m,children:t("projects.project_key")}),e.jsx("input",{type:"text",value:l,onChange:r=>i(r.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:t("projects.project_key_placeholder"),required:!0,style:f,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:t("projects.project_key_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{style:m,children:t("projects.repo_url")}),e.jsx("input",{type:"text",value:c,onChange:r=>v(r.target.value),placeholder:t("projects.repo_url_placeholder"),required:!0,style:f,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"0.75rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:m,children:t("projects.default_branch")}),e.jsx("input",{type:"text",value:o,onChange:r=>d(r.target.value),placeholder:t("projects.main"),style:f,onFocus:r=>r.target.style.borderColor="var(--accent)",onBlur:r=>r.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:m,children:t("projects.git_platform")}),e.jsx(F,{value:_,onChange:r=>S(r),options:[{value:b.GITHUB,label:t("projects.github")},{value:b.GITLAB,label:t("projects.gitlab")},{value:b.GITEA,label:t("projects.gitea")}]})]}),e.jsxs("div",{children:[e.jsx("label",{style:m,children:t("projects.agent_type")}),e.jsx(F,{value:k,onChange:r=>B(r),options:[{value:p.CLAUDE,label:t("projects.claude")},{value:p.CURSOR,label:t("projects.cursor")},{value:p.CODEX,label:t("projects.codex")},{value:p.CUSTOM,label:t("projects.custom")}]})]})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("button",{type:"button",onClick:C,disabled:j,style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"color 0.15s, border-color 0.15s"},className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",children:t("common.cancel")}),e.jsx("button",{type:"submit",disabled:j||!n||!l||!c,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:j||!n||!l||!c?"not-allowed":"pointer",opacity:j||!n||!l||!c?.7:1},children:t(j?"common.creating":"common.create")})]})]})]})}):null}function X(){const u=L(),{t:s}=w(),[g,t]=a.useState([]),[n,x]=a.useState(!0),[l,i]=a.useState(!1);R(a.useMemo(()=>e.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(M,{className:"h-3.5 w-3.5"}),s("projects.create_project")]}),[s]));async function c(){x(!0);try{const o=await P.get("web/projects").json();t(o)}catch{}finally{x(!1)}}a.useEffect(()=>{c()},[]);function v(o){t(d=>[o,...d])}return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8",children:[n?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(I,{rows:4})}):g.length===0?e.jsx(G,{icon:D,title:s("projects.no_projects_yet"),description:s("projects.create_first_project"),actionLabel:s("projects.create_project"),onAction:()=>i(!0)}):e.jsxs("div",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr_1fr_100px] gap-4 border-b border-[var(--border-row)] px-4 py-2.5",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-muted)]",children:s("projects.key")}),e.jsx("span",{className:"text-xs font-medium text-[var(--text-muted)]",children:s("projects.name")}),e.jsx("span",{className:"text-xs font-medium text-[var(--text-muted)]",children:s("projects.repository")}),e.jsx("span",{className:"text-xs font-medium text-[var(--text-muted)]",children:s("projects.agent")})]}),g.map(o=>e.jsxs("div",{onClick:()=>u(`/projects/${o.key}`),className:"grid cursor-pointer grid-cols-[100px_1fr_1fr_100px] gap-4 border-b border-[var(--border-row)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)]",children:[e.jsx("span",{className:"truncate text-sm text-[var(--accent)]",children:o.key}),e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:o.name}),e.jsx("a",{href:o.repoUrl,target:"_blank",rel:"noopener noreferrer",className:"truncate text-sm text-[var(--accent)] hover:underline",onClick:d=>d.stopPropagation(),children:o.repoUrl}),e.jsx("span",{className:"text-sm text-[var(--text-secondary)]",children:o.agentType})]},o.key))]}),e.jsx(H,{isOpen:l,onClose:()=>i(!1),onCreated:v})]})}export{X as default};
@@ -0,0 +1 @@
1
+ import{a as b,r as s,f as h,j as e,C as v}from"./index-CluWJF_4.js";import{C as f}from"./copy-CljRO0MZ.js";function k({mode:l}){const{t:o}=b(),[n,d]=s.useState([]),[x,c]=s.useState(null),[u,i]=s.useState(!1);s.useEffect(()=>{h.get("web/profile/tokens").json().then(t=>{const r=t.filter(m=>m.status==="active");d(r),r.length>0&&c(r[0].id)}).catch(()=>{})},[]);const a=l==="cli"?"ov login --token <your-token>":'curl -H "authorization: bearer <your-token>" http://localhost:9000/api/web/tasks',p=s.useCallback(()=>{navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),2e3)},[a]);return n.length===0?null:e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--accent)]/20 bg-[var(--bg-card)] p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:o("docs.quick_start_with_token")}),e.jsx("select",{value:x??"",onChange:t=>c(Number(t.target.value)),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2 py-1 text-xs text-[var(--text-primary)]",children:n.map(t=>e.jsx("option",{value:t.id,children:t.label},t.id))})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)] break-all",children:a}),e.jsx("button",{onClick:p,className:"shrink-0 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:u?e.jsx(v,{size:14}):e.jsx(f,{size:14})})]}),e.jsx("p",{className:"mt-2 text-[10px] text-[var(--text-muted)]",children:o("docs.replace_token_hint")})]})}export{k as Q};
@@ -0,0 +1,6 @@
1
+ import{c as _,a as N,r as s,j as e,X as S,f as h,l as R}from"./index-CluWJF_4.js";import{P as i}from"./protocol-C4f2G7mk.js";import{S as g}from"./Select-Coph7K6I.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const w=_("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);function A({isOpen:a,onClose:d,projectKey:m,onAdded:x}){const{t}=N(),[o,E]=s.useState([]),[n,u]=s.useState(""),[v,j]=s.useState(i.MEMBER),[p,f]=s.useState(!1),[y,b]=s.useState("");s.useEffect(()=>{if(!a)return;async function r(){try{const c=await h.get("admin/developers").json();E(c)}catch{}}r()},[a]);function l(){u(""),j(i.MEMBER),b(""),d()}async function M(r){if(r.preventDefault(),!!n){b(""),f(!0);try{await h.post(`admin/projects/${m}/members`,{json:{developerId:parseInt(n,10),role:v}}),x(),l()}catch(c){const k=c instanceof Error?c.message:t("projects.failed_to_add_member");b(k)}finally{f(!1)}}}return a?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:l}),e.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:e.jsxs("form",{onSubmit:M,children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h3",{className:"text-sm text-[var(--text-primary)]",children:t("projects.add_member_title")}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:l,children:e.jsx(S,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:t("projects.developer")}),e.jsx(g,{value:n,onChange:u,options:o.map(r=>({value:String(r.id),label:`${r.name} (${r.gitEmail})`})),placeholder:t("projects.select_developer")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:t("projects.role")}),e.jsx(g,{value:v,onChange:r=>j(r),options:[{value:i.MEMBER,label:t("projects.member_role")},{value:i.MAINTAINER,label:t("projects.maintainer_role")}]})]}),y&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:y})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",disabled:p,onClick:l,children:t("common.cancel")}),e.jsx("button",{type:"submit",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:p||!n,children:t(p?"projects.adding":"projects.add_member")})]})]})})]}):null}function L({isOpen:a,onClose:d,onConfirm:m,memberName:x,loading:t}){const{t:o}=N();return e.jsx(R,{isOpen:a,onClose:d,onConfirm:m,title:`> ${o("projects.remove_member")}`,message:o("projects.remove_member_confirm",{name:x}),confirmLabel:o("common.remove"),confirmVariant:"danger",isLoading:t})}export{A,L as R,w as U};
@@ -0,0 +1,6 @@
1
+ import{c as f,r as c,j as t}from"./index-CluWJF_4.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const b=f("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function h({value:r,onChange:i,options:l,placeholder:x,disabled:a=!1,className:d=""}){var u;const[n,s]=c.useState(!1),o=c.useRef(null),m=((u=l.find(e=>e.value===r))==null?void 0:u.label)??x??"";return c.useEffect(()=>{function e(v){o.current&&!o.current.contains(v.target)&&s(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.jsxs("div",{ref:o,className:`relative ${d}`,children:[t.jsxs("button",{type:"button",disabled:a,onClick:()=>!a&&s(!n),className:`flex w-full items-center justify-between rounded-[4px] border bg-[var(--bg-input)] px-3 py-2 font-mono text-xs outline-none transition-colors ${n?"border-[var(--accent)] text-[var(--text-primary)]":"border-[var(--border)] text-[var(--text-primary)] hover:border-[var(--text-muted)]"} ${a?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[t.jsx("span",{className:r?"":"text-[var(--text-muted)]",children:m}),t.jsx(b,{size:12,className:`ml-2 shrink-0 text-[var(--text-muted)] transition-transform ${n?"rotate-180":""}`})]}),n&&t.jsx("div",{className:"absolute left-0 z-50 mt-1 max-h-48 w-full overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] py-1 shadow-lg",children:l.map(e=>t.jsxs("button",{type:"button",onClick:()=>{i(e.value),s(!1)},className:`flex w-full items-center px-3 py-1.5 text-left font-mono text-xs transition-colors ${e.value===r?"bg-[var(--accent)]/10 text-[var(--accent)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.value===r&&t.jsx("span",{className:"mr-2 text-[var(--accent)]",children:">"}),e.label]},e.value))})]})}export{h as S};
@@ -0,0 +1,6 @@
1
+ import{c as h,a as v,r,j as e,f as m,t as x}from"./index-CluWJF_4.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const _=h("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),b=[{nameKey:"admin.scheduling",fields:[{key:"max_concurrent_tasks_per_machine",labelKey:"admin.max_concurrent_tasks",descKey:"admin.max_concurrent_tasks_desc",type:"number",placeholder:"3"},{key:"task_timeout_minutes",labelKey:"admin.task_timeout",descKey:"admin.task_timeout_desc",type:"number",placeholder:"120"}]},{nameKey:"admin.heartbeat",fields:[{key:"heartbeat_interval_seconds",labelKey:"admin.heartbeat_interval",descKey:"admin.heartbeat_interval_desc",type:"number",placeholder:"30"}]},{nameKey:"admin.output",fields:[{key:"machine_offline_threshold_seconds",labelKey:"admin.machine_offline_threshold",descKey:"admin.machine_offline_threshold_desc",type:"number",placeholder:"90"}]},{nameKey:"admin.defaults",fields:[{key:"default_agent_type",labelKey:"admin.default_agent_type",descKey:"admin.default_agent_type_desc",type:"text",placeholder:"claude-code"},{key:"server_url",labelKey:"admin.server_url",descKey:"admin.server_url_desc",type:"text",placeholder:"https://overlord.example.com"}]}];function f(){const{t:a}=v(),[i,d]=r.useState({}),[c,u]=r.useState(!0),[l,o]=r.useState(!1);r.useEffect(()=>{async function s(){try{const t=await m.get("admin/settings").json();d(t)}catch{}finally{u(!1)}}s()},[]);const y=(s,t)=>{d(n=>({...n,[s]:t}))},p=async()=>{o(!0);try{const s=await m.put("admin/settings",{json:i}).json();d(s),x.success(a("admin.settings_saved"))}catch{x.error(a("admin.failed_to_save_settings"))}finally{o(!1)}};return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.settings_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.settings_subtitle")})]}),c?e.jsx("div",{className:"py-16 text-center text-xs text-[var(--text-muted)]",children:a("admin.loading_settings")}):e.jsxs("div",{className:"space-y-6",children:[b.map(s=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-xs font-medium text-[var(--text-primary)]",children:a(s.nameKey)}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-4",children:s.fields.map(t=>e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-[var(--text-primary)]",children:a(t.labelKey)}),e.jsx("p",{className:"mb-2 text-[10px] text-[var(--text-muted)]",children:a(t.descKey)}),e.jsx("input",{type:"text",inputMode:t.type==="number"?"numeric":void 0,pattern:t.type==="number"?"[0-9]*":void 0,value:i[t.key]??"",onChange:n=>{t.type==="number"&&n.target.value&&!/^\d*$/.test(n.target.value)||y(t.key,n.target.value)},placeholder:t.placeholder,className:"w-full max-w-[200px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]},t.key))})]},s.nameKey)),e.jsx("div",{children:e.jsxs("button",{type:"button",onClick:p,disabled:l||c,className:"flex items-center gap-2 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(_,{size:12}),a(l?"common.saving":"admin.save_settings")]})})]})]})}export{f as default};
@@ -0,0 +1 @@
1
+ import{j as e}from"./index-CluWJF_4.js";const n="rounded-[4px] bg-[var(--border)] animate-pulse";function c({rows:r=5}){const a=[[60,200,80,120],[60,160,100,80],[60,220,70,140],[60,180,90,100],[60,190,110,90]];return e.jsx("div",{className:"flex flex-col gap-3",children:Array.from({length:r}).map((s,l)=>{const t=a[l%a.length];return e.jsx("div",{className:"flex gap-4",children:t.map((i,o)=>e.jsx("div",{className:n,style:{width:i,height:12}},o))},l)})})}function m({cards:r=4}){return e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Array.from({length:r}).map((a,s)=>e.jsx("div",{className:`${n} h-20`},s))})}export{m as C,c as T};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright (c) 2014 The xterm.js authors. All rights reserved.
3
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
4
+ * https://github.com/chjj/term.js
5
+ * @license MIT
6
+ *
7
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ * of this software and associated documentation files (the "Software"), to deal
9
+ * in the Software without restriction, including without limitation the rights
10
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ * copies of the Software, and to permit persons to whom the Software is
12
+ * furnished to do so, subject to the following conditions:
13
+ *
14
+ * The above copyright notice and this permission notice shall be included in
15
+ * all copies or substantial portions of the Software.
16
+ *
17
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ * THE SOFTWARE.
24
+ *
25
+ * Originally forked from (with the author's permission):
26
+ * Fabrice Bellard's javascript vt100 for jslinux:
27
+ * http://bellard.org/jslinux/
28
+ * Copyright (c) 2011 Fabrice Bellard
29
+ * The original design remains. The terminal itself
30
+ * has been extended to include xterm CSI codes, among
31
+ * other features.
32
+ */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}