@overlordai/server 1.0.150 → 1.0.151

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 (148) hide show
  1. package/database/migrations/015-automation-template-taxonomy.sql +99 -0
  2. package/dist/adapters/lark/lark.controller.js +1 -1
  3. package/dist/adapters/lark/lark.controller.js.map +1 -1
  4. package/dist/adapters/slack/slack.controller.d.ts.map +1 -1
  5. package/dist/adapters/slack/slack.controller.js +4 -1
  6. package/dist/adapters/slack/slack.controller.js.map +1 -1
  7. package/dist/automation/automation-template.service.d.ts +4 -1
  8. package/dist/automation/automation-template.service.d.ts.map +1 -1
  9. package/dist/automation/automation-template.service.js +9 -2
  10. package/dist/automation/automation-template.service.js.map +1 -1
  11. package/dist/automation/builtin-templates.d.ts +14 -0
  12. package/dist/automation/builtin-templates.d.ts.map +1 -0
  13. package/dist/automation/builtin-templates.js +327 -0
  14. package/dist/automation/builtin-templates.js.map +1 -0
  15. package/dist/database/repositories/automation.repository.d.ts +12 -0
  16. package/dist/database/repositories/automation.repository.d.ts.map +1 -1
  17. package/dist/database/repositories/automation.repository.js +63 -2
  18. package/dist/database/repositories/automation.repository.js.map +1 -1
  19. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  20. package/dist/dispatcher/dispatcher.service.js +6 -1
  21. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  22. package/dist/dispatcher/dispatcher.types.d.ts +2 -0
  23. package/dist/dispatcher/dispatcher.types.d.ts.map +1 -1
  24. package/dist/notifier/notification-consumer.d.ts +1 -8
  25. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  26. package/dist/notifier/notification-consumer.js +4 -58
  27. package/dist/notifier/notification-consumer.js.map +1 -1
  28. package/dist/notifier/template.service.d.ts.map +1 -1
  29. package/dist/notifier/template.service.js +14 -7
  30. package/dist/notifier/template.service.js.map +1 -1
  31. package/dist/web/automation.controller.js +1 -1
  32. package/dist/web/automation.controller.js.map +1 -1
  33. package/package.json +4 -4
  34. package/public/assets/{AccessTokensPage-Cxf8lX2l.js → AccessTokensPage-DOQYcLSs.js} +1 -1
  35. package/public/assets/{AdminPage-CYbg2MAm.js → AdminPage-vaAs4nmP.js} +1 -1
  36. package/public/assets/{AgentCliPage-B927spLk.js → AgentCliPage-BXGIfvSo.js} +1 -1
  37. package/public/assets/{ApiReferencePage-Dg2PEPIj.js → ApiReferencePage-ChGlKtFZ.js} +1 -1
  38. package/public/assets/{ArchitecturePage-DpdvWol1.js → ArchitecturePage-BDo0Sz0V.js} +1 -1
  39. package/public/assets/{AuditLogPage-DC0cHKgp.js → AuditLogPage-CDonhWBh.js} +1 -1
  40. package/public/assets/AutomationCreatePage-C1_2qnf5.js +1 -0
  41. package/public/assets/{AutomationDetailPage-Dzkc_ZgE.js → AutomationDetailPage-BruGQNkV.js} +1 -1
  42. package/public/assets/{AutomationEditPage-HuEyfsd4.js → AutomationEditPage-BVlx-7AI.js} +1 -1
  43. package/public/assets/AutomationListPage-BprhRKdu.js +26 -0
  44. package/public/assets/{AutomationRunDetailPage-DpbJ8WGA.js → AutomationRunDetailPage-BWRONm49.js} +2 -2
  45. package/public/assets/{BindPlatformPage-BsEqhv2c.js → BindPlatformPage-B-jO83qZ.js} +1 -1
  46. package/public/assets/BotIntegrationPage-CfWOXPnJ.js +1 -0
  47. package/public/assets/{BotManage-ClYWS35N.js → BotManage-Dt4gvWW6.js} +1 -1
  48. package/public/assets/{BotSetupPage-i-AQ7pd6.js → BotSetupPage-BAtr0Wem.js} +1 -1
  49. package/public/assets/ChangelogPage-CbYmEPo0.js +1 -0
  50. package/public/assets/{CliReferencePage-DE7sjttz.js → CliReferencePage-DzBrPSnn.js} +1 -1
  51. package/public/assets/ConfirmStageDialog-CJ8pWink.js +6 -0
  52. package/public/assets/{DeploymentPage-DSE4lkjS.js → DeploymentPage-DngrSHQT.js} +1 -1
  53. package/public/assets/{DevWorkflowPage-BANLgjo2.js → DevWorkflowPage-BQfJaZyg.js} +1 -1
  54. package/public/assets/{DeveloperManage-D1SXqVFy.js → DeveloperManage-whlVH116.js} +1 -1
  55. package/public/assets/{DeveloperSetupPage-C_2BhtWg.js → DeveloperSetupPage-LrbpgJ2C.js} +1 -1
  56. package/public/assets/DocsIndexPage-vE4yr9Si.js +26 -0
  57. package/public/assets/{DocsLayout-DF24edES.js → DocsLayout-ByGEAOqk.js} +1 -1
  58. package/public/assets/{DocsPrimitives-m1oUERel.js → DocsPrimitives-DCBNKtsW.js} +1 -1
  59. package/public/assets/{EditProjectPage-DBMoGsR8.js → EditProjectPage-CjJMof0e.js} +2 -2
  60. package/public/assets/{EmptyState-tRn0r3m4.js → EmptyState-BfgwLg0u.js} +1 -1
  61. package/public/assets/{EnvVariablesPage-C6aJgjAB.js → EnvVariablesPage-D5h_sa-J.js} +1 -1
  62. package/public/assets/{HomePage-Bk-TkaC8.js → HomePage-BfETjlYe.js} +1 -1
  63. package/public/assets/{InfoRow-DNGAuZW7.js → InfoRow-CIwHf1Un.js} +1 -1
  64. package/public/assets/{InstallationPage-D8L9Higi.js → InstallationPage-2uTV3WlY.js} +1 -1
  65. package/public/assets/{LandingPage-DWUNOSPY.js → LandingPage-DMFC0PF_.js} +1 -1
  66. package/public/assets/{LocalDevelopmentPage-EmrG2Khk.js → LocalDevelopmentPage-9g3s63GP.js} +1 -1
  67. package/public/assets/{LoginPage-DGikIseW.js → LoginPage-CXwygPZl.js} +1 -1
  68. package/public/assets/{MetricBar-DJJX8LMi.js → MetricBar-BWuqiydF.js} +1 -1
  69. package/public/assets/{NotFoundPage-C8KIi602.js → NotFoundPage-Cs7ae_Mz.js} +1 -1
  70. package/public/assets/{OnboardingGuide-hzsHrV8w.js → OnboardingGuide-uCrXzgnL.js} +1 -1
  71. package/public/assets/{PermissionsPage-CViv0974.js → PermissionsPage-CVrdX2r2.js} +1 -1
  72. package/public/assets/{PipelineConfigPage-DAL7k_Mn.js → PipelineConfigPage-BxkXW1la.js} +1 -1
  73. package/public/assets/{PipelineEditorPage-c8vBg5bb.js → PipelineEditorPage-DiyMvTIg.js} +2 -2
  74. package/public/assets/{PlanPage-to7JvocS.js → PlanPage-B-NSg434.js} +1 -1
  75. package/public/assets/{ProfilePage-FkoPFABx.js → ProfilePage-CRMCbMyc.js} +1 -1
  76. package/public/assets/{ProjectDetailPage-CLcnGmQC.js → ProjectDetailPage-Bx1DUkpw.js} +3 -3
  77. package/public/assets/{ProjectListPage-xapZ35at.js → ProjectListPage-D1LzmIVf.js} +2 -2
  78. package/public/assets/PtyTerminal-CxBKQBbF.js +38 -0
  79. package/public/assets/{QuickAuth-tYYBxSU8.js → QuickAuth-BMY6Nw6u.js} +1 -1
  80. package/public/assets/{RemoveMemberConfirmDialog-KoNueMWe.js → RemoveMemberConfirmDialog-Da3XlOxO.js} +1 -1
  81. package/public/assets/{ReviewAggregatePage-BTN2bkEA.js → ReviewAggregatePage-mnnW-Nli.js} +2 -2
  82. package/public/assets/{ReviewPage-DKVAeNjP.js → ReviewPage-_pd3mJC1.js} +1 -1
  83. package/public/assets/{Select-ucU6_0EP.js → Select-CaAVBHmI.js} +1 -1
  84. package/public/assets/{SettingsPage-Dv6y5QEu.js → SettingsPage-CsDJ7FS9.js} +1 -1
  85. package/public/assets/{Skeleton-BAYr4eiz.js → Skeleton-CNV0Dyd8.js} +1 -1
  86. package/public/assets/{SkillPage-B3Iw74cZ.js → SkillPage-CQyxaNa5.js} +1 -1
  87. package/public/assets/TaskDetailPage-Dn7Vl2tI.js +21 -0
  88. package/public/assets/{TaskGuidePage-BBFKjc9w.js → TaskGuidePage-Ch465zVv.js} +1 -1
  89. package/public/assets/{TaskListPage-DUUYPpEt.js → TaskListPage-DbQbJMDj.js} +1 -1
  90. package/public/assets/{TaskStatusBadge-BD3WJQkl.js → TaskStatusBadge-Dzloj2eJ.js} +1 -1
  91. package/public/assets/TerminalHomePage-C2bwGFkH.js +6 -0
  92. package/public/assets/TokenManage-mToToJ_g.js +1 -0
  93. package/public/assets/{Tooltip-DfB8CAIs.js → Tooltip-DzkVglKi.js} +1 -1
  94. package/public/assets/{TotpSetupPage-DwXxvB-k.js → TotpSetupPage-Dk00_OYo.js} +1 -1
  95. package/public/assets/{WorkerDetailPage-aLNOgmfW.js → WorkerDetailPage-C8_zfmSR.js} +1 -1
  96. package/public/assets/{WorkerListPage-CrJESAH0.js → WorkerListPage-kKUioe-i.js} +2 -2
  97. package/public/assets/{WorkerOperationsPage-rHLL8hJa.js → WorkerOperationsPage-CBzwbV8I.js} +1 -1
  98. package/public/assets/{WorkerSetupGuidePage-Ckrfo8-b.js → WorkerSetupGuidePage-DvaP5u6N.js} +1 -1
  99. package/public/assets/{WorkerSetupPage-Cwf4AXe9.js → WorkerSetupPage-BD-EAPKM.js} +1 -1
  100. package/public/assets/{agent-type-options-Vn2Ar3HP.js → agent-type-options-BiwwFXJv.js} +1 -1
  101. package/public/assets/{arrow-left-C08vc7G2.js → arrow-left-BnN4eZhK.js} +1 -1
  102. package/public/assets/{arrow-right-CiCC0owG.js → arrow-right-BDaYPEVr.js} +1 -1
  103. package/public/assets/{bot-BpRqYalx.js → bot-jsWsZ197.js} +1 -1
  104. package/public/assets/{chevron-down-54sz-rQX.js → chevron-down-DyqUpmgf.js} +1 -1
  105. package/public/assets/{chevron-left-D9iQafYD.js → chevron-left-D5fJVFiB.js} +1 -1
  106. package/public/assets/{chevron-right-Ccp2bQ3u.js → chevron-right-Bz-j2WmS.js} +1 -1
  107. package/public/assets/{chevron-up-Cm7Jc-Tg.js → chevron-up-DEXIEMJO.js} +1 -1
  108. package/public/assets/{circle-alert-DKHl7f_Q.js → circle-alert-DE06tNOV.js} +1 -1
  109. package/public/assets/{clock-B6V-4VR5.js → clock-DyV22whY.js} +1 -1
  110. package/public/assets/{copy-B-4Hfvcn.js → copy-Dtpgo9EK.js} +1 -1
  111. package/public/assets/{download-3Syugo5K.js → download-DVCPTZuD.js} +1 -1
  112. package/public/assets/{external-link-B4tgsST2.js → external-link-Bbo-dc9z.js} +1 -1
  113. package/public/assets/{git-fork-BhXdgj_k.js → git-fork-A1WGp9ha.js} +1 -1
  114. package/public/assets/index-Du11Fv9c.css +1 -0
  115. package/public/assets/{index-D3EF0BU0.js → index-PZwTchr_.js} +32 -27
  116. package/public/assets/{key-BTztJw3V.js → key-BDx4jfUG.js} +1 -1
  117. package/public/assets/{loader-circle-CPOjAAu7.js → loader-circle-nKG9e8iK.js} +1 -1
  118. package/public/assets/{pencil-eGjyAgrM.js → pencil-Dgj4md4-.js} +1 -1
  119. package/public/assets/{play-BjFnzBVa.js → play-DFj8BMl8.js} +1 -1
  120. package/public/assets/{plus-BwhhTyaX.js → plus-CCF-PMRF.js} +1 -1
  121. package/public/assets/{rotate-ccw-CesPJxB6.js → rotate-ccw-CyltG4Qx.js} +1 -1
  122. package/public/assets/{scroll-text-BcO-tu0h.js → scroll-text-IFQgBRlh.js} +1 -1
  123. package/public/assets/{settings-Cpf4Aw4Z.js → settings-CYtYYzCu.js} +1 -1
  124. package/public/assets/{skip-forward-tHDn4amf.js → skip-forward-Ck7tY58a.js} +1 -1
  125. package/public/assets/{status-colors-BNBcbZVQ.js → status-colors-DDycfcf7.js} +1 -1
  126. package/public/assets/{task-constants-v3cKX5sS.js → task-constants-CSVY_jfk.js} +1 -1
  127. package/public/assets/{task.store-B1f8yuTU.js → task.store-BTXbcXgO.js} +1 -1
  128. package/public/assets/{timer-D4gHmYOk.js → timer-CXsWiTNP.js} +1 -1
  129. package/public/assets/{trash-2-B0gTlwTA.js → trash-2-DXJqRCdo.js} +1 -1
  130. package/public/assets/{useFetch-DqA_6ili.js → useFetch-6R6P2rOm.js} +1 -1
  131. package/public/assets/{users-BDhUOLR9.js → users-BZPY-p6E.js} +1 -1
  132. package/public/assets/{wifi-CpsnZ0me.js → wifi-Bgq95lS8.js} +1 -1
  133. package/public/assets/{workflow-D6VrmpVC.js → workflow-RqNfx4vc.js} +1 -1
  134. package/public/assets/{zap-ChFVfVhi.js → zap-BIwamY7L.js} +1 -1
  135. package/public/index.html +2 -2
  136. package/public/sw.js +1 -1
  137. package/public/assets/AutomationCreatePage-BvFaaM3C.js +0 -1
  138. package/public/assets/AutomationListPage-Ds8g44m8.js +0 -16
  139. package/public/assets/BotIntegrationPage-ClfrH4Nq.js +0 -1
  140. package/public/assets/ChangelogPage-C-xth3KP.js +0 -1
  141. package/public/assets/ConfirmStageDialog-DvTvViy4.js +0 -7
  142. package/public/assets/DocsIndexPage-Ch2Rj0KS.js +0 -26
  143. package/public/assets/PtyTerminal-CvlgzMDa.js +0 -38
  144. package/public/assets/TaskDetailPage-Dm9O3GpZ.js +0 -21
  145. package/public/assets/TerminalHomePage-By_ngoYD.js +0 -6
  146. package/public/assets/TokenManage-BK36rX8P.js +0 -1
  147. package/public/assets/file-text-BfrzBouS.js +0 -6
  148. package/public/assets/index-CdJk2QGi.css +0 -1
