steroids-api 0.2.7

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 (328) hide show
  1. package/dist/API/src/index.d.ts +10 -0
  2. package/dist/API/src/index.d.ts.map +1 -0
  3. package/dist/API/src/index.js +130 -0
  4. package/dist/API/src/index.js.map +1 -0
  5. package/dist/API/src/routes/activity.d.ts +7 -0
  6. package/dist/API/src/routes/activity.d.ts.map +1 -0
  7. package/dist/API/src/routes/activity.js +252 -0
  8. package/dist/API/src/routes/activity.js.map +1 -0
  9. package/dist/API/src/routes/config.d.ts +7 -0
  10. package/dist/API/src/routes/config.d.ts.map +1 -0
  11. package/dist/API/src/routes/config.js +521 -0
  12. package/dist/API/src/routes/config.js.map +1 -0
  13. package/dist/API/src/routes/health.d.ts +7 -0
  14. package/dist/API/src/routes/health.d.ts.map +1 -0
  15. package/dist/API/src/routes/health.js +172 -0
  16. package/dist/API/src/routes/health.js.map +1 -0
  17. package/dist/API/src/routes/incidents.d.ts +7 -0
  18. package/dist/API/src/routes/incidents.d.ts.map +1 -0
  19. package/dist/API/src/routes/incidents.js +117 -0
  20. package/dist/API/src/routes/incidents.js.map +1 -0
  21. package/dist/API/src/routes/projects.d.ts +7 -0
  22. package/dist/API/src/routes/projects.d.ts.map +1 -0
  23. package/dist/API/src/routes/projects.js +398 -0
  24. package/dist/API/src/routes/projects.js.map +1 -0
  25. package/dist/API/src/routes/runners.d.ts +7 -0
  26. package/dist/API/src/routes/runners.d.ts.map +1 -0
  27. package/dist/API/src/routes/runners.js +242 -0
  28. package/dist/API/src/routes/runners.js.map +1 -0
  29. package/dist/API/src/routes/tasks.d.ts +7 -0
  30. package/dist/API/src/routes/tasks.d.ts.map +1 -0
  31. package/dist/API/src/routes/tasks.js +1007 -0
  32. package/dist/API/src/routes/tasks.js.map +1 -0
  33. package/dist/API/src/utils/validation.d.ts +22 -0
  34. package/dist/API/src/utils/validation.d.ts.map +1 -0
  35. package/dist/API/src/utils/validation.js +50 -0
  36. package/dist/API/src/utils/validation.js.map +1 -0
  37. package/dist/index.d.ts +10 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +184 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/routes/activity.d.ts +7 -0
  42. package/dist/routes/activity.d.ts.map +1 -0
  43. package/dist/routes/activity.js +252 -0
  44. package/dist/routes/activity.js.map +1 -0
  45. package/dist/routes/config.d.ts +7 -0
  46. package/dist/routes/config.d.ts.map +1 -0
  47. package/dist/routes/config.js +647 -0
  48. package/dist/routes/config.js.map +1 -0
  49. package/dist/routes/credit-alerts.d.ts +2 -0
  50. package/dist/routes/credit-alerts.d.ts.map +1 -0
  51. package/dist/routes/credit-alerts.js +97 -0
  52. package/dist/routes/credit-alerts.js.map +1 -0
  53. package/dist/routes/health.d.ts +7 -0
  54. package/dist/routes/health.d.ts.map +1 -0
  55. package/dist/routes/health.js +200 -0
  56. package/dist/routes/health.js.map +1 -0
  57. package/dist/routes/incidents.d.ts +7 -0
  58. package/dist/routes/incidents.d.ts.map +1 -0
  59. package/dist/routes/incidents.js +117 -0
  60. package/dist/routes/incidents.js.map +1 -0
  61. package/dist/routes/projects.d.ts +7 -0
  62. package/dist/routes/projects.d.ts.map +1 -0
  63. package/dist/routes/projects.js +643 -0
  64. package/dist/routes/projects.js.map +1 -0
  65. package/dist/routes/runners.d.ts +7 -0
  66. package/dist/routes/runners.d.ts.map +1 -0
  67. package/dist/routes/runners.js +299 -0
  68. package/dist/routes/runners.js.map +1 -0
  69. package/dist/routes/skills.d.ts +3 -0
  70. package/dist/routes/skills.d.ts.map +1 -0
  71. package/dist/routes/skills.js +109 -0
  72. package/dist/routes/skills.js.map +1 -0
  73. package/dist/routes/storage.d.ts +7 -0
  74. package/dist/routes/storage.d.ts.map +1 -0
  75. package/dist/routes/storage.js +93 -0
  76. package/dist/routes/storage.js.map +1 -0
  77. package/dist/routes/tasks.d.ts +7 -0
  78. package/dist/routes/tasks.d.ts.map +1 -0
  79. package/dist/routes/tasks.js +1145 -0
  80. package/dist/routes/tasks.js.map +1 -0
  81. package/dist/src/cleanup/invocation-logs.d.ts +30 -0
  82. package/dist/src/cleanup/invocation-logs.d.ts.map +1 -0
  83. package/dist/src/cleanup/invocation-logs.js +66 -0
  84. package/dist/src/cleanup/invocation-logs.js.map +1 -0
  85. package/dist/src/commands/loop-phases.d.ts +11 -0
  86. package/dist/src/commands/loop-phases.d.ts.map +1 -0
  87. package/dist/src/commands/loop-phases.js +304 -0
  88. package/dist/src/commands/loop-phases.js.map +1 -0
  89. package/dist/src/config/loader.d.ts +160 -0
  90. package/dist/src/config/loader.d.ts.map +1 -0
  91. package/dist/src/config/loader.js +276 -0
  92. package/dist/src/config/loader.js.map +1 -0
  93. package/dist/src/database/connection.d.ts +35 -0
  94. package/dist/src/database/connection.d.ts.map +1 -0
  95. package/dist/src/database/connection.js +197 -0
  96. package/dist/src/database/connection.js.map +1 -0
  97. package/dist/src/database/queries.d.ts +220 -0
  98. package/dist/src/database/queries.d.ts.map +1 -0
  99. package/dist/src/database/queries.js +589 -0
  100. package/dist/src/database/queries.js.map +1 -0
  101. package/dist/src/database/schema.d.ts +8 -0
  102. package/dist/src/database/schema.d.ts.map +1 -0
  103. package/dist/src/database/schema.js +184 -0
  104. package/dist/src/database/schema.js.map +1 -0
  105. package/dist/src/git/push.d.ts +26 -0
  106. package/dist/src/git/push.d.ts.map +1 -0
  107. package/dist/src/git/push.js +91 -0
  108. package/dist/src/git/push.js.map +1 -0
  109. package/dist/src/git/status.d.ts +83 -0
  110. package/dist/src/git/status.d.ts.map +1 -0
  111. package/dist/src/git/status.js +315 -0
  112. package/dist/src/git/status.js.map +1 -0
  113. package/dist/src/health/stuck-task-detector.d.ts +131 -0
  114. package/dist/src/health/stuck-task-detector.d.ts.map +1 -0
  115. package/dist/src/health/stuck-task-detector.js +233 -0
  116. package/dist/src/health/stuck-task-detector.js.map +1 -0
  117. package/dist/src/health/stuck-task-recovery.d.ts +45 -0
  118. package/dist/src/health/stuck-task-recovery.d.ts.map +1 -0
  119. package/dist/src/health/stuck-task-recovery.js +309 -0
  120. package/dist/src/health/stuck-task-recovery.js.map +1 -0
  121. package/dist/src/index.d.ts +10 -0
  122. package/dist/src/index.d.ts.map +1 -0
  123. package/dist/src/index.js +130 -0
  124. package/dist/src/index.js.map +1 -0
  125. package/dist/src/locking/queries.d.ts +116 -0
  126. package/dist/src/locking/queries.d.ts.map +1 -0
  127. package/dist/src/locking/queries.js +232 -0
  128. package/dist/src/locking/queries.js.map +1 -0
  129. package/dist/src/locking/section-lock.d.ts +74 -0
  130. package/dist/src/locking/section-lock.d.ts.map +1 -0
  131. package/dist/src/locking/section-lock.js +196 -0
  132. package/dist/src/locking/section-lock.js.map +1 -0
  133. package/dist/src/locking/task-lock.d.ts +92 -0
  134. package/dist/src/locking/task-lock.d.ts.map +1 -0
  135. package/dist/src/locking/task-lock.js +233 -0
  136. package/dist/src/locking/task-lock.js.map +1 -0
  137. package/dist/src/migrations/index.d.ts +7 -0
  138. package/dist/src/migrations/index.d.ts.map +1 -0
  139. package/dist/src/migrations/index.js +9 -0
  140. package/dist/src/migrations/index.js.map +1 -0
  141. package/dist/src/migrations/manifest.d.ts +92 -0
  142. package/dist/src/migrations/manifest.d.ts.map +1 -0
  143. package/dist/src/migrations/manifest.js +255 -0
  144. package/dist/src/migrations/manifest.js.map +1 -0
  145. package/dist/src/migrations/runner.d.ts +84 -0
  146. package/dist/src/migrations/runner.d.ts.map +1 -0
  147. package/dist/src/migrations/runner.js +338 -0
  148. package/dist/src/migrations/runner.js.map +1 -0
  149. package/dist/src/orchestrator/coder.d.ts +32 -0
  150. package/dist/src/orchestrator/coder.d.ts.map +1 -0
  151. package/dist/src/orchestrator/coder.js +170 -0
  152. package/dist/src/orchestrator/coder.js.map +1 -0
  153. package/dist/src/orchestrator/coordinator.d.ts +28 -0
  154. package/dist/src/orchestrator/coordinator.d.ts.map +1 -0
  155. package/dist/src/orchestrator/coordinator.js +252 -0
  156. package/dist/src/orchestrator/coordinator.js.map +1 -0
  157. package/dist/src/orchestrator/fallback-handler.d.ts +24 -0
  158. package/dist/src/orchestrator/fallback-handler.d.ts.map +1 -0
  159. package/dist/src/orchestrator/fallback-handler.js +280 -0
  160. package/dist/src/orchestrator/fallback-handler.js.map +1 -0
  161. package/dist/src/orchestrator/invoke.d.ts +14 -0
  162. package/dist/src/orchestrator/invoke.d.ts.map +1 -0
  163. package/dist/src/orchestrator/invoke.js +76 -0
  164. package/dist/src/orchestrator/invoke.js.map +1 -0
  165. package/dist/src/orchestrator/post-coder.d.ts +10 -0
  166. package/dist/src/orchestrator/post-coder.d.ts.map +1 -0
  167. package/dist/src/orchestrator/post-coder.js +198 -0
  168. package/dist/src/orchestrator/post-coder.js.map +1 -0
  169. package/dist/src/orchestrator/post-reviewer.d.ts +10 -0
  170. package/dist/src/orchestrator/post-reviewer.d.ts.map +1 -0
  171. package/dist/src/orchestrator/post-reviewer.js +199 -0
  172. package/dist/src/orchestrator/post-reviewer.js.map +1 -0
  173. package/dist/src/orchestrator/reviewer.d.ts +35 -0
  174. package/dist/src/orchestrator/reviewer.d.ts.map +1 -0
  175. package/dist/src/orchestrator/reviewer.js +237 -0
  176. package/dist/src/orchestrator/reviewer.js.map +1 -0
  177. package/dist/src/orchestrator/schemas.d.ts +10 -0
  178. package/dist/src/orchestrator/schemas.d.ts.map +1 -0
  179. package/dist/src/orchestrator/schemas.js +81 -0
  180. package/dist/src/orchestrator/schemas.js.map +1 -0
  181. package/dist/src/orchestrator/task-selector.d.ts +102 -0
  182. package/dist/src/orchestrator/task-selector.d.ts.map +1 -0
  183. package/dist/src/orchestrator/task-selector.js +326 -0
  184. package/dist/src/orchestrator/task-selector.js.map +1 -0
  185. package/dist/src/orchestrator/types.d.ts +74 -0
  186. package/dist/src/orchestrator/types.d.ts.map +1 -0
  187. package/dist/src/orchestrator/types.js +5 -0
  188. package/dist/src/orchestrator/types.js.map +1 -0
  189. package/dist/src/prompts/coder.d.ts +36 -0
  190. package/dist/src/prompts/coder.d.ts.map +1 -0
  191. package/dist/src/prompts/coder.js +303 -0
  192. package/dist/src/prompts/coder.js.map +1 -0
  193. package/dist/src/prompts/prompt-helpers.d.ts +51 -0
  194. package/dist/src/prompts/prompt-helpers.d.ts.map +1 -0
  195. package/dist/src/prompts/prompt-helpers.js +299 -0
  196. package/dist/src/prompts/prompt-helpers.js.map +1 -0
  197. package/dist/src/prompts/reviewer.d.ts +40 -0
  198. package/dist/src/prompts/reviewer.d.ts.map +1 -0
  199. package/dist/src/prompts/reviewer.js +416 -0
  200. package/dist/src/prompts/reviewer.js.map +1 -0
  201. package/dist/src/providers/claude.d.ts +53 -0
  202. package/dist/src/providers/claude.d.ts.map +1 -0
  203. package/dist/src/providers/claude.js +227 -0
  204. package/dist/src/providers/claude.js.map +1 -0
  205. package/dist/src/providers/codex.d.ts +53 -0
  206. package/dist/src/providers/codex.d.ts.map +1 -0
  207. package/dist/src/providers/codex.js +253 -0
  208. package/dist/src/providers/codex.js.map +1 -0
  209. package/dist/src/providers/gemini.d.ts +58 -0
  210. package/dist/src/providers/gemini.d.ts.map +1 -0
  211. package/dist/src/providers/gemini.js +240 -0
  212. package/dist/src/providers/gemini.js.map +1 -0
  213. package/dist/src/providers/interface.d.ts +185 -0
  214. package/dist/src/providers/interface.d.ts.map +1 -0
  215. package/dist/src/providers/interface.js +92 -0
  216. package/dist/src/providers/interface.js.map +1 -0
  217. package/dist/src/providers/invocation-logger.d.ts +97 -0
  218. package/dist/src/providers/invocation-logger.d.ts.map +1 -0
  219. package/dist/src/providers/invocation-logger.js +378 -0
  220. package/dist/src/providers/invocation-logger.js.map +1 -0
  221. package/dist/src/providers/openai.d.ts +53 -0
  222. package/dist/src/providers/openai.d.ts.map +1 -0
  223. package/dist/src/providers/openai.js +230 -0
  224. package/dist/src/providers/openai.js.map +1 -0
  225. package/dist/src/providers/registry.d.ts +100 -0
  226. package/dist/src/providers/registry.d.ts.map +1 -0
  227. package/dist/src/providers/registry.js +170 -0
  228. package/dist/src/providers/registry.js.map +1 -0
  229. package/dist/src/routes/activity.d.ts +7 -0
  230. package/dist/src/routes/activity.d.ts.map +1 -0
  231. package/dist/src/routes/activity.js +252 -0
  232. package/dist/src/routes/activity.js.map +1 -0
  233. package/dist/src/routes/config.d.ts +7 -0
  234. package/dist/src/routes/config.d.ts.map +1 -0
  235. package/dist/src/routes/config.js +521 -0
  236. package/dist/src/routes/config.js.map +1 -0
  237. package/dist/src/routes/health.d.ts +7 -0
  238. package/dist/src/routes/health.d.ts.map +1 -0
  239. package/dist/src/routes/health.js +172 -0
  240. package/dist/src/routes/health.js.map +1 -0
  241. package/dist/src/routes/incidents.d.ts +7 -0
  242. package/dist/src/routes/incidents.d.ts.map +1 -0
  243. package/dist/src/routes/incidents.js +117 -0
  244. package/dist/src/routes/incidents.js.map +1 -0
  245. package/dist/src/routes/projects.d.ts +7 -0
  246. package/dist/src/routes/projects.d.ts.map +1 -0
  247. package/dist/src/routes/projects.js +398 -0
  248. package/dist/src/routes/projects.js.map +1 -0
  249. package/dist/src/routes/runners.d.ts +7 -0
  250. package/dist/src/routes/runners.d.ts.map +1 -0
  251. package/dist/src/routes/runners.js +242 -0
  252. package/dist/src/routes/runners.js.map +1 -0
  253. package/dist/src/routes/tasks.d.ts +7 -0
  254. package/dist/src/routes/tasks.d.ts.map +1 -0
  255. package/dist/src/routes/tasks.js +1007 -0
  256. package/dist/src/routes/tasks.js.map +1 -0
  257. package/dist/src/runners/activity-log.d.ts +65 -0
  258. package/dist/src/runners/activity-log.d.ts.map +1 -0
  259. package/dist/src/runners/activity-log.js +140 -0
  260. package/dist/src/runners/activity-log.js.map +1 -0
  261. package/dist/src/runners/cron.d.ts +30 -0
  262. package/dist/src/runners/cron.d.ts.map +1 -0
  263. package/dist/src/runners/cron.js +333 -0
  264. package/dist/src/runners/cron.js.map +1 -0
  265. package/dist/src/runners/daemon.d.ts +71 -0
  266. package/dist/src/runners/daemon.d.ts.map +1 -0
  267. package/dist/src/runners/daemon.js +233 -0
  268. package/dist/src/runners/daemon.js.map +1 -0
  269. package/dist/src/runners/global-db.d.ts +31 -0
  270. package/dist/src/runners/global-db.d.ts.map +1 -0
  271. package/dist/src/runners/global-db.js +220 -0
  272. package/dist/src/runners/global-db.js.map +1 -0
  273. package/dist/src/runners/hang-detector.d.ts +38 -0
  274. package/dist/src/runners/hang-detector.d.ts.map +1 -0
  275. package/dist/src/runners/hang-detector.js +130 -0
  276. package/dist/src/runners/hang-detector.js.map +1 -0
  277. package/dist/src/runners/heartbeat.d.ts +39 -0
  278. package/dist/src/runners/heartbeat.d.ts.map +1 -0
  279. package/dist/src/runners/heartbeat.js +71 -0
  280. package/dist/src/runners/heartbeat.js.map +1 -0
  281. package/dist/src/runners/lock.d.ts +47 -0
  282. package/dist/src/runners/lock.d.ts.map +1 -0
  283. package/dist/src/runners/lock.js +140 -0
  284. package/dist/src/runners/lock.js.map +1 -0
  285. package/dist/src/runners/orchestrator-loop.d.ts +20 -0
  286. package/dist/src/runners/orchestrator-loop.d.ts.map +1 -0
  287. package/dist/src/runners/orchestrator-loop.js +208 -0
  288. package/dist/src/runners/orchestrator-loop.js.map +1 -0
  289. package/dist/src/runners/projects.d.ts +96 -0
  290. package/dist/src/runners/projects.d.ts.map +1 -0
  291. package/dist/src/runners/projects.js +243 -0
  292. package/dist/src/runners/projects.js.map +1 -0
  293. package/dist/src/runners/wakeup.d.ts +37 -0
  294. package/dist/src/runners/wakeup.d.ts.map +1 -0
  295. package/dist/src/runners/wakeup.js +355 -0
  296. package/dist/src/runners/wakeup.js.map +1 -0
  297. package/dist/src/utils/validation.d.ts +22 -0
  298. package/dist/src/utils/validation.d.ts.map +1 -0
  299. package/dist/src/utils/validation.js +50 -0
  300. package/dist/src/utils/validation.js.map +1 -0
  301. package/dist/utils/sqlite.d.ts +17 -0
  302. package/dist/utils/sqlite.d.ts.map +1 -0
  303. package/dist/utils/sqlite.js +27 -0
  304. package/dist/utils/sqlite.js.map +1 -0
  305. package/dist/utils/storage-cache.d.ts +33 -0
  306. package/dist/utils/storage-cache.d.ts.map +1 -0
  307. package/dist/utils/storage-cache.js +81 -0
  308. package/dist/utils/storage-cache.js.map +1 -0
  309. package/dist/utils/validation.d.ts +22 -0
  310. package/dist/utils/validation.d.ts.map +1 -0
  311. package/dist/utils/validation.js +51 -0
  312. package/dist/utils/validation.js.map +1 -0
  313. package/package.json +39 -0
  314. package/src/index.ts +199 -0
  315. package/src/routes/activity.ts +302 -0
  316. package/src/routes/config.ts +723 -0
  317. package/src/routes/credit-alerts.ts +73 -0
  318. package/src/routes/health.ts +219 -0
  319. package/src/routes/incidents.ts +131 -0
  320. package/src/routes/projects.ts +854 -0
  321. package/src/routes/runners.ts +357 -0
  322. package/src/routes/skills.ts +127 -0
  323. package/src/routes/storage.ts +108 -0
  324. package/src/routes/tasks.ts +1372 -0
  325. package/src/utils/sqlite.ts +36 -0
  326. package/src/utils/storage-cache.ts +107 -0
  327. package/src/utils/validation.ts +61 -0
  328. package/tsconfig.json +20 -0
