@overlordai/server 1.0.163 → 1.0.164

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 (157) hide show
  1. package/database/migrations/019-chat-bindings-notify-default.sql +35 -0
  2. package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
  3. package/dist/adapters/lark/lark.adapter.js +6 -1
  4. package/dist/adapters/lark/lark.adapter.js.map +1 -1
  5. package/dist/adapters/slack/slack-block.builder.d.ts +2 -0
  6. package/dist/adapters/slack/slack-block.builder.d.ts.map +1 -1
  7. package/dist/adapters/slack/slack-block.builder.js +37 -7
  8. package/dist/adapters/slack/slack-block.builder.js.map +1 -1
  9. package/dist/automation/automation-findings.d.ts +4 -0
  10. package/dist/automation/automation-findings.d.ts.map +1 -0
  11. package/dist/automation/automation-findings.js +93 -0
  12. package/dist/automation/automation-findings.js.map +1 -0
  13. package/dist/automation/automation-template.service.d.ts.map +1 -1
  14. package/dist/automation/automation-template.service.js +4 -0
  15. package/dist/automation/automation-template.service.js.map +1 -1
  16. package/dist/automation/builtin-templates.d.ts +8 -0
  17. package/dist/automation/builtin-templates.d.ts.map +1 -1
  18. package/dist/automation/builtin-templates.js +217 -11
  19. package/dist/automation/builtin-templates.js.map +1 -1
  20. package/dist/database/repositories/automation.repository.d.ts +5 -0
  21. package/dist/database/repositories/automation.repository.d.ts.map +1 -1
  22. package/dist/database/repositories/automation.repository.js +29 -0
  23. package/dist/database/repositories/automation.repository.js.map +1 -1
  24. package/dist/database/repositories/bot.repository.d.ts +7 -0
  25. package/dist/database/repositories/bot.repository.d.ts.map +1 -1
  26. package/dist/database/repositories/bot.repository.js +80 -7
  27. package/dist/database/repositories/bot.repository.js.map +1 -1
  28. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  29. package/dist/notifier/notification-consumer.js +10 -13
  30. package/dist/notifier/notification-consumer.js.map +1 -1
  31. package/dist/notifier/template.service.d.ts.map +1 -1
  32. package/dist/notifier/template.service.js +97 -17
  33. package/dist/notifier/template.service.js.map +1 -1
  34. package/dist/web/admin/admin-bot.controller.d.ts +4 -0
  35. package/dist/web/admin/admin-bot.controller.d.ts.map +1 -1
  36. package/dist/web/admin/admin-bot.controller.js +34 -0
  37. package/dist/web/admin/admin-bot.controller.js.map +1 -1
  38. package/dist/web/automation.controller.d.ts +2 -0
  39. package/dist/web/automation.controller.d.ts.map +1 -1
  40. package/package.json +4 -4
  41. package/public/assets/{AccessTokensPage-ldQyk5XS.js → AccessTokensPage-D_7YDp_V.js} +1 -1
  42. package/public/assets/{AdminPage-B2nXMtQP.js → AdminPage-DdFXx0Xj.js} +1 -1
  43. package/public/assets/{AgentCliPage-DN6Sx2_W.js → AgentCliPage-P5kTmePw.js} +1 -1
  44. package/public/assets/{ApiReferencePage-B63Cv6ev.js → ApiReferencePage-BqWGBZ_O.js} +1 -1
  45. package/public/assets/{ArchitecturePage-Bw1w2No4.js → ArchitecturePage-BL4siOHt.js} +1 -1
  46. package/public/assets/{AuditLogPage-DUrbtnap.js → AuditLogPage-pRql2nQ7.js} +1 -1
  47. package/public/assets/AutomationCreatePage-DJQaYP_m.js +1 -0
  48. package/public/assets/{AutomationDetailPage-CMBHY3MX.js → AutomationDetailPage-DqFl-wOt.js} +4 -4
  49. package/public/assets/AutomationEditPage-DGAGgkUC.js +1 -0
  50. package/public/assets/AutomationListPage-DZg8R_6o.js +26 -0
  51. package/public/assets/AutomationRunDetailPage-CCW8q96K.js +6 -0
  52. package/public/assets/{BindPlatformPage-DSlnobHy.js → BindPlatformPage-CZl5-Iy1.js} +1 -1
  53. package/public/assets/BotIntegrationPage-DLkm33Yu.js +1 -0
  54. package/public/assets/BotManage-BLDeztU9.js +6 -0
  55. package/public/assets/{BotSetupPage-DMdavNli.js → BotSetupPage-CdkW57x3.js} +17 -5
  56. package/public/assets/ChangelogPage-Dh-ZKMy7.js +1 -0
  57. package/public/assets/Checkbox-CZd7073E.js +1 -0
  58. package/public/assets/{CliReferencePage-Cj5J-5PY.js → CliReferencePage-oiI83DWp.js} +1 -1
  59. package/public/assets/{ConfirmStageDialog-Dl1_NcCr.js → ConfirmStageDialog-BvAwtj3E.js} +1 -1
  60. package/public/assets/{DeploymentPage-BnJoRfc6.js → DeploymentPage-BDVB924W.js} +1 -1
  61. package/public/assets/{DevWorkflowPage-Bh6iCSgz.js → DevWorkflowPage-DbQmdO2_.js} +1 -1
  62. package/public/assets/{DeveloperManage-DRktoKo0.js → DeveloperManage-CglSKeKS.js} +1 -1
  63. package/public/assets/{DeveloperSetupPage-CFJ_Diyi.js → DeveloperSetupPage-BnSTEmg5.js} +1 -1
  64. package/public/assets/{DocsIndexPage-DBQdb_iY.js → DocsIndexPage-DlcO-07d.js} +1 -1
  65. package/public/assets/{DocsLayout-Cd956Abd.js → DocsLayout-Bt1aVPLh.js} +1 -1
  66. package/public/assets/{DocsPrimitives-DxxQvd4A.js → DocsPrimitives-Beo_PA0s.js} +1 -1
  67. package/public/assets/{EditProjectPage-BGNgVGl_.js → EditProjectPage-BvbqOa-5.js} +1 -1
  68. package/public/assets/{EmptyState-DQ0fOTKY.js → EmptyState-DtQh3oGP.js} +1 -1
  69. package/public/assets/{EnvVariablesPage-CelP_-SE.js → EnvVariablesPage-ChGB0--u.js} +1 -1
  70. package/public/assets/{HomePage-C3_hGl3i.js → HomePage-RIo62sIo.js} +1 -1
  71. package/public/assets/{InfoRow-ssnjkeJd.js → InfoRow-BAw0Cqao.js} +1 -1
  72. package/public/assets/{InstallationPage-OvlJ5Fm1.js → InstallationPage-BfFP3JL6.js} +1 -1
  73. package/public/assets/{LandingPage-BNl9fFku.js → LandingPage-D1nwz0j2.js} +1 -1
  74. package/public/assets/{LocalDevelopmentPage-CXbkHbi0.js → LocalDevelopmentPage-C9FttUSM.js} +1 -1
  75. package/public/assets/{LoginPage-L_1SThps.js → LoginPage-BSeNMZVK.js} +1 -1
  76. package/public/assets/{MetricBar-5mo0FTxI.js → MetricBar-DRasIPu8.js} +1 -1
  77. package/public/assets/{MultiSelect-4LelQ6vN.js → MultiSelect-CeoEM-97.js} +1 -1
  78. package/public/assets/{NotFoundPage-Ht-8qf12.js → NotFoundPage-CxACXVzS.js} +1 -1
  79. package/public/assets/{OnboardingGuide-D9ui1dG9.js → OnboardingGuide-DV4KLWmI.js} +1 -1
  80. package/public/assets/{PermissionsPage-DbppdG6c.js → PermissionsPage-Buj2dHal.js} +1 -1
  81. package/public/assets/{PipelineConfigPage-B1D2tEQK.js → PipelineConfigPage-BH4Jn2yV.js} +1 -1
  82. package/public/assets/{PipelineEditorPage-s_YlfwwQ.js → PipelineEditorPage-CClFLl4j.js} +1 -1
  83. package/public/assets/{PlanPage-CuiDWL0h.js → PlanPage-D4DXpDvR.js} +1 -1
  84. package/public/assets/{ProfilePage-BJdNfqJ8.js → ProfilePage-DvehWXam.js} +1 -1
  85. package/public/assets/{ProjectDetailPage-BKVdM9E_.js → ProjectDetailPage-Bqe31-ln.js} +1 -1
  86. package/public/assets/{ProjectListPage-DcENyE_f.js → ProjectListPage-Ct8ZMMx4.js} +1 -1
  87. package/public/assets/{PtyTerminal-6sH_Ru9B.js → PtyTerminal-DShTbNdS.js} +1 -1
  88. package/public/assets/{QuickAuth-BJQDPb8y.js → QuickAuth-DihfVcAD.js} +1 -1
  89. package/public/assets/{RemoveMemberConfirmDialog-BeVfJj3-.js → RemoveMemberConfirmDialog-CqG8IOTw.js} +1 -1
  90. package/public/assets/ReviewAggregatePage-DpWf-Ze2.js +6 -0
  91. package/public/assets/ReviewPage-CYQsaOf6.js +1 -0
  92. package/public/assets/{Select-Dgtvdi2n.js → Select-CHmz_Qig.js} +1 -1
  93. package/public/assets/{SettingsPage-0vk6NVVJ.js → SettingsPage-K6tggt6C.js} +1 -1
  94. package/public/assets/{Skeleton-CwwH6ktS.js → Skeleton-BgqnK2cB.js} +1 -1
  95. package/public/assets/{SkillPage-BrdGx8-d.js → SkillPage-CNyesq7O.js} +1 -1
  96. package/public/assets/TaskDetailPage-DRc65k88.js +21 -0
  97. package/public/assets/{TaskGuidePage-Bo0wdhb0.js → TaskGuidePage-BWSwJgc7.js} +1 -1
  98. package/public/assets/{TaskListPage-Cxk-Tici.js → TaskListPage-UYdmtrj3.js} +1 -1
  99. package/public/assets/{TaskStatusBadge-B8MoEoLo.js → TaskStatusBadge-Corb-4yR.js} +1 -1
  100. package/public/assets/{TerminalHomePage-DR_ek5wb.js → TerminalHomePage-DRbOLOsa.js} +1 -1
  101. package/public/assets/{TokenManage-Ba4OjLdS.js → TokenManage-Dl7fNQVT.js} +1 -1
  102. package/public/assets/{Tooltip-BsZZ0Gbx.js → Tooltip-BE58Ef5C.js} +1 -1
  103. package/public/assets/{TotpSetupPage-IMrYjGAF.js → TotpSetupPage-CzPs5R1n.js} +1 -1
  104. package/public/assets/{WorkerDetailPage-B9TiPkJ8.js → WorkerDetailPage-Db-WRfx3.js} +1 -1
  105. package/public/assets/{WorkerListPage-Dm_zdLQH.js → WorkerListPage-DDXGCmUJ.js} +1 -1
  106. package/public/assets/{WorkerOperationsPage-BYBaNNVI.js → WorkerOperationsPage-vAaRESDJ.js} +1 -1
  107. package/public/assets/{WorkerSetupGuidePage-Xed2whgU.js → WorkerSetupGuidePage-C7p9pa6K.js} +1 -1
  108. package/public/assets/{WorkerSetupPage-y62Z3za_.js → WorkerSetupPage-Cxv2yPLI.js} +1 -1
  109. package/public/assets/{agent-type-options-Drj4kVJw.js → agent-type-options-CuEUrpd3.js} +1 -1
  110. package/public/assets/{arrow-left-BcA9UMTL.js → arrow-left-DOpqosft.js} +1 -1
  111. package/public/assets/{arrow-right-BZXdY7kF.js → arrow-right-CNUsZnIR.js} +1 -1
  112. package/public/assets/automationFindings-CnN7yNaM.js +1 -0
  113. package/public/assets/{bot-DcTSu6mF.js → bot-BaIIvmh0.js} +1 -1
  114. package/public/assets/{chevron-down-B-IybQE8.js → chevron-down-BKGOt_gM.js} +1 -1
  115. package/public/assets/{chevron-left-BoAE9yoT.js → chevron-left-i2pNLJ7H.js} +1 -1
  116. package/public/assets/{chevron-right-DdNeU6u1.js → chevron-right-D45D0HpI.js} +1 -1
  117. package/public/assets/{chevron-up-C4VkqudN.js → chevron-up-Bd6Oui4J.js} +1 -1
  118. package/public/assets/{circle-alert-BzDJW2uY.js → circle-alert-ClJNCLug.js} +1 -1
  119. package/public/assets/{clock-BF7qBFGO.js → clock-yzYGdAPO.js} +1 -1
  120. package/public/assets/{copy-BilNgG66.js → copy-mNrO3LXa.js} +1 -1
  121. package/public/assets/{download-DyLe1gp-.js → download-DDHXuzR3.js} +1 -1
  122. package/public/assets/{external-link-C2lUBinm.js → external-link-cxXMgt6V.js} +1 -1
  123. package/public/assets/{git-fork-DljHeJn2.js → git-fork-BGP19woV.js} +1 -1
  124. package/public/assets/{index-DpFOWbFQ.js → index-CuZrCrRX.js} +3 -3
  125. package/public/assets/{index-pQSLMYLJ.css → index-D1osv3VP.css} +1 -1
  126. package/public/assets/{key-CHQYfxWN.js → key-C__WciFk.js} +1 -1
  127. package/public/assets/{loader-circle-DmxemZdl.js → loader-circle-dFBBOOuB.js} +1 -1
  128. package/public/assets/{pencil-DMKsPe_A.js → pencil-C61WAtwR.js} +1 -1
  129. package/public/assets/{play-RH8-4UME.js → play-BHSy19KT.js} +1 -1
  130. package/public/assets/{plus-7GEqLtYy.js → plus-DXUBGb2Z.js} +1 -1
  131. package/public/assets/{rotate-ccw-Jtcupri2.js → rotate-ccw-DWFriik8.js} +1 -1
  132. package/public/assets/{scroll-text-tbcoJ-t_.js → scroll-text-B_kZuKoH.js} +1 -1
  133. package/public/assets/{settings-D0aqv-8_.js → settings-C72xeZrh.js} +1 -1
  134. package/public/assets/{skip-forward-BHfCjKv2.js → skip-forward-D5_4gYCC.js} +1 -1
  135. package/public/assets/{status-colors-_SUaojQM.js → status-colors-Bq7c453S.js} +1 -1
  136. package/public/assets/{task-agent-Rpiyr0sB.js → task-agent-DnayHp_f.js} +1 -1
  137. package/public/assets/{task-constants-BAM6BP3N.js → task-constants-CeedMrvc.js} +1 -1
  138. package/public/assets/{task.store-BMOVGyvP.js → task.store-BxwSVv-p.js} +1 -1
  139. package/public/assets/{timer-LF3nKAXi.js → timer-BFpvSXFd.js} +1 -1
  140. package/public/assets/{trash-2-CfHTaDgU.js → trash-2-5FJOu4Ud.js} +1 -1
  141. package/public/assets/{useFetch-Sdr634q_.js → useFetch-CoPiRYNS.js} +1 -1
  142. package/public/assets/{users-DUHEmaaK.js → users-BI6dc6Ci.js} +1 -1
  143. package/public/assets/{wifi-DR2_OBUt.js → wifi-Ooku276B.js} +1 -1
  144. package/public/assets/{workflow-uVJjw4HD.js → workflow-CvwIjZCH.js} +1 -1
  145. package/public/assets/{zap-BH9B1NGV.js → zap-Cv_baXfa.js} +1 -1
  146. package/public/index.html +2 -2
  147. package/public/sw.js +1 -1
  148. package/public/assets/AutomationCreatePage-DaHeZycf.js +0 -1
  149. package/public/assets/AutomationEditPage-Cjw5DRd6.js +0 -1
  150. package/public/assets/AutomationListPage-Cj4cqINZ.js +0 -26
  151. package/public/assets/AutomationRunDetailPage-CzcvwnZh.js +0 -6
  152. package/public/assets/BotIntegrationPage-LIWwLiyv.js +0 -1
  153. package/public/assets/BotManage-umHOH2yR.js +0 -6
  154. package/public/assets/ChangelogPage-DMuOXPSB.js +0 -1
  155. package/public/assets/ReviewAggregatePage-D6_tkXWc.js +0 -6
  156. package/public/assets/ReviewPage-CWNJfYaM.js +0 -1
  157. package/public/assets/TaskDetailPage-BtWTrChF.js +0 -21
