@overlordai/server 1.0.139 → 1.0.141

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/database/migrations/010-plan-review-mode.sql +11 -0
  2. package/database/migrations/012-schema-index-fixes.sql +72 -0
  3. package/dist/adapters/adapter.module.d.ts.map +1 -1
  4. package/dist/adapters/adapter.module.js +3 -0
  5. package/dist/adapters/adapter.module.js.map +1 -1
  6. package/dist/adapters/command-parser.utils.d.ts +11 -0
  7. package/dist/adapters/command-parser.utils.d.ts.map +1 -1
  8. package/dist/adapters/command-parser.utils.js +58 -1
  9. package/dist/adapters/command-parser.utils.js.map +1 -1
  10. package/dist/adapters/help-text.d.ts.map +1 -1
  11. package/dist/adapters/help-text.js +8 -6
  12. package/dist/adapters/help-text.js.map +1 -1
  13. package/dist/adapters/lark/lark-message.parser.d.ts +7 -7
  14. package/dist/adapters/lark/lark-message.parser.d.ts.map +1 -1
  15. package/dist/adapters/lark/lark-message.parser.js +11 -7
  16. package/dist/adapters/lark/lark-message.parser.js.map +1 -1
  17. package/dist/adapters/lark/lark.adapter.d.ts +3 -1
  18. package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
  19. package/dist/adapters/lark/lark.adapter.js +28 -12
  20. package/dist/adapters/lark/lark.adapter.js.map +1 -1
  21. package/dist/adapters/nlu.service.d.ts +20 -0
  22. package/dist/adapters/nlu.service.d.ts.map +1 -0
  23. package/dist/adapters/nlu.service.js +231 -0
  24. package/dist/adapters/nlu.service.js.map +1 -0
  25. package/dist/adapters/slack/slack-message.parser.d.ts.map +1 -1
  26. package/dist/adapters/slack/slack-message.parser.js +4 -0
  27. package/dist/adapters/slack/slack-message.parser.js.map +1 -1
  28. package/dist/adapters/slack/slack.adapter.d.ts +3 -1
  29. package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
  30. package/dist/adapters/slack/slack.adapter.js +43 -14
  31. package/dist/adapters/slack/slack.adapter.js.map +1 -1
  32. package/dist/adapters/slack/slack.controller.js +8 -8
  33. package/dist/adapters/slack/slack.controller.js.map +1 -1
  34. package/dist/common/project-validation.d.ts +13 -3
  35. package/dist/common/project-validation.d.ts.map +1 -1
  36. package/dist/common/project-validation.js +21 -5
  37. package/dist/common/project-validation.js.map +1 -1
  38. package/dist/database/migration-runner.d.ts.map +1 -1
  39. package/dist/database/migration-runner.js +10 -1
  40. package/dist/database/migration-runner.js.map +1 -1
  41. package/dist/database/repositories/project.repository.d.ts +2 -0
  42. package/dist/database/repositories/project.repository.d.ts.map +1 -1
  43. package/dist/database/repositories/project.repository.js +13 -0
  44. package/dist/database/repositories/project.repository.js.map +1 -1
  45. package/dist/database/repositories/task.repository.d.ts +11 -2
  46. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  47. package/dist/database/repositories/task.repository.js +64 -8
  48. package/dist/database/repositories/task.repository.js.map +1 -1
  49. package/dist/dispatcher/dispatcher.service.d.ts +2 -0
  50. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  51. package/dist/dispatcher/dispatcher.service.js +79 -0
  52. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  53. package/dist/dispatcher/scheduler.service.d.ts.map +1 -1
  54. package/dist/dispatcher/scheduler.service.js +3 -0
  55. package/dist/dispatcher/scheduler.service.js.map +1 -1
  56. package/dist/dispatcher/task-creation.service.d.ts +13 -2
  57. package/dist/dispatcher/task-creation.service.d.ts.map +1 -1
  58. package/dist/dispatcher/task-creation.service.js +207 -21
  59. package/dist/dispatcher/task-creation.service.js.map +1 -1
  60. package/dist/dispatcher/task-lifecycle.service.d.ts +5 -1
  61. package/dist/dispatcher/task-lifecycle.service.d.ts.map +1 -1
  62. package/dist/dispatcher/task-lifecycle.service.js +231 -1
  63. package/dist/dispatcher/task-lifecycle.service.js.map +1 -1
  64. package/dist/events/event-types.d.ts +8 -0
  65. package/dist/events/event-types.d.ts.map +1 -1
  66. package/dist/events/event-types.js +1 -0
  67. package/dist/events/event-types.js.map +1 -1
  68. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  69. package/dist/notifier/notification-consumer.js +5 -0
  70. package/dist/notifier/notification-consumer.js.map +1 -1
  71. package/dist/notifier/notification-event-listener.d.ts +2 -1
  72. package/dist/notifier/notification-event-listener.d.ts.map +1 -1
  73. package/dist/notifier/notification-event-listener.js +14 -0
  74. package/dist/notifier/notification-event-listener.js.map +1 -1
  75. package/dist/notifier/notifier.service.d.ts +1 -0
  76. package/dist/notifier/notifier.service.d.ts.map +1 -1
  77. package/dist/notifier/notifier.service.js +8 -0
  78. package/dist/notifier/notifier.service.js.map +1 -1
  79. package/dist/notifier/template.service.d.ts +4 -0
  80. package/dist/notifier/template.service.d.ts.map +1 -1
  81. package/dist/notifier/template.service.js +32 -0
  82. package/dist/notifier/template.service.js.map +1 -1
  83. package/dist/web/admin/admin-project.controller.d.ts.map +1 -1
  84. package/dist/web/admin/admin-project.controller.js +15 -0
  85. package/dist/web/admin/admin-project.controller.js.map +1 -1
  86. package/dist/web/dashboard.service.js +3 -3
  87. package/dist/web/frame-handlers/index.d.ts +1 -0
  88. package/dist/web/frame-handlers/index.d.ts.map +1 -1
  89. package/dist/web/frame-handlers/index.js +3 -1
  90. package/dist/web/frame-handlers/index.js.map +1 -1
  91. package/dist/web/frame-handlers/progress.handler.d.ts.map +1 -1
  92. package/dist/web/frame-handlers/progress.handler.js +18 -0
  93. package/dist/web/frame-handlers/progress.handler.js.map +1 -1
  94. package/dist/web/frame-handlers/review-report.handler.d.ts +15 -0
  95. package/dist/web/frame-handlers/review-report.handler.d.ts.map +1 -0
  96. package/dist/web/frame-handlers/review-report.handler.js +140 -0
  97. package/dist/web/frame-handlers/review-report.handler.js.map +1 -0
  98. package/dist/web/frame-handlers/stage-confirm.handler.d.ts +3 -1
  99. package/dist/web/frame-handlers/stage-confirm.handler.d.ts.map +1 -1
  100. package/dist/web/frame-handlers/stage-confirm.handler.js +18 -4
  101. package/dist/web/frame-handlers/stage-confirm.handler.js.map +1 -1
  102. package/dist/web/project.controller.js +1 -1
  103. package/dist/web/project.controller.js.map +1 -1
  104. package/dist/web/task.controller.d.ts +116 -2
  105. package/dist/web/task.controller.d.ts.map +1 -1
  106. package/dist/web/task.controller.js +172 -8
  107. package/dist/web/task.controller.js.map +1 -1
  108. package/dist/web/web-event.service.d.ts +2 -1
  109. package/dist/web/web-event.service.d.ts.map +1 -1
  110. package/dist/web/web-event.service.js +13 -0
  111. package/dist/web/web-event.service.js.map +1 -1
  112. package/dist/web/worker-channel.gateway.d.ts +2 -1
  113. package/dist/web/worker-channel.gateway.d.ts.map +1 -1
  114. package/dist/web/worker-channel.gateway.js +6 -3
  115. package/dist/web/worker-channel.gateway.js.map +1 -1
  116. package/package.json +4 -4
  117. package/public/assets/AccessTokensPage-wTxicSeE.js +1 -0
  118. package/public/assets/AdminPage-CBovEOm4.js +1 -0
  119. package/public/assets/{AgentCliPage-BR2YXUlN.js → AgentCliPage-DfqlFdFN.js} +1 -1
  120. package/public/assets/{ApiReferencePage-CWGvx9sZ.js → ApiReferencePage-7TUHB8sC.js} +1 -1
  121. package/public/assets/{ArchitecturePage-CVipZPS8.js → ArchitecturePage-CycvJ1HW.js} +1 -1
  122. package/public/assets/AuditLogPage-CqqCDd8o.js +1 -0
  123. package/public/assets/{BindPlatformPage-BDisYk6H.js → BindPlatformPage-BV5wNIi2.js} +1 -1
  124. package/public/assets/{BotIntegrationPage-DoqcdqwE.js → BotIntegrationPage-B2bQytks.js} +1 -1
  125. package/public/assets/{BotManage-DRo01WBu.js → BotManage-BBBrqdT_.js} +2 -2
  126. package/public/assets/{BotSetupPage-nornZgmt.js → BotSetupPage-DdDPniAd.js} +1 -1
  127. package/public/assets/{ChangelogPage-Bd5TviZ8.js → ChangelogPage-D5YE3BFH.js} +1 -1
  128. package/public/assets/CliReferencePage-yJgtPpFn.js +17 -0
  129. package/public/assets/ConfirmStageDialog-BOGr-qSN.js +12 -0
  130. package/public/assets/{DeploymentPage-3YMjpAFo.js → DeploymentPage-C0CXq8yl.js} +1 -1
  131. package/public/assets/{DevWorkflowPage-DFQTZVP9.js → DevWorkflowPage-I4Io3nYz.js} +1 -1
  132. package/public/assets/{DeveloperManage-BnMIj_g_.js → DeveloperManage-Cy0LRyHh.js} +2 -2
  133. package/public/assets/{DeveloperSetupPage-Cw4nLpIm.js → DeveloperSetupPage-DzGCH2XG.js} +1 -1
  134. package/public/assets/{DocsIndexPage-cK28EfKj.js → DocsIndexPage-PIEcc9gX.js} +2 -2
  135. package/public/assets/DocsLayout-ChIliA9A.js +1 -0
  136. package/public/assets/{DocsPrimitives-2csfHzW_.js → DocsPrimitives-BMgSDhur.js} +1 -1
  137. package/public/assets/EditProjectPage-D0rfXGZR.js +2 -0
  138. package/public/assets/{EmptyState-ADwWEXdn.js → EmptyState-Di2nOiOt.js} +1 -1
  139. package/public/assets/{EnvVariablesPage-D7HonzNe.js → EnvVariablesPage-EmfRwttc.js} +1 -1
  140. package/public/assets/HomePage-CeOmNhkc.js +1 -0
  141. package/public/assets/{InfoRow-CmtJW4M9.js → InfoRow-5vQ-_wWv.js} +1 -1
  142. package/public/assets/{InstallationPage-CJ-YdcrX.js → InstallationPage-CUbe1AD-.js} +1 -1
  143. package/public/assets/{LandingPage-CWdPeZv-.js → LandingPage-DSHGbkXw.js} +7 -12
  144. package/public/assets/{LocalDevelopmentPage-BDl2Ktyc.js → LocalDevelopmentPage-fialPCnX.js} +1 -1
  145. package/public/assets/{LoginPage-DgF9ENzx.js → LoginPage-C4oz9yjV.js} +1 -1
  146. package/public/assets/{MetricBar-DoUTAkIk.js → MetricBar-ByQYVWVi.js} +1 -1
  147. package/public/assets/{NotFoundPage-BUrnSFza.js → NotFoundPage-BeayCSH7.js} +1 -1
  148. package/public/assets/{OnboardingGuide-E87DHNsp.js → OnboardingGuide-CqcX04SL.js} +1 -1
  149. package/public/assets/{PermissionsPage-DKhdHNDg.js → PermissionsPage-Bb2CYzMf.js} +1 -1
  150. package/public/assets/{PipelineConfigPage-Dn-fh0Ia.js → PipelineConfigPage-DwY__0Ag.js} +2 -2
  151. package/public/assets/PipelineEditorPage-FkckQpQX.js +3 -0
  152. package/public/assets/PlanPage-BOzGJd2h.js +1 -0
  153. package/public/assets/ProfilePage-CT_kk3a8.js +1 -0
  154. package/public/assets/ProjectDetailPage-B-t7L84T.js +7 -0
  155. package/public/assets/ProjectListPage-C2uStUVE.js +6 -0
  156. package/public/assets/PtyTerminal-BYXg_ahq.js +38 -0
  157. package/public/assets/QuickAuth-CohuPihd.js +1 -0
  158. package/public/assets/{RemoveMemberConfirmDialog-Brv6Th8M.js → RemoveMemberConfirmDialog-DLq9g7Td.js} +1 -1
  159. package/public/assets/ReviewAggregatePage-dWQb52Df.js +11 -0
  160. package/public/assets/ReviewPage-DtdWSBgK.js +1 -0
  161. package/public/assets/Select-BAl7H-Y0.js +1 -0
  162. package/public/assets/{SettingsPage-CZwwUAeC.js → SettingsPage-qCfF6rzU.js} +1 -1
  163. package/public/assets/{Skeleton-DQWHHk9G.js → Skeleton-DA5o8Wqi.js} +1 -1
  164. package/public/assets/{SkillPage-CKbqXAb6.js → SkillPage-C6p0dXbu.js} +1 -1
  165. package/public/assets/TaskDetailPage-D4sGfico.js +21 -0
  166. package/public/assets/TaskGuidePage-COT0chCI.js +19 -0
  167. package/public/assets/TaskListPage-Bvq5ow7r.js +1 -0
  168. package/public/assets/{TaskStatusBadge-Cd9AKReP.js → TaskStatusBadge-BdNFkrjU.js} +1 -1
  169. package/public/assets/TerminalHomePage-XJ5daAJC.js +6 -0
  170. package/public/assets/TokenManage-JLFD8xAN.js +1 -0
  171. package/public/assets/{Tooltip-1tjISJAN.js → Tooltip-Bl8LCgWr.js} +1 -1
  172. package/public/assets/{TotpSetupPage-Dme4c3tv.js → TotpSetupPage-BGE6pDdn.js} +1 -1
  173. package/public/assets/{WorkerDetailPage-CgXIs1_M.js → WorkerDetailPage-Dd-IbO6r.js} +1 -1
  174. package/public/assets/{WorkerListPage-CM1GqeN7.js → WorkerListPage-e4P55nJc.js} +2 -2
  175. package/public/assets/{WorkerOperationsPage-uArfsFAY.js → WorkerOperationsPage-ioBw_i1j.js} +1 -1
  176. package/public/assets/WorkerSetupGuidePage-CRicnVVm.js +1 -0
  177. package/public/assets/{WorkerSetupPage-DTQvCeTf.js → WorkerSetupPage-DXOlNqUZ.js} +1 -1
  178. package/public/assets/{agent-type-options-l4HLs4lb.js → agent-type-options-BVIYXf2V.js} +1 -1
  179. package/public/assets/{arrow-left-D2z6WXle.js → arrow-left-CTo0KHGY.js} +1 -1
  180. package/public/assets/{arrow-right-BBWwGkdK.js → arrow-right-C9oQyTKw.js} +1 -1
  181. package/public/assets/{bot-haRrziLf.js → bot-B301pflD.js} +1 -1
  182. package/public/assets/chevron-down-B0Leook1.js +6 -0
  183. package/public/assets/{chevron-left-B11s6IVD.js → chevron-left-59qctCaF.js} +1 -1
  184. package/public/assets/{chevron-right-CxMAZVfy.js → chevron-right-XfJqITCa.js} +1 -1
  185. package/public/assets/chevron-up-BW2PVBfH.js +6 -0
  186. package/public/assets/{copy-CukaPL3b.js → copy-DEWCNXDf.js} +1 -1
  187. package/public/assets/{download-CtBIkCC6.js → download-7d5kMwpH.js} +1 -1
  188. package/public/assets/{external-link-BYaw3Ovt.js → external-link-DjBNV7ga.js} +1 -1
  189. package/public/assets/{file-text-CwpyLWx2.js → file-text-DHEz_RFq.js} +1 -1
  190. package/public/assets/{git-fork-DjDcRdWO.js → git-fork-cRLOBM6a.js} +1 -1
  191. package/public/assets/index-eKvCyU64.js +252 -0
  192. package/public/assets/index-kJfGgL_V.css +1 -0
  193. package/public/assets/{key-D-EBAM_S.js → key-D5BbAzTj.js} +1 -1
  194. package/public/assets/{loader-circle-PEOtoIoF.js → loader-circle-B_f_h4fq.js} +1 -1
  195. package/public/assets/{pencil-BObnoNZc.js → pencil-CTTWvWuS.js} +1 -1
  196. package/public/assets/play-Cqf1Kvc7.js +6 -0
  197. package/public/assets/{plus-JnJTWOh0.js → plus-DwBKB0x6.js} +1 -1
  198. package/public/assets/{rotate-ccw-9hl77Xny.js → rotate-ccw-CZR8KOZn.js} +1 -1
  199. package/public/assets/{scroll-text-w6v00sw0.js → scroll-text-BeQeZkLb.js} +1 -1
  200. package/public/assets/{settings-DqX6KTB6.js → settings-CsdOqob5.js} +1 -1
  201. package/public/assets/skip-forward-BqiRx2ZQ.js +6 -0
  202. package/public/assets/status-colors-yfNzOmz-.js +1 -0
  203. package/public/assets/task-constants-BWLt-ivk.js +1 -0
  204. package/public/assets/task.store-BDZwafPm.js +1 -0
  205. package/public/assets/{trash-2-BH7Uy_FR.js → trash-2-CXPG2vQr.js} +1 -1
  206. package/public/assets/{useFetch-C6aoI2YR.js → useFetch-CVFGit7a.js} +1 -1
  207. package/public/assets/{users-N89uFOml.js → users-DmefWRaM.js} +1 -1
  208. package/public/assets/{wifi-B0GLkoI5.js → wifi-BJIfMBKB.js} +1 -1
  209. package/public/assets/{workflow-CPFrQB2p.js → workflow-CuZasRLA.js} +1 -1
  210. package/public/index.html +2 -2
  211. package/public/sw.js +1 -1
  212. package/public/assets/AccessTokensPage-DMsQKvGG.js +0 -1
  213. package/public/assets/AdminPage-DqZMqDDh.js +0 -1
  214. package/public/assets/AuditLogPage-CCUK_lWo.js +0 -1
  215. package/public/assets/CliReferencePage-C6NT0ynG.js +0 -16
  216. package/public/assets/DocsLayout-BVtSzaqN.js +0 -1
  217. package/public/assets/EditProjectPage-D4LeLkUK.js +0 -2
  218. package/public/assets/HomePage-CFVWSe09.js +0 -1
  219. package/public/assets/MobileTerminalShell-BSE0-T35.js +0 -49
  220. package/public/assets/PipelineEditorPage-DY945ZLB.js +0 -3
  221. package/public/assets/ProfilePage-wMwqf3xq.js +0 -1
  222. package/public/assets/ProjectDetailPage-Czbvi0xm.js +0 -7
  223. package/public/assets/ProjectListPage-qT9qvnxf.js +0 -6
  224. package/public/assets/QuickAuth-BsMxofrA.js +0 -1
  225. package/public/assets/Select-BfjWmQST.js +0 -6
  226. package/public/assets/TaskDetailPage-CskFoYAc.js +0 -26
  227. package/public/assets/TaskListPage-T7DWBtM3.js +0 -1
  228. package/public/assets/TerminalHomePage-ClJFAaTn.js +0 -11
  229. package/public/assets/TokenManage-Cj9UuqyE.js +0 -1
  230. package/public/assets/WorkerSetupGuidePage-CyW_9sIh.js +0 -6
  231. package/public/assets/index-BUjb3VF-.css +0 -1
  232. package/public/assets/index-GPUbNOkg.js +0 -242
  233. package/public/assets/status-colors-C_RhLQKM.js +0 -1
  234. package/public/assets/task-constants-LNckgIqT.js +0 -1
  235. /package/public/assets/{MobileTerminalShell-6GBZ9nXN.css → PtyTerminal-6GBZ9nXN.css} +0 -0