@@ -0,0 +1,303 @@
1
+ /**
2
+ * Coder prompt templates
3
+ * Following the exact templates from PROMPTS.md
4
+ */
5
+ import { getAgentsMd, getSourceFileContent, buildFileScopeSection, buildFileAnchorSection, formatRejectionHistoryForCoder, } from './prompt-helpers.js';
6
+ /**
7
+ * Generate the coder prompt for a new task
8
+ */
9
+ export function generateCoderPrompt(context) {
10
+ const { task, projectPath, previousStatus, rejectionNotes, rejectionHistory, coordinatorGuidance } = context;
11
+ const agentsMd = getAgentsMd(projectPath);
12
+ const sourceContent = getSourceFileContent(projectPath, task.source_file);
13
+ // Build rejection section with full history and coordinator guidance
14
+ const rejectionSection = formatRejectionHistoryForCoder(task.id, rejectionHistory, rejectionNotes, coordinatorGuidance);
15
+ // Build file scope section
16
+ const fileScopeSection = buildFileScopeSection(task, sourceContent);
17
+ const fileAnchorSection = buildFileAnchorSection(task);
18
+ return `# TASK: ${task.id.substring(0, 8)} - ${task.title}
19
+ # Status: ${previousStatus} → in_progress | Rejections: ${task.rejection_count}/15
20
+
21
+ You are a CODER in an automated task execution system. Your job is to implement the task below according to the specification.
22
+
23
+ **Follow the project's existing architecture and patterns.** Read AGENTS.md and existing code to understand how things are structured before making changes.
24
+
25
+ ---
26
+
27
+ ## Task Information
28
+
29
+ **Task ID:** ${task.id}
30
+ **Title:** ${task.title}
31
+ **Rejection Count:** ${task.rejection_count}/15
32
+ **Project:** ${projectPath}
33
+ ${fileScopeSection}${fileAnchorSection}
34
+ ---
35
+
36
+ ## Specification
37
+
38
+ The full specification is in: ${task.source_file ?? '(not specified)'}
39
+
40
+ ${sourceContent}
41
+
42
+ ---
43
+
44
+ ## Project Guidelines
45
+
46
+ ${agentsMd}
47
+
48
+ ---
49
+
50
+ ## Existing Code Context
51
+
52
+ Review relevant project files as needed for your implementation.
53
+ ${rejectionSection}
54
+ ---
55
+
56
+ ## FIRST: Check If Work Is Already Done
57
+
58
+ **Before implementing anything, check if the work already exists:**
59
+
60
+ 1. Search for files/code that match the specification requirements
61
+ 2. Run \`git log --oneline -20\` to see recent commits
62
+
63
+ **IF THE WORK ALREADY EXISTS:**
64
+
65
+ 1. Verify it matches the spec:
66
+
67
+ \`\`\`bash
68
+ git log --oneline -20 # Find the commit hash
69
+ git show <commit-hash> --stat # Verify it matches the spec
70
+ \`\`\`
71
+
72
+ 2. Note which commit contains the work in your response
73
+ 3. **Do NOT implement duplicate code** - state "TASK COMPLETE" and the orchestrator will submit for review
74
+
75
+ ---
76
+
77
+ **IF THE WORK DOES NOT EXIST, CONTINUE BELOW:**
78
+
79
+ ---
80
+
81
+ ## Your Instructions (If Work Is NOT Already Done)
82
+
83
+ 1. Read the specification carefully
84
+ 2. Implement the feature/fix as specified
85
+ 3. Write tests if the project has a test directory
86
+ 4. Keep files under 500 lines
87
+ 5. Follow the coding standards in AGENTS.md
88
+
89
+ ### Security Notes
90
+
91
+ - When executing shell commands with user-controlled arguments, use array-based APIs (e.g., \`execFileSync(cmd, [args])\`). Add a comment like \`// hardcoded command, no user input\` when using \`execSync\` intentionally for fixed commands or shell features.
92
+ - If you make a security-relevant decision (e.g., choosing \`execSync\` over \`execFileSync\` because you need pipes), explain your reasoning in your commit message or output.
93
+
94
+ ---
95
+
96
+ ## Attempt Before Skip (IMPORTANT)
97
+
98
+ **You MUST attempt any task that can be run locally, even if it might fail.**
99
+
100
+ Many tasks look like they need external setup, but they're actually runnable commands. Your job is to TRY them first.
101
+
102
+ **The rule is simple:** If you can type a command and hit Enter, ATTEMPT IT.
103
+
104
+ Even if it fails, that failure is valuable information. The reviewer wants to see that you tried.
105
+
106
+ **Only skip when the task TRULY requires external action you cannot perform** (e.g., cloud console access, DNS configuration, account creation).
107
+
108
+ **BEFORE skipping, check the spec section for:**
109
+ - \`> SKIP\` markers, "manual setup", "handled manually", "external setup"
110
+ - Cloud infrastructure tasks with NO automation scripts provided
111
+
112
+ **If you must skip, output:** "TASK SHOULD BE SKIPPED: <reason>. WHAT'S NEEDED: <human action>."
113
+ The orchestrator will handle the skip status.
114
+
115
+ ---
116
+
117
+ ## CRITICAL RULES
118
+
119
+ 1. **NEVER touch .steroids/ directory** (no .db, .yaml, .yml files)
120
+ 2. **BUILD MUST PASS before submitting** (run build and tests, fix errors)
121
+ 3. **COMMIT YOUR WORK** with a meaningful message when complete
122
+ 4. **DO NOT run any \`steroids tasks\` commands** - the orchestrator handles all status updates
123
+ 5. **Never modify TODO.md directly** - the CLI manages task status
124
+
125
+ ---
126
+
127
+ ## When You Are Done
128
+
129
+ **Verify the project builds AND tests pass, then commit your work:**
130
+
131
+ \`\`\`bash
132
+ git add <your-changed-files>
133
+ git commit -m "<type>: <descriptive message>"
134
+ \`\`\`
135
+
136
+ **Output "TASK COMPLETE" followed by a summary of your changes.**
137
+
138
+ The orchestrator will automatically detect your completion and submit the task for review. Do NOT run any \`steroids tasks\` commands - the orchestrator handles all status updates.
139
+
140
+ ---
141
+ ${task.rejection_count > 0 ? `
142
+ ## THIS TASK HAS BEEN REJECTED ${task.rejection_count} TIME(S)
143
+
144
+ **You MUST address the reviewer's feedback before submitting again.**
145
+ Extract every test case from the rejection notes, run each one, fix issues at the source, then test again.
146
+
147
+ ` : ''}---
148
+
149
+ ## Start Now
150
+
151
+ Begin by reading ${task.source_file ?? 'the specification above'} and implementing the task.
152
+ `;
153
+ }
154
+ /**
155
+ * Generate the coder prompt for a batch of tasks
156
+ */
157
+ export function generateBatchCoderPrompt(context) {
158
+ const { tasks, projectPath, sectionName } = context;
159
+ const agentsMd = getAgentsMd(projectPath);
160
+ // Build task specs for each task
161
+ const taskSpecs = tasks.map((task, index) => {
162
+ const sourceContent = getSourceFileContent(projectPath, task.source_file);
163
+ return `
164
+ ### Task ${index + 1}: ${task.title}
165
+ **Task ID:** ${task.id}
166
+ **Spec File:** ${task.source_file ?? '(not specified)'}
167
+
168
+ ${sourceContent}
169
+ `;
170
+ }).join('\n---\n');
171
+ const taskIds = tasks.map(t => t.id);
172
+ return `# STEROIDS BATCH CODER TASK
173
+
174
+ You are a CODER assigned MULTIPLE tasks from section "${sectionName}".
175
+
176
+ **IMPORTANT:** Implement each task IN ORDER, committing after each one.
177
+
178
+ ## Section: ${sectionName}
179
+ **Total Tasks:** ${tasks.length}
180
+ **Project:** ${projectPath}
181
+
182
+ ---
183
+
184
+ ## Project Guidelines
185
+
186
+ ${agentsMd}
187
+
188
+ ---
189
+
190
+ ## TASKS TO IMPLEMENT
191
+
192
+ ${taskSpecs}
193
+
194
+ ---
195
+
196
+ ## YOUR WORKFLOW
197
+
198
+ For EACH task:
199
+ 1. Read the specification
200
+ 2. Implement the feature/fix
201
+ 3. Run tests if applicable
202
+ 4. Commit: \`git add <files> && git commit -m "<type>: <message>"\`
203
+ 5. Output "TASK COMPLETE: <task-id>" when done
204
+ 6. Move to next task
205
+
206
+ **CRITICAL:** Each task MUST have its own commit. The orchestrator will handle status updates.
207
+
208
+ ---
209
+
210
+ ## CRITICAL RULES
211
+
212
+ 1. **NEVER touch .steroids/ directory**
213
+ 2. **BUILD MUST PASS after each task**
214
+ 3. **Commit after EACH task** with a descriptive message
215
+ 4. **DO NOT run \`steroids tasks\` commands** - the orchestrator handles status
216
+
217
+ ---
218
+
219
+ ## TASK IDS
220
+
221
+ ${taskIds.map((id, i) => `- Task ${i + 1}: ${id}`).join('\n')}
222
+
223
+ ---
224
+
225
+ ## Start Now
226
+
227
+ Begin with Task 1 and work through each task in order.
228
+ `;
229
+ }
230
+ /**
231
+ * Generate the coder prompt for resuming partial work
232
+ */
233
+ export function generateResumingCoderPrompt(context) {
234
+ const { task, projectPath, gitStatus, gitDiff, rejectionHistory, coordinatorGuidance } = context;
235
+ const sourceContent = getSourceFileContent(projectPath, task.source_file);
236
+ const fileAnchorSection = buildFileAnchorSection(task);
237
+ // Build rejection section with full history and coordinator guidance (same as normal prompt)
238
+ const rejectionSection = formatRejectionHistoryForCoder(task.id, rejectionHistory, undefined, coordinatorGuidance);
239
+ return `# TASK: ${task.id.substring(0, 8)} - ${task.title} (RESUMING)
240
+ # Status: resuming | Rejections: ${task.rejection_count}/15
241
+
242
+ You are a CODER resuming work on a partially completed task.
243
+
244
+ ---
245
+
246
+ ## Task Information
247
+
248
+ **Task ID:** ${task.id}
249
+ **Title:** ${task.title}
250
+ **Status:** in_progress (resuming)
251
+ **Rejection Count:** ${task.rejection_count}/15
252
+ **Project:** ${projectPath}
253
+ ${fileAnchorSection}
254
+ ---
255
+
256
+ ## Previous Work Detected
257
+
258
+ A previous coder started this task but did not complete it. You may find:
259
+ - Uncommitted changes in the working directory
260
+ - Partial implementations in progress
261
+
262
+ **Git Status:**
263
+ \`\`\`
264
+ ${gitStatus ?? 'No uncommitted changes'}
265
+ \`\`\`
266
+
267
+ **Uncommitted Changes:**
268
+ \`\`\`diff
269
+ ${gitDiff ?? 'No changes'}
270
+ \`\`\`
271
+
272
+ ---
273
+
274
+ ## Your Instructions
275
+
276
+ 1. Review what the previous coder did
277
+ 2. If the work looks good, complete it
278
+ 3. If the work looks wrong, you may start fresh
279
+ 4. Commit all changes when done
280
+ ${rejectionSection}
281
+ ---
282
+
283
+ ## Specification
284
+
285
+ ${sourceContent}
286
+
287
+ ---
288
+
289
+ ## CRITICAL RULES
290
+
291
+ 1. **NEVER touch .steroids/ directory**
292
+ 2. **COMMIT YOUR WORK** when complete
293
+ 3. **Output "TASK COMPLETE"** when done - the orchestrator will submit for review
294
+ 4. **DO NOT run any \`steroids tasks\` commands** - the orchestrator handles all status updates
295
+
296
+ ---
297
+
298
+ ## Complete the Task Now
299
+
300
+ Review the existing work and finish the implementation.
301
+ `;
302
+ }
303
+ //# sourceMappingURL=coder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coder.js","sourceRoot":"","sources":["../../../../src/prompts/coder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACL,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAa7B;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAA2B;IAC7D,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;IAE7G,MAAM,QAAQ,GAAG,WAAW,CAAC,WAAW,CAAC,CAAC;IAC1C,MAAM,aAAa,GAAG,oBAAoB,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAE1E,qEAAqE;IACrE,MAAM,gBAAgB,GAAG,8BAA8B,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC;IAExH,2BAA2B;IAC3B,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACpE,MAAM,iBAAiB,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAEvD,OAAO,WAAW,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,CA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
+ * Shared prompt helper functions
3
+ * Used by coder, reviewer, and coordinator prompts
4
+ */
5
+ import type { Task, RejectionEntry } from '../database/queries.js';
6
+ /**
7
+ * Read AGENTS.md content if present
8
+ */
9
+ export declare function getAgentsMd(projectPath: string): string;
10
+ /**
11
+ * Read source file content if specified
12
+ */
13
+ export declare function getSourceFileContent(projectPath: string, sourceFile?: string | null): string;
14
+ /**
15
+ * Extract first line of rejection notes as a title/summary
16
+ */
17
+ export declare function extractRejectionTitle(notes: string | null | undefined): string;
18
+ /**
19
+ * Detect repeated patterns in rejection history
20
+ * Uses normalized fuzzy matching to catch similar (not just identical) issues
21
+ */
22
+ export declare function detectRejectionPatterns(rejectionHistory: RejectionEntry[]): string;
23
+ /**
24
+ * Extract file paths mentioned in text (task title, spec content)
25
+ * Language-agnostic: matches any path-like pattern with directory separators and file extensions
26
+ */
27
+ export declare function extractFileHints(title: string, specContent: string): string[];
28
+ /**
29
+ * Build a file scope section for the prompt
30
+ */
31
+ export declare function buildFileScopeSection(task: Task, specContent: string): string;
32
+ /**
33
+ * Format rejection history for coder prompt
34
+ * Shows ALL rejection titles for pattern visibility, full details of last 3
35
+ */
36
+ export declare function formatRejectionHistoryForCoder(taskId: string, rejectionHistory?: RejectionEntry[], latestNotes?: string, coordinatorGuidance?: string): string;
37
+ /**
38
+ * Build a file anchor section for the prompt
39
+ * Directs the coder/reviewer to a specific file and line
40
+ */
41
+ export declare function buildFileAnchorSection(task: Task): string;
42
+ export interface SectionTask {
43
+ id: string;
44
+ title: string;
45
+ status: string;
46
+ }
47
+ /**
48
+ * Format other tasks in the same section for context
49
+ */
50
+ export declare function formatSectionTasks(currentTaskId: string, sectionTasks?: SectionTask[]): string;
51
+ //# sourceMappingURL=prompt-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-helpers.d.ts","sourceRoot":"","sources":["../../../../src/prompts/prompt-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,I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readFileSync } from 'node:fs';
6
+ import { join } from 'node:path';
7
+ /**
8
+ * Read AGENTS.md content if present
9
+ */
10
+ export function getAgentsMd(projectPath) {
11
+ const agentsPath = join(projectPath, 'AGENTS.md');
12
+ if (existsSync(agentsPath)) {
13
+ const content = readFileSync(agentsPath, 'utf-8');
14
+ // Truncate if too long (max 5000 chars per spec)
15
+ if (content.length > 5000) {
16
+ return content.substring(0, 5000) + '\n\n[Content truncated]';
17
+ }
18
+ return content;
19
+ }
20
+ return 'No AGENTS.md found. Follow standard coding practices.';
21
+ }
22
+ /**
23
+ * Read source file content if specified
24
+ */
25
+ export function getSourceFileContent(projectPath, sourceFile) {
26
+ if (!sourceFile) {
27
+ return 'No specification file linked.';
28
+ }
29
+ const fullPath = join(projectPath, sourceFile);
30
+ if (!existsSync(fullPath)) {
31
+ return `Specification file not found: ${sourceFile}`;
32
+ }
33
+ const content = readFileSync(fullPath, 'utf-8');
34
+ // Truncate if too long (max 10000 chars per spec)
35
+ if (content.length > 10000) {
36
+ return content.substring(0, 10000) + `\n\n[Content truncated. Full file at: ${sourceFile}]`;
37
+ }
38
+ return content;
39
+ }
40
+ /**
41
+ * Extract first line of rejection notes as a title/summary
42
+ */
43
+ export function extractRejectionTitle(notes) {
44
+ if (!notes)
45
+ return '(no notes)';
46
+ const firstLine = notes.split('\n').find(l => l.trim().length > 0) || '(no notes)';
47
+ // Strip markdown formatting for summary
48
+ return firstLine.replace(/^[-*#\s[\]]+/, '').trim().substring(0, 100);
49
+ }
50
+ /**
51
+ * Normalize text for fuzzy comparison
52
+ * Strips punctuation, lowercases, collapses whitespace
53
+ */
54
+ function normalizeForComparison(text) {
55
+ return text.toLowerCase().replace(/[^a-z0-9\s]/g, '').replace(/\s+/g, ' ').trim();
56
+ }
57
+ /**
58
+ * Detect repeated patterns in rejection history
59
+ * Uses normalized fuzzy matching to catch similar (not just identical) issues
60
+ */
61
+ export function detectRejectionPatterns(rejectionHistory) {
62
+ if (rejectionHistory.length < 3)
63
+ return '';
64
+ // Extract titles and normalize for comparison
65
+ const entries = rejectionHistory.map(r => ({
66
+ title: extractRejectionTitle(r.notes),
67
+ normalized: normalizeForComparison(extractRejectionTitle(r.notes)),
68
+ }));
69
+ // Group by normalized title (catches minor wording variations)
70
+ const groups = new Map();
71
+ for (const entry of entries) {
72
+ const existing = groups.get(entry.normalized);
73
+ if (existing) {
74
+ existing.count++;
75
+ }
76
+ else {
77
+ groups.set(entry.normalized, { title: entry.title, count: 1 });
78
+ }
79
+ }
80
+ // Also check for keyword-level overlap between non-identical entries
81
+ // If 3+ rejections share significant keywords, flag it
82
+ const allNotes = rejectionHistory.map(r => r.notes || '');
83
+ const keywordCounts = new Map();
84
+ for (const note of allNotes) {
85
+ // Extract significant words (4+ chars, not common words)
86
+ const words = new Set(normalizeForComparison(note)
87
+ .split(' ')
88
+ .filter(w => w.length >= 4));
89
+ for (const word of words) {
90
+ keywordCounts.set(word, (keywordCounts.get(word) || 0) + 1);
91
+ }
92
+ }
93
+ const hotKeywords = [...keywordCounts.entries()]
94
+ .filter(([, count]) => count >= 3)
95
+ .filter(([word]) => !['task', 'file', 'code', 'this', 'that', 'should', 'must', 'need'].includes(word))
96
+ .map(([word]) => word);
97
+ const repeated = [...groups.values()].filter(g => g.count >= 3);
98
+ if (repeated.length === 0 && hotKeywords.length === 0)
99
+ return '';
100
+ const lines = [];
101
+ for (const { title, count } of repeated) {
102
+ lines.push(`- "${title}" - raised ${count} times`);
103
+ }
104
+ if (hotKeywords.length > 0 && repeated.length === 0) {
105
+ lines.push(`- Recurring themes: ${hotKeywords.slice(0, 5).join(', ')}`);
106
+ }
107
+ return `
108
+ **PATTERN DETECTED - The following issues keep repeating:**
109
+
110
+ ${lines.join('\n')}
111
+
112
+ If you cannot resolve these, DISPUTE the task instead of resubmitting the same work:
113
+ \`\`\`bash
114
+ steroids dispute create <task-id> --reason "Cannot resolve: <explain why>" --type coder
115
+ \`\`\`
116
+ `;
117
+ }
118
+ /**
119
+ * Extract file paths mentioned in text (task title, spec content)
120
+ * Language-agnostic: matches any path-like pattern with directory separators and file extensions
121
+ */
122
+ export function extractFileHints(title, specContent) {
123
+ const combined = `${title}\n${specContent}`;
124
+ // Match any path with at least one directory separator and a file extension (1-10 chars)
125
+ // Examples: src/foo.ts, lib/utils/helpers.py, app/models/user.rb, pkg/api/handler.go
126
+ const filePattern = /(?:^|\s|`|"|'|\()([\w][\w.-]*(?:\/[\w.-]+)+\.\w{1,10})/gm;
127
+ const matches = new Set();
128
+ let match;
129
+ while ((match = filePattern.exec(combined)) !== null) {
130
+ const path = match[1];
131
+ // Filter out URLs, version numbers, and common false positives
132
+ if (path.includes('://') || /^\d+\.\d+\.\d+/.test(path) || path.includes('node_modules/')) {
133
+ continue;
134
+ }
135
+ matches.add(path);
136
+ }
137
+ return [...matches];
138
+ }
139
+ /**
140
+ * Build a file scope section for the prompt
141
+ */
142
+ export function buildFileScopeSection(task, specContent) {
143
+ const fileHints = extractFileHints(task.title, specContent);
144
+ if (fileHints.length === 0)
145
+ return '';
146
+ return `
147
+ ---
148
+
149
+ ## FILE SCOPE
150
+
151
+ Based on the task specification, these files are likely relevant:
152
+ ${fileHints.map(f => `- \`${f}\``).join('\n')}
153
+
154
+ **Focus your changes on these files.** If you find yourself modifying unrelated files, STOP and re-read the specification.
155
+
156
+ `;
157
+ }
158
+ /**
159
+ * Format rejection history for coder prompt
160
+ * Shows ALL rejection titles for pattern visibility, full details of last 3
161
+ */
162
+ export function formatRejectionHistoryForCoder(taskId, rejectionHistory, latestNotes, coordinatorGuidance) {
163
+ if (!rejectionHistory || rejectionHistory.length === 0) {
164
+ return '';
165
+ }
166
+ const latest = rejectionHistory[rejectionHistory.length - 1];
167
+ const latestCommitRef = latest.commit_sha ? ` (commit: ${latest.commit_sha.substring(0, 7)})` : '';
168
+ // Show ALL rejection titles for pattern visibility
169
+ const rejectionTitlesList = rejectionHistory.map(r => `${r.rejection_number}. ${extractRejectionTitle(r.notes)}`).join('\n');
170
+ // Show full details of last 3 rejections
171
+ const detailedRejections = rejectionHistory.length > 3
172
+ ? rejectionHistory.slice(-3)
173
+ : rejectionHistory;
174
+ const detailedLines = detailedRejections.map(r => {
175
+ const commitRef = r.commit_sha ? ` (commit: ${r.commit_sha.substring(0, 7)})` : '';
176
+ return `### Rejection #${r.rejection_number}${commitRef}
177
+ ${r.notes || '(no detailed notes)'}
178
+ `;
179
+ });
180
+ // Detect patterns
181
+ const patternWarning = detectRejectionPatterns(rejectionHistory);
182
+ // Coordinator guidance section (injected after 2nd rejection)
183
+ const coordinatorSection = coordinatorGuidance ? `
184
+ ---
185
+
186
+ ## COORDINATOR GUIDANCE
187
+
188
+ A coordinator has reviewed the rejection history and provides this guidance:
189
+
190
+ ${coordinatorGuidance}
191
+
192
+ **Follow the coordinator's guidance above. It takes priority over conflicting reviewer feedback.**
193
+
194
+ ` : '';
195
+ return `
196
+ ---
197
+
198
+ ## REJECTION HISTORY (${rejectionHistory.length} total, max 15)
199
+
200
+ ${rejectionTitlesList}
201
+
202
+ ${patternWarning}
203
+ ---
204
+
205
+ ## LATEST REJECTION${latestCommitRef}
206
+
207
+ **ADDRESS EACH CHECKBOX BELOW:**
208
+
209
+ ${latest.notes || '(no notes)'}
210
+
211
+ ---
212
+ ${detailedLines.length > 1 ? `## Previous Rejections (for context)\n\n${detailedLines.slice(0, -1).join('\n---\n')}` : ''}
213
+ ${coordinatorSection}---
214
+
215
+ ## BEFORE SUBMITTING
216
+
217
+ 1. For each \`- [ ]\` item in the rejection:
218
+ - Open the file mentioned
219
+ - Make the exact change requested
220
+ - Verify the fix works
221
+
222
+ 2. Run the build and tests:
223
+ - The project must build successfully
224
+ - Tests must pass (if the project has tests)
225
+
226
+ 3. Commit your changes and output "TASK COMPLETE" - the orchestrator will submit for review
227
+
228
+ **DO NOT submit until you have addressed EVERY checkbox in the rejection notes.**
229
+ **DO NOT run any CLI commands - the orchestrator handles all status updates.**
230
+
231
+ If you believe the reviewer is wrong or the requirement is impossible, dispute:
232
+ \`\`\`bash
233
+ steroids dispute create ${taskId} --reason "explanation" --type coder
234
+ \`\`\`
235
+ `;
236
+ }
237
+ /**
238
+ * Build a file anchor section for the prompt
239
+ * Directs the coder/reviewer to a specific file and line
240
+ */
241
+ export function buildFileAnchorSection(task) {
242
+ if (!task.file_path)
243
+ return '';
244
+ const lineRef = task.file_line ? `:${task.file_line}` : '';
245
+ const commitShort = task.file_commit_sha?.substring(0, 7) ?? 'unknown';
246
+ return `
247
+ ## FILE ANCHOR
248
+
249
+ **This task is anchored to a specific location in the codebase:**
250
+
251
+ - **File:** \`${task.file_path}${lineRef}\`
252
+ ${task.file_line ? `- **Line:** ${task.file_line}\n` : ''}- **Commit:** \`${commitShort}\`
253
+
254
+ Start your investigation at this file${task.file_line ? ' and line' : ''}. Use \`git show ${commitShort}:${task.file_path}\` to see the version when this task was created.
255
+
256
+ ---
257
+ `;
258
+ }
259
+ const MAX_SECTION_TASKS = 15;
260
+ /**
261
+ * Format other tasks in the same section for context
262
+ */
263
+ export function formatSectionTasks(currentTaskId, sectionTasks) {
264
+ if (!sectionTasks || sectionTasks.length <= 1) {
265
+ return '';
266
+ }
267
+ const statusEmoji = {
268
+ 'pending': '\u23F3',
269
+ 'in_progress': '\uD83D\uDD04',
270
+ 'review': '\uD83D\uDC40',
271
+ 'completed': '\u2705',
272
+ };
273
+ const otherTasks = sectionTasks.filter(t => t.id !== currentTaskId);
274
+ const tasksToShow = otherTasks.slice(0, MAX_SECTION_TASKS);
275
+ const remainingCount = otherTasks.length - tasksToShow.length;
276
+ const lines = tasksToShow.map(t => {
277
+ const emoji = statusEmoji[t.status] || '\u2753';
278
+ const marker = t.status === 'completed' ? ' (done)' : t.status === 'pending' ? ' (pending)' : '';
279
+ return `- ${emoji} ${t.title}${marker}`;
280
+ });
281
+ if (remainingCount > 0) {
282
+ lines.push(`- ... and ${remainingCount} more task${remainingCount > 1 ? 's' : ''}`);
283
+ }
284
+ if (lines.length === 0)
285
+ return '';
286
+ return `
287
+ ---
288
+
289
+ ## Other Tasks in This Section
290
+
291
+ **IMPORTANT:** The task you are reviewing is ONE of several tasks implementing this feature.
292
+ Do NOT reject this task for issues that are explicitly listed as separate tasks below.
293
+ Focus ONLY on whether THIS task's scope is correctly implemented.
294
+
295
+ ${lines.join('\n')}
296
+
297
+ `;
298
+ }
299
+ //# sourceMappingURL=prompt-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-helpers.js","sourceRoot":"","sources":["../../../../src/prompts/prompt-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,WAAmB;IAC7C,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAClD,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAClD,iDAAiD;QACjD,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;YAC1B,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,yBAAyB,CAAC;QAChE,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,uDAAuD,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,WAAmB,EACnB,UAA0B;IAE1B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,+BAA+B,CAAC;IACzC,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAC/C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,OAAO,iCAAiC,UAAU,EAAE,CAAC;IACvD,CAAC;I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