@@ -1 +1 @@
1
- {"version":3,"file":"admin-bot.controller.d.ts","sourceRoot":"","sources":["../../../src/web/admin/admin-bot.controller.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,aAAa,EAAE,MAAM,4CAA4C,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,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e;;;;IAKf,YAAY,CAA4B,EAAE,EAAE,MAAM;IASlD,aAAa,CACgB,EAAE,EAAE,MAAM,EAErC,IAAI,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAChE,GAAG,EAAE,oBAAoB;IAwDlC,SAAS,CACoB,EAAE,EAAE,MAAM,EAC9B,GAAG,EAAE,oBAAoB;;;IAoBlC,aAAa,CACgB,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAC5D,GAAG,EAAE,oBAAoB;;;IAgClC,iBAAiB,CACY,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EACrD,GAAG,EAAE,oBAAoB;IAgClC,uBAAuB,CACM,EAAE,EAAE,MAAM,EAC7B,IAAI,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,EACrD,GAAG,EAAE,oBAAoB;CA8BnC"}
@@ -207,6 +207,31 @@ let AdminBotController = class AdminBotController {
207
207
  });
208
208
  return binding;
209
209
  }
210
+ setNotifyDefaultBinding(id, body, req) {
211
+ const bot = this.botRepo.findById(id);
212
+ if (!bot) {
213
+ throw new common_1.NotFoundException(`Bot #${id} not found`);
214
+ }
215
+ const platformChatId = body.platformChatId?.trim();
216
+ const projectKey = body.projectKey?.trim();
217
+ if (!platformChatId) {
218
+ throw new common_1.BadRequestException('platformChatId must be a non-empty string');
219
+ }
220
+ if (!projectKey) {
221
+ throw new common_1.BadRequestException('projectKey must be a non-empty string');
222
+ }
223
+ const binding = this.botRepo.setNotifyDefaultBinding(id, platformChatId, projectKey);
224
+ if (!binding) {
225
+ throw new common_1.NotFoundException('Binding not found');
226
+ }
227
+ this.auditLogRepo.create({
228
+ userId: req.user.sub,
229
+ action: 'bot_binding_set_notify_default',
230
+ resource: `bot:${id}`,
231
+ detail: `Set notification default project '${projectKey}' for chat '${platformChatId}'`,
232
+ });
233
+ return binding;
234
+ }
210
235
  };
211
236
  exports.AdminBotController = AdminBotController;
