@overlordai/server 1.0.176 → 1.0.178
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.
- package/dist/connectors/connector.controller.d.ts.map +1 -1
- package/dist/connectors/connector.controller.js +2 -0
- package/dist/connectors/connector.controller.js.map +1 -1
- package/dist/database/repositories/connector.repository.d.ts +2 -0
- package/dist/database/repositories/connector.repository.d.ts.map +1 -1
- package/dist/database/repositories/connector.repository.js +8 -0
- package/dist/database/repositories/connector.repository.js.map +1 -1
- package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
- package/dist/dispatcher/scheduler.service.js +6 -1
- package/dist/dispatcher/scheduler.service.js.map +1 -1
- package/dist/web/admin/admin-connector.controller.d.ts +6 -0
- package/dist/web/admin/admin-connector.controller.d.ts.map +1 -1
- package/dist/web/admin/admin-connector.controller.js +88 -12
- package/dist/web/admin/admin-connector.controller.js.map +1 -1
- package/dist/web/project.controller.d.ts +1 -3
- package/dist/web/project.controller.d.ts.map +1 -1
- package/dist/web/project.controller.js +3 -2
- package/dist/web/project.controller.js.map +1 -1
- package/package.json +4 -4
- package/public/assets/{AccessTokensPage-CoUlSpBu.js → AccessTokensPage-1EKC1hiZ.js} +1 -1
- package/public/assets/AdminPage-51tboyFu.js +1 -0
- package/public/assets/{AgentCliPage-2zflW4gy.js → AgentCliPage-HVXHK2Or.js} +1 -1
- package/public/assets/{ApiReferencePage-BC8HEfcM.js → ApiReferencePage-TgiwRipe.js} +1 -1
- package/public/assets/{ArchitecturePage-Da9rv0hg.js → ArchitecturePage-BzeZql6h.js} +1 -1
- package/public/assets/{AuditLogPage-BrF0T3MT.js → AuditLogPage-y6n7Px8g.js} +1 -1
- package/public/assets/{AutomationCreatePage-DI-Z1v9e.js → AutomationCreatePage-CajNO4bS.js} +1 -1
- package/public/assets/{AutomationDetailPage-7TLMwELt.js → AutomationDetailPage-Dgf3Tb9C.js} +3 -8
- package/public/assets/{AutomationEditPage-BuOKTyTf.js → AutomationEditPage-DYaZj31T.js} +1 -1
- package/public/assets/{AutomationListPage-D4XF43yR.js → AutomationListPage-DxPUmPbs.js} +3 -3
- package/public/assets/{AutomationRunDetailPage-BDhPEndz.js → AutomationRunDetailPage-DmNxMDk5.js} +1 -1
- package/public/assets/{BindPlatformPage-DNamr2h_.js → BindPlatformPage-MYeCpBFT.js} +1 -1
- package/public/assets/{BotIntegrationPage-DN665fG6.js → BotIntegrationPage-Dnk8iYbr.js} +1 -1
- package/public/assets/BotManage-96DyyPVc.js +1 -0
- package/public/assets/{BotSetupPage-DPsT5Ln6.js → BotSetupPage-esAmTt5X.js} +1 -1
- package/public/assets/ChangelogPage-BZmrhbzu.js +1 -0
- package/public/assets/{Checkbox-D8xEau6n.js → Checkbox-CQt3GUhI.js} +1 -1
- package/public/assets/{CliReferencePage-DVtpCVyB.js → CliReferencePage-D-PUOTbI.js} +1 -1
- package/public/assets/{ConfirmStageDialog-Cu49oAnM.js → ConfirmStageDialog-DIsZM7QS.js} +1 -1
- package/public/assets/ConnectorsManage-v8CzbHwB.js +6 -0
- package/public/assets/{ConnectorsPage-DmC6MARl.js → ConnectorsPage-Czxmo0rf.js} +1 -1
- package/public/assets/{DeploymentPage-P3jrGKlU.js → DeploymentPage-BmfGIQ--.js} +1 -1
- package/public/assets/{DevWorkflowPage-DDE9wLKC.js → DevWorkflowPage-BwP87xBb.js} +1 -1
- package/public/assets/{DeveloperManage-Bpo7QRy5.js → DeveloperManage-Bu-dU6qo.js} +2 -2
- package/public/assets/{DeveloperSetupPage-CHz_5bNW.js → DeveloperSetupPage-PXns-tkJ.js} +1 -1
- package/public/assets/{DocsIndexPage-C8kNCHNc.js → DocsIndexPage-DHYB2eq5.js} +6 -11
- package/public/assets/{DocsLayout-CF22uAIS.js → DocsLayout-DLxSnG0D.js} +1 -1
- package/public/assets/{DocsPrimitives-BhxcRaTm.js → DocsPrimitives-D7h19aXG.js} +1 -1
- package/public/assets/{EditProjectPage-D_3HRO1s.js → EditProjectPage-BC0UDNOv.js} +2 -2
- package/public/assets/{EmptyState-IvQHEoph.js → EmptyState-CMDagsi4.js} +1 -1
- package/public/assets/{EnvVariablesPage-DNuaFEmN.js → EnvVariablesPage-BB7ahnB1.js} +1 -1
- package/public/assets/HomePage-CssNquOH.js +1 -0
- package/public/assets/{InfoRow-C_tQVkuP.js → InfoRow-BxIE0xaA.js} +1 -1
- package/public/assets/{InstallationPage-CK1BUOe2.js → InstallationPage-CcJ0J1Zn.js} +1 -1
- package/public/assets/{LandingPage-DvR0mLWM.js → LandingPage-BiMt64NW.js} +1 -1
- package/public/assets/{LocalDevelopmentPage-C-5yQqhM.js → LocalDevelopmentPage-D4FSxH3d.js} +1 -1
- package/public/assets/{LoginPage-BdTmOyQm.js → LoginPage-dLNo1JNx.js} +1 -1
- package/public/assets/{MetricBar-CKXN_2Ue.js → MetricBar-kakUenDO.js} +1 -1
- package/public/assets/{MultiSelect-DegVW8UL.js → MultiSelect-CmPlPDVq.js} +1 -1
- package/public/assets/{NotFoundPage-V93x8tfy.js → NotFoundPage-ohSBiBT-.js} +1 -1
- package/public/assets/{OnboardingGuide-Crybb-Zh.js → OnboardingGuide-cHKCR0M5.js} +1 -1
- package/public/assets/{PermissionsPage-BmehbFsh.js → PermissionsPage-7-IPdVXg.js} +1 -1
- package/public/assets/{PipelineConfigPage-DZVU3Vkj.js → PipelineConfigPage-BX6JMHM4.js} +1 -1
- package/public/assets/{PipelineEditorPage-BH67Oewc.js → PipelineEditorPage-BeNxSKH5.js} +1 -1
- package/public/assets/{PlanPage-B4OhS9_O.js → PlanPage-B7z3l_2F.js} +1 -1
- package/public/assets/{ProfilePage-DpMfRGms.js → ProfilePage-DwsnCrys.js} +1 -1
- package/public/assets/{ProjectDetailPage-BOvwgwui.js → ProjectDetailPage-CzLqL69C.js} +3 -3
- package/public/assets/{ProjectListPage-C2ZPh8P9.js → ProjectListPage-Do-9PkUN.js} +1 -1
- package/public/assets/{PtyTerminal-DKh7d_-3.js → PtyTerminal-Z14rUlQy.js} +1 -1
- package/public/assets/{QuickAuth-D2EErll5.js → QuickAuth-CX1phe7h.js} +1 -1
- package/public/assets/RemoveMemberConfirmDialog-DI3-C2N9.js +6 -0
- package/public/assets/{ReviewAggregatePage-CTSuOo4O.js → ReviewAggregatePage-tiy7PRsr.js} +2 -2
- package/public/assets/ReviewPage-CmbUljfI.js +1 -0
- package/public/assets/Select-LGk_EawR.js +1 -0
- package/public/assets/{SettingsPage-D3tDh7gu.js → SettingsPage-BpS56Ttu.js} +1 -1
- package/public/assets/{Skeleton-Crpru9Ol.js → Skeleton-DaeQHyTP.js} +1 -1
- package/public/assets/{SkillPage-BiwP6aqc.js → SkillPage-BexkozUK.js} +1 -1
- package/public/assets/TaskDetailPage-CElleGRa.js +21 -0
- package/public/assets/{TaskGuidePage-DD_jyUVW.js → TaskGuidePage-C5Ed0gO0.js} +1 -1
- package/public/assets/TaskListPage-CdajIIwz.js +1 -0
- package/public/assets/{TaskStatusBadge-Cfz28K6K.js → TaskStatusBadge-CuTVIvqD.js} +1 -1
- package/public/assets/{TerminalHomePage-BmhBvY10.js → TerminalHomePage-Cs3JoG8j.js} +1 -1
- package/public/assets/{TokenManage-CYSBKzT7.js → TokenManage-BeDY8n-U.js} +1 -1
- package/public/assets/Tooltip-DjIk-pqB.js +1 -0
- package/public/assets/{TotpSetupPage-DP5q6oE-.js → TotpSetupPage-C_NjLBdt.js} +1 -1
- package/public/assets/{WorkerDetailPage-LMirCNtN.js → WorkerDetailPage-CuuvI6Fx.js} +1 -1
- package/public/assets/{WorkerListPage-q6siISS8.js → WorkerListPage-70g7vy3m.js} +1 -1
- package/public/assets/{WorkerOperationsPage-CGzqG_QM.js → WorkerOperationsPage-BL4BZ45w.js} +1 -1
- package/public/assets/{WorkerSetupGuidePage-aVkDqrMr.js → WorkerSetupGuidePage-jnyL_uM0.js} +1 -1
- package/public/assets/{WorkerSetupPage-C_zONAIf.js → WorkerSetupPage-ChyjqvnS.js} +1 -1
- package/public/assets/{agent-type-options-BiSKx1a4.js → agent-type-options-BpMI3Naw.js} +1 -1
- package/public/assets/{arrow-left-sGTyHBvX.js → arrow-left-BL1QzlAp.js} +1 -1
- package/public/assets/{arrow-right-_NIT1UtR.js → arrow-right-BrrN-7YA.js} +1 -1
- package/public/assets/{bot-CDSBtXc_.js → bot-D-zp4qz4.js} +1 -1
- package/public/assets/{chevron-down-CE0uuyBZ.js → chevron-down-BOgq_PNA.js} +1 -1
- package/public/assets/{chevron-left-C0Zw71uv.js → chevron-left-BPO7Bb6l.js} +1 -1
- package/public/assets/{chevron-right-BCit7CZP.js → chevron-right-DHCIokyJ.js} +1 -1
- package/public/assets/{chevron-up-Bl0OZM4v.js → chevron-up-wO9VgMYB.js} +1 -1
- package/public/assets/{circle-alert-rHCTliEW.js → circle-alert-DkW4_zyQ.js} +1 -1
- package/public/assets/{clock-BwsbKSS6.js → clock-BbJkwoCd.js} +1 -1
- package/public/assets/{copy-h1a805Rd.js → copy-BBOWX6ou.js} +1 -1
- package/public/assets/developer-options-PMfL5Zv7.js +1 -0
- package/public/assets/{download-URcu3Jx3.js → download-CbWraeN_.js} +1 -1
- package/public/assets/{external-link-FhyMbjzB.js → external-link-CEkNn2LX.js} +1 -1
- package/public/assets/{git-fork-Dc1BvdTN.js → git-fork-B775P9bq.js} +1 -1
- package/public/assets/{index-J1zWTACN.js → index-Dh1GMLID.js} +15 -15
- package/public/assets/index-DwFw8jxe.css +1 -0
- package/public/assets/{key-COdogDFT.js → key-Dl9aLBg3.js} +1 -1
- package/public/assets/link-2-BBq5JW-o.js +6 -0
- package/public/assets/{loader-circle-Bq_BpbZ2.js → loader-circle-wSNLBiy-.js} +1 -1
- package/public/assets/{pencil-0fxibflK.js → pencil-ZFPPMxtk.js} +1 -1
- package/public/assets/{play-Dbk8Wgkn.js → play-DX-9yzZV.js} +1 -1
- package/public/assets/plug-BxGp3gAo.js +6 -0
- package/public/assets/{plus-V36Q_nxP.js → plus-Cn46sPb9.js} +1 -1
- package/public/assets/power-PnMndXJz.js +6 -0
- package/public/assets/{rotate-ccw-ByVQRmQu.js → rotate-ccw-zdevuzi_.js} +1 -1
- package/public/assets/{scroll-text-C2iOLXnA.js → scroll-text-BGkAQAvr.js} +1 -1
- package/public/assets/{settings-DrgaMc9j.js → settings-CfrsrJUV.js} +1 -1
- package/public/assets/{skip-forward-SfkU0vVB.js → skip-forward-ckOfJ8QF.js} +1 -1
- package/public/assets/status-colors-DC-m2CdG.js +1 -0
- package/public/assets/{task-agent-BIYkVnlP.js → task-agent-ZWBurVoa.js} +1 -1
- package/public/assets/{task-constants-07c7xWcv.js → task-constants-DfpO4NY9.js} +1 -1
- package/public/assets/{task.store-DWG-SG1e.js → task.store-B461yHYH.js} +1 -1
- package/public/assets/{timer-IeRNhyK4.js → timer-BFPhC5N0.js} +1 -1
- package/public/assets/{trash-2-DuFeqRaH.js → trash-2-CaIOqYj_.js} +1 -1
- package/public/assets/{useFetch-CZCaxaCi.js → useFetch-CJMNf1mK.js} +1 -1
- package/public/assets/{users-CG1y1K_u.js → users-BCrPK5sS.js} +1 -1
- package/public/assets/{wifi-Dvp0MK85.js → wifi-Cm-x6iNY.js} +1 -1
- package/public/assets/{workflow-qWh96h21.js → workflow-Burj_14o.js} +1 -1
- package/public/assets/{zap-Cwv7x_Mg.js → zap-BAYG3kyF.js} +1 -1
- package/public/index.html +2 -2
- package/public/sw.js +1 -1
- package/public/assets/AdminPage-BonHpbC8.js +0 -1
- package/public/assets/BotManage-DvfKuBFx.js +0 -6
- package/public/assets/ChangelogPage-D1_YfUwN.js +0 -1
- package/public/assets/HomePage-B7S2lrwi.js +0 -1
- package/public/assets/RemoveMemberConfirmDialog-Bnq4vIGU.js +0 -6
- package/public/assets/ReviewPage-Dx31QqyM.js +0 -1
- package/public/assets/Select-BXx8KPbW.js +0 -1
- package/public/assets/TaskDetailPage-DHW9thUL.js +0 -21
- package/public/assets/TaskListPage-CBIv7NTp.js +0 -1
- package/public/assets/Tooltip-DZdu3ZKx.js +0 -1
- package/public/assets/index-B40ZH6vh.css +0 -1
- package/public/assets/status-colors-IR97PkWv.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as g,r as p,j as e,
|
|
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-Dh1GMLID.js";import{S as C}from"./Select-LGk_EawR.js";import"./chevron-down-BOgq_PNA.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-
|
|
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-Dh1GMLID.js";import{E as ce}from"./EmptyState-CMDagsi4.js";import{T as ie}from"./Skeleton-DaeQHyTP.js";import{C as le}from"./ConfirmStageDialog-DIsZM7QS.js";import{f as de}from"./date-CmcdoD87.js";import{S as pe}from"./Select-LGk_EawR.js";import{P as ue}from"./plus-Cn46sPb9.js";import{E as me}from"./external-link-CEkNn2LX.js";import{C as xe}from"./chevron-left-BPO7Bb6l.js";import{C as fe}from"./chevron-right-DHCIokyJ.js";import"./clock-BbJkwoCd.js";import"./chevron-down-BOgq_PNA.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,
|
|
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-Dh1GMLID.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-BxIE0xaA.js";import{u as V}from"./useFetch-CJMNf1mK.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.178"]}),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,7 +1,7 @@
|
|
|
1
|
-
import{c as R,a as
|
|
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-Dh1GMLID.js";import{U as P,A as G,R as Q}from"./RemoveMemberConfirmDialog-DI3-C2N9.js";import{T as X}from"./Tooltip-DjIk-pqB.js";import{c as _}from"./date-CmcdoD87.js";import{t as $}from"./status-colors-DC-m2CdG.js";import{I as o}from"./InfoRow-BxIE0xaA.js";import{u as Y}from"./useFetch-CJMNf1mK.js";import{P as Z}from"./pencil-ZFPPMxtk.js";import{T as ee}from"./trash-2-CaIOqYj_.js";import{A as te}from"./arrow-left-BL1QzlAp.js";import{P as re}from"./plus-Cn46sPb9.js";import"./Select-LGk_EawR.js";import"./chevron-down-BOgq_PNA.js";/**
|
|
2
2
|
* @license lucide-react v0.469.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const se=R("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ae({isOpen:n,onClose:a,onConfirm:r,projectName:m,loading:p}){const{t:j}=$();return e.jsx(q,{isOpen:n,onClose:a,onConfirm:r,title:`> ${j("projects.delete_project")}`,message:j("projects.delete_project_confirm",{name:m}),confirmLabel:j("projects.delete_project"),confirmVariant:"danger",isLoading:p})}function ue(){const{key:n}=B(),a=K(),{t:r}=$(),m=H(t=>t.user),p=J(),[j,N]=x.useState(!1),[L,C]=x.useState(!1),[S,A]=x.useState(!1),[d,u]=x.useState(null),[W,I]=x.useState(!1),{data:l,loading:F,error:M,refetch:y}=X(async()=>{if(!n)throw new Error("Missing project key");const[t,w,f]=await Promise.all([h.get(`web/projects/${n}`).json(),h.get(`web/projects/${n}/members`).json().catch(()=>[]),h.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(U=>U.data).catch(()=>[])]);let v=null;if(t.pipeline)try{v=JSON.parse(t.pipeline)}catch{}return{project:t,members:w,tasks:f,pipelineConfig:v}},[n]),s=(l==null?void 0:l.project)??null,b=(l==null?void 0:l.members)??[],g=(l==null?void 0:l.tasks)??[],i=(l==null?void 0:l.pipelineConfig)??null,c=p||b.some(t=>t.developerId===(m==null?void 0:m.id)&&t.role===k.MAINTAINER);V(x.useMemo(()=>s?e.jsxs(e.Fragment,{children:[c&&e.jsxs("button",{onClick:()=>a(`/projects/${s.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(Y,{className:"h-3 w-3"}),r("common.edit")]}),p&&e.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(ee,{className:"h-3 w-3"}),r("common.delete")]})]}):null,[s,c,p,a,r]));async function O(){if(s){C(!0);try{await h.delete(`admin/projects/${s.key}`),a("/projects")}catch{}finally{C(!1),N(!1)}}}async function E(){if(!(!s||!d)){I(!0);try{await h.delete(`web/projects/${s.key}/members`,{searchParams:{developerId:String(d.developerId)}}),await y()}catch{}finally{I(!1),u(null)}}}return F?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):M?e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--destructive)]",children:M}),e.jsx("button",{onClick:()=>y(),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("common.retry")})]}):s?e.jsxs("div",{className:"mx-auto max-w-6xl",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>a("/projects"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(te,{className:"h-4 w-4"})}),e.jsxs("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:[s.key," — ",s.name]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 hidden md:block text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>a("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.key"),value:s.key}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.name"),value:s.name}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.repo_url"),value:s.repoUrl,href:s.repoUrl}),s.sshUrl&&e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.ssh_url"),value:s.sshUrl}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.git_platform"),value:s.gitPlatform}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_branch"),value:s.defaultBranch}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.agent_type"),value:s.agentType}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.max_turns"),value:String(s.maxTurns)}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.allowed_tools"),value:s.allowedTools??"all"}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_project"),value:s.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.members")}),c&&e.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(re,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),b.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_members_yet")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] p-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"block text-[11px] mt-0.5",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-muted)"},children:t.role})]}),c&&e.jsx("button",{onClick:()=>u(t),className:"shrink-0 text-[var(--destructive)] hover:underline ml-2","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})]},t.developerId))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.added_at")}),c&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:r("common.actions")})]})}),e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-secondary)"},children:t.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)}),c&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>u(t),className:"text-[var(--destructive)] hover:underline","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})})]},t.developerId))})]})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.recent_tasks")}),g.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_tasks_for_project")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:g.map(t=>e.jsxs("div",{className:"cursor-pointer rounded-[4px] border border-[var(--border)] p-3 transition-colors active:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),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:t.description,children:["#",t.id," ",D(t)]}),e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:T[t.status]},children:t.status})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:_(t.createdAt)})]},t.id))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.created")})]})}),e.jsx("tbody",{children:g.map(t=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",t.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)] preserve-case",children:e.jsx(Q,{content:t.description,children:D(t)})}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:T[t.status]},children:t.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)})]},t.id))})]})})]})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:r("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),i!=null&&i.stages&&i.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:i.stages.map((t,w)=>{var f,v;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>a(`/projects/${s.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:t.label??t.name}),t.prompt&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",t.prompt.split(`
|
|
7
|
-
`)[0].slice(0,40)]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.requireConfirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:r("projects.confirm_label")})})]}),((f=t.onFailure)==null?void 0:f.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(
|
|
6
|
+
*/const se=R("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);function ae({isOpen:n,onClose:a,onConfirm:r,projectName:m,loading:p}){const{t:j}=T();return e.jsx(q,{isOpen:n,onClose:a,onConfirm:r,title:`> ${j("projects.delete_project")}`,message:j("projects.delete_project_confirm",{name:m}),confirmLabel:j("projects.delete_project"),confirmVariant:"danger",isLoading:p})}function ue(){const{key:n}=B(),a=K(),{t:r}=T(),m=H(t=>t.user),p=J(),[j,N]=x.useState(!1),[L,C]=x.useState(!1),[S,A]=x.useState(!1),[d,u]=x.useState(null),[W,I]=x.useState(!1),{data:l,loading:F,error:M,refetch:y}=Y(async()=>{if(!n)throw new Error("Missing project key");const[t,w,f]=await Promise.all([h.get(`web/projects/${n}`).json(),h.get(`web/projects/${n}/members`).json().catch(()=>[]),h.get("web/tasks",{searchParams:{projectKey:n,limit:"20"}}).json().then(U=>U.data).catch(()=>[])]);let v=null;if(t.pipeline)try{v=JSON.parse(t.pipeline)}catch{}return{project:t,members:w,tasks:f,pipelineConfig:v}},[n]),s=(l==null?void 0:l.project)??null,b=(l==null?void 0:l.members)??[],g=(l==null?void 0:l.tasks)??[],i=(l==null?void 0:l.pipelineConfig)??null,c=p||b.some(t=>t.developerId===(m==null?void 0:m.id)&&t.role===k.MAINTAINER);V(x.useMemo(()=>s?e.jsxs(e.Fragment,{children:[c&&e.jsxs("button",{onClick:()=>a(`/projects/${s.key}/edit`),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--border)] bg-transparent px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:[e.jsx(Z,{className:"h-3 w-3"}),r("common.edit")]}),p&&e.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1.5 rounded-[4px] border border-[var(--destructive)] bg-transparent px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)] hover:text-white",children:[e.jsx(ee,{className:"h-3 w-3"}),r("common.delete")]})]}):null,[s,c,p,a,r]));async function O(){if(s){C(!0);try{await h.delete(`admin/projects/${s.key}`),a("/projects")}catch{}finally{C(!1),N(!1)}}}async function E(){if(!(!s||!d)){I(!0);try{await h.delete(`web/projects/${s.key}/members`,{searchParams:{developerId:String(d.developerId)}}),await y()}catch{}finally{I(!1),u(null)}}}return F?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-[var(--border)] border-t-[var(--accent)]"})}):M?e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--destructive)]",children:M}),e.jsx("button",{onClick:()=>y(),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("common.retry")})]}):s?e.jsxs("div",{className:"mx-auto max-w-6xl",children:[e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-3 shrink-0 md:hidden",children:[e.jsx("button",{onClick:()=>a("/projects"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(te,{className:"h-4 w-4"})}),e.jsxs("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:[s.key," — ",s.name]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[e.jsxs("div",{className:"mb-2 hidden md:block text-xs text-[var(--text-muted)]",children:[e.jsx("span",{className:"cursor-pointer hover:text-[var(--text-secondary)]",onClick:()=>a("/projects"),children:r("projects.title")})," / ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.key})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.project_info")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.key"),value:s.key}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.name"),value:s.name}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.repo_url"),value:s.repoUrl,href:s.repoUrl}),s.sshUrl&&e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.ssh_url"),value:s.sshUrl}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.git_platform"),value:s.gitPlatform}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_branch"),value:s.defaultBranch}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.agent_type"),value:s.agentType}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.max_turns"),value:String(s.maxTurns)}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.allowed_tools"),value:s.allowedTools??"all"}),e.jsx(o,{variant:"fixed-label",labelWidth:"w-32",label:r("projects.default_project"),value:s.isDefault?"yes":"no"})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--accent)]",children:r("projects.members")}),c&&e.jsxs("button",{onClick:()=>A(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-medium text-black",children:[e.jsx(re,{className:"h-3.5 w-3.5"}),r("projects.add_member")]})]}),b.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_members_yet")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:b.map(t=>e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] border border-[var(--border)] p-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-xs text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("span",{className:"block text-[11px] mt-0.5",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-muted)"},children:t.role})]}),c&&e.jsx("button",{onClick:()=>u(t),className:"shrink-0 text-[var(--destructive)] hover:underline ml-2","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})]},t.developerId))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.name")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.role")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.added_at")}),c&&e.jsx("th",{className:"pb-2 text-right text-xs font-medium text-[var(--text-muted)]",children:r("common.actions")})]})}),e.jsx("tbody",{children:b.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-primary)]",children:t.developerName??`#${t.developerId}`}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:t.role===k.MAINTAINER?"var(--warning)":"var(--text-secondary)"},children:t.role}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)}),c&&e.jsx("td",{className:"py-2.5 text-right",children:e.jsx("button",{onClick:()=>u(t),className:"text-[var(--destructive)] hover:underline","aria-label":r("projects.remove_member"),children:e.jsx(P,{className:"h-3.5 w-3.5"})})})]},t.developerId))})]})})]})]}),e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-[var(--accent)]",children:r("projects.recent_tasks")}),g.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("projects.no_tasks_for_project")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-2 md:hidden",children:g.map(t=>e.jsxs("div",{className:"cursor-pointer rounded-[4px] border border-[var(--border)] p-3 transition-colors active:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),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:t.description,children:["#",t.id," ",D(t)]}),e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:$[t.status]},children:t.status})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)] mt-1 block",children:_(t.createdAt)})]},t.id))}),e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border-row)]",children:[e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.id")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.description")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.status")}),e.jsx("th",{className:"pb-2 text-left text-xs font-medium text-[var(--text-muted)]",children:r("projects.created")})]})}),e.jsx("tbody",{children:g.map(t=>e.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border-row)] last:border-b-0 hover:bg-[var(--bg-input)]",onClick:()=>a(`/tasks/${t.id}`),children:[e.jsxs("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:["#",t.id]}),e.jsx("td",{className:"max-w-xs truncate py-2.5 text-sm text-[var(--text-primary)] preserve-case",children:e.jsx(X,{content:t.description,children:D(t)})}),e.jsx("td",{className:"py-2.5 text-sm",style:{color:$[t.status]},children:t.status}),e.jsx("td",{className:"py-2.5 text-sm text-[var(--text-secondary)]",children:_(t.createdAt)})]},t.id))})]})})]})]})]}),e.jsx("div",{children:e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 md:p-5",children:[e.jsx("h2",{className:"mb-4 text-[13px] font-medium text-[var(--accent)]",children:r("projects.pipeline")}),e.jsx("div",{className:"mb-3 h-px bg-[var(--border)]"}),i!=null&&i.stages&&i.stages.length>0?e.jsx("div",{className:"flex flex-col items-center",children:i.stages.map((t,w)=>{var f,v;return e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-[4px] bg-[var(--bg-input)] px-3 py-2.5 cursor-pointer hover:bg-[var(--bg-secondary)]",style:{borderLeft:"3px solid var(--accent)"},onClick:()=>a(`/projects/${s.key}/pipeline`),children:[e.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[e.jsx("span",{className:"text-xs font-medium text-[var(--text-primary)]",children:t.label??t.name}),t.prompt&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)] truncate",children:["// ",t.prompt.split(`
|
|
7
|
+
`)[0].slice(0,40)]})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.requireConfirm&&e.jsx("span",{className:"rounded-[4px] px-2 py-0.5 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:r("projects.confirm_label")})})]}),((f=t.onFailure)==null?void 0:f.goto)&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 py-1",children:[e.jsx(z,{className:"h-3 w-3 text-[var(--warning)]"}),e.jsxs("span",{className:"text-[11px] text-[var(--warning)]",children:["onFailure.goto: ",t.onFailure.goto,", maxLoops: ",t.onFailure.maxLoops]})]}),w<i.stages.length-1&&!((v=t.onFailure)!=null&&v.goto)&&e.jsx("div",{className:"flex justify-center py-1",children:e.jsx(se,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})})]},t.name)})}):e.jsx("div",{className:"py-6 text-center text-xs text-[var(--text-muted)]",children:r("projects.no_pipeline_configured")}),c&&e.jsx("button",{onClick:()=>a(`/projects/${s.key}/pipeline`),className:"mt-3 flex w-full items-center justify-center gap-1.5 py-2 text-xs text-[var(--accent)] hover:text-[var(--accent)]",children:r("projects.add_stage")})]})})]}),e.jsx(ae,{isOpen:j,onClose:()=>N(!1),onConfirm:O,projectName:s.name,loading:L}),e.jsx(G,{isOpen:S,onClose:()=>A(!1),projectKey:s.key,existingMemberIds:b.map(t=>t.developerId),onAdded:y}),e.jsx(Q,{isOpen:!!d,onClose:()=>u(null),onConfirm:E,memberName:d?d.developerName??`#${d.developerId}`:"",loading:W})]})]}):e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("projects.project_not_found")}),e.jsx("button",{onClick:()=>a("/projects"),className:"mt-4 rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)]",children:r("projects.back_to_projects")})]})}export{ue as default};
|
|
@@ -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-
|
|
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-Dh1GMLID.js";import{S as U}from"./Select-LGk_EawR.js";import{a as D}from"./agent-type-options-BpMI3Naw.js";import{E as J}from"./EmptyState-CMDagsi4.js";import{T as O}from"./Skeleton-DaeQHyTP.js";import{t as q}from"./date-CmcdoD87.js";import{u as W}from"./useFetch-CJMNf1mK.js";import{P as $}from"./plus-Cn46sPb9.js";import{A as K}from"./arrow-left-BL1QzlAp.js";import"./chevron-down-BOgq_PNA.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-
|
|
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-Dh1GMLID.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,
|
|
1
|
+
import{a as h,r as s,h as b,a9 as v,j as e,C as j}from"./index-Dh1GMLID.js";import{C as f}from"./copy-BBOWX6ou.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};
|
|
@@ -0,0 +1,6 @@
|
|
|
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-Dh1GMLID.js";import{S as N}from"./Select-LGk_EawR.js";/**
|
|
2
|
+
* @license lucide-react v0.469.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const $=R("UserMinus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);function B({isOpen:s,onClose:l,projectKey:i,existingMemberIds:d=[],onAdded:m}){const{t}=_();w(s);const[E,M]=a.useState([]),[o,u]=a.useState(""),[v,j]=a.useState(c.MEMBER),[x,f]=a.useState(!1),[y,p]=a.useState("");a.useEffect(()=>{if(!s)return;async function r(){try{const n=await g.get("admin/developers",{searchParams:{status:"active"}}).json();M(n)}catch{}}r()},[s]);function b(){u(""),j(c.MEMBER),p(""),l()}async function S(r){if(r.preventDefault(),!!o){p(""),f(!0);try{await g.post(`web/projects/${i}/members`,{json:{developerId:parseInt(o,10),role:v}}),m(),b()}catch(n){const h=n instanceof Error?n.message:"",k=h.includes("409")?t("projects.member_already_exists"):h||t("projects.failed_to_add_member");p(k)}finally{f(!1)}}}return s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]"}),e.jsx("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:e.jsxs("form",{onSubmit:S,children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h3",{className:"text-sm text-[var(--text-primary)]",children:t("projects.add_member_title")}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:b,children:e.jsx(C,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:t("projects.developer")}),e.jsx(N,{value:o,onChange:u,options:E.filter(r=>!d.includes(r.id)&&r.status===D.ACTIVE).map(r=>({value:String(r.id),label:`${r.name} (${r.gitEmail})`})),placeholder:t("projects.select_developer")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:t("projects.role")}),e.jsx(N,{value:v,onChange:r=>j(r),options:[{value:c.MEMBER,label:t("projects.member_role")},{value:c.MAINTAINER,label:t("projects.maintainer_role")}]})]}),y&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:y})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",disabled:x,onClick:b,children:t("common.cancel")}),e.jsx("button",{type:"submit",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:x||!o,children:t(x?"projects.adding":"projects.add_member")})]})]})})]}):null}function P({isOpen:s,onClose:l,onConfirm:i,memberName:d,loading:m}){const{t}=_();return e.jsx(I,{isOpen:s,onClose:l,onConfirm:i,title:`> ${t("projects.remove_member")}`,message:t("projects.remove_member_confirm",{name:d}),confirmLabel:t("common.remove"),confirmVariant:"danger",isLoading:m})}export{B as A,P as R,$ as U};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as xe,B as me,f as ue,a as
|
|
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-Dh1GMLID.js";import{P as je}from"./PtyTerminal-Z14rUlQy.js";import{T as Ne}from"./Skeleton-DaeQHyTP.js";import{C as K}from"./Checkbox-CQt3GUhI.js";import{f as we,b as ye}from"./date-CmcdoD87.js";import{a as Se}from"./agent-type-options-BpMI3Naw.js";import{T as z,g as q}from"./task-constants-DfpO4NY9.js";import{A as ke}from"./arrow-left-BL1QzlAp.js";import{L as Ce}from"./loader-circle-wSNLBiy-.js";import{P as Q}from"./play-DX-9yzZV.js";import{S as Te}from"./skip-forward-ckOfJ8QF.js";import{R as Re}from"./rotate-ccw-zdevuzi_.js";import{C as Ae}from"./chevron-up-wO9VgMYB.js";import{C as Ee}from"./chevron-down-BOgq_PNA.js";import{C as De}from"./circle-alert-DkW4_zyQ.js";/**
|
|
2
2
|
* @license lucide-react v0.469.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Ie=xe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),X={critical:0,warning:1,suggestion:2};function Le(s){switch(s){case"critical":return{text:"text-[var(--destructive)]",bg:"rgba(239,68,68,0.12)",border:"rgba(239,68,68,0.27)"};case"warning":return{text:"text-[var(--warning)]",bg:"rgba(245,158,11,0.12)",border:"rgba(245,158,11,0.27)"};default:return{text:"text-[var(--info)]",bg:"rgba(59,130,246,0.10)",border:"rgba(59,130,246,0.27)"}}}function _e({severity:s}){return s==="critical"?e.jsx(De,{className:"h-3.5 w-3.5 text-[var(--destructive)]"}):s==="warning"?e.jsx(W,{className:"h-3.5 w-3.5 text-[var(--warning)]"}):e.jsx(Ie,{className:"h-3.5 w-3.5 text-[var(--info)]"})}function $e(s){switch(s){case p.RUNNING:return"bg-[var(--accent)]";case p.QUEUED:case p.ASSIGNED:case p.SUSPENDED:return"bg-[var(--warning)]";case p.COMPLETED:return"bg-[var(--accent)]";case p.FAILED:return"bg-[var(--destructive)]";default:return"bg-[#525252]"}}function Z(s){return s===p.RUNNING||s===p.QUEUED||s===p.ASSIGNED}function G(s){return s===p.SUSPENDED}const Pe=Se(V);function Fe({task:s,expanded:l,onToggleExpand:a}){const v=V(s.agentType),d=$e(s.status),o=ye(s.startedAt,s.completedAt??void 0),N=Z(s.status),b=z.includes(s.status),y=r.useRef(null);return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3 hover:bg-[var(--bg-input)] transition-colors",onClick:a,children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${d} ${N?"animate-pulse":""}`}),e.jsx("span",{className:"flex-1 text-xs font-medium text-[var(--text-primary)]",children:v}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[N?`${s.status.toLowerCase()}...`:s.status.toLowerCase(),o&&` · ${o}`]}),e.jsxs("a",{href:`/tasks/${s.id}`,target:"_blank",rel:"noopener noreferrer",onClick:S=>S.stopPropagation(),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-muted)] hover:text-[var(--accent)] hover:border-[var(--accent)] transition-colors flex items-center gap-1",children:[e.jsx(ge,{className:"h-3 w-3"}),"↗"]}),l?e.jsx(Ae,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}):e.jsx(Ee,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})]}),l&&e.jsx("div",{className:"border-t border-[var(--border)]",style:{height:"300px"},children:e.jsx(je,{ref:y,taskId:s.id,sessionId:s.currentSessionId??void 0,taskFinished:b})})]})}function Ue({issue:s}){const l=Le(s.severity);return e.jsxs("div",{className:`rounded-[4px] p-3 text-xs ${s.isDuplicate?"opacity-60":""}`,style:{backgroundColor:l.bg,border:`1px solid ${l.border}`},children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx(_e,{severity:s.severity}),e.jsx("span",{className:`font-bold ${l.text}`,children:s.severity}),s.agentType&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:s.agentType}),e.jsxs("span",{className:"text-[var(--text-muted)]",children:[s.file,s.line!=null?`:${s.line}`:""]}),s.isDuplicate&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:"duplicate"})]}),e.jsx("p",{className:"mb-1 text-[var(--text-secondary)]",children:s.description}),s.suggestion&&e.jsxs("p",{className:"text-[var(--text-muted)]",children:[e.jsx("span",{className:"font-medium",children:"suggestion:"})," ",s.suggestion]})]})}function Me({sourceTaskId:s,defaultReviewers:l,onClose:a,onLaunched:v}){const{t:d}=H(),o=l.length>0?l:[he.CLAUDE],N=l.length>0,[b,y]=r.useState(o),[S,$]=r.useState(""),[w,P]=r.useState(""),[T,I]=r.useState(!1),[R,A]=r.useState(!1);function F(i){y(g=>g.includes(i)?g.filter(h=>h!==i):[...g,i])}async function k(){if(b.length===0){j.error("select at least one review agent.");return}A(!0);try{await _.post(`web/tasks/${s}/review`,{json:{agentTypes:b,description:S.trim()||void 0,skipFix:T||void 0,issueRef:w.trim()||void 0}}),j.success("review launched"),v(),a()}catch(i){const g=i instanceof Error?i.message:String(i);j.error(g)}finally{A(!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:d("review.review_again")}),e.jsx("button",{onClick:a,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(fe,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:d("review.select_agents")}),N&&e.jsx("span",{className:"rounded-[4px] border border-amber-500/40 bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-500",children:"using project defaults"})]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:Pe.map(i=>e.jsx(K,{checked:b.includes(i.value),onCheckedChange:()=>F(i.value),label:i.label,containerClassName:"w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors"},i.value))}),e.jsx("textarea",{value:S,onChange:i=>$(i.target.value),placeholder:d("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(K,{checked:T,onCheckedChange:I,label:d("review.skip_fix_label"),containerClassName:"mb-3 w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors",labelClassName:"text-[var(--text-muted)]"}),e.jsx("input",{value:w,onChange:i=>P(i.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:k,disabled:R||b.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(Q,{className:"h-3 w-3"}),d(R?"common.processing":"review.launch")]}),e.jsx("button",{onClick:a,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:d("common.cancel")})]})]})})}function tt(){var Y;const{sourceTaskId:s}=me(),l=ue(),{t:a}=H(),v=Number(s),d=pe(t=>t.eventSeq),[o,N]=r.useState(null),[b,y]=r.useState(!0),[S,$]=r.useState(new Set),[w,P]=r.useState(""),[T,I]=r.useState(!1),[R,A]=r.useState(!1),[F,k]=r.useState(!1),[i,g]=r.useState(null),h=r.useCallback(async()=>{try{const t=await _.get(`web/tasks/${v}/reviews`).json();N(t),t.rounds&&t.rounds.length>0&&g(n=>n??t.rounds[t.rounds.length-1].round)}catch{N(null)}finally{y(!1)}},[v]);r.useEffect(()=>{y(!0),h()},[h]),r.useEffect(()=>{d>0&&h()},[d,h]);const ee=r.useCallback(t=>{$(n=>{const x=new Set(n);return x.has(t)?x.delete(t):x.add(t),x})},[]),C=(o==null?void 0:o.rounds)??[],U=C.length>0?C[C.length-1].round:null,f=i??U,M=C.find(t=>t.round===f),c=(M==null?void 0:M.reviewTasks)??(o==null?void 0:o.reviewTasks)??[];c.some(t=>Z(t.status));const L=c.some(t=>G(t.status)),O=c.length>0&&c.every(t=>z.includes(t.status)),te=c.some(t=>t.report!=null),se=c.length>0&&c.every(t=>t.report!=null),q=f===U,re=L||O,E=r.useMemo(()=>{var x;const t=[];for(const u of c)if((x=u.report)!=null&&x.issues)for(const D of u.report.issues)t.push({...D,agentType:u.agentType??"claude"});t.sort((u,D)=>(X[u.severity]??9)-(X[D.severity]??9));const n=new Set;return t.map(u=>{const D=u.description.slice(0,20),B=`${u.file}:${u.line??""}:${D}`;return n.has(B)?{...u,isDuplicate:!0}:(n.add(B),u)})},[c]),ae=E.filter(t=>t.severity==="critical").length,ne=E.filter(t=>t.severity==="warning").length,oe=E.filter(t=>t.severity==="suggestion").length,J=c.filter(t=>G(t.status)),ie=r.useMemo(()=>[{value:"",label:"select agent..."},...J.map(t=>({value:String(t.id),label:V(t.agentType)}))],[J]);async function ce(){if(!w){j.error("select a review agent to perform the fix.");return}I(!0);try{await _.post(`web/tasks/${v}/approve-fix`,{json:{reviewTaskId:Number(w)}}),j.success("fix started"),h()}catch(t){const n=t instanceof Error?t.message:String(t);j.error(n)}finally{I(!1)}}async function le(){A(!0);try{await _.post(`web/tasks/${v}/skip-fix`,{json:f!=null?{round:f}:{}}),j.success("review completed — no fix needed"),l("/review")}catch(t){const n=t instanceof Error?t.message:String(t);j.error(n)}finally{A(!1)}}const de=r.useMemo(()=>{var n;const t=(n=o==null?void 0:o.sourceTask)==null?void 0:n.configSnapshot;if(!t)return[];try{const x=JSON.parse(t);return Array.isArray(x.defaultReviewers)?x.defaultReviewers:[]}catch{return[]}},[(Y=o==null?void 0:o.sourceTask)==null?void 0:Y.configSnapshot]);if(b)return e.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(Ne,{rows:5})});if(!o)return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"// reviews not found"}),e.jsx("button",{onClick:()=>l("/review"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:"< back to review"})]});const{sourceTask:m}=o;return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{onClick:()=>l("/review"),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(ke,{className:"h-3.5 w-3.5"}),a("common.back")]})}),e.jsx("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:"source task"}),e.jsxs(ve,{to:`/tasks/${m.id}`,className:"text-xs text-[var(--info)] hover:underline",children:["#",m.id]}),e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:m.projectKey})]}),e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:m.description}),(m.branch||m.sourceCommitSha)&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["reviewing branch"," ",m.branch&&e.jsx("span",{className:"text-[var(--text-secondary)]",children:m.branch}),m.sourceCommitSha&&e.jsxs(e.Fragment,{children:[" ","at commit"," ",e.jsx("span",{className:"font-mono text-[var(--accent)]",children:m.sourceCommitSha.slice(0,7)})]})]})]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:we(m.createdAt)})]})}),C.length>1&&e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"round:"}),e.jsx("div",{className:"flex gap-1",children:C.map(t=>e.jsxs("button",{onClick:()=>g(t.round),className:`rounded-[4px] border px-3 py-1 text-xs transition-colors ${f===t.round?"border-[var(--accent)] bg-[var(--accent)] text-black font-bold":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:["#",t.round]},t.round))}),f!==U&&e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// historical"})]}),c.length>0&&e.jsxs("div",{className:"mb-5",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:[a("review.round"),f?` #${f}`:""]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[c.filter(t=>z.includes(t.status)||G(t.status)).length," / ",c.length," done"]})]}),e.jsx("div",{className:"flex flex-col gap-2",children:c.map(t=>e.jsx(Fe,{task:t,expanded:S.has(t.id),onToggleExpand:()=>ee(t.id)},t.id))})]}),re&&te&&(c.filter(n=>n.report!=null).every(n=>!n.report.summary&&n.report.issues.length===0)?e.jsx("div",{className:"mb-5 rounded-[4px] border border-amber-500/40 bg-amber-500/10 p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(W,{className:"h-4 w-4 shrink-0 text-amber-500 mt-0.5"}),e.jsx("p",{className:"text-xs text-amber-500",children:a("review.empty_report_warning")})]})}):e.jsxs("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("div",{className:"mb-3 flex items-center gap-3",children:e.jsxs("span",{className:"text-xs font-bold text-[var(--accent)]",children:[a("review.round")," — ",a("review.issues_summary",{critical:String(ae),warning:String(ne),suggestion:String(oe)})]})}),E.length>0?e.jsx("div",{className:"flex flex-col gap-2",children:E.map((n,x)=>e.jsx(Ue,{issue:n},x))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// no issues reported"})]})),q&&se&&!L&&!O&&e.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx(Ce,{className:"h-3.5 w-3.5 animate-spin text-[var(--text-muted)]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("review.waiting_agents")})]}),q&&(L||O)&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("span",{className:"mb-3 block text-xs font-bold text-[var(--text-muted)]",children:"actions"}),e.jsxs("div",{className:"flex flex-col gap-3",children:[L&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[e.jsx("select",{value:w,onChange:t=>P(t.target.value),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)] md:w-48",children:ie.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsxs("button",{onClick:ce,disabled:T||!w,className:"flex 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(Q,{className:"h-3 w-3"}),a(T?"common.processing":"review.approve_fix")]}),e.jsxs("button",{onClick:le,disabled:R,className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(Te,{className:"h-3 w-3"}),a(R?"common.processing":"review.skip_fix")]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-[var(--text-muted)]",children:[e.jsx(be,{className:"h-3 w-3 shrink-0"}),a("review.fix_push_info")]})]}),e.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(Re,{className:"h-3.5 w-3.5"}),a("review.review_again")]})]})]}),c.length===0&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8 text-center",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("review.no_reviews")}),e.jsxs("button",{onClick:()=>k(!0),className:"mt-3 flex items-center gap-1.5 mx-auto rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black",children:[e.jsx(Q,{className:"h-3 w-3"}),a("review.launch")]})]}),F&&e.jsx(Me,{sourceTaskId:v,defaultReviewers:de,onClose:()=>k(!1),onLaunched:()=>{k(!1),h()}})]})}export{tt as default};
|
|
6
|
+
*/const Ie=xe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),X={critical:0,warning:1,suggestion:2};function Le(s){switch(s){case"critical":return{text:"text-[var(--destructive)]",bg:"rgba(239,68,68,0.12)",border:"rgba(239,68,68,0.27)"};case"warning":return{text:"text-[var(--warning)]",bg:"rgba(245,158,11,0.12)",border:"rgba(245,158,11,0.27)"};default:return{text:"text-[var(--info)]",bg:"rgba(59,130,246,0.10)",border:"rgba(59,130,246,0.27)"}}}function _e({severity:s}){return s==="critical"?e.jsx(De,{className:"h-3.5 w-3.5 text-[var(--destructive)]"}):s==="warning"?e.jsx(H,{className:"h-3.5 w-3.5 text-[var(--warning)]"}):e.jsx(Ie,{className:"h-3.5 w-3.5 text-[var(--info)]"})}function $e(s){switch(s){case p.RUNNING:return"bg-[var(--accent)]";case p.QUEUED:case p.ASSIGNED:case p.SUSPENDED:return"bg-[var(--warning)]";case p.COMPLETED:return"bg-[var(--accent)]";case p.FAILED:return"bg-[var(--destructive)]";default:return"bg-[#525252]"}}function W(s){return s===p.RUNNING||s===p.QUEUED||s===p.ASSIGNED}function G(s){return s===p.SUSPENDED}const Pe=Se(q);function Fe({task:s,expanded:l,onToggleExpand:a}){const v=q(s.agentType),d=$e(s.status),o=ye(s.startedAt,s.completedAt??void 0),N=W(s.status),b=z.includes(s.status),y=r.useRef(null);return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("div",{className:"flex cursor-pointer items-center gap-3 px-4 py-3 hover:bg-[var(--bg-input)] transition-colors",onClick:a,children:[e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${d} ${N?"animate-pulse":""}`}),e.jsx("span",{className:"flex-1 text-xs font-medium text-[var(--text-primary)]",children:v}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[N?`${s.status.toLowerCase()}...`:s.status.toLowerCase(),o&&` · ${o}`]}),e.jsxs("a",{href:`/tasks/${s.id}`,target:"_blank",rel:"noopener noreferrer",onClick:S=>S.stopPropagation(),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-muted)] hover:text-[var(--accent)] hover:border-[var(--accent)] transition-colors flex items-center gap-1",children:[e.jsx(ge,{className:"h-3 w-3"}),"↗"]}),l?e.jsx(Ae,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}):e.jsx(Ee,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"})]}),l&&e.jsx("div",{className:"border-t border-[var(--border)]",style:{height:"300px"},children:e.jsx(je,{ref:y,taskId:s.id,sessionId:s.currentSessionId??void 0,taskFinished:b})})]})}function Ue({issue:s}){const l=Le(s.severity);return e.jsxs("div",{className:`rounded-[4px] p-3 text-xs ${s.isDuplicate?"opacity-60":""}`,style:{backgroundColor:l.bg,border:`1px solid ${l.border}`},children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[e.jsx(_e,{severity:s.severity}),e.jsx("span",{className:`font-bold ${l.text}`,children:s.severity}),s.agentType&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:s.agentType}),e.jsxs("span",{className:"text-[var(--text-muted)]",children:[s.file,s.line!=null?`:${s.line}`:""]}),s.isDuplicate&&e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:"duplicate"})]}),e.jsx("p",{className:"mb-1 text-[var(--text-secondary)]",children:s.description}),s.suggestion&&e.jsxs("p",{className:"text-[var(--text-muted)]",children:[e.jsx("span",{className:"font-medium",children:"suggestion:"})," ",s.suggestion]})]})}function Me({sourceTaskId:s,defaultReviewers:l,onClose:a,onLaunched:v}){const{t:d}=Z(),o=l.length>0?l:[he.CLAUDE],N=l.length>0,[b,y]=r.useState(o),[S,$]=r.useState(""),[w,P]=r.useState(""),[T,I]=r.useState(!1),[R,A]=r.useState(!1);function F(i){y(g=>g.includes(i)?g.filter(h=>h!==i):[...g,i])}async function k(){if(b.length===0){j.error("select at least one review agent.");return}A(!0);try{await _.post(`web/tasks/${s}/review`,{json:{agentTypes:b,description:S.trim()||void 0,skipFix:T||void 0,issueRef:w.trim()||void 0}}),j.success("review launched"),v(),a()}catch(i){const g=i instanceof Error?i.message:String(i);j.error(g)}finally{A(!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:d("review.review_again")}),e.jsx("button",{onClick:a,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(fe,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:d("review.select_agents")}),N&&e.jsx("span",{className:"rounded-[4px] border border-amber-500/40 bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-500",children:"using project defaults"})]}),e.jsx("div",{className:"mb-4 flex flex-col gap-2",children:Pe.map(i=>e.jsx(K,{checked:b.includes(i.value),onCheckedChange:()=>F(i.value),label:i.label,containerClassName:"w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors"},i.value))}),e.jsx("textarea",{value:S,onChange:i=>$(i.target.value),placeholder:d("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(K,{checked:T,onCheckedChange:I,label:d("review.skip_fix_label"),containerClassName:"mb-3 w-full gap-2.5 rounded-[4px] border border-[var(--border)] px-3 py-2 hover:bg-[var(--bg-input)] transition-colors",labelClassName:"text-[var(--text-muted)]"}),e.jsx("input",{value:w,onChange:i=>P(i.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:k,disabled:R||b.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(Q,{className:"h-3 w-3"}),d(R?"common.processing":"review.launch")]}),e.jsx("button",{onClick:a,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:d("common.cancel")})]})]})})}function tt(){var Y;const{sourceTaskId:s}=me(),l=ue(),{t:a}=Z(),v=Number(s),d=pe(t=>t.eventSeq),[o,N]=r.useState(null),[b,y]=r.useState(!0),[S,$]=r.useState(new Set),[w,P]=r.useState(""),[T,I]=r.useState(!1),[R,A]=r.useState(!1),[F,k]=r.useState(!1),[i,g]=r.useState(null),h=r.useCallback(async()=>{try{const t=await _.get(`web/tasks/${v}/reviews`).json();N(t),t.rounds&&t.rounds.length>0&&g(n=>n??t.rounds[t.rounds.length-1].round)}catch{N(null)}finally{y(!1)}},[v]);r.useEffect(()=>{y(!0),h()},[h]),r.useEffect(()=>{d>0&&h()},[d,h]);const ee=r.useCallback(t=>{$(n=>{const x=new Set(n);return x.has(t)?x.delete(t):x.add(t),x})},[]),C=(o==null?void 0:o.rounds)??[],U=C.length>0?C[C.length-1].round:null,f=i??U,M=C.find(t=>t.round===f),c=(M==null?void 0:M.reviewTasks)??(o==null?void 0:o.reviewTasks)??[];c.some(t=>W(t.status));const L=c.some(t=>G(t.status)),O=c.length>0&&c.every(t=>z.includes(t.status)),te=c.some(t=>t.report!=null),se=c.length>0&&c.every(t=>t.report!=null),J=f===U,re=L||O,E=r.useMemo(()=>{var x;const t=[];for(const u of c)if((x=u.report)!=null&&x.issues)for(const D of u.report.issues)t.push({...D,agentType:u.agentType??"claude"});t.sort((u,D)=>(X[u.severity]??9)-(X[D.severity]??9));const n=new Set;return t.map(u=>{const D=u.description.slice(0,20),B=`${u.file}:${u.line??""}:${D}`;return n.has(B)?{...u,isDuplicate:!0}:(n.add(B),u)})},[c]),ae=E.filter(t=>t.severity==="critical").length,ne=E.filter(t=>t.severity==="warning").length,oe=E.filter(t=>t.severity==="suggestion").length,V=c.filter(t=>G(t.status)),ie=r.useMemo(()=>[{value:"",label:"select agent..."},...V.map(t=>({value:String(t.id),label:q(t.agentType)}))],[V]);async function ce(){if(!w){j.error("select a review agent to perform the fix.");return}I(!0);try{await _.post(`web/tasks/${v}/approve-fix`,{json:{reviewTaskId:Number(w)}}),j.success("fix started"),h()}catch(t){const n=t instanceof Error?t.message:String(t);j.error(n)}finally{I(!1)}}async function le(){A(!0);try{await _.post(`web/tasks/${v}/skip-fix`,{json:f!=null?{round:f}:{}}),j.success("review completed — no fix needed"),l("/review")}catch(t){const n=t instanceof Error?t.message:String(t);j.error(n)}finally{A(!1)}}const de=r.useMemo(()=>{var n;const t=(n=o==null?void 0:o.sourceTask)==null?void 0:n.configSnapshot;if(!t)return[];try{const x=JSON.parse(t);return Array.isArray(x.defaultReviewers)?x.defaultReviewers:[]}catch{return[]}},[(Y=o==null?void 0:o.sourceTask)==null?void 0:Y.configSnapshot]);if(b)return e.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(Ne,{rows:5})});if(!o)return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:"// reviews not found"}),e.jsx("button",{onClick:()=>l("/review"),className:"mt-4 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:"< back to review"})]});const{sourceTask:m}=o;return e.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{onClick:()=>l("/review"),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(ke,{className:"h-3.5 w-3.5"}),a("common.back")]})}),e.jsx("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-1 flex-col gap-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:"source task"}),e.jsxs(ve,{to:`/tasks/${m.id}`,className:"text-xs text-[var(--info)] hover:underline",children:["#",m.id]}),e.jsx("span",{className:"shrink-0 rounded-[4px] border border-[var(--border)] px-2 py-0.5 text-[11px] text-[var(--text-muted)]",children:m.projectKey})]}),e.jsx("span",{className:"truncate text-sm text-[var(--text-primary)]",children:m.description}),(m.branch||m.sourceCommitSha)&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["reviewing branch"," ",m.branch&&e.jsx("span",{className:"text-[var(--text-secondary)]",children:m.branch}),m.sourceCommitSha&&e.jsxs(e.Fragment,{children:[" ","at commit"," ",e.jsx("span",{className:"font-mono text-[var(--accent)]",children:m.sourceCommitSha.slice(0,7)})]})]})]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:we(m.createdAt)})]})}),C.length>1&&e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"round:"}),e.jsx("div",{className:"flex gap-1",children:C.map(t=>e.jsxs("button",{onClick:()=>g(t.round),className:`rounded-[4px] border px-3 py-1 text-xs transition-colors ${f===t.round?"border-[var(--accent)] bg-[var(--accent)] text-black font-bold":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:["#",t.round]},t.round))}),f!==U&&e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// historical"})]}),c.length>0&&e.jsxs("div",{className:"mb-5",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs font-bold text-[var(--text-muted)]",children:[a("review.round"),f?` #${f}`:""]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:[c.filter(t=>z.includes(t.status)||G(t.status)).length," / ",c.length," done"]})]}),e.jsx("div",{className:"flex flex-col gap-2",children:c.map(t=>e.jsx(Fe,{task:t,expanded:S.has(t.id),onToggleExpand:()=>ee(t.id)},t.id))})]}),re&&te&&(c.filter(n=>n.report!=null).every(n=>!n.report.summary&&n.report.issues.length===0)?e.jsx("div",{className:"mb-5 rounded-[4px] border border-amber-500/40 bg-amber-500/10 p-4",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(H,{className:"h-4 w-4 shrink-0 text-amber-500 mt-0.5"}),e.jsx("p",{className:"text-xs text-amber-500",children:a("review.empty_report_warning")})]})}):e.jsxs("div",{className:"mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("div",{className:"mb-3 flex items-center gap-3",children:e.jsxs("span",{className:"text-xs font-bold text-[var(--accent)]",children:[a("review.round")," — ",a("review.issues_summary",{critical:String(ae),warning:String(ne),suggestion:String(oe)})]})}),E.length>0?e.jsx("div",{className:"flex flex-col gap-2",children:E.map((n,x)=>e.jsx(Ue,{issue:n},x))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"// no issues reported"})]})),J&&se&&!L&&!O&&e.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx(Ce,{className:"h-3.5 w-3.5 animate-spin text-[var(--text-muted)]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("review.waiting_agents")})]}),J&&(L||O)&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("span",{className:"mb-3 block text-xs font-bold text-[var(--text-muted)]",children:"actions"}),e.jsxs("div",{className:"flex flex-col gap-3",children:[L&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center",children:[e.jsx("select",{value:w,onChange:t=>P(t.target.value),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)] md:w-48",children:ie.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))}),e.jsxs("button",{onClick:ce,disabled:T||!w,className:"flex 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(Q,{className:"h-3 w-3"}),a(T?"common.processing":"review.approve_fix")]}),e.jsxs("button",{onClick:le,disabled:R,className:"flex items-center justify-center gap-1.5 rounded-[4px] border border-[var(--border)] px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:[e.jsx(Te,{className:"h-3 w-3"}),a(R?"common.processing":"review.skip_fix")]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-[var(--text-muted)]",children:[e.jsx(be,{className:"h-3 w-3 shrink-0"}),a("review.fix_push_info")]})]}),e.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1.5 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[e.jsx(Re,{className:"h-3.5 w-3.5"}),a("review.review_again")]})]})]}),c.length===0&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8 text-center",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("review.no_reviews")}),e.jsxs("button",{onClick:()=>k(!0),className:"mt-3 flex items-center gap-1.5 mx-auto rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-bold text-black",children:[e.jsx(Q,{className:"h-3 w-3"}),a("review.launch")]})]}),F&&e.jsx(Me,{sourceTaskId:v,defaultReviewers:de,onClose:()=>k(!1),onLaunched:()=>{k(!1),h()}})]})}export{tt as default};
|
|
@@ -0,0 +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-Dh1GMLID.js";import{p as q}from"./developer-options-PMfL5Zv7.js";import{E as D}from"./EmptyState-CMDagsi4.js";import{T as L}from"./Skeleton-DaeQHyTP.js";import{C as z}from"./Checkbox-CQt3GUhI.js";import{S as C}from"./Select-LGk_EawR.js";import{f as P}from"./date-CmcdoD87.js";import{T as A}from"./Tooltip-DjIk-pqB.js";import{a as J}from"./agent-type-options-BpMI3Naw.js";import{g as X}from"./task-constants-DfpO4NY9.js";import{P as Z}from"./plus-Cn46sPb9.js";import{P as R}from"./play-DX-9yzZV.js";import{C as V}from"./chevron-left-BPO7Bb6l.js";import{C as W}from"./chevron-right-DHCIokyJ.js";import"./chevron-down-BOgq_PNA.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,j as t}from"./index-Dh1GMLID.js";import{C as b}from"./chevron-down-BOgq_PNA.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 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-Dh1GMLID.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-
|
|
1
|
+
import{a as t,j as e}from"./index-Dh1GMLID.js";import{I as c,C as r}from"./DocsPrimitives-D7h19aXG.js";import{E as n}from"./external-link-CEkNn2LX.js";import"./copy-BBOWX6ou.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};
|