@overlordai/server 1.0.179 → 1.0.180

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 (113) hide show
  1. package/dist/adapters/nlu.service.js +2 -2
  2. package/package.json +4 -4
  3. package/public/assets/{AccessTokensPage-BbryzvnM.js → AccessTokensPage-DSRaXrXC.js} +1 -1
  4. package/public/assets/{AdminPage-BultWF7a.js → AdminPage-quo_nZu0.js} +1 -1
  5. package/public/assets/{AgentCliPage-SW_JKwzo.js → AgentCliPage-B_cQKyB7.js} +1 -1
  6. package/public/assets/{ApiReferencePage-BawqrcYL.js → ApiReferencePage-CkzYCBis.js} +1 -1
  7. package/public/assets/{ArchitecturePage-FWLevT4m.js → ArchitecturePage-B0j0c21l.js} +1 -1
  8. package/public/assets/{AuditLogPage-DrxyZ_N_.js → AuditLogPage-DdW6Rjbw.js} +1 -1
  9. package/public/assets/{AutomationCreatePage-CWA--vuT.js → AutomationCreatePage-DglF_EDi.js} +1 -1
  10. package/public/assets/{AutomationDetailPage-BFNJn9l0.js → AutomationDetailPage-C3aTSg-j.js} +1 -1
  11. package/public/assets/{AutomationEditPage-y5p6I8v9.js → AutomationEditPage-CcC-aVlt.js} +1 -1
  12. package/public/assets/{AutomationListPage-Bhgxxu6_.js → AutomationListPage-DR_CE70e.js} +1 -1
  13. package/public/assets/{AutomationRunDetailPage-eRVHSPgi.js → AutomationRunDetailPage-CZ4pxP1x.js} +1 -1
  14. package/public/assets/{BindPlatformPage-JgPH-GyV.js → BindPlatformPage-Bn9R5es1.js} +1 -1
  15. package/public/assets/{BotIntegrationPage-yO7OUlpc.js → BotIntegrationPage-BF9ii7I9.js} +1 -1
  16. package/public/assets/{BotManage-BwplAxcP.js → BotManage-CVBala6Z.js} +1 -1
  17. package/public/assets/{BotSetupPage-vF-1zbQt.js → BotSetupPage-B2w5uyZ-.js} +1 -1
  18. package/public/assets/{ChangelogPage-Dvz1CT1l.js → ChangelogPage-CQ09e6Bp.js} +1 -1
  19. package/public/assets/{Checkbox-Cv1IaY0N.js → Checkbox-ksCSqTDb.js} +1 -1
  20. package/public/assets/{CliReferencePage-CcCgOSoY.js → CliReferencePage-CXSJI2NI.js} +3 -3
  21. package/public/assets/{ConfirmStageDialog-pDcoEYGK.js → ConfirmStageDialog-pT-iA956.js} +1 -1
  22. package/public/assets/{ConnectorsManage-B8aIKAfR.js → ConnectorsManage-Dfl92aJZ.js} +1 -1
  23. package/public/assets/{ConnectorsPage-DpvBzw0u.js → ConnectorsPage-B65QSW6u.js} +1 -1
  24. package/public/assets/{DeploymentPage-2CGTHVvc.js → DeploymentPage-CUZ5KK3d.js} +1 -1
  25. package/public/assets/{DevWorkflowPage-C9dwRqkd.js → DevWorkflowPage-j3fyS7Y_.js} +1 -1
  26. package/public/assets/{DeveloperManage-CP4AFGVd.js → DeveloperManage-BKyKIipO.js} +1 -1
  27. package/public/assets/{DeveloperSetupPage-CAUfLPib.js → DeveloperSetupPage-BZoCYXpK.js} +1 -1
  28. package/public/assets/{DocsIndexPage-_KFl66Pi.js → DocsIndexPage-BvqoOdfl.js} +1 -1
  29. package/public/assets/{DocsLayout-yhAysfLb.js → DocsLayout-C59ONhjV.js} +1 -1
  30. package/public/assets/{DocsPrimitives-BLjrk7dq.js → DocsPrimitives-CipzCTEu.js} +1 -1
  31. package/public/assets/{EditProjectPage-C-i9mvrD.js → EditProjectPage-Bi5rAJ13.js} +1 -1
  32. package/public/assets/{EmptyState-DCvtEuqr.js → EmptyState-DV7LUJer.js} +1 -1
  33. package/public/assets/{EnvVariablesPage-DHlRltEG.js → EnvVariablesPage-jcd0s6Kk.js} +1 -1
  34. package/public/assets/{HomePage-zVLfdxgB.js → HomePage-CG2VZtpZ.js} +1 -1
  35. package/public/assets/{InfoRow-0V76rcDX.js → InfoRow-DtLvNV_J.js} +1 -1
  36. package/public/assets/{InstallationPage-CF5KJSiH.js → InstallationPage-BCxuKwTs.js} +1 -1
  37. package/public/assets/{LandingPage-BZ2OW2Tp.js → LandingPage-CnUihNQl.js} +1 -1
  38. package/public/assets/{LocalDevelopmentPage-CHzphJ7-.js → LocalDevelopmentPage-BvDGaeS9.js} +1 -1
  39. package/public/assets/{LoginPage-BvkNtbOH.js → LoginPage-CnO_s0hQ.js} +1 -1
  40. package/public/assets/{MetricBar-8IDBuyjQ.js → MetricBar-DnOi5rBL.js} +1 -1
  41. package/public/assets/{MultiSelect-DqMAwXWW.js → MultiSelect-B-bLdzr4.js} +1 -1
  42. package/public/assets/{NotFoundPage-3hbcgIgf.js → NotFoundPage-H5psGKE8.js} +1 -1
  43. package/public/assets/{OnboardingGuide-BZhFBXTO.js → OnboardingGuide-Cj05MAli.js} +1 -1
  44. package/public/assets/{PermissionsPage-CrRmJEWi.js → PermissionsPage-CDjMHQvq.js} +1 -1
  45. package/public/assets/{PipelineConfigPage-QOFAuIzF.js → PipelineConfigPage-D_TTvIoA.js} +1 -1
  46. package/public/assets/{PipelineEditorPage-BiDBe2GM.js → PipelineEditorPage-xKDOKA_r.js} +1 -1
  47. package/public/assets/{PlanPage-Bi6aA-yb.js → PlanPage-pjNFq5I8.js} +1 -1
  48. package/public/assets/{ProfilePage-D3BwamWo.js → ProfilePage-CS9IfoHU.js} +1 -1
  49. package/public/assets/{ProjectDetailPage-Crv53lJf.js → ProjectDetailPage-BFQsH4bl.js} +1 -1
  50. package/public/assets/{ProjectListPage-BHkBlY4i.js → ProjectListPage-DzCFTq0z.js} +1 -1
  51. package/public/assets/{PtyTerminal-fX-mJfnE.js → PtyTerminal-DWRVuu-D.js} +1 -1
  52. package/public/assets/{QuickAuth-Bg6-rI5M.js → QuickAuth-DmFeLmAr.js} +1 -1
  53. package/public/assets/{RemoveMemberConfirmDialog-DCvjYeqR.js → RemoveMemberConfirmDialog-CHU9g7rJ.js} +1 -1
  54. package/public/assets/{ReviewAggregatePage-vilyKtbQ.js → ReviewAggregatePage-Bf7aL-gD.js} +1 -1
  55. package/public/assets/{ReviewPage-B1moD3qH.js → ReviewPage-DV9HrPzi.js} +1 -1
  56. package/public/assets/{Select-Buxh6kTz.js → Select-xdty1j0i.js} +1 -1
  57. package/public/assets/{SettingsPage-e_KlSeOd.js → SettingsPage-DAIr4JkV.js} +1 -1
  58. package/public/assets/{Skeleton-Cxko1u3z.js → Skeleton-CmBnyd29.js} +1 -1
  59. package/public/assets/{SkillPage-BLXLZ_br.js → SkillPage-Cj3pNfKV.js} +1 -1
  60. package/public/assets/{TaskDetailPage-DSf2vDDR.js → TaskDetailPage-CLwDpv_i.js} +1 -1
  61. package/public/assets/{TaskGuidePage-BW1rBO-9.js → TaskGuidePage-nIfi5sYx.js} +1 -1
  62. package/public/assets/{TaskListPage-hB72kn3H.js → TaskListPage-BUcEF_A8.js} +1 -1
  63. package/public/assets/{TaskStatusBadge-C_WHXkor.js → TaskStatusBadge-4rifJwVC.js} +1 -1
  64. package/public/assets/{TerminalHomePage-DQ7h-pKm.js → TerminalHomePage-BfTnmFzn.js} +1 -1
  65. package/public/assets/{TokenManage-BS68pVIn.js → TokenManage-DUxh8mAN.js} +1 -1
  66. package/public/assets/{Tooltip-CoGldvyP.js → Tooltip-CAj06OH3.js} +1 -1
  67. package/public/assets/{TotpSetupPage-DSO6vRsM.js → TotpSetupPage-DGSu7E4H.js} +1 -1
  68. package/public/assets/{WorkerDetailPage-CtSdGuiT.js → WorkerDetailPage-BMQxaS56.js} +1 -1
  69. package/public/assets/{WorkerListPage-BPjiOimX.js → WorkerListPage-Dblt6aZ1.js} +1 -1
  70. package/public/assets/{WorkerOperationsPage-S0sYpBVA.js → WorkerOperationsPage-CzxRiINJ.js} +1 -1
  71. package/public/assets/{WorkerSetupGuidePage-Cz8jZzlP.js → WorkerSetupGuidePage-WaRQgvcM.js} +1 -1
  72. package/public/assets/{WorkerSetupPage-DP-Gua4N.js → WorkerSetupPage-B5xXzfZ8.js} +1 -1
  73. package/public/assets/{agent-type-options-BO0L8qFm.js → agent-type-options-BgAoGQFU.js} +1 -1
  74. package/public/assets/{arrow-left-DsnDpdp1.js → arrow-left-Dsd8akiF.js} +1 -1
  75. package/public/assets/{arrow-right-SYbE07-f.js → arrow-right-BwFsEszb.js} +1 -1
  76. package/public/assets/{bot-Te-gb92X.js → bot-C7wSfjw1.js} +1 -1
  77. package/public/assets/{chevron-down-BOM9LZkG.js → chevron-down-SeRjAX4r.js} +1 -1
  78. package/public/assets/{chevron-left-D9tS8E5I.js → chevron-left-BvZWPLc1.js} +1 -1
  79. package/public/assets/{chevron-right-Cjz_w39s.js → chevron-right-Dirw-Ueo.js} +1 -1
  80. package/public/assets/{chevron-up-DP7_Tzsv.js → chevron-up-D_UYsCj8.js} +1 -1
  81. package/public/assets/{circle-alert-7ekwM0mg.js → circle-alert-WAD2ix0l.js} +1 -1
  82. package/public/assets/{clock-BSGAvAVI.js → clock-oJUEgAKB.js} +1 -1
  83. package/public/assets/{copy-CYXyA9yV.js → copy-BWTAfZ7b.js} +1 -1
  84. package/public/assets/{developer-options-DMIpNxfA.js → developer-options-Czaxdx-w.js} +1 -1
  85. package/public/assets/{download-BiTSnXRZ.js → download-l-ATQbZQ.js} +1 -1
  86. package/public/assets/{external-link-BjNbjJjr.js → external-link-BesNRyvW.js} +1 -1
  87. package/public/assets/{git-fork-Cl-h0DTv.js → git-fork-_pBPs-xc.js} +1 -1
  88. package/public/assets/{index--5cyM8L1.js → index-0QFy9ku9.js} +2 -2
  89. package/public/assets/{key-BzsEyvw2.js → key-BilH6uAl.js} +1 -1
  90. package/public/assets/{link-2-CmHbsrSO.js → link-2-ELPNTQde.js} +1 -1
  91. package/public/assets/{loader-circle-DgwRTB3H.js → loader-circle-OCqj772N.js} +1 -1
  92. package/public/assets/{pencil-CxmtoC0o.js → pencil-QmINK6St.js} +1 -1
  93. package/public/assets/{play-Ba8VDpNy.js → play-CUByBpQ0.js} +1 -1
  94. package/public/assets/{plug-B19phlnq.js → plug-CvdRvl-j.js} +1 -1
  95. package/public/assets/{plus-jUKyQIr2.js → plus-D38pnIMa.js} +1 -1
  96. package/public/assets/{power-DQyycfkW.js → power-CzLnYo_h.js} +1 -1
  97. package/public/assets/{rotate-ccw-EMxH_to4.js → rotate-ccw-BsCb3qU2.js} +1 -1
  98. package/public/assets/{scroll-text-pA_y69Ov.js → scroll-text-CF1Ze80E.js} +1 -1
  99. package/public/assets/{settings-DAb4HsMD.js → settings-CqcmKnX4.js} +1 -1
  100. package/public/assets/{skip-forward-CqSyF3tK.js → skip-forward-DcSN0O55.js} +1 -1
  101. package/public/assets/{status-colors-B460F2ZH.js → status-colors-DlyerwQ7.js} +1 -1
  102. package/public/assets/{task-agent-Cx6Aibwn.js → task-agent-Cgyq_UGX.js} +1 -1
  103. package/public/assets/{task-constants-BNLUt-jR.js → task-constants-D5ty4qUR.js} +1 -1
  104. package/public/assets/{task.store-DzA1A6GX.js → task.store-D_nwogGq.js} +1 -1
  105. package/public/assets/{timer-DSCxqEFg.js → timer-EysIetGz.js} +1 -1
  106. package/public/assets/{trash-2-DKVPzjZC.js → trash-2-CYdvAzYO.js} +1 -1
  107. package/public/assets/{useFetch-O3XBp_Gw.js → useFetch-BqnEzaSJ.js} +1 -1
  108. package/public/assets/{users-2xZaXYNg.js → users-dmt7eU5B.js} +1 -1
  109. package/public/assets/{wifi-BJaHHkkn.js → wifi-Bore97VF.js} +1 -1
  110. package/public/assets/{workflow-D7dtHNTX.js → workflow-DLz7dyVN.js} +1 -1
  111. package/public/assets/{zap-BLh2ptQ-.js → zap-DhNn8k7Z.js} +1 -1
  112. package/public/index.html +1 -1
  113. package/public/sw.js +1 -1
