@overlordai/server 1.0.140 → 1.0.141
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/database/migrations/010-plan-review-mode.sql +11 -0
- package/database/migrations/012-schema-index-fixes.sql +72 -0
- package/dist/adapters/adapter.module.d.ts.map +1 -1
- package/dist/adapters/adapter.module.js +3 -0
- package/dist/adapters/adapter.module.js.map +1 -1
- package/dist/adapters/command-parser.utils.d.ts +11 -0
- package/dist/adapters/command-parser.utils.d.ts.map +1 -1
- package/dist/adapters/command-parser.utils.js +57 -0
- package/dist/adapters/command-parser.utils.js.map +1 -1
- package/dist/adapters/help-text.d.ts.map +1 -1
- package/dist/adapters/help-text.js +8 -6
- package/dist/adapters/help-text.js.map +1 -1
- package/dist/adapters/lark/lark-message.parser.d.ts +7 -7
- package/dist/adapters/lark/lark-message.parser.d.ts.map +1 -1
- package/dist/adapters/lark/lark-message.parser.js +11 -7
- package/dist/adapters/lark/lark-message.parser.js.map +1 -1
- package/dist/adapters/lark/lark.adapter.d.ts +3 -1
- package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
- package/dist/adapters/lark/lark.adapter.js +28 -12
- package/dist/adapters/lark/lark.adapter.js.map +1 -1
- package/dist/adapters/nlu.service.d.ts +20 -0
- package/dist/adapters/nlu.service.d.ts.map +1 -0
- package/dist/adapters/nlu.service.js +231 -0
- package/dist/adapters/nlu.service.js.map +1 -0
- package/dist/adapters/slack/slack-message.parser.d.ts.map +1 -1
- package/dist/adapters/slack/slack-message.parser.js +4 -0
- package/dist/adapters/slack/slack-message.parser.js.map +1 -1
- package/dist/adapters/slack/slack.adapter.d.ts +3 -1
- package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
- package/dist/adapters/slack/slack.adapter.js +43 -14
- package/dist/adapters/slack/slack.adapter.js.map +1 -1
- package/dist/adapters/slack/slack.controller.js +8 -8
- package/dist/adapters/slack/slack.controller.js.map +1 -1
- package/dist/common/project-validation.d.ts +13 -3
- package/dist/common/project-validation.d.ts.map +1 -1
- package/dist/common/project-validation.js +21 -5
- package/dist/common/project-validation.js.map +1 -1
- package/dist/database/migration-runner.d.ts.map +1 -1
- package/dist/database/migration-runner.js +10 -1
- package/dist/database/migration-runner.js.map +1 -1
- package/dist/database/repositories/project.repository.d.ts +2 -0
- package/dist/database/repositories/project.repository.d.ts.map +1 -1
- package/dist/database/repositories/project.repository.js +13 -0
- package/dist/database/repositories/project.repository.js.map +1 -1
- package/dist/database/repositories/task.repository.d.ts +11 -2
- package/dist/database/repositories/task.repository.d.ts.map +1 -1
- package/dist/database/repositories/task.repository.js +64 -8
- package/dist/database/repositories/task.repository.js.map +1 -1
- package/dist/dispatcher/dispatcher.service.d.ts +2 -0
- package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
- package/dist/dispatcher/dispatcher.service.js +79 -0
- package/dist/dispatcher/dispatcher.service.js.map +1 -1
- package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
- package/dist/dispatcher/scheduler.service.js +3 -0
- package/dist/dispatcher/scheduler.service.js.map +1 -1
- package/dist/dispatcher/task-creation.service.d.ts +13 -2
- package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
- package/dist/dispatcher/task-creation.service.js +207 -21
- package/dist/dispatcher/task-creation.service.js.map +1 -1
- package/dist/dispatcher/task-lifecycle.service.d.ts +5 -1
- package/dist/dispatcher/task-lifecycle.service.d.ts.map +1 -1
- package/dist/dispatcher/task-lifecycle.service.js +231 -1
- package/dist/dispatcher/task-lifecycle.service.js.map +1 -1
- package/dist/events/event-types.d.ts +8 -0
- package/dist/events/event-types.d.ts.map +1 -1
- package/dist/events/event-types.js +1 -0
- package/dist/events/event-types.js.map +1 -1
- package/dist/notifier/notification-consumer.d.ts.map +1 -1
- package/dist/notifier/notification-consumer.js +5 -0
- package/dist/notifier/notification-consumer.js.map +1 -1
- package/dist/notifier/notification-event-listener.d.ts +2 -1
- package/dist/notifier/notification-event-listener.d.ts.map +1 -1
- package/dist/notifier/notification-event-listener.js +14 -0
- package/dist/notifier/notification-event-listener.js.map +1 -1
- package/dist/notifier/notifier.service.d.ts +1 -0
- package/dist/notifier/notifier.service.d.ts.map +1 -1
- package/dist/notifier/notifier.service.js +8 -0
- package/dist/notifier/notifier.service.js.map +1 -1
- package/dist/notifier/template.service.d.ts +4 -0
- package/dist/notifier/template.service.d.ts.map +1 -1
- package/dist/notifier/template.service.js +32 -0
- package/dist/notifier/template.service.js.map +1 -1
- package/dist/web/admin/admin-project.controller.d.ts.map +1 -1
- package/dist/web/admin/admin-project.controller.js +15 -0
- package/dist/web/admin/admin-project.controller.js.map +1 -1
- package/dist/web/dashboard.service.js +3 -3
- package/dist/web/frame-handlers/index.d.ts +1 -0
- package/dist/web/frame-handlers/index.d.ts.map +1 -1
- package/dist/web/frame-handlers/index.js +3 -1
- package/dist/web/frame-handlers/index.js.map +1 -1
- package/dist/web/frame-handlers/progress.handler.d.ts.map +1 -1
- package/dist/web/frame-handlers/progress.handler.js +18 -0
- package/dist/web/frame-handlers/progress.handler.js.map +1 -1
- package/dist/web/frame-handlers/review-report.handler.d.ts +15 -0
- package/dist/web/frame-handlers/review-report.handler.d.ts.map +1 -0
- package/dist/web/frame-handlers/review-report.handler.js +140 -0
- package/dist/web/frame-handlers/review-report.handler.js.map +1 -0
- package/dist/web/frame-handlers/stage-confirm.handler.d.ts +3 -1
- package/dist/web/frame-handlers/stage-confirm.handler.d.ts.map +1 -1
- package/dist/web/frame-handlers/stage-confirm.handler.js +18 -4
- package/dist/web/frame-handlers/stage-confirm.handler.js.map +1 -1
- package/dist/web/project.controller.js +1 -1
- package/dist/web/project.controller.js.map +1 -1
- package/dist/web/task.controller.d.ts +116 -2
- package/dist/web/task.controller.d.ts.map +1 -1
- package/dist/web/task.controller.js +172 -8
- package/dist/web/task.controller.js.map +1 -1
- package/dist/web/web-event.service.d.ts +2 -1
- package/dist/web/web-event.service.d.ts.map +1 -1
- package/dist/web/web-event.service.js +13 -0
- package/dist/web/web-event.service.js.map +1 -1
- package/dist/web/worker-channel.gateway.d.ts +2 -1
- package/dist/web/worker-channel.gateway.d.ts.map +1 -1
- package/dist/web/worker-channel.gateway.js +6 -3
- package/dist/web/worker-channel.gateway.js.map +1 -1
- package/package.json +4 -4
- package/public/assets/AccessTokensPage-wTxicSeE.js +1 -0
- package/public/assets/AdminPage-CBovEOm4.js +1 -0
- package/public/assets/{AgentCliPage-CyYjrwq2.js → AgentCliPage-DfqlFdFN.js} +1 -1
- package/public/assets/{ApiReferencePage-Bclq5KsN.js → ApiReferencePage-7TUHB8sC.js} +1 -1
- package/public/assets/{ArchitecturePage-BDytxAWu.js → ArchitecturePage-CycvJ1HW.js} +1 -1
- package/public/assets/AuditLogPage-CqqCDd8o.js +1 -0
- package/public/assets/{BindPlatformPage-BWFCXp_B.js → BindPlatformPage-BV5wNIi2.js} +1 -1
- package/public/assets/{BotIntegrationPage-BE63GDU0.js → BotIntegrationPage-B2bQytks.js} +1 -1
- package/public/assets/{BotManage-B4jE07jf.js → BotManage-BBBrqdT_.js} +2 -2
- package/public/assets/{BotSetupPage-CFZ4rCsj.js → BotSetupPage-DdDPniAd.js} +1 -1
- package/public/assets/{ChangelogPage-Dq4Vbaek.js → ChangelogPage-D5YE3BFH.js} +1 -1
- package/public/assets/CliReferencePage-yJgtPpFn.js +17 -0
- package/public/assets/ConfirmStageDialog-BOGr-qSN.js +12 -0
- package/public/assets/{DeploymentPage-Cl6zirj-.js → DeploymentPage-C0CXq8yl.js} +1 -1
- package/public/assets/{DevWorkflowPage-Le7igjcE.js → DevWorkflowPage-I4Io3nYz.js} +1 -1
- package/public/assets/{DeveloperManage-CEia9VDa.js → DeveloperManage-Cy0LRyHh.js} +2 -2
- package/public/assets/{DeveloperSetupPage-CYbrSjhy.js → DeveloperSetupPage-DzGCH2XG.js} +1 -1
- package/public/assets/{DocsIndexPage-Ds7FZGYL.js → DocsIndexPage-PIEcc9gX.js} +2 -2
- package/public/assets/DocsLayout-ChIliA9A.js +1 -0
- package/public/assets/{DocsPrimitives-BeRfTNWi.js → DocsPrimitives-BMgSDhur.js} +1 -1
- package/public/assets/EditProjectPage-D0rfXGZR.js +2 -0
- package/public/assets/{EmptyState-BrTEmjub.js → EmptyState-Di2nOiOt.js} +1 -1
- package/public/assets/{EnvVariablesPage-Cco0LY2i.js → EnvVariablesPage-EmfRwttc.js} +1 -1
- package/public/assets/{HomePage-DkFq_Niq.js → HomePage-CeOmNhkc.js} +1 -1
- package/public/assets/{InfoRow-VesvmVYO.js → InfoRow-5vQ-_wWv.js} +1 -1
- package/public/assets/{InstallationPage-Cd7Eh_1x.js → InstallationPage-CUbe1AD-.js} +1 -1
- package/public/assets/{LandingPage-Cxp2IXav.js → LandingPage-DSHGbkXw.js} +7 -12
- package/public/assets/{LocalDevelopmentPage-BC2x9o_F.js → LocalDevelopmentPage-fialPCnX.js} +1 -1
- package/public/assets/{LoginPage-fgYsLW4-.js → LoginPage-C4oz9yjV.js} +1 -1
- package/public/assets/{MetricBar-CFHaSbdz.js → MetricBar-ByQYVWVi.js} +1 -1
- package/public/assets/{NotFoundPage-BxtgZYrG.js → NotFoundPage-BeayCSH7.js} +1 -1
- package/public/assets/{OnboardingGuide-BqdyHxJS.js → OnboardingGuide-CqcX04SL.js} +1 -1
- package/public/assets/{PermissionsPage-BP5SsoMl.js → PermissionsPage-Bb2CYzMf.js} +1 -1
- package/public/assets/{PipelineConfigPage-B8NayzNO.js → PipelineConfigPage-DwY__0Ag.js} +2 -2
- package/public/assets/PipelineEditorPage-FkckQpQX.js +3 -0
- package/public/assets/PlanPage-BOzGJd2h.js +1 -0
- package/public/assets/ProfilePage-CT_kk3a8.js +1 -0
- package/public/assets/{ProjectDetailPage-CGhCxrKQ.js → ProjectDetailPage-B-t7L84T.js} +3 -3
- package/public/assets/{ProjectListPage-2b4E2H36.js → ProjectListPage-C2uStUVE.js} +2 -2
- package/public/assets/PtyTerminal-BYXg_ahq.js +38 -0
- package/public/assets/QuickAuth-CohuPihd.js +1 -0
- package/public/assets/{RemoveMemberConfirmDialog-CblKQmK2.js → RemoveMemberConfirmDialog-DLq9g7Td.js} +1 -1
- package/public/assets/ReviewAggregatePage-dWQb52Df.js +11 -0
- package/public/assets/ReviewPage-DtdWSBgK.js +1 -0
- package/public/assets/Select-BAl7H-Y0.js +1 -0
- package/public/assets/{SettingsPage-CcTEwK5L.js → SettingsPage-qCfF6rzU.js} +1 -1
- package/public/assets/{Skeleton-CJVHi16l.js → Skeleton-DA5o8Wqi.js} +1 -1
- package/public/assets/{SkillPage-Dl6hXkHy.js → SkillPage-C6p0dXbu.js} +1 -1
- package/public/assets/TaskDetailPage-D4sGfico.js +21 -0
- package/public/assets/TaskGuidePage-COT0chCI.js +19 -0
- package/public/assets/TaskListPage-Bvq5ow7r.js +1 -0
- package/public/assets/{TaskStatusBadge-BdDVC3F4.js → TaskStatusBadge-BdNFkrjU.js} +1 -1
- package/public/assets/TerminalHomePage-XJ5daAJC.js +6 -0
- package/public/assets/TokenManage-JLFD8xAN.js +1 -0
- package/public/assets/{Tooltip-BSeP698b.js → Tooltip-Bl8LCgWr.js} +1 -1
- package/public/assets/{TotpSetupPage-DkTKw-87.js → TotpSetupPage-BGE6pDdn.js} +1 -1
- package/public/assets/{WorkerDetailPage-C3xgOzQ5.js → WorkerDetailPage-Dd-IbO6r.js} +1 -1
- package/public/assets/{WorkerListPage-SzomA2Jg.js → WorkerListPage-e4P55nJc.js} +2 -2
- package/public/assets/{WorkerOperationsPage-Dm1PdRDK.js → WorkerOperationsPage-ioBw_i1j.js} +1 -1
- package/public/assets/WorkerSetupGuidePage-CRicnVVm.js +1 -0
- package/public/assets/{WorkerSetupPage-DOjZMVtt.js → WorkerSetupPage-DXOlNqUZ.js} +1 -1
- package/public/assets/{agent-type-options-SYUwiixD.js → agent-type-options-BVIYXf2V.js} +1 -1
- package/public/assets/{arrow-left-B16h49gW.js → arrow-left-CTo0KHGY.js} +1 -1
- package/public/assets/{arrow-right-DxSODyV0.js → arrow-right-C9oQyTKw.js} +1 -1
- package/public/assets/{bot-DvI1Z_Mw.js → bot-B301pflD.js} +1 -1
- package/public/assets/chevron-down-B0Leook1.js +6 -0
- package/public/assets/{chevron-left-CH1J8GB-.js → chevron-left-59qctCaF.js} +1 -1
- package/public/assets/{chevron-right-CdPoqMfX.js → chevron-right-XfJqITCa.js} +1 -1
- package/public/assets/chevron-up-BW2PVBfH.js +6 -0
- package/public/assets/{copy-DNIFSymA.js → copy-DEWCNXDf.js} +1 -1
- package/public/assets/{download-DLYSP8rX.js → download-7d5kMwpH.js} +1 -1
- package/public/assets/{external-link-DrZcaziN.js → external-link-DjBNV7ga.js} +1 -1
- package/public/assets/{file-text-224YYyRN.js → file-text-DHEz_RFq.js} +1 -1
- package/public/assets/{git-fork-CsNrC-5K.js → git-fork-cRLOBM6a.js} +1 -1
- package/public/assets/index-eKvCyU64.js +252 -0
- package/public/assets/index-kJfGgL_V.css +1 -0
- package/public/assets/{key-ChevPWu9.js → key-D5BbAzTj.js} +1 -1
- package/public/assets/{loader-circle-_p8GERRD.js → loader-circle-B_f_h4fq.js} +1 -1
- package/public/assets/{pencil-BjrOvZ4y.js → pencil-CTTWvWuS.js} +1 -1
- package/public/assets/play-Cqf1Kvc7.js +6 -0
- package/public/assets/{plus-DtE-5ICU.js → plus-DwBKB0x6.js} +1 -1
- package/public/assets/{rotate-ccw-DTMgDeUz.js → rotate-ccw-CZR8KOZn.js} +1 -1
- package/public/assets/{scroll-text-DLDVcM9k.js → scroll-text-BeQeZkLb.js} +1 -1
- package/public/assets/{settings-BWLb7GMU.js → settings-CsdOqob5.js} +1 -1
- package/public/assets/skip-forward-BqiRx2ZQ.js +6 -0
- package/public/assets/status-colors-yfNzOmz-.js +1 -0
- package/public/assets/task-constants-BWLt-ivk.js +1 -0
- package/public/assets/task.store-BDZwafPm.js +1 -0
- package/public/assets/{trash-2-DGYLJbuV.js → trash-2-CXPG2vQr.js} +1 -1
- package/public/assets/{useFetch-BHc-EDVT.js → useFetch-CVFGit7a.js} +1 -1
- package/public/assets/{users-CXqH9m6n.js → users-DmefWRaM.js} +1 -1
- package/public/assets/{wifi-CknEzeaW.js → wifi-BJIfMBKB.js} +1 -1
- package/public/assets/{workflow-BHEQEN9B.js → workflow-CuZasRLA.js} +1 -1
- package/public/index.html +2 -2
- package/public/sw.js +1 -1
- package/public/assets/AccessTokensPage-D1CyjkMd.js +0 -1
- package/public/assets/AdminPage-BfGgzqGY.js +0 -1
- package/public/assets/AuditLogPage-BtlSABTt.js +0 -1
- package/public/assets/CliReferencePage-fyRcKPES.js +0 -16
- package/public/assets/DocsLayout-Bc08wdi2.js +0 -1
- package/public/assets/EditProjectPage-UQcHFFv0.js +0 -2
- package/public/assets/MobileTerminalShell-DvdSW-sx.js +0 -49
- package/public/assets/PipelineEditorPage-BLRXg7uE.js +0 -3
- package/public/assets/ProfilePage-BY4_Kq2m.js +0 -1
- package/public/assets/QuickAuth-DODaMzBE.js +0 -1
- package/public/assets/Select-CatoaxSD.js +0 -6
- package/public/assets/TaskDetailPage-BF-G4onm.js +0 -26
- package/public/assets/TaskListPage-DKtvYTqk.js +0 -1
- package/public/assets/TerminalHomePage-CR-OzAME.js +0 -11
- package/public/assets/TokenManage-DGWTDHT0.js +0 -1
- package/public/assets/WorkerSetupGuidePage-BDxh9qGL.js +0 -6
- package/public/assets/index-BUjb3VF-.css +0 -1
- package/public/assets/index-BnZa648g.js +0 -242
- package/public/assets/status-colors-CJELOkpG.js +0 -1
- package/public/assets/task-constants-DVi4wVyB.js +0 -1
- /package/public/assets/{MobileTerminalShell-6GBZ9nXN.css → PtyTerminal-6GBZ9nXN.css} +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as g,r as x,j as e,Y as $,A as I,f as M,h as S,t as y}from"./index-BnZa648g.js";import{S as C}from"./Select-CatoaxSD.js";const O={stages:[]};function q(){return{name:"",prompt:""}}function b({children:t}){return e.jsx("label",{className:"mb-1 block font-mono text-[11px] text-[var(--text-secondary)]",children:t})}function j({value:t,onChange:o,placeholder:a,type:r="text",className:c=""}){return e.jsx("input",{type:r,value:t,onChange:s=>o(s.target.value),placeholder:a,className:`w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none ${c}`})}function J({checked:t,onChange:o}){return e.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>o(!t),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-[var(--border)] transition-colors ${t?"bg-[var(--accent)]":"bg-[var(--bg-primary)]"}`,children:e.jsx("span",{className:`inline-block h-3.5 w-3.5 rounded-full bg-white shadow transition-transform ${t?"translate-x-[18px]":"translate-x-[2px]"}`})})}function N({value:t,onChange:o,placeholder:a,rows:r=4}){return e.jsx("textarea",{value:t,onChange:c=>o(c.target.value),placeholder:a,rows:r,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2.5 py-1.5 font-mono text-xs leading-relaxed text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none"})}function T({stage:t,index:o,selected:a,onSelect:r,onDelete:c}){const{t:s}=g(),i=t.prompt?$(t.prompt,60):"";return e.jsxs("div",{role:"button",tabIndex:0,onClick:r,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r())},className:`group relative flex w-full items-start gap-3 rounded-[4px] border px-4 py-3 text-left transition-colors ${a?"border-[var(--accent)] bg-[var(--bg-card)]":"border-[var(--border)] bg-[var(--bg-card)] hover:border-[var(--text-muted)]"}`,style:{borderLeftWidth:3,borderLeftColor:"var(--accent)"},children:[e.jsx("span",{className:"mt-0.5 shrink-0 font-mono text-[11px] text-[var(--text-muted)]",children:String(o+1).padStart(2,"0")}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs font-bold text-[var(--text-primary)]",children:t.name||"unnamed"}),t.label&&e.jsx("span",{className:"truncate font-mono text-[11px] text-[var(--text-muted)]",children:t.label})]}),i&&e.jsxs("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[var(--text-muted)]",children:["// ",i]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 font-mono text-[11px] text-[var(--text-muted)]",children:[t.gate&&e.jsx("span",{children:"gate"}),t.requireConfirm&&e.jsx("span",{children:"confirm"}),t.timeout!=null&&e.jsxs("span",{children:["timeout:",t.timeout,"s"]})]})]}),e.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),c()},className:"mt-0.5 shrink-0 rounded-[4px] p-0.5 text-[var(--text-muted)] opacity-0 transition-opacity hover:text-[var(--destructive)] group-hover:opacity-100","aria-label":s("pipeline.delete_stage"),children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"3 6 5 6 21 6"}),e.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})}function _({stage:t,onChange:o,allStageNames:a}){const{t:r}=g(),c=x.useMemo(()=>{const s=[{value:"",label:"-- select --"}];for(const i of a)i&&i!==t.name&&s.push({value:i,label:i});return s},[a,t.name]);return e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-mono text-sm font-semibold text-[var(--accent)]",children:r("pipeline.stage_properties")}),e.jsx("p",{className:"font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.editing",{name:t.name||r("pipeline.unnamed")})}),e.jsxs("div",{children:[e.jsxs(b,{children:[r("pipeline.name")," *"]}),e.jsx(j,{value:t.name,onChange:s=>o({name:s}),placeholder:r("pipeline.stage_name")})]}),e.jsxs("div",{children:[e.jsx(b,{children:"label"}),e.jsx(j,{value:t.label??"",onChange:s=>o({label:s||void 0}),placeholder:"optional display label"})]}),e.jsxs("div",{children:[e.jsx(b,{children:"prompt *"}),e.jsx(N,{value:t.prompt,onChange:s=>o({prompt:s}),placeholder:"instructions for the agent...",rows:8})]}),e.jsxs("div",{children:[e.jsx(b,{children:"gate"}),e.jsx(j,{value:t.gate??"",onChange:s=>o({gate:s||void 0}),placeholder:"Pass condition, e.g.: no P1-P3 issues"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{children:r("pipeline.confirm_required")}),e.jsx(J,{checked:t.requireConfirm??!1,onChange:s=>o({requireConfirm:s})})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.timeout")}),e.jsx(j,{type:"number",value:String(t.timeout??""),onChange:s=>o({timeout:s?parseInt(s,10):void 0}),placeholder:"600"})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("p",{className:"mb-3 font-mono text-[11px] text-[var(--text-muted)]",children:r("pipeline.on_failure_section")}),e.jsxs("div",{className:"mb-3",children:[e.jsx(b,{children:r("pipeline.on_failure")}),e.jsx(C,{value:t.onFailure?"goto":"stop",onChange:s=>{o(s==="stop"?{onFailure:void 0}:{onFailure:{goto:"",maxLoops:3}})},options:[{value:"stop",label:r("pipeline.stop")},{value:"goto",label:r("pipeline.goto_stage")}]})]}),t.onFailure&&e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.goto")}),e.jsx(C,{value:t.onFailure.goto,onChange:s=>{var i;return o({onFailure:{goto:s,maxLoops:((i=t.onFailure)==null?void 0:i.maxLoops)??3}})},options:c})]}),e.jsxs("div",{children:[e.jsx(b,{children:r("pipeline.max_loops")}),e.jsx(j,{type:"number",value:String(t.onFailure.maxLoops),onChange:s=>{var i;return o({onFailure:{goto:((i=t.onFailure)==null?void 0:i.goto)??"",maxLoops:s?parseInt(s,10):3}})},placeholder:"3"})]})]})]}),e.jsxs("div",{className:"border-t border-[var(--border)] pt-3",children:[e.jsx("h4",{className:"mb-2 font-mono text-xs font-semibold text-[var(--accent)]",children:"params"}),e.jsx(N,{value:t.params?Object.entries(t.params).map(([s,i])=>`${s}=${i}`).join(`
|
|
2
|
-
`):"",onChange:s=>{if(!s.trim()){o({params:void 0});return}const i={};s.split(`
|
|
3
|
-
`).forEach(d=>{const l=d.indexOf("=");l>0&&(i[d.slice(0,l).trim()]=d.slice(l+1).trim())}),o({params:i})},placeholder:"KEY=value (one per line)",rows:3})]})]})}function D({value:t,onChange:o}){const[a,r]=x.useState(t.trim().length>0);return x.useEffect(()=>{!a&&t.trim().length>0&&r(!0)},[t,a]),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsxs("button",{type:"button",onClick:()=>r(c=>!c),className:"flex w-full items-center justify-between px-4 py-3 text-left font-mono text-xs font-semibold text-[var(--accent)]",children:[e.jsx("span",{children:"preamble"}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:a?"[-]":"[+]"})]}),a&&e.jsx("div",{className:"border-t border-[var(--border)] px-4 py-3",children:e.jsx(N,{value:t,onChange:o,placeholder:"Global pre-prompt injected before all stages",rows:4})})]})}function Y({value:t,onChange:o}){const{t:a}=g(),[r,c]=x.useState(null),[s,i]=x.useState(!1),d=x.useMemo(()=>t??O,[t]),l=d.stages,h=r!=null?l[r]??null:null,f=x.useMemo(()=>l.map(n=>n.name),[l]),v=x.useCallback(n=>{o({...d,stages:n})},[o,d]),F=x.useCallback(()=>{const n=[...l,q()];v(n),c(n.length-1)},[l,v]),E=x.useCallback(n=>{const p=l.filter((m,u)=>u!==n);v(p),r===n?c(p.length>0?Math.min(n,p.length-1):null):r!=null&&r>n&&c(r-1)},[l,r,v]),w=x.useCallback((n,p)=>{const m=l.map((u,P)=>P===n?{...u,...p}:u);v(m)},[l,v]),k=x.useCallback((n,p)=>{const m=p==="up"?n-1:n+1;if(m<0||m>=l.length)return;const u=[...l];[u[n],u[m]]=[u[m],u[n]],v(u),r===n?c(m):r===m&&c(n)},[l,r,v]),L=x.useMemo(()=>JSON.stringify(d,null,2),[d]);return e.jsxs("div",{className:"flex flex-col gap-0",children:[e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsxs("button",{type:"button",onClick:()=>i(n=>!n),className:`rounded-[4px] border px-2 py-1 font-mono text-[11px] transition-colors ${s?"border-[var(--accent)] text-[var(--accent)]":"border-[var(--border)] text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:[a("pipeline.json_toggle")," ⇅"]})}),s&&e.jsx("pre",{className:"mb-4 max-h-[400px] overflow-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3 font-mono text-[11px] leading-relaxed text-[var(--text-primary)]",children:L}),e.jsx("div",{className:"mb-4",children:e.jsx(D,{value:d.preamble??"",onChange:n=>o({...d,preamble:n||void 0})})}),e.jsxs("div",{className:"flex gap-6",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.map((n,p)=>{var m;return e.jsxs("div",{children:[e.jsx(T,{stage:n,index:p,selected:r===p,onSelect:()=>c(p),onDelete:()=>E(p)}),p<l.length-1&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-2",children:[e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"▼"}),e.jsx("div",{className:"h-6 w-px bg-[var(--border)]"})]}),((m=n.onFailure)==null?void 0:m.goto)&&e.jsx("div",{className:"flex items-center justify-center gap-1.5 py-1",children:e.jsxs("span",{className:"text-[11px] text-[var(--warning)]",children:["↺ loop → ",n.onFailure.goto," (max ",n.onFailure.maxLoops,")"]})})]},`${p}-${n.name}`)}),r!=null&&l.length>1&&e.jsxs("div",{className:"flex items-center gap-1 pl-7 pt-2",children:[e.jsxs("button",{type:"button",disabled:r===0,onClick:()=>k(r,"up"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▲ ",a("pipeline.up")]}),e.jsxs("button",{type:"button",disabled:r===l.length-1,onClick:()=>k(r,"down"),className:"rounded-[4px] border border-[var(--border)] px-2 py-0.5 font-mono text-[11px] text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)] disabled:opacity-30",children:["▼ ",a("pipeline.down")]})]}),e.jsx("div",{className:"flex items-center justify-center py-3",children:e.jsxs("button",{type:"button",onClick:F,className:"flex items-center gap-1.5 rounded-[4px] border border-dashed border-[var(--border)] px-4 py-2 font-mono text-xs text-[var(--accent)] transition-colors hover:border-[var(--accent)] hover:bg-[var(--bg-secondary)]",children:[e.jsx("span",{className:"text-sm leading-none",children:"+"})," ",a("pipeline.add_stage")]})}),h&&e.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"font-mono text-xs font-semibold text-[var(--accent)]",children:a("pipeline.stage_properties")}),e.jsx("button",{type:"button",onClick:()=>c(null),className:"rounded-[4px] border border-[var(--border)] px-2 py-1 font-mono text-[11px] text-[var(--text-muted)]",children:"x"})]}),e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f})]})]}),e.jsx("div",{className:"hidden w-[360px] shrink-0 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5 lg:block",style:{alignSelf:"flex-start",position:"sticky",top:0},children:h?e.jsx(_,{stage:h,onChange:n=>w(r,n),allStageNames:f}):e.jsx("div",{className:"flex min-h-[200px] items-center justify-center",children:e.jsx("p",{className:"font-mono text-xs text-[var(--text-muted)]",children:a("pipeline.select_stage")})})})]})]})}function G(){const{key:t}=I(),o=M(),{t:a}=g(),[r,c]=x.useState(null),[s,i]=x.useState(!0),[d,l]=x.useState(!1);x.useEffect(()=>{t&&S.get(`web/projects/${t}`).json().then(f=>{if(f.pipeline)try{c(JSON.parse(f.pipeline))}catch{c(null)}}).catch(()=>y.error(a("pipeline.failed_to_load_project"))).finally(()=>i(!1))},[t,a]);const h=x.useCallback(async()=>{if(t){l(!0);try{await S.put(`web/projects/${t}`,{json:{pipeline:r?JSON.stringify(r):null}}),y.success(a("pipeline.saved"))}catch{y.error(a("pipeline.failed_to_save"))}finally{l(!1)}}},[t,r,a]);return s?e.jsx("div",{className:"flex h-full items-center justify-center font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:a("pipeline.loading_pipeline")})}):e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-[var(--border)] px-4 md:px-8 py-5 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-base font-medium text-[var(--text-primary)] shrink-0",children:a("pipeline.title")}),e.jsx("span",{className:"text-sm text-[var(--text-muted)] truncate",children:a("pipeline.subtitle",{key:t??""})})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{type:"button",onClick:h,disabled:d,className:"rounded-[4px] bg-[var(--accent)] px-4 py-1.5 text-xs font-bold text-black disabled:opacity-50",children:a(d?"common.saving":"pipeline.save")}),e.jsx("button",{type:"button",onClick:()=>o(`/projects/${t}`),className:"rounded-[4px] border border-[var(--border)] px-4 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("pipeline.cancel")})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4 md:p-8",children:e.jsx(Y,{value:r,onChange:c})})]})}export{G as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as A,u as F,f as T,r as s,j as e,L as z,Z as I,_ as $,v as K,h as p,t as c}from"./index-BnZa648g.js";import{v as M}from"./password-CHk45-jw.js";import{I as o}from"./InfoRow-VesvmVYO.js";import{u as V}from"./useFetch-BHc-EDVT.js";function J(){var y,k,C,P;const{t:r}=A(),{logout:L}=F(),E=T(),[S,m]=s.useState(!1),{data:t,loading:U,refetch:D}=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.140"]}),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{J as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as h,r as s,h as b,$ as v,j as e,C as j}from"./index-BnZa648g.js";import{C as f}from"./copy-DNIFSymA.js";function y({mode:l}){const{t:o}=h(),[n,d]=s.useState([]),[x,c]=s.useState(null),[u,i]=s.useState(!1);s.useEffect(()=>{b.get("web/profile/tokens").json().then(t=>{const r=t.filter(m=>m.status===v.ACTIVE);d(r),r.length>0&&c(r[0].id)}).catch(()=>{})},[]);const a=l==="cli"?"ov login --token <your-token>":'curl -H "authorization: bearer <your-token>" http://localhost:9000/api/web/tasks',p=s.useCallback(()=>{navigator.clipboard.writeText(a),i(!0),setTimeout(()=>i(!1),2e3)},[a]);return n.length===0?null:e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--accent)]/20 bg-[var(--bg-card)] p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:o("docs.quick_start_with_token")}),e.jsx("select",{value:x??"",onChange:t=>c(Number(t.target.value)),className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-2 py-1 text-xs text-[var(--text-primary)]",children:n.map(t=>e.jsx("option",{value:t.id,children:t.label},t.id))})]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-[4px] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"text-xs text-[var(--accent)] break-all",children:a}),e.jsx("button",{onClick:p,className:"shrink-0 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:u?e.jsx(j,{size:14}):e.jsx(f,{size:14})})]}),e.jsx("p",{className:"mt-2 text-[11px] text-[var(--text-muted)]",children:o("docs.replace_token_hint")})]})}export{y as Q};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as p,r as l,j as t}from"./index-BnZa648g.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 b=p("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);function h({value:r,onChange:x,options:c,placeholder:u,disabled:n=!1,className:d=""}){var i;const[a,o]=l.useState(!1),s=l.useRef(null),m=((i=c.find(e=>e.value===r))==null?void 0:i.label)??u??"";return l.useEffect(()=>{function e(v){s.current&&!s.current.contains(v.target)&&o(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.jsxs("div",{ref:s,className:`relative ${d}`,children:[t.jsxs("button",{type:"button",disabled:n,onClick:()=>!n&&o(!a),"aria-expanded":a,"aria-haspopup":"listbox",className:`flex w-full items-center justify-between rounded-[4px] border bg-[var(--bg-input)] px-3 py-2 font-mono text-xs outline-none transition-colors ${a?"border-[var(--accent)] text-[var(--text-primary)]":"border-[var(--border)] text-[var(--text-primary)] hover:border-[var(--text-muted)]"} ${n?"cursor-not-allowed opacity-50":"cursor-pointer"}`,children:[t.jsx("span",{className:r?"":"text-[var(--text-muted)]",children:m}),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("button",{type:"button",role:"option","aria-selected":e.value===r,onClick:()=>{x(e.value),o(!1)},className:`flex w-full items-center px-3 py-1.5 text-left font-mono text-xs transition-colors ${e.value===r?"bg-[var(--accent)]/10 text-[var(--accent)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.value===r&&t.jsx("span",{className:"mr-2 text-[var(--accent)]",children:">"}),e.label]},e.value))})]})}export{b as C,h as S};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{c as Y,a as Z,r as l,h as j,j as e,M as kt,z as P,H as wt,t as Q,v as _e,A as _t,f as Ct,B as St,q as Tt,s as Et,k as Qe,p as L,l as Ye,m as Lt,L as Ze,X as it,n as Dt,x as It,U as $t,b as At,G as Pt,E as Rt}from"./index-BnZa648g.js";import{u as Ft,T as Mt,g as le}from"./task-constants-DVi4wVyB.js";import{C as Ot,u as Ut,g as qt,P as et,M as Bt,H as Gt}from"./MobileTerminalShell-DvdSW-sx.js";import{a as Kt,b as zt,f as J,c as Wt}from"./date-RFA7-ZGs.js";import{S as tt}from"./Select-CatoaxSD.js";import{a as xt}from"./status-colors-CJELOkpG.js";import{a as Xt}from"./agent-type-options-SYUwiixD.js";import{T as Ht}from"./Tooltip-BSeP698b.js";import{A as Vt}from"./arrow-left-B16h49gW.js";import{R as ot}from"./rotate-ccw-DTMgDeUz.js";import{G as Jt}from"./git-fork-CsNrC-5K.js";import{E as Qt}from"./external-link-DrZcaziN.js";import{L as dt}from"./loader-circle-_p8GERRD.js";import{F as Yt}from"./file-text-224YYyRN.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 Zt=Y("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
7
|
-
* @license lucide-react v0.469.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const es=Y("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
|
12
|
-
* @license lucide-react v0.469.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const ts=Y("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
17
|
-
* @license lucide-react v0.469.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const ss=Y("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
22
|
-
* @license lucide-react v0.469.0 - ISC
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the ISC license.
|
|
25
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const as=Y("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);function st({isOpen:n,onClose:c,taskId:s,stageName:r,timeoutSeconds:t,onSubmitted:x}){const{t:m}=Z(),[h,p]=l.useState(t),[_,C]=l.useState(!1);l.useEffect(()=>{if(!n)return;p(t);const o=setInterval(()=>{p(N=>N<=1?(clearInterval(o),0):N-1)},1e3);return()=>clearInterval(o)},[n,t]),l.useEffect(()=>{h===0&&n&&c()},[h,n,c]);const I=l.useCallback(async o=>{C(!0);try{await j.post(`web/tasks/${s}/confirm-stage`,{json:{stageName:r,approved:o}}),x==null||x(),c()}catch{}finally{C(!1)}},[s,r,c,x]);return n?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.jsxs("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("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(kt,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsxs("h3",{className:"text-sm text-[var(--text-primary)]",children:["// stage: ",r]})]}),e.jsxs("span",{className:"flex items-center gap-1 text-xs text-[var(--text-muted)]",children:[e.jsx(Ot,{className:"h-3.5 w-3.5"}),Kt(h)]})]}),e.jsx("div",{className:"space-y-4 px-5 py-5",children:e.jsx("p",{className:"whitespace-pre-wrap text-xs text-[var(--text-primary)]",children:m("tasks.confirm_stage_message",{name:r})})}),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:_,onClick:()=>I(!1),children:m("tasks.reject")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:_,onClick:()=>I(!0),children:m(_?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})]}):null}function rs(n,c){const s=new Date(n).getTime()-Date.now();if(s<=0)return c("tasks.tunnel_expired");const r=Math.floor(s/36e5),t=Math.floor(s%36e5/6e4);return r>0?c("tasks.tunnel_expires_hm",{h:r,m:t}):c("tasks.tunnel_expires_m",{m:t})}function at(n){switch(n){case"CONNECTED":return"var(--accent)";case"STARTING":return"var(--warning)";case"EXPIRED":return"var(--text-muted)";default:return"var(--text-muted)"}}function rt(n,c){switch(n){case"IDLE":case"CLOSED":return c("tasks.tunnel_idle");case"STARTING":return c("tasks.tunnel_starting");case"CONNECTED":return c("tasks.tunnel_connected");case"EXPIRED":return c("tasks.tunnel_expired");case"CLOSING":return c("tasks.tunnel_closing");default:return String(n).toLowerCase()}}function ns({taskId:n,taskFinished:c,compact:s}){const{t:r}=Z(),[t,x]=l.useState(P.IDLE),[m,h]=l.useState(null),[p,_]=l.useState(null),[C,I]=l.useState(""),[o,N]=l.useState(!1),[ce,R]=l.useState(!1),F=l.useRef(null),$=l.useCallback(async()=>{try{const u=await j.get(`web/workspace-tunnel/${n}/status`).json();x(u.status),h(u.tunnelUrl??null),_(u.expiresAt??null),(u.status==="EXPIRED"||u.status==="IDLE"||u.status==="CLOSED")&&S()}catch{}},[n]);function ie(){S(),F.current=setInterval($,5e3)}function S(){F.current&&(clearInterval(F.current),F.current=null)}l.useEffect(()=>{c&&(t===P.STARTING||t===P.CONNECTED)&&(x(P.IDLE),h(null),S())},[c,t]),l.useEffect(()=>{if(t!=="CONNECTED"||!p)return;const u=()=>{const T=rs(p,r);I(T),T===r("tasks.tunnel_expired")&&(x(P.EXPIRED),h(null),S())};u();const D=setInterval(u,3e4);return()=>clearInterval(D)},[t,p]),l.useEffect(()=>()=>S(),[]),l.useEffect(()=>{c||$()},[$,c]);async function K(){N(!0);try{await j.post(`web/workspace-tunnel/${n}/start`),x(P.STARTING),ie()}catch(u){let D=r("tasks.tunnel_start_failed");try{if(u instanceof wt){const T=await u.response.json();T!=null&&T.error&&(D=T.error,/code.*not found|ENOENT.*code|spawn code/i.test(D)&&(D+=". "+r("tasks.tunnel_install_code_hint")))}}catch{}Q.error(D)}finally{N(!1)}}async function z(){N(!0);try{await j.post(`web/workspace-tunnel/${n}/stop`),x(P.IDLE),h(null),S()}catch{}finally{N(!1)}}async function xe(){m&&(await navigator.clipboard.writeText(m),R(!0),setTimeout(()=>R(!1),2e3))}return s?e.jsxs("div",{className:"flex items-center gap-2 font-mono lowercase text-xs",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"ide_tunnel:"}),e.jsx("span",{style:{color:at(t)},children:rt(t,r)}),(t==="IDLE"||t==="CLOSED"||t==="EXPIRED")&&e.jsx("button",{onClick:K,disabled:o,className:"rounded-[4px] px-2 py-1 text-[var(--info)] disabled:opacity-50",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:r(o?"tasks.tunnel_starting":"tasks.tunnel_start")}),t==="CONNECTED"&&m&&e.jsx("a",{href:m.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] px-2 py-1 text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:r("tasks.tunnel_open_in_cursor")})]}):e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 font-mono lowercase",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("tasks.tunnel_header")}),e.jsxs("span",{className:"text-xs",style:{color:at(t)},children:["● ",rt(t,r)]})]}),t==="CONNECTED"&&p&&e.jsxs("p",{className:"mb-2 text-xs text-[var(--text-muted)]",children:["// ",C]}),t==="CONNECTED"&&m&&e.jsxs("div",{className:"mb-3 flex items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2",children:[e.jsx("code",{className:"flex-1 truncate text-xs text-[var(--text-primary)]",children:m}),e.jsxs("button",{onClick:xe,className:"shrink-0 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors","aria-label":r("tasks.tunnel_copy_url"),children:["[",r("common.copy"),"]"]})]}),ce&&e.jsx("p",{className:"mb-2 text-xs text-[var(--accent)]",children:r("tasks.tunnel_copied")}),t==="STARTING"&&e.jsx("p",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("tasks.tunnel_waiting")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(t==="IDLE"||t==="CLOSED")&&e.jsx("button",{onClick:K,disabled:o,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:r(o?"tasks.tunnel_starting_button":"tasks.tunnel_start_button")}),t==="STARTING"&&e.jsx("button",{onClick:z,disabled:o,className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:r(o?"tasks.tunnel_stopping":"tasks.tunnel_cancel")}),t==="CONNECTED"&&m&&e.jsxs(e.Fragment,{children:[e.jsx("a",{href:m.replace(/^https?:/,"cursor:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:r("tasks.tunnel_open_cursor")}),e.jsx("a",{href:m.replace(/^https?:/,"vscode:"),target:"_blank",rel:"noopener noreferrer",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("tasks.tunnel_open_vscode")}),e.jsx("button",{onClick:z,disabled:o,className:"rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors disabled:opacity-50",children:r(o?"tasks.tunnel_stopping":"tasks.tunnel_stop")})]}),t==="EXPIRED"&&e.jsx("button",{onClick:K,disabled:o,className:"rounded-[4px] border border-[var(--accent)]/40 px-3 py-1.5 text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors disabled:opacity-50",children:r(o?"tasks.tunnel_starting_button":"tasks.tunnel_restart")})]})]})}function ls({isOpen:n,onClose:c,onConfirm:s,taskId:r,isLoading:t}){const{t:x}=Z();return e.jsx(_e,{isOpen:n,onClose:c,onConfirm:s,title:x("tasks.cancel_task_title"),message:x("tasks.cancel_task_message",{id:String(r)}),confirmLabel:x("tasks.cancel_task_confirm_label"),confirmVariant:"danger",isLoading:t})}function cs({isOpen:n,onClose:c,onConfirm:s,taskId:r,mrUrl:t,isLoading:x,reuseWorkspace:m,onReuseWorkspaceChange:h}){const{t:p}=Z(),_=t?p("tasks.retry_message_with_mr",{id:String(r),url:t}):p("tasks.retry_message_without_mr",{id:String(r)});return e.jsx(_e,{isOpen:n,onClose:c,onConfirm:s,title:p("tasks.retry_title"),message:_,confirmLabel:p("tasks.retry_confirm_label"),confirmVariant:"accent",isLoading:x,children:e.jsxs("label",{className:"flex items-center gap-2 mt-3 text-[var(--text-muted)] text-xs cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:C=>h(C.target.checked),className:"w-3.5 h-3.5 cursor-pointer accent-[var(--accent)]"}),p("tasks.reuse_workspace_label")]})})}const ye=["implement","test","verify","review","simplify","submit"];function we(n){if(typeof n=="string")try{return we(JSON.parse(n))}catch{return null}if(!n||typeof n!="object")return null;const c=n.stages;if(!Array.isArray(c)||c.length===0)return null;const s=c.map(r=>r&&typeof r=="object"?r.name:null).filter(r=>typeof r=="string"&&r.length>0);return s.length===c.length?s:null}function is(n){if(!n.configSnapshot)return ye;try{const c=JSON.parse(n.configSnapshot);return we(c.pipeline)??we(c)??ye}catch{return ye}}function xs(n){switch(n){case"stage_change":return"text-[var(--accent)]";case"info":return"text-[var(--text-secondary)]";case"warning":return"text-[var(--warning)]";case"error":return"text-[var(--destructive)]";case"system":return"text-[var(--info)]";default:return"text-[var(--text-muted)]"}}function ke({status:n,agentType:c}){const s=xt(n),r=le(c);return e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-0.5 text-xs",style:{color:s},children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-[3px]",style:{backgroundColor:s}}),n.toLowerCase()," / ",r]})}function nt({stages:n,runningBg:c="bg-[#1a1a1a]",py:s="py-1.5"}){return e.jsx(e.Fragment,{children:n.map(r=>{const t=r.status==="completed",x=r.status==="running",m=r.status==="failed";return e.jsxs("div",{className:`flex items-center gap-2 rounded-[4px] px-2 ${s} ${x?c:""}`,children:[t&&e.jsx(Rt,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),x&&e.jsx(dt,{className:"h-3.5 w-3.5 shrink-0 text-[var(--accent)]"}),m&&e.jsx(it,{className:"h-3.5 w-3.5 shrink-0 text-[var(--destructive)]"}),r.status==="pending"&&e.jsx(Zt,{className:"h-3.5 w-3.5 shrink-0 text-[#525252]"}),e.jsx("span",{className:"text-xs",style:{color:t?"var(--accent)":x?"#e5e5e5":m?"var(--destructive)":"#525252",fontWeight:x?500:400},children:x?`> ${r.name}`:r.name})]},r.name)})})}function lt({task:n,ptyStatus:c,displayAgentType:s,t:r,gap:t="gap-2 md:gap-3"}){return e.jsxs("div",{className:`flex items-center ${t}`,children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:r("tasks.pty_terminal")}),e.jsxs("span",{className:`inline-flex items-center gap-1 text-[11px] ${c==="connected"?"text-[var(--accent)]":c==="connecting"?"text-[var(--warning)]":"text-[var(--text-muted)]"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${c==="connected"?"bg-[var(--accent)]":c==="connecting"?"bg-[var(--warning)]":"bg-[#525252]"}`}),r(`tasks.${c}`)]}),e.jsx("span",{className:"text-[11px]",style:{color:xt(n.status)},children:n.status.toLowerCase()}),n.currentStage&&e.jsxs("span",{className:"hidden md:inline text-[11px] text-[var(--accent)]",children:[r("tasks.stage"),": ",n.currentStage]}),e.jsxs("span",{className:"hidden md:inline text-[11px] text-[var(--text-muted)]",children:["agent: ",s]}),n.workerName&&e.jsxs("span",{className:"hidden md:inline text-[11px] text-[var(--text-muted)]",children:["worker: ",n.workerName]})]})}function ct({isFinished:n,takeoverState:c,ptyRef:s,t:r}){return e.jsxs(e.Fragment,{children:[!n&&c==="auto"&&e.jsxs("button",{onClick:()=>{var t;return(t=s.current)==null?void 0:t.requestTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-10 md:h-8 text-[11px] font-medium text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:[e.jsx(Gt,{className:"h-3 w-3"}),r("tasks.take_over")]}),!n&&c==="manual"&&e.jsxs("button",{onClick:()=>{var t;return(t=s.current)==null?void 0:t.releaseTakeover()},className:"flex items-center gap-1.5 rounded-[4px] px-2.5 h-10 md:h-8 text-[11px] font-medium text-[var(--accent)]",style:{backgroundColor:"rgba(34,197,94,0.12)"},children:[e.jsx(ot,{className:"h-3 w-3"}),r("tasks.restore_auto")]})]})}function os(n){const c=is(n),s=n.currentStage?c.indexOf(n.currentStage):-1;return c.map((r,t)=>{let x="pending";return n.status===L.COMPLETED?x="completed":n.status===L.FAILED&&t<=s?x=t===s?"failed":"completed":s>=0&&(t<s?x="completed":t===s&&(x="running")),{name:r,status:x}})}function G(n,c){if(!n||!c)return null;const s=n.repoUrl.replace(/\.git$/,"").replace(/\/+$/,""),r=c.split("/").map(encodeURIComponent).join("/");return n.gitPlatform===Pt.GITLAB?`${s}/-/tree/${r}`:`${s}/tree/${r}`}function _s(){var He,Ve,Je;const{id:n}=_t(),c=Ct(),{t:s}=Z(),r=Ft(a=>a.cancelTask),[t,x]=l.useState(null),[m,h]=l.useState(null),[p,_]=l.useState([]),[C,I]=l.useState(!0),[o,N]=l.useState(null),[ce,R]=l.useState(!1),[F,$]=l.useState(!1),[ie,S]=l.useState(!1),[K,z]=l.useState(!1),[xe,u]=l.useState(!1),[D,T]=l.useState(!1),[Ce,Se]=l.useState(""),[Te,Ee]=l.useState(""),[Le,De]=l.useState("append"),[Ie,oe]=l.useState(!1),[$e,mt]=St(),[k,de]=l.useState("terminal"),[Ae,Pe]=l.useState([]),[ee,Re]=l.useState(0),[W,M]=l.useState(0),[X,Fe]=l.useState(""),[te,pt]=l.useState(""),[ut,me]=l.useState(!1),[ht,Me]=l.useState(!1),[O,pe]=l.useState(null),[Oe,ue]=l.useState("disconnected"),[he,fe]=l.useState("auto"),H=l.useRef(null),Ue=l.useRef(null),ft=Ut(),d=Number(n),f=t?Mt.includes(t.status):!1;Tt(t?Et(t,100):null);const E=l.useCallback(async()=>{try{const a=await j.get(`web/tasks/${d}`).json();x(a)}catch{}},[d]),se=l.useCallback(async()=>{try{const a=await j.get(`web/tasks/${d}/logs`).json();_(a.lines)}catch{}},[d]),U=l.useCallback(async()=>{try{const a=await j.get(`web/tasks/${d}/pending-confirm`).json();N(a.confirm)}catch{N(null)}},[d]),qe=l.useCallback(async()=>{me(!0);try{const a=new URLSearchParams;a.set("limit","50"),a.set("offset",String(W*50)),X&&a.set("type",X),te&&a.set("search",te);const i=await j.get(`web/tasks/${d}/events?${a}`).json();Pe(i.events),Re(i.total)}catch{}finally{me(!1)}},[d,W,X,te]);l.useEffect(()=>{k==="logs"&&qe()},[k,qe]),l.useEffect(()=>{k==="pipeline"&&!f&&j.get(`web/workspaces/${d}`).json().then(pe).catch(()=>pe(null))},[k,d,f]);const q=Qe(a=>a.lastEvent),Be=Qe(a=>a.eventSeq);l.useEffect(()=>{I(!0),x(null),h(null),_([]),N(null),pe(null),Pe([]),Re(0),M(0),me(!1),Promise.all([E(),se(),U()]).finally(()=>I(!1))},[E,se,U]),l.useEffect(()=>{t!=null&&t.projectKey&&j.get(`web/projects/${t.projectKey}`).json().then(h).catch(()=>h(null))},[t==null?void 0:t.projectKey]),l.useEffect(()=>{!q||Be===0||(q.event==="task_status_changed"&&q.taskId===d||q.event==="task_created"&&q.taskId===d)&&(E(),U())},[Be,q,d,E,U]),l.useEffect(()=>{if(f)return;const i=setInterval(()=>{document.visibilityState!=="hidden"&&Promise.all([E(),se(),U()])},15e3);return()=>clearInterval(i)},[f,E,se,U]);const Ge=l.useCallback(()=>N(null),[]),ae=l.useCallback(()=>{N(null),E()},[E]),vt=(t==null?void 0:t.status)===L.FAILED||(t==null?void 0:t.status)===L.CANCELLED,ve=(t==null?void 0:t.status)===L.COMPLETED||(t==null?void 0:t.status)===L.FAILED||(t==null?void 0:t.status)===L.CANCELLED;l.useEffect(()=>{$e.get("action")==="fork"&&t&&!C&&(ve&&Ke(),mt(a=>(a.delete("action"),a),{replace:!0}))},[t,C,$e,ve]);async function gt(){z(!0);try{await r(d),R(!1),await E()}finally{z(!1)}}async function bt(){u(!0);try{await j.post(`web/tasks/${d}/retry`,{json:{reuseWorkspace:Ie}}),$(!1),oe(!1),await E()}finally{u(!1)}}function Ke(){Se(""),Ee(""),De("append"),S(!0)}async function jt(){T(!0);try{const a=Ce.trim()||void 0,i=await j.post(`web/tasks/${d}/fork`,{json:{description:a,descriptionMode:a?Le:void 0,agentType:Te||void 0}}).json();S(!1),Q.success(s("tasks.fork_success")),c(`/tasks/${i.task.id}`)}catch{Q.error(s("tasks.fork_error"))}finally{T(!1)}}const y=l.useMemo(()=>t?os(t):[],[t==null?void 0:t.configSnapshot,t==null?void 0:t.currentStage,t==null?void 0:t.status]),ge=y.findIndex(a=>a.status==="running");if(C)return 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:s("tasks.loading_task")})});if(!t)return e.jsxs("div",{className:"mx-auto max-w-5xl px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:s("tasks.task_not_found")}),e.jsxs("button",{onClick:()=>c("/tasks"),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:["< ",s("tasks.back_to_tasks")]})]});const w=t.status===L.QUEUED&&t.queuePosition!=null&&t.queueTotal!=null?{position:t.queuePosition,total:t.queueTotal}:null,v=zt(t.startedAt,t.completedAt),V=qt(t),be=le(t.agentType),Nt=[{value:"",label:s("tasks.fork_agent_type_placeholder",{agent:le(V)})},...Xt(le,V)],re=`${s("tasks.status_suspended")} / ${be}`,ze=w?e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"queue"}),e.jsxs("span",{className:"text-[var(--info)]",children:["#",w.position," / ",w.total]})]}):null,We=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:()=>c("/tasks"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(Vt,{className:"h-4 w-4"})}),e.jsxs("span",{className:"line-clamp-2 text-sm font-medium text-[var(--text-primary)]",title:Lt(t),children:["#",t.id," ",Ye(t,100)]})]}),je=e.jsxs("div",{className:"hidden md:flex items-center gap-4 border-b border-[var(--border)] bg-[var(--bg-primary)] px-5 shrink-0",style:{height:44},children:[e.jsx(ke,{status:t.status,agentType:t.agentType}),v&&e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// time cost: ",v]}),w&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsx("span",{className:"text-xs text-[var(--info)]",children:s("tasks.queue_position",{position:String(w.position),total:String(w.total)})})]}),e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs(Ze,{to:`/projects/${t.projectKey}`,className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:["project: ",e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),t.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["branch: ",G(m,t.branch)?e.jsx("a",{href:G(m,t.branch),target:"_blank",rel:"noopener noreferrer",className:"text-[var(--text-primary)] hover:text-[var(--info)] hover:underline transition-colors",children:t.branch}):e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch})]})]}),t.mrUrl&&/^https?:\/\//.test(t.mrUrl)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs text-[var(--border)]",children:"|"}),e.jsxs("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline",children:["MR: ",((He=t.mrUrl.match(/!?\d+$/))==null?void 0:He[0])??"view"]})]})]}),Xe=e.jsxs("div",{className:"flex items-center gap-3 border-t border-[var(--border)] bg-[var(--bg-primary)] px-4 md:px-5 shrink-0",style:{height:48},children:[!f&&e.jsxs("button",{onClick:()=>R(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--destructive)]/10 px-3 h-8 text-[11px] font-medium text-[var(--destructive)]",children:[e.jsx(it,{className:"h-3 w-3"}),s("tasks.cancel_task")]}),vt&&e.jsxs("button",{onClick:()=>$(!0),className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-3 h-8 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors cursor-pointer",children:[e.jsx(ot,{className:"h-3 w-3"}),s("tasks.retry_task")]}),ve&&e.jsxs("button",{onClick:Ke,className:"flex flex-1 md:flex-none items-center justify-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-3 h-8 text-[11px] text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors cursor-pointer",children:[e.jsx(Jt,{className:"h-3 w-3"}),s("tasks.fork_task")]}),t.workerId&&!f&&e.jsxs("button",{onClick:()=>{de("pipeline"),setTimeout(()=>{var a,i;(i=(a=Ue.current)==null?void 0:a.scrollIntoView)==null||i.call(a,{behavior:"smooth",block:"center"})},50)},className:"hidden lg:flex items-center justify-center gap-1.5 rounded-[4px] px-3 h-8 text-[11px] font-medium text-[var(--info)]",style:{backgroundColor:"rgba(59,130,246,0.12)"},children:[e.jsx(Qt,{className:"h-3 w-3"}),s("tasks.cursor_tunnel")]})]}),yt=e.jsxs("div",{className:"hidden w-[280px] shrink-0 flex-col gap-6 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-4 lg:flex",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:s("tasks.pipeline_stages")}),e.jsx(nt,{stages:y})]}),v&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-[11px] text-[var(--text-secondary)]",children:["// time cost: ",v]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:s("tasks.activity_log")}),p.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:p.slice(0,8).map((a,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:a},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.no_activity")})]})]}),Ne=e.jsxs(e.Fragment,{children:[e.jsx(ls,{isOpen:ce,onClose:()=>R(!1),onConfirm:gt,taskId:d,isLoading:K}),e.jsx(cs,{isOpen:F,onClose:()=>{$(!1),oe(!1)},onConfirm:bt,taskId:d,mrUrl:t.mrUrl??void 0,isLoading:xe,reuseWorkspace:Ie,onReuseWorkspaceChange:oe}),e.jsx(_e,{isOpen:ie,onClose:()=>S(!1),onConfirm:jt,title:s("tasks.fork_task"),message:s("tasks.fork_task_desc"),confirmLabel:s("tasks.fork_task"),confirmVariant:"accent",isLoading:D,children:e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["fork of #",d]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.form_agent_type")}),e.jsx(tt,{value:Te,onChange:Ee,options:Nt})]}),e.jsx("textarea",{value:Ce,onChange:a=>Se(a.target.value),placeholder:s("tasks.fork_description_placeholder"),rows:4,className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsxs("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] px-3 py-2 text-[11px] text-[var(--text-secondary)]",children:[e.jsx("input",{type:"checkbox",checked:Le==="replace",onChange:a=>De(a.target.checked?"replace":"append"),className:"mt-0.5 h-3.5 w-3.5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] accent-[var(--accent)]"}),e.jsxs("span",{children:[s("tasks.fork_replace_description"),e.jsx("span",{className:"mt-1 block text-[10px] text-[var(--text-muted)]",children:s("tasks.fork_append_hint")})]})]})]})})]});return ht&&k==="terminal"?e.jsxs("div",{className:"fixed inset-0 z-50 flex flex-col bg-[var(--bg-primary)] font-mono lowercase h-screen",style:{height:"100dvh",paddingTop:"env(safe-area-inset-top, 0px)",paddingBottom:"env(safe-area-inset-bottom, 0px)"},children:[je,e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 shrink-0",style:{height:36,backgroundColor:"#111111"},children:[e.jsx(lt,{task:t,ptyStatus:Oe,displayAgentType:V,t:s,gap:"gap-3"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ct,{isFinished:f,takeoverState:he,ptyRef:H,t:s}),e.jsx("button",{onClick:()=>Me(!1),className:"flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1 text-[var(--text-muted)]",children:e.jsx(ss,{className:"h-3 w-3"})})]})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(et,{ref:H,taskId:d,sessionId:t.currentSessionId??void 0,taskFinished:f,onStatusChange:ue,onTakeoverChange:fe})}),Xe,Ne]}):t.status===L.SUSPENDED?e.jsxs("div",{className:"flex h-full flex-col font-mono lowercase",children:[We,je,e.jsx("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0",style:{backgroundColor:"rgba(245,158,11,0.08)",borderColor:"rgba(245,158,11,0.2)",color:"var(--warning)"},children:s("tasks.task_suspended_banner")}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col md:flex-row gap-4 md:gap-6 p-4 md:p-6 overflow-y-auto",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-4",children:[e.jsxs("div",{className:"hidden md:flex items-center gap-3",children:[e.jsxs("span",{className:"text-xl font-bold text-[var(--text-primary)]",children:["#",t.id]}),e.jsx("span",{className:"text-base text-[var(--text-secondary)] truncate max-w-[60%]",children:e.jsx(Ht,{content:Dt(t),children:Ye(t,200)})}),e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:re})]}),e.jsx("div",{className:"flex items-center gap-2 md:hidden",children:e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px] font-bold text-[var(--warning)]",style:{backgroundColor:"rgba(245,158,11,0.12)"},children:re})}),o&&e.jsxs("div",{className:"rounded-[4px] border p-4",style:{borderColor:"rgba(245,158,11,0.27)",backgroundColor:"#1a1a1a"},children:[e.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:s("tasks.pending_confirmation")}),e.jsx("p",{className:"mb-3 text-xs text-[var(--text-secondary)]",children:o.prompt??s("tasks.pipeline_requires_confirmation")}),e.jsx("div",{className:"mb-3 flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"stage"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:o.stageName})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:flex-wrap md:gap-3",children:[e.jsx("button",{onClick:async()=>{try{await j.post(`web/tasks/${d}/confirm-stage`,{json:{stageName:o.stageName,approved:!0}}),ae()}catch{Q.error(s("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] bg-[var(--accent)] px-4 py-2.5 md:py-2 text-[11px] font-bold text-[#0c0c0c]",children:s("tasks.confirm_and_proceed")}),e.jsx("button",{onClick:async()=>{try{await j.post(`web/tasks/${d}/confirm-stage`,{json:{stageName:o.stageName,approved:!1}}),ae()}catch{Q.error(s("tasks.confirm_failed"))}},className:"flex-1 md:flex-none rounded-[4px] bg-[#1a1a1a] px-4 py-2.5 md:py-2 text-[11px] text-[var(--destructive)]",style:{border:"1px solid rgba(239,68,68,0.27)"},children:s("tasks.reject")})]})]}),e.jsxs("div",{className:"flex flex-col gap-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:s("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"status"}),e.jsx("span",{className:"font-bold text-[var(--warning)]",children:re})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:J(t.createdAt)})]})]})]}),e.jsx("div",{className:"hidden md:flex flex-wrap items-center gap-2 py-2",children:y.map((a,i)=>{const g=a.status==="failed",b=a.status==="completed",A=a.status==="running"&&t.status===L.SUSPENDED,B=g?"var(--destructive)":b?"var(--accent)":A?"var(--warning)":"#525252",ne=g?"rgba(239,68,68,0.12)":b?"rgba(34,197,94,0.12)":A?"rgba(245,158,11,0.12)":"transparent";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"rounded-[4px] px-2.5 py-1 text-[11px]",style:{color:B,backgroundColor:ne,fontWeight:A?700:400,border:A?`1px solid ${B}`:void 0},children:A?"confirm":`${a.name}${b?" ✓":g?" ✗":""}`}),i<y.length-1&&e.jsx("div",{className:"h-px w-6 bg-[var(--border)]"})]},a.name)})}),e.jsxs("div",{className:"hidden md:block min-h-[200px] flex-1 rounded-[4px] border border-[var(--border)] bg-[#0c0c0c] p-4",children:[e.jsx("p",{className:"mb-2 text-[11px] font-bold text-[var(--accent)]",children:s("tasks.pty_output")}),e.jsxs("div",{className:"flex flex-col gap-1",children:[p.slice(-10).map((a,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-secondary)]",children:a},i)),p.length===0&&e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.no_output")})]})]})]}),e.jsxs("div",{className:"hidden w-[280px] shrink-0 flex-col gap-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:flex",children:[e.jsx("span",{className:"text-[13px] font-bold text-[var(--accent)]",children:s("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"status"}),e.jsx("span",{className:"font-bold text-[var(--warning)]",children:re})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsx("span",{className:"text-xs font-bold text-[var(--accent)]",children:s("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2",children:y.map(a=>{const i=a.status==="completed"?"var(--info)":a.status==="failed"?"var(--destructive)":a.status==="running"?"var(--warning)":"#525252",g=a.status==="failed"?"var(--destructive)":a.status==="running"?"var(--warning)":"#a3a3a3",b=a.status==="completed"?"completed":a.status==="running"?"suspended":a.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-[4px]",style:{backgroundColor:i}}),e.jsxs("span",{className:"text-[11px]",style:{color:g,fontWeight:a.status==="running"?700:400},children:[a.name," ",b]})]},a.name)})}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsx("div",{className:"flex flex-col gap-1.5 text-[11px]",children:e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"created"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:J(t.createdAt)})]})})]})]}),o&&e.jsx(st,{isOpen:!!o,onClose:Ge,taskId:d,stageName:o.stageName,timeoutSeconds:Math.ceil(o.timeout/1e3),onSubmitted:ae}),Ne]}):e.jsxs("div",{className:"flex h-full flex-col overflow-hidden font-mono lowercase",children:[We,e.jsxs("div",{className:"flex flex-wrap items-center gap-3 gap-y-1 border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 py-2 shrink-0 md:hidden",children:[e.jsx(ke,{status:t.status,agentType:t.agentType}),v&&e.jsxs("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:["// time cost: ",v]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:t.projectKey}),t.workerName&&e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:t.workerName}),t.branch&&(G(m,t.branch)?e.jsx("a",{href:G(m,t.branch),target:"_blank",rel:"noopener noreferrer",className:"shrink-0 text-[11px] text-[var(--text-muted)] hover:text-[var(--info)] hover:underline truncate max-w-[80px] md:max-w-[120px] transition-colors",children:t.branch}):e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)] truncate max-w-[80px] md:max-w-[120px]",children:t.branch}))]}),je,t.errorMessage&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-6 py-2 text-xs shrink-0 bg-[var(--destructive)]/10 text-[var(--destructive)]",style:{borderColor:"rgba(239,68,68,0.2)"},children:["// error: ",t.errorMessage]}),w&&e.jsxs("div",{className:"flex items-center gap-2 border-b px-4 md:px-6 py-2 text-xs shrink-0 text-[var(--info)]",style:{backgroundColor:"color-mix(in srgb, var(--info) 8%, transparent)",borderColor:"color-mix(in srgb, var(--info) 20%, transparent)"},children:[e.jsx(es,{className:"h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{children:[s("tasks.queue_position_banner",{position:String(w.position),total:String(w.total)}),w.position>1?` — ${s("tasks.queue_ahead",{count:String(w.position-1)})}`:` — ${s("tasks.queue_next")}`]})]}),o&&e.jsx(st,{isOpen:!!o,onClose:Ge,taskId:d,stageName:o.stageName,timeoutSeconds:Math.ceil(o.timeout/1e3),onSubmitted:ae}),e.jsxs("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"flex items-center border-b border-[var(--border)] shrink-0 overflow-x-auto no-scrollbar",children:["terminal","pipeline","logs","detail"].map(a=>e.jsx("button",{onClick:()=>de(a),className:`shrink-0 whitespace-nowrap px-4 py-2.5 text-xs transition-colors ${k===a?"border-b-2 border-[var(--accent)] text-[var(--accent)] font-medium":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:s(a==="terminal"?"tasks.terminal":a==="pipeline"?"tasks.pipeline_tab":a==="logs"?"tasks.logs":"tasks.detail_tab")},a))}),k==="terminal"&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-3 md:px-5 shrink-0",style:{height:36,backgroundColor:"#111111"},children:[e.jsx(lt,{task:t,ptyStatus:Oe,displayAgentType:V,t:s}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ct,{isFinished:f,takeoverState:he,ptyRef:H,t:s}),!f&&he==="requesting"&&e.jsxs("span",{className:"flex items-center gap-1.5 px-2.5 h-10 md:h-8 text-[11px] text-[var(--warning)]",children:[e.jsx(dt,{className:"h-3 w-3 animate-spin"}),s("tasks.requesting_takeover")]}),!f&&t.currentStage&&e.jsxs("button",{className:"hidden md:flex items-center gap-1.5 rounded-[4px] bg-[var(--bg-card)] px-2.5 h-10 md:h-8 text-[11px] text-[var(--text-muted)]",children:[e.jsx(as,{className:"h-3 w-3"}),s("tasks.skip_stage")]}),e.jsx("button",{onClick:()=>Me(!0),className:"hidden md:flex items-center rounded-[4px] bg-[var(--bg-card)] px-2.5 h-10 md:h-8 text-[var(--text-muted)]",children:e.jsx(ts,{className:"h-3 w-3"})})]})]}),e.jsxs("div",{className:"border-b border-[var(--border)] px-4 py-2 shrink-0 md:hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.currentStage&&e.jsxs("span",{className:"text-[11px] font-semibold text-[var(--accent)]",children:[s("tasks.stage"),": ",t.currentStage]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",V]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsx("div",{className:"overflow-x-auto no-scrollbar pr-4",style:{borderRadius:0},children:e.jsxs("div",{className:"flex items-center gap-1.5 py-0.5",children:[e.jsx("span",{className:"shrink-0 text-[11px] font-bold text-[var(--accent)]",children:s("tasks.stage_progress")}),y.map((a,i)=>{const g=a.status==="completed",b=a.status==="running",B=a.status==="failed"?"var(--destructive)":g||b?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",children:[e.jsxs("span",{className:"shrink-0 text-[11px] leading-normal whitespace-nowrap",style:{color:B,fontWeight:b?600:400},children:[a.name,g?" ✓":b?" ...":""]}),i<y.length-1&&e.jsx("div",{className:"mx-1.5 h-px w-4 shrink-0",style:{backgroundColor:B}})]},a.name)})]})})]}),ft?e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(Bt,{ref:H,taskId:d,sessionId:t.currentSessionId??void 0,taskFinished:f,onStatusChange:ue,onTakeoverChange:fe})}):e.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e.jsx(et,{ref:H,taskId:d,sessionId:t.currentSessionId??void 0,taskFinished:f,onStatusChange:ue,onTakeoverChange:fe})}),Xe]}),k==="pipeline"&&e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("div",{className:"mb-4 md:mb-5 overflow-x-auto no-scrollbar",style:{borderRadius:0},children:e.jsx("div",{className:"flex items-center py-5",children:y.map((a,i)=>{const g=a.status==="completed",b=a.status==="running",ne=a.status==="failed"?"var(--destructive)":g||b?"var(--accent)":"#525252";return e.jsxs("div",{className:"flex items-center",style:{flex:i<y.length-1?1:void 0},children:[e.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[e.jsxs("div",{className:"flex h-6 w-6 md:h-7 md:w-7 items-center justify-center rounded-full shrink-0",style:{backgroundColor:ne},children:[g&&e.jsx("span",{className:"text-[11px] md:text-xs font-semibold text-[#0c0c0c]",children:"✓"}),b&&e.jsx("span",{className:"h-2 w-2 md:h-2.5 md:w-2.5 rounded-full bg-[#0c0c0c]"})]}),e.jsx("span",{className:"text-[11px] leading-normal font-medium whitespace-nowrap",style:{color:ne},children:a.name})]}),i<y.length-1&&e.jsx("div",{className:"mx-1 md:mx-2 h-0.5 flex-1 min-w-3 rounded-full",style:{backgroundColor:i<(ge>=0?ge:0)?"var(--accent)":"#525252"}})]},a.name)})})}),t.currentStage&&e.jsxs("div",{className:"mb-4 md:mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 text-xs leading-relaxed",children:[e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// stage: ",t.currentStage," (",ge+1,"/",y.length,")"]}),t.startedAt&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// elapsed: ",J(t.startedAt).replace(" ago","")]}),v&&e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",v]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// retries: ",t.retryCount,"/2"]})]}),!t.currentStage&&v&&e.jsx("div",{className:"mb-4 md:mb-5 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 text-xs leading-relaxed",children:e.jsxs("p",{className:"text-[var(--text-secondary)]",children:["// time cost: ",v]})}),e.jsx("button",{onClick:()=>de("terminal"),className:"flex-1 min-h-[100px] rounded-[4px] border border-dashed border-[var(--border)] flex items-center justify-center gap-2 text-[11px] text-[var(--text-muted)] hover:border-[var(--accent)] hover:text-[var(--accent)] transition-colors",children:e.jsxs("span",{children:["// ",s("tasks.view_terminal")]})}),e.jsxs("div",{className:"mt-4 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 lg:hidden",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:s("tasks.task_info")}),e.jsxs("div",{className:"mt-2 flex flex-col gap-1.5 text-[11px]",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"branch"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.branch??"-"})]}),ze]})]}),e.jsxs("div",{className:"flex flex-col gap-6 mt-4 lg:hidden",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:s("tasks.pipeline_stages")}),e.jsx(nt,{stages:y,runningBg:"bg-[var(--bg-input)]",py:"py-2"})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[11px] font-medium text-[var(--text-muted)]",children:s("tasks.activity_log")}),p.length>0?e.jsx("div",{className:"flex flex-col gap-1.5",children:p.slice(-12).map((a,i)=>e.jsx("p",{className:"text-[11px] leading-relaxed text-[var(--text-muted)]",children:a},i))}):e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.no_activity")})]})]})]}),k==="logs"&&e.jsxs("div",{className:"flex flex-1 flex-col gap-3 md:gap-5 overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)] md:hidden",children:s("tasks.task_logs")}),e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:gap-3",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar md:hidden",children:["","error","system"].map(a=>e.jsx("button",{onClick:()=>{Fe(a),M(0)},className:`shrink-0 rounded-[4px] px-2.5 py-1 text-[11px] ${X===a?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)]"}`,children:a||"all"},a))}),e.jsx("div",{className:"hidden md:block",children:e.jsx(tt,{value:X,onChange:a=>{Fe(a),M(0)},options:[{value:"",label:"all"},{value:"stage_change",label:"stage_change"},{value:"info",label:"info"},{value:"warning",label:"warning"},{value:"error",label:"error"},{value:"system",label:"system"}],className:"w-36"})}),e.jsxs("div",{className:"flex flex-1 items-center gap-2 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:[e.jsx(It,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:s("tasks.search_logs"),value:te,onChange:a=>{pt(a.target.value),M(0)},className:"flex-1 bg-transparent text-xs text-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)]"})]})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[Ae.map((a,i)=>e.jsxs("div",{className:`flex items-start md:items-center gap-2 md:gap-4 rounded-[4px] px-2 md:px-3 py-2 text-[11px] md:text-xs ${i%2===0?"bg-[var(--bg-card)]":""}`,children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:new Date(a.timestamp).toLocaleTimeString("en-US",{hour12:!1})}),e.jsx("span",{className:`shrink-0 font-medium ${xs(a.type)}`,children:a.type}),e.jsx("span",{className:"min-w-0 break-words md:truncate text-[var(--text-primary)]",children:a.message})]},a.id)),Ae.length===0&&!ut&&e.jsx("p",{className:"py-8 text-center text-xs text-[var(--text-muted)]",children:s("tasks.no_log_entries")})]}),ee>50&&e.jsxs("div",{className:"flex items-center justify-center gap-1",children:[Array.from({length:Math.ceil(ee/50)}).slice(0,5).map((a,i)=>e.jsx("button",{onClick:()=>M(i),className:`rounded-[4px] px-2 py-1 text-xs ${W===i?"bg-[var(--accent)] text-black font-medium":"text-[var(--text-muted)] hover:text-[var(--text-primary)]"}`,children:i+1},i)),Math.ceil(ee/50)>5&&e.jsx("button",{onClick:()=>M(W+1),disabled:W>=Math.ceil(ee/50)-1,className:"rounded-[4px] px-2 py-1 text-xs text-[var(--text-muted)] disabled:opacity-30",children:">"})]})]}),k==="detail"&&e.jsxs("div",{className:"flex flex-1 flex-col gap-4 md:gap-5 overflow-y-auto p-4 md:p-6 lg:p-8",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx($t,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:s("tasks.detail_basic_info")})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:[e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.detail_creator")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.creatorName??"-"})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("common.created_at")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:Wt(t.createdAt)}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:J(t.createdAt)})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("common.status")}),e.jsx(ke,{status:t.status,agentType:t.agentType})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.detail_project")}),e.jsx(Ze,{to:`/projects/${t.projectKey}`,className:"text-xs text-[var(--info)] hover:underline transition-colors",children:t.projectKey})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.detail_worker")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.form_agent_type")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:be})]}),v&&e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.detail_time_cost")}),e.jsx("span",{className:"text-xs text-[var(--text-primary)]",children:v})]}),t.branch&&e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.detail_branch")}),G(m,t.branch)?e.jsx("a",{href:G(m,t.branch),target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline transition-colors truncate",children:t.branch}):e.jsx("span",{className:"text-xs text-[var(--text-primary)] truncate",children:t.branch})]}),t.mrUrl&&/^https?:\/\//.test(t.mrUrl)&&e.jsxs("div",{className:"flex flex-col gap-1 rounded-[4px] bg-[var(--bg-primary)] p-3",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.mr_link")}),e.jsx("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-[var(--info)] hover:underline truncate",children:((Ve=t.mrUrl.match(/!?\d+$/))==null?void 0:Ve[0])??"view"})]})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(Yt,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:s("tasks.detail_task_name")})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[t.name&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.detail_ai_name")}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:t.name})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.detail_task_id")}),e.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["#",t.id]})]}),t.sourcePlatform&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:s("tasks.detail_source")}),e.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:t.sourcePlatform})]})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(At,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-bold text-[var(--accent)]",children:s("tasks.detail_description")})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[#0c0c0c] p-4 overflow-x-auto",children:e.jsx("pre",{className:"whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--text-secondary)] font-mono",children:t.description})})]})]})]}),k==="terminal"&&yt,k==="pipeline"&&e.jsxs("div",{className:"hidden w-[420px] shrink-0 flex-col gap-5 overflow-y-auto border-l border-[var(--border)] bg-[var(--bg-primary)] p-5 lg:flex",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:s("tasks.task_info")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"project"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.projectKey})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"creator"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.creatorName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"worker"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:t.workerName??"-"})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:s("common.created_at")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:J(t.createdAt)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:s("tasks.form_agent_type")}),e.jsx("span",{className:"text-[var(--text-primary)]",children:be})]}),v&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"time cost"}),e.jsx("span",{className:"text-[var(--text-primary)]",children:v})]}),ze]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:s("tasks.workspace_section")}),e.jsxs("div",{className:"flex flex-col gap-1.5 text-xs",children:[e.jsxs("div",{className:"flex min-w-0 justify-between",children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:"branch"}),e.jsx("span",{className:"ml-4 min-w-0 truncate text-[var(--text-primary)]",children:t.branch??(O==null?void 0:O.branch)??"-"})]}),e.jsxs("div",{className:"flex min-w-0 justify-between",children:[e.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:"worktree"}),e.jsx("span",{className:"ml-4 min-w-0 truncate text-[var(--text-primary)]",children:(O==null?void 0:O.path)??"-"})]}),t.mrUrl&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:s("tasks.mr_link")}),e.jsx("a",{href:t.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-[var(--info)] hover:underline",children:((Je=t.mrUrl.match(/!?\d+$/))==null?void 0:Je[0])??"view"})]})]})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{ref:Ue,className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:s("tasks.cursor_tunnel_section")}),t.workerId?e.jsx(ns,{taskId:d,taskFinished:f,compact:!0}):e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:s("tasks.no_worker_assigned")})]}),e.jsx("div",{className:"h-px bg-[var(--border)]"}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-[13px] font-semibold text-[var(--accent)]",children:s("tasks.stage_timeline")}),e.jsx("div",{className:"flex flex-col gap-2 text-xs",children:y.map(a=>{const i=a.status==="completed"?"✓":a.status==="running"?"→":"·",g=a.status==="running"?"var(--accent)":a.status==="completed"?"var(--info)":a.status==="failed"?"var(--destructive)":"#525252",b=a.status==="completed"?"done":a.status==="running"?"running...":a.status==="failed"?"failed":"pending";return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-semibold",style:{color:g},children:i}),e.jsx("span",{className:a.status==="running"?"font-medium":"",style:{color:g},children:a.name}),e.jsxs("span",{className:"text-[11px]",style:{color:"#525252"},children:["— ",b]})]},a.name)})})]})]})]}),Ne]})}export{_s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{R as pe,f as J,a as $,p as u,j as e,l as ee,n as me,u as ue,i as he,r,h as P,X as be,k as ve,w as fe,H as ge,t as W,x as ye,y as V,m as je}from"./index-BnZa648g.js";import{a as ke,u as X}from"./task-constants-DVi4wVyB.js";import{T as te}from"./TaskStatusBadge-BdDVC3F4.js";import{f as se}from"./date-RFA7-ZGs.js";import{T as Ne}from"./Tooltip-BSeP698b.js";import{G as re}from"./git-fork-CsNrC-5K.js";import{S as A}from"./Select-CatoaxSD.js";import{g as Ce}from"./agent-type-options-SYUwiixD.js";import{C as we}from"./copy-DNIFSymA.js";import{E as Y}from"./EmptyState-BrTEmjub.js";import{T as Z}from"./Skeleton-CJVHi16l.js";import{P as Se}from"./plus-DtE-5ICU.js";import{C as _e}from"./chevron-left-CH1J8GB-.js";import{C as Te}from"./chevron-right-CdPoqMfX.js";import"./status-colors-CJELOkpG.js";const Ee=pe.memo(function({task:s}){const d=J(),{t:c}=$(),x=(a,b)=>c(`common.${a}`,{n:b}),i=s.status===u.COMPLETED||s.status===u.FAILED||s.status===u.CANCELLED;return e.jsxs("tr",{onClick:()=>d(`/tasks/${s.id}`),className:"cursor-pointer border-b border-[var(--border-row)] transition-colors hover:bg-[var(--bg-input)]",children:[e.jsxs("td",{className:"w-16 py-3 pr-4 font-mono text-xs font-medium text-[var(--text-secondary)] text-right tabular-nums",children:["#",s.id]}),e.jsx("td",{className:"py-3 pr-4 text-sm text-[var(--text-primary)]",children:e.jsx(Ne,{content:me(s),children:ee(s)})}),e.jsx("td",{className:"py-3 pr-4",children:e.jsx(te,{status:s.status})}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.projectKey}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.developerName??s.creatorName??"-"}),e.jsx("td",{className:"py-3 pr-4 font-mono text-xs text-[var(--text-secondary)]",children:s.workerName??"—"}),e.jsx("td",{className:"py-3 font-mono text-xs text-[var(--text-muted)]",children:e.jsxs("span",{className:"flex items-center gap-2",children:[se(s.createdAt,x),i&&e.jsx("button",{onClick:a=>{a.stopPropagation(),d(`/tasks/${s.id}?action=fork`)},className:"shrink-0 rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] hover:bg-[var(--bg-input)] transition-colors",title:c("tasks.fork_task"),children:e.jsx(re,{className:"h-3 w-3"})})]})})]})});function De({isOpen:n,onClose:s,projects:d,projectsLoading:c,onSubmit:x,isSubmitting:i}){const{t:a}=$();ue(o=>o.user);const b=he(),[p,K]=r.useState(""),[h,B]=r.useState(""),[m,I]=r.useState("feat"),[k,C]=r.useState(""),[w,S]=r.useState(""),[f,_]=r.useState(""),[g,y]=r.useState(""),[T,O]=r.useState(""),[M,R]=r.useState([]),[z,N]=r.useState(""),j=d.find(o=>o.key===p),H=Ce(o=>o,j==null?void 0:j.agentType);r.useEffect(()=>{if(!n||(K(""),B(""),I("feat"),C(""),S(""),_(""),y(""),O(""),N(""),!b))return;const o=new AbortController;return P.get("admin/developers",{signal:o.signal}).json().then(R).catch(()=>{}),()=>o.abort()},[n,b]),r.useEffect(()=>{if(!n)return;function o(D){D.key==="Escape"&&s()}return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n,s]);async function E(o){if(o.preventDefault(),N(""),!p||!h.trim()){N(a("tasks.project_and_description_required"));return}try{await x({projectKey:p,description:h.trim(),workerId:g||void 0,developerId:T?Number(T):void 0,taskType:m,branchSlug:w.trim()||void 0,agentType:k||void 0,targetBranch:f.trim()||void 0})}catch(D){const L=D instanceof Error?D.message:a("tasks.failed_to_create_task");N(L)}}return n?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 font-mono",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&s()},children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",onClick:o=>o.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-6 py-4",children:[e.jsxs("h2",{className:"text-sm text-[var(--text-primary)]",children:["// ",a("tasks.new_task")]}),e.jsx("button",{onClick:s,className:"text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(be,{className:"h-4 w-4"})})]}),e.jsxs("form",{onSubmit:E,className:"px-6 py-5",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.project")}),e.jsx(A,{value:p,onChange:K,options:d.map(o=>({value:o.key,label:o.name})),placeholder:a(c?"common.loading":"tasks.select_project"),disabled:c})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_type")}),e.jsx(A,{value:m,onChange:I,options:ke})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.form_agent_type")}),e.jsx(A,{value:k,onChange:C,options:H})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.task_description")}),e.jsx("textarea",{value:h,onChange:o=>B(o.target.value),placeholder:a("tasks.describe_task_placeholder"),rows:4,className:"w-full resize-none rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_worker")}),e.jsx("input",{type:"text",value:g,onChange:o=>y(o.target.value),placeholder:a("tasks.any_able"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.branch_slug")}),e.jsx("input",{type:"text",value:w,onChange:o=>S(o.target.value),placeholder:a("tasks.branch_slug_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.target_branch")}),e.jsx("input",{type:"text",value:f,onChange:o=>_(o.target.value),placeholder:a("tasks.target_branch_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),b&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:a("tasks.assign_developer")}),e.jsx(A,{value:T,onChange:O,options:M.map(o=>({value:String(o.id),label:o.name})),placeholder:a("tasks.select_developer")})]}),z&&e.jsx("div",{className:"rounded-[4px] bg-[#2a1515] border border-[var(--destructive)]/30 px-3 py-2 text-xs text-[var(--destructive)]",children:z})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:s,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] transition-colors hover:text-[var(--text-primary)]",children:a("common.cancel")}),e.jsx("button",{type:"submit",disabled:i||!p||!h.trim(),className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs text-black transition-opacity hover:opacity-90 disabled:opacity-40",children:a(i?"common.creating":"tasks.create_task")})]})]})]})}):null}function Fe({isOpen:n,onClose:s,onForceCreate:d,onViewExisting:c,similarTask:x,isLoading:i}){const{t:a}=$();return!x||!n?null:e.jsx("div",{onClick:s,style:{position:"fixed",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},children:e.jsxs("div",{onClick:b=>b.stopPropagation(),style:{width:"100%",maxWidth:"480px",backgroundColor:"var(--bg-card)",border:"1px solid var(--border)",borderRadius:"4px",padding:"1.5rem",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{style:{marginBottom:"1.25rem"},children:[e.jsxs("div",{style:{color:"var(--accent)",fontSize:"0.875rem",fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx(we,{style:{width:"1rem",height:"1rem"}}),a("tasks.dedup_title")]}),e.jsx("div",{style:{color:"var(--text-muted)",fontSize:"0.7rem",marginTop:"0.25rem"},children:a("tasks.dedup_description")})]}),e.jsxs("div",{style:{marginBottom:"1.25rem",padding:"0.75rem",border:"1px solid var(--border)",borderRadius:"4px",backgroundColor:"var(--bg-primary)"},children:[e.jsxs("div",{style:{color:"var(--text-muted)",fontSize:"0.65rem",fontFamily:"'JetBrains Mono', monospace"},children:["#",x.id," · ",x.status]}),e.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.75rem",marginTop:"0.375rem",lineHeight:"1.5"},children:x.description})]}),e.jsxs("div",{style:{display:"flex",gap:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:s,disabled:i,className:"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:border-[var(--text-muted)]",style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1,transition:"color 0.15s, border-color 0.15s"},children:a("common.cancel")}),e.jsx("button",{type:"button",onClick:()=>c(x.id),style:{flex:1,padding:"0.5rem",backgroundColor:"transparent",color:"var(--text-muted)",border:"1px solid var(--border)",borderRadius:"4px",fontSize:"0.75rem",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},children:a("tasks.view_existing")}),e.jsx("button",{type:"button",onClick:d,disabled:i,style:{flex:1,padding:"0.5rem",backgroundColor:"var(--warning)",color:"#0C0C0C",border:"none",borderRadius:"4px",fontSize:"0.75rem",fontWeight:600,fontFamily:"'JetBrains Mono', monospace",cursor:i?"not-allowed":"pointer",opacity:i?.7:1},children:a(i?"common.creating":"tasks.dedup_create_anyway")})]})]})})}function Pe({task:n}){const s=J(),d=n.status===u.COMPLETED||n.status===u.FAILED||n.status===u.CANCELLED;return e.jsxs("div",{onClick:()=>s(`/tasks/${n.id}`),className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 transition-colors active:bg-[var(--bg-input)]",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"text-[11px] text-[var(--text-primary)] leading-tight line-clamp-2",title:je(n),children:["#",n.id," ",ee(n)]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[d&&e.jsx("button",{onClick:c=>{c.stopPropagation(),s(`/tasks/${n.id}?action=fork`)},className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",children:e.jsx(re,{className:"h-3 w-3"})}),e.jsx(te,{status:n.status})]})]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:se(n.createdAt)}),e.jsx("span",{children:"·"}),e.jsx("span",{children:n.projectKey}),n.workerName&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:n.workerName})]})]})]})}const Ae=[{key:"all",labelKey:"tasks.tab_all"},{key:u.RUNNING,labelKey:"tasks.tab_running"},{key:u.QUEUED,labelKey:"tasks.tab_queued"},{key:u.COMPLETED,labelKey:"tasks.tab_completed"},{key:u.FAILED,labelKey:"tasks.tab_failed"},{key:u.CANCELLED,labelKey:"tasks.tab_cancelled"}],Ie=20;function Ve(){const n=J(),{t:s}=$(),{tasks:d,loading:c,fetchTasks:x}=X(),i=ve(t=>t.taskSeq),[a,b]=r.useState("all"),[p,K]=r.useState(""),[h,B]=r.useState(""),[m,I]=r.useState(""),[k,C]=r.useState(void 0),[w,S]=r.useState([]),f=X(t=>t.nextCursor),[_,g]=r.useState(!1);fe(r.useMemo(()=>e.jsxs("button",{onClick:()=>g(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[e.jsx(Se,{className:"h-3.5 w-3.5"}),s("tasks.new_task")]}),[s]));const[y,T]=r.useState([]),[O,M]=r.useState(!1),[R,z]=r.useState([]),[N,j]=r.useState(!1),[H,E]=r.useState(!1),[o,D]=r.useState(null),[L,q]=r.useState(null),G=r.useCallback(t=>{const l={limit:String(Ie)};return a!=="all"&&(l.status=a),p&&(l.projectKey=p),h&&(l.developerId=h),t&&(l.cursor=t),l},[a,p,h]);r.useEffect(()=>{x(G(k))},[G,k,x,i]),r.useEffect(()=>{C(void 0),S([])},[a,p,h]),r.useEffect(()=>{let t=!1;return(async()=>{try{const[v,xe]=await Promise.all([P.get("web/projects").json(),P.get("web/projects/-/developers").json()]);if(t)return;T(v),z(xe)}catch{}})(),()=>{t=!0}},[]),r.useEffect(()=>{if(!_||y.length>0)return;M(!0);let t=!1;return(async()=>{try{const v=await P.get("web/projects").json();t||T(v)}catch{}finally{t||M(!1)}})(),()=>{t=!0}},[_,y.length]);const ae=r.useCallback(async t=>{j(!0);try{const l=await P.post("web/tasks",{json:{projectKey:t.projectKey,description:t.description,workerId:t.workerId,developerId:t.developerId,taskType:t.taskType,branchSlug:t.branchSlug,agentType:t.agentType,targetBranch:t.targetBranch}}).json();g(!1),n(`/tasks/${l.task.id}`)}catch(l){if(l instanceof ge&&l.response.status===409){try{const v=await l.response.json();if(v.confirmRequired){D({id:v.confirmRequired.taskId,description:v.confirmRequired.message,status:"active"}),q(t),g(!1),E(!0);return}}catch{}W.error(s("tasks.similar_task_exists"))}else{const v=l instanceof Error?l.message:String(l);W.error(v)}}finally{j(!1)}},[n]),oe=r.useCallback(async()=>{if(L){j(!0);try{const t=await P.post("web/tasks",{json:{...L,force:!0}}).json();E(!1),q(null),n(`/tasks/${t.task.id}`)}finally{j(!1)}}},[L,n]),F=r.useMemo(()=>{if(!m.trim())return d;const t=m.toLowerCase();return d.filter(l=>(l.name??"").toLowerCase().includes(t)||l.description.toLowerCase().includes(t)||String(l.id).includes(m))},[d,m]),ne=r.useCallback(()=>{f&&(S(t=>[...t,k??""]),C(f))},[f,k]),le=r.useCallback(()=>{S(t=>{if(t.length===0)return t;const l=t.slice(0,-1);return C(t.at(-1)||void 0),l})},[]),ce=w.length+1,ie=r.useMemo(()=>[{value:"",label:s("tasks.filter_project")},...y.map(t=>({value:t.key,label:t.name}))],[y,s]),de=r.useMemo(()=>[{value:"",label:s("tasks.filter_developer")},...R.map(t=>({value:String(t.id),label:t.name}))],[R,s]),Q=s(m?"tasks.try_adjusting_search":"tasks.create_first_task"),U=m?void 0:e.jsx("button",{onClick:()=>g(!0),className:"rounded-[4px] bg-[var(--accent)] px-5 py-2 text-[11px] font-bold text-black",children:s("tasks.create_task")});return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 md:gap-4 md:flex-row md:items-center",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 md:pb-0 no-scrollbar pr-4 md:pr-0",children:Ae.map(t=>e.jsx("button",{onClick:()=>b(t.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-10 md:h-8 text-xs transition-colors ${a===t.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:s(t.labelKey)},t.key))}),e.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto md:flex-row md:items-center",children:[e.jsxs("div",{className:"relative md:w-52",children:[e.jsx(ye,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:s("tasks.search_tasks"),value:m,onChange:t=>I(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"}),m&&e.jsx("button",{onClick:()=>I(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:"x"})]}),e.jsx(A,{value:p,onChange:K,options:ie,className:"md:w-40"}),e.jsx(A,{value:h,onChange:B,options:de,className:"md:w-40"})]})]}),e.jsx("div",{className:"hidden md:block rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:e.jsxs("table",{className:"w-full text-left",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[e.jsx("th",{className:"w-16 px-4 py-2.5 text-right",children:s("tasks.id")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.description_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.status_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.project_col")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.assignee")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.worker")}),e.jsx("th",{className:"px-4 py-2.5",children:s("tasks.time")})]})}),e.jsxs("tbody",{children:[c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Z,{rows:5})})}),!c&&F.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:"p-4",children:e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U})})}),F.map(t=>e.jsx(Ee,{task:t},t.id))]})]})}),e.jsxs("div",{className:"flex flex-col gap-2 md:hidden",children:[c&&F.length===0&&e.jsx("div",{className:"p-4",children:e.jsx(Z,{rows:5})}),!c&&F.length===0&&e.jsx(Y,{icon:V,title:s("tasks.no_tasks_found"),description:Q,action:U}),F.map(t=>e.jsx(Pe,{task:t},t.id))]}),(w.length>0||f)&&e.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["// page ",ce]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:le,disabled:w.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[e.jsx(_e,{className:"h-3.5 w-3.5"}),s("tasks.prev")]}),e.jsxs("button",{onClick:ne,disabled:!f,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",children:[s("common.next"),e.jsx(Te,{className:"h-3.5 w-3.5"})]})]})]}),e.jsx(De,{isOpen:_,onClose:()=>g(!1),projects:y,projectsLoading:O,onSubmit:ae,isSubmitting:N}),e.jsx(Fe,{isOpen:H,onClose:()=>{E(!1),q(null)},onForceCreate:oe,onViewExisting:t=>{E(!1),q(null),n(`/tasks/${t}`)},similarTask:o,isLoading:N})]})}export{Ve as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{c as Z,o as ce,h as A,p as N,a as M,r as c,k as z,q as oe,s as le,j as e,X as ee,v as de,f as xe,l as me,m as ue}from"./index-BnZa648g.js";import{g as te,M as pe,C as he}from"./MobileTerminalShell-DvdSW-sx.js";import{T as q,u as fe,a as G,g as ve}from"./task-constants-DVi4wVyB.js";import{i as J,O as se}from"./OnboardingGuide-BqdyHxJS.js";import{S as C,C as ge}from"./Select-CatoaxSD.js";import{a as ae}from"./status-colors-CJELOkpG.js";import{a as be}from"./date-RFA7-ZGs.js";import{g as je}from"./agent-type-options-SYUwiixD.js";import{u as ne}from"./useFetch-BHc-EDVT.js";import{P as $}from"./plus-DtE-5ICU.js";import{W as ke}from"./wifi-CknEzeaW.js";import"./loader-circle-_p8GERRD.js";import"./rotate-ccw-DTMgDeUz.js";import"./chevron-right-CdPoqMfX.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 ye=Z("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
7
|
-
* @license lucide-react v0.469.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const Ne=Z("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),re="overlord_home_terminal";function Te(){try{const t=localStorage.getItem(re);if(t)return JSON.parse(t)}catch{}return{pinnedTaskIds:[],activeTaskId:null}}let Q="";function R(t){const n=JSON.stringify(t);n!==Q&&(Q=n,localStorage.setItem(re,n))}const V=Te(),we=new Set([N.QUEUED,N.ASSIGNED,N.RUNNING,N.SUSPENDED]);let B=!1;const Se=ce((t,n)=>({pinnedTaskIds:V.pinnedTaskIds,activeTaskId:V.activeTaskId,taskMetas:{},stageConfirm:null,loading:!1,setActiveTask:s=>{t({activeTaskId:s}),R({pinnedTaskIds:n().pinnedTaskIds,activeTaskId:s})},pinTask:s=>{const{pinnedTaskIds:a}=n();if(a.includes(s))return;const o=[...a,s];t({pinnedTaskIds:o}),R({pinnedTaskIds:o,activeTaskId:n().activeTaskId})},unpinTask:s=>{const{pinnedTaskIds:a,activeTaskId:o,taskMetas:m}=n(),r=a.filter(f=>f!==s),d=o===s?r[0]??null:o,{[s]:p,...i}=m;t({pinnedTaskIds:r,activeTaskId:d,taskMetas:i}),R({pinnedTaskIds:r,activeTaskId:d})},loadActiveTasks:async()=>{if(!B){B=!0,t({loading:!0});try{const a=(await A.get("web/tasks",{searchParams:{limit:"30"}}).json()).data.filter(i=>we.has(i.status)),o={};for(const i of a)o[i.id]={id:i.id,name:i.name,description:i.description,status:i.status,projectKey:i.projectKey,workerName:i.workerName??null,agentType:te(i),currentStage:i.currentStage,currentSessionId:i.currentSessionId,updatedAt:i.updatedAt};const r=[...a].sort((i,f)=>f.updatedAt.localeCompare(i.updatedAt)).map(i=>i.id),{activeTaskId:d}=n(),p=d&&r.includes(d)?d:r[0]??null;t({taskMetas:o,pinnedTaskIds:r,activeTaskId:p}),R({pinnedTaskIds:r,activeTaskId:p})}catch{}finally{B=!1,t({loading:!1})}}},fetchStageConfirm:async s=>{try{const a=await A.get(`web/tasks/${s}/pending-confirm`).json();t({stageConfirm:a.confirm})}catch{t({stageConfirm:null})}},clearStageConfirm:()=>t({stageConfirm:null}),updateTaskMeta:(s,a)=>{const{taskMetas:o}=n(),m=o[s];m&&t({taskMetas:{...o,[s]:{...m,...a}}})}}));function Ce(){const[t,n]=c.useState(()=>J());c.useEffect(()=>{const a=()=>n(!0),o=()=>n(J());return window.addEventListener("onboarding-dismissed",a),window.addEventListener("storage",o),()=>{window.removeEventListener("onboarding-dismissed",a),window.removeEventListener("storage",o)}},[]);const{data:s}=ne(()=>t?Promise.resolve(null):A.get("web/dashboard/stats").json(),[t]);return t||!s?null:{activeTasks:(s.active_tasks??0)+(s.queued_tasks??0),totalWorkers:s.online_workers??0,totalProjects:s.project_count??0,totalDevelopers:s.developer_count??0}}function _e({taskId:t,confirm:n,onSubmitted:s}){const{t:a}=M(),[o,m]=c.useState(n.timeout),[r,d]=c.useState(!1);c.useEffect(()=>{m(n.timeout);const i=setInterval(()=>{m(f=>f<=1?(clearInterval(i),0):f-1)},1e3);return()=>clearInterval(i)},[n.timeout,n.stageName]);const p=c.useCallback(async i=>{d(!0);try{await A.post(`web/tasks/${t}/confirm-stage`,{json:{stageName:n.stageName,approved:i}}),s()}catch{}finally{d(!1)}},[t,n.stageName,s]);return e.jsxs("div",{className:"flex items-center justify-between gap-2 border-b-2 border-[var(--warning)] bg-[var(--warning)]/10 px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(he,{className:"h-3.5 w-3.5 shrink-0 text-[var(--warning)]"}),e.jsxs("span",{className:"truncate text-xs text-[var(--text-primary)]",children:["// stage: ",n.stageName]}),e.jsx("span",{className:"shrink-0 text-xs text-[var(--warning)]",children:be(o)})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("button",{onClick:()=>p(!1),disabled:r,className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors disabled:opacity-50",children:a("tasks.reject")}),e.jsx("button",{onClick:()=>p(!0),disabled:r,className:"rounded-[4px] bg-[var(--accent)] px-2 py-1 text-[11px] text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:a(r?"tasks.stage_submitting":"tasks.confirm_and_proceed")})]})]})}function Ie({projectKey:t,onProjectChange:n,onCreated:s}){const{t:a}=M(),o=fe(x=>x.createTask),[m,r]=c.useState(""),[d,p]=c.useState("feat"),[i,f]=c.useState(void 0),[h,_]=c.useState(!1),[I,E]=c.useState(!1),[U,D]=c.useState(!1),{data:T}=ne(()=>A.get("web/projects").json(),[]),g=c.useMemo(()=>{const x=(T??[]).map(F=>({value:F.key,label:F.key}));return[{value:"",label:a("terminal_home.all_projects")},...x]},[T,a]),b=c.useMemo(()=>(T??[]).find(x=>x.key===t)??null,[T,t]),k=c.useMemo(()=>je(x=>x,b==null?void 0:b.agentType),[b==null?void 0:b.agentType]),w=c.useRef(!1);c.useEffect(()=>{if(!w.current){if(t){w.current=!0;return}g.length>1&&(n(g[1].value),w.current=!0)}},[t,g,n]),c.useEffect(()=>{f(void 0)},[t]);const u=i??"",O=c.useCallback(x=>{f(x||void 0)},[]),y=!!t&&!!m.trim();function v(){y&&E(!0)}async function S(){if(E(!1),!!y){_(!0);try{const x=await o({projectKey:t,description:m.trim(),taskType:d,agentType:i||void 0});r(""),s(x.id)}catch{}finally{_(!1)}}}const L=a("terminal_home.confirm_create_message").replace("{taskType}",d).replace("{projectKey}",t).replace("{description}",m.trim()),P="flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-2 py-1.5 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex items-center gap-2 border-b border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:[e.jsx("div",{className:"w-[140px]",children:e.jsx(C,{value:t,onChange:n,options:g,placeholder:a("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(C,{value:d,onChange:p,options:G})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(C,{value:u,onChange:O,options:k,placeholder:a("tasks.form_agent_type"),disabled:h||!t})}),e.jsx("input",{type:"text",value:m,onChange:x=>r(x.target.value),onKeyDown:x=>x.key==="Enter"&&v(),placeholder:a("terminal_home.task_description_placeholder"),className:P,disabled:h}),e.jsxs("button",{onClick:v,disabled:h||!y,className:"flex items-center gap-1 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:[e.jsx($,{className:"h-3 w-3"}),a(h?"common.creating":"terminal_home.new_task")]})]}),e.jsx("div",{className:"md:hidden border-b border-[var(--border)] bg-[var(--bg-card)]",children:U?e.jsxs("div",{className:"flex flex-col gap-2 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(C,{value:t,onChange:n,options:g,placeholder:a("terminal_home.select_project")})}),e.jsx("div",{className:"w-[100px]",children:e.jsx(C,{value:d,onChange:p,options:G})}),e.jsx("div",{className:"w-[120px]",children:e.jsx(C,{value:u,onChange:O,options:k,placeholder:a("tasks.form_agent_type"),disabled:h||!t})}),e.jsx("button",{onClick:()=>D(!1),className:"p-1 text-[var(--text-muted)]",children:e.jsx(ee,{className:"h-3.5 w-3.5"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:m,onChange:x=>r(x.target.value),onKeyDown:x=>x.key==="Enter"&&v(),placeholder:a("terminal_home.task_description_placeholder"),className:P,disabled:h}),e.jsx("button",{onClick:v,disabled:h||!y,className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:e.jsx($,{className:"h-3 w-3"})})]})]}):e.jsxs("button",{onClick:()=>D(!0),className:"flex w-full items-center justify-center gap-1 py-2 text-xs text-[var(--accent)] hover:opacity-80",children:[e.jsx($,{className:"h-3.5 w-3.5"}),a("terminal_home.new_task")]})}),e.jsx(de,{isOpen:I,onClose:()=>E(!1),onConfirm:S,title:a("terminal_home.confirm_create_title"),message:L,confirmVariant:"accent",confirmLabel:a("terminal_home.new_task"),isLoading:h})]})}function Y({status:t,size:n}){const s=t===N.SUSPENDED,a=ae(t),o=n==="sm"?"h-1.5 w-1.5":"h-2 w-2";return e.jsx("span",{className:`${o} shrink-0 rounded-full ${s?"animate-pulse":""}`,style:{backgroundColor:s?"var(--warning)":a}})}function Ee({tasks:t,activeId:n,onSelect:s,onUnpin:a,children:o}){const m=xe();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden md:flex flex-col border-r border-[var(--border)] bg-[var(--bg-card)] overflow-y-auto",style:{width:200,minWidth:200},children:[e.jsx("div",{className:"border-b border-[var(--border)] px-3 py-2",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"// active tasks"})}),t.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):e.jsx("div",{className:"flex-1",children:t.map(r=>{const d=r.id===n;return e.jsxs("div",{onClick:()=>s(r.id),className:`group flex items-center gap-2 px-3 py-2 cursor-pointer transition-colors ${d?"bg-[var(--accent)]/10 text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--bg-input)] hover:text-[var(--text-primary)]"}`,children:[e.jsx(Y,{status:r.status,size:"md"}),e.jsxs("div",{className:"flex-1 min-w-0",title:ue(r),children:[e.jsxs("div",{className:"truncate text-xs",children:["#",r.id," ",me(r)]}),e.jsx("div",{className:"text-[10px] text-[var(--text-muted)]",children:r.projectKey})]}),e.jsx("button",{onClick:p=>{p.stopPropagation(),a(r.id)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--text-primary)]",title:"unpin",children:e.jsx(ee,{className:"h-3 w-3"})}),e.jsx("button",{onClick:p=>{p.stopPropagation(),m(`/tasks/${r.id}`)},className:"hidden group-hover:flex items-center justify-center shrink-0 w-5 h-5 text-[var(--text-muted)] hover:text-[var(--accent)]",title:"open detail",children:e.jsx("span",{className:"text-[10px] leading-none",children:"→"})})]},r.id)})})]}),e.jsxs("div",{className:"flex flex-col md:hidden",children:[e.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar border-b border-[var(--border)] bg-[var(--bg-card)] px-2",style:{height:44},children:t.length===0?e.jsx("div",{className:"flex items-center justify-center w-full",children:e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:"no active tasks"})}):t.map(r=>{const d=r.id===n;return e.jsxs("button",{onClick:()=>s(r.id),className:`flex shrink-0 items-center gap-1.5 px-3 border-b-2 transition-colors ${d?"border-[var(--accent)] text-[var(--text-primary)]":"border-transparent text-[var(--text-secondary)]"}`,style:{height:44},children:[e.jsx(Y,{status:r.status,size:"sm"}),e.jsxs("span",{className:"text-[11px] whitespace-nowrap",children:["#",r.id]})]},r.id)})}),o]})]})}function Ae({task:t,takeoverState:n,onTakeover:s,onRelease:a}){const o=ae(t.status),m=ve(t.agentType),r=te(t);return e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:36,minHeight:36},children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:t.projectKey}),e.jsxs("span",{className:"text-[11px]",style:{color:o},children:[t.status.toLowerCase()," / ",m]}),t.currentStage&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"hidden md:inline text-[11px] text-[var(--text-muted)]",children:["// stage: ",t.currentStage]}),e.jsxs("span",{className:"md:hidden text-[11px] text-[var(--text-muted)]",children:["stage: ",t.currentStage]})]}),e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["agent: ",r]}),t.workerName&&e.jsxs("span",{className:"text-[11px] text-[var(--text-muted)]",children:["worker: ",t.workerName]})]}),e.jsx("div",{className:"flex items-center gap-1"})]})}function Me({task:t,ptyStatus:n}){const s=n==="connected";return e.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] bg-[var(--bg-card)] px-3",style:{height:28,minHeight:28},children:[e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:t.currentStage?`stage: ${t.currentStage}`:`task #${t.id}`}),e.jsxs("span",{className:`flex items-center gap-1 text-[10px] ${s?"text-[var(--accent)]":"text-[var(--text-muted)]"}`,children:[s?e.jsx(ke,{className:"h-2.5 w-2.5"}):e.jsx(Ne,{className:"h-2.5 w-2.5"}),s?"connected":n]})]})}function K({onboardingData:t}){const[n,s]=c.useState(!1),{t:a}=M();return t?n?e.jsxs("div",{className:"border-b border-[var(--accent)]/30",children:[e.jsxs("button",{onClick:()=>s(!1),className:"flex w-full items-center justify-between bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:a("onboarding.getting_started")}),e.jsx(ye,{className:"h-3 w-3 text-[var(--text-muted)]"})]}),e.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:e.jsx(se,{data:t})})]}):e.jsxs("button",{onClick:()=>s(!0),className:"flex w-full items-center justify-between border-b border-[var(--accent)]/30 bg-[var(--bg-card)] px-3 py-1.5 transition-colors hover:bg-[var(--bg-input)]",style:{height:36},children:[e.jsx("span",{className:"text-[11px] text-[var(--accent)]",children:a("onboarding.getting_started")}),e.jsx(ge,{className:"h-3 w-3 text-[var(--text-muted)]"})]}):null}function X({onboardingData:t}){const{t:n}=M();return e.jsx("div",{className:`flex flex-1 flex-col items-center p-4 md:p-6 ${t?"overflow-auto":"justify-center"}`,children:t?e.jsx("div",{className:"w-full max-w-lg",children:e.jsx(se,{data:t})}):e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"mb-3 text-3xl text-[var(--border)]",children:[">","_"]}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:n("terminal_home.no_active_tasks")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:n("terminal_home.create_task_hint")})]})})}function Je(){const{t}=M(),{pinnedTaskIds:n,activeTaskId:s,taskMetas:a,stageConfirm:o,loading:m,setActiveTask:r,pinTask:d,unpinTask:p,loadActiveTasks:i,fetchStageConfirm:f,clearStageConfirm:h,updateTaskMeta:_}=Se(),I=c.useRef(null),[E,U]=c.useState("disconnected"),[D,T]=c.useState("auto"),[g,b]=c.useState(""),k=z(l=>l.lastEvent),w=z(l=>l.status),u=s?a[s]??null:null,O=u?q.includes(u.status):!1,y=c.useRef(!1);c.useEffect(()=>{!y.current&&u&&(b(u.projectKey),y.current=!0)},[u]);const v=c.useMemo(()=>{const l=n.map(j=>a[j]).filter(Boolean);return g?l.filter(j=>j.projectKey===g):l},[n,a,g]);c.useEffect(()=>{v.length>0&&s&&!v.some(l=>l.id===s)&&r(v[0].id)},[v,s,r]);const S=Ce();oe(u?le(u):null),c.useEffect(()=>{i()},[i]),c.useEffect(()=>{s&&(u==null?void 0:u.status)===N.SUSPENDED?f(s):h()},[s,u==null?void 0:u.status,f,h]),c.useEffect(()=>{if(k){if(k.event==="task_status_changed"){const{taskId:l,status:j,currentStage:H}=k,W={status:j,updatedAt:new Date().toISOString()};H!==void 0&&(W.currentStage=H),_(l,W),j===N.SUSPENDED&&l===s&&f(l),q.includes(j)&&l===s&&h()}k.event==="task_created"&&i()}},[k,s,f,h,_,i]),c.useEffect(()=>{if(w==="connected")return;const j=setInterval(()=>{document.visibilityState!=="hidden"&&i()},15e3);return()=>clearInterval(j)},[w,i]);const L=c.useCallback(l=>{d(l),r(l),i()},[d,r,i]),P=c.useCallback(()=>{h(),i()},[h,i]),x=c.useCallback(()=>{var l;(l=I.current)==null||l.requestTakeover()},[]),F=c.useCallback(()=>{var l;(l=I.current)==null||l.releaseTakeover()},[]);if(m&&n.length===0)return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t("common.loading")})});const ie=v.length>0;return e.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[e.jsx(Ie,{projectKey:g,onProjectChange:b,onCreated:L}),e.jsx("div",{className:"flex flex-col md:flex-row flex-1 overflow-hidden",children:ie?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{tasks:v,activeId:s,onSelect:r,onUnpin:p,children:e.jsx("div",{className:"md:hidden",children:e.jsx(K,{onboardingData:S})})}),e.jsx("div",{className:"flex flex-1 flex-col overflow-hidden",children:u?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(K,{onboardingData:S})}),e.jsx(Ae,{task:u,takeoverState:D,onTakeover:x,onRelease:F}),o&&s&&e.jsx(_e,{taskId:s,confirm:o,onSubmitted:P}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(pe,{taskId:s,sessionId:u.currentSessionId??void 0,taskFinished:O,onStatusChange:U,onTakeoverChange:T,ref:I},s)}),e.jsx(Me,{task:u,ptyStatus:E})]}):e.jsx(X,{onboardingData:S})})]}):e.jsx(X,{onboardingData:S})})]})}export{Je as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as C,r as n,j as e,h as w,f as M,E as O,$ as k,Z as $,I as T,v as V}from"./index-BnZa648g.js";import{K as E}from"./key-ChevPWu9.js";import{C as S}from"./copy-DNIFSymA.js";import{E as K}from"./external-link-DrZcaziN.js";import{E as P}from"./EmptyState-BrTEmjub.js";import{T as W}from"./Skeleton-CJVHi16l.js";import{u as B}from"./useFetch-BHc-EDVT.js";import{e as R}from"./status-colors-CJELOkpG.js";import{P as J}from"./plus-DtE-5ICU.js";function z({isOpen:a,onClose:y,onCreated:b}){const{t:s}=C(),[r,c]=n.useState(""),[i,d]=n.useState(!1),[l,v]=n.useState("");function h(){c(""),v(""),y()}async function x(){if(v(""),!r.trim()){v(s("admin.pat_label_required"));return}try{d(!0);const o=await w.post("admin/worker-tokens",{json:{label:r.trim()}}).json();c(""),b({token:o.token,id:o.id})}catch(o){const m=o instanceof Error?o.message:s("admin.pat_failed_to_generate");v(m)}finally{d(!1)}}return a?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:o=>{o.target===o.currentTarget&&h()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{maxWidth:"480px",borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:[e.jsx(E,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:s("admin.generate_worker_token_title")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[l&&e.jsx("div",{className:"border border-[var(--destructive)]/30 bg-[var(--destructive)]/10 px-3 py-2 text-xs text-[var(--destructive)]",style:{borderRadius:"4px"},children:l}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.create_one_time_token")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:s("admin.label")}),e.jsx("input",{type:"text",placeholder:s("admin.pat_label_placeholder"),value:r,onChange:o=>c(o.target.value),className:"w-full border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2 text-sm text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:border-[var(--accent)] focus:outline-none",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},onKeyDown:o=>{o.key==="Enter"&&x()}}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:s("admin.label_identifies_worker")})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[e.jsx("button",{onClick:h,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s("common.cancel")}),e.jsx("button",{onClick:x,disabled:i,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80 disabled:opacity-50",style:{borderRadius:"4px",fontFamily:"'JetBrains Mono', monospace"},children:s(i?"admin.generating":"admin.generate")})]})]})}):null}const X=3e3,q=600*1e3;function G({isOpen:a,token:y,tokenId:b,onClose:s}){const{t:r}=C(),[c,i]=n.useState("command"),[d,l]=n.useState(!1),[v,h]=n.useState(!1),[x,o]=n.useState(""),[m,g]=n.useState(null),p=n.useRef(void 0),N=n.useRef(Date.now()),_=M(),j=typeof window<"u"?window.location.origin:"https://overlord.example.com",t=`overlord setup worker --token ${y} --server ${j}`;async function D(){try{await navigator.clipboard.writeText(y),l(!0),setTimeout(()=>l(!1),2e3)}catch{}}async function L(){try{await navigator.clipboard.writeText(t),h(!0),setTimeout(()=>h(!1),2e3)}catch{}}const A=n.useCallback(async()=>{try{const f=await w.get(`admin/worker-tokens/${b}/status`).json();f.status==="used"&&f.worker_name&&(i("success"),o(f.worker_name),g(f.worker_id??null),p.current&&clearInterval(p.current))}catch{}Date.now()-N.current>q&&(i("timeout"),p.current&&clearInterval(p.current))},[b]);function F(){i("waiting"),N.current=Date.now(),p.current=setInterval(A,X)}n.useEffect(()=>()=>{p.current&&clearInterval(p.current)},[]);function I(){s(),m&&_(`/workers/${m}`)}if(!a)return null;const u={fontFamily:"'JetBrains Mono', monospace",borderRadius:"4px"};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backgroundColor:"var(--modal-backdrop, rgba(12,12,12,0.6))"},onClick:f=>{f.target===f.currentTarget&&s()},children:e.jsxs("div",{className:"w-full border border-[var(--border)] bg-[var(--bg-card)]",style:{...u,maxWidth:"480px"},children:[e.jsx("div",{className:"flex items-center gap-2 border-b border-[var(--border)] px-5 py-4",children:c==="success"?e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:r("admin.worker_registered")})]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:r("admin.worker_token_generated")})]})}),e.jsxs("div",{className:"space-y-4 px-5 py-4",children:[c!=="success"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("admin.run_command_desc")}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:"Token"}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsx("code",{className:"block break-all pr-20 text-xs text-[var(--text-primary)]",children:y}),e.jsx("button",{onClick:D,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:d?e.jsx("span",{className:"text-[var(--accent)]",children:r("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"h-3 w-3"})," ",r("common.copy")]})})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[11px] text-[var(--text-muted)]",children:r("admin.setup_command")}),e.jsxs("div",{className:"relative border border-[var(--border)] bg-[var(--bg-card)] p-3",style:{borderRadius:"4px"},children:[e.jsxs("code",{className:"block break-all pr-20 text-xs text-[var(--accent)]",children:["$ ",t]}),e.jsx("button",{onClick:L,className:"absolute right-2 top-2 flex items-center gap-1 border border-[var(--border)] bg-transparent px-2 py-1 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:v?e.jsx("span",{className:"text-[var(--accent)]",children:r("common.copied")}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"h-3 w-3"})," ",r("common.copy")]})})]})]}),e.jsx("div",{className:"border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-yellow-400",style:{borderRadius:"4px"},children:r("admin.token_shown_once")})]}),c==="waiting"&&e.jsxs("div",{className:"flex items-center gap-3 border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-[var(--accent)] border-t-transparent"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:r("admin.waiting_for_worker")})]}),c==="timeout"&&e.jsx("div",{className:"border border-[var(--border)] bg-[var(--bg-card)] px-4 py-3 text-xs text-[var(--text-muted)]",style:{borderRadius:"4px"},children:r("admin.token_not_yet_used")}),c==="success"&&e.jsxs("div",{className:"border border-[var(--accent)]/30 bg-[var(--accent)]/10 px-4 py-3",style:{borderRadius:"4px"},children:[e.jsx("p",{className:"text-xs text-[var(--accent)]",children:r("admin.worker_registered_success")}),e.jsxs("p",{className:"mt-1 text-xs text-[var(--text-primary)]",children:[r("admin.worker"),": ",e.jsx("span",{className:"text-[var(--accent)]",children:x})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-3",children:[c==="command"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),e.jsx("button",{onClick:F,className:"bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:u,children:r("admin.copied_wait_for_worker")})]}),c==="waiting"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("admin.close_worker_can_register")}),c==="timeout"&&e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),c==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:s,className:"border border-[var(--border)] bg-transparent px-4 py-1.5 text-xs text-[var(--text-muted)] transition-colors hover:border-[var(--text-muted)] hover:text-[var(--text-primary)]",style:u,children:r("common.close")}),e.jsxs("button",{onClick:I,className:"flex items-center gap-1.5 bg-[var(--accent)] px-4 py-1.5 text-xs font-medium text-black transition-opacity hover:opacity-80",style:u,children:[e.jsx(K,{className:"h-3 w-3"}),r("admin.view_worker")]})]})]})]})})}function se(){const{t:a}=C(),[y,b]=n.useState(!1),[s,r]=n.useState(null),[c,i]=n.useState(!1),[d,l]=n.useState(null),[v,h]=n.useState(!1),[x,o]=n.useState(!1),{data:m,loading:g,refetch:p}=B(()=>w.get("admin/worker-tokens").json(),[]);async function N(){if(d){h(!0);try{await w.post(`admin/worker-tokens/${d.id}/revoke`),i(!1),l(null),p()}catch{}finally{h(!1)}}}function _(t){b(!1),r(t),p()}const j=n.useMemo(()=>(m??[]).filter(t=>x||t.status!==k.REVOKED),[m,x]);return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.tokens_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.tokens_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>b(!0),children:[e.jsx(J,{className:"h-3.5 w-3.5"}),a("admin.generate_token")]})]}),!g&&(m==null?void 0:m.some(t=>t.status===k.REVOKED))&&e.jsx("div",{className:"mb-4 flex items-center gap-2",children:e.jsx("button",{type:"button",onClick:()=>o(!x),className:`text-xs transition-colors ${x?"text-[var(--text-primary)]":"text-[var(--text-muted)] hover:text-[var(--text-secondary)]"}`,children:a(x?"admin.hide_revoked":"admin.show_revoked")})}),g?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(W,{rows:3})}):j.length===0?e.jsx(P,{icon:$,title:a("admin.no_worker_tokens"),description:a("admin.generate_token_desc"),actionLabel:a("admin.generate_token"),onAction:()=>b(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.label")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.purpose")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("common.created_at")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.expires_at")}),e.jsx("th",{className:"pb-2 font-normal",children:a("common.actions")})]})}),e.jsx("tbody",{children:j.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:t.label}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.purpose}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:R(t.status),children:t.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5 pr-4",children:t.expiresAt?e.jsx("span",{className:"text-[var(--text-secondary)]",children:new Date(t.expiresAt).toLocaleDateString()}):e.jsx("span",{className:"text-[var(--text-muted)]",children:"—"})}),e.jsx("td",{className:"py-2.5",children:t.status===k.ACTIVE&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{l(t),i(!0)},children:[e.jsx(T,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:j.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)] font-medium truncate mr-2",children:t.label}),e.jsx("span",{className:`text-[11px] shrink-0 ${R(t.status)}`,children:t.status})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-secondary)] truncate mb-1",children:t.purpose}),e.jsxs("div",{className:"flex items-center justify-between text-[11px] text-[var(--text-muted)]",children:[e.jsx("span",{children:new Date(t.createdAt).toLocaleDateString()}),t.expiresAt&&e.jsx("span",{children:new Date(t.expiresAt).toLocaleDateString()})]}),t.status===k.ACTIVE&&e.jsx("div",{className:"mt-2 pt-2 border-t border-[var(--border)]",children:e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] px-2 py-1 text-[11px] text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>{l(t),i(!0)},children:[e.jsx(T,{className:"h-3.5 w-3.5"}),a("admin.revoke")]})})]},t.id))})]}),e.jsx(z,{isOpen:y,onClose:()=>b(!1),onCreated:_}),s&&e.jsx(G,{isOpen:!!s,token:s.token,tokenId:s.id,onClose:()=>r(null)}),e.jsx(V,{isOpen:c,onClose:()=>{i(!1),l(null)},onConfirm:N,title:a("admin.revoke_token"),message:a("admin.revoke_token_confirm",{label:(d==null?void 0:d.label)??""}),confirmLabel:a("admin.revoke"),confirmVariant:"danger",isLoading:v})]})}export{se as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as o,f as x,a as i,j as e,E as t}from"./index-BnZa648g.js";import{K as d}from"./key-ChevPWu9.js";import{D as l}from"./download-DLYSP8rX.js";import{S as m}from"./settings-BWLb7GMU.js";import{W as p}from"./wifi-CknEzeaW.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 v=o("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);function k(){const c=x(),{t:r}=i(),n=[{number:1,icon:d,title:r("workers.step_generate_token"),description:r("workers.step_generate_token_desc"),content:e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--accent)] px-3 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)] hover:text-black transition-colors",onClick:()=>c("/admin/tokens"),children:r("workers.go_to_token_management")})},{number:2,icon:l,title:r("workers.step_install_worker"),description:r("workers.step_install_worker_desc"),content:e.jsx("div",{className:"space-y-2",children:e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] overflow-x-auto",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"npm install -g @overlordai/cli @overlordai/worker"]})})},{number:3,icon:m,title:r("workers.step_configure_env"),description:r("workers.step_configure_env_desc"),content:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-[11px] text-[var(--text-muted)]",children:r("workers.setup_wizard_option")}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] overflow-x-auto",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"overlord setup worker"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-[11px] text-[var(--text-muted)]",children:r("workers.manual_config_option")}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] overflow-x-auto space-y-1",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"mkdir -p ~/.overlord-worker"]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"cat > ~/.overlord-worker/.env <<EOF"]}),e.jsx("div",{children:"OVERLORD_HOST=https://overlord.example.com"}),e.jsx("div",{children:"OVERLORD_WORKER_TOKEN=ovw_TOKEN_HERE"}),e.jsx("div",{children:"OVERLORD_WORKER_NAME=my-worker"}),e.jsx("div",{children:"EOF"})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-3 text-xs space-y-1",children:[e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_HOST"})," — ",r("workers.env_host")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_TOKEN"})," — ",r("workers.env_worker_token")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_WORKER_NAME"})," — ",r("workers.env_worker_name")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_WORKSPACE_ROOT"})," — ",r("workers.env_workspace_root")]}),e.jsxs("p",{className:"text-[var(--text-secondary)]",children:[e.jsx("span",{className:"text-[var(--accent)]",children:"OVERLORD_MAX_SLOTS"})," — ",r("workers.env_max_slots")]})]})]})},{number:4,icon:v,title:r("workers.step_start_worker"),description:r("workers.step_start_worker_desc"),content:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:r("workers.start_note_setup_wizard")}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] overflow-x-auto",children:[e.jsx("span",{className:"text-[var(--text-muted)]",children:"$ "}),"overlord start worker"]})]})},{number:5,icon:p,title:r("workers.step_verify_connection"),description:r("workers.step_verify_connection_desc"),content:e.jsxs("div",{className:"flex items-start gap-3 rounded-[4px] border border-green-500/20 bg-green-500/5 p-3",children:[e.jsx(t,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-400"}),e.jsxs("div",{className:"text-xs",children:[e.jsx("p",{className:"text-[var(--text-primary)]",children:r("workers.verify_how_to")}),e.jsxs("ul",{className:"mt-1 list-inside list-disc text-[var(--text-muted)]",children:[e.jsx("li",{children:r("workers.verify_check_workers").split("workers page").map((s,a)=>a===0?e.jsxs("span",{children:[s,e.jsx("button",{type:"button",className:"text-[var(--accent)] underline",onClick:()=>c("/workers"),children:r("workers.title")})]},a):e.jsx("span",{children:s},a))}),e.jsx("li",{children:r("workers.verify_status")}),e.jsx("li",{children:r("workers.verify_capabilities")})]})]})]})}];return e.jsxs("div",{className:"max-w-3xl font-mono px-4 md:px-0",children:[e.jsx("div",{className:"mb-8",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("workers.setup_header_desc")})}),e.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-primary)]",children:r("workers.prerequisites")}),e.jsxs("ul",{className:"space-y-2 text-xs text-[var(--text-muted)]",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(t,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),r("workers.prereq_machine")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(t,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),r("workers.prereq_node")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(t,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),r("workers.prereq_git")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(t,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),r("workers.prereq_network")]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(t,{className:"h-3.5 w-3.5 text-[var(--accent)]"}),r("workers.prereq_token")]})]})]}),e.jsx("div",{className:"space-y-4",children:n.map(s=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[e.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-[4px] bg-[var(--accent)] text-[11px] font-bold text-black",children:s.number}),e.jsx(s.icon,{className:"h-4 w-4 text-[var(--accent)]"}),e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:s.title})]}),e.jsx("p",{className:"mb-3 text-[11px] text-[var(--text-muted)]",children:s.description}),s.content]},s.number))})]})}export{k as default};
|