@overlordai/server 1.0.173 → 1.0.174

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/adapters/confirm-required.utils.d.ts +24 -0
  2. package/dist/adapters/confirm-required.utils.d.ts.map +1 -0
  3. package/dist/adapters/confirm-required.utils.js +51 -0
  4. package/dist/adapters/confirm-required.utils.js.map +1 -0
  5. package/dist/adapters/lark/lark.adapter.d.ts +5 -3
  6. package/dist/adapters/lark/lark.adapter.d.ts.map +1 -1
  7. package/dist/adapters/lark/lark.adapter.js +56 -20
  8. package/dist/adapters/lark/lark.adapter.js.map +1 -1
  9. package/dist/adapters/slack/slack.adapter.d.ts.map +1 -1
  10. package/dist/adapters/slack/slack.adapter.js +41 -12
  11. package/dist/adapters/slack/slack.adapter.js.map +1 -1
  12. package/dist/app.module.d.ts.map +1 -1
  13. package/dist/app.module.js +2 -0
  14. package/dist/app.module.js.map +1 -1
  15. package/dist/database/repositories/task.repository.d.ts +1 -0
  16. package/dist/database/repositories/task.repository.d.ts.map +1 -1
  17. package/dist/database/repositories/task.repository.js +7 -0
  18. package/dist/database/repositories/task.repository.js.map +1 -1
  19. package/dist/dispatcher/dispatcher.service.d.ts.map +1 -1
  20. package/dist/dispatcher/dispatcher.service.js +7 -7
  21. package/dist/dispatcher/dispatcher.service.js.map +1 -1
  22. package/dist/dispatcher/dispatcher.types.d.ts +1 -1
  23. package/dist/dispatcher/dispatcher.types.d.ts.map +1 -1
  24. package/dist/dispatcher/task-lifecycle.service.d.ts +1 -0
  25. package/dist/dispatcher/task-lifecycle.service.d.ts.map +1 -1
  26. package/dist/dispatcher/task-lifecycle.service.js +15 -0
  27. package/dist/dispatcher/task-lifecycle.service.js.map +1 -1
  28. package/dist/events/event-types.d.ts +7 -0
  29. package/dist/events/event-types.d.ts.map +1 -1
  30. package/dist/notifier/card-actions.d.ts +3 -0
  31. package/dist/notifier/card-actions.d.ts.map +1 -1
  32. package/dist/notifier/card-actions.js +6 -0
  33. package/dist/notifier/card-actions.js.map +1 -1
  34. package/dist/notifier/notification-consumer.d.ts.map +1 -1
  35. package/dist/notifier/notification-consumer.js +8 -3
  36. package/dist/notifier/notification-consumer.js.map +1 -1
  37. package/dist/notifier/notification-event-listener.d.ts.map +1 -1
  38. package/dist/notifier/notification-event-listener.js +3 -1
  39. package/dist/notifier/notification-event-listener.js.map +1 -1
  40. package/dist/notifier/notifier.service.d.ts +6 -1
  41. package/dist/notifier/notifier.service.d.ts.map +1 -1
  42. package/dist/notifier/notifier.service.js +2 -1
  43. package/dist/notifier/notifier.service.js.map +1 -1
  44. package/dist/notifier/template.service.d.ts +8 -1
  45. package/dist/notifier/template.service.d.ts.map +1 -1
  46. package/dist/notifier/template.service.js +38 -6
  47. package/dist/notifier/template.service.js.map +1 -1
  48. package/dist/review/review-comment.service.d.ts +41 -0
  49. package/dist/review/review-comment.service.d.ts.map +1 -0
  50. package/dist/review/review-comment.service.js +317 -0
  51. package/dist/review/review-comment.service.js.map +1 -0
  52. package/dist/review/review.module.d.ts +3 -0
  53. package/dist/review/review.module.d.ts.map +1 -0
  54. package/dist/review/review.module.js +22 -0
  55. package/dist/review/review.module.js.map +1 -0
  56. package/dist/web/frame-handlers/review-report.handler.d.ts.map +1 -1
  57. package/dist/web/frame-handlers/review-report.handler.js +26 -6
  58. package/dist/web/frame-handlers/review-report.handler.js.map +1 -1
  59. package/dist/web/frame-handlers/stage-confirm.handler.d.ts +12 -2
  60. package/dist/web/frame-handlers/stage-confirm.handler.d.ts.map +1 -1
  61. package/dist/web/frame-handlers/stage-confirm.handler.js +106 -28
  62. package/dist/web/frame-handlers/stage-confirm.handler.js.map +1 -1
  63. package/package.json +4 -4
  64. package/public/assets/{AccessTokensPage-DWRXad3x.js → AccessTokensPage-CBlLkkX6.js} +1 -1
  65. package/public/assets/{AdminPage-BoIqMBJM.js → AdminPage-mynf8ODr.js} +1 -1
  66. package/public/assets/{AgentCliPage-DDk8OWtX.js → AgentCliPage-DrnciW6T.js} +1 -1
  67. package/public/assets/{ApiReferencePage-Bv1wLy5b.js → ApiReferencePage-DRe_cm_m.js} +1 -1
  68. package/public/assets/{ArchitecturePage-CxP9hkhF.js → ArchitecturePage-DNoVjW-a.js} +1 -1
  69. package/public/assets/{AuditLogPage-B7QQ9hah.js → AuditLogPage-B1eTcJBR.js} +1 -1
  70. package/public/assets/{AutomationCreatePage-ChPD2oTI.js → AutomationCreatePage-CukXfCtB.js} +1 -1
  71. package/public/assets/{AutomationDetailPage-BY6bseqa.js → AutomationDetailPage-DWshoZlm.js} +1 -1
  72. package/public/assets/{AutomationEditPage-BqeA3DXk.js → AutomationEditPage-DL3-RPcj.js} +1 -1
  73. package/public/assets/{AutomationListPage-DkT1Yv4n.js → AutomationListPage-DGH6MsJc.js} +1 -1
  74. package/public/assets/{AutomationRunDetailPage-CWPGlBJd.js → AutomationRunDetailPage-D0oJoBJW.js} +1 -1
  75. package/public/assets/{BindPlatformPage-DrCQMFXN.js → BindPlatformPage-BTgH5eI0.js} +1 -1
  76. package/public/assets/{BotIntegrationPage-CFSmmRh1.js → BotIntegrationPage-D6GXacbO.js} +1 -1
  77. package/public/assets/{BotManage-C7o5dyKk.js → BotManage-Cn_zH3U4.js} +1 -1
  78. package/public/assets/{BotSetupPage-BgjGC1Ce.js → BotSetupPage-DTb0r78_.js} +1 -1
  79. package/public/assets/{ChangelogPage-Bk6LcJiR.js → ChangelogPage-CNfqrRty.js} +1 -1
  80. package/public/assets/{Checkbox-BOX6FtEq.js → Checkbox-D1hAKR9E.js} +1 -1
  81. package/public/assets/{CliReferencePage-CtWMf_UQ.js → CliReferencePage-DK4sv8D8.js} +1 -1
  82. package/public/assets/{ConfirmStageDialog-BtyVYk27.js → ConfirmStageDialog-Bi3nbWlh.js} +1 -1
  83. package/public/assets/{DeploymentPage-CsQj6iic.js → DeploymentPage-xKePKzHX.js} +1 -1
  84. package/public/assets/{DevWorkflowPage-uy7WzcsE.js → DevWorkflowPage-DHNtwyat.js} +1 -1
  85. package/public/assets/{DeveloperManage-BI6Ajrgf.js → DeveloperManage-Di8MWrTf.js} +1 -1
  86. package/public/assets/{DeveloperSetupPage-D-iex6Or.js → DeveloperSetupPage-C7_LFKDA.js} +1 -1
  87. package/public/assets/{DocsIndexPage-D-KxxA8_.js → DocsIndexPage-DDcOuwlz.js} +1 -1
  88. package/public/assets/{DocsLayout-BCzKSMhE.js → DocsLayout-B477jsxk.js} +1 -1
  89. package/public/assets/{DocsPrimitives-BzVDx2cs.js → DocsPrimitives-CgyoKAir.js} +1 -1
  90. package/public/assets/{EditProjectPage-BY-qZ5wL.js → EditProjectPage-Dfm319Z2.js} +1 -1
  91. package/public/assets/{EmptyState-CqF5g3iI.js → EmptyState-P0FzomcO.js} +1 -1
  92. package/public/assets/{EnvVariablesPage-BYhrZ5C5.js → EnvVariablesPage-CnQo2yCF.js} +1 -1
  93. package/public/assets/{HomePage-Bhanys0H.js → HomePage-Da2G6_QB.js} +1 -1
  94. package/public/assets/{InfoRow-BxA58xIa.js → InfoRow-DbxM6iML.js} +1 -1
  95. package/public/assets/{InstallationPage-Cg1I_2Mi.js → InstallationPage-CuOWbc1H.js} +1 -1
  96. package/public/assets/{LandingPage-JQqDMBvp.js → LandingPage-Cbvdm3eI.js} +1 -1
  97. package/public/assets/{LocalDevelopmentPage-t1wS_JiB.js → LocalDevelopmentPage-0icX-WcV.js} +1 -1
  98. package/public/assets/{LoginPage-CgGCdeF7.js → LoginPage-6JnXQfU3.js} +1 -1
  99. package/public/assets/{MetricBar-DfTk8Sjr.js → MetricBar-Dc-VQSMu.js} +1 -1
  100. package/public/assets/{MultiSelect-s1A3k8lX.js → MultiSelect-DCWH4BA8.js} +1 -1
  101. package/public/assets/{NotFoundPage-BcK6DhJP.js → NotFoundPage-DDuYP8W4.js} +1 -1
  102. package/public/assets/{OnboardingGuide-CnEZNjMO.js → OnboardingGuide-B0V0r8s3.js} +1 -1
  103. package/public/assets/{PermissionsPage-DMhgJT_d.js → PermissionsPage-B0ggYIb5.js} +1 -1
  104. package/public/assets/{PipelineConfigPage-DLXm99KL.js → PipelineConfigPage-DtZQzMEH.js} +1 -1
  105. package/public/assets/{PipelineEditorPage-BVaO5u3d.js → PipelineEditorPage-BJvEIr25.js} +1 -1
  106. package/public/assets/{PlanPage-B3oI7rdU.js → PlanPage-C86YOhVS.js} +1 -1
  107. package/public/assets/{ProfilePage-Bo77BD7U.js → ProfilePage-BnWgT5TC.js} +1 -1
  108. package/public/assets/{ProjectDetailPage-BXap15n_.js → ProjectDetailPage-DGQH-J_A.js} +1 -1
  109. package/public/assets/{ProjectListPage-Bf5gQWll.js → ProjectListPage-CNCAX69Y.js} +1 -1
  110. package/public/assets/{PtyTerminal-Do7JUGQS.js → PtyTerminal-kO8wCuuU.js} +1 -1
  111. package/public/assets/{QuickAuth-EIbjxqlx.js → QuickAuth-DARffZGR.js} +1 -1
  112. package/public/assets/{RemoveMemberConfirmDialog-CGzHpvJv.js → RemoveMemberConfirmDialog-D9rPijXx.js} +1 -1
  113. package/public/assets/{ReviewAggregatePage-Bvk901fs.js → ReviewAggregatePage-Bc1K6gXO.js} +1 -1
  114. package/public/assets/{ReviewPage-CBEbIkD3.js → ReviewPage-BPDRxqrG.js} +1 -1
  115. package/public/assets/{Select-BRJxl1YO.js → Select-CgGQnjuL.js} +1 -1
  116. package/public/assets/{SettingsPage-CUznfUgJ.js → SettingsPage-Dqser9QV.js} +1 -1
  117. package/public/assets/{Skeleton-CkmmCp2B.js → Skeleton-KIdOfHCh.js} +1 -1
  118. package/public/assets/{SkillPage-DmMxzWHC.js → SkillPage-kituG7_x.js} +1 -1
  119. package/public/assets/{TaskDetailPage-DF6j4ohL.js → TaskDetailPage-DQVE-zp-.js} +1 -1
  120. package/public/assets/{TaskGuidePage-1NpVzVqi.js → TaskGuidePage-D3sA_3Vy.js} +1 -1
  121. package/public/assets/{TaskListPage-1_Fn21zu.js → TaskListPage-arWi98DB.js} +1 -1
  122. package/public/assets/{TaskStatusBadge-BldGSOah.js → TaskStatusBadge-D9epJQNe.js} +1 -1
  123. package/public/assets/{TerminalHomePage-BIk8jU04.js → TerminalHomePage-Cl2Uh4Hp.js} +1 -1
  124. package/public/assets/{TokenManage-CMtAf7QR.js → TokenManage-DOg2xTt8.js} +1 -1
  125. package/public/assets/{Tooltip-EOsBLsZE.js → Tooltip-D1qzP0lG.js} +1 -1
  126. package/public/assets/{TotpSetupPage-C7oZEO7M.js → TotpSetupPage-CCbH89j8.js} +1 -1
  127. package/public/assets/{WorkerDetailPage-DNUSVoN8.js → WorkerDetailPage-PtA39Lz5.js} +1 -1
  128. package/public/assets/{WorkerListPage-Bkb8IGzC.js → WorkerListPage-Rq7zwaP2.js} +1 -1
  129. package/public/assets/{WorkerOperationsPage-yH5f32ue.js → WorkerOperationsPage-CapQErvu.js} +1 -1
  130. package/public/assets/{WorkerSetupGuidePage-DADwzbsf.js → WorkerSetupGuidePage-BVgaWQP0.js} +1 -1
  131. package/public/assets/{WorkerSetupPage-DAGFtNCP.js → WorkerSetupPage-D-T4O7PE.js} +1 -1
  132. package/public/assets/{agent-type-options-DXKoGpJI.js → agent-type-options-CvfN3Xkt.js} +1 -1
  133. package/public/assets/{arrow-left-DolNA3BD.js → arrow-left-CsRQX7H5.js} +1 -1
  134. package/public/assets/{arrow-right-J0lJRpaW.js → arrow-right-lhj-X9Ah.js} +1 -1
  135. package/public/assets/{bot-Bf1PX7dx.js → bot-BI0aOjZg.js} +1 -1
  136. package/public/assets/{chevron-down-Cm4So_5j.js → chevron-down-BMMNE8tj.js} +1 -1
  137. package/public/assets/{chevron-left-Cx2ByqjE.js → chevron-left-C5QPcYfE.js} +1 -1
  138. package/public/assets/{chevron-right-D0k7WYYt.js → chevron-right-DUJ8mQK2.js} +1 -1
  139. package/public/assets/{chevron-up-DVl3qTn3.js → chevron-up-tdj0sbLv.js} +1 -1
  140. package/public/assets/{circle-alert-BojCwibr.js → circle-alert-CMpAAr9i.js} +1 -1
  141. package/public/assets/{clock-DQeHdtoa.js → clock-CM8cLcAb.js} +1 -1
  142. package/public/assets/{copy-CHO7AsGy.js → copy-DEFukTLk.js} +1 -1
  143. package/public/assets/{download-D5cnbFDk.js → download-enKZtRO3.js} +1 -1
  144. package/public/assets/{external-link-lvF-co6-.js → external-link-DLg1H4XY.js} +1 -1
  145. package/public/assets/{git-fork-DRlvwKYI.js → git-fork-BLuZ7mG_.js} +1 -1
  146. package/public/assets/{index-D9synPeJ.js → index-6n4YMG-q.js} +2 -2
  147. package/public/assets/{key-KezsYJ0O.js → key-DdT50FZZ.js} +1 -1
  148. package/public/assets/{loader-circle--EO2iEyc.js → loader-circle-BsR1MJQw.js} +1 -1
  149. package/public/assets/{pencil-DIvX1Xsb.js → pencil-wJOYzbVI.js} +1 -1
  150. package/public/assets/{play-BHrAGNju.js → play-sxSJsoXu.js} +1 -1
  151. package/public/assets/{plus-9sncIl_N.js → plus-B3b8vXw9.js} +1 -1
  152. package/public/assets/{rotate-ccw-Dw8AxO4w.js → rotate-ccw-Wq-FsTE-.js} +1 -1
  153. package/public/assets/{scroll-text-CRQexw-n.js → scroll-text-DrPNg6ww.js} +1 -1
  154. package/public/assets/{settings-CgXh3xHG.js → settings-CG53o23z.js} +1 -1
  155. package/public/assets/{skip-forward-Q2vmwL9H.js → skip-forward-gDc2Yb8q.js} +1 -1
  156. package/public/assets/{status-colors-CRgg1N4i.js → status-colors-D1PZs9TB.js} +1 -1
  157. package/public/assets/{task-agent-KZdZD5cO.js → task-agent-DZDHjrS-.js} +1 -1
  158. package/public/assets/{task-constants-BiYtEhWG.js → task-constants-CCKesKBc.js} +1 -1
  159. package/public/assets/{task.store-Ds-1t2to.js → task.store-yMf_13Ff.js} +1 -1
  160. package/public/assets/{timer-ihiO0n04.js → timer-tBxBLW3s.js} +1 -1
  161. package/public/assets/{trash-2-Cb5-yglV.js → trash-2--fHS3BRC.js} +1 -1
  162. package/public/assets/{useFetch-Dj0ZN58I.js → useFetch-CBIWj1ZT.js} +1 -1
  163. package/public/assets/{users-MLpO39SG.js → users-BWDidnLE.js} +1 -1
  164. package/public/assets/{wifi-SWAOT6IR.js → wifi-BTg-eNKI.js} +1 -1
  165. package/public/assets/{workflow-M2c7dT84.js → workflow-CBP21ght.js} +1 -1
  166. package/public/assets/{zap-gd-vvEW3.js → zap-Dhvfo8tD.js} +1 -1
  167. package/public/index.html +1 -1
  168. package/public/sw.js +1 -1
