@overlordai/server 1.0.153 → 1.0.154

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/database/migrations/017-automation-multi-project.sql +21 -0
  2. package/dist/automation/automation-executor.d.ts +1 -1
  3. package/dist/automation/automation-executor.d.ts.map +1 -1
  4. package/dist/automation/automation-executor.js +18 -13
  5. package/dist/automation/automation-executor.js.map +1 -1
  6. package/dist/automation/automation-scheduler.d.ts.map +1 -1
  7. package/dist/automation/automation-scheduler.js +9 -1
  8. package/dist/automation/automation-scheduler.js.map +1 -1
  9. package/dist/automation/automation-trigger.js +3 -3
  10. package/dist/automation/automation-trigger.js.map +1 -1
  11. package/dist/automation/automation.service.d.ts +4 -0
  12. package/dist/automation/automation.service.d.ts.map +1 -1
  13. package/dist/automation/automation.service.js +63 -7
  14. package/dist/automation/automation.service.js.map +1 -1
  15. package/dist/database/repositories/automation.repository.d.ts +7 -2
  16. package/dist/database/repositories/automation.repository.d.ts.map +1 -1
  17. package/dist/database/repositories/automation.repository.js +69 -20
  18. package/dist/database/repositories/automation.repository.js.map +1 -1
  19. package/dist/web/automation.controller.d.ts +4 -0
  20. package/dist/web/automation.controller.d.ts.map +1 -1
  21. package/dist/web/automation.controller.js +54 -21
  22. package/dist/web/automation.controller.js.map +1 -1
  23. package/dist/web/worker-web.controller.d.ts +1 -1
  24. package/dist/web/worker-web.controller.d.ts.map +1 -1
  25. package/dist/web/worker-web.controller.js +15 -5
  26. package/dist/web/worker-web.controller.js.map +1 -1
  27. package/package.json +4 -4
  28. package/public/assets/{AccessTokensPage-DXQ89ukc.js → AccessTokensPage-CYec9jzJ.js} +1 -1
  29. package/public/assets/{AdminPage-CDZmjRV9.js → AdminPage-t2Q3HGBC.js} +1 -1
  30. package/public/assets/{AgentCliPage-DCdxPR6S.js → AgentCliPage-S06CR41h.js} +1 -1
  31. package/public/assets/{ApiReferencePage-C9-X-GKr.js → ApiReferencePage-CsXGBGDf.js} +1 -1
  32. package/public/assets/{ArchitecturePage-Dxlhg0NE.js → ArchitecturePage-1w9WC-ns.js} +1 -1
  33. package/public/assets/{AuditLogPage-DuNMP2Ci.js → AuditLogPage-BtTTQrI0.js} +1 -1
  34. package/public/assets/AutomationCreatePage-B-fTvSAy.js +1 -0
  35. package/public/assets/AutomationDetailPage-vsniJu06.js +16 -0
  36. package/public/assets/AutomationEditPage-Bl_WVim4.js +1 -0
  37. package/public/assets/AutomationListPage-2K5vRQk2.js +26 -0
  38. package/public/assets/{AutomationRunDetailPage-BXDvVmOb.js → AutomationRunDetailPage-41_RxWmD.js} +2 -2
  39. package/public/assets/{BindPlatformPage-D7RqNYXd.js → BindPlatformPage-BElmbysw.js} +1 -1
  40. package/public/assets/{BotIntegrationPage-V8qLGn1k.js → BotIntegrationPage-Dl2aGKqO.js} +1 -1
  41. package/public/assets/{BotManage-BoD4fYJL.js → BotManage-bSKcAFsV.js} +1 -1
  42. package/public/assets/{BotSetupPage-zNoKS7WT.js → BotSetupPage-DNlfGROu.js} +1 -1
  43. package/public/assets/{ChangelogPage-C8vEoFc1.js → ChangelogPage-zcA8kPFS.js} +1 -1
  44. package/public/assets/{CliReferencePage-DI0v_20Z.js → CliReferencePage-M1h0rDfy.js} +1 -1
  45. package/public/assets/{ConfirmStageDialog-BxJrj_E0.js → ConfirmStageDialog-DR4NtMbp.js} +1 -1
  46. package/public/assets/{DeploymentPage-C73PyRve.js → DeploymentPage-C7TLn2zL.js} +1 -1
  47. package/public/assets/{DevWorkflowPage-BePrf4bW.js → DevWorkflowPage-wv-IqCn3.js} +1 -1
  48. package/public/assets/{DeveloperManage-C5hMRVC-.js → DeveloperManage-BSh3_MTP.js} +1 -1
  49. package/public/assets/{DeveloperSetupPage-BgXJyC-s.js → DeveloperSetupPage-CxcWXk1l.js} +1 -1
  50. package/public/assets/{DocsIndexPage-DwasU6WO.js → DocsIndexPage-BaAVze9J.js} +1 -1
  51. package/public/assets/DocsLayout-T_cPcAIl.js +1 -0
  52. package/public/assets/{DocsPrimitives-criaO5pB.js → DocsPrimitives-BCcIgi-N.js} +1 -1
  53. package/public/assets/{EditProjectPage-CukMflPd.js → EditProjectPage-BNzVUbWF.js} +1 -1
  54. package/public/assets/{EmptyState-Cc73hU7f.js → EmptyState-Dtc0ZNRp.js} +1 -1
  55. package/public/assets/{EnvVariablesPage-C2rZQZyt.js → EnvVariablesPage-Bac6hRjE.js} +1 -1
  56. package/public/assets/{HomePage-DW-dLfbp.js → HomePage-BNiekw7A.js} +1 -1
  57. package/public/assets/{InfoRow-DINJ_QV-.js → InfoRow-CzMBBOwd.js} +1 -1
  58. package/public/assets/{InstallationPage-DcmzHz4C.js → InstallationPage-ZVK1CxNV.js} +1 -1
  59. package/public/assets/{LandingPage-CvJzOpWU.js → LandingPage-ChvKFNcy.js} +1 -1
  60. package/public/assets/{LocalDevelopmentPage-GAJID9QZ.js → LocalDevelopmentPage-DO_Je_rS.js} +1 -1
  61. package/public/assets/{LoginPage-BytAnsfi.js → LoginPage-q5n1oi6c.js} +1 -1
  62. package/public/assets/{MetricBar-CbCODU4f.js → MetricBar-8Mx9cJBP.js} +1 -1
  63. package/public/assets/MultiSelect-Bn_OBCgB.js +1 -0
  64. package/public/assets/{NotFoundPage-Bs9yJJwx.js → NotFoundPage-CUbVM9QK.js} +1 -1
  65. package/public/assets/{OnboardingGuide-BIDXqZnr.js → OnboardingGuide-CV4tINbf.js} +1 -1
  66. package/public/assets/{PermissionsPage-wNPxTxmr.js → PermissionsPage-Cu20mTMb.js} +1 -1
  67. package/public/assets/{PipelineConfigPage-BnDPzJ0W.js → PipelineConfigPage-DadkE0Vl.js} +1 -1
  68. package/public/assets/{PipelineEditorPage-iwD-Ildz.js → PipelineEditorPage-CmGr3emr.js} +2 -2
  69. package/public/assets/{PlanPage-Ds--6R8P.js → PlanPage-C9BaQHlG.js} +1 -1
  70. package/public/assets/{ProfilePage-GD0iZnUX.js → ProfilePage-V2QDDDT5.js} +1 -1
  71. package/public/assets/{ProjectDetailPage-1xSyDx2g.js → ProjectDetailPage-BIM5wNdd.js} +1 -1
  72. package/public/assets/{ProjectListPage-DvTwJyL7.js → ProjectListPage-BqJ3sa75.js} +1 -1
  73. package/public/assets/{PtyTerminal-C_XqFPK-.js → PtyTerminal-CDGp4pLP.js} +1 -1
  74. package/public/assets/{QuickAuth-IBPgPMoZ.js → QuickAuth-YzGZf86P.js} +1 -1
  75. package/public/assets/{RemoveMemberConfirmDialog-CnwwKZXG.js → RemoveMemberConfirmDialog-3Zg6POcw.js} +1 -1
  76. package/public/assets/{ReviewAggregatePage-_DXYQ1no.js → ReviewAggregatePage-DZ7vq0na.js} +1 -1
  77. package/public/assets/{ReviewPage-WglnSxck.js → ReviewPage-CuIGtr5J.js} +1 -1
  78. package/public/assets/{Select-BT88kXEc.js → Select-67FOknim.js} +1 -1
  79. package/public/assets/{SettingsPage-Cp13YqMS.js → SettingsPage-DxQyuz8P.js} +1 -1
  80. package/public/assets/{Skeleton-BS77WEat.js → Skeleton-_rq02txk.js} +1 -1
  81. package/public/assets/{SkillPage-DEiBtg-n.js → SkillPage-BZiHfn-H.js} +1 -1
  82. package/public/assets/{TaskDetailPage-CLJm5OHg.js → TaskDetailPage-CUBpkfyo.js} +1 -1
  83. package/public/assets/{TaskGuidePage-UnG822ve.js → TaskGuidePage-hvqiwQod.js} +1 -1
  84. package/public/assets/{TaskListPage-VMLUqQ3z.js → TaskListPage-Bhose57w.js} +1 -1
  85. package/public/assets/{TaskStatusBadge-CPYwuefQ.js → TaskStatusBadge-D4ZTaewH.js} +1 -1
  86. package/public/assets/{TerminalHomePage-BGH7we16.js → TerminalHomePage-BG0HvMTN.js} +1 -1
  87. package/public/assets/{TokenManage-DSZ4PiTn.js → TokenManage-XCYWH63A.js} +1 -1
  88. package/public/assets/Tooltip-BeXBpXMQ.js +1 -0
  89. package/public/assets/{TotpSetupPage-DSXh_OAz.js → TotpSetupPage-DchjCTiK.js} +1 -1
  90. package/public/assets/WorkerDetailPage-DIa8H0Cq.js +1 -0
  91. package/public/assets/{WorkerListPage-tunTyx1T.js → WorkerListPage-C8Or4H2-.js} +1 -1
  92. package/public/assets/{WorkerOperationsPage-Yg4kcw_x.js → WorkerOperationsPage-BSoKQXAz.js} +1 -1
  93. package/public/assets/{WorkerSetupGuidePage-LZUkE-e5.js → WorkerSetupGuidePage-BfVQ3Ua8.js} +1 -1
  94. package/public/assets/{WorkerSetupPage-CG_DzPUH.js → WorkerSetupPage-BndankoD.js} +1 -1
  95. package/public/assets/{agent-type-options-dOssJvy4.js → agent-type-options-ChuePYjM.js} +1 -1
  96. package/public/assets/{arrow-left-CrZE68gW.js → arrow-left-DqjVoydc.js} +1 -1
  97. package/public/assets/{arrow-right-DLRQjlkF.js → arrow-right-CTYUOR48.js} +1 -1
  98. package/public/assets/{bot-DmJpjSOx.js → bot-DIgcjp1L.js} +1 -1
  99. package/public/assets/{chevron-down-y6iszDL7.js → chevron-down-USdSAtLM.js} +1 -1
  100. package/public/assets/{chevron-left-BIWwaWdg.js → chevron-left-DeBK5qpt.js} +1 -1
  101. package/public/assets/{chevron-right-sVVxgXPZ.js → chevron-right-c3y2M4GO.js} +1 -1
  102. package/public/assets/{chevron-up-DeTe83cH.js → chevron-up-DCDYf3Az.js} +1 -1
  103. package/public/assets/{circle-alert-Bfr159qR.js → circle-alert-l_FFcF-_.js} +1 -1
  104. package/public/assets/{clock-YxHW-VuF.js → clock-ey7I11g5.js} +1 -1
  105. package/public/assets/{copy-Bl6iow2q.js → copy-BvsnHVjA.js} +1 -1
  106. package/public/assets/{download-n0G7Q5jK.js → download-BzwPSzep.js} +1 -1
  107. package/public/assets/{external-link-CTyupW5_.js → external-link-ChvrB9MU.js} +1 -1
  108. package/public/assets/{git-fork-BhvPCxDz.js → git-fork-DS0EMsEA.js} +1 -1
  109. package/public/assets/index-Azh1KhiX.css +1 -0
  110. package/public/assets/{index-Cfz24FvS.js → index-Dc7l0IT6.js} +3 -3
  111. package/public/assets/{key-Dxqw3xyk.js → key-D7b87-i1.js} +1 -1
  112. package/public/assets/{loader-circle-DNtX1Uwk.js → loader-circle-CA2KGzXp.js} +1 -1
  113. package/public/assets/{pencil-BKEue5ds.js → pencil-CfrtWF-J.js} +1 -1
  114. package/public/assets/{play-FY1PInKQ.js → play-C_ZVU9H5.js} +1 -1
  115. package/public/assets/{plus-1F0b5FBe.js → plus-g2yZrAF7.js} +1 -1
  116. package/public/assets/{rotate-ccw-a8SG1SHY.js → rotate-ccw-C1EaXve8.js} +1 -1
  117. package/public/assets/{scroll-text-B9RM2NGX.js → scroll-text-CwMw-SJf.js} +1 -1
  118. package/public/assets/{settings-tfOPOdvu.js → settings-CpJIpeUV.js} +1 -1
  119. package/public/assets/{skip-forward-CcZfD8OL.js → skip-forward-BQCBn5yW.js} +1 -1
  120. package/public/assets/{status-colors-qoQt_0Rr.js → status-colors-PFYg7zX9.js} +1 -1
  121. package/public/assets/{task-constants-CfHktCUk.js → task-constants-BtTS5GQt.js} +1 -1
  122. package/public/assets/{task.store-DwFV-Y_Y.js → task.store-2YMrViYj.js} +1 -1
  123. package/public/assets/{timer-zcEdGBAt.js → timer-B7JsdQPs.js} +1 -1
  124. package/public/assets/{trash-2-BLnVFw_Z.js → trash-2-CgnGXyNP.js} +1 -1
  125. package/public/assets/{useFetch-BhpPrPjt.js → useFetch-CM-iw_s7.js} +1 -1
  126. package/public/assets/{users-DtSlwD1_.js → users-Bpg-Dicv.js} +1 -1
  127. package/public/assets/{wifi-jQAtmf0f.js → wifi-2G9hdLVN.js} +1 -1
  128. package/public/assets/{workflow-BAkt--kn.js → workflow-o40bANXK.js} +1 -1
  129. package/public/assets/{zap-Bz-sk9DU.js → zap-YCwvQMOv.js} +1 -1
  130. package/public/index.html +2 -2
  131. package/public/sw.js +1 -1
  132. package/public/assets/AutomationCreatePage-C3WbhMos.js +0 -1
  133. package/public/assets/AutomationDetailPage-CZ4Iuva3.js +0 -16
  134. package/public/assets/AutomationEditPage-CWxADO5Y.js +0 -1
  135. package/public/assets/AutomationListPage-D3Pip2D6.js +0 -26
  136. package/public/assets/DocsLayout-Bhyrvjmw.js +0 -1
  137. package/public/assets/Tooltip-iHcbiLoR.js +0 -1
  138. package/public/assets/WorkerDetailPage-15-wa8JS.js +0 -1
  139. package/public/assets/index-DZ09Mz1K.css +0 -1
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Cfz24FvS.js";/**
1
+ import{c as e}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Cfz24FvS.js";/**
1
+ import{c as e}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-Cfz24FvS.js";/**
1
+ import{c as a}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Cfz24FvS.js";/**
1
+ import{c as o}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Cfz24FvS.js";/**
1
+ import{c as e}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-Cfz24FvS.js";/**
1
+ import{c as t}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-Cfz24FvS.js";/**
1
+ import{c as a}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-Cfz24FvS.js";/**
1
+ import{c as a}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-Cfz24FvS.js";/**
1
+ import{c as o}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{W as r,o as e,aa as s,ab as u,a7 as a}from"./index-Cfz24FvS.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--info)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const o={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return o[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,o as w};
1
+ import{W as r,o as e,aa as s,ab as u,a7 as a}from"./index-Dc7l0IT6.js";const n={[e.QUEUED]:"var(--text-muted)",[e.ASSIGNED]:"#60a5fa",[e.RUNNING]:"var(--accent)",[e.SUSPENDED]:"var(--warning)",[e.COMPLETED]:"var(--info)",[e.FAILED]:"var(--destructive)",[e.CANCELLED]:"var(--text-muted)"};function v(t){return n[t]??"var(--text-muted)"}const o={[r.ONLINE]:"var(--accent)",[r.OFFLINE]:"var(--destructive)",[r.DRAINING]:"var(--warning)",[r.DECOMMISSIONED]:"var(--text-muted)"};function E(t){return o[t]??"var(--text-muted)"}function x(t){switch(t){case s.ACTIVE:return"text-green-400";case s.DISABLED:return"text-red-400";default:return"text-[var(--text-muted)]"}}function S(t){switch(t){case a.ACTIVE:return"text-green-400";case a.USED:return"text-blue-400";case a.REVOKED:return"text-red-400";case a.EXPIRED:return"text-[var(--text-muted)]";default:return"text-[var(--text-muted)]"}}function d(t){switch(t){case u.ACTIVE:return"text-green-400";case"error":return"text-red-400";default:return"text-[var(--text-muted)]"}}function i(t){return t>.8?"var(--destructive)":t>.6?"var(--warning)":"var(--accent)"}export{v as a,i as b,x as c,d,S as e,E as g,n as t,o as w};
@@ -1 +1 @@
1
- import{o as a,O as t}from"./index-Cfz24FvS.js";import{a as l}from"./agent-type-options-dOssJvy4.js";const r=[a.COMPLETED,a.FAILED,a.CANCELLED],E=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],o=l(e=>e);[...o];function c(e){return(e??t.CLAUDE).toLowerCase()}export{r as T,E as a,c as g};
1
+ import{o as a,O as t}from"./index-Dc7l0IT6.js";import{a as l}from"./agent-type-options-ChuePYjM.js";const r=[a.COMPLETED,a.FAILED,a.CANCELLED],E=[{value:"feat",label:"feat"},{value:"fix",label:"fix"},{value:"refactor",label:"refactor"},{value:"docs",label:"docs"},{value:"chore",label:"chore"}],o=l(e=>e);[...o];function c(e){return(e??t.CLAUDE).toLowerCase()}export{r as T,E as a,c as g};
@@ -1 +1 @@
1
- import{n as i,h as c}from"./index-Cfz24FvS.js";const k=i((a,o)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0,fetchTasks:async s=>{const t=o()._fetchTasksAbort;t&&t.abort();const e=new AbortController,n=o()._fetchTasksRequestId+1;a({loading:!0,error:null,_fetchTasksAbort:e,_fetchTasksRequestId:n});try{const r={};s!=null&&s.status&&(r.status=s.status),s!=null&&s.projectKey&&(r.projectKey=s.projectKey),s!=null&&s.developerId&&(r.developerId=s.developerId),s!=null&&s.cursor&&(r.cursor=s.cursor),s!=null&&s.limit&&(r.limit=String(s.limit));const l=await c.get("web/tasks",{searchParams:r,signal:e.signal}).json();if(o()._fetchTasksRequestId!==n)return;a({tasks:l.data,nextCursor:l.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;o()._fetchTasksRequestId===n&&a({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{o()._fetchTasksRequestId===n&&a({loading:!1,_fetchTasksAbort:null})}},fetchTask:async s=>{a({loading:!0,error:null});try{const t=await c.get(`web/tasks/${s}`).json();a({currentTask:t})}catch(t){a({error:t instanceof Error?t.message:"Failed to fetch task"})}finally{a({loading:!1})}},createTask:async s=>{a({error:null});try{const t=await c.post("web/tasks",{json:s}).json();return a(e=>({tasks:[t,...e.tasks]})),t}catch(t){throw a({error:t instanceof Error?t.message:"Failed to create task"}),t}},cancelTask:async s=>{a({error:null});try{await c.post(`web/tasks/${s}/cancel`);const{currentTask:t}=o();(t==null?void 0:t.id)===s&&await o().fetchTask(s)}catch(t){throw a({error:t instanceof Error?t.message:"Failed to cancel task"}),t}},reset:()=>{a({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0})}}));export{k as u};
1
+ import{n as i,h as c}from"./index-Dc7l0IT6.js";const k=i((a,o)=>({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0,fetchTasks:async s=>{const t=o()._fetchTasksAbort;t&&t.abort();const e=new AbortController,n=o()._fetchTasksRequestId+1;a({loading:!0,error:null,_fetchTasksAbort:e,_fetchTasksRequestId:n});try{const r={};s!=null&&s.status&&(r.status=s.status),s!=null&&s.projectKey&&(r.projectKey=s.projectKey),s!=null&&s.developerId&&(r.developerId=s.developerId),s!=null&&s.cursor&&(r.cursor=s.cursor),s!=null&&s.limit&&(r.limit=String(s.limit));const l=await c.get("web/tasks",{searchParams:r,signal:e.signal}).json();if(o()._fetchTasksRequestId!==n)return;a({tasks:l.data,nextCursor:l.nextCursor??null,_fetchTasksAbort:null})}catch(r){if(r instanceof DOMException&&r.name==="AbortError")return;o()._fetchTasksRequestId===n&&a({error:r instanceof Error?r.message:"Failed to fetch tasks"})}finally{o()._fetchTasksRequestId===n&&a({loading:!1,_fetchTasksAbort:null})}},fetchTask:async s=>{a({loading:!0,error:null});try{const t=await c.get(`web/tasks/${s}`).json();a({currentTask:t})}catch(t){a({error:t instanceof Error?t.message:"Failed to fetch task"})}finally{a({loading:!1})}},createTask:async s=>{a({error:null});try{const t=await c.post("web/tasks",{json:s}).json();return a(e=>({tasks:[t,...e.tasks]})),t}catch(t){throw a({error:t instanceof Error?t.message:"Failed to create task"}),t}},cancelTask:async s=>{a({error:null});try{await c.post(`web/tasks/${s}/cancel`);const{currentTask:t}=o();(t==null?void 0:t.id)===s&&await o().fetchTask(s)}catch(t){throw a({error:t instanceof Error?t.message:"Failed to cancel task"}),t}},reset:()=>{a({tasks:[],currentTask:null,loading:!1,error:null,nextCursor:null,_fetchTasksAbort:null,_fetchTasksRequestId:0})}}));export{k as u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Cfz24FvS.js";/**
1
+ import{c as e}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Cfz24FvS.js";/**
1
+ import{c as e}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as e}from"./index-Cfz24FvS.js";function p(s,l){const[i,d]=e.useState(null),[R,a]=e.useState(!0),[m,o]=e.useState(null),f=e.useRef(s);f.current=s;const r=e.useRef(0),t=e.useRef(!0),u=e.useCallback(async()=>{const c=++r.current;a(!0),o(null);try{const n=await f.current();t.current&&c===r.current&&d(n)}catch(n){if(t.current&&c===r.current){const E=n instanceof Error?n.message:"An unexpected error occurred";o(E)}}finally{t.current&&c===r.current&&a(!1)}},l);return e.useEffect(()=>{u()},[u]),e.useEffect(()=>()=>{t.current=!1,r.current+=1},[]),{data:i,loading:R,error:m,refetch:u}}export{p as u};
1
+ import{r as e}from"./index-Dc7l0IT6.js";function p(s,l){const[i,d]=e.useState(null),[R,a]=e.useState(!0),[m,o]=e.useState(null),f=e.useRef(s);f.current=s;const r=e.useRef(0),t=e.useRef(!0),u=e.useCallback(async()=>{const c=++r.current;a(!0),o(null);try{const n=await f.current();t.current&&c===r.current&&d(n)}catch(n){if(t.current&&c===r.current){const E=n instanceof Error?n.message:"An unexpected error occurred";o(E)}}finally{t.current&&c===r.current&&a(!1)}},l);return e.useEffect(()=>{u()},[u]),e.useEffect(()=>()=>{t.current=!1,r.current+=1},[]),{data:i,loading:R,error:m,refetch:u}}export{p as u};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Cfz24FvS.js";/**
1
+ import{c as e}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Cfz24FvS.js";/**
1
+ import{c as e}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-Cfz24FvS.js";/**
1
+ import{c}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-Cfz24FvS.js";/**
1
+ import{c as a}from"./index-Dc7l0IT6.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
package/public/index.html CHANGED
@@ -28,8 +28,8 @@
28
28
  href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
29
29
  rel="stylesheet"
30
30
  />
31
- <script type="module" crossorigin src="/assets/index-Cfz24FvS.js"></script>
32
- <link rel="stylesheet" crossorigin href="/assets/index-DZ09Mz1K.css">
31
+ <script type="module" crossorigin src="/assets/index-Dc7l0IT6.js"></script>
32
+ <link rel="stylesheet" crossorigin href="/assets/index-Azh1KhiX.css">
33
33
  <link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
34
34
  <body>
35
35
  <div id="root"></div>
package/public/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const a=s=>l(s,r),o={module:{uri:r},exports:u,require:a};e[r]=Promise.all(i.map(s=>o[s]||a(s))).then(s=>(n(...s),u))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"b28c64898e79f0d7f49e5423d545e1ec"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"apple-touch-icon-152x152.png",revision:"8cc7ef3bc3aa19c3d8a29a58646d0636"},{url:"apple-touch-icon-120x120.png",revision:"7057fb6fb60df3fcf3cd49883db13be9"},{url:"assets/zap-Bz-sk9DU.js",revision:null},{url:"assets/workflow-BAkt--kn.js",revision:null},{url:"assets/wifi-jQAtmf0f.js",revision:null},{url:"assets/users-DtSlwD1_.js",revision:null},{url:"assets/useFetch-BhpPrPjt.js",revision:null},{url:"assets/trash-2-BLnVFw_Z.js",revision:null},{url:"assets/timer-zcEdGBAt.js",revision:null},{url:"assets/task.store-DwFV-Y_Y.js",revision:null},{url:"assets/task-constants-CfHktCUk.js",revision:null},{url:"assets/status-colors-qoQt_0Rr.js",revision:null},{url:"assets/skip-forward-CcZfD8OL.js",revision:null},{url:"assets/settings-tfOPOdvu.js",revision:null},{url:"assets/scroll-text-B9RM2NGX.js",revision:null},{url:"assets/rotate-ccw-a8SG1SHY.js",revision:null},{url:"assets/plus-1F0b5FBe.js",revision:null},{url:"assets/play-FY1PInKQ.js",revision:null},{url:"assets/pencil-BKEue5ds.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-DNtX1Uwk.js",revision:null},{url:"assets/key-Dxqw3xyk.js",revision:null},{url:"assets/index-DZ09Mz1K.css",revision:null},{url:"assets/index-Cfz24FvS.js",revision:null},{url:"assets/git-fork-BhvPCxDz.js",revision:null},{url:"assets/external-link-CTyupW5_.js",revision:null},{url:"assets/download-n0G7Q5jK.js",revision:null},{url:"assets/date-CmcdoD87.js",revision:null},{url:"assets/copy-Bl6iow2q.js",revision:null},{url:"assets/clock-YxHW-VuF.js",revision:null},{url:"assets/circle-alert-Bfr159qR.js",revision:null},{url:"assets/chevron-up-DeTe83cH.js",revision:null},{url:"assets/chevron-right-sVVxgXPZ.js",revision:null},{url:"assets/chevron-left-BIWwaWdg.js",revision:null},{url:"assets/chevron-down-y6iszDL7.js",revision:null},{url:"assets/bot-DmJpjSOx.js",revision:null},{url:"assets/arrow-right-DLRQjlkF.js",revision:null},{url:"assets/arrow-left-CrZE68gW.js",revision:null},{url:"assets/agent-type-options-dOssJvy4.js",revision:null},{url:"assets/WorkerSetupPage-CG_DzPUH.js",revision:null},{url:"assets/WorkerSetupGuidePage-LZUkE-e5.js",revision:null},{url:"assets/WorkerOperationsPage-Yg4kcw_x.js",revision:null},{url:"assets/WorkerListPage-tunTyx1T.js",revision:null},{url:"assets/WorkerDetailPage-15-wa8JS.js",revision:null},{url:"assets/TotpSetupPage-DSXh_OAz.js",revision:null},{url:"assets/Tooltip-iHcbiLoR.js",revision:null},{url:"assets/TokenManage-DSZ4PiTn.js",revision:null},{url:"assets/TerminalHomePage-BGH7we16.js",revision:null},{url:"assets/TaskStatusBadge-CPYwuefQ.js",revision:null},{url:"assets/TaskListPage-VMLUqQ3z.js",revision:null},{url:"assets/TaskGuidePage-UnG822ve.js",revision:null},{url:"assets/TaskDetailPage-CLJm5OHg.js",revision:null},{url:"assets/SkillPage-DEiBtg-n.js",revision:null},{url:"assets/Skeleton-BS77WEat.js",revision:null},{url:"assets/SettingsPage-Cp13YqMS.js",revision:null},{url:"assets/Select-BT88kXEc.js",revision:null},{url:"assets/ReviewPage-WglnSxck.js",revision:null},{url:"assets/ReviewAggregatePage-_DXYQ1no.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-CnwwKZXG.js",revision:null},{url:"assets/QuickAuth-IBPgPMoZ.js",revision:null},{url:"assets/PtyTerminal-C_XqFPK-.js",revision:null},{url:"assets/PtyTerminal-6GBZ9nXN.css",revision:null},{url:"assets/ProjectListPage-DvTwJyL7.js",revision:null},{url:"assets/ProjectDetailPage-1xSyDx2g.js",revision:null},{url:"assets/ProfilePage-GD0iZnUX.js",revision:null},{url:"assets/PlanPage-Ds--6R8P.js",revision:null},{url:"assets/PipelineEditorPage-iwD-Ildz.js",revision:null},{url:"assets/PipelineConfigPage-BnDPzJ0W.js",revision:null},{url:"assets/PermissionsPage-wNPxTxmr.js",revision:null},{url:"assets/OnboardingGuide-BIDXqZnr.js",revision:null},{url:"assets/NotFoundPage-Bs9yJJwx.js",revision:null},{url:"assets/MetricBar-CbCODU4f.js",revision:null},{url:"assets/LoginPage-BytAnsfi.js",revision:null},{url:"assets/LocalDevelopmentPage-GAJID9QZ.js",revision:null},{url:"assets/LandingPage-CvJzOpWU.js",revision:null},{url:"assets/InstallationPage-DcmzHz4C.js",revision:null},{url:"assets/InfoRow-DINJ_QV-.js",revision:null},{url:"assets/HomePage-DW-dLfbp.js",revision:null},{url:"assets/EnvVariablesPage-C2rZQZyt.js",revision:null},{url:"assets/EmptyState-Cc73hU7f.js",revision:null},{url:"assets/EditProjectPage-CukMflPd.js",revision:null},{url:"assets/DocsPrimitives-criaO5pB.js",revision:null},{url:"assets/DocsLayout-Bhyrvjmw.js",revision:null},{url:"assets/DocsIndexPage-DwasU6WO.js",revision:null},{url:"assets/DeveloperSetupPage-BgXJyC-s.js",revision:null},{url:"assets/DeveloperManage-C5hMRVC-.js",revision:null},{url:"assets/DevWorkflowPage-BePrf4bW.js",revision:null},{url:"assets/DeploymentPage-C73PyRve.js",revision:null},{url:"assets/ConfirmStageDialog-BxJrj_E0.js",revision:null},{url:"assets/CliReferencePage-DI0v_20Z.js",revision:null},{url:"assets/ChangelogPage-C8vEoFc1.js",revision:null},{url:"assets/BotSetupPage-zNoKS7WT.js",revision:null},{url:"assets/BotManage-BoD4fYJL.js",revision:null},{url:"assets/BotIntegrationPage-V8qLGn1k.js",revision:null},{url:"assets/BindPlatformPage-D7RqNYXd.js",revision:null},{url:"assets/AutomationRunDetailPage-BXDvVmOb.js",revision:null},{url:"assets/AutomationListPage-D3Pip2D6.js",revision:null},{url:"assets/AutomationEditPage-CWxADO5Y.js",revision:null},{url:"assets/AutomationDetailPage-CZ4Iuva3.js",revision:null},{url:"assets/AutomationCreatePage-C3WbhMos.js",revision:null},{url:"assets/AuditLogPage-DuNMP2Ci.js",revision:null},{url:"assets/ArchitecturePage-Dxlhg0NE.js",revision:null},{url:"assets/ApiReferencePage-C9-X-GKr.js",revision:null},{url:"assets/AgentCliPage-DCdxPR6S.js",revision:null},{url:"assets/AdminPage-CDZmjRV9.js",revision:null},{url:"assets/AccessTokensPage-DXQ89ukc.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"manifest.webmanifest",revision:"e3100788a89f54481dbd663d57df57a6"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"))),s.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new s.CacheFirst({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),s.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new s.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new s.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3})]}),"GET")});
1
+ if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let a={};const u=s=>l(s,r),o={module:{uri:r},exports:a,require:u};e[r]=Promise.all(i.map(s=>o[s]||u(s))).then(s=>(n(...s),a))}}define(["./workbox-6e9b121d"],function(s){"use strict";self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"og-image.png",revision:"f1563b4bdc7d1a4ab0aef864b0c2294e"},{url:"index.html",revision:"5232b7cd6f110e1d76b044627f9b923e"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"apple-touch-icon-152x152.png",revision:"8cc7ef3bc3aa19c3d8a29a58646d0636"},{url:"apple-touch-icon-120x120.png",revision:"7057fb6fb60df3fcf3cd49883db13be9"},{url:"assets/zap-YCwvQMOv.js",revision:null},{url:"assets/workflow-o40bANXK.js",revision:null},{url:"assets/wifi-2G9hdLVN.js",revision:null},{url:"assets/users-Bpg-Dicv.js",revision:null},{url:"assets/useFetch-CM-iw_s7.js",revision:null},{url:"assets/trash-2-CgnGXyNP.js",revision:null},{url:"assets/timer-B7JsdQPs.js",revision:null},{url:"assets/task.store-2YMrViYj.js",revision:null},{url:"assets/task-constants-BtTS5GQt.js",revision:null},{url:"assets/status-colors-PFYg7zX9.js",revision:null},{url:"assets/skip-forward-BQCBn5yW.js",revision:null},{url:"assets/settings-CpJIpeUV.js",revision:null},{url:"assets/scroll-text-CwMw-SJf.js",revision:null},{url:"assets/rotate-ccw-C1EaXve8.js",revision:null},{url:"assets/plus-g2yZrAF7.js",revision:null},{url:"assets/play-C_ZVU9H5.js",revision:null},{url:"assets/pencil-CfrtWF-J.js",revision:null},{url:"assets/password-CHk45-jw.js",revision:null},{url:"assets/loader-circle-CA2KGzXp.js",revision:null},{url:"assets/key-D7b87-i1.js",revision:null},{url:"assets/index-Dc7l0IT6.js",revision:null},{url:"assets/index-Azh1KhiX.css",revision:null},{url:"assets/git-fork-DS0EMsEA.js",revision:null},{url:"assets/external-link-ChvrB9MU.js",revision:null},{url:"assets/download-BzwPSzep.js",revision:null},{url:"assets/date-CmcdoD87.js",revision:null},{url:"assets/copy-BvsnHVjA.js",revision:null},{url:"assets/clock-ey7I11g5.js",revision:null},{url:"assets/circle-alert-l_FFcF-_.js",revision:null},{url:"assets/chevron-up-DCDYf3Az.js",revision:null},{url:"assets/chevron-right-c3y2M4GO.js",revision:null},{url:"assets/chevron-left-DeBK5qpt.js",revision:null},{url:"assets/chevron-down-USdSAtLM.js",revision:null},{url:"assets/bot-DIgcjp1L.js",revision:null},{url:"assets/arrow-right-CTYUOR48.js",revision:null},{url:"assets/arrow-left-DqjVoydc.js",revision:null},{url:"assets/agent-type-options-ChuePYjM.js",revision:null},{url:"assets/WorkerSetupPage-BndankoD.js",revision:null},{url:"assets/WorkerSetupGuidePage-BfVQ3Ua8.js",revision:null},{url:"assets/WorkerOperationsPage-BSoKQXAz.js",revision:null},{url:"assets/WorkerListPage-C8Or4H2-.js",revision:null},{url:"assets/WorkerDetailPage-DIa8H0Cq.js",revision:null},{url:"assets/TotpSetupPage-DchjCTiK.js",revision:null},{url:"assets/Tooltip-BeXBpXMQ.js",revision:null},{url:"assets/TokenManage-XCYWH63A.js",revision:null},{url:"assets/TerminalHomePage-BG0HvMTN.js",revision:null},{url:"assets/TaskStatusBadge-D4ZTaewH.js",revision:null},{url:"assets/TaskListPage-Bhose57w.js",revision:null},{url:"assets/TaskGuidePage-hvqiwQod.js",revision:null},{url:"assets/TaskDetailPage-CUBpkfyo.js",revision:null},{url:"assets/SkillPage-BZiHfn-H.js",revision:null},{url:"assets/Skeleton-_rq02txk.js",revision:null},{url:"assets/SettingsPage-DxQyuz8P.js",revision:null},{url:"assets/Select-67FOknim.js",revision:null},{url:"assets/ReviewPage-CuIGtr5J.js",revision:null},{url:"assets/ReviewAggregatePage-DZ7vq0na.js",revision:null},{url:"assets/RemoveMemberConfirmDialog-3Zg6POcw.js",revision:null},{url:"assets/QuickAuth-YzGZf86P.js",revision:null},{url:"assets/PtyTerminal-CDGp4pLP.js",revision:null},{url:"assets/PtyTerminal-6GBZ9nXN.css",revision:null},{url:"assets/ProjectListPage-BqJ3sa75.js",revision:null},{url:"assets/ProjectDetailPage-BIM5wNdd.js",revision:null},{url:"assets/ProfilePage-V2QDDDT5.js",revision:null},{url:"assets/PlanPage-C9BaQHlG.js",revision:null},{url:"assets/PipelineEditorPage-CmGr3emr.js",revision:null},{url:"assets/PipelineConfigPage-DadkE0Vl.js",revision:null},{url:"assets/PermissionsPage-Cu20mTMb.js",revision:null},{url:"assets/OnboardingGuide-CV4tINbf.js",revision:null},{url:"assets/NotFoundPage-CUbVM9QK.js",revision:null},{url:"assets/MultiSelect-Bn_OBCgB.js",revision:null},{url:"assets/MetricBar-8Mx9cJBP.js",revision:null},{url:"assets/LoginPage-q5n1oi6c.js",revision:null},{url:"assets/LocalDevelopmentPage-DO_Je_rS.js",revision:null},{url:"assets/LandingPage-ChvKFNcy.js",revision:null},{url:"assets/InstallationPage-ZVK1CxNV.js",revision:null},{url:"assets/InfoRow-CzMBBOwd.js",revision:null},{url:"assets/HomePage-BNiekw7A.js",revision:null},{url:"assets/EnvVariablesPage-Bac6hRjE.js",revision:null},{url:"assets/EmptyState-Dtc0ZNRp.js",revision:null},{url:"assets/EditProjectPage-BNzVUbWF.js",revision:null},{url:"assets/DocsPrimitives-BCcIgi-N.js",revision:null},{url:"assets/DocsLayout-T_cPcAIl.js",revision:null},{url:"assets/DocsIndexPage-BaAVze9J.js",revision:null},{url:"assets/DeveloperSetupPage-CxcWXk1l.js",revision:null},{url:"assets/DeveloperManage-BSh3_MTP.js",revision:null},{url:"assets/DevWorkflowPage-wv-IqCn3.js",revision:null},{url:"assets/DeploymentPage-C7TLn2zL.js",revision:null},{url:"assets/ConfirmStageDialog-DR4NtMbp.js",revision:null},{url:"assets/CliReferencePage-M1h0rDfy.js",revision:null},{url:"assets/ChangelogPage-zcA8kPFS.js",revision:null},{url:"assets/BotSetupPage-DNlfGROu.js",revision:null},{url:"assets/BotManage-bSKcAFsV.js",revision:null},{url:"assets/BotIntegrationPage-Dl2aGKqO.js",revision:null},{url:"assets/BindPlatformPage-BElmbysw.js",revision:null},{url:"assets/AutomationRunDetailPage-41_RxWmD.js",revision:null},{url:"assets/AutomationListPage-2K5vRQk2.js",revision:null},{url:"assets/AutomationEditPage-Bl_WVim4.js",revision:null},{url:"assets/AutomationDetailPage-vsniJu06.js",revision:null},{url:"assets/AutomationCreatePage-B-fTvSAy.js",revision:null},{url:"assets/AuditLogPage-BtTTQrI0.js",revision:null},{url:"assets/ArchitecturePage-1w9WC-ns.js",revision:null},{url:"assets/ApiReferencePage-CsXGBGDf.js",revision:null},{url:"assets/AgentCliPage-S06CR41h.js",revision:null},{url:"assets/AdminPage-t2Q3HGBC.js",revision:null},{url:"assets/AccessTokensPage-CYec9jzJ.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"34c1b155ebc55bee221777f86f4612d8"},{url:"favicon.svg",revision:"e91ea32c7308cc2267ae15a5974a27f8"},{url:"icon-192x192.png",revision:"0bc2b74efb274c01d9eb50f717f4b7cf"},{url:"icon-512x512.png",revision:"74e561c3eb152bbb9cdcb333b5f1f3be"},{url:"icon-maskable-192x192.png",revision:"bf88226fe789dcb35bf89a307d3ba1af"},{url:"icon-maskable-512x512.png",revision:"69ada030d99c4a087bc309c00d716654"},{url:"manifest.webmanifest",revision:"e3100788a89f54481dbd663d57df57a6"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("/index.html"))),s.registerRoute(/^https:\/\/fonts\.googleapis\.com/,new s.CacheFirst({cacheName:"google-fonts-stylesheets",plugins:[]}),"GET"),s.registerRoute(/^https:\/\/fonts\.gstatic\.com/,new s.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new s.ExpirationPlugin({maxEntries:10,maxAgeSeconds:31536e3})]}),"GET")});
@@ -1 +0,0 @@
1
- import{f as J,a as Q,B as W,a0 as T,r,h as X,t as i,j as e}from"./index-Cfz24FvS.js";import{S as p}from"./Select-BT88kXEc.js";import{A as ee}from"./arrow-left-CrZE68gW.js";import"./chevron-down-y6iszDL7.js";const te=[{label:"every_hour",value:"0 * * * *"},{label:"every_6_hours",value:"0 */6 * * *"},{label:"daily_midnight",value:"0 0 * * *"},{label:"daily_9am",value:"0 9 * * *"},{label:"weekly_monday",value:"0 9 * * 1"},{label:"custom",value:""}],ae=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],re=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],oe=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Australia/Sydney"];function se(x){const a=x.trim().split(/\s+/);return a.length===5||a.length===6}function xe(){const x=J(),{t:a}=Q(),[q]=W(),d=q.get("templateId"),{createAutomation:E}=T(),[v,w]=r.useState(""),[y,A]=r.useState(""),[b,B]=r.useState(""),[l,P]=r.useState("cron"),[R,j]=r.useState("0 0 * * *"),[u,_]=r.useState("0 0 * * *"),[N,F]=r.useState("UTC"),[k,M]=r.useState("COMPLETED"),[h,K]=r.useState(""),[f,L]=r.useState(""),[g,$]=r.useState("readonly"),[C,D]=r.useState("claude"),[S,z]=r.useState(!0),[Y,U]=r.useState({}),[V,G]=r.useState([]),[I,O]=r.useState(!1);r.useEffect(()=>{let t=!1;return X.get("web/projects").json().then(c=>{t||G(c)}).catch(()=>{t||i.error(a("automation.failed_load_projects"))}),()=>{t=!0}},[a]),r.useEffect(()=>{if(!d)return;let t=!1;return T.getState().fetchTemplates().then(()=>{if(t)return;const o=T.getState().templates.find(s=>s.id===Number(d));if(o){w(o.name),A(o.taskDescription),P(o.triggerType),$(o.executionMode);const s=o.triggerConfig;if(o.triggerType==="cron"&&s.cron&&(_(s.cron),j(""),s.timezone&&F(s.timezone)),o.triggerType==="task_event"&&s.event){M(s.event);const n=s.filter;n!=null&&n.projectKey&&K(n.projectKey),n!=null&&n.taskMode&&L(n.taskMode)}const m=o.taskConfig;m&&U(m),m!=null&&m.agentType&&D(m.agentType),z(!0)}}),()=>{t=!0}},[d]);const Z=t=>{j(t),t&&_(t)},H=r.useCallback(async()=>{if(!v.trim()){i.error(a("automation.name_required"));return}if(!b){i.error(a("automation.project_required"));return}let t={};if(l==="cron"){if(!u.trim()){i.error(a("automation.cron_expression_required"));return}if(!se(u)){i.error(a("automation.cron_expression_invalid"));return}t={cron:u,timezone:N}}else l==="task_event"&&(t={event:k,filter:{...h&&{projectKey:h},...f&&{taskMode:f}}});O(!0);try{const c=await E({projectKey:b,name:v.trim(),description:y.trim(),triggerType:l,triggerConfig:t,executionMode:g,taskConfig:{...Y,agentType:C},notifyProjectChats:S,...d?{templateId:Number(d)}:{}});i.success(a("automation.automation_created")),x(`/automations/${c.id}`)}catch(c){const o=c instanceof Error?c.message:a("automation.failed_create");i.error(o)}finally{O(!1)}},[v,y,b,l,u,N,k,h,f,g,C,S,d,E,x,a]);return e.jsxs("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>x("/automations"),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(ee,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("automation.create_title")})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-project",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.project")}),e.jsx(p,{value:b,onChange:B,options:V.map(t=>({value:t.key,label:`${t.name} (${t.key})`})),placeholder:a("automation.select_project")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-name",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.name")}),e.jsx("input",{id:"create-name",type:"text",value:v,onChange:t=>w(t.target.value),placeholder:a("automation.name_placeholder"),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)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-description",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.description")}),e.jsx("textarea",{id:"create-description",value:y,onChange:t=>A(t.target.value),rows:4,placeholder:a("automation.description_placeholder"),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.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a("automation.template_vars")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.trigger_type")}),e.jsx("div",{className:"flex gap-2",children:["cron","task_event","manual"].map(t=>e.jsx("button",{onClick:()=>P(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${l===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))})]}),l==="cron"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.cron_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-cron-preset",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.preset")}),e.jsx(p,{value:R,onChange:Z,options:te.map(t=>({value:t.value,label:t.value?`${t.label} (${t.value})`:t.label}))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-cron-expression",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.cron_expression")}),e.jsx("input",{id:"create-cron-expression",type:"text",value:u,onChange:t=>{_(t.target.value),j("")},placeholder:"* * * * *",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs font-mono text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-timezone",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.timezone")}),e.jsx(p,{value:N,onChange:F,options:oe.map(t=>({value:t,label:t}))})]})]}),l==="task_event"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.task_event_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-event-type",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.event_type")}),e.jsx(p,{value:k,onChange:M,options:ae})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-filter-project",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_project_key")}),e.jsx("input",{id:"create-filter-project",type:"text",value:h,onChange:t=>K(t.target.value),placeholder:a("automation.filter_project_key_placeholder"),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)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-filter-mode",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_task_mode")}),e.jsx(p,{value:f,onChange:L,options:[{value:"",label:a("automation.all_modes")},{value:"develop",label:"develop"},{value:"review",label:"review"}]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.execution_mode")}),e.jsx("div",{className:"flex gap-2",children:["readonly","writable"].map(t=>e.jsx("button",{onClick:()=>$(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${g===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a(g==="writable"?"automation.writable_hint":"automation.readonly_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:re.map(t=>e.jsx("button",{onClick:()=>D(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${C===t.value?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t.label},t.value))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs text-[var(--text-primary)] cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:S,onChange:t=>z(t.target.checked),className:"h-3.5 w-3.5 cursor-pointer accent-[var(--accent)]"}),a("automation.notify_project_chats")]}),e.jsx("p",{className:"mt-1 pl-5 text-[10px] text-[var(--text-muted)]",children:a("automation.notify_project_chats_hint")})]}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:H,disabled:I,className:"flex-1 rounded-[4px] bg-[var(--accent)] px-4 py-2.5 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed transition-opacity hover:opacity-90",children:a(I?"automation.creating":"automation.create_automation")}),e.jsx("button",{onClick:()=>x("/automations"),className:"rounded-[4px] border border-[var(--border)] px-4 py-2.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("automation.cancel")})]})]})]})}export{xe as default};
@@ -1,16 +0,0 @@
1
- import{c as p,f as M,a as I,A as S,a0 as $,r as o,a1 as D,p as L,t as i,w as O,j as t,s as F}from"./index-Cfz24FvS.js";import{E as N}from"./EmptyState-Cc73hU7f.js";import{T as q}from"./Skeleton-BS77WEat.js";import{f as k,c as z}from"./date-CmcdoD87.js";import{C as w}from"./clock-YxHW-VuF.js";import{A as G}from"./arrow-left-CrZE68gW.js";import{P as _}from"./play-FY1PInKQ.js";import{T as H}from"./trash-2-BLnVFw_Z.js";import{T as K}from"./timer-zcEdGBAt.js";import{Z as U}from"./zap-Bz-sk9DU.js";import{E as Z}from"./external-link-CTyupW5_.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("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
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 Q=p("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
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 V=p("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);function W(n){switch(n){case"COMPLETED":return"bg-[var(--accent)]";case"RUNNING":return"bg-[var(--accent)]";case"PENDING":return"bg-[var(--warning)]";case"FAILED":return"bg-[var(--destructive)]";case"SKIPPED":return"bg-[#525252]";default:return"bg-[#525252]"}}function ct(){const n=M(),{t:e}=I(),{id:A}=S(),r=Number(A),{currentAutomation:a,loading:C,fetchAutomation:l,enableAutomation:h,disableAutomation:b,triggerAutomation:v,deleteAutomation:g,runs:f,fetchRuns:c,clearRunQuery:j}=$(),[T,y]=o.useState(!1),d=o.useRef(!1);o.useEffect(()=>(l(r),c({automationId:r,limit:20}),()=>{j()}),[r,l,c,j]),o.useEffect(()=>{d.current=!0;const s=D.onStatus(u=>{d.current&&u==="connected"&&c({automationId:r,limit:20})});return()=>{d.current=!1,s()}},[r,c]),L((a==null?void 0:a.name)??null);const P=o.useCallback(async()=>{if(a)try{a.enabled?(await b(a.id),await l(r),i.success(e("automation.automation_disabled"))):(await h(a.id),await l(r),i.success(e("automation.automation_enabled")))}catch{i.error(e("automation.failed_toggle"))}},[a,r,h,b,l,e]),E=o.useCallback(async()=>{try{await v(r),i.success(e("automation.automation_triggered")),c({automationId:r,limit:20})}catch{i.error(e("automation.failed_trigger"))}},[r,v,c,e]),R=o.useCallback(async()=>{try{await g(r),i.success(e("automation.automation_deleted")),n("/automations")}catch{i.error(e("automation.failed_delete"))}},[r,g,n,e]);if(O(null),C&&!a)return t.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:t.jsx(q,{rows:6})});if(!a)return t.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:t.jsx(N,{icon:w,title:e("automation.automation_not_found")})});const x=a.triggerConfig,m=a.taskConfig;return t.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsxs("div",{className:"mb-6 flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:()=>n("/automations"),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:t.jsx(G,{className:"h-4 w-4"})}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a.name}),t.jsx("span",{className:`h-2 w-2 rounded-full ${a.enabled?"bg-[var(--accent)]":"bg-[var(--text-muted)]"}`}),t.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:a.enabled?e("automation.enabled"):e("automation.disabled")})]}),a.description&&t.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] line-clamp-2",title:a.description,children:a.description})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:P,className:`flex items-center gap-1 rounded-[4px] border px-3 py-1.5 text-[11px] transition-colors ${a.enabled?"border-[var(--warning)] text-[var(--warning)] hover:bg-[var(--warning)]/10":"border-[var(--accent)] text-[var(--accent)] hover:bg-[var(--accent)]/10"}`,children:a.enabled?t.jsxs(t.Fragment,{children:[t.jsx(B,{className:"h-3 w-3"})," ",e("automation.disable")]}):t.jsxs(t.Fragment,{children:[t.jsx(Q,{className:"h-3 w-3"})," ",e("automation.enable")]})}),t.jsxs("button",{onClick:()=>n(`/automations/${a.id}/edit`),className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[t.jsx(V,{className:"h-3 w-3"})," ",e("automation.edit")]}),t.jsxs("button",{onClick:E,className:"flex items-center gap-1 rounded-[4px] border border-[var(--accent)] px-3 py-1.5 text-[11px] text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:[t.jsx(_,{className:"h-3 w-3"})," ",e("automation.trigger_now")]}),t.jsxs("button",{onClick:()=>y(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--text-muted)] hover:text-[var(--destructive)] hover:border-[var(--destructive)] transition-colors",children:[t.jsx(H,{className:"h-3 w-3"})," ",e("automation.delete")]})]})]}),t.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:e("automation.configuration")}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.trigger_type")}),t.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-xs text-[var(--text-primary)]",children:[a.triggerType==="cron"&&t.jsx(K,{className:"h-3 w-3"}),a.triggerType==="task_event"&&t.jsx(U,{className:"h-3 w-3"}),a.triggerType==="manual"&&t.jsx(_,{className:"h-3 w-3"}),a.triggerType]})]}),a.triggerType==="cron"&&!!x.cron&&t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.schedule")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:x.cron}),t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:x.timezone??"UTC"})]}),a.triggerType==="task_event"&&!!x.event&&t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.event")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:x.event})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.agent_type")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:(m==null?void 0:m.agentType)??"claude"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.execution_mode")}),t.jsx("span",{className:`mt-0.5 block text-xs ${a.executionMode==="writable"?"text-[var(--warning)]":"text-[var(--text-primary)]"}`,children:a.executionMode})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.notify_project_chats")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:a.notifyProjectChats?e("automation.notify_project_chats_enabled"):e("automation.notify_project_chats_disabled")})]})]}),t.jsxs("div",{className:"mt-3 flex items-center gap-4 text-[10px] text-[var(--text-muted)]",children:[t.jsxs("span",{children:[e("automation.project"),": ",a.projectKey]}),a.lastRunAt&&t.jsx("span",{children:e("automation.last_run",{time:k(a.lastRunAt)})}),a.nextRunAt&&t.jsx("span",{children:e("automation.next_run",{time:z(a.nextRunAt)})})]})]}),t.jsxs("div",{children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:e("automation.run_history")}),f.length===0?t.jsx(N,{icon:w,title:e("automation.no_runs"),compact:!0}):t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:t.jsxs("table",{className:"w-full text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_time")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_status")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_findings")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_task")})]})}),t.jsx("tbody",{children:f.map(s=>t.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border)] last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",onClick:()=>n(`/automations/runs/${s.id}`),children:[t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-primary)]",children:k(s.createdAt)}),t.jsx("td",{className:"px-4 py-2.5",children:t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-[var(--text-primary)]",children:[t.jsx("span",{className:`h-2 w-2 rounded-full ${W(s.status)}`}),s.status.toLowerCase()]})}),t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-muted)]",children:s.hasFindings&&s.findings?`${Array.isArray(s.findings)?s.findings.length:0} finding${Array.isArray(s.findings)&&s.findings.length!==1?"s":""}`:"-"}),t.jsx("td",{className:"px-4 py-2.5",children:s.taskId?t.jsxs("button",{onClick:u=>{u.stopPropagation(),n(`/tasks/${s.taskId}`)},className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:["#",s.taskId,t.jsx(Z,{className:"h-2.5 w-2.5"})]}):t.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"-"})})]},s.id))})]})})]}),t.jsx(F,{isOpen:T,onClose:()=>y(!1),onConfirm:R,title:e("automation.delete_title"),message:e("automation.delete_confirm",{name:a.name}),confirmLabel:e("automation.delete"),confirmVariant:"danger"})]})}export{ct as default};
@@ -1 +0,0 @@
1
- import{f as H,a as J,A as Q,a0 as W,r as o,t as m,j as e}from"./index-Cfz24FvS.js";import{S as h}from"./Select-BT88kXEc.js";import{T as X}from"./Skeleton-BS77WEat.js";import{E as ee}from"./EmptyState-Cc73hU7f.js";import{C as te}from"./clock-YxHW-VuF.js";import{A as ae}from"./arrow-left-CrZE68gW.js";import"./chevron-down-y6iszDL7.js";const O=[{label:"every_hour",value:"0 * * * *"},{label:"every_6_hours",value:"0 */6 * * *"},{label:"daily_midnight",value:"0 0 * * *"},{label:"daily_9am",value:"0 9 * * *"},{label:"weekly_monday",value:"0 9 * * 1"},{label:"custom",value:""}],re=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],oe=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],I=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Asia/Kolkata","Australia/Sydney"];function se(c){const a=c.trim().split(/\s+/);return a.length===5||a.length===6}function ue(){const c=H(),{t:a}=J(),{id:R}=Q(),n=Number(R),{currentAutomation:r,loading:U,fetchAutomation:k,updateAutomation:C}=W(),[u,E]=o.useState(""),[y,T]=o.useState(""),[l,S]=o.useState("cron"),[Y,f]=o.useState(""),[x,g]=o.useState(""),[i,w]=o.useState("UTC"),[j,A]=o.useState("COMPLETED"),[p,P]=o.useState(""),[v,F]=o.useState(""),[b,M]=o.useState("readonly"),[_,L]=o.useState("claude"),[N,$]=o.useState(!1),[z,D]=o.useState(!1),[K,q]=o.useState(!1);o.useEffect(()=>{k(n)},[n,k]),o.useEffect(()=>{if(!r||r.id!==n||K)return;E(r.name),T(r.description),S(r.triggerType),M(r.executionMode);const t=r.triggerConfig;if(r.triggerType==="cron"){const s=t.cron??"";g(s);const G=O.find(Z=>Z.value===s);f(G?s:""),w(t.timezone??"UTC")}if(r.triggerType==="task_event"){A(t.event??"COMPLETED");const s=t.filter;P((s==null?void 0:s.projectKey)??""),F((s==null?void 0:s.taskMode)??"")}const d=r.taskConfig;L((d==null?void 0:d.agentType)??"claude"),$(r.notifyProjectChats),q(!0)},[r,n,K]);const V=t=>{f(t),t&&g(t)},B=o.useCallback(async()=>{if(!u.trim()){m.error(a("automation.name_required"));return}let t={};if(l==="cron"){if(!x.trim()){m.error(a("automation.cron_expression_required"));return}if(!se(x)){m.error(a("automation.cron_expression_invalid"));return}t={cron:x,timezone:i}}else l==="task_event"&&(t={event:j,filter:{...p&&{projectKey:p},...v&&{taskMode:v}}});D(!0);try{await C(n,{name:u.trim(),description:y.trim(),triggerType:l,triggerConfig:t,executionMode:b,taskConfig:{...(r==null?void 0:r.taskConfig)??{},agentType:_},notifyProjectChats:N}),m.success(a("automation.automation_updated")),c(`/automations/${n}`)}catch(d){const s=d instanceof Error?d.message:a("automation.failed_update");m.error(s)}finally{D(!1)}},[u,y,l,x,i,j,p,v,b,_,N,n,C,c,a]);return U&&!r?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(X,{rows:6})}):!r||r.id!==n?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(ee,{icon:te,title:a("automation.automation_not_found")})}):e.jsxs("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>c(`/automations/${n}`),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(ae,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("automation.edit_title")})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-name",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.name")}),e.jsx("input",{id:"edit-name",type:"text",value:u,onChange:t=>E(t.target.value),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)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-description",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.description")}),e.jsx("textarea",{id:"edit-description",value:y,onChange:t=>T(t.target.value),rows:4,placeholder:a("automation.description_placeholder"),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.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a("automation.template_vars")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.trigger_type")}),e.jsx("div",{className:"flex gap-2",children:["cron","task_event","manual"].map(t=>e.jsx("button",{onClick:()=>S(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${l===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))})]}),l==="cron"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.cron_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-cron-preset",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.preset")}),e.jsx(h,{value:Y,onChange:V,options:O.map(t=>({value:t.value,label:`${t.label}${t.value?` (${t.value})`:""}`}))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-cron-expression",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.cron_expression")}),e.jsx("input",{id:"edit-cron-expression",type:"text",value:x,onChange:t=>{g(t.target.value),f("")},placeholder:"* * * * *",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs font-mono text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-timezone",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.timezone")}),e.jsx(h,{value:i,onChange:w,options:[...i&&!I.includes(i)?[{value:i,label:i}]:[],...I.map(t=>({value:t,label:t}))]})]})]}),l==="task_event"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.task_event_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-event-type",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.event_type")}),e.jsx(h,{value:j,onChange:A,options:re})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-filter-project",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_project_key")}),e.jsx("input",{id:"edit-filter-project",type:"text",value:p,onChange:t=>P(t.target.value),placeholder:a("automation.filter_project_key_placeholder"),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)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-filter-mode",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_task_mode")}),e.jsx(h,{value:v,onChange:F,options:[{value:"",label:a("automation.all_modes")},{value:"develop",label:"develop"},{value:"review",label:"review"}]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.execution_mode")}),e.jsx("div",{className:"flex gap-2",children:["readonly","writable"].map(t=>e.jsx("button",{onClick:()=>M(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${b===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a(b==="writable"?"automation.writable_hint":"automation.readonly_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:oe.map(t=>e.jsx("button",{onClick:()=>L(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${_===t.value?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t.label},t.value))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs text-[var(--text-primary)] cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:N,onChange:t=>$(t.target.checked),className:"h-3.5 w-3.5 cursor-pointer accent-[var(--accent)]"}),a("automation.notify_project_chats")]}),e.jsx("p",{className:"mt-1 pl-5 text-[10px] text-[var(--text-muted)]",children:a("automation.notify_project_chats_hint")})]}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:B,disabled:z,className:"flex-1 rounded-[4px] bg-[var(--accent)] px-4 py-2.5 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed transition-opacity hover:opacity-90",children:a(z?"automation.saving":"automation.save_changes")}),e.jsx("button",{onClick:()=>c(`/automations/${n}`),className:"rounded-[4px] border border-[var(--border)] px-4 py-2.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("automation.cancel")})]})]})]})}export{ue as default};
@@ -1,26 +0,0 @@
1
- import{c as S,f as R,a as M,r as l,a0 as T,w as Q,j as e,a1 as Z,a2 as P,a3 as X,a4 as H,t as p,Q as J,F as ee,v as te,h as ae,X as re}from"./index-Cfz24FvS.js";import{E as I}from"./EmptyState-Cc73hU7f.js";import{T as $}from"./Skeleton-BS77WEat.js";import{f as O,d as se}from"./date-CmcdoD87.js";import{S as B}from"./Select-BT88kXEc.js";import{P as ne}from"./plus-1F0b5FBe.js";import{P as oe}from"./play-FY1PInKQ.js";import{Z as ie}from"./zap-Bz-sk9DU.js";import{T as ce}from"./timer-zcEdGBAt.js";import{C as le}from"./clock-YxHW-VuF.js";import{C as de}from"./chevron-right-sVVxgXPZ.js";import"./chevron-down-y6iszDL7.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 xe=S("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
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 q=S("BookDashed",[["path",{d:"M12 17h1.5",key:"1gkc67"}],["path",{d:"M12 22h1.5",key:"1my7sn"}],["path",{d:"M12 2h1.5",key:"19tvb7"}],["path",{d:"M17.5 22H19a1 1 0 0 0 1-1",key:"10akbh"}],["path",{d:"M17.5 2H19a1 1 0 0 1 1 1v1.5",key:"1vrfjs"}],["path",{d:"M20 14v3h-2.5",key:"1naeju"}],["path",{d:"M20 8.5V10",key:"1ctpfu"}],["path",{d:"M4 10V8.5",key:"1o3zg5"}],["path",{d:"M4 19.5V14",key:"ob81pf"}],["path",{d:"M4 4.5A2.5 2.5 0 0 1 6.5 2H8",key:"s8vcyb"}],["path",{d:"M8 22H6.5a1 1 0 0 1 0-5H8",key:"1cu73q"}]]);/**
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 me=S("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
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 ue=S("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
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 pe=S("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);function he({severity:a}){const t={critical:"border-[var(--destructive)] text-[var(--destructive)]",warning:"border-[var(--warning)] text-[var(--warning)]",info:"border-[var(--info)] text-[var(--info)]"};return e.jsx("span",{className:`rounded-[4px] border px-1.5 py-0.5 text-[10px] ${t[a]??"border-[var(--border)] text-[var(--text-muted)]"}`,children:a})}function z({type:a}){const i={cron:ce,task_event:ie,manual:oe}[a]??le;return e.jsxs("span",{className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-1.5 py-0.5 text-[10px] text-[var(--text-muted)]",children:[e.jsx(i,{className:"h-2.5 w-2.5"}),a]})}function V({mode:a}){const t=a==="writable";return e.jsx("span",{className:`rounded-[4px] border px-1.5 py-0.5 text-[10px] ${t?"border-[var(--warning)] text-[var(--warning)]":"border-[var(--border)] text-[var(--text-muted)]"}`,children:a})}function ge(){const a=R(),{t}=M(),{runs:i,loading:o,fetchRuns:d,updateRunStatus:g,batchUpdateRuns:x,clearRunQuery:y}=T(),[s,b]=l.useState(new Set),N=l.useRef(!1);l.useEffect(()=>(d({inboxStatus:"unread",limit:50}),()=>{y()}),[d,y]),l.useEffect(()=>{N.current=!0;const r=Z.onStatus(w=>{N.current&&w==="connected"&&d({inboxStatus:"unread",limit:50})});return()=>{N.current=!1,r()}},[d]);const c=r=>{b(w=>{const f=new Set(w);return f.has(r)?f.delete(r):f.add(r),f})},u=()=>{s.size===i.length?b(new Set):b(new Set(i.map(r=>r.id)))},m=async r=>{try{await g(r,"read"),p.success(t("automation.marked_as_read"))}catch{p.error(t("automation.failed_mark_read"))}},j=async r=>{try{await g(r,"archived"),p.success(t("automation.archived"))}catch{p.error(t("automation.failed_archive"))}},k=async()=>{if(s.size!==0)try{await x(Array.from(s),"read"),b(new Set),p.success(t("automation.marked_n_read",{n:s.size}))}catch{p.error(t("automation.failed_batch_update"))}},v=r=>r.findings&&Array.isArray(r.findings)?r.findings.length:0;if(o&&i.length===0)return e.jsx("div",{className:"p-4",children:e.jsx($,{rows:4})});const A=i.filter(r=>r.inboxStatus==="unread");return A.length===0?e.jsx(I,{icon:ue,title:t("automation.no_unread_findings"),description:t("automation.inbox_description")}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("button",{onClick:u,className:"rounded-[4px] border border-[var(--border)] px-2.5 py-1.5 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:s.size===A.length?t("automation.deselect_all"):t("automation.select_all")}),s.size>0&&e.jsxs("button",{onClick:k,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1.5 text-[11px] text-[var(--text-secondary)] hover:text-[var(--accent)] transition-colors",children:[e.jsx(P,{className:"h-3 w-3"}),t("automation.mark_all_read")," (",s.size,")"]})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:A.map(r=>e.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--border)] px-4 py-3 last:border-b-0",children:[e.jsx("input",{type:"checkbox",checked:s.has(r.id),onChange:()=>c(r.id),className:"h-3.5 w-3.5 shrink-0 accent-[var(--accent)]"}),e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-[var(--accent)]"}),e.jsxs("div",{className:"flex min-w-0 flex-1 cursor-pointer flex-col gap-0.5",onClick:()=>a(`/automations/runs/${r.id}`),children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)] hover:text-[var(--accent)] transition-colors",children:t("automation.run_label",{id:r.id,automationId:r.automationId})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(z,{type:r.triggerType}),r.findings&&Array.isArray(r.findings)&&r.findings.length>0&&e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:v(r)!==1?t("automation.findings_count",{count:v(r)}):t("automation.finding_count",{count:v(r)})}),r.findings&&Array.isArray(r.findings)&&(()=>{const w=new Set(r.findings.map(f=>f.severity));return Array.from(w).map(f=>e.jsx(he,{severity:f},f))})()]})]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:O(r.createdAt)}),e.jsx("button",{onClick:()=>m(r.id),className:"shrink-0 rounded-[4px] p-1.5 text-[var(--text-muted)] hover:text-[var(--accent)] transition-colors",title:t("automation.mark_read"),children:e.jsx(P,{className:"h-3.5 w-3.5"})}),e.jsx("button",{onClick:()=>j(r.id),className:"shrink-0 rounded-[4px] p-1.5 text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",title:t("automation.archive"),children:e.jsx(xe,{className:"h-3.5 w-3.5"})})]},r.id))})]})}function be(){const a=R(),{t}=M(),{automations:i,loading:o,fetchAutomations:d,enableAutomation:g,disableAutomation:x}=T();l.useEffect(()=>{d()},[d]);const y=async s=>{try{s.enabled?(await x(s.id),p.success(t("automation.automation_disabled"))):(await g(s.id),p.success(t("automation.automation_enabled")))}catch{p.error(t("automation.failed_toggle"))}};return o&&i.length===0?e.jsx("div",{className:"p-4",children:e.jsx($,{rows:4})}):i.length===0?e.jsx(I,{icon:X,title:t("automation.no_automations"),description:t("automation.create_first_description"),actionLabel:t("automation.new_automation"),onAction:()=>a("/automations/new")}):e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:i.map(s=>e.jsxs("div",{className:"cursor-pointer rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--accent)]/30",onClick:()=>a(`/automations/${s.id}`),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[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 text-xs font-bold text-[var(--text-primary)]",children:s.name}),e.jsx("span",{className:`h-2 w-2 shrink-0 rounded-full ${s.enabled?"bg-[var(--accent)]":"bg-[var(--text-muted)]"}`})]}),s.description&&e.jsx("p",{className:"mt-1 truncate text-[11px] text-[var(--text-muted)]",children:s.description})]}),e.jsx("button",{type:"button",onClick:b=>{b.stopPropagation(),y(s)},"aria-pressed":s.enabled,className:`relative h-5 w-9 shrink-0 cursor-pointer rounded-full transition-colors focus:outline-none ${s.enabled?"bg-[var(--accent)]":"bg-[var(--border)]"}`,children:e.jsx("span",{className:`absolute top-0.5 left-0.5 h-4 w-4 rounded-full bg-white shadow-sm transition-transform ${s.enabled?"translate-x-4":"translate-x-0"}`})})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[e.jsx(z,{type:s.triggerType}),e.jsx(V,{mode:s.executionMode})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-[10px] text-[var(--text-muted)]",children:[s.lastRunAt&&e.jsx("span",{children:t("automation.last_run",{time:O(s.lastRunAt)})}),s.nextRunAt&&e.jsx("span",{children:t("automation.next_run",{time:se(s.nextRunAt)})}),!s.lastRunAt&&!s.nextRunAt&&e.jsx("span",{children:t("automation.no_runs_yet")})]})]},s.id))})}const U={status_reports:{titleKey:"automation.template_category_status_reports",descriptionKey:"automation.template_category_status_reports_description",icon:ee,order:0,iconClass:"border-sky-500/30 bg-sky-500/10 text-sky-300"},release_prep:{titleKey:"automation.template_category_release_prep",descriptionKey:"automation.template_category_release_prep_description",icon:P,order:1,iconClass:"border-emerald-500/30 bg-emerald-500/10 text-emerald-300"},incidents_triage:{titleKey:"automation.template_category_incidents_triage",descriptionKey:"automation.template_category_incidents_triage_description",icon:J,order:2,iconClass:"border-rose-500/30 bg-rose-500/10 text-rose-300"},code_quality:{titleKey:"automation.template_category_code_quality",descriptionKey:"automation.template_category_code_quality_description",icon:me,order:3,iconClass:"border-amber-500/30 bg-amber-500/10 text-amber-300"},repo_maintenance:{titleKey:"automation.template_category_repo_maintenance",descriptionKey:"automation.template_category_repo_maintenance_description",icon:pe,order:4,iconClass:"border-fuchsia-500/30 bg-fuchsia-500/10 text-fuchsia-300"},growth_exploration:{titleKey:"automation.template_category_growth_exploration",descriptionKey:"automation.template_category_growth_exploration_description",icon:H,order:5,iconClass:"border-violet-500/30 bg-violet-500/10 text-violet-300"},other:{titleKey:"automation.template_category_other",descriptionKey:"automation.template_category_other_description",icon:q,order:99,iconClass:"border-[var(--border)] bg-[var(--bg-input)] text-[var(--text-muted)]"}},ve={standup_summary:0,weekly_engineering_summary:1,weekly_release_notes:2,daily_bug_scan:3},fe=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}];function C(a){return U[a??""]??U.other}function ye(a){const t=C(a.category);return{Icon:t.icon,iconClass:t.iconClass}}function D(a){const t=a.builtinKey!=null?ve[a.builtinKey]??50:50,i=C(a.category).order,o=a.isBuiltin?0:20,d=a.executionMode==="readonly"?0:2;return t+i*5+o+d}function F({template:a,onUse:t,emphasized:i=!1,sourceLabel:o,actionLabel:d}){const{Icon:g,iconClass:x}=ye(a);return e.jsxs("article",{className:`group rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 transition-colors hover:border-[var(--accent)]/30 ${i?"min-h-[220px]":""}`,children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("div",{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-[4px] border ${x}`,children:e.jsx(g,{className:"h-4 w-4"})}),e.jsx("span",{className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[10px] text-[var(--text-muted)]",children:o})]}),e.jsxs("div",{className:"mt-4",children:[e.jsx("h3",{className:"text-sm font-bold text-[var(--text-primary)]",children:a.name}),e.jsx("p",{className:`mt-2 text-xs leading-5 text-[var(--text-secondary)] ${i?"line-clamp-4":"line-clamp-3"}`,children:a.description})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(z,{type:a.triggerType}),e.jsx(V,{mode:a.executionMode})]}),e.jsxs("button",{onClick:()=>t(a.id),className:"mt-5 inline-flex items-center gap-1 text-xs font-bold text-[var(--accent)] transition-colors hover:text-[var(--text-primary)]",children:[d,e.jsx(de,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]})]})}function je(a){const t=a.trim().split(/\s+/);return t.length===5||t.length===6}function _e({template:a,onClose:t,onCreated:i}){const{t:o}=M(),{createAutomation:d}=T(),[g,x]=l.useState([]),[y,s]=l.useState(""),[b,N]=l.useState(""),[c,u]=l.useState("UTC"),[m,j]=l.useState("claude"),[k,v]=l.useState(!0),[A,r]=l.useState(!1),[w,f]=l.useState(!1),[E,L]=l.useState(!1);if(te(!!a),l.useEffect(()=>{if(!a)return;const n=a.triggerConfig??{},h=a.taskConfig??{};s(""),N(typeof n.cron=="string"?n.cron:""),u(typeof n.timezone=="string"?n.timezone:"UTC"),j(typeof h.agentType=="string"?h.agentType:"claude"),v(!0),r(!1),f(!0);let _=!1;return ae.get("web/projects").json().then(K=>{_||(x(K),K.length===1&&(s(K[0].key),j(K[0].agentType)))}).catch(()=>{_||p.error(o("automation.failed_load_projects"))}).finally(()=>{_||f(!1)}),()=>{_=!0}},[a,o]),l.useEffect(()=>{if(!a)return;const n=h=>{h.key==="Escape"&&!E&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[a,t,E]),!a)return null;const Y=n=>{if(s(n),A)return;const h=g.find(_=>_.key===n);h&&j(h.agentType)},G=n=>{j(n),r(!0)},W=async()=>{if(!y){p.error(o("automation.project_required"));return}let n=a.triggerConfig??{};if(a.triggerType==="cron"){if(!b.trim()){p.error(o("automation.cron_expression_required"));return}if(!je(b)){p.error(o("automation.cron_expression_invalid"));return}n={...n,cron:b.trim(),timezone:c}}else if(a.triggerType==="task_event"){const h=typeof n.filter=="object"&&n.filter!==null&&!Array.isArray(n.filter)?n.filter:{};n={...n,filter:{...h,projectKey:y}}}L(!0);try{const h=a.taskConfig??{},_=await d({projectKey:y,name:a.name,description:a.taskDescription,triggerType:a.triggerType,triggerConfig:n,executionMode:a.executionMode,notifyProjectChats:k,taskConfig:{...h,agentType:m},templateId:a.id});p.success(o("automation.automation_created")),t(),i(_.id)}catch(h){const _=h instanceof Error?h.message:o("automation.failed_create");p.error(_)}finally{L(!1)}};return e.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto bg-black/70 p-4",onClick:t,children:e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":a.name,onClick:n=>n.stopPropagation(),className:"mx-auto my-4 max-h-[calc(100vh-2rem)] w-full max-w-5xl overflow-y-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono shadow-2xl",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-[var(--border)] px-6 py-5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-[0.16em] text-[var(--accent)]",children:o("automation.template_preview")}),e.jsx("h2",{className:"mt-2 text-2xl font-semibold text-[var(--text-primary)]",children:a.name}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-[var(--text-secondary)]",children:a.description})]}),e.jsx("button",{type:"button","aria-label":o("common.close"),onClick:t,className:"rounded-[4px] border border-[var(--border)] p-2 text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:e.jsx(re,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"px-6 py-6",children:e.jsxs("div",{className:"max-h-[40vh] overflow-y-auto rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] p-5",children:[e.jsx("p",{className:"mb-3 text-[11px] text-[var(--text-muted)]",children:o("automation.template_prompt")}),e.jsx("p",{className:"whitespace-pre-wrap text-lg leading-9 text-[var(--text-primary)]",children:a.taskDescription})]})}),e.jsxs("div",{className:"flex flex-col gap-4 border-t border-[var(--border)] px-6 py-5",children:[e.jsxs("div",{className:"grid gap-3 lg:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)_200px]",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.project")}),e.jsx(B,{value:y,onChange:Y,options:g.map(n=>({value:n.key,label:`${n.name} (${n.key})`})),placeholder:o(w?"common.loading":"automation.select_project"),className:"w-full"})]}),a.triggerType==="cron"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.schedule")}),e.jsx("input",{type:"text",value:b,onChange:n=>N(n.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.timezone")}),e.jsx(B,{value:c,onChange:u,options:[{value:"UTC",label:"UTC"},{value:"Asia/Shanghai",label:"Asia/Shanghai"},{value:"Asia/Singapore",label:"Asia/Singapore"},{value:"America/Los_Angeles",label:"America/Los_Angeles"},{value:"America/New_York",label:"America/New_York"}],placeholder:o("automation.timezone"),className:"w-full"})]})]}):e.jsxs("div",{className:"lg:col-span-2 flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.trigger_type")}),e.jsx("div",{className:"flex h-9 items-center rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 text-xs text-[var(--text-primary)]",children:a.triggerType})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:o("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:fe.map(n=>e.jsx("button",{type:"button",onClick:()=>G(n.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${m===n.value?"border-[var(--accent)] bg-[var(--accent)]/5 text-[var(--accent)]":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:n.label},n.value))})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-xs text-[var(--text-primary)] cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:k,onChange:n=>v(n.target.checked),className:"h-3.5 w-3.5 cursor-pointer accent-[var(--accent)]"}),o("automation.notify_project_chats")]}),e.jsx("p",{className:"mt-1 pl-5 text-[10px] text-[var(--text-muted)]",children:o("automation.notify_project_chats_hint")})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:t,className:"text-sm text-[var(--text-muted)] transition-colors hover:text-[var(--text-primary)]",children:o("automation.cancel")}),e.jsx("button",{type:"button",onClick:W,disabled:E,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-sm font-bold text-black transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",children:o(E?"automation.creating":"automation.create_from_template")})]})]})]})})}function Ne(){const a=R(),{t}=M(),{templates:i,loading:o,fetchTemplates:d}=T(),[g,x]=l.useState(null);if(l.useEffect(()=>{d()},[d]),o&&i.length===0)return e.jsx("div",{className:"p-4",children:e.jsx($,{rows:4})});if(i.length===0)return e.jsx(I,{icon:q,title:t("automation.no_templates"),description:t("automation.templates_description")});const y=i.reduce((c,u)=>{const m=u.category||"other";return c[m]||(c[m]=[]),c[m].push(u),c},{}),s=Object.entries(y).sort(([c],[u])=>C(c).order-C(u).order),b=[...i].sort((c,u)=>D(c)-D(u)).slice(0,Math.min(4,i.length)),N=c=>{const u=i.find(m=>m.id===c)??null;x(u)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-5",children:[e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-end md:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-[var(--accent)]",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:t("automation.templates_suggested")})]}),e.jsx("h2",{className:"mt-2 text-sm font-bold text-[var(--text-primary)]",children:t("automation.templates_suggested_title")}),e.jsx("p",{className:"mt-1 max-w-2xl text-xs leading-5 text-[var(--text-muted)]",children:t("automation.templates_suggested_description")})]}),e.jsx("span",{className:"text-[11px] text-[var(--text-muted)]",children:t("automation.templates_ready_count",{count:i.length})})]}),e.jsx("div",{className:"mt-4 grid gap-3 xl:grid-cols-2",children:b.map(c=>e.jsx(F,{template:c,emphasized:!0,onUse:N,sourceLabel:c.isBuiltin?t("automation.template_source_builtin"):t("automation.template_source_custom"),actionLabel:t("automation.use_template")},`suggested-${c.id}`))})]}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[220px_minmax(0,1fr)]",children:[e.jsxs("aside",{className:"h-fit rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3 lg:sticky lg:top-4",children:[e.jsx("p",{className:"text-[11px] font-bold text-[var(--text-primary)]",children:t("automation.templates_browse")}),e.jsx("p",{className:"mt-1 text-[11px] leading-5 text-[var(--text-muted)]",children:t("automation.templates_browse_description")}),e.jsx("div",{className:"mt-3 space-y-1.5",children:s.map(([c,u])=>{const m=C(c),j=m.icon,k=`automation-template-category-${c}`;return e.jsxs("button",{type:"button","aria-label":t(m.titleKey),onClick:()=>{var v;(v=document.getElementById(k))==null||v.scrollIntoView({behavior:"smooth",block:"start"})},className:"flex w-full items-center justify-between rounded-[4px] border border-transparent bg-[var(--bg-input)] px-3 py-2 text-left transition-colors hover:border-[var(--border)] hover:text-[var(--text-primary)]",children:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-xs text-[var(--text-secondary)]",children:[e.jsx(j,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{className:"truncate",children:t(m.titleKey)})]}),e.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:u.length})]},`nav-${c}`)})})]}),e.jsx("div",{className:"space-y-6",children:s.map(([c,u])=>{const m=C(c),j=m.icon,k=`automation-template-category-${c}`;return e.jsxs("section",{id:k,className:"scroll-mt-4",children:[e.jsxs("div",{className:"mb-3 border-b border-[var(--border)] pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-[var(--text-muted)]",children:[e.jsx(j,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:t(m.titleKey)})]}),e.jsx("h3",{className:"mt-2 text-sm font-bold text-[var(--text-primary)]",children:t(m.titleKey)}),e.jsx("p",{className:"mt-1 text-xs leading-5 text-[var(--text-muted)]",children:t(m.descriptionKey)})]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:u.map(v=>e.jsx(F,{template:v,onUse:N,sourceLabel:v.isBuiltin?t("automation.template_source_builtin"):t("automation.template_source_custom"),actionLabel:t("automation.use_template")},v.id))})]},c)})})]}),e.jsx(_e,{template:g,onClose:()=>x(null),onCreated:c=>a(`/automations/${c}`)})]})}function ze(){const a=R(),{t}=M(),[i,o]=l.useState("inbox"),d=T(x=>x.inboxUnreadCount);l.useEffect(()=>{T.getState().fetchInboxCount()},[]),Q(l.useMemo(()=>e.jsxs("button",{onClick:()=>a("/automations/new"),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(ne,{className:"h-3.5 w-3.5"}),t("automation.new_automation")]}),[a,t]));const g=[{key:"inbox",label:t("automation.tab_inbox"),count:d>0?d:void 0},{key:"automations",label:t("automation.tab_automations")},{key:"templates",label:t("automation.tab_templates")}];return e.jsxs("div",{className:"mx-auto max-w-6xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsx("h1",{className:"sr-only",children:t("automation.title")}),e.jsx("div",{className:"mb-4 flex items-center gap-1 overflow-x-auto pb-1 no-scrollbar",children:g.map(x=>e.jsxs("button",{onClick:()=>o(x.key),className:`shrink-0 rounded-[4px] px-3 py-2 h-8 text-xs transition-colors flex items-center gap-1.5 ${i===x.key?"text-[var(--accent)] bg-[var(--bg-input)]":"text-[var(--text-muted)] bg-[var(--bg-card)] hover:text-[var(--text-secondary)]"}`,children:[x.label,x.count!==void 0&&e.jsx("span",{className:"flex h-4 min-w-[16px] items-center justify-center rounded-full bg-[var(--accent)] px-1 text-[10px] font-bold text-black",children:x.count})]},x.key))}),i==="inbox"&&e.jsx(ge,{}),i==="automations"&&e.jsx(be,{}),i==="templates"&&e.jsx(Ne,{})]})}export{ze as default};
@@ -1 +0,0 @@
1
- import{a as i,g as x,j as a,L as d,b as m,J as b,M as p,a4 as u,e as v,a8 as f,a9 as h}from"./index-Cfz24FvS.js";import{A as j}from"./arrow-left-CrZE68gW.js";const o=[{to:"/docs/cli",label:"cli",icon:m},{to:"/docs/api",label:"api",icon:b},{to:"/docs/bot",label:"bot",icon:p},{to:"/docs/skill",label:"skill",icon:u},{to:"/docs/all",label:"all",icon:v}],k=new Set(o.map(s=>s.to));function y(){const{t:s}=i(),r=x(),t=!k.has(r.pathname);return a.jsxs("div",{className:"flex h-full flex-col",children:[a.jsxs("nav",{className:"flex items-center border-b border-[var(--border)] bg-[var(--bg-card)] px-4 md:px-6 overflow-x-auto no-scrollbar",children:[t&&a.jsxs(d,{to:"/docs/all",className:"mr-3 shrink-0 flex items-center gap-1 text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",children:[a.jsx(j,{size:12}),s("docs.docs_back")]}),o.map(({to:e,label:l,icon:c})=>a.jsxs(f,{to:e,className:({isActive:n})=>`flex items-center gap-1.5 px-3 py-3 text-xs lowercase border-b-2 transition-colors shrink-0 ${n||t&&e==="/docs/all"?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[a.jsx(c,{size:14}),a.jsx("span",{children:l})]},e))]}),a.jsx("main",{className:"flex-1 overflow-auto p-4 md:p-6",children:a.jsx(h,{})})]})}export{y as default};
@@ -1 +0,0 @@
1
- import{_ as m,r as e,j as t}from"./index-Cfz24FvS.js";var b=m();function g({content:n,children:a,delay:l=100,className:i}){const[p,u]=e.useState(!1),[c,f]=e.useState({top:0,left:0}),r=e.useRef(null),o=e.useRef(null),x=e.useCallback(()=>{r.current=setTimeout(()=>{if(o.current){const s=o.current.getBoundingClientRect();f({top:s.top-4,left:s.left+s.width/2})}u(!0)},l)},[l]),d=e.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),u(!1)},[]);return n?t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:o,onMouseEnter:x,onMouseLeave:d,className:i,children:a}),p&&b.createPortal(t.jsx("div",{role:"tooltip",style:{position:"fixed",top:c.top,left:c.left,transform:"translate(-50%, -100%)",zIndex:9999},className:"pointer-events-none max-w-sm rounded-[4px] bg-[var(--bg-card)] px-2.5 py-1.5 text-xs text-[var(--text-primary)] shadow-lg border border-[var(--border-row)]",children:n}),document.body)]}):t.jsx(t.Fragment,{children:a})}export{g as T};
@@ -1 +0,0 @@
1
- import{a as b,j as e,s as T,A as se,f as te,r as x,u as ae,k as R,w as ne,W as m,D as N,L as oe,Q as F,h as g,l as ie}from"./index-Cfz24FvS.js";import{t as le,c as H}from"./date-CmcdoD87.js";import{w as ce,b as de,t as xe}from"./status-colors-qoQt_0Rr.js";import{I as l}from"./InfoRow-DINJ_QV-.js";import{M as S}from"./MetricBar-CbCODU4f.js";import{u as me}from"./useFetch-BhpPrPjt.js";import{T as pe}from"./Tooltip-iHcbiLoR.js";import{T as U}from"./trash-2-BLnVFw_Z.js";import{A as ue}from"./arrow-left-CrZE68gW.js";function be({isOpen:t,onClose:n,onConfirm:r,workerName:o,isDraining:i,loading:p}){const{t:c}=b();return e.jsx(T,{isOpen:t,onClose:n,onConfirm:r,title:c(i?"workers.undrain_worker_title":"workers.drain_worker_title"),message:i?c("workers.undrain_confirm",{name:o}):c("workers.drain_confirm",{name:o}),confirmLabel:c(i?"workers.undrain":"workers.drain"),confirmVariant:i?"accent":"warning",isLoading:p})}function V(t){return t==="rate_limit"?"rate limited":t}function ve(t,n){return n(t==="binary_missing"?"workers.manual_restore_required":"workers.awaiting_auto_recovery")}function Se(){var $,A;const{id:t}=se(),n=te(),{t:r}=b(),[o,i]=x.useState(!1),[p,c]=x.useState(!1),[P,w]=x.useState(!1),[z,L]=x.useState(!1),[B,j]=x.useState(!1),[Q,I]=x.useState(!1),[y,f]=x.useState(null),v=ae(a=>{var d;return(d=a.user)==null?void 0:d.role}),J=R(a=>a.workerSeq),K=R(a=>a.taskSeq),{data:u,loading:X,error:M,refetch:_}=me(async()=>{if(!t)throw new Error("Missing worker ID");const[a,d]=await Promise.all([g.get(`web/workers/${t}`).json(),g.get(`web/workers/${t}/tasks`).json().catch(()=>[])]);return{worker:a,tasks:d}},[t,J,K]),s=(u==null?void 0:u.worker)??null,C=(u==null?void 0:u.tasks)??[],O=v===N.LEAD||v===N.ADMIN;ne(x.useMemo(()=>!s||s.status===m.DECOMMISSIONED?null:e.jsxs("div",{className:"flex items-center gap-2",children:[s.status===m.ONLINE&&e.jsxs("button",{onClick:()=>i(!0),className:"rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",r("workers.drain")]}),v===N.ADMIN&&e.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(U,{className:"h-3 w-3"}),r("workers.decommission")]})]}),[s,v,r]));async function Y(){if(s){c(!0);try{const a=s.status===m.DRAINING?"undrain":"drain";await g.post(`web/workers/${s.id}/${a}`),await _()}catch{}finally{c(!1),i(!1)}}}async function Z(){if(s){L(!0);try{await g.delete(`admin/workers/${s.id}`),n("/workers")}catch{}finally{L(!1),w(!1)}}}async function ee(){if(!(!s||!y)){I(!0);try{await g.post(`web/workers/${s.id}/capabilities/${encodeURIComponent(y)}/restore`),await _()}catch{}finally{I(!1),j(!1),f(null)}}}if(X)return e.jsx("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono",children:e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:r("workers.loading_worker")})});if(M)return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--destructive)]",children:M}),e.jsx("button",{onClick:()=>_(),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:r("common.retry")})]});if(!s)return e.jsxs("div",{className:"mx-auto max-w-5xl px-4 md:px-6 py-8 font-mono lowercase text-center",children:[e.jsx("p",{className:"text-sm text-[var(--text-secondary)]",children:r("workers.worker_not_found")}),e.jsxs("button",{onClick:()=>n("/workers"),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:["< ",r("workers.back_to_workers")]})]});const k=s.status===m.DRAINING,h=s.status!==m.DECOMMISSIONED;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mx-auto max-w-5xl font-mono lowercase",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-primary)] px-4 shrink-0 md:hidden",style:{height:56},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("button",{onClick:()=>n("/workers"),className:"shrink-0 text-[var(--text-muted)]",children:e.jsx(ue,{className:"h-4 w-4"})}),e.jsx("span",{className:"truncate text-sm font-medium text-[var(--text-primary)]",children:s.name})]}),!k&&s.status!==m.OFFLINE&&h&&e.jsxs("button",{onClick:()=>i(!0),className:"shrink-0 rounded-[4px] border border-[var(--warning)]/40 px-3 py-1.5 text-xs text-[var(--warning)] hover:bg-[var(--warning)]/10 transition-colors",children:["> ",r("workers.drain")]})]}),e.jsxs("div",{className:"px-4 md:px-6 py-8",children:[k?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(oe,{to:"/workers",className:"text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:r("workers.title")}),e.jsx("span",{className:"text-[var(--text-muted)]",children:"/"}),e.jsx("span",{className:"text-[var(--text-secondary)]",children:s.name})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[h&&e.jsxs("button",{onClick:()=>i(!0),className:"rounded-[4px] border border-[var(--accent)] px-4 py-1.5 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:["> ",r("workers.undrain")]}),v===N.ADMIN&&h&&e.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--destructive)]/40 px-3 py-1.5 text-xs text-[var(--destructive)] hover:bg-[var(--destructive)]/10 transition-colors",children:[e.jsx(U,{className:"h-3 w-3"}),r("workers.decommission")]})]})]}),e.jsx("div",{className:"mb-4",children:e.jsx("span",{className:"rounded-[4px] bg-[var(--warning)]/20 px-2.5 py-1 text-xs font-medium text-[var(--warning)]",children:r("workers.draining")})}),e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)]/40 bg-[var(--warning)]/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(F,{className:"h-3.5 w-3.5 text-[var(--warning)]"}),e.jsx("span",{className:"text-xs text-[var(--warning)]",children:r("workers.draining_warning")})]}),e.jsx("p",{className:"text-xs text-[var(--warning)]/70 ml-5.5",children:r("workers.draining_active_tasks")})]}),e.jsxs("div",{className:"mb-6 grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(D,{label:r("workers.cpu"),value:s.cpuUsage,unit:"%"}),e.jsx(D,{label:r("workers.memory"),value:s.memoryUsage,unit:"%"}),e.jsx(D,{label:r("workers.disk"),value:s.diskUsage,unit:"%"}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("workers.slots")}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[s.activeSlots,"/",s.maxSlots]})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>n("/workers"),className:"mb-4 text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors",children:["< ",r("workers.back_to_workers")]}),e.jsxs("h1",{className:"mb-2 text-lg font-bold text-[var(--text-primary)] flex items-center gap-2",children:[s.name,e.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-normal",style:{color:ce[s.status]},children:[e.jsx("span",{style:{fontSize:"0.5rem"},children:"●"}),s.status.toLowerCase()]})]}),e.jsx("p",{className:"mb-6 text-xs text-[var(--text-muted)]",children:r("workers.last_heartbeat",{time:le(s.lastHeartbeat,"never")})}),s.status===m.DECOMMISSIONED&&e.jsx("div",{className:"mb-6 rounded-[4px] border border-[var(--text-muted)]/40 bg-[var(--text-muted)]/10 p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-3.5 w-3.5 text-[var(--text-muted)]"}),e.jsxs("span",{className:"text-xs text-[var(--text-muted)]",children:["this worker has been decommissioned",s.decommissionedAt?` on ${H(s.decommissionedAt)}`:""," and can no longer accept tasks."]})]})}),e.jsxs("div",{className:"mb-6 grid gap-4 lg:grid-cols-2",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.resource_usage")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(S,{label:r("workers.cpu"),value:s.cpuUsage}),e.jsx(S,{label:r("workers.mem"),value:s.memoryUsage}),e.jsx(S,{label:r("workers.disk"),value:s.diskUsage})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.connection_info")}),e.jsx(q,{worker:s})]})]})]}),k?e.jsxs(e.Fragment,{children:[e.jsx(G,{title:r("workers.active_tasks"),tasks:C,navigate:n}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:r("workers.capabilities")}),s.capabilities.length>0?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:s.capabilities.map(a=>e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx("p",{className:"text-xs text-[var(--text-primary)]",children:a})},a))}):e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("workers.no_capabilities_short")}),((($=s.degradedCapabilities)==null?void 0:$.length)??0)>0&&e.jsx("div",{className:"mt-3 space-y-2",children:s.degradedCapabilities.map(a=>e.jsx(W,{agentType:a.agentType,failureType:a.failureType,failureCount:a.failureCount,showRestore:O&&h,onRestore:()=>{f(a.agentType),j(!0)}},a.agentType))})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"mb-4 text-sm font-medium text-[var(--accent)]",children:r("workers.worker_info")}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:e.jsx(q,{worker:s,showExtended:!0})})]})]}):e.jsxs(e.Fragment,{children:[s.capabilities.length>0&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:r("workers.capabilities")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.capabilities.map(a=>{var E;const d=(E=s.degradedCapabilities)==null?void 0:E.find(re=>re.agentType===a);return e.jsxs("span",{className:`rounded-[4px] border px-2.5 py-1 text-xs ${d?"border-[var(--warning)] text-[var(--warning)] bg-[var(--warning)]/5":"border-[var(--border)] text-[var(--text-secondary)]"}`,children:[a,d&&e.jsx("span",{className:"ml-1.5 text-[10px]",children:V(d.failureType)})]},a)})}),(((A=s.degradedCapabilities)==null?void 0:A.length)??0)>0&&e.jsx("div",{className:"mt-3 space-y-2",children:s.degradedCapabilities.map(a=>e.jsx(W,{agentType:a.agentType,failureType:a.failureType,failureCount:a.failureCount,showRestore:O&&h,onRestore:()=>{f(a.agentType),j(!0)}},a.agentType))})]}),e.jsx(G,{title:`${r("workers.current_tasks")} (${C.length})`,tasks:C,navigate:n})]})]})]}),e.jsx(be,{isOpen:o,onClose:()=>i(!1),onConfirm:Y,workerName:s.name,isDraining:k,loading:p}),e.jsx(T,{isOpen:P,onClose:()=>w(!1),onConfirm:Z,title:r("workers.decommission_title"),message:r("workers.decommission_confirm",{name:s.name}),confirmLabel:r("workers.decommission"),confirmVariant:"danger",isLoading:z}),e.jsx(T,{isOpen:B,onClose:()=>{j(!1),f(null)},onConfirm:ee,title:r("workers.restore_capability_title"),message:r("workers.restore_capability_confirm",{capability:y??r("workers.unknown"),name:s.name}),confirmLabel:r("workers.restore_capability"),confirmVariant:"accent",isLoading:Q})]})}function W({agentType:t,failureType:n,failureCount:r,showRestore:o,onRestore:i}){const{t:p}=b();return e.jsx("div",{className:"rounded-[4px] border border-[var(--warning)] bg-[var(--warning)]/5 p-3 text-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-medium",children:t}),e.jsxs("span",{className:"text-[var(--text-muted)] ml-2 text-xs",children:[V(n)," · ",r," consecutive failure",r!==1?"s":""," · ",ve(n,p)]})]}),o&&e.jsx("button",{type:"button",onClick:i,className:"shrink-0 rounded-[4px] border border-[var(--accent)]/40 px-2.5 py-1 text-xs text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:p("workers.restore_capability")})]})})}function q({worker:t,showExtended:n=!1}){const{t:r}=b();return e.jsxs("div",{className:"flex flex-col gap-2 text-xs",children:[e.jsx(l,{label:r("workers.worker_id"),value:t.id}),e.jsx(l,{label:r("workers.host"),value:t.host}),e.jsx(l,{label:r("workers.os"),value:t.os??r("workers.unknown")}),e.jsx(l,{label:r("workers.cpu_model"),value:t.cpuModel??r("workers.n_a")}),e.jsx(l,{label:r("workers.cpu_cores"),value:t.cpuCores!=null?String(t.cpuCores):r("workers.n_a")}),e.jsx(l,{label:r("workers.memory"),value:t.memoryGb!=null?`${t.memoryGb} gb`:r("workers.n_a")}),e.jsx(l,{label:r("workers.last_heartbeat_label"),value:H(t.lastHeartbeat)}),e.jsx(l,{label:r("workers.slots"),value:`${t.activeSlots}/${t.maxSlots}`}),n&&e.jsxs(e.Fragment,{children:[e.jsx(l,{label:r("workers.status_label"),value:t.status.toLowerCase()}),e.jsx(l,{label:r("workers.worker_version"),value:t.workerVersion??r("workers.n_a")})]})]})}function G({title:t,tasks:n,navigate:r}){const{t:o}=b();return e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[e.jsx("h2",{className:"mb-3 text-xs text-[var(--text-muted)]",children:t}),n.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[e.jsx("span",{className:"text-xl font-bold text-[var(--border)]",children:"[ ]"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:o("workers.no_active_tasks")})]}):e.jsx(he,{tasks:n,navigate:r})]})}function he({tasks:t,navigate:n}){const{t:r}=b();return e.jsx("div",{className:"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-row)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.id")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.description")}),e.jsx("th",{className:"py-2 pr-4 text-left font-normal text-[var(--text-muted)]",children:r("workers.status_label")}),e.jsx("th",{className:"py-2 text-left font-normal text-[var(--text-muted)]",children:r("workers.stage")})]})}),e.jsx("tbody",{children:t.map(o=>e.jsxs("tr",{onClick:()=>n(`/tasks/${o.id}`),className:"cursor-pointer border-b border-[var(--border-row)] hover:bg-[var(--bg-input)] transition-colors",children:[e.jsxs("td",{className:"py-2 pr-4 text-[var(--text-primary)]",children:["#",o.id]}),e.jsx("td",{className:"max-w-[120px] md:max-w-xs truncate py-2 pr-4 text-[var(--text-secondary)]",children:e.jsx(pe,{content:o.description,children:ie(o)})}),e.jsx("td",{className:"py-2 pr-4",children:e.jsxs("span",{style:{color:xe[o.status]},children:["● ",o.status.toLowerCase()]})}),e.jsx("td",{className:"py-2 text-[var(--text-secondary)]",children:o.currentStage??"-"})]},o.id))})]})})}function D({label:t,value:n,unit:r}){const o=Math.round(n*100);return e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-5",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:t}),e.jsxs("p",{className:"mt-2 text-lg font-semibold text-[var(--text-primary)]",children:[o,r]}),e.jsx("div",{className:"mt-3 h-1.5 w-full rounded-[2px] bg-[var(--bg-input)]",children:e.jsx("div",{className:"h-full rounded-[2px] transition-all",style:{width:`${o}%`,backgroundColor:de(n)}})})]})}export{Se as default};