@@ -1,3 +1,3 @@
1
- import{a as g,r as p,j as e,a1 as $,B as I,f as M,h as S,t as y}from"./index--5cyM8L1.js";import{S as C}from"./Select-Buxh6kTz.js";import"./chevron-down-BOM9LZkG.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(`
1
+ import{a as g,r as p,j as e,a1 as $,B as I,f as M,h as S,t as y}from"./index-0QFy9ku9.js";import{S as C}from"./Select-xdty1j0i.js";import"./chevron-down-SeRjAX4r.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
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 B({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 D({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(B,{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 W(){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(D,{value:r,onChange:c})})]})}export{W as default};
@@ -1 +1 @@
1
- import{f as ee,a as te,k as se,r as s,h as b,o as a,t as N,x as re,j as t,K as ae,l as ne,I as oe}from"./index--5cyM8L1.js";import{E as ce}from"./EmptyState-DCvtEuqr.js";import{T as ie}from"./Skeleton-Cxko1u3z.js";import{C as le}from"./ConfirmStageDialog-pDcoEYGK.js";import{f as de}from"./date-CmcdoD87.js";import{S as pe}from"./Select-Buxh6kTz.js";import{P as ue}from"./plus-jUKyQIr2.js";import{E as me}from"./external-link-BjNbjJjr.js";import{C as xe}from"./chevron-left-D9tS8E5I.js";import{C as fe}from"./chevron-right-Cjz_w39s.js";import"./clock-BSGAvAVI.js";import"./chevron-down-BOM9LZkG.js";const be=[a.QUEUED,a.ASSIGNED,a.RUNNING,a.SUSPENDED],ge=20;function he(c,n){if(!c)return null;const y=c.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),i=n.split("/").map(encodeURIComponent).join("/");return c.gitPlatform===oe.GITLAB?`${y}/-/tree/${i}/docs/specs`:`${y}/tree/${i}/docs/specs`}function ve(c){switch(c){case a.RUNNING:return"bg-[var(--accent)]";case a.QUEUED:return"bg-[var(--warning)]";case a.ASSIGNED:return"bg-[var(--info)]";case a.SUSPENDED:return"bg-[var(--warning)]";case a.COMPLETED:return"bg-[var(--accent)]";case a.FAILED:return"bg-[var(--destructive)]";case a.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}function Le(){const c=ee(),{t:n}=te(),y=se(e=>e.taskSeq),[i,Q]=s.useState("in_progress"),[E,I]=s.useState([]),[L,U]=s.useState(!0),[g,_]=s.useState(void 0),[p,w]=s.useState(void 0),[u,k]=s.useState([]),[j,$]=s.useState({}),[H,A]=s.useState(new Set),[M,D]=s.useState(null),[h,P]=s.useState(null),[l,J]=s.useState([]),[m,O]=s.useState(""),[v,R]=s.useState(""),[T,G]=s.useState(!1),V=s.useMemo(()=>{const e={};for(const r of l)e[r.key]=r;return e},[l]);s.useEffect(()=>{let e=!1;return b.get("web/projects").json().then(r=>{e||J(r)}).catch(()=>{}),()=>{e=!0}},[]),s.useEffect(()=>{l.length>0&&!m&&O(l[0].key)},[l]);const C=s.useCallback(async e=>{U(!0);try{const r=new URLSearchParams({taskMode:"plan",limit:String(ge)});i==="in_progress"?r.set("status",be.join(",")):r.set("status",a.COMPLETED+","+a.FAILED+","+a.CANCELLED),e&&r.set("cursor",e);const S=await b.get(`web/tasks?${r}`).json(),x=S.data??[];I(x),_(S.nextCursor);const d=x.filter(o=>o.status===a.SUSPENDED).map(o=>o.id);if(d.length>0){const o=new Set;await Promise.all(d.map(async f=>{try{(await b.get(`web/tasks/${f}/pending-confirm`).json()).confirm&&o.add(f)}catch{}})),A(o)}else A(new Set);const q=x.filter(o=>o.status===a.COMPLETED).map(o=>o.id);if(q.length>0){const o={};await Promise.all(q.map(async f=>{try{const F=await b.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(f),limit:"100"})}`).json();o[f]=(F.data??[]).length}catch{o[f]=0}})),$(o)}else $({})}catch{I([]),_(void 0)}finally{U(!1)}},[i]);s.useEffect(()=>{C(p)},[C,p,y]),s.useEffect(()=>{w(void 0),k([])},[i]);const Z=s.useCallback(()=>{g&&(k(e=>[...e,p??""]),w(g))},[g,p]),z=s.useCallback(()=>{u.length!==0&&(w(u.at(-1)||void 0),k(e=>e.slice(0,-1)))},[u]),W=u.length+1,K=s.useCallback(async()=>{if(!m||!v.trim()){N.error("project and description are required.");return}G(!0);try{const e=await b.post("web/tasks",{json:{projectKey:m,description:v.trim(),taskMode:"plan"}}).json();R(""),c(`/tasks/${e.task.id}`)}catch(e){const r=e instanceof Error?e.message:String(e);N.error(r)}finally{G(!1)}},[m,v,c]),X=s.useCallback(async e=>{try{const r=await b.get(`web/tasks/${e}/pending-confirm`).json();r.confirm?(D(e),P(r.confirm)):N.error(n("tasks.confirm_failed"))}catch{N.error(n("tasks.confirm_failed"))}},[n]),Y=s.useCallback(()=>{D(null),P(null),C(p)},[C,p]),B=s.useMemo(()=>l.map(e=>({value:e.key,label:e.name})),[l]);return re(null),t.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsx("h1",{className:"sr-only",children:n("plan.title")}),t.jsxs("div",{className:"mb-6 flex flex-col gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:flex-row md:items-center md:gap-3",children:[t.jsx(pe,{value:m,onChange:O,options:B.length>0?B:[{value:"",label:"loading..."}],className:"md:w-44 shrink-0"}),t.jsx("input",{type:"text",placeholder:n("plan.description_placeholder"),value:v,onChange:e=>R(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!T&&K()},className:"flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),t.jsxs("button",{onClick:K,disabled:T||!m||!v.trim(),className:"flex shrink-0 items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-mono text-black transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:[t.jsx(ue,{className:"h-3.5 w-3.5"}),n(T?"common.creating":"plan.create")]})]}),t.jsx("div",{className:"mb-4 flex items-center gap-1 overflow-x-auto pb-1 no-scrollbar",children:["in_progress","completed"].map(e=>t.jsx("button",{onClick:()=>Q(e),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${i===e?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:n(e==="in_progress"?"review.in_progress":"tasks.tab_completed")},e))}),t.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[L&&E.length===0&&t.jsx("div",{className:"p-4",children:t.jsx(ie,{rows:4})}),!L&&E.length===0&&t.jsx(ce,{icon:ae,title:n("plan.no_plans"),description:n("plan.description_placeholder")}),E.map(e=>t.jsxs("div",{onClick:()=>c(`/tasks/${e.id}`),className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[t.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${ve(e.status)}`}),t.jsxs("span",{className:"flex-1 truncate text-xs text-[var(--text-primary)] preserve-case",children:["#",e.id," ",ne(e)]}),e.status===a.SUSPENDED&&H.has(e.id)&&t.jsx("button",{onClick:r=>{r.stopPropagation(),X(e.id)},className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold text-black bg-[var(--warning)] hover:opacity-90 transition-opacity",children:n("tasks.pending_confirmation")}),e.status===a.COMPLETED&&j[e.id]!=null&&j[e.id]>0&&t.jsxs("span",{className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold",style:{color:"#3b82f6",backgroundColor:"rgba(59,130,246,0.12)"},title:`${j[e.id]} downstream task(s)`,children:[j[e.id]," tasks"]}),e.status===a.COMPLETED&&(()=>{const r=V[e.projectKey];if(!r)return null;let S="main";if(e.configSnapshot)try{const d=JSON.parse(e.configSnapshot);d.defaultBranch&&(S=d.defaultBranch)}catch{}const x=he(r,S);return x?t.jsxs("a",{href:x,target:"_blank",rel:"noopener noreferrer",onClick:d=>d.stopPropagation(),className:"shrink-0 flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[10px] text-[var(--text-muted)] hover:text-[var(--info)] hover:border-[var(--info)] transition-colors",title:n("plan.view_spec"),children:[t.jsx(me,{className:"h-2.5 w-2.5"}),n("plan.view_spec")]}):null})(),t.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:e.projectKey}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:e.status.toLowerCase()}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:de(e.createdAt)})]},e.id))]}),(u.length>0||g)&&t.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",W]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:z,disabled:u.length===0,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[t.jsx(xe,{className:"h-3.5 w-3.5"}),n("tasks.prev")]}),t.jsxs("button",{onClick:Z,disabled:!g,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[n("common.next"),t.jsx(fe,{className:"h-3.5 w-3.5"})]})]})]}),M!=null&&h&&t.jsx(le,{isOpen:!0,onClose:()=>{D(null),P(null)},taskId:M,stageName:h.stageName,timeoutSeconds:h.timeout,confirmType:h.confirmType,prompt:h.prompt,onSubmitted:Y})]})}export{Le as default};
1
+ import{f as ee,a as te,k as se,r as s,h as b,o as a,t as N,x as re,j as t,K as ae,l as ne,I as oe}from"./index-0QFy9ku9.js";import{E as ce}from"./EmptyState-DV7LUJer.js";import{T as ie}from"./Skeleton-CmBnyd29.js";import{C as le}from"./ConfirmStageDialog-pT-iA956.js";import{f as de}from"./date-CmcdoD87.js";import{S as pe}from"./Select-xdty1j0i.js";import{P as ue}from"./plus-D38pnIMa.js";import{E as me}from"./external-link-BesNRyvW.js";import{C as xe}from"./chevron-left-BvZWPLc1.js";import{C as fe}from"./chevron-right-Dirw-Ueo.js";import"./clock-oJUEgAKB.js";import"./chevron-down-SeRjAX4r.js";const be=[a.QUEUED,a.ASSIGNED,a.RUNNING,a.SUSPENDED],ge=20;function he(c,n){if(!c)return null;const y=c.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),i=n.split("/").map(encodeURIComponent).join("/");return c.gitPlatform===oe.GITLAB?`${y}/-/tree/${i}/docs/specs`:`${y}/tree/${i}/docs/specs`}function ve(c){switch(c){case a.RUNNING:return"bg-[var(--accent)]";case a.QUEUED:return"bg-[var(--warning)]";case a.ASSIGNED:return"bg-[var(--info)]";case a.SUSPENDED:return"bg-[var(--warning)]";case a.COMPLETED:return"bg-[var(--accent)]";case a.FAILED:return"bg-[var(--destructive)]";case a.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}function Le(){const c=ee(),{t:n}=te(),y=se(e=>e.taskSeq),[i,Q]=s.useState("in_progress"),[E,I]=s.useState([]),[L,U]=s.useState(!0),[g,_]=s.useState(void 0),[p,w]=s.useState(void 0),[u,k]=s.useState([]),[j,$]=s.useState({}),[H,A]=s.useState(new Set),[M,D]=s.useState(null),[h,P]=s.useState(null),[l,J]=s.useState([]),[m,O]=s.useState(""),[v,R]=s.useState(""),[T,G]=s.useState(!1),V=s.useMemo(()=>{const e={};for(const r of l)e[r.key]=r;return e},[l]);s.useEffect(()=>{let e=!1;return b.get("web/projects").json().then(r=>{e||J(r)}).catch(()=>{}),()=>{e=!0}},[]),s.useEffect(()=>{l.length>0&&!m&&O(l[0].key)},[l]);const C=s.useCallback(async e=>{U(!0);try{const r=new URLSearchParams({taskMode:"plan",limit:String(ge)});i==="in_progress"?r.set("status",be.join(",")):r.set("status",a.COMPLETED+","+a.FAILED+","+a.CANCELLED),e&&r.set("cursor",e);const S=await b.get(`web/tasks?${r}`).json(),x=S.data??[];I(x),_(S.nextCursor);const d=x.filter(o=>o.status===a.SUSPENDED).map(o=>o.id);if(d.length>0){const o=new Set;await Promise.all(d.map(async f=>{try{(await b.get(`web/tasks/${f}/pending-confirm`).json()).confirm&&o.add(f)}catch{}})),A(o)}else A(new Set);const q=x.filter(o=>o.status===a.COMPLETED).map(o=>o.id);if(q.length>0){const o={};await Promise.all(q.map(async f=>{try{const F=await b.get(`web/tasks?${new URLSearchParams({sourceTaskId:String(f),limit:"100"})}`).json();o[f]=(F.data??[]).length}catch{o[f]=0}})),$(o)}else $({})}catch{I([]),_(void 0)}finally{U(!1)}},[i]);s.useEffect(()=>{C(p)},[C,p,y]),s.useEffect(()=>{w(void 0),k([])},[i]);const Z=s.useCallback(()=>{g&&(k(e=>[...e,p??""]),w(g))},[g,p]),z=s.useCallback(()=>{u.length!==0&&(w(u.at(-1)||void 0),k(e=>e.slice(0,-1)))},[u]),W=u.length+1,K=s.useCallback(async()=>{if(!m||!v.trim()){N.error("project and description are required.");return}G(!0);try{const e=await b.post("web/tasks",{json:{projectKey:m,description:v.trim(),taskMode:"plan"}}).json();R(""),c(`/tasks/${e.task.id}`)}catch(e){const r=e instanceof Error?e.message:String(e);N.error(r)}finally{G(!1)}},[m,v,c]),X=s.useCallback(async e=>{try{const r=await b.get(`web/tasks/${e}/pending-confirm`).json();r.confirm?(D(e),P(r.confirm)):N.error(n("tasks.confirm_failed"))}catch{N.error(n("tasks.confirm_failed"))}},[n]),Y=s.useCallback(()=>{D(null),P(null),C(p)},[C,p]),B=s.useMemo(()=>l.map(e=>({value:e.key,label:e.name})),[l]);return re(null),t.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsx("h1",{className:"sr-only",children:n("plan.title")}),t.jsxs("div",{className:"mb-6 flex flex-col gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:flex-row md:items-center md:gap-3",children:[t.jsx(pe,{value:m,onChange:O,options:B.length>0?B:[{value:"",label:"loading..."}],className:"md:w-44 shrink-0"}),t.jsx("input",{type:"text",placeholder:n("plan.description_placeholder"),value:v,onChange:e=>R(e.target.value),onKeyDown:e=>{e.key==="Enter"&&!T&&K()},className:"flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),t.jsxs("button",{onClick:K,disabled:T||!m||!v.trim(),className:"flex shrink-0 items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-mono text-black transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:[t.jsx(ue,{className:"h-3.5 w-3.5"}),n(T?"common.creating":"plan.create")]})]}),t.jsx("div",{className:"mb-4 flex items-center gap-1 overflow-x-auto pb-1 no-scrollbar",children:["in_progress","completed"].map(e=>t.jsx("button",{onClick:()=>Q(e),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${i===e?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:n(e==="in_progress"?"review.in_progress":"tasks.tab_completed")},e))}),t.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[L&&E.length===0&&t.jsx("div",{className:"p-4",children:t.jsx(ie,{rows:4})}),!L&&E.length===0&&t.jsx(ce,{icon:ae,title:n("plan.no_plans"),description:n("plan.description_placeholder")}),E.map(e=>t.jsxs("div",{onClick:()=>c(`/tasks/${e.id}`),className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[t.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${ve(e.status)}`}),t.jsxs("span",{className:"flex-1 truncate text-xs text-[var(--text-primary)] preserve-case",children:["#",e.id," ",ne(e)]}),e.status===a.SUSPENDED&&H.has(e.id)&&t.jsx("button",{onClick:r=>{r.stopPropagation(),X(e.id)},className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold text-black bg-[var(--warning)] hover:opacity-90 transition-opacity",children:n("tasks.pending_confirmation")}),e.status===a.COMPLETED&&j[e.id]!=null&&j[e.id]>0&&t.jsxs("span",{className:"shrink-0 rounded-[4px] px-2 py-0.5 text-[10px] font-bold",style:{color:"#3b82f6",backgroundColor:"rgba(59,130,246,0.12)"},title:`${j[e.id]} downstream task(s)`,children:[j[e.id]," tasks"]}),e.status===a.COMPLETED&&(()=>{const r=V[e.projectKey];if(!r)return null;let S="main";if(e.configSnapshot)try{const d=JSON.parse(e.configSnapshot);d.defaultBranch&&(S=d.defaultBranch)}catch{}const x=he(r,S);return x?t.jsxs("a",{href:x,target:"_blank",rel:"noopener noreferrer",onClick:d=>d.stopPropagation(),className:"shrink-0 flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[10px] text-[var(--text-muted)] hover:text-[var(--info)] hover:border-[var(--info)] transition-colors",title:n("plan.view_spec"),children:[t.jsx(me,{className:"h-2.5 w-2.5"}),n("plan.view_spec")]}):null})(),t.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:e.projectKey}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:e.status.toLowerCase()}),t.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:de(e.createdAt)})]},e.id))]}),(u.length>0||g)&&t.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[t.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",W]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:z,disabled:u.length===0,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[t.jsx(xe,{className:"h-3.5 w-3.5"}),n("tasks.prev")]}),t.jsxs("button",{onClick:Z,disabled:!g,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[n("common.next"),t.jsx(fe,{className:"h-3.5 w-3.5"})]})]})]}),M!=null&&h&&t.jsx(le,{isOpen:!0,onClose:()=>{D(null),P(null)},taskId:M,stageName:h.stageName,timeoutSeconds:h.timeout,confirmType:h.confirmType,prompt:h.prompt,onSubmitted:Y})]})}export{Le as default};
@@ -1 +1 @@
1
- import{a as A,u as F,f as T,r as s,j as e,L as z,a7 as I,a8 as $,s as K,h as p,t as c}from"./index--5cyM8L1.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-0V76rcDX.js";import{u as V}from"./useFetch-O3XBp_Gw.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.179"]}),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,a7 as I,a8 as $,s as K,h as p,t as c}from"./index-0QFy9ku9.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-DtLvNV_J.js";import{u as V}from"./useFetch-BqnEzaSJ.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.180"]}),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 T,j as e,s as q,B,f as K,u as H,i as J,r as x,_ as k,x as V,l as D,$ as z,h}from"./index--5cyM8L1.js";import{U as P,A as G,R as Q}from"./RemoveMemberConfirmDialog-DCvjYeqR.js";import{T as X}from"./Tooltip-CoGldvyP.js";import{c as _}from"./date-CmcdoD87.js";import{t as $}from"./status-colors-B460F2ZH.js";import{I as o}from"./InfoRow-0V76rcDX.js";import{u as Y}from"./useFetch-O3XBp_Gw.js";import{P as Z}from"./pencil-CxmtoC0o.js";import{T as ee}from"./trash-2-DKVPzjZC.js";import{A as te}from"./arrow-left-DsnDpdp1.js";import{P as re}from"./plus-jUKyQIr2.js";import"./Select-Buxh6kTz.js";import"./chevron-down-BOM9LZkG.js";/**
1
+ import{c as R,a as T,j as e,s as q,B,f as K,u as H,i as J,r as x,_ as k,x as V,l as D,$ as z,h}from"./index-0QFy9ku9.js";import{U as P,A as G,R as Q}from"./RemoveMemberConfirmDialog-CHU9g7rJ.js";import{T as X}from"./Tooltip-CAj06OH3.js";import{c as _}from"./date-CmcdoD87.js";import{t as $}from"./status-colors-DlyerwQ7.js";import{I as o}from"./InfoRow-DtLvNV_J.js";import{u as Y}from"./useFetch-BqnEzaSJ.js";import{P as Z}from"./pencil-QmINK6St.js";import{T as ee}from"./trash-2-CYdvAzYO.js";import{A as te}from"./arrow-left-Dsd8akiF.js";import{P as re}from"./plus-D38pnIMa.js";import"./Select-xdty1j0i.js";import"./chevron-down-SeRjAX4r.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as R,a as P,v as G,r as o,I as x,Q as z,j as e,h as E,f as H,x as M}from"./index--5cyM8L1.js";import{S as U}from"./Select-Buxh6kTz.js";import{b as D}from"./agent-type-options-BO0L8qFm.js";import{E as J}from"./EmptyState-DCvtEuqr.js";import{T as O}from"./Skeleton-Cxko1u3z.js";import{t as q}from"./date-CmcdoD87.js";import{u as W}from"./useFetch-O3XBp_Gw.js";import{P as $}from"./plus-jUKyQIr2.js";import{A as K}from"./arrow-left-DsnDpdp1.js";import"./chevron-down-BOM9LZkG.js";/**
1
+ import{c as R,a as P,v as G,r as o,I as x,Q as z,j as e,h as E,f as H,x as M}from"./index-0QFy9ku9.js";import{S as U}from"./Select-xdty1j0i.js";import{b as D}from"./agent-type-options-BgAoGQFU.js";import{E as J}from"./EmptyState-DV7LUJer.js";import{T as O}from"./Skeleton-CmBnyd29.js";import{t as q}from"./date-CmcdoD87.js";import{u as W}from"./useFetch-BqnEzaSJ.js";import{P as $}from"./plus-D38pnIMa.js";import{A as K}from"./arrow-left-Dsd8akiF.js";import"./chevron-down-SeRjAX4r.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--5cyM8L1.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-0QFy9ku9.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,a9 as v,j as e,C as j}from"./index--5cyM8L1.js";import{C as f}from"./copy-CYXyA9yV.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,a9 as v,j as e,C as j}from"./index-0QFy9ku9.js";import{C as f}from"./copy-BWTAfZ7b.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,_ as c,j as e,X as C,V as D,h as g,s as I}from"./index--5cyM8L1.js";import{S as N}from"./Select-Buxh6kTz.js";/**
1
+ import{c as R,a as _,v as w,r as a,_ as c,j as e,X as C,V as D,h as g,s as I}from"./index-0QFy9ku9.js";import{S as N}from"./Select-xdty1j0i.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as xe,B as me,f as ue,a as Z,k as pe,r,h as _,j as e,L as ve,Y as H,Z as be,t as j,o as p,b as ge,Q as he,X as fe}from"./index--5cyM8L1.js";import{P as je}from"./PtyTerminal-fX-mJfnE.js";import{T as Ne}from"./Skeleton-Cxko1u3z.js";import{C as K}from"./Checkbox-Cv1IaY0N.js";import{f as we,b as ye}from"./date-CmcdoD87.js";import{b as Se}from"./agent-type-options-BO0L8qFm.js";import{T as z,g as q}from"./task-constants-BNLUt-jR.js";import{A as ke}from"./arrow-left-DsnDpdp1.js";import{L as Ce}from"./loader-circle-DgwRTB3H.js";import{P as Q}from"./play-Ba8VDpNy.js";import{S as Te}from"./skip-forward-CqSyF3tK.js";import{R as Re}from"./rotate-ccw-EMxH_to4.js";import{C as Ae}from"./chevron-up-DP7_Tzsv.js";import{C as Ee}from"./chevron-down-BOM9LZkG.js";import{C as De}from"./circle-alert-7ekwM0mg.js";/**
1
+ import{c as xe,B as me,f as ue,a as Z,k as pe,r,h as _,j as e,L as ve,Y as H,Z as be,t as j,o as p,b as ge,Q as he,X as fe}from"./index-0QFy9ku9.js";import{P as je}from"./PtyTerminal-DWRVuu-D.js";import{T as Ne}from"./Skeleton-CmBnyd29.js";import{C as K}from"./Checkbox-ksCSqTDb.js";import{f as we,b as ye}from"./date-CmcdoD87.js";import{b as Se}from"./agent-type-options-BgAoGQFU.js";import{T as z,g as q}from"./task-constants-D5ty4qUR.js";import{A as ke}from"./arrow-left-Dsd8akiF.js";import{L as Ce}from"./loader-circle-OCqj772N.js";import{P as Q}from"./play-CUByBpQ0.js";import{S as Te}from"./skip-forward-DcSN0O55.js";import{R as Re}from"./rotate-ccw-BsCb3qU2.js";import{C as Ae}from"./chevron-up-D_UYsCj8.js";import{C as Ee}from"./chevron-down-SeRjAX4r.js";import{C as De}from"./circle-alert-WAD2ix0l.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{a as w,f as k,k as F,r,x as K,j as e,h as N,o as m,E,l as B,X as T,H,t as y,Q}from"./index--5cyM8L1.js";import{p as q}from"./developer-options-DMIpNxfA.js";import{E as D}from"./EmptyState-DCvtEuqr.js";import{T as L}from"./Skeleton-Cxko1u3z.js";import{C as z}from"./Checkbox-Cv1IaY0N.js";import{S as C}from"./Select-Buxh6kTz.js";import{f as P}from"./date-CmcdoD87.js";import{T as A}from"./Tooltip-CoGldvyP.js";import{b as J}from"./agent-type-options-BO0L8qFm.js";import{g as X}from"./task-constants-BNLUt-jR.js";import{P as Z}from"./plus-jUKyQIr2.js";import{P as R}from"./play-Ba8VDpNy.js";import{C as V}from"./chevron-left-D9tS8E5I.js";import{C as W}from"./chevron-right-Cjz_w39s.js";import"./chevron-down-BOM9LZkG.js";function $(){const[s,i]=r.useState(void 0),[t,a]=r.useState(void 0),[p,n]=r.useState([]),b=r.useRef(void 0),u=r.useRef(void 0);b.current=s,u.current=t;const f=r.useCallback(c=>{i(c)},[]),x=r.useCallback(()=>{const c=b.current;c&&(n(j=>[...j,u.current??""]),a(c))},[]),g=r.useRef([]);g.current=p;const d=r.useCallback(()=>{const c=g.current;c.length!==0&&(a(c.at(-1)||void 0),n(c.slice(0,-1)))},[]),v=p.length+1,l=p.length>0;return{cursor:t,setNextCursor:f,goNext:x,goPrev:d,pageNumber:v,hasPrev:l,hasNext:!!s}}const I=20;function Y(s){switch(s){case m.RUNNING:return"bg-[var(--accent)]";case m.QUEUED:return"bg-[var(--warning)]";case m.ASSIGNED:return"bg-[var(--info)]";case m.SUSPENDED:return"bg-[var(--warning)]";case m.COMPLETED:return"bg-[var(--accent)]";case m.FAILED:return"bg-[var(--destructive)]";case m.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}const ee=J(X);function se({taskId:s,onClose:i,onLaunched:t}){const{t:a}=w(),[p,n]=r.useState([Q.CLAUDE]),[b,u]=r.useState(""),[f,x]=r.useState(""),[g,d]=r.useState(!1);function v(o){n(c=>c.includes(o)?c.filter(j=>j!==o):[...c,o])}async function l(){if(p.length===0){y.error("select at least one review agent.");return}d(!0);try{await N.post(`web/tasks/${s}/review`,{json:{agentTypes:p,description:b.trim()||void 0,issueRef:f.trim()||void 0}}),y.success("review launched"),t(),i()}catch(o){const c=o instanceof Error?o.message:String(o);y.error(c)}finally{d(!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:a("review.launch")}),e.jsx("button",{onClick:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(T,{className:"h-4 w-4"})})]}),e.jsxs("p",{className:"mb-3 text-[11px] text-[var(--text-muted)]",children:["task #",s," — ",a("review.select_agents")]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:ee.map(o=>e.jsx(z,{checked:p.includes(o.value),onCheckedChange:()=>v(o.value),label:o.label,containerClassName:"w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors"},o.value))}),e.jsx("textarea",{value:b,onChange:o=>u(o.target.value),placeholder:a("review.description_placeholder"),rows:3,className:"mb-3 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.jsx("input",{value:f,onChange:o=>x(o.target.value),placeholder:"--ref: Figma/Jira/Sentry URL",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)]"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:l,disabled:g||p.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(R,{className:"h-3 w-3"}),a(g?"common.processing":"review.launch")]}),e.jsx("button",{onClick:i,className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")})]})]})})}function _({pag:s}){const{t:i}=w();return!s.hasPrev&&!s.hasNext?null:e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",s.pageNumber]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:s.goPrev,disabled:!s.hasPrev,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(V,{className:"h-3.5 w-3.5"}),i("tasks.prev")]}),e.jsxs("button",{onClick:s.goNext,disabled:!s.hasNext,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[i("common.next"),e.jsx(W,{className:"h-3.5 w-3.5"})]})]})]})}function te({onRefresh:s,projectFilter:i,developerFilter:t}){const{t:a}=w(),p=k(),[n,b]=r.useState([]),[u,f]=r.useState(!0),[x,g]=r.useState(null),d=$(),v=r.useCallback(async l=>{f(!0);try{const o=new Date(Date.now()-6048e5).toISOString(),c=new URLSearchParams({status:m.COMPLETED,taskMode:"develop",reviewStatus:"null",completedAfter:o,limit:String(I)});i&&c.set("projectKey",i),t&&c.set("developerId",t),l&&c.set("cursor",l);const j=await N.get(`web/tasks?${c}`).json();b(j.data??[]),d.setNextCursor(j.nextCursor)}catch{b([]),d.setNextCursor(void 0)}finally{f(!1)}},[i,t]);return r.useEffect(()=>{v(d.cursor)},[v,d.cursor]),u&&n.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&n.length===0&&!d.hasPrev?e.jsx(D,{icon:E,title:a("review.no_reviews"),description:a("review.pending")}):e.jsxs(e.Fragment,{children:[n.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:n.map(l=>e.jsxs("div",{className:"flex flex-col gap-1 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsx(A,{content:l.description,className:"flex-1 min-w-0",children:e.jsxs("span",{className:"cursor-pointer truncate text-xs text-[var(--text-primary)] hover:text-[var(--accent)] transition-colors block preserve-case",onClick:()=>p(`/tasks/${l.id}`),children:["#",l.id," ",B(l)]})}),e.jsx("button",{onClick:async()=>{try{await N.post(`web/tasks/${l.id}/review-status`,{json:{reviewStatus:"dismissed"}}),v(d.cursor)}catch(o){let c="Failed to dismiss";try{if(o instanceof H){const j=await o.response.json();c=(j==null?void 0:j.message)??c}else o instanceof Error&&(c=o.message)}catch{}y.error(c)}},className:"shrink-0 flex items-center rounded-[4px] p-1.5 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":"dismiss",children:e.jsx(T,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{onClick:()=>g(l.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:a("review.launch_short")})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5 text-[11px] text-[var(--text-muted)] min-w-0",children:[e.jsx("span",{className:"shrink-0",children:P(l.completedAt??l.createdAt)}),e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"shrink-0",children:l.projectKey}),l.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"truncate",children:l.workerName})]})]})]},l.id))}),e.jsx(_,{pag:d}),x!==null&&e.jsx(se,{taskId:x,onClose:()=>g(null),onLaunched:()=>{s(),v(d.cursor)}})]})}function re(s){const i=new Map;for(const t of s){const a=t.sourceTaskId??t.id;i.has(a)||i.set(a,[]),i.get(a).push(t)}return Array.from(i.entries()).map(([t,a])=>({sourceTaskId:t,tasks:a}))}function ae({group:s,onClick:i}){const t=s.tasks[0],a=s.tasks.every(n=>n.status===m.COMPLETED||n.status===m.FAILED||n.status===m.CANCELLED),p=t==null?void 0:t.sourceCommitSha;return e.jsxs("div",{onClick:i,className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${a?"bg-[var(--accent)]":"bg-[var(--warning)]"}`}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(A,{content:(t==null?void 0:t.sourceTaskDescription)??(t==null?void 0:t.description),className:"truncate",children:e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["source #",s.sourceTaskId]})}),p&&e.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-[var(--accent)]",children:["@",p.slice(0,7)]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.tasks.length," ",s.tasks.length===1?"agent":"agents"," · ",s.tasks.map(n=>(n.agentType??"claude").toLowerCase()).join(", ")]})]}),t&&e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:t.projectKey}),t&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:P(t.createdAt)}),e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.tasks.map(n=>e.jsx("span",{className:`h-2 w-2 rounded-full ${Y(n.status)}`,title:n.status.toLowerCase()},n.id))})]})}function S({mode:s,projectFilter:i,developerFilter:t}){const{t:a}=w(),p=k(),[n,b]=r.useState([]),[u,f]=r.useState(!0),x=$(),g=r.useCallback(async d=>{f(!0);try{const v=new URLSearchParams({taskMode:"review",limit:String(I),groupBySource:"true"});s==="in_progress"?v.set("status",[m.QUEUED,m.ASSIGNED,m.RUNNING,m.SUSPENDED].join(",")):v.set("status",[m.COMPLETED,m.FAILED,m.CANCELLED].join(",")),i&&v.set("projectKey",i),t&&v.set("sourceDeveloperId",t),d&&v.set("cursor",d);const l=await N.get(`web/tasks?${v}`).json();b(re(l.data??[])),x.setNextCursor(l.nextCursor??void 0)}catch{b([]),x.setNextCursor(void 0)}finally{f(!1)}},[s,i,t]);return r.useEffect(()=>{g(x.cursor)},[g,x.cursor]),u&&n.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&n.length===0&&!x.hasPrev?e.jsx(D,{icon:E,title:a("review.no_reviews")}):e.jsxs(e.Fragment,{children:[n.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:n.map(d=>e.jsx(ae,{group:d,onClick:()=>p(`/review/${d.sourceTaskId}`)},d.sourceTaskId))}),e.jsx(_,{pag:x})]})}function Ne(){const{t:s}=w(),i=k(),t=F(h=>h.taskSeq),[a,p]=r.useState("pending"),[n,b]=r.useState(0),[u,f]=r.useState(""),[x,g]=r.useState(""),[d,v]=r.useState([]),[l,o]=r.useState([]);K(null);const c=r.useCallback(()=>b(h=>h+1),[]);r.useEffect(()=>{let h=!1;return(async()=>{try{const[M,G]=await Promise.all([N.get("web/projects").json(),N.get("web/projects/-/developers").json()]);if(h)return;v(M),o(G)}catch{}})(),()=>{h=!0}},[]);const j=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...d.map(h=>({value:h.key,label:h.name}))],[d,s]),O=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...q(l)],[l,s]),U=[{key:"pending",label:s("review.pending")},{key:"in_progress",label:s("review.in_progress")},{key:"history",label:s("review.history")}];return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("h1",{className:"sr-only",children:s("review.title")}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar",children:[U.map(h=>e.jsx("button",{onClick:()=>p(h.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${a===h.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:h.label},h.key)),e.jsxs("button",{onClick:()=>i("/plan"),className:"shrink-0 flex items-center gap-1 rounded-[4px] px-3 py-2 h-8 text-xs text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:[e.jsx(Z,{className:"h-3 w-3"}),s("plan.title")]})]}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsx(C,{value:u,onChange:f,options:j,className:"md:w-40"}),e.jsx(C,{value:x,onChange:g,options:O,className:"md:w-40"})]})]}),a==="pending"&&e.jsx(te,{onRefresh:c,projectFilter:u,developerFilter:x},`pending-${n}-${t}-${u}-${x}`),a==="in_progress"&&e.jsx(S,{mode:"in_progress",projectFilter:u,developerFilter:x},`inprogress-${n}-${t}-${u}-${x}`),a==="history"&&e.jsx(S,{mode:"history",projectFilter:u,developerFilter:x},`history-${n}-${t}-${u}-${x}`)]})}export{Ne as default};
1
+ import{a as w,f as k,k as F,r,x as K,j as e,h as N,o as m,E,l as B,X as T,H,t as y,Q}from"./index-0QFy9ku9.js";import{p as q}from"./developer-options-Czaxdx-w.js";import{E as D}from"./EmptyState-DV7LUJer.js";import{T as L}from"./Skeleton-CmBnyd29.js";import{C as z}from"./Checkbox-ksCSqTDb.js";import{S as C}from"./Select-xdty1j0i.js";import{f as P}from"./date-CmcdoD87.js";import{T as A}from"./Tooltip-CAj06OH3.js";import{b as J}from"./agent-type-options-BgAoGQFU.js";import{g as X}from"./task-constants-D5ty4qUR.js";import{P as Z}from"./plus-D38pnIMa.js";import{P as R}from"./play-CUByBpQ0.js";import{C as V}from"./chevron-left-BvZWPLc1.js";import{C as W}from"./chevron-right-Dirw-Ueo.js";import"./chevron-down-SeRjAX4r.js";function $(){const[s,i]=r.useState(void 0),[t,a]=r.useState(void 0),[p,n]=r.useState([]),b=r.useRef(void 0),u=r.useRef(void 0);b.current=s,u.current=t;const f=r.useCallback(c=>{i(c)},[]),x=r.useCallback(()=>{const c=b.current;c&&(n(j=>[...j,u.current??""]),a(c))},[]),g=r.useRef([]);g.current=p;const d=r.useCallback(()=>{const c=g.current;c.length!==0&&(a(c.at(-1)||void 0),n(c.slice(0,-1)))},[]),v=p.length+1,l=p.length>0;return{cursor:t,setNextCursor:f,goNext:x,goPrev:d,pageNumber:v,hasPrev:l,hasNext:!!s}}const I=20;function Y(s){switch(s){case m.RUNNING:return"bg-[var(--accent)]";case m.QUEUED:return"bg-[var(--warning)]";case m.ASSIGNED:return"bg-[var(--info)]";case m.SUSPENDED:return"bg-[var(--warning)]";case m.COMPLETED:return"bg-[var(--accent)]";case m.FAILED:return"bg-[var(--destructive)]";case m.CANCELLED:return"bg-[#525252]";default:return"bg-[#525252]"}}const ee=J(X);function se({taskId:s,onClose:i,onLaunched:t}){const{t:a}=w(),[p,n]=r.useState([Q.CLAUDE]),[b,u]=r.useState(""),[f,x]=r.useState(""),[g,d]=r.useState(!1);function v(o){n(c=>c.includes(o)?c.filter(j=>j!==o):[...c,o])}async function l(){if(p.length===0){y.error("select at least one review agent.");return}d(!0);try{await N.post(`web/tasks/${s}/review`,{json:{agentTypes:p,description:b.trim()||void 0,issueRef:f.trim()||void 0}}),y.success("review launched"),t(),i()}catch(o){const c=o instanceof Error?o.message:String(o);y.error(c)}finally{d(!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:a("review.launch")}),e.jsx("button",{onClick:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(T,{className:"h-4 w-4"})})]}),e.jsxs("p",{className:"mb-3 text-[11px] text-[var(--text-muted)]",children:["task #",s," — ",a("review.select_agents")]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:ee.map(o=>e.jsx(z,{checked:p.includes(o.value),onCheckedChange:()=>v(o.value),label:o.label,containerClassName:"w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors"},o.value))}),e.jsx("textarea",{value:b,onChange:o=>u(o.target.value),placeholder:a("review.description_placeholder"),rows:3,className:"mb-3 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.jsx("input",{value:f,onChange:o=>x(o.target.value),placeholder:"--ref: Figma/Jira/Sentry URL",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)]"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:l,disabled:g||p.length===0,className:"flex flex-1 items-center justify-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(R,{className:"h-3 w-3"}),a(g?"common.processing":"review.launch")]}),e.jsx("button",{onClick:i,className:"rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")})]})]})})}function _({pag:s}){const{t:i}=w();return!s.hasPrev&&!s.hasNext?null:e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",s.pageNumber]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:s.goPrev,disabled:!s.hasPrev,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(V,{className:"h-3.5 w-3.5"}),i("tasks.prev")]}),e.jsxs("button",{onClick:s.goNext,disabled:!s.hasNext,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[i("common.next"),e.jsx(W,{className:"h-3.5 w-3.5"})]})]})]})}function te({onRefresh:s,projectFilter:i,developerFilter:t}){const{t:a}=w(),p=k(),[n,b]=r.useState([]),[u,f]=r.useState(!0),[x,g]=r.useState(null),d=$(),v=r.useCallback(async l=>{f(!0);try{const o=new Date(Date.now()-6048e5).toISOString(),c=new URLSearchParams({status:m.COMPLETED,taskMode:"develop",reviewStatus:"null",completedAfter:o,limit:String(I)});i&&c.set("projectKey",i),t&&c.set("developerId",t),l&&c.set("cursor",l);const j=await N.get(`web/tasks?${c}`).json();b(j.data??[]),d.setNextCursor(j.nextCursor)}catch{b([]),d.setNextCursor(void 0)}finally{f(!1)}},[i,t]);return r.useEffect(()=>{v(d.cursor)},[v,d.cursor]),u&&n.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&n.length===0&&!d.hasPrev?e.jsx(D,{icon:E,title:a("review.no_reviews"),description:a("review.pending")}):e.jsxs(e.Fragment,{children:[n.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:n.map(l=>e.jsxs("div",{className:"flex flex-col gap-1 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsx(A,{content:l.description,className:"flex-1 min-w-0",children:e.jsxs("span",{className:"cursor-pointer truncate text-xs text-[var(--text-primary)] hover:text-[var(--accent)] transition-colors block preserve-case",onClick:()=>p(`/tasks/${l.id}`),children:["#",l.id," ",B(l)]})}),e.jsx("button",{onClick:async()=>{try{await N.post(`web/tasks/${l.id}/review-status`,{json:{reviewStatus:"dismissed"}}),v(d.cursor)}catch(o){let c="Failed to dismiss";try{if(o instanceof H){const j=await o.response.json();c=(j==null?void 0:j.message)??c}else o instanceof Error&&(c=o.message)}catch{}y.error(c)}},className:"shrink-0 flex items-center rounded-[4px] p-1.5 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":"dismiss",children:e.jsx(T,{className:"h-3.5 w-3.5"})}),e.jsxs("button",{onClick:()=>g(l.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:a("review.launch_short")})]})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-5 text-[11px] text-[var(--text-muted)] min-w-0",children:[e.jsx("span",{className:"shrink-0",children:P(l.completedAt??l.createdAt)}),e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"shrink-0",children:l.projectKey}),l.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"shrink-0",children:"·"}),e.jsx("span",{className:"truncate",children:l.workerName})]})]})]},l.id))}),e.jsx(_,{pag:d}),x!==null&&e.jsx(se,{taskId:x,onClose:()=>g(null),onLaunched:()=>{s(),v(d.cursor)}})]})}function re(s){const i=new Map;for(const t of s){const a=t.sourceTaskId??t.id;i.has(a)||i.set(a,[]),i.get(a).push(t)}return Array.from(i.entries()).map(([t,a])=>({sourceTaskId:t,tasks:a}))}function ae({group:s,onClick:i}){const t=s.tasks[0],a=s.tasks.every(n=>n.status===m.COMPLETED||n.status===m.FAILED||n.status===m.CANCELLED),p=t==null?void 0:t.sourceCommitSha;return e.jsxs("div",{onClick:i,className:"flex cursor-pointer items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${a?"bg-[var(--accent)]":"bg-[var(--warning)]"}`}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(A,{content:(t==null?void 0:t.sourceTaskDescription)??(t==null?void 0:t.description),className:"truncate",children:e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["source #",s.sourceTaskId]})}),p&&e.jsxs("span",{className:"shrink-0 font-mono text-[11px] text-[var(--accent)]",children:["@",p.slice(0,7)]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[s.tasks.length," ",s.tasks.length===1?"agent":"agents"," · ",s.tasks.map(n=>(n.agentType??"claude").toLowerCase()).join(", ")]})]}),t&&e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:t.projectKey}),t&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:P(t.createdAt)}),e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s.tasks.map(n=>e.jsx("span",{className:`h-2 w-2 rounded-full ${Y(n.status)}`,title:n.status.toLowerCase()},n.id))})]})}function S({mode:s,projectFilter:i,developerFilter:t}){const{t:a}=w(),p=k(),[n,b]=r.useState([]),[u,f]=r.useState(!0),x=$(),g=r.useCallback(async d=>{f(!0);try{const v=new URLSearchParams({taskMode:"review",limit:String(I),groupBySource:"true"});s==="in_progress"?v.set("status",[m.QUEUED,m.ASSIGNED,m.RUNNING,m.SUSPENDED].join(",")):v.set("status",[m.COMPLETED,m.FAILED,m.CANCELLED].join(",")),i&&v.set("projectKey",i),t&&v.set("sourceDeveloperId",t),d&&v.set("cursor",d);const l=await N.get(`web/tasks?${v}`).json();b(re(l.data??[])),x.setNextCursor(l.nextCursor??void 0)}catch{b([]),x.setNextCursor(void 0)}finally{f(!1)}},[s,i,t]);return r.useEffect(()=>{g(x.cursor)},[g,x.cursor]),u&&n.length===0?e.jsx("div",{className:"p-4",children:e.jsx(L,{rows:4})}):!u&&n.length===0&&!x.hasPrev?e.jsx(D,{icon:E,title:a("review.no_reviews")}):e.jsxs(e.Fragment,{children:[n.length>0&&e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:n.map(d=>e.jsx(ae,{group:d,onClick:()=>p(`/review/${d.sourceTaskId}`)},d.sourceTaskId))}),e.jsx(_,{pag:x})]})}function Ne(){const{t:s}=w(),i=k(),t=F(h=>h.taskSeq),[a,p]=r.useState("pending"),[n,b]=r.useState(0),[u,f]=r.useState(""),[x,g]=r.useState(""),[d,v]=r.useState([]),[l,o]=r.useState([]);K(null);const c=r.useCallback(()=>b(h=>h+1),[]);r.useEffect(()=>{let h=!1;return(async()=>{try{const[M,G]=await Promise.all([N.get("web/projects").json(),N.get("web/projects/-/developers").json()]);if(h)return;v(M),o(G)}catch{}})(),()=>{h=!0}},[]);const j=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...d.map(h=>({value:h.key,label:h.name}))],[d,s]),O=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...q(l)],[l,s]),U=[{key:"pending",label:s("review.pending")},{key:"in_progress",label:s("review.in_progress")},{key:"history",label:s("review.history")}];return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("h1",{className:"sr-only",children:s("review.title")}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsxs("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar",children:[U.map(h=>e.jsx("button",{onClick:()=>p(h.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors ${a===h.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:h.label},h.key)),e.jsxs("button",{onClick:()=>i("/plan"),className:"shrink-0 flex items-center gap-1 rounded-[4px] px-3 py-2 h-8 text-xs text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:[e.jsx(Z,{className:"h-3 w-3"}),s("plan.title")]})]}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsx(C,{value:u,onChange:f,options:j,className:"md:w-40"}),e.jsx(C,{value:x,onChange:g,options:O,className:"md:w-40"})]})]}),a==="pending"&&e.jsx(te,{onRefresh:c,projectFilter:u,developerFilter:x},`pending-${n}-${t}-${u}-${x}`),a==="in_progress"&&e.jsx(S,{mode:"in_progress",projectFilter:u,developerFilter:x},`inprogress-${n}-${t}-${u}-${x}`),a==="history"&&e.jsx(S,{mode:"history",projectFilter:u,developerFilter:x},`history-${n}-${t}-${u}-${x}`)]})}export{Ne as default};
@@ -1 +1 @@
1
- import{r as l,j as t}from"./index--5cyM8L1.js";import{C as b}from"./chevron-down-BOM9LZkG.js";function h({value:r,onChange:x,options:c,placeholder:d,disabled:s=!1,className:m=""}){var i;const[a,n]=l.useState(!1),o=l.useRef(null),u=((i=c.find(e=>e.value===r))==null?void 0:i.label)??d??"";return l.useEffect(()=>{function e(v){o.current&&!o.current.contains(v.target)&&n(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.jsxs("div",{ref:o,className:`relative ${m}`,children:[t.jsxs("button",{type:"button",disabled:s,onClick:()=>!s&&n(!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)]"} ${s?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[t.jsx("span",{className:r?"":"text-[var(--text-muted)]",children:u}),t.jsx(b,{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("div",{children:[e.separator&&t.jsx("div",{className:"my-1 border-t border-[var(--border)]"}),t.jsxs("button",{type:"button",role:"option","aria-selected":e.value===r,onClick:()=>{x(e.value),n(!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-0QFy9ku9.js";import{C as b}from"./chevron-down-SeRjAX4r.js";function h({value:r,onChange:x,options:c,placeholder:d,disabled:s=!1,className:m=""}){var i;const[a,n]=l.useState(!1),o=l.useRef(null),u=((i=c.find(e=>e.value===r))==null?void 0:i.label)??d??"";return l.useEffect(()=>{function e(v){o.current&&!o.current.contains(v.target)&&n(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.jsxs("div",{ref:o,className:`relative ${m}`,children:[t.jsxs("button",{type:"button",disabled:s,onClick:()=>!s&&n(!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)]"} ${s?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[t.jsx("span",{className:r?"":"text-[var(--text-muted)]",children:u}),t.jsx(b,{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("div",{children:[e.separator&&t.jsx("div",{className:"my-1 border-t border-[var(--border)]"}),t.jsxs("button",{type:"button",role:"option","aria-selected":e.value===r,onClick:()=>{x(e.value),n(!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--5cyM8L1.js";/**
1
+ import{c as h,a as v,r,j as e,h as m,t as u}from"./index-0QFy9ku9.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--5cyM8L1.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-0QFy9ku9.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--5cyM8L1.js";import{I as c,C as r}from"./DocsPrimitives-BLjrk7dq.js";import{E as n}from"./external-link-BjNbjJjr.js";import"./copy-CYXyA9yV.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-0QFy9ku9.js";import{I as c,C as r}from"./DocsPrimitives-CipzCTEu.js";import{E as n}from"./external-link-BesNRyvW.js";import"./copy-BWTAfZ7b.js";const o=[{action:"create tasks",desc:"describe what you want done, overlord dispatches to a worker"},{action:"list & monitor tasks",desc:"check status, read execution logs, track progress"},{action:"cancel & retry tasks",desc:"manage task lifecycle"},{action:"confirm pipeline stages",desc:"approve or provide input for suspended stages"},{action:"manage projects",desc:"list projects, view members"},{action:"check cluster health",desc:"see worker status, online workers, queue depth"},{action:"search",desc:"find tasks, projects, and workers by keyword"},{action:"read notifications",desc:"check and clear your notification inbox"}],d=['create a task in project "frontend" to fix the login page styling',"what tasks are running right now?","show me the logs for task 42","how many workers are online?","cancel task 15"],i=[{name:"claude code",url:"https://claude.com/claude-code"},{name:"cursor",url:"https://cursor.com/cli"},{name:"windsurf",url:"https://windsurf.com"},{name:"codex",url:"https://openai.com/codex"}];function u(){t();const a=typeof window<"u"?window.location.origin:"https://your-server";return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// use overlord from your ai coding assistant — claude code, cursor, windsurf, codex, and more. install the skill and your assistant can create tasks, monitor execution, and manage your fleet."})}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// install"}),e.jsx(c,{code:"npx skills add overlord-run/skill"})]}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// configure — set these environment variables"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_SERVER=",e.jsx("span",{className:"text-[var(--accent)]",children:a})]}),e.jsx(r,{text:`export OVERLORD_SERVER=${a}`})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 overflow-x-auto",children:[e.jsxs("code",{className:"text-xs text-[var(--text-primary)] whitespace-nowrap",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"export "}),"OVERLORD_TOKEN=",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"your-token"})]}),e.jsx(r,{text:"export OVERLORD_TOKEN=your-token"})]})]}),e.jsxs("p",{className:"text-[11px] text-[var(--text-muted)]",children:["// create a token at ",e.jsx("a",{href:"/access-tokens",className:"text-[var(--accent)] hover:underline",children:"/access-tokens"})]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> capabilities"}),e.jsx("div",{className:"space-y-2",children:o.map(s=>e.jsxs("div",{className:"flex items-start gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("span",{className:"shrink-0 text-xs font-medium text-[var(--text-primary)]",children:s.action}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// ",s.desc]})]},s.action))})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> example usage"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:"// just ask your ai agent naturally"}),d.map(s=>e.jsx("div",{className:"rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:e.jsxs("code",{className:"text-xs text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"> "}),s]})},s))]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"mb-4 text-sm text-[var(--accent)]",children:"> compatible tools"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:i.map(s=>e.jsxs("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2.5 text-xs text-[var(--text-primary)] transition-colors hover:border-[var(--accent)]",children:[s.name,e.jsx(n,{className:"h-3 w-3 text-[var(--text-muted)]"})]},s.name))}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:"// and any ai coding assistant that supports the skills protocol"})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["// open source:"," ",e.jsx("a",{href:"https://github.com/overlord-run/skill",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent)] hover:underline",children:"github.com/overlord-run/skill"})]})})]})}export{u as default};
@@ -1,4 +1,4 @@
1
- import{c as xe,a as de,r as n,A as P,h,j as e,H as Qt,t as $,s as Le,B as Yt,f as Zt,F as es,p as ts,q as ss,k as gt,o as k,R as as,L as ie,l as bt,m as rs,X as Ee,y as ns,U as ls,G as jt,b as cs,I as Rt,J as is}from"./index--5cyM8L1.js";import{u as os}from"./task.store-DzA1A6GX.js";import{P as Nt}from"./PtyTerminal-fX-mJfnE.js";import{C as yt}from"./ConfirmStageDialog-pDcoEYGK.js";import{C as oe}from"./Checkbox-Cv1IaY0N.js";import{S as kt}from"./Select-Buxh6kTz.js";import{b as xs,f as Y,c as ds}from"./date-CmcdoD87.js";import{a as Dt}from"./status-colors-B460F2ZH.js";import{g as we,H as ms}from"./task-agent-Cx6Aibwn.js";import{a as wt,b as _t}from"./agent-type-options-BO0L8qFm.js";import{T as ps,g as Z}from"./task-constants-BNLUt-jR.js";import{T as us}from"./Tooltip-CoGldvyP.js";import{A as hs}from"./arrow-left-DsnDpdp1.js";import{R as At}from"./rotate-ccw-EMxH_to4.js";import{G as fs}from"./git-fork-Cl-h0DTv.js";import{P as Ct}from"./play-Ba8VDpNy.js";import{E as _e}from"./external-link-BjNbjJjr.js";import{L as Pt}from"./loader-circle-DgwRTB3H.js";import{S as vs}from"./skip-forward-CqSyF3tK.js";import"./clock-BSGAvAVI.js";import"./chevron-down-BOM9LZkG.js";/**
1
+ import{c as xe,a as de,r as n,A as P,h,j as e,H as Qt,t as $,s as Le,B as Yt,f as Zt,F as es,p as ts,q as ss,k as gt,o as k,R as as,L as ie,l as bt,m as rs,X as Ee,y as ns,U as ls,G as jt,b as cs,I as Rt,J as is}from"./index-0QFy9ku9.js";import{u as os}from"./task.store-D_nwogGq.js";import{P as Nt}from"./PtyTerminal-DWRVuu-D.js";import{C as yt}from"./ConfirmStageDialog-pT-iA956.js";import{C as oe}from"./Checkbox-ksCSqTDb.js";import{S as kt}from"./Select-xdty1j0i.js";import{b as xs,f as Y,c as ds}from"./date-CmcdoD87.js";import{a as Dt}from"./status-colors-DlyerwQ7.js";import{g as we,H as ms}from"./task-agent-Cgyq_UGX.js";import{a as wt,b as _t}from"./agent-type-options-BgAoGQFU.js";import{T as ps,g as Z}from"./task-constants-D5ty4qUR.js";import{T as us}from"./Tooltip-CAj06OH3.js";import{A as hs}from"./arrow-left-Dsd8akiF.js";import{R as At}from"./rotate-ccw-BsCb3qU2.js";import{G as fs}from"./git-fork-_pBPs-xc.js";import{P as Ct}from"./play-CUByBpQ0.js";import{E as _e}from"./external-link-BesNRyvW.js";import{L as Pt}from"./loader-circle-OCqj772N.js";import{S as vs}from"./skip-forward-DcSN0O55.js";import"./clock-oJUEgAKB.js";import"./chevron-down-SeRjAX4r.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--5cyM8L1.js";import{a as s}from"./DocsPrimitives-BLjrk7dq.js";import"./copy-CYXyA9yV.js";const a=`ov task create -d "implement oauth login" -p WEB -t feat
1
+ import{j as e}from"./index-0QFy9ku9.js";import{a as s}from"./DocsPrimitives-CipzCTEu.js";import"./copy-BWTAfZ7b.js";const a=`ov task create -d "implement oauth login" -p WEB -t feat
2
2
  ov task plan -d "design auth system" -p WEB
3
3
  ov task review 42 --agent codex,cursor
4
4
  ov task fork 42 -d "retry with a simpler approach"`,r=`develop "implement oauth login" --project WEB --type feat
@@ -1 +1 @@
1
- import{R as he,f as G,a as U,o as u,j as e,l as re,u as fe,i as ge,v as ae,r,h as A,X as ye,k as je,w as O,x as ke,H as Ne,t as Y,y as Ce,z as Z,m as we}from"./index--5cyM8L1.js";import{u as ee}from"./task.store-DzA1A6GX.js";import{T as oe}from"./TaskStatusBadge-C_WHXkor.js";import{f as ne}from"./date-CmcdoD87.js";import{T as Se}from"./Tooltip-CoGldvyP.js";import{G as le}from"./git-fork-Cl-h0DTv.js";import{S}from"./Select-Buxh6kTz.js";import{p as _e}from"./developer-options-DMIpNxfA.js";import{a as Te}from"./task-constants-BNLUt-jR.js";import{g as Ee}from"./agent-type-options-BO0L8qFm.js";import{C as Pe}from"./copy-CYXyA9yV.js";import{E as te}from"./EmptyState-DCvtEuqr.js";import{T as se}from"./Skeleton-Cxko1u3z.js";import{P as Fe}from"./plus-jUKyQIr2.js";import{C as De}from"./chevron-left-D9tS8E5I.js";import{C as Ae}from"./chevron-right-Cjz_w39s.js";import"./status-colors-B460F2ZH.js";import"./chevron-down-BOM9LZkG.js";const Ie=he.memo(function({task:t}){const d=G(),{t:c}=U(),x=(a,b)=>c(`common.${a}`,{n:b}),i=t.status===u.COMPLETED||t.status===u.FAILED||t.status===u.CANCELLED;return e.jsxs("tr",{onClick:()=>d(`/tasks/${t.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:["#",t.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)] preserve-case",children:e.jsx(Se,{content:t.description,children:re(t)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(oe,{status:t.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.developerName??t.creatorName??"-"}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.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:[ne(t.createdAt,x),i&&e.jsx("button",{onClick:a=>{a.stopPropagation(),d(`/tasks/${t.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(le,{className:"h-3 w-3"})})]})})]})});function Re({isOpen:n,onClose:t,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:a}=U();fe(o=>o.user);const b=ge();ae(n);const[p,L]=r.useState(""),[v,M]=r.useState(""),[g,B]=r.useState("feat"),[m,I]=r.useState(""),[C,_]=r.useState(""),[h,T]=r.useState(""),[y,E]=r.useState(""),[j,k]=r.useState(""),[P,K]=r.useState(""),[z,q]=r.useState([]),[$,w]=r.useState(""),N=d.find(o=>o.key===p),W=Ee(o=>o,N==null?void 0:N.agentType);r.useEffect(()=>{if(!n||(L(""),M(""),B("feat"),I(""),_(""),T(""),E(""),k(""),K(""),w(""),!b))return;const o=new AbortController;return A.get("admin/developers",{searchParams:{status:"active"},signal:o.signal}).json().then(q).catch(()=>{}),()=>o.abort()},[n,b]);async function F(o){if(o.preventDefault(),w(""),!p||!v.trim()){w(a("tasks.project_and_description_required"));return}try{await x({projectKey:p,description:v.trim(),workerId:j||void 0,developerId:P?Number(P):void 0,taskType:g,branchSlug:C.trim()||void 0,agentType:m||void 0,targetBranch:h.trim()||void 0,issueRef:y.trim()||void 0})}catch(H){const R=H instanceof Error?H.message:a("tasks.failed_to_create_task");w(R)}}return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:t,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(ye,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:F,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.project")}),e.jsx(S,{value:p,onChange:L,options:d.map(o=>({value:o.key,label:o.name})),placeholder:a(c?"common.loading":"tasks.select_project"),disabled:c})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_type")}),e.jsx(S,{value:g,onChange:B,options:Te})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx(S,{value:m,onChange:I,options:W})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_description")}),e.jsx("textarea",{value:v,onChange:o=>M(o.target.value),placeholder:a("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_worker")}),e.jsx("input",{type:"text",value:j,onChange:o=>k(o.target.value),placeholder:a("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.branch_slug")}),e.jsx("input",{type:"text",value:C,onChange:o=>_(o.target.value),placeholder:a("tasks.branch_slug_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_branch")}),e.jsx("input",{type:"text",value:h,onChange:o=>T(o.target.value),placeholder:a("tasks.target_branch_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.issue_ref")}),e.jsx("input",{type:"text",value:y,onChange:o=>E(o.target.value),placeholder:a("tasks.issue_ref_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),b&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(S,{value:P,onChange:K,options:z.map(o=>({value:String(o.id),label:o.name})),placeholder:a("tasks.select_developer")})]}),$&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:$})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:t,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:i||!p||!v.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:a(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function Oe({isOpen:n,onClose:t,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:a}=U();return ae(n),!x||!n?null:e.jsx("div",{style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:b=>b.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(Pe,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",x.id," · ",x.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:x.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:t,disabled:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>c(x.id),style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:d,disabled:i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1},children:a(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function Le({task:n}){const t=G(),d=n.status===u.COMPLETED||n.status===u.FAILED||n.status===u.CANCELLED;return e.jsxs("div",{onClick:()=>t(`/tasks/${n.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2 preserve-case",title:we(n),children:["#",n.id," ",re(n)]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),t(`/tasks/${n.id}?action=fork`)},className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:e.jsx(le,{className:"h-3 w-3"})}),e.jsx(oe,{status:n.status})]})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:ne(n.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.workerName})]})]})]})}const Me=[{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"}],Be=20;function at(){const n=G(),{t}=U(),{tasks:d,loading:c,fetchTasks:x}=ee(),i=je(s=>s.taskSeq),[a,b]=r.useState("all"),[p,L]=r.useState(O.DEVELOP),[v,M]=r.useState(""),[g,B]=r.useState(""),[m,I]=r.useState(""),[C,_]=r.useState(void 0),[h,T]=r.useState([]),y=ee(s=>s.nextCursor),[E,j]=r.useState(!1);ke(r.useMemo(()=>e.jsxs("button",{onClick:()=>j(!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(Fe,{className:"h-3.5 w-3.5"}),t("tasks.new_task")]}),[t]));const[k,P]=r.useState([]),[K,z]=r.useState(!1),[q,$]=r.useState([]),[w,N]=r.useState(!1),[W,F]=r.useState(!1),[o,H]=r.useState(null),[R,J]=r.useState(null),Q=r.useCallback(s=>{const l={limit:String(Be)};return p&&(l.taskMode=p),a!=="all"&&(l.status=a),v&&(l.projectKey=v),g&&(l.developerId=g),s&&(l.cursor=s),l},[a,p,v,g]);r.useEffect(()=>{x(Q(C))},[Q,C,x,i]),r.useEffect(()=>{_(void 0),T([])},[a,p,v,g]),r.useEffect(()=>{let s=!1;return(async()=>{try{const[f,be]=await Promise.all([A.get("web/projects").json(),A.get("web/projects/-/developers").json()]);if(s)return;P(f),$(be)}catch{}})(),()=>{s=!0}},[]),r.useEffect(()=>{if(!E||k.length>0)return;z(!0);let s=!1;return(async()=>{try{const f=await A.get("web/projects").json();s||P(f)}catch{}finally{s||z(!1)}})(),()=>{s=!0}},[E,k.length]);const ce=r.useCallback(async s=>{N(!0);try{const l=await A.post("web/tasks",{json:{projectKey:s.projectKey,description:s.description,workerId:s.workerId,developerId:s.developerId,taskType:s.taskType,branchSlug:s.branchSlug,agentType:s.agentType,targetBranch:s.targetBranch,issueRef:s.issueRef}}).json();j(!1),n(`/tasks/${l.task.id}`)}catch(l){if(l instanceof Ne&&l.response.status===409){try{const f=await l.response.json();if(f.confirmRequired){H({id:f.confirmRequired.taskId,description:f.confirmRequired.message,status:"active"}),J(s),j(!1),F(!0);return}}catch{}Y.error(t("tasks.similar_task_exists"))}else{const f=l instanceof Error?l.message:String(l);Y.error(f)}}finally{N(!1)}},[n]),ie=r.useCallback(async()=>{if(R){N(!0);try{const s=await A.post("web/tasks",{json:{...R,force:!0}}).json();F(!1),J(null),n(`/tasks/${s.task.id}`)}finally{N(!1)}}},[R,n]),D=r.useMemo(()=>{if(!m.trim())return d;const s=m.toLowerCase();return d.filter(l=>(l.name??"").toLowerCase().includes(s)||l.description.toLowerCase().includes(s)||String(l.id).includes(m))},[d,m]),de=r.useCallback(()=>{y&&(T(s=>[...s,C??""]),_(y))},[y,C]),xe=r.useCallback(()=>{h.length!==0&&(_(h.at(-1)||void 0),T(s=>s.slice(0,-1)))},[h]),pe=h.length+1,me=r.useMemo(()=>[{value:"",label:t("tasks.filter_project")},...k.map(s=>({value:s.key,label:s.name}))],[k,t]),ue=r.useMemo(()=>[{value:"",label:t("tasks.filter_developer")},..._e(q)],[q,t]),ve=r.useMemo(()=>[{value:"",label:t("tasks.filter_mode")},{value:O.DEVELOP,label:t("tasks.mode_develop")},{value:O.PLAN,label:t("tasks.mode_plan")},{value:O.REVIEW,label:t("tasks.mode_review")},{value:O.AUTOMATION,label:t("tasks.mode_automation")}],[t]),V=t(m?"tasks.try_adjusting_search":"tasks.create_first_task"),X=m?void 0:e.jsx("button",{onClick:()=>j(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("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:Me.map(s=>e.jsx("button",{onClick:()=>b(s.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${a===s.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:t(s.labelKey)},s.key))}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative md:w-52",children:[e.jsx(Ce,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:t("tasks.search_tasks"),value:m,onChange:s=>I(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),m&&e.jsx("button",{onClick:()=>I(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]}),e.jsx(S,{value:p,onChange:L,options:ve,className:"md:w-36"}),e.jsx(S,{value:v,onChange:M,options:me,className:"md:w-40"}),e.jsx(S,{value:g,onChange:B,options:ue,className:"md:w-40"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:t("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.time")})]})}),e.jsxs("tbody",{children:[c&&D.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(se,{rows:5})})}),!c&&D.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(te,{icon:Z,title:t("tasks.no_tasks_found"),description:V,action:X})})}),D.map(s=>e.jsx(Ie,{task:s},s.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[c&&D.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(se,{rows:5})}),!c&&D.length===0&&e.jsx(te,{icon:Z,title:t("tasks.no_tasks_found"),description:V,action:X}),D.map(s=>e.jsx(Le,{task:s},s.id))]}),(h.length>0||y)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",pe]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:xe,disabled:h.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(De,{className:"h-3.5 w-3.5"}),t("tasks.prev")]}),e.jsxs("button",{onClick:de,disabled:!y,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:[t("common.next"),e.jsx(Ae,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(Re,{isOpen:E,onClose:()=>j(!1),projects:k,projectsLoading:K,onSubmit:ce,isSubmitting:w}),e.jsx(Oe,{isOpen:W,onClose:()=>{F(!1),J(null)},onForceCreate:ie,onViewExisting:s=>{F(!1),J(null),n(`/tasks/${s}`)},similarTask:o,isLoading:w})]})}export{at as default};
1
+ import{R as he,f as G,a as U,o as u,j as e,l as re,u as fe,i as ge,v as ae,r,h as A,X as ye,k as je,w as O,x as ke,H as Ne,t as Y,y as Ce,z as Z,m as we}from"./index-0QFy9ku9.js";import{u as ee}from"./task.store-D_nwogGq.js";import{T as oe}from"./TaskStatusBadge-4rifJwVC.js";import{f as ne}from"./date-CmcdoD87.js";import{T as Se}from"./Tooltip-CAj06OH3.js";import{G as le}from"./git-fork-_pBPs-xc.js";import{S}from"./Select-xdty1j0i.js";import{p as _e}from"./developer-options-Czaxdx-w.js";import{a as Te}from"./task-constants-D5ty4qUR.js";import{g as Ee}from"./agent-type-options-BgAoGQFU.js";import{C as Pe}from"./copy-BWTAfZ7b.js";import{E as te}from"./EmptyState-DV7LUJer.js";import{T as se}from"./Skeleton-CmBnyd29.js";import{P as Fe}from"./plus-D38pnIMa.js";import{C as De}from"./chevron-left-BvZWPLc1.js";import{C as Ae}from"./chevron-right-Dirw-Ueo.js";import"./status-colors-DlyerwQ7.js";import"./chevron-down-SeRjAX4r.js";const Ie=he.memo(function({task:t}){const d=G(),{t:c}=U(),x=(a,b)=>c(`common.${a}`,{n:b}),i=t.status===u.COMPLETED||t.status===u.FAILED||t.status===u.CANCELLED;return e.jsxs("tr",{onClick:()=>d(`/tasks/${t.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:["#",t.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)] preserve-case",children:e.jsx(Se,{content:t.description,children:re(t)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(oe,{status:t.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.developerName??t.creatorName??"-"}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:t.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:[ne(t.createdAt,x),i&&e.jsx("button",{onClick:a=>{a.stopPropagation(),d(`/tasks/${t.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(le,{className:"h-3 w-3"})})]})})]})});function Re({isOpen:n,onClose:t,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:a}=U();fe(o=>o.user);const b=ge();ae(n);const[p,L]=r.useState(""),[v,M]=r.useState(""),[g,B]=r.useState("feat"),[m,I]=r.useState(""),[C,_]=r.useState(""),[h,T]=r.useState(""),[y,E]=r.useState(""),[j,k]=r.useState(""),[P,K]=r.useState(""),[z,q]=r.useState([]),[$,w]=r.useState(""),N=d.find(o=>o.key===p),W=Ee(o=>o,N==null?void 0:N.agentType);r.useEffect(()=>{if(!n||(L(""),M(""),B("feat"),I(""),_(""),T(""),E(""),k(""),K(""),w(""),!b))return;const o=new AbortController;return A.get("admin/developers",{searchParams:{status:"active"},signal:o.signal}).json().then(q).catch(()=>{}),()=>o.abort()},[n,b]);async function F(o){if(o.preventDefault(),w(""),!p||!v.trim()){w(a("tasks.project_and_description_required"));return}try{await x({projectKey:p,description:v.trim(),workerId:j||void 0,developerId:P?Number(P):void 0,taskType:g,branchSlug:C.trim()||void 0,agentType:m||void 0,targetBranch:h.trim()||void 0,issueRef:y.trim()||void 0})}catch(H){const R=H instanceof Error?H.message:a("tasks.failed_to_create_task");w(R)}}return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:t,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(ye,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:F,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.project")}),e.jsx(S,{value:p,onChange:L,options:d.map(o=>({value:o.key,label:o.name})),placeholder:a(c?"common.loading":"tasks.select_project"),disabled:c})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_type")}),e.jsx(S,{value:g,onChange:B,options:Te})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx(S,{value:m,onChange:I,options:W})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_description")}),e.jsx("textarea",{value:v,onChange:o=>M(o.target.value),placeholder:a("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_worker")}),e.jsx("input",{type:"text",value:j,onChange:o=>k(o.target.value),placeholder:a("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.branch_slug")}),e.jsx("input",{type:"text",value:C,onChange:o=>_(o.target.value),placeholder:a("tasks.branch_slug_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_branch")}),e.jsx("input",{type:"text",value:h,onChange:o=>T(o.target.value),placeholder:a("tasks.target_branch_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.issue_ref")}),e.jsx("input",{type:"text",value:y,onChange:o=>E(o.target.value),placeholder:a("tasks.issue_ref_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),b&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(S,{value:P,onChange:K,options:z.map(o=>({value:String(o.id),label:o.name})),placeholder:a("tasks.select_developer")})]}),$&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:$})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:t,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:i||!p||!v.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:a(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function Oe({isOpen:n,onClose:t,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:a}=U();return ae(n),!x||!n?null:e.jsx("div",{style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:b=>b.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(Pe,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",x.id," · ",x.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:x.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:t,disabled:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>c(x.id),style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:d,disabled:i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1},children:a(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function Le({task:n}){const t=G(),d=n.status===u.COMPLETED||n.status===u.FAILED||n.status===u.CANCELLED;return e.jsxs("div",{onClick:()=>t(`/tasks/${n.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2 preserve-case",title:we(n),children:["#",n.id," ",re(n)]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),t(`/tasks/${n.id}?action=fork`)},className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:e.jsx(le,{className:"h-3 w-3"})}),e.jsx(oe,{status:n.status})]})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:ne(n.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.workerName})]})]})]})}const Me=[{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"}],Be=20;function at(){const n=G(),{t}=U(),{tasks:d,loading:c,fetchTasks:x}=ee(),i=je(s=>s.taskSeq),[a,b]=r.useState("all"),[p,L]=r.useState(O.DEVELOP),[v,M]=r.useState(""),[g,B]=r.useState(""),[m,I]=r.useState(""),[C,_]=r.useState(void 0),[h,T]=r.useState([]),y=ee(s=>s.nextCursor),[E,j]=r.useState(!1);ke(r.useMemo(()=>e.jsxs("button",{onClick:()=>j(!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(Fe,{className:"h-3.5 w-3.5"}),t("tasks.new_task")]}),[t]));const[k,P]=r.useState([]),[K,z]=r.useState(!1),[q,$]=r.useState([]),[w,N]=r.useState(!1),[W,F]=r.useState(!1),[o,H]=r.useState(null),[R,J]=r.useState(null),Q=r.useCallback(s=>{const l={limit:String(Be)};return p&&(l.taskMode=p),a!=="all"&&(l.status=a),v&&(l.projectKey=v),g&&(l.developerId=g),s&&(l.cursor=s),l},[a,p,v,g]);r.useEffect(()=>{x(Q(C))},[Q,C,x,i]),r.useEffect(()=>{_(void 0),T([])},[a,p,v,g]),r.useEffect(()=>{let s=!1;return(async()=>{try{const[f,be]=await Promise.all([A.get("web/projects").json(),A.get("web/projects/-/developers").json()]);if(s)return;P(f),$(be)}catch{}})(),()=>{s=!0}},[]),r.useEffect(()=>{if(!E||k.length>0)return;z(!0);let s=!1;return(async()=>{try{const f=await A.get("web/projects").json();s||P(f)}catch{}finally{s||z(!1)}})(),()=>{s=!0}},[E,k.length]);const ce=r.useCallback(async s=>{N(!0);try{const l=await A.post("web/tasks",{json:{projectKey:s.projectKey,description:s.description,workerId:s.workerId,developerId:s.developerId,taskType:s.taskType,branchSlug:s.branchSlug,agentType:s.agentType,targetBranch:s.targetBranch,issueRef:s.issueRef}}).json();j(!1),n(`/tasks/${l.task.id}`)}catch(l){if(l instanceof Ne&&l.response.status===409){try{const f=await l.response.json();if(f.confirmRequired){H({id:f.confirmRequired.taskId,description:f.confirmRequired.message,status:"active"}),J(s),j(!1),F(!0);return}}catch{}Y.error(t("tasks.similar_task_exists"))}else{const f=l instanceof Error?l.message:String(l);Y.error(f)}}finally{N(!1)}},[n]),ie=r.useCallback(async()=>{if(R){N(!0);try{const s=await A.post("web/tasks",{json:{...R,force:!0}}).json();F(!1),J(null),n(`/tasks/${s.task.id}`)}finally{N(!1)}}},[R,n]),D=r.useMemo(()=>{if(!m.trim())return d;const s=m.toLowerCase();return d.filter(l=>(l.name??"").toLowerCase().includes(s)||l.description.toLowerCase().includes(s)||String(l.id).includes(m))},[d,m]),de=r.useCallback(()=>{y&&(T(s=>[...s,C??""]),_(y))},[y,C]),xe=r.useCallback(()=>{h.length!==0&&(_(h.at(-1)||void 0),T(s=>s.slice(0,-1)))},[h]),pe=h.length+1,me=r.useMemo(()=>[{value:"",label:t("tasks.filter_project")},...k.map(s=>({value:s.key,label:s.name}))],[k,t]),ue=r.useMemo(()=>[{value:"",label:t("tasks.filter_developer")},..._e(q)],[q,t]),ve=r.useMemo(()=>[{value:"",label:t("tasks.filter_mode")},{value:O.DEVELOP,label:t("tasks.mode_develop")},{value:O.PLAN,label:t("tasks.mode_plan")},{value:O.REVIEW,label:t("tasks.mode_review")},{value:O.AUTOMATION,label:t("tasks.mode_automation")}],[t]),V=t(m?"tasks.try_adjusting_search":"tasks.create_first_task"),X=m?void 0:e.jsx("button",{onClick:()=>j(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:t("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:Me.map(s=>e.jsx("button",{onClick:()=>b(s.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${a===s.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:t(s.labelKey)},s.key))}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative md:w-52",children:[e.jsx(Ce,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:t("tasks.search_tasks"),value:m,onChange:s=>I(s.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),m&&e.jsx("button",{onClick:()=>I(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]}),e.jsx(S,{value:p,onChange:L,options:ve,className:"md:w-36"}),e.jsx(S,{value:v,onChange:M,options:me,className:"md:w-40"}),e.jsx(S,{value:g,onChange:B,options:ue,className:"md:w-40"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:t("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:t("tasks.time")})]})}),e.jsxs("tbody",{children:[c&&D.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(se,{rows:5})})}),!c&&D.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(te,{icon:Z,title:t("tasks.no_tasks_found"),description:V,action:X})})}),D.map(s=>e.jsx(Ie,{task:s},s.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[c&&D.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(se,{rows:5})}),!c&&D.length===0&&e.jsx(te,{icon:Z,title:t("tasks.no_tasks_found"),description:V,action:X}),D.map(s=>e.jsx(Le,{task:s},s.id))]}),(h.length>0||y)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",pe]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:xe,disabled:h.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(De,{className:"h-3.5 w-3.5"}),t("tasks.prev")]}),e.jsxs("button",{onClick:de,disabled:!y,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:[t("common.next"),e.jsx(Ae,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(Re,{isOpen:E,onClose:()=>j(!1),projects:k,projectsLoading:K,onSubmit:ce,isSubmitting:w}),e.jsx(Oe,{isOpen:W,onClose:()=>{F(!1),J(null)},onForceCreate:ie,onViewExisting:s=>{F(!1),J(null),n(`/tasks/${s}`)},similarTask:o,isLoading:w})]})}export{at as default};
@@ -1 +1 @@
1
- import{a as l,j as a}from"./index--5cyM8L1.js";import{a as u}from"./status-colors-B460F2ZH.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-0QFy9ku9.js";import{a as u}from"./status-colors-DlyerwQ7.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--5cyM8L1.js";import{g as ee,H as ve}from"./task-agent-Cx6Aibwn.js";import{u as fe}from"./task.store-DzA1A6GX.js";import{P as ge}from"./PtyTerminal-fX-mJfnE.js";import{i as G,O as te}from"./OnboardingGuide-BZhFBXTO.js";import{C as be}from"./ConfirmStageDialog-pDcoEYGK.js";import{S as E}from"./Select-Buxh6kTz.js";import{a as se}from"./status-colors-B460F2ZH.js";import{a as je}from"./date-CmcdoD87.js";import{T as q,a as J,g as ke}from"./task-constants-BNLUt-jR.js";import{g as ye}from"./agent-type-options-BO0L8qFm.js";import{u as ae}from"./useFetch-O3XBp_Gw.js";import{P as $}from"./plus-jUKyQIr2.js";import{C as Ne}from"./chevron-down-BOM9LZkG.js";import{C as we}from"./chevron-up-DP7_Tzsv.js";import{R as Te}from"./rotate-ccw-EMxH_to4.js";import{C as Se}from"./clock-BSGAvAVI.js";import{W as _e}from"./wifi-BJaHHkkn.js";import"./chevron-right-Cjz_w39s.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-0QFy9ku9.js";import{g as ee,H as ve}from"./task-agent-Cgyq_UGX.js";import{u as fe}from"./task.store-D_nwogGq.js";import{P as ge}from"./PtyTerminal-DWRVuu-D.js";import{i as G,O as te}from"./OnboardingGuide-Cj05MAli.js";import{C as be}from"./ConfirmStageDialog-pT-iA956.js";import{S as E}from"./Select-xdty1j0i.js";import{a as se}from"./status-colors-DlyerwQ7.js";import{a as je}from"./date-CmcdoD87.js";import{T as q,a as J,g as ke}from"./task-constants-D5ty4qUR.js";import{g as ye}from"./agent-type-options-BgAoGQFU.js";import{u as ae}from"./useFetch-BqnEzaSJ.js";import{P as $}from"./plus-D38pnIMa.js";import{C as Ne}from"./chevron-down-SeRjAX4r.js";import{C as we}from"./chevron-up-D_UYsCj8.js";import{R as Te}from"./rotate-ccw-BsCb3qU2.js";import{C as Se}from"./clock-oJUEgAKB.js";import{W as _e}from"./wifi-Bore97VF.js";import"./chevron-right-Dirw-Ueo.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.