@overlordai/server 1.0.35 → 1.0.37

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 (58) hide show
  1. package/dist/database/repositories/machine.repository.d.ts +1 -0
  2. package/dist/database/repositories/machine.repository.d.ts.map +1 -1
  3. package/dist/database/repositories/machine.repository.js +6 -0
  4. package/dist/database/repositories/machine.repository.js.map +1 -1
  5. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  6. package/dist/dispatcher/dispatcher.service.js +12 -4
  7. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  8. package/package.json +2 -2
  9. package/public/assets/{AccessTokensPage-DTrIditb.js → AccessTokensPage-ojllPkL9.js} +1 -1
  10. package/public/assets/{AdminPage-spE4NopL.js → AdminPage-DT5Gz95n.js} +1 -1
  11. package/public/assets/{ApiReferencePage-BQTlr1a3.js → ApiReferencePage-ClkFkTlQ.js} +1 -1
  12. package/public/assets/{AuditLogPage-DpWVEOeD.js → AuditLogPage-ItQ-a-Ug.js} +1 -1
  13. package/public/assets/{BotManage-BHIfrSQ9.js → BotManage-B6ghS4AS.js} +1 -1
  14. package/public/assets/{CliReferencePage-BpD75e6J.js → CliReferencePage-Dp2FlU4w.js} +1 -1
  15. package/public/assets/{DeveloperManage-w3ZCt_NM.js → DeveloperManage-Dd69OOTz.js} +1 -1
  16. package/public/assets/EditProjectPage-CHOX_K9y.js +2 -0
  17. package/public/assets/{EmptyState-C9vei1H4.js → EmptyState-CqOs-r87.js} +1 -1
  18. package/public/assets/{HomePage-CPg4Qc6p.js → HomePage-BFeB9nZ3.js} +1 -1
  19. package/public/assets/{LandingPage-B6mDnkMI.js → LandingPage-J4rOJEzd.js} +1 -1
  20. package/public/assets/{LoginPage-lTCE4PWV.js → LoginPage-DZSKqR5I.js} +1 -1
  21. package/public/assets/{MachineDetailPage-CVj-dTHS.js → MachineDetailPage-CLbJ-Pzk.js} +1 -1
  22. package/public/assets/{MachineListPage-DQq5DZFL.js → MachineListPage-D5AjVzuP.js} +1 -1
  23. package/public/assets/{NotFoundPage-COyyGIMN.js → NotFoundPage-DBAUSGVI.js} +1 -1
  24. package/public/assets/{PipelineEditorPage-DEw5xksl.js → PipelineEditorPage-C2Oc_jPg.js} +1 -1
  25. package/public/assets/{ProfilePage-DjFeJa-r.js → ProfilePage-C95OfWvM.js} +1 -1
  26. package/public/assets/{ProjectDetailPage-Bi4r2iHL.js → ProjectDetailPage-Cv_Vkdmn.js} +3 -3
  27. package/public/assets/{ProjectListPage-BKuhnPBI.js → ProjectListPage-Cb3X53kU.js} +1 -1
  28. package/public/assets/{QuickAuth-L60GzSOW.js → QuickAuth-BZuEWnXM.js} +1 -1
  29. package/public/assets/{RemoveMemberConfirmDialog-2jr0B-lt.js → RemoveMemberConfirmDialog-DJc5TI2H.js} +1 -1
  30. package/public/assets/{Select-DOPqCoVh.js → Select-vE59gnrR.js} +1 -1
  31. package/public/assets/{SettingsPage-BPNWmxTz.js → SettingsPage-bUzbAlJ5.js} +1 -1
  32. package/public/assets/{Skeleton-DRiV4Mc_.js → Skeleton-DkWfJwGk.js} +1 -1
  33. package/public/assets/{SkillPage-CtW_Yh-Z.js → SkillPage-KxhNwqaU.js} +1 -1
  34. package/public/assets/{TaskDetailPage-BONY8TYd.js → TaskDetailPage-DcbvNDx0.js} +1 -1
  35. package/public/assets/{TaskListPage-D86Z1p5a.js → TaskListPage-BCXlj6fs.js} +1 -1
  36. package/public/assets/{TaskStatusBadge-BOkVIY-S.js → TaskStatusBadge-C6STyltI.js} +1 -1
  37. package/public/assets/{TokenManage-DJ5FKh1g.js → TokenManage-DfPGpCx-.js} +1 -1
  38. package/public/assets/{TotpSetupPage-D4zL65kY.js → TotpSetupPage-Xa8ezAxQ.js} +1 -1
  39. package/public/assets/{WorkerSetupGuidePage-DkERqTk-.js → WorkerSetupGuidePage-QJry2UPm.js} +1 -1
  40. package/public/assets/{arrow-left-rWVL-A4T.js → arrow-left-_sT90Vgd.js} +1 -1
  41. package/public/assets/{arrow-right-DES2lofC.js → arrow-right-BrkUEdML.js} +1 -1
  42. package/public/assets/{bot-Bjj1z-2h.js → bot-D0OdHc2O.js} +1 -1
  43. package/public/assets/{chevron-right-CNgok700.js → chevron-right-DE9L0bkk.js} +1 -1
  44. package/public/assets/{copy-CpdsOI_O.js → copy-DeIFkKL0.js} +1 -1
  45. package/public/assets/{external-link-Cp9i7osW.js → external-link-8WYxL39M.js} +1 -1
  46. package/public/assets/{index-BdEJ0aTM.js → index-IC0w3nms.js} +2 -2
  47. package/public/assets/{key-D6HzwwXl.js → key-BWK1AZ5R.js} +1 -1
  48. package/public/assets/{loader-circle-CwvOmGaz.js → loader-circle-CjjIeO9t.js} +1 -1
  49. package/public/assets/{pencil-D6ZHfLK_.js → pencil-BIUaEBhE.js} +1 -1
  50. package/public/assets/{plus-8YfTJ47b.js → plus-DAoE-jeh.js} +1 -1
  51. package/public/assets/{rotate-ccw-CrJHxzN4.js → rotate-ccw-CY2m880Q.js} +1 -1
  52. package/public/assets/{scroll-text-dlAJEgcC.js → scroll-text-C4o9sGsu.js} +1 -1
  53. package/public/assets/{settings-B5JVwtOy.js → settings-CRoMlkO8.js} +1 -1
  54. package/public/assets/{task.store-CR5aAb6q.js → task.store-DDFQ0jcG.js} +1 -1
  55. package/public/assets/{trash-2-Dkm6k-XU.js → trash-2-CopJbaLA.js} +1 -1
  56. package/public/assets/{users-Bb4kMVG2.js → users-C5PA9aph.js} +1 -1
  57. package/public/index.html +1 -1
  58. package/public/assets/EditProjectPage-BWYk0T8l.js +0 -2