@@ -1,3 +1,3 @@
1
- import{j as e}from"./index-GPUbNOkg.js";import{a as s}from"./DocsPrimitives-2csfHzW_.js";import"./copy-CukaPL3b.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-eKvCyU64.js";import{a as s}from"./DocsPrimitives-BMgSDhur.js";import"./copy-DEWCNXDf.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-GPUbNOkg.js";import{Q as c}from"./QuickAuth-BsMxofrA.js";import{P as h}from"./plus-JnJTWOh0.js";import"./copy-CukaPL3b.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-eKvCyU64.js";import{Q as c}from"./QuickAuth-CohuPihd.js";import{P as h}from"./plus-DwBKB0x6.js";import"./copy-DEWCNXDf.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-GPUbNOkg.js";import{C as s}from"./DocsPrimitives-2csfHzW_.js";import"./copy-CukaPL3b.js";const r=` ┌──────────────────┐
1
+ import{j as e}from"./index-eKvCyU64.js";import{C as s}from"./DocsPrimitives-BMgSDhur.js";import"./copy-DEWCNXDf.js";const r=` ┌──────────────────┐
2
2
  │ Developer │
3
3
  │ (create / attach) │
4
4
  └──┬─────┬──────┬──┘
@@ -0,0 +1 @@
1
+ import{a as C,r,h as S,j as e,x as k}from"./index-eKvCyU64.js";import{S as L}from"./Select-BAl7H-Y0.js";import{E}from"./EmptyState-Di2nOiOt.js";import{T}from"./Skeleton-DA5o8Wqi.js";import{S as A}from"./scroll-text-BeQeZkLb.js";import{C as F}from"./chevron-left-59qctCaF.js";import{C as P}from"./chevron-right-XfJqITCa.js";import"./chevron-down-B0Leook1.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 +1 @@
1
- import{a as u,B as h,f as g,r as s,h as v,j as e}from"./index-GPUbNOkg.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-eKvCyU64.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 +1 @@
1
- import{j as e}from"./index-GPUbNOkg.js";function t(){return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// bot integration"}),e.jsx("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:"advanced bot integration topics — interactive cards, troubleshooting, and the adapter pattern. for initial bot setup (lark, slack), see the bot setup guide."})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> interactive cards"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when a pipeline reaches a stage that requires user input, the bot sends an interactive card. there are three card modes:"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"confirm mode"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"sent when a stage needs explicit approval before proceeding. the card shows a summary of what will happen and two buttons:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] pl-4",children:[e.jsxs("li",{children:["- ",e.jsx("span",{className:"text-[var(--accent)]",children:"confirm"})," — advance the pipeline to the next stage"]}),e.jsxs("li",{children:["- ",e.jsx("span",{className:"text-[var(--accent)]",children:"cancel"})," — abort the pipeline"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"example: a deploy stage waiting for human sign-off before pushing to production. the bot updates the card in-place after the user responds, replacing the buttons with the outcome."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"choice mode"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"sent when the pipeline branches and the user must pick one of several options. each option is rendered as a button. the selected option determines which branch the pipeline follows."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"example: choosing a deploy target (staging / production / canary) mid-pipeline."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"input mode"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"sent when the pipeline needs free-form text input from the user. the bot sends a card with a link to the web dashboard where the user submits their input. the submitted value is injected into the pipeline context as a variable."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"example: providing a hotfix version number or a rollback reason."})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> card lifecycle"}),e.jsxs("div",{className:"space-y-2 text-xs text-[var(--text-secondary)]",children:[e.jsx("p",{children:"1. bot sends the card when the stage starts"}),e.jsx("p",{children:"2. card remains active until a user responds or the stage times out (default: 10 minutes)"}),e.jsx("p",{children:"3. on response, the bot updates the card to show the result and the pipeline continues"}),e.jsx("p",{children:"4. if the stage times out, the card is updated with a timeout message and the pipeline follows the timeout path (fail or fallback)"})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"only users with the appropriate project role can interact with cards. unauthorized clicks return an ephemeral error."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> notification routing"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when a task progresses through its lifecycle, the bot sends notifications to relevant parties. routing depends on who created the task and who is assigned to execute it."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"event"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"method"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"executor"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"creator (if ≠)"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"project chats"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"assigned"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"running"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"stage_changed"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"completed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat)"}),e.jsx("td",{className:"py-2",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"failed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat)"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"cancelled"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"suspended"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"resumed"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"stage_confirm_required"}),e.jsx("td",{className:"py-2 pr-4",children:"new dm"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm only)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]})]})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"creator = executor"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"intermediate updates (assigned, running, stage changes) update the original task card in-place. important events (completed, failed, cancelled, suspended) send a new message. stage confirmation requests are always sent as a dm."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"creator ≠ executor"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when a task is assigned to another developer via @mention, the executor receives all notifications via dm. the creator only receives completed and failed notifications in the source chat. stage confirmations go exclusively to the executor."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"stage confirmation timeout"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"if the executor does not respond to a stage confirmation within 10 minutes, the task is automatically marked as failed with a timeout error."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"web-created tasks"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"tasks created via the web dashboard also receive DM notifications if the developer has linked their Lark or Slack account. both in-app (bell icon) and platform DM notifications are delivered."})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"if the target developer has not linked their platform account, notifications fall back to the web dashboard's in-app notification system."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> troubleshooting"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"common issues when running bots in production:"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"symptom"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"cause"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"fix"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"bot doesn't respond to mentions"}),e.jsx("td",{className:"py-2 pr-4",children:"webhook url not reachable"}),e.jsx("td",{className:"py-2",children:"verify the url is publicly accessible and returns 200 to the platform's verification challenge"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"401 on webhook"}),e.jsx("td",{className:"py-2 pr-4",children:"wrong verification token / signing secret"}),e.jsx("td",{className:"py-2",children:"check webhooktoken matches the platform's verification token (lark) or signing secret (slack)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"commands work but no cards"}),e.jsx("td",{className:"py-2 pr-4",children:"missing card event subscription"}),e.jsx("td",{className:"py-2",children:"lark: set callback configuration request url to your webhook url. slack: enable interactivity and set the interact url"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"user not found error"}),e.jsx("td",{className:"py-2 pr-4",children:"developer account not linked"}),e.jsx("td",{className:"py-2",children:"set platform_uid on the developer record to their platform user id"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"bot responds in wrong project"}),e.jsx("td",{className:"py-2 pr-4",children:"chat group bound to wrong project"}),e.jsx("td",{className:"py-2",children:"update the binding via admin - bot management or the bindings api"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"duplicate messages"}),e.jsx("td",{className:"py-2 pr-4",children:"multiple bot instances handling same event"}),e.jsx("td",{className:"py-2",children:"ensure only one overlord instance processes webhooks, or use the built-in dedup"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"card buttons do nothing"}),e.jsx("td",{className:"py-2 pr-4",children:"interact url misconfigured"}),e.jsx("td",{className:"py-2",children:"slack: check interactivity request url. lark: check card action callback url"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"/overlord slash command 404"}),e.jsx("td",{className:"py-2 pr-4",children:"command url wrong"}),e.jsx("td",{className:"py-2",children:"verify the slash command request url matches your-server/webhook/slack/commands"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"bot stops responding after deploy"}),e.jsx("td",{className:"py-2 pr-4",children:"webhook url changed"}),e.jsx("td",{className:"py-2",children:"update the request url in the platform's app settings to match the new server address"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> adapter pattern"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the bot system uses an adapter pattern internally. each platform (lark, slack, discord) implements an adapter interface:"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"handleWebhook(req)"}),e.jsx("span",{children:"— receive platform events, verify signatures, parse into commands"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"sendMessage(chatId, content)"}),e.jsx("span",{children:"— send messages (text or cards)"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"updateMessage(msgId, content)"}),e.jsx("span",{children:"— update existing messages (progress updates)"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"resolveUser(platformUid)"}),e.jsx("span",{children:"— map platform user id to overlord developer"})]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"to add a custom platform adapter, implement the interface and register it in the bot service config. see the lark and slack adapters in the codebase for reference."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> multi-bot architecture"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"overlord supports multiple bot instances across different platforms simultaneously. each project or group can have its own bot. all bots share the same overlord backend."}),e.jsxs("div",{className:"space-y-2 text-xs text-[var(--text-secondary)]",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"lark"})," — single webhook url (/webhook/lark), bot identified by app_id in the request payload"]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"slack"})," — separate endpoints for events, interactivity, and commands (/webhook/slack/events, /webhook/slack/interact, /webhook/slack/commands), bot identified by app_id in the request headers"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"you can run multiple bots on the same platform (e.g., one slack bot per team) by registering each with a unique app id. a discord adapter is planned for a future release."})]})]})]})}export{t as default};
1
+ import{j as e}from"./index-eKvCyU64.js";function t(){return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// bot integration"}),e.jsx("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:"advanced bot integration topics — interactive cards, troubleshooting, and the adapter pattern. for initial bot setup (lark, slack), see the bot setup guide."})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> interactive cards"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when a pipeline reaches a stage that requires user input, the bot sends an interactive card. there are three card modes:"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"confirm mode"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"sent when a stage needs explicit approval before proceeding. the card shows a summary of what will happen and two buttons:"}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] pl-4",children:[e.jsxs("li",{children:["- ",e.jsx("span",{className:"text-[var(--accent)]",children:"confirm"})," — advance the pipeline to the next stage"]}),e.jsxs("li",{children:["- ",e.jsx("span",{className:"text-[var(--accent)]",children:"cancel"})," — abort the pipeline"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"example: a deploy stage waiting for human sign-off before pushing to production. the bot updates the card in-place after the user responds, replacing the buttons with the outcome."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"choice mode"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"sent when the pipeline branches and the user must pick one of several options. each option is rendered as a button. the selected option determines which branch the pipeline follows."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"example: choosing a deploy target (staging / production / canary) mid-pipeline."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"input mode"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"sent when the pipeline needs free-form text input from the user. the bot sends a card with a link to the web dashboard where the user submits their input. the submitted value is injected into the pipeline context as a variable."}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"example: providing a hotfix version number or a rollback reason."})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> card lifecycle"}),e.jsxs("div",{className:"space-y-2 text-xs text-[var(--text-secondary)]",children:[e.jsx("p",{children:"1. bot sends the card when the stage starts"}),e.jsx("p",{children:"2. card remains active until a user responds or the stage times out (default: 10 minutes)"}),e.jsx("p",{children:"3. on response, the bot updates the card to show the result and the pipeline continues"}),e.jsx("p",{children:"4. if the stage times out, the card is updated with a timeout message and the pipeline follows the timeout path (fail or fallback)"})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"only users with the appropriate project role can interact with cards. unauthorized clicks return an ephemeral error."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> notification routing"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when a task progresses through its lifecycle, the bot sends notifications to relevant parties. routing depends on who created the task and who is assigned to execute it."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"event"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"method"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"executor"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"creator (if ≠)"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"project chats"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"assigned"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"running"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"stage_changed"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"completed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat)"}),e.jsx("td",{className:"py-2",children:"yes"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"failed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat)"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"cancelled"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"suspended"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"resumed"}),e.jsx("td",{className:"py-2 pr-4",children:"card update"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"stage_confirm_required"}),e.jsx("td",{className:"py-2 pr-4",children:"new dm"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm only)"}),e.jsx("td",{className:"py-2 pr-4",children:"—"}),e.jsx("td",{className:"py-2",children:"—"})]})]})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"creator = executor"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"intermediate updates (assigned, running, stage changes) update the original task card in-place. important events (completed, failed, cancelled, suspended) send a new message. stage confirmation requests are always sent as a dm."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"creator ≠ executor"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"when a task is assigned to another developer via @mention, the executor receives all notifications via dm. the creator only receives completed and failed notifications in the source chat. stage confirmations go exclusively to the executor."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"stage confirmation timeout"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"if the executor does not respond to a stage confirmation within 10 minutes, the task is automatically marked as failed with a timeout error."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"web-created tasks"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"tasks created via the web dashboard also receive DM notifications if the developer has linked their Lark or Slack account. both in-app (bell icon) and platform DM notifications are delivered."})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"if the target developer has not linked their platform account, notifications fall back to the web dashboard's in-app notification system."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> plan and review commands"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["in addition to ",e.jsx("span",{className:"text-[var(--accent)]",children:"develop"})," and ",e.jsx("span",{className:"text-[var(--accent)]",children:"fork"}),", the bot supports two higher-level commands:"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"plan"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["starts an interactive planning session where an ai agent reads the project codebase, discusses requirements with you, and produces a spec document saved to the project repository. use ",e.jsx("span",{className:"text-[var(--accent)]",children:"--project KEY"})," to specify the target project."]}),e.jsx("code",{className:"block text-xs text-[var(--text-secondary)] bg-[var(--bg-primary)] rounded-[4px] px-3 py-2",children:'@bot plan "implement user authentication system" --project WEB'})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"review"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"triggers cross-model code review on a completed develop task. each specified agent runs a parallel review task and produces a structured report. only completed develop tasks can be reviewed."}),e.jsx("code",{className:"block text-xs text-[var(--text-secondary)] bg-[var(--bg-primary)] rounded-[4px] px-3 py-2",children:"@bot review #42 --agent codex,cursor"})]})]})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> troubleshooting"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"common issues when running bots in production:"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"symptom"}),e.jsx("th",{className:"py-2 pr-4 text-left text-[var(--text-muted)]",children:"cause"}),e.jsx("th",{className:"py-2 text-left text-[var(--text-muted)]",children:"fix"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"bot doesn't respond to mentions"}),e.jsx("td",{className:"py-2 pr-4",children:"webhook url not reachable"}),e.jsx("td",{className:"py-2",children:"verify the url is publicly accessible and returns 200 to the platform's verification challenge"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"401 on webhook"}),e.jsx("td",{className:"py-2 pr-4",children:"wrong verification token / signing secret"}),e.jsx("td",{className:"py-2",children:"check webhooktoken matches the platform's verification token (lark) or signing secret (slack)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"commands work but no cards"}),e.jsx("td",{className:"py-2 pr-4",children:"missing card event subscription"}),e.jsx("td",{className:"py-2",children:"lark: set callback configuration request url to your webhook url. slack: enable interactivity and set the interact url"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"user not found error"}),e.jsx("td",{className:"py-2 pr-4",children:"developer account not linked"}),e.jsx("td",{className:"py-2",children:"set platform_uid on the developer record to their platform user id"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"bot responds in wrong project"}),e.jsx("td",{className:"py-2 pr-4",children:"chat group bound to wrong project"}),e.jsx("td",{className:"py-2",children:"update the binding via admin - bot management or the bindings api"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"duplicate messages"}),e.jsx("td",{className:"py-2 pr-4",children:"multiple bot instances handling same event"}),e.jsx("td",{className:"py-2",children:"ensure only one overlord instance processes webhooks, or use the built-in dedup"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"card buttons do nothing"}),e.jsx("td",{className:"py-2 pr-4",children:"interact url misconfigured"}),e.jsx("td",{className:"py-2",children:"slack: check interactivity request url. lark: check card action callback url"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"/overlord slash command 404"}),e.jsx("td",{className:"py-2 pr-4",children:"command url wrong"}),e.jsx("td",{className:"py-2",children:"verify the slash command request url matches your-server/webhook/slack/commands"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"bot stops responding after deploy"}),e.jsx("td",{className:"py-2 pr-4",children:"webhook url changed"}),e.jsx("td",{className:"py-2",children:"update the request url in the platform's app settings to match the new server address"})]})]})]})})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> adapter pattern"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the bot system uses an adapter pattern internally. each platform (lark, slack, discord) implements an adapter interface:"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"handleWebhook(req)"}),e.jsx("span",{children:"— receive platform events, verify signatures, parse into commands"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"sendMessage(chatId, content)"}),e.jsx("span",{children:"— send messages (text or cards)"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"updateMessage(msgId, content)"}),e.jsx("span",{children:"— update existing messages (progress updates)"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("code",{className:"shrink-0 text-[var(--accent)]",children:"resolveUser(platformUid)"}),e.jsx("span",{children:"— map platform user id to overlord developer"})]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"to add a custom platform adapter, implement the interface and register it in the bot service config. see the lark and slack adapters in the codebase for reference."})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> multi-bot architecture"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"overlord supports multiple bot instances across different platforms simultaneously. each project or group can have its own bot. all bots share the same overlord backend."}),e.jsxs("div",{className:"space-y-2 text-xs text-[var(--text-secondary)]",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"lark"})," — single webhook url (/webhook/lark), bot identified by app_id in the request payload"]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[var(--accent)]",children:"slack"})," — separate endpoints for events, interactivity, and commands (/webhook/slack/events, /webhook/slack/interact, /webhook/slack/commands), bot identified by app_id in the request headers"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"you can run multiple bots on the same platform (e.g., one slack bot per team) by registering each with a unique app id. a discord adapter is planned for a future release."})]})]})]})}export{t as default};
@@ -1,6 +1,6 @@
1
- import{c as W,a as B,r as d,j as e,X as P,h as N,v as G,t as O}from"./index-GPUbNOkg.js";import{S as F}from"./Select-BfjWmQST.js";import{C as R}from"./DocsPrimitives-2csfHzW_.js";import{T as M}from"./trash-2-BH7Uy_FR.js";import{P as q}from"./plus-JnJTWOh0.js";import{E as U}from"./EmptyState-ADwWEXdn.js";import{T as D}from"./Skeleton-DQWHHk9G.js";import{u as K}from"./useFetch-C6aoI2YR.js";import{d as T}from"./status-colors-C_RhLQKM.js";import{B as H}from"./bot-haRrziLf.js";import{P as V}from"./pencil-BObnoNZc.js";import"./copy-CukaPL3b.js";/**
1
+ import{c as W,a as B,r as d,j as e,X as P,h as N,v as G,t as O}from"./index-eKvCyU64.js";import{S as F}from"./Select-BAl7H-Y0.js";import{C as R}from"./DocsPrimitives-BMgSDhur.js";import{T as M}from"./trash-2-CXPG2vQr.js";import{P as q}from"./plus-DwBKB0x6.js";import{E as U}from"./EmptyState-Di2nOiOt.js";import{T as D}from"./Skeleton-DA5o8Wqi.js";import{u as K}from"./useFetch-CVFGit7a.js";import{d as T}from"./status-colors-yfNzOmz-.js";import{B as H}from"./bot-B301pflD.js";import{P as V}from"./pencil-CTTWvWuS.js";import"./chevron-down-B0Leook1.js";import"./copy-DEWCNXDf.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 X=W("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),J=[{value:"lark",label:"lark_(feishu)"},{value:"slack",label:"slack"}];function Q({isOpen:s,onClose:v,onCreated:_,editBot:p,onEditClose:n}){const{t:r}=B(),o=!!p,[E,g]=d.useState(""),[i,b]=d.useState("lark"),[k,j]=d.useState(""),[x,w]=d.useState(""),[h,C]=d.useState(""),[I,$]=d.useState(!1),[S,m]=d.useState("");d.useEffect(()=>{s&&(p?(g(p.name),b(p.platform),j(p.appId),w(""),C("")):(g(""),b("lark"),j(""),w(""),C("")),$(!1),m(""))},[p,s]);function u(){o&&n?n():v()}async function f(){if(m(""),!E.trim()||!k.trim()){m(r("admin.name_and_app_id_required"));return}if(o){if(i==="slack"&&x.trim()&&!x.trim().startsWith("xoxb-")){m(r("admin.invalid_bot_token"));return}}else{if(!x.trim()){m(r("admin.app_secret_required"));return}if(i==="slack"){if(!x.trim().startsWith("xoxb-")){m(r("admin.invalid_bot_token"));return}if(!h.trim()){m(r("admin.signing_secret_required"));return}}}const t={name:E.trim(),platform:i,appId:k.trim()};x.trim()&&(t.appSecret=x.trim()),h.trim()&&(t.webhookToken=h.trim());try{$(!0),o?await N.put(`admin/bots/${p.id}`,{json:t}).json():await N.post("admin/bots",{json:t}).json(),u(),_()}catch(c){const A=c instanceof Error?c.message:r(o?"admin.failed_to_update_bot":"admin.failed_to_create_bot");m(A)}finally{$(!1)}}if(!s)return null;const a=window.location.origin,l=[{label:r("admin.webhook_events_url"),url:`${a}/webhook/slack/events`,hint:r("admin.slack_events_hint")},{label:r("admin.webhook_interact_url"),url:`${a}/webhook/slack/interact`,hint:r("admin.slack_interact_hint")},{label:r("admin.webhook_commands_url"),url:`${a}/webhook/slack/commands`,hint:r("admin.slack_commands_hint")}],L=[{label:r("admin.webhook_request_url"),url:`${a}/webhook/lark`,hint:r("admin.webhook_config_hint_lark")}],y=i==="slack"?l:L;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:u}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h3",{className:"text-sm text-[var(--text-primary)]",children:o?`// ${r("admin.edit_bot")}`:`// ${r("admin.create_bot")}`}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:u,children:e.jsx(P,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[S&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:S}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r("admin.bot_name")}),e.jsx("input",{type:"text",placeholder:"e.g. overlord lark bot",value:E,onChange:t=>g(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)] focus: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:r("admin.platform")}),e.jsx(F,{value:i,onChange:b,options:J,disabled:o})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-3",children:[e.jsx("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:r("admin.webhook_config")}),e.jsx("div",{className:"text-xs text-[var(--text-muted)] mb-3",children:r(i==="slack"?"admin.webhook_config_hint_slack":"admin.webhook_config_hint_lark")}),e.jsx("div",{className:"space-y-2",children:y.map(t=>e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-[var(--text-muted)] mb-1",children:t.label}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("code",{className:"flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-2 py-1 text-xs text-[var(--text-primary)] select-all overflow-x-auto",children:t.url}),e.jsx(R,{text:t.url})]}),e.jsx("div",{className:"mt-0.5 text-xs text-[var(--text-muted)]",children:t.hint})]},t.label))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r("admin.app_id")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r(i==="slack"?"admin.app_id_hint_slack":"admin.app_id_hint_lark")}),e.jsx("input",{type:"text",placeholder:"platform application id",value:k,onChange:t=>j(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)] focus:outline-none focus:border-[var(--accent)]"})]}),i==="slack"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r(o?"admin.bot_token_keep_current":"admin.bot_token")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r("admin.bot_token_hint")}),e.jsx("input",{type:"password",placeholder:r("admin.bot_token_placeholder"),value:x,onChange:t=>w(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)] focus: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:r(o?"admin.signing_secret_keep_current":"admin.signing_secret")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r("admin.signing_secret_hint")}),e.jsx("input",{type:"password",placeholder:r("admin.signing_secret_placeholder"),value:h,onChange:t=>C(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)] focus:outline-none focus:border-[var(--accent)]"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r(o?"admin.app_secret_keep_current":"admin.app_secret")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r("admin.app_secret_hint_lark")}),e.jsx("input",{type:"password",placeholder:"platform application secret",value:x,onChange:t=>w(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)] focus: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:r(o?"admin.encrypt_key_keep_current":"admin.encrypt_key")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r("admin.encrypt_key_hint")}),e.jsx("input",{type:"password",placeholder:r("admin.encrypt_key_placeholder"),value:h,onChange:t=>C(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)] focus:outline-none focus:border-[var(--accent)]"})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:u,children:r("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:I,onClick:f,children:r(I?o?"common.saving":"common.creating":o?"common.save_changes":"common.create")})]})]})]})}function Y({isOpen:s,bot:v,onClose:_,onUpdated:p}){const{t:n}=B(),[r,o]=d.useState([]),[E,g]=d.useState([]),[i,b]=d.useState(!1),[k,j]=d.useState(!1),[x,w]=d.useState(""),[h,C]=d.useState(""),[I,$]=d.useState(""),[S,m]=d.useState(""),u=r.reduce((t,c)=>{const A=t.find(z=>z.platformChatId===c.platformChatId);return A?(A.bindings.push(c),!A.chatName&&c.chatName&&(A.chatName=c.chatName),t):(t.push({platformChatId:c.platformChatId,chatName:c.chatName,bindings:[c]}),t)},[]),f=d.useCallback(async()=>{try{const t=await N.get(`admin/bots/${v.id}/bindings`).json();o(t)}catch{}},[v.id]);d.useEffect(()=>{s&&f()},[s,f]);const a=d.useCallback(async()=>{try{const t=await N.get("web/projects").json();g(t)}catch{}},[]);d.useEffect(()=>{s&&a()},[s,a]);const l=async()=>{if(m(""),!x.trim()||!h.trim()||!I){m(n("admin.chat_binding_all_fields_required"));return}try{b(!0),await N.post(`admin/bots/${v.id}/bindings`,{json:{platformChatId:x.trim(),chatName:h.trim(),projectKey:I}}).json(),w(""),C(""),$(""),j(!1),await f(),p()}catch(t){const c=t instanceof Error?t.message:n("admin.failed_to_add_binding");m(c)}finally{b(!1)}},L=async t=>{try{await N.delete(`admin/bots/${v.id}/bindings`,{json:{platformChatId:t.platformChatId,projectKey:t.projectKey}}),await f(),p()}catch{m(n("admin.failed_to_delete_binding"))}},y=async t=>{try{b(!0),m(""),await N.put(`admin/bots/${v.id}/bindings/default`,{json:{platformChatId:t.platformChatId,projectKey:t.projectKey}}).json(),await f(),p()}catch(c){const A=c instanceof Error?c.message:n("admin.chat_binding_set_default_failed");m(A)}finally{b(!1)}};return s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:_}),e.jsxs("div",{className:"relative z-10 w-full max-w-[600px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h3",{className:"text-sm text-[var(--text-primary)]",children:n("admin.chat_binding_title",{name:v.name})}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:_,children:e.jsx(P,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"px-5 py-5",children:[S&&e.jsx("div",{className:"mb-4 rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:S}),r.length===0&&!k?e.jsx("p",{className:"py-4 text-center text-xs text-[var(--text-muted)]",children:n("admin.chat_binding_no_bindings")}):e.jsx("div",{className:"space-y-3",children:u.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-4",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2 border-b border-[var(--border)] pb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-[var(--text-primary)]",children:t.chatName||"-"}),e.jsx("div",{className:"text-[11px] text-[var(--text-muted)]",children:t.platformChatId})]}),e.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[n("admin.chat_binding_projects"),": ",t.bindings.length]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:n("admin.project")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:n("admin.chat_binding_default_project")}),e.jsx("th",{className:"pb-2 font-normal",children:n("common.actions")})]})}),e.jsx("tbody",{children:t.bindings.map(c=>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:"py-2.5 pr-4 text-[var(--text-secondary)]",children:c.projectKey??"-"}),e.jsx("td",{className:"py-2.5 pr-4",children:c.isDefault?e.jsx("span",{className:"rounded-[4px] border border-[var(--accent)] px-2 py-0.5 text-[11px] text-[var(--accent)]",children:n("admin.chat_binding_default_badge")}):e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-secondary)] hover:border-[var(--accent)] hover:text-[var(--text-primary)] transition-colors",disabled:i||!c.projectKey,onClick:()=>y(c),children:n("admin.chat_binding_set_default")})}),e.jsx("td",{className:"py-2.5",children:e.jsx("button",{type:"button",className:"rounded-[4px] p-1.5 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>L(c),children:e.jsx(M,{className:"h-3.5 w-3.5"})})})]},c.id))})]})})]},t.platformChatId))}),k&&e.jsxs("div",{className:"mt-4 space-y-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-4",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:n("admin.chat_binding_add")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("admin.chat_id")}),e.jsx("input",{type:"text",placeholder:n("admin.chat_binding_id_placeholder"),value:x,onChange:t=>w(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)] focus: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:n("admin.chat_name")}),e.jsx("input",{type:"text",placeholder:n("admin.chat_binding_name_placeholder"),value:h,onChange:t=>C(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)] focus: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:n("admin.project")}),e.jsx(F,{value:I,onChange:$,options:E.map(t=>({value:t.key,label:`${t.name} (${t.key})`})),placeholder:n("admin.chat_binding_select_project")})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:()=>j(!1),children:n("common.cancel")}),e.jsx("button",{type:"button","data-testid":"submit-binding",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:i,onClick:l,children:n(i?"admin.chat_binding_adding":"admin.add_binding")})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] px-5 py-4",children:[e.jsx("div",{children:!k&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] transition-colors",onClick:()=>j(!0),children:[e.jsx(q,{className:"h-3.5 w-3.5"}),n("admin.add_binding")]})}),e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:_,children:n("common.close")})]})]})]}):null}function xe(){const{t:s}=B(),[v,_]=d.useState(!1),[p,n]=d.useState(null),[r,o]=d.useState(null),[E,g]=d.useState(!1),[i,b]=d.useState(null),[k,j]=d.useState(!1),{data:x,loading:w,refetch:h}=K(()=>N.get("admin/bots").json(),[]),{data:C,loading:I,refetch:$}=K(()=>N.get("admin/bots/all-bindings").json(),[]),S=(C??[]).reduce((a,l)=>{const L=`${l.botInstanceId}:${l.platformChatId}`,y=a.find(t=>t.key===L);return y?(y.bindings.push(l),!y.chatName&&l.chatName&&(y.chatName=l.chatName),l.createdAt<y.createdAt&&(y.createdAt=l.createdAt),a):(a.push({key:L,botName:l.botName,platform:l.platform,platformChatId:l.platformChatId,chatName:l.chatName,createdAt:l.createdAt,bindings:[l]}),a)},[]);async function m(){if(i){j(!0);try{await N.delete(`admin/bots/${i.id}`),g(!1),b(null),h()}catch{O.error(s("admin.failed_to_delete_bot"))}finally{j(!1)}}}function u(a){switch(a){case"lark":return"text-blue-400";case"slack":return"text-yellow-400";default:return"text-[var(--text-secondary)]"}}function f(a){return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",className:"rounded-[4px] p-2.5 md:p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:s("common.edit"),onClick:()=>n(a),children:e.jsx(V,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",className:"rounded-[4px] p-2.5 md:p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:s("admin.chat_bindings"),onClick:()=>o(a),children:e.jsx(X,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",className:"rounded-[4px] p-2.5 md:p-1.5 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",title:s("common.delete"),onClick:()=>{b(a),g(!0)},children:e.jsx(M,{className:"h-3.5 w-3.5"})})]})}return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("admin.bots_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.bots_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>{n(null),_(!0)},children:[e.jsx(q,{className:"h-3.5 w-3.5"}),s("admin.create_bot")]})]}),w?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(D,{rows:3})}):!x||x.length===0?e.jsx(U,{icon:H,title:s("admin.no_bots_configured"),description:s("admin.add_bot_desc"),actionLabel:s("admin.create_bot"),onAction:()=>{n(null),_(!0)}}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.bot_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.platform")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.app_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("common.created_at")}),e.jsx("th",{className:"pb-2 font-normal",children:s("common.actions")})]})}),e.jsx("tbody",{children:x.map(a=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:a.name}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:u(a.platform),children:a.platform})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:a.appId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:T(a.status),children:a.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(a.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5",children:f(a)})]},a.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:x.map(a=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)] font-medium",children:a.name}),f(a)]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[e.jsx("span",{className:u(a.platform),children:a.platform}),e.jsx("span",{className:T(a.status),children:a.status})]}),e.jsx("div",{className:"mt-1 text-[11px] text-[var(--text-secondary)] truncate",children:a.appId})]},a.id))})]}),e.jsx(Q,{isOpen:v||!!p,onClose:()=>{_(!1),n(null)},onCreated:h,editBot:p,onEditClose:()=>n(null)}),r&&e.jsx(Y,{isOpen:!!r,bot:r,onClose:()=>o(null),onUpdated:()=>{h(),$()}}),e.jsx(G,{isOpen:E,onClose:()=>{g(!1),b(null)},onConfirm:m,title:s("admin.delete_bot"),message:s("admin.delete_bot_confirm",{name:(i==null?void 0:i.name)??""}),confirmLabel:s("common.delete"),confirmVariant:"danger",isLoading:k}),e.jsxs("div",{className:"mt-8",children:[e.jsxs("h2",{className:"mb-4 text-sm text-[var(--text-primary)]",children:[s("admin.chat_bindings"),e.jsx("span",{className:"ml-2 text-[var(--text-muted)]",children:s("admin.chat_bindings_subtitle")})]}),I?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(D,{rows:3})}):S.length===0?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8 text-center",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.no_chat_bindings")})}):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:s("admin.bot")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.platform")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.chat_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.chat_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.project")}),e.jsx("th",{className:"pb-2 font-normal",children:s("common.created_at")})]})}),e.jsx("tbody",{children:S.map(a=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:a.botName}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:u(a.platform),children:a.platform})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:a.platformChatId}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:a.chatName??"-"}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:e.jsx("div",{className:"space-y-1",children:a.bindings.map(l=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:l.projectKey??"-"}),l.isDefault&&e.jsx("span",{className:"rounded-[4px] border border-[var(--accent)] px-1.5 py-0.5 text-[10px] text-[var(--accent)]",children:s("admin.chat_binding_default_badge")})]},l.id))})}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:new Date(a.createdAt).toLocaleDateString()})]},a.key))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:S.map(a=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)] font-medium",children:a.botName}),e.jsx("span",{className:`text-[11px] ${u(a.platform)}`,children:a.platform})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-secondary)] truncate",children:a.platformChatId}),e.jsx("div",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:a.chatName??"-"}),e.jsx("div",{className:"mt-2 space-y-1 text-[11px] text-[var(--text-muted)]",children:a.bindings.map(l=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:l.projectKey??"-"}),l.isDefault&&e.jsx("span",{className:"rounded-[4px] border border-[var(--accent)] px-1.5 py-0.5 text-[10px] text-[var(--accent)]",children:s("admin.chat_binding_default_badge")})]},l.id))})]},a.key))})]})]})]})}export{xe as default};
6
+ */const X=W("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),J=[{value:"lark",label:"lark_(feishu)"},{value:"slack",label:"slack"}];function Q({isOpen:s,onClose:v,onCreated:_,editBot:p,onEditClose:n}){const{t:r}=B(),o=!!p,[E,g]=d.useState(""),[i,b]=d.useState("lark"),[k,j]=d.useState(""),[x,w]=d.useState(""),[h,C]=d.useState(""),[I,$]=d.useState(!1),[S,m]=d.useState("");d.useEffect(()=>{s&&(p?(g(p.name),b(p.platform),j(p.appId),w(""),C("")):(g(""),b("lark"),j(""),w(""),C("")),$(!1),m(""))},[p,s]);function u(){o&&n?n():v()}async function f(){if(m(""),!E.trim()||!k.trim()){m(r("admin.name_and_app_id_required"));return}if(o){if(i==="slack"&&x.trim()&&!x.trim().startsWith("xoxb-")){m(r("admin.invalid_bot_token"));return}}else{if(!x.trim()){m(r("admin.app_secret_required"));return}if(i==="slack"){if(!x.trim().startsWith("xoxb-")){m(r("admin.invalid_bot_token"));return}if(!h.trim()){m(r("admin.signing_secret_required"));return}}}const t={name:E.trim(),platform:i,appId:k.trim()};x.trim()&&(t.appSecret=x.trim()),h.trim()&&(t.webhookToken=h.trim());try{$(!0),o?await N.put(`admin/bots/${p.id}`,{json:t}).json():await N.post("admin/bots",{json:t}).json(),u(),_()}catch(c){const A=c instanceof Error?c.message:r(o?"admin.failed_to_update_bot":"admin.failed_to_create_bot");m(A)}finally{$(!1)}}if(!s)return null;const a=window.location.origin,l=[{label:r("admin.webhook_events_url"),url:`${a}/webhook/slack/events`,hint:r("admin.slack_events_hint")},{label:r("admin.webhook_interact_url"),url:`${a}/webhook/slack/interact`,hint:r("admin.slack_interact_hint")},{label:r("admin.webhook_commands_url"),url:`${a}/webhook/slack/commands`,hint:r("admin.slack_commands_hint")}],L=[{label:r("admin.webhook_request_url"),url:`${a}/webhook/lark`,hint:r("admin.webhook_config_hint_lark")}],y=i==="slack"?l:L;return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:u}),e.jsxs("div",{className:"relative z-10 w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h3",{className:"text-sm text-[var(--text-primary)]",children:o?`// ${r("admin.edit_bot")}`:`// ${r("admin.create_bot")}`}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:u,children:e.jsx(P,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[S&&e.jsx("div",{className:"rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:S}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r("admin.bot_name")}),e.jsx("input",{type:"text",placeholder:"e.g. overlord lark bot",value:E,onChange:t=>g(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)] focus: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:r("admin.platform")}),e.jsx(F,{value:i,onChange:b,options:J,disabled:o})]}),e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-3",children:[e.jsx("div",{className:"mb-2 text-xs text-[var(--text-muted)]",children:r("admin.webhook_config")}),e.jsx("div",{className:"text-xs text-[var(--text-muted)] mb-3",children:r(i==="slack"?"admin.webhook_config_hint_slack":"admin.webhook_config_hint_lark")}),e.jsx("div",{className:"space-y-2",children:y.map(t=>e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-[var(--text-muted)] mb-1",children:t.label}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("code",{className:"flex-1 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-2 py-1 text-xs text-[var(--text-primary)] select-all overflow-x-auto",children:t.url}),e.jsx(R,{text:t.url})]}),e.jsx("div",{className:"mt-0.5 text-xs text-[var(--text-muted)]",children:t.hint})]},t.label))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r("admin.app_id")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r(i==="slack"?"admin.app_id_hint_slack":"admin.app_id_hint_lark")}),e.jsx("input",{type:"text",placeholder:"platform application id",value:k,onChange:t=>j(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)] focus:outline-none focus:border-[var(--accent)]"})]}),i==="slack"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r(o?"admin.bot_token_keep_current":"admin.bot_token")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r("admin.bot_token_hint")}),e.jsx("input",{type:"password",placeholder:r("admin.bot_token_placeholder"),value:x,onChange:t=>w(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)] focus: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:r(o?"admin.signing_secret_keep_current":"admin.signing_secret")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r("admin.signing_secret_hint")}),e.jsx("input",{type:"password",placeholder:r("admin.signing_secret_placeholder"),value:h,onChange:t=>C(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)] focus:outline-none focus:border-[var(--accent)]"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:r(o?"admin.app_secret_keep_current":"admin.app_secret")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r("admin.app_secret_hint_lark")}),e.jsx("input",{type:"password",placeholder:"platform application secret",value:x,onChange:t=>w(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)] focus: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:r(o?"admin.encrypt_key_keep_current":"admin.encrypt_key")}),e.jsx("div",{className:"mb-1 text-xs text-[var(--text-muted)]",children:r("admin.encrypt_key_hint")}),e.jsx("input",{type:"password",placeholder:r("admin.encrypt_key_placeholder"),value:h,onChange:t=>C(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)] focus:outline-none focus:border-[var(--accent)]"})]})]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:u,children:r("common.cancel")}),e.jsx("button",{type:"button",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:I,onClick:f,children:r(I?o?"common.saving":"common.creating":o?"common.save_changes":"common.create")})]})]})]})}function Y({isOpen:s,bot:v,onClose:_,onUpdated:p}){const{t:n}=B(),[r,o]=d.useState([]),[E,g]=d.useState([]),[i,b]=d.useState(!1),[k,j]=d.useState(!1),[x,w]=d.useState(""),[h,C]=d.useState(""),[I,$]=d.useState(""),[S,m]=d.useState(""),u=r.reduce((t,c)=>{const A=t.find(z=>z.platformChatId===c.platformChatId);return A?(A.bindings.push(c),!A.chatName&&c.chatName&&(A.chatName=c.chatName),t):(t.push({platformChatId:c.platformChatId,chatName:c.chatName,bindings:[c]}),t)},[]),f=d.useCallback(async()=>{try{const t=await N.get(`admin/bots/${v.id}/bindings`).json();o(t)}catch{}},[v.id]);d.useEffect(()=>{s&&f()},[s,f]);const a=d.useCallback(async()=>{try{const t=await N.get("web/projects").json();g(t)}catch{}},[]);d.useEffect(()=>{s&&a()},[s,a]);const l=async()=>{if(m(""),!x.trim()||!h.trim()||!I){m(n("admin.chat_binding_all_fields_required"));return}try{b(!0),await N.post(`admin/bots/${v.id}/bindings`,{json:{platformChatId:x.trim(),chatName:h.trim(),projectKey:I}}).json(),w(""),C(""),$(""),j(!1),await f(),p()}catch(t){const c=t instanceof Error?t.message:n("admin.failed_to_add_binding");m(c)}finally{b(!1)}},L=async t=>{try{await N.delete(`admin/bots/${v.id}/bindings`,{json:{platformChatId:t.platformChatId,projectKey:t.projectKey}}),await f(),p()}catch{m(n("admin.failed_to_delete_binding"))}},y=async t=>{try{b(!0),m(""),await N.put(`admin/bots/${v.id}/bindings/default`,{json:{platformChatId:t.platformChatId,projectKey:t.projectKey}}).json(),await f(),p()}catch(c){const A=c instanceof Error?c.message:n("admin.chat_binding_set_default_failed");m(A)}finally{b(!1)}};return s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{backdropFilter:"blur(2px)"},children:[e.jsx("div",{className:"fixed inset-0 bg-[var(--modal-backdrop)]",onClick:_}),e.jsxs("div",{className:"relative z-10 w-full max-w-[600px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] font-mono",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h3",{className:"text-sm text-[var(--text-primary)]",children:n("admin.chat_binding_title",{name:v.name})}),e.jsx("button",{type:"button",className:"rounded-[4px] p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors",onClick:_,children:e.jsx(P,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"px-5 py-5",children:[S&&e.jsx("div",{className:"mb-4 rounded-[4px] border border-red-500/30 bg-red-500/10 px-3 py-2 text-xs text-red-400",children:S}),r.length===0&&!k?e.jsx("p",{className:"py-4 text-center text-xs text-[var(--text-muted)]",children:n("admin.chat_binding_no_bindings")}):e.jsx("div",{className:"space-y-3",children:u.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-4",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-2 border-b border-[var(--border)] pb-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-[var(--text-primary)]",children:t.chatName||"-"}),e.jsx("div",{className:"text-[11px] text-[var(--text-muted)]",children:t.platformChatId})]}),e.jsxs("div",{className:"text-[11px] text-[var(--text-muted)]",children:[n("admin.chat_binding_projects"),": ",t.bindings.length]})]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:n("admin.project")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:n("admin.chat_binding_default_project")}),e.jsx("th",{className:"pb-2 font-normal",children:n("common.actions")})]})}),e.jsx("tbody",{children:t.bindings.map(c=>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:"py-2.5 pr-4 text-[var(--text-secondary)]",children:c.projectKey??"-"}),e.jsx("td",{className:"py-2.5 pr-4",children:c.isDefault?e.jsx("span",{className:"rounded-[4px] border border-[var(--accent)] px-2 py-0.5 text-[11px] text-[var(--accent)]",children:n("admin.chat_binding_default_badge")}):e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-2 py-1 text-[11px] text-[var(--text-secondary)] hover:border-[var(--accent)] hover:text-[var(--text-primary)] transition-colors",disabled:i||!c.projectKey,onClick:()=>y(c),children:n("admin.chat_binding_set_default")})}),e.jsx("td",{className:"py-2.5",children:e.jsx("button",{type:"button",className:"rounded-[4px] p-1.5 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",onClick:()=>L(c),children:e.jsx(M,{className:"h-3.5 w-3.5"})})})]},c.id))})]})})]},t.platformChatId))}),k&&e.jsxs("div",{className:"mt-4 space-y-3 rounded-[4px] border border-[var(--border)] bg-[var(--bg-primary)] p-4",children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:n("admin.chat_binding_add")}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:n("admin.chat_id")}),e.jsx("input",{type:"text",placeholder:n("admin.chat_binding_id_placeholder"),value:x,onChange:t=>w(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)] focus: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:n("admin.chat_name")}),e.jsx("input",{type:"text",placeholder:n("admin.chat_binding_name_placeholder"),value:h,onChange:t=>C(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)] focus: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:n("admin.project")}),e.jsx(F,{value:I,onChange:$,options:E.map(t=>({value:t.key,label:`${t.name} (${t.key})`})),placeholder:n("admin.chat_binding_select_project")})]}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:()=>j(!1),children:n("common.cancel")}),e.jsx("button",{type:"button","data-testid":"submit-binding",className:"rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity disabled:opacity-50",disabled:i,onClick:l,children:n(i?"admin.chat_binding_adding":"admin.add_binding")})]})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-[var(--border)] px-5 py-4",children:[e.jsx("div",{children:!k&&e.jsxs("button",{type:"button",className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] transition-colors",onClick:()=>j(!0),children:[e.jsx(q,{className:"h-3.5 w-3.5"}),n("admin.add_binding")]})}),e.jsx("button",{type:"button",className:"rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",onClick:_,children:n("common.close")})]})]})]}):null}function me(){const{t:s}=B(),[v,_]=d.useState(!1),[p,n]=d.useState(null),[r,o]=d.useState(null),[E,g]=d.useState(!1),[i,b]=d.useState(null),[k,j]=d.useState(!1),{data:x,loading:w,refetch:h}=K(()=>N.get("admin/bots").json(),[]),{data:C,loading:I,refetch:$}=K(()=>N.get("admin/bots/all-bindings").json(),[]),S=(C??[]).reduce((a,l)=>{const L=`${l.botInstanceId}:${l.platformChatId}`,y=a.find(t=>t.key===L);return y?(y.bindings.push(l),!y.chatName&&l.chatName&&(y.chatName=l.chatName),l.createdAt<y.createdAt&&(y.createdAt=l.createdAt),a):(a.push({key:L,botName:l.botName,platform:l.platform,platformChatId:l.platformChatId,chatName:l.chatName,createdAt:l.createdAt,bindings:[l]}),a)},[]);async function m(){if(i){j(!0);try{await N.delete(`admin/bots/${i.id}`),g(!1),b(null),h()}catch{O.error(s("admin.failed_to_delete_bot"))}finally{j(!1)}}}function u(a){switch(a){case"lark":return"text-blue-400";case"slack":return"text-yellow-400";default:return"text-[var(--text-secondary)]"}}function f(a){return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{type:"button",className:"rounded-[4px] p-2.5 md:p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:s("common.edit"),onClick:()=>n(a),children:e.jsx(V,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",className:"rounded-[4px] p-2.5 md:p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:bg-white/[0.05] transition-colors",title:s("admin.chat_bindings"),onClick:()=>o(a),children:e.jsx(X,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",className:"rounded-[4px] p-2.5 md:p-1.5 text-red-400 hover:text-red-300 hover:bg-white/[0.05] transition-colors",title:s("common.delete"),onClick:()=>{b(a),g(!0)},children:e.jsx(M,{className:"h-3.5 w-3.5"})})]})}return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:s("admin.bots_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.bots_subtitle")})]}),e.jsxs("button",{type:"button",className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black hover:opacity-90 transition-opacity",onClick:()=>{n(null),_(!0)},children:[e.jsx(q,{className:"h-3.5 w-3.5"}),s("admin.create_bot")]})]}),w?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(D,{rows:3})}):!x||x.length===0?e.jsx(U,{icon:H,title:s("admin.no_bots_configured"),description:s("admin.add_bot_desc"),actionLabel:s("admin.create_bot"),onAction:()=>{n(null),_(!0)}}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.bot_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.platform")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.app_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.status")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("common.created_at")}),e.jsx("th",{className:"pb-2 font-normal",children:s("common.actions")})]})}),e.jsx("tbody",{children:x.map(a=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:a.name}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:u(a.platform),children:a.platform})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:a.appId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:T(a.status),children:a.status})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(a.createdAt).toLocaleDateString()}),e.jsx("td",{className:"py-2.5",children:f(a)})]},a.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:x.map(a=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)] font-medium",children:a.name}),f(a)]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[e.jsx("span",{className:u(a.platform),children:a.platform}),e.jsx("span",{className:T(a.status),children:a.status})]}),e.jsx("div",{className:"mt-1 text-[11px] text-[var(--text-secondary)] truncate",children:a.appId})]},a.id))})]}),e.jsx(Q,{isOpen:v||!!p,onClose:()=>{_(!1),n(null)},onCreated:h,editBot:p,onEditClose:()=>n(null)}),r&&e.jsx(Y,{isOpen:!!r,bot:r,onClose:()=>o(null),onUpdated:()=>{h(),$()}}),e.jsx(G,{isOpen:E,onClose:()=>{g(!1),b(null)},onConfirm:m,title:s("admin.delete_bot"),message:s("admin.delete_bot_confirm",{name:(i==null?void 0:i.name)??""}),confirmLabel:s("common.delete"),confirmVariant:"danger",isLoading:k}),e.jsxs("div",{className:"mt-8",children:[e.jsxs("h2",{className:"mb-4 text-sm text-[var(--text-primary)]",children:[s("admin.chat_bindings"),e.jsx("span",{className:"ml-2 text-[var(--text-muted)]",children:s("admin.chat_bindings_subtitle")})]}),I?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(D,{rows:3})}):S.length===0?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-8 text-center",children:e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:s("admin.no_chat_bindings")})}):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:s("admin.bot")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.platform")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.chat_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.chat_name")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:s("admin.project")}),e.jsx("th",{className:"pb-2 font-normal",children:s("common.created_at")})]})}),e.jsx("tbody",{children:S.map(a=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-primary)]",children:a.botName}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:u(a.platform),children:a.platform})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:a.platformChatId}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:a.chatName??"-"}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:e.jsx("div",{className:"space-y-1",children:a.bindings.map(l=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:l.projectKey??"-"}),l.isDefault&&e.jsx("span",{className:"rounded-[4px] border border-[var(--accent)] px-1.5 py-0.5 text-[10px] text-[var(--accent)]",children:s("admin.chat_binding_default_badge")})]},l.id))})}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:new Date(a.createdAt).toLocaleDateString()})]},a.key))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:S.map(a=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs text-[var(--text-primary)] font-medium",children:a.botName}),e.jsx("span",{className:`text-[11px] ${u(a.platform)}`,children:a.platform})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-secondary)] truncate",children:a.platformChatId}),e.jsx("div",{className:"mt-1 text-[11px] text-[var(--text-muted)]",children:a.chatName??"-"}),e.jsx("div",{className:"mt-2 space-y-1 text-[11px] text-[var(--text-muted)]",children:a.bindings.map(l=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:l.projectKey??"-"}),l.isDefault&&e.jsx("span",{className:"rounded-[4px] border border-[var(--accent)] px-1.5 py-0.5 text-[10px] text-[var(--accent)]",children:s("admin.chat_binding_default_badge")})]},l.id))})]},a.key))})]})]})]})}export{me as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./index-GPUbNOkg.js";import{a as s}from"./DocsPrimitives-2csfHzW_.js";import"./copy-CukaPL3b.js";const c=[{command:"develop",alias:"dev",example:'@bot develop "fix login bug" --project WEB',description:"create a new task"},{command:"develop",alias:"dev",example:'@bot develop "fix login bug" --agent cursor',description:"create a task with specific agent"},{command:"develop",alias:"dev",example:'@bot develop "fix login bug" --type fix --branch fix-login',description:"specify task type and branch slug"},{command:"develop",alias:"dev",example:'@bot develop "deploy" --on worker-1',description:"create a task on a specific worker"},{command:"show",alias:"progress / logs / workspace / ws",example:"@bot show #42",description:"view task details"},{command:"cancel",alias:"",example:"@bot cancel #42",description:"cancel a running task"},{command:"retry",alias:"",example:"@bot retry #42",description:"retry a failed/cancelled task"},{command:"fork",alias:"",example:"@bot fork #42",description:"fork a completed/failed/cancelled task"},{command:"fork",alias:"",example:"@bot fork #42 --agent codex",description:"fork with a different agent"},{command:"fork",alias:"",example:'@bot fork #42 "extra detail"',description:"fork and append extra detail to the original description"},{command:"fork",alias:"",example:'@bot fork #42 "new desc" --replace',description:"fork and replace the original description"},{command:"list",alias:"ls",example:"@bot list --project WEB",description:"list recent tasks"},{command:"confirm",alias:"",example:"@bot confirm #42",description:"confirm a pending stage"},{command:"projects",alias:"proj",example:"@bot projects",description:"list your projects"},{command:"status",alias:"",example:"@bot status",description:"show cluster status"},{command:"workers",alias:"",example:"@bot workers",description:"list all workers (admin only)"},{command:"search",alias:"",example:"@bot search login",description:"search tasks, workers, projects"},{command:"bind",alias:"",example:"@bot bind",description:"link your chat account to your overlord account"},{command:"info",alias:"",example:"@bot info",description:"show chat id, user id, and link status"},{command:"help",alias:"",example:"@bot help",description:"show available commands"}];function i(){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",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// overview"}),e.jsxs("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:["overlord supports creating tasks via chat bots. users can ",e.jsx("code",{className:"text-[var(--accent)]",children:'@bot develop "fix the login bug"'})," in a group chat, and overlord dispatches the task automatically. notifications are sent back through the same channel."]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// lark setup"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xs text-[var(--accent)]",children:"> 1. create a lark app"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["on ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"lark open platform"})," (open.larksuite.com) → custom app:"]}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["— note the ",e.jsx("span",{className:"text-[var(--accent)]",children:"app id"})," and ",e.jsx("span",{className:"text-[var(--accent)]",children:"app secret"})]}),e.jsxs("li",{children:["— event subscriptions: ",e.jsx("code",{className:"text-[var(--accent)]",children:"im.message.receive_v1"})]}),e.jsxs("li",{children:["— event request url: ",e.jsx("code",{className:"text-[var(--text-secondary)]",children:"https://your-overlord-server.com/webhook/lark"})]}),e.jsxs("li",{children:["— callback configuration → request url: ",e.jsx("code",{className:"text-[var(--text-secondary)]",children:"https://your-overlord-server.com/webhook/lark"})]}),e.jsx("li",{children:"— enable bot capability"}),e.jsxs("li",{children:["— permissions: ",e.jsx("code",{className:"text-[var(--accent)]",children:"im:message.group_at_msg:readonly"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"im:message.p2p_msg:readonly"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"im:message:send_as_bot"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xs text-[var(--accent)]",children:"> 2. register in overlord"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"via admin → bot management → add bot, or via the api:"}),e.jsx(s,{code:`curl -X POST https://your-server:9000/api/admin/bots \\
1
+ import{j as e}from"./index-eKvCyU64.js";import{a as s}from"./DocsPrimitives-BMgSDhur.js";import"./copy-DEWCNXDf.js";const c=[{command:"develop",alias:"dev",example:'@bot develop "fix login bug" --project WEB',description:"create a new task"},{command:"develop",alias:"dev",example:'@bot develop "fix login bug" --agent cursor',description:"create a task with specific agent"},{command:"develop",alias:"dev",example:'@bot develop "fix login bug" --type fix --branch fix-login',description:"specify task type and branch slug"},{command:"develop",alias:"dev",example:'@bot develop "deploy" --on worker-1',description:"create a task on a specific worker"},{command:"show",alias:"progress / logs / workspace / ws",example:"@bot show #42",description:"view task details"},{command:"cancel",alias:"",example:"@bot cancel #42",description:"cancel a running task"},{command:"retry",alias:"",example:"@bot retry #42",description:"retry a failed/cancelled task"},{command:"fork",alias:"",example:"@bot fork #42",description:"fork a completed/failed/cancelled task"},{command:"fork",alias:"",example:"@bot fork #42 --agent codex",description:"fork with a different agent"},{command:"fork",alias:"",example:'@bot fork #42 "extra detail"',description:"fork and append extra detail to the original description"},{command:"fork",alias:"",example:'@bot fork #42 "new desc" --replace',description:"fork and replace the original description"},{command:"list",alias:"ls",example:"@bot list --project WEB",description:"list recent tasks"},{command:"confirm",alias:"",example:"@bot confirm #42",description:"confirm a pending stage"},{command:"projects",alias:"proj",example:"@bot projects",description:"list your projects"},{command:"status",alias:"",example:"@bot status",description:"show cluster status"},{command:"workers",alias:"",example:"@bot workers",description:"list all workers (admin only)"},{command:"search",alias:"",example:"@bot search login",description:"search tasks, workers, projects"},{command:"bind",alias:"",example:"@bot bind",description:"link your chat account to your overlord account"},{command:"info",alias:"",example:"@bot info",description:"show chat id, user id, and link status"},{command:"help",alias:"",example:"@bot help",description:"show available commands"}];function i(){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",{children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// overview"}),e.jsxs("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:["overlord supports creating tasks via chat bots. users can ",e.jsx("code",{className:"text-[var(--accent)]",children:'@bot develop "fix the login bug"'})," in a group chat, and overlord dispatches the task automatically. notifications are sent back through the same channel."]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// lark setup"}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xs text-[var(--accent)]",children:"> 1. create a lark app"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["on ",e.jsx("span",{className:"text-[var(--text-secondary)]",children:"lark open platform"})," (open.larksuite.com) → custom app:"]}),e.jsxs("ul",{className:"space-y-1 text-xs text-[var(--text-secondary)] list-none pl-0",children:[e.jsxs("li",{children:["— note the ",e.jsx("span",{className:"text-[var(--accent)]",children:"app id"})," and ",e.jsx("span",{className:"text-[var(--accent)]",children:"app secret"})]}),e.jsxs("li",{children:["— event subscriptions: ",e.jsx("code",{className:"text-[var(--accent)]",children:"im.message.receive_v1"})]}),e.jsxs("li",{children:["— event request url: ",e.jsx("code",{className:"text-[var(--text-secondary)]",children:"https://your-overlord-server.com/webhook/lark"})]}),e.jsxs("li",{children:["— callback configuration → request url: ",e.jsx("code",{className:"text-[var(--text-secondary)]",children:"https://your-overlord-server.com/webhook/lark"})]}),e.jsx("li",{children:"— enable bot capability"}),e.jsxs("li",{children:["— permissions: ",e.jsx("code",{className:"text-[var(--accent)]",children:"im:message.group_at_msg:readonly"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"im:message.p2p_msg:readonly"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"im:message:send_as_bot"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"text-xs text-[var(--accent)]",children:"> 2. register in overlord"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"via admin → bot management → add bot, or via the api:"}),e.jsx(s,{code:`curl -X POST https://your-server:9000/api/admin/bots \\
2
2
  -H "Authorization: Bearer $TOKEN" \\