@@ -1 +1 @@
1
- import{a as _,v as C,r as c,j as e,h as k,s as T,w as S,F as A,a5 as D,a7 as f,t as g}from"./index-D3EF0BU0.js";import{S as E}from"./Select-ucU6_0EP.js";import{E as L}from"./EmptyState-tRn0r3m4.js";import{T as I}from"./Skeleton-BAYr4eiz.js";import{t as N}from"./date-RFA7-ZGs.js";import{u as R}from"./useFetch-DqA_6ili.js";import{P}from"./plus-BwhhTyaX.js";import{C as O}from"./copy-B-4Hfvcn.js";import{T as w}from"./trash-2-B0gTlwTA.js";import"./chevron-down-54sz-rQX.js";function V({isOpen:s,onClose:u,onCreated:i}){const{t:a}=_();C(s);const[d,o]=c.useState(""),[x,n]=c.useState("never"),[m,p]=c.useState(!1),[v,l]=c.useState(""),j=[{value:"never",label:a("access_tokens.no_expiry")},{value:"30",label:a("access_tokens.days_30")},{value:"90",label:a("access_tokens.days_90")},{value:"365",label:a("access_tokens.days_365")}];function h(){o(""),n("never"),l(""),u()}async function b(){if(l(""),!d.trim()){l(a("access_tokens.token_label_required"));return}try{p(!0);const r=await k.post("web/profile/tokens",{json:{label:d.trim(),...x!=="never"&&{expiresAt:new Date(Date.now()+parseInt(x,10)*864e5).toISOString()}}}).json();o(""),n("never"),i({token:r.token,name:r.name})}catch(r){const y=r instanceof Error?r.message:a("access_tokens.failed_to_create_token");l(y)}finally{p(!1)}}return s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]"}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:a("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[v&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)]/30 bg-[var(--destructive)]/5 px-3 py-2 text-xs text-[var(--destructive)]",children:v}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:a("access_tokens.token_name_placeholder"),value:d,onChange:r=>o(r.target.value),onKeyDown:r=>{r.key==="Enter"&&b()},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",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.expires")}),e.jsx(E,{value:x,onChange:n,options:j})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:h,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")}),e.jsx("button",{onClick:b,disabled:m,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:a(m?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function F({isOpen:s,onClose:u,onConfirm:i,tokenLabel:a,isLoading:d}){const{t:o}=_();return e.jsx(T,{isOpen:s,onClose:u,onConfirm:i,title:o("access_tokens.revoke_token_title"),message:o("access_tokens.revoke_confirm",{name:a}),confirmLabel:o("access_tokens.revoke"),confirmVariant:"danger",isLoading:d})}function Q(){const{t:s}=_(),[u,i]=c.useState(!1),[a,d]=c.useState(null),[o,x]=c.useState(!1),[n,m]=c.useState(null),[p,v]=c.useState(null),{data:l,loading:j,refetch:h}=R(()=>k.get("web/profile/tokens").json(),[]);S(c.useMemo(()=>e.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black transition-opacity hover:opacity-90",children:[e.jsx(P,{className:"h-3.5 w-3.5"}),s("access_tokens.create_token")]}),[s]));function b(t){i(!1),d(t.token),x(!1),h()}async function r(){if(a)try{await navigator.clipboard.writeText(a),x(!0),setTimeout(()=>x(!1),2e3)}catch{}}async function y(){if(n)try{v(n.id),await k.post(`web/profile/tokens/${n.id}/revoke`),g.success(s("access_tokens.token_revoked")),m(null),h()}catch{g.error(s("access_tokens.failed_to_revoke_token"))}finally{v(null)}}return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[a&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs font-medium text-[var(--warning)]",children:s("access_tokens.copy_token_warning")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 break-all rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)]",children:a}),e.jsxs("button",{onClick:r,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[o?e.jsx(A,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(O,{className:"h-3.5 w-3.5"}),s(o?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>d(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:s("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:j?e.jsx("div",{className:"p-4",children:e.jsx(I,{rows:3})}):!l||l.length===0?e.jsx(L,{icon:D,title:s("access_tokens.no_tokens"),description:s("access_tokens.create_token_desc"),actionLabel:s("access_tokens.create_token"),onAction:()=>i(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden divide-y divide-[var(--border)]",children:l.map(t=>e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)] font-medium",children:t.label}),e.jsx("span",{className:`text-xs shrink-0 ml-2 ${t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]"}`,children:t.status})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-[var(--text-secondary)]",children:[e.jsxs("span",{children:[s("access_tokens.created"),": ",new Date(t.createdAt).toLocaleDateString()]}),e.jsxs("span",{children:[s("access_tokens.expires"),": ",t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")]}),e.jsxs("span",{children:[s("access_tokens.last_used"),": ",t.lastUsedAt?N(t.lastUsedAt):s("common.never")]})]}),t.status===f.ACTIVE&&e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))}),e.jsxs("table",{className:"hidden md:table w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:s("common.actions")})]})}),e.jsx("tbody",{children:l.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-[var(--text-primary)]",children:e.jsx("span",{className:"truncate block max-w-[100px] md:max-w-[200px]",children:t.label})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]",children:t.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.lastUsedAt?N(t.lastUsedAt):s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:t.status===f.ACTIVE&&e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))})]})]})}),e.jsx(V,{isOpen:u,onClose:()=>i(!1),onCreated:b}),e.jsx(F,{isOpen:!!n,onClose:()=>m(null),onConfirm:y,tokenLabel:(n==null?void 0:n.label)??"",isLoading:p!==null})]})}export{Q as default};
1
+ import{a as _,v as C,r as c,j as e,h as k,s as T,w as S,I as A,a5 as D,a7 as f,t as g}from"./index-PZwTchr_.js";import{S as E}from"./Select-CaAVBHmI.js";import{E as L}from"./EmptyState-BfgwLg0u.js";import{T as I}from"./Skeleton-CNV0Dyd8.js";import{t as N}from"./date-RFA7-ZGs.js";import{u as R}from"./useFetch-6R6P2rOm.js";import{P}from"./plus-CCF-PMRF.js";import{C as O}from"./copy-Dtpgo9EK.js";import{T as w}from"./trash-2-DXJqRCdo.js";import"./chevron-down-DyqUpmgf.js";function V({isOpen:s,onClose:u,onCreated:i}){const{t:a}=_();C(s);const[d,o]=c.useState(""),[x,n]=c.useState("never"),[m,p]=c.useState(!1),[v,l]=c.useState(""),j=[{value:"never",label:a("access_tokens.no_expiry")},{value:"30",label:a("access_tokens.days_30")},{value:"90",label:a("access_tokens.days_90")},{value:"365",label:a("access_tokens.days_365")}];function h(){o(""),n("never"),l(""),u()}async function b(){if(l(""),!d.trim()){l(a("access_tokens.token_label_required"));return}try{p(!0);const r=await k.post("web/profile/tokens",{json:{label:d.trim(),...x!=="never"&&{expiresAt:new Date(Date.now()+parseInt(x,10)*864e5).toISOString()}}}).json();o(""),n("never"),i({token:r.token,name:r.name})}catch(r){const y=r instanceof Error?r.message:a("access_tokens.failed_to_create_token");l(y)}finally{p(!1)}}return s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]"}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:a("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[v&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)]/30 bg-[var(--destructive)]/5 px-3 py-2 text-xs text-[var(--destructive)]",children:v}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:a("access_tokens.token_name_placeholder"),value:d,onChange:r=>o(r.target.value),onKeyDown:r=>{r.key==="Enter"&&b()},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",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.expires")}),e.jsx(E,{value:x,onChange:n,options:j})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:h,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")}),e.jsx("button",{onClick:b,disabled:m,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:a(m?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function U({isOpen:s,onClose:u,onConfirm:i,tokenLabel:a,isLoading:d}){const{t:o}=_();return e.jsx(T,{isOpen:s,onClose:u,onConfirm:i,title:o("access_tokens.revoke_token_title"),message:o("access_tokens.revoke_confirm",{name:a}),confirmLabel:o("access_tokens.revoke"),confirmVariant:"danger",isLoading:d})}function Q(){const{t:s}=_(),[u,i]=c.useState(!1),[a,d]=c.useState(null),[o,x]=c.useState(!1),[n,m]=c.useState(null),[p,v]=c.useState(null),{data:l,loading:j,refetch:h}=R(()=>k.get("web/profile/tokens").json(),[]);S(c.useMemo(()=>e.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black transition-opacity hover:opacity-90",children:[e.jsx(P,{className:"h-3.5 w-3.5"}),s("access_tokens.create_token")]}),[s]));function b(t){i(!1),d(t.token),x(!1),h()}async function r(){if(a)try{await navigator.clipboard.writeText(a),x(!0),setTimeout(()=>x(!1),2e3)}catch{}}async function y(){if(n)try{v(n.id),await k.post(`web/profile/tokens/${n.id}/revoke`),g.success(s("access_tokens.token_revoked")),m(null),h()}catch{g.error(s("access_tokens.failed_to_revoke_token"))}finally{v(null)}}return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[a&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs font-medium text-[var(--warning)]",children:s("access_tokens.copy_token_warning")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 break-all rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)]",children:a}),e.jsxs("button",{onClick:r,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[o?e.jsx(A,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(O,{className:"h-3.5 w-3.5"}),s(o?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>d(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:s("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:j?e.jsx("div",{className:"p-4",children:e.jsx(I,{rows:3})}):!l||l.length===0?e.jsx(L,{icon:D,title:s("access_tokens.no_tokens"),description:s("access_tokens.create_token_desc"),actionLabel:s("access_tokens.create_token"),onAction:()=>i(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden divide-y divide-[var(--border)]",children:l.map(t=>e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)] font-medium",children:t.label}),e.jsx("span",{className:`text-xs shrink-0 ml-2 ${t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]"}`,children:t.status})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-[var(--text-secondary)]",children:[e.jsxs("span",{children:[s("access_tokens.created"),": ",new Date(t.createdAt).toLocaleDateString()]}),e.jsxs("span",{children:[s("access_tokens.expires"),": ",t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")]}),e.jsxs("span",{children:[s("access_tokens.last_used"),": ",t.lastUsedAt?N(t.lastUsedAt):s("common.never")]})]}),t.status===f.ACTIVE&&e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))}),e.jsxs("table",{className:"hidden md:table w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:s("common.actions")})]})}),e.jsx("tbody",{children:l.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-[var(--text-primary)]",children:e.jsx("span",{className:"truncate block max-w-[100px] md:max-w-[200px]",children:t.label})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]",children:t.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.lastUsedAt?N(t.lastUsedAt):s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:t.status===f.ACTIVE&&e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))})]})]})}),e.jsx(V,{isOpen:u,onClose:()=>i(!1),onCreated:b}),e.jsx(U,{isOpen:!!n,onClose:()=>m(null),onConfirm:y,tokenLabel:(n==null?void 0:n.label)??"",isLoading:p!==null})]})}export{Q as default};
@@ -1 +1 @@
1
- import{a as i,a5 as d,j as t,a9 as m,aa as l}from"./index-D3EF0BU0.js";import{U as c}from"./users-BDhUOLR9.js";import{B as b}from"./bot-BpRqYalx.js";import{S as p}from"./scroll-text-BcO-tu0h.js";import{S as x}from"./settings-Cpf4Aw4Z.js";function h(){const{t:a}=i(),r=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:c},{to:"/admin/bots",label:a("admin.tab_bots"),icon:b},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:d},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:p},{to:"/admin/settings",label:a("admin.tab_settings"),icon:x}];return t.jsxs("div",{children:[t.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar pr-4 md:pr-0",children:r.map(({to:e,label:o,icon:s})=>t.jsxs(m,{to:e,className:({isActive:n})=>`flex shrink-0 whitespace-nowrap items-center gap-2 border-b-2 px-4 py-3 md:py-2 text-sm transition-colors ${n?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[t.jsx(s,{size:16}),o]},e))}),t.jsx(l,{})]})}export{h as default};
1
+ import{a as i,a5 as d,j as t,a8 as m,a9 as l}from"./index-PZwTchr_.js";import{U as c}from"./users-BZPY-p6E.js";import{B as b}from"./bot-jsWsZ197.js";import{S as p}from"./scroll-text-IFQgBRlh.js";import{S as x}from"./settings-CYtYYzCu.js";function h(){const{t:a}=i(),r=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:c},{to:"/admin/bots",label:a("admin.tab_bots"),icon:b},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:d},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:p},{to:"/admin/settings",label:a("admin.tab_settings"),icon:x}];return t.jsxs("div",{children:[t.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar pr-4 md:pr-0",children:r.map(({to:e,label:o,icon:s})=>t.jsxs(m,{to:e,className:({isActive:n})=>`flex shrink-0 whitespace-nowrap items-center gap-2 border-b-2 px-4 py-3 md:py-2 text-sm transition-colors ${n?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[t.jsx(s,{size:16}),o]},e))}),t.jsx(l,{})]})}export{h as default};
@@ -1,3 +1,3 @@
1
- import{j as e}from"./index-D3EF0BU0.js";import{a as s}from"./DocsPrimitives-m1oUERel.js";import"./copy-B-4Hfvcn.js";function d(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// agent cli integration"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["overlord supports three ai agent clis. each project configures an ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent_type"})," that determines which cli the worker uses to execute tasks. the prompt is written to pty stdin after the cli starts — not passed as a cli argument."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// supported agents"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"agent"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli binary"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config value"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"subscription"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"claude code"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:"anthropic / claude"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"cursor agent"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})}),e.jsx("td",{className:"px-3 py-2",children:"cursor"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"openai codex"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:"openai"})]})]})]})}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// the cursor agent cli binary is ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"}),", not ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"}),". the config value ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})," maps to the ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})," binary."]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// permission strategy"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["all agents run in fully automated mode by default. the ",e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})," project config controls the permission level:"]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"allowedTools"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"claude"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cursor"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"codex"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"null (default)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-skip-permissions"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-bypass-approvals-and-sandbox"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"specific value"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--allowedTools <value>"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--full-auto"})})]})]})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// cli flag mapping"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"claude code"}),e.jsx(s,{code:"claude --dangerously-skip-permissions [--allowedTools <tools>] [--plugin-dir <path>]"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--allowedTools"})," or ",e.jsx("code",{children:"--dangerously-skip-permissions"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--plugin-dir <path>"})}),e.jsx("td",{className:"px-3 py-2",children:"load custom skills/plugins"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:".claude.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:".credentials.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"settings.json"})," from real home. pre-trusts worktree in ",e.jsx("code",{className:"text-[var(--accent)]",children:"trustedDirectories"}),"."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"cursor agent"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--warning)]/30 bg-[var(--warning)]/5 px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--warning)]",children:'⚠ macos limitation: cursor agent stores auth tokens in macos keychain, which requires a gui login session. headless workers (launchd/ssh) cannot access keychain and will fail with "keychain operation timed out". cursor agent is currently only supported on linux workers.'})}),e.jsx(s,{code:"agent --yolo --approve-mcps"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"purpose"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--yolo"})}),e.jsx("td",{className:"px-3 py-2",children:"skip all confirmation prompts (alias for --force)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"line-through opacity-50",children:"--trust"})}),e.jsx("td",{className:"px-3 py-2",children:"removed — only works in headless/print mode. trust is auto-accepted via pty."})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:"auto-approve mcp servers"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: relies on workspace-manager's xdg ",e.jsx("code",{className:"text-[var(--accent)]",children:".config/"})," symlink."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"openai codex"}),e.jsx(s,{code:"codex --dangerously-bypass-approvals-and-sandbox"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsx("tbody",{className:"text-[var(--text-secondary)]",children:e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--dangerously-bypass-approvals-and-sandbox"})," or ",e.jsx("code",{children:"--full-auto"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]})})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.codex"})," directory if it exists."]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// configsnapshot fields"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"project-level config fields passed to executors:"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"type"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"used by"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentType"})}),e.jsx("td",{className:"px-3 py-2",children:"claude | cursor | codex"}),e.jsx("td",{className:"px-3 py-2",children:"all"}),e.jsx("td",{className:"px-3 py-2",children:"which cli to spawn"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude, codex"}),e.jsx("td",{className:"px-3 py-2",children:"permission strategy control"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude"}),e.jsx("td",{className:"px-3 py-2",children:"plugin directory path"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"maxTurns"})}),e.jsx("td",{className:"px-3 py-2",children:"number"}),e.jsx("td",{className:"px-3 py-2",children:"stage monitor"}),e.jsx("td",{className:"px-3 py-2",children:"max stage retry loops"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"pipeline"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"pipeline compiler"}),e.jsx("td",{className:"px-3 py-2",children:"custom pipeline json (null = default 6-stage)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentEnv"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"extra env vars json merged into pty env"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"json array of shell commands run before agent starts (120s timeout each)"})]})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// git hooks"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["worker creates isolated git worktrees for each task. by default, project-level git hooks (husky, lefthook, etc.) are not installed because ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," is not run automatically. use the project's ",e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})," field to install hooks before the agent starts."]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"hook tool"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"setupCommands"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"husky"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx husky install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"lefthook"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx lefthook install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"simple-git-hooks"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx simple-git-hooks"]'})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"native (.githooks/)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["git config core.hooksPath .githooks"]'})})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the lightest option is native git hooks — commit hook scripts to a ",e.jsx("code",{className:"text-[var(--accent)]",children:".githooks/"})," directory in your repo, then use a single ",e.jsx("code",{className:"text-[var(--accent)]",children:"git config"})," command. no ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," needed."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// capability detection"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"workers auto-detect installed agent clis on startup and report capabilities to the server. if a capability degrades at runtime (auth failure, rate limit), the server temporarily removes it. it auto-recovers when the next task execution succeeds."}),e.jsx(s,{code:`which claude && claude --version → capability: 'claude'
1
+ import{j as e}from"./index-PZwTchr_.js";import{a as s}from"./DocsPrimitives-DCBNKtsW.js";import"./copy-Dtpgo9EK.js";function d(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// agent cli integration"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["overlord supports three ai agent clis. each project configures an ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent_type"})," that determines which cli the worker uses to execute tasks. the prompt is written to pty stdin after the cli starts — not passed as a cli argument."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// supported agents"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"agent"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli binary"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config value"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"subscription"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"claude code"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:"anthropic / claude"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"cursor agent"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})}),e.jsx("td",{className:"px-3 py-2",children:"cursor"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"openai codex"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:"openai"})]})]})]})}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// the cursor agent cli binary is ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"}),", not ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"}),". the config value ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})," maps to the ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})," binary."]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// permission strategy"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["all agents run in fully automated mode by default. the ",e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})," project config controls the permission level:"]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"allowedTools"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"claude"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cursor"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"codex"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"null (default)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-skip-permissions"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-bypass-approvals-and-sandbox"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"specific value"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--allowedTools <value>"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--full-auto"})})]})]})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// cli flag mapping"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"claude code"}),e.jsx(s,{code:"claude --dangerously-skip-permissions [--allowedTools <tools>] [--plugin-dir <path>]"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--allowedTools"})," or ",e.jsx("code",{children:"--dangerously-skip-permissions"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--plugin-dir <path>"})}),e.jsx("td",{className:"px-3 py-2",children:"load custom skills/plugins"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:".claude.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:".credentials.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"settings.json"})," from real home. pre-trusts worktree in ",e.jsx("code",{className:"text-[var(--accent)]",children:"trustedDirectories"}),"."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"cursor agent"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--warning)]/30 bg-[var(--warning)]/5 px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--warning)]",children:'⚠ macos limitation: cursor agent stores auth tokens in macos keychain, which requires a gui login session. headless workers (launchd/ssh) cannot access keychain and will fail with "keychain operation timed out". cursor agent is currently only supported on linux workers.'})}),e.jsx(s,{code:"agent --yolo --approve-mcps"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"purpose"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--yolo"})}),e.jsx("td",{className:"px-3 py-2",children:"skip all confirmation prompts (alias for --force)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"line-through opacity-50",children:"--trust"})}),e.jsx("td",{className:"px-3 py-2",children:"removed — only works in headless/print mode. trust is auto-accepted via pty."})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:"auto-approve mcp servers"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: relies on workspace-manager's xdg ",e.jsx("code",{className:"text-[var(--accent)]",children:".config/"})," symlink."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"openai codex"}),e.jsx(s,{code:"codex --dangerously-bypass-approvals-and-sandbox"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsx("tbody",{className:"text-[var(--text-secondary)]",children:e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--dangerously-bypass-approvals-and-sandbox"})," or ",e.jsx("code",{children:"--full-auto"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]})})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.codex"})," directory if it exists."]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// configsnapshot fields"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"project-level config fields passed to executors:"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"type"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"used by"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentType"})}),e.jsx("td",{className:"px-3 py-2",children:"claude | cursor | codex"}),e.jsx("td",{className:"px-3 py-2",children:"all"}),e.jsx("td",{className:"px-3 py-2",children:"which cli to spawn"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude, codex"}),e.jsx("td",{className:"px-3 py-2",children:"permission strategy control"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude"}),e.jsx("td",{className:"px-3 py-2",children:"plugin directory path"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"maxTurns"})}),e.jsx("td",{className:"px-3 py-2",children:"number"}),e.jsx("td",{className:"px-3 py-2",children:"stage monitor"}),e.jsx("td",{className:"px-3 py-2",children:"max stage retry loops"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"pipeline"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"pipeline compiler"}),e.jsx("td",{className:"px-3 py-2",children:"custom pipeline json (null = default 6-stage)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentEnv"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"extra env vars json merged into pty env"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"json array of shell commands run before agent starts (120s timeout each)"})]})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// git hooks"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["worker creates isolated git worktrees for each task. by default, project-level git hooks (husky, lefthook, etc.) are not installed because ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," is not run automatically. use the project's ",e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})," field to install hooks before the agent starts."]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] 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)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"hook tool"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"setupCommands"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"husky"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx husky install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"lefthook"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx lefthook install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"simple-git-hooks"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx simple-git-hooks"]'})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"native (.githooks/)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["git config core.hooksPath .githooks"]'})})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the lightest option is native git hooks — commit hook scripts to a ",e.jsx("code",{className:"text-[var(--accent)]",children:".githooks/"})," directory in your repo, then use a single ",e.jsx("code",{className:"text-[var(--accent)]",children:"git config"})," command. no ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," needed."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// capability detection"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"workers auto-detect installed agent clis on startup and report capabilities to the server. if a capability degrades at runtime (auth failure, rate limit), the server temporarily removes it. it auto-recovers when the next task execution succeeds."}),e.jsx(s,{code:`which claude && claude --version → capability: 'claude'
2
2
  which agent && agent --version → capability: 'cursor'
3
3
  which codex && codex --version → capability: 'codex'`})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// default pipeline"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the default pipeline has 7 stages:"}),e.jsx("div",{className:"flex flex-wrap items-center gap-1 text-xs",children:["implement","test","verify","review","simplify","rebase","submit"].map((a,t)=>e.jsxs("span",{children:[e.jsx("code",{className:"rounded-[4px] bg-[var(--bg-primary)] px-2 py-0.5 text-[var(--accent)]",children:a}),t<6&&e.jsx("span",{className:"mx-1 text-[var(--text-muted)]",children:"→"})]},a))}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the ",e.jsx("code",{className:"text-[var(--accent)]",children:"verify"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"review"})," stages loop back to ",e.jsx("code",{className:"text-[var(--accent)]",children:"implement"})," on failure (max 3 loops). the ",e.jsx("code",{className:"text-[var(--accent)]",children:"simplify"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"rebase"})," stages loop back to themselves on failure (max 3 loops)."]})]})]})})}export{d as default};
@@ -1 +1 @@
1
- import{f as d,a as o,w as p,r as n,j as t}from"./index-D3EF0BU0.js";import{Q as c}from"./QuickAuth-tYYBxSU8.js";import{P as h}from"./plus-BwhhTyaX.js";import"./copy-B-4Hfvcn.js";const l={GET:"text-green-400",POST:"text-blue-400",PUT:"text-yellow-400",DELETE:"text-red-400"},m=[{title:"authentication",prefix:"/api/auth",endpoints:[{method:"POST",path:"/login",description:"authenticate with username + password (optional totpCode)",auth:"none",body:'{ "username": "string", "password": "string", "totpCode?": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/refresh",description:"refresh access token (rotates refresh token)",auth:"none",body:'{ "refreshToken": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/logout",description:"invalidate refresh token",auth:"jwt",body:'{ "refreshToken": "string" }'}]},{title:"tasks",prefix:"/api/web/tasks",endpoints:[{method:"GET",path:"",description:"list tasks with optional filters",auth:"jwt",response:'[ { "id": 1, "description": "...", "status": "RUNNING", ... } ]'},{method:"POST",path:"",description:"create a new task (name is AI-generated if LLM is configured, otherwise null)",auth:"jwt",body:'{ "projectKey": "string", "description": "string", "workerId?": "string", "taskType?": "feat|fix|refactor|docs|chore", "branchSlug?": "string", "targetBranch?": "string" }',response:'{ "id": 1, "description": "...", "name": "string | null", "branchSlug": "string | null", "status": "PENDING", ... }'},{method:"GET",path:"/:id",description:"get task details",auth:"jwt"},{method:"POST",path:"/:id/cancel",description:"cancel a running task",auth:"jwt"},{method:"POST",path:"/:id/retry",description:"retry a failed or cancelled task",auth:"jwt"},{method:"POST",path:"/:id/confirm-stage",description:"confirm/choose/input for suspended stage",auth:"jwt",body:'{ "stageIndex": "number", "result": "string" }'},{method:"POST",path:"/:id/pty-token",description:"get pty websocket token",auth:"jwt"}]},{title:"workers",prefix:"/api/web/workers",endpoints:[{method:"GET",path:"",description:"list all workers",auth:"jwt"},{method:"GET",path:"/:id",description:"get worker details",auth:"jwt"},{method:"GET",path:"/:id/tasks",description:"list tasks assigned to a worker",auth:"jwt"},{method:"POST",path:"/:id/drain",description:"start draining a worker",auth:"jwt"},{method:"POST",path:"/:id/undrain",description:"cancel worker drain",auth:"jwt"}]},{title:"projects",prefix:"/api/web/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"GET",path:"/:key",description:"get project details",auth:"jwt"}]},{title:"profile",prefix:"/api/web/profile",endpoints:[{method:"GET",path:"",description:"get current user profile",auth:"jwt"},{method:"PUT",path:"",description:"update profile (gitName, gitEmail)",auth:"jwt",body:'{ "gitName?": "string", "gitEmail?": "string" }'},{method:"PUT",path:"/password",description:"change password",auth:"jwt",body:'{ "currentPassword": "string", "newPassword": "string" }'},{method:"POST",path:"/totp/setup",description:"initialize totp setup",auth:"jwt"},{method:"POST",path:"/totp/verify",description:"verify totp setup code",auth:"jwt",body:'{ "code": "string" }'},{method:"GET",path:"/tokens",description:"list personal access tokens",auth:"jwt"},{method:"POST",path:"/tokens",description:"create a personal access token",auth:"jwt",body:'{ "label": "string", "expiresAt?": "string" }'},{method:"POST",path:"/tokens/:id/revoke",description:"revoke a token",auth:"jwt"},{method:"POST",path:"/bind-platform",description:"link a chat platform account using a one-time bind token",auth:"jwt",body:'{ "token": "string" }',response:'{ "success": true, "platform": "lark" }'}]},{title:"workspaces & tunnels",prefix:"/api/web",endpoints:[{method:"GET",path:"/workspaces/:taskId",description:"get workspace for a task",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/start",description:"start a cursor remote tunnel",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/stop",description:"stop a running tunnel",auth:"jwt"},{method:"GET",path:"/workspace-tunnel/:taskId/status",description:"get tunnel status",auth:"jwt"}]},{title:"dashboard",prefix:"/api/web/dashboard",endpoints:[{method:"GET",path:"/stats",description:"get dashboard statistics",auth:"jwt"},{method:"GET",path:"/recent-tasks",description:"get recent tasks for dashboard",auth:"jwt"},{method:"GET",path:"/recent-activity",description:"get recent activity feed",auth:"jwt"}]},{title:"notifications",prefix:"/api/web/notifications",endpoints:[{method:"GET",path:"",description:"list notifications with cursor pagination",auth:"jwt"},{method:"POST",path:"/:id/read",description:"mark a notification as read",auth:"jwt"},{method:"POST",path:"/read-all",description:"mark all notifications as read",auth:"jwt"}]},{title:"search",prefix:"/api/web",endpoints:[{method:"GET",path:"/search?q=query",description:"global search across tasks, workers, projects",auth:"jwt"}]},{title:"admin — developers",prefix:"/api/admin/developers",endpoints:[{method:"GET",path:"",description:"list all developers",auth:"jwt"},{method:"POST",path:"",description:"create a developer",auth:"jwt",body:'{ "name": "string", "password": "string", "role": "string", "gitName": "string", "gitEmail": "string" }'},{method:"PUT",path:"/:id",description:"update developer",auth:"jwt"},{method:"PUT",path:"/:id/reset-totp",description:"reset developer totp",auth:"jwt"}]},{title:"admin — projects",prefix:"/api/admin/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"POST",path:"",description:"create a project",auth:"jwt"},{method:"PUT",path:"/:key",description:"update project (including pipeline)",auth:"jwt"},{method:"DELETE",path:"/:key",description:"delete a project",auth:"jwt"},{method:"GET",path:"/:key/members",description:"get project members",auth:"jwt"},{method:"POST",path:"/:key/members",description:"add project member",auth:"jwt"},{method:"DELETE",path:"/:key/members?developerId=N",description:"remove project member",auth:"jwt"}]},{title:"admin — worker tokens",prefix:"/api/admin/worker-tokens",endpoints:[{method:"GET",path:"",description:"list all worker enrollment tokens",auth:"jwt"},{method:"POST",path:"",description:"generate a new worker token",auth:"jwt"},{method:"POST",path:"/:id/revoke",description:"revoke a worker token",auth:"jwt"},{method:"GET",path:"/:id/status",description:"get token status and linked worker",auth:"jwt"}]},{title:"admin — workers",prefix:"/api/admin/workers",endpoints:[{method:"GET",path:"",description:"list all workers (admin)",auth:"jwt"},{method:"PUT",path:"/:id",description:"update worker status",auth:"jwt",body:'{ "status?": "string" }'}]},{title:"admin — bots",prefix:"/api/admin/bots",endpoints:[{method:"GET",path:"",description:"list bot instances",auth:"jwt"},{method:"POST",path:"",description:"create a bot instance",auth:"jwt"},{method:"GET",path:"/:id/bindings",description:"get group bindings for a bot",auth:"jwt"},{method:"POST",path:"/:id/bindings",description:"create a group binding",auth:"jwt"},{method:"DELETE",path:"/:id/bindings",description:"delete a group binding",auth:"jwt"}]},{title:"admin — audit & settings",prefix:"/api/admin",endpoints:[{method:"GET",path:"/audit-logs",description:"query audit log with filters",auth:"jwt"},{method:"GET",path:"/settings",description:"get all system settings",auth:"jwt"},{method:"PUT",path:"/settings",description:"update system settings",auth:"jwt"}]},{title:"websocket",prefix:"",endpoints:[{method:"GET",path:"WS /ws/pty/:taskId",description:'pty terminal websocket — first obtain a channel token via POST /api/web/tasks/:taskId/pty-token, then send an auth frame after connection: { type: "auth", token: "<jwt>", channelToken: "<channel-token>" }',auth:"jwt"},{method:"GET",path:"WS /api/workers/pty/:taskId",description:'worker pty websocket — auth via frame: { type: "auth", workerJwt: "<worker-jwt>", channelToken: "<channel-token>" }',auth:"worker-token"}]}];function u({ep:e,prefix:a}){const[s,r]=n.useState(!1),{t:i}=o();return t.jsxs("div",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 sm:gap-3 px-3 md:px-4 py-2.5 text-left transition-colors hover:bg-[var(--bg-input)] min-w-0",onClick:()=>r(!s),children:[t.jsx("span",{className:`w-12 shrink-0 text-xs font-bold ${l[e.method]}`,children:e.method}),t.jsxs("code",{className:"flex-1 text-xs text-[var(--text-primary)] truncate min-w-0",children:[a,e.path]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate max-w-[200px]",children:["// ",e.description]})]}),s&&t.jsxs("div",{className:"border-t border-[var(--border-row)] bg-[var(--bg-primary)] px-3 md:px-4 py-3 space-y-2",children:[t.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// ",e.description]}),t.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[t.jsx("span",{className:"text-[var(--text-muted)]",children:"auth:"}),t.jsx("span",{className:e.auth==="none"?"text-[var(--text-muted)]":"text-[var(--accent)]",children:e.auth})]}),e.body&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:i("docs.request_body")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.body})]}),e.response&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:i("docs.response")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.response})]})]})]})}function g(){const e=d(),{t:a}=o();return p(n.useMemo(()=>t.jsxs("button",{onClick:()=>e("/access-tokens"),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:[t.jsx(h,{className:"h-3.5 w-3.5"}),a("access_tokens.create_token")]}),[e,a])),t.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[t.jsx("div",{className:"mb-8",children:t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.api_base_url_desc",{url:"http://localhost:9000"})})}),t.jsx(c,{mode:"api"}),t.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.authentication")}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"jwt"}),t.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["obtained via /api/auth/login — pass as ",t.jsx("code",{children:"authorization: bearer <token>"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"pat"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"personal access token — same header format, for cli/api usage"})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-yellow-400",children:"worker-token"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"enrollment token for worker registration — used during initial handshake"})]})]}),t.jsx("div",{className:"space-y-6",children:m.map(s=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-2 text-sm text-[var(--accent)]",children:["> ",s.title]}),t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s.endpoints.map((r,i)=>t.jsx(u,{ep:r,prefix:s.prefix},`${r.method}-${r.path}-${i}`))})]},s.title))})]})}export{g as default};
1
+ import{f as d,a as o,w as p,r as n,j as t}from"./index-PZwTchr_.js";import{Q as c}from"./QuickAuth-BMY6Nw6u.js";import{P as h}from"./plus-CCF-PMRF.js";import"./copy-Dtpgo9EK.js";const l={GET:"text-green-400",POST:"text-blue-400",PUT:"text-yellow-400",DELETE:"text-red-400"},m=[{title:"authentication",prefix:"/api/auth",endpoints:[{method:"POST",path:"/login",description:"authenticate with username + password (optional totpCode)",auth:"none",body:'{ "username": "string", "password": "string", "totpCode?": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/refresh",description:"refresh access token (rotates refresh token)",auth:"none",body:'{ "refreshToken": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/logout",description:"invalidate refresh token",auth:"jwt",body:'{ "refreshToken": "string" }'}]},{title:"tasks",prefix:"/api/web/tasks",endpoints:[{method:"GET",path:"",description:"list tasks with optional filters",auth:"jwt",response:'[ { "id": 1, "description": "...", "status": "RUNNING", ... } ]'},{method:"POST",path:"",description:"create a new task (name is AI-generated if LLM is configured, otherwise null)",auth:"jwt",body:'{ "projectKey": "string", "description": "string", "workerId?": "string", "taskType?": "feat|fix|refactor|docs|chore", "branchSlug?": "string", "targetBranch?": "string" }',response:'{ "id": 1, "description": "...", "name": "string | null", "branchSlug": "string | null", "status": "PENDING", ... }'},{method:"GET",path:"/:id",description:"get task details",auth:"jwt"},{method:"POST",path:"/:id/cancel",description:"cancel a running task",auth:"jwt"},{method:"POST",path:"/:id/retry",description:"retry a failed or cancelled task",auth:"jwt"},{method:"POST",path:"/:id/confirm-stage",description:"confirm/choose/input for suspended stage",auth:"jwt",body:'{ "stageIndex": "number", "result": "string" }'},{method:"POST",path:"/:id/pty-token",description:"get pty websocket token",auth:"jwt"}]},{title:"workers",prefix:"/api/web/workers",endpoints:[{method:"GET",path:"",description:"list all workers",auth:"jwt"},{method:"GET",path:"/:id",description:"get worker details",auth:"jwt"},{method:"GET",path:"/:id/tasks",description:"list tasks assigned to a worker",auth:"jwt"},{method:"POST",path:"/:id/drain",description:"start draining a worker",auth:"jwt"},{method:"POST",path:"/:id/undrain",description:"cancel worker drain",auth:"jwt"}]},{title:"projects",prefix:"/api/web/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"GET",path:"/:key",description:"get project details",auth:"jwt"}]},{title:"profile",prefix:"/api/web/profile",endpoints:[{method:"GET",path:"",description:"get current user profile",auth:"jwt"},{method:"PUT",path:"",description:"update profile (gitName, gitEmail)",auth:"jwt",body:'{ "gitName?": "string", "gitEmail?": "string" }'},{method:"PUT",path:"/password",description:"change password",auth:"jwt",body:'{ "currentPassword": "string", "newPassword": "string" }'},{method:"POST",path:"/totp/setup",description:"initialize totp setup",auth:"jwt"},{method:"POST",path:"/totp/verify",description:"verify totp setup code",auth:"jwt",body:'{ "code": "string" }'},{method:"GET",path:"/tokens",description:"list personal access tokens",auth:"jwt"},{method:"POST",path:"/tokens",description:"create a personal access token",auth:"jwt",body:'{ "label": "string", "expiresAt?": "string" }'},{method:"POST",path:"/tokens/:id/revoke",description:"revoke a token",auth:"jwt"},{method:"POST",path:"/bind-platform",description:"link a chat platform account using a one-time bind token",auth:"jwt",body:'{ "token": "string" }',response:'{ "success": true, "platform": "lark" }'}]},{title:"workspaces & tunnels",prefix:"/api/web",endpoints:[{method:"GET",path:"/workspaces/:taskId",description:"get workspace for a task",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/start",description:"start a cursor remote tunnel",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/stop",description:"stop a running tunnel",auth:"jwt"},{method:"GET",path:"/workspace-tunnel/:taskId/status",description:"get tunnel status",auth:"jwt"}]},{title:"dashboard",prefix:"/api/web/dashboard",endpoints:[{method:"GET",path:"/stats",description:"get dashboard statistics",auth:"jwt"},{method:"GET",path:"/recent-tasks",description:"get recent tasks for dashboard",auth:"jwt"},{method:"GET",path:"/recent-activity",description:"get recent activity feed",auth:"jwt"}]},{title:"notifications",prefix:"/api/web/notifications",endpoints:[{method:"GET",path:"",description:"list notifications with cursor pagination",auth:"jwt"},{method:"POST",path:"/:id/read",description:"mark a notification as read",auth:"jwt"},{method:"POST",path:"/read-all",description:"mark all notifications as read",auth:"jwt"}]},{title:"search",prefix:"/api/web",endpoints:[{method:"GET",path:"/search?q=query",description:"global search across tasks, workers, projects",auth:"jwt"}]},{title:"admin — developers",prefix:"/api/admin/developers",endpoints:[{method:"GET",path:"",description:"list all developers",auth:"jwt"},{method:"POST",path:"",description:"create a developer",auth:"jwt",body:'{ "name": "string", "password": "string", "role": "string", "gitName": "string", "gitEmail": "string" }'},{method:"PUT",path:"/:id",description:"update developer",auth:"jwt"},{method:"PUT",path:"/:id/reset-totp",description:"reset developer totp",auth:"jwt"}]},{title:"admin — projects",prefix:"/api/admin/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"POST",path:"",description:"create a project",auth:"jwt"},{method:"PUT",path:"/:key",description:"update project (including pipeline)",auth:"jwt"},{method:"DELETE",path:"/:key",description:"delete a project",auth:"jwt"},{method:"GET",path:"/:key/members",description:"get project members",auth:"jwt"},{method:"POST",path:"/:key/members",description:"add project member",auth:"jwt"},{method:"DELETE",path:"/:key/members?developerId=N",description:"remove project member",auth:"jwt"}]},{title:"admin — worker tokens",prefix:"/api/admin/worker-tokens",endpoints:[{method:"GET",path:"",description:"list all worker enrollment tokens",auth:"jwt"},{method:"POST",path:"",description:"generate a new worker token",auth:"jwt"},{method:"POST",path:"/:id/revoke",description:"revoke a worker token",auth:"jwt"},{method:"GET",path:"/:id/status",description:"get token status and linked worker",auth:"jwt"}]},{title:"admin — workers",prefix:"/api/admin/workers",endpoints:[{method:"GET",path:"",description:"list all workers (admin)",auth:"jwt"},{method:"PUT",path:"/:id",description:"update worker status",auth:"jwt",body:'{ "status?": "string" }'}]},{title:"admin — bots",prefix:"/api/admin/bots",endpoints:[{method:"GET",path:"",description:"list bot instances",auth:"jwt"},{method:"POST",path:"",description:"create a bot instance",auth:"jwt"},{method:"GET",path:"/:id/bindings",description:"get group bindings for a bot",auth:"jwt"},{method:"POST",path:"/:id/bindings",description:"create a group binding",auth:"jwt"},{method:"DELETE",path:"/:id/bindings",description:"delete a group binding",auth:"jwt"}]},{title:"admin — audit & settings",prefix:"/api/admin",endpoints:[{method:"GET",path:"/audit-logs",description:"query audit log with filters",auth:"jwt"},{method:"GET",path:"/settings",description:"get all system settings",auth:"jwt"},{method:"PUT",path:"/settings",description:"update system settings",auth:"jwt"}]},{title:"websocket",prefix:"",endpoints:[{method:"GET",path:"WS /ws/pty/:taskId",description:'pty terminal websocket — first obtain a channel token via POST /api/web/tasks/:taskId/pty-token, then send an auth frame after connection: { type: "auth", token: "<jwt>", channelToken: "<channel-token>" }',auth:"jwt"},{method:"GET",path:"WS /api/workers/pty/:taskId",description:'worker pty websocket — auth via frame: { type: "auth", workerJwt: "<worker-jwt>", channelToken: "<channel-token>" }',auth:"worker-token"}]}];function u({ep:e,prefix:a}){const[s,r]=n.useState(!1),{t:i}=o();return t.jsxs("div",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 sm:gap-3 px-3 md:px-4 py-2.5 text-left transition-colors hover:bg-[var(--bg-input)] min-w-0",onClick:()=>r(!s),children:[t.jsx("span",{className:`w-12 shrink-0 text-xs font-bold ${l[e.method]}`,children:e.method}),t.jsxs("code",{className:"flex-1 text-xs text-[var(--text-primary)] truncate min-w-0",children:[a,e.path]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate max-w-[200px]",children:["// ",e.description]})]}),s&&t.jsxs("div",{className:"border-t border-[var(--border-row)] bg-[var(--bg-primary)] px-3 md:px-4 py-3 space-y-2",children:[t.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// ",e.description]}),t.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[t.jsx("span",{className:"text-[var(--text-muted)]",children:"auth:"}),t.jsx("span",{className:e.auth==="none"?"text-[var(--text-muted)]":"text-[var(--accent)]",children:e.auth})]}),e.body&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:i("docs.request_body")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.body})]}),e.response&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:i("docs.response")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.response})]})]})]})}function g(){const e=d(),{t:a}=o();return p(n.useMemo(()=>t.jsxs("button",{onClick:()=>e("/access-tokens"),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:[t.jsx(h,{className:"h-3.5 w-3.5"}),a("access_tokens.create_token")]}),[e,a])),t.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[t.jsx("div",{className:"mb-8",children:t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.api_base_url_desc",{url:"http://localhost:9000"})})}),t.jsx(c,{mode:"api"}),t.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.authentication")}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"jwt"}),t.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["obtained via /api/auth/login — pass as ",t.jsx("code",{children:"authorization: bearer <token>"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"pat"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"personal access token — same header format, for cli/api usage"})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-yellow-400",children:"worker-token"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"enrollment token for worker registration — used during initial handshake"})]})]}),t.jsx("div",{className:"space-y-6",children:m.map(s=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-2 text-sm text-[var(--accent)]",children:["> ",s.title]}),t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s.endpoints.map((r,i)=>t.jsx(u,{ep:r,prefix:s.prefix},`${r.method}-${r.path}-${i}`))})]},s.title))})]})}export{g as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./index-D3EF0BU0.js";import{C as s}from"./DocsPrimitives-m1oUERel.js";import"./copy-B-4Hfvcn.js";const r=` ┌──────────────────┐
1
+ import{j as e}from"./index-PZwTchr_.js";import{C as s}from"./DocsPrimitives-DCBNKtsW.js";import"./copy-Dtpgo9EK.js";const r=` ┌──────────────────┐
2
2
  │ Developer │
3
3
  │ (create / attach) │
4
4
  └──┬─────┬──────┬──┘
@@ -1 +1 @@
1
- import{a as C,r,h as S,j as e,x as k}from"./index-D3EF0BU0.js";import{S as L}from"./Select-ucU6_0EP.js";import{E}from"./EmptyState-tRn0r3m4.js";import{T}from"./Skeleton-BAYr4eiz.js";import{S as A}from"./scroll-text-BcO-tu0h.js";import{C as F}from"./chevron-left-D9iQafYD.js";import{C as P}from"./chevron-right-Ccp2bQ3u.js";import"./chevron-down-54sz-rQX.js";function q(){const{t:a}=C(),h=[{value:"",label:a("admin.all_actions")},{value:"login",label:a("admin.action_login")},{value:"logout",label:a("admin.action_logout")},{value:"create",label:a("admin.action_create")},{value:"update",label:a("admin.action_update")},{value:"delete",label:a("admin.action_delete")},{value:"revoke",label:a("admin.action_revoke")},{value:"reset_2fa",label:a("admin.action_reset_2fa")},{value:"generate_token",label:a("admin.action_generate_token")}],[n,b]=r.useState([]),[f,p]=r.useState(!0),[i,j]=r.useState(""),[o,g]=r.useState(""),[N,c]=r.useState(void 0),[x,m]=r.useState([]),[l,w]=r.useState(void 0),d=r.useCallback(async t=>{try{p(!0);const s={limit:"50"};t&&(s.cursor=t),i&&(s.action=i),o&&(s.user=o);const v=await S.get("admin/audit-logs",{searchParams:s}).json();b(v.data),w(v.nextCursor)}catch{}finally{p(!1)}},[i,o]);r.useEffect(()=>{c(void 0),m([]),d()},[d]);function _(){l&&(m(t=>[...t,N??""]),c(l),d(l))}function y(){if(x.length===0)return;const t=[...x],s=t.pop();m(t),c(s||void 0),d(s||void 0)}function u(t){return t.startsWith("delete")||t==="revoke"?"text-[var(--destructive)]":t.startsWith("create")||t==="generate_token"?"text-[var(--accent)]":t.startsWith("update")||t==="reset_2fa"?"text-[var(--warning)]":t==="login"?"text-[var(--info)]":"text-[var(--text-secondary)]"}return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.audit_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.audit_subtitle")})]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsx(L,{value:i,onChange:j,options:h}),e.jsxs("div",{className:"relative w-full max-w-xs",children:[e.jsx(k,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.filter_by_user"),value:o,onChange:t=>g(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),f?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(T,{rows:5})}):n.length===0?e.jsx(E,{icon:A,title:a("admin.no_audit_entries"),description:a("admin.audit_logs_appear")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.timestamp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.user_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.action")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.resource")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.detail")}),e.jsx("th",{className:"pb-2 font-normal",children:a("admin.ip")})]})}),e.jsx("tbody",{children:n.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"whitespace-nowrap py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleString()}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.userId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:u(t.action),children:t.action})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.resource}),e.jsx("td",{className:"max-w-xs truncate py-2.5 pr-4 text-[var(--text-muted)]",children:t.detail}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:t.ip})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:n.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] mb-1",children:new Date(t.createdAt).toLocaleString()}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2 mb-1",children:[e.jsx("span",{className:`shrink-0 text-[11px] ${u(t.action)}`,children:t.action}),e.jsx("span",{className:"min-w-0 truncate text-[11px] text-[var(--text-secondary)]",children:t.resource})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] truncate",children:t.detail}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[11px] text-[var(--text-muted)]",children:[e.jsxs("span",{children:["User: ",t.userId]}),e.jsx("span",{children:t.ip})]})]},t.id))}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("admin.showing_entries",{count:String(n.length)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",disabled:x.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:y,children:[e.jsx(F,{className:"h-3.5 w-3.5"}),a("common.previous")]}),e.jsxs("button",{type:"button",disabled:!l,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:_,children:[a("common.next"),e.jsx(P,{className:"h-3.5 w-3.5"})]})]})]})]})]})}export{q as default};
1
+ import{a as C,r,h as S,j as e,x as k}from"./index-PZwTchr_.js";import{S as L}from"./Select-CaAVBHmI.js";import{E}from"./EmptyState-BfgwLg0u.js";import{T}from"./Skeleton-CNV0Dyd8.js";import{S as A}from"./scroll-text-IFQgBRlh.js";import{C as F}from"./chevron-left-D5fJVFiB.js";import{C as P}from"./chevron-right-Bz-j2WmS.js";import"./chevron-down-DyqUpmgf.js";function q(){const{t:a}=C(),h=[{value:"",label:a("admin.all_actions")},{value:"login",label:a("admin.action_login")},{value:"logout",label:a("admin.action_logout")},{value:"create",label:a("admin.action_create")},{value:"update",label:a("admin.action_update")},{value:"delete",label:a("admin.action_delete")},{value:"revoke",label:a("admin.action_revoke")},{value:"reset_2fa",label:a("admin.action_reset_2fa")},{value:"generate_token",label:a("admin.action_generate_token")}],[n,b]=r.useState([]),[f,p]=r.useState(!0),[i,j]=r.useState(""),[o,g]=r.useState(""),[N,c]=r.useState(void 0),[x,m]=r.useState([]),[l,w]=r.useState(void 0),d=r.useCallback(async t=>{try{p(!0);const s={limit:"50"};t&&(s.cursor=t),i&&(s.action=i),o&&(s.user=o);const v=await S.get("admin/audit-logs",{searchParams:s}).json();b(v.data),w(v.nextCursor)}catch{}finally{p(!1)}},[i,o]);r.useEffect(()=>{c(void 0),m([]),d()},[d]);function _(){l&&(m(t=>[...t,N??""]),c(l),d(l))}function y(){if(x.length===0)return;const t=[...x],s=t.pop();m(t),c(s||void 0),d(s||void 0)}function u(t){return t.startsWith("delete")||t==="revoke"?"text-[var(--destructive)]":t.startsWith("create")||t==="generate_token"?"text-[var(--accent)]":t.startsWith("update")||t==="reset_2fa"?"text-[var(--warning)]":t==="login"?"text-[var(--info)]":"text-[var(--text-secondary)]"}return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.audit_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.audit_subtitle")})]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsx(L,{value:i,onChange:j,options:h}),e.jsxs("div",{className:"relative w-full max-w-xs",children:[e.jsx(k,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.filter_by_user"),value:o,onChange:t=>g(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),f?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(T,{rows:5})}):n.length===0?e.jsx(E,{icon:A,title:a("admin.no_audit_entries"),description:a("admin.audit_logs_appear")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.timestamp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.user_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.action")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.resource")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.detail")}),e.jsx("th",{className:"pb-2 font-normal",children:a("admin.ip")})]})}),e.jsx("tbody",{children:n.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"whitespace-nowrap py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleString()}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.userId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:u(t.action),children:t.action})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.resource}),e.jsx("td",{className:"max-w-xs truncate py-2.5 pr-4 text-[var(--text-muted)]",children:t.detail}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:t.ip})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:n.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] mb-1",children:new Date(t.createdAt).toLocaleString()}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2 mb-1",children:[e.jsx("span",{className:`shrink-0 text-[11px] ${u(t.action)}`,children:t.action}),e.jsx("span",{className:"min-w-0 truncate text-[11px] text-[var(--text-secondary)]",children:t.resource})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] truncate",children:t.detail}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[11px] text-[var(--text-muted)]",children:[e.jsxs("span",{children:["User: ",t.userId]}),e.jsx("span",{children:t.ip})]})]},t.id))}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("admin.showing_entries",{count:String(n.length)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",disabled:x.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:y,children:[e.jsx(F,{className:"h-3.5 w-3.5"}),a("common.previous")]}),e.jsxs("button",{type:"button",disabled:!l,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:_,children:[a("common.next"),e.jsx(P,{className:"h-3.5 w-3.5"})]})]})]})]})]})}export{q as default};
@@ -0,0 +1 @@
1
+ import{f as Z,a as H,B as J,a0 as S,r,h as Q,t as i,j as e}from"./index-PZwTchr_.js";import{S as p}from"./Select-CaAVBHmI.js";import{A as W}from"./arrow-left-BnN4eZhK.js";import"./chevron-down-DyqUpmgf.js";const X=[{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:""}],ee=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],te=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],ae=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Australia/Sydney"];function re(d){const a=d.trim().split(/\s+/);return a.length===5||a.length===6}function ce(){const d=Z(),{t:a}=H(),[I]=J(),x=I.get("templateId"),{createAutomation:T}=S(),[v,E]=r.useState(""),[y,w]=r.useState(""),[b,O]=r.useState(""),[l,A]=r.useState("cron"),[q,j]=r.useState("0 0 * * *"),[u,_]=r.useState("0 0 * * *"),[N,P]=r.useState("UTC"),[k,F]=r.useState("COMPLETED"),[h,M]=r.useState(""),[g,K]=r.useState(""),[f,L]=r.useState("readonly"),[C,$]=r.useState("claude"),[B,R]=r.useState({}),[Y,U]=r.useState([]),[D,z]=r.useState(!1);r.useEffect(()=>{let t=!1;return Q.get("web/projects").json().then(c=>{t||U(c)}).catch(()=>{t||i.error(a("automation.failed_load_projects"))}),()=>{t=!0}},[a]),r.useEffect(()=>{if(!x)return;let t=!1;return S.getState().fetchTemplates().then(()=>{if(t)return;const o=S.getState().templates.find(n=>n.id===Number(x));if(o){E(o.name),w(o.taskDescription),A(o.triggerType),L(o.executionMode);const n=o.triggerConfig;if(o.triggerType==="cron"&&n.cron&&(_(n.cron),j(""),n.timezone&&P(n.timezone)),o.triggerType==="task_event"&&n.event){F(n.event);const s=n.filter;s!=null&&s.projectKey&&M(s.projectKey),s!=null&&s.taskMode&&K(s.taskMode)}const m=o.taskConfig;m&&R(m),m!=null&&m.agentType&&$(m.agentType)}}),()=>{t=!0}},[x]);const V=t=>{j(t),t&&_(t)},G=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(!re(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},...g&&{taskMode:g}}});z(!0);try{const c=await T({projectKey:b,name:v.trim(),description:y.trim(),triggerType:l,triggerConfig:t,executionMode:f,taskConfig:{...B,agentType:C},...x?{templateId:Number(x)}:{}});i.success(a("automation.automation_created")),d(`/automations/${c.id}`)}catch(c){const o=c instanceof Error?c.message:a("automation.failed_create");i.error(o)}finally{z(!1)}},[v,y,b,l,u,N,k,h,g,f,C,x,T,d,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:()=>d("/automations"),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(W,{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:O,options:Y.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=>E(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=>w(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:()=>A(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:q,onChange:V,options:X.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:P,options:ae.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:F,options:ee})]}),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=>M(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:g,onChange:K,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:()=>L(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${f===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(f==="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:te.map(t=>e.jsx("button",{onClick:()=>$(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",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:G,disabled:D,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(D?"automation.creating":"automation.create_automation")}),e.jsx("button",{onClick:()=>d("/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{ce as default};
@@ -1,4 +1,4 @@
1
- import{c as g,f as M,a as $,A as I,a1 as S,r as i,a2 as D,p as L,t as c,w as O,j as t,s as F}from"./index-D3EF0BU0.js";import{E as k}from"./EmptyState-tRn0r3m4.js";import{T as q}from"./Skeleton-BAYr4eiz.js";import{f as _,c as z}from"./date-RFA7-ZGs.js";import{C as A}from"./clock-B6V-4VR5.js";import{A as G}from"./arrow-left-C08vc7G2.js";import{P as C}from"./play-BjFnzBVa.js";import{T as H}from"./trash-2-B0gTlwTA.js";import{T as K}from"./timer-D4gHmYOk.js";import{Z as U}from"./zap-ChFVfVhi.js";import{E as W}from"./external-link-B4tgsST2.js";/**
1
+ import{c as g,f as M,a as $,A as I,a0 as S,r as i,a1 as D,p as L,t as c,w as O,j as t,s as F}from"./index-PZwTchr_.js";import{E as k}from"./EmptyState-BfgwLg0u.js";import{T as q}from"./Skeleton-CNV0Dyd8.js";import{f as _,c as z}from"./date-RFA7-ZGs.js";import{C as A}from"./clock-DyV22whY.js";import{A as G}from"./arrow-left-BnN4eZhK.js";import{P as C}from"./play-DFj8BMl8.js";import{T as H}from"./trash-2-DXJqRCdo.js";import{T as K}from"./timer-CXsWiTNP.js";import{Z as U}from"./zap-BIwamY7L.js";import{E as W}from"./external-link-Bbo-dc9z.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{f as V,a as B,A as G,a1 as Z,r as o,t as x,j as e}from"./index-D3EF0BU0.js";import{T as H}from"./Skeleton-BAYr4eiz.js";import{E as J}from"./EmptyState-tRn0r3m4.js";import{C as Q}from"./clock-B6V-4VR5.js";import{A as W}from"./arrow-left-C08vc7G2.js";const D=[{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:""}],X=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],ee=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],te=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Australia/Sydney"];function ae(i){const a=i.trim().split(/\s+/);return a.length===5||a.length===6}function ie(){const i=V(),{t:a}=B(),{id:$}=G(),s=Number($),{currentAutomation:r,loading:K,fetchAutomation:N,updateAutomation:_}=Z(),[u,k]=o.useState(""),[b,C]=o.useState(""),[l,E]=o.useState("cron"),[O,h]=o.useState(""),[d,g]=o.useState(""),[y,T]=o.useState("UTC"),[f,S]=o.useState("COMPLETED"),[m,w]=o.useState(""),[p,A]=o.useState(""),[v,P]=o.useState("readonly"),[j,F]=o.useState("claude"),[M,L]=o.useState(!1),[z,I]=o.useState(!1);o.useEffect(()=>{N(s)},[s,N]),o.useEffect(()=>{if(!r||r.id!==s||z)return;k(r.name),C(r.description),E(r.triggerType),P(r.executionMode);const t=r.triggerConfig;if(r.triggerType==="cron"){const n=t.cron??"";g(n);const Y=D.find(q=>q.value===n);h(Y?n:""),T(t.timezone??"UTC")}if(r.triggerType==="task_event"){S(t.event??"COMPLETED");const n=t.filter;w((n==null?void 0:n.projectKey)??""),A((n==null?void 0:n.taskMode)??"")}const c=r.taskConfig;F((c==null?void 0:c.agentType)??"claude"),I(!0)},[r,s,z]);const R=t=>{h(t),t&&g(t)},U=o.useCallback(async()=>{if(!u.trim()){x.error(a("automation.name_required"));return}let t={};if(l==="cron"){if(!d.trim()){x.error(a("automation.cron_expression_required"));return}if(!ae(d)){x.error(a("automation.cron_expression_invalid"));return}t={cron:d,timezone:y}}else l==="task_event"&&(t={event:f,filter:{...m&&{projectKey:m},...p&&{taskMode:p}}});L(!0);try{await _(s,{name:u.trim(),description:b.trim(),triggerType:l,triggerConfig:t,executionMode:v,taskConfig:{...(r==null?void 0:r.taskConfig)??{},agentType:j}}),x.success(a("automation.automation_updated")),i(`/automations/${s}`)}catch(c){const n=c instanceof Error?c.message:a("automation.failed_update");x.error(n)}finally{L(!1)}},[u,b,l,d,y,f,m,p,v,j,s,_,i,a]);return K&&!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(H,{rows:6})}):!r||r.id!==s?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(J,{icon:Q,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:()=>i(`/automations/${s}`),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(W,{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=>k(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:b,onChange:t=>C(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:()=>E(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("select",{id:"edit-cron-preset",value:O,onChange:t=>R(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)] outline-none focus:border-[var(--accent)]",children:D.map(t=>e.jsxs("option",{value:t.value,children:[t.label," ",t.value?`(${t.value})`:""]},t.label))})]}),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:d,onChange:t=>{g(t.target.value),h("")},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("select",{id:"edit-timezone",value:y,onChange:t=>T(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)] outline-none focus:border-[var(--accent)]",children:te.map(t=>e.jsx("option",{value:t,children:t},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("select",{id:"edit-event-type",value:f,onChange:t=>S(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)] outline-none focus:border-[var(--accent)]",children:X.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]}),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:m,onChange:t=>w(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.jsxs("select",{id:"edit-filter-mode",value:p,onChange:t=>A(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)] outline-none focus:border-[var(--accent)]",children:[e.jsx("option",{value:"",children:a("automation.all_modes")}),e.jsx("option",{value:"develop",children:"develop"}),e.jsx("option",{value:"review",children:"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:()=>P(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${v===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(v==="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:ee.map(t=>e.jsx("button",{onClick:()=>F(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${j===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",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:U,disabled:M,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(M?"automation.saving":"automation.save_changes")}),e.jsx("button",{onClick:()=>i(`/automations/${s}`),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{ie as default};
1
+ import{f as V,a as B,A as G,a0 as Z,r as o,t as x,j as e}from"./index-PZwTchr_.js";import{T as H}from"./Skeleton-CNV0Dyd8.js";import{E as J}from"./EmptyState-BfgwLg0u.js";import{C as Q}from"./clock-DyV22whY.js";import{A as W}from"./arrow-left-BnN4eZhK.js";const D=[{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:""}],X=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],ee=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],te=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Australia/Sydney"];function ae(i){const a=i.trim().split(/\s+/);return a.length===5||a.length===6}function ie(){const i=V(),{t:a}=B(),{id:$}=G(),s=Number($),{currentAutomation:r,loading:K,fetchAutomation:N,updateAutomation:_}=Z(),[u,k]=o.useState(""),[b,C]=o.useState(""),[l,E]=o.useState("cron"),[O,h]=o.useState(""),[d,g]=o.useState(""),[y,T]=o.useState("UTC"),[f,S]=o.useState("COMPLETED"),[m,w]=o.useState(""),[p,A]=o.useState(""),[v,P]=o.useState("readonly"),[j,F]=o.useState("claude"),[M,L]=o.useState(!1),[z,I]=o.useState(!1);o.useEffect(()=>{N(s)},[s,N]),o.useEffect(()=>{if(!r||r.id!==s||z)return;k(r.name),C(r.description),E(r.triggerType),P(r.executionMode);const t=r.triggerConfig;if(r.triggerType==="cron"){const n=t.cron??"";g(n);const Y=D.find(q=>q.value===n);h(Y?n:""),T(t.timezone??"UTC")}if(r.triggerType==="task_event"){S(t.event??"COMPLETED");const n=t.filter;w((n==null?void 0:n.projectKey)??""),A((n==null?void 0:n.taskMode)??"")}const c=r.taskConfig;F((c==null?void 0:c.agentType)??"claude"),I(!0)},[r,s,z]);const R=t=>{h(t),t&&g(t)},U=o.useCallback(async()=>{if(!u.trim()){x.error(a("automation.name_required"));return}let t={};if(l==="cron"){if(!d.trim()){x.error(a("automation.cron_expression_required"));return}if(!ae(d)){x.error(a("automation.cron_expression_invalid"));return}t={cron:d,timezone:y}}else l==="task_event"&&(t={event:f,filter:{...m&&{projectKey:m},...p&&{taskMode:p}}});L(!0);try{await _(s,{name:u.trim(),description:b.trim(),triggerType:l,triggerConfig:t,executionMode:v,taskConfig:{...(r==null?void 0:r.taskConfig)??{},agentType:j}}),x.success(a("automation.automation_updated")),i(`/automations/${s}`)}catch(c){const n=c instanceof Error?c.message:a("automation.failed_update");x.error(n)}finally{L(!1)}},[u,b,l,d,y,f,m,p,v,j,s,_,i,a]);return K&&!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(H,{rows:6})}):!r||r.id!==s?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(J,{icon:Q,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:()=>i(`/automations/${s}`),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(W,{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=>k(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:b,onChange:t=>C(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:()=>E(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("select",{id:"edit-cron-preset",value:O,onChange:t=>R(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)] outline-none focus:border-[var(--accent)]",children:D.map(t=>e.jsxs("option",{value:t.value,children:[t.label," ",t.value?`(${t.value})`:""]},t.label))})]}),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:d,onChange:t=>{g(t.target.value),h("")},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("select",{id:"edit-timezone",value:y,onChange:t=>T(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)] outline-none focus:border-[var(--accent)]",children:te.map(t=>e.jsx("option",{value:t,children:t},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("select",{id:"edit-event-type",value:f,onChange:t=>S(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)] outline-none focus:border-[var(--accent)]",children:X.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]}),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:m,onChange:t=>w(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.jsxs("select",{id:"edit-filter-mode",value:p,onChange:t=>A(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)] outline-none focus:border-[var(--accent)]",children:[e.jsx("option",{value:"",children:a("automation.all_modes")}),e.jsx("option",{value:"develop",children:"develop"}),e.jsx("option",{value:"review",children:"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:()=>P(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${v===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(v==="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:ee.map(t=>e.jsx("button",{onClick:()=>F(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${j===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",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:U,disabled:M,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(M?"automation.saving":"automation.save_changes")}),e.jsx("button",{onClick:()=>i(`/automations/${s}`),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{ie as default};
@@ -0,0 +1,26 @@
1
+ import{c as S,f as K,a as M,r as l,a0 as T,w as G,j as e,a1 as W,a2 as R,a3 as Q,a4 as H,t as p,Q as Z,F as X,v as J,h as ee,X as te}from"./index-PZwTchr_.js";import{E as P}from"./EmptyState-BfgwLg0u.js";import{T as $}from"./Skeleton-CNV0Dyd8.js";import{f as I}from"./date-RFA7-ZGs.js";import{S as L}from"./Select-CaAVBHmI.js";import{P as ae}from"./plus-CCF-PMRF.js";import{P as re}from"./play-DFj8BMl8.js";import{Z as se}from"./zap-BIwamY7L.js";import{T as ne}from"./timer-CXsWiTNP.js";import{C as oe}from"./clock-DyV22whY.js";import{C as ie}from"./chevron-right-Bz-j2WmS.js";import"./chevron-down-DyqUpmgf.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 ce=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 O=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 le=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 de=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 xe=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 me({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:ne,task_event:se,manual:re}[a]??oe;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 q({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 ue(){const a=K(),{t}=M(),{runs:i,loading:o,fetchRuns:d,updateRunStatus:g,batchUpdateRuns:x,clearRunQuery:y}=T(),[s,b]=l.useState(new Set),k=l.useRef(!1);l.useEffect(()=>(d({inboxStatus:"unread",limit:50}),()=>{y()}),[d,y]),l.useEffect(()=>{k.current=!0;const r=W.onStatus(_=>{k.current&&_==="connected"&&d({inboxStatus:"unread",limit:50})});return()=>{k.current=!1,r()}},[d]);const c=r=>{b(_=>{const f=new Set(_);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"))}},w=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(P,{icon:de,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:w,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(R,{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 _=new Set(r.findings.map(f=>f.severity));return Array.from(_).map(f=>e.jsx(me,{severity:f},f))})()]})]}),e.jsx("span",{className:"shrink-0 text-[11px] text-[var(--text-muted)]",children:I(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(R,{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(ce,{className:"h-3.5 w-3.5"})})]},r.id))})]})}function pe(){const a=K(),{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(P,{icon:Q,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",{onClick:b=>{b.stopPropagation(),y(s)},className:`relative h-5 w-9 shrink-0 rounded-full transition-colors ${s.enabled?"bg-[var(--accent)]":"bg-[var(--border)]"}`,children:e.jsx("span",{className:`absolute top-0.5 h-4 w-4 rounded-full bg-white transition-transform ${s.enabled?"translate-x-4":"translate-x-0.5"}`})})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[e.jsx(z,{type:s.triggerType}),e.jsx(q,{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:I(s.lastRunAt)})}),s.nextRunAt&&e.jsx("span",{children:t("automation.next_run",{time:I(s.nextRunAt)})}),!s.lastRunAt&&!s.nextRunAt&&e.jsx("span",{children:t("automation.no_runs_yet")})]})]},s.id))})}const B={status_reports:{titleKey:"automation.template_category_status_reports",descriptionKey:"automation.template_category_status_reports_description",icon:X,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:R,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:Z,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:le,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:xe,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:O,order:99,iconClass:"border-[var(--border)] bg-[var(--bg-input)] text-[var(--text-muted)]"}},he={standup_summary:0,weekly_engineering_summary:1,weekly_release_notes:2,daily_bug_scan:3},ge=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}];function C(a){return B[a??""]??B.other}function be(a){const t=C(a.category);return{Icon:t.icon,iconClass:t.iconClass}}function U(a){const t=a.builtinKey!=null?he[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 D({template:a,onUse:t,emphasized:i=!1,sourceLabel:o,actionLabel:d}){const{Icon:g,iconClass:x}=be(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(q,{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(ie,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]})]})}function ve(a){const t=a.trim().split(/\s+/);return t.length===5||t.length===6}function fe({template:a,onClose:t,onCreated:i}){const{t:o}=M(),{createAutomation:d}=T(),[g,x]=l.useState([]),[y,s]=l.useState(""),[b,k]=l.useState(""),[c,u]=l.useState("UTC"),[m,j]=l.useState("claude"),[w,v]=l.useState(!1),[A,r]=l.useState(!1),[_,f]=l.useState(!1);if(J(!!a),l.useEffect(()=>{if(!a)return;const n=a.triggerConfig??{},h=a.taskConfig??{};s(""),k(typeof n.cron=="string"?n.cron:""),u(typeof n.timezone=="string"?n.timezone:"UTC"),j(typeof h.agentType=="string"?h.agentType:"claude"),v(!1),r(!0);let N=!1;return ee.get("web/projects").json().then(E=>{N||(x(E),E.length===1&&(s(E[0].key),j(E[0].agentType)))}).catch(()=>{N||p.error(o("automation.failed_load_projects"))}).finally(()=>{N||r(!1)}),()=>{N=!0}},[a,o]),l.useEffect(()=>{if(!a)return;const n=h=>{h.key==="Escape"&&!_&&t()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[a,t,_]),!a)return null;const F=n=>{if(s(n),w)return;const h=g.find(N=>N.key===n);h&&j(h.agentType)},V=n=>{j(n),v(!0)},Y=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(!ve(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}}}f(!0);try{const h=a.taskConfig??{},N=await d({projectKey:y,name:a.name,description:a.taskDescription,triggerType:a.triggerType,triggerConfig:n,executionMode:a.executionMode,taskConfig:{...h,agentType:m},templateId:a.id});p.success(o("automation.automation_created")),t(),i(N.id)}catch(h){const N=h instanceof Error?h.message:o("automation.failed_create");p.error(N)}finally{f(!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(te,{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(L,{value:y,onChange:F,options:g.map(n=>({value:n.key,label:`${n.name} (${n.key})`})),placeholder:o(A?"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=>k(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(L,{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:ge.map(n=>e.jsx("button",{type:"button",onClick:()=>V(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",{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:Y,disabled:_,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(_?"automation.creating":"automation.create_from_template")})]})]})]})})}function ye(){const a=K(),{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(P,{icon:O,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)=>U(c)-U(u)).slice(0,Math.min(4,i.length)),k=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(D,{template:c,emphasized:!0,onUse:k,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,w=`automation-template-category-${c}`;return e.jsxs("button",{type:"button","aria-label":t(m.titleKey),onClick:()=>{var v;(v=document.getElementById(w))==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,w=`automation-template-category-${c}`;return e.jsxs("section",{id:w,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(D,{template:v,onUse:k,sourceLabel:v.isBuiltin?t("automation.template_source_builtin"):t("automation.template_source_custom"),actionLabel:t("automation.use_template")},v.id))})]},c)})})]}),e.jsx(fe,{template:g,onClose:()=>x(null),onCreated:c=>a(`/automations/${c}`)})]})}function Ie(){const a=K(),{t}=M(),[i,o]=l.useState("inbox"),d=T(x=>x.inboxUnreadCount);l.useEffect(()=>{T.getState().fetchInboxCount()},[]),G(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(ae,{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(ue,{}),i==="automations"&&e.jsx(pe,{}),i==="templates"&&e.jsx(ye,{})]})}export{Ie as default};
@@ -1,6 +1,6 @@
1
- import{c as k,f as E,a as I,A,r as c,k as C,p as R,h as f,j as t,Y as u,V as _}from"./index-D3EF0BU0.js";import{E as h}from"./EmptyState-tRn0r3m4.js";import{T as P}from"./Skeleton-BAYr4eiz.js";import{b as D,c as S,f as T}from"./date-RFA7-ZGs.js";import{C as L}from"./clock-B6V-4VR5.js";import{A as $}from"./arrow-left-C08vc7G2.js";import{E as G}from"./external-link-B4tgsST2.js";import{C as q}from"./circle-alert-DKHl7f_Q.js";/**
1
+ import{c as k,f as E,a as I,A,r as c,k as C,p as R,h as f,j as t,V as u,Q as _}from"./index-PZwTchr_.js";import{E as h}from"./EmptyState-BfgwLg0u.js";import{T as P}from"./Skeleton-CNV0Dyd8.js";import{b as D,c as S,f as T}from"./date-RFA7-ZGs.js";import{C as L}from"./clock-DyV22whY.js";import{A as $}from"./arrow-left-BnN4eZhK.js";import{E as G}from"./external-link-Bbo-dc9z.js";import{C as q}from"./circle-alert-DE06tNOV.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const U=k("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);function M(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 O(n){switch(n){case"COMPLETED":return"text-[var(--accent)]";case"RUNNING":return"text-[var(--accent)]";case"PENDING":return"text-[var(--warning)]";case"FAILED":return"text-[var(--destructive)]";default:return"text-[var(--text-muted)]"}}const B={critical:_,warning:q,info:u},b={critical:"border-[var(--destructive)] text-[var(--destructive)]",warning:"border-[var(--warning)] text-[var(--warning)]",info:"border-[var(--info)] text-[var(--info)]"},F={critical:"bg-[var(--destructive)]/5",warning:"bg-[var(--warning)]/5",info:"bg-[var(--info)]/5"};function X(){const n=E(),{t:s}=I(),{runId:i}=A(),[r,l]=c.useState(null),[g,p]=c.useState(!0),x=c.useRef(null),v=C(e=>e.eventSeq);if(R(r?s("automation.run_title",{id:r.id}):null),c.useEffect(()=>{if(!i)return;let e=!1;return p(!0),f.get(`web/automation-runs/${i}`).json().then(a=>{e||(l(a),x.current=a)}).catch(()=>{e||l(null)}).finally(()=>{e||p(!1)}),()=>{e=!0}},[i]),c.useEffect(()=>{if(!i||v===0)return;const e=x.current;e&&!["PENDING","RUNNING"].includes(e.status)||f.get(`web/automation-runs/${i}`).json().then(a=>{l(a),x.current=a}).catch(()=>{})},[v,i]),g)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(P,{rows:6})});if(!r)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(h,{icon:L,title:s("automation.run_not_found")})});const d=Array.isArray(r.findings)?r.findings:[],N=D(r.startedAt,r.completedAt),o={},j=["critical","warning","info"];for(const e of d){const a=e.severity||"info";o[a]||(o[a]=[]),o[a].push(e)}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 items-center gap-3",children:[t.jsx("button",{onClick:()=>n(-1),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:t.jsx($,{className:"h-4 w-4"})}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:s("automation.run_title",{id:r.id})}),r.automationName&&t.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:r.automationName})]})]}),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:s("automation.run_metadata")}),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:s("automation.status")}),t.jsxs("span",{className:`mt-0.5 flex items-center gap-1.5 text-xs ${O(r.status)}`,children:[t.jsx("span",{className:`h-2 w-2 rounded-full ${M(r.status)}`}),r.status.toLowerCase()]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:s("automation.trigger_type")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:r.triggerType})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:s("automation.triggered_at")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:S(r.createdAt)}),t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:T(r.createdAt)})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:s("automation.duration")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:N??"-"})]})]}),t.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[r.taskId&&t.jsxs("button",{onClick:()=>n(`/tasks/${r.taskId}`),className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--accent)] hover:bg-[var(--accent)]/5 transition-colors",children:[t.jsx(G,{className:"h-3 w-3"})," ",s("automation.task_label",{id:r.taskId})]}),r.mrUrl&&t.jsxs("a",{href:r.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--accent)] hover:bg-[var(--accent)]/5 transition-colors",children:[t.jsx(U,{className:"h-3 w-3"})," ",s("automation.merge_request")]})]})]}),t.jsxs("div",{children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:s("automation.findings_title",{count:d.length})}),d.length===0?t.jsx(h,{icon:u,title:s("automation.no_findings"),compact:!0}):t.jsx("div",{className:"space-y-4",children:j.map(e=>{const a=o[e];if(!a||a.length===0)return null;const y=B[e]??u;return t.jsxs("div",{children:[t.jsxs("div",{className:"mb-2 flex items-center gap-1.5",children:[t.jsx(y,{className:`h-3.5 w-3.5 ${e==="critical"?"text-[var(--destructive)]":e==="warning"?"text-[var(--warning)]":"text-[var(--info)]"}`}),t.jsxs("span",{className:"text-[11px] font-bold text-[var(--text-primary)]",children:[e," (",a.length,")"]})]}),t.jsx("div",{className:"space-y-2",children:a.map((m,w)=>t.jsx("div",{className:`rounded-[4px] border p-3 ${b[e]??"border-[var(--border)]"} ${F[e]??""}`,children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("span",{className:`mt-0.5 rounded-[4px] border px-1.5 py-0.5 text-[10px] ${b[e]??"border-[var(--border)] text-[var(--text-muted)]"}`,children:e}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block text-xs font-bold text-[var(--text-primary)]",children:m.title}),m.detail&&t.jsx("p",{className:"mt-1 whitespace-pre-wrap text-[11px] text-[var(--text-secondary)]",children:m.detail})]})]})},w))})]},e)})})]})]})}export{X as default};
6
+ */const U=k("GitPullRequest",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]);function M(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 O(n){switch(n){case"COMPLETED":return"text-[var(--accent)]";case"RUNNING":return"text-[var(--accent)]";case"PENDING":return"text-[var(--warning)]";case"FAILED":return"text-[var(--destructive)]";default:return"text-[var(--text-muted)]"}}const B={critical:_,warning:q,info:u},b={critical:"border-[var(--destructive)] text-[var(--destructive)]",warning:"border-[var(--warning)] text-[var(--warning)]",info:"border-[var(--info)] text-[var(--info)]"},F={critical:"bg-[var(--destructive)]/5",warning:"bg-[var(--warning)]/5",info:"bg-[var(--info)]/5"};function Y(){const n=E(),{t:s}=I(),{runId:i}=A(),[r,l]=c.useState(null),[g,p]=c.useState(!0),x=c.useRef(null),v=C(e=>e.eventSeq);if(R(r?s("automation.run_title",{id:r.id}):null),c.useEffect(()=>{if(!i)return;let e=!1;return p(!0),f.get(`web/automation-runs/${i}`).json().then(a=>{e||(l(a),x.current=a)}).catch(()=>{e||l(null)}).finally(()=>{e||p(!1)}),()=>{e=!0}},[i]),c.useEffect(()=>{if(!i||v===0)return;const e=x.current;e&&!["PENDING","RUNNING"].includes(e.status)||f.get(`web/automation-runs/${i}`).json().then(a=>{l(a),x.current=a}).catch(()=>{})},[v,i]),g)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(P,{rows:6})});if(!r)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(h,{icon:L,title:s("automation.run_not_found")})});const d=Array.isArray(r.findings)?r.findings:[],N=D(r.startedAt,r.completedAt),o={},j=["critical","warning","info"];for(const e of d){const a=e.severity||"info";o[a]||(o[a]=[]),o[a].push(e)}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 items-center gap-3",children:[t.jsx("button",{onClick:()=>n(-1),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:t.jsx($,{className:"h-4 w-4"})}),t.jsxs("div",{children:[t.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:s("automation.run_title",{id:r.id})}),r.automationName&&t.jsx("p",{className:"text-[11px] text-[var(--text-muted)]",children:r.automationName})]})]}),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:s("automation.run_metadata")}),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:s("automation.status")}),t.jsxs("span",{className:`mt-0.5 flex items-center gap-1.5 text-xs ${O(r.status)}`,children:[t.jsx("span",{className:`h-2 w-2 rounded-full ${M(r.status)}`}),r.status.toLowerCase()]})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:s("automation.trigger_type")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:r.triggerType})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:s("automation.triggered_at")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:S(r.createdAt)}),t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:T(r.createdAt)})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:s("automation.duration")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:N??"-"})]})]}),t.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[r.taskId&&t.jsxs("button",{onClick:()=>n(`/tasks/${r.taskId}`),className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--accent)] hover:bg-[var(--accent)]/5 transition-colors",children:[t.jsx(G,{className:"h-3 w-3"})," ",s("automation.task_label",{id:r.taskId})]}),r.mrUrl&&t.jsxs("a",{href:r.mrUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--accent)] hover:bg-[var(--accent)]/5 transition-colors",children:[t.jsx(U,{className:"h-3 w-3"})," ",s("automation.merge_request")]})]})]}),t.jsxs("div",{children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:s("automation.findings_title",{count:d.length})}),d.length===0?t.jsx(h,{icon:u,title:s("automation.no_findings"),compact:!0}):t.jsx("div",{className:"space-y-4",children:j.map(e=>{const a=o[e];if(!a||a.length===0)return null;const y=B[e]??u;return t.jsxs("div",{children:[t.jsxs("div",{className:"mb-2 flex items-center gap-1.5",children:[t.jsx(y,{className:`h-3.5 w-3.5 ${e==="critical"?"text-[var(--destructive)]":e==="warning"?"text-[var(--warning)]":"text-[var(--info)]"}`}),t.jsxs("span",{className:"text-[11px] font-bold text-[var(--text-primary)]",children:[e," (",a.length,")"]})]}),t.jsx("div",{className:"space-y-2",children:a.map((m,w)=>t.jsx("div",{className:`rounded-[4px] border p-3 ${b[e]??"border-[var(--border)]"} ${F[e]??""}`,children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("span",{className:`mt-0.5 rounded-[4px] border px-1.5 py-0.5 text-[10px] ${b[e]??"border-[var(--border)] text-[var(--text-muted)]"}`,children:e}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:"block text-xs font-bold text-[var(--text-primary)]",children:m.title}),m.detail&&t.jsx("p",{className:"mt-1 whitespace-pre-wrap text-[11px] text-[var(--text-secondary)]",children:m.detail})]})]})},w))})]},e)})})]})]})}export{Y as default};
@@ -1 +1 @@
1
- import{a as u,B as h,f as g,r as s,h as v,j as e}from"./index-D3EF0BU0.js";function j(){const{t:r}=u(),[l]=h(),i=g(),a=l.get("token"),[n,o]=s.useState("loading"),[m,p]=s.useState(""),[b,c]=s.useState("");return s.useEffect(()=>{if(!a){o("error"),c(r("bind.no_token"));return}v.post("web/profile/bind-platform",{json:{token:a}}).json().then(t=>{p(t.platform),o("success")}).catch(async t=>{var x;o("error");try{const d=await((x=t.response)==null?void 0:x.json());c((d==null?void 0:d.message)??r("bind.error"))}catch{c(t instanceof Error?t.message:r("bind.error"))}})},[a]),e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--bg-primary)] px-4 font-mono",children:e.jsxs("div",{className:"w-full max-w-[400px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-6",children:[e.jsx("h1",{className:"mb-4 text-sm text-[var(--text-primary)]",children:r("bind.title")}),n==="loading"&&e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("bind.linking")}),n==="success"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-[4px] border border-green-500/30 bg-green-500/10 px-3 py-2 text-xs text-green-400",children:r("bind.success")}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:r("bind.success_detail").replace("{platform}",m)}),e.jsx("button",{onClick:()=>i("/home"),className:"rounded-[4px] bg-[var(--accent)] px-3 py-2 text-xs text-black hover:opacity-90 transition-opacity",children:r("bind.back_to_home")})]}),n==="error"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400 break-words",children:b||r("bind.invalid_token")}),e.jsx("button",{onClick:()=>i("/home"),className:"rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("bind.back_to_home")})]})]})})}export{j as default};
1
+ import{a as u,B as h,f as g,r as s,h as v,j as e}from"./index-PZwTchr_.js";function j(){const{t:r}=u(),[l]=h(),i=g(),a=l.get("token"),[n,o]=s.useState("loading"),[m,p]=s.useState(""),[b,c]=s.useState("");return s.useEffect(()=>{if(!a){o("error"),c(r("bind.no_token"));return}v.post("web/profile/bind-platform",{json:{token:a}}).json().then(t=>{p(t.platform),o("success")}).catch(async t=>{var x;o("error");try{const d=await((x=t.response)==null?void 0:x.json());c((d==null?void 0:d.message)??r("bind.error"))}catch{c(t instanceof Error?t.message:r("bind.error"))}})},[a]),e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-[var(--bg-primary)] px-4 font-mono",children:e.jsxs("div",{className:"w-full max-w-[400px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 md:p-6",children:[e.jsx("h1",{className:"mb-4 text-sm text-[var(--text-primary)]",children:r("bind.title")}),n==="loading"&&e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:r("bind.linking")}),n==="success"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-[4px] border border-green-500/30 bg-green-500/10 px-3 py-2 text-xs text-green-400",children:r("bind.success")}),e.jsx("p",{className:"text-xs text-[var(--text-secondary)]",children:r("bind.success_detail").replace("{platform}",m)}),e.jsx("button",{onClick:()=>i("/home"),className:"rounded-[4px] bg-[var(--accent)] px-3 py-2 text-xs text-black hover:opacity-90 transition-opacity",children:r("bind.back_to_home")})]}),n==="error"&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400 break-words",children:b||r("bind.invalid_token")}),e.jsx("button",{onClick:()=>i("/home"),className:"rounded-[4px] border border-[var(--border)] px-3 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:r("bind.back_to_home")})]})]})})}export{j as default};