@overlordai/server 1.0.173 → 1.0.174

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 (168) hide show
  1. package/dist/adapters/confirm-required.utils.d.ts +24 -0
  2. package/dist/adapters/confirm-required.utils.d.ts.map +1 -0
  3. package/dist/adapters/confirm-required.utils.js +51 -0
  4. package/dist/adapters/confirm-required.utils.js.map +1 -0
  5. package/dist/adapters/lark/lark.adapter.d.ts +5 -3
  6. package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
  7. package/dist/adapters/lark/lark.adapter.js +56 -20
  8. package/dist/adapters/lark/lark.adapter.js.map +1 -1
  9. package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
  10. package/dist/adapters/slack/slack.adapter.js +41 -12
  11. package/dist/adapters/slack/slack.adapter.js.map +1 -1
  12. package/dist/app.module.d.ts.map +1 -1
  13. package/dist/app.module.js +2 -0
  14. package/dist/app.module.js.map +1 -1
  15. package/dist/database/repositories/task.repository.d.ts +1 -0
  16. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  17. package/dist/database/repositories/task.repository.js +7 -0
  18. package/dist/database/repositories/task.repository.js.map +1 -1
  19. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  20. package/dist/dispatcher/dispatcher.service.js +7 -7
  21. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  22. package/dist/dispatcher/dispatcher.types.d.ts +1 -1
  23. package/dist/dispatcher/dispatcher.types.d.ts.map +1 -1
  24. package/dist/dispatcher/task-lifecycle.service.d.ts +1 -0
  25. package/dist/dispatcher/task-lifecycle.service.d.ts.map +1 -1
  26. package/dist/dispatcher/task-lifecycle.service.js +15 -0
  27. package/dist/dispatcher/task-lifecycle.service.js.map +1 -1
  28. package/dist/events/event-types.d.ts +7 -0
  29. package/dist/events/event-types.d.ts.map +1 -1
  30. package/dist/notifier/card-actions.d.ts +3 -0
  31. package/dist/notifier/card-actions.d.ts.map +1 -1
  32. package/dist/notifier/card-actions.js +6 -0
  33. package/dist/notifier/card-actions.js.map +1 -1
  34. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  35. package/dist/notifier/notification-consumer.js +8 -3
  36. package/dist/notifier/notification-consumer.js.map +1 -1
  37. package/dist/notifier/notification-event-listener.d.ts.map +1 -1
  38. package/dist/notifier/notification-event-listener.js +3 -1
  39. package/dist/notifier/notification-event-listener.js.map +1 -1
  40. package/dist/notifier/notifier.service.d.ts +6 -1
  41. package/dist/notifier/notifier.service.d.ts.map +1 -1
  42. package/dist/notifier/notifier.service.js +2 -1
  43. package/dist/notifier/notifier.service.js.map +1 -1
  44. package/dist/notifier/template.service.d.ts +8 -1
  45. package/dist/notifier/template.service.d.ts.map +1 -1
  46. package/dist/notifier/template.service.js +38 -6
  47. package/dist/notifier/template.service.js.map +1 -1
  48. package/dist/review/review-comment.service.d.ts +41 -0
  49. package/dist/review/review-comment.service.d.ts.map +1 -0
  50. package/dist/review/review-comment.service.js +317 -0
  51. package/dist/review/review-comment.service.js.map +1 -0
  52. package/dist/review/review.module.d.ts +3 -0
  53. package/dist/review/review.module.d.ts.map +1 -0
  54. package/dist/review/review.module.js +22 -0
  55. package/dist/review/review.module.js.map +1 -0
  56. package/dist/web/frame-handlers/review-report.handler.d.ts.map +1 -1
  57. package/dist/web/frame-handlers/review-report.handler.js +26 -6
  58. package/dist/web/frame-handlers/review-report.handler.js.map +1 -1
  59. package/dist/web/frame-handlers/stage-confirm.handler.d.ts +12 -2
  60. package/dist/web/frame-handlers/stage-confirm.handler.d.ts.map +1 -1
  61. package/dist/web/frame-handlers/stage-confirm.handler.js +106 -28
  62. package/dist/web/frame-handlers/stage-confirm.handler.js.map +1 -1
  63. package/package.json +4 -4
  64. package/public/assets/{AccessTokensPage-DWRXad3x.js → AccessTokensPage-CBlLkkX6.js} +1 -1
  65. package/public/assets/{AdminPage-BoIqMBJM.js → AdminPage-mynf8ODr.js} +1 -1
  66. package/public/assets/{AgentCliPage-DDk8OWtX.js → AgentCliPage-DrnciW6T.js} +1 -1
  67. package/public/assets/{ApiReferencePage-Bv1wLy5b.js → ApiReferencePage-DRe_cm_m.js} +1 -1
  68. package/public/assets/{ArchitecturePage-CxP9hkhF.js → ArchitecturePage-DNoVjW-a.js} +1 -1
  69. package/public/assets/{AuditLogPage-B7QQ9hah.js → AuditLogPage-B1eTcJBR.js} +1 -1
  70. package/public/assets/{AutomationCreatePage-ChPD2oTI.js → AutomationCreatePage-CukXfCtB.js} +1 -1
  71. package/public/assets/{AutomationDetailPage-BY6bseqa.js → AutomationDetailPage-DWshoZlm.js} +1 -1
  72. package/public/assets/{AutomationEditPage-BqeA3DXk.js → AutomationEditPage-DL3-RPcj.js} +1 -1
  73. package/public/assets/{AutomationListPage-DkT1Yv4n.js → AutomationListPage-DGH6MsJc.js} +1 -1
  74. package/public/assets/{AutomationRunDetailPage-CWPGlBJd.js → AutomationRunDetailPage-D0oJoBJW.js} +1 -1
  75. package/public/assets/{BindPlatformPage-DrCQMFXN.js → BindPlatformPage-BTgH5eI0.js} +1 -1
  76. package/public/assets/{BotIntegrationPage-CFSmmRh1.js → BotIntegrationPage-D6GXacbO.js} +1 -1
  77. package/public/assets/{BotManage-C7o5dyKk.js → BotManage-Cn_zH3U4.js} +1 -1
  78. package/public/assets/{BotSetupPage-BgjGC1Ce.js → BotSetupPage-DTb0r78_.js} +1 -1
  79. package/public/assets/{ChangelogPage-Bk6LcJiR.js → ChangelogPage-CNfqrRty.js} +1 -1
  80. package/public/assets/{Checkbox-BOX6FtEq.js → Checkbox-D1hAKR9E.js} +1 -1
  81. package/public/assets/{CliReferencePage-CtWMf_UQ.js → CliReferencePage-DK4sv8D8.js} +1 -1
  82. package/public/assets/{ConfirmStageDialog-BtyVYk27.js → ConfirmStageDialog-Bi3nbWlh.js} +1 -1
  83. package/public/assets/{DeploymentPage-CsQj6iic.js → DeploymentPage-xKePKzHX.js} +1 -1
  84. package/public/assets/{DevWorkflowPage-uy7WzcsE.js → DevWorkflowPage-DHNtwyat.js} +1 -1
  85. package/public/assets/{DeveloperManage-BI6Ajrgf.js → DeveloperManage-Di8MWrTf.js} +1 -1
  86. package/public/assets/{DeveloperSetupPage-D-iex6Or.js → DeveloperSetupPage-C7_LFKDA.js} +1 -1
  87. package/public/assets/{DocsIndexPage-D-KxxA8_.js → DocsIndexPage-DDcOuwlz.js} +1 -1
  88. package/public/assets/{DocsLayout-BCzKSMhE.js → DocsLayout-B477jsxk.js} +1 -1
  89. package/public/assets/{DocsPrimitives-BzVDx2cs.js → DocsPrimitives-CgyoKAir.js} +1 -1
  90. package/public/assets/{EditProjectPage-BY-qZ5wL.js → EditProjectPage-Dfm319Z2.js} +1 -1
  91. package/public/assets/{EmptyState-CqF5g3iI.js → EmptyState-P0FzomcO.js} +1 -1
  92. package/public/assets/{EnvVariablesPage-BYhrZ5C5.js → EnvVariablesPage-CnQo2yCF.js} +1 -1
  93. package/public/assets/{HomePage-Bhanys0H.js → HomePage-Da2G6_QB.js} +1 -1
  94. package/public/assets/{InfoRow-BxA58xIa.js → InfoRow-DbxM6iML.js} +1 -1
  95. package/public/assets/{InstallationPage-Cg1I_2Mi.js → InstallationPage-CuOWbc1H.js} +1 -1
  96. package/public/assets/{LandingPage-JQqDMBvp.js → LandingPage-Cbvdm3eI.js} +1 -1
  97. package/public/assets/{LocalDevelopmentPage-t1wS_JiB.js → LocalDevelopmentPage-0icX-WcV.js} +1 -1
  98. package/public/assets/{LoginPage-CgGCdeF7.js → LoginPage-6JnXQfU3.js} +1 -1
  99. package/public/assets/{MetricBar-DfTk8Sjr.js → MetricBar-Dc-VQSMu.js} +1 -1
  100. package/public/assets/{MultiSelect-s1A3k8lX.js → MultiSelect-DCWH4BA8.js} +1 -1
  101. package/public/assets/{NotFoundPage-BcK6DhJP.js → NotFoundPage-DDuYP8W4.js} +1 -1
  102. package/public/assets/{OnboardingGuide-CnEZNjMO.js → OnboardingGuide-B0V0r8s3.js} +1 -1
  103. package/public/assets/{PermissionsPage-DMhgJT_d.js → PermissionsPage-B0ggYIb5.js} +1 -1
  104. package/public/assets/{PipelineConfigPage-DLXm99KL.js → PipelineConfigPage-DtZQzMEH.js} +1 -1
  105. package/public/assets/{PipelineEditorPage-BVaO5u3d.js → PipelineEditorPage-BJvEIr25.js} +1 -1
  106. package/public/assets/{PlanPage-B3oI7rdU.js → PlanPage-C86YOhVS.js} +1 -1
  107. package/public/assets/{ProfilePage-Bo77BD7U.js → ProfilePage-BnWgT5TC.js} +1 -1
  108. package/public/assets/{ProjectDetailPage-BXap15n_.js → ProjectDetailPage-DGQH-J_A.js} +1 -1
  109. package/public/assets/{ProjectListPage-Bf5gQWll.js → ProjectListPage-CNCAX69Y.js} +1 -1
  110. package/public/assets/{PtyTerminal-Do7JUGQS.js → PtyTerminal-kO8wCuuU.js} +1 -1
  111. package/public/assets/{QuickAuth-EIbjxqlx.js → QuickAuth-DARffZGR.js} +1 -1
  112. package/public/assets/{RemoveMemberConfirmDialog-CGzHpvJv.js → RemoveMemberConfirmDialog-D9rPijXx.js} +1 -1
  113. package/public/assets/{ReviewAggregatePage-Bvk901fs.js → ReviewAggregatePage-Bc1K6gXO.js} +1 -1
  114. package/public/assets/{ReviewPage-CBEbIkD3.js → ReviewPage-BPDRxqrG.js} +1 -1
  115. package/public/assets/{Select-BRJxl1YO.js → Select-CgGQnjuL.js} +1 -1
  116. package/public/assets/{SettingsPage-CUznfUgJ.js → SettingsPage-Dqser9QV.js} +1 -1
  117. package/public/assets/{Skeleton-CkmmCp2B.js → Skeleton-KIdOfHCh.js} +1 -1
  118. package/public/assets/{SkillPage-DmMxzWHC.js → SkillPage-kituG7_x.js} +1 -1
  119. package/public/assets/{TaskDetailPage-DF6j4ohL.js → TaskDetailPage-DQVE-zp-.js} +1 -1
  120. package/public/assets/{TaskGuidePage-1NpVzVqi.js → TaskGuidePage-D3sA_3Vy.js} +1 -1
  121. package/public/assets/{TaskListPage-1_Fn21zu.js → TaskListPage-arWi98DB.js} +1 -1
  122. package/public/assets/{TaskStatusBadge-BldGSOah.js → TaskStatusBadge-D9epJQNe.js} +1 -1
  123. package/public/assets/{TerminalHomePage-BIk8jU04.js → TerminalHomePage-Cl2Uh4Hp.js} +1 -1
  124. package/public/assets/{TokenManage-CMtAf7QR.js → TokenManage-DOg2xTt8.js} +1 -1
  125. package/public/assets/{Tooltip-EOsBLsZE.js → Tooltip-D1qzP0lG.js} +1 -1
  126. package/public/assets/{TotpSetupPage-C7oZEO7M.js → TotpSetupPage-CCbH89j8.js} +1 -1
  127. package/public/assets/{WorkerDetailPage-DNUSVoN8.js → WorkerDetailPage-PtA39Lz5.js} +1 -1
  128. package/public/assets/{WorkerListPage-Bkb8IGzC.js → WorkerListPage-Rq7zwaP2.js} +1 -1
  129. package/public/assets/{WorkerOperationsPage-yH5f32ue.js → WorkerOperationsPage-CapQErvu.js} +1 -1
  130. package/public/assets/{WorkerSetupGuidePage-DADwzbsf.js → WorkerSetupGuidePage-BVgaWQP0.js} +1 -1
  131. package/public/assets/{WorkerSetupPage-DAGFtNCP.js → WorkerSetupPage-D-T4O7PE.js} +1 -1
  132. package/public/assets/{agent-type-options-DXKoGpJI.js → agent-type-options-CvfN3Xkt.js} +1 -1
  133. package/public/assets/{arrow-left-DolNA3BD.js → arrow-left-CsRQX7H5.js} +1 -1
  134. package/public/assets/{arrow-right-J0lJRpaW.js → arrow-right-lhj-X9Ah.js} +1 -1
  135. package/public/assets/{bot-Bf1PX7dx.js → bot-BI0aOjZg.js} +1 -1
  136. package/public/assets/{chevron-down-Cm4So_5j.js → chevron-down-BMMNE8tj.js} +1 -1
  137. package/public/assets/{chevron-left-Cx2ByqjE.js → chevron-left-C5QPcYfE.js} +1 -1
  138. package/public/assets/{chevron-right-D0k7WYYt.js → chevron-right-DUJ8mQK2.js} +1 -1
  139. package/public/assets/{chevron-up-DVl3qTn3.js → chevron-up-tdj0sbLv.js} +1 -1
  140. package/public/assets/{circle-alert-BojCwibr.js → circle-alert-CMpAAr9i.js} +1 -1
  141. package/public/assets/{clock-DQeHdtoa.js → clock-CM8cLcAb.js} +1 -1
  142. package/public/assets/{copy-CHO7AsGy.js → copy-DEFukTLk.js} +1 -1
  143. package/public/assets/{download-D5cnbFDk.js → download-enKZtRO3.js} +1 -1
  144. package/public/assets/{external-link-lvF-co6-.js → external-link-DLg1H4XY.js} +1 -1
  145. package/public/assets/{git-fork-DRlvwKYI.js → git-fork-BLuZ7mG_.js} +1 -1
  146. package/public/assets/{index-D9synPeJ.js → index-6n4YMG-q.js} +2 -2
  147. package/public/assets/{key-KezsYJ0O.js → key-DdT50FZZ.js} +1 -1
  148. package/public/assets/{loader-circle--EO2iEyc.js → loader-circle-BsR1MJQw.js} +1 -1
  149. package/public/assets/{pencil-DIvX1Xsb.js → pencil-wJOYzbVI.js} +1 -1
  150. package/public/assets/{play-BHrAGNju.js → play-sxSJsoXu.js} +1 -1
  151. package/public/assets/{plus-9sncIl_N.js → plus-B3b8vXw9.js} +1 -1
  152. package/public/assets/{rotate-ccw-Dw8AxO4w.js → rotate-ccw-Wq-FsTE-.js} +1 -1
  153. package/public/assets/{scroll-text-CRQexw-n.js → scroll-text-DrPNg6ww.js} +1 -1
  154. package/public/assets/{settings-CgXh3xHG.js → settings-CG53o23z.js} +1 -1
  155. package/public/assets/{skip-forward-Q2vmwL9H.js → skip-forward-gDc2Yb8q.js} +1 -1
  156. package/public/assets/{status-colors-CRgg1N4i.js → status-colors-D1PZs9TB.js} +1 -1
  157. package/public/assets/{task-agent-KZdZD5cO.js → task-agent-DZDHjrS-.js} +1 -1
  158. package/public/assets/{task-constants-BiYtEhWG.js → task-constants-CCKesKBc.js} +1 -1
  159. package/public/assets/{task.store-Ds-1t2to.js → task.store-yMf_13Ff.js} +1 -1
  160. package/public/assets/{timer-ihiO0n04.js → timer-tBxBLW3s.js} +1 -1
  161. package/public/assets/{trash-2-Cb5-yglV.js → trash-2--fHS3BRC.js} +1 -1
  162. package/public/assets/{useFetch-Dj0ZN58I.js → useFetch-CBIWj1ZT.js} +1 -1
  163. package/public/assets/{users-MLpO39SG.js → users-BWDidnLE.js} +1 -1
  164. package/public/assets/{wifi-SWAOT6IR.js → wifi-BTg-eNKI.js} +1 -1
  165. package/public/assets/{workflow-M2c7dT84.js → workflow-CBP21ght.js} +1 -1
  166. package/public/assets/{zap-gd-vvEW3.js → zap-Dhvfo8tD.js} +1 -1
  167. package/public/index.html +1 -1
  168. package/public/sw.js +1 -1
