@overlordai/server 1.0.152 → 1.0.154

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 (155) hide show
  1. package/database/migrations/016-automation-notify-project-chats.sql +2 -0
  2. package/database/migrations/017-automation-multi-project.sql +21 -0
  3. package/dist/automation/automation-executor.d.ts +1 -1
  4. package/dist/automation/automation-executor.d.ts.map +1 -1
  5. package/dist/automation/automation-executor.js +18 -13
  6. package/dist/automation/automation-executor.js.map +1 -1
  7. package/dist/automation/automation-scheduler.d.ts.map +1 -1
  8. package/dist/automation/automation-scheduler.js +9 -1
  9. package/dist/automation/automation-scheduler.js.map +1 -1
  10. package/dist/automation/automation-trigger.js +3 -3
  11. package/dist/automation/automation-trigger.js.map +1 -1
  12. package/dist/automation/automation.service.d.ts +4 -0
  13. package/dist/automation/automation.service.d.ts.map +1 -1
  14. package/dist/automation/automation.service.js +66 -7
  15. package/dist/automation/automation.service.js.map +1 -1
  16. package/dist/automation/builtin-templates.js +3 -3
  17. package/dist/automation/builtin-templates.js.map +1 -1
  18. package/dist/database/repositories/automation.repository.d.ts +9 -2
  19. package/dist/database/repositories/automation.repository.d.ts.map +1 -1
  20. package/dist/database/repositories/automation.repository.js +75 -23
  21. package/dist/database/repositories/automation.repository.js.map +1 -1
  22. package/dist/notifier/notification-consumer.d.ts +4 -1
  23. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  24. package/dist/notifier/notification-consumer.js +32 -8
  25. package/dist/notifier/notification-consumer.js.map +1 -1
  26. package/dist/notifier/notification-event-listener.d.ts.map +1 -1
  27. package/dist/notifier/notification-event-listener.js +3 -2
  28. package/dist/notifier/notification-event-listener.js.map +1 -1
  29. package/dist/notifier/notifier.service.d.ts +4 -2
  30. package/dist/notifier/notifier.service.d.ts.map +1 -1
  31. package/dist/notifier/notifier.service.js +57 -2
  32. package/dist/notifier/notifier.service.js.map +1 -1
  33. package/dist/web/automation.controller.d.ts +4 -0
  34. package/dist/web/automation.controller.d.ts.map +1 -1
  35. package/dist/web/automation.controller.js +60 -21
  36. package/dist/web/automation.controller.js.map +1 -1
  37. package/dist/web/worker-web.controller.d.ts +1 -1
  38. package/dist/web/worker-web.controller.d.ts.map +1 -1
  39. package/dist/web/worker-web.controller.js +15 -5
  40. package/dist/web/worker-web.controller.js.map +1 -1
  41. package/package.json +4 -4
  42. package/public/assets/{AccessTokensPage-DOQYcLSs.js → AccessTokensPage-CYec9jzJ.js} +1 -1
  43. package/public/assets/{AdminPage-vaAs4nmP.js → AdminPage-t2Q3HGBC.js} +1 -1
  44. package/public/assets/{AgentCliPage-BXGIfvSo.js → AgentCliPage-S06CR41h.js} +1 -1
  45. package/public/assets/{ApiReferencePage-ChGlKtFZ.js → ApiReferencePage-CsXGBGDf.js} +1 -1
  46. package/public/assets/{ArchitecturePage-BDo0Sz0V.js → ArchitecturePage-1w9WC-ns.js} +1 -1
  47. package/public/assets/{AuditLogPage-CDonhWBh.js → AuditLogPage-BtTTQrI0.js} +1 -1
  48. package/public/assets/AutomationCreatePage-B-fTvSAy.js +1 -0
  49. package/public/assets/AutomationDetailPage-vsniJu06.js +16 -0
  50. package/public/assets/AutomationEditPage-Bl_WVim4.js +1 -0
  51. package/public/assets/AutomationListPage-2K5vRQk2.js +26 -0
  52. package/public/assets/{AutomationRunDetailPage-BWRONm49.js → AutomationRunDetailPage-41_RxWmD.js} +2 -2
  53. package/public/assets/{BindPlatformPage-B-jO83qZ.js → BindPlatformPage-BElmbysw.js} +1 -1
  54. package/public/assets/{BotIntegrationPage-CfWOXPnJ.js → BotIntegrationPage-Dl2aGKqO.js} +1 -1
  55. package/public/assets/{BotManage-Dt4gvWW6.js → BotManage-bSKcAFsV.js} +1 -1
  56. package/public/assets/{BotSetupPage-BAtr0Wem.js → BotSetupPage-DNlfGROu.js} +1 -1
  57. package/public/assets/{ChangelogPage-CbYmEPo0.js → ChangelogPage-zcA8kPFS.js} +1 -1
  58. package/public/assets/{CliReferencePage-DzBrPSnn.js → CliReferencePage-M1h0rDfy.js} +1 -1
  59. package/public/assets/{ConfirmStageDialog-CJ8pWink.js → ConfirmStageDialog-DR4NtMbp.js} +1 -1
  60. package/public/assets/{DeploymentPage-DngrSHQT.js → DeploymentPage-C7TLn2zL.js} +1 -1
  61. package/public/assets/{DevWorkflowPage-BQfJaZyg.js → DevWorkflowPage-wv-IqCn3.js} +1 -1
  62. package/public/assets/{DeveloperManage-whlVH116.js → DeveloperManage-BSh3_MTP.js} +1 -1
  63. package/public/assets/{DeveloperSetupPage-LrbpgJ2C.js → DeveloperSetupPage-CxcWXk1l.js} +1 -1
  64. package/public/assets/{DocsIndexPage-vE4yr9Si.js → DocsIndexPage-BaAVze9J.js} +1 -1
  65. package/public/assets/DocsLayout-T_cPcAIl.js +1 -0
  66. package/public/assets/{DocsPrimitives-DCBNKtsW.js → DocsPrimitives-BCcIgi-N.js} +1 -1
  67. package/public/assets/{EditProjectPage-CjJMof0e.js → EditProjectPage-BNzVUbWF.js} +1 -1
  68. package/public/assets/{EmptyState-BfgwLg0u.js → EmptyState-Dtc0ZNRp.js} +1 -1
  69. package/public/assets/{EnvVariablesPage-D5h_sa-J.js → EnvVariablesPage-Bac6hRjE.js} +1 -1
  70. package/public/assets/{HomePage-BfETjlYe.js → HomePage-BNiekw7A.js} +1 -1
  71. package/public/assets/{InfoRow-CIwHf1Un.js → InfoRow-CzMBBOwd.js} +1 -1
  72. package/public/assets/{InstallationPage-2uTV3WlY.js → InstallationPage-ZVK1CxNV.js} +1 -1
  73. package/public/assets/{LandingPage-DMFC0PF_.js → LandingPage-ChvKFNcy.js} +1 -1
  74. package/public/assets/{LocalDevelopmentPage-9g3s63GP.js → LocalDevelopmentPage-DO_Je_rS.js} +1 -1
  75. package/public/assets/{LoginPage-CXwygPZl.js → LoginPage-q5n1oi6c.js} +1 -1
  76. package/public/assets/{MetricBar-BWuqiydF.js → MetricBar-8Mx9cJBP.js} +1 -1
  77. package/public/assets/MultiSelect-Bn_OBCgB.js +1 -0
  78. package/public/assets/{NotFoundPage-Cs7ae_Mz.js → NotFoundPage-CUbVM9QK.js} +1 -1
  79. package/public/assets/{OnboardingGuide-uCrXzgnL.js → OnboardingGuide-CV4tINbf.js} +1 -1
  80. package/public/assets/{PermissionsPage-CVrdX2r2.js → PermissionsPage-Cu20mTMb.js} +1 -1
  81. package/public/assets/{PipelineConfigPage-BxkXW1la.js → PipelineConfigPage-DadkE0Vl.js} +1 -1
  82. package/public/assets/{PipelineEditorPage-DiyMvTIg.js → PipelineEditorPage-CmGr3emr.js} +2 -2
  83. package/public/assets/{PlanPage-B-NSg434.js → PlanPage-C9BaQHlG.js} +1 -1
  84. package/public/assets/{ProfilePage-CRMCbMyc.js → ProfilePage-V2QDDDT5.js} +1 -1
  85. package/public/assets/{ProjectDetailPage-Bx1DUkpw.js → ProjectDetailPage-BIM5wNdd.js} +1 -1
  86. package/public/assets/{ProjectListPage-D1LzmIVf.js → ProjectListPage-BqJ3sa75.js} +1 -1
  87. package/public/assets/{PtyTerminal-CxBKQBbF.js → PtyTerminal-CDGp4pLP.js} +1 -1
  88. package/public/assets/{QuickAuth-BMY6Nw6u.js → QuickAuth-YzGZf86P.js} +1 -1
  89. package/public/assets/{RemoveMemberConfirmDialog-Da3XlOxO.js → RemoveMemberConfirmDialog-3Zg6POcw.js} +1 -1
  90. package/public/assets/{ReviewAggregatePage-mnnW-Nli.js → ReviewAggregatePage-DZ7vq0na.js} +1 -1
  91. package/public/assets/{ReviewPage-_pd3mJC1.js → ReviewPage-CuIGtr5J.js} +1 -1
  92. package/public/assets/{Select-CaAVBHmI.js → Select-67FOknim.js} +1 -1
  93. package/public/assets/{SettingsPage-CsDJ7FS9.js → SettingsPage-DxQyuz8P.js} +1 -1
  94. package/public/assets/{Skeleton-CNV0Dyd8.js → Skeleton-_rq02txk.js} +1 -1
  95. package/public/assets/{SkillPage-CQyxaNa5.js → SkillPage-BZiHfn-H.js} +1 -1
  96. package/public/assets/{TaskDetailPage-Dn7Vl2tI.js → TaskDetailPage-CUBpkfyo.js} +1 -1
  97. package/public/assets/{TaskGuidePage-Ch465zVv.js → TaskGuidePage-hvqiwQod.js} +1 -1
  98. package/public/assets/{TaskListPage-DbQbJMDj.js → TaskListPage-Bhose57w.js} +1 -1
  99. package/public/assets/{TaskStatusBadge-Dzloj2eJ.js → TaskStatusBadge-D4ZTaewH.js} +1 -1
  100. package/public/assets/{TerminalHomePage-C2bwGFkH.js → TerminalHomePage-BG0HvMTN.js} +1 -1
  101. package/public/assets/{TokenManage-mToToJ_g.js → TokenManage-XCYWH63A.js} +1 -1
  102. package/public/assets/Tooltip-BeXBpXMQ.js +1 -0
  103. package/public/assets/{TotpSetupPage-Dk00_OYo.js → TotpSetupPage-DchjCTiK.js} +1 -1
  104. package/public/assets/WorkerDetailPage-DIa8H0Cq.js +1 -0
  105. package/public/assets/{WorkerListPage-kKUioe-i.js → WorkerListPage-C8Or4H2-.js} +1 -1
  106. package/public/assets/{WorkerOperationsPage-CBzwbV8I.js → WorkerOperationsPage-BSoKQXAz.js} +1 -1
  107. package/public/assets/{WorkerSetupGuidePage-DvaP5u6N.js → WorkerSetupGuidePage-BfVQ3Ua8.js} +1 -1
  108. package/public/assets/{WorkerSetupPage-BD-EAPKM.js → WorkerSetupPage-BndankoD.js} +1 -1
  109. package/public/assets/{agent-type-options-BiwwFXJv.js → agent-type-options-ChuePYjM.js} +1 -1
  110. package/public/assets/{arrow-left-BnN4eZhK.js → arrow-left-DqjVoydc.js} +1 -1
  111. package/public/assets/{arrow-right-BDaYPEVr.js → arrow-right-CTYUOR48.js} +1 -1
  112. package/public/assets/{bot-jsWsZ197.js → bot-DIgcjp1L.js} +1 -1
  113. package/public/assets/{chevron-down-DyqUpmgf.js → chevron-down-USdSAtLM.js} +1 -1
  114. package/public/assets/{chevron-left-D5fJVFiB.js → chevron-left-DeBK5qpt.js} +1 -1
  115. package/public/assets/{chevron-right-Bz-j2WmS.js → chevron-right-c3y2M4GO.js} +1 -1
  116. package/public/assets/{chevron-up-DEXIEMJO.js → chevron-up-DCDYf3Az.js} +1 -1
  117. package/public/assets/{circle-alert-DE06tNOV.js → circle-alert-l_FFcF-_.js} +1 -1
  118. package/public/assets/{clock-DyV22whY.js → clock-ey7I11g5.js} +1 -1
  119. package/public/assets/{copy-Dtpgo9EK.js → copy-BvsnHVjA.js} +1 -1
  120. package/public/assets/date-CmcdoD87.js +1 -0
  121. package/public/assets/{download-DVCPTZuD.js → download-BzwPSzep.js} +1 -1
  122. package/public/assets/{external-link-Bbo-dc9z.js → external-link-ChvrB9MU.js} +1 -1
  123. package/public/assets/{git-fork-A1WGp9ha.js → git-fork-DS0EMsEA.js} +1 -1
  124. package/public/assets/index-Azh1KhiX.css +1 -0
  125. package/public/assets/{index-PZwTchr_.js → index-Dc7l0IT6.js} +3 -3
  126. package/public/assets/{key-BDx4jfUG.js → key-D7b87-i1.js} +1 -1
  127. package/public/assets/{loader-circle-nKG9e8iK.js → loader-circle-CA2KGzXp.js} +1 -1
  128. package/public/assets/{pencil-Dgj4md4-.js → pencil-CfrtWF-J.js} +1 -1
  129. package/public/assets/{play-DFj8BMl8.js → play-C_ZVU9H5.js} +1 -1
  130. package/public/assets/{plus-CCF-PMRF.js → plus-g2yZrAF7.js} +1 -1
  131. package/public/assets/{rotate-ccw-CyltG4Qx.js → rotate-ccw-C1EaXve8.js} +1 -1
  132. package/public/assets/{scroll-text-IFQgBRlh.js → scroll-text-CwMw-SJf.js} +1 -1
  133. package/public/assets/{settings-CYtYYzCu.js → settings-CpJIpeUV.js} +1 -1
  134. package/public/assets/{skip-forward-Ck7tY58a.js → skip-forward-BQCBn5yW.js} +1 -1
  135. package/public/assets/{status-colors-DDycfcf7.js → status-colors-PFYg7zX9.js} +1 -1
  136. package/public/assets/{task-constants-CSVY_jfk.js → task-constants-BtTS5GQt.js} +1 -1
  137. package/public/assets/{task.store-BTXbcXgO.js → task.store-2YMrViYj.js} +1 -1
  138. package/public/assets/{timer-CXsWiTNP.js → timer-B7JsdQPs.js} +1 -1
  139. package/public/assets/{trash-2-DXJqRCdo.js → trash-2-CgnGXyNP.js} +1 -1
  140. package/public/assets/{useFetch-6R6P2rOm.js → useFetch-CM-iw_s7.js} +1 -1
  141. package/public/assets/{users-BZPY-p6E.js → users-Bpg-Dicv.js} +1 -1
  142. package/public/assets/{wifi-Bgq95lS8.js → wifi-2G9hdLVN.js} +1 -1
  143. package/public/assets/{workflow-RqNfx4vc.js → workflow-o40bANXK.js} +1 -1
  144. package/public/assets/{zap-BIwamY7L.js → zap-YCwvQMOv.js} +1 -1
  145. package/public/index.html +2 -2
  146. package/public/sw.js +1 -1
  147. package/public/assets/AutomationCreatePage-C1_2qnf5.js +0 -1
  148. package/public/assets/AutomationDetailPage-BruGQNkV.js +0 -16
  149. package/public/assets/AutomationEditPage-BVlx-7AI.js +0 -1
  150. package/public/assets/AutomationListPage-BprhRKdu.js +0 -26
  151. package/public/assets/DocsLayout-ByGEAOqk.js +0 -1
  152. package/public/assets/Tooltip-DzkVglKi.js +0 -1
  153. package/public/assets/WorkerDetailPage-C8_zfmSR.js +0 -1
  154. package/public/assets/date-RFA7-ZGs.js +0 -1
  155. package/public/assets/index-Du11Fv9c.css +0 -1