212
237
  __decorate([
@@ -280,6 +305,15 @@ __decorate([
280
305
  __metadata("design:paramtypes", [Number, Object, Object]),
281
306
  __metadata("design:returntype", void 0)
282
307
  ], AdminBotController.prototype, "setDefaultBinding", null);
308
+ __decorate([
309
+ (0, common_1.Put)(':id/bindings/notification-default'),
310
+ __param(0, (0, common_1.Param)('id', common_1.ParseIntPipe)),
311
+ __param(1, (0, common_1.Body)()),
312
+ __param(2, (0, common_1.Req)()),
313
+ __metadata("design:type", Function),
314
+ __metadata("design:paramtypes", [Number, Object, Object]),
315
+ __metadata("design:returntype", void 0)
316
+ ], AdminBotController.prototype, "setNotifyDefaultBinding", null);
283
317
  exports.AdminBotController = AdminBotController = __decorate([
284
318
  (0, common_1.Controller)('api/admin/bots'),
285
319
  (0, common_1.UseGuards)(jwt_auth_guard_1.JwtAuthGuard, roles_guard_1.RolesGuard),
@@ -1 +1 @@
1
- {"version":3,"file":"admin-bot.controller.js","sourceRoot":"","sources":["../../../src/web/admin/admin-bot.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAcwB;AACxB,mDAA+D;AAC/D,qEAAgE;AAChE,+DAA2D;AAC3D,2EAA8D;AAC9D,+EAA2E;AAC3E,uFAAmF;AACnF,2FAAsF;AACtF,gEAA4D;AAMrD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YACmB,OAAsB,EACtB,WAA8B,EAC9B,YAAgC,EAChC,aAA4B;QAH5B,YAAO,GAAP,OAAO,CAAe;QACtB,gBAAW,GAAX,WAAW,CAAmB;QAC9B,iBAAY,GAAZ,YAAY,CAAoB;QAChC,kBAAa,GAAb,aAAa,CAAe;IAC5C,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,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;IAEN,WAAA,IAAA,YAAG,GAAE,CAAA;;;;uDAqDP;AAGD;IADC,IAAA,eAAM,EAAC,KAAK,CAAC;IAEX,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,YAAG,GAAE,CAAA;;;;mDAiBP;AAGD;IADC,IAAA,eAAM,EAAC,cAAc,CAAC;IAEpB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,YAAG,GAAE,CAAA;;;;uDA6BP;AAGD;IADC,IAAA,YAAG,EAAC,sBAAsB,CAAC;IAEzB,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,YAAG,GAAE,CAAA;;;;2DA6BP;AAGD;IADC,IAAA,YAAG,EAAC,mCAAmC,CAAC;IAEtC,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,qBAAY,CAAC,CAAA;IACzB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,YAAG,GAAE,CAAA;;;;iEA6BP;6BA3SU,kBAAkB;IAH9B,IAAA,mBAAU,EAAC,gBAAgB,CAAC;IAC5B,IAAA,kBAAS,EAAC,6BAAY,EAAE,wBAAU,CAAC;IACnC,IAAA,uBAAK,EAAC,wBAAa,CAAC,KAAK,CAAC;qCAGG,8BAAa;QACT,sCAAiB;QAChB,yCAAkB;QACjB,8BAAa;GALpC,kBAAkB,CA4S9B"}
@@ -54,6 +54,8 @@ export declare class AutomationController {
54
54
  startedAt: string | null;
55
55
  completedAt: string | null;
56
56
  createdAt: string;
57
+ taskStatus?: string | null;
58
+ workerName?: string | null;
57
59
  };
58
60
  updateAutomationRun(id: number, body: {
59
61
  inboxStatus?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"automation.controller.d.ts","sourceRoot":"","sources":["../../src/web/automation.controller.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EAEvB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAG1E,qBAEa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBALf,iBAAiB,EAAE,iBAAiB,EACpC,eAAe,EAAE,yBAAyB,EAC1C,cAAc,EAAE,oBAAoB,EACpC,iBAAiB,EAAE,uBAAuB,EAC1C,QAAQ,EAAE,cAAc,EACxB,eAAe,EAAE,eAAe;IAGnD,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,uBAAuB;IAY/B,OAAO,CAAC,2BAA2B;IAYnC,OAAO,CAAC,2BAA2B;IAMnC,OAAO,CAAC,+BAA+B;IAMvC,OAAO,CAAC,sBAAsB;IAaxB,gBAAgB,CACZ,IAAI,EAAE,uBAAuB,EAC9B,GAAG,EAA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C,yBAAyB,CACf,IAAI,EAAE,sBAAsB,EAC7B,GAAG,EAAE,oBAAoB;;;;IA0ClC,aAAa,CACJ,GAAG,EAAE,oBAAoB,EACb,QAAQ,CAAC,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM;IAwB1C,WAAW,CACkB,EAAE,EAAE,MAAM,EAC9B,GAAG,EAAE,oBAAoB;IAgBlC,cAAc,CACJ,IAAI,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACvC,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,EACM,GAAG,EAAE,oBAAoB;IAmClC,cAAc,CACe,EAAE,EAAE,MAAM,EAC9B,GAAG,EAAE,oBAAoB;;;CAanC"}
1
+ {"version":3,"file":"automation.controller.d.ts","sourceRoot":"","sources":["../../src/web/automation.controller.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EAEvB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OA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;QACxB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,EACM,GAAG,EAAE,oBAAoB;IAmClC,cAAc,CACe,EAAE,EAAE,MAAM,EAC9B,GAAG,EAAE,oBAAoB;;;CAanC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overlordai/server",
3
- "version": "1.0.163",
3
+ "version": "1.0.164",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",
@@ -28,9 +28,9 @@
28
28
  "@nestjs/platform-express": "^10.4.0",
29
29
  "@nestjs/platform-ws": "^10.4.0",
30
30
  "@nestjs/websockets": "^10.4.0",
31
- "@overlordai/command-parser": "1.0.163",
32
- "@overlordai/protocol": "1.0.163",
33
- "@overlordai/validation": "1.0.163",
31
+ "@overlordai/command-parser": "1.0.164",
32
+ "@overlordai/protocol": "1.0.164",
33
+ "@overlordai/validation": "1.0.164",
34
34
  "@slack/web-api": "^7.15.0",
35
35
  "bcrypt": "^6.0.0",
36
36
  "better-sqlite3": "^11.0.0",
@@ -1 +1 @@
1
- import{a as _,v as C,r as c,j as e,h as k,s as T,x as S,J as A,a6 as D,a8 as f,t as g}from"./index-DpFOWbFQ.js";import{S as E}from"./Select-Dgtvdi2n.js";import{E as L}from"./EmptyState-DQ0fOTKY.js";import{T as I}from"./Skeleton-CwwH6ktS.js";import{t as N}from"./date-CmcdoD87.js";import{u as R}from"./useFetch-Sdr634q_.js";import{P}from"./plus-7GEqLtYy.js";import{C as O}from"./copy-BilNgG66.js";import{T as w}from"./trash-2-CfHTaDgU.js";import"./chevron-down-B-IybQE8.js";function V({isOpen:s,onClose:u,onCreated:i}){const{t:a}=_();C(s);const[d,o]=c.useState(""),[x,n]=c.useState("never"),[m,p]=c.useState(!1),[v,l]=c.useState(""),j=[{value:"never",label:a("access_tokens.no_expiry")},{value:"30",label:a("access_tokens.days_30")},{value:"90",label:a("access_tokens.days_90")},{value:"365",label:a("access_tokens.days_365")}];function h(){o(""),n("never"),l(""),u()}async function b(){if(l(""),!d.trim()){l(a("access_tokens.token_label_required"));return}try{p(!0);const r=await k.post("web/profile/tokens",{json:{label:d.trim(),...x!=="never"&&{expiresAt:new Date(Date.now()+parseInt(x,10)*864e5).toISOString()}}}).json();o(""),n("never"),i({token:r.token,name:r.name})}catch(r){const y=r instanceof Error?r.message:a("access_tokens.failed_to_create_token");l(y)}finally{p(!1)}}return s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]"}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:a("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[v&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)]/30 bg-[var(--destructive)]/5 px-3 py-2 text-xs text-[var(--destructive)]",children:v}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:a("access_tokens.token_name_placeholder"),value:d,onChange:r=>o(r.target.value),onKeyDown:r=>{r.key==="Enter"&&b()},className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.expires")}),e.jsx(E,{value:x,onChange:n,options:j})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:h,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")}),e.jsx("button",{onClick:b,disabled:m,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:a(m?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function U({isOpen:s,onClose:u,onConfirm:i,tokenLabel:a,isLoading:d}){const{t:o}=_();return e.jsx(T,{isOpen:s,onClose:u,onConfirm:i,title:o("access_tokens.revoke_token_title"),message:o("access_tokens.revoke_confirm",{name:a}),confirmLabel:o("access_tokens.revoke"),confirmVariant:"danger",isLoading:d})}function Q(){const{t:s}=_(),[u,i]=c.useState(!1),[a,d]=c.useState(null),[o,x]=c.useState(!1),[n,m]=c.useState(null),[p,v]=c.useState(null),{data:l,loading:j,refetch:h}=R(()=>k.get("web/profile/tokens").json(),[]);S(c.useMemo(()=>e.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black transition-opacity hover:opacity-90",children:[e.jsx(P,{className:"h-3.5 w-3.5"}),s("access_tokens.create_token")]}),[s]));function b(t){i(!1),d(t.token),x(!1),h()}async function r(){if(a)try{await navigator.clipboard.writeText(a),x(!0),setTimeout(()=>x(!1),2e3)}catch{}}async function y(){if(n)try{v(n.id),await k.post(`web/profile/tokens/${n.id}/revoke`),g.success(s("access_tokens.token_revoked")),m(null),h()}catch{g.error(s("access_tokens.failed_to_revoke_token"))}finally{v(null)}}return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[a&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs font-medium text-[var(--warning)]",children:s("access_tokens.copy_token_warning")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 break-all rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)]",children:a}),e.jsxs("button",{onClick:r,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[o?e.jsx(A,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(O,{className:"h-3.5 w-3.5"}),s(o?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>d(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:s("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:j?e.jsx("div",{className:"p-4",children:e.jsx(I,{rows:3})}):!l||l.length===0?e.jsx(L,{icon:D,title:s("access_tokens.no_tokens"),description:s("access_tokens.create_token_desc"),actionLabel:s("access_tokens.create_token"),onAction:()=>i(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden divide-y divide-[var(--border)]",children:l.map(t=>e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)] font-medium",children:t.label}),e.jsx("span",{className:`text-xs shrink-0 ml-2 ${t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]"}`,children:t.status})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-[var(--text-secondary)]",children:[e.jsxs("span",{children:[s("access_tokens.created"),": ",new Date(t.createdAt).toLocaleDateString()]}),e.jsxs("span",{children:[s("access_tokens.expires"),": ",t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")]}),e.jsxs("span",{children:[s("access_tokens.last_used"),": ",t.lastUsedAt?N(t.lastUsedAt):s("common.never")]})]}),t.status===f.ACTIVE&&e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))}),e.jsxs("table",{className:"hidden md:table w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:s("common.actions")})]})}),e.jsx("tbody",{children:l.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-[var(--text-primary)]",children:e.jsx("span",{className:"truncate block max-w-[100px] md:max-w-[200px]",children:t.label})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]",children:t.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.lastUsedAt?N(t.lastUsedAt):s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:t.status===f.ACTIVE&&e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))})]})]})}),e.jsx(V,{isOpen:u,onClose:()=>i(!1),onCreated:b}),e.jsx(U,{isOpen:!!n,onClose:()=>m(null),onConfirm:y,tokenLabel:(n==null?void 0:n.label)??"",isLoading:p!==null})]})}export{Q as default};
1
+ import{a as _,v as C,r as c,j as e,h as k,s as T,x as S,J as A,a6 as D,a8 as f,t as g}from"./index-CuZrCrRX.js";import{S as E}from"./Select-CHmz_Qig.js";import{E as L}from"./EmptyState-DtQh3oGP.js";import{T as I}from"./Skeleton-BgqnK2cB.js";import{t as N}from"./date-CmcdoD87.js";import{u as R}from"./useFetch-CoPiRYNS.js";import{P}from"./plus-DXUBGb2Z.js";import{C as O}from"./copy-mNrO3LXa.js";import{T as w}from"./trash-2-5FJOu4Ud.js";import"./chevron-down-BKGOt_gM.js";function V({isOpen:s,onClose:u,onCreated:i}){const{t:a}=_();C(s);const[d,o]=c.useState(""),[x,n]=c.useState("never"),[m,p]=c.useState(!1),[v,l]=c.useState(""),j=[{value:"never",label:a("access_tokens.no_expiry")},{value:"30",label:a("access_tokens.days_30")},{value:"90",label:a("access_tokens.days_90")},{value:"365",label:a("access_tokens.days_365")}];function h(){o(""),n("never"),l(""),u()}async function b(){if(l(""),!d.trim()){l(a("access_tokens.token_label_required"));return}try{p(!0);const r=await k.post("web/profile/tokens",{json:{label:d.trim(),...x!=="never"&&{expiresAt:new Date(Date.now()+parseInt(x,10)*864e5).toISOString()}}}).json();o(""),n("never"),i({token:r.token,name:r.name})}catch(r){const y=r instanceof Error?r.message:a("access_tokens.failed_to_create_token");l(y)}finally{p(!1)}}return s?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-40 bg-[var(--modal-backdrop)]"}),e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:e.jsxs("div",{className:"w-full max-w-[480px] rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] shadow-lg",onClick:r=>r.stopPropagation(),children:[e.jsxs("div",{className:"border-b border-[var(--border)] px-5 py-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text-primary)]",children:a("access_tokens.create_personal_access_token")}),e.jsx("p",{className:"mt-1 text-xs text-[var(--text-muted)]",children:a("access_tokens.tokens_authenticate_desc")})]}),e.jsxs("div",{className:"space-y-4 px-5 py-5",children:[v&&e.jsx("div",{className:"rounded-[4px] border border-[var(--destructive)]/30 bg-[var(--destructive)]/5 px-3 py-2 text-xs text-[var(--destructive)]",children:v}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.token_name")}),e.jsx("input",{type:"text",placeholder:a("access_tokens.token_name_placeholder"),value:d,onChange:r=>o(r.target.value),onKeyDown:r=>{r.key==="Enter"&&b()},className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] px-3 py-2 text-xs text-[var(--text-primary)] outline-none focus:border-[var(--accent)]"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1.5 block text-xs text-[var(--text-muted)]",children:a("access_tokens.expires")}),e.jsx(E,{value:x,onChange:n,options:j})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 border-t border-[var(--border)] px-5 py-4",children:[e.jsx("button",{onClick:h,className:"rounded-[4px] border border-[var(--border)] bg-transparent px-4 py-2 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:a("common.cancel")}),e.jsx("button",{onClick:b,disabled:m,className:"rounded-[4px] bg-[var(--accent)] px-4 py-2 text-xs font-medium text-black hover:opacity-90 transition-opacity disabled:opacity-50",children:a(m?"common.creating":"access_tokens.create_token")})]})]})})]}):null}function U({isOpen:s,onClose:u,onConfirm:i,tokenLabel:a,isLoading:d}){const{t:o}=_();return e.jsx(T,{isOpen:s,onClose:u,onConfirm:i,title:o("access_tokens.revoke_token_title"),message:o("access_tokens.revoke_confirm",{name:a}),confirmLabel:o("access_tokens.revoke"),confirmVariant:"danger",isLoading:d})}function Q(){const{t:s}=_(),[u,i]=c.useState(!1),[a,d]=c.useState(null),[o,x]=c.useState(!1),[n,m]=c.useState(null),[p,v]=c.useState(null),{data:l,loading:j,refetch:h}=R(()=>k.get("web/profile/tokens").json(),[]);S(c.useMemo(()=>e.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs text-black transition-opacity hover:opacity-90",children:[e.jsx(P,{className:"h-3.5 w-3.5"}),s("access_tokens.create_token")]}),[s]));function b(t){i(!1),d(t.token),x(!1),h()}async function r(){if(a)try{await navigator.clipboard.writeText(a),x(!0),setTimeout(()=>x(!1),2e3)}catch{}}async function y(){if(n)try{v(n.id),await k.post(`web/profile/tokens/${n.id}/revoke`),g.success(s("access_tokens.token_revoked")),m(null),h()}catch{g.error(s("access_tokens.failed_to_revoke_token"))}finally{v(null)}}return e.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[a&&e.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--warning)] bg-[var(--bg-card)] px-4 py-3",children:[e.jsx("p",{className:"mb-2 text-xs font-medium text-[var(--warning)]",children:s("access_tokens.copy_token_warning")}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 break-all rounded-[4px] bg-[var(--bg-primary)] px-3 py-2 text-xs text-[var(--text-primary)]",children:a}),e.jsxs("button",{onClick:r,className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-2 py-1.5 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[o?e.jsx(A,{className:"h-3.5 w-3.5 text-[var(--accent)]"}):e.jsx(O,{className:"h-3.5 w-3.5"}),s(o?"common.copied":"common.copy")]})]}),e.jsx("div",{className:"mt-2 flex justify-end",children:e.jsx("button",{onClick:()=>d(null),className:"text-xs text-[var(--text-muted)] hover:text-[var(--text-secondary)]",children:s("common.dismiss")})})]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:j?e.jsx("div",{className:"p-4",children:e.jsx(I,{rows:3})}):!l||l.length===0?e.jsx(L,{icon:D,title:s("access_tokens.no_tokens"),description:s("access_tokens.create_token_desc"),actionLabel:s("access_tokens.create_token"),onAction:()=>i(!0)}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"md:hidden divide-y divide-[var(--border)]",children:l.map(t=>e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-xs text-[var(--text-primary)] font-medium",children:t.label}),e.jsx("span",{className:`text-xs shrink-0 ml-2 ${t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]"}`,children:t.status})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-[var(--text-secondary)]",children:[e.jsxs("span",{children:[s("access_tokens.created"),": ",new Date(t.createdAt).toLocaleDateString()]}),e.jsxs("span",{children:[s("access_tokens.expires"),": ",t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")]}),e.jsxs("span",{children:[s("access_tokens.last_used"),": ",t.lastUsedAt?N(t.lastUsedAt):s("common.never")]})]}),t.status===f.ACTIVE&&e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))}),e.jsxs("table",{className:"hidden md:table w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.name")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("common.status")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.created")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.last_used")}),e.jsx("th",{className:"px-4 py-2.5 font-normal",children:s("access_tokens.expires")}),e.jsx("th",{className:"px-4 py-2.5 font-normal text-right",children:s("common.actions")})]})}),e.jsx("tbody",{children:l.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] last:border-b-0 hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"px-4 py-3 text-[var(--text-primary)]",children:e.jsx("span",{className:"truncate block max-w-[100px] md:max-w-[200px]",children:t.label})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:t.status===f.ACTIVE?"text-green-400":"text-[var(--text-muted)]",children:t.status})}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:new Date(t.createdAt).toLocaleDateString()}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.lastUsedAt?N(t.lastUsedAt):s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-[var(--text-secondary)]",children:t.expiresAt?new Date(t.expiresAt).toLocaleDateString():s("common.never")}),e.jsx("td",{className:"px-4 py-3 text-right",children:t.status===f.ACTIVE&&e.jsxs("button",{onClick:()=>m(t),disabled:p===t.id,className:"inline-flex items-center gap-1 text-xs text-[var(--destructive)] hover:underline disabled:opacity-50",children:[e.jsx(w,{className:"h-3 w-3"}),s("access_tokens.revoke")]})})]},t.id))})]})]})}),e.jsx(V,{isOpen:u,onClose:()=>i(!1),onCreated:b}),e.jsx(U,{isOpen:!!n,onClose:()=>m(null),onConfirm:y,tokenLabel:(n==null?void 0:n.label)??"",isLoading:p!==null})]})}export{Q as default};
@@ -1 +1 @@
1
- import{a as i,a6 as d,j as t,a9 as m,aa as l}from"./index-DpFOWbFQ.js";import{U as c}from"./users-DUHEmaaK.js";import{B as b}from"./bot-DcTSu6mF.js";import{S as p}from"./scroll-text-tbcoJ-t_.js";import{S as x}from"./settings-D0aqv-8_.js";function h(){const{t:a}=i(),r=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:c},{to:"/admin/bots",label:a("admin.tab_bots"),icon:b},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:d},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:p},{to:"/admin/settings",label:a("admin.tab_settings"),icon:x}];return t.jsxs("div",{children:[t.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar pr-4 md:pr-0",children:r.map(({to:e,label:o,icon:s})=>t.jsxs(m,{to:e,className:({isActive:n})=>`flex shrink-0 whitespace-nowrap items-center gap-2 border-b-2 px-4 py-3 md:py-2 text-sm transition-colors ${n?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[t.jsx(s,{size:16}),o]},e))}),t.jsx(l,{})]})}export{h as default};
1
+ import{a as i,a6 as d,j as t,a9 as m,aa as l}from"./index-CuZrCrRX.js";import{U as c}from"./users-BI6dc6Ci.js";import{B as b}from"./bot-BaIIvmh0.js";import{S as p}from"./scroll-text-B_kZuKoH.js";import{S as x}from"./settings-C72xeZrh.js";function h(){const{t:a}=i(),r=[{to:"/admin/developers",label:a("admin.tab_developers"),icon:c},{to:"/admin/bots",label:a("admin.tab_bots"),icon:b},{to:"/admin/tokens",label:a("admin.tab_tokens"),icon:d},{to:"/admin/audit-logs",label:a("admin.tab_audit_logs"),icon:p},{to:"/admin/settings",label:a("admin.tab_settings"),icon:x}];return t.jsxs("div",{children:[t.jsx("div",{className:"mb-6 flex flex-nowrap gap-2 overflow-x-auto border-b border-[var(--border)] no-scrollbar pr-4 md:pr-0",children:r.map(({to:e,label:o,icon:s})=>t.jsxs(m,{to:e,className:({isActive:n})=>`flex shrink-0 whitespace-nowrap items-center gap-2 border-b-2 px-4 py-3 md:py-2 text-sm transition-colors ${n?"border-[var(--accent)] text-[var(--accent)]":"border-transparent text-[var(--text-secondary)] hover:text-[var(--text-primary)]"}`,children:[t.jsx(s,{size:16}),o]},e))}),t.jsx(l,{})]})}export{h as default};
@@ -1,3 +1,3 @@
1
- import{j as e}from"./index-DpFOWbFQ.js";import{a as s}from"./DocsPrimitives-DxxQvd4A.js";import"./copy-BilNgG66.js";function d(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// agent cli integration"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["overlord supports three ai agent clis. each project configures an ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent_type"})," that determines which cli the worker uses to execute tasks. the prompt is written to pty stdin after the cli starts — not passed as a cli argument."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// supported agents"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"agent"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli binary"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config value"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"subscription"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"claude code"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:"anthropic / claude"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"cursor agent"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})}),e.jsx("td",{className:"px-3 py-2",children:"cursor"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"openai codex"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:"openai"})]})]})]})}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// the cursor agent cli binary is ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"}),", not ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"}),". the config value ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})," maps to the ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})," binary."]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// permission strategy"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["all agents run in fully automated mode by default. the ",e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})," project config controls the permission level:"]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"allowedTools"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"claude"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cursor"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"codex"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"null (default)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-skip-permissions"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-bypass-approvals-and-sandbox"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"specific value"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--allowedTools <value>"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--full-auto"})})]})]})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// cli flag mapping"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"claude code"}),e.jsx(s,{code:"claude --dangerously-skip-permissions [--allowedTools <tools>] [--plugin-dir <path>]"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--allowedTools"})," or ",e.jsx("code",{children:"--dangerously-skip-permissions"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--plugin-dir <path>"})}),e.jsx("td",{className:"px-3 py-2",children:"load custom skills/plugins"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:".claude.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:".credentials.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"settings.json"})," from real home. pre-trusts worktree in ",e.jsx("code",{className:"text-[var(--accent)]",children:"trustedDirectories"}),"."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"cursor agent"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--warning)]/30 bg-[var(--warning)]/5 px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--warning)]",children:'⚠ macos limitation: cursor agent stores auth tokens in macos keychain, which requires a gui login session. headless workers (launchd/ssh) cannot access keychain and will fail with "keychain operation timed out". cursor agent is currently only supported on linux workers.'})}),e.jsx(s,{code:"agent --yolo --approve-mcps"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"purpose"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--yolo"})}),e.jsx("td",{className:"px-3 py-2",children:"skip all confirmation prompts (alias for --force)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"line-through opacity-50",children:"--trust"})}),e.jsx("td",{className:"px-3 py-2",children:"removed — only works in headless/print mode. trust is auto-accepted via pty."})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:"auto-approve mcp servers"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: relies on workspace-manager's xdg ",e.jsx("code",{className:"text-[var(--accent)]",children:".config/"})," symlink."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"openai codex"}),e.jsx(s,{code:"codex --dangerously-bypass-approvals-and-sandbox"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsx("tbody",{className:"text-[var(--text-secondary)]",children:e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--dangerously-bypass-approvals-and-sandbox"})," or ",e.jsx("code",{children:"--full-auto"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]})})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.codex"})," directory if it exists."]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// configsnapshot fields"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"project-level config fields passed to executors:"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"type"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"used by"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentType"})}),e.jsx("td",{className:"px-3 py-2",children:"claude | cursor | codex"}),e.jsx("td",{className:"px-3 py-2",children:"all"}),e.jsx("td",{className:"px-3 py-2",children:"which cli to spawn"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude, codex"}),e.jsx("td",{className:"px-3 py-2",children:"permission strategy control"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude"}),e.jsx("td",{className:"px-3 py-2",children:"plugin directory path"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"maxTurns"})}),e.jsx("td",{className:"px-3 py-2",children:"number"}),e.jsx("td",{className:"px-3 py-2",children:"stage monitor"}),e.jsx("td",{className:"px-3 py-2",children:"max stage retry loops"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"pipeline"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"pipeline compiler"}),e.jsx("td",{className:"px-3 py-2",children:"custom pipeline json (null = default 6-stage)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentEnv"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"extra env vars json merged into pty env"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"json array of shell commands run before agent starts (120s timeout each)"})]})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// git hooks"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["worker creates isolated git worktrees for each task. by default, project-level git hooks (husky, lefthook, etc.) are not installed because ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," is not run automatically. use the project's ",e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})," field to install hooks before the agent starts."]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"hook tool"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"setupCommands"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"husky"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx husky install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"lefthook"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx lefthook install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"simple-git-hooks"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx simple-git-hooks"]'})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"native (.githooks/)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["git config core.hooksPath .githooks"]'})})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the lightest option is native git hooks — commit hook scripts to a ",e.jsx("code",{className:"text-[var(--accent)]",children:".githooks/"})," directory in your repo, then use a single ",e.jsx("code",{className:"text-[var(--accent)]",children:"git config"})," command. no ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," needed."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// capability detection"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"workers auto-detect installed agent clis on startup and report capabilities to the server. if a capability degrades at runtime (auth failure, rate limit), the server temporarily removes it. it auto-recovers when the next task execution succeeds."}),e.jsx(s,{code:`which claude && claude --version → capability: 'claude'
1
+ import{j as e}from"./index-CuZrCrRX.js";import{a as s}from"./DocsPrimitives-Beo_PA0s.js";import"./copy-mNrO3LXa.js";function d(){return e.jsx("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// agent cli integration"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["overlord supports three ai agent clis. each project configures an ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent_type"})," that determines which cli the worker uses to execute tasks. the prompt is written to pty stdin after the cli starts — not passed as a cli argument."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// supported agents"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"agent"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli binary"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config value"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"subscription"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"claude code"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"claude"})}),e.jsx("td",{className:"px-3 py-2",children:"anthropic / claude"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"cursor agent"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})}),e.jsx("td",{className:"px-3 py-2",children:"cursor"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"openai codex"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"codex"})}),e.jsx("td",{className:"px-3 py-2",children:"openai"})]})]})]})}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] px-3 py-2",children:e.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// the cursor agent cli binary is ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"}),", not ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"}),". the config value ",e.jsx("code",{className:"text-[var(--accent)]",children:"cursor"})," maps to the ",e.jsx("code",{className:"text-[var(--accent)]",children:"agent"})," binary."]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// permission strategy"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["all agents run in fully automated mode by default. the ",e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})," project config controls the permission level:"]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"allowedTools"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"claude"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cursor"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"codex"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"null (default)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-skip-permissions"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--dangerously-bypass-approvals-and-sandbox"})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2 text-[var(--text-muted)]",children:"specific value"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--allowedTools <value>"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--yolo --approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"--full-auto"})})]})]})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// cli flag mapping"}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"claude code"}),e.jsx(s,{code:"claude --dangerously-skip-permissions [--allowedTools <tools>] [--plugin-dir <path>]"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--allowedTools"})," or ",e.jsx("code",{children:"--dangerously-skip-permissions"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--plugin-dir <path>"})}),e.jsx("td",{className:"px-3 py-2",children:"load custom skills/plugins"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:".claude.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:".credentials.json"}),", ",e.jsx("code",{className:"text-[var(--accent)]",children:"settings.json"})," from real home. pre-trusts worktree in ",e.jsx("code",{className:"text-[var(--accent)]",children:"trustedDirectories"}),"."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"cursor agent"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--warning)]/30 bg-[var(--warning)]/5 px-3 py-2",children:e.jsx("p",{className:"text-xs text-[var(--warning)]",children:'⚠ macos limitation: cursor agent stores auth tokens in macos keychain, which requires a gui login session. headless workers (launchd/ssh) cannot access keychain and will fail with "keychain operation timed out". cursor agent is currently only supported on linux workers.'})}),e.jsx(s,{code:"agent --yolo --approve-mcps"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"purpose"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--yolo"})}),e.jsx("td",{className:"px-3 py-2",children:"skip all confirmation prompts (alias for --force)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"line-through opacity-50",children:"--trust"})}),e.jsx("td",{className:"px-3 py-2",children:"removed — only works in headless/print mode. trust is auto-accepted via pty."})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{children:"--approve-mcps"})}),e.jsx("td",{className:"px-3 py-2",children:"auto-approve mcp servers"})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: relies on workspace-manager's xdg ",e.jsx("code",{className:"text-[var(--accent)]",children:".config/"})," symlink."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-semibold text-[var(--accent)]",children:"openai codex"}),e.jsx(s,{code:"codex --dangerously-bypass-approvals-and-sandbox"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"config field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"cli flag"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"notes"})]})}),e.jsx("tbody",{className:"text-[var(--text-secondary)]",children:e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsxs("td",{className:"px-3 py-2",children:[e.jsx("code",{children:"--dangerously-bypass-approvals-and-sandbox"})," or ",e.jsx("code",{children:"--full-auto"})]}),e.jsx("td",{className:"px-3 py-2",children:"see permission strategy"})]})})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["environment: symlinks ",e.jsx("code",{className:"text-[var(--accent)]",children:"~/.codex"})," directory if it exists."]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// configsnapshot fields"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"project-level config fields passed to executors:"}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"field"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"type"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"used by"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"description"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentType"})}),e.jsx("td",{className:"px-3 py-2",children:"claude | cursor | codex"}),e.jsx("td",{className:"px-3 py-2",children:"all"}),e.jsx("td",{className:"px-3 py-2",children:"which cli to spawn"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"allowedTools"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude, codex"}),e.jsx("td",{className:"px-3 py-2",children:"permission strategy control"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"skillsPath"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"claude"}),e.jsx("td",{className:"px-3 py-2",children:"plugin directory path"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"maxTurns"})}),e.jsx("td",{className:"px-3 py-2",children:"number"}),e.jsx("td",{className:"px-3 py-2",children:"stage monitor"}),e.jsx("td",{className:"px-3 py-2",children:"max stage retry loops"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"pipeline"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"pipeline compiler"}),e.jsx("td",{className:"px-3 py-2",children:"custom pipeline json (null = default 6-stage)"})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"agentEnv"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"extra env vars json merged into pty env"})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})}),e.jsx("td",{className:"px-3 py-2",children:"string | null"}),e.jsx("td",{className:"px-3 py-2",children:"worker"}),e.jsx("td",{className:"px-3 py-2",children:"json array of shell commands run before agent starts (120s timeout each)"})]})]})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// git hooks"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["worker creates isolated git worktrees for each task. by default, project-level git hooks (husky, lefthook, etc.) are not installed because ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," is not run automatically. use the project's ",e.jsx("code",{className:"text-[var(--accent)]",children:"setupCommands"})," field to install hooks before the agent starts."]}),e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] bg-[var(--bg-card)]",children:[e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"hook tool"}),e.jsx("th",{className:"px-3 py-2 text-left text-[var(--text-muted)]",children:"setupCommands"})]})}),e.jsxs("tbody",{className:"text-[var(--text-secondary)]",children:[e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"husky"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx husky install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"lefthook"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx lefthook install"]'})})]}),e.jsxs("tr",{className:"border-b border-[var(--border)]",children:[e.jsx("td",{className:"px-3 py-2",children:"simple-git-hooks"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["npm install", "npx simple-git-hooks"]'})})]}),e.jsxs("tr",{children:[e.jsx("td",{className:"px-3 py-2",children:"native (.githooks/)"}),e.jsx("td",{className:"px-3 py-2",children:e.jsx("code",{className:"text-[var(--accent)]",children:'["git config core.hooksPath .githooks"]'})})]})]})]})}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the lightest option is native git hooks — commit hook scripts to a ",e.jsx("code",{className:"text-[var(--accent)]",children:".githooks/"})," directory in your repo, then use a single ",e.jsx("code",{className:"text-[var(--accent)]",children:"git config"})," command. no ",e.jsx("code",{className:"text-[var(--accent)]",children:"npm install"})," needed."]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// capability detection"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"workers auto-detect installed agent clis on startup and report capabilities to the server. if a capability degrades at runtime (auth failure, rate limit), the server temporarily removes it. it auto-recovers when the next task execution succeeds."}),e.jsx(s,{code:`which claude && claude --version → capability: 'claude'
2
2
  which agent && agent --version → capability: 'cursor'
3
3
  which codex && codex --version → capability: 'codex'`})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:"// default pipeline"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"the default pipeline has 7 stages:"}),e.jsx("div",{className:"flex flex-wrap items-center gap-1 text-xs",children:["implement","test","verify","review","simplify","rebase","submit"].map((a,t)=>e.jsxs("span",{children:[e.jsx("code",{className:"rounded-[4px] bg-[var(--bg-primary)] px-2 py-0.5 text-[var(--accent)]",children:a}),t<6&&e.jsx("span",{className:"mx-1 text-[var(--text-muted)]",children:"→"})]},a))}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)]",children:["the ",e.jsx("code",{className:"text-[var(--accent)]",children:"verify"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"review"})," stages loop back to ",e.jsx("code",{className:"text-[var(--accent)]",children:"implement"})," on failure (max 3 loops). the ",e.jsx("code",{className:"text-[var(--accent)]",children:"simplify"})," and ",e.jsx("code",{className:"text-[var(--accent)]",children:"rebase"})," stages loop back to themselves on failure (max 3 loops)."]})]})]})})}export{d as default};
@@ -1 +1 @@
1
- import{f as d,a as o,x as p,r as n,j as t}from"./index-DpFOWbFQ.js";import{Q as c}from"./QuickAuth-BJQDPb8y.js";import{P as h}from"./plus-7GEqLtYy.js";import"./copy-BilNgG66.js";const l={GET:"text-green-400",POST:"text-blue-400",PUT:"text-yellow-400",DELETE:"text-red-400"},m=[{title:"authentication",prefix:"/api/auth",endpoints:[{method:"POST",path:"/login",description:"authenticate with username + password (optional totpCode)",auth:"none",body:'{ "username": "string", "password": "string", "totpCode?": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/refresh",description:"refresh access token (rotates refresh token)",auth:"none",body:'{ "refreshToken": "string" }',response:'{ "accessToken": "string", "refreshToken": "string" }'},{method:"POST",path:"/logout",description:"invalidate refresh token",auth:"jwt",body:'{ "refreshToken": "string" }'}]},{title:"tasks",prefix:"/api/web/tasks",endpoints:[{method:"GET",path:"",description:"list tasks with optional filters",auth:"jwt",response:'[ { "id": 1, "description": "...", "status": "RUNNING", ... } ]'},{method:"POST",path:"",description:"create a new task (name is AI-generated if LLM is configured, otherwise null)",auth:"jwt",body:'{ "projectKey": "string", "description": "string", "workerId?": "string", "taskType?": "feat|fix|refactor|docs|chore", "branchSlug?": "string", "targetBranch?": "string" }',response:'{ "id": 1, "description": "...", "name": "string | null", "branchSlug": "string | null", "status": "PENDING", ... }'},{method:"GET",path:"/:id",description:"get task details",auth:"jwt"},{method:"POST",path:"/:id/cancel",description:"cancel a running task",auth:"jwt"},{method:"POST",path:"/:id/retry",description:"retry a failed or cancelled task",auth:"jwt"},{method:"POST",path:"/:id/confirm-stage",description:"confirm/choose/input for suspended stage",auth:"jwt",body:'{ "stageIndex": "number", "result": "string" }'},{method:"POST",path:"/:id/pty-token",description:"get pty websocket token",auth:"jwt"}]},{title:"workers",prefix:"/api/web/workers",endpoints:[{method:"GET",path:"",description:"list all workers",auth:"jwt"},{method:"GET",path:"/:id",description:"get worker details",auth:"jwt"},{method:"GET",path:"/:id/tasks",description:"list tasks assigned to a worker",auth:"jwt"},{method:"POST",path:"/:id/drain",description:"start draining a worker",auth:"jwt"},{method:"POST",path:"/:id/undrain",description:"cancel worker drain",auth:"jwt"}]},{title:"projects",prefix:"/api/web/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"GET",path:"/:key",description:"get project details",auth:"jwt"}]},{title:"profile",prefix:"/api/web/profile",endpoints:[{method:"GET",path:"",description:"get current user profile",auth:"jwt"},{method:"PUT",path:"",description:"update profile (gitName, gitEmail)",auth:"jwt",body:'{ "gitName?": "string", "gitEmail?": "string" }'},{method:"PUT",path:"/password",description:"change password",auth:"jwt",body:'{ "currentPassword": "string", "newPassword": "string" }'},{method:"POST",path:"/totp/setup",description:"initialize totp setup",auth:"jwt"},{method:"POST",path:"/totp/verify",description:"verify totp setup code",auth:"jwt",body:'{ "code": "string" }'},{method:"GET",path:"/tokens",description:"list personal access tokens",auth:"jwt"},{method:"POST",path:"/tokens",description:"create a personal access token",auth:"jwt",body:'{ "label": "string", "expiresAt?": "string" }'},{method:"POST",path:"/tokens/:id/revoke",description:"revoke a token",auth:"jwt"},{method:"POST",path:"/bind-platform",description:"link a chat platform account using a one-time bind token",auth:"jwt",body:'{ "token": "string" }',response:'{ "success": true, "platform": "lark" }'}]},{title:"workspaces & tunnels",prefix:"/api/web",endpoints:[{method:"GET",path:"/workspaces/:taskId",description:"get workspace for a task",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/start",description:"start a cursor remote tunnel",auth:"jwt"},{method:"POST",path:"/workspace-tunnel/:taskId/stop",description:"stop a running tunnel",auth:"jwt"},{method:"GET",path:"/workspace-tunnel/:taskId/status",description:"get tunnel status",auth:"jwt"}]},{title:"dashboard",prefix:"/api/web/dashboard",endpoints:[{method:"GET",path:"/stats",description:"get dashboard statistics",auth:"jwt"},{method:"GET",path:"/recent-tasks",description:"get recent tasks for dashboard",auth:"jwt"},{method:"GET",path:"/recent-activity",description:"get recent activity feed",auth:"jwt"}]},{title:"notifications",prefix:"/api/web/notifications",endpoints:[{method:"GET",path:"",description:"list notifications with cursor pagination",auth:"jwt"},{method:"POST",path:"/:id/read",description:"mark a notification as read",auth:"jwt"},{method:"POST",path:"/read-all",description:"mark all notifications as read",auth:"jwt"}]},{title:"search",prefix:"/api/web",endpoints:[{method:"GET",path:"/search?q=query",description:"global search across tasks, workers, projects",auth:"jwt"}]},{title:"admin — developers",prefix:"/api/admin/developers",endpoints:[{method:"GET",path:"",description:"list all developers",auth:"jwt"},{method:"POST",path:"",description:"create a developer",auth:"jwt",body:'{ "name": "string", "password": "string", "role": "string", "gitName": "string", "gitEmail": "string" }'},{method:"PUT",path:"/:id",description:"update developer",auth:"jwt"},{method:"PUT",path:"/:id/reset-totp",description:"reset developer totp",auth:"jwt"}]},{title:"admin — projects",prefix:"/api/admin/projects",endpoints:[{method:"GET",path:"",description:"list all projects",auth:"jwt"},{method:"POST",path:"",description:"create a project",auth:"jwt"},{method:"PUT",path:"/:key",description:"update project (including pipeline)",auth:"jwt"},{method:"DELETE",path:"/:key",description:"delete a project",auth:"jwt"},{method:"GET",path:"/:key/members",description:"get project members",auth:"jwt"},{method:"POST",path:"/:key/members",description:"add project member",auth:"jwt"},{method:"DELETE",path:"/:key/members?developerId=N",description:"remove project member",auth:"jwt"}]},{title:"admin — worker tokens",prefix:"/api/admin/worker-tokens",endpoints:[{method:"GET",path:"",description:"list all worker enrollment tokens",auth:"jwt"},{method:"POST",path:"",description:"generate a new worker token",auth:"jwt"},{method:"POST",path:"/:id/revoke",description:"revoke a worker token",auth:"jwt"},{method:"GET",path:"/:id/status",description:"get token status and linked worker",auth:"jwt"}]},{title:"admin — workers",prefix:"/api/admin/workers",endpoints:[{method:"GET",path:"",description:"list all workers (admin)",auth:"jwt"},{method:"PUT",path:"/:id",description:"update worker status",auth:"jwt",body:'{ "status?": "string" }'}]},{title:"admin — bots",prefix:"/api/admin/bots",endpoints:[{method:"GET",path:"",description:"list bot instances",auth:"jwt"},{method:"POST",path:"",description:"create a bot instance",auth:"jwt"},{method:"GET",path:"/:id/bindings",description:"get group bindings for a bot",auth:"jwt"},{method:"POST",path:"/:id/bindings",description:"create a group binding",auth:"jwt"},{method:"DELETE",path:"/:id/bindings",description:"delete a group binding",auth:"jwt"}]},{title:"admin — audit & settings",prefix:"/api/admin",endpoints:[{method:"GET",path:"/audit-logs",description:"query audit log with filters",auth:"jwt"},{method:"GET",path:"/settings",description:"get all system settings",auth:"jwt"},{method:"PUT",path:"/settings",description:"update system settings",auth:"jwt"}]},{title:"websocket",prefix:"",endpoints:[{method:"GET",path:"WS /ws/pty/:taskId",description:'pty terminal websocket — first obtain a channel token via POST /api/web/tasks/:taskId/pty-token, then send an auth frame after connection: { type: "auth", token: "<jwt>", channelToken: "<channel-token>" }',auth:"jwt"},{method:"GET",path:"WS /api/workers/pty/:taskId",description:'worker pty websocket — auth via frame: { type: "auth", workerJwt: "<worker-jwt>", channelToken: "<channel-token>" }',auth:"worker-token"}]}];function u({ep:e,prefix:a}){const[s,r]=n.useState(!1),{t:i}=o();return t.jsxs("div",{className:"border-b border-[var(--border-row)] last:border-b-0",children:[t.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 sm:gap-3 px-3 md:px-4 py-2.5 text-left transition-colors hover:bg-[var(--bg-input)] min-w-0",onClick:()=>r(!s),children:[t.jsx("span",{className:`w-12 shrink-0 text-xs font-bold ${l[e.method]}`,children:e.method}),t.jsxs("code",{className:"flex-1 text-xs text-[var(--text-primary)] truncate min-w-0",children:[a,e.path]}),t.jsxs("span",{className:"text-xs text-[var(--text-muted)] hidden sm:inline truncate max-w-[200px]",children:["// ",e.description]})]}),s&&t.jsxs("div",{className:"border-t border-[var(--border-row)] bg-[var(--bg-primary)] px-3 md:px-4 py-3 space-y-2",children:[t.jsxs("p",{className:"text-xs text-[var(--text-secondary)]",children:["// ",e.description]}),t.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[t.jsx("span",{className:"text-[var(--text-muted)]",children:"auth:"}),t.jsx("span",{className:e.auth==="none"?"text-[var(--text-muted)]":"text-[var(--accent)]",children:e.auth})]}),e.body&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:i("docs.request_body")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.body})]}),e.response&&t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] uppercase tracking-wider text-[var(--text-muted)] mb-1",children:i("docs.response")}),t.jsx("pre",{className:"rounded-[4px] bg-[var(--bg-card)] px-3 py-2 text-xs text-[var(--text-secondary)] overflow-x-auto",children:e.response})]})]})]})}function g(){const e=d(),{t:a}=o();return p(n.useMemo(()=>t.jsxs("button",{onClick:()=>e("/access-tokens"),className:"flex items-center gap-1.5 rounded-[4px] bg-[var(--accent)] px-3 py-1.5 text-xs font-mono text-black transition-opacity hover:opacity-90",children:[t.jsx(h,{className:"h-3.5 w-3.5"}),a("access_tokens.create_token")]}),[e,a])),t.jsxs("div",{className:"mx-auto max-w-4xl px-4 md:px-6 py-8 font-mono lowercase",children:[t.jsx("div",{className:"mb-8",children:t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.api_base_url_desc",{url:"http://localhost:9000"})})}),t.jsx(c,{mode:"api"}),t.jsxs("div",{className:"mb-8 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4 space-y-2",children:[t.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("docs.authentication")}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"jwt"}),t.jsxs("span",{className:"text-xs text-[var(--text-secondary)]",children:["obtained via /api/auth/login — pass as ",t.jsx("code",{children:"authorization: bearer <token>"})]})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-[var(--accent)]",children:"pat"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"personal access token — same header format, for cli/api usage"})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("code",{className:"shrink-0 text-xs text-yellow-400",children:"worker-token"}),t.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:"enrollment token for worker registration — used during initial handshake"})]})]}),t.jsx("div",{className:"space-y-6",children:m.map(s=>t.jsxs("div",{children:[t.jsxs("h2",{className:"mb-2 text-sm text-[var(--accent)]",children:["> ",s.title]}),t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:s.endpoints.map((r,i)=>t.jsx(u,{ep:r,prefix:s.prefix},`${r.method}-${r.path}-${i}`))})]},s.title))})]})}export{g as default};
1
+ import{f as d,a as o,x as p,r as n,j as t}from"./index-CuZrCrRX.js";import{Q as c}from"./QuickAuth-DihfVcAD.js";import{P as h}from"./plus-DXUBGb2Z.js";import"./copy-mNrO3LXa.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-DpFOWbFQ.js";import{C as s}from"./DocsPrimitives-DxxQvd4A.js";import"./copy-BilNgG66.js";const r=` ┌──────────────────┐
1
+ import{j as e}from"./index-CuZrCrRX.js";import{C as s}from"./DocsPrimitives-Beo_PA0s.js";import"./copy-mNrO3LXa.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-DpFOWbFQ.js";import{S as L}from"./Select-Dgtvdi2n.js";import{E}from"./EmptyState-DQ0fOTKY.js";import{T}from"./Skeleton-CwwH6ktS.js";import{S as A}from"./scroll-text-tbcoJ-t_.js";import{C as F}from"./chevron-left-BoAE9yoT.js";import{C as P}from"./chevron-right-DdNeU6u1.js";import"./chevron-down-B-IybQE8.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-CuZrCrRX.js";import{S as L}from"./Select-CHmz_Qig.js";import{E}from"./EmptyState-DtQh3oGP.js";import{T}from"./Skeleton-BgqnK2cB.js";import{S as A}from"./scroll-text-B_kZuKoH.js";import{C as F}from"./chevron-left-i2pNLJ7H.js";import{C as P}from"./chevron-right-D45D0HpI.js";import"./chevron-down-BKGOt_gM.js";function q(){const{t:a}=C(),h=[{value:"",label:a("admin.all_actions")},{value:"login",label:a("admin.action_login")},{value:"logout",label:a("admin.action_logout")},{value:"create",label:a("admin.action_create")},{value:"update",label:a("admin.action_update")},{value:"delete",label:a("admin.action_delete")},{value:"revoke",label:a("admin.action_revoke")},{value:"reset_2fa",label:a("admin.action_reset_2fa")},{value:"generate_token",label:a("admin.action_generate_token")}],[n,b]=r.useState([]),[f,p]=r.useState(!0),[i,j]=r.useState(""),[o,g]=r.useState(""),[N,c]=r.useState(void 0),[x,m]=r.useState([]),[l,w]=r.useState(void 0),d=r.useCallback(async t=>{try{p(!0);const s={limit:"50"};t&&(s.cursor=t),i&&(s.action=i),o&&(s.user=o);const v=await S.get("admin/audit-logs",{searchParams:s}).json();b(v.data),w(v.nextCursor)}catch{}finally{p(!1)}},[i,o]);r.useEffect(()=>{c(void 0),m([]),d()},[d]);function _(){l&&(m(t=>[...t,N??""]),c(l),d(l))}function y(){if(x.length===0)return;const t=[...x],s=t.pop();m(t),c(s||void 0),d(s||void 0)}function u(t){return t.startsWith("delete")||t==="revoke"?"text-[var(--destructive)]":t.startsWith("create")||t==="generate_token"?"text-[var(--accent)]":t.startsWith("update")||t==="reset_2fa"?"text-[var(--warning)]":t==="login"?"text-[var(--info)]":"text-[var(--text-secondary)]"}return e.jsxs("div",{className:"font-mono",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-sm text-[var(--text-primary)]",children:a("admin.audit_title")}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:a("admin.audit_subtitle")})]}),e.jsxs("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsx(L,{value:i,onChange:j,options:h}),e.jsxs("div",{className:"relative w-full max-w-xs",children:[e.jsx(k,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--text-muted)]"}),e.jsx("input",{type:"text",placeholder:a("admin.filter_by_user"),value:o,onChange:t=>g(t.target.value),className:"w-full rounded-[4px] border border-[var(--border)] bg-[var(--bg-input)] py-1.5 pl-8 pr-3 text-xs text-[var(--text-primary)] placeholder:text-[var(--text-muted)] focus:outline-none focus:border-[var(--accent)]"})]})]}),f?e.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:e.jsx(T,{rows:5})}):n.length===0?e.jsx(E,{icon:A,title:a("admin.no_audit_entries"),description:a("admin.audit_logs_appear")}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-[var(--border)] text-left text-[var(--text-muted)]",children:[e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.timestamp")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.user_id")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.action")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.resource")}),e.jsx("th",{className:"pb-2 pr-4 font-normal",children:a("admin.detail")}),e.jsx("th",{className:"pb-2 font-normal",children:a("admin.ip")})]})}),e.jsx("tbody",{children:n.map(t=>e.jsxs("tr",{className:"border-b border-[var(--border-row)] hover:bg-white/[0.02] transition-colors",children:[e.jsx("td",{className:"whitespace-nowrap py-2.5 pr-4 text-[var(--text-muted)]",children:new Date(t.createdAt).toLocaleString()}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.userId}),e.jsx("td",{className:"py-2.5 pr-4",children:e.jsx("span",{className:u(t.action),children:t.action})}),e.jsx("td",{className:"py-2.5 pr-4 text-[var(--text-secondary)]",children:t.resource}),e.jsx("td",{className:"max-w-xs truncate py-2.5 pr-4 text-[var(--text-muted)]",children:t.detail}),e.jsx("td",{className:"py-2.5 text-[var(--text-muted)]",children:t.ip})]},t.id))})]})}),e.jsx("div",{className:"md:hidden space-y-3",children:n.map(t=>e.jsxs("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-3",children:[e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] mb-1",children:new Date(t.createdAt).toLocaleString()}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2 mb-1",children:[e.jsx("span",{className:`shrink-0 text-[11px] ${u(t.action)}`,children:t.action}),e.jsx("span",{className:"min-w-0 truncate text-[11px] text-[var(--text-secondary)]",children:t.resource})]}),e.jsx("div",{className:"text-[11px] text-[var(--text-muted)] truncate",children:t.detail}),e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[11px] text-[var(--text-muted)]",children:[e.jsxs("span",{children:["User: ",t.userId]}),e.jsx("span",{children:t.ip})]})]},t.id))}),e.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[e.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:a("admin.showing_entries",{count:String(n.length)})}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{type:"button",disabled:x.length===0,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:y,children:[e.jsx(F,{className:"h-3.5 w-3.5"}),a("common.previous")]}),e.jsxs("button",{type:"button",disabled:!l,className:"flex items-center justify-center gap-1 rounded-[4px] border border-[var(--border)] px-2.5 py-1 min-h-[44px] min-w-[44px] md:min-h-0 md:min-w-0 text-xs text-[var(--text-secondary)] hover:text-[var(--text-primary)] hover:border-[var(--accent)] disabled:opacity-30 disabled:cursor-not-allowed transition-colors",onClick:_,children:[a("common.next"),e.jsx(P,{className:"h-3.5 w-3.5"})]})]})]})]})]})}export{q as default};
@@ -0,0 +1 @@
1
+ import{f as J,a as Q,F as W,a1 as A,r,h as X,t as x,j as e}from"./index-CuZrCrRX.js";import{S as b}from"./Select-CHmz_Qig.js";import{M as ee}from"./MultiSelect-CeoEM-97.js";import{C as te}from"./Checkbox-CZd7073E.js";import{A as ae}from"./arrow-left-DOpqosft.js";import"./chevron-down-BKGOt_gM.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,16 +1,16 @@
1
- import{c as v,f as I,a as $,B as D,a1 as L,r as o,a2 as O,p as F,t as i,x as q,j as t,s as K}from"./index-DpFOWbFQ.js";import{E as _}from"./EmptyState-DQ0fOTKY.js";import{T as z}from"./Skeleton-CwwH6ktS.js";import{f as A,c as B}from"./date-CmcdoD87.js";import{C}from"./clock-BF7qBFGO.js";import{A as G}from"./arrow-left-BcA9UMTL.js";import{P as T}from"./play-RH8-4UME.js";import{T as H}from"./trash-2-CfHTaDgU.js";import{T as U}from"./timer-LF3nKAXi.js";import{Z as W}from"./zap-BH9B1NGV.js";import{E as Z}from"./external-link-C2lUBinm.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-CuZrCrRX.js";import{E as w}from"./EmptyState-DtQh3oGP.js";import{T as q}from"./Skeleton-BgqnK2cB.js";import{f as k,c as K}from"./date-CmcdoD87.js";import{e as z}from"./automationFindings-CnN7yNaM.js";import{C as _}from"./clock-yzYGdAPO.js";import{A as B}from"./arrow-left-DOpqosft.js";import{P as C}from"./play-BHSy19KT.js";import{T as G}from"./trash-2-5FJOu4Ud.js";import{T as H}from"./timer-BFpvSXFd.js";import{Z as U}from"./zap-Cv_baXfa.js";import{E as Z}from"./external-link-cxXMgt6V.js";/**
2
2
  * @license lucide-react v0.469.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const J=v("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
6
+ */const Q=u("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
7
7
  * @license lucide-react v0.469.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const Q=v("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
11
+ */const V=u("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
12
12
  * @license lucide-react v0.469.0 - ISC
13
13
  *
14
14
  * This source code is licensed under the ISC license.
15
15
  * See the LICENSE file in the root directory of this source tree.
16
- */const V=v("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);function X(n){switch(n){case"COMPLETED":return"bg-[var(--accent)]";case"RUNNING":return"bg-[var(--accent)]";case"PENDING":return"bg-[var(--warning)]";case"FAILED":return"bg-[var(--destructive)]";case"SKIPPED":return"bg-[#525252]";default:return"bg-[#525252]"}}function Y(n,e){return(n&&n.length>0?n:[e]).join(", ")}function dt(){const n=I(),{t:e}=$(),{id:b}=D(),r=Number(b),{currentAutomation:a,loading:P,fetchAutomation:x,enableAutomation:g,disableAutomation:f,triggerAutomation:j,deleteAutomation:y,runs:N,fetchRuns:c,clearRunQuery:w}=L(),[E,k]=o.useState(!1),p=o.useRef(!1);o.useEffect(()=>(x(r),c({automationId:r,limit:20}),()=>{w()}),[r,x,c,w]),o.useEffect(()=>{p.current=!0;const s=O.onStatus(l=>{p.current&&l==="connected"&&c({automationId:r,limit:20})});return()=>{p.current=!1,s()}},[r,c]),F((a==null?void 0:a.name)??null);const M=o.useCallback(async()=>{if(a)try{a.enabled?(await f(a.id),await x(r),i.success(e("automation.automation_disabled"))):(await g(a.id),await x(r),i.success(e("automation.automation_enabled")))}catch{i.error(e("automation.failed_toggle"))}},[a,r,g,f,x,e]),R=o.useCallback(async()=>{try{await j(r),i.success(e("automation.automation_triggered")),c({automationId:r,limit:20})}catch{i.error(e("automation.failed_trigger"))}},[r,j,c,e]),S=o.useCallback(async()=>{try{await y(r),i.success(e("automation.automation_deleted")),n("/automations")}catch{i.error(e("automation.failed_delete"))}},[r,y,n,e]);if(q(null),P&&!a)return t.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:t.jsx(z,{rows:6})});if(!a)return t.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:t.jsx(_,{icon:C,title:e("automation.automation_not_found")})});const d=a.triggerConfig,u=a.taskConfig;return t.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsxs("div",{className:"mb-6 flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:()=>n("/automations"),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:t.jsx(G,{className:"h-4 w-4"})}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a.name}),t.jsx("span",{className:`h-2 w-2 rounded-full ${a.enabled?"bg-[var(--accent)]":"bg-[var(--text-muted)]"}`}),t.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:a.enabled?e("automation.enabled"):e("automation.disabled")})]}),a.description&&t.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] line-clamp-2",children:a.description})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:M,className:`flex items-center gap-1 rounded-[4px] border px-3 py-1.5 text-[11px] transition-colors ${a.enabled?"border-[var(--warning)] text-[var(--warning)] hover:bg-[var(--warning)]/10":"border-[var(--accent)] text-[var(--accent)] hover:bg-[var(--accent)]/10"}`,children:a.enabled?t.jsxs(t.Fragment,{children:[t.jsx(J,{className:"h-3 w-3"})," ",e("automation.disable")]}):t.jsxs(t.Fragment,{children:[t.jsx(Q,{className:"h-3 w-3"})," ",e("automation.enable")]})}),t.jsxs("button",{onClick:()=>n(`/automations/${a.id}/edit`),className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[t.jsx(V,{className:"h-3 w-3"})," ",e("automation.edit")]}),t.jsxs("button",{onClick:R,className:"flex items-center gap-1 whitespace-nowrap rounded-[4px] border border-[var(--accent)] px-3 py-1.5 text-[11px] text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:[t.jsx(T,{className:"h-3 w-3 shrink-0"})," ",e("automation.trigger_now")]}),t.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--text-muted)] hover:text-[var(--destructive)] hover:border-[var(--destructive)] transition-colors",children:[t.jsx(H,{className:"h-3 w-3"})," ",e("automation.delete")]})]})]}),t.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:e("automation.configuration")}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.trigger_type")}),t.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-xs text-[var(--text-primary)]",children:[a.triggerType==="cron"&&t.jsx(U,{className:"h-3 w-3"}),a.triggerType==="task_event"&&t.jsx(W,{className:"h-3 w-3"}),a.triggerType==="manual"&&t.jsx(T,{className:"h-3 w-3"}),a.triggerType]})]}),a.triggerType==="cron"&&!!d.cron&&t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.schedule")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:d.cron}),t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:d.timezone??"UTC"})]}),a.triggerType==="task_event"&&!!d.event&&t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.event")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:d.event})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.agent_type")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:(u==null?void 0:u.agentType)??"claude"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.execution_mode")}),t.jsx("span",{className:`mt-0.5 block text-xs ${a.executionMode==="writable"?"text-[var(--warning)]":"text-[var(--text-primary)]"}`,children:a.executionMode})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block whitespace-nowrap text-[10px] text-[var(--text-muted)]",children:e("automation.notify_project_chats")}),t.jsx("span",{className:"mt-0.5 block whitespace-nowrap text-xs text-[var(--text-primary)]",children:a.notifyProjectChats?e("automation.notify_project_chats_enabled"):e("automation.notify_project_chats_disabled")})]})]}),t.jsxs("div",{className:"mt-3 flex items-center gap-4 text-[10px] text-[var(--text-muted)]",children:[t.jsxs("span",{children:[e("automation.project"),": ",Y(a.projectKeys,a.projectKey)]}),a.lastRunAt&&t.jsx("span",{children:e("automation.last_run",{time:A(a.lastRunAt)})}),a.nextRunAt&&t.jsx("span",{children:e("automation.next_run",{time:B(a.nextRunAt)})})]})]}),t.jsxs("div",{children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:e("automation.run_history")}),N.length===0?t.jsx(_,{icon:C,title:e("automation.no_runs"),compact:!0}):t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:t.jsxs("table",{className:"w-full text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_time")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.project")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_status")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_findings")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_task")})]})}),t.jsx("tbody",{children:N.map(s=>t.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border)] last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",onClick:()=>n(`/automations/runs/${s.id}`),children:[t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-primary)]",children:A(s.createdAt)}),t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-primary)]",children:s.projectKey??a.projectKey}),t.jsx("td",{className:"px-4 py-2.5",children:t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-[var(--text-primary)]",children:[t.jsx("span",{className:`h-2 w-2 rounded-full ${X(s.status)}`}),s.status.toLowerCase()]})}),t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-muted)]",children:(()=>{if(!s.hasFindings||!s.findings||!Array.isArray(s.findings))return"-";const l=s.findings.flatMap(m=>{if(m.detail&&typeof m.detail=="string"&&m.detail.trimStart().startsWith("{"))try{const h=JSON.parse(m.detail);if(Array.isArray(h.findings)&&h.findings.length>0)return h.findings}catch{}return[m]});return`${l.length} finding${l.length!==1?"s":""}`})()}),t.jsx("td",{className:"px-4 py-2.5",children:s.taskId?t.jsxs("button",{onClick:l=>{l.stopPropagation(),n(`/tasks/${s.taskId}`)},className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:["#",s.taskId,t.jsx(Z,{className:"h-2.5 w-2.5"})]}):t.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"-"})})]},s.id))})]})})]}),t.jsx(K,{isOpen:E,onClose:()=>k(!1),onConfirm:S,title:e("automation.delete_title"),message:e("automation.delete_confirm",{name:a.name}),confirmLabel:e("automation.delete"),confirmVariant:"danger"})]})}export{dt as default};
16
+ */const W=u("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);function J(n){switch(n){case"COMPLETED":return"bg-[var(--accent)]";case"RUNNING":return"bg-[var(--accent)]";case"PENDING":return"bg-[var(--warning)]";case"FAILED":return"bg-[var(--destructive)]";case"SKIPPED":return"bg-[#525252]";default:return"bg-[#525252]"}}function X(n,e){return(n&&n.length>0?n:[e]).join(", ")}function dt(){const n=M(),{t:e}=I(),{id:h}=S(),r=Number(h),{currentAutomation:a,loading:A,fetchAutomation:x,enableAutomation:v,disableAutomation:b,triggerAutomation:g,deleteAutomation:f,runs:j,fetchRuns:c,clearRunQuery:y}=$(),[T,N]=o.useState(!1),m=o.useRef(!1);o.useEffect(()=>(x(r),c({automationId:r,limit:20}),()=>{y()}),[r,x,c,y]),o.useEffect(()=>{m.current=!0;const s=D.onStatus(l=>{m.current&&l==="connected"&&c({automationId:r,limit:20})});return()=>{m.current=!1,s()}},[r,c]),L((a==null?void 0:a.name)??null);const P=o.useCallback(async()=>{if(a)try{a.enabled?(await b(a.id),await x(r),i.success(e("automation.automation_disabled"))):(await v(a.id),await x(r),i.success(e("automation.automation_enabled")))}catch{i.error(e("automation.failed_toggle"))}},[a,r,v,b,x,e]),E=o.useCallback(async()=>{try{await g(r),i.success(e("automation.automation_triggered")),c({automationId:r,limit:20})}catch{i.error(e("automation.failed_trigger"))}},[r,g,c,e]),R=o.useCallback(async()=>{try{await f(r),i.success(e("automation.automation_deleted")),n("/automations")}catch{i.error(e("automation.failed_delete"))}},[r,f,n,e]);if(O(null),A&&!a)return t.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:t.jsx(q,{rows:6})});if(!a)return t.jsx("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:t.jsx(w,{icon:_,title:e("automation.automation_not_found")})});const d=a.triggerConfig,p=a.taskConfig;return t.jsxs("div",{className:"mx-auto max-w-4xl px-2 py-4 md:px-4 md:py-6 font-mono",children:[t.jsxs("div",{className:"mb-6 flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("button",{onClick:()=>n("/automations"),className:"rounded-[4px] p-1.5 text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:t.jsx(B,{className:"h-4 w-4"})}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h1",{className:"text-sm font-bold text-[var(--text-primary)]",children:a.name}),t.jsx("span",{className:`h-2 w-2 rounded-full ${a.enabled?"bg-[var(--accent)]":"bg-[var(--text-muted)]"}`}),t.jsx("span",{className:"text-[10px] text-[var(--text-muted)]",children:a.enabled?e("automation.enabled"):e("automation.disabled")})]}),a.description&&t.jsx("p",{className:"mt-0.5 text-[11px] text-[var(--text-muted)] line-clamp-2",children:a.description})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("button",{onClick:P,className:`flex items-center gap-1 rounded-[4px] border px-3 py-1.5 text-[11px] transition-colors ${a.enabled?"border-[var(--warning)] text-[var(--warning)] hover:bg-[var(--warning)]/10":"border-[var(--accent)] text-[var(--accent)] hover:bg-[var(--accent)]/10"}`,children:a.enabled?t.jsxs(t.Fragment,{children:[t.jsx(Q,{className:"h-3 w-3"})," ",e("automation.disable")]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{className:"h-3 w-3"})," ",e("automation.enable")]})}),t.jsxs("button",{onClick:()=>n(`/automations/${a.id}/edit`),className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--text-secondary)] hover:text-[var(--text-primary)] transition-colors",children:[t.jsx(W,{className:"h-3 w-3"})," ",e("automation.edit")]}),t.jsxs("button",{onClick:E,className:"flex items-center gap-1 whitespace-nowrap rounded-[4px] border border-[var(--accent)] px-3 py-1.5 text-[11px] text-[var(--accent)] hover:bg-[var(--accent)]/10 transition-colors",children:[t.jsx(C,{className:"h-3 w-3 shrink-0"})," ",e("automation.trigger_now")]}),t.jsxs("button",{onClick:()=>N(!0),className:"flex items-center gap-1 rounded-[4px] border border-[var(--border)] px-3 py-1.5 text-[11px] text-[var(--text-muted)] hover:text-[var(--destructive)] hover:border-[var(--destructive)] transition-colors",children:[t.jsx(G,{className:"h-3 w-3"})," ",e("automation.delete")]})]})]}),t.jsxs("div",{className:"mb-6 rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)] p-4",children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:e("automation.configuration")}),t.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.trigger_type")}),t.jsxs("div",{className:"mt-0.5 flex items-center gap-1 text-xs text-[var(--text-primary)]",children:[a.triggerType==="cron"&&t.jsx(H,{className:"h-3 w-3"}),a.triggerType==="task_event"&&t.jsx(U,{className:"h-3 w-3"}),a.triggerType==="manual"&&t.jsx(C,{className:"h-3 w-3"}),a.triggerType]})]}),a.triggerType==="cron"&&!!d.cron&&t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.schedule")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:d.cron}),t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:d.timezone??"UTC"})]}),a.triggerType==="task_event"&&!!d.event&&t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.event")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:d.event})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.agent_type")}),t.jsx("span",{className:"mt-0.5 block text-xs text-[var(--text-primary)]",children:(p==null?void 0:p.agentType)??"claude"})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block text-[10px] text-[var(--text-muted)]",children:e("automation.execution_mode")}),t.jsx("span",{className:`mt-0.5 block text-xs ${a.executionMode==="writable"?"text-[var(--warning)]":"text-[var(--text-primary)]"}`,children:a.executionMode})]}),t.jsxs("div",{children:[t.jsx("span",{className:"block whitespace-nowrap text-[10px] text-[var(--text-muted)]",children:e("automation.notify_project_chats")}),t.jsx("span",{className:"mt-0.5 block whitespace-nowrap text-xs text-[var(--text-primary)]",children:a.notifyProjectChats?e("automation.notify_project_chats_enabled"):e("automation.notify_project_chats_disabled")})]})]}),t.jsxs("div",{className:"mt-3 flex items-center gap-4 text-[10px] text-[var(--text-muted)]",children:[t.jsxs("span",{children:[e("automation.project"),": ",X(a.projectKeys,a.projectKey)]}),a.lastRunAt&&t.jsx("span",{children:e("automation.last_run",{time:k(a.lastRunAt)})}),a.nextRunAt&&t.jsx("span",{children:e("automation.next_run",{time:K(a.nextRunAt)})})]})]}),t.jsxs("div",{children:[t.jsx("h2",{className:"mb-3 text-[11px] font-bold text-[var(--text-muted)]",children:e("automation.run_history")}),j.length===0?t.jsx(w,{icon:_,title:e("automation.no_runs"),compact:!0}):t.jsx("div",{className:"rounded-[4px] border border-[var(--border)] bg-[var(--bg-card)]",children:t.jsxs("table",{className:"w-full text-left",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-[var(--border)] text-[11px] font-medium text-[#525252]",children:[t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_time")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.project")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_status")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_findings")}),t.jsx("th",{className:"px-4 py-2.5",children:e("automation.col_task")})]})}),t.jsx("tbody",{children:j.map(s=>t.jsxs("tr",{className:"cursor-pointer border-b border-[var(--border)] last:border-b-0 hover:bg-[var(--bg-input)] transition-colors",onClick:()=>n(`/automations/runs/${s.id}`),children:[t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-primary)]",children:k(s.createdAt)}),t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-primary)]",children:s.projectKey??a.projectKey}),t.jsx("td",{className:"px-4 py-2.5",children:t.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-[var(--text-primary)]",children:[t.jsx("span",{className:`h-2 w-2 rounded-full ${J(s.status)}`}),s.status.toLowerCase()]})}),t.jsx("td",{className:"px-4 py-2.5 text-xs text-[var(--text-muted)]",children:(()=>{if(!s.hasFindings||!s.findings||!Array.isArray(s.findings))return"-";const l=z(s.findings);return`${l.length} finding${l.length!==1?"s":""}`})()}),t.jsx("td",{className:"px-4 py-2.5",children:s.taskId?t.jsxs("button",{onClick:l=>{l.stopPropagation(),n(`/tasks/${s.taskId}`)},className:"flex items-center gap-1 text-xs text-[var(--accent)] hover:underline",children:["#",s.taskId,t.jsx(Z,{className:"h-2.5 w-2.5"})]}):t.jsx("span",{className:"text-xs text-[var(--text-muted)]",children:"-"})})]},s.id))})]})})]}),t.jsx(F,{isOpen:T,onClose:()=>N(!1),onConfirm:R,title:e("automation.delete_title"),message:e("automation.delete_confirm",{name:a.name}),confirmLabel:e("automation.delete"),confirmVariant:"danger"})]})}export{dt as default};