@overlordai/server 1.0.173 → 1.0.175

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 (173) hide show
  1. package/dist/adapters/confirm-required.utils.d.ts +24 -0
  2. package/dist/adapters/confirm-required.utils.d.ts.map +1 -0
  3. package/dist/adapters/confirm-required.utils.js +51 -0
  4. package/dist/adapters/confirm-required.utils.js.map +1 -0
  5. package/dist/adapters/lark/lark.adapter.d.ts +5 -3
  6. package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
  7. package/dist/adapters/lark/lark.adapter.js +56 -20
  8. package/dist/adapters/lark/lark.adapter.js.map +1 -1
  9. package/dist/adapters/nlu.service.js +1 -1
  10. package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
  11. package/dist/adapters/slack/slack.adapter.js +41 -12
  12. package/dist/adapters/slack/slack.adapter.js.map +1 -1
  13. package/dist/app.module.d.ts.map +1 -1
  14. package/dist/app.module.js +2 -0
  15. package/dist/app.module.js.map +1 -1
  16. package/dist/database/repositories/task.repository.d.ts +1 -0
  17. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  18. package/dist/database/repositories/task.repository.js +7 -0
  19. package/dist/database/repositories/task.repository.js.map +1 -1
  20. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  21. package/dist/dispatcher/dispatcher.service.js +7 -7
  22. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  23. package/dist/dispatcher/dispatcher.types.d.ts +1 -1
  24. package/dist/dispatcher/dispatcher.types.d.ts.map +1 -1
  25. package/dist/dispatcher/task-lifecycle.service.d.ts +1 -0
  26. package/dist/dispatcher/task-lifecycle.service.d.ts.map +1 -1
  27. package/dist/dispatcher/task-lifecycle.service.js +15 -0
  28. package/dist/dispatcher/task-lifecycle.service.js.map +1 -1
  29. package/dist/events/event-types.d.ts +7 -0
  30. package/dist/events/event-types.d.ts.map +1 -1
  31. package/dist/notifier/card-actions.d.ts +3 -0
  32. package/dist/notifier/card-actions.d.ts.map +1 -1
  33. package/dist/notifier/card-actions.js +6 -0
  34. package/dist/notifier/card-actions.js.map +1 -1
  35. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  36. package/dist/notifier/notification-consumer.js +13 -6
  37. package/dist/notifier/notification-consumer.js.map +1 -1
  38. package/dist/notifier/notification-event-listener.d.ts.map +1 -1
  39. package/dist/notifier/notification-event-listener.js +3 -1
  40. package/dist/notifier/notification-event-listener.js.map +1 -1
  41. package/dist/notifier/notifier.service.d.ts +6 -1
  42. package/dist/notifier/notifier.service.d.ts.map +1 -1
  43. package/dist/notifier/notifier.service.js +2 -1
  44. package/dist/notifier/notifier.service.js.map +1 -1
  45. package/dist/notifier/template.service.d.ts +8 -1
  46. package/dist/notifier/template.service.d.ts.map +1 -1
  47. package/dist/notifier/template.service.js +38 -6
  48. package/dist/notifier/template.service.js.map +1 -1
  49. package/dist/review/review-comment.service.d.ts +41 -0
  50. package/dist/review/review-comment.service.d.ts.map +1 -0
  51. package/dist/review/review-comment.service.js +317 -0
  52. package/dist/review/review-comment.service.js.map +1 -0
  53. package/dist/review/review.module.d.ts +3 -0
  54. package/dist/review/review.module.d.ts.map +1 -0
  55. package/dist/review/review.module.js +22 -0
  56. package/dist/review/review.module.js.map +1 -0
  57. package/dist/web/frame-handlers/review-report.handler.d.ts.map +1 -1
  58. package/dist/web/frame-handlers/review-report.handler.js +26 -6
  59. package/dist/web/frame-handlers/review-report.handler.js.map +1 -1
  60. package/dist/web/frame-handlers/stage-confirm.handler.d.ts +12 -2
  61. package/dist/web/frame-handlers/stage-confirm.handler.d.ts.map +1 -1
  62. package/dist/web/frame-handlers/stage-confirm.handler.js +106 -28
  63. package/dist/web/frame-handlers/stage-confirm.handler.js.map +1 -1
  64. package/package.json +4 -4
  65. package/public/assets/{AccessTokensPage-DWRXad3x.js → AccessTokensPage-BlZBgj0-.js} +1 -1
  66. package/public/assets/{AdminPage-BoIqMBJM.js → AdminPage-C0OFG0LC.js} +1 -1
  67. package/public/assets/{AgentCliPage-DDk8OWtX.js → AgentCliPage-Ci2XVaN8.js} +1 -1
  68. package/public/assets/{ApiReferencePage-Bv1wLy5b.js → ApiReferencePage-Dm9y-zCM.js} +1 -1
  69. package/public/assets/{ArchitecturePage-CxP9hkhF.js → ArchitecturePage-BetPO5Ws.js} +1 -1
  70. package/public/assets/{AuditLogPage-B7QQ9hah.js → AuditLogPage-Dbd27v1s.js} +1 -1
  71. package/public/assets/AutomationCreatePage-BvSw8KoZ.js +1 -0
  72. package/public/assets/{AutomationDetailPage-BY6bseqa.js → AutomationDetailPage-1Y2tp1KP.js} +1 -1
  73. package/public/assets/AutomationEditPage-C9UO1XrW.js +1 -0
  74. package/public/assets/AutomationListPage-CJk8o3Vp.js +26 -0
  75. package/public/assets/{AutomationRunDetailPage-CWPGlBJd.js → AutomationRunDetailPage-h7T4V9Yq.js} +1 -1
  76. package/public/assets/{BindPlatformPage-DrCQMFXN.js → BindPlatformPage-DpzV1bpB.js} +1 -1
  77. package/public/assets/{BotIntegrationPage-CFSmmRh1.js → BotIntegrationPage-9kAG4BIL.js} +1 -1
  78. package/public/assets/{BotManage-C7o5dyKk.js → BotManage-BanZ5a5-.js} +1 -1
  79. package/public/assets/{BotSetupPage-BgjGC1Ce.js → BotSetupPage-BZIfJYqL.js} +1 -1
  80. package/public/assets/{ChangelogPage-Bk6LcJiR.js → ChangelogPage-Da8n7_T3.js} +1 -1
  81. package/public/assets/{Checkbox-BOX6FtEq.js → Checkbox-Dsj1BuTd.js} +1 -1
  82. package/public/assets/{CliReferencePage-CtWMf_UQ.js → CliReferencePage-BDFsLYmx.js} +1 -1
  83. package/public/assets/{ConfirmStageDialog-BtyVYk27.js → ConfirmStageDialog-BUTA9YZ1.js} +1 -1
  84. package/public/assets/{DeploymentPage-CsQj6iic.js → DeploymentPage-B5TlN0FI.js} +1 -1
  85. package/public/assets/{DevWorkflowPage-uy7WzcsE.js → DevWorkflowPage-Abvhng0F.js} +1 -1
  86. package/public/assets/{DeveloperManage-BI6Ajrgf.js → DeveloperManage-DPSHCC6K.js} +1 -1
  87. package/public/assets/{DeveloperSetupPage-D-iex6Or.js → DeveloperSetupPage-QipfVSjp.js} +1 -1
  88. package/public/assets/{DocsIndexPage-D-KxxA8_.js → DocsIndexPage-Dw-saIXq.js} +1 -1
  89. package/public/assets/{DocsLayout-BCzKSMhE.js → DocsLayout-BsGaDVp1.js} +1 -1
  90. package/public/assets/{DocsPrimitives-BzVDx2cs.js → DocsPrimitives-Bv8TQpkc.js} +1 -1
  91. package/public/assets/{EditProjectPage-BY-qZ5wL.js → EditProjectPage-CtNCwK-z.js} +1 -1
  92. package/public/assets/{EmptyState-CqF5g3iI.js → EmptyState-BpbqIJyG.js} +1 -1
  93. package/public/assets/{EnvVariablesPage-BYhrZ5C5.js → EnvVariablesPage-D5Cn_E5P.js} +1 -1
  94. package/public/assets/{HomePage-Bhanys0H.js → HomePage-BFNO_Hk6.js} +1 -1
  95. package/public/assets/{InfoRow-BxA58xIa.js → InfoRow-BCDb21nt.js} +1 -1
  96. package/public/assets/{InstallationPage-Cg1I_2Mi.js → InstallationPage-DLW6MXhs.js} +1 -1
  97. package/public/assets/{LandingPage-JQqDMBvp.js → LandingPage-BLcQBvuD.js} +1 -1
  98. package/public/assets/{LocalDevelopmentPage-t1wS_JiB.js → LocalDevelopmentPage-BnbdovKe.js} +1 -1
  99. package/public/assets/{LoginPage-CgGCdeF7.js → LoginPage-Bh-p4hP9.js} +1 -1
  100. package/public/assets/{MetricBar-DfTk8Sjr.js → MetricBar-DLR15rum.js} +1 -1
  101. package/public/assets/{MultiSelect-s1A3k8lX.js → MultiSelect-BKtGWYgt.js} +1 -1
  102. package/public/assets/{NotFoundPage-BcK6DhJP.js → NotFoundPage-BpUwim1l.js} +1 -1
  103. package/public/assets/{OnboardingGuide-CnEZNjMO.js → OnboardingGuide-BTsSW7Mq.js} +1 -1
  104. package/public/assets/{PermissionsPage-DMhgJT_d.js → PermissionsPage-A828G2ih.js} +1 -1
  105. package/public/assets/{PipelineConfigPage-DLXm99KL.js → PipelineConfigPage-Cw1OxgKV.js} +1 -1
  106. package/public/assets/{PipelineEditorPage-BVaO5u3d.js → PipelineEditorPage-tewviYrj.js} +1 -1
  107. package/public/assets/{PlanPage-B3oI7rdU.js → PlanPage-Bidp5iEn.js} +1 -1
  108. package/public/assets/{ProfilePage-Bo77BD7U.js → ProfilePage-DgFxZS6i.js} +1 -1
  109. package/public/assets/{ProjectDetailPage-BXap15n_.js → ProjectDetailPage-BoIU1U3V.js} +1 -1
  110. package/public/assets/{ProjectListPage-Bf5gQWll.js → ProjectListPage-DMoN7Ghc.js} +1 -1
  111. package/public/assets/{PtyTerminal-Do7JUGQS.js → PtyTerminal-QdM0LGge.js} +1 -1
  112. package/public/assets/{QuickAuth-EIbjxqlx.js → QuickAuth-CGnZQLaj.js} +1 -1
  113. package/public/assets/{RemoveMemberConfirmDialog-CGzHpvJv.js → RemoveMemberConfirmDialog-uFuATit4.js} +1 -1
  114. package/public/assets/{ReviewAggregatePage-Bvk901fs.js → ReviewAggregatePage-D5S57j51.js} +1 -1
  115. package/public/assets/{ReviewPage-CBEbIkD3.js → ReviewPage-tkUY7vrY.js} +1 -1
  116. package/public/assets/{Select-BRJxl1YO.js → Select-CC0FnszM.js} +1 -1
  117. package/public/assets/{SettingsPage-CUznfUgJ.js → SettingsPage-DiecpWAG.js} +1 -1
  118. package/public/assets/{Skeleton-CkmmCp2B.js → Skeleton-WCDZdltv.js} +1 -1
  119. package/public/assets/{SkillPage-DmMxzWHC.js → SkillPage-ABYkJSop.js} +1 -1
  120. package/public/assets/{TaskDetailPage-DF6j4ohL.js → TaskDetailPage-D6qSqsm0.js} +1 -1
  121. package/public/assets/{TaskGuidePage-1NpVzVqi.js → TaskGuidePage-CFzoePPd.js} +1 -1
  122. package/public/assets/{TaskListPage-1_Fn21zu.js → TaskListPage-rDPMfjmN.js} +1 -1
  123. package/public/assets/{TaskStatusBadge-BldGSOah.js → TaskStatusBadge-CzUIb3QQ.js} +1 -1
  124. package/public/assets/{TerminalHomePage-BIk8jU04.js → TerminalHomePage-DP-gqkiq.js} +1 -1
  125. package/public/assets/{TokenManage-CMtAf7QR.js → TokenManage-CbLsJbR9.js} +1 -1
  126. package/public/assets/{Tooltip-EOsBLsZE.js → Tooltip-Ds3lc4sS.js} +1 -1
  127. package/public/assets/{TotpSetupPage-C7oZEO7M.js → TotpSetupPage-Bakhx3kM.js} +1 -1
  128. package/public/assets/{WorkerDetailPage-DNUSVoN8.js → WorkerDetailPage-W_1tf-Ng.js} +1 -1
  129. package/public/assets/{WorkerListPage-Bkb8IGzC.js → WorkerListPage-DAgJojBW.js} +1 -1
  130. package/public/assets/{WorkerOperationsPage-yH5f32ue.js → WorkerOperationsPage-BE8gDr3P.js} +1 -1
  131. package/public/assets/{WorkerSetupGuidePage-DADwzbsf.js → WorkerSetupGuidePage-Cjwu7yCO.js} +1 -1
  132. package/public/assets/{WorkerSetupPage-DAGFtNCP.js → WorkerSetupPage-C4F2PDWx.js} +1 -1
  133. package/public/assets/agent-type-options-BTd_pbKQ.js +1 -0
  134. package/public/assets/{arrow-left-DolNA3BD.js → arrow-left-Czit8jGK.js} +1 -1
  135. package/public/assets/{arrow-right-J0lJRpaW.js → arrow-right-DUvU3ZSE.js} +1 -1
  136. package/public/assets/{bot-Bf1PX7dx.js → bot-xYitrdXz.js} +1 -1
  137. package/public/assets/{chevron-down-Cm4So_5j.js → chevron-down-DwSdaR46.js} +1 -1
  138. package/public/assets/{chevron-left-Cx2ByqjE.js → chevron-left-DMFdbT8q.js} +1 -1
  139. package/public/assets/{chevron-right-D0k7WYYt.js → chevron-right-BqoEBUXc.js} +1 -1
  140. package/public/assets/{chevron-up-DVl3qTn3.js → chevron-up-4jZShvn6.js} +1 -1
  141. package/public/assets/{circle-alert-BojCwibr.js → circle-alert-gAYg5DQY.js} +1 -1
  142. package/public/assets/{clock-DQeHdtoa.js → clock-Bn8CRcdc.js} +1 -1
  143. package/public/assets/{copy-CHO7AsGy.js → copy-_C7txolK.js} +1 -1
  144. package/public/assets/{download-D5cnbFDk.js → download-CGR9pdGa.js} +1 -1
  145. package/public/assets/{external-link-lvF-co6-.js → external-link-DGEar13h.js} +1 -1
  146. package/public/assets/{git-fork-DRlvwKYI.js → git-fork-bd2vu3ng.js} +1 -1
  147. package/public/assets/{index-D9synPeJ.js → index-DAwsREkq.js} +5 -5
  148. package/public/assets/{key-KezsYJ0O.js → key-b6kn-A1T.js} +1 -1
  149. package/public/assets/{loader-circle--EO2iEyc.js → loader-circle-vH-Hp_AS.js} +1 -1
  150. package/public/assets/{pencil-DIvX1Xsb.js → pencil-Cxzh8oiw.js} +1 -1
  151. package/public/assets/{play-BHrAGNju.js → play-bFi1k4eQ.js} +1 -1
  152. package/public/assets/{plus-9sncIl_N.js → plus-DJTaWh3N.js} +1 -1
  153. package/public/assets/{rotate-ccw-Dw8AxO4w.js → rotate-ccw-CXFQ7046.js} +1 -1
  154. package/public/assets/{scroll-text-CRQexw-n.js → scroll-text-UIbwyc0E.js} +1 -1
  155. package/public/assets/{settings-CgXh3xHG.js → settings-DA_C9Znv.js} +1 -1
  156. package/public/assets/{skip-forward-Q2vmwL9H.js → skip-forward-C71GgwGt.js} +1 -1
  157. package/public/assets/{status-colors-CRgg1N4i.js → status-colors-C14ffr9M.js} +1 -1
  158. package/public/assets/{task-agent-KZdZD5cO.js → task-agent-BasiQZ0L.js} +1 -1
  159. package/public/assets/{task-constants-BiYtEhWG.js → task-constants-DihuKtBw.js} +1 -1
  160. package/public/assets/{task.store-Ds-1t2to.js → task.store-MpV9TV7z.js} +1 -1
  161. package/public/assets/{timer-ihiO0n04.js → timer-COkLkLUF.js} +1 -1
  162. package/public/assets/{trash-2-Cb5-yglV.js → trash-2-CDhJihtl.js} +1 -1
  163. package/public/assets/{useFetch-Dj0ZN58I.js → useFetch-CgkGfhaP.js} +1 -1
  164. package/public/assets/{users-MLpO39SG.js → users-BwpIig9c.js} +1 -1
  165. package/public/assets/{wifi-SWAOT6IR.js → wifi-D5o6IWuC.js} +1 -1
  166. package/public/assets/{workflow-M2c7dT84.js → workflow-DXTOpHef.js} +1 -1
  167. package/public/assets/{zap-gd-vvEW3.js → zap-CEUF2oJs.js} +1 -1
  168. package/public/index.html +1 -1
  169. package/public/sw.js +1 -1
  170. package/public/assets/AutomationCreatePage-ChPD2oTI.js +0 -1
  171. package/public/assets/AutomationEditPage-BqeA3DXk.js +0 -1
  172. package/public/assets/AutomationListPage-DkT1Yv4n.js +0 -26
  173. package/public/assets/agent-type-options-DXKoGpJI.js +0 -1