@@ -1,3 +1,3 @@
1
- import{a as g,r as p,j as e,$ as P,A as I,f as M,h as S,t as y}from"./index-PZwTchr_.js";import{S as C}from"./Select-CaAVBHmI.js";import"./chevron-down-DyqUpmgf.js";const O={stages:[]};function q(){return{name:"",prompt:""}}function b({children:t}){return e.jsx("label",{className:"mb-1 block font-mono text-[11px] text-[var(--text-secondary)]",children:t})}function j({value:t,onChange:o,placeholder:a,type:r="text",className:c=""}){return e.jsx("input",{type:r,value:t,onChange:s=>o(s.target.value),placeholder:a,className:`w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none ${c}`})}function J({checked:t,onChange:o}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>o(!t),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-[var(--border)] transition-colors ${t?"bg-[var(--accent)]":"bg-[var(--bg-primary)]"}`,children:e.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow transition-transform ${t?"translate-x-[18px]":"translate-x-[2px]"}`})})}function N({value:t,onChange:o,placeholder:a,rows:r=4}){return e.jsx("textarea",{value:t,onChange:c=>o(c.target.value),placeholder:a,rows:r,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs leading-relaxed text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none"})}function T({stage:t,index:o,selected:a,onSelect:r,onDelete:c}){const{t:s}=g(),i=t.prompt?P(t.prompt,60):"";return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())},className:`group relative flex w-full items-start gap-3 rounded-[4px] border px-4 py-3 text-left transition-colors ${a?"border-[var(--accent)] bg-[var(--bg-card)]":"border-[var(--border)] bg-[var(--bg-card)] hover:border-[var(--text-muted)]"}`,style:{borderLeftWidth:3,borderLeftColor:"var(--accent)"},children:[e.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[11px] text-[var(--text-muted)]",children:String(o+1).padStart(2,"0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs font-bold text-[var(--text-primary)]",children:t.name||"unnamed"}),t.label&&e.jsx("span",{className:"truncate font-mono text-[11px] text-[var(--text-muted)]",children:t.label})]}),i&&e.jsxs("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[var(--text-muted)]",children:["// ",i]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 font-mono text-[11px] text-[var(--text-muted)]",children:[t.gate&&e.jsx("span",{children:"gate"}),t.requireConfirm&&e.jsx("span",{children:"confirm"}),t.timeout!=null&&e.jsxs("span",{children:["timeout:",t.timeout,"s"]})]})]}),e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),c()},className:"mt-0.5 shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] opacity-0 transition-opacity hover:text-[var(--destructive)] group-hover:opacity-100","aria-label":s("pipeline.delete_stage"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})}function _({stage:t,onChange:o,allStageNames:a}){const{t:r}=g(),c=p.useMemo(()=>{const s=[{value:"",label:"-- select --"}];for(const i of a)i&&i!==t.name&&s.push({value:i,label:i});return s},[a,t.name]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-mono text-sm font-semibold text-[var(--accent)]",children:r("pipeline.stage_properties")}),e.jsx("p",{className:"font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.editing",{name:t.name||r("pipeline.unnamed")})}),e.jsxs("div",{children:[e.jsxs(b,{children:[r("pipeline.name")," *"]}),e.jsx(j,{value:t.name,onChange:s=>o({name:s}),placeholder:r("pipeline.stage_name")})]}),e.jsxs("div",{children:[e.jsx(b,{children:"label"}),e.jsx(j,{value:t.label??"",onChange:s=>o({label:s||void 0}),placeholder:"optional display label"})]}),e.jsxs("div",{children:[e.jsx(b,{children:"prompt *"}),e.jsx(N,{value:t.prompt,onChange:s=>o({prompt:s}),placeholder:"instructions for the agent...",rows:8})]}),e.jsxs("div",{children:[e.jsx(b,{children:"gate"}),e.jsx(j,{value:t.gate??"",onChange:s=>o({gate:s||void 0}),placeholder:"Pass condition, e.g.: no P1-P3 issues"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:r("pipeline.confirm_required")}),e.jsx(J,{checked:t.requireConfirm??!1,onChange:s=>o({requireConfirm:s})})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.timeout")}),e.jsx(j,{type:"number",value:String(t.timeout??""),onChange:s=>o({timeout:s?parseInt(s,10):void 0}),placeholder:"600"})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("p",{className:"mb-3 font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.on_failure_section")}),e.jsxs("div",{className:"mb-3",children:[e.jsx(b,{children:r("pipeline.on_failure")}),e.jsx(C,{value:t.onFailure?"goto":"stop",onChange:s=>{o(s==="stop"?{onFailure:void 0}:{onFailure:{goto:"",maxLoops:3}})},options:[{value:"stop",label:r("pipeline.stop")},{value:"goto",label:r("pipeline.goto_stage")}]})]}),t.onFailure&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.goto")}),e.jsx(C,{value:t.onFailure.goto,onChange:s=>{var i;return o({onFailure:{goto:s,maxLoops:((i=t.onFailure)==null?void 0:i.maxLoops)??3}})},options:c})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.max_loops")}),e.jsx(j,{type:"number",value:String(t.onFailure.maxLoops),onChange:s=>{var i;return o({onFailure:{goto:((i=t.onFailure)==null?void 0:i.goto)??"",maxLoops:s?parseInt(s,10):3}})},placeholder:"3"})]})]})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold text-[var(--accent)]",children:"params"}),e.jsx(N,{value:t.params?Object.entries(t.params).map(([s,i])=>`${s}=${i}`).join(`
1
+ import{a as g,r as p,j as e,_ as $,A as I,f as M,h as S,t as y}from"./index-Dc7l0IT6.js";import{S as C}from"./Select-67FOknim.js";import"./chevron-down-USdSAtLM.js";const O={stages:[]};function q(){return{name:"",prompt:""}}function b({children:t}){return e.jsx("label",{className:"mb-1 block font-mono text-[11px] text-[var(--text-secondary)]",children:t})}function j({value:t,onChange:o,placeholder:a,type:r="text",className:c=""}){return e.jsx("input",{type:r,value:t,onChange:s=>o(s.target.value),placeholder:a,className:`w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none ${c}`})}function J({checked:t,onChange:o}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>o(!t),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-[var(--border)] transition-colors ${t?"bg-[var(--accent)]":"bg-[var(--bg-primary)]"}`,children:e.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow transition-transform ${t?"translate-x-[18px]":"translate-x-[2px]"}`})})}function N({value:t,onChange:o,placeholder:a,rows:r=4}){return e.jsx("textarea",{value:t,onChange:c=>o(c.target.value),placeholder:a,rows:r,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs leading-relaxed text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none"})}function T({stage:t,index:o,selected:a,onSelect:r,onDelete:c}){const{t:s}=g(),i=t.prompt?$(t.prompt,60):"";return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())},className:`group relative flex w-full items-start gap-3 rounded-[4px] border px-4 py-3 text-left transition-colors ${a?"border-[var(--accent)] bg-[var(--bg-card)]":"border-[var(--border)] bg-[var(--bg-card)] hover:border-[var(--text-muted)]"}`,style:{borderLeftWidth:3,borderLeftColor:"var(--accent)"},children:[e.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[11px] text-[var(--text-muted)]",children:String(o+1).padStart(2,"0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs font-bold text-[var(--text-primary)]",children:t.name||"unnamed"}),t.label&&e.jsx("span",{className:"truncate font-mono text-[11px] text-[var(--text-muted)]",children:t.label})]}),i&&e.jsxs("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[var(--text-muted)]",children:["// ",i]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 font-mono text-[11px] text-[var(--text-muted)]",children:[t.gate&&e.jsx("span",{children:"gate"}),t.requireConfirm&&e.jsx("span",{children:"confirm"}),t.timeout!=null&&e.jsxs("span",{children:["timeout:",t.timeout,"s"]})]})]}),e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),c()},className:"mt-0.5 shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] opacity-0 transition-opacity hover:text-[var(--destructive)] group-hover:opacity-100","aria-label":s("pipeline.delete_stage"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})}function _({stage:t,onChange:o,allStageNames:a}){const{t:r}=g(),c=p.useMemo(()=>{const s=[{value:"",label:"-- select --"}];for(const i of a)i&&i!==t.name&&s.push({value:i,label:i});return s},[a,t.name]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-mono text-sm font-semibold text-[var(--accent)]",children:r("pipeline.stage_properties")}),e.jsx("p",{className:"font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.editing",{name:t.name||r("pipeline.unnamed")})}),e.jsxs("div",{children:[e.jsxs(b,{children:[r("pipeline.name")," *"]}),e.jsx(j,{value:t.name,onChange:s=>o({name:s}),placeholder:r("pipeline.stage_name")})]}),e.jsxs("div",{children:[e.jsx(b,{children:"label"}),e.jsx(j,{value:t.label??"",onChange:s=>o({label:s||void 0}),placeholder:"optional display label"})]}),e.jsxs("div",{children:[e.jsx(b,{children:"prompt *"}),e.jsx(N,{value:t.prompt,onChange:s=>o({prompt:s}),placeholder:"instructions for the agent...",rows:8})]}),e.jsxs("div",{children:[e.jsx(b,{children:"gate"}),e.jsx(j,{value:t.gate??"",onChange:s=>o({gate:s||void 0}),placeholder:"Pass condition, e.g.: no P1-P3 issues"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:r("pipeline.confirm_required")}),e.jsx(J,{checked:t.requireConfirm??!1,onChange:s=>o({requireConfirm:s})})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.timeout")}),e.jsx(j,{type:"number",value:String(t.timeout??""),onChange:s=>o({timeout:s?parseInt(s,10):void 0}),placeholder:"600"})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("p",{className:"mb-3 font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.on_failure_section")}),e.jsxs("div",{className:"mb-3",children:[e.jsx(b,{children:r("pipeline.on_failure")}),e.jsx(C,{value:t.onFailure?"goto":"stop",onChange:s=>{o(s==="stop"?{onFailure:void 0}:{onFailure:{goto:"",maxLoops:3}})},options:[{value:"stop",label:r("pipeline.stop")},{value:"goto",label:r("pipeline.goto_stage")}]})]}),t.onFailure&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.goto")}),e.jsx(C,{value:t.onFailure.goto,onChange:s=>{var i;return o({onFailure:{goto:s,maxLoops:((i=t.onFailure)==null?void 0:i.maxLoops)??3}})},options:c})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.max_loops")}),e.jsx(j,{type:"number",value:String(t.onFailure.maxLoops),onChange:s=>{var i;return o({onFailure:{goto:((i=t.onFailure)==null?void 0:i.goto)??"",maxLoops:s?parseInt(s,10):3}})},placeholder:"3"})]})]})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold text-[var(--accent)]",children:"params"}),e.jsx(N,{value:t.params?Object.entries(t.params).map(([s,i])=>`${s}=${i}`).join(`
2
2
  `):"",onChange:s=>{if(!s.trim()){o({params:void 0});return}const i={};s.split(`
3
- `).forEach(d=>{const l=d.indexOf("=");l>0&&(i[d.slice(0,l).trim()]=d.slice(l+1).trim())}),o({params:i})},placeholder:"KEY=value (one per line)",rows:3})]})]})}function D({value:t,onChange:o}){const[a,r]=p.useState(t.trim().length>0);return p.useEffect(()=>{!a&&t.trim().length>0&&r(!0)},[t,a]),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("button",{type:"button",onClick:()=>r(c=>!c),className:"flex w-full items-center justify-between px-4 py-3 text-left font-mono text-xs font-semibold text-[var(--accent)]",children:[e.jsx("span",{children:"preamble"}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a?"[-]":"[+]"})]}),a&&e.jsx("div",{className:"border-t border-[var(--border)] px-4 py-3",children:e.jsx(N,{value:t,onChange:o,placeholder:"Global pre-prompt injected before all stages",rows:4})})]})}function A({value:t,onChange:o}){const{t:a}=g(),[r,c]=p.useState(null),[s,i]=p.useState(!1),d=p.useMemo(()=>t??O,[t]),l=d.stages,h=r!=null?l[r]??null:null,f=p.useMemo(()=>l.map(n=>n.name),[l]),v=p.useCallback(n=>{o({...d,stages:n})},[o,d]),F=p.useCallback(()=>{const n=[...l,q()];v(n),c(n.length-1)},[l,v]),E=p.useCallback(n=>{const x=l.filter((m,u)=>u!==n);v(x),r===n?c(x.length>0?Math.min(n,x.length-1):null):r!=null&&r>n&&c(r-1)},[l,r,v]),w=p.useCallback((n,x)=>{const m=l.map((u,L)=>L===n?{...u,...x}:u);v(m)},[l,v]),k=p.useCallback((n,x)=>{const m=x==="up"?n-1:n+1;if(m<0||m>=l.length)return;const u=[...l];[u[n],u[m]]=[u[m],u[n]],v(u),r===n?c(m):r===m&&c(n)},[l,r,v]),$=p.useMemo(()=>JSON.stringify(d,null,2),[d]);return e.jsxs("div",{className:"flex flex-col gap-0",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{type:"button",onClick:()=>i(n=>!n),className:`rounded-[4px] border px-2 py-1 font-mono text-[11px] transition-colors ${s?"border-[var(--accent)] text-[var(--accent)]":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:[a("pipeline.json_toggle")," ⇅"]})}),s&&e.jsx("pre",{className:"mb-4 max-h-[400px] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3 font-mono text-[11px] leading-relaxed text-[var(--text-primary)]",children:$}),e.jsx("div",{className:"mb-4",children:e.jsx(D,{value:d.preamble??"",onChange:n=>o({...d,preamble:n||void 0})})}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.map((n,x)=>{var m;return e.jsxs("div",{children:[e.jsx(T,{stage:n,index:x,selected:r===x,onSelect:()=>c(x),onDelete:()=>E(x)}),x<l.length-1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"▼"}),e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"})]}),((m=n.onFailure)==null?void 0:m.goto)&&e.jsx("div",{className:"flex items-center justify-center gap-1.5 py-1",children:e.jsxs("span",{className:"text-[11px] text-[var(--warning)]",children:["↺ loop → ",n.onFailure.goto," (max ",n.onFailure.maxLoops,")"]})})]},`${x}-${n.name}`)}),r!=null&&l.length>1&&e.jsxs("div",{className:"flex items-center gap-1 pl-7 pt-2",children:[e.jsxs("button",{type:"button",disabled:r===0,onClick:()=>k(r,"up"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▲ ",a("pipeline.up")]}),e.jsxs("button",{type:"button",disabled:r===l.length-1,onClick:()=>k(r,"down"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▼ ",a("pipeline.down")]})]}),e.jsx("div",{className:"flex items-center justify-center py-3",children:e.jsxs("button",{type:"button",onClick:F,className:"flex items-center gap-1.5 rounded-[4px] border border-dashed border-[var(--border)] px-4 py-2 font-mono text-xs text-[var(--accent)] transition-colors hover:border-[var(--accent)] hover:bg-[var(--bg-secondary)]",children:[e.jsx("span",{className:"text-sm leading-none",children:"+"})," ",a("pipeline.add_stage")]})}),h&&e.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs font-semibold text-[var(--accent)]",children:a("pipeline.stage_properties")}),e.jsx("button",{type:"button",onClick:()=>c(null),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 font-mono text-[11px] text-[var(--text-muted)]",children:"x"})]}),e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f})]})]}),e.jsx("div",{className:"hidden w-[360px] shrink-0 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 lg:block",style:{alignSelf:"flex-start",position:"sticky",top:0},children:h?e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f}):e.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:e.jsx("p",{className:"font-mono text-xs text-[var(--text-muted)]",children:a("pipeline.select_stage")})})})]})]})}function V(){const{key:t}=I(),o=M(),{t:a}=g(),[r,c]=p.useState(null),[s,i]=p.useState(!0),[d,l]=p.useState(!1);p.useEffect(()=>{t&&S.get(`web/projects/${t}`).json().then(f=>{if(f.pipeline)try{c(JSON.parse(f.pipeline))}catch{c(null)}}).catch(()=>y.error(a("pipeline.failed_to_load_project"))).finally(()=>i(!1))},[t,a]);const h=p.useCallback(async()=>{if(t){l(!0);try{await S.put(`web/projects/${t}`,{json:{pipeline:r?JSON.stringify(r):null}}),y.success(a("pipeline.saved"))}catch{y.error(a("pipeline.failed_to_save"))}finally{l(!1)}}},[t,r,a]);return s?e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("pipeline.loading_pipeline")})}):e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-[var(--border)] px-4 md:px-8 py-5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-base font-medium text-[var(--text-primary)] shrink-0",children:a("pipeline.title")}),e.jsx("span",{className:"text-sm text-[var(--text-muted)] truncate",children:a("pipeline.subtitle",{key:t??""})})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:h,disabled:d,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black disabled:opacity-50",children:a(d?"common.saving":"pipeline.save")}),e.jsx("button",{type:"button",onClick:()=>o(`/projects/${t}`),className:"rounded-[4px] border border-[var(--border)] px-4 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("pipeline.cancel")})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 md:p-8",children:e.jsx(A,{value:r,onChange:c})})]})}export{V as default};
3
+ `).forEach(d=>{const l=d.indexOf("=");l>0&&(i[d.slice(0,l).trim()]=d.slice(l+1).trim())}),o({params:i})},placeholder:"KEY=value (one per line)",rows:3})]})]})}function D({value:t,onChange:o}){const[a,r]=p.useState(t.trim().length>0);return p.useEffect(()=>{!a&&t.trim().length>0&&r(!0)},[t,a]),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("button",{type:"button",onClick:()=>r(c=>!c),className:"flex w-full items-center justify-between px-4 py-3 text-left font-mono text-xs font-semibold text-[var(--accent)]",children:[e.jsx("span",{children:"preamble"}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a?"[-]":"[+]"})]}),a&&e.jsx("div",{className:"border-t border-[var(--border)] px-4 py-3",children:e.jsx(N,{value:t,onChange:o,placeholder:"Global pre-prompt injected before all stages",rows:4})})]})}function A({value:t,onChange:o}){const{t:a}=g(),[r,c]=p.useState(null),[s,i]=p.useState(!1),d=p.useMemo(()=>t??O,[t]),l=d.stages,h=r!=null?l[r]??null:null,f=p.useMemo(()=>l.map(n=>n.name),[l]),v=p.useCallback(n=>{o({...d,stages:n})},[o,d]),F=p.useCallback(()=>{const n=[...l,q()];v(n),c(n.length-1)},[l,v]),E=p.useCallback(n=>{const x=l.filter((m,u)=>u!==n);v(x),r===n?c(x.length>0?Math.min(n,x.length-1):null):r!=null&&r>n&&c(r-1)},[l,r,v]),w=p.useCallback((n,x)=>{const m=l.map((u,P)=>P===n?{...u,...x}:u);v(m)},[l,v]),k=p.useCallback((n,x)=>{const m=x==="up"?n-1:n+1;if(m<0||m>=l.length)return;const u=[...l];[u[n],u[m]]=[u[m],u[n]],v(u),r===n?c(m):r===m&&c(n)},[l,r,v]),L=p.useMemo(()=>JSON.stringify(d,null,2),[d]);return e.jsxs("div",{className:"flex flex-col gap-0",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{type:"button",onClick:()=>i(n=>!n),className:`rounded-[4px] border px-2 py-1 font-mono text-[11px] transition-colors ${s?"border-[var(--accent)] text-[var(--accent)]":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:[a("pipeline.json_toggle")," ⇅"]})}),s&&e.jsx("pre",{className:"mb-4 max-h-[400px] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3 font-mono text-[11px] leading-relaxed text-[var(--text-primary)]",children:L}),e.jsx("div",{className:"mb-4",children:e.jsx(D,{value:d.preamble??"",onChange:n=>o({...d,preamble:n||void 0})})}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.map((n,x)=>{var m;return e.jsxs("div",{children:[e.jsx(T,{stage:n,index:x,selected:r===x,onSelect:()=>c(x),onDelete:()=>E(x)}),x<l.length-1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"▼"}),e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"})]}),((m=n.onFailure)==null?void 0:m.goto)&&e.jsx("div",{className:"flex items-center justify-center gap-1.5 py-1",children:e.jsxs("span",{className:"text-[11px] text-[var(--warning)]",children:["↺ loop → ",n.onFailure.goto," (max ",n.onFailure.maxLoops,")"]})})]},`${x}-${n.name}`)}),r!=null&&l.length>1&&e.jsxs("div",{className:"flex items-center gap-1 pl-7 pt-2",children:[e.jsxs("button",{type:"button",disabled:r===0,onClick:()=>k(r,"up"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▲ ",a("pipeline.up")]}),e.jsxs("button",{type:"button",disabled:r===l.length-1,onClick:()=>k(r,"down"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▼ ",a("pipeline.down")]})]}),e.jsx("div",{className:"flex items-center justify-center py-3",children:e.jsxs("button",{type:"button",onClick:F,className:"flex items-center gap-1.5 rounded-[4px] border border-dashed border-[var(--border)] px-4 py-2 font-mono text-xs text-[var(--accent)] transition-colors hover:border-[var(--accent)] hover:bg-[var(--bg-secondary)]",children:[e.jsx("span",{className:"text-sm leading-none",children:"+"})," ",a("pipeline.add_stage")]})}),h&&e.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs font-semibold text-[var(--accent)]",children:a("pipeline.stage_properties")}),e.jsx("button",{type:"button",onClick:()=>c(null),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 font-mono text-[11px] text-[var(--text-muted)]",children:"x"})]}),e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f})]})]}),e.jsx("div",{className:"hidden w-[360px] shrink-0 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 lg:block",style:{alignSelf:"flex-start",position:"sticky",top:0},children:h?e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f}):e.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:e.jsx("p",{className:"font-mono text-xs text-[var(--text-muted)]",children:a("pipeline.select_stage")})})})]})]})}function V(){const{key:t}=I(),o=M(),{t:a}=g(),[r,c]=p.useState(null),[s,i]=p.useState(!0),[d,l]=p.useState(!1);p.useEffect(()=>{t&&S.get(`web/projects/${t}`).json().then(f=>{if(f.pipeline)try{c(JSON.parse(f.pipeline))}catch{c(null)}}).catch(()=>y.error(a("pipeline.failed_to_load_project"))).finally(()=>i(!1))},[t,a]);const h=p.useCallback(async()=>{if(t){l(!0);try{await S.put(`web/projects/${t}`,{json:{pipeline:r?JSON.stringify(r):null}}),y.success(a("pipeline.saved"))}catch{y.error(a("pipeline.failed_to_save"))}finally{l(!1)}}},[t,r,a]);return s?e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("pipeline.loading_pipeline")})}):e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-[var(--border)] px-4 md:px-8 py-5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-base font-medium text-[var(--text-primary)] shrink-0",children:a("pipeline.title")}),e.jsx("span",{className:"text-sm text-[var(--text-muted)] truncate",children:a("pipeline.subtitle",{key:t??""})})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:h,disabled:d,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black disabled:opacity-50",children:a(d?"common.saving":"pipeline.save")}),e.jsx("button",{type:"button",onClick:()=>o(`/projects/${t}`),className:"rounded-[4px] border border-[var(--border)] px-4 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("pipeline.cancel")})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 md:p-8",children:e.jsx(A,{value:r,onChange:c})})]})}export{V as default};
@@ -1 +1 @@
1
- import{f as Q,a as H,k as J,r,h as j,o as s,t as M,w as V,j as t,K as Z,l as z,G as W}from"./index-PZwTchr_.js";import{E as X}from"./EmptyState-BfgwLg0u.js";import{T as Y}from"./Skeleton-CNV0Dyd8.js";import{f as ee}from"./date-RFA7-ZGs.js";import{S as te}from"./Select-CaAVBHmI.js";import{P as re}from"./plus-CCF-PMRF.js";import{E as se}from"./external-link-Bbo-dc9z.js";import{C as ae}from"./chevron-left-D5fJVFiB.js";import{C as oe}from"./chevron-right-Bz-j2WmS.js";import"./chevron-down-DyqUpmgf.js";const ne=[s.QUEUED,s.ASSIGNED,s.RUNNING,s.SUSPENDED],ce=20;function ie(n,a){if(!n)return null;const v=n.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),c=a.split("/").map(encodeURIComponent).join("/");return n.gitPlatform===W.GITLAB?`${v}/-/tree/${c}/docs/specs`:`${v}/tree/${c}/docs/specs`}function le(n){switch(n){case s.RUNNING:return"bg-[var(--accent)]";case s.QUEUED:return"bg-[var(--warning)]";case s.ASSIGNED:return"bg-[var(--info)]";case s.SUSPENDED:return"bg-[var(--warning)]";case s.COMPLETED:return"bg-[var(--accent)]";case s.FAILED:return"bg-[var(--destructive)]";case s.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}function je(){const n=Q(),{t:a}=H(),v=J(e=>e.taskSeq),[c,G]=r.useState("in_progress"),[y,w]=r.useState([]),[k,D]=r.useState(!0),[u,P]=r.useState(void 0),[g,N]=r.useState(void 0),[p,E]=r.useState([]),[h,T]=r.useState({}),[i,R]=r.useState([]),[x,L]=r.useState(""),[m,U]=r.useState(""),[S,_]=r.useState(!1),O=r.useMemo(()=>{const e={};for(const o of i)e[o.key]=o;return e},[i]);r.useEffect(()=>{let e=!1;return j.get("web/projects").json().then(o=>{e||R(o)}).catch(()=>{}),()=>{e=!0}},[]),r.useEffect(()=>{i.length>0&&!x&&L(i[0].key)},[i]);const A=r.useCallback(async e=>{D(!0);try{const o=new URLSearchParams({taskMode:"plan",limit:String(ce)});c==="in_progress"?o.set("status",ne.join(",")):o.set("status",s.COMPLETED+","+s.FAILED+","+s.CANCELLED),e&&o.set("cursor",e);const b=await j.get(`web/tasks?${o}`).json(),f=b.data??[];w(f),P(b.nextCursor);const l=f.filter(d=>d.status===s.COMPLETED).map(d=>d.id);if(l.length>0){const d={};await Promise.all(l.map(async C=>{try{const F=await j.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(C),limit:"100"})}`).json();d[C]=(F.data??[]).length}catch{d[C]=0}})),T(d)}else T({})}catch{w([]),P(void 0)}finally{D(!1)}},[c]);r.useEffect(()=>{A(g)},[A,g,v]),r.useEffect(()=>{N(void 0),E([])},[c]);const K=r.useCallback(()=>{u&&(E(e=>[...e,g??""]),N(u))},[u,g]),B=r.useCallback(()=>{p.length!==0&&(N(p.at(-1)||void 0),E(e=>e.slice(0,-1)))},[p]),q=p.length+1,$=r.useCallback(async()=>{if(!x||!m.trim()){M.error("project and description are required.");return}_(!0);try{const e=await j.post("web/tasks",{json:{projectKey:x,description:m.trim(),taskMode:"plan"}}).json();U(""),n(`/tasks/${e.task.id}`)}catch(e){const o=e instanceof Error?e.message:String(e);M.error(o)}finally{_(!1)}},[x,m,n]),I=r.useMemo(()=>i.map(e=>({value:e.key,label:e.name})),[i]);return V(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:a("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(te,{value:x,onChange:L,options:I.length>0?I:[{value:"",label:"loading..."}],className:"md:w-44 shrink-0"}),t.jsx("input",{type:"text",placeholder:a("plan.description_placeholder"),value:m,onChange:e=>U(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!S&&$()},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:$,disabled:S||!x||!m.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(re,{className:"h-3.5 w-3.5"}),a(S?"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:()=>G(e),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${c===e?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:a(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:[k&&y.length===0&&t.jsx("div",{className:"p-4",children:t.jsx(Y,{rows:4})}),!k&&y.length===0&&t.jsx(X,{icon:Z,title:a("plan.no_plans"),description:a("plan.description_placeholder")}),y.map(e=>t.jsxs("div",{onClick:()=>n(`/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 ${le(e.status)}`}),t.jsxs("span",{className:"flex-1 truncate text-xs text-[var(--text-primary)]",children:["#",e.id," ",z(e)]}),e.status===s.COMPLETED&&h[e.id]!=null&&h[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:`${h[e.id]} downstream task(s)`,children:[h[e.id]," tasks"]}),e.status===s.COMPLETED&&(()=>{const o=O[e.projectKey];if(!o)return null;let b="main";if(e.configSnapshot)try{const l=JSON.parse(e.configSnapshot);l.defaultBranch&&(b=l.defaultBranch)}catch{}const f=ie(o,b);return f?t.jsxs("a",{href:f,target:"_blank",rel:"noopener noreferrer",onClick:l=>l.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:a("plan.view_spec"),children:[t.jsx(se,{className:"h-2.5 w-2.5"}),a("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:ee(e.createdAt)})]},e.id))]}),(p.length>0||u)&&t.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",q]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:B,disabled:p.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(ae,{className:"h-3.5 w-3.5"}),a("tasks.prev")]}),t.jsxs("button",{onClick:K,disabled:!u,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:[a("common.next"),t.jsx(oe,{className:"h-3.5 w-3.5"})]})]})]})]})}export{je as default};
1
+ import{f as Q,a as H,k as J,r,h as j,o as s,t as M,w as V,j as t,K as Z,l as z,G as W}from"./index-Dc7l0IT6.js";import{E as X}from"./EmptyState-Dtc0ZNRp.js";import{T as Y}from"./Skeleton-_rq02txk.js";import{f as ee}from"./date-CmcdoD87.js";import{S as te}from"./Select-67FOknim.js";import{P as re}from"./plus-g2yZrAF7.js";import{E as se}from"./external-link-ChvrB9MU.js";import{C as ae}from"./chevron-left-DeBK5qpt.js";import{C as oe}from"./chevron-right-c3y2M4GO.js";import"./chevron-down-USdSAtLM.js";const ne=[s.QUEUED,s.ASSIGNED,s.RUNNING,s.SUSPENDED],ce=20;function ie(n,a){if(!n)return null;const v=n.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),c=a.split("/").map(encodeURIComponent).join("/");return n.gitPlatform===W.GITLAB?`${v}/-/tree/${c}/docs/specs`:`${v}/tree/${c}/docs/specs`}function le(n){switch(n){case s.RUNNING:return"bg-[var(--accent)]";case s.QUEUED:return"bg-[var(--warning)]";case s.ASSIGNED:return"bg-[var(--info)]";case s.SUSPENDED:return"bg-[var(--warning)]";case s.COMPLETED:return"bg-[var(--accent)]";case s.FAILED:return"bg-[var(--destructive)]";case s.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}function je(){const n=Q(),{t:a}=H(),v=J(e=>e.taskSeq),[c,G]=r.useState("in_progress"),[y,w]=r.useState([]),[k,D]=r.useState(!0),[u,P]=r.useState(void 0),[g,N]=r.useState(void 0),[p,E]=r.useState([]),[h,T]=r.useState({}),[i,R]=r.useState([]),[x,L]=r.useState(""),[m,U]=r.useState(""),[S,_]=r.useState(!1),O=r.useMemo(()=>{const e={};for(const o of i)e[o.key]=o;return e},[i]);r.useEffect(()=>{let e=!1;return j.get("web/projects").json().then(o=>{e||R(o)}).catch(()=>{}),()=>{e=!0}},[]),r.useEffect(()=>{i.length>0&&!x&&L(i[0].key)},[i]);const A=r.useCallback(async e=>{D(!0);try{const o=new URLSearchParams({taskMode:"plan",limit:String(ce)});c==="in_progress"?o.set("status",ne.join(",")):o.set("status",s.COMPLETED+","+s.FAILED+","+s.CANCELLED),e&&o.set("cursor",e);const b=await j.get(`web/tasks?${o}`).json(),f=b.data??[];w(f),P(b.nextCursor);const l=f.filter(d=>d.status===s.COMPLETED).map(d=>d.id);if(l.length>0){const d={};await Promise.all(l.map(async C=>{try{const F=await j.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(C),limit:"100"})}`).json();d[C]=(F.data??[]).length}catch{d[C]=0}})),T(d)}else T({})}catch{w([]),P(void 0)}finally{D(!1)}},[c]);r.useEffect(()=>{A(g)},[A,g,v]),r.useEffect(()=>{N(void 0),E([])},[c]);const K=r.useCallback(()=>{u&&(E(e=>[...e,g??""]),N(u))},[u,g]),B=r.useCallback(()=>{p.length!==0&&(N(p.at(-1)||void 0),E(e=>e.slice(0,-1)))},[p]),q=p.length+1,$=r.useCallback(async()=>{if(!x||!m.trim()){M.error("project and description are required.");return}_(!0);try{const e=await j.post("web/tasks",{json:{projectKey:x,description:m.trim(),taskMode:"plan"}}).json();U(""),n(`/tasks/${e.task.id}`)}catch(e){const o=e instanceof Error?e.message:String(e);M.error(o)}finally{_(!1)}},[x,m,n]),I=r.useMemo(()=>i.map(e=>({value:e.key,label:e.name})),[i]);return V(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:a("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(te,{value:x,onChange:L,options:I.length>0?I:[{value:"",label:"loading..."}],className:"md:w-44 shrink-0"}),t.jsx("input",{type:"text",placeholder:a("plan.description_placeholder"),value:m,onChange:e=>U(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!S&&$()},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:$,disabled:S||!x||!m.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(re,{className:"h-3.5 w-3.5"}),a(S?"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:()=>G(e),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${c===e?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:a(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:[k&&y.length===0&&t.jsx("div",{className:"p-4",children:t.jsx(Y,{rows:4})}),!k&&y.length===0&&t.jsx(X,{icon:Z,title:a("plan.no_plans"),description:a("plan.description_placeholder")}),y.map(e=>t.jsxs("div",{onClick:()=>n(`/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 ${le(e.status)}`}),t.jsxs("span",{className:"flex-1 truncate text-xs text-[var(--text-primary)]",children:["#",e.id," ",z(e)]}),e.status===s.COMPLETED&&h[e.id]!=null&&h[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:`${h[e.id]} downstream task(s)`,children:[h[e.id]," tasks"]}),e.status===s.COMPLETED&&(()=>{const o=O[e.projectKey];if(!o)return null;let b="main";if(e.configSnapshot)try{const l=JSON.parse(e.configSnapshot);l.defaultBranch&&(b=l.defaultBranch)}catch{}const f=ie(o,b);return f?t.jsxs("a",{href:f,target:"_blank",rel:"noopener noreferrer",onClick:l=>l.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:a("plan.view_spec"),children:[t.jsx(se,{className:"h-2.5 w-2.5"}),a("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:ee(e.createdAt)})]},e.id))]}),(p.length>0||u)&&t.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",q]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:B,disabled:p.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(ae,{className:"h-3.5 w-3.5"}),a("tasks.prev")]}),t.jsxs("button",{onClick:K,disabled:!u,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:[a("common.next"),t.jsx(oe,{className:"h-3.5 w-3.5"})]})]})]})]})}export{je as default};
@@ -1 +1 @@
1
- import{a as A,u as F,f as T,r as s,j as e,L as z,a5 as I,a6 as $,s as K,h as p,t as c}from"./index-PZwTchr_.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-CIwHf1Un.js";import{u as V}from"./useFetch-6R6P2rOm.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.151"]}),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,a5 as I,a6 as $,s as K,h as p,t as c}from"./index-Dc7l0IT6.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-CzMBBOwd.js";import{u as V}from"./useFetch-CM-iw_s7.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.154"]}),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,A as K,f as B,u as H,i as J,r as x,Y as k,w as V,l as D,Z as Y,h as v}from"./index-PZwTchr_.js";import{U as P,A as Z,R as z}from"./RemoveMemberConfirmDialog-Da3XlOxO.js";import{T as G}from"./Tooltip-DzkVglKi.js";import{c as _}from"./date-RFA7-ZGs.js";import{t as T}from"./status-colors-DDycfcf7.js";import{I as o}from"./InfoRow-CIwHf1Un.js";import{u as Q}from"./useFetch-6R6P2rOm.js";import{P as X}from"./pencil-Dgj4md4-.js";import{T as ee}from"./trash-2-DXJqRCdo.js";import{A as te}from"./arrow-left-BnN4eZhK.js";import{P as re}from"./plus-CCF-PMRF.js";import"./Select-CaAVBHmI.js";import"./chevron-down-DyqUpmgf.js";/**
1
+ import{c as R,a as $,j as e,s as q,A as K,f as B,u as H,i as J,r as x,Y as k,w as V,l as D,Z as Y,h as v}from"./index-Dc7l0IT6.js";import{U as P,A as Z,R as z}from"./RemoveMemberConfirmDialog-3Zg6POcw.js";import{T as G}from"./Tooltip-BeXBpXMQ.js";import{c as _}from"./date-CmcdoD87.js";import{t as T}from"./status-colors-PFYg7zX9.js";import{I as o}from"./InfoRow-CzMBBOwd.js";import{u as Q}from"./useFetch-CM-iw_s7.js";import{P as X}from"./pencil-CfrtWF-J.js";import{T as ee}from"./trash-2-CgnGXyNP.js";import{A as te}from"./arrow-left-DqjVoydc.js";import{P as re}from"./plus-g2yZrAF7.js";import"./Select-67FOknim.js";import"./chevron-down-USdSAtLM.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 I,a as P,v as R,r as o,G as x,O as z,j as e,h as E,f as H,w as M}from"./index-PZwTchr_.js";import{S as U}from"./Select-CaAVBHmI.js";import{a as D}from"./agent-type-options-BiwwFXJv.js";import{E as J}from"./EmptyState-BfgwLg0u.js";import{T as O}from"./Skeleton-CNV0Dyd8.js";import{t as q}from"./date-RFA7-ZGs.js";import{u as W}from"./useFetch-6R6P2rOm.js";import{P as $}from"./plus-CCF-PMRF.js";import{A as K}from"./arrow-left-BnN4eZhK.js";import"./chevron-down-DyqUpmgf.js";/**
1
+ import{c as I,a as P,v as R,r as o,G as x,O as z,j as e,h as E,f as H,w as M}from"./index-Dc7l0IT6.js";import{S as U}from"./Select-67FOknim.js";import{a as D}from"./agent-type-options-ChuePYjM.js";import{E as J}from"./EmptyState-Dtc0ZNRp.js";import{T as O}from"./Skeleton-_rq02txk.js";import{t as q}from"./date-CmcdoD87.js";import{u as W}from"./useFetch-CM-iw_s7.js";import{P as $}from"./plus-g2yZrAF7.js";import{A as K}from"./arrow-left-DqjVoydc.js";import"./chevron-down-USdSAtLM.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-PZwTchr_.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-Dc7l0IT6.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,a7 as v,j as e,C as j}from"./index-PZwTchr_.js";import{C as f}from"./copy-Dtpgo9EK.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,a7 as v,j as e,C as j}from"./index-Dc7l0IT6.js";import{C as f}from"./copy-BvsnHVjA.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,Y as c,j as e,X as C,h as g,s as D}from"./index-PZwTchr_.js";import{S as N}from"./Select-CaAVBHmI.js";/**
1
+ import{c as R,a as _,v as w,r as a,Y as c,j as e,X as C,h as g,s as D}from"./index-Dc7l0IT6.js";import{S as N}from"./Select-67FOknim.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 de,A as xe,f as me,a as B,k as pe,r as n,h as L,j as e,L as ue,Q as H,V as ve,t as f,o as v,b as be,O as ge,X as he}from"./index-PZwTchr_.js";import{P as fe}from"./PtyTerminal-CxBKQBbF.js";import{T as je}from"./Skeleton-CNV0Dyd8.js";import{f as Ne,b as we}from"./date-RFA7-ZGs.js";import{a as ye}from"./agent-type-options-BiwwFXJv.js";import{T as G,g as Q}from"./task-constants-CSVY_jfk.js";import{A as ke}from"./arrow-left-BnN4eZhK.js";import{L as Se}from"./loader-circle-nKG9e8iK.js";import{P as z}from"./play-DFj8BMl8.js";import{S as Ce}from"./skip-forward-Ck7tY58a.js";import{R as Te}from"./rotate-ccw-CyltG4Qx.js";import{C as Ae}from"./chevron-up-DEXIEMJO.js";import{C as Ee}from"./chevron-down-DyqUpmgf.js";import{C as Re}from"./circle-alert-DE06tNOV.js";/**
1
+ import{c as de,A as xe,f as me,a as B,k as pe,r as n,h as L,j as e,L as ue,Q as H,V as ve,t as f,o as v,b as be,O as ge,X as he}from"./index-Dc7l0IT6.js";import{P as fe}from"./PtyTerminal-CDGp4pLP.js";import{T as je}from"./Skeleton-_rq02txk.js";import{f as Ne,b as we}from"./date-CmcdoD87.js";import{a as ye}from"./agent-type-options-ChuePYjM.js";import{T as G,g as Q}from"./task-constants-BtTS5GQt.js";import{A as ke}from"./arrow-left-DqjVoydc.js";import{L as Se}from"./loader-circle-CA2KGzXp.js";import{P as z}from"./play-C_ZVU9H5.js";import{S as Ce}from"./skip-forward-BQCBn5yW.js";import{R as Te}from"./rotate-ccw-C1EaXve8.js";import{C as Ae}from"./chevron-up-DCDYf3Az.js";import{C as Ee}from"./chevron-down-USdSAtLM.js";import{C as Re}from"./circle-alert-l_FFcF-_.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 y,k as G,r as a,w as K,j as e,h as N,f as S,o as p,E,l as F,X as T,H as B,t as w,O as H}from"./index-PZwTchr_.js";import{E as D}from"./EmptyState-BfgwLg0u.js";import{T as L}from"./Skeleton-CNV0Dyd8.js";import{S as k}from"./Select-CaAVBHmI.js";import{f as P}from"./date-RFA7-ZGs.js";import{T as A}from"./Tooltip-DzkVglKi.js";import{a as q}from"./agent-type-options-BiwwFXJv.js";import{g as z}from"./task-constants-CSVY_jfk.js";import{P as R}from"./play-DFj8BMl8.js";import{C as Q}from"./chevron-left-D5fJVFiB.js";import{C as X}from"./chevron-right-Bz-j2WmS.js";import"./chevron-down-DyqUpmgf.js";function $(){const[t,n]=a.useState(void 0),[s,i]=a.useState(void 0),[x,o]=a.useState([]),u=a.useRef(void 0),g=a.useRef(void 0);u.current=t,g.current=s;const m=a.useCallback(d=>{n(d)},[]),h=a.useCallback(()=>{const d=u.current;d&&(o(j=>[...j,g.current??""]),i(d))},[]),b=a.useRef([]);b.current=x;const l=a.useCallback(()=>{const d=b.current;d.length!==0&&(i(d.at(-1)||void 0),o(d.slice(0,-1)))},[]),r=x.length+1,c=x.length>0;return{cursor:s,setNextCursor:m,goNext:h,goPrev:l,pageNumber:r,hasPrev:c,hasNext:!!t}}const I=20;function Z(t){switch(t){case p.RUNNING:return"bg-[var(--accent)]";case p.QUEUED:return"bg-[var(--warning)]";case p.ASSIGNED:return"bg-[var(--info)]";case p.SUSPENDED:return"bg-[var(--warning)]";case p.COMPLETED:return"bg-[var(--accent)]";case p.FAILED:return"bg-[var(--destructive)]";case p.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}const J=q(z);function V({taskId:t,onClose:n,onLaunched:s}){const{t:i}=y(),[x,o]=a.useState([H.CLAUDE]),[u,g]=a.useState(""),[m,h]=a.useState(!1);function b(r){o(c=>c.includes(r)?c.filter(f=>f!==r):[...c,r])}async function l(){if(x.length===0){w.error("select at least one review agent.");return}h(!0);try{await N.post(`web/tasks/${t}/review`,{json:{agentTypes:x,description:u.trim()||void 0}}),w.success("review launched"),s(),n()}catch(r){const c=r instanceof Error?r.message:String(r);w.error(c)}finally{h(!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:i("review.launch")}),e.jsx("button",{onClick:n,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 #",t," — ",i("review.select_agents")]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:J.map(r=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:x.includes(r.value),onChange:()=>b(r.value),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:r.label})]},r.value))}),e.jsx("textarea",{value:u,onChange:r=>g(r.target.value),placeholder:i("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:l,disabled:m||x.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"}),i(m?"common.processing":"review.launch")]}),e.jsx("button",{onClick:n,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:i("common.cancel")})]})]})})}function _({pag:t}){const{t:n}=y();return!t.hasPrev&&!t.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 ",t.pageNumber]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:t.goPrev,disabled:!t.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(Q,{className:"h-3.5 w-3.5"}),n("tasks.prev")]}),e.jsxs("button",{onClick:t.goNext,disabled:!t.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:[n("common.next"),e.jsx(X,{className:"h-3.5 w-3.5"})]})]})]})}function W({onRefresh:t,projectFilter:n,developerFilter:s}){const{t:i}=y(),x=S(),[o,u]=a.useState([]),[g,m]=a.useState(!0),[h,b]=a.useState(null),l=$(),r=a.useCallback(async c=>{m(!0);try{const f=new Date(Date.now()-6048e5).toISOString(),d=new URLSearchParams({status:p.COMPLETED,taskMode:"develop",reviewStatus:"null",completedAfter:f,limit:String(I)});n&&d.set("projectKey",n),s&&d.set("developerId",s),c&&d.set("cursor",c);const j=await N.get(`web/tasks?${d}`).json();u(j.data??[]),l.setNextCursor(j.nextCursor)}catch{u([]),l.setNextCursor(void 0)}finally{m(!1)}},[n,s]);return a.useEffect(()=>{r(l.cursor)},[r,l.cursor]),g&&o.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!g&&o.length===0&&!l.hasPrev?e.jsx(D,{icon:E,title:i("review.no_reviews"),description:i("review.pending")}):e.jsxs(e.Fragment,{children:[o.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:o.map(c=>e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsx(A,{content:c.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",onClick:()=>x(`/tasks/${c.id}`),children:["#",c.id," ",F(c)]})}),e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:c.projectKey}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:P(c.completedAt??c.createdAt)}),e.jsxs("button",{onClick:async()=>{try{await N.post(`web/tasks/${c.id}/review-status`,{json:{reviewStatus:"dismissed"}}),r(l.cursor)}catch(f){let d="Failed to dismiss";try{if(f instanceof B){const j=await f.response.json();d=(j==null?void 0:j.message)??d}else f instanceof Error&&(d=f.message)}catch{}w.error(d)}},className:"shrink-0 flex items-center gap-1.5 rounded-[4px] px-3 py-1.5 text-[11px] font-medium text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(T,{className:"h-3 w-3"}),"Dismiss"]}),e.jsxs("button",{onClick:()=>b(c.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:i("review.launch_short")})]})]},c.id))}),e.jsx(_,{pag:l}),h!==null&&e.jsx(V,{taskId:h,onClose:()=>b(null),onLaunched:()=>{t(),r(l.cursor)}})]})}function Y(t){const n=new Map;for(const s of t){const i=s.sourceTaskId??s.id;n.has(i)||n.set(i,[]),n.get(i).push(s)}return Array.from(n.entries()).map(([s,i])=>({sourceTaskId:s,tasks:i}))}function ee({group:t,onClick:n}){const s=t.tasks[0],i=t.tasks.every(o=>o.status===p.COMPLETED||o.status===p.FAILED||o.status===p.CANCELLED),x=s==null?void 0:s.sourceCommitSha;return e.jsxs("div",{onClick:n,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 ${i?"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:(s==null?void 0:s.sourceTaskDescription)??(s==null?void 0:s.description),className:"truncate",children:e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["source #",t.sourceTaskId]})}),x&&e.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-[var(--accent)]",children:["@",x.slice(0,7)]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[t.tasks.length," ",t.tasks.length===1?"agent":"agents"," · ",t.tasks.map(o=>(o.agentType??"claude").toLowerCase()).join(", ")]})]}),s&&e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:s.projectKey}),s&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:P(s.createdAt)}),e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:t.tasks.map(o=>e.jsx("span",{className:`h-2 w-2 rounded-full ${Z(o.status)}`,title:o.status.toLowerCase()},o.id))})]})}function C({mode:t,projectFilter:n,developerFilter:s}){const{t:i}=y(),x=S(),[o,u]=a.useState([]),[g,m]=a.useState(!0),h=$(),b=a.useCallback(async l=>{m(!0);try{const r=new URLSearchParams({taskMode:"review",limit:String(I),groupBySource:"true"});t==="in_progress"?r.set("status",[p.QUEUED,p.ASSIGNED,p.RUNNING,p.SUSPENDED].join(",")):r.set("status",[p.COMPLETED,p.FAILED,p.CANCELLED].join(",")),n&&r.set("projectKey",n),s&&r.set("sourceDeveloperId",s),l&&r.set("cursor",l);const c=await N.get(`web/tasks?${r}`).json();u(Y(c.data??[])),h.setNextCursor(c.nextCursor??void 0)}catch{u([]),h.setNextCursor(void 0)}finally{m(!1)}},[t,n,s]);return a.useEffect(()=>{b(h.cursor)},[b,h.cursor]),g&&o.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!g&&o.length===0&&!h.hasPrev?e.jsx(D,{icon:E,title:i("review.no_reviews")}):e.jsxs(e.Fragment,{children:[o.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:o.map(l=>e.jsx(ee,{group:l,onClick:()=>x(`/review/${l.sourceTaskId}`)},l.sourceTaskId))}),e.jsx(_,{pag:h})]})}function pe(){const{t}=y(),n=G(v=>v.taskSeq),[s,i]=a.useState("pending"),[x,o]=a.useState(0),[u,g]=a.useState(""),[m,h]=a.useState(""),[b,l]=a.useState([]),[r,c]=a.useState([]);K(null);const f=a.useCallback(()=>o(v=>v+1),[]);a.useEffect(()=>{let v=!1;return(async()=>{try{const[U,M]=await Promise.all([N.get("web/projects").json(),N.get("web/projects/-/developers").json()]);if(v)return;l(U),c(M)}catch{}})(),()=>{v=!0}},[]);const d=a.useMemo(()=>[{value:"",label:t("tasks.filter_project")},...b.map(v=>({value:v.key,label:v.name}))],[b,t]),j=a.useMemo(()=>[{value:"",label:t("tasks.filter_developer")},...r.map(v=>({value:String(v.id),label:v.name}))],[r,t]),O=[{key:"pending",label:t("review.pending")},{key:"in_progress",label:t("review.in_progress")},{key:"history",label:t("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:t("review.title")}),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",children:O.map(v=>e.jsx("button",{onClick:()=>i(v.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${s===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("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsx(k,{value:u,onChange:g,options:d,className:"md:w-40"}),e.jsx(k,{value:m,onChange:h,options:j,className:"md:w-40"})]})]}),s==="pending"&&e.jsx(W,{onRefresh:f,projectFilter:u,developerFilter:m},`pending-${x}-${n}-${u}-${m}`),s==="in_progress"&&e.jsx(C,{mode:"in_progress",projectFilter:u,developerFilter:m},`inprogress-${x}-${n}-${u}-${m}`),s==="history"&&e.jsx(C,{mode:"history",projectFilter:u,developerFilter:m},`history-${x}-${n}-${u}-${m}`)]})}export{pe as default};
1
+ import{a as y,k as G,r as a,w as K,j as e,h as N,f as S,o as p,E,l as F,X as T,H as B,t as w,O as H}from"./index-Dc7l0IT6.js";import{E as D}from"./EmptyState-Dtc0ZNRp.js";import{T as L}from"./Skeleton-_rq02txk.js";import{S as k}from"./Select-67FOknim.js";import{f as P}from"./date-CmcdoD87.js";import{T as A}from"./Tooltip-BeXBpXMQ.js";import{a as q}from"./agent-type-options-ChuePYjM.js";import{g as z}from"./task-constants-BtTS5GQt.js";import{P as R}from"./play-C_ZVU9H5.js";import{C as Q}from"./chevron-left-DeBK5qpt.js";import{C as X}from"./chevron-right-c3y2M4GO.js";import"./chevron-down-USdSAtLM.js";function $(){const[t,n]=a.useState(void 0),[s,i]=a.useState(void 0),[x,o]=a.useState([]),u=a.useRef(void 0),g=a.useRef(void 0);u.current=t,g.current=s;const m=a.useCallback(d=>{n(d)},[]),h=a.useCallback(()=>{const d=u.current;d&&(o(j=>[...j,g.current??""]),i(d))},[]),b=a.useRef([]);b.current=x;const l=a.useCallback(()=>{const d=b.current;d.length!==0&&(i(d.at(-1)||void 0),o(d.slice(0,-1)))},[]),r=x.length+1,c=x.length>0;return{cursor:s,setNextCursor:m,goNext:h,goPrev:l,pageNumber:r,hasPrev:c,hasNext:!!t}}const I=20;function Z(t){switch(t){case p.RUNNING:return"bg-[var(--accent)]";case p.QUEUED:return"bg-[var(--warning)]";case p.ASSIGNED:return"bg-[var(--info)]";case p.SUSPENDED:return"bg-[var(--warning)]";case p.COMPLETED:return"bg-[var(--accent)]";case p.FAILED:return"bg-[var(--destructive)]";case p.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}const J=q(z);function V({taskId:t,onClose:n,onLaunched:s}){const{t:i}=y(),[x,o]=a.useState([H.CLAUDE]),[u,g]=a.useState(""),[m,h]=a.useState(!1);function b(r){o(c=>c.includes(r)?c.filter(f=>f!==r):[...c,r])}async function l(){if(x.length===0){w.error("select at least one review agent.");return}h(!0);try{await N.post(`web/tasks/${t}/review`,{json:{agentTypes:x,description:u.trim()||void 0}}),w.success("review launched"),s(),n()}catch(r){const c=r instanceof Error?r.message:String(r);w.error(c)}finally{h(!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:i("review.launch")}),e.jsx("button",{onClick:n,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 #",t," — ",i("review.select_agents")]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:J.map(r=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("input",{type:"checkbox",checked:x.includes(r.value),onChange:()=>b(r.value),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:r.label})]},r.value))}),e.jsx("textarea",{value:u,onChange:r=>g(r.target.value),placeholder:i("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:l,disabled:m||x.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"}),i(m?"common.processing":"review.launch")]}),e.jsx("button",{onClick:n,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:i("common.cancel")})]})]})})}function _({pag:t}){const{t:n}=y();return!t.hasPrev&&!t.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 ",t.pageNumber]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:t.goPrev,disabled:!t.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(Q,{className:"h-3.5 w-3.5"}),n("tasks.prev")]}),e.jsxs("button",{onClick:t.goNext,disabled:!t.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:[n("common.next"),e.jsx(X,{className:"h-3.5 w-3.5"})]})]})]})}function W({onRefresh:t,projectFilter:n,developerFilter:s}){const{t:i}=y(),x=S(),[o,u]=a.useState([]),[g,m]=a.useState(!0),[h,b]=a.useState(null),l=$(),r=a.useCallback(async c=>{m(!0);try{const f=new Date(Date.now()-6048e5).toISOString(),d=new URLSearchParams({status:p.COMPLETED,taskMode:"develop",reviewStatus:"null",completedAfter:f,limit:String(I)});n&&d.set("projectKey",n),s&&d.set("developerId",s),c&&d.set("cursor",c);const j=await N.get(`web/tasks?${d}`).json();u(j.data??[]),l.setNextCursor(j.nextCursor)}catch{u([]),l.setNextCursor(void 0)}finally{m(!1)}},[n,s]);return a.useEffect(()=>{r(l.cursor)},[r,l.cursor]),g&&o.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!g&&o.length===0&&!l.hasPrev?e.jsx(D,{icon:E,title:i("review.no_reviews"),description:i("review.pending")}):e.jsxs(e.Fragment,{children:[o.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:o.map(c=>e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsx(A,{content:c.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",onClick:()=>x(`/tasks/${c.id}`),children:["#",c.id," ",F(c)]})}),e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:c.projectKey}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:P(c.completedAt??c.createdAt)}),e.jsxs("button",{onClick:async()=>{try{await N.post(`web/tasks/${c.id}/review-status`,{json:{reviewStatus:"dismissed"}}),r(l.cursor)}catch(f){let d="Failed to dismiss";try{if(f instanceof B){const j=await f.response.json();d=(j==null?void 0:j.message)??d}else f instanceof Error&&(d=f.message)}catch{}w.error(d)}},className:"shrink-0 flex items-center gap-1.5 rounded-[4px] px-3 py-1.5 text-[11px] font-medium text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(T,{className:"h-3 w-3"}),"Dismiss"]}),e.jsxs("button",{onClick:()=>b(c.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:i("review.launch_short")})]})]},c.id))}),e.jsx(_,{pag:l}),h!==null&&e.jsx(V,{taskId:h,onClose:()=>b(null),onLaunched:()=>{t(),r(l.cursor)}})]})}function Y(t){const n=new Map;for(const s of t){const i=s.sourceTaskId??s.id;n.has(i)||n.set(i,[]),n.get(i).push(s)}return Array.from(n.entries()).map(([s,i])=>({sourceTaskId:s,tasks:i}))}function ee({group:t,onClick:n}){const s=t.tasks[0],i=t.tasks.every(o=>o.status===p.COMPLETED||o.status===p.FAILED||o.status===p.CANCELLED),x=s==null?void 0:s.sourceCommitSha;return e.jsxs("div",{onClick:n,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 ${i?"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:(s==null?void 0:s.sourceTaskDescription)??(s==null?void 0:s.description),className:"truncate",children:e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["source #",t.sourceTaskId]})}),x&&e.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-[var(--accent)]",children:["@",x.slice(0,7)]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[t.tasks.length," ",t.tasks.length===1?"agent":"agents"," · ",t.tasks.map(o=>(o.agentType??"claude").toLowerCase()).join(", ")]})]}),s&&e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:s.projectKey}),s&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:P(s.createdAt)}),e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:t.tasks.map(o=>e.jsx("span",{className:`h-2 w-2 rounded-full ${Z(o.status)}`,title:o.status.toLowerCase()},o.id))})]})}function C({mode:t,projectFilter:n,developerFilter:s}){const{t:i}=y(),x=S(),[o,u]=a.useState([]),[g,m]=a.useState(!0),h=$(),b=a.useCallback(async l=>{m(!0);try{const r=new URLSearchParams({taskMode:"review",limit:String(I),groupBySource:"true"});t==="in_progress"?r.set("status",[p.QUEUED,p.ASSIGNED,p.RUNNING,p.SUSPENDED].join(",")):r.set("status",[p.COMPLETED,p.FAILED,p.CANCELLED].join(",")),n&&r.set("projectKey",n),s&&r.set("sourceDeveloperId",s),l&&r.set("cursor",l);const c=await N.get(`web/tasks?${r}`).json();u(Y(c.data??[])),h.setNextCursor(c.nextCursor??void 0)}catch{u([]),h.setNextCursor(void 0)}finally{m(!1)}},[t,n,s]);return a.useEffect(()=>{b(h.cursor)},[b,h.cursor]),g&&o.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!g&&o.length===0&&!h.hasPrev?e.jsx(D,{icon:E,title:i("review.no_reviews")}):e.jsxs(e.Fragment,{children:[o.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:o.map(l=>e.jsx(ee,{group:l,onClick:()=>x(`/review/${l.sourceTaskId}`)},l.sourceTaskId))}),e.jsx(_,{pag:h})]})}function pe(){const{t}=y(),n=G(v=>v.taskSeq),[s,i]=a.useState("pending"),[x,o]=a.useState(0),[u,g]=a.useState(""),[m,h]=a.useState(""),[b,l]=a.useState([]),[r,c]=a.useState([]);K(null);const f=a.useCallback(()=>o(v=>v+1),[]);a.useEffect(()=>{let v=!1;return(async()=>{try{const[U,M]=await Promise.all([N.get("web/projects").json(),N.get("web/projects/-/developers").json()]);if(v)return;l(U),c(M)}catch{}})(),()=>{v=!0}},[]);const d=a.useMemo(()=>[{value:"",label:t("tasks.filter_project")},...b.map(v=>({value:v.key,label:v.name}))],[b,t]),j=a.useMemo(()=>[{value:"",label:t("tasks.filter_developer")},...r.map(v=>({value:String(v.id),label:v.name}))],[r,t]),O=[{key:"pending",label:t("review.pending")},{key:"in_progress",label:t("review.in_progress")},{key:"history",label:t("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:t("review.title")}),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",children:O.map(v=>e.jsx("button",{onClick:()=>i(v.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${s===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("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsx(k,{value:u,onChange:g,options:d,className:"md:w-40"}),e.jsx(k,{value:m,onChange:h,options:j,className:"md:w-40"})]})]}),s==="pending"&&e.jsx(W,{onRefresh:f,projectFilter:u,developerFilter:m},`pending-${x}-${n}-${u}-${m}`),s==="in_progress"&&e.jsx(C,{mode:"in_progress",projectFilter:u,developerFilter:m},`inprogress-${x}-${n}-${u}-${m}`),s==="history"&&e.jsx(C,{mode:"history",projectFilter:u,developerFilter:m},`history-${x}-${n}-${u}-${m}`)]})}export{pe as default};
@@ -1 +1 @@
1
- import{r as l,j as t}from"./index-PZwTchr_.js";import{C as f}from"./chevron-down-DyqUpmgf.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-Dc7l0IT6.js";import{C as f}from"./chevron-down-USdSAtLM.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-PZwTchr_.js";/**
1
+ import{c as h,a as v,r,j as e,h as m,t as u}from"./index-Dc7l0IT6.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-PZwTchr_.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-Dc7l0IT6.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-PZwTchr_.js";import{I as c,C as r}from"./DocsPrimitives-DCBNKtsW.js";import{E as n}from"./external-link-Bbo-dc9z.js";import"./copy-Dtpgo9EK.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-Dc7l0IT6.js";import{I as c,C as r}from"./DocsPrimitives-BCcIgi-N.js";import{E as n}from"./external-link-ChvrB9MU.js";import"./copy-BvsnHVjA.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 oe,a as xe,r as n,z as P,h as f,j as e,H as zt,t as W,s as Ce,A as Kt,f as Wt,B as Xt,p as Ht,q as Vt,k as dt,o as y,R as Jt,L as ie,l as mt,m as Qt,X as _e,x as Yt,U as Zt,F as pt,b as es,G as _t,I as ts}from"./index-PZwTchr_.js";import{u as ss}from"./task.store-BTXbcXgO.js";import{P as ut}from"./PtyTerminal-CxBKQBbF.js";import{g as as,C as ht,H as rs}from"./ConfirmStageDialog-CJ8pWink.js";import{S as ft}from"./Select-CaAVBHmI.js";import{b as ns,f as Q,c as ls}from"./date-RFA7-ZGs.js";import{a as St}from"./status-colors-DDycfcf7.js";import{a as vt}from"./agent-type-options-BiwwFXJv.js";import{T as cs,g as Y}from"./task-constants-CSVY_jfk.js";import{T as is}from"./Tooltip-DzkVglKi.js";import{A as os}from"./arrow-left-BnN4eZhK.js";import{R as Ct}from"./rotate-ccw-CyltG4Qx.js";import{G as xs}from"./git-fork-A1WGp9ha.js";import{P as gt}from"./play-DFj8BMl8.js";import{E as bt}from"./external-link-Bbo-dc9z.js";import{L as Et}from"./loader-circle-nKG9e8iK.js";import{S as ds}from"./skip-forward-Ck7tY58a.js";import"./clock-DyV22whY.js";import"./chevron-down-DyqUpmgf.js";/**
1
+ import{c as oe,a as xe,r as n,z as P,h as f,j as e,H as zt,t as W,s as Ce,A as Kt,f as Wt,B as Xt,p as Ht,q as Vt,k as dt,o as y,R as Jt,L as ie,l as mt,m as Qt,X as _e,x as Yt,U as Zt,F as pt,b as es,G as _t,I as ts}from"./index-Dc7l0IT6.js";import{u as ss}from"./task.store-2YMrViYj.js";import{P as ut}from"./PtyTerminal-CDGp4pLP.js";import{g as as,C as ht,H as rs}from"./ConfirmStageDialog-DR4NtMbp.js";import{S as ft}from"./Select-67FOknim.js";import{b as ns,f as Q,c as ls}from"./date-CmcdoD87.js";import{a as St}from"./status-colors-PFYg7zX9.js";import{a as vt}from"./agent-type-options-ChuePYjM.js";import{T as cs,g as Y}from"./task-constants-BtTS5GQt.js";import{T as is}from"./Tooltip-BeXBpXMQ.js";import{A as os}from"./arrow-left-DqjVoydc.js";import{R as Ct}from"./rotate-ccw-C1EaXve8.js";import{G as xs}from"./git-fork-DS0EMsEA.js";import{P as gt}from"./play-C_ZVU9H5.js";import{E as bt}from"./external-link-ChvrB9MU.js";import{L as Et}from"./loader-circle-CA2KGzXp.js";import{S as ds}from"./skip-forward-BQCBn5yW.js";import"./clock-ey7I11g5.js";import"./chevron-down-USdSAtLM.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-PZwTchr_.js";import{a as s}from"./DocsPrimitives-DCBNKtsW.js";import"./copy-Dtpgo9EK.js";const a=`ov task create -d "implement oauth login" -p WEB -t feat
1
+ import{j as e}from"./index-Dc7l0IT6.js";import{a as s}from"./DocsPrimitives-BCcIgi-N.js";import"./copy-BvsnHVjA.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 me,f as J,a as $,o as u,j as e,l as ee,u as ue,i as ve,v as te,r as a,h as P,X as he,k as be,w as fe,H as ge,t as W,x as ye,y as V,m as je}from"./index-PZwTchr_.js";import{u as X}from"./task.store-BTXbcXgO.js";import{T as se}from"./TaskStatusBadge-Dzloj2eJ.js";import{f as re}from"./date-RFA7-ZGs.js";import{T as ke}from"./Tooltip-DzkVglKi.js";import{G as ae}from"./git-fork-A1WGp9ha.js";import{S as D}from"./Select-CaAVBHmI.js";import{a as Ne}from"./task-constants-CSVY_jfk.js";import{g as Ce}from"./agent-type-options-BiwwFXJv.js";import{C as we}from"./copy-Dtpgo9EK.js";import{E as Y}from"./EmptyState-BfgwLg0u.js";import{T as Z}from"./Skeleton-CNV0Dyd8.js";import{P as Se}from"./plus-CCF-PMRF.js";import{C as _e}from"./chevron-left-D5fJVFiB.js";import{C as Te}from"./chevron-right-Bz-j2WmS.js";import"./status-colors-DDycfcf7.js";import"./chevron-down-DyqUpmgf.js";const Ee=me.memo(function({task:s}){const d=J(),{t:c}=$(),x=(r,h)=>c(`common.${r}`,{n:h}),i=s.status===u.COMPLETED||s.status===u.FAILED||s.status===u.CANCELLED;return e.jsxs("tr",{onClick:()=>d(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:e.jsx(ke,{content:s.description,children:ee(s)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(se,{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:[re(s.createdAt,x),i&&e.jsx("button",{onClick:r=>{r.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(ae,{className:"h-3 w-3"})})]})})]})});function Fe({isOpen:o,onClose:s,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:r}=$();ue(n=>n.user);const h=ve();te(o);const[p,L]=a.useState(""),[v,B]=a.useState(""),[m,A]=a.useState("feat"),[N,w]=a.useState(""),[b,S]=a.useState(""),[g,_]=a.useState(""),[y,j]=a.useState(""),[T,K]=a.useState(""),[M,R]=a.useState([]),[O,C]=a.useState(""),k=d.find(n=>n.key===p),H=Ce(n=>n,k==null?void 0:k.agentType);a.useEffect(()=>{if(!o||(L(""),B(""),A("feat"),w(""),S(""),_(""),j(""),K(""),C(""),!h))return;const n=new AbortController;return P.get("admin/developers",{signal:n.signal}).json().then(R).catch(()=>{}),()=>n.abort()},[o,h]);async function E(n){if(n.preventDefault(),C(""),!p||!v.trim()){C(r("tasks.project_and_description_required"));return}try{await x({projectKey:p,description:v.trim(),workerId:y||void 0,developerId:T?Number(T):void 0,taskType:m,branchSlug:b.trim()||void 0,agentType:N||void 0,targetBranch:g.trim()||void 0})}catch(z){const I=z instanceof Error?z.message:r("tasks.failed_to_create_task");C(I)}}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:["// ",r("tasks.new_task")]}),e.jsx("button",{onClick:s,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(he,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:E,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.project")}),e.jsx(D,{value:p,onChange:L,options:d.map(n=>({value:n.key,label:n.name})),placeholder:r(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:r("tasks.task_type")}),e.jsx(D,{value:m,onChange:A,options:Ne})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.form_agent_type")}),e.jsx(D,{value:N,onChange:w,options:H})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.task_description")}),e.jsx("textarea",{value:v,onChange:n=>B(n.target.value),placeholder:r("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:r("tasks.target_worker")}),e.jsx("input",{type:"text",value:y,onChange:n=>j(n.target.value),placeholder:r("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:r("tasks.branch_slug")}),e.jsx("input",{type:"text",value:b,onChange:n=>S(n.target.value),placeholder:r("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:r("tasks.target_branch")}),e.jsx("input",{type:"text",value:g,onChange:n=>_(n.target.value),placeholder:r("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)]"})]}),h&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.assign_developer")}),e.jsx(D,{value:T,onChange:K,options:M.map(n=>({value:String(n.id),label:n.name})),placeholder:r("tasks.select_developer")})]}),O&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:O})]}),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:r("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:r(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function Pe({isOpen:o,onClose:s,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:r}=$();return te(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:h=>h.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(we,{style:{width:"1rem",height:"1rem"}}),r("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:r("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:r("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:r("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:r(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function De({task:o}){const s=J(),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",title:je(o),children:["#",o.id," ",ee(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(ae,{className:"h-3 w-3"})}),e.jsx(se,{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:re(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 Ae=[{key:"all",labelKey:"tasks.tab_all"},{key:u.RUNNING,labelKey:"tasks.tab_running"},{key:u.QUEUED,labelKey:"tasks.tab_queued"},{key:u.COMPLETED,labelKey:"tasks.tab_completed"},{key:u.FAILED,labelKey:"tasks.tab_failed"},{key:u.CANCELLED,labelKey:"tasks.tab_cancelled"}],Ie=20;function Ye(){const o=J(),{t:s}=$(),{tasks:d,loading:c,fetchTasks:x}=X(),i=be(t=>t.taskSeq),[r,h]=a.useState("all"),[p,L]=a.useState(""),[v,B]=a.useState(""),[m,A]=a.useState(""),[N,w]=a.useState(void 0),[b,S]=a.useState([]),g=X(t=>t.nextCursor),[_,y]=a.useState(!1);fe(a.useMemo(()=>e.jsxs("button",{onClick:()=>y(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(Se,{className:"h-3.5 w-3.5"}),s("tasks.new_task")]}),[s]));const[j,T]=a.useState([]),[K,M]=a.useState(!1),[R,O]=a.useState([]),[C,k]=a.useState(!1),[H,E]=a.useState(!1),[n,z]=a.useState(null),[I,q]=a.useState(null),G=a.useCallback(t=>{const l={limit:String(Ie),taskMode:"develop"};return r!=="all"&&(l.status=r),p&&(l.projectKey=p),v&&(l.developerId=v),t&&(l.cursor=t),l},[r,p,v]);a.useEffect(()=>{x(G(N))},[G,N,x,i]),a.useEffect(()=>{w(void 0),S([])},[r,p,v]),a.useEffect(()=>{let t=!1;return(async()=>{try{const[f,pe]=await Promise.all([P.get("web/projects").json(),P.get("web/projects/-/developers").json()]);if(t)return;T(f),O(pe)}catch{}})(),()=>{t=!0}},[]),a.useEffect(()=>{if(!_||j.length>0)return;M(!0);let t=!1;return(async()=>{try{const f=await P.get("web/projects").json();t||T(f)}catch{}finally{t||M(!1)}})(),()=>{t=!0}},[_,j.length]);const oe=a.useCallback(async t=>{k(!0);try{const l=await P.post("web/tasks",{json:{projectKey:t.projectKey,description:t.description,workerId:t.workerId,developerId:t.developerId,taskType:t.taskType,branchSlug:t.branchSlug,agentType:t.agentType,targetBranch:t.targetBranch}}).json();y(!1),o(`/tasks/${l.task.id}`)}catch(l){if(l instanceof ge&&l.response.status===409){try{const f=await l.response.json();if(f.confirmRequired){z({id:f.confirmRequired.taskId,description:f.confirmRequired.message,status:"active"}),q(t),y(!1),E(!0);return}}catch{}W.error(s("tasks.similar_task_exists"))}else{const f=l instanceof Error?l.message:String(l);W.error(f)}}finally{k(!1)}},[o]),ne=a.useCallback(async()=>{if(I){k(!0);try{const t=await P.post("web/tasks",{json:{...I,force:!0}}).json();E(!1),q(null),o(`/tasks/${t.task.id}`)}finally{k(!1)}}},[I,o]),F=a.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]),le=a.useCallback(()=>{g&&(S(t=>[...t,N??""]),w(g))},[g,N]),ce=a.useCallback(()=>{b.length!==0&&(w(b.at(-1)||void 0),S(t=>t.slice(0,-1)))},[b]),ie=b.length+1,de=a.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...j.map(t=>({value:t.key,label:t.name}))],[j,s]),xe=a.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...R.map(t=>({value:String(t.id),label:t.name}))],[R,s]),Q=s(m?"tasks.try_adjusting_search":"tasks.create_first_task"),U=m?void 0:e.jsx("button",{onClick:()=>y(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:s("tasks.create_task")});return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar pr-4 md:pr-0",children:Ae.map(t=>e.jsx("button",{onClick:()=>h(t.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${r===t.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:s(t.labelKey)},t.key))}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative md:w-52",children:[e.jsx(ye,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:s("tasks.search_tasks"),value:m,onChange:t=>A(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:()=>A(""),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(D,{value:p,onChange:L,options:de,className:"md:w-40"}),e.jsx(D,{value:v,onChange:B,options:xe,className:"md:w-40"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:s("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.time")})]})}),e.jsxs("tbody",{children:[c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Z,{rows:5})})}),!c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U})})}),F.map(t=>e.jsx(Ee,{task:t},t.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[c&&F.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(Z,{rows:5})}),!c&&F.length===0&&e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U}),F.map(t=>e.jsx(De,{task:t},t.id))]}),(b.length>0||g)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",ie]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:ce,disabled:b.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(_e,{className:"h-3.5 w-3.5"}),s("tasks.prev")]}),e.jsxs("button",{onClick:le,disabled:!g,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[s("common.next"),e.jsx(Te,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(Fe,{isOpen:_,onClose:()=>y(!1),projects:j,projectsLoading:K,onSubmit:oe,isSubmitting:C}),e.jsx(Pe,{isOpen:H,onClose:()=>{E(!1),q(null)},onForceCreate:ne,onViewExisting:t=>{E(!1),q(null),o(`/tasks/${t}`)},similarTask:n,isLoading:C})]})}export{Ye as default};
1
+ import{R as me,f as J,a as $,o as u,j as e,l as ee,u as ue,i as ve,v as te,r as a,h as P,X as he,k as be,w as fe,H as ge,t as W,x as ye,y as V,m as je}from"./index-Dc7l0IT6.js";import{u as X}from"./task.store-2YMrViYj.js";import{T as se}from"./TaskStatusBadge-D4ZTaewH.js";import{f as re}from"./date-CmcdoD87.js";import{T as ke}from"./Tooltip-BeXBpXMQ.js";import{G as ae}from"./git-fork-DS0EMsEA.js";import{S as D}from"./Select-67FOknim.js";import{a as Ne}from"./task-constants-BtTS5GQt.js";import{g as Ce}from"./agent-type-options-ChuePYjM.js";import{C as we}from"./copy-BvsnHVjA.js";import{E as Y}from"./EmptyState-Dtc0ZNRp.js";import{T as Z}from"./Skeleton-_rq02txk.js";import{P as Se}from"./plus-g2yZrAF7.js";import{C as _e}from"./chevron-left-DeBK5qpt.js";import{C as Te}from"./chevron-right-c3y2M4GO.js";import"./status-colors-PFYg7zX9.js";import"./chevron-down-USdSAtLM.js";const Ee=me.memo(function({task:s}){const d=J(),{t:c}=$(),x=(r,h)=>c(`common.${r}`,{n:h}),i=s.status===u.COMPLETED||s.status===u.FAILED||s.status===u.CANCELLED;return e.jsxs("tr",{onClick:()=>d(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:e.jsx(ke,{content:s.description,children:ee(s)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(se,{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:[re(s.createdAt,x),i&&e.jsx("button",{onClick:r=>{r.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(ae,{className:"h-3 w-3"})})]})})]})});function Fe({isOpen:o,onClose:s,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:r}=$();ue(n=>n.user);const h=ve();te(o);const[p,L]=a.useState(""),[v,B]=a.useState(""),[m,A]=a.useState("feat"),[N,w]=a.useState(""),[b,S]=a.useState(""),[g,_]=a.useState(""),[y,j]=a.useState(""),[T,K]=a.useState(""),[M,R]=a.useState([]),[O,C]=a.useState(""),k=d.find(n=>n.key===p),H=Ce(n=>n,k==null?void 0:k.agentType);a.useEffect(()=>{if(!o||(L(""),B(""),A("feat"),w(""),S(""),_(""),j(""),K(""),C(""),!h))return;const n=new AbortController;return P.get("admin/developers",{signal:n.signal}).json().then(R).catch(()=>{}),()=>n.abort()},[o,h]);async function E(n){if(n.preventDefault(),C(""),!p||!v.trim()){C(r("tasks.project_and_description_required"));return}try{await x({projectKey:p,description:v.trim(),workerId:y||void 0,developerId:T?Number(T):void 0,taskType:m,branchSlug:b.trim()||void 0,agentType:N||void 0,targetBranch:g.trim()||void 0})}catch(z){const I=z instanceof Error?z.message:r("tasks.failed_to_create_task");C(I)}}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:["// ",r("tasks.new_task")]}),e.jsx("button",{onClick:s,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(he,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:E,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.project")}),e.jsx(D,{value:p,onChange:L,options:d.map(n=>({value:n.key,label:n.name})),placeholder:r(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:r("tasks.task_type")}),e.jsx(D,{value:m,onChange:A,options:Ne})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.form_agent_type")}),e.jsx(D,{value:N,onChange:w,options:H})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.task_description")}),e.jsx("textarea",{value:v,onChange:n=>B(n.target.value),placeholder:r("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:r("tasks.target_worker")}),e.jsx("input",{type:"text",value:y,onChange:n=>j(n.target.value),placeholder:r("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:r("tasks.branch_slug")}),e.jsx("input",{type:"text",value:b,onChange:n=>S(n.target.value),placeholder:r("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:r("tasks.target_branch")}),e.jsx("input",{type:"text",value:g,onChange:n=>_(n.target.value),placeholder:r("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)]"})]}),h&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.assign_developer")}),e.jsx(D,{value:T,onChange:K,options:M.map(n=>({value:String(n.id),label:n.name})),placeholder:r("tasks.select_developer")})]}),O&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:O})]}),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:r("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:r(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function Pe({isOpen:o,onClose:s,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:r}=$();return te(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:h=>h.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(we,{style:{width:"1rem",height:"1rem"}}),r("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:r("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:r("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:r("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:r(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function De({task:o}){const s=J(),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",title:je(o),children:["#",o.id," ",ee(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(ae,{className:"h-3 w-3"})}),e.jsx(se,{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:re(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 Ae=[{key:"all",labelKey:"tasks.tab_all"},{key:u.RUNNING,labelKey:"tasks.tab_running"},{key:u.QUEUED,labelKey:"tasks.tab_queued"},{key:u.COMPLETED,labelKey:"tasks.tab_completed"},{key:u.FAILED,labelKey:"tasks.tab_failed"},{key:u.CANCELLED,labelKey:"tasks.tab_cancelled"}],Ie=20;function Ye(){const o=J(),{t:s}=$(),{tasks:d,loading:c,fetchTasks:x}=X(),i=be(t=>t.taskSeq),[r,h]=a.useState("all"),[p,L]=a.useState(""),[v,B]=a.useState(""),[m,A]=a.useState(""),[N,w]=a.useState(void 0),[b,S]=a.useState([]),g=X(t=>t.nextCursor),[_,y]=a.useState(!1);fe(a.useMemo(()=>e.jsxs("button",{onClick:()=>y(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(Se,{className:"h-3.5 w-3.5"}),s("tasks.new_task")]}),[s]));const[j,T]=a.useState([]),[K,M]=a.useState(!1),[R,O]=a.useState([]),[C,k]=a.useState(!1),[H,E]=a.useState(!1),[n,z]=a.useState(null),[I,q]=a.useState(null),G=a.useCallback(t=>{const l={limit:String(Ie),taskMode:"develop"};return r!=="all"&&(l.status=r),p&&(l.projectKey=p),v&&(l.developerId=v),t&&(l.cursor=t),l},[r,p,v]);a.useEffect(()=>{x(G(N))},[G,N,x,i]),a.useEffect(()=>{w(void 0),S([])},[r,p,v]),a.useEffect(()=>{let t=!1;return(async()=>{try{const[f,pe]=await Promise.all([P.get("web/projects").json(),P.get("web/projects/-/developers").json()]);if(t)return;T(f),O(pe)}catch{}})(),()=>{t=!0}},[]),a.useEffect(()=>{if(!_||j.length>0)return;M(!0);let t=!1;return(async()=>{try{const f=await P.get("web/projects").json();t||T(f)}catch{}finally{t||M(!1)}})(),()=>{t=!0}},[_,j.length]);const oe=a.useCallback(async t=>{k(!0);try{const l=await P.post("web/tasks",{json:{projectKey:t.projectKey,description:t.description,workerId:t.workerId,developerId:t.developerId,taskType:t.taskType,branchSlug:t.branchSlug,agentType:t.agentType,targetBranch:t.targetBranch}}).json();y(!1),o(`/tasks/${l.task.id}`)}catch(l){if(l instanceof ge&&l.response.status===409){try{const f=await l.response.json();if(f.confirmRequired){z({id:f.confirmRequired.taskId,description:f.confirmRequired.message,status:"active"}),q(t),y(!1),E(!0);return}}catch{}W.error(s("tasks.similar_task_exists"))}else{const f=l instanceof Error?l.message:String(l);W.error(f)}}finally{k(!1)}},[o]),ne=a.useCallback(async()=>{if(I){k(!0);try{const t=await P.post("web/tasks",{json:{...I,force:!0}}).json();E(!1),q(null),o(`/tasks/${t.task.id}`)}finally{k(!1)}}},[I,o]),F=a.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]),le=a.useCallback(()=>{g&&(S(t=>[...t,N??""]),w(g))},[g,N]),ce=a.useCallback(()=>{b.length!==0&&(w(b.at(-1)||void 0),S(t=>t.slice(0,-1)))},[b]),ie=b.length+1,de=a.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...j.map(t=>({value:t.key,label:t.name}))],[j,s]),xe=a.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...R.map(t=>({value:String(t.id),label:t.name}))],[R,s]),Q=s(m?"tasks.try_adjusting_search":"tasks.create_first_task"),U=m?void 0:e.jsx("button",{onClick:()=>y(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:s("tasks.create_task")});return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar pr-4 md:pr-0",children:Ae.map(t=>e.jsx("button",{onClick:()=>h(t.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${r===t.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:s(t.labelKey)},t.key))}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative md:w-52",children:[e.jsx(ye,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:s("tasks.search_tasks"),value:m,onChange:t=>A(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:()=>A(""),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(D,{value:p,onChange:L,options:de,className:"md:w-40"}),e.jsx(D,{value:v,onChange:B,options:xe,className:"md:w-40"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:s("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.time")})]})}),e.jsxs("tbody",{children:[c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Z,{rows:5})})}),!c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U})})}),F.map(t=>e.jsx(Ee,{task:t},t.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[c&&F.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(Z,{rows:5})}),!c&&F.length===0&&e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U}),F.map(t=>e.jsx(De,{task:t},t.id))]}),(b.length>0||g)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",ie]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:ce,disabled:b.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(_e,{className:"h-3.5 w-3.5"}),s("tasks.prev")]}),e.jsxs("button",{onClick:le,disabled:!g,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[s("common.next"),e.jsx(Te,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(Fe,{isOpen:_,onClose:()=>y(!1),projects:j,projectsLoading:K,onSubmit:oe,isSubmitting:C}),e.jsx(Pe,{isOpen:H,onClose:()=>{E(!1),q(null)},onForceCreate:ne,onViewExisting:t=>{E(!1),q(null),o(`/tasks/${t}`)},similarTask:n,isLoading:C})]})}export{Ye as default};
@@ -1 +1 @@
1
- import{a as l,j as a}from"./index-PZwTchr_.js";import{a as u}from"./status-colors-DDycfcf7.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-Dc7l0IT6.js";import{a as u}from"./status-colors-PFYg7zX9.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-PZwTchr_.js";import{g as ee,H as ve,C as fe}from"./ConfirmStageDialog-CJ8pWink.js";import{u as ge}from"./task.store-BTXbcXgO.js";import{P as be}from"./PtyTerminal-CxBKQBbF.js";import{i as G,O as te}from"./OnboardingGuide-uCrXzgnL.js";import{S as E}from"./Select-CaAVBHmI.js";import{a as se}from"./status-colors-DDycfcf7.js";import{a as je}from"./date-RFA7-ZGs.js";import{T as q,a as J,g as ke}from"./task-constants-CSVY_jfk.js";import{g as ye}from"./agent-type-options-BiwwFXJv.js";import{u as ae}from"./useFetch-6R6P2rOm.js";import{P as $}from"./plus-CCF-PMRF.js";import{C as Ne}from"./chevron-down-DyqUpmgf.js";import{C as we}from"./chevron-up-DEXIEMJO.js";import{R as Te}from"./rotate-ccw-CyltG4Qx.js";import{C as Se}from"./clock-DyV22whY.js";import{W as _e}from"./wifi-Bgq95lS8.js";import"./chevron-right-Bz-j2WmS.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-Dc7l0IT6.js";import{g as ee,H as ve,C as fe}from"./ConfirmStageDialog-DR4NtMbp.js";import{u as ge}from"./task.store-2YMrViYj.js";import{P as be}from"./PtyTerminal-CDGp4pLP.js";import{i as G,O as te}from"./OnboardingGuide-CV4tINbf.js";import{S as E}from"./Select-67FOknim.js";import{a as se}from"./status-colors-PFYg7zX9.js";import{a as je}from"./date-CmcdoD87.js";import{T as q,a as J,g as ke}from"./task-constants-BtTS5GQt.js";import{g as ye}from"./agent-type-options-ChuePYjM.js";import{u as ae}from"./useFetch-CM-iw_s7.js";import{P as $}from"./plus-g2yZrAF7.js";import{C as Ne}from"./chevron-down-USdSAtLM.js";import{C as we}from"./chevron-up-DCDYf3Az.js";import{R as Te}from"./rotate-ccw-C1EaXve8.js";import{C as Se}from"./clock-ey7I11g5.js";import{W as _e}from"./wifi-2G9hdLVN.js";import"./chevron-right-c3y2M4GO.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.