@@ -1 +1 @@
1
- import{f as d,a as o,x as p,r as n,j as t}from"./index-D9synPeJ.js";import{Q as c}from"./QuickAuth-EIbjxqlx.js";import{P as h}from"./plus-9sncIl_N.js";import"./copy-CHO7AsGy.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"},{method:"PUT",path:"/:id/bindings/default",description:"set the default project for command routing in one chat",auth:"jwt",body:'{ "platformChatId": "string", "projectKey": "string" }'},{method:"PUT",path:"/:id/bindings/notification-default",description:"set the notify-default chat for automation summaries for one project",auth:"jwt",body:'{ "platformChatId": "string", "projectKey": "string" }'}]},{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,i]=n.useState(!1),{t:r}=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:()=>i(!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:r("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:r("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((i,r)=>t.jsx(u,{ep:i,prefix:s.prefix},`${i.method}-${i.path}-${r}`))})]},s.title))})]})}export{g as default};
1
+ import{f as d,a as o,x as p,r as n,j as t}from"./index-6n4YMG-q.js";import{Q as c}from"./QuickAuth-DARffZGR.js";import{P as h}from"./plus-B3b8vXw9.js";import"./copy-DEFukTLk.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"},{method:"PUT",path:"/:id/bindings/default",description:"set the default project for command routing in one chat",auth:"jwt",body:'{ "platformChatId": "string", "projectKey": "string" }'},{method:"PUT",path:"/:id/bindings/notification-default",description:"set the notify-default chat for automation summaries for one project",auth:"jwt",body:'{ "platformChatId": "string", "projectKey": "string" }'}]},{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,i]=n.useState(!1),{t:r}=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:()=>i(!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:r("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:r("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((i,r)=>t.jsx(u,{ep:i,prefix:s.prefix},`${i.method}-${i.path}-${r}`))})]},s.title))})]})}export{g as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./index-D9synPeJ.js";import{C as s}from"./DocsPrimitives-BzVDx2cs.js";import"./copy-CHO7AsGy.js";const r=` ┌──────────────────┐
1
+ import{j as e}from"./index-6n4YMG-q.js";import{C as s}from"./DocsPrimitives-CgyoKAir.js";import"./copy-DEFukTLk.js";const r=` ┌──────────────────┐
2
2
  │ Developer │
3
3
  │ (create / attach) │
4
4
  └──┬─────┬──────┬──┘
@@ -1 +1 @@
1
- import{a as C,r,h as S,j as e,y as k}from"./index-D9synPeJ.js";import{S as L}from"./Select-BRJxl1YO.js";import{E}from"./EmptyState-CqF5g3iI.js";import{T}from"./Skeleton-CkmmCp2B.js";import{S as A}from"./scroll-text-CRQexw-n.js";import{C as F}from"./chevron-left-Cx2ByqjE.js";import{C as P}from"./chevron-right-D0k7WYYt.js";import"./chevron-down-Cm4So_5j.js";function q(){const{t:a}=C(),h=[{value:"",label:a("admin.all_actions")},{value:"login",label:a("admin.action_login")},{value:"logout",label:a("admin.action_logout")},{value:"create",label:a("admin.action_create")},{value:"update",label:a("admin.action_update")},{value:"delete",label:a("admin.action_delete")},{value:"revoke",label:a("admin.action_revoke")},{value:"reset_2fa",label:a("admin.action_reset_2fa")},{value:"generate_token",label:a("admin.action_generate_token")}],[n,b]=r.useState([]),[f,p]=r.useState(!0),[i,j]=r.useState(""),[o,g]=r.useState(""),[N,c]=r.useState(void 0),[x,m]=r.useState([]),[l,w]=r.useState(void 0),d=r.useCallback(async t=>{try{p(!0);const s={limit:"50"};t&&(s.cursor=t),i&&(s.action=i),o&&(s.user=o);const v=await S.get("admin/audit-logs",{searchParams:s}).json();b(v.data),w(v.nextCursor)}catch{}finally{p(!1)}},[i,o]);r.useEffect(()=>{c(void 0),m([]),d()},[d]);function _(){l&&(m(t=>[...t,N??""]),c(l),d(l))}function y(){if(x.length===0)return;const t=[...x],s=t.pop();m(t),c(s||void 0),d(s||void 0)}function u(t){return t.startsWith("delete")||t==="revoke"?"text-[var(--destructive)]":t.startsWith("create")||t==="generate_token"?"text-[var(--accent)]":t.startsWith("update")||t==="reset_2fa"?"text-[var(--warning)]":t==="login"?"text-[var(--info)]":"text-[var(--text-secondary)]"}return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.audit_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.audit_subtitle")})]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsx(L,{value:i,onChange:j,options:h}),e.jsxs("div",{className:"relative w-full max-w-xs",children:[e.jsx(k,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.filter_by_user"),value:o,onChange:t=>g(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),f?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(T,{rows:5})}):n.length===0?e.jsx(E,{icon:A,title:a("admin.no_audit_entries"),description:a("admin.audit_logs_appear")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.timestamp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.user_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.action")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.resource")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.detail")}),e.jsx("th",{className:"pb-2 font-normal",children:a("admin.ip")})]})}),e.jsx("tbody",{children:n.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"whitespace-nowrap py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleString()}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.userId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:u(t.action),children:t.action})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.resource}),e.jsx("td",{className:"max-w-xs truncate py-2.5 pr-4 text-[var(--text-muted)]",children:t.detail}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:t.ip})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:n.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] mb-1",children:new Date(t.createdAt).toLocaleString()}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2 mb-1",children:[e.jsx("span",{className:`shrink-0 text-[11px] ${u(t.action)}`,children:t.action}),e.jsx("span",{className:"min-w-0 truncate text-[11px] text-[var(--text-secondary)]",children:t.resource})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] truncate",children:t.detail}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[11px] text-[var(--text-muted)]",children:[e.jsxs("span",{children:["User: ",t.userId]}),e.jsx("span",{children:t.ip})]})]},t.id))}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("admin.showing_entries",{count:String(n.length)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",disabled:x.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:y,children:[e.jsx(F,{className:"h-3.5 w-3.5"}),a("common.previous")]}),e.jsxs("button",{type:"button",disabled:!l,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:_,children:[a("common.next"),e.jsx(P,{className:"h-3.5 w-3.5"})]})]})]})]})]})}export{q as default};
1
+ import{a as C,r,h as S,j as e,y as k}from"./index-6n4YMG-q.js";import{S as L}from"./Select-CgGQnjuL.js";import{E}from"./EmptyState-P0FzomcO.js";import{T}from"./Skeleton-KIdOfHCh.js";import{S as A}from"./scroll-text-DrPNg6ww.js";import{C as F}from"./chevron-left-C5QPcYfE.js";import{C as P}from"./chevron-right-DUJ8mQK2.js";import"./chevron-down-BMMNE8tj.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{f as J,a as Q,F as W,a1 as A,r,h as X,t as x,j as e}from"./index-D9synPeJ.js";import{S as b}from"./Select-BRJxl1YO.js";import{M as ee}from"./MultiSelect-s1A3k8lX.js";import{C as te}from"./Checkbox-BOX6FtEq.js";import{A as ae}from"./arrow-left-DolNA3BD.js";import"./chevron-down-Cm4So_5j.js";const re=[{label:"every_hour",value:"0 * * * *"},{label:"every_6_hours",value:"0 */6 * * *"},{label:"daily_midnight",value:"0 0 * * *"},{label:"daily_9am",value:"0 9 * * *"},{label:"weekly_monday",value:"0 9 * * 1"},{label:"custom",value:""}],oe=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],se=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],ne=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Australia/Sydney"];function le(m){const a=m.trim().split(/\s+/);return a.length===5||a.length===6}function pe(){const m=J(),{t:a}=Q(),[Y]=W(),u=Y.get("templateId"),{createAutomation:w}=A(),[h,P]=r.useState(""),[y,F]=r.useState(""),[s,M]=r.useState([]),[c,$]=r.useState("cron"),[B,j]=r.useState("0 0 * * *"),[v,_]=r.useState("0 0 * * *"),[k,K]=r.useState("UTC"),[N,L]=r.useState("COMPLETED"),[d,C]=r.useState(""),[f,D]=r.useState(""),[g,z]=r.useState("readonly"),[S,T]=r.useState("claude"),[E,I]=r.useState(!0),[U,V]=r.useState({}),[O,G]=r.useState([]),[q,R]=r.useState(!1);r.useEffect(()=>{d&&(s.length===0||!s.includes(d))&&C("")},[d,s]),r.useEffect(()=>{let t=!1;return X.get("web/projects").json().then(n=>{t||G(n),!t&&n.length===1&&(M([n[0].key]),T(n[0].agentType))}).catch(()=>{t||x.error(a("automation.failed_load_projects"))}),()=>{t=!0}},[a]),r.useEffect(()=>{if(!u)return;let t=!1;return A.getState().fetchTemplates().then(()=>{if(t)return;const o=A.getState().templates.find(l=>l.id===Number(u));if(o){P(o.name),F(o.taskDescription),$(o.triggerType),z(o.executionMode);const l=o.triggerConfig;if(o.triggerType==="cron"&&l.cron&&(_(l.cron),j(""),l.timezone&&K(l.timezone)),o.triggerType==="task_event"&&l.event){L(l.event);const i=l.filter;i!=null&&i.projectKey&&C(i.projectKey),i!=null&&i.taskMode&&D(i.taskMode)}const p=o.taskConfig;p&&V(p),p!=null&&p.agentType&&T(p.agentType),I(!0)}}),()=>{t=!0}},[u]);const Z=t=>{j(t),t&&_(t)},H=r.useCallback(async()=>{if(!h.trim()){x.error(a("automation.name_required"));return}if(s.length===0){x.error(a("automation.project_required"));return}let t={};if(c==="cron"){if(!v.trim()){x.error(a("automation.cron_expression_required"));return}if(!le(v)){x.error(a("automation.cron_expression_invalid"));return}t={cron:v,timezone:k}}else c==="task_event"&&(t={event:N,filter:{...d&&{projectKey:d},...f&&{taskMode:f}}});R(!0);try{const n=await w({projectKey:s[0],projectKeys:s,name:h.trim(),description:y.trim(),triggerType:c,triggerConfig:t,executionMode:g,taskConfig:{...U,agentType:S},notifyProjectChats:E,...u?{templateId:Number(u)}:{}});x.success(a("automation.automation_created")),m(`/automations/${n.id}`)}catch(n){const o=n instanceof Error?n.message:a("automation.failed_create");x.error(o)}finally{R(!1)}},[h,y,s,c,v,k,N,d,f,g,S,E,u,w,m,a]);return e.jsxs("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>m("/automations"),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(ae,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("automation.create_title")})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-project",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.project")}),e.jsx(ee,{values:s,onChange:M,options:O.map(t=>({value:t.key,label:`${t.name} (${t.key})`})),placeholder:a("automation.select_project")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-name",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.name")}),e.jsx("input",{id:"create-name",type:"text",value:h,onChange:t=>P(t.target.value),placeholder:a("automation.name_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-description",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.description")}),e.jsx("textarea",{id:"create-description",value:y,onChange:t=>F(t.target.value),rows:4,placeholder:a("automation.description_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a("automation.template_vars")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.trigger_type")}),e.jsx("div",{className:"flex gap-2",children:["cron","task_event","manual"].map(t=>e.jsx("button",{onClick:()=>$(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${c===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))})]}),c==="cron"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.cron_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-cron-preset",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.preset")}),e.jsx(b,{value:B,onChange:Z,options:re.map(t=>({value:t.value,label:t.value?`${t.label} (${t.value})`:t.label}))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-cron-expression",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.cron_expression")}),e.jsx("input",{id:"create-cron-expression",type:"text",value:v,onChange:t=>{_(t.target.value),j("")},placeholder:"* * * * *",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs font-mono text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-timezone",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.timezone")}),e.jsx(b,{value:k,onChange:K,options:ne.map(t=>({value:t,label:t}))})]})]}),c==="task_event"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.task_event_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-event-type",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.event_type")}),e.jsx(b,{value:N,onChange:L,options:oe})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-filter-project",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_project_key")}),e.jsx(b,{value:d,onChange:C,options:[{value:"",label:a("automation.all_projects")},...O.filter(t=>s.includes(t.key)).map(t=>({value:t.key,label:`${t.name} (${t.key})`}))],disabled:s.length===0})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-filter-mode",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_task_mode")}),e.jsx(b,{value:f,onChange:D,options:[{value:"",label:a("automation.all_modes")},{value:"develop",label:"develop"},{value:"review",label:"review"}]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.execution_mode")}),e.jsx("div",{className:"flex gap-2",children:["readonly","writable"].map(t=>e.jsx("button",{onClick:()=>z(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${g===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a(g==="writable"?"automation.writable_hint":"automation.readonly_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:se.map(t=>e.jsx("button",{onClick:()=>T(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${S===t.value?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t.label},t.value))})]}),e.jsxs("div",{children:[e.jsx(te,{checked:E,onCheckedChange:I,label:a("automation.notify_project_chats")}),e.jsx("p",{className:"mt-1 pl-6 text-[10px] text-[var(--text-muted)]",children:a("automation.notify_project_chats_hint")})]}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:H,disabled:q,className:"flex-1 rounded-[4px] bg-[var(--accent)] px-4 py-2.5 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed transition-opacity hover:opacity-90",children:a(q?"automation.creating":"automation.create_automation")}),e.jsx("button",{onClick:()=>m("/automations"),className:"rounded-[4px] border border-[var(--border)] px-4 py-2.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("automation.cancel")})]})]})]})}export{pe as default};
1
+ import{f as J,a as Q,F as W,a1 as A,r,h as X,t as x,j as e}from"./index-6n4YMG-q.js";import{S as b}from"./Select-CgGQnjuL.js";import{M as ee}from"./MultiSelect-DCWH4BA8.js";import{C as te}from"./Checkbox-D1hAKR9E.js";import{A as ae}from"./arrow-left-CsRQX7H5.js";import"./chevron-down-BMMNE8tj.js";const re=[{label:"every_hour",value:"0 * * * *"},{label:"every_6_hours",value:"0 */6 * * *"},{label:"daily_midnight",value:"0 0 * * *"},{label:"daily_9am",value:"0 9 * * *"},{label:"weekly_monday",value:"0 9 * * 1"},{label:"custom",value:""}],oe=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],se=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],ne=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Australia/Sydney"];function le(m){const a=m.trim().split(/\s+/);return a.length===5||a.length===6}function pe(){const m=J(),{t:a}=Q(),[Y]=W(),u=Y.get("templateId"),{createAutomation:w}=A(),[h,P]=r.useState(""),[y,F]=r.useState(""),[s,M]=r.useState([]),[c,$]=r.useState("cron"),[B,j]=r.useState("0 0 * * *"),[v,_]=r.useState("0 0 * * *"),[k,K]=r.useState("UTC"),[N,L]=r.useState("COMPLETED"),[d,C]=r.useState(""),[f,D]=r.useState(""),[g,z]=r.useState("readonly"),[S,T]=r.useState("claude"),[E,I]=r.useState(!0),[U,V]=r.useState({}),[O,G]=r.useState([]),[q,R]=r.useState(!1);r.useEffect(()=>{d&&(s.length===0||!s.includes(d))&&C("")},[d,s]),r.useEffect(()=>{let t=!1;return X.get("web/projects").json().then(n=>{t||G(n),!t&&n.length===1&&(M([n[0].key]),T(n[0].agentType))}).catch(()=>{t||x.error(a("automation.failed_load_projects"))}),()=>{t=!0}},[a]),r.useEffect(()=>{if(!u)return;let t=!1;return A.getState().fetchTemplates().then(()=>{if(t)return;const o=A.getState().templates.find(l=>l.id===Number(u));if(o){P(o.name),F(o.taskDescription),$(o.triggerType),z(o.executionMode);const l=o.triggerConfig;if(o.triggerType==="cron"&&l.cron&&(_(l.cron),j(""),l.timezone&&K(l.timezone)),o.triggerType==="task_event"&&l.event){L(l.event);const i=l.filter;i!=null&&i.projectKey&&C(i.projectKey),i!=null&&i.taskMode&&D(i.taskMode)}const p=o.taskConfig;p&&V(p),p!=null&&p.agentType&&T(p.agentType),I(!0)}}),()=>{t=!0}},[u]);const Z=t=>{j(t),t&&_(t)},H=r.useCallback(async()=>{if(!h.trim()){x.error(a("automation.name_required"));return}if(s.length===0){x.error(a("automation.project_required"));return}let t={};if(c==="cron"){if(!v.trim()){x.error(a("automation.cron_expression_required"));return}if(!le(v)){x.error(a("automation.cron_expression_invalid"));return}t={cron:v,timezone:k}}else c==="task_event"&&(t={event:N,filter:{...d&&{projectKey:d},...f&&{taskMode:f}}});R(!0);try{const n=await w({projectKey:s[0],projectKeys:s,name:h.trim(),description:y.trim(),triggerType:c,triggerConfig:t,executionMode:g,taskConfig:{...U,agentType:S},notifyProjectChats:E,...u?{templateId:Number(u)}:{}});x.success(a("automation.automation_created")),m(`/automations/${n.id}`)}catch(n){const o=n instanceof Error?n.message:a("automation.failed_create");x.error(o)}finally{R(!1)}},[h,y,s,c,v,k,N,d,f,g,S,E,u,w,m,a]);return e.jsxs("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>m("/automations"),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(ae,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("automation.create_title")})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-project",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.project")}),e.jsx(ee,{values:s,onChange:M,options:O.map(t=>({value:t.key,label:`${t.name} (${t.key})`})),placeholder:a("automation.select_project")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-name",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.name")}),e.jsx("input",{id:"create-name",type:"text",value:h,onChange:t=>P(t.target.value),placeholder:a("automation.name_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-description",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.description")}),e.jsx("textarea",{id:"create-description",value:y,onChange:t=>F(t.target.value),rows:4,placeholder:a("automation.description_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a("automation.template_vars")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.trigger_type")}),e.jsx("div",{className:"flex gap-2",children:["cron","task_event","manual"].map(t=>e.jsx("button",{onClick:()=>$(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${c===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))})]}),c==="cron"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.cron_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-cron-preset",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.preset")}),e.jsx(b,{value:B,onChange:Z,options:re.map(t=>({value:t.value,label:t.value?`${t.label} (${t.value})`:t.label}))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-cron-expression",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.cron_expression")}),e.jsx("input",{id:"create-cron-expression",type:"text",value:v,onChange:t=>{_(t.target.value),j("")},placeholder:"* * * * *",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs font-mono text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-timezone",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.timezone")}),e.jsx(b,{value:k,onChange:K,options:ne.map(t=>({value:t,label:t}))})]})]}),c==="task_event"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.task_event_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-event-type",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.event_type")}),e.jsx(b,{value:N,onChange:L,options:oe})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-filter-project",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_project_key")}),e.jsx(b,{value:d,onChange:C,options:[{value:"",label:a("automation.all_projects")},...O.filter(t=>s.includes(t.key)).map(t=>({value:t.key,label:`${t.name} (${t.key})`}))],disabled:s.length===0})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"create-filter-mode",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_task_mode")}),e.jsx(b,{value:f,onChange:D,options:[{value:"",label:a("automation.all_modes")},{value:"develop",label:"develop"},{value:"review",label:"review"}]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.execution_mode")}),e.jsx("div",{className:"flex gap-2",children:["readonly","writable"].map(t=>e.jsx("button",{onClick:()=>z(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${g===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a(g==="writable"?"automation.writable_hint":"automation.readonly_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:se.map(t=>e.jsx("button",{onClick:()=>T(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${S===t.value?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t.label},t.value))})]}),e.jsxs("div",{children:[e.jsx(te,{checked:E,onCheckedChange:I,label:a("automation.notify_project_chats")}),e.jsx("p",{className:"mt-1 pl-6 text-[10px] text-[var(--text-muted)]",children:a("automation.notify_project_chats_hint")})]}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:H,disabled:q,className:"flex-1 rounded-[4px] bg-[var(--accent)] px-4 py-2.5 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed transition-opacity hover:opacity-90",children:a(q?"automation.creating":"automation.create_automation")}),e.jsx("button",{onClick:()=>m("/automations"),className:"rounded-[4px] border border-[var(--border)] px-4 py-2.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("automation.cancel")})]})]})]})}export{pe as default};
@@ -1,4 +1,4 @@
1
- import{c as u,f as M,a as I,B as S,a1 as $,r as o,a2 as D,p as L,t as i,x as O,j as t,s as F}from"./index-D9synPeJ.js";import{E as w}from"./EmptyState-CqF5g3iI.js";import{T as q}from"./Skeleton-CkmmCp2B.js";import{f as k,c as K}from"./date-CmcdoD87.js";import{e as z}from"./automationFindings-DfyQvLZV.js";import{C as _}from"./clock-DQeHdtoa.js";import{A as B}from"./arrow-left-DolNA3BD.js";import{P as C}from"./play-BHrAGNju.js";import{T as G}from"./trash-2-Cb5-yglV.js";import{T as H}from"./timer-ihiO0n04.js";import{Z as U}from"./zap-gd-vvEW3.js";import{E as Z}from"./external-link-lvF-co6-.js";/**
1
+ import{c as u,f as M,a as I,B as S,a1 as $,r as o,a2 as D,p as L,t as i,x as O,j as t,s as F}from"./index-6n4YMG-q.js";import{E as w}from"./EmptyState-P0FzomcO.js";import{T as q}from"./Skeleton-KIdOfHCh.js";import{f as k,c as K}from"./date-CmcdoD87.js";import{e as z}from"./automationFindings-DfyQvLZV.js";import{C as _}from"./clock-CM8cLcAb.js";import{A as B}from"./arrow-left-CsRQX7H5.js";import{P as C}from"./play-sxSJsoXu.js";import{T as G}from"./trash-2--fHS3BRC.js";import{T as H}from"./timer-tBxBLW3s.js";import{Z as U}from"./zap-Dhvfo8tD.js";import{E as Z}from"./external-link-DLg1H4XY.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{f as X,a as ee,B as te,a1 as ae,r,h as re,t as m,j as e}from"./index-D9synPeJ.js";import{S as v}from"./Select-BRJxl1YO.js";import{M as oe}from"./MultiSelect-s1A3k8lX.js";import{C as se}from"./Checkbox-BOX6FtEq.js";import{T as ne}from"./Skeleton-CkmmCp2B.js";import{E as le}from"./EmptyState-CqF5g3iI.js";import{C as ie}from"./clock-DQeHdtoa.js";import{A as ce}from"./arrow-left-DolNA3BD.js";import"./chevron-down-Cm4So_5j.js";const R=[{label:"every_hour",value:"0 * * * *"},{label:"every_6_hours",value:"0 */6 * * *"},{label:"daily_midnight",value:"0 0 * * *"},{label:"daily_9am",value:"0 9 * * *"},{label:"weekly_monday",value:"0 9 * * 1"},{label:"custom",value:""}],de=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],xe=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],U=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Asia/Kolkata","Australia/Sydney"];function me(u){const a=u.trim().split(/\s+/);return a.length===5||a.length===6}function _e(){const u=X(),{t:a}=ee(),{id:Y}=te(),n=Number(Y),{currentAutomation:o,loading:B,fetchAutomation:E,updateAutomation:S}=ae(),[b,T]=r.useState(""),[y,w]=r.useState(""),[l,A]=r.useState([]),[c,P]=r.useState("cron"),[V,j]=r.useState(""),[p,g]=r.useState(""),[d,M]=r.useState("UTC"),[_,$]=r.useState("COMPLETED"),[x,k]=r.useState(""),[h,F]=r.useState(""),[f,K]=r.useState("readonly"),[N,L]=r.useState("claude"),[C,z]=r.useState(!1),[D,G]=r.useState([]),[O,I]=r.useState(!1),[q,Z]=r.useState(!1);r.useEffect(()=>{E(n)},[n,E]),r.useEffect(()=>{let t=!1;return re.get("web/projects").json().then(i=>{t||G(i)}).catch(()=>{t||m.error(a("automation.failed_load_projects"))}),()=>{t=!0}},[a]),r.useEffect(()=>{x&&(l.length===0||!l.includes(x))&&k("")},[x,l]),r.useEffect(()=>{if(!o||o.id!==n||q)return;T(o.name),w(o.description),A(o.projectKeys??[o.projectKey]),P(o.triggerType),K(o.executionMode);const t=o.triggerConfig;if(o.triggerType==="cron"){const s=t.cron??"";g(s);const Q=R.find(W=>W.value===s);j(Q?s:""),M(t.timezone??"UTC")}if(o.triggerType==="task_event"){$(t.event??"COMPLETED");const s=t.filter;k((s==null?void 0:s.projectKey)??""),F((s==null?void 0:s.taskMode)??"")}const i=o.taskConfig;L((i==null?void 0:i.agentType)??"claude"),z(o.notifyProjectChats),Z(!0)},[o,n,q]);const H=t=>{j(t),t&&g(t)},J=r.useCallback(async()=>{if(!b.trim()){m.error(a("automation.name_required"));return}if(l.length===0){m.error(a("automation.project_required"));return}let t={};if(c==="cron"){if(!p.trim()){m.error(a("automation.cron_expression_required"));return}if(!me(p)){m.error(a("automation.cron_expression_invalid"));return}t={cron:p,timezone:d}}else c==="task_event"&&(t={event:_,filter:{...x&&{projectKey:x},...h&&{taskMode:h}}});I(!0);try{await S(n,{projectKey:l[0],projectKeys:l,name:b.trim(),description:y.trim(),triggerType:c,triggerConfig:t,executionMode:f,taskConfig:{...(o==null?void 0:o.taskConfig)??{},agentType:N},notifyProjectChats:C}),m.success(a("automation.automation_updated")),u(`/automations/${n}`)}catch(i){const s=i instanceof Error?i.message:a("automation.failed_update");m.error(s)}finally{I(!1)}},[b,y,l,c,p,d,_,x,h,f,N,C,n,S,u,a]);return B&&!o?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(ne,{rows:6})}):!o||o.id!==n?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(le,{icon:ie,title:a("automation.automation_not_found")})}):e.jsxs("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>u(`/automations/${n}`),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(ce,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("automation.edit_title")})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-projects",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.project")}),e.jsx(oe,{values:l,onChange:A,options:D.map(t=>({value:t.key,label:`${t.name} (${t.key})`})),placeholder:a("automation.select_project")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-name",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.name")}),e.jsx("input",{id:"edit-name",type:"text",value:b,onChange:t=>T(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-description",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.description")}),e.jsx("textarea",{id:"edit-description",value:y,onChange:t=>w(t.target.value),rows:4,placeholder:a("automation.description_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a("automation.template_vars")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.trigger_type")}),e.jsx("div",{className:"flex gap-2",children:["cron","task_event","manual"].map(t=>e.jsx("button",{onClick:()=>P(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${c===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))})]}),c==="cron"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.cron_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-cron-preset",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.preset")}),e.jsx(v,{value:V,onChange:H,options:R.map(t=>({value:t.value,label:`${t.label}${t.value?` (${t.value})`:""}`}))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-cron-expression",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.cron_expression")}),e.jsx("input",{id:"edit-cron-expression",type:"text",value:p,onChange:t=>{g(t.target.value),j("")},placeholder:"* * * * *",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs font-mono text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-timezone",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.timezone")}),e.jsx(v,{value:d,onChange:M,options:[...d&&!U.includes(d)?[{value:d,label:d}]:[],...U.map(t=>({value:t,label:t}))]})]})]}),c==="task_event"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.task_event_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-event-type",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.event_type")}),e.jsx(v,{value:_,onChange:$,options:de})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-filter-project",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_project_key")}),e.jsx(v,{value:x,onChange:k,options:[{value:"",label:a("automation.all_projects")},...D.filter(t=>l.includes(t.key)).map(t=>({value:t.key,label:`${t.name} (${t.key})`}))],disabled:l.length===0})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-filter-mode",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_task_mode")}),e.jsx(v,{value:h,onChange:F,options:[{value:"",label:a("automation.all_modes")},{value:"develop",label:"develop"},{value:"review",label:"review"}]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.execution_mode")}),e.jsx("div",{className:"flex gap-2",children:["readonly","writable"].map(t=>e.jsx("button",{onClick:()=>K(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${f===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a(f==="writable"?"automation.writable_hint":"automation.readonly_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:xe.map(t=>e.jsx("button",{onClick:()=>L(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${N===t.value?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t.label},t.value))})]}),e.jsxs("div",{children:[e.jsx(se,{checked:C,onCheckedChange:z,label:a("automation.notify_project_chats")}),e.jsx("p",{className:"mt-1 pl-6 text-[10px] text-[var(--text-muted)]",children:a("automation.notify_project_chats_hint")})]}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:J,disabled:O,className:"flex-1 rounded-[4px] bg-[var(--accent)] px-4 py-2.5 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed transition-opacity hover:opacity-90",children:a(O?"automation.saving":"automation.save_changes")}),e.jsx("button",{onClick:()=>u(`/automations/${n}`),className:"rounded-[4px] border border-[var(--border)] px-4 py-2.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("automation.cancel")})]})]})]})}export{_e as default};
1
+ import{f as X,a as ee,B as te,a1 as ae,r,h as re,t as m,j as e}from"./index-6n4YMG-q.js";import{S as v}from"./Select-CgGQnjuL.js";import{M as oe}from"./MultiSelect-DCWH4BA8.js";import{C as se}from"./Checkbox-D1hAKR9E.js";import{T as ne}from"./Skeleton-KIdOfHCh.js";import{E as le}from"./EmptyState-P0FzomcO.js";import{C as ie}from"./clock-CM8cLcAb.js";import{A as ce}from"./arrow-left-CsRQX7H5.js";import"./chevron-down-BMMNE8tj.js";const R=[{label:"every_hour",value:"0 * * * *"},{label:"every_6_hours",value:"0 */6 * * *"},{label:"daily_midnight",value:"0 0 * * *"},{label:"daily_9am",value:"0 9 * * *"},{label:"weekly_monday",value:"0 9 * * 1"},{label:"custom",value:""}],de=[{label:"completed",value:"COMPLETED"},{label:"failed",value:"FAILED"},{label:"cancelled",value:"CANCELLED"}],xe=[{label:"claude",value:"claude"},{label:"cursor",value:"cursor"},{label:"codex",value:"codex"}],U=["UTC","America/New_York","America/Chicago","America/Denver","America/Los_Angeles","Europe/London","Europe/Berlin","Asia/Tokyo","Asia/Shanghai","Asia/Singapore","Asia/Kolkata","Australia/Sydney"];function me(u){const a=u.trim().split(/\s+/);return a.length===5||a.length===6}function _e(){const u=X(),{t:a}=ee(),{id:Y}=te(),n=Number(Y),{currentAutomation:o,loading:B,fetchAutomation:E,updateAutomation:S}=ae(),[b,T]=r.useState(""),[y,w]=r.useState(""),[l,A]=r.useState([]),[c,P]=r.useState("cron"),[V,j]=r.useState(""),[p,g]=r.useState(""),[d,M]=r.useState("UTC"),[_,$]=r.useState("COMPLETED"),[x,k]=r.useState(""),[h,F]=r.useState(""),[f,K]=r.useState("readonly"),[N,L]=r.useState("claude"),[C,z]=r.useState(!1),[D,G]=r.useState([]),[O,I]=r.useState(!1),[q,Z]=r.useState(!1);r.useEffect(()=>{E(n)},[n,E]),r.useEffect(()=>{let t=!1;return re.get("web/projects").json().then(i=>{t||G(i)}).catch(()=>{t||m.error(a("automation.failed_load_projects"))}),()=>{t=!0}},[a]),r.useEffect(()=>{x&&(l.length===0||!l.includes(x))&&k("")},[x,l]),r.useEffect(()=>{if(!o||o.id!==n||q)return;T(o.name),w(o.description),A(o.projectKeys??[o.projectKey]),P(o.triggerType),K(o.executionMode);const t=o.triggerConfig;if(o.triggerType==="cron"){const s=t.cron??"";g(s);const Q=R.find(W=>W.value===s);j(Q?s:""),M(t.timezone??"UTC")}if(o.triggerType==="task_event"){$(t.event??"COMPLETED");const s=t.filter;k((s==null?void 0:s.projectKey)??""),F((s==null?void 0:s.taskMode)??"")}const i=o.taskConfig;L((i==null?void 0:i.agentType)??"claude"),z(o.notifyProjectChats),Z(!0)},[o,n,q]);const H=t=>{j(t),t&&g(t)},J=r.useCallback(async()=>{if(!b.trim()){m.error(a("automation.name_required"));return}if(l.length===0){m.error(a("automation.project_required"));return}let t={};if(c==="cron"){if(!p.trim()){m.error(a("automation.cron_expression_required"));return}if(!me(p)){m.error(a("automation.cron_expression_invalid"));return}t={cron:p,timezone:d}}else c==="task_event"&&(t={event:_,filter:{...x&&{projectKey:x},...h&&{taskMode:h}}});I(!0);try{await S(n,{projectKey:l[0],projectKeys:l,name:b.trim(),description:y.trim(),triggerType:c,triggerConfig:t,executionMode:f,taskConfig:{...(o==null?void 0:o.taskConfig)??{},agentType:N},notifyProjectChats:C}),m.success(a("automation.automation_updated")),u(`/automations/${n}`)}catch(i){const s=i instanceof Error?i.message:a("automation.failed_update");m.error(s)}finally{I(!1)}},[b,y,l,c,p,d,_,x,h,f,N,C,n,S,u,a]);return B&&!o?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(ne,{rows:6})}):!o||o.id!==n?e.jsx("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:e.jsx(le,{icon:ie,title:a("automation.automation_not_found")})}):e.jsxs("div",{className:"mx-auto max-w-2xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[e.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>u(`/automations/${n}`),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:e.jsx(ce,{className:"h-4 w-4"})}),e.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a("automation.edit_title")})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-projects",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.project")}),e.jsx(oe,{values:l,onChange:A,options:D.map(t=>({value:t.key,label:`${t.name} (${t.key})`})),placeholder:a("automation.select_project")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-name",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.name")}),e.jsx("input",{id:"edit-name",type:"text",value:b,onChange:t=>T(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-description",className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.description")}),e.jsx("textarea",{id:"edit-description",value:y,onChange:t=>w(t.target.value),rows:4,placeholder:a("automation.description_placeholder"),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)] resize-none"}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a("automation.template_vars")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.trigger_type")}),e.jsx("div",{className:"flex gap-2",children:["cron","task_event","manual"].map(t=>e.jsx("button",{onClick:()=>P(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${c===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))})]}),c==="cron"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.cron_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-cron-preset",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.preset")}),e.jsx(v,{value:V,onChange:H,options:R.map(t=>({value:t.value,label:`${t.label}${t.value?` (${t.value})`:""}`}))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-cron-expression",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.cron_expression")}),e.jsx("input",{id:"edit-cron-expression",type:"text",value:p,onChange:t=>{g(t.target.value),j("")},placeholder:"* * * * *",className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs font-mono text-[var(--text-primary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-timezone",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.timezone")}),e.jsx(v,{value:d,onChange:M,options:[...d&&!U.includes(d)?[{value:d,label:d}]:[],...U.map(t=>({value:t,label:t}))]})]})]}),c==="task_event"&&e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-3",children:[e.jsx("label",{className:"block text-[11px] font-bold text-[var(--text-primary)]",children:a("automation.task_event_config")}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-event-type",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.event_type")}),e.jsx(v,{value:_,onChange:$,options:de})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-filter-project",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_project_key")}),e.jsx(v,{value:x,onChange:k,options:[{value:"",label:a("automation.all_projects")},...D.filter(t=>l.includes(t.key)).map(t=>({value:t.key,label:`${t.name} (${t.key})`}))],disabled:l.length===0})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"edit-filter-mode",className:"mb-1 block text-[10px] text-[var(--text-muted)]",children:a("automation.filter_task_mode")}),e.jsx(v,{value:h,onChange:F,options:[{value:"",label:a("automation.all_modes")},{value:"develop",label:"develop"},{value:"review",label:"review"}]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.execution_mode")}),e.jsx("div",{className:"flex gap-2",children:["readonly","writable"].map(t=>e.jsx("button",{onClick:()=>K(t),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${f===t?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t},t))}),e.jsx("p",{className:"mt-1 text-[10px] text-[var(--text-muted)]",children:a(f==="writable"?"automation.writable_hint":"automation.readonly_hint")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-[11px] text-[var(--text-muted)]",children:a("automation.agent_type")}),e.jsx("div",{className:"flex gap-2",children:xe.map(t=>e.jsx("button",{onClick:()=>L(t.value),className:`flex-1 rounded-[4px] border px-3 py-2 text-xs transition-colors ${N===t.value?"border-[var(--accent)] text-[var(--accent)] bg-[var(--accent)]/5":"border-[var(--border)] text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:t.label},t.value))})]}),e.jsxs("div",{children:[e.jsx(se,{checked:C,onCheckedChange:z,label:a("automation.notify_project_chats")}),e.jsx("p",{className:"mt-1 pl-6 text-[10px] text-[var(--text-muted)]",children:a("automation.notify_project_chats_hint")})]}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{onClick:J,disabled:O,className:"flex-1 rounded-[4px] bg-[var(--accent)] px-4 py-2.5 text-xs font-bold text-black disabled:opacity-40 disabled:cursor-not-allowed transition-opacity hover:opacity-90",children:a(O?"automation.saving":"automation.save_changes")}),e.jsx("button",{onClick:()=>u(`/automations/${n}`),className:"rounded-[4px] border border-[var(--border)] px-4 py-2.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("automation.cancel")})]})]})]})}export{_e as default};
@@ -1,4 +1,4 @@
1
- import{c as E,f as $,a as K,r as l,a1 as M,x as Z,j as e,a2 as Q,a3 as R,a4 as X,a5 as F,t as p,V as J,G as ee,v as te,h as ae,X as re}from"./index-D9synPeJ.js";import{E as P}from"./EmptyState-CqF5g3iI.js";import{T as I}from"./Skeleton-CkmmCp2B.js";import{T as se}from"./TaskStatusBadge-BldGSOah.js";import{f as H,d as oe}from"./date-CmcdoD87.js";import{S as ne}from"./Select-BRJxl1YO.js";import{M as ie}from"./MultiSelect-s1A3k8lX.js";import{C as O}from"./Checkbox-BOX6FtEq.js";import{e as ce}from"./automationFindings-DfyQvLZV.js";import{P as le}from"./plus-9sncIl_N.js";import{P as de}from"./play-BHrAGNju.js";import{Z as xe}from"./zap-gd-vvEW3.js";import{T as me}from"./timer-ihiO0n04.js";import{C as ue}from"./clock-DQeHdtoa.js";import{C as pe}from"./chevron-right-D0k7WYYt.js";import"./status-colors-CRgg1N4i.js";import"./chevron-down-Cm4So_5j.js";/**
1
+ import{c as E,f as $,a as K,r as l,a1 as M,x as Z,j as e,a2 as Q,a3 as R,a4 as X,a5 as F,t as p,V as J,G as ee,v as te,h as ae,X as re}from"./index-6n4YMG-q.js";import{E as P}from"./EmptyState-P0FzomcO.js";import{T as I}from"./Skeleton-KIdOfHCh.js";import{T as se}from"./TaskStatusBadge-D9epJQNe.js";import{f as H,d as oe}from"./date-CmcdoD87.js";import{S as ne}from"./Select-CgGQnjuL.js";import{M as ie}from"./MultiSelect-DCWH4BA8.js";import{C as O}from"./Checkbox-D1hAKR9E.js";import{e as ce}from"./automationFindings-DfyQvLZV.js";import{P as le}from"./plus-B3b8vXw9.js";import{P as de}from"./play-sxSJsoXu.js";import{Z as xe}from"./zap-Dhvfo8tD.js";import{T as me}from"./timer-tBxBLW3s.js";import{C as ue}from"./clock-CM8cLcAb.js";import{C as pe}from"./chevron-right-DUJ8mQK2.js";import"./status-colors-D1PZs9TB.js";import"./chevron-down-BMMNE8tj.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as k,f as E,a as I,B as A,r as c,k as C,p as R,h as f,j as t,Y as u,V as _}from"./index-D9synPeJ.js";import{E as h}from"./EmptyState-CqF5g3iI.js";import{T as P}from"./Skeleton-CkmmCp2B.js";import{b as D,c as S,f as T}from"./date-CmcdoD87.js";import{e as L}from"./automationFindings-DfyQvLZV.js";import{C as $}from"./clock-DQeHdtoa.js";import{A as G}from"./arrow-left-DolNA3BD.js";import{E as q}from"./external-link-lvF-co6-.js";import{C as U}from"./circle-alert-BojCwibr.js";/**
1
+ import{c as k,f as E,a as I,B as A,r as c,k as C,p as R,h as f,j as t,Y as u,V as _}from"./index-6n4YMG-q.js";import{E as h}from"./EmptyState-P0FzomcO.js";import{T as P}from"./Skeleton-KIdOfHCh.js";import{b as D,c as S,f as T}from"./date-CmcdoD87.js";import{e as L}from"./automationFindings-DfyQvLZV.js";import{C as $}from"./clock-CM8cLcAb.js";import{A as G}from"./arrow-left-CsRQX7H5.js";import{E as q}from"./external-link-DLg1H4XY.js";import{C as U}from"./circle-alert-CMpAAr9i.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{a as u,F as h,f as g,r as s,h as v,j as e}from"./index-D9synPeJ.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,F as h,f as g,r as s,h as v,j as e}from"./index-6n4YMG-q.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-D9synPeJ.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:"reject"})," — skip or abort the current stage (you can also cancel the entire task with ",e.jsx("code",{className:"text-[var(--accent)]",children:"cancel #id"}),")"]})]}),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("p",{className:"text-xs text-[var(--text-muted)]",children:"completion and failure notifications stay with the executor dm plus the original source chat or creator fallback. overlord does not fan these lifecycle notifications out to every chat bound to the project."}),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.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.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.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.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.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.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.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:"dm"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",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.jsxs("tr",{className:"border-b border-[var(--border)]",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.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"review_round_complete"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat or dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"automation_run_completed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message (card, text fallback)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm, if linked)"}),e.jsx("td",{className:"py-2 pr-4",children:"notify-default project chats"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"automation_run_failed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message (card, text fallback)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm, if linked)"}),e.jsx("td",{className:"py-2 pr-4",children:"notify-default project chats"})]})]})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"automation tasks"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"automation-spawned tasks do not emit regular task lifecycle notifications (created, assigned, running, completed, failed). instead, when an automation run finishes, the executor receives a text-only dm with findings (if their platform account is linked), and each bot's notify-default chat for that project also receives the summary when notifyprojectchats is enabled."}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["command routing and automation routing are separate. ",e.jsx("code",{className:"text-[var(--accent)]",children:"default"})," decides which project a chat uses for bot commands; ",e.jsx("code",{className:"text-[var(--accent)]",children:"notify default"})," decides which chat receives automation summaries for a project."]})]}),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 in the same source chat. 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 receives completed, failed, and review_round_complete notifications in the source chat, or in-app if no source chat exists. 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 via commands"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["in addition to card buttons, users can type ",e.jsx("code",{className:"text-[var(--accent)]",children:"confirm #id"})," or ",e.jsx("code",{className:"text-[var(--accent)]",children:"reject #id"}),". when replying directly to the bot's confirmation dm, the task id can be omitted — the bot infers it from the parent message."]})]}),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:"automation summary sent to the wrong room"}),e.jsx("td",{className:"py-2 pr-4",children:"notify-default chat set on another binding"}),e.jsx("td",{className:"py-2",children:"switch the project's notify default in admin - bot management"})]}),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",{className:"border-b border-[var(--border)]",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("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"lark quote/reply content missing"}),e.jsx("td",{className:"py-2 pr-4",children:"missing im:message:readonly permission"}),e.jsx("td",{className:"py-2",children:"add im:message:readonly scope in the lark app's permissions settings and publish a new version"})]})]})]})})]}),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-6n4YMG-q.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:"reject"})," — skip or abort the current stage (you can also cancel the entire task with ",e.jsx("code",{className:"text-[var(--accent)]",children:"cancel #id"}),")"]})]}),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("p",{className:"text-xs text-[var(--text-muted)]",children:"completion and failure notifications stay with the executor dm plus the original source chat or creator fallback. overlord does not fan these lifecycle notifications out to every chat bound to the project."}),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.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.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.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.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.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.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.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:"dm"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm)"}),e.jsx("td",{className:"py-2 pr-4",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.jsxs("tr",{className:"border-b border-[var(--border)]",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.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"review_round_complete"}),e.jsx("td",{className:"py-2 pr-4",children:"new message"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat or dm)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (source chat)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"py-2 pr-4",children:"automation_run_completed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message (card, text fallback)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm, if linked)"}),e.jsx("td",{className:"py-2 pr-4",children:"notify-default project chats"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"automation_run_failed"}),e.jsx("td",{className:"py-2 pr-4",children:"new message (card, text fallback)"}),e.jsx("td",{className:"py-2 pr-4",children:"yes (dm, if linked)"}),e.jsx("td",{className:"py-2 pr-4",children:"notify-default project chats"})]})]})]})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs text-[var(--text-primary)]",children:"automation tasks"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"automation-spawned tasks do not emit regular task lifecycle notifications (created, assigned, running, completed, failed). instead, when an automation run finishes, the executor receives a text-only dm with findings (if their platform account is linked), and each bot's notify-default chat for that project also receives the summary when notifyprojectchats is enabled."}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["command routing and automation routing are separate. ",e.jsx("code",{className:"text-[var(--accent)]",children:"default"})," decides which project a chat uses for bot commands; ",e.jsx("code",{className:"text-[var(--accent)]",children:"notify default"})," decides which chat receives automation summaries for a project."]})]}),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 in the same source chat. 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 receives completed, failed, and review_round_complete notifications in the source chat, or in-app if no source chat exists. 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 via commands"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["in addition to card buttons, users can type ",e.jsx("code",{className:"text-[var(--accent)]",children:"confirm #id"})," or ",e.jsx("code",{className:"text-[var(--accent)]",children:"reject #id"}),". when replying directly to the bot's confirmation dm, the task id can be omitted — the bot infers it from the parent message."]})]}),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:"automation summary sent to the wrong room"}),e.jsx("td",{className:"py-2 pr-4",children:"notify-default chat set on another binding"}),e.jsx("td",{className:"py-2",children:"switch the project's notify default in admin - bot management"})]}),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",{className:"border-b border-[var(--border)]",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("tr",{children:[e.jsx("td",{className:"py-2 pr-4",children:"lark quote/reply content missing"}),e.jsx("td",{className:"py-2 pr-4",children:"missing im:message:readonly permission"}),e.jsx("td",{className:"py-2",children:"add im:message:readonly scope in the lark app's permissions settings and publish a new version"})]})]})]})})]}),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,4 +1,4 @@
1
- import{c as R,a as K,v as F,r as i,j as e,X as M,h as j,s as H,t as U}from"./index-D9synPeJ.js";import{S as q}from"./Select-BRJxl1YO.js";import{C as V}from"./DocsPrimitives-BzVDx2cs.js";import{T as z}from"./trash-2-Cb5-yglV.js";import{P as W}from"./plus-9sncIl_N.js";import{E as X}from"./EmptyState-CqF5g3iI.js";import{T as L}from"./Skeleton-CkmmCp2B.js";import{u as P}from"./useFetch-Dj0ZN58I.js";import{d as T}from"./status-colors-CRgg1N4i.js";import{B as J}from"./bot-Bf1PX7dx.js";import{P as O}from"./pencil-DIvX1Xsb.js";import"./chevron-down-Cm4So_5j.js";import"./copy-CHO7AsGy.js";/**
1
+ import{c as R,a as K,v as F,r as i,j as e,X as M,h as j,s as H,t as U}from"./index-6n4YMG-q.js";import{S as q}from"./Select-CgGQnjuL.js";import{C as V}from"./DocsPrimitives-CgyoKAir.js";import{T as z}from"./trash-2--fHS3BRC.js";import{P as W}from"./plus-B3b8vXw9.js";import{E as X}from"./EmptyState-P0FzomcO.js";import{T as L}from"./Skeleton-KIdOfHCh.js";import{u as P}from"./useFetch-CBIWj1ZT.js";import{d as T}from"./status-colors-D1PZs9TB.js";import{B as J}from"./bot-BI0aOjZg.js";import{P as O}from"./pencil-wJOYzbVI.js";import"./chevron-down-BMMNE8tj.js";import"./copy-DEFukTLk.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{j as e}from"./index-D9synPeJ.js";import{a as t}from"./DocsPrimitives-BzVDx2cs.js";import"./copy-CHO7AsGy.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 o(){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(t,{code:`curl -X POST https://your-server:9000/api/admin/bots \\
1
+ import{j as e}from"./index-6n4YMG-q.js";import{a as t}from"./DocsPrimitives-CgyoKAir.js";import"./copy-DEFukTLk.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 o(){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(t,{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 '{