@overlordai/server 1.0.134 → 1.0.136

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 (105) hide show
  1. package/database/migrations/008-task-target-branch.sql +1 -0
  2. package/dist/adapters/help-text.js +1 -1
  3. package/dist/database/repositories/task.repository.d.ts +1 -0
  4. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  5. package/dist/database/repositories/task.repository.js +6 -2
  6. package/dist/database/repositories/task.repository.js.map +1 -1
  7. package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
  8. package/dist/dispatcher/scheduler.service.js +24 -5
  9. package/dist/dispatcher/scheduler.service.js.map +1 -1
  10. package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
  11. package/dist/dispatcher/task-creation.service.js +4 -0
  12. package/dist/dispatcher/task-creation.service.js.map +1 -1
  13. package/dist/web/task.controller.d.ts +1 -0
  14. package/dist/web/task.controller.d.ts.map +1 -1
  15. package/dist/web/task.controller.js +6 -0
  16. package/dist/web/task.controller.js.map +1 -1
  17. package/package.json +4 -4
  18. package/public/assets/{AccessTokensPage-BoVgUrzP.js → AccessTokensPage-DR-poRS4.js} +1 -1
  19. package/public/assets/{AdminPage-P2z0Fl0Y.js → AdminPage-BBswldyj.js} +1 -1
  20. package/public/assets/{AgentCliPage-C7GiYV6z.js → AgentCliPage-BjvJPqFg.js} +1 -1
  21. package/public/assets/{ApiReferencePage-Kzj97VkN.js → ApiReferencePage-DGncLrQ3.js} +1 -1
  22. package/public/assets/{ArchitecturePage-Dj1I7Lif.js → ArchitecturePage-Ce0QnFXC.js} +1 -1
  23. package/public/assets/{AuditLogPage-D1OTE5S1.js → AuditLogPage-w_7Nj4Rv.js} +1 -1
  24. package/public/assets/{BindPlatformPage-CUbHhfZo.js → BindPlatformPage-CaN-9QLb.js} +1 -1
  25. package/public/assets/{BotIntegrationPage-Cz1-B_ag.js → BotIntegrationPage-SVH7cMHP.js} +1 -1
  26. package/public/assets/{BotManage-DGCb_1uD.js → BotManage-D-lenZUf.js} +1 -1
  27. package/public/assets/{BotSetupPage-DEj-NMfd.js → BotSetupPage-DoLW98NA.js} +1 -1
  28. package/public/assets/{ChangelogPage-DerOZcUF.js → ChangelogPage-DuEv-8dO.js} +1 -1
  29. package/public/assets/{CliReferencePage-kHDw2pA7.js → CliReferencePage-BY4jRKIa.js} +1 -1
  30. package/public/assets/{DeploymentPage-B5XPM33m.js → DeploymentPage-5MdRHTAa.js} +1 -1
  31. package/public/assets/{DevWorkflowPage-CdyR3M_a.js → DevWorkflowPage-O7m2Y5RK.js} +1 -1
  32. package/public/assets/{DeveloperManage-CADxGSzH.js → DeveloperManage-DvAPUGuF.js} +1 -1
  33. package/public/assets/{DeveloperSetupPage-TGy2mo4p.js → DeveloperSetupPage-ZxzN_i4I.js} +1 -1
  34. package/public/assets/{DocsIndexPage-CKLFPHA9.js → DocsIndexPage-BQ1p1z73.js} +1 -1
  35. package/public/assets/{DocsLayout-j09z0-2-.js → DocsLayout-C21J5c4W.js} +1 -1
  36. package/public/assets/{DocsPrimitives-BjKzQarf.js → DocsPrimitives-C-MCNelj.js} +1 -1
  37. package/public/assets/{EditProjectPage-YrALdZ6_.js → EditProjectPage-DtBVrVqX.js} +1 -1
  38. package/public/assets/{EmptyState-c4IsGUGS.js → EmptyState-BwOJcw-7.js} +1 -1
  39. package/public/assets/{EnvVariablesPage-DUV5GbgH.js → EnvVariablesPage-BO3O-emk.js} +1 -1
  40. package/public/assets/{HomePage-Bd0qbwuy.js → HomePage-DGlnGz9w.js} +1 -1
  41. package/public/assets/{InfoRow-OjQK-lfD.js → InfoRow-CArRH_uK.js} +1 -1
  42. package/public/assets/{InstallationPage-QKu8ZH_9.js → InstallationPage-DbN30z1N.js} +1 -1
  43. package/public/assets/{LandingPage-9OL5ViAD.js → LandingPage-h4gKySBf.js} +1 -1
  44. package/public/assets/{LocalDevelopmentPage-DktRuJdo.js → LocalDevelopmentPage-CzGh_CyA.js} +1 -1
  45. package/public/assets/{LoginPage-zjkljmUG.js → LoginPage-D0xxVRbd.js} +1 -1
  46. package/public/assets/{MetricBar-Ct-6XoF8.js → MetricBar-CBh2ydOP.js} +1 -1
  47. package/public/assets/{NotFoundPage-DpUSdTHq.js → NotFoundPage-CTB5zYpq.js} +1 -1
  48. package/public/assets/{OnboardingGuide-DniYFVLU.js → OnboardingGuide-j6HspxdC.js} +1 -1
  49. package/public/assets/{PermissionsPage-AtbdWCh6.js → PermissionsPage-DhIPVozc.js} +1 -1
  50. package/public/assets/{PipelineConfigPage-ByKxXAqM.js → PipelineConfigPage-BPP3hqfX.js} +1 -1
  51. package/public/assets/{PipelineEditorPage-BmkHpPoJ.js → PipelineEditorPage-zNzVbcEY.js} +1 -1
  52. package/public/assets/{ProfilePage-D3DWeoQM.js → ProfilePage-By17-B9R.js} +1 -1
  53. package/public/assets/{ProjectDetailPage-DcxPgXCF.js → ProjectDetailPage-D3tG00hE.js} +1 -1
  54. package/public/assets/{ProjectListPage-B2LJx5SB.js → ProjectListPage-yOkjg0aA.js} +2 -2
  55. package/public/assets/{PtyTerminal-BQ2UYeLe.js → PtyTerminal-BCi4nF3w.js} +1 -1
  56. package/public/assets/{QuickAuth-DbXnLBbA.js → QuickAuth-Dv8THFX-.js} +1 -1
  57. package/public/assets/{RemoveMemberConfirmDialog-DgXwrcbD.js → RemoveMemberConfirmDialog-7CNTS9OT.js} +1 -1
  58. package/public/assets/{Select-CKozUJa5.js → Select-C9mH7t3y.js} +1 -1
  59. package/public/assets/{SettingsPage-Dc7kQQ-U.js → SettingsPage-CyrpPfpE.js} +1 -1
  60. package/public/assets/{Skeleton-1CByoX9G.js → Skeleton-BSwNthrI.js} +1 -1
  61. package/public/assets/{SkillPage-C5bC1S4B.js → SkillPage-x3K6pR1n.js} +1 -1
  62. package/public/assets/{TaskDetailPage-Bci7hNZD.js → TaskDetailPage-C4qj7_Be.js} +1 -1
  63. package/public/assets/TaskListPage-ChDkGoRG.js +1 -0
  64. package/public/assets/{TaskStatusBadge-BQr1iwes.js → TaskStatusBadge-bgFlcooX.js} +1 -1
  65. package/public/assets/TerminalHomePage-DvUjZD9t.js +11 -0
  66. package/public/assets/{TokenManage-CaQAVdV3.js → TokenManage-BiFQC6sW.js} +1 -1
  67. package/public/assets/{Tooltip-D_CBrTO_.js → Tooltip-C8VKfixS.js} +1 -1
  68. package/public/assets/{TotpSetupPage-hm7e8ja5.js → TotpSetupPage-BBiIpwY3.js} +1 -1
  69. package/public/assets/{WorkerDetailPage-B1Dx_37R.js → WorkerDetailPage-Du6ZEZAb.js} +1 -1
  70. package/public/assets/{WorkerListPage-BS3r46aW.js → WorkerListPage-ByqfyN10.js} +1 -1
  71. package/public/assets/{WorkerOperationsPage-EplOzeIS.js → WorkerOperationsPage-DeqjI2So.js} +1 -1
  72. package/public/assets/{WorkerSetupGuidePage-Bj7AFF_z.js → WorkerSetupGuidePage-BVJvCq1d.js} +1 -1
  73. package/public/assets/{WorkerSetupPage-C3mkq4zM.js → WorkerSetupPage-D3Jpi9tJ.js} +1 -1
  74. package/public/assets/{agent-type-options-DUkN669t.js → agent-type-options-snmZcyAv.js} +1 -1
  75. package/public/assets/{arrow-left-BPE0QXvK.js → arrow-left-CIwOL41D.js} +1 -1
  76. package/public/assets/{arrow-right-BdXr5iFo.js → arrow-right-vAeX7cF5.js} +1 -1
  77. package/public/assets/{bot-CNZBTp4c.js → bot-CvhMANHw.js} +1 -1
  78. package/public/assets/{chevron-left-BhcTbOUx.js → chevron-left-C6IUM-8d.js} +1 -1
  79. package/public/assets/{chevron-right-BuhDQxo4.js → chevron-right-CtCcIQB9.js} +1 -1
  80. package/public/assets/{copy-cloBpe4U.js → copy-BsSvzuvN.js} +1 -1
  81. package/public/assets/{download-BxlPrmML.js → download-DziGmRwM.js} +1 -1
  82. package/public/assets/{external-link-Clr8ygf6.js → external-link-D4FpeC5t.js} +1 -1
  83. package/public/assets/{file-text-KFjDZaJL.js → file-text-DWEXk0wE.js} +1 -1
  84. package/public/assets/{git-fork-CBlyXbge.js → git-fork-DWSuvIF4.js} +1 -1
  85. package/public/assets/index-3ccyrL7z.css +1 -0
  86. package/public/assets/{index-DJl-vKpg.js → index-D_OrDcWf.js} +3 -3
  87. package/public/assets/{key-BwIOi-0U.js → key-BpF_rjM9.js} +1 -1
  88. package/public/assets/{loader-circle-CF4O3sgn.js → loader-circle-PQQXGtgi.js} +1 -1
  89. package/public/assets/{pencil-BKwPd_Fv.js → pencil-DvVrY4a_.js} +1 -1
  90. package/public/assets/{plus-Dy384KeJ.js → plus-DLpnTi95.js} +1 -1
  91. package/public/assets/{rotate-ccw-BqKuF1OZ.js → rotate-ccw-CiTf48Td.js} +1 -1
  92. package/public/assets/{scroll-text-BQnKZlDZ.js → scroll-text-cGPnQr3M.js} +1 -1
  93. package/public/assets/{settings-iP7F66C4.js → settings--c2rvWEY.js} +1 -1
  94. package/public/assets/{status-colors-D3fj6h6e.js → status-colors-CYQlZjBF.js} +1 -1
  95. package/public/assets/{task-constants-q2zc7hX5.js → task-constants-C28Dag_x.js} +1 -1
  96. package/public/assets/{trash-2-CYF0CqNA.js → trash-2-B5fxIpUx.js} +1 -1
  97. package/public/assets/{useFetch-CyCGABKu.js → useFetch-_T-wW8J0.js} +1 -1
  98. package/public/assets/{users-BQ-sAhp6.js → users-cnF1W_5i.js} +1 -1
  99. package/public/assets/{wifi-DKdwzLvS.js → wifi-DyUmH42s.js} +1 -1
  100. package/public/assets/{workflow-DlF_hAtY.js → workflow-Br0aC6fc.js} +1 -1
  101. package/public/index.html +2 -2
  102. package/public/sw.js +1 -1
  103. package/public/assets/TaskListPage-CysAqfJ7.js +0 -1
  104. package/public/assets/TerminalHomePage-AG4elUye.js +0 -11
  105. package/public/assets/index-D6SjJWkw.css +0 -1