@@ -16,14 +16,26 @@ class ReviewReportHandler {
16
16
  async handle(frame, _ctx) {
17
17
  const { taskId, report } = frame;
18
18
  this.logger.log(`Received review_report for task #${taskId}`);
19
- // 1. Store the report in Redis with 24h TTL
20
- await this.redis.setex(`review_report:${taskId}`, REVIEW_REPORT_TTL_SEC, JSON.stringify(report));
21
- // 2. Find the review task and its sourceTaskId
19
+ const reportJson = JSON.stringify(report);
20
+ // 1. Find the review task and persist to DB BEFORE any await.
21
+ // The terminal progress frame can arrive right after this frame;
22
+ // FrameHandlerRegistry.dispatch() does not await async handlers,
23
+ // so the synchronous task_completed path may re-read the task row
24
+ // while we're still awaiting Redis. The DB write is synchronous
25
+ // (better-sqlite3) and closes that race.
22
26
  const reviewTask = this.taskRepo.findById(taskId);
23
- if (!reviewTask?.sourceTaskId) {
24
- this.logger.warn(`review_report: task #${taskId} not found or has no sourceTaskId`);
27
+ if (reviewTask?.taskMode !== 'review' || !reviewTask.sourceTaskId) {
28
+ this.logger.warn(`review_report: task #${taskId} not found, not a review task, or has no sourceTaskId`);
25
29
  return;
26
30
  }
31
+ try {
32
+ this.taskRepo.updateReviewReport(taskId, reportJson);
33
+ }
34
+ catch (err) {
35
+ this.logger.warn(`review_report: early DB persist failed for task #${taskId}: ${String(err)}`);
36
+ }
37
+ // 2. Store the report in Redis with 24h TTL (used by round aggregation)
38
+ await this.redis.setex(`review_report:${taskId}`, REVIEW_REPORT_TTL_SEC, reportJson);
27
39
  const { sourceTaskId } = reviewTask;
28
40
  // 3. Determine which round this task belongs to by scanning round keys.
29
41
  // createReviewTasks stores: review_round:{sourceTaskId}:{round} -> { taskIds: [...] }
@@ -113,10 +125,11 @@ class ReviewReportHandler {
113
125
  }
114
126
  catch { /* keep existing */ }
115
127
  }
116
- // Aggregate issue counts from all reports in this round for the notification
128
+ // Aggregate issue counts and details from all reports in this round for the notification
117
129
  let criticalCount = 0;
118
130
  let warningCount = 0;
119
131
  let suggestionCount = 0;
132
+ const allIssues = [];
120
133
  for (const roundTaskId of currentRoundTaskIds) {
121
134
  const reportRaw = await this.redis.get(`review_report:${roundTaskId}`);
122
135
  if (!reportRaw)
@@ -130,6 +143,12 @@ class ReviewReportHandler {
130
143
  warningCount++;
131
144
  else if (issue.severity === 'suggestion')
132
145
  suggestionCount++;
146
+ allIssues.push({
147
+ severity: issue.severity,
148
+ file: issue.file,
149
+ line: issue.line,
150
+ description: issue.description,
151
+ });
133
152
  }
134
153
  }
135
154
  catch {
@@ -142,6 +161,7 @@ class ReviewReportHandler {
142
161
  criticalCount,
143
162
  warningCount,
144
163
  suggestionCount,
164
+ issues: allIssues,
145
165
  });
146
166
  // Only auto-mark as reviewed if not explicitly dismissed by user
147
167
  const sourceTask = this.taskRepo.findById(sourceTaskId);
@@ -1 +1 @@
1
- {"version":3,"file":"review-report.handler.js","sourceRoot":"","sources":["../../../src/web/frame-handlers/review-report.handler.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAMxC,0DAAyF;AAEzF,wDAAwD;AACxD,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAGrC,MAAa,mBAAmB;IAI9B,YACmB,QAAwB,EACxB,KAAmB,EACnB,YAA2B;QAF3B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,UAAK,GAAL,KAAK,CAAc;QACnB,iBAAY,GAAZ,YAAY,CAAe;QANrC,eAAU,GAAG,CAAC,eAAe,CAAC,CAAC;QACvB,WAAM,GAAG,IAAI,eAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAM5D,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,K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AQ,KAAK,SAAS;4BAAE,YAAY,EAAE,CAAC;6BACjD,IAAI,KAAK,CAAC,QAAQ,KAAK,YAAY;4BAAE,eAAe,EAAE,CAAC;oBAC9D,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,0BAA0B;gBAC5B,CAAC;YACH,CAAC;YAED,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,0BAAY,CAAC,qBAAqB,EAAE;gBACzD,YAAY;gBACZ,KAAK,EAAE,YAAY;gBACnB,aAAa;gBACb,YAAY;gBACZ,eAAe;aACqB,CAAC,CAAC;YAExC,iEAAiE;YACjE,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YACxD,IAAI,UAAU,IAAI,UAAU,CAAC,YAAY,KAAK,WAAW,EAAE,CAAC;gBAC1D,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA3KD,kDA2KC"}
1
+ {"version":3,"file":"review-report.handler.js","sourceRoot":"","sources":["../../../src/web/frame-handlers/review-report.handler.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAMxC,0DAAyF;AAEzF,wDAAwD;AACxD,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAGrC,MAAa,mBAAmB;IAI9B,YACmB,QAAwB,EACxB,KAAmB,EACnB,YAA2B;QAF3B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,UAAK,GAAL,KAAK,CAAc;QACnB,iBAAY,GAAZ,YAAY,CAAe;QANrC,eAAU,GAAG,CAAC,eAAe,CAAC,CAAC;QACvB,WAAM,GAAG,IAAI,eAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAM5D,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,KAAoB,EAAE,IAAyB;QAC1D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAA0B,CA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"}
@@ -18,8 +18,18 @@ export declare class StageConfirmHandler implements FrameHandler {
18
18
  constructor(dedupService: DedupService, taskRepo: TaskRepository, notifierService: NotifierService, eventEmitter: EventEmitter2, taskLifecycleService?: TaskLifecycleService | undefined, redis?: RedisService | undefined);
19
19
  handle(frame: WorkerUpFrame, _ctx: FrameHandlerContext): Promise<void>;
20
20
  /**
21
- * If this review task is the only reviewer in its round, auto-approve the fix.
21
+ * Check whether this review task is the sole reviewer in its round.
22
+ * Uses expectedCount (set at round creation) for robustness against race conditions.
22
23
  */
23
- private tryAutoApproveSingleReviewer;
24
+ private isSingleReviewerRound;
25
+ private getReviewRoundData;
26
+ private matchesSingleReviewerRound;
27
+ private isSingleReviewerRoundFromDb;
28
+ /**
29
+ * Auto-confirm the fix stage for a single-reviewer round.
30
+ * Falls back to the normal confirm notification if approveFix cannot resume the task.
31
+ */
32
+ private autoConfirmSingleReviewer;
33
+ private notifySuspended;
24
34
  }
25
35
  //# sourceMappingURL=stage-confirm.handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stage-confirm.handler.d.ts","sourceRoot":"","sources":["../../../src/web/frame-handlers/stage-confirm.handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EAEd,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,qBAAa,mBAAoB,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AoB,YAAW,YAAY;IAKpD,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC;IACtC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IATzB,QAAQ,CAAC,UAAU,WAA6B;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;gBAG5C,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,cAAc,EACxB,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,aAAa,EAC3B,oBAAoB,CAAC,EAAE,oBAAoB,YAAA,EAC3C,KAAK,CAAC,EAAE,YAAY,YAAA;IAGjC,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAyG5E;;;OAGG;YACW,qBAAqB;YA+BrB,kBAAkB;IAiBhC,OAAO,CAAC,0BAA0B;IAelC,OAAO,CAAC,2BAA2B;IAWnC;;;OAGG;YACW,yBAAyB;YAuBzB,eAAe;CAQ9B"}
@@ -70,31 +70,59 @@ class StageConfirmHandler {
70
70
  // Transition task from RUNNING → SUSPENDED so approveFix/skipFix can find it
71
71
  const task = this.taskRepo.findById(taskId);
72
72
  if (task) {
73
- if (task.status === protocol_1.TaskStatus.RUNNING) {
74
- const updated = this.taskRepo.updateStatus(taskId, protocol_1.TaskStatus.SUSPENDED, task.revision, { currentStage: stageName });
75
- if (updated) {
76
- this.eventEmitter.emit(event_types_1.DomainEvents.TASK_STATUS_CHANGED, {
77
- taskId,
78
- status: protocol_1.TaskStatus.SUSPENDED,
79
- previousStatus: protocol_1.TaskStatus.RUNNING,
80
- });
81
- }
82
- }
83
- // Auto-approve fix for single-reviewer review rounds.
84
- // Skip notification entirely — the user doesn't need to confirm manually.
73
+ // Check single-reviewer status BEFORE the status update so we can suppress
74
+ // the "task_suspended" notification for single-reviewer auto-approve cases.
75
+ // Without this, the user sees a useless "suspended" card immediately followed
76
+ // by an auto-approve — the suppression avoids that noise.
77
+ // Wrapped in try-catch so Redis failures cannot prevent the status transition.
78
+ let shouldSuppressSuspendedNotification = false;
85
79
  if (task.taskMode === 'review' &&
86
80
  task.sourceTaskId &&
87
81
  stageName === 'fix' &&
88
- this.taskLifecycleService &&
89
82
  this.redis) {
90
83
  const sourceTask = this.taskRepo.findById(task.sourceTaskId);
91
84
  if (sourceTask?.reviewStatus === 'dismissed') {
92
85
  this.logger.log(`Skipping auto-approve for task #${taskId} — source task #${task.sourceTaskId} was dismissed`);
93
86
  }
94
87
  else {
95
- const autoApproved = await this.tryAutoApproveSingleReviewer(task.sourceTaskId, taskId);
96
- if (autoApproved)
97
- return; // Skip confirm notification — already auto-approved
88
+ try {
89
+ shouldSuppressSuspendedNotification = await this.isSingleReviewerRound(task.sourceTaskId, taskId, task.reviewRound);
90
+ }
91
+ catch (err) {
92
+ this.logger.warn(`isSingleReviewerRound failed for task #${taskId}, falling back to normal confirm: ${String(err)}`);
93
+ }
94
+ }
95
+ }
96
+ let statusUpdated = false;
97
+ if (task.status === protocol_1.TaskStatus.RUNNING) {
98
+ statusUpdated = this.taskRepo.updateStatus(taskId, protocol_1.TaskStatus.SUSPENDED, task.revision, { currentStage: stageName });
99
+ if (statusUpdated) {
100
+ this.eventEmitter.emit(event_types_1.DomainEvents.TASK_STATUS_CHANGED, {
101
+ taskId,
102
+ status: protocol_1.TaskStatus.SUSPENDED,
103
+ previousStatus: protocol_1.TaskStatus.RUNNING,
104
+ suppressNotifications: shouldSuppressSuspendedNotification,
105
+ });
106
+ }
107
+ }
108
+ // Auto-approve fix for single-reviewer review rounds.
109
+ // Skip manual confirm notifications when the single reviewer can be
110
+ // auto-approved, but preserve the shared status-change event so web
111
+ // clients and other subscribers still observe the lifecycle transition.
112
+ if (task.sourceTaskId && shouldSuppressSuspendedNotification) {
113
+ const autoApproved = await this.autoConfirmSingleReviewer(task.sourceTaskId, taskId);
114
+ if (autoApproved)
115
+ return;
116
+ // Auto-approve failed — check if approveFix partially succeeded and
117
+ // already resumed the task to RUNNING. If so, skip both the suppressed
118
+ // suspended notification and the confirm card (the task is running again).
119
+ if (statusUpdated) {
120
+ const currentTask = this.taskRepo.findById(taskId);
121
+ if (currentTask && currentTask.status !== protocol_1.TaskStatus.SUSPENDED) {
122
+ this.logger.log(`Task #${taskId} already resumed to ${currentTask.status} after partial auto-approve — skipping confirm card`);
123
+ return;
124
+ }
125
+ await this.notifySuspended(taskId);
98
126
  }
99
127
  }
100
128
  await this.notifierService.notifyStageConfirmRequired(task, stageName, prompt, confirmNonce);
@@ -104,37 +132,87 @@ class StageConfirmHandler {
104
132
  }
105
133
  }
106
134
  /**
107
- * If this review task is the only reviewer in its round, auto-approve the fix.
135
+ * Check whether this review task is the sole reviewer in its round.
136
+ * Uses expectedCount (set at round creation) for robustness against race conditions.
108
137
  */
109
- async tryAutoApproveSingleReviewer(sourceTaskId, reviewTaskId) {
110
- if (!this.taskLifecycleService || !this.redis)
138
+ async isSingleReviewerRound(sourceTaskId, reviewTaskId, reviewRound) {
139
+ if (!this.redis)
111
140
  return false;
112
- // Find the latest round for this source task
141
+ if (reviewRound != null && reviewRound > 0) {
142
+ const explicitRound = await this.getReviewRoundData(sourceTaskId, reviewRound);
143
+ if (explicitRound) {
144
+ return this.matchesSingleReviewerRound(explicitRound, reviewTaskId, true);
145
+ }
146
+ return this.isSingleReviewerRoundFromDb(sourceTaskId, reviewTaskId, reviewRound);
147
+ }
113
148
  const latestRoundRaw = await this.redis.get(`review_round_count:${sourceTaskId}`);
114
149
  if (!latestRoundRaw)
115
150
  return false;
116
151
  const latestRound = parseInt(latestRoundRaw, 10);
117
152
  if (isNaN(latestRound))
118
153
  return false;
119
- const roundKey = `review_round:${sourceTaskId}:${latestRound}`;
154
+ for (let round = latestRound; round >= 1; round--) {
155
+ const roundData = await this.getReviewRoundData(sourceTaskId, round);
156
+ if (!roundData || !roundData.taskIds.includes(reviewTaskId)) {
157
+ continue;
158
+ }
159
+ return this.matchesSingleReviewerRound(roundData, reviewTaskId, false);
160
+ }
161
+ return false;
162
+ }
163
+ async getReviewRoundData(sourceTaskId, round) {
164
+ if (!this.redis)
165
+ return null;
166
+ const roundKey = `review_round:${sourceTaskId}:${round}`;
120
167
  const roundRaw = await this.redis.get(roundKey);
121
168
  if (!roundRaw)
169
+ return null;
170
+ try {
171
+ return JSON.parse(roundRaw);
172
+ }
173
+ catch {
174
+ return null;
175
+ }
176
+ }
177
+ matchesSingleReviewerRound(roundData, reviewTaskId, allowEmptyMembership) {
178
+ const count = roundData.expectedCount ?? roundData.taskIds.length;
179
+ if (count !== 1)
122
180
  return false;
181
+ if (roundData.taskIds.length === 0) {
182
+ return allowEmptyMembership;
183
+ }
184
+ return roundData.taskIds.includes(reviewTaskId);
185
+ }
186
+ isSingleReviewerRoundFromDb(sourceTaskId, reviewTaskId, reviewRound) {
187
+ const roundTasks = this.taskRepo.findBySourceTaskId(sourceTaskId)
188
+ .filter((task) => task.taskMode === 'review' && task.reviewRound === reviewRound);
189
+ return roundTasks.length === 1 && roundTasks[0]?.id === reviewTaskId;
190
+ }
191
+ /**
192
+ * Auto-confirm the fix stage for a single-reviewer round.
193
+ * Falls back to the normal confirm notification if approveFix cannot resume the task.
194
+ */
195
+ async autoConfirmSingleReviewer(sourceTaskId, reviewTaskId) {
196
+ if (!this.taskLifecycleService) {
197
+ this.logger.warn(`Cannot auto-confirm task #${reviewTaskId} — taskLifecycleService not available`);
198
+ return false;
199
+ }
123
200
  try {
124
- const roundData = JSON.parse(roundRaw);
125
- if (roundData.taskIds.length !== 1)
126
- return false;
127
- if (roundData.taskIds[0] !== reviewTaskId)
128
- return false;
129
201
  await this.taskLifecycleService.approveFix(sourceTaskId, reviewTaskId);
130
- this.logger.log(`Auto-approved fix for single-reviewer round #${latestRound}, task #${reviewTaskId}`);
202
+ this.logger.log(`Auto-approved fix for single-reviewer round, task #${reviewTaskId}`);
131
203
  return true;
132
204
  }
133
205
  catch (err) {
134
- this.logger.warn(`Auto-approve fix failed for task #${reviewTaskId}: ${String(err)}`);
206
+ this.logger.warn(`Auto-approve fix failed for single-reviewer task #${reviewTaskId}: ${String(err)}`);
135
207
  return false;
136
208
  }
137
209
  }
210
+ async notifySuspended(taskId) {
211
+ const freshTask = this.taskRepo.findById(taskId);
212
+ if (!freshTask)
213
+ return;
214
+ await this.notifierService.notifyTaskSuspended(freshTask, freshTask.errorMessage ?? 'Task suspended');
215
+ }
138
216
  }
139
217
  exports.StageConfirmHandler = StageConfirmHandler;
140
218
  //# sourceMappingURL=stage-confirm.handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stage-confirm.handler.js","sourceRoot":"","sources":["../../../src/web/frame-handlers/stage-confirm.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,oDAAsC;AAKtC,mDAAkD;AAQlD,0DAAuF;AAEvF,MAAa,mBAAmB;IAI9B,YACmB,YAA0B,EAC1B,QAAwB,EACxB,eAAgC,EAChC,YAA2B,EAC3B,oBAA2C,EAC3C,KAAoB;QALpB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,aAAQ,GAAR,QAAQ,CAAgB;QACxB,oBAAe,GAAf,eAAe,CAAiB;QAChC,iBAAY,GAAZ,YAAY,CAAe;QAC3B,yBAAoB,GAApB,oBAAoB,CAAuB;QAC3C,UAAK,GAAL,KAAK,CAAe;QAT9B,eAAU,GAAG,CAAC,uBAAuB,CAAC,CAAC;QAC/B,WAAM,GAAG,IAAI,eAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAS5D,CAAC;IAEJ,KAAK,CAAC,MAAM,CAAC,KAAoB,EAAE,IAAyB;QAC1D,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAA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C,CAAC;YACvE,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,sDAAsD,YAAY,EAAE,CACrE,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,qDAAqD,YAAY,KAAK,MAAM,CAAC,GAAG,CAAC,EAAE,CACpF,CAAC;YACF,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,MAAc;QAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,SAAS;YAAE,OAAO;QACvB,MAAM,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAC5C,SAAS,EACT,SAAS,CAAC,YAAY,IAAI,gBAAgB,CAC3C,CAAC;IACJ,CAAC;CACF;AAvOD,kDAuOC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overlordai/server",
3
- "version": "1.0.173",
3
+ "version": "1.0.174",
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.173",
32
- "@overlordai/protocol": "1.0.173",
33
- "@overlordai/validation": "1.0.173",
31
+ "@overlordai/command-parser": "1.0.174",
32
+ "@overlordai/protocol": "1.0.174",
33
+ "@overlordai/validation": "1.0.174",
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-D9synPeJ.js";import{S as E}from"./Select-BRJxl1YO.js";import{E as L}from"./EmptyState-CqF5g3iI.js";import{T as I}from"./Skeleton-CkmmCp2B.js";import{t as N}from"./date-CmcdoD87.js";import{u as R}from"./useFetch-Dj0ZN58I.js";import{P}from"./plus-9sncIl_N.js";import{C as O}from"./copy-CHO7AsGy.js";import{T as w}from"./trash-2-Cb5-yglV.js";import"./chevron-down-Cm4So_5j.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-6n4YMG-q.js";import{S as E}from"./Select-CgGQnjuL.js";import{E as L}from"./EmptyState-P0FzomcO.js";import{T as I}from"./Skeleton-KIdOfHCh.js";import{t as N}from"./date-CmcdoD87.js";import{u as R}from"./useFetch-CBIWj1ZT.js";import{P}from"./plus-B3b8vXw9.js";import{C as O}from"./copy-DEFukTLk.js";import{T as w}from"./trash-2--fHS3BRC.js";import"./chevron-down-BMMNE8tj.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-D9synPeJ.js";import{U as c}from"./users-MLpO39SG.js";import{B as b}from"./bot-Bf1PX7dx.js";import{S as p}from"./scroll-text-CRQexw-n.js";import{S as x}from"./settings-CgXh3xHG.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-6n4YMG-q.js";import{U as c}from"./users-BWDidnLE.js";import{B as b}from"./bot-BI0aOjZg.js";import{S as p}from"./scroll-text-DrPNg6ww.js";import{S as x}from"./settings-CG53o23z.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-D9synPeJ.js";import{a as s}from"./DocsPrimitives-BzVDx2cs.js";import"./copy-CHO7AsGy.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-6n4YMG-q.js";import{a as s}from"./DocsPrimitives-CgyoKAir.js";import"./copy-DEFukTLk.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};