@@ -1 +1 @@
1
- import{u as I,r as i,j as e,X as z,C as X,L as N,d as Q,a as $,f as u}from"./index-BdEJ0aTM.js";import{M as h}from"./protocol-C5uQmiiB.js";import{T as A}from"./TaskStatusBadge-BOkVIY-S.js";import{T as w}from"./Skeleton-DRiV4Mc_.js";import{C as U}from"./chevron-right-CNgok700.js";import{A as S}from"./arrow-right-DES2lofC.js";function W(){return[{id:"admin_create_project",title:"create your first project",description:"set up a project with a git repo and pipeline",link:"/projects",linkLabel:"go to projects",autoDetect:!0},{id:"admin_register_worker",title:"register a worker machine",description:"generate a token and set up a worker to run tasks",link:"/machines",linkLabel:"go to machines",autoDetect:!0},{id:"admin_create_developer",title:"create a developer account",description:"add team members who can create and monitor tasks",link:"/admin/developers",linkLabel:"manage developers",autoDetect:!0},{id:"admin_first_task",title:"create your first task",description:"verify the full pipeline works end-to-end",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}function Z(){return[{id:"lead_view_projects",title:"view your projects",description:"check the projects assigned to you",link:"/projects",linkLabel:"go to projects"},{id:"lead_configure_pipeline",title:"configure a pipeline",description:"set up stages for your project workflow",link:"/projects",linkLabel:"go to projects"},{id:"lead_add_member",title:"add a team member",description:"invite developers to your project",link:"/projects",linkLabel:"go to projects"},{id:"lead_first_task",title:"create your first task",description:"submit a task and watch it execute",link:"/tasks",linkLabel:"go to tasks"}]}function ee(){return[{id:"dev_install_cli",title:"install the ov cli",description:"npm install -g @overlordai/developer-cli",link:"/docs/cli",linkLabel:"cli"},{id:"dev_setup_cli",title:"run ov setup",description:"connect to the server and authenticate",link:"/docs/cli",linkLabel:"setup guide"},{id:"dev_view_projects",title:"explore projects",description:"browse available projects and their pipelines",link:"/projects",linkLabel:"go to projects"},{id:"dev_first_task",title:"create your first task",description:"submit a task via web or cli",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}const O="overlord_onboarding";function te(){try{const n=localStorage.getItem(O);if(n)return JSON.parse(n)}catch{}return{dismissed:!1,completed:{}}}function E(n){localStorage.setItem(O,JSON.stringify(n))}function se({data:n}){const s=I(r=>{var c;return(c=r.user)==null?void 0:c.role}),[o,a]=i.useState(te),d=s==="admin"?W():s==="lead"||s==="maintainer"?Z():ee(),l=i.useCallback(r=>{if(o.completed[r.id])return!0;if(!r.autoDetect)return!1;switch(r.id){case"admin_create_project":return n.totalProjects>0;case"admin_register_worker":return n.totalMachines>0;case"admin_create_developer":return n.totalDevelopers>1;case"admin_first_task":case"dev_first_task":return n.activeTasks>0;default:return!1}},[o.completed,n]),x=d.filter(l).length,p=x===d.length,k=i.useCallback(r=>{a(c=>{const f={...c,completed:{...c.completed,[r]:!c.completed[r]}};return E(f),f})},[]),v=i.useCallback(()=>{a(r=>{const c={...r,dismissed:!0};return E(c),c})},[]);if(o.dismissed)return null;const b=Math.round(x/d.length*100);return e.jsxs("div",{className:"mb-6 md:mb-8 rounded-[4px] border border-[var(--accent)]/30 bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:"// getting started"}),e.jsxs("span",{className:"text-[10px] text-[var(--text-muted)]",children:[x,"/",d.length," completed"]})]}),e.jsx("button",{onClick:v,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",title:"dismiss",children:e.jsx(z,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"h-0.5 bg-[var(--border)]",children:e.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-500",style:{width:`${b}%`}})}),e.jsx("div",{className:"divide-y divide-[var(--border)]",children:d.map(r=>{const c=l(r);return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("button",{onClick:()=>!r.autoDetect&&k(r.id),className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors ${c?"border-[var(--accent)] bg-[var(--accent)]":"border-[var(--border)] hover:border-[var(--text-muted)]"} ${r.autoDetect?"cursor-default":"cursor-pointer"}`,children:c&&e.jsx(X,{className:"h-2.5 w-2.5 text-black"})}),e.jsxs("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:`text-xs ${c?"text-[var(--text-muted)] line-through":"text-[var(--text-primary)]"}`,children:r.title}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)] truncate",children:r.description})]}),r.link&&!c&&e.jsxs(N,{to:r.link,className:"ml-3 flex shrink-0 items-center gap-1 text-[10px] text-[var(--accent)] hover:underline",children:[r.linkLabel," ",e.jsx(U,{className:"h-3 w-3"})]})]})]},r.id)})}),p&&e.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 text-center",children:[e.jsx("span",{className:"text-xs text-[var(--accent)]",children:"all set! you're ready to go."}),e.jsx("button",{onClick:v,className:"ml-3 text-[10px] text-[var(--text-muted)] underline hover:text-[var(--text-primary)]",children:"dismiss"})]})]})}const ae=3e4,re=[{key:"active_tasks",labelKey:"dashboard.active_tasks"},{key:"queued_tasks",labelKey:"dashboard.queued_tasks"},{key:"online_workers",labelKey:"dashboard.online_workers"},{key:"completed_today",labelKey:"dashboard.completed_today"}],ne=["mon","tue","wed","thu","fri","sat","sun"];function L(n){const s=Date.now(),o=new Date(n).getTime(),a=s-o,d=Math.floor(a/6e4);if(d<1)return"just now";if(d<60)return`${d}m ago`;const l=Math.floor(d/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function ie(n,s){return n.length<=s?n:n.slice(0,s)+"..."}function le({dailyRates:n,overallRate:s}){const{t:o}=$(),a=ne.map((l,x)=>({label:l,value:n[x]??0})),d=Math.max(...a.map(l=>l.value),1);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[s,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:o("dashboard.last_7_days")})]}),e.jsx("div",{className:"flex gap-2",style:{height:80},children:a.map(l=>{const x=d>0?Math.max(l.value/d*100,4):4;return e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("div",{className:"relative w-full h-full rounded-[4px]",style:{backgroundColor:"rgba(34,197,94,0.1)"},children:e.jsx("div",{className:"absolute bottom-0 left-0 right-0 rounded-[4px]",style:{height:`${x}%`,backgroundColor:l.value>=80?"var(--accent)":l.value>=50?"var(--warning)":"var(--destructive)"}})}),e.jsx("span",{className:"shrink-0 text-[10px] text-[var(--text-muted)]",children:l.label})]},l.label)})})]})}function he(){const n=Q(),{t:s}=$(),o=I(t=>{var m;return((m=t.user)==null?void 0:m.role)==="admin"}),[a,d]=i.useState(null),[l,x]=i.useState([]),[p,k]=i.useState([]),[v,b]=i.useState([]),[r,c]=i.useState(0),[f,F]=i.useState(0),[C,K]=i.useState(!0),[P,G]=i.useState(!0),[q,B]=i.useState(!0),[H,J]=i.useState(!0),j=i.useCallback(async()=>{try{const t=await u.get("web/dashboard/stats").json();d(t)}catch{}finally{K(!1)}},[]),g=i.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-tasks",{searchParams:{limit:"5"}}).json();x(t)}catch{}finally{G(!1)}},[]),D=i.useCallback(async()=>{try{const t=await u.get("web/machines").json();k(t)}catch{}finally{B(!1)}},[]),M=i.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-activity").json();b(t)}catch{b([])}finally{J(!1)}},[]);i.useEffect(()=>{j(),g(),D(),M(),u.get("web/projects").json().then(t=>c(t.length)).catch(()=>{}),o&&u.get("admin/developers").json().then(t=>F(t.length)).catch(()=>{})},[j,g,D,M,o]);const y=i.useRef(null);i.useEffect(()=>(y.current=setInterval(()=>{j(),g()},ae),()=>{y.current&&clearInterval(y.current)}),[j,g]);const R=(a==null?void 0:a.success_rate_daily)??null,T=(a==null?void 0:a.task_success_rate_7d)??0;function V(t){switch(t){case h.ONLINE:return"var(--accent)";case h.DRAINING:return"var(--warning)";case h.OFFLINE:default:return"var(--text-muted)"}}function Y(t){switch(t){case h.ONLINE:return s("dashboard.online");case h.DRAINING:return s("dashboard.idle");case h.OFFLINE:default:return s("dashboard.offline")}}return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-6 md:py-8 font-mono",children:[e.jsx("div",{className:"mb-4 md:hidden",children:e.jsxs("span",{className:"text-base font-bold text-[var(--accent)]",children:["// ",s("dashboard.title")]})}),e.jsx("div",{className:"mb-6 md:mb-8 grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children:re.map(({key:t,labelKey:m})=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-4",children:[e.jsxs("span",{className:"text-[9px] md:text-xs text-[var(--text-muted)]",children:[s(m),":"]}),C?e.jsx("div",{className:"mt-1 h-6 md:h-8 w-12 md:w-16 animate-pulse rounded bg-[var(--bg-input)]"}):e.jsx("div",{className:"mt-1 flex items-baseline gap-2",children:e.jsx("span",{className:"text-2xl md:text-3xl font-bold text-[var(--text-primary)]",children:(a==null?void 0:a[t])??0})})]},t))}),e.jsx(se,{data:{activeTasks:((a==null?void 0:a.active_tasks)??0)+((a==null?void 0:a.queued_tasks)??0),totalMachines:p.length,totalProjects:r,totalDevelopers:f}}),e.jsxs("div",{className:"mb-6 grid gap-6 lg:grid-cols-3 items-stretch",children:[e.jsx("div",{className:"hidden md:flex flex-col gap-6 lg:col-span-2",children:e.jsxs("div",{className:"flex flex-1 flex-col rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("div",{className:"border-b border-[var(--border)] px-5 py-3",children:e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.task_success_rate")})}),e.jsx("div",{className:"flex flex-1 flex-col justify-center p-5",children:C?e.jsx("div",{className:"h-24 animate-pulse rounded bg-[var(--bg-input)]"}):R?e.jsx(le,{dailyRates:R,overallRate:T}):e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[T,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.daily_breakdown_not_available")})]})})]})}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] md:border",children:[e.jsxs("div",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.recent_tasks")}),e.jsxs(N,{to:"/tasks",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"flex md:hidden items-center justify-between px-3 py-3",children:e.jsx("h2",{className:"text-xs font-bold text-[var(--accent)]",children:s("dashboard.recent_tasks")})}),e.jsx("div",{className:"px-3 pb-3 md:p-4",children:P?e.jsx(w,{rows:4}):l.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.no_tasks_yet")})]}):e.jsx("div",{className:"flex flex-col gap-2 md:gap-0",children:l.map(t=>e.jsxs("div",{onClick:()=>n(`/tasks/${t.id}`),className:"flex cursor-pointer items-center gap-3 rounded-[4px] border border-[var(--border)] p-3 transition-colors hover:bg-[var(--bg-input)] md:rounded-none md:border-0 md:border-b md:border-[var(--border-row)] md:p-0 md:py-2.5 last:md:border-b-0",children:[e.jsxs("div",{className:"flex-1 min-w-0 md:hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[10px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",t.id," ",t.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(A,{status:t.status})})]}),e.jsx("span",{className:"text-[9px] text-[var(--text-muted)] mt-1 block",children:L(t.created_at)})]}),e.jsxs("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:["#",t.id]}),e.jsx("span",{className:"hidden md:inline flex-1 text-xs text-[var(--text-primary)] truncate",children:ie(t.description,40)}),e.jsx("span",{className:"hidden md:inline",children:e.jsx(A,{status:t.status})}),e.jsx("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:L(t.created_at)})]},t.id))})})]})]}),e.jsxs("div",{className:"hidden md:grid gap-6 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.worker_status")}),e.jsxs(N,{to:"/machines",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:q?e.jsx(w,{rows:3}):p.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.no_workers_registered")})]}):e.jsx("div",{className:"flex flex-col",children:p.map(t=>e.jsxs("div",{onClick:()=>n(`/machines/${t.id}`),className:"flex cursor-pointer items-center justify-between border-b border-[var(--border-row)] py-2.5 transition-colors hover:bg-[var(--bg-input)] last:border-b-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t.host??"--"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:[t.activeSlots,"/",t.maxSlots," ",s("dashboard.slots")]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs",style:{color:V(t.status)},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),Y(t.status)]})]})]},t.id))})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.recent_activity")}),o&&e.jsxs(N,{to:"/admin/audit-logs",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:H?e.jsx(w,{rows:4}):v.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.no_recent_activity")})]}):e.jsx("div",{className:"flex flex-col",children:v.map(t=>{const m=t.message.match(/task\s*#?(\d+)/i),_=m?m[1]:null;return e.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border-row)] py-2 last:border-b-0 ${_?"cursor-pointer hover:bg-[var(--bg-input)] transition-colors":""}`,onClick:()=>_&&n(`/tasks/${_}`),children:[e.jsx("span",{className:"shrink-0 text-xs text-[var(--text-muted)]",children:L(t.timestamp)}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:t.message})]},t.id)})})})]})]})]})}export{he as default};
1
+ import{u as I,r as i,j as e,X as z,C as X,L as N,d as Q,a as $,f as u}from"./index-IC0w3nms.js";import{M as h}from"./protocol-C5uQmiiB.js";import{T as A}from"./TaskStatusBadge-C6STyltI.js";import{T as w}from"./Skeleton-DkWfJwGk.js";import{C as U}from"./chevron-right-DE9L0bkk.js";import{A as S}from"./arrow-right-BrkUEdML.js";function W(){return[{id:"admin_create_project",title:"create your first project",description:"set up a project with a git repo and pipeline",link:"/projects",linkLabel:"go to projects",autoDetect:!0},{id:"admin_register_worker",title:"register a worker machine",description:"generate a token and set up a worker to run tasks",link:"/machines",linkLabel:"go to machines",autoDetect:!0},{id:"admin_create_developer",title:"create a developer account",description:"add team members who can create and monitor tasks",link:"/admin/developers",linkLabel:"manage developers",autoDetect:!0},{id:"admin_first_task",title:"create your first task",description:"verify the full pipeline works end-to-end",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}function Z(){return[{id:"lead_view_projects",title:"view your projects",description:"check the projects assigned to you",link:"/projects",linkLabel:"go to projects"},{id:"lead_configure_pipeline",title:"configure a pipeline",description:"set up stages for your project workflow",link:"/projects",linkLabel:"go to projects"},{id:"lead_add_member",title:"add a team member",description:"invite developers to your project",link:"/projects",linkLabel:"go to projects"},{id:"lead_first_task",title:"create your first task",description:"submit a task and watch it execute",link:"/tasks",linkLabel:"go to tasks"}]}function ee(){return[{id:"dev_install_cli",title:"install the ov cli",description:"npm install -g @overlordai/developer-cli",link:"/docs/cli",linkLabel:"cli"},{id:"dev_setup_cli",title:"run ov setup",description:"connect to the server and authenticate",link:"/docs/cli",linkLabel:"setup guide"},{id:"dev_view_projects",title:"explore projects",description:"browse available projects and their pipelines",link:"/projects",linkLabel:"go to projects"},{id:"dev_first_task",title:"create your first task",description:"submit a task via web or cli",link:"/tasks",linkLabel:"go to tasks",autoDetect:!0}]}const O="overlord_onboarding";function te(){try{const n=localStorage.getItem(O);if(n)return JSON.parse(n)}catch{}return{dismissed:!1,completed:{}}}function E(n){localStorage.setItem(O,JSON.stringify(n))}function se({data:n}){const s=I(r=>{var c;return(c=r.user)==null?void 0:c.role}),[o,a]=i.useState(te),d=s==="admin"?W():s==="lead"||s==="maintainer"?Z():ee(),l=i.useCallback(r=>{if(o.completed[r.id])return!0;if(!r.autoDetect)return!1;switch(r.id){case"admin_create_project":return n.totalProjects>0;case"admin_register_worker":return n.totalMachines>0;case"admin_create_developer":return n.totalDevelopers>1;case"admin_first_task":case"dev_first_task":return n.activeTasks>0;default:return!1}},[o.completed,n]),x=d.filter(l).length,p=x===d.length,k=i.useCallback(r=>{a(c=>{const f={...c,completed:{...c.completed,[r]:!c.completed[r]}};return E(f),f})},[]),v=i.useCallback(()=>{a(r=>{const c={...r,dismissed:!0};return E(c),c})},[]);if(o.dismissed)return null;const b=Math.round(x/d.length*100);return e.jsxs("div",{className:"mb-6 md:mb-8 rounded-[4px] border border-[var(--accent)]/30 bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:"// getting started"}),e.jsxs("span",{className:"text-[10px] text-[var(--text-muted)]",children:[x,"/",d.length," completed"]})]}),e.jsx("button",{onClick:v,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",title:"dismiss",children:e.jsx(z,{className:"h-3.5 w-3.5"})})]}),e.jsx("div",{className:"h-0.5 bg-[var(--border)]",children:e.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-500",style:{width:`${b}%`}})}),e.jsx("div",{className:"divide-y divide-[var(--border)]",children:d.map(r=>{const c=l(r);return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("button",{onClick:()=>!r.autoDetect&&k(r.id),className:`flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px] border transition-colors ${c?"border-[var(--accent)] bg-[var(--accent)]":"border-[var(--border)] hover:border-[var(--text-muted)]"} ${r.autoDetect?"cursor-default":"cursor-pointer"}`,children:c&&e.jsx(X,{className:"h-2.5 w-2.5 text-black"})}),e.jsxs("div",{className:"flex flex-1 items-center justify-between min-w-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:`text-xs ${c?"text-[var(--text-muted)] line-through":"text-[var(--text-primary)]"}`,children:r.title}),e.jsx("p",{className:"text-[10px] text-[var(--text-muted)] truncate",children:r.description})]}),r.link&&!c&&e.jsxs(N,{to:r.link,className:"ml-3 flex shrink-0 items-center gap-1 text-[10px] text-[var(--accent)] hover:underline",children:[r.linkLabel," ",e.jsx(U,{className:"h-3 w-3"})]})]})]},r.id)})}),p&&e.jsxs("div",{className:"border-t border-[var(--border)] px-4 py-3 text-center",children:[e.jsx("span",{className:"text-xs text-[var(--accent)]",children:"all set! you're ready to go."}),e.jsx("button",{onClick:v,className:"ml-3 text-[10px] text-[var(--text-muted)] underline hover:text-[var(--text-primary)]",children:"dismiss"})]})]})}const ae=3e4,re=[{key:"active_tasks",labelKey:"dashboard.active_tasks"},{key:"queued_tasks",labelKey:"dashboard.queued_tasks"},{key:"online_workers",labelKey:"dashboard.online_workers"},{key:"completed_today",labelKey:"dashboard.completed_today"}],ne=["mon","tue","wed","thu","fri","sat","sun"];function L(n){const s=Date.now(),o=new Date(n).getTime(),a=s-o,d=Math.floor(a/6e4);if(d<1)return"just now";if(d<60)return`${d}m ago`;const l=Math.floor(d/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function ie(n,s){return n.length<=s?n:n.slice(0,s)+"..."}function le({dailyRates:n,overallRate:s}){const{t:o}=$(),a=ne.map((l,x)=>({label:l,value:n[x]??0})),d=Math.max(...a.map(l=>l.value),1);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3 flex items-baseline gap-2",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[s,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:o("dashboard.last_7_days")})]}),e.jsx("div",{className:"flex gap-2",style:{height:80},children:a.map(l=>{const x=d>0?Math.max(l.value/d*100,4):4;return e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("div",{className:"relative w-full h-full rounded-[4px]",style:{backgroundColor:"rgba(34,197,94,0.1)"},children:e.jsx("div",{className:"absolute bottom-0 left-0 right-0 rounded-[4px]",style:{height:`${x}%`,backgroundColor:l.value>=80?"var(--accent)":l.value>=50?"var(--warning)":"var(--destructive)"}})}),e.jsx("span",{className:"shrink-0 text-[10px] text-[var(--text-muted)]",children:l.label})]},l.label)})})]})}function he(){const n=Q(),{t:s}=$(),o=I(t=>{var m;return((m=t.user)==null?void 0:m.role)==="admin"}),[a,d]=i.useState(null),[l,x]=i.useState([]),[p,k]=i.useState([]),[v,b]=i.useState([]),[r,c]=i.useState(0),[f,F]=i.useState(0),[C,K]=i.useState(!0),[P,G]=i.useState(!0),[q,B]=i.useState(!0),[H,J]=i.useState(!0),j=i.useCallback(async()=>{try{const t=await u.get("web/dashboard/stats").json();d(t)}catch{}finally{K(!1)}},[]),g=i.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-tasks",{searchParams:{limit:"5"}}).json();x(t)}catch{}finally{G(!1)}},[]),D=i.useCallback(async()=>{try{const t=await u.get("web/machines").json();k(t)}catch{}finally{B(!1)}},[]),M=i.useCallback(async()=>{try{const t=await u.get("web/dashboard/recent-activity").json();b(t)}catch{b([])}finally{J(!1)}},[]);i.useEffect(()=>{j(),g(),D(),M(),u.get("web/projects").json().then(t=>c(t.length)).catch(()=>{}),o&&u.get("admin/developers").json().then(t=>F(t.length)).catch(()=>{})},[j,g,D,M,o]);const y=i.useRef(null);i.useEffect(()=>(y.current=setInterval(()=>{j(),g()},ae),()=>{y.current&&clearInterval(y.current)}),[j,g]);const R=(a==null?void 0:a.success_rate_daily)??null,T=(a==null?void 0:a.task_success_rate_7d)??0;function V(t){switch(t){case h.ONLINE:return"var(--accent)";case h.DRAINING:return"var(--warning)";case h.OFFLINE:default:return"var(--text-muted)"}}function Y(t){switch(t){case h.ONLINE:return s("dashboard.online");case h.DRAINING:return s("dashboard.idle");case h.OFFLINE:default:return s("dashboard.offline")}}return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-6 md:py-8 font-mono",children:[e.jsx("div",{className:"mb-4 md:hidden",children:e.jsxs("span",{className:"text-base font-bold text-[var(--accent)]",children:["// ",s("dashboard.title")]})}),e.jsx("div",{className:"mb-6 md:mb-8 grid grid-cols-2 gap-3 md:gap-4 lg:grid-cols-4",children:re.map(({key:t,labelKey:m})=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-4",children:[e.jsxs("span",{className:"text-[9px] md:text-xs text-[var(--text-muted)]",children:[s(m),":"]}),C?e.jsx("div",{className:"mt-1 h-6 md:h-8 w-12 md:w-16 animate-pulse rounded bg-[var(--bg-input)]"}):e.jsx("div",{className:"mt-1 flex items-baseline gap-2",children:e.jsx("span",{className:"text-2xl md:text-3xl font-bold text-[var(--text-primary)]",children:(a==null?void 0:a[t])??0})})]},t))}),e.jsx(se,{data:{activeTasks:((a==null?void 0:a.active_tasks)??0)+((a==null?void 0:a.queued_tasks)??0),totalMachines:p.length,totalProjects:r,totalDevelopers:f}}),e.jsxs("div",{className:"mb-6 grid gap-6 lg:grid-cols-3 items-stretch",children:[e.jsx("div",{className:"hidden md:flex flex-col gap-6 lg:col-span-2",children:e.jsxs("div",{className:"flex flex-1 flex-col rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("div",{className:"border-b border-[var(--border)] px-5 py-3",children:e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.task_success_rate")})}),e.jsx("div",{className:"flex flex-1 flex-col justify-center p-5",children:C?e.jsx("div",{className:"h-24 animate-pulse rounded bg-[var(--bg-input)]"}):R?e.jsx(le,{dailyRates:R,overallRate:T}):e.jsxs("div",{className:"flex flex-col items-center gap-2 py-6",children:[e.jsxs("span",{className:"text-2xl font-bold text-[var(--text-primary)]",children:[T,"%"]}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.daily_breakdown_not_available")})]})})]})}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] md:border",children:[e.jsxs("div",{className:"hidden md:flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.recent_tasks")}),e.jsxs(N,{to:"/tasks",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"flex md:hidden items-center justify-between px-3 py-3",children:e.jsx("h2",{className:"text-xs font-bold text-[var(--accent)]",children:s("dashboard.recent_tasks")})}),e.jsx("div",{className:"px-3 pb-3 md:p-4",children:P?e.jsx(w,{rows:4}):l.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.no_tasks_yet")})]}):e.jsx("div",{className:"flex flex-col gap-2 md:gap-0",children:l.map(t=>e.jsxs("div",{onClick:()=>n(`/tasks/${t.id}`),className:"flex cursor-pointer items-center gap-3 rounded-[4px] border border-[var(--border)] p-3 transition-colors hover:bg-[var(--bg-input)] md:rounded-none md:border-0 md:border-b md:border-[var(--border-row)] md:p-0 md:py-2.5 last:md:border-b-0",children:[e.jsxs("div",{className:"flex-1 min-w-0 md:hidden",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[10px] text-[var(--text-primary)] leading-tight",style:{wordBreak:"break-word"},children:["#",t.id," ",t.description]}),e.jsx("span",{className:"shrink-0",children:e.jsx(A,{status:t.status})})]}),e.jsx("span",{className:"text-[9px] text-[var(--text-muted)] mt-1 block",children:L(t.created_at)})]}),e.jsxs("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:["#",t.id]}),e.jsx("span",{className:"hidden md:inline flex-1 text-xs text-[var(--text-primary)] truncate",children:ie(t.description,40)}),e.jsx("span",{className:"hidden md:inline",children:e.jsx(A,{status:t.status})}),e.jsx("span",{className:"hidden md:inline shrink-0 text-xs text-[var(--text-muted)]",children:L(t.created_at)})]},t.id))})})]})]}),e.jsxs("div",{className:"hidden md:grid gap-6 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.worker_status")}),e.jsxs(N,{to:"/machines",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:q?e.jsx(w,{rows:3}):p.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.no_workers_registered")})]}):e.jsx("div",{className:"flex flex-col",children:p.map(t=>e.jsxs("div",{onClick:()=>n(`/machines/${t.id}`),className:"flex cursor-pointer items-center justify-between border-b border-[var(--border-row)] py-2.5 transition-colors hover:bg-[var(--bg-input)] last:border-b-0",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.name}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t.host??"--"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:[t.activeSlots,"/",t.maxSlots," ",s("dashboard.slots")]}),e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs",style:{color:V(t.status)},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),Y(t.status)]})]})]},t.id))})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("dashboard.recent_activity")}),o&&e.jsxs(N,{to:"/admin/audit-logs",className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:[s("common.view_all")," ",e.jsx(S,{className:"h-3 w-3"})]})]}),e.jsx("div",{className:"p-4",children:H?e.jsx(w,{rows:4}):v.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("dashboard.no_recent_activity")})]}):e.jsx("div",{className:"flex flex-col",children:v.map(t=>{const m=t.message.match(/task\s*#?(\d+)/i),_=m?m[1]:null;return e.jsxs("div",{className:`flex items-start gap-3 border-b border-[var(--border-row)] py-2 last:border-b-0 ${_?"cursor-pointer hover:bg-[var(--bg-input)] transition-colors":""}`,onClick:()=>_&&n(`/tasks/${_}`),children:[e.jsx("span",{className:"shrink-0 text-xs text-[var(--text-muted)]",children:L(t.timestamp)}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:t.message})]},t.id)})})})]})]})]})}export{he as default};
@@ -1,4 +1,4 @@
1
- import{c as n,u as m,a as h,j as e,T as p,L as l,b as x,S as y,r as g,C as v}from"./index-BdEJ0aTM.js";import{A as c}from"./arrow-right-DES2lofC.js";import{B as u}from"./bot-Bjj1z-2h.js";import{U as b}from"./users-Bb4kMVG2.js";import{C as j}from"./copy-CpdsOI_O.js";/**
1
+ import{c as n,u as m,a as h,j as e,T as p,L as l,b as x,S as y,r as g,C as v}from"./index-IC0w3nms.js";import{A as c}from"./arrow-right-BrkUEdML.js";import{B as u}from"./bot-D0OdHc2O.js";import{U as b}from"./users-C5PA9aph.js";import{C as j}from"./copy-DeIFkKL0.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{d as W,e as q,u as m,a as I,r as c,j as t,N as k}from"./index-BdEJ0aTM.js";function P(){var w,B;const h=W(),y=q(),x=m(e=>e.login),v=m(e=>e.requireTotpSetup),_=m(e=>e.user),{t:n}=I(),[C,S]=c.useState("credentials"),[u,F]=c.useState(""),[p,z]=c.useState(""),[i,b]=c.useState(""),[l,g]=c.useState(!1),[j,d]=c.useState(""),f=c.useRef([]);if(_&&!v){let e=(B=(w=y.state)==null?void 0:w.from)==null?void 0:B.pathname;return(e==="/totp-setup"||e==="/login")&&(e=void 0),t.jsx(k,{to:e??"/home",replace:!0})}if(v)return t.jsx(k,{to:"/totp-setup",replace:!0});const M=async e=>{var r,o;if(e.preventDefault(),d(""),!u.trim()||!p.trim()){d(n("auth.username_and_password_required"));return}g(!0);try{await x({username:u.trim(),password:p});const a=m.getState();if(a.requireTotpSetup)return;if(a.user){let s=(o=(r=y.state)==null?void 0:r.from)==null?void 0:o.pathname;(s==="/totp-setup"||s==="/login")&&(s=void 0),h(s??"/home",{replace:!0})}}catch(a){const s=a instanceof Error?a.message:n("auth.login_failed");s==="TOTP_REQUIRED"?(S("totp"),d("")):d(s)}finally{g(!1)}},J=async e=>{var r,o;if(e.preventDefault(),d(""),!i.trim()||i.trim().length!==6){d(n("auth.please_enter_valid_6_digit_code"));return}g(!0);try{if(await x({username:u.trim(),password:p,totpCode:i.trim()}),m.getState().user){let s=(o=(r=y.state)==null?void 0:r.from)==null?void 0:o.pathname;(s==="/totp-setup"||s==="/login")&&(s=void 0),h(s??"/home",{replace:!0})}}catch(a){const s=a instanceof Error?a.message:n("auth.invalid_totp_code");d(s)}finally{g(!1)}},R=()=>{S("credentials"),b(""),d("")},T=(e,r)=>{var s;const o=r.replace(/\D/g,"").slice(-1),a=i.split("");for(;a.length<6;)a.push("");a[e]=o,b(a.join("")),o&&e<5&&((s=f.current[e+1])==null||s.focus())},D=(e,r)=>{var o;r.key==="Backspace"&&!i[e]&&e>0&&((o=f.current[e-1])==null||o.focus())},E=e=>{var a;e.preventDefault();const r=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6);b(r);const o=Math.min(r.length,5);(a=f.current[o])==null||a.focus()};return t.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--bg-primary)",padding:"1rem",fontFamily:"'JetBrains Mono', monospace"},children:t.jsxs("div",{style:{width:"100%",maxWidth:"400px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"2rem"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.625rem",marginBottom:"0.25rem"},children:[t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",borderRadius:"4px",backgroundColor:"var(--accent)",fontFamily:"'JetBrains Mono', monospace"},"aria-hidden":!0,children:t.jsx("span",{style:{fontSize:"1.25rem",fontWeight:600,color:"#0C0C0C"},children:"~"})}),t.jsx("span",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:n("landing.overlord")})]}),t.jsx("div",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:"0.75rem",marginBottom:"2rem",fontFamily:"'JetBrains Mono', monospace"},children:n(C==="credentials"?"auth.ai_powered_development_system":"auth.two_factor_verification")}),j&&t.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.75rem",fontFamily:"'JetBrains Mono', monospace",overflowWrap:"break-word",wordBreak:"break-word"},children:j}),C==="credentials"?t.jsxs("form",{onSubmit:M,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.username")}),t.jsx("input",{type:"text",placeholder:n("auth.enter_username"),value:u,onChange:e=>F(e.target.value),autoFocus:!0,autoComplete:"username",required:!0,style:{width:"100%",padding:"0.625rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.875rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},onFocus:e=>e.target.style.borderColor="var(--accent)",onBlur:e=>e.target.style.borderColor="var(--border)"})]}),t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.password")}),t.jsx("input",{type:"password",placeholder:n("auth.enter_password"),value:p,onChange:e=>z(e.target.value),autoComplete:"current-password",required:!0,style:{width:"100%",padding:"0.625rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.875rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},onFocus:e=>e.target.style.borderColor="var(--accent)",onBlur:e=>e.target.style.borderColor="var(--border)"})]}),t.jsx("button",{type:"submit",disabled:l,style:{width:"100%",padding:"0.625rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:l?"not-allowed":"pointer",opacity:l?.7:1,marginTop:"0.5rem"},children:n(l?"common.signing_in":"auth.sign_in")}),t.jsx("button",{type:"button",onClick:()=>h("/"),style:{width:"100%",padding:"0.5rem",backgroundColor:"transparent",border:"none",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:n("common.back")})]},"credentials"):t.jsxs("form",{onSubmit:J,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.5rem",fontFamily:"'JetBrains Mono', monospace",textAlign:"center"},children:n("auth.enter_totp_code")}),t.jsx("div",{style:{display:"flex",gap:"0.5rem",justifyContent:"center"},onPaste:E,children:Array.from({length:6}).map((e,r)=>t.jsx("input",{ref:o=>{f.current[r]=o},type:"text",inputMode:"numeric",maxLength:1,value:i[r]||"",onChange:o=>T(r,o.target.value),onKeyDown:o=>D(r,o),autoFocus:r===0,autoComplete:r===0?"one-time-code":"off",style:{width:"2.75rem",height:"3rem",textAlign:"center",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"1.25rem",fontFamily:"'JetBrains Mono', monospace",fontWeight:600,outline:"none",boxSizing:"border-box"},onFocus:o=>o.target.style.borderColor="var(--accent)",onBlur:o=>o.target.style.borderColor="var(--border)"},r))})]}),t.jsx("button",{type:"submit",disabled:l||i.length!==6,style:{width:"100%",padding:"0.625rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:l||i.length!==6?"not-allowed":"pointer",opacity:l||i.length!==6?.7:1,marginTop:"0.5rem"},children:n(l?"common.verifying":"auth.verify")}),t.jsx("button",{type:"button",onClick:R,style:{width:"100%",padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:n("common.back")})]},"totp")]})})}export{P as default};
1
+ import{d as W,e as q,u as m,a as I,r as c,j as t,N as k}from"./index-IC0w3nms.js";function P(){var w,B;const h=W(),y=q(),x=m(e=>e.login),v=m(e=>e.requireTotpSetup),_=m(e=>e.user),{t:n}=I(),[C,S]=c.useState("credentials"),[u,F]=c.useState(""),[p,z]=c.useState(""),[i,b]=c.useState(""),[l,g]=c.useState(!1),[j,d]=c.useState(""),f=c.useRef([]);if(_&&!v){let e=(B=(w=y.state)==null?void 0:w.from)==null?void 0:B.pathname;return(e==="/totp-setup"||e==="/login")&&(e=void 0),t.jsx(k,{to:e??"/home",replace:!0})}if(v)return t.jsx(k,{to:"/totp-setup",replace:!0});const M=async e=>{var r,o;if(e.preventDefault(),d(""),!u.trim()||!p.trim()){d(n("auth.username_and_password_required"));return}g(!0);try{await x({username:u.trim(),password:p});const a=m.getState();if(a.requireTotpSetup)return;if(a.user){let s=(o=(r=y.state)==null?void 0:r.from)==null?void 0:o.pathname;(s==="/totp-setup"||s==="/login")&&(s=void 0),h(s??"/home",{replace:!0})}}catch(a){const s=a instanceof Error?a.message:n("auth.login_failed");s==="TOTP_REQUIRED"?(S("totp"),d("")):d(s)}finally{g(!1)}},J=async e=>{var r,o;if(e.preventDefault(),d(""),!i.trim()||i.trim().length!==6){d(n("auth.please_enter_valid_6_digit_code"));return}g(!0);try{if(await x({username:u.trim(),password:p,totpCode:i.trim()}),m.getState().user){let s=(o=(r=y.state)==null?void 0:r.from)==null?void 0:o.pathname;(s==="/totp-setup"||s==="/login")&&(s=void 0),h(s??"/home",{replace:!0})}}catch(a){const s=a instanceof Error?a.message:n("auth.invalid_totp_code");d(s)}finally{g(!1)}},R=()=>{S("credentials"),b(""),d("")},T=(e,r)=>{var s;const o=r.replace(/\D/g,"").slice(-1),a=i.split("");for(;a.length<6;)a.push("");a[e]=o,b(a.join("")),o&&e<5&&((s=f.current[e+1])==null||s.focus())},D=(e,r)=>{var o;r.key==="Backspace"&&!i[e]&&e>0&&((o=f.current[e-1])==null||o.focus())},E=e=>{var a;e.preventDefault();const r=e.clipboardData.getData("text").replace(/\D/g,"").slice(0,6);b(r);const o=Math.min(r.length,5);(a=f.current[o])==null||a.focus()};return t.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--bg-primary)",padding:"1rem",fontFamily:"'JetBrains Mono', monospace"},children:t.jsxs("div",{style:{width:"100%",maxWidth:"400px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"2rem"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"0.625rem",marginBottom:"0.25rem"},children:[t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",borderRadius:"4px",backgroundColor:"var(--accent)",fontFamily:"'JetBrains Mono', monospace"},"aria-hidden":!0,children:t.jsx("span",{style:{fontSize:"1.25rem",fontWeight:600,color:"#0C0C0C"},children:"~"})}),t.jsx("span",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:n("landing.overlord")})]}),t.jsx("div",{style:{textAlign:"center",color:"var(--text-muted)",fontSize:"0.75rem",marginBottom:"2rem",fontFamily:"'JetBrains Mono', monospace"},children:n(C==="credentials"?"auth.ai_powered_development_system":"auth.two_factor_verification")}),j&&t.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.75rem",fontFamily:"'JetBrains Mono', monospace",overflowWrap:"break-word",wordBreak:"break-word"},children:j}),C==="credentials"?t.jsxs("form",{onSubmit:M,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.username")}),t.jsx("input",{type:"text",placeholder:n("auth.enter_username"),value:u,onChange:e=>F(e.target.value),autoFocus:!0,autoComplete:"username",required:!0,style:{width:"100%",padding:"0.625rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.875rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},onFocus:e=>e.target.style.borderColor="var(--accent)",onBlur:e=>e.target.style.borderColor="var(--border)"})]}),t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.375rem",fontFamily:"'JetBrains Mono', monospace"},children:n("auth.password")}),t.jsx("input",{type:"password",placeholder:n("auth.enter_password"),value:p,onChange:e=>z(e.target.value),autoComplete:"current-password",required:!0,style:{width:"100%",padding:"0.625rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.875rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},onFocus:e=>e.target.style.borderColor="var(--accent)",onBlur:e=>e.target.style.borderColor="var(--border)"})]}),t.jsx("button",{type:"submit",disabled:l,style:{width:"100%",padding:"0.625rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:l?"not-allowed":"pointer",opacity:l?.7:1,marginTop:"0.5rem"},children:n(l?"common.signing_in":"auth.sign_in")}),t.jsx("button",{type:"button",onClick:()=>h("/"),style:{width:"100%",padding:"0.5rem",backgroundColor:"transparent",border:"none",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:n("common.back")})]},"credentials"):t.jsxs("form",{onSubmit:J,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[t.jsxs("div",{children:[t.jsx("label",{style:{display:"block",color:"var(--text-secondary)",fontSize:"0.75rem",marginBottom:"0.5rem",fontFamily:"'JetBrains Mono', monospace",textAlign:"center"},children:n("auth.enter_totp_code")}),t.jsx("div",{style:{display:"flex",gap:"0.5rem",justifyContent:"center"},onPaste:E,children:Array.from({length:6}).map((e,r)=>t.jsx("input",{ref:o=>{f.current[r]=o},type:"text",inputMode:"numeric",maxLength:1,value:i[r]||"",onChange:o=>T(r,o.target.value),onKeyDown:o=>D(r,o),autoFocus:r===0,autoComplete:r===0?"one-time-code":"off",style:{width:"2.75rem",height:"3rem",textAlign:"center",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"1.25rem",fontFamily:"'JetBrains Mono', monospace",fontWeight:600,outline:"none",boxSizing:"border-box"},onFocus:o=>o.target.style.borderColor="var(--accent)",onBlur:o=>o.target.style.borderColor="var(--border)"},r))})]}),t.jsx("button",{type:"submit",disabled:l||i.length!==6,style:{width:"100%",padding:"0.625rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.875rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:l||i.length!==6?"not-allowed":"pointer",opacity:l||i.length!==6?.7:1,marginTop:"0.5rem"},children:n(l?"common.verifying":"auth.verify")}),t.jsx("button",{type:"button",onClick:R,style:{width:"100%",padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:n("common.back")})]},"totp")]})})}export{P as default};
@@ -1 +1 @@
1
- import{a as E,j as e,l as M,m as H,d as V,r as o,u as z,h as B,f as b,L as Q,s as C}from"./index-BdEJ0aTM.js";import{M as i,T as x}from"./protocol-C5uQmiiB.js";import{T as S}from"./trash-2-Dkm6k-XU.js";import{A as D}from"./arrow-left-rWVL-A4T.js";function q({isOpen:t,onClose:r,onConfirm:a,machineName:s,isDraining:l,loading:d}){const{t:m}=E();return e.jsx(M,{isOpen:t,onClose:r,onConfirm:a,title:m(l?"machines.undrain_machine_title":"machines.drain_machine_title"),message:l?m("machines.undrain_confirm",{name:s}):m("machines.drain_confirm",{name:s}),confirmLabel:m(l?"machines.undrain":"machines.drain"),confirmVariant:l?"accent":"warning",isLoading:d})}const J={[i.ONLINE]:"var(--accent)",[i.OFFLINE]:"var(--destructive)",[i.DRAINING]:"var(--warning)",[i.DECOMMISSIONED]:"var(--text-muted)"},K={[x.QUEUED]:"var(--text-muted)",[x.ASSIGNED]:"#60a5fa",[x.RUNNING]:"var(--accent)",[x.SUSPENDED]:"var(--warning)",[x.COMPLETED]:"var(--accent)",[x.FAILED]:"var(--destructive)",[x.CANCELLED]:"var(--text-muted)"};function g(t){return t?new Date(t).toLocaleString():"n/a"}function W(t){if(!t)return"never";const r=Date.now()-new Date(t).getTime(),a=Math.floor(r/1e3);if(a<60)return`${a}s ago`;const s=Math.floor(a/60);if(s<60)return`${s}m ago`;const l=Math.floor(s/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function I(t){return t>80?"var(--destructive)":t>60?"var(--warning)":"var(--accent)"}function se(){const{id:t}=H(),r=V(),{t:a}=E(),[s,l]=o.useState(null),[d,m]=o.useState([]),[L,O]=o.useState(!0),[$,h]=o.useState(!1),[T,y]=o.useState(!1),[A,u]=o.useState(!1),[U,w]=o.useState(!1),p=z(c=>{var v;return(v=c.user)==null?void 0:v.role});B(o.useMemo(()=>!s||s.status===i.DECOMMISSIONED?null:e.jsxs("div",{className:"flex items-center gap-2",children:[s.status===i.ONLINE&&e.jsxs("button",{onClick:()=>h(!0),className:"rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",a("machines.drain")]}),p==="admin"&&e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(S,{className:"h-3 w-3"}),a("machines.decommission")]})]}),[s,p,a]));const j=o.useCallback(async()=>{if(t)try{const[c,v]=await Promise.all([b.get(`web/machines/${t}`).json(),b.get(`web/machines/${t}/tasks`).json().catch(()=>[])]);l(c),m(v)}catch{}finally{O(!1)}},[t]);o.useEffect(()=>{j()},[j]);async function G(){if(s){y(!0);try{const c=s.status===i.DRAINING?"undrain":"drain";await b.post(`web/machines/${s.id}/${c}`),await j()}catch{}finally{y(!1),h(!1)}}}async function F(){if(s){w(!0);try{await b.delete(`admin/machines/${s.id}`),r("/machines")}catch{}finally{w(!1),u(!1)}}}if(L)return e.jsx("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("machines.loading_machine")})});if(!s)return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:a("machines.machine_not_found")}),e.jsxs("button",{onClick:()=>r("/machines"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",a("machines.back_to_machines")]})]});const _=s.status===i.DRAINING,R=e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsx("button",{onClick:()=>r("/machines"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(D,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),e.jsxs("div",{className:"px-6 py-8",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(Q,{to:"/machines",className:"text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:a("machines.title")}),e.jsx("span",{className:"text-[var(--text-muted)]",children:"/"}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s.status!==i.DECOMMISSIONED&&e.jsxs("button",{onClick:()=>h(!0),className:"rounded-[4px] border border-[var(--accent)] px-4 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:["> ",a("machines.undrain")]}),p==="admin"&&s.status!==i.DECOMMISSIONED&&e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(S,{className:"h-3 w-3"}),a("machines.decommission")]})]})]}),e.jsx("div",{className:"mb-4",children:e.jsx("span",{className:"rounded-[4px] bg-[var(--warning)]/20 px-2.5 py-1 text-xs font-medium text-[var(--warning)]",children:a("machines.draining")})}),e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)]/40 bg-[var(--warning)]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(C,{className:"h-3.5 w-3.5 text-[var(--warning)]"}),e.jsx("span",{className:"text-xs text-[var(--warning)]",children:a("machines.draining_warning")})]}),e.jsx("p",{className:"text-xs text-[var(--warning)]/70 ml-5.5",children:a("machines.draining_active_tasks")})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-4",children:[e.jsx(f,{label:a("machines.cpu"),value:s.cpuUsage,unit:"%"}),e.jsx(f,{label:a("machines.memory"),value:s.memoryUsage,unit:"%"}),e.jsx(f,{label:a("machines.disk"),value:s.diskUsage,unit:"%"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("machines.slots")}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[s.activeSlots,"/",s.maxSlots]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.active_tasks")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:d.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_active_tasks")})]}):e.jsx(k,{tasks:d,navigate:r,t:a})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.capabilities")}),s.capabilities.length>0?e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:s.capabilities.map(c=>e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx("p",{className:"text-xs text-[var(--text-primary)]",children:c})},c))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_capabilities_short")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.machine_info")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(n,{label:a("machines.host"),value:s.host}),e.jsx(n,{label:a("machines.port"),value:String(s.port)}),s.sshUrl&&e.jsx(n,{label:"ssh url",value:s.sshUrl}),e.jsx(n,{label:a("machines.os"),value:s.os??a("machines.unknown")}),e.jsx(n,{label:a("machines.cpu_model"),value:s.cpuModel??a("machines.n_a")}),e.jsx(n,{label:a("machines.cpu_cores"),value:s.cpuCores!=null?String(s.cpuCores):a("machines.n_a")}),e.jsx(n,{label:a("machines.memory"),value:s.memoryGb!=null?`${s.memoryGb} gb`:a("machines.n_a")}),e.jsx(n,{label:a("machines.machine_id"),value:s.id}),e.jsx(n,{label:a("machines.last_heartbeat_label"),value:g(s.lastHeartbeat)}),e.jsx(n,{label:a("machines.slots"),value:`${s.activeSlots}/${s.maxSlots}`}),e.jsx(n,{label:a("machines.status_label"),value:s.status.toLowerCase()}),e.jsx(n,{label:a("machines.worker_version"),value:s.workerVersion??a("machines.n_a")})]})})]})]})]}),P=e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("button",{onClick:()=>r("/machines"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(D,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),s.status!==i.OFFLINE&&s.status!==i.DECOMMISSIONED&&e.jsxs("button",{onClick:()=>h(!0),className:"shrink-0 rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",a("machines.drain")]})]}),e.jsxs("div",{className:"px-6 py-8",children:[e.jsxs("button",{onClick:()=>r("/machines"),className:"mb-4 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:["< ",a("machines.back_to_machines")]}),e.jsxs("h1",{className:"mb-2 text-lg font-bold text-[var(--text-primary)] flex items-center gap-2",children:[s.name,e.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-normal",style:{color:J[s.status]},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),s.status.toLowerCase()]})]}),e.jsx("p",{className:"mb-6 text-xs text-[var(--text-muted)]",children:a("machines.last_heartbeat",{time:W(s.lastHeartbeat)})}),s.status===i.DECOMMISSIONED&&e.jsx("div",{className:"mb-6 rounded-[4px] border border-[var(--text-muted)]/40 bg-[var(--text-muted)]/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["this machine has been decommissioned",s.decommissionedAt?` on ${g(s.decommissionedAt)}`:""," and can no longer accept tasks."]})]})}),e.jsxs("div",{className:"mb-6 grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.resource_usage")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(N,{label:a("machines.cpu"),value:s.cpuUsage}),e.jsx(N,{label:a("machines.mem"),value:s.memoryUsage}),e.jsx(N,{label:a("machines.disk"),value:s.diskUsage})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.connection_info")}),e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(n,{label:a("machines.machine_id"),value:s.id}),e.jsx(n,{label:a("machines.host"),value:s.host}),e.jsx(n,{label:a("machines.port"),value:String(s.port)}),s.sshUrl&&e.jsx(n,{label:"ssh url",value:s.sshUrl}),e.jsx(n,{label:a("machines.os"),value:s.os??a("machines.unknown")}),e.jsx(n,{label:a("machines.cpu_model"),value:s.cpuModel??a("machines.n_a")}),e.jsx(n,{label:a("machines.cpu_cores"),value:s.cpuCores!=null?String(s.cpuCores):a("machines.n_a")}),e.jsx(n,{label:a("machines.memory"),value:s.memoryGb!=null?`${s.memoryGb} gb`:a("machines.n_a")}),e.jsx(n,{label:a("machines.last_heartbeat_label"),value:g(s.lastHeartbeat)}),e.jsx(n,{label:a("machines.slots"),value:`${s.activeSlots}/${s.maxSlots}`})]})]})]}),s.capabilities.length>0&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.capabilities")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.capabilities.map(c=>e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)]",children:c},c))})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsxs("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:[a("machines.current_tasks")," (",d.length,")"]}),d.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_active_tasks")})]}):e.jsx(k,{tasks:d,navigate:r,t:a})]})]})]});return e.jsxs(e.Fragment,{children:[_?R:P,e.jsx(q,{isOpen:$,onClose:()=>h(!1),onConfirm:G,machineName:s.name,isDraining:_,loading:T}),e.jsx(M,{isOpen:A,onClose:()=>u(!1),onConfirm:F,title:a("machines.decommission_title"),message:a("machines.decommission_confirm",{name:s.name}),confirmLabel:a("machines.decommission"),confirmVariant:"danger",isLoading:U})]})}function k({tasks:t,navigate:r,t:a}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.id")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.description")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.status_label")}),e.jsx("th",{className:"py-2 text-left font-normal text-[var(--text-muted)]",children:a("machines.stage")})]})}),e.jsx("tbody",{children:t.map(s=>e.jsxs("tr",{onClick:()=>r(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] hover:bg-[var(--bg-input)] transition-colors",children:[e.jsxs("td",{className:"py-2 pr-4 text-[var(--text-primary)]",children:["#",s.id]}),e.jsx("td",{className:"max-w-xs truncate py-2 pr-4 text-[var(--text-secondary)]",children:s.description}),e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("span",{style:{color:K[s.status]},children:["● ",s.status.toLowerCase()]})}),e.jsx("td",{className:"py-2 text-[var(--text-secondary)]",children:s.currentStage??"-"})]},s.id))})]})})}function f({label:t,value:r,unit:a}){return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[r,a]}),e.jsx("div",{className:"mt-3 h-1.5 w-full rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${r}%`,backgroundColor:I(r)}})})]})}function N({label:t,value:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-[var(--text-secondary)]",children:t}),e.jsxs("span",{className:"text-[var(--text-primary)]",children:[r,"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${r}%`,backgroundColor:I(r)}})})]})}function n({label:t,value:r}){return e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:t}),e.jsx("span",{className:"truncate text-[var(--text-primary)]",children:r})]})}export{se as default};
1
+ import{a as E,j as e,l as M,m as H,d as V,r as o,u as z,h as B,f as b,L as Q,s as C}from"./index-IC0w3nms.js";import{M as i,T as x}from"./protocol-C5uQmiiB.js";import{T as S}from"./trash-2-CopJbaLA.js";import{A as D}from"./arrow-left-_sT90Vgd.js";function q({isOpen:t,onClose:r,onConfirm:a,machineName:s,isDraining:l,loading:d}){const{t:m}=E();return e.jsx(M,{isOpen:t,onClose:r,onConfirm:a,title:m(l?"machines.undrain_machine_title":"machines.drain_machine_title"),message:l?m("machines.undrain_confirm",{name:s}):m("machines.drain_confirm",{name:s}),confirmLabel:m(l?"machines.undrain":"machines.drain"),confirmVariant:l?"accent":"warning",isLoading:d})}const J={[i.ONLINE]:"var(--accent)",[i.OFFLINE]:"var(--destructive)",[i.DRAINING]:"var(--warning)",[i.DECOMMISSIONED]:"var(--text-muted)"},K={[x.QUEUED]:"var(--text-muted)",[x.ASSIGNED]:"#60a5fa",[x.RUNNING]:"var(--accent)",[x.SUSPENDED]:"var(--warning)",[x.COMPLETED]:"var(--accent)",[x.FAILED]:"var(--destructive)",[x.CANCELLED]:"var(--text-muted)"};function g(t){return t?new Date(t).toLocaleString():"n/a"}function W(t){if(!t)return"never";const r=Date.now()-new Date(t).getTime(),a=Math.floor(r/1e3);if(a<60)return`${a}s ago`;const s=Math.floor(a/60);if(s<60)return`${s}m ago`;const l=Math.floor(s/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function I(t){return t>80?"var(--destructive)":t>60?"var(--warning)":"var(--accent)"}function se(){const{id:t}=H(),r=V(),{t:a}=E(),[s,l]=o.useState(null),[d,m]=o.useState([]),[L,O]=o.useState(!0),[$,h]=o.useState(!1),[T,y]=o.useState(!1),[A,u]=o.useState(!1),[U,w]=o.useState(!1),p=z(c=>{var v;return(v=c.user)==null?void 0:v.role});B(o.useMemo(()=>!s||s.status===i.DECOMMISSIONED?null:e.jsxs("div",{className:"flex items-center gap-2",children:[s.status===i.ONLINE&&e.jsxs("button",{onClick:()=>h(!0),className:"rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",a("machines.drain")]}),p==="admin"&&e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(S,{className:"h-3 w-3"}),a("machines.decommission")]})]}),[s,p,a]));const j=o.useCallback(async()=>{if(t)try{const[c,v]=await Promise.all([b.get(`web/machines/${t}`).json(),b.get(`web/machines/${t}/tasks`).json().catch(()=>[])]);l(c),m(v)}catch{}finally{O(!1)}},[t]);o.useEffect(()=>{j()},[j]);async function G(){if(s){y(!0);try{const c=s.status===i.DRAINING?"undrain":"drain";await b.post(`web/machines/${s.id}/${c}`),await j()}catch{}finally{y(!1),h(!1)}}}async function F(){if(s){w(!0);try{await b.delete(`admin/machines/${s.id}`),r("/machines")}catch{}finally{w(!1),u(!1)}}}if(L)return e.jsx("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("machines.loading_machine")})});if(!s)return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:a("machines.machine_not_found")}),e.jsxs("button",{onClick:()=>r("/machines"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:["< ",a("machines.back_to_machines")]})]});const _=s.status===i.DRAINING,R=e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsx("button",{onClick:()=>r("/machines"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(D,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),e.jsxs("div",{className:"px-6 py-8",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(Q,{to:"/machines",className:"text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:a("machines.title")}),e.jsx("span",{className:"text-[var(--text-muted)]",children:"/"}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s.status!==i.DECOMMISSIONED&&e.jsxs("button",{onClick:()=>h(!0),className:"rounded-[4px] border border-[var(--accent)] px-4 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:["> ",a("machines.undrain")]}),p==="admin"&&s.status!==i.DECOMMISSIONED&&e.jsxs("button",{onClick:()=>u(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(S,{className:"h-3 w-3"}),a("machines.decommission")]})]})]}),e.jsx("div",{className:"mb-4",children:e.jsx("span",{className:"rounded-[4px] bg-[var(--warning)]/20 px-2.5 py-1 text-xs font-medium text-[var(--warning)]",children:a("machines.draining")})}),e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)]/40 bg-[var(--warning)]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(C,{className:"h-3.5 w-3.5 text-[var(--warning)]"}),e.jsx("span",{className:"text-xs text-[var(--warning)]",children:a("machines.draining_warning")})]}),e.jsx("p",{className:"text-xs text-[var(--warning)]/70 ml-5.5",children:a("machines.draining_active_tasks")})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-4",children:[e.jsx(f,{label:a("machines.cpu"),value:s.cpuUsage,unit:"%"}),e.jsx(f,{label:a("machines.memory"),value:s.memoryUsage,unit:"%"}),e.jsx(f,{label:a("machines.disk"),value:s.diskUsage,unit:"%"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("machines.slots")}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[s.activeSlots,"/",s.maxSlots]})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.active_tasks")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:d.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_active_tasks")})]}):e.jsx(k,{tasks:d,navigate:r,t:a})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.capabilities")}),s.capabilities.length>0?e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:s.capabilities.map(c=>e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx("p",{className:"text-xs text-[var(--text-primary)]",children:c})},c))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_capabilities_short")})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:a("machines.machine_info")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(n,{label:a("machines.host"),value:s.host}),e.jsx(n,{label:a("machines.port"),value:String(s.port)}),s.sshUrl&&e.jsx(n,{label:"ssh url",value:s.sshUrl}),e.jsx(n,{label:a("machines.os"),value:s.os??a("machines.unknown")}),e.jsx(n,{label:a("machines.cpu_model"),value:s.cpuModel??a("machines.n_a")}),e.jsx(n,{label:a("machines.cpu_cores"),value:s.cpuCores!=null?String(s.cpuCores):a("machines.n_a")}),e.jsx(n,{label:a("machines.memory"),value:s.memoryGb!=null?`${s.memoryGb} gb`:a("machines.n_a")}),e.jsx(n,{label:a("machines.machine_id"),value:s.id}),e.jsx(n,{label:a("machines.last_heartbeat_label"),value:g(s.lastHeartbeat)}),e.jsx(n,{label:a("machines.slots"),value:`${s.activeSlots}/${s.maxSlots}`}),e.jsx(n,{label:a("machines.status_label"),value:s.status.toLowerCase()}),e.jsx(n,{label:a("machines.worker_version"),value:s.workerVersion??a("machines.n_a")})]})})]})]})]}),P=e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("button",{onClick:()=>r("/machines"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(D,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),s.status!==i.OFFLINE&&s.status!==i.DECOMMISSIONED&&e.jsxs("button",{onClick:()=>h(!0),className:"shrink-0 rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",a("machines.drain")]})]}),e.jsxs("div",{className:"px-6 py-8",children:[e.jsxs("button",{onClick:()=>r("/machines"),className:"mb-4 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:["< ",a("machines.back_to_machines")]}),e.jsxs("h1",{className:"mb-2 text-lg font-bold text-[var(--text-primary)] flex items-center gap-2",children:[s.name,e.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-normal",style:{color:J[s.status]},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),s.status.toLowerCase()]})]}),e.jsx("p",{className:"mb-6 text-xs text-[var(--text-muted)]",children:a("machines.last_heartbeat",{time:W(s.lastHeartbeat)})}),s.status===i.DECOMMISSIONED&&e.jsx("div",{className:"mb-6 rounded-[4px] border border-[var(--text-muted)]/40 bg-[var(--text-muted)]/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["this machine has been decommissioned",s.decommissionedAt?` on ${g(s.decommissionedAt)}`:""," and can no longer accept tasks."]})]})}),e.jsxs("div",{className:"mb-6 grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.resource_usage")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(N,{label:a("machines.cpu"),value:s.cpuUsage}),e.jsx(N,{label:a("machines.mem"),value:s.memoryUsage}),e.jsx(N,{label:a("machines.disk"),value:s.diskUsage})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.connection_info")}),e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(n,{label:a("machines.machine_id"),value:s.id}),e.jsx(n,{label:a("machines.host"),value:s.host}),e.jsx(n,{label:a("machines.port"),value:String(s.port)}),s.sshUrl&&e.jsx(n,{label:"ssh url",value:s.sshUrl}),e.jsx(n,{label:a("machines.os"),value:s.os??a("machines.unknown")}),e.jsx(n,{label:a("machines.cpu_model"),value:s.cpuModel??a("machines.n_a")}),e.jsx(n,{label:a("machines.cpu_cores"),value:s.cpuCores!=null?String(s.cpuCores):a("machines.n_a")}),e.jsx(n,{label:a("machines.memory"),value:s.memoryGb!=null?`${s.memoryGb} gb`:a("machines.n_a")}),e.jsx(n,{label:a("machines.last_heartbeat_label"),value:g(s.lastHeartbeat)}),e.jsx(n,{label:a("machines.slots"),value:`${s.activeSlots}/${s.maxSlots}`})]})]})]}),s.capabilities.length>0&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:a("machines.capabilities")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.capabilities.map(c=>e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)]",children:c},c))})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsxs("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:[a("machines.current_tasks")," (",d.length,")"]}),d.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("machines.no_active_tasks")})]}):e.jsx(k,{tasks:d,navigate:r,t:a})]})]})]});return e.jsxs(e.Fragment,{children:[_?R:P,e.jsx(q,{isOpen:$,onClose:()=>h(!1),onConfirm:G,machineName:s.name,isDraining:_,loading:T}),e.jsx(M,{isOpen:A,onClose:()=>u(!1),onConfirm:F,title:a("machines.decommission_title"),message:a("machines.decommission_confirm",{name:s.name}),confirmLabel:a("machines.decommission"),confirmVariant:"danger",isLoading:U})]})}function k({tasks:t,navigate:r,t:a}){return e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.id")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.description")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:a("machines.status_label")}),e.jsx("th",{className:"py-2 text-left font-normal text-[var(--text-muted)]",children:a("machines.stage")})]})}),e.jsx("tbody",{children:t.map(s=>e.jsxs("tr",{onClick:()=>r(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] hover:bg-[var(--bg-input)] transition-colors",children:[e.jsxs("td",{className:"py-2 pr-4 text-[var(--text-primary)]",children:["#",s.id]}),e.jsx("td",{className:"max-w-xs truncate py-2 pr-4 text-[var(--text-secondary)]",children:s.description}),e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("span",{style:{color:K[s.status]},children:["● ",s.status.toLowerCase()]})}),e.jsx("td",{className:"py-2 text-[var(--text-secondary)]",children:s.currentStage??"-"})]},s.id))})]})})}function f({label:t,value:r,unit:a}){return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[r,a]}),e.jsx("div",{className:"mt-3 h-1.5 w-full rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${r}%`,backgroundColor:I(r)}})})]})}function N({label:t,value:r}){return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-[var(--text-secondary)]",children:t}),e.jsxs("span",{className:"text-[var(--text-primary)]",children:[r,"%"]})]}),e.jsx("div",{className:"h-1.5 w-full rounded-sm bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-sm transition-all",style:{width:`${r}%`,backgroundColor:I(r)}})})]})}function n({label:t,value:r}){return e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:t}),e.jsx("span",{className:"truncate text-[var(--text-primary)]",children:r})]})}export{se as default};
@@ -1,4 +1,4 @@
1
- import{c as B,a as I,j as e,r as s,f as C,X as K,o as q,d as W,u as H,h as V,q as O}from"./index-BdEJ0aTM.js";import{M as u}from"./protocol-C5uQmiiB.js";import X from"./WorkerSetupGuidePage-DkERqTk-.js";import{C as z}from"./copy-CpdsOI_O.js";import{L as J}from"./loader-circle-CwvOmGaz.js";import{S as Q}from"./Select-DOPqCoVh.js";import{E as Y}from"./EmptyState-C9vei1H4.js";import{C as Z}from"./Skeleton-DRiV4Mc_.js";import{P as ee}from"./plus-8YfTJ47b.js";import"./key-D6HzwwXl.js";import"./settings-B5JVwtOy.js";/**
1
+ import{c as B,a as I,j as e,r as s,f as C,X as K,o as q,d as W,u as H,h as V,q as O}from"./index-IC0w3nms.js";import{M as u}from"./protocol-C5uQmiiB.js";import X from"./WorkerSetupGuidePage-QJry2UPm.js";import{C as z}from"./copy-DeIFkKL0.js";import{L as J}from"./loader-circle-CjjIeO9t.js";import{S as Q}from"./Select-vE59gnrR.js";import{E as Y}from"./EmptyState-CqOs-r87.js";import{C as Z}from"./Skeleton-DkWfJwGk.js";import{P as ee}from"./plus-DAoE-jeh.js";import"./key-BWK1AZ5R.js";import"./settings-CRoMlkO8.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{d as a,a as n,j as e,L as o}from"./index-BdEJ0aTM.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};
1
+ import{d as a,a as n,j as e,L as o}from"./index-IC0w3nms.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};
@@ -1,3 +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-BdEJ0aTM.js";import{S as B}from"./Select-DOPqCoVh.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(`
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-IC0w3nms.js";import{S as B}from"./Select-vE59gnrR.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
2
  `):"",onChange:r=>{if(!r.trim()){o({env:void 0});return}const a={};r.split(`
3
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(`web/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};
@@ -1 +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-BdEJ0aTM.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};
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-IC0w3nms.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};
@@ -1,7 +1,7 @@
1
- import{c as F,a as S,j as e,l as G,m as K,d as q,u as B,r as l,h as H,f as j,v as J}from"./index-BdEJ0aTM.js";import{T as d}from"./protocol-C5uQmiiB.js";import{U as Q,A as V,R as z}from"./RemoveMemberConfirmDialog-2jr0B-lt.js";import{P as W}from"./pencil-D6ZHfLK_.js";import{T as X}from"./trash-2-Dkm6k-XU.js";import{P as Y}from"./plus-8YfTJ47b.js";import"./Select-DOPqCoVh.js";/**
1
+ import{c as F,a as S,j as e,l as G,m as K,d as q,u as B,r as l,h as H,f as j,v as J}from"./index-IC0w3nms.js";import{T as d}from"./protocol-C5uQmiiB.js";import{U as Q,A as V,R as z}from"./RemoveMemberConfirmDialog-DJc5TI2H.js";import{P as W}from"./pencil-BIUaEBhE.js";import{T as X}from"./trash-2-CopJbaLA.js";import{P as Y}from"./plus-DAoE-jeh.js";import"./Select-vE59gnrR.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const Z=F("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ee({isOpen:n,onClose:a,onConfirm:t,projectName:o,loading:p}){const{t:r}=S();return e.jsx(G,{isOpen:n,onClose:a,onConfirm:t,title:`> ${r("projects.delete_project")}`,message:r("projects.delete_project_confirm",{name:o}),confirmLabel:r("projects.delete_project"),confirmVariant:"danger",isLoading:p})}const te={[d.QUEUED]:"var(--text-muted)",[d.ASSIGNED]:"var(--info)",[d.RUNNING]:"var(--info)",[d.SUSPENDED]:"var(--warning)",[d.COMPLETED]:"var(--accent)",[d.FAILED]:"var(--destructive)",[d.CANCELLED]:"var(--text-muted)"};function D(n){return new Date(n).toLocaleString()}function de(){const{key:n}=K(),a=q(),{t}=S(),o=B(s=>s.user),p=(o==null?void 0:o.role)==="admin",[r,M]=l.useState(null),[u,P]=l.useState([]),i=p||u.some(s=>s.developerId===(o==null?void 0:o.id)&&s.role==="maintainer"),[w,L]=l.useState([]),[A,E]=l.useState(!0),[x,f]=l.useState(null),[I,N]=l.useState(!1),[T,k]=l.useState(!1),[$,_]=l.useState(!1),[m,y]=l.useState(null),[O,C]=l.useState(!1);H(l.useMemo(()=>r?e.jsxs(e.Fragment,{children:[i&&e.jsxs("button",{onClick:()=>a(`/projects/${r.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(W,{className:"h-3 w-3"}),t("common.edit")]}),p&&e.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(X,{className:"h-3 w-3"}),t("common.delete")]})]}):null,[r,i,p,a,t]));const v=l.useCallback(async()=>{if(n)try{const[s,g,b]=await Promise.all([j.get(`web/projects/${n}`).json(),j.get(`web/projects/${n}/members`).json().catch(()=>[]),j.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(h=>h.data).catch(()=>[])]);if(M(s),P(g),L(b),s.pipeline)try{f(JSON.parse(s.pipeline))}catch{f(null)}else f(null)}catch{}finally{E(!1)}},[n]);l.useEffect(()=>{v()},[v]);async function R(){if(r){k(!0);try{await j.delete(`admin/projects/${r.key}`),a("/projects")}catch{}finally{k(!1),N(!1)}}}async function U(){if(!(!r||!m)){C(!0);try{await j.delete(`web/projects/${r.key}/members`,{searchParams:{developerId:String(m.developerId)}}),await v()}catch{}finally{C(!1),y(null)}}}return A?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r?e.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>a("/projects"),children:t("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:t("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{label:t("projects.key"),value:r.key}),e.jsx(c,{label:t("projects.name"),value:r.name}),e.jsx(c,{label:t("projects.repo_url"),value:r.repoUrl,href:r.repoUrl}),e.jsx(c,{label:t("projects.git_platform"),value:r.gitPlatform}),e.jsx(c,{label:t("projects.default_branch"),value:r.defaultBranch}),e.jsx(c,{label:t("projects.agent_type"),value:r.agentType}),e.jsx(c,{label:t("projects.max_turns"),value:String(r.maxTurns)}),e.jsx(c,{label:t("projects.allowed_tools"),value:r.allowedTools??"all"}),e.jsx(c,{label:t("projects.auto_merge"),value:r.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:t("projects.members")}),i&&e.jsxs("button",{onClick:()=>_(!0),className:"flex items-center gap-1.5 rounded bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(Y,{className:"h-3.5 w-3.5"}),t("projects.add_member")]})]}),u.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("projects.no_members_yet")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.added_at")}),i&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:t("common.actions")})]})}),e.jsx("tbody",{children:u.map(s=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:s.developerName??`#${s.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:s.role==="maintainer"?"var(--warning)":"var(--text-secondary)"},children:s.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)}),i&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>y(s),className:"text-[var(--destructive)] hover:underline","aria-label":t("projects.remove_member"),children:e.jsx(Q,{className:"h-3.5 w-3.5"})})})]},s.developerId))})]})})]}),e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:t("projects.recent_tasks")}),w.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("projects.no_tasks_for_project")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.created")})]})}),e.jsx("tbody",{children:w.map(s=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${s.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",s.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)]",children:s.description}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:te[s.status]},children:s.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)})]},s.id))})]})})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:t("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),x!=null&&x.stages&&x.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:x.stages.map((s,g)=>{var b,h;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>a(`/projects/${r.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:s.name}),s.command&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",s.command.split(`
7
- `)[0].slice(0,40)]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.confirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:t("projects.confirm_label")}),s.irreversible&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--destructive)]",style:{backgroundColor:"rgba(239,68,68,0.12)"},children:t("pipeline.irreversible")})]})]}),((b=s.onFailure)==null?void 0:b.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(J,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[10px] text-[var(--warning)]",children:["onFailure.goto: ",s.onFailure.goto,", maxLoops: ",s.onFailure.maxLoops]})]}),g<x.stages.length-1&&!((h=s.onFailure)!=null&&h.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(Z,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},s.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:t("projects.no_pipeline_configured")}),i&&e.jsx("button",{onClick:()=>a(`/projects/${r.key}/pipeline`),className:"mt-3 flex w-full items-center justify-center gap-1.5 py-2 text-xs text-[var(--accent)] hover:text-[var(--accent)]",children:t("projects.add_stage")})]})})]}),e.jsx(ee,{isOpen:I,onClose:()=>N(!1),onConfirm:R,projectName:r.name,loading:T}),e.jsx(V,{isOpen:$,onClose:()=>_(!1),projectKey:r.key,existingMemberIds:u.map(s=>s.developerId),onAdded:v}),e.jsx(z,{isOpen:!!m,onClose:()=>y(null),onConfirm:U,memberName:m?m.developerName??`#${m.developerId}`:"",loading:O})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("projects.project_not_found")}),e.jsx("button",{onClick:()=>a("/projects"),className:"mt-4 rounded border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:t("projects.back_to_projects")})]})}function c({label:n,value:a,href:t}){return e.jsxs("div",{className:"flex items-center gap-3 py-1",children:[e.jsx("span",{className:"w-32 shrink-0 text-xs text-[var(--text-muted)]",children:n}),t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"truncate text-sm text-[var(--accent)] hover:underline",children:a}):e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:a})]})}export{de as default};
6
+ */const Z=F("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ee({isOpen:n,onClose:a,onConfirm:t,projectName:o,loading:p}){const{t:r}=S();return e.jsx(G,{isOpen:n,onClose:a,onConfirm:t,title:`> ${r("projects.delete_project")}`,message:r("projects.delete_project_confirm",{name:o}),confirmLabel:r("projects.delete_project"),confirmVariant:"danger",isLoading:p})}const te={[d.QUEUED]:"var(--text-muted)",[d.ASSIGNED]:"var(--info)",[d.RUNNING]:"var(--info)",[d.SUSPENDED]:"var(--warning)",[d.COMPLETED]:"var(--accent)",[d.FAILED]:"var(--destructive)",[d.CANCELLED]:"var(--text-muted)"};function D(n){return new Date(n).toLocaleString()}function de(){const{key:n}=K(),a=q(),{t}=S(),o=B(s=>s.user),p=(o==null?void 0:o.role)==="admin",[r,M]=l.useState(null),[u,P]=l.useState([]),i=p||u.some(s=>s.developerId===(o==null?void 0:o.id)&&s.role==="maintainer"),[w,L]=l.useState([]),[A,E]=l.useState(!0),[x,f]=l.useState(null),[I,N]=l.useState(!1),[T,k]=l.useState(!1),[$,_]=l.useState(!1),[m,y]=l.useState(null),[U,C]=l.useState(!1);H(l.useMemo(()=>r?e.jsxs(e.Fragment,{children:[i&&e.jsxs("button",{onClick:()=>a(`/projects/${r.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(W,{className:"h-3 w-3"}),t("common.edit")]}),p&&e.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(X,{className:"h-3 w-3"}),t("common.delete")]})]}):null,[r,i,p,a,t]));const v=l.useCallback(async()=>{if(n)try{const[s,g,h]=await Promise.all([j.get(`web/projects/${n}`).json(),j.get(`web/projects/${n}/members`).json().catch(()=>[]),j.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(b=>b.data).catch(()=>[])]);if(M(s),P(g),L(h),s.pipeline)try{f(JSON.parse(s.pipeline))}catch{f(null)}else f(null)}catch{}finally{E(!1)}},[n]);l.useEffect(()=>{v()},[v]);async function O(){if(r){k(!0);try{await j.delete(`admin/projects/${r.key}`),a("/projects")}catch{}finally{k(!1),N(!1)}}}async function R(){if(!(!r||!m)){C(!0);try{await j.delete(`web/projects/${r.key}/members`,{searchParams:{developerId:String(m.developerId)}}),await v()}catch{}finally{C(!1),y(null)}}}return A?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):r?e.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-8",children:[e.jsxs("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>a("/projects"),children:t("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:r.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:t("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{label:t("projects.key"),value:r.key}),e.jsx(c,{label:t("projects.name"),value:r.name}),e.jsx(c,{label:t("projects.repo_url"),value:r.repoUrl,href:r.repoUrl}),r.sshUrl&&e.jsx(c,{label:t("projects.ssh_url"),value:r.sshUrl}),e.jsx(c,{label:t("projects.git_platform"),value:r.gitPlatform}),e.jsx(c,{label:t("projects.default_branch"),value:r.defaultBranch}),e.jsx(c,{label:t("projects.agent_type"),value:r.agentType}),e.jsx(c,{label:t("projects.max_turns"),value:String(r.maxTurns)}),e.jsx(c,{label:t("projects.allowed_tools"),value:r.allowedTools??"all"}),e.jsx(c,{label:t("projects.auto_merge"),value:r.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:t("projects.members")}),i&&e.jsxs("button",{onClick:()=>_(!0),className:"flex items-center gap-1.5 rounded bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(Y,{className:"h-3.5 w-3.5"}),t("projects.add_member")]})]}),u.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("projects.no_members_yet")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.added_at")}),i&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:t("common.actions")})]})}),e.jsx("tbody",{children:u.map(s=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:s.developerName??`#${s.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:s.role==="maintainer"?"var(--warning)":"var(--text-secondary)"},children:s.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)}),i&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>y(s),className:"text-[var(--destructive)] hover:underline","aria-label":t("projects.remove_member"),children:e.jsx(Q,{className:"h-3.5 w-3.5"})})})]},s.developerId))})]})})]}),e.jsxs("section",{className:"rounded border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:t("projects.recent_tasks")}),w.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:t("projects.no_tasks_for_project")})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:t("projects.created")})]})}),e.jsx("tbody",{children:w.map(s=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${s.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",s.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)]",children:s.description}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:te[s.status]},children:s.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:D(s.createdAt)})]},s.id))})]})})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:t("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),x!=null&&x.stages&&x.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:x.stages.map((s,g)=>{var h,b;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>a(`/projects/${r.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:s.name}),s.command&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",s.command.split(`
7
+ `)[0].slice(0,40)]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.confirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:t("projects.confirm_label")}),s.irreversible&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[10px] font-medium text-[var(--destructive)]",style:{backgroundColor:"rgba(239,68,68,0.12)"},children:t("pipeline.irreversible")})]})]}),((h=s.onFailure)==null?void 0:h.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(J,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[10px] text-[var(--warning)]",children:["onFailure.goto: ",s.onFailure.goto,", maxLoops: ",s.onFailure.maxLoops]})]}),g<x.stages.length-1&&!((b=s.onFailure)!=null&&b.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(Z,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},s.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:t("projects.no_pipeline_configured")}),i&&e.jsx("button",{onClick:()=>a(`/projects/${r.key}/pipeline`),className:"mt-3 flex w-full items-center justify-center gap-1.5 py-2 text-xs text-[var(--accent)] hover:text-[var(--accent)]",children:t("projects.add_stage")})]})})]}),e.jsx(ee,{isOpen:I,onClose:()=>N(!1),onConfirm:O,projectName:r.name,loading:T}),e.jsx(V,{isOpen:$,onClose:()=>_(!1),projectKey:r.key,existingMemberIds:u.map(s=>s.developerId),onAdded:v}),e.jsx(z,{isOpen:!!m,onClose:()=>y(null),onConfirm:R,memberName:m?m.developerName??`#${m.developerId}`:"",loading:U})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("projects.project_not_found")}),e.jsx("button",{onClick:()=>a("/projects"),className:"mt-4 rounded border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:t("projects.back_to_projects")})]})}function c({label:n,value:a,href:t}){return e.jsxs("div",{className:"flex items-center gap-3 py-1",children:[e.jsx("span",{className:"w-32 shrink-0 text-xs text-[var(--text-muted)]",children:n}),t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"truncate text-sm text-[var(--accent)] hover:underline",children:a}):e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:a})]})}export{de as default};
@@ -1,4 +1,4 @@
1
- import{c as L,a as E,r as a,j as e,f as z,d as D,h as R}from"./index-BdEJ0aTM.js";import{G as h,A as m}from"./protocol-C5uQmiiB.js";import{S as F}from"./Select-DOPqCoVh.js";import{E as G}from"./EmptyState-C9vei1H4.js";import{T as I}from"./Skeleton-DRiV4Mc_.js";import{P as H}from"./plus-8YfTJ47b.js";/**
1
+ import{c as L,a as E,r as a,j as e,f as z,d as D,h as R}from"./index-IC0w3nms.js";import{G as h,A as m}from"./protocol-C5uQmiiB.js";import{S as F}from"./Select-vE59gnrR.js";import{E as G}from"./EmptyState-CqOs-r87.js";import{T as I}from"./Skeleton-DkWfJwGk.js";import{P as H}from"./plus-DAoE-jeh.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{a as b,r as s,f as h,j as e,C as v}from"./index-BdEJ0aTM.js";import{C as f}from"./copy-CpdsOI_O.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};
1
+ import{a as b,r as s,f as h,j as e,C as v}from"./index-IC0w3nms.js";import{C as f}from"./copy-DeIFkKL0.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};
@@ -1,4 +1,4 @@
1
- import{c as w,a as _,r as s,j as e,X as R,f as g,l as C}from"./index-BdEJ0aTM.js";import{P as l}from"./protocol-C5uQmiiB.js";import{S as N}from"./Select-DOPqCoVh.js";/**
1
+ import{c as w,a as _,r as s,j as e,X as R,f as g,l as C}from"./index-IC0w3nms.js";import{P as l}from"./protocol-C5uQmiiB.js";import{S as N}from"./Select-vE59gnrR.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as f,r as c,j as t}from"./index-BdEJ0aTM.js";/**
1
+ import{c as f,r as c,j as t}from"./index-IC0w3nms.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as h,a as v,r,j as e,f as m,t as x}from"./index-BdEJ0aTM.js";/**
1
+ import{c as h,a as v,r,j as e,f as m,t as x}from"./index-IC0w3nms.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e}from"./index-BdEJ0aTM.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};
1
+ import{j as e}from"./index-IC0w3nms.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};
@@ -1 +1 @@
1
- import{a as c,j as e,r as n,C as o}from"./index-BdEJ0aTM.js";import{E as i}from"./external-link-Cp9i7osW.js";import{C as d}from"./copy-CpdsOI_O.js";function a({text:t}){const[s,r]=n.useState(!1);return e.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),2e3)},className:"rounded-[4px] p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:s?e.jsx(o,{className:"h-3 w-3 text-[var(--accent)]"}):e.jsx(d,{className:"h-3 w-3"})})}function x({text:t}){return e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:t}),e.jsx(a,{text:t})]})}const l=[{action:"create tasks",desc:"describe what you want done, overlord dispatches to a worker"},{action:"list & monitor tasks",desc:"check status, read execution logs, track progress"},{action:"cancel & retry tasks",desc:"manage task lifecycle"},{action:"confirm pipeline stages",desc:"approve or provide input for suspended stages"},{action:"manage projects",desc:"list projects, view members"},{action:"check cluster health",desc:"see machine status, online workers, queue depth"},{action:"search",desc:"find tasks, projects, and machines by keyword"},{action:"read notifications",desc:"check and clear your notification inbox"}],m=['create a task in project "frontend" to fix the login page styling',"what tasks are running right now?","show me the logs for task 42","how many machines are online?","cancel task 15"],p=[{name:"claude code",url:"https://claude.com/claude-code"},{name:"cursor",url:"https://cursor.com"},{name:"windsurf",url:"https://windsurf.com"},{name:"codex",url:"https://openai.com/codex"}];function b(){c();const t=typeof window<"u"?window.location.origin:"https://your-server";return e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."})}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// install"}),e.jsx(x,{text:"npx skills add overlord-run/skill"})]}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// configure — set these environment variables"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=",e.jsx("span",{className:"text-[var(--accent)]",children:t})]}),e.jsx(a,{text:`export OVERLORD_SERVER=${t}`})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"your-token"})]}),e.jsx(a,{text:"export OVERLORD_TOKEN=your-token"})]})]}),e.jsxs("p",{className:"text-[10px] text-[var(--text-muted)]",children:["// create a token at ",e.jsx("a",{href:"/access-tokens",className:"text-[var(--accent)] hover:underline",children:"/access-tokens"})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> capabilities"}),e.jsx("div",{className:"space-y-2",children:l.map(s=>e.jsxs("div",{className:"flex items-start gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("span",{className:"shrink-0 text-xs font-medium text-[var(--text-primary)]",children:s.action}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.desc]})]},s.action))})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> example usage"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:"// just ask your ai agent naturally"}),m.map(s=>e.jsx("div",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:e.jsxs("code",{className:"text-xs text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> "}),s]})},s))]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> compatible tools"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:p.map(s=>e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2.5 text-xs text-[var(--text-primary)] transition-colors hover:border-[var(--accent)]",children:[s.name,e.jsx(i,{className:"h-3 w-3 text-[var(--text-muted)]"})]},s.name))}),e.jsx("p",{className:"mt-2 text-[10px] text-[var(--text-muted)]",children:"// and any ai coding assistant that supports the skills protocol"})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["// open source:"," ",e.jsx("a",{href:"https://github.com/overlord-run/skill",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent)] hover:underline",children:"github.com/overlord-run/skill"})]})})]})}export{b as default};
1
+ import{a as c,j as e,r as n,C as o}from"./index-IC0w3nms.js";import{E as i}from"./external-link-8WYxL39M.js";import{C as d}from"./copy-DeIFkKL0.js";function a({text:t}){const[s,r]=n.useState(!1);return e.jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(t),r(!0),setTimeout(()=>r(!1),2e3)},className:"rounded-[4px] p-1 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:s?e.jsx(o,{className:"h-3 w-3 text-[var(--accent)]"}):e.jsx(d,{className:"h-3 w-3"})})}function x({text:t}){return e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)]",children:t}),e.jsx(a,{text:t})]})}const l=[{action:"create tasks",desc:"describe what you want done, overlord dispatches to a worker"},{action:"list & monitor tasks",desc:"check status, read execution logs, track progress"},{action:"cancel & retry tasks",desc:"manage task lifecycle"},{action:"confirm pipeline stages",desc:"approve or provide input for suspended stages"},{action:"manage projects",desc:"list projects, view members"},{action:"check cluster health",desc:"see machine status, online workers, queue depth"},{action:"search",desc:"find tasks, projects, and machines by keyword"},{action:"read notifications",desc:"check and clear your notification inbox"}],m=['create a task in project "frontend" to fix the login page styling',"what tasks are running right now?","show me the logs for task 42","how many machines are online?","cancel task 15"],p=[{name:"claude code",url:"https://claude.com/claude-code"},{name:"cursor",url:"https://cursor.com"},{name:"windsurf",url:"https://windsurf.com"},{name:"codex",url:"https://openai.com/codex"}];function b(){c();const t=typeof window<"u"?window.location.origin:"https://your-server";return e.jsxs("div",{className:"mx-auto max-w-4xl px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."})}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// install"}),e.jsx(x,{text:"npx skills add overlord-run/skill"})]}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// configure — set these environment variables"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=",e.jsx("span",{className:"text-[var(--accent)]",children:t})]}),e.jsx(a,{text:`export OVERLORD_SERVER=${t}`})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)]",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"your-token"})]}),e.jsx(a,{text:"export OVERLORD_TOKEN=your-token"})]})]}),e.jsxs("p",{className:"text-[10px] text-[var(--text-muted)]",children:["// create a token at ",e.jsx("a",{href:"/access-tokens",className:"text-[var(--accent)] hover:underline",children:"/access-tokens"})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> capabilities"}),e.jsx("div",{className:"space-y-2",children:l.map(s=>e.jsxs("div",{className:"flex items-start gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("span",{className:"shrink-0 text-xs font-medium text-[var(--text-primary)]",children:s.action}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.desc]})]},s.action))})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> example usage"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:"// just ask your ai agent naturally"}),m.map(s=>e.jsx("div",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:e.jsxs("code",{className:"text-xs text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> "}),s]})},s))]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> compatible tools"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:p.map(s=>e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2.5 text-xs text-[var(--text-primary)] transition-colors hover:border-[var(--accent)]",children:[s.name,e.jsx(i,{className:"h-3 w-3 text-[var(--text-muted)]"})]},s.name))}),e.jsx("p",{className:"mt-2 text-[10px] text-[var(--text-muted)]",children:"// and any ai coding assistant that supports the skills protocol"})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["// open source:"," ",e.jsx("a",{href:"https://github.com/overlord-run/skill",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent)] hover:underline",children:"github.com/overlord-run/skill"})]})})]})}export{b as default};
@@ -1,4 +1,4 @@
1
- var He=Object.defineProperty;var Fe=(G,$,F)=>$ in G?He(G,$,{enumerable:!0,configurable:!0,writable:!0,value:F}):G[$]=F;var ve=(G,$,F)=>Fe(G,typeof $!="symbol"?$+"":$,F);import{c as pe,r as z,u as We,f as ce,j as C,a as be,l as Ie,m as Ue,d as $e,n as ze,X as we,o as Ke,t as ke,i as qe}from"./index-BdEJ0aTM.js";import{u as Ve}from"./task.store-CR5aAb6q.js";import{S as Ge}from"./Select-DOPqCoVh.js";import{A as Xe}from"./arrow-left-rWVL-A4T.js";import{R as Je}from"./rotate-ccw-CrJHxzN4.js";import{E as Ye}from"./external-link-Cp9i7osW.js";import{L as Ee}from"./loader-circle-CwvOmGaz.js";/**
1
+ var He=Object.defineProperty;var Fe=(G,$,F)=>$ in G?He(G,$,{enumerable:!0,configurable:!0,writable:!0,value:F}):G[$]=F;var ve=(G,$,F)=>Fe(G,typeof $!="symbol"?$+"":$,F);import{c as pe,r as z,u as We,f as ce,j as C,a as be,l as Ie,m as Ue,d as $e,n as ze,X as we,o as Ke,t as ke,i as qe}from"./index-IC0w3nms.js";import{u as Ve}from"./task.store-DDFQ0jcG.js";import{S as Ge}from"./Select-vE59gnrR.js";import{A as Xe}from"./arrow-left-_sT90Vgd.js";import{R as Je}from"./rotate-ccw-CY2m880Q.js";import{E as Ye}from"./external-link-8WYxL39M.js";import{L as Ee}from"./loader-circle-CjjIeO9t.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.