@@ -1,3 +1,3 @@
1
- import{a as g,r as x,j as e,Q as $,A as I,f as M,h as S,t as y}from"./index-DJl-vKpg.js";import{S as C}from"./Select-CKozUJa5.js";const O={stages:[]};function q(){return{name:"",prompt:""}}function b({children:t}){return e.jsx("label",{className:"mb-1 block font-mono text-[11px] text-[var(--text-secondary)]",children:t})}function j({value:t,onChange:o,placeholder:a,type:r="text",className:c=""}){return e.jsx("input",{type:r,value:t,onChange:s=>o(s.target.value),placeholder:a,className:`w-full rounded-[4px] 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 ${c}`})}function J({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 N({value:t,onChange:o,placeholder:a,rows:r=4}){return e.jsx("textarea",{value:t,onChange:c=>o(c.target.value),placeholder:a,rows:r,className:"w-full rounded-[4px] 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 T({stage:t,index:o,selected:a,onSelect:r,onDelete:c}){const{t:s}=g(),i=t.prompt?$(t.prompt,60):"";return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())},className:`group relative flex w-full items-start gap-3 rounded-[4px] border px-4 py-3 text-left transition-colors ${a?"border-[var(--accent)] bg-[var(--bg-card)]":"border-[var(--border)] bg-[var(--bg-card)] hover:border-[var(--text-muted)]"}`,style:{borderLeftWidth:3,borderLeftColor:"var(--accent)"},children:[e.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[11px] 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"}),t.label&&e.jsx("span",{className:"truncate font-mono text-[11px] text-[var(--text-muted)]",children:t.label})]}),i&&e.jsxs("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[var(--text-muted)]",children:["// ",i]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 font-mono text-[11px] text-[var(--text-muted)]",children:[t.gate&&e.jsx("span",{children:"gate"}),t.requireConfirm&&e.jsx("span",{children:"confirm"}),t.timeout!=null&&e.jsxs("span",{children:["timeout:",t.timeout,"s"]})]})]}),e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),c()},className:"mt-0.5 shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] opacity-0 transition-opacity hover:text-[var(--destructive)] group-hover:opacity-100","aria-label":s("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 _({stage:t,onChange:o,allStageNames:a}){const{t:r}=g(),c=x.useMemo(()=>{const s=[{value:"",label:"-- select --"}];for(const i of a)i&&i!==t.name&&s.push({value:i,label:i});return s},[a,t.name]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-mono text-sm font-semibold text-[var(--accent)]",children:r("pipeline.stage_properties")}),e.jsx("p",{className:"font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.editing",{name:t.name||r("pipeline.unnamed")})}),e.jsxs("div",{children:[e.jsxs(b,{children:[r("pipeline.name")," *"]}),e.jsx(j,{value:t.name,onChange:s=>o({name:s}),placeholder:r("pipeline.stage_name")})]}),e.jsxs("div",{children:[e.jsx(b,{children:"label"}),e.jsx(j,{value:t.label??"",onChange:s=>o({label:s||void 0}),placeholder:"optional display label"})]}),e.jsxs("div",{children:[e.jsx(b,{children:"prompt *"}),e.jsx(N,{value:t.prompt,onChange:s=>o({prompt:s}),placeholder:"instructions for the agent...",rows:8})]}),e.jsxs("div",{children:[e.jsx(b,{children:"gate"}),e.jsx(j,{value:t.gate??"",onChange:s=>o({gate:s||void 0}),placeholder:"Pass condition, e.g.: no P1-P3 issues"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:r("pipeline.confirm_required")}),e.jsx(J,{checked:t.requireConfirm??!1,onChange:s=>o({requireConfirm:s})})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.timeout")}),e.jsx(j,{type:"number",value:String(t.timeout??""),onChange:s=>o({timeout:s?parseInt(s,10):void 0}),placeholder:"600"})]}),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:r("pipeline.on_failure_section")}),e.jsxs("div",{className:"mb-3",children:[e.jsx(b,{children:r("pipeline.on_failure")}),e.jsx(C,{value:t.onFailure?"goto":"stop",onChange:s=>{o(s==="stop"?{onFailure:void 0}:{onFailure:{goto:"",maxLoops:3}})},options:[{value:"stop",label:r("pipeline.stop")},{value:"goto",label:r("pipeline.goto_stage")}]})]}),t.onFailure&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.goto")}),e.jsx(C,{value:t.onFailure.goto,onChange:s=>{var i;return o({onFailure:{goto:s,maxLoops:((i=t.onFailure)==null?void 0:i.maxLoops)??3}})},options:c})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.max_loops")}),e.jsx(j,{type:"number",value:String(t.onFailure.maxLoops),onChange:s=>{var i;return o({onFailure:{goto:((i=t.onFailure)==null?void 0:i.goto)??"",maxLoops:s?parseInt(s,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:"params"}),e.jsx(N,{value:t.params?Object.entries(t.params).map(([s,i])=>`${s}=${i}`).join(`
1
+ import{a as g,r as x,j as e,Q as $,A as I,f as M,h as S,t as y}from"./index-D_OrDcWf.js";import{S as C}from"./Select-C9mH7t3y.js";const O={stages:[]};function q(){return{name:"",prompt:""}}function b({children:t}){return e.jsx("label",{className:"mb-1 block font-mono text-[11px] text-[var(--text-secondary)]",children:t})}function j({value:t,onChange:o,placeholder:a,type:r="text",className:c=""}){return e.jsx("input",{type:r,value:t,onChange:s=>o(s.target.value),placeholder:a,className:`w-full rounded-[4px] 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 ${c}`})}function J({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 N({value:t,onChange:o,placeholder:a,rows:r=4}){return e.jsx("textarea",{value:t,onChange:c=>o(c.target.value),placeholder:a,rows:r,className:"w-full rounded-[4px] 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 T({stage:t,index:o,selected:a,onSelect:r,onDelete:c}){const{t:s}=g(),i=t.prompt?$(t.prompt,60):"";return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())},className:`group relative flex w-full items-start gap-3 rounded-[4px] border px-4 py-3 text-left transition-colors ${a?"border-[var(--accent)] bg-[var(--bg-card)]":"border-[var(--border)] bg-[var(--bg-card)] hover:border-[var(--text-muted)]"}`,style:{borderLeftWidth:3,borderLeftColor:"var(--accent)"},children:[e.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[11px] 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"}),t.label&&e.jsx("span",{className:"truncate font-mono text-[11px] text-[var(--text-muted)]",children:t.label})]}),i&&e.jsxs("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[var(--text-muted)]",children:["// ",i]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 font-mono text-[11px] text-[var(--text-muted)]",children:[t.gate&&e.jsx("span",{children:"gate"}),t.requireConfirm&&e.jsx("span",{children:"confirm"}),t.timeout!=null&&e.jsxs("span",{children:["timeout:",t.timeout,"s"]})]})]}),e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),c()},className:"mt-0.5 shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] opacity-0 transition-opacity hover:text-[var(--destructive)] group-hover:opacity-100","aria-label":s("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 _({stage:t,onChange:o,allStageNames:a}){const{t:r}=g(),c=x.useMemo(()=>{const s=[{value:"",label:"-- select --"}];for(const i of a)i&&i!==t.name&&s.push({value:i,label:i});return s},[a,t.name]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-mono text-sm font-semibold text-[var(--accent)]",children:r("pipeline.stage_properties")}),e.jsx("p",{className:"font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.editing",{name:t.name||r("pipeline.unnamed")})}),e.jsxs("div",{children:[e.jsxs(b,{children:[r("pipeline.name")," *"]}),e.jsx(j,{value:t.name,onChange:s=>o({name:s}),placeholder:r("pipeline.stage_name")})]}),e.jsxs("div",{children:[e.jsx(b,{children:"label"}),e.jsx(j,{value:t.label??"",onChange:s=>o({label:s||void 0}),placeholder:"optional display label"})]}),e.jsxs("div",{children:[e.jsx(b,{children:"prompt *"}),e.jsx(N,{value:t.prompt,onChange:s=>o({prompt:s}),placeholder:"instructions for the agent...",rows:8})]}),e.jsxs("div",{children:[e.jsx(b,{children:"gate"}),e.jsx(j,{value:t.gate??"",onChange:s=>o({gate:s||void 0}),placeholder:"Pass condition, e.g.: no P1-P3 issues"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:r("pipeline.confirm_required")}),e.jsx(J,{checked:t.requireConfirm??!1,onChange:s=>o({requireConfirm:s})})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.timeout")}),e.jsx(j,{type:"number",value:String(t.timeout??""),onChange:s=>o({timeout:s?parseInt(s,10):void 0}),placeholder:"600"})]}),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:r("pipeline.on_failure_section")}),e.jsxs("div",{className:"mb-3",children:[e.jsx(b,{children:r("pipeline.on_failure")}),e.jsx(C,{value:t.onFailure?"goto":"stop",onChange:s=>{o(s==="stop"?{onFailure:void 0}:{onFailure:{goto:"",maxLoops:3}})},options:[{value:"stop",label:r("pipeline.stop")},{value:"goto",label:r("pipeline.goto_stage")}]})]}),t.onFailure&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.goto")}),e.jsx(C,{value:t.onFailure.goto,onChange:s=>{var i;return o({onFailure:{goto:s,maxLoops:((i=t.onFailure)==null?void 0:i.maxLoops)??3}})},options:c})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.max_loops")}),e.jsx(j,{type:"number",value:String(t.onFailure.maxLoops),onChange:s=>{var i;return o({onFailure:{goto:((i=t.onFailure)==null?void 0:i.goto)??"",maxLoops:s?parseInt(s,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:"params"}),e.jsx(N,{value:t.params?Object.entries(t.params).map(([s,i])=>`${s}=${i}`).join(`
2
2
  `):"",onChange:s=>{if(!s.trim()){o({params:void 0});return}const i={};s.split(`
3
3
  `).forEach(d=>{const l=d.indexOf("=");l>0&&(i[d.slice(0,l).trim()]=d.slice(l+1).trim())}),o({params:i})},placeholder:"KEY=value (one per line)",rows:3})]})]})}function D({value:t,onChange:o}){const[a,r]=x.useState(t.trim().length>0);return x.useEffect(()=>{!a&&t.trim().length>0&&r(!0)},[t,a]),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("button",{type:"button",onClick:()=>r(c=>!c),className:"flex w-full items-center justify-between px-4 py-3 text-left font-mono text-xs font-semibold text-[var(--accent)]",children:[e.jsx("span",{children:"preamble"}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a?"[-]":"[+]"})]}),a&&e.jsx("div",{className:"border-t border-[var(--border)] px-4 py-3",children:e.jsx(N,{value:t,onChange:o,placeholder:"Global pre-prompt injected before all stages",rows:4})})]})}function A({value:t,onChange:o}){const{t:a}=g(),[r,c]=x.useState(null),[s,i]=x.useState(!1),d=x.useMemo(()=>t??O,[t]),l=d.stages,h=r!=null?l[r]??null:null,f=x.useMemo(()=>l.map(n=>n.name),[l]),v=x.useCallback(n=>{o({...d,stages:n})},[o,d]),F=x.useCallback(()=>{const n=[...l,q()];v(n),c(n.length-1)},[l,v]),E=x.useCallback(n=>{const p=l.filter((m,u)=>u!==n);v(p),r===n?c(p.length>0?Math.min(n,p.length-1):null):r!=null&&r>n&&c(r-1)},[l,r,v]),w=x.useCallback((n,p)=>{const m=l.map((u,P)=>P===n?{...u,...p}:u);v(m)},[l,v]),k=x.useCallback((n,p)=>{const m=p==="up"?n-1:n+1;if(m<0||m>=l.length)return;const u=[...l];[u[n],u[m]]=[u[m],u[n]],v(u),r===n?c(m):r===m&&c(n)},[l,r,v]),L=x.useMemo(()=>JSON.stringify(d,null,2),[d]);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:()=>i(n=>!n),className:`rounded-[4px] border px-2 py-1 font-mono text-[11px] transition-colors ${s?"border-[var(--accent)] text-[var(--accent)]":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:[a("pipeline.json_toggle")," ⇅"]})}),s&&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:L}),e.jsx("div",{className:"mb-4",children:e.jsx(D,{value:d.preamble??"",onChange:n=>o({...d,preamble:n||void 0})})}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.map((n,p)=>{var m;return e.jsxs("div",{children:[e.jsx(T,{stage:n,index:p,selected:r===p,onSelect:()=>c(p),onDelete:()=>E(p)}),p<l.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-[11px] text-[var(--text-muted)]",children:"▼"}),e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"})]}),((m=n.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-[11px] text-[var(--warning)]",children:["↺ loop → ",n.onFailure.goto," (max ",n.onFailure.maxLoops,")"]})})]},`${p}-${n.name}`)}),r!=null&&l.length>1&&e.jsxs("div",{className:"flex items-center gap-1 pl-7 pt-2",children:[e.jsxs("button",{type:"button",disabled:r===0,onClick:()=>k(r,"up"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▲ ",a("pipeline.up")]}),e.jsxs("button",{type:"button",disabled:r===l.length-1,onClick:()=>k(r,"down"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▼ ",a("pipeline.down")]})]}),e.jsx("div",{className:"flex items-center justify-center py-3",children:e.jsxs("button",{type:"button",onClick:F,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:"+"})," ",a("pipeline.add_stage")]})}),h&&e.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs font-semibold text-[var(--accent)]",children:a("pipeline.stage_properties")}),e.jsx("button",{type:"button",onClick:()=>c(null),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 font-mono text-[11px] text-[var(--text-muted)]",children:"x"})]}),e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f})]})]}),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:h?e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f}):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:a("pipeline.select_stage")})})})]})]})}function K(){const{key:t}=I(),o=M(),{t:a}=g(),[r,c]=x.useState(null),[s,i]=x.useState(!0),[d,l]=x.useState(!1);x.useEffect(()=>{t&&S.get(`web/projects/${t}`).json().then(f=>{if(f.pipeline)try{c(JSON.parse(f.pipeline))}catch{c(null)}}).catch(()=>y.error(a("pipeline.failed_to_load_project"))).finally(()=>i(!1))},[t,a]);const h=x.useCallback(async()=>{if(t){l(!0);try{await S.put(`web/projects/${t}`,{json:{pipeline:r?JSON.stringify(r):null}}),y.success(a("pipeline.saved"))}catch{y.error(a("pipeline.failed_to_save"))}finally{l(!1)}}},[t,r,a]);return s?e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("pipeline.loading_pipeline")})}):e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-[var(--border)] px-4 md:px-8 py-5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-base font-medium text-[var(--text-primary)] shrink-0",children:a("pipeline.title")}),e.jsx("span",{className:"text-sm text-[var(--text-muted)] truncate",children:a("pipeline.subtitle",{key:t??""})})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:h,disabled:d,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black disabled:opacity-50",children:a(d?"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:a("pipeline.cancel")})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 md:p-8",children:e.jsx(A,{value:r,onChange:c})})]})}export{K as default};
@@ -1 +1 @@
1
- import{a as A,u as F,f as T,r as s,j as e,L as z,V as I,Y as V,v as $,h as p,t as c}from"./index-DJl-vKpg.js";import{v as K}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-OjQK-lfD.js";import{u as M}from"./useFetch-CyCGABKu.js";function J(){var y,k,C,P;const{t:r}=A(),{logout:L}=F(),E=T(),[S,m]=s.useState(!1),{data:t,loading:U,refetch:D}=M(()=>p.get("web/profile").json(),[]),[x,u]=s.useState(""),[d,b]=s.useState(""),[f,v]=s.useState(""),[g,h]=s.useState(!1),[j,n]=s.useState(""),[i,_]=s.useState(""),[w,N]=s.useState(!1);async function O(){if(n(""),!x){n(r("profile.current_password_required"));return}if(!d){n(r("profile.new_password_required"));return}const a=K(d);if(a){n(r(a));return}if(d!==f){n(r("profile.passwords_do_not_match"));return}try{h(!0),await p.put("web/profile/password",{json:{currentPassword:x,newPassword:d}}),c.success(r("profile.password_changed")),u(""),b(""),v("")}catch(l){const q=l instanceof Error?l.message:r("profile.failed_to_change_password");n(q)}finally{h(!1)}}async function R(){if(!i||i.length!==6){c.error(r("profile.totp_code_required"));return}try{N(!0),await p.post("web/profile/totp/regenerate",{json:{code:i}}),c.success(r("profile.two_fa_regenerated")),_(""),D()}catch(a){const l=a instanceof Error?a.message:r("profile.totp_code_invalid");c.error(l)}finally{N(!1)}}return U?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-4 md: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(o,{variant:"fixed-label",label:r("profile.username"),value:t.name}),e.jsx(o,{variant:"fixed-label",label:r("common.role"),value:t.role}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_name"),value:t.gitName||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_email"),value:t.gitEmail||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.status"),value:t.status}),e.jsx(o,{variant:"fixed-label",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.platform_accounts")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",label:"lark",value:(y=t==null?void 0:t.platformUids)!=null&&y.lark?`${t.platformUids.lark.slice(0,12)}... ✓`:r("profile.not_linked")}),e.jsx(o,{variant:"fixed-label",label:"slack",value:(k=t==null?void 0:t.platformUids)!=null&&k.slack?`${t.platformUids.slack.slice(0,12)}... ✓`:r("profile.not_linked")})]}),(!((C=t==null?void 0:t.platformUids)!=null&&C.lark)||!((P=t==null?void 0:t.platformUids)!=null&&P.slack))&&e.jsx("p",{className:"mt-3 text-xs text-[var(--text-muted)]",children:r("profile.bind_hint")})]}),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:[j&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--destructive)]",children:j}),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:a=>u(a.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:d,onChange:a=>b(a.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:f,onChange:a=>v(a.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:O,disabled:g,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black disabled:opacity-50",children:r(g?"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:i,onChange:a=>{const l=a.target.value.replace(/\D/g,"").slice(0,6);_(l)},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:R,disabled:w||i.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(w?"profile.regenerating":"profile.regenerate_2fa")})})]})]})]}),e.jsxs(z,{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(I,{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")})]})]}),e.jsxs("button",{onClick:()=>m(!0),className:"flex w-full items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--destructive)] text-left",children:[e.jsx(V,{size:16,className:"text-[var(--destructive)]"}),e.jsx("span",{className:"text-sm text-[var(--destructive)]",children:r("common.log_out")})]}),e.jsxs("div",{className:"pt-2 pb-4 text-center text-xs text-[var(--text-muted)]",children:["overlord v","1.0.134"]}),e.jsx($,{isOpen:S,onClose:()=>m(!1),onConfirm:()=>{L(),E("/login")},title:r("common.logout_title"),message:r("common.logout_message"),confirmLabel:r("common.logout"),confirmVariant:"warning"})]})}export{J as default};
1
+ import{a as A,u as F,f as T,r as s,j as e,L as z,V as I,Y as V,v as $,h as p,t as c}from"./index-D_OrDcWf.js";import{v as K}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-CArRH_uK.js";import{u as M}from"./useFetch-_T-wW8J0.js";function J(){var y,k,C,P;const{t:r}=A(),{logout:L}=F(),E=T(),[S,m]=s.useState(!1),{data:t,loading:U,refetch:D}=M(()=>p.get("web/profile").json(),[]),[x,u]=s.useState(""),[d,b]=s.useState(""),[f,v]=s.useState(""),[g,h]=s.useState(!1),[j,n]=s.useState(""),[i,_]=s.useState(""),[w,N]=s.useState(!1);async function O(){if(n(""),!x){n(r("profile.current_password_required"));return}if(!d){n(r("profile.new_password_required"));return}const a=K(d);if(a){n(r(a));return}if(d!==f){n(r("profile.passwords_do_not_match"));return}try{h(!0),await p.put("web/profile/password",{json:{currentPassword:x,newPassword:d}}),c.success(r("profile.password_changed")),u(""),b(""),v("")}catch(l){const q=l instanceof Error?l.message:r("profile.failed_to_change_password");n(q)}finally{h(!1)}}async function R(){if(!i||i.length!==6){c.error(r("profile.totp_code_required"));return}try{N(!0),await p.post("web/profile/totp/regenerate",{json:{code:i}}),c.success(r("profile.two_fa_regenerated")),_(""),D()}catch(a){const l=a instanceof Error?a.message:r("profile.totp_code_invalid");c.error(l)}finally{N(!1)}}return U?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-4 md: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(o,{variant:"fixed-label",label:r("profile.username"),value:t.name}),e.jsx(o,{variant:"fixed-label",label:r("common.role"),value:t.role}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_name"),value:t.gitName||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.git_email"),value:t.gitEmail||r("common.not_set")}),e.jsx(o,{variant:"fixed-label",label:r("profile.status"),value:t.status}),e.jsx(o,{variant:"fixed-label",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.platform_accounts")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",label:"lark",value:(y=t==null?void 0:t.platformUids)!=null&&y.lark?`${t.platformUids.lark.slice(0,12)}... ✓`:r("profile.not_linked")}),e.jsx(o,{variant:"fixed-label",label:"slack",value:(k=t==null?void 0:t.platformUids)!=null&&k.slack?`${t.platformUids.slack.slice(0,12)}... ✓`:r("profile.not_linked")})]}),(!((C=t==null?void 0:t.platformUids)!=null&&C.lark)||!((P=t==null?void 0:t.platformUids)!=null&&P.slack))&&e.jsx("p",{className:"mt-3 text-xs text-[var(--text-muted)]",children:r("profile.bind_hint")})]}),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:[j&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)] bg-[var(--bg-input)] px-3 py-2 text-sm text-[var(--destructive)]",children:j}),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:a=>u(a.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:d,onChange:a=>b(a.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:f,onChange:a=>v(a.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:O,disabled:g,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black disabled:opacity-50",children:r(g?"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:i,onChange:a=>{const l=a.target.value.replace(/\D/g,"").slice(0,6);_(l)},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:R,disabled:w||i.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(w?"profile.regenerating":"profile.regenerate_2fa")})})]})]})]}),e.jsxs(z,{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(I,{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")})]})]}),e.jsxs("button",{onClick:()=>m(!0),className:"flex w-full items-center gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--destructive)] text-left",children:[e.jsx(V,{size:16,className:"text-[var(--destructive)]"}),e.jsx("span",{className:"text-sm text-[var(--destructive)]",children:r("common.log_out")})]}),e.jsxs("div",{className:"pt-2 pb-4 text-center text-xs text-[var(--text-muted)]",children:["overlord v","1.0.136"]}),e.jsx($,{isOpen:S,onClose:()=>m(!1),onConfirm:()=>{L(),E("/login")},title:r("common.logout_title"),message:r("common.logout_message"),confirmLabel:r("common.logout"),confirmVariant:"warning"})]})}export{J as default};
@@ -1,4 +1,4 @@
1
- import{c as F,a as I,j as e,v as U,A as E,f as R,u as K,i as q,r as x,J as A,w as J,l as B,n as H,K as V,h as v}from"./index-DJl-vKpg.js";import{U as z,A as G,R as Q}from"./RemoveMemberConfirmDialog-DgXwrcbD.js";import{T as X}from"./Tooltip-D_CBrTO_.js";import{c as D}from"./date-RFA7-ZGs.js";import{t as Y}from"./status-colors-D3fj6h6e.js";import{I as o}from"./InfoRow-OjQK-lfD.js";import{u as Z}from"./useFetch-CyCGABKu.js";import{P as ee}from"./pencil-BKwPd_Fv.js";import{T as te}from"./trash-2-CYF0CqNA.js";import{P as re}from"./plus-Dy384KeJ.js";import"./Select-CKozUJa5.js";/**
1
+ import{c as F,a as I,j as e,v as U,A as E,f as R,u as K,i as q,r as x,J as A,w as J,l as B,n as H,K as V,h as v}from"./index-D_OrDcWf.js";import{U as z,A as G,R as Q}from"./RemoveMemberConfirmDialog-7CNTS9OT.js";import{T as X}from"./Tooltip-C8VKfixS.js";import{c as D}from"./date-RFA7-ZGs.js";import{t as Y}from"./status-colors-CYQlZjBF.js";import{I as o}from"./InfoRow-CArRH_uK.js";import{u as Z}from"./useFetch-_T-wW8J0.js";import{P as ee}from"./pencil-DvVrY4a_.js";import{T as te}from"./trash-2-B5fxIpUx.js";import{P as re}from"./plus-DLpnTi95.js";import"./Select-C9mH7t3y.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,6 +1,6 @@
1
- import{c as L,a as E,r as o,G as x,F as z,j as e,h as P,f as H,w as M}from"./index-DJl-vKpg.js";import{S as U}from"./Select-CKozUJa5.js";import{g as R}from"./agent-type-options-DUkN669t.js";import{E as D}from"./EmptyState-c4IsGUGS.js";import{T as J}from"./Skeleton-1CByoX9G.js";import{t as O}from"./date-RFA7-ZGs.js";import{u as q}from"./useFetch-CyCGABKu.js";import{P as W}from"./plus-Dy384KeJ.js";/**
1
+ import{c as L,a as E,r as o,G as x,F as z,j as e,h as P,f as H,w as M}from"./index-D_OrDcWf.js";import{S as U}from"./Select-C9mH7t3y.js";import{a as R}from"./agent-type-options-snmZcyAv.js";import{E as D}from"./EmptyState-BwOJcw-7.js";import{T as J}from"./Skeleton-BSwNthrI.js";import{t as O}from"./date-RFA7-ZGs.js";import{u as q}from"./useFetch-_T-wW8J0.js";import{P as W}from"./plus-DLpnTi95.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 $=L("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),m={width:"100%",padding:"0.5rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},c={display:"block",color:"var(--text-secondary)",fontSize:"0.7rem",marginBottom:"0.25rem",fontFamily:"'JetBrains Mono', monospace"};function K({isOpen:i,onClose:a,onCreated:v}){const{t:r}=E(),d=R(t=>t),[l,u]=o.useState(""),[s,b]=o.useState(""),[n,y]=o.useState(""),[f,C]=o.useState(""),[_,k]=o.useState("main"),[N,S]=o.useState(x.GITHUB),[B,T]=o.useState(z.CLAUDE),[p,F]=o.useState(!1),[w,g]=o.useState("");o.useEffect(()=>{i&&A()},[i]);function A(){u(""),b(""),y(""),C(""),k("main"),S(x.GITHUB),T(z.CLAUDE),g("")}function h(){A(),a()}async function G(t){t.preventDefault(),g(""),F(!0);try{const j=await P.post("admin/projects",{json:{name:l,key:s,repoUrl:n,sshUrl:f||void 0,defaultBranch:_,gitPlatform:N,agentType:B}}).json();v(j),h()}catch(j){const I=j instanceof Error?j.message:r("projects.failed_to_create_project");g(I)}finally{F(!1)}}return i?e.jsx("div",{onClick:h,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))",padding:"1rem"},children:e.jsxs("div",{onClick:t=>t.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600},children:["> ",r("projects.create_project")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:r("projects.add_project_desc")})]}),w&&e.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.7rem"},children:w}),e.jsxs("form",{onSubmit:G,style:{display:"flex",flexDirection:"column",gap:"0.875rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.project_name")}),e.jsx("input",{type:"text",value:l,onChange:t=>u(t.target.value),placeholder:r("projects.project_name_placeholder"),required:!0,autoFocus:!0,style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.project_key")}),e.jsx("input",{type:"text",value:s,onChange:t=>b(t.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:r("projects.project_key_placeholder"),required:!0,style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:r("projects.project_key_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.repo_url")}),e.jsx("input",{type:"text",value:n,onChange:t=>y(t.target.value),placeholder:r("projects.repo_url_placeholder"),required:!0,style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.ssh_url")}),e.jsx("input",{type:"text",value:f,onChange:t=>C(t.target.value),placeholder:r("projects.ssh_url_placeholder"),style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:r("projects.ssh_url_hint")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.default_branch")}),e.jsx("input",{type:"text",value:_,onChange:t=>k(t.target.value),placeholder:r("projects.main"),style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.git_platform")}),e.jsx(U,{value:N,onChange:t=>S(t),options:[{value:x.GITHUB,label:r("projects.github")},{value:x.GITLAB,label:r("projects.gitlab")},{value:x.GITEA,label:r("projects.gitea")}]})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.agent_type")}),e.jsx(U,{value:B,onChange:t=>T(t),options:d})]})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("button",{type:"button",onClick:h,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"color 0.15s, border-color 0.15s"},className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",children:r("common.cancel")}),e.jsx("button",{type:"submit",disabled:p||!l||!s||!n,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:p||!l||!s||!n?"not-allowed":"pointer",opacity:p||!l||!s||!n?.7:1},children:r(p?"common.creating":"common.create")})]})]})]})}):null}function se(){const i=H(),{t:a}=E(),[v,r]=o.useState(!1),{data:d,loading:l,refetch:u}=q(()=>P.get("web/projects").json(),[]);return M(o.useMemo(()=>e.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),a("projects.create_project")]}),[a])),e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8",children:[l?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(J,{rows:4})}):!d||d.length===0?e.jsx(D,{icon:$,title:a("projects.no_projects_yet"),description:a("projects.create_first_project"),actionLabel:a("projects.create_project"),onAction:()=>r(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:d.map(s=>e.jsxs("div",{onClick:()=>i(`/projects/${s.key}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--accent)]",children:s.key}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.taskCount??0," tasks"]})]}),e.jsx("span",{className:"mt-1 block text-[11px] text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:"mt-0.5 block text-[11px] text-[var(--text-muted)]",children:s.agentType})]},s.key))}),e.jsxs("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"grid grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-2.5 text-xs font-medium text-[var(--text-muted)]",children:[e.jsx("span",{children:"#"}),e.jsx("span",{children:a("projects.key")}),e.jsx("span",{children:a("projects.name")}),e.jsx("span",{children:a("projects.members")}),e.jsx("span",{children:a("projects.tasks_count")}),e.jsx("span",{children:a("projects.last_activity")})]}),d.map((s,b)=>e.jsxs("div",{onClick:()=>i(`/projects/${s.key}`),className:"grid cursor-pointer grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors items-center",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:b+1}),e.jsx("span",{className:"truncate text-xs text-[var(--accent)]",children:s.key}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-xs text-[var(--text-primary)]",children:s.name}),e.jsxs("span",{className:"block truncate text-[11px] text-[var(--text-muted)]",children:[s.agentType," · ",s.repoUrl.replace(/^https?:\/\//,"").split("/").slice(-2).join("/")]})]}),e.jsx("div",{className:"flex items-center",children:e.jsxs("div",{className:"flex -space-x-1.5",children:[(s.members??[]).map(n=>e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--accent)]/20 text-[11px] font-bold text-[var(--accent)]",title:n.name,children:n.name.charAt(0).toUpperCase()},n.id)),(s.memberCount??0)>5&&e.jsxs("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--bg-input)] text-[11px] text-[var(--text-muted)]",children:["+",s.memberCount-5]})]})}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:s.taskCount??0}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:O(s.lastActivity??null)})]},s.key))]})]}),e.jsx(K,{isOpen:v,onClose:()=>r(!1),onCreated:u})]})}export{se as default};
6
+ */const $=L("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),m={width:"100%",padding:"0.5rem 0.75rem",backgroundColor:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"4px",color:"var(--text-primary)",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",outline:"none",boxSizing:"border-box"},c={display:"block",color:"var(--text-secondary)",fontSize:"0.7rem",marginBottom:"0.25rem",fontFamily:"'JetBrains Mono', monospace"};function K({isOpen:i,onClose:a,onCreated:v}){const{t:r}=E(),d=R(t=>t),[l,u]=o.useState(""),[s,b]=o.useState(""),[n,y]=o.useState(""),[f,C]=o.useState(""),[_,k]=o.useState("main"),[N,S]=o.useState(x.GITHUB),[B,T]=o.useState(z.CLAUDE),[p,F]=o.useState(!1),[w,h]=o.useState("");o.useEffect(()=>{i&&A()},[i]);function A(){u(""),b(""),y(""),C(""),k("main"),S(x.GITHUB),T(z.CLAUDE),h("")}function g(){A(),a()}async function G(t){t.preventDefault(),h(""),F(!0);try{const j=await P.post("admin/projects",{json:{name:l,key:s,repoUrl:n,sshUrl:f||void 0,defaultBranch:_,gitPlatform:N,agentType:B}}).json();v(j),g()}catch(j){const I=j instanceof Error?j.message:r("projects.failed_to_create_project");h(I)}finally{F(!1)}}return i?e.jsx("div",{onClick:g,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))",padding:"1rem"},children:e.jsxs("div",{onClick:t=>t.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600},children:["> ",r("projects.create_project")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:r("projects.add_project_desc")})]}),w&&e.jsx("div",{style:{marginBottom:"1rem",padding:"0.5rem 0.75rem",borderRadius:"4px",backgroundColor:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"var(--destructive)",fontSize:"0.7rem"},children:w}),e.jsxs("form",{onSubmit:G,style:{display:"flex",flexDirection:"column",gap:"0.875rem"},children:[e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.project_name")}),e.jsx("input",{type:"text",value:l,onChange:t=>u(t.target.value),placeholder:r("projects.project_name_placeholder"),required:!0,autoFocus:!0,style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.project_key")}),e.jsx("input",{type:"text",value:s,onChange:t=>b(t.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:r("projects.project_key_placeholder"),required:!0,style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:r("projects.project_key_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.repo_url")}),e.jsx("input",{type:"text",value:n,onChange:t=>y(t.target.value),placeholder:r("projects.repo_url_placeholder"),required:!0,style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.ssh_url")}),e.jsx("input",{type:"text",value:f,onChange:t=>C(t.target.value),placeholder:r("projects.ssh_url_placeholder"),style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",marginTop:"0.25rem"},children:r("projects.ssh_url_hint")})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.default_branch")}),e.jsx("input",{type:"text",value:_,onChange:t=>k(t.target.value),placeholder:r("projects.main"),style:m,onFocus:t=>t.target.style.borderColor="var(--accent)",onBlur:t=>t.target.style.borderColor="var(--border)"})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.git_platform")}),e.jsx(U,{value:N,onChange:t=>S(t),options:[{value:x.GITHUB,label:r("projects.github")},{value:x.GITLAB,label:r("projects.gitlab")},{value:x.GITEA,label:r("projects.gitea")}]})]}),e.jsxs("div",{children:[e.jsx("label",{style:c,children:r("projects.agent_type")}),e.jsx(U,{value:B,onChange:t=>T(t),options:d})]})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("button",{type:"button",onClick:g,disabled:p,style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",transition:"color 0.15s, border-color 0.15s"},className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",children:r("common.cancel")}),e.jsx("button",{type:"submit",disabled:p||!l||!s||!n,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--accent)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:p||!l||!s||!n?"not-allowed":"pointer",opacity:p||!l||!s||!n?.7:1},children:r(p?"common.creating":"common.create")})]})]})]})}):null}function se(){const i=H(),{t:a}=E(),[v,r]=o.useState(!1),{data:d,loading:l,refetch:u}=q(()=>P.get("web/projects").json(),[]);return M(o.useMemo(()=>e.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),a("projects.create_project")]}),[a])),e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8",children:[l?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(J,{rows:4})}):!d||d.length===0?e.jsx(D,{icon:$,title:a("projects.no_projects_yet"),description:a("projects.create_first_project"),actionLabel:a("projects.create_project"),onAction:()=>r(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:d.map(s=>e.jsxs("div",{onClick:()=>i(`/projects/${s.key}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--accent)]",children:s.key}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.taskCount??0," tasks"]})]}),e.jsx("span",{className:"mt-1 block text-[11px] text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:"mt-0.5 block text-[11px] text-[var(--text-muted)]",children:s.agentType})]},s.key))}),e.jsxs("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"grid grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-2.5 text-xs font-medium text-[var(--text-muted)]",children:[e.jsx("span",{children:"#"}),e.jsx("span",{children:a("projects.key")}),e.jsx("span",{children:a("projects.name")}),e.jsx("span",{children:a("projects.members")}),e.jsx("span",{children:a("projects.tasks_count")}),e.jsx("span",{children:a("projects.last_activity")})]}),d.map((s,b)=>e.jsxs("div",{onClick:()=>i(`/projects/${s.key}`),className:"grid cursor-pointer grid-cols-[36px_90px_1fr_120px_60px_80px] gap-3 border-b border-[var(--border-row)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors items-center",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:b+1}),e.jsx("span",{className:"truncate text-xs text-[var(--accent)]",children:s.key}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-xs text-[var(--text-primary)]",children:s.name}),e.jsxs("span",{className:"block truncate text-[11px] text-[var(--text-muted)]",children:[s.agentType," · ",s.repoUrl.replace(/^https?:\/\//,"").split("/").slice(-2).join("/")]})]}),e.jsx("div",{className:"flex items-center",children:e.jsxs("div",{className:"flex -space-x-1.5",children:[(s.members??[]).map(n=>e.jsx("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--accent)]/20 text-[11px] font-bold text-[var(--accent)]",title:n.name,children:n.name.charAt(0).toUpperCase()},n.id)),(s.memberCount??0)>5&&e.jsxs("div",{className:"flex h-6 w-6 items-center justify-center rounded-full border-2 border-[var(--bg-card)] bg-[var(--bg-input)] text-[11px] text-[var(--text-muted)]",children:["+",s.memberCount-5]})]})}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:s.taskCount??0}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:O(s.lastActivity??null)})]},s.key))]})]}),e.jsx(K,{isOpen:v,onClose:()=>r(!1),onCreated:u})]})}export{se as default};
@@ -1,4 +1,4 @@
1
- var Le=Object.defineProperty;var De=(Q,$,K)=>$ in Q?Le(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:K}):Q[$]=K;var se=(Q,$,K)=>De(Q,typeof $!="symbol"?$+"":$,K);import{c as we,r as X,u as Re,h as xe,j as ue}from"./index-DJl-vKpg.js";/**
1
+ var Le=Object.defineProperty;var De=(Q,$,K)=>$ in Q?Le(Q,$,{enumerable:!0,configurable:!0,writable:!0,value:K}):Q[$]=K;var se=(Q,$,K)=>De(Q,typeof $!="symbol"?$+"":$,K);import{c as we,r as X,u as Re,h as xe,j as ue}from"./index-D_OrDcWf.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 h,r as s,h as b,Z as v,j as e,C as j}from"./index-DJl-vKpg.js";import{C as f}from"./copy-cloBpe4U.js";function y({mode:l}){const{t:o}=h(),[n,d]=s.useState([]),[x,c]=s.useState(null),[u,i]=s.useState(!1);s.useEffect(()=>{b.get("web/profile/tokens").json().then(t=>{const r=t.filter(m=>m.status===v.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(j,{size:14}):e.jsx(f,{size:14})})]}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:o("docs.replace_token_hint")})]})}export{y as Q};
1
+ import{a as h,r as s,h as b,Z as v,j as e,C as j}from"./index-D_OrDcWf.js";import{C as f}from"./copy-BsSvzuvN.js";function y({mode:l}){const{t:o}=h(),[n,d]=s.useState([]),[x,c]=s.useState(null),[u,i]=s.useState(!1);s.useEffect(()=>{b.get("web/profile/tokens").json().then(t=>{const r=t.filter(m=>m.status===v.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(j,{size:14}):e.jsx(f,{size:14})})]}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:o("docs.replace_token_hint")})]})}export{y as Q};
@@ -1,4 +1,4 @@
1
- import{c as w,a as _,r as s,J as l,j as e,X as R,h as g,v as C}from"./index-DJl-vKpg.js";import{S as N}from"./Select-CKozUJa5.js";/**
1
+ import{c as w,a as _,r as s,J as l,j as e,X as R,h as g,v as C}from"./index-D_OrDcWf.js";import{S as N}from"./Select-C9mH7t3y.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 p,r as l,j as t}from"./index-DJl-vKpg.js";/**
1
+ import{c as p,r as l,j as t}from"./index-D_OrDcWf.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,h as m,t as u}from"./index-DJl-vKpg.js";/**
1
+ import{c as h,a as v,r,j as e,h as m,t as u}from"./index-D_OrDcWf.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-DJl-vKpg.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-D_OrDcWf.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 t,j as e}from"./index-DJl-vKpg.js";import{I as c,C as r}from"./DocsPrimitives-BjKzQarf.js";import{E as n}from"./external-link-Clr8ygf6.js";import"./copy-cloBpe4U.js";const o=[{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 worker status, online workers, queue depth"},{action:"search",desc:"find tasks, projects, and workers by keyword"},{action:"read notifications",desc:"check and clear your notification inbox"}],d=['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 workers are online?","cancel task 15"],i=[{name:"claude code",url:"https://claude.com/claude-code"},{name:"cursor",url:"https://cursor.com/cli"},{name:"windsurf",url:"https://windsurf.com"},{name:"codex",url:"https://openai.com/codex"}];function u(){t();const a=typeof window<"u"?window.location.origin:"https://your-server";return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md: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(c,{code:"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 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=",e.jsx("span",{className:"text-[var(--accent)]",children:a})]}),e.jsx(r,{text:`export OVERLORD_SERVER=${a}`})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",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(r,{text:"export OVERLORD_TOKEN=your-token"})]})]}),e.jsxs("p",{className:"text-[11px] 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:o.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"}),d.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:i.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(n,{className:"h-3 w-3 text-[var(--text-muted)]"})]},s.name))}),e.jsx("p",{className:"mt-2 text-[11px] 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{u as default};
1
+ import{a as t,j as e}from"./index-D_OrDcWf.js";import{I as c,C as r}from"./DocsPrimitives-C-MCNelj.js";import{E as n}from"./external-link-D4FpeC5t.js";import"./copy-BsSvzuvN.js";const o=[{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 worker status, online workers, queue depth"},{action:"search",desc:"find tasks, projects, and workers by keyword"},{action:"read notifications",desc:"check and clear your notification inbox"}],d=['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 workers are online?","cancel task 15"],i=[{name:"claude code",url:"https://claude.com/claude-code"},{name:"cursor",url:"https://cursor.com/cli"},{name:"windsurf",url:"https://windsurf.com"},{name:"codex",url:"https://openai.com/codex"}];function u(){t();const a=typeof window<"u"?window.location.origin:"https://your-server";return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md: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(c,{code:"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 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=",e.jsx("span",{className:"text-[var(--accent)]",children:a})]}),e.jsx(r,{text:`export OVERLORD_SERVER=${a}`})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",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(r,{text:"export OVERLORD_TOKEN=your-token"})]})]}),e.jsxs("p",{className:"text-[11px] 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:o.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"}),d.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:i.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(n,{className:"h-3 w-3 text-[var(--text-muted)]"})]},s.name))}),e.jsx("p",{className:"mt-2 text-[11px] 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{u as default};
@@ -1,4 +1,4 @@
1
- import{c as J,a as Q,r as l,h as g,j as e,M as ft,z as A,H as vt,t as V,v as ye,A as bt,f as gt,B as jt,q as Nt,s as yt,k as We,p as L,l as Xe,m as kt,L as He,X as st,n as wt,x as _t,U as Ct,b as St,G as Tt,E as Et}from"./index-DJl-vKpg.js";import{u as Lt,T as Dt,g as at}from"./task-constants-q2zc7hX5.js";import{C as It,g as $t,P as Ve,H as Pt}from"./PtyTerminal-BQ2UYeLe.js";import{a as At,b as Rt,f as H,c as Ft}from"./date-RFA7-ZGs.js";import{S as Mt}from"./Select-CKozUJa5.js";import{a as rt}from"./status-colors-D3fj6h6e.js";import{T as Ot}from"./Tooltip-D_CBrTO_.js";import{A as Ut}from"./arrow-left-BPE0QXvK.js";import{R as nt}from"./rotate-ccw-BqKuF1OZ.js";import{G as qt}from"./git-fork-CBlyXbge.js";import{E as Bt}from"./external-link-Clr8ygf6.js";import{L as lt}from"./loader-circle-CF4O3sgn.js";import{F as Gt}from"./file-text-KFjDZaJL.js";import"./agent-type-options-DUkN669t.js";/**
1
+ import{c as J,a as Q,r as l,h as g,j as e,M as ft,z as A,H as vt,t as V,v as ye,A as bt,f as gt,B as jt,q as Nt,s as yt,k as We,p as L,l as Xe,m as kt,L as He,X as st,n as wt,x as _t,U as Ct,b as St,G as Tt,E as Et}from"./index-D_OrDcWf.js";import{u as Lt,T as Dt,g as at}from"./task-constants-C28Dag_x.js";import{C as It,g as $t,P as Ve,H as Pt}from"./PtyTerminal-BCi4nF3w.js";import{a as At,b as Rt,f as H,c as Ft}from"./date-RFA7-ZGs.js";import{S as Mt}from"./Select-C9mH7t3y.js";import{a as rt}from"./status-colors-CYQlZjBF.js";import{T as Ot}from"./Tooltip-C8VKfixS.js";import{A as Ut}from"./arrow-left-CIwOL41D.js";import{R as nt}from"./rotate-ccw-CiTf48Td.js";import{G as qt}from"./git-fork-DWSuvIF4.js";import{E as Bt}from"./external-link-D4FpeC5t.js";import{L as lt}from"./loader-circle-PQQXGtgi.js";import{F as Gt}from"./file-text-DWEXk0wE.js";import"./agent-type-options-snmZcyAv.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{R as pe,f as J,a as $,p as u,j as e,l as ee,n as me,u as ue,i as he,r,h as P,X as be,k as ve,w as fe,H as ge,t as W,x as ye,y as V,m as je}from"./index-D_OrDcWf.js";import{a as ke,u as X}from"./task-constants-C28Dag_x.js";import{T as te}from"./TaskStatusBadge-bgFlcooX.js";import{f as se}from"./date-RFA7-ZGs.js";import{T as Ne}from"./Tooltip-C8VKfixS.js";import{G as re}from"./git-fork-DWSuvIF4.js";import{S as A}from"./Select-C9mH7t3y.js";import{g as Ce}from"./agent-type-options-snmZcyAv.js";import{C as we}from"./copy-BsSvzuvN.js";import{E as Y}from"./EmptyState-BwOJcw-7.js";import{T as Z}from"./Skeleton-BSwNthrI.js";import{P as Se}from"./plus-DLpnTi95.js";import{C as _e}from"./chevron-left-C6IUM-8d.js";import{C as Te}from"./chevron-right-CtCcIQB9.js";import"./status-colors-CYQlZjBF.js";const Ee=pe.memo(function({task:s}){const d=J(),{t:c}=$(),x=(a,b)=>c(`common.${a}`,{n:b}),i=s.status===u.COMPLETED||s.status===u.FAILED||s.status===u.CANCELLED;return e.jsxs("tr",{onClick:()=>d(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:e.jsx(Ne,{content:me(s),children:ee(s)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(te,{status:s.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.developerName??s.creatorName??"-"}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.workerName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:e.jsxs("span",{className:"flex items-center gap-2",children:[se(s.createdAt,x),i&&e.jsx("button",{onClick:a=>{a.stopPropagation(),d(`/tasks/${s.id}?action=fork`)},className:"shrink-0 rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] hover:bg-[var(--bg-input)] transition-colors",title:c("tasks.fork_task"),children:e.jsx(re,{className:"h-3 w-3"})})]})})]})});function De({isOpen:n,onClose:s,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:a}=$();ue(o=>o.user);const b=he(),[p,K]=r.useState(""),[h,B]=r.useState(""),[m,I]=r.useState("feat"),[k,C]=r.useState(""),[w,S]=r.useState(""),[f,_]=r.useState(""),[g,y]=r.useState(""),[T,O]=r.useState(""),[M,R]=r.useState([]),[z,N]=r.useState(""),j=d.find(o=>o.key===p),H=Ce(o=>o,j==null?void 0:j.agentType);r.useEffect(()=>{if(!n||(K(""),B(""),I("feat"),C(""),S(""),_(""),y(""),O(""),N(""),!b))return;const o=new AbortController;return P.get("admin/developers",{signal:o.signal}).json().then(R).catch(()=>{}),()=>o.abort()},[n,b]),r.useEffect(()=>{if(!n)return;function o(D){D.key==="Escape"&&s()}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n,s]);async function E(o){if(o.preventDefault(),N(""),!p||!h.trim()){N(a("tasks.project_and_description_required"));return}try{await x({projectKey:p,description:h.trim(),workerId:g||void 0,developerId:T?Number(T):void 0,taskType:m,branchSlug:w.trim()||void 0,agentType:k||void 0,targetBranch:f.trim()||void 0})}catch(D){const L=D instanceof Error?D.message:a("tasks.failed_to_create_task");N(L)}}return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&s()},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:s,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(be,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:E,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.project")}),e.jsx(A,{value:p,onChange:K,options:d.map(o=>({value:o.key,label:o.name})),placeholder:a(c?"common.loading":"tasks.select_project"),disabled:c})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_type")}),e.jsx(A,{value:m,onChange:I,options:ke})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx(A,{value:k,onChange:C,options:H})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_description")}),e.jsx("textarea",{value:h,onChange:o=>B(o.target.value),placeholder:a("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_worker")}),e.jsx("input",{type:"text",value:g,onChange:o=>y(o.target.value),placeholder:a("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.branch_slug")}),e.jsx("input",{type:"text",value:w,onChange:o=>S(o.target.value),placeholder:a("tasks.branch_slug_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_branch")}),e.jsx("input",{type:"text",value:f,onChange:o=>_(o.target.value),placeholder:a("tasks.target_branch_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),b&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(A,{value:T,onChange:O,options:M.map(o=>({value:String(o.id),label:o.name})),placeholder:a("tasks.select_developer")})]}),z&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:z})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:s,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:i||!p||!h.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:a(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function Fe({isOpen:n,onClose:s,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:a}=$();return!x||!n?null:e.jsx("div",{onClick:s,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:b=>b.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(we,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",x.id," · ",x.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:x.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:s,disabled:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>c(x.id),style:{flex:1,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:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:d,disabled:i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1},children:a(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function Pe({task:n}){const s=J(),d=n.status===u.COMPLETED||n.status===u.FAILED||n.status===u.CANCELLED;return e.jsxs("div",{onClick:()=>s(`/tasks/${n.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2",title:je(n),children:["#",n.id," ",ee(n)]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),s(`/tasks/${n.id}?action=fork`)},className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:e.jsx(re,{className:"h-3 w-3"})}),e.jsx(te,{status:n.status})]})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:se(n.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.workerName})]})]})]})}const Ae=[{key:"all",labelKey:"tasks.tab_all"},{key:u.RUNNING,labelKey:"tasks.tab_running"},{key:u.QUEUED,labelKey:"tasks.tab_queued"},{key:u.COMPLETED,labelKey:"tasks.tab_completed"},{key:u.FAILED,labelKey:"tasks.tab_failed"},{key:u.CANCELLED,labelKey:"tasks.tab_cancelled"}],Ie=20;function Ve(){const n=J(),{t:s}=$(),{tasks:d,loading:c,fetchTasks:x}=X(),i=ve(t=>t.taskSeq),[a,b]=r.useState("all"),[p,K]=r.useState(""),[h,B]=r.useState(""),[m,I]=r.useState(""),[k,C]=r.useState(void 0),[w,S]=r.useState([]),f=X(t=>t.nextCursor),[_,g]=r.useState(!1);fe(r.useMemo(()=>e.jsxs("button",{onClick:()=>g(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(Se,{className:"h-3.5 w-3.5"}),s("tasks.new_task")]}),[s]));const[y,T]=r.useState([]),[O,M]=r.useState(!1),[R,z]=r.useState([]),[N,j]=r.useState(!1),[H,E]=r.useState(!1),[o,D]=r.useState(null),[L,q]=r.useState(null),G=r.useCallback(t=>{const l={limit:String(Ie)};return a!=="all"&&(l.status=a),p&&(l.projectKey=p),h&&(l.developerId=h),t&&(l.cursor=t),l},[a,p,h]);r.useEffect(()=>{x(G(k))},[G,k,x,i]),r.useEffect(()=>{C(void 0),S([])},[a,p,h]),r.useEffect(()=>{let t=!1;return(async()=>{try{const[v,xe]=await Promise.all([P.get("web/projects").json(),P.get("web/projects/-/developers").json()]);if(t)return;T(v),z(xe)}catch{}})(),()=>{t=!0}},[]),r.useEffect(()=>{if(!_||y.length>0)return;M(!0);let t=!1;return(async()=>{try{const v=await P.get("web/projects").json();t||T(v)}catch{}finally{t||M(!1)}})(),()=>{t=!0}},[_,y.length]);const ae=r.useCallback(async t=>{j(!0);try{const l=await P.post("web/tasks",{json:{projectKey:t.projectKey,description:t.description,workerId:t.workerId,developerId:t.developerId,taskType:t.taskType,branchSlug:t.branchSlug,agentType:t.agentType,targetBranch:t.targetBranch}}).json();g(!1),n(`/tasks/${l.task.id}`)}catch(l){if(l instanceof ge&&l.response.status===409){try{const v=await l.response.json();if(v.confirmRequired){D({id:v.confirmRequired.taskId,description:v.confirmRequired.message,status:"active"}),q(t),g(!1),E(!0);return}}catch{}W.error(s("tasks.similar_task_exists"))}else{const v=l instanceof Error?l.message:String(l);W.error(v)}}finally{j(!1)}},[n]),oe=r.useCallback(async()=>{if(L){j(!0);try{const t=await P.post("web/tasks",{json:{...L,force:!0}}).json();E(!1),q(null),n(`/tasks/${t.task.id}`)}finally{j(!1)}}},[L,n]),F=r.useMemo(()=>{if(!m.trim())return d;const t=m.toLowerCase();return d.filter(l=>(l.name??"").toLowerCase().includes(t)||l.description.toLowerCase().includes(t)||String(l.id).includes(m))},[d,m]),ne=r.useCallback(()=>{f&&(S(t=>[...t,k??""]),C(f))},[f,k]),le=r.useCallback(()=>{S(t=>{if(t.length===0)return t;const l=t.slice(0,-1);return C(t.at(-1)||void 0),l})},[]),ce=w.length+1,ie=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...y.map(t=>({value:t.key,label:t.name}))],[y,s]),de=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...R.map(t=>({value:String(t.id),label:t.name}))],[R,s]),Q=s(m?"tasks.try_adjusting_search":"tasks.create_first_task"),U=m?void 0:e.jsx("button",{onClick:()=>g(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:s("tasks.create_task")});return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar pr-4 md:pr-0",children:Ae.map(t=>e.jsx("button",{onClick:()=>b(t.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${a===t.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:s(t.labelKey)},t.key))}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative md:w-52",children:[e.jsx(ye,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:s("tasks.search_tasks"),value:m,onChange:t=>I(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),m&&e.jsx("button",{onClick:()=>I(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]}),e.jsx(A,{value:p,onChange:K,options:ie,className:"md:w-40"}),e.jsx(A,{value:h,onChange:B,options:de,className:"md:w-40"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:s("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.time")})]})}),e.jsxs("tbody",{children:[c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Z,{rows:5})})}),!c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U})})}),F.map(t=>e.jsx(Ee,{task:t},t.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[c&&F.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(Z,{rows:5})}),!c&&F.length===0&&e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U}),F.map(t=>e.jsx(Pe,{task:t},t.id))]}),(w.length>0||f)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",ce]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:le,disabled:w.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(_e,{className:"h-3.5 w-3.5"}),s("tasks.prev")]}),e.jsxs("button",{onClick:ne,disabled:!f,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[s("common.next"),e.jsx(Te,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(De,{isOpen:_,onClose:()=>g(!1),projects:y,projectsLoading:O,onSubmit:ae,isSubmitting:N}),e.jsx(Fe,{isOpen:H,onClose:()=>{E(!1),q(null)},onForceCreate:oe,onViewExisting:t=>{E(!1),q(null),n(`/tasks/${t}`)},similarTask:o,isLoading:N})]})}export{Ve as default};
@@ -1 +1 @@
1
- import{a as l,j as a}from"./index-DJl-vKpg.js";import{a as u}from"./status-colors-D3fj6h6e.js";const r={QUEUED:"tasks.status_queued",ASSIGNED:"tasks.status_assigned",RUNNING:"tasks.status_running",SUSPENDED:"tasks.status_suspended",COMPLETED:"tasks.status_completed",FAILED:"tasks.status_failed",CANCELLED:"tasks.status_cancelled"};function E({status:s}){const{t:e}=l(),t=r[s],n=t?e(t):(s??"unknown").toLowerCase(),o=u(s);return a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs",style:{color:o},children:[a.jsx("span",{style:{fontSize:"0.6rem"},children:"●"}),n]})}export{E as T};
1
+ import{a as l,j as a}from"./index-D_OrDcWf.js";import{a as u}from"./status-colors-CYQlZjBF.js";const r={QUEUED:"tasks.status_queued",ASSIGNED:"tasks.status_assigned",RUNNING:"tasks.status_running",SUSPENDED:"tasks.status_suspended",COMPLETED:"tasks.status_completed",FAILED:"tasks.status_failed",CANCELLED:"tasks.status_cancelled"};function E({status:s}){const{t:e}=l(),t=r[s],n=t?e(t):(s??"unknown").toLowerCase(),o=u(s);return a.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs",style:{color:o},children:[a.jsx("span",{style:{fontSize:"0.6rem"},children:"●"}),n]})}export{E as T};
@@ -0,0 +1,11 @@
1
+ import{c as Z,o as ce,h as A,p as N,a as M,r as c,k as z,q as le,s as oe,j as e,X as ee,v as de,f as xe,l as me,m as ue}from"./index-D_OrDcWf.js";import{g as te,P as pe,H as he,C as fe}from"./PtyTerminal-BCi4nF3w.js";import{T as B,u as ve,a as G,g as ge}from"./task-constants-C28Dag_x.js";import{i as J,O as se}from"./OnboardingGuide-j6HspxdC.js";import{S as C,C as be}from"./Select-C9mH7t3y.js";import{a as ae}from"./status-colors-CYQlZjBF.js";import{a as je}from"./date-RFA7-ZGs.js";import{g as ke}from"./agent-type-options-snmZcyAv.js";import{u as ne}from"./useFetch-_T-wW8J0.js";import{P as $}from"./plus-DLpnTi95.js";import{R as ye}from"./rotate-ccw-CiTf48Td.js";import{W as Ne}from"./wifi-DyUmH42s.js";import"./chevron-right-CtCcIQB9.js";/**
2
+ * @license lucide-react v0.469.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const we=Z("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
7
+ * @license lucide-react v0.469.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Te=Z("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),re="overlord_home_terminal";function Se(){try{const t=localStorage.getItem(re);if(t)return JSON.parse(t)}catch{}return{pinnedTaskIds:[],activeTaskId:null}}let Q="";function F(t){const a=JSON.stringify(t);a!==Q&&(Q=a,localStorage.setItem(re,a))}const V=Se(),Ce=new Set([N.QUEUED,N.ASSIGNED,N.RUNNING,N.SUSPENDED]);let H=!1;const _e=ce((t,a)=>({pinnedTaskIds:V.pinnedTaskIds,activeTaskId:V.activeTaskId,taskMetas:{},stageConfirm:null,loading:!1,setActiveTask:s=>{t({activeTaskId:s}),F({pinnedTaskIds:a().pinnedTaskIds,activeTaskId:s})},pinTask:s=>{const{pinnedTaskIds:n}=a();if(n.includes(s))return;const l=[...n,s];t({pinnedTaskIds:l}),F({pinnedTaskIds:l,activeTaskId:a().activeTaskId})},unpinTask:s=>{const{pinnedTaskIds:n,activeTaskId:l,taskMetas:m}=a(),r=n.filter(f=>f!==s),o=l===s?r[0]??null:l,{[s]:p,...i}=m;t({pinnedTaskIds:r,activeTaskId:o,taskMetas:i}),F({pinnedTaskIds:r,activeTaskId:o})},loadActiveTasks:async()=>{if(!H){H=!0,t({loading:!0});try{const n=(await A.get("web/tasks",{searchParams:{limit:"30"}}).json()).data.filter(i=>Ce.has(i.status)),l={};for(const i of n)l[i.id]={id:i.id,name:i.name,description:i.description,status:i.status,projectKey:i.projectKey,workerName:i.workerName??null,agentType:te(i),currentStage:i.currentStage,currentSessionId:i.currentSessionId,updatedAt:i.updatedAt};const r=[...n].sort((i,f)=>f.updatedAt.localeCompare(i.updatedAt)).map(i=>i.id),{activeTaskId:o}=a(),p=o&&r.includes(o)?o:r[0]??null;t({taskMetas:l,pinnedTaskIds:r,activeTaskId:p}),F({pinnedTaskIds:r,activeTaskId:p})}catch{}finally{H=!1,t({loading:!1})}}},fetchStageConfirm:async s=>{try{const n=await A.get(`web/tasks/${s}/pending-confirm`).json();t({stageConfirm:n.confirm})}catch{t({stageConfirm:null})}},clearStageConfirm:()=>t({stageConfirm:null}),updateTaskMeta:(s,n)=>{const{taskMetas:l}=a(),m=l[s];m&&t({taskMetas:{...l,[s]:{...m,...n}}})}}));function Ie(){const[t,a]=c.useState(()=>J());c.useEffect(()=>{const n=()=>a(!0),l=()=>a(J());return window.addEventListener("onboarding-dismissed",n),window.addEventListener("storage",l),()=>{window.removeEventListener("onboarding-dismissed",n),window.removeEventListener("storage",l)}},[]);const{data:s}=ne(()=>t?Promise.resolve(null):A.get("web/dashboard/stats").json(),[t]);return t||!s?null:{activeTasks:(s.active_tasks??0)+(s.queued_tasks??0),totalWorkers:s.online_workers??0,totalProjects:s.project_count??0,totalDevelopers:s.developer_count??0}}function Ee({taskId:t,confirm:a,onSubmitted:s}){const{t:n}=M(),[l,m]=c.useState(a.timeout),[r,o]=c.useState(!1);c.useEffect(()=>{m(a.timeout);const i=setInterval(()=>{m(f=>f<=1?(clearInterval(i),0):f-1)},1e3);return()=>clearInterval(i)},[a.timeout,a.stageName]);const p=c.useCallback(async i=>{o(!0);try{await A.post(`web/tasks/${t}/confirm-stage`,{json:{stageName:a.stageName,approved:i}}),s()}catch{}finally{o(!1)}},[t,a.stageName,s]);return e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b-2 border-[var(--warning)] bg-[var(--warning)]/10 px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(fe,{className:"h-3.5 w-3.5 shrink-0 text-[var(--warning)]"}),e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["// stage: ",a.stageName]}),e.jsx("span",{className:"shrink-0 text-xs text-[var(--warning)]",children:je(l)})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("button",{onClick:()=>p(!1),disabled:r,className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:n("tasks.reject")}),e.jsx("button",{onClick:()=>p(!0),disabled:r,className:"rounded-[4px] bg-[var(--accent)] px-2 py-1 text-[11px] text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:n(r?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})}function Ae({projectKey:t,onProjectChange:a,onCreated:s}){const{t:n}=M(),l=ve(x=>x.createTask),[m,r]=c.useState(""),[o,p]=c.useState("feat"),[i,f]=c.useState(void 0),[h,_]=c.useState(!1),[I,E]=c.useState(!1),[U,D]=c.useState(!1),{data:w}=ne(()=>A.get("web/projects").json(),[]),g=c.useMemo(()=>{const x=(w??[]).map(R=>({value:R.key,label:R.key}));return[{value:"",label:n("terminal_home.all_projects")},...x]},[w,n]),b=c.useMemo(()=>(w??[]).find(x=>x.key===t)??null,[w,t]),k=c.useMemo(()=>ke(x=>x,b==null?void 0:b.agentType),[b==null?void 0:b.agentType]),T=c.useRef(!1);c.useEffect(()=>{if(!T.current){if(t){T.current=!0;return}g.length>1&&(a(g[1].value),T.current=!0)}},[t,g,a]),c.useEffect(()=>{f(void 0)},[t]);const u=i??"",O=c.useCallback(x=>{f(x||void 0)},[]),y=!!t&&!!m.trim();function v(){y&&E(!0)}async function S(){if(E(!1),!!y){_(!0);try{const x=await l({projectKey:t,description:m.trim(),taskType:o,agentType:i||void 0});r(""),s(x.id)}catch{}finally{_(!1)}}}const L=n("terminal_home.confirm_create_message").replace("{taskType}",o).replace("{projectKey}",t).replace("{description}",m.trim()),P="flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex items-center gap-2 border-b border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:[e.jsx("div",{className:"w-[140px]",children:e.jsx(C,{value:t,onChange:a,options:g,placeholder:n("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(C,{value:o,onChange:p,options:G})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(C,{value:u,onChange:O,options:k,placeholder:n("tasks.form_agent_type"),disabled:h||!t})}),e.jsx("input",{type:"text",value:m,onChange:x=>r(x.target.value),onKeyDown:x=>x.key==="Enter"&&v(),placeholder:n("terminal_home.task_description_placeholder"),className:P,disabled:h}),e.jsxs("button",{onClick:v,disabled:h||!y,className:"flex items-center gap-1 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:[e.jsx($,{className:"h-3 w-3"}),n(h?"common.creating":"terminal_home.new_task")]})]}),e.jsx("div",{className:"md:hidden border-b border-[var(--border)] bg-[var(--bg-card)]",children:U?e.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(C,{value:t,onChange:a,options:g,placeholder:n("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(C,{value:o,onChange:p,options:G})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(C,{value:u,onChange:O,options:k,placeholder:n("tasks.form_agent_type"),disabled:h||!t})}),e.jsx("button",{onClick:()=>D(!1),className:"p-1 text-[var(--text-muted)]",children:e.jsx(ee,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:m,onChange:x=>r(x.target.value),onKeyDown:x=>x.key==="Enter"&&v(),placeholder:n("terminal_home.task_description_placeholder"),className:P,disabled:h}),e.jsx("button",{onClick:v,disabled:h||!y,className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:e.jsx($,{className:"h-3 w-3"})})]})]}):e.jsxs("button",{onClick:()=>D(!0),className:"flex w-full items-center justify-center gap-1 py-2 text-xs text-[var(--accent)] hover:opacity-80",children:[e.jsx($,{className:"h-3.5 w-3.5"}),n("terminal_home.new_task")]})}),e.jsx(de,{isOpen:I,onClose:()=>E(!1),onConfirm:S,title:n("terminal_home.confirm_create_title"),message:L,confirmVariant:"accent",confirmLabel:n("terminal_home.new_task"),isLoading:h})]})}function Y({status:t,size:a}){const s=t===N.SUSPENDED,n=ae(t),l=a==="sm"?"h-1.5 w-1.5":"h-2 w-2";return e.jsx("span",{className:`${l} shrink-0 rounded-full ${s?"animate-pulse":""}`,style:{backgroundColor:s?"var(--warning)":n}})}function Me({tasks:t,activeId:a,onSelect:s,onUnpin:n,children:l}){const m=xe();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex flex-col border-r border-[var(--border)] bg-[var(--bg-card)] overflow-y-auto",style:{width:200,minWidth:200},children:[e.jsx("div",{className:"border-b border-[var(--border)] px-3 py-2",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// active tasks"})}),t.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):e.jsx("div",{className:"flex-1",children:t.map(r=>{const o=r.id===a;return e.jsxs("div",{onClick:()=>s(r.id),className:`group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${o?"bg-[var(--accent)]/10 text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.jsx(Y,{status:r.status,size:"md"}),e.jsxs("div",{className:"flex-1 min-w-0",title:ue(r),children:[e.jsxs("div",{className:"truncate text-xs",children:["#",r.id," ",me(r)]}),e.jsx("div",{className:"text-[10px] text-[var(--text-muted)]",children:r.projectKey})]}),e.jsx("button",{onClick:p=>{p.stopPropagation(),n(r.id)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--text-primary)]",title:"unpin",children:e.jsx(ee,{className:"h-3 w-3"})}),e.jsx("button",{onClick:p=>{p.stopPropagation(),m(`/tasks/${r.id}`)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--accent)]",title:"open detail",children:e.jsx("span",{className:"text-[10px] leading-none",children:"→"})})]},r.id)})})]}),e.jsxs("div",{className:"flex flex-col md:hidden",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar border-b border-[var(--border)] bg-[var(--bg-card)] px-2",style:{height:44},children:t.length===0?e.jsx("div",{className:"flex items-center justify-center w-full",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):t.map(r=>{const o=r.id===a;return e.jsxs("button",{onClick:()=>s(r.id),className:`flex shrink-0 items-center gap-1.5 px-3 border-b-2 transition-colors ${o?"border-[var(--accent)] text-[var(--text-primary)]":"border-transparent text-[var(--text-secondary)]"}`,style:{height:44},children:[e.jsx(Y,{status:r.status,size:"sm"}),e.jsxs("span",{className:"text-[11px] whitespace-nowrap",children:["#",r.id]})]},r.id)})}),l]})]})}function De({task:t,takeoverState:a,onTakeover:s,onRelease:n}){const l=ae(t.status),m=ge(t.agentType),r=a==="manual",o=te(t);return e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:36,minHeight:36},children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:t.projectKey}),e.jsxs("span",{className:"text-[11px]",style:{color:l},children:[t.status.toLowerCase()," / ",m]}),t.currentStage&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"hidden md:inline text-[11px] text-[var(--text-muted)]",children:["// stage: ",t.currentStage]}),e.jsxs("span",{className:"md:hidden text-[11px] text-[var(--text-muted)]",children:["stage: ",t.currentStage]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",o]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsx("div",{className:"flex items-center gap-1",children:!B.includes(t.status)&&(r?e.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 rounded-[4px] px-2.5 py-0.5 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(ye,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden md:inline",children:"restore auto"})]}):e.jsxs("button",{onClick:s,disabled:a==="requesting",className:"flex items-center gap-1.5 rounded-[4px] px-2.5 py-0.5 text-[11px] font-medium text-[var(--warning)] disabled:opacity-50",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:[e.jsx(he,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden md:inline",children:"take over"})]}))})]})}function Oe({task:t,ptyStatus:a}){const s=a==="connected";return e.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:28,minHeight:28},children:[e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:t.currentStage?`stage: ${t.currentStage}`:`task #${t.id}`}),e.jsxs("span",{className:`flex items-center gap-1 text-[10px] ${s?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:[s?e.jsx(Ne,{className:"h-2.5 w-2.5"}):e.jsx(Te,{className:"h-2.5 w-2.5"}),s?"connected":a]})]})}function K({onboardingData:t}){const[a,s]=c.useState(!1),{t:n}=M();return t?a?e.jsxs("div",{className:"border-b border-[var(--accent)]/30",children:[e.jsxs("button",{onClick:()=>s(!1),className:"flex w-full items-center justify-between bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:n("onboarding.getting_started")}),e.jsx(we,{className:"h-3 w-3 text-[var(--text-muted)]"})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx(se,{data:t})})]}):e.jsxs("button",{onClick:()=>s(!0),className:"flex w-full items-center justify-between border-b border-[var(--accent)]/30 bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",style:{height:36},children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:n("onboarding.getting_started")}),e.jsx(be,{className:"h-3 w-3 text-[var(--text-muted)]"})]}):null}function X({onboardingData:t}){const{t:a}=M();return e.jsx("div",{className:`flex flex-1 flex-col items-center p-4 md:p-6 ${t?"overflow-auto":"justify-center"}`,children:t?e.jsx("div",{className:"w-full max-w-lg",children:e.jsx(se,{data:t})}):e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"mb-3 text-3xl text-[var(--border)]",children:[">","_"]}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("terminal_home.no_active_tasks")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("terminal_home.create_task_hint")})]})})}function Qe(){const{t}=M(),{pinnedTaskIds:a,activeTaskId:s,taskMetas:n,stageConfirm:l,loading:m,setActiveTask:r,pinTask:o,unpinTask:p,loadActiveTasks:i,fetchStageConfirm:f,clearStageConfirm:h,updateTaskMeta:_}=_e(),I=c.useRef(null),[E,U]=c.useState("disconnected"),[D,w]=c.useState("auto"),[g,b]=c.useState(""),k=z(d=>d.lastEvent),T=z(d=>d.status),u=s?n[s]??null:null,O=u?B.includes(u.status):!1,y=c.useRef(!1);c.useEffect(()=>{!y.current&&u&&(b(u.projectKey),y.current=!0)},[u]);const v=c.useMemo(()=>{const d=a.map(j=>n[j]).filter(Boolean);return g?d.filter(j=>j.projectKey===g):d},[a,n,g]);c.useEffect(()=>{v.length>0&&s&&!v.some(d=>d.id===s)&&r(v[0].id)},[v,s,r]);const S=Ie();le(u?oe(u):null),c.useEffect(()=>{i()},[i]),c.useEffect(()=>{s&&(u==null?void 0:u.status)===N.SUSPENDED?f(s):h()},[s,u==null?void 0:u.status,f,h]),c.useEffect(()=>{if(k){if(k.event==="task_status_changed"){const{taskId:d,status:j,currentStage:W}=k,q={status:j,updatedAt:new Date().toISOString()};W!==void 0&&(q.currentStage=W),_(d,q),j===N.SUSPENDED&&d===s&&f(d),B.includes(j)&&d===s&&h()}k.event==="task_created"&&i()}},[k,s,f,h,_,i]),c.useEffect(()=>{if(T==="connected")return;const j=setInterval(()=>{document.visibilityState!=="hidden"&&i()},15e3);return()=>clearInterval(j)},[T,i]);const L=c.useCallback(d=>{o(d),r(d),i()},[o,r,i]),P=c.useCallback(()=>{h(),i()},[h,i]),x=c.useCallback(()=>{var d;(d=I.current)==null||d.requestTakeover()},[]),R=c.useCallback(()=>{var d;(d=I.current)==null||d.releaseTakeover()},[]);if(m&&a.length===0)return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("common.loading")})});const ie=v.length>0;return e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsx(Ae,{projectKey:g,onProjectChange:b,onCreated:L}),e.jsx("div",{className:"flex flex-col md:flex-row flex-1 overflow-hidden",children:ie?e.jsxs(e.Fragment,{children:[e.jsx(Me,{tasks:v,activeId:s,onSelect:r,onUnpin:p,children:e.jsx("div",{className:"md:hidden",children:e.jsx(K,{onboardingData:S})})}),e.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:u?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(K,{onboardingData:S})}),e.jsx(De,{task:u,takeoverState:D,onTakeover:x,onRelease:R}),l&&s&&e.jsx(Ee,{taskId:s,confirm:l,onSubmitted:P}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(pe,{taskId:s,sessionId:u.currentSessionId??void 0,taskFinished:O,onStatusChange:U,onTakeoverChange:w,ref:I},s)}),e.jsx(Oe,{task:u,ptyStatus:E})]}):e.jsx(X,{onboardingData:S})})]}):e.jsx(X,{onboardingData:S})})]})}export{Qe as default};
@@ -1 +1 @@
1
- import{a as C,r as n,j as e,h as w,f as M,E as O,Z as k,V,a4 as T,v as $}from"./index-DJl-vKpg.js";import{K as E}from"./key-BwIOi-0U.js";import{C as S}from"./copy-cloBpe4U.js";import{E as K}from"./external-link-Clr8ygf6.js";import{E as P}from"./EmptyState-c4IsGUGS.js";import{T as W}from"./Skeleton-1CByoX9G.js";import{u as B}from"./useFetch-CyCGABKu.js";import{e as R}from"./status-colors-D3fj6h6e.js";import{P as J}from"./plus-Dy384KeJ.js";function z({isOpen:a,onClose:y,onCreated:b}){const{t:s}=C(),[r,c]=n.useState(""),[i,d]=n.useState(!1),[l,v]=n.useState("");function h(){c(""),v(""),y()}async function x(){if(v(""),!r.trim()){v(s("admin.pat_label_required"));return}try{d(!0);const o=await w.post("admin/worker-tokens",{json:{label:r.trim()}}).json();c(""),b({token:o.token,id:o.id})}catch(o){const m=o instanceof Error?o.message:s("admin.pat_failed_to_generate");v(m)}finally{d(!1)}}return a?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&h()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(E,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:s("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[l&&e.jsx("div",{className:"border border-[var(--destructive)]/30 bg-[var(--destructive)]/10 px-3 py-2 text-xs text-[var(--destructive)]",style:{borderRadius:"4px"},children:l}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("admin.label")}),e.jsx("input",{type:"text",placeholder:s("admin.pat_label_placeholder"),value:r,onChange:o=>c(o.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:o=>{o.key==="Enter"&&x()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("admin.label_identifies_worker")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:h,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s("common.cancel")}),e.jsx("button",{onClick:x,disabled:i,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s(i?"admin.generating":"admin.generate")})]})]})}):null}const X=3e3,q=600*1e3;function G({isOpen:a,token:y,tokenId:b,onClose:s}){const{t:r}=C(),[c,i]=n.useState("command"),[d,l]=n.useState(!1),[v,h]=n.useState(!1),[x,o]=n.useState(""),[m,g]=n.useState(null),p=n.useRef(void 0),N=n.useRef(Date.now()),_=M(),j=typeof window<"u"?window.location.origin:"https://overlord.example.com",t=`overlord setup worker --token ${y} --server ${j}`;async function D(){try{await navigator.clipboard.writeText(y),l(!0),setTimeout(()=>l(!1),2e3)}catch{}}async function L(){try{await navigator.clipboard.writeText(t),h(!0),setTimeout(()=>h(!1),2e3)}catch{}}const A=n.useCallback(async()=>{try{const f=await w.get(`admin/worker-tokens/${b}/status`).json();f.status==="used"&&f.worker_name&&(i("success"),o(f.worker_name),g(f.worker_id??null),p.current&&clearInterval(p.current))}catch{}Date.now()-N.current>q&&(i("timeout"),p.current&&clearInterval(p.current))},[b]);function F(){i("waiting"),N.current=Date.now(),p.current=setInterval(A,X)}n.useEffect(()=>()=>{p.current&&clearInterval(p.current)},[]);function I(){s(),m&&_(`/workers/${m}`)}if(!a)return null;const u={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:f=>{f.target===f.currentTarget&&s()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...u,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:r("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:r("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("admin.run_command_desc")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:y}),e.jsx("button",{onClick:D,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:d?e.jsx("span",{className:"text-[var(--accent)]",children:r("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"h-3 w-3"})," ",r("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:r("admin.setup_command")}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsxs("code",{className:"block break-all pr-20 text-xs text-[var(--accent)]",children:["$ ",t]}),e.jsx("button",{onClick:L,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:v?e.jsx("span",{className:"text-[var(--accent)]",children:r("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"h-3 w-3"})," ",r("common.copy")]})})]})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:r("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:r("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:r("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[r("admin.worker"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:x})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),e.jsx("button",{onClick:F,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:u,children:r("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),e.jsxs("button",{onClick:I,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:u,children:[e.jsx(K,{className:"h-3 w-3"}),r("admin.view_worker")]})]})]})]})})}function se(){const{t:a}=C(),[y,b]=n.useState(!1),[s,r]=n.useState(null),[c,i]=n.useState(!1),[d,l]=n.useState(null),[v,h]=n.useState(!1),[x,o]=n.useState(!1),{data:m,loading:g,refetch:p}=B(()=>w.get("admin/worker-tokens").json(),[]);async function N(){if(d){h(!0);try{await w.post(`admin/worker-tokens/${d.id}/revoke`),i(!1),l(null),p()}catch{}finally{h(!1)}}}function _(t){b(!1),r(t),p()}const j=n.useMemo(()=>(m??[]).filter(t=>x||t.status!==k.REVOKED),[m,x]);return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>b(!0),children:[e.jsx(J,{className:"h-3.5 w-3.5"}),a("admin.generate_token")]})]}),!g&&(m==null?void 0:m.some(t=>t.status===k.REVOKED))&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>o(!x),className:`text-xs transition-colors ${x?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(x?"admin.hide_revoked":"admin.show_revoked")})}),g?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(W,{rows:3})}):j.length===0?e.jsx(P,{icon:V,title:a("admin.no_worker_tokens"),description:a("admin.generate_token_desc"),actionLabel:a("admin.generate_token"),onAction:()=>b(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:j.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:t.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:R(t.status),children:t.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:t.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(t.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:t.status===k.ACTIVE&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{l(t),i(!0)},children:[e.jsx(T,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:j.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)] font-medium truncate mr-2",children:t.label}),e.jsx("span",{className:`text-[11px] shrink-0 ${R(t.status)}`,children:t.status})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-secondary)] truncate mb-1",children:t.purpose}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:new Date(t.createdAt).toLocaleDateString()}),t.expiresAt&&e.jsx("span",{children:new Date(t.expiresAt).toLocaleDateString()})]}),t.status===k.ACTIVE&&e.jsx("div",{className:"mt-2 pt-2 border-t border-[var(--border)]",children:e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-[11px] text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{l(t),i(!0)},children:[e.jsx(T,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},t.id))})]}),e.jsx(z,{isOpen:y,onClose:()=>b(!1),onCreated:_}),s&&e.jsx(G,{isOpen:!!s,token:s.token,tokenId:s.id,onClose:()=>r(null)}),e.jsx($,{isOpen:c,onClose:()=>{i(!1),l(null)},onConfirm:N,title:a("admin.revoke_token"),message:a("admin.revoke_token_confirm",{label:(d==null?void 0:d.label)??""}),confirmLabel:a("admin.revoke"),confirmVariant:"danger",isLoading:v})]})}export{se as default};
1
+ import{a as C,r as n,j as e,h as w,f as M,E as O,Z as k,V,a4 as T,v as $}from"./index-D_OrDcWf.js";import{K as E}from"./key-BpF_rjM9.js";import{C as S}from"./copy-BsSvzuvN.js";import{E as K}from"./external-link-D4FpeC5t.js";import{E as P}from"./EmptyState-BwOJcw-7.js";import{T as W}from"./Skeleton-BSwNthrI.js";import{u as B}from"./useFetch-_T-wW8J0.js";import{e as R}from"./status-colors-CYQlZjBF.js";import{P as J}from"./plus-DLpnTi95.js";function z({isOpen:a,onClose:y,onCreated:b}){const{t:s}=C(),[r,c]=n.useState(""),[i,d]=n.useState(!1),[l,v]=n.useState("");function h(){c(""),v(""),y()}async function x(){if(v(""),!r.trim()){v(s("admin.pat_label_required"));return}try{d(!0);const o=await w.post("admin/worker-tokens",{json:{label:r.trim()}}).json();c(""),b({token:o.token,id:o.id})}catch(o){const m=o instanceof Error?o.message:s("admin.pat_failed_to_generate");v(m)}finally{d(!1)}}return a?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&h()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(E,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:s("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[l&&e.jsx("div",{className:"border border-[var(--destructive)]/30 bg-[var(--destructive)]/10 px-3 py-2 text-xs text-[var(--destructive)]",style:{borderRadius:"4px"},children:l}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("admin.label")}),e.jsx("input",{type:"text",placeholder:s("admin.pat_label_placeholder"),value:r,onChange:o=>c(o.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:o=>{o.key==="Enter"&&x()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("admin.label_identifies_worker")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:h,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s("common.cancel")}),e.jsx("button",{onClick:x,disabled:i,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s(i?"admin.generating":"admin.generate")})]})]})}):null}const X=3e3,q=600*1e3;function G({isOpen:a,token:y,tokenId:b,onClose:s}){const{t:r}=C(),[c,i]=n.useState("command"),[d,l]=n.useState(!1),[v,h]=n.useState(!1),[x,o]=n.useState(""),[m,g]=n.useState(null),p=n.useRef(void 0),N=n.useRef(Date.now()),_=M(),j=typeof window<"u"?window.location.origin:"https://overlord.example.com",t=`overlord setup worker --token ${y} --server ${j}`;async function D(){try{await navigator.clipboard.writeText(y),l(!0),setTimeout(()=>l(!1),2e3)}catch{}}async function L(){try{await navigator.clipboard.writeText(t),h(!0),setTimeout(()=>h(!1),2e3)}catch{}}const A=n.useCallback(async()=>{try{const f=await w.get(`admin/worker-tokens/${b}/status`).json();f.status==="used"&&f.worker_name&&(i("success"),o(f.worker_name),g(f.worker_id??null),p.current&&clearInterval(p.current))}catch{}Date.now()-N.current>q&&(i("timeout"),p.current&&clearInterval(p.current))},[b]);function F(){i("waiting"),N.current=Date.now(),p.current=setInterval(A,X)}n.useEffect(()=>()=>{p.current&&clearInterval(p.current)},[]);function I(){s(),m&&_(`/workers/${m}`)}if(!a)return null;const u={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:f=>{f.target===f.currentTarget&&s()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...u,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:r("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:r("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("admin.run_command_desc")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:y}),e.jsx("button",{onClick:D,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:d?e.jsx("span",{className:"text-[var(--accent)]",children:r("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"h-3 w-3"})," ",r("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:r("admin.setup_command")}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsxs("code",{className:"block break-all pr-20 text-xs text-[var(--accent)]",children:["$ ",t]}),e.jsx("button",{onClick:L,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:v?e.jsx("span",{className:"text-[var(--accent)]",children:r("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"h-3 w-3"})," ",r("common.copy")]})})]})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:r("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:r("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:r("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[r("admin.worker"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:x})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),e.jsx("button",{onClick:F,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:u,children:r("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),e.jsxs("button",{onClick:I,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:u,children:[e.jsx(K,{className:"h-3 w-3"}),r("admin.view_worker")]})]})]})]})})}function se(){const{t:a}=C(),[y,b]=n.useState(!1),[s,r]=n.useState(null),[c,i]=n.useState(!1),[d,l]=n.useState(null),[v,h]=n.useState(!1),[x,o]=n.useState(!1),{data:m,loading:g,refetch:p}=B(()=>w.get("admin/worker-tokens").json(),[]);async function N(){if(d){h(!0);try{await w.post(`admin/worker-tokens/${d.id}/revoke`),i(!1),l(null),p()}catch{}finally{h(!1)}}}function _(t){b(!1),r(t),p()}const j=n.useMemo(()=>(m??[]).filter(t=>x||t.status!==k.REVOKED),[m,x]);return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>b(!0),children:[e.jsx(J,{className:"h-3.5 w-3.5"}),a("admin.generate_token")]})]}),!g&&(m==null?void 0:m.some(t=>t.status===k.REVOKED))&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>o(!x),className:`text-xs transition-colors ${x?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(x?"admin.hide_revoked":"admin.show_revoked")})}),g?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(W,{rows:3})}):j.length===0?e.jsx(P,{icon:V,title:a("admin.no_worker_tokens"),description:a("admin.generate_token_desc"),actionLabel:a("admin.generate_token"),onAction:()=>b(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:j.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:t.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:R(t.status),children:t.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:t.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(t.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:t.status===k.ACTIVE&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{l(t),i(!0)},children:[e.jsx(T,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:j.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)] font-medium truncate mr-2",children:t.label}),e.jsx("span",{className:`text-[11px] shrink-0 ${R(t.status)}`,children:t.status})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-secondary)] truncate mb-1",children:t.purpose}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:new Date(t.createdAt).toLocaleDateString()}),t.expiresAt&&e.jsx("span",{children:new Date(t.expiresAt).toLocaleDateString()})]}),t.status===k.ACTIVE&&e.jsx("div",{className:"mt-2 pt-2 border-t border-[var(--border)]",children:e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-[11px] text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{l(t),i(!0)},children:[e.jsx(T,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},t.id))})]}),e.jsx(z,{isOpen:y,onClose:()=>b(!1),onCreated:_}),s&&e.jsx(G,{isOpen:!!s,token:s.token,tokenId:s.id,onClose:()=>r(null)}),e.jsx($,{isOpen:c,onClose:()=>{i(!1),l(null)},onConfirm:N,title:a("admin.revoke_token"),message:a("admin.revoke_token_confirm",{label:(d==null?void 0:d.label)??""}),confirmLabel:a("admin.revoke"),confirmVariant:"danger",isLoading:v})]})}export{se as default};
@@ -1 +1 @@
1
- import{O as m,r as e,j as t}from"./index-DJl-vKpg.js";var b=m();function g({content:n,children:a,delay:l=100,className:i}){const[p,u]=e.useState(!1),[c,f]=e.useState({top:0,left:0}),r=e.useRef(null),o=e.useRef(null),x=e.useCallback(()=>{r.current=setTimeout(()=>{if(o.current){const s=o.current.getBoundingClientRect();f({top:s.top-4,left:s.left+s.width/2})}u(!0)},l)},[l]),d=e.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),u(!1)},[]);return n?t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:o,onMouseEnter:x,onMouseLeave:d,className:i,children:a}),p&&b.createPortal(t.jsx("div",{role:"tooltip",style:{position:"fixed",top:c.top,left:c.left,transform:"translate(-50%, -100%)",zIndex:9999},className:"pointer-events-none max-w-sm rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1.5 text-xs text-[var(--text-primary)] shadow-lg border border-[var(--border-row)]",children:n}),document.body)]}):t.jsx(t.Fragment,{children:a})}export{g as T};
1
+ import{O as m,r as e,j as t}from"./index-D_OrDcWf.js";var b=m();function g({content:n,children:a,delay:l=100,className:i}){const[p,u]=e.useState(!1),[c,f]=e.useState({top:0,left:0}),r=e.useRef(null),o=e.useRef(null),x=e.useCallback(()=>{r.current=setTimeout(()=>{if(o.current){const s=o.current.getBoundingClientRect();f({top:s.top-4,left:s.left+s.width/2})}u(!0)},l)},[l]),d=e.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),u(!1)},[]);return n?t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:o,onMouseEnter:x,onMouseLeave:d,className:i,children:a}),p&&b.createPortal(t.jsx("div",{role:"tooltip",style:{position:"fixed",top:c.top,left:c.left,transform:"translate(-50%, -100%)",zIndex:9999},className:"pointer-events-none max-w-sm rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1.5 text-xs text-[var(--text-primary)] shadow-lg border border-[var(--border-row)]",children:n}),document.body)]}):t.jsx(t.Fragment,{children:a})}export{g as T};
@@ -1,4 +1,4 @@
1
- import{R as A,g as he,f as fe,u as Y,a as me,r as _,j as M,h as W,t as ge}from"./index-DJl-vKpg.js";var pe=Object.defineProperty,j=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,V=(u,a,i)=>a in u?pe(u,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[a]=i,k=(u,a)=>{for(var i in a||(a={}))X.call(a,i)&&V(u,i,a[i]);if(j)for(var i of j(a))K.call(a,i)&&V(u,i,a[i]);return u},U=(u,a)=>{var i={};for(var l in u)X.call(u,l)&&a.indexOf(l)<0&&(i[l]=u[l]);if(u!=null&&j)for(var l of j(u))a.indexOf(l)<0&&K.call(u,l)&&(i[l]=u[l]);return i};/**
1
+ import{R as A,g as he,f as fe,u as Y,a as me,r as _,j as M,h as W,t as ge}from"./index-D_OrDcWf.js";var pe=Object.defineProperty,j=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable,V=(u,a,i)=>a in u?pe(u,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):u[a]=i,k=(u,a)=>{for(var i in a||(a={}))X.call(a,i)&&V(u,i,a[i]);if(j)for(var i of j(a))K.call(a,i)&&V(u,i,a[i]);return u},U=(u,a)=>{var i={};for(var l in u)X.call(u,l)&&a.indexOf(l)<0&&(i[l]=u[l]);if(u!=null&&j)for(var l of j(u))a.indexOf(l)<0&&K.call(u,l)&&(i[l]=u[l]);return i};/**
2
2
  * @license QR Code generator library (TypeScript)
3
3
  * Copyright (c) Project Nayuki.
4
4
  * SPDX-License-Identifier: MIT