3
3
  -H "Content-Type: application/json" \\
4
4
  -d '{
@@ -1 +1 @@
1
- import{j as e}from"./index-GPUbNOkg.js";function s(){return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// changelog"}),e.jsx("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:"release history and notable changes."})]}),e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> v1.0.28"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"2026-03-13"})]}),e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"initial public release"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsx("p",{children:"- full task orchestration platform with multi-agent support (claude code, cursor, codex)"}),e.jsx("p",{children:"- real-time pty terminal streaming via xterm.js in web dashboard"}),e.jsx("p",{children:"- skill pipeline system with confirmation, choice, and input stages"}),e.jsx("p",{children:"- multi-machine worker fleet with intelligent task routing"}),e.jsx("p",{children:"- lark bot integration with interactive message cards"}),e.jsx("p",{children:"- developer cli (ov) for task management and terminal attachment"}),e.jsx("p",{children:"- operations cli (overlord) for server/worker lifecycle management"}),e.jsx("p",{children:"- role-based access control (developer, lead, admin)"}),e.jsx("p",{children:"- totp two-factor authentication"}),e.jsx("p",{children:"- personal access tokens for api/cli authentication"}),e.jsx("p",{children:"- cursor remote tunnel support for workspace access"}),e.jsx("p",{children:"- project-level configuration with pipeline definitions"}),e.jsx("p",{children:"- audit logging for all administrative actions"}),e.jsx("p",{children:"- cloudflare zero trust deployment support"}),e.jsx("p",{children:"- sqlite database with wal mode"}),e.jsx("p",{children:"- redis-backed task queue via bullmq"}),e.jsx("p",{children:"- comprehensive web dashboard with dark/light theme"})]})]})})]})}export{s as default};
1
+ import{j as e}from"./index-eKvCyU64.js";function s(){return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// changelog"}),e.jsx("p",{className:"mt-2 text-xs text-[var(--text-muted)]",children:"release history and notable changes."})]}),e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("h2",{className:"text-sm text-[var(--accent)]",children:"> v1.0.28"}),e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"2026-03-13"})]}),e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"initial public release"}),e.jsxs("div",{className:"space-y-1 text-xs text-[var(--text-secondary)]",children:[e.jsx("p",{children:"- full task orchestration platform with multi-agent support (claude code, cursor, codex)"}),e.jsx("p",{children:"- real-time pty terminal streaming via xterm.js in web dashboard"}),e.jsx("p",{children:"- skill pipeline system with confirmation, choice, and input stages"}),e.jsx("p",{children:"- multi-machine worker fleet with intelligent task routing"}),e.jsx("p",{children:"- lark bot integration with interactive message cards"}),e.jsx("p",{children:"- developer cli (ov) for task management and terminal attachment"}),e.jsx("p",{children:"- operations cli (overlord) for server/worker lifecycle management"}),e.jsx("p",{children:"- role-based access control (developer, lead, admin)"}),e.jsx("p",{children:"- totp two-factor authentication"}),e.jsx("p",{children:"- personal access tokens for api/cli authentication"}),e.jsx("p",{children:"- cursor remote tunnel support for workspace access"}),e.jsx("p",{children:"- project-level configuration with pipeline definitions"}),e.jsx("p",{children:"- audit logging for all administrative actions"}),e.jsx("p",{children:"- cloudflare zero trust deployment support"}),e.jsx("p",{children:"- sqlite database with wal mode"}),e.jsx("p",{children:"- redis-backed task queue via bullmq"}),e.jsx("p",{children:"- comprehensive web dashboard with dark/light theme"})]})]})})]})}export{s as default};