@@ -1 +1 @@
1
- import{f as ee,a as te,k as se,r as s,h as b,o as a,t as N,x as re,j as t,K as ae,l as ne,I as oe}from"./index-D9synPeJ.js";import{E as ce}from"./EmptyState-CqF5g3iI.js";import{T as ie}from"./Skeleton-CkmmCp2B.js";import{C as le}from"./ConfirmStageDialog-BtyVYk27.js";import{f as de}from"./date-CmcdoD87.js";import{S as pe}from"./Select-BRJxl1YO.js";import{P as ue}from"./plus-9sncIl_N.js";import{E as me}from"./external-link-lvF-co6-.js";import{C as xe}from"./chevron-left-Cx2ByqjE.js";import{C as fe}from"./chevron-right-D0k7WYYt.js";import"./clock-DQeHdtoa.js";import"./chevron-down-Cm4So_5j.js";const be=[a.QUEUED,a.ASSIGNED,a.RUNNING,a.SUSPENDED],ge=20;function he(c,n){if(!c)return null;const y=c.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),i=n.split("/").map(encodeURIComponent).join("/");return c.gitPlatform===oe.GITLAB?`${y}/-/tree/${i}/docs/specs`:`${y}/tree/${i}/docs/specs`}function ve(c){switch(c){case a.RUNNING:return"bg-[var(--accent)]";case a.QUEUED:return"bg-[var(--warning)]";case a.ASSIGNED:return"bg-[var(--info)]";case a.SUSPENDED:return"bg-[var(--warning)]";case a.COMPLETED:return"bg-[var(--accent)]";case a.FAILED:return"bg-[var(--destructive)]";case a.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}function Le(){const c=ee(),{t:n}=te(),y=se(e=>e.taskSeq),[i,Q]=s.useState("in_progress"),[E,I]=s.useState([]),[L,U]=s.useState(!0),[g,_]=s.useState(void 0),[p,w]=s.useState(void 0),[u,k]=s.useState([]),[j,$]=s.useState({}),[H,A]=s.useState(new Set),[M,D]=s.useState(null),[h,P]=s.useState(null),[l,J]=s.useState([]),[m,O]=s.useState(""),[v,R]=s.useState(""),[T,G]=s.useState(!1),V=s.useMemo(()=>{const e={};for(const r of l)e[r.key]=r;return e},[l]);s.useEffect(()=>{let e=!1;return b.get("web/projects").json().then(r=>{e||J(r)}).catch(()=>{}),()=>{e=!0}},[]),s.useEffect(()=>{l.length>0&&!m&&O(l[0].key)},[l]);const C=s.useCallback(async e=>{U(!0);try{const r=new URLSearchParams({taskMode:"plan",limit:String(ge)});i==="in_progress"?r.set("status",be.join(",")):r.set("status",a.COMPLETED+","+a.FAILED+","+a.CANCELLED),e&&r.set("cursor",e);const S=await b.get(`web/tasks?${r}`).json(),x=S.data??[];I(x),_(S.nextCursor);const d=x.filter(o=>o.status===a.SUSPENDED).map(o=>o.id);if(d.length>0){const o=new Set;await Promise.all(d.map(async f=>{try{(await b.get(`web/tasks/${f}/pending-confirm`).json()).confirm&&o.add(f)}catch{}})),A(o)}else A(new Set);const q=x.filter(o=>o.status===a.COMPLETED).map(o=>o.id);if(q.length>0){const o={};await Promise.all(q.map(async f=>{try{const F=await b.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(f),limit:"100"})}`).json();o[f]=(F.data??[]).length}catch{o[f]=0}})),$(o)}else $({})}catch{I([]),_(void 0)}finally{U(!1)}},[i]);s.useEffect(()=>{C(p)},[C,p,y]),s.useEffect(()=>{w(void 0),k([])},[i]);const Z=s.useCallback(()=>{g&&(k(e=>[...e,p??""]),w(g))},[g,p]),z=s.useCallback(()=>{u.length!==0&&(w(u.at(-1)||void 0),k(e=>e.slice(0,-1)))},[u]),W=u.length+1,K=s.useCallback(async()=>{if(!m||!v.trim()){N.error("project and description are required.");return}G(!0);try{const e=await b.post("web/tasks",{json:{projectKey:m,description:v.trim(),taskMode:"plan"}}).json();R(""),c(`/tasks/${e.task.id}`)}catch(e){const r=e instanceof Error?e.message:String(e);N.error(r)}finally{G(!1)}},[m,v,c]),X=s.useCallback(async e=>{try{const r=await b.get(`web/tasks/${e}/pending-confirm`).json();r.confirm?(D(e),P(r.confirm)):N.error(n("tasks.confirm_failed"))}catch{N.error(n("tasks.confirm_failed"))}},[n]),Y=s.useCallback(()=>{D(null),P(null),C(p)},[C,p]),B=s.useMemo(()=>l.map(e=>({value:e.key,label:e.name})),[l]);return re(null),t.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsx("h1",{className:"sr-only",children:n("plan.title")}),t.jsxs("div",{className:"mb-6 flex flex-col gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:flex-row md:items-center md:gap-3",children:[t.jsx(pe,{value:m,onChange:O,options:B.length>0?B:[{value:"",label:"loading..."}],className:"md:w-44 shrink-0"}),t.jsx("input",{type:"text",placeholder:n("plan.description_placeholder"),value:v,onChange:e=>R(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!T&&K()},className:"flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),t.jsxs("button",{onClick:K,disabled:T||!m||!v.trim(),className:"flex shrink-0 items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-mono text-black transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:[t.jsx(ue,{className:"h-3.5 w-3.5"}),n(T?"common.creating":"plan.create")]})]}),t.jsx("div",{className:"mb-4 flex items-center gap-1 overflow-x-auto pb-1 no-scrollbar",children:["in_progress","completed"].map(e=>t.jsx("button",{onClick:()=>Q(e),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${i===e?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:n(e==="in_progress"?"review.in_progress":"tasks.tab_completed")},e))}),t.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[L&&E.length===0&&t.jsx("div",{className:"p-4",children:t.jsx(ie,{rows:4})}),!L&&E.length===0&&t.jsx(ce,{icon:ae,title:n("plan.no_plans"),description:n("plan.description_placeholder")}),E.map(e=>t.jsxs("div",{onClick:()=>c(`/tasks/${e.id}`),className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[t.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${ve(e.status)}`}),t.jsxs("span",{className:"flex-1 truncate text-xs text-[var(--text-primary)] preserve-case",children:["#",e.id," ",ne(e)]}),e.status===a.SUSPENDED&&H.has(e.id)&&t.jsx("button",{onClick:r=>{r.stopPropagation(),X(e.id)},className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold text-black bg-[var(--warning)] hover:opacity-90 transition-opacity",children:n("tasks.pending_confirmation")}),e.status===a.COMPLETED&&j[e.id]!=null&&j[e.id]>0&&t.jsxs("span",{className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold",style:{color:"#3b82f6",backgroundColor:"rgba(59,130,246,0.12)"},title:`${j[e.id]} downstream task(s)`,children:[j[e.id]," tasks"]}),e.status===a.COMPLETED&&(()=>{const r=V[e.projectKey];if(!r)return null;let S="main";if(e.configSnapshot)try{const d=JSON.parse(e.configSnapshot);d.defaultBranch&&(S=d.defaultBranch)}catch{}const x=he(r,S);return x?t.jsxs("a",{href:x,target:"_blank",rel:"noopener noreferrer",onClick:d=>d.stopPropagation(),className:"shrink-0 flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[10px] text-[var(--text-muted)] hover:text-[var(--info)] hover:border-[var(--info)] transition-colors",title:n("plan.view_spec"),children:[t.jsx(me,{className:"h-2.5 w-2.5"}),n("plan.view_spec")]}):null})(),t.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:e.projectKey}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:e.status.toLowerCase()}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:de(e.createdAt)})]},e.id))]}),(u.length>0||g)&&t.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",W]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:z,disabled:u.length===0,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 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:[t.jsx(xe,{className:"h-3.5 w-3.5"}),n("tasks.prev")]}),t.jsxs("button",{onClick:Z,disabled:!g,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 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:[n("common.next"),t.jsx(fe,{className:"h-3.5 w-3.5"})]})]})]}),M!=null&&h&&t.jsx(le,{isOpen:!0,onClose:()=>{D(null),P(null)},taskId:M,stageName:h.stageName,timeoutSeconds:h.timeout,confirmType:h.confirmType,prompt:h.prompt,onSubmitted:Y})]})}export{Le as default};
1
+ import{f as ee,a as te,k as se,r as s,h as b,o as a,t as N,x as re,j as t,K as ae,l as ne,I as oe}from"./index-DAwsREkq.js";import{E as ce}from"./EmptyState-BpbqIJyG.js";import{T as ie}from"./Skeleton-WCDZdltv.js";import{C as le}from"./ConfirmStageDialog-BUTA9YZ1.js";import{f as de}from"./date-CmcdoD87.js";import{S as pe}from"./Select-CC0FnszM.js";import{P as ue}from"./plus-DJTaWh3N.js";import{E as me}from"./external-link-DGEar13h.js";import{C as xe}from"./chevron-left-DMFdbT8q.js";import{C as fe}from"./chevron-right-BqoEBUXc.js";import"./clock-Bn8CRcdc.js";import"./chevron-down-DwSdaR46.js";const be=[a.QUEUED,a.ASSIGNED,a.RUNNING,a.SUSPENDED],ge=20;function he(c,n){if(!c)return null;const y=c.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),i=n.split("/").map(encodeURIComponent).join("/");return c.gitPlatform===oe.GITLAB?`${y}/-/tree/${i}/docs/specs`:`${y}/tree/${i}/docs/specs`}function ve(c){switch(c){case a.RUNNING:return"bg-[var(--accent)]";case a.QUEUED:return"bg-[var(--warning)]";case a.ASSIGNED:return"bg-[var(--info)]";case a.SUSPENDED:return"bg-[var(--warning)]";case a.COMPLETED:return"bg-[var(--accent)]";case a.FAILED:return"bg-[var(--destructive)]";case a.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}function Le(){const c=ee(),{t:n}=te(),y=se(e=>e.taskSeq),[i,Q]=s.useState("in_progress"),[E,I]=s.useState([]),[L,U]=s.useState(!0),[g,_]=s.useState(void 0),[p,w]=s.useState(void 0),[u,k]=s.useState([]),[j,$]=s.useState({}),[H,A]=s.useState(new Set),[M,D]=s.useState(null),[h,P]=s.useState(null),[l,J]=s.useState([]),[m,O]=s.useState(""),[v,R]=s.useState(""),[T,G]=s.useState(!1),V=s.useMemo(()=>{const e={};for(const r of l)e[r.key]=r;return e},[l]);s.useEffect(()=>{let e=!1;return b.get("web/projects").json().then(r=>{e||J(r)}).catch(()=>{}),()=>{e=!0}},[]),s.useEffect(()=>{l.length>0&&!m&&O(l[0].key)},[l]);const C=s.useCallback(async e=>{U(!0);try{const r=new URLSearchParams({taskMode:"plan",limit:String(ge)});i==="in_progress"?r.set("status",be.join(",")):r.set("status",a.COMPLETED+","+a.FAILED+","+a.CANCELLED),e&&r.set("cursor",e);const S=await b.get(`web/tasks?${r}`).json(),x=S.data??[];I(x),_(S.nextCursor);const d=x.filter(o=>o.status===a.SUSPENDED).map(o=>o.id);if(d.length>0){const o=new Set;await Promise.all(d.map(async f=>{try{(await b.get(`web/tasks/${f}/pending-confirm`).json()).confirm&&o.add(f)}catch{}})),A(o)}else A(new Set);const q=x.filter(o=>o.status===a.COMPLETED).map(o=>o.id);if(q.length>0){const o={};await Promise.all(q.map(async f=>{try{const F=await b.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(f),limit:"100"})}`).json();o[f]=(F.data??[]).length}catch{o[f]=0}})),$(o)}else $({})}catch{I([]),_(void 0)}finally{U(!1)}},[i]);s.useEffect(()=>{C(p)},[C,p,y]),s.useEffect(()=>{w(void 0),k([])},[i]);const Z=s.useCallback(()=>{g&&(k(e=>[...e,p??""]),w(g))},[g,p]),z=s.useCallback(()=>{u.length!==0&&(w(u.at(-1)||void 0),k(e=>e.slice(0,-1)))},[u]),W=u.length+1,K=s.useCallback(async()=>{if(!m||!v.trim()){N.error("project and description are required.");return}G(!0);try{const e=await b.post("web/tasks",{json:{projectKey:m,description:v.trim(),taskMode:"plan"}}).json();R(""),c(`/tasks/${e.task.id}`)}catch(e){const r=e instanceof Error?e.message:String(e);N.error(r)}finally{G(!1)}},[m,v,c]),X=s.useCallback(async e=>{try{const r=await b.get(`web/tasks/${e}/pending-confirm`).json();r.confirm?(D(e),P(r.confirm)):N.error(n("tasks.confirm_failed"))}catch{N.error(n("tasks.confirm_failed"))}},[n]),Y=s.useCallback(()=>{D(null),P(null),C(p)},[C,p]),B=s.useMemo(()=>l.map(e=>({value:e.key,label:e.name})),[l]);return re(null),t.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsx("h1",{className:"sr-only",children:n("plan.title")}),t.jsxs("div",{className:"mb-6 flex flex-col gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:flex-row md:items-center md:gap-3",children:[t.jsx(pe,{value:m,onChange:O,options:B.length>0?B:[{value:"",label:"loading..."}],className:"md:w-44 shrink-0"}),t.jsx("input",{type:"text",placeholder:n("plan.description_placeholder"),value:v,onChange:e=>R(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!T&&K()},className:"flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),t.jsxs("button",{onClick:K,disabled:T||!m||!v.trim(),className:"flex shrink-0 items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-mono text-black transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:[t.jsx(ue,{className:"h-3.5 w-3.5"}),n(T?"common.creating":"plan.create")]})]}),t.jsx("div",{className:"mb-4 flex items-center gap-1 overflow-x-auto pb-1 no-scrollbar",children:["in_progress","completed"].map(e=>t.jsx("button",{onClick:()=>Q(e),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${i===e?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:n(e==="in_progress"?"review.in_progress":"tasks.tab_completed")},e))}),t.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[L&&E.length===0&&t.jsx("div",{className:"p-4",children:t.jsx(ie,{rows:4})}),!L&&E.length===0&&t.jsx(ce,{icon:ae,title:n("plan.no_plans"),description:n("plan.description_placeholder")}),E.map(e=>t.jsxs("div",{onClick:()=>c(`/tasks/${e.id}`),className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[t.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${ve(e.status)}`}),t.jsxs("span",{className:"flex-1 truncate text-xs text-[var(--text-primary)] preserve-case",children:["#",e.id," ",ne(e)]}),e.status===a.SUSPENDED&&H.has(e.id)&&t.jsx("button",{onClick:r=>{r.stopPropagation(),X(e.id)},className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold text-black bg-[var(--warning)] hover:opacity-90 transition-opacity",children:n("tasks.pending_confirmation")}),e.status===a.COMPLETED&&j[e.id]!=null&&j[e.id]>0&&t.jsxs("span",{className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold",style:{color:"#3b82f6",backgroundColor:"rgba(59,130,246,0.12)"},title:`${j[e.id]} downstream task(s)`,children:[j[e.id]," tasks"]}),e.status===a.COMPLETED&&(()=>{const r=V[e.projectKey];if(!r)return null;let S="main";if(e.configSnapshot)try{const d=JSON.parse(e.configSnapshot);d.defaultBranch&&(S=d.defaultBranch)}catch{}const x=he(r,S);return x?t.jsxs("a",{href:x,target:"_blank",rel:"noopener noreferrer",onClick:d=>d.stopPropagation(),className:"shrink-0 flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[10px] text-[var(--text-muted)] hover:text-[var(--info)] hover:border-[var(--info)] transition-colors",title:n("plan.view_spec"),children:[t.jsx(me,{className:"h-2.5 w-2.5"}),n("plan.view_spec")]}):null})(),t.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:e.projectKey}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:e.status.toLowerCase()}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:de(e.createdAt)})]},e.id))]}),(u.length>0||g)&&t.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",W]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:z,disabled:u.length===0,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 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:[t.jsx(xe,{className:"h-3.5 w-3.5"}),n("tasks.prev")]}),t.jsxs("button",{onClick:Z,disabled:!g,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 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:[n("common.next"),t.jsx(fe,{className:"h-3.5 w-3.5"})]})]})]}),M!=null&&h&&t.jsx(le,{isOpen:!0,onClose:()=>{D(null),P(null)},taskId:M,stageName:h.stageName,timeoutSeconds:h.timeout,confirmType:h.confirmType,prompt:h.prompt,onSubmitted:Y})]})}export{Le as default};
@@ -1 +1 @@
1
- import{a as A,u as F,f as T,r as s,j as e,L as z,a6 as I,a7 as $,s as K,h as p,t as c}from"./index-D9synPeJ.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-BxA58xIa.js";import{u as V}from"./useFetch-Dj0ZN58I.js";function Q(){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}=V(()=>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=M(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($,{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.173"]}),e.jsx(K,{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{Q as default};
1
+ import{a as A,u as F,f as T,r as s,j as e,L as z,a6 as I,a7 as $,s as K,h as p,t as c}from"./index-DAwsREkq.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-BCDb21nt.js";import{u as V}from"./useFetch-CgkGfhaP.js";function Q(){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}=V(()=>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=M(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($,{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.175"]}),e.jsx(K,{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{Q as default};
@@ -1,4 +1,4 @@
1
- import{c as R,a as $,j as e,s as q,B,f as K,u as H,i as J,r as x,Z as k,x as V,l as D,_ as Z,h}from"./index-D9synPeJ.js";import{U as P,A as z,R as G}from"./RemoveMemberConfirmDialog-CGzHpvJv.js";import{T as Q}from"./Tooltip-EOsBLsZE.js";import{c as _}from"./date-CmcdoD87.js";import{t as T}from"./status-colors-CRgg1N4i.js";import{I as o}from"./InfoRow-BxA58xIa.js";import{u as X}from"./useFetch-Dj0ZN58I.js";import{P as Y}from"./pencil-DIvX1Xsb.js";import{T as ee}from"./trash-2-Cb5-yglV.js";import{A as te}from"./arrow-left-DolNA3BD.js";import{P as re}from"./plus-9sncIl_N.js";import"./Select-BRJxl1YO.js";import"./chevron-down-Cm4So_5j.js";/**
1
+ import{c as R,a as $,j as e,s as q,B,f as K,u as H,i as J,r as x,Z as k,x as V,l as D,_ as Z,h}from"./index-DAwsREkq.js";import{U as P,A as z,R as G}from"./RemoveMemberConfirmDialog-uFuATit4.js";import{T as Q}from"./Tooltip-Ds3lc4sS.js";import{c as _}from"./date-CmcdoD87.js";import{t as T}from"./status-colors-C14ffr9M.js";import{I as o}from"./InfoRow-BCDb21nt.js";import{u as X}from"./useFetch-CgkGfhaP.js";import{P as Y}from"./pencil-Cxzh8oiw.js";import{T as ee}from"./trash-2-CDhJihtl.js";import{A as te}from"./arrow-left-Czit8jGK.js";import{P as re}from"./plus-DJTaWh3N.js";import"./Select-CC0FnszM.js";import"./chevron-down-DwSdaR46.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 R,a as P,v as G,r as o,I as x,Q as z,j as e,h as E,f as H,x as M}from"./index-D9synPeJ.js";import{S as U}from"./Select-BRJxl1YO.js";import{a as D}from"./agent-type-options-DXKoGpJI.js";import{E as J}from"./EmptyState-CqF5g3iI.js";import{T as O}from"./Skeleton-CkmmCp2B.js";import{t as q}from"./date-CmcdoD87.js";import{u as W}from"./useFetch-Dj0ZN58I.js";import{P as $}from"./plus-9sncIl_N.js";import{A as K}from"./arrow-left-DolNA3BD.js";import"./chevron-down-Cm4So_5j.js";/**
1
+ import{c as R,a as P,v as G,r as o,I as x,Q as z,j as e,h as E,f as H,x as M}from"./index-DAwsREkq.js";import{S as U}from"./Select-CC0FnszM.js";import{a as D}from"./agent-type-options-BTd_pbKQ.js";import{E as J}from"./EmptyState-BpbqIJyG.js";import{T as O}from"./Skeleton-WCDZdltv.js";import{t as q}from"./date-CmcdoD87.js";import{u as W}from"./useFetch-CgkGfhaP.js";import{P as $}from"./plus-DJTaWh3N.js";import{A as K}from"./arrow-left-Czit8jGK.js";import"./chevron-down-DwSdaR46.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
- var Xr=Object.defineProperty;var jr=(e,t,i)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Oe=(e,t,i)=>jr(e,typeof t!="symbol"?t+"":t,i);import{r as Z,u as Gr,h as Jr,j as Mt}from"./index-D9synPeJ.js";/**
1
+ var Xr=Object.defineProperty;var jr=(e,t,i)=>t in e?Xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Oe=(e,t,i)=>jr(e,typeof t!="symbol"?t+"":t,i);import{r as Z,u as Gr,h as Jr,j as Mt}from"./index-DAwsREkq.js";/**
2
2
  * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
3
3
  * @license MIT
4
4
  *
@@ -1 +1 @@
1
- import{a as h,r as s,h as b,a8 as v,j as e,C as j}from"./index-D9synPeJ.js";import{C as f}from"./copy-CHO7AsGy.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,a8 as v,j as e,C as j}from"./index-DAwsREkq.js";import{C as f}from"./copy-_C7txolK.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 R,a as _,v as w,r as a,Z as c,j as e,X as C,h as g,s as D}from"./index-D9synPeJ.js";import{S as N}from"./Select-BRJxl1YO.js";/**
1
+ import{c as R,a as _,v as w,r as a,Z as c,j as e,X as C,h as g,s as D}from"./index-DAwsREkq.js";import{S as N}from"./Select-CC0FnszM.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 xe,B as me,f as ue,a as H,k as pe,r as n,h as L,j as e,L as ve,V as W,Y as be,t as f,o as v,b as ge,Q as he,X as fe}from"./index-D9synPeJ.js";import{P as je}from"./PtyTerminal-Do7JUGQS.js";import{T as Ne}from"./Skeleton-CkmmCp2B.js";import{C as K}from"./Checkbox-BOX6FtEq.js";import{f as we,b as ye}from"./date-CmcdoD87.js";import{a as ke}from"./agent-type-options-DXKoGpJI.js";import{T as G,g as Q}from"./task-constants-BiYtEhWG.js";import{A as Se}from"./arrow-left-DolNA3BD.js";import{L as Ce}from"./loader-circle--EO2iEyc.js";import{P as z}from"./play-BHrAGNju.js";import{S as Te}from"./skip-forward-Q2vmwL9H.js";import{R as Ae}from"./rotate-ccw-Dw8AxO4w.js";import{C as Ee}from"./chevron-up-DVl3qTn3.js";import{C as Re}from"./chevron-down-Cm4So_5j.js";import{C as De}from"./circle-alert-BojCwibr.js";/**
1
+ import{c as xe,B as me,f as ue,a as H,k as pe,r as n,h as L,j as e,L as ve,V as W,Y as be,t as f,o as v,b as ge,Q as he,X as fe}from"./index-DAwsREkq.js";import{P as je}from"./PtyTerminal-QdM0LGge.js";import{T as Ne}from"./Skeleton-WCDZdltv.js";import{C as K}from"./Checkbox-Dsj1BuTd.js";import{f as we,b as ye}from"./date-CmcdoD87.js";import{a as ke}from"./agent-type-options-BTd_pbKQ.js";import{T as G,g as Q}from"./task-constants-DihuKtBw.js";import{A as Se}from"./arrow-left-Czit8jGK.js";import{L as Ce}from"./loader-circle-vH-Hp_AS.js";import{P as z}from"./play-bFi1k4eQ.js";import{S as Te}from"./skip-forward-C71GgwGt.js";import{R as Ae}from"./rotate-ccw-CXFQ7046.js";import{C as Ee}from"./chevron-up-4jZShvn6.js";import{C as Re}from"./chevron-down-DwSdaR46.js";import{C as De}from"./circle-alert-gAYg5DQY.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 w,f as k,k as K,r,x as F,j as e,h as N,o as m,E,l as B,X as T,H,t as y,Q}from"./index-D9synPeJ.js";import{E as D}from"./EmptyState-CqF5g3iI.js";import{T as L}from"./Skeleton-CkmmCp2B.js";import{C as q}from"./Checkbox-BOX6FtEq.js";import{S as C}from"./Select-BRJxl1YO.js";import{f as P}from"./date-CmcdoD87.js";import{T as A}from"./Tooltip-EOsBLsZE.js";import{a as z}from"./agent-type-options-DXKoGpJI.js";import{g as X}from"./task-constants-BiYtEhWG.js";import{P as Z}from"./plus-9sncIl_N.js";import{P as R}from"./play-BHrAGNju.js";import{C as J}from"./chevron-left-Cx2ByqjE.js";import{C as V}from"./chevron-right-D0k7WYYt.js";import"./chevron-down-Cm4So_5j.js";function $(){const[s,i]=r.useState(void 0),[t,o]=r.useState(void 0),[p,c]=r.useState([]),h=r.useRef(void 0),u=r.useRef(void 0);h.current=s,u.current=t;const g=r.useCallback(x=>{i(x)},[]),l=r.useCallback(()=>{const x=h.current;x&&(c(j=>[...j,u.current??""]),o(x))},[]),b=r.useRef([]);b.current=p;const d=r.useCallback(()=>{const x=b.current;x.length!==0&&(o(x.at(-1)||void 0),c(x.slice(0,-1)))},[]),a=p.length+1,n=p.length>0;return{cursor:t,setNextCursor:g,goNext:l,goPrev:d,pageNumber:a,hasPrev:n,hasNext:!!s}}const I=20;function W(s){switch(s){case m.RUNNING:return"bg-[var(--accent)]";case m.QUEUED:return"bg-[var(--warning)]";case m.ASSIGNED:return"bg-[var(--info)]";case m.SUSPENDED:return"bg-[var(--warning)]";case m.COMPLETED:return"bg-[var(--accent)]";case m.FAILED:return"bg-[var(--destructive)]";case m.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}const Y=z(X);function ee({taskId:s,onClose:i,onLaunched:t}){const{t:o}=w(),[p,c]=r.useState([Q.CLAUDE]),[h,u]=r.useState(""),[g,l]=r.useState(!1);function b(a){c(n=>n.includes(a)?n.filter(f=>f!==a):[...n,a])}async function d(){if(p.length===0){y.error("select at least one review agent.");return}l(!0);try{await N.post(`web/tasks/${s}/review`,{json:{agentTypes:p,description:h.trim()||void 0}}),y.success("review launched"),t(),i()}catch(a){const n=a instanceof Error?a.message:String(a);y.error(n)}finally{l(!1)}}return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 font-mono",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-[var(--text-primary)]",children:o("review.launch")}),e.jsx("button",{onClick:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(T,{className:"h-4 w-4"})})]}),e.jsxs("p",{className:"mb-3 text-[11px] text-[var(--text-muted)]",children:["task #",s," — ",o("review.select_agents")]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:Y.map(a=>e.jsx(q,{checked:p.includes(a.value),onCheckedChange:()=>b(a.value),label:a.label,containerClassName:"w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors"},a.value))}),e.jsx("textarea",{value:h,onChange:a=>u(a.target.value),placeholder:o("review.description_placeholder"),rows:3,className:"mb-4 w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:d,disabled:g||p.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(R,{className:"h-3 w-3"}),o(g?"common.processing":"review.launch")]}),e.jsx("button",{onClick:i,className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:o("common.cancel")})]})]})})}function _({pag:s}){const{t:i}=w();return!s.hasPrev&&!s.hasNext?null:e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",s.pageNumber]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:s.goPrev,disabled:!s.hasPrev,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 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(J,{className:"h-3.5 w-3.5"}),i("tasks.prev")]}),e.jsxs("button",{onClick:s.goNext,disabled:!s.hasNext,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 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:[i("common.next"),e.jsx(V,{className:"h-3.5 w-3.5"})]})]})]})}function se({onRefresh:s,projectFilter:i,developerFilter:t}){const{t:o}=w(),p=k(),[c,h]=r.useState([]),[u,g]=r.useState(!0),[l,b]=r.useState(null),d=$(),a=r.useCallback(async n=>{g(!0);try{const f=new Date(Date.now()-6048e5).toISOString(),x=new URLSearchParams({status:m.COMPLETED,taskMode:"develop",reviewStatus:"null",completedAfter:f,limit:String(I)});i&&x.set("projectKey",i),t&&x.set("developerId",t),n&&x.set("cursor",n);const j=await N.get(`web/tasks?${x}`).json();h(j.data??[]),d.setNextCursor(j.nextCursor)}catch{h([]),d.setNextCursor(void 0)}finally{g(!1)}},[i,t]);return r.useEffect(()=>{a(d.cursor)},[a,d.cursor]),u&&c.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&c.length===0&&!d.hasPrev?e.jsx(D,{icon:E,title:o("review.no_reviews"),description:o("review.pending")}):e.jsxs(e.Fragment,{children:[c.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:c.map(n=>e.jsxs("div",{className:"flex flex-col gap-1 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsx(A,{content:n.description,className:"flex-1 min-w-0",children:e.jsxs("span",{className:"cursor-pointer truncate text-xs text-[var(--text-primary)] hover:text-[var(--accent)] transition-colors block preserve-case",onClick:()=>p(`/tasks/${n.id}`),children:["#",n.id," ",B(n)]})}),e.jsx("button",{onClick:async()=>{try{await N.post(`web/tasks/${n.id}/review-status`,{json:{reviewStatus:"dismissed"}}),a(d.cursor)}catch(f){let x="Failed to dismiss";try{if(f instanceof H){const j=await f.response.json();x=(j==null?void 0:j.message)??x}else f instanceof Error&&(x=f.message)}catch{}y.error(x)}},className:"shrink-0 flex items-center rounded-[4px] p-1.5 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":"dismiss",children:e.jsx(T,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{onClick:()=>b(n.id),className:"shrink-0 flex items-center gap-1.5 rounded-[4px] px-3 py-1.5 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(R,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden md:inline",children:o("review.launch_short")})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5 text-[11px] text-[var(--text-muted)] min-w-0",children:[e.jsx("span",{className:"shrink-0",children:P(n.completedAt??n.createdAt)}),e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"shrink-0",children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"truncate",children:n.workerName})]})]})]},n.id))}),e.jsx(_,{pag:d}),l!==null&&e.jsx(ee,{taskId:l,onClose:()=>b(null),onLaunched:()=>{s(),a(d.cursor)}})]})}function te(s){const i=new Map;for(const t of s){const o=t.sourceTaskId??t.id;i.has(o)||i.set(o,[]),i.get(o).push(t)}return Array.from(i.entries()).map(([t,o])=>({sourceTaskId:t,tasks:o}))}function re({group:s,onClick:i}){const t=s.tasks[0],o=s.tasks.every(c=>c.status===m.COMPLETED||c.status===m.FAILED||c.status===m.CANCELLED),p=t==null?void 0:t.sourceCommitSha;return e.jsxs("div",{onClick:i,className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${o?"bg-[var(--accent)]":"bg-[var(--warning)]"}`}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(A,{content:(t==null?void 0:t.sourceTaskDescription)??(t==null?void 0:t.description),className:"truncate",children:e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["source #",s.sourceTaskId]})}),p&&e.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-[var(--accent)]",children:["@",p.slice(0,7)]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.tasks.length," ",s.tasks.length===1?"agent":"agents"," · ",s.tasks.map(c=>(c.agentType??"claude").toLowerCase()).join(", ")]})]}),t&&e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:t.projectKey}),t&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:P(t.createdAt)}),e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.tasks.map(c=>e.jsx("span",{className:`h-2 w-2 rounded-full ${W(c.status)}`,title:c.status.toLowerCase()},c.id))})]})}function S({mode:s,projectFilter:i,developerFilter:t}){const{t:o}=w(),p=k(),[c,h]=r.useState([]),[u,g]=r.useState(!0),l=$(),b=r.useCallback(async d=>{g(!0);try{const a=new URLSearchParams({taskMode:"review",limit:String(I),groupBySource:"true"});s==="in_progress"?a.set("status",[m.QUEUED,m.ASSIGNED,m.RUNNING,m.SUSPENDED].join(",")):a.set("status",[m.COMPLETED,m.FAILED,m.CANCELLED].join(",")),i&&a.set("projectKey",i),t&&a.set("sourceDeveloperId",t),d&&a.set("cursor",d);const n=await N.get(`web/tasks?${a}`).json();h(te(n.data??[])),l.setNextCursor(n.nextCursor??void 0)}catch{h([]),l.setNextCursor(void 0)}finally{g(!1)}},[s,i,t]);return r.useEffect(()=>{b(l.cursor)},[b,l.cursor]),u&&c.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&c.length===0&&!l.hasPrev?e.jsx(D,{icon:E,title:o("review.no_reviews")}):e.jsxs(e.Fragment,{children:[c.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:c.map(d=>e.jsx(re,{group:d,onClick:()=>p(`/review/${d.sourceTaskId}`)},d.sourceTaskId))}),e.jsx(_,{pag:l})]})}function fe(){const{t:s}=w(),i=k(),t=K(v=>v.taskSeq),[o,p]=r.useState("pending"),[c,h]=r.useState(0),[u,g]=r.useState(""),[l,b]=r.useState(""),[d,a]=r.useState([]),[n,f]=r.useState([]);F(null);const x=r.useCallback(()=>h(v=>v+1),[]);r.useEffect(()=>{let v=!1;return(async()=>{try{const[M,G]=await Promise.all([N.get("web/projects").json(),N.get("web/projects/-/developers").json()]);if(v)return;a(M),f(G)}catch{}})(),()=>{v=!0}},[]);const j=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...d.map(v=>({value:v.key,label:v.name}))],[d,s]),O=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...n.map(v=>({value:String(v.id),label:v.name}))],[n,s]),U=[{key:"pending",label:s("review.pending")},{key:"in_progress",label:s("review.in_progress")},{key:"history",label:s("review.history")}];return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("h1",{className:"sr-only",children:s("review.title")}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar",children:[U.map(v=>e.jsx("button",{onClick:()=>p(v.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${o===v.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:v.label},v.key)),e.jsxs("button",{onClick:()=>i("/plan"),className:"shrink-0 flex items-center gap-1 rounded-[4px] px-3 py-2 h-8 text-xs text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:[e.jsx(Z,{className:"h-3 w-3"}),s("plan.title")]})]}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsx(C,{value:u,onChange:g,options:j,className:"md:w-40"}),e.jsx(C,{value:l,onChange:b,options:O,className:"md:w-40"})]})]}),o==="pending"&&e.jsx(se,{onRefresh:x,projectFilter:u,developerFilter:l},`pending-${c}-${t}-${u}-${l}`),o==="in_progress"&&e.jsx(S,{mode:"in_progress",projectFilter:u,developerFilter:l},`inprogress-${c}-${t}-${u}-${l}`),o==="history"&&e.jsx(S,{mode:"history",projectFilter:u,developerFilter:l},`history-${c}-${t}-${u}-${l}`)]})}export{fe as default};
1
+ import{a as w,f as k,k as K,r,x as F,j as e,h as N,o as m,E,l as B,X as T,H,t as y,Q}from"./index-DAwsREkq.js";import{E as D}from"./EmptyState-BpbqIJyG.js";import{T as L}from"./Skeleton-WCDZdltv.js";import{C as q}from"./Checkbox-Dsj1BuTd.js";import{S as C}from"./Select-CC0FnszM.js";import{f as P}from"./date-CmcdoD87.js";import{T as A}from"./Tooltip-Ds3lc4sS.js";import{a as z}from"./agent-type-options-BTd_pbKQ.js";import{g as X}from"./task-constants-DihuKtBw.js";import{P as Z}from"./plus-DJTaWh3N.js";import{P as R}from"./play-bFi1k4eQ.js";import{C as J}from"./chevron-left-DMFdbT8q.js";import{C as V}from"./chevron-right-BqoEBUXc.js";import"./chevron-down-DwSdaR46.js";function $(){const[s,i]=r.useState(void 0),[t,o]=r.useState(void 0),[p,c]=r.useState([]),h=r.useRef(void 0),u=r.useRef(void 0);h.current=s,u.current=t;const g=r.useCallback(x=>{i(x)},[]),l=r.useCallback(()=>{const x=h.current;x&&(c(j=>[...j,u.current??""]),o(x))},[]),b=r.useRef([]);b.current=p;const d=r.useCallback(()=>{const x=b.current;x.length!==0&&(o(x.at(-1)||void 0),c(x.slice(0,-1)))},[]),a=p.length+1,n=p.length>0;return{cursor:t,setNextCursor:g,goNext:l,goPrev:d,pageNumber:a,hasPrev:n,hasNext:!!s}}const I=20;function W(s){switch(s){case m.RUNNING:return"bg-[var(--accent)]";case m.QUEUED:return"bg-[var(--warning)]";case m.ASSIGNED:return"bg-[var(--info)]";case m.SUSPENDED:return"bg-[var(--warning)]";case m.COMPLETED:return"bg-[var(--accent)]";case m.FAILED:return"bg-[var(--destructive)]";case m.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}const Y=z(X);function ee({taskId:s,onClose:i,onLaunched:t}){const{t:o}=w(),[p,c]=r.useState([Q.CLAUDE]),[h,u]=r.useState(""),[g,l]=r.useState(!1);function b(a){c(n=>n.includes(a)?n.filter(f=>f!==a):[...n,a])}async function d(){if(p.length===0){y.error("select at least one review agent.");return}l(!0);try{await N.post(`web/tasks/${s}/review`,{json:{agentTypes:p,description:h.trim()||void 0}}),y.success("review launched"),t(),i()}catch(a){const n=a instanceof Error?a.message:String(a);y.error(n)}finally{l(!1)}}return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 font-mono",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-[var(--text-primary)]",children:o("review.launch")}),e.jsx("button",{onClick:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(T,{className:"h-4 w-4"})})]}),e.jsxs("p",{className:"mb-3 text-[11px] text-[var(--text-muted)]",children:["task #",s," — ",o("review.select_agents")]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:Y.map(a=>e.jsx(q,{checked:p.includes(a.value),onCheckedChange:()=>b(a.value),label:a.label,containerClassName:"w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors"},a.value))}),e.jsx("textarea",{value:h,onChange:a=>u(a.target.value),placeholder:o("review.description_placeholder"),rows:3,className:"mb-4 w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:d,disabled:g||p.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(R,{className:"h-3 w-3"}),o(g?"common.processing":"review.launch")]}),e.jsx("button",{onClick:i,className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:o("common.cancel")})]})]})})}function _({pag:s}){const{t:i}=w();return!s.hasPrev&&!s.hasNext?null:e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",s.pageNumber]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:s.goPrev,disabled:!s.hasPrev,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 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(J,{className:"h-3.5 w-3.5"}),i("tasks.prev")]}),e.jsxs("button",{onClick:s.goNext,disabled:!s.hasNext,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 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:[i("common.next"),e.jsx(V,{className:"h-3.5 w-3.5"})]})]})]})}function se({onRefresh:s,projectFilter:i,developerFilter:t}){const{t:o}=w(),p=k(),[c,h]=r.useState([]),[u,g]=r.useState(!0),[l,b]=r.useState(null),d=$(),a=r.useCallback(async n=>{g(!0);try{const f=new Date(Date.now()-6048e5).toISOString(),x=new URLSearchParams({status:m.COMPLETED,taskMode:"develop",reviewStatus:"null",completedAfter:f,limit:String(I)});i&&x.set("projectKey",i),t&&x.set("developerId",t),n&&x.set("cursor",n);const j=await N.get(`web/tasks?${x}`).json();h(j.data??[]),d.setNextCursor(j.nextCursor)}catch{h([]),d.setNextCursor(void 0)}finally{g(!1)}},[i,t]);return r.useEffect(()=>{a(d.cursor)},[a,d.cursor]),u&&c.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&c.length===0&&!d.hasPrev?e.jsx(D,{icon:E,title:o("review.no_reviews"),description:o("review.pending")}):e.jsxs(e.Fragment,{children:[c.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:c.map(n=>e.jsxs("div",{className:"flex flex-col gap-1 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsx(A,{content:n.description,className:"flex-1 min-w-0",children:e.jsxs("span",{className:"cursor-pointer truncate text-xs text-[var(--text-primary)] hover:text-[var(--accent)] transition-colors block preserve-case",onClick:()=>p(`/tasks/${n.id}`),children:["#",n.id," ",B(n)]})}),e.jsx("button",{onClick:async()=>{try{await N.post(`web/tasks/${n.id}/review-status`,{json:{reviewStatus:"dismissed"}}),a(d.cursor)}catch(f){let x="Failed to dismiss";try{if(f instanceof H){const j=await f.response.json();x=(j==null?void 0:j.message)??x}else f instanceof Error&&(x=f.message)}catch{}y.error(x)}},className:"shrink-0 flex items-center rounded-[4px] p-1.5 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":"dismiss",children:e.jsx(T,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{onClick:()=>b(n.id),className:"shrink-0 flex items-center gap-1.5 rounded-[4px] px-3 py-1.5 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(R,{className:"h-3 w-3"}),e.jsx("span",{className:"hidden md:inline",children:o("review.launch_short")})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5 text-[11px] text-[var(--text-muted)] min-w-0",children:[e.jsx("span",{className:"shrink-0",children:P(n.completedAt??n.createdAt)}),e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"shrink-0",children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"truncate",children:n.workerName})]})]})]},n.id))}),e.jsx(_,{pag:d}),l!==null&&e.jsx(ee,{taskId:l,onClose:()=>b(null),onLaunched:()=>{s(),a(d.cursor)}})]})}function te(s){const i=new Map;for(const t of s){const o=t.sourceTaskId??t.id;i.has(o)||i.set(o,[]),i.get(o).push(t)}return Array.from(i.entries()).map(([t,o])=>({sourceTaskId:t,tasks:o}))}function re({group:s,onClick:i}){const t=s.tasks[0],o=s.tasks.every(c=>c.status===m.COMPLETED||c.status===m.FAILED||c.status===m.CANCELLED),p=t==null?void 0:t.sourceCommitSha;return e.jsxs("div",{onClick:i,className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${o?"bg-[var(--accent)]":"bg-[var(--warning)]"}`}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(A,{content:(t==null?void 0:t.sourceTaskDescription)??(t==null?void 0:t.description),className:"truncate",children:e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["source #",s.sourceTaskId]})}),p&&e.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-[var(--accent)]",children:["@",p.slice(0,7)]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.tasks.length," ",s.tasks.length===1?"agent":"agents"," · ",s.tasks.map(c=>(c.agentType??"claude").toLowerCase()).join(", ")]})]}),t&&e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:t.projectKey}),t&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:P(t.createdAt)}),e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.tasks.map(c=>e.jsx("span",{className:`h-2 w-2 rounded-full ${W(c.status)}`,title:c.status.toLowerCase()},c.id))})]})}function S({mode:s,projectFilter:i,developerFilter:t}){const{t:o}=w(),p=k(),[c,h]=r.useState([]),[u,g]=r.useState(!0),l=$(),b=r.useCallback(async d=>{g(!0);try{const a=new URLSearchParams({taskMode:"review",limit:String(I),groupBySource:"true"});s==="in_progress"?a.set("status",[m.QUEUED,m.ASSIGNED,m.RUNNING,m.SUSPENDED].join(",")):a.set("status",[m.COMPLETED,m.FAILED,m.CANCELLED].join(",")),i&&a.set("projectKey",i),t&&a.set("sourceDeveloperId",t),d&&a.set("cursor",d);const n=await N.get(`web/tasks?${a}`).json();h(te(n.data??[])),l.setNextCursor(n.nextCursor??void 0)}catch{h([]),l.setNextCursor(void 0)}finally{g(!1)}},[s,i,t]);return r.useEffect(()=>{b(l.cursor)},[b,l.cursor]),u&&c.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&c.length===0&&!l.hasPrev?e.jsx(D,{icon:E,title:o("review.no_reviews")}):e.jsxs(e.Fragment,{children:[c.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:c.map(d=>e.jsx(re,{group:d,onClick:()=>p(`/review/${d.sourceTaskId}`)},d.sourceTaskId))}),e.jsx(_,{pag:l})]})}function fe(){const{t:s}=w(),i=k(),t=K(v=>v.taskSeq),[o,p]=r.useState("pending"),[c,h]=r.useState(0),[u,g]=r.useState(""),[l,b]=r.useState(""),[d,a]=r.useState([]),[n,f]=r.useState([]);F(null);const x=r.useCallback(()=>h(v=>v+1),[]);r.useEffect(()=>{let v=!1;return(async()=>{try{const[M,G]=await Promise.all([N.get("web/projects").json(),N.get("web/projects/-/developers").json()]);if(v)return;a(M),f(G)}catch{}})(),()=>{v=!0}},[]);const j=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...d.map(v=>({value:v.key,label:v.name}))],[d,s]),O=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...n.map(v=>({value:String(v.id),label:v.name}))],[n,s]),U=[{key:"pending",label:s("review.pending")},{key:"in_progress",label:s("review.in_progress")},{key:"history",label:s("review.history")}];return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("h1",{className:"sr-only",children:s("review.title")}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar",children:[U.map(v=>e.jsx("button",{onClick:()=>p(v.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${o===v.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:v.label},v.key)),e.jsxs("button",{onClick:()=>i("/plan"),className:"shrink-0 flex items-center gap-1 rounded-[4px] px-3 py-2 h-8 text-xs text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:[e.jsx(Z,{className:"h-3 w-3"}),s("plan.title")]})]}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsx(C,{value:u,onChange:g,options:j,className:"md:w-40"}),e.jsx(C,{value:l,onChange:b,options:O,className:"md:w-40"})]})]}),o==="pending"&&e.jsx(se,{onRefresh:x,projectFilter:u,developerFilter:l},`pending-${c}-${t}-${u}-${l}`),o==="in_progress"&&e.jsx(S,{mode:"in_progress",projectFilter:u,developerFilter:l},`inprogress-${c}-${t}-${u}-${l}`),o==="history"&&e.jsx(S,{mode:"history",projectFilter:u,developerFilter:l},`history-${c}-${t}-${u}-${l}`)]})}export{fe as default};
@@ -1 +1 @@
1
- import{r as l,j as t}from"./index-D9synPeJ.js";import{C as f}from"./chevron-down-Cm4So_5j.js";function h({value:r,onChange:x,options:c,placeholder:u,disabled:n=!1,className:m=""}){var i;const[a,o]=l.useState(!1),s=l.useRef(null),d=((i=c.find(e=>e.value===r))==null?void 0:i.label)??u??"";return l.useEffect(()=>{function e(v){s.current&&!s.current.contains(v.target)&&o(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.jsxs("div",{ref:s,className:`relative ${m}`,children:[t.jsxs("button",{type:"button",disabled:n,onClick:()=>!n&&o(!a),"aria-expanded":a,"aria-haspopup":"listbox",className:`flex w-full items-center justify-between rounded-[4px] border bg-[var(--bg-input)] px-3 py-2 font-mono text-xs outline-none transition-colors ${a?"border-[var(--accent)] text-[var(--text-primary)]":"border-[var(--border)] text-[var(--text-primary)] hover:border-[var(--text-muted)]"} ${n?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[t.jsx("span",{className:r?"":"text-[var(--text-muted)]",children:d}),t.jsx(f,{size:12,className:`ml-2 shrink-0 text-[var(--text-muted)] transition-transform ${a?"rotate-180":""}`})]}),a&&t.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-1 max-h-48 min-w-full w-max max-w-[calc(100vw-2rem)] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] py-1 shadow-lg",children:c.map(e=>t.jsxs("button",{type:"button",role:"option","aria-selected":e.value===r,onClick:()=>{x(e.value),o(!1)},className:`flex w-full items-center px-3 py-1.5 text-left font-mono text-xs transition-colors ${e.value===r?"bg-[var(--accent)]/10 text-[var(--accent)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.value===r&&t.jsx("span",{className:"mr-2 text-[var(--accent)]",children:">"}),e.label]},e.value))})]})}export{h as S};
1
+ import{r as l,j as t}from"./index-DAwsREkq.js";import{C as f}from"./chevron-down-DwSdaR46.js";function h({value:r,onChange:x,options:c,placeholder:u,disabled:n=!1,className:m=""}){var i;const[a,o]=l.useState(!1),s=l.useRef(null),d=((i=c.find(e=>e.value===r))==null?void 0:i.label)??u??"";return l.useEffect(()=>{function e(v){s.current&&!s.current.contains(v.target)&&o(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.jsxs("div",{ref:s,className:`relative ${m}`,children:[t.jsxs("button",{type:"button",disabled:n,onClick:()=>!n&&o(!a),"aria-expanded":a,"aria-haspopup":"listbox",className:`flex w-full items-center justify-between rounded-[4px] border bg-[var(--bg-input)] px-3 py-2 font-mono text-xs outline-none transition-colors ${a?"border-[var(--accent)] text-[var(--text-primary)]":"border-[var(--border)] text-[var(--text-primary)] hover:border-[var(--text-muted)]"} ${n?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[t.jsx("span",{className:r?"":"text-[var(--text-muted)]",children:d}),t.jsx(f,{size:12,className:`ml-2 shrink-0 text-[var(--text-muted)] transition-transform ${a?"rotate-180":""}`})]}),a&&t.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-1 max-h-48 min-w-full w-max max-w-[calc(100vw-2rem)] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] py-1 shadow-lg",children:c.map(e=>t.jsxs("button",{type:"button",role:"option","aria-selected":e.value===r,onClick:()=>{x(e.value),o(!1)},className:`flex w-full items-center px-3 py-1.5 text-left font-mono text-xs transition-colors ${e.value===r?"bg-[var(--accent)]/10 text-[var(--accent)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.value===r&&t.jsx("span",{className:"mr-2 text-[var(--accent)]",children:">"}),e.label]},e.value))})]})}export{h as S};
@@ -1,4 +1,4 @@
1
- import{c as h,a as v,r,j as e,h as m,t as u}from"./index-D9synPeJ.js";/**
1
+ import{c as h,a as v,r,j as e,h as m,t as u}from"./index-DAwsREkq.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-D9synPeJ.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-DAwsREkq.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-D9synPeJ.js";import{I as c,C as r}from"./DocsPrimitives-BzVDx2cs.js";import{E as n}from"./external-link-lvF-co6-.js";import"./copy-CHO7AsGy.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-DAwsREkq.js";import{I as c,C as r}from"./DocsPrimitives-Bv8TQpkc.js";import{E as n}from"./external-link-DGEar13h.js";import"./copy-_C7txolK.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 xe,a as de,r as n,A as R,h as f,j as e,H as Kt,t as $,s as Ee,B as Wt,f as Ht,F as Xt,p as Jt,q as Vt,k as mt,o as k,R as Qt,L as ie,l as pt,m as Yt,X as Ce,y as Zt,U as es,G as ut,b as ts,I as Ct,J as ss}from"./index-D9synPeJ.js";import{u as as}from"./task.store-Ds-1t2to.js";import{P as ht}from"./PtyTerminal-Do7JUGQS.js";import{C as ft}from"./ConfirmStageDialog-BtyVYk27.js";import{C as oe}from"./Checkbox-BOX6FtEq.js";import{S as vt}from"./Select-BRJxl1YO.js";import{b as rs,f as Y,c as ns}from"./date-CmcdoD87.js";import{a as St}from"./status-colors-CRgg1N4i.js";import{g as ls,H as cs}from"./task-agent-KZdZD5cO.js";import{a as gt}from"./agent-type-options-DXKoGpJI.js";import{T as is,g as Z}from"./task-constants-BiYtEhWG.js";import{T as os}from"./Tooltip-EOsBLsZE.js";import{A as xs}from"./arrow-left-DolNA3BD.js";import{R as Et}from"./rotate-ccw-Dw8AxO4w.js";import{G as ds}from"./git-fork-DRlvwKYI.js";import{P as bt}from"./play-BHrAGNju.js";import{E as jt}from"./external-link-lvF-co6-.js";import{L as Tt}from"./loader-circle--EO2iEyc.js";import{S as ms}from"./skip-forward-Q2vmwL9H.js";import"./clock-DQeHdtoa.js";import"./chevron-down-Cm4So_5j.js";/**
1
+ import{c as xe,a as de,r as n,A as R,h as f,j as e,H as Kt,t as $,s as Ee,B as Wt,f as Ht,F as Xt,p as Jt,q as Vt,k as mt,o as k,R as Qt,L as ie,l as pt,m as Yt,X as Ce,y as Zt,U as es,G as ut,b as ts,I as Ct,J as ss}from"./index-DAwsREkq.js";import{u as as}from"./task.store-MpV9TV7z.js";import{P as ht}from"./PtyTerminal-QdM0LGge.js";import{C as ft}from"./ConfirmStageDialog-BUTA9YZ1.js";import{C as oe}from"./Checkbox-Dsj1BuTd.js";import{S as vt}from"./Select-CC0FnszM.js";import{b as rs,f as Y,c as ns}from"./date-CmcdoD87.js";import{a as St}from"./status-colors-C14ffr9M.js";import{g as ls,H as cs}from"./task-agent-BasiQZ0L.js";import{a as gt}from"./agent-type-options-BTd_pbKQ.js";import{T as is,g as Z}from"./task-constants-DihuKtBw.js";import{T as os}from"./Tooltip-Ds3lc4sS.js";import{A as xs}from"./arrow-left-Czit8jGK.js";import{R as Et}from"./rotate-ccw-CXFQ7046.js";import{G as ds}from"./git-fork-bd2vu3ng.js";import{P as bt}from"./play-bFi1k4eQ.js";import{E as jt}from"./external-link-DGEar13h.js";import{L as Tt}from"./loader-circle-vH-Hp_AS.js";import{S as ms}from"./skip-forward-C71GgwGt.js";import"./clock-Bn8CRcdc.js";import"./chevron-down-DwSdaR46.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{j as e}from"./index-D9synPeJ.js";import{a as s}from"./DocsPrimitives-BzVDx2cs.js";import"./copy-CHO7AsGy.js";const a=`ov task create -d "implement oauth login" -p WEB -t feat
1
+ import{j as e}from"./index-DAwsREkq.js";import{a as s}from"./DocsPrimitives-Bv8TQpkc.js";import"./copy-_C7txolK.js";const a=`ov task create -d "implement oauth login" -p WEB -t feat
2
2
  ov task plan -d "design auth system" -p WEB
3
3
  ov task review 42 --agent codex,cursor
4
4
  ov task fork 42 -d "retry with a simpler approach"`,r=`develop "implement oauth login" --project WEB --type feat
@@ -1 +1 @@
1
- import{R as he,f as W,a as $,o as u,j as e,l as se,u as fe,i as ge,v as re,r,h as A,X as ye,k as je,w as M,x as ke,H as Ne,t as X,y as Ce,z as Y,m as we}from"./index-D9synPeJ.js";import{u as Z}from"./task.store-Ds-1t2to.js";import{T as ae}from"./TaskStatusBadge-BldGSOah.js";import{f as oe}from"./date-CmcdoD87.js";import{T as Se}from"./Tooltip-EOsBLsZE.js";import{G as ne}from"./git-fork-DRlvwKYI.js";import{S}from"./Select-BRJxl1YO.js";import{a as _e}from"./task-constants-BiYtEhWG.js";import{g as Te}from"./agent-type-options-DXKoGpJI.js";import{C as Ee}from"./copy-CHO7AsGy.js";import{E as ee}from"./EmptyState-CqF5g3iI.js";import{T as te}from"./Skeleton-CkmmCp2B.js";import{P as Pe}from"./plus-9sncIl_N.js";import{C as Fe}from"./chevron-left-Cx2ByqjE.js";import{C as Ae}from"./chevron-right-D0k7WYYt.js";import"./status-colors-CRgg1N4i.js";import"./chevron-down-Cm4So_5j.js";const De=he.memo(function({task:s}){const d=W(),{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)] preserve-case",children:e.jsx(Se,{content:s.description,children:se(s)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(ae,{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:[oe(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(ne,{className:"h-3 w-3"})})]})})]})});function Ie({isOpen:o,onClose:s,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:a}=$();fe(n=>n.user);const b=ge();re(o);const[p,O]=r.useState(""),[v,R]=r.useState(""),[y,B]=r.useState("feat"),[m,D]=r.useState(""),[N,_]=r.useState(""),[h,T]=r.useState(""),[j,E]=r.useState(""),[f,k]=r.useState(""),[K,H]=r.useState([]),[I,C]=r.useState(""),L=d.find(n=>n.key===p),z=Te(n=>n,L==null?void 0:L.agentType);r.useEffect(()=>{if(!o||(O(""),R(""),B("feat"),D(""),_(""),T(""),E(""),k(""),C(""),!b))return;const n=new AbortController;return A.get("admin/developers",{signal:n.signal}).json().then(H).catch(()=>{}),()=>n.abort()},[o,b]);async function P(n){if(n.preventDefault(),C(""),!p||!v.trim()){C(a("tasks.project_and_description_required"));return}try{await x({projectKey:p,description:v.trim(),workerId:j||void 0,developerId:f?Number(f):void 0,taskType:y,branchSlug:N.trim()||void 0,agentType:m||void 0,targetBranch:h.trim()||void 0})}catch(w){const J=w instanceof Error?w.message:a("tasks.failed_to_create_task");C(J)}}return o?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))"},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:n=>n.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(ye,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:P,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(S,{value:p,onChange:O,options:d.map(n=>({value:n.key,label:n.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(S,{value:y,onChange:B,options:_e})]}),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(S,{value:m,onChange:D,options:z})]}),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:v,onChange:n=>R(n.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:j,onChange:n=>E(n.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:N,onChange:n=>_(n.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:h,onChange:n=>T(n.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(S,{value:f,onChange:k,options:K.map(n=>({value:String(n.id),label:n.name})),placeholder:a("tasks.select_developer")})]}),I&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:I})]}),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||!v.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 Le({isOpen:o,onClose:s,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:a}=$();return re(o),!x||!o?null:e.jsx("div",{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(Ee,{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 Me({task:o}){const s=W(),d=o.status===u.COMPLETED||o.status===u.FAILED||o.status===u.CANCELLED;return e.jsxs("div",{onClick:()=>s(`/tasks/${o.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 preserve-case",title:we(o),children:["#",o.id," ",se(o)]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),s(`/tasks/${o.id}?action=fork`)},className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:e.jsx(ne,{className:"h-3 w-3"})}),e.jsx(ae,{status:o.status})]})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:oe(o.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:o.projectKey}),o.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:o.workerName})]})]})]})}const Oe=[{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"}],Re=20;function st(){const o=W(),{t:s}=$(),{tasks:d,loading:c,fetchTasks:x}=Z(),i=je(t=>t.taskSeq),[a,b]=r.useState("all"),[p,O]=r.useState(M.DEVELOP),[v,R]=r.useState(""),[y,B]=r.useState(""),[m,D]=r.useState(""),[N,_]=r.useState(void 0),[h,T]=r.useState([]),j=Z(t=>t.nextCursor),[E,f]=r.useState(!1);ke(r.useMemo(()=>e.jsxs("button",{onClick:()=>f(!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(Pe,{className:"h-3.5 w-3.5"}),s("tasks.new_task")]}),[s]));const[k,K]=r.useState([]),[H,I]=r.useState(!1),[C,L]=r.useState([]),[z,P]=r.useState(!1),[n,w]=r.useState(!1),[J,le]=r.useState(null),[U,q]=r.useState(null),G=r.useCallback(t=>{const l={limit:String(Re)};return p&&(l.taskMode=p),a!=="all"&&(l.status=a),v&&(l.projectKey=v),y&&(l.developerId=y),t&&(l.cursor=t),l},[a,p,v,y]);r.useEffect(()=>{x(G(N))},[G,N,x,i]),r.useEffect(()=>{_(void 0),T([])},[a,p,v,y]),r.useEffect(()=>{let t=!1;return(async()=>{try{const[g,be]=await Promise.all([A.get("web/projects").json(),A.get("web/projects/-/developers").json()]);if(t)return;K(g),L(be)}catch{}})(),()=>{t=!0}},[]),r.useEffect(()=>{if(!E||k.length>0)return;I(!0);let t=!1;return(async()=>{try{const g=await A.get("web/projects").json();t||K(g)}catch{}finally{t||I(!1)}})(),()=>{t=!0}},[E,k.length]);const ce=r.useCallback(async t=>{P(!0);try{const l=await A.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();f(!1),o(`/tasks/${l.task.id}`)}catch(l){if(l instanceof Ne&&l.response.status===409){try{const g=await l.response.json();if(g.confirmRequired){le({id:g.confirmRequired.taskId,description:g.confirmRequired.message,status:"active"}),q(t),f(!1),w(!0);return}}catch{}X.error(s("tasks.similar_task_exists"))}else{const g=l instanceof Error?l.message:String(l);X.error(g)}}finally{P(!1)}},[o]),ie=r.useCallback(async()=>{if(U){P(!0);try{const t=await A.post("web/tasks",{json:{...U,force:!0}}).json();w(!1),q(null),o(`/tasks/${t.task.id}`)}finally{P(!1)}}},[U,o]),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]),de=r.useCallback(()=>{j&&(T(t=>[...t,N??""]),_(j))},[j,N]),xe=r.useCallback(()=>{h.length!==0&&(_(h.at(-1)||void 0),T(t=>t.slice(0,-1)))},[h]),pe=h.length+1,me=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...k.map(t=>({value:t.key,label:t.name}))],[k,s]),ue=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...C.map(t=>({value:String(t.id),label:t.name}))],[C,s]),ve=r.useMemo(()=>[{value:"",label:s("tasks.filter_mode")},{value:M.DEVELOP,label:s("tasks.mode_develop")},{value:M.PLAN,label:s("tasks.mode_plan")},{value:M.REVIEW,label:s("tasks.mode_review")},{value:M.AUTOMATION,label:s("tasks.mode_automation")}],[s]),Q=s(m?"tasks.try_adjusting_search":"tasks.create_first_task"),V=m?void 0:e.jsx("button",{onClick:()=>f(!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:Oe.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(Ce,{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=>D(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:()=>D(""),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(S,{value:p,onChange:O,options:ve,className:"md:w-36"}),e.jsx(S,{value:v,onChange:R,options:me,className:"md:w-40"}),e.jsx(S,{value:y,onChange:B,options:ue,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(te,{rows:5})})}),!c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(ee,{icon:Y,title:s("tasks.no_tasks_found"),description:Q,action:V})})}),F.map(t=>e.jsx(De,{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(te,{rows:5})}),!c&&F.length===0&&e.jsx(ee,{icon:Y,title:s("tasks.no_tasks_found"),description:Q,action:V}),F.map(t=>e.jsx(Me,{task:t},t.id))]}),(h.length>0||j)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",pe]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:xe,disabled:h.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(Fe,{className:"h-3.5 w-3.5"}),s("tasks.prev")]}),e.jsxs("button",{onClick:de,disabled:!j,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(Ae,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(Ie,{isOpen:E,onClose:()=>f(!1),projects:k,projectsLoading:H,onSubmit:ce,isSubmitting:z}),e.jsx(Le,{isOpen:n,onClose:()=>{w(!1),q(null)},onForceCreate:ie,onViewExisting:t=>{w(!1),q(null),o(`/tasks/${t}`)},similarTask:J,isLoading:z})]})}export{st as default};
1
+ import{R as he,f as W,a as $,o as u,j as e,l as se,u as fe,i as ge,v as re,r,h as A,X as ye,k as je,w as M,x as ke,H as Ne,t as X,y as Ce,z as Y,m as we}from"./index-DAwsREkq.js";import{u as Z}from"./task.store-MpV9TV7z.js";import{T as ae}from"./TaskStatusBadge-CzUIb3QQ.js";import{f as oe}from"./date-CmcdoD87.js";import{T as Se}from"./Tooltip-Ds3lc4sS.js";import{G as ne}from"./git-fork-bd2vu3ng.js";import{S}from"./Select-CC0FnszM.js";import{a as _e}from"./task-constants-DihuKtBw.js";import{g as Te}from"./agent-type-options-BTd_pbKQ.js";import{C as Ee}from"./copy-_C7txolK.js";import{E as ee}from"./EmptyState-BpbqIJyG.js";import{T as te}from"./Skeleton-WCDZdltv.js";import{P as Pe}from"./plus-DJTaWh3N.js";import{C as Fe}from"./chevron-left-DMFdbT8q.js";import{C as Ae}from"./chevron-right-BqoEBUXc.js";import"./status-colors-C14ffr9M.js";import"./chevron-down-DwSdaR46.js";const De=he.memo(function({task:s}){const d=W(),{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)] preserve-case",children:e.jsx(Se,{content:s.description,children:se(s)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(ae,{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:[oe(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(ne,{className:"h-3 w-3"})})]})})]})});function Ie({isOpen:o,onClose:s,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:a}=$();fe(n=>n.user);const b=ge();re(o);const[p,O]=r.useState(""),[v,R]=r.useState(""),[y,B]=r.useState("feat"),[m,D]=r.useState(""),[N,_]=r.useState(""),[h,T]=r.useState(""),[j,E]=r.useState(""),[f,k]=r.useState(""),[K,H]=r.useState([]),[I,C]=r.useState(""),L=d.find(n=>n.key===p),z=Te(n=>n,L==null?void 0:L.agentType);r.useEffect(()=>{if(!o||(O(""),R(""),B("feat"),D(""),_(""),T(""),E(""),k(""),C(""),!b))return;const n=new AbortController;return A.get("admin/developers",{signal:n.signal}).json().then(H).catch(()=>{}),()=>n.abort()},[o,b]);async function P(n){if(n.preventDefault(),C(""),!p||!v.trim()){C(a("tasks.project_and_description_required"));return}try{await x({projectKey:p,description:v.trim(),workerId:j||void 0,developerId:f?Number(f):void 0,taskType:y,branchSlug:N.trim()||void 0,agentType:m||void 0,targetBranch:h.trim()||void 0})}catch(w){const J=w instanceof Error?w.message:a("tasks.failed_to_create_task");C(J)}}return o?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))"},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:n=>n.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(ye,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:P,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(S,{value:p,onChange:O,options:d.map(n=>({value:n.key,label:n.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(S,{value:y,onChange:B,options:_e})]}),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(S,{value:m,onChange:D,options:z})]}),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:v,onChange:n=>R(n.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:j,onChange:n=>E(n.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:N,onChange:n=>_(n.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:h,onChange:n=>T(n.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(S,{value:f,onChange:k,options:K.map(n=>({value:String(n.id),label:n.name})),placeholder:a("tasks.select_developer")})]}),I&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:I})]}),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||!v.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 Le({isOpen:o,onClose:s,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:a}=$();return re(o),!x||!o?null:e.jsx("div",{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(Ee,{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 Me({task:o}){const s=W(),d=o.status===u.COMPLETED||o.status===u.FAILED||o.status===u.CANCELLED;return e.jsxs("div",{onClick:()=>s(`/tasks/${o.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 preserve-case",title:we(o),children:["#",o.id," ",se(o)]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),s(`/tasks/${o.id}?action=fork`)},className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:e.jsx(ne,{className:"h-3 w-3"})}),e.jsx(ae,{status:o.status})]})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:oe(o.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:o.projectKey}),o.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:o.workerName})]})]})]})}const Oe=[{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"}],Re=20;function st(){const o=W(),{t:s}=$(),{tasks:d,loading:c,fetchTasks:x}=Z(),i=je(t=>t.taskSeq),[a,b]=r.useState("all"),[p,O]=r.useState(M.DEVELOP),[v,R]=r.useState(""),[y,B]=r.useState(""),[m,D]=r.useState(""),[N,_]=r.useState(void 0),[h,T]=r.useState([]),j=Z(t=>t.nextCursor),[E,f]=r.useState(!1);ke(r.useMemo(()=>e.jsxs("button",{onClick:()=>f(!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(Pe,{className:"h-3.5 w-3.5"}),s("tasks.new_task")]}),[s]));const[k,K]=r.useState([]),[H,I]=r.useState(!1),[C,L]=r.useState([]),[z,P]=r.useState(!1),[n,w]=r.useState(!1),[J,le]=r.useState(null),[U,q]=r.useState(null),G=r.useCallback(t=>{const l={limit:String(Re)};return p&&(l.taskMode=p),a!=="all"&&(l.status=a),v&&(l.projectKey=v),y&&(l.developerId=y),t&&(l.cursor=t),l},[a,p,v,y]);r.useEffect(()=>{x(G(N))},[G,N,x,i]),r.useEffect(()=>{_(void 0),T([])},[a,p,v,y]),r.useEffect(()=>{let t=!1;return(async()=>{try{const[g,be]=await Promise.all([A.get("web/projects").json(),A.get("web/projects/-/developers").json()]);if(t)return;K(g),L(be)}catch{}})(),()=>{t=!0}},[]),r.useEffect(()=>{if(!E||k.length>0)return;I(!0);let t=!1;return(async()=>{try{const g=await A.get("web/projects").json();t||K(g)}catch{}finally{t||I(!1)}})(),()=>{t=!0}},[E,k.length]);const ce=r.useCallback(async t=>{P(!0);try{const l=await A.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();f(!1),o(`/tasks/${l.task.id}`)}catch(l){if(l instanceof Ne&&l.response.status===409){try{const g=await l.response.json();if(g.confirmRequired){le({id:g.confirmRequired.taskId,description:g.confirmRequired.message,status:"active"}),q(t),f(!1),w(!0);return}}catch{}X.error(s("tasks.similar_task_exists"))}else{const g=l instanceof Error?l.message:String(l);X.error(g)}}finally{P(!1)}},[o]),ie=r.useCallback(async()=>{if(U){P(!0);try{const t=await A.post("web/tasks",{json:{...U,force:!0}}).json();w(!1),q(null),o(`/tasks/${t.task.id}`)}finally{P(!1)}}},[U,o]),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]),de=r.useCallback(()=>{j&&(T(t=>[...t,N??""]),_(j))},[j,N]),xe=r.useCallback(()=>{h.length!==0&&(_(h.at(-1)||void 0),T(t=>t.slice(0,-1)))},[h]),pe=h.length+1,me=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...k.map(t=>({value:t.key,label:t.name}))],[k,s]),ue=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...C.map(t=>({value:String(t.id),label:t.name}))],[C,s]),ve=r.useMemo(()=>[{value:"",label:s("tasks.filter_mode")},{value:M.DEVELOP,label:s("tasks.mode_develop")},{value:M.PLAN,label:s("tasks.mode_plan")},{value:M.REVIEW,label:s("tasks.mode_review")},{value:M.AUTOMATION,label:s("tasks.mode_automation")}],[s]),Q=s(m?"tasks.try_adjusting_search":"tasks.create_first_task"),V=m?void 0:e.jsx("button",{onClick:()=>f(!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:Oe.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(Ce,{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=>D(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:()=>D(""),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(S,{value:p,onChange:O,options:ve,className:"md:w-36"}),e.jsx(S,{value:v,onChange:R,options:me,className:"md:w-40"}),e.jsx(S,{value:y,onChange:B,options:ue,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(te,{rows:5})})}),!c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(ee,{icon:Y,title:s("tasks.no_tasks_found"),description:Q,action:V})})}),F.map(t=>e.jsx(De,{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(te,{rows:5})}),!c&&F.length===0&&e.jsx(ee,{icon:Y,title:s("tasks.no_tasks_found"),description:Q,action:V}),F.map(t=>e.jsx(Me,{task:t},t.id))]}),(h.length>0||j)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",pe]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:xe,disabled:h.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(Fe,{className:"h-3.5 w-3.5"}),s("tasks.prev")]}),e.jsxs("button",{onClick:de,disabled:!j,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(Ae,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(Ie,{isOpen:E,onClose:()=>f(!1),projects:k,projectsLoading:H,onSubmit:ce,isSubmitting:z}),e.jsx(Le,{isOpen:n,onClose:()=>{w(!1),q(null)},onForceCreate:ie,onViewExisting:t=>{w(!1),q(null),o(`/tasks/${t}`)},similarTask:J,isLoading:z})]})}export{st as default};
@@ -1 +1 @@
1
- import{a as l,j as a}from"./index-D9synPeJ.js";import{a as u}from"./status-colors-CRgg1N4i.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-DAwsREkq.js";import{a as u}from"./status-colors-C14ffr9M.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,4 +1,4 @@
1
- import{c as ce,n as le,h as O,o as S,a as A,r,k as z,p as de,q as xe,j as e,X as Z,s as me,f as pe,l as ue,m as he}from"./index-D9synPeJ.js";import{g as ee,H as ve}from"./task-agent-KZdZD5cO.js";import{u as fe}from"./task.store-Ds-1t2to.js";import{P as ge}from"./PtyTerminal-Do7JUGQS.js";import{i as G,O as te}from"./OnboardingGuide-CnEZNjMO.js";import{C as be}from"./ConfirmStageDialog-BtyVYk27.js";import{S as E}from"./Select-BRJxl1YO.js";import{a as se}from"./status-colors-CRgg1N4i.js";import{a as je}from"./date-CmcdoD87.js";import{T as q,a as J,g as ke}from"./task-constants-BiYtEhWG.js";import{g as ye}from"./agent-type-options-DXKoGpJI.js";import{u as ae}from"./useFetch-Dj0ZN58I.js";import{P as $}from"./plus-9sncIl_N.js";import{C as Ne}from"./chevron-down-Cm4So_5j.js";import{C as we}from"./chevron-up-DVl3qTn3.js";import{R as Te}from"./rotate-ccw-Dw8AxO4w.js";import{C as Se}from"./clock-DQeHdtoa.js";import{W as _e}from"./wifi-SWAOT6IR.js";import"./chevron-right-D0k7WYYt.js";/**
1
+ import{c as ce,n as le,h as O,o as S,a as A,r,k as z,p as de,q as xe,j as e,X as Z,s as me,f as pe,l as ue,m as he}from"./index-DAwsREkq.js";import{g as ee,H as ve}from"./task-agent-BasiQZ0L.js";import{u as fe}from"./task.store-MpV9TV7z.js";import{P as ge}from"./PtyTerminal-QdM0LGge.js";import{i as G,O as te}from"./OnboardingGuide-BTsSW7Mq.js";import{C as be}from"./ConfirmStageDialog-BUTA9YZ1.js";import{S as E}from"./Select-CC0FnszM.js";import{a as se}from"./status-colors-C14ffr9M.js";import{a as je}from"./date-CmcdoD87.js";import{T as q,a as J,g as ke}from"./task-constants-DihuKtBw.js";import{g as ye}from"./agent-type-options-BTd_pbKQ.js";import{u as ae}from"./useFetch-CgkGfhaP.js";import{P as $}from"./plus-DJTaWh3N.js";import{C as Ne}from"./chevron-down-DwSdaR46.js";import{C as we}from"./chevron-up-4jZShvn6.js";import{R as Te}from"./rotate-ccw-CXFQ7046.js";import{C as Se}from"./clock-Bn8CRcdc.js";import{W as _e}from"./wifi-D5o6IWuC.js";import"./chevron-right-BqoEBUXc.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 C,v as D,r as n,j as e,h as _,f as P,J as V,a8 as w,a6 as J,ad as S,s as O}from"./index-D9synPeJ.js";import{K as L}from"./key-KezsYJ0O.js";import{C as T}from"./copy-CHO7AsGy.js";import{E as W}from"./external-link-lvF-co6-.js";import{E as B}from"./EmptyState-CqF5g3iI.js";import{T as z}from"./Skeleton-CkmmCp2B.js";import{u as X}from"./useFetch-Dj0ZN58I.js";import{e as E}from"./status-colors-CRgg1N4i.js";import{P as q}from"./plus-9sncIl_N.js";function G({isOpen:r,onClose:f,onCreated:u}){const{t:s}=C();D(r);const[a,o]=n.useState(""),[i,d]=n.useState(!1),[l,h]=n.useState("");function y(){o(""),h(""),f()}async function x(){if(h(""),!a.trim()){h(s("admin.pat_label_required"));return}try{d(!0);const c=await _.post("admin/worker-tokens",{json:{label:a.trim()}}).json();o(""),u({token:c.token,id:c.id})}catch(c){const m=c instanceof Error?c.message:s("admin.pat_failed_to_generate");h(m)}finally{d(!1)}}return r?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))"},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(L,{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:a,onChange:c=>o(c.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:c=>{c.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:y,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 U=3e3,H=600*1e3;function Q({isOpen:r,token:f,tokenId:u,onClose:s}){const{t:a}=C();D(r);const[o,i]=n.useState("command"),[d,l]=n.useState(!1),[h,y]=n.useState(!1),[x,c]=n.useState(""),[m,g]=n.useState(null),p=n.useRef(void 0),N=n.useRef(Date.now()),k=n.useRef(null),j=P();n.useEffect(()=>{var v;r&&((v=k.current)==null||v.focus())},[r]);const t=n.useCallback(v=>{v.key==="Escape"&&s()},[s]),A=typeof window<"u"?window.location.origin:"https://overlord.example.com",R=`overlord setup worker --token ${f} --server ${A}`;async function F(){try{await navigator.clipboard.writeText(f),l(!0),setTimeout(()=>l(!1),2e3)}catch{}}async function I(){try{await navigator.clipboard.writeText(R),y(!0),setTimeout(()=>y(!1),2e3)}catch{}}const M=n.useCallback(async()=>{try{const v=await _.get(`admin/worker-tokens/${u}/status`).json();v.status==="used"&&v.worker_name&&(i("success"),c(v.worker_name),g(v.worker_id??null),p.current&&clearInterval(p.current))}catch{}Date.now()-N.current>H&&(i("timeout"),p.current&&clearInterval(p.current))},[u]);function K(){i("waiting"),N.current=Date.now(),p.current=setInterval(M,U)}n.useEffect(()=>()=>{p.current&&clearInterval(p.current)},[]);function $(){s(),m&&j(`/workers/${m}`)}if(!r)return null;const b={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))"},children:e.jsxs("div",{ref:k,className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...b,maxWidth:"480px"},onKeyDown:t,tabIndex:-1,children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:o==="success"?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:a("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:a("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[o!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("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:f}),e.jsx("button",{onClick:F,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:b,children:d?e.jsx("span",{className:"text-[var(--accent)]",children:a("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(T,{className:"h-3 w-3"})," ",a("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:a("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:["$ ",R]}),e.jsx("button",{onClick:I,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:b,children:h?e.jsx("span",{className:"text-[var(--accent)]",children:a("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(T,{className:"h-3 w-3"})," ",a("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:a("admin.token_shown_once")})]}),o==="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:a("admin.waiting_for_worker")})]}),o==="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:a("admin.token_not_yet_used")}),o==="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:a("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[a("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:[o==="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:b,children:a("common.close")}),e.jsx("button",{onClick:K,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:b,children:a("admin.copied_wait_for_worker")})]}),o==="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:b,children:a("admin.close_worker_can_register")}),o==="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:b,children:a("common.close")}),o==="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:b,children:a("common.close")}),e.jsxs("button",{onClick:$,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:b,children:[e.jsx(W,{className:"h-3 w-3"}),a("admin.view_worker")]})]})]})]})})}function ce(){const{t:r}=C(),[f,u]=n.useState(!1),[s,a]=n.useState(null),[o,i]=n.useState(!1),[d,l]=n.useState(null),[h,y]=n.useState(!1),[x,c]=n.useState(!1),{data:m,loading:g,refetch:p}=X(()=>_.get("admin/worker-tokens").json(),[]);async function N(){if(d){y(!0);try{await _.post(`admin/worker-tokens/${d.id}/revoke`),i(!1),l(null),p()}catch{}finally{y(!1)}}}function k(t){u(!1),a(t),p()}const j=n.useMemo(()=>(m??[]).filter(t=>x||t.status!==w.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:r("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("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:()=>u(!0),children:[e.jsx(q,{className:"h-3.5 w-3.5"}),r("admin.generate_token")]})]}),!g&&(m==null?void 0:m.some(t=>t.status===w.REVOKED))&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>c(!x),className:`text-xs transition-colors ${x?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:r(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(z,{rows:3})}):j.length===0?e.jsx(B,{icon:J,title:r("admin.no_worker_tokens"),description:r("admin.generate_token_desc"),actionLabel:r("admin.generate_token"),onAction:()=>u(!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:r("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:r("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:E(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===w.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(S,{className:"h-3.5 w-3.5"}),r("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 ${E(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===w.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(S,{className:"h-3.5 w-3.5"}),r("admin.revoke")]})})]},t.id))})]}),e.jsx(G,{isOpen:f,onClose:()=>u(!1),onCreated:k}),s&&e.jsx(Q,{isOpen:!!s,token:s.token,tokenId:s.id,onClose:()=>a(null)}),e.jsx(O,{isOpen:o,onClose:()=>{i(!1),l(null)},onConfirm:N,title:r("admin.revoke_token"),message:r("admin.revoke_token_confirm",{label:(d==null?void 0:d.label)??""}),confirmLabel:r("admin.revoke"),confirmVariant:"danger",isLoading:h})]})}export{ce as default};
1
+ import{a as C,v as D,r as n,j as e,h as _,f as P,J as V,a8 as w,a6 as J,ad as S,s as O}from"./index-DAwsREkq.js";import{K as L}from"./key-b6kn-A1T.js";import{C as T}from"./copy-_C7txolK.js";import{E as W}from"./external-link-DGEar13h.js";import{E as B}from"./EmptyState-BpbqIJyG.js";import{T as z}from"./Skeleton-WCDZdltv.js";import{u as X}from"./useFetch-CgkGfhaP.js";import{e as E}from"./status-colors-C14ffr9M.js";import{P as q}from"./plus-DJTaWh3N.js";function G({isOpen:r,onClose:f,onCreated:u}){const{t:s}=C();D(r);const[a,o]=n.useState(""),[i,d]=n.useState(!1),[l,h]=n.useState("");function y(){o(""),h(""),f()}async function x(){if(h(""),!a.trim()){h(s("admin.pat_label_required"));return}try{d(!0);const c=await _.post("admin/worker-tokens",{json:{label:a.trim()}}).json();o(""),u({token:c.token,id:c.id})}catch(c){const m=c instanceof Error?c.message:s("admin.pat_failed_to_generate");h(m)}finally{d(!1)}}return r?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))"},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(L,{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:a,onChange:c=>o(c.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:c=>{c.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:y,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 U=3e3,H=600*1e3;function Q({isOpen:r,token:f,tokenId:u,onClose:s}){const{t:a}=C();D(r);const[o,i]=n.useState("command"),[d,l]=n.useState(!1),[h,y]=n.useState(!1),[x,c]=n.useState(""),[m,g]=n.useState(null),p=n.useRef(void 0),N=n.useRef(Date.now()),k=n.useRef(null),j=P();n.useEffect(()=>{var v;r&&((v=k.current)==null||v.focus())},[r]);const t=n.useCallback(v=>{v.key==="Escape"&&s()},[s]),A=typeof window<"u"?window.location.origin:"https://overlord.example.com",R=`overlord setup worker --token ${f} --server ${A}`;async function F(){try{await navigator.clipboard.writeText(f),l(!0),setTimeout(()=>l(!1),2e3)}catch{}}async function I(){try{await navigator.clipboard.writeText(R),y(!0),setTimeout(()=>y(!1),2e3)}catch{}}const M=n.useCallback(async()=>{try{const v=await _.get(`admin/worker-tokens/${u}/status`).json();v.status==="used"&&v.worker_name&&(i("success"),c(v.worker_name),g(v.worker_id??null),p.current&&clearInterval(p.current))}catch{}Date.now()-N.current>H&&(i("timeout"),p.current&&clearInterval(p.current))},[u]);function K(){i("waiting"),N.current=Date.now(),p.current=setInterval(M,U)}n.useEffect(()=>()=>{p.current&&clearInterval(p.current)},[]);function $(){s(),m&&j(`/workers/${m}`)}if(!r)return null;const b={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))"},children:e.jsxs("div",{ref:k,className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...b,maxWidth:"480px"},onKeyDown:t,tabIndex:-1,children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:o==="success"?e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:a("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:a("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[o!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("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:f}),e.jsx("button",{onClick:F,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:b,children:d?e.jsx("span",{className:"text-[var(--accent)]",children:a("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(T,{className:"h-3 w-3"})," ",a("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:a("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:["$ ",R]}),e.jsx("button",{onClick:I,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:b,children:h?e.jsx("span",{className:"text-[var(--accent)]",children:a("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(T,{className:"h-3 w-3"})," ",a("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:a("admin.token_shown_once")})]}),o==="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:a("admin.waiting_for_worker")})]}),o==="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:a("admin.token_not_yet_used")}),o==="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:a("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[a("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:[o==="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:b,children:a("common.close")}),e.jsx("button",{onClick:K,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:b,children:a("admin.copied_wait_for_worker")})]}),o==="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:b,children:a("admin.close_worker_can_register")}),o==="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:b,children:a("common.close")}),o==="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:b,children:a("common.close")}),e.jsxs("button",{onClick:$,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:b,children:[e.jsx(W,{className:"h-3 w-3"}),a("admin.view_worker")]})]})]})]})})}function ce(){const{t:r}=C(),[f,u]=n.useState(!1),[s,a]=n.useState(null),[o,i]=n.useState(!1),[d,l]=n.useState(null),[h,y]=n.useState(!1),[x,c]=n.useState(!1),{data:m,loading:g,refetch:p}=X(()=>_.get("admin/worker-tokens").json(),[]);async function N(){if(d){y(!0);try{await _.post(`admin/worker-tokens/${d.id}/revoke`),i(!1),l(null),p()}catch{}finally{y(!1)}}}function k(t){u(!1),a(t),p()}const j=n.useMemo(()=>(m??[]).filter(t=>x||t.status!==w.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:r("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("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:()=>u(!0),children:[e.jsx(q,{className:"h-3.5 w-3.5"}),r("admin.generate_token")]})]}),!g&&(m==null?void 0:m.some(t=>t.status===w.REVOKED))&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>c(!x),className:`text-xs transition-colors ${x?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:r(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(z,{rows:3})}):j.length===0?e.jsx(B,{icon:J,title:r("admin.no_worker_tokens"),description:r("admin.generate_token_desc"),actionLabel:r("admin.generate_token"),onAction:()=>u(!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:r("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:r("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:r("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:E(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===w.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(S,{className:"h-3.5 w-3.5"}),r("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 ${E(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===w.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(S,{className:"h-3.5 w-3.5"}),r("admin.revoke")]})})]},t.id))})]}),e.jsx(G,{isOpen:f,onClose:()=>u(!1),onCreated:k}),s&&e.jsx(Q,{isOpen:!!s,token:s.token,tokenId:s.id,onClose:()=>a(null)}),e.jsx(O,{isOpen:o,onClose:()=>{i(!1),l(null)},onConfirm:N,title:r("admin.revoke_token"),message:r("admin.revoke_token_confirm",{label:(d==null?void 0:d.label)??""}),confirmLabel:r("admin.revoke"),confirmVariant:"danger",isLoading:h})]})}export{ce as default};
@@ -1 +1 @@
1
- import{$ as m,r as e,j as t}from"./index-D9synPeJ.js";var b=m();function g({content:n,children:a,delay:l=100,className:i}){const[p,c]=e.useState(!1),[u,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})}c(!0)},l)},[l]),d=e.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),c(!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:u.top,left:u.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)] preserve-case",children:n}),document.body)]}):t.jsx(t.Fragment,{children:a})}export{g as T};
1
+ import{$ as m,r as e,j as t}from"./index-DAwsREkq.js";var b=m();function g({content:n,children:a,delay:l=100,className:i}){const[p,c]=e.useState(!1),[u,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})}c(!0)},l)},[l]),d=e.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),c(!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:u.top,left:u.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)] preserve-case",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-D9synPeJ.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-DAwsREkq.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