olympus-ai 1.0.0

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 (573) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +691 -0
  3. package/dist/__tests__/example.test.d.ts +2 -0
  4. package/dist/__tests__/example.test.d.ts.map +1 -0
  5. package/dist/__tests__/example.test.js +20 -0
  6. package/dist/__tests__/example.test.js.map +1 -0
  7. package/dist/__tests__/hooks.test.d.ts +2 -0
  8. package/dist/__tests__/hooks.test.d.ts.map +1 -0
  9. package/dist/__tests__/hooks.test.js +644 -0
  10. package/dist/__tests__/hooks.test.js.map +1 -0
  11. package/dist/__tests__/installer.test.d.ts +2 -0
  12. package/dist/__tests__/installer.test.d.ts.map +1 -0
  13. package/dist/__tests__/installer.test.js +369 -0
  14. package/dist/__tests__/installer.test.js.map +1 -0
  15. package/dist/__tests__/model-routing.test.d.ts +2 -0
  16. package/dist/__tests__/model-routing.test.d.ts.map +1 -0
  17. package/dist/__tests__/model-routing.test.js +814 -0
  18. package/dist/__tests__/model-routing.test.js.map +1 -0
  19. package/dist/__tests__/skills.test.d.ts +2 -0
  20. package/dist/__tests__/skills.test.d.ts.map +1 -0
  21. package/dist/__tests__/skills.test.js +126 -0
  22. package/dist/__tests__/skills.test.js.map +1 -0
  23. package/dist/__tests__/types.test.d.ts +2 -0
  24. package/dist/__tests__/types.test.d.ts.map +1 -0
  25. package/dist/__tests__/types.test.js +77 -0
  26. package/dist/__tests__/types.test.js.map +1 -0
  27. package/dist/agents/definitions.d.ts +105 -0
  28. package/dist/agents/definitions.d.ts.map +1 -0
  29. package/dist/agents/definitions.js +1379 -0
  30. package/dist/agents/definitions.js.map +1 -0
  31. package/dist/agents/document-writer.d.ts +11 -0
  32. package/dist/agents/document-writer.d.ts.map +1 -0
  33. package/dist/agents/document-writer.js +209 -0
  34. package/dist/agents/document-writer.js.map +1 -0
  35. package/dist/agents/explore.d.ts +12 -0
  36. package/dist/agents/explore.d.ts.map +1 -0
  37. package/dist/agents/explore.js +103 -0
  38. package/dist/agents/explore.js.map +1 -0
  39. package/dist/agents/frontend-engineer.d.ts +11 -0
  40. package/dist/agents/frontend-engineer.d.ts.map +1 -0
  41. package/dist/agents/frontend-engineer.js +115 -0
  42. package/dist/agents/frontend-engineer.js.map +1 -0
  43. package/dist/agents/index.d.ts +21 -0
  44. package/dist/agents/index.d.ts.map +1 -0
  45. package/dist/agents/index.js +27 -0
  46. package/dist/agents/index.js.map +1 -0
  47. package/dist/agents/librarian.d.ts +12 -0
  48. package/dist/agents/librarian.d.ts.map +1 -0
  49. package/dist/agents/librarian.js +103 -0
  50. package/dist/agents/librarian.js.map +1 -0
  51. package/dist/agents/metis.d.ts +12 -0
  52. package/dist/agents/metis.d.ts.map +1 -0
  53. package/dist/agents/metis.js +117 -0
  54. package/dist/agents/metis.js.map +1 -0
  55. package/dist/agents/momus.d.ts +12 -0
  56. package/dist/agents/momus.d.ts.map +1 -0
  57. package/dist/agents/momus.js +128 -0
  58. package/dist/agents/momus.js.map +1 -0
  59. package/dist/agents/multimodal-looker.d.ts +11 -0
  60. package/dist/agents/multimodal-looker.d.ts.map +1 -0
  61. package/dist/agents/multimodal-looker.js +70 -0
  62. package/dist/agents/multimodal-looker.js.map +1 -0
  63. package/dist/agents/olympian.d.ts +12 -0
  64. package/dist/agents/olympian.d.ts.map +1 -0
  65. package/dist/agents/olympian.js +93 -0
  66. package/dist/agents/olympian.js.map +1 -0
  67. package/dist/agents/oracle.d.ts +13 -0
  68. package/dist/agents/oracle.d.ts.map +1 -0
  69. package/dist/agents/oracle.js +191 -0
  70. package/dist/agents/oracle.js.map +1 -0
  71. package/dist/agents/orchestrator-olympus.d.ts +11 -0
  72. package/dist/agents/orchestrator-olympus.d.ts.map +1 -0
  73. package/dist/agents/orchestrator-olympus.js +115 -0
  74. package/dist/agents/orchestrator-olympus.js.map +1 -0
  75. package/dist/agents/orchestrator-sisyphus.d.ts +11 -0
  76. package/dist/agents/orchestrator-sisyphus.d.ts.map +1 -0
  77. package/dist/agents/orchestrator-sisyphus.js +115 -0
  78. package/dist/agents/orchestrator-sisyphus.js.map +1 -0
  79. package/dist/agents/prometheus.d.ts +12 -0
  80. package/dist/agents/prometheus.d.ts.map +1 -0
  81. package/dist/agents/prometheus.js +156 -0
  82. package/dist/agents/prometheus.js.map +1 -0
  83. package/dist/agents/qa-tester.d.ts +16 -0
  84. package/dist/agents/qa-tester.d.ts.map +1 -0
  85. package/dist/agents/qa-tester.js +367 -0
  86. package/dist/agents/qa-tester.js.map +1 -0
  87. package/dist/agents/sisyphus-junior.d.ts +12 -0
  88. package/dist/agents/sisyphus-junior.d.ts.map +1 -0
  89. package/dist/agents/sisyphus-junior.js +93 -0
  90. package/dist/agents/sisyphus-junior.js.map +1 -0
  91. package/dist/agents/types.d.ts +120 -0
  92. package/dist/agents/types.d.ts.map +1 -0
  93. package/dist/agents/types.js +38 -0
  94. package/dist/agents/types.js.map +1 -0
  95. package/dist/agents/utils.d.ts +49 -0
  96. package/dist/agents/utils.d.ts.map +1 -0
  97. package/dist/agents/utils.js +164 -0
  98. package/dist/agents/utils.js.map +1 -0
  99. package/dist/cli/index.d.ts +13 -0
  100. package/dist/cli/index.d.ts.map +1 -0
  101. package/dist/cli/index.js +496 -0
  102. package/dist/cli/index.js.map +1 -0
  103. package/dist/commands/index.d.ts +78 -0
  104. package/dist/commands/index.d.ts.map +1 -0
  105. package/dist/commands/index.js +148 -0
  106. package/dist/commands/index.js.map +1 -0
  107. package/dist/config/index.d.ts +5 -0
  108. package/dist/config/index.d.ts.map +1 -0
  109. package/dist/config/index.js +5 -0
  110. package/dist/config/index.js.map +1 -0
  111. package/dist/config/loader.d.ts +49 -0
  112. package/dist/config/loader.d.ts.map +1 -0
  113. package/dist/config/loader.js +380 -0
  114. package/dist/config/loader.js.map +1 -0
  115. package/dist/features/auto-update.d.ts +187 -0
  116. package/dist/features/auto-update.d.ts.map +1 -0
  117. package/dist/features/auto-update.js +539 -0
  118. package/dist/features/auto-update.js.map +1 -0
  119. package/dist/features/background-agent/concurrency.d.ts +53 -0
  120. package/dist/features/background-agent/concurrency.d.ts.map +1 -0
  121. package/dist/features/background-agent/concurrency.js +121 -0
  122. package/dist/features/background-agent/concurrency.js.map +1 -0
  123. package/dist/features/background-agent/index.d.ts +12 -0
  124. package/dist/features/background-agent/index.d.ts.map +1 -0
  125. package/dist/features/background-agent/index.js +12 -0
  126. package/dist/features/background-agent/index.js.map +1 -0
  127. package/dist/features/background-agent/manager.d.ts +134 -0
  128. package/dist/features/background-agent/manager.d.ts.map +1 -0
  129. package/dist/features/background-agent/manager.js +412 -0
  130. package/dist/features/background-agent/manager.js.map +1 -0
  131. package/dist/features/background-agent/types.d.ts +99 -0
  132. package/dist/features/background-agent/types.d.ts.map +1 -0
  133. package/dist/features/background-agent/types.js +9 -0
  134. package/dist/features/background-agent/types.js.map +1 -0
  135. package/dist/features/background-tasks.d.ts +99 -0
  136. package/dist/features/background-tasks.d.ts.map +1 -0
  137. package/dist/features/background-tasks.js +265 -0
  138. package/dist/features/background-tasks.js.map +1 -0
  139. package/dist/features/boulder-state/constants.d.ts +20 -0
  140. package/dist/features/boulder-state/constants.d.ts.map +1 -0
  141. package/dist/features/boulder-state/constants.js +20 -0
  142. package/dist/features/boulder-state/constants.js.map +1 -0
  143. package/dist/features/boulder-state/index.d.ts +12 -0
  144. package/dist/features/boulder-state/index.d.ts.map +1 -0
  145. package/dist/features/boulder-state/index.js +13 -0
  146. package/dist/features/boulder-state/index.js.map +1 -0
  147. package/dist/features/boulder-state/storage.d.ts +58 -0
  148. package/dist/features/boulder-state/storage.d.ts.map +1 -0
  149. package/dist/features/boulder-state/storage.js +174 -0
  150. package/dist/features/boulder-state/storage.js.map +1 -0
  151. package/dist/features/boulder-state/types.d.ts +48 -0
  152. package/dist/features/boulder-state/types.d.ts.map +1 -0
  153. package/dist/features/boulder-state/types.js +10 -0
  154. package/dist/features/boulder-state/types.js.map +1 -0
  155. package/dist/features/builtin-skills/index.d.ts +10 -0
  156. package/dist/features/builtin-skills/index.d.ts.map +1 -0
  157. package/dist/features/builtin-skills/index.js +10 -0
  158. package/dist/features/builtin-skills/index.js.map +1 -0
  159. package/dist/features/builtin-skills/skills.d.ts +21 -0
  160. package/dist/features/builtin-skills/skills.d.ts.map +1 -0
  161. package/dist/features/builtin-skills/skills.js +1082 -0
  162. package/dist/features/builtin-skills/skills.js.map +1 -0
  163. package/dist/features/builtin-skills/types.d.ts +60 -0
  164. package/dist/features/builtin-skills/types.d.ts.map +1 -0
  165. package/dist/features/builtin-skills/types.js +9 -0
  166. package/dist/features/builtin-skills/types.js.map +1 -0
  167. package/dist/features/context-injector/collector.d.ts +56 -0
  168. package/dist/features/context-injector/collector.d.ts.map +1 -0
  169. package/dist/features/context-injector/collector.js +122 -0
  170. package/dist/features/context-injector/collector.js.map +1 -0
  171. package/dist/features/context-injector/index.d.ts +12 -0
  172. package/dist/features/context-injector/index.d.ts.map +1 -0
  173. package/dist/features/context-injector/index.js +13 -0
  174. package/dist/features/context-injector/index.js.map +1 -0
  175. package/dist/features/context-injector/injector.d.ts +47 -0
  176. package/dist/features/context-injector/injector.d.ts.map +1 -0
  177. package/dist/features/context-injector/injector.js +103 -0
  178. package/dist/features/context-injector/injector.js.map +1 -0
  179. package/dist/features/context-injector/types.d.ts +103 -0
  180. package/dist/features/context-injector/types.d.ts.map +1 -0
  181. package/dist/features/context-injector/types.js +11 -0
  182. package/dist/features/context-injector/types.js.map +1 -0
  183. package/dist/features/continuation-enforcement.d.ts +36 -0
  184. package/dist/features/continuation-enforcement.d.ts.map +1 -0
  185. package/dist/features/continuation-enforcement.js +175 -0
  186. package/dist/features/continuation-enforcement.js.map +1 -0
  187. package/dist/features/index.d.ts +12 -0
  188. package/dist/features/index.d.ts.map +1 -0
  189. package/dist/features/index.js +49 -0
  190. package/dist/features/index.js.map +1 -0
  191. package/dist/features/magic-keywords.d.ts +28 -0
  192. package/dist/features/magic-keywords.d.ts.map +1 -0
  193. package/dist/features/magic-keywords.js +421 -0
  194. package/dist/features/magic-keywords.js.map +1 -0
  195. package/dist/features/model-routing/index.d.ts +34 -0
  196. package/dist/features/model-routing/index.d.ts.map +1 -0
  197. package/dist/features/model-routing/index.js +48 -0
  198. package/dist/features/model-routing/index.js.map +1 -0
  199. package/dist/features/model-routing/prompts/haiku.d.ts +54 -0
  200. package/dist/features/model-routing/prompts/haiku.d.ts.map +1 -0
  201. package/dist/features/model-routing/prompts/haiku.js +141 -0
  202. package/dist/features/model-routing/prompts/haiku.js.map +1 -0
  203. package/dist/features/model-routing/prompts/index.d.ts +45 -0
  204. package/dist/features/model-routing/prompts/index.d.ts.map +1 -0
  205. package/dist/features/model-routing/prompts/index.js +116 -0
  206. package/dist/features/model-routing/prompts/index.js.map +1 -0
  207. package/dist/features/model-routing/prompts/opus.d.ts +34 -0
  208. package/dist/features/model-routing/prompts/opus.d.ts.map +1 -0
  209. package/dist/features/model-routing/prompts/opus.js +153 -0
  210. package/dist/features/model-routing/prompts/opus.js.map +1 -0
  211. package/dist/features/model-routing/prompts/sonnet.d.ts +38 -0
  212. package/dist/features/model-routing/prompts/sonnet.d.ts.map +1 -0
  213. package/dist/features/model-routing/prompts/sonnet.js +149 -0
  214. package/dist/features/model-routing/prompts/sonnet.js.map +1 -0
  215. package/dist/features/model-routing/router.d.ts +92 -0
  216. package/dist/features/model-routing/router.d.ts.map +1 -0
  217. package/dist/features/model-routing/router.js +267 -0
  218. package/dist/features/model-routing/router.js.map +1 -0
  219. package/dist/features/model-routing/rules.d.ts +32 -0
  220. package/dist/features/model-routing/rules.d.ts.map +1 -0
  221. package/dist/features/model-routing/rules.js +224 -0
  222. package/dist/features/model-routing/rules.js.map +1 -0
  223. package/dist/features/model-routing/scorer.d.ts +35 -0
  224. package/dist/features/model-routing/scorer.d.ts.map +1 -0
  225. package/dist/features/model-routing/scorer.js +241 -0
  226. package/dist/features/model-routing/scorer.js.map +1 -0
  227. package/dist/features/model-routing/signals.d.ts +26 -0
  228. package/dist/features/model-routing/signals.d.ts.map +1 -0
  229. package/dist/features/model-routing/signals.js +283 -0
  230. package/dist/features/model-routing/signals.js.map +1 -0
  231. package/dist/features/model-routing/types.d.ts +195 -0
  232. package/dist/features/model-routing/types.d.ts.map +1 -0
  233. package/dist/features/model-routing/types.js +86 -0
  234. package/dist/features/model-routing/types.js.map +1 -0
  235. package/dist/hooks/agent-usage-reminder/constants.d.ts +17 -0
  236. package/dist/hooks/agent-usage-reminder/constants.d.ts.map +1 -0
  237. package/dist/hooks/agent-usage-reminder/constants.js +58 -0
  238. package/dist/hooks/agent-usage-reminder/constants.js.map +1 -0
  239. package/dist/hooks/agent-usage-reminder/index.d.ts +36 -0
  240. package/dist/hooks/agent-usage-reminder/index.d.ts.map +1 -0
  241. package/dist/hooks/agent-usage-reminder/index.js +89 -0
  242. package/dist/hooks/agent-usage-reminder/index.js.map +1 -0
  243. package/dist/hooks/agent-usage-reminder/storage.d.ts +12 -0
  244. package/dist/hooks/agent-usage-reminder/storage.d.ts.map +1 -0
  245. package/dist/hooks/agent-usage-reminder/storage.js +39 -0
  246. package/dist/hooks/agent-usage-reminder/storage.js.map +1 -0
  247. package/dist/hooks/agent-usage-reminder/types.d.ts +14 -0
  248. package/dist/hooks/agent-usage-reminder/types.d.ts.map +1 -0
  249. package/dist/hooks/agent-usage-reminder/types.js +9 -0
  250. package/dist/hooks/agent-usage-reminder/types.js.map +1 -0
  251. package/dist/hooks/ascent-verifier/index.d.ts +72 -0
  252. package/dist/hooks/ascent-verifier/index.d.ts.map +1 -0
  253. package/dist/hooks/ascent-verifier/index.js +223 -0
  254. package/dist/hooks/ascent-verifier/index.js.map +1 -0
  255. package/dist/hooks/auto-slash-command/constants.d.ts +19 -0
  256. package/dist/hooks/auto-slash-command/constants.d.ts.map +1 -0
  257. package/dist/hooks/auto-slash-command/constants.js +28 -0
  258. package/dist/hooks/auto-slash-command/constants.js.map +1 -0
  259. package/dist/hooks/auto-slash-command/detector.d.ts +33 -0
  260. package/dist/hooks/auto-slash-command/detector.d.ts.map +1 -0
  261. package/dist/hooks/auto-slash-command/detector.js +73 -0
  262. package/dist/hooks/auto-slash-command/detector.js.map +1 -0
  263. package/dist/hooks/auto-slash-command/executor.d.ts +29 -0
  264. package/dist/hooks/auto-slash-command/executor.d.ts.map +1 -0
  265. package/dist/hooks/auto-slash-command/executor.js +214 -0
  266. package/dist/hooks/auto-slash-command/executor.js.map +1 -0
  267. package/dist/hooks/auto-slash-command/index.d.ts +53 -0
  268. package/dist/hooks/auto-slash-command/index.d.ts.map +1 -0
  269. package/dist/hooks/auto-slash-command/index.js +105 -0
  270. package/dist/hooks/auto-slash-command/index.js.map +1 -0
  271. package/dist/hooks/auto-slash-command/types.d.ts +77 -0
  272. package/dist/hooks/auto-slash-command/types.d.ts.map +1 -0
  273. package/dist/hooks/auto-slash-command/types.js +9 -0
  274. package/dist/hooks/auto-slash-command/types.js.map +1 -0
  275. package/dist/hooks/background-notification/index.d.ts +60 -0
  276. package/dist/hooks/background-notification/index.d.ts.map +1 -0
  277. package/dist/hooks/background-notification/index.js +180 -0
  278. package/dist/hooks/background-notification/index.js.map +1 -0
  279. package/dist/hooks/background-notification/types.d.ts +64 -0
  280. package/dist/hooks/background-notification/types.d.ts.map +1 -0
  281. package/dist/hooks/background-notification/types.js +8 -0
  282. package/dist/hooks/background-notification/types.js.map +1 -0
  283. package/dist/hooks/bridge.d.ts +68 -0
  284. package/dist/hooks/bridge.d.ts.map +1 -0
  285. package/dist/hooks/bridge.js +321 -0
  286. package/dist/hooks/bridge.js.map +1 -0
  287. package/dist/hooks/comment-checker/constants.d.ts +28 -0
  288. package/dist/hooks/comment-checker/constants.d.ts.map +1 -0
  289. package/dist/hooks/comment-checker/constants.js +189 -0
  290. package/dist/hooks/comment-checker/constants.js.map +1 -0
  291. package/dist/hooks/comment-checker/filters.d.ts +39 -0
  292. package/dist/hooks/comment-checker/filters.d.ts.map +1 -0
  293. package/dist/hooks/comment-checker/filters.js +126 -0
  294. package/dist/hooks/comment-checker/filters.js.map +1 -0
  295. package/dist/hooks/comment-checker/index.d.ts +58 -0
  296. package/dist/hooks/comment-checker/index.d.ts.map +1 -0
  297. package/dist/hooks/comment-checker/index.js +298 -0
  298. package/dist/hooks/comment-checker/index.js.map +1 -0
  299. package/dist/hooks/comment-checker/types.d.ts +88 -0
  300. package/dist/hooks/comment-checker/types.d.ts.map +1 -0
  301. package/dist/hooks/comment-checker/types.js +9 -0
  302. package/dist/hooks/comment-checker/types.js.map +1 -0
  303. package/dist/hooks/context-window-limit-recovery/constants.d.ts +28 -0
  304. package/dist/hooks/context-window-limit-recovery/constants.d.ts.map +1 -0
  305. package/dist/hooks/context-window-limit-recovery/constants.js +85 -0
  306. package/dist/hooks/context-window-limit-recovery/constants.js.map +1 -0
  307. package/dist/hooks/context-window-limit-recovery/index.d.ts +62 -0
  308. package/dist/hooks/context-window-limit-recovery/index.d.ts.map +1 -0
  309. package/dist/hooks/context-window-limit-recovery/index.js +201 -0
  310. package/dist/hooks/context-window-limit-recovery/index.js.map +1 -0
  311. package/dist/hooks/context-window-limit-recovery/parser.d.ts +31 -0
  312. package/dist/hooks/context-window-limit-recovery/parser.d.ts.map +1 -0
  313. package/dist/hooks/context-window-limit-recovery/parser.js +241 -0
  314. package/dist/hooks/context-window-limit-recovery/parser.js.map +1 -0
  315. package/dist/hooks/context-window-limit-recovery/types.d.ts +84 -0
  316. package/dist/hooks/context-window-limit-recovery/types.d.ts.map +1 -0
  317. package/dist/hooks/context-window-limit-recovery/types.js +34 -0
  318. package/dist/hooks/context-window-limit-recovery/types.js.map +1 -0
  319. package/dist/hooks/directory-readme-injector/constants.d.ts +15 -0
  320. package/dist/hooks/directory-readme-injector/constants.d.ts.map +1 -0
  321. package/dist/hooks/directory-readme-injector/constants.js +17 -0
  322. package/dist/hooks/directory-readme-injector/constants.js.map +1 -0
  323. package/dist/hooks/directory-readme-injector/index.d.ts +41 -0
  324. package/dist/hooks/directory-readme-injector/index.d.ts.map +1 -0
  325. package/dist/hooks/directory-readme-injector/index.js +162 -0
  326. package/dist/hooks/directory-readme-injector/index.js.map +1 -0
  327. package/dist/hooks/directory-readme-injector/storage.d.ts +20 -0
  328. package/dist/hooks/directory-readme-injector/storage.d.ts.map +1 -0
  329. package/dist/hooks/directory-readme-injector/storage.js +56 -0
  330. package/dist/hooks/directory-readme-injector/storage.js.map +1 -0
  331. package/dist/hooks/directory-readme-injector/types.d.ts +20 -0
  332. package/dist/hooks/directory-readme-injector/types.d.ts.map +1 -0
  333. package/dist/hooks/directory-readme-injector/types.js +9 -0
  334. package/dist/hooks/directory-readme-injector/types.js.map +1 -0
  335. package/dist/hooks/edit-error-recovery/index.d.ts +62 -0
  336. package/dist/hooks/edit-error-recovery/index.d.ts.map +1 -0
  337. package/dist/hooks/edit-error-recovery/index.js +89 -0
  338. package/dist/hooks/edit-error-recovery/index.js.map +1 -0
  339. package/dist/hooks/empty-message-sanitizer/constants.d.ts +33 -0
  340. package/dist/hooks/empty-message-sanitizer/constants.d.ts.map +1 -0
  341. package/dist/hooks/empty-message-sanitizer/constants.js +37 -0
  342. package/dist/hooks/empty-message-sanitizer/constants.js.map +1 -0
  343. package/dist/hooks/empty-message-sanitizer/index.d.ts +59 -0
  344. package/dist/hooks/empty-message-sanitizer/index.d.ts.map +1 -0
  345. package/dist/hooks/empty-message-sanitizer/index.js +171 -0
  346. package/dist/hooks/empty-message-sanitizer/index.js.map +1 -0
  347. package/dist/hooks/empty-message-sanitizer/types.d.ts +79 -0
  348. package/dist/hooks/empty-message-sanitizer/types.d.ts.map +1 -0
  349. package/dist/hooks/empty-message-sanitizer/types.js +10 -0
  350. package/dist/hooks/empty-message-sanitizer/types.js.map +1 -0
  351. package/dist/hooks/index.d.ts +35 -0
  352. package/dist/hooks/index.d.ts.map +1 -0
  353. package/dist/hooks/index.js +81 -0
  354. package/dist/hooks/index.js.map +1 -0
  355. package/dist/hooks/keyword-detector/index.d.ts +40 -0
  356. package/dist/hooks/keyword-detector/index.d.ts.map +1 -0
  357. package/dist/hooks/keyword-detector/index.js +88 -0
  358. package/dist/hooks/keyword-detector/index.js.map +1 -0
  359. package/dist/hooks/non-interactive-env/constants.d.ts +35 -0
  360. package/dist/hooks/non-interactive-env/constants.d.ts.map +1 -0
  361. package/dist/hooks/non-interactive-env/constants.js +69 -0
  362. package/dist/hooks/non-interactive-env/constants.js.map +1 -0
  363. package/dist/hooks/non-interactive-env/detector.d.ts +2 -0
  364. package/dist/hooks/non-interactive-env/detector.d.ts.map +1 -0
  365. package/dist/hooks/non-interactive-env/detector.js +16 -0
  366. package/dist/hooks/non-interactive-env/detector.js.map +1 -0
  367. package/dist/hooks/non-interactive-env/index.d.ts +14 -0
  368. package/dist/hooks/non-interactive-env/index.d.ts.map +1 -0
  369. package/dist/hooks/non-interactive-env/index.js +72 -0
  370. package/dist/hooks/non-interactive-env/index.js.map +1 -0
  371. package/dist/hooks/non-interactive-env/types.d.ts +14 -0
  372. package/dist/hooks/non-interactive-env/types.d.ts.map +1 -0
  373. package/dist/hooks/non-interactive-env/types.js +2 -0
  374. package/dist/hooks/non-interactive-env/types.js.map +1 -0
  375. package/dist/hooks/olympus-orchestrator/constants.d.ts +23 -0
  376. package/dist/hooks/olympus-orchestrator/constants.d.ts.map +1 -0
  377. package/dist/hooks/olympus-orchestrator/constants.js +142 -0
  378. package/dist/hooks/olympus-orchestrator/constants.js.map +1 -0
  379. package/dist/hooks/olympus-orchestrator/index.d.ts +113 -0
  380. package/dist/hooks/olympus-orchestrator/index.d.ts.map +1 -0
  381. package/dist/hooks/olympus-orchestrator/index.js +283 -0
  382. package/dist/hooks/olympus-orchestrator/index.js.map +1 -0
  383. package/dist/hooks/persistent-mode/index.d.ts +40 -0
  384. package/dist/hooks/persistent-mode/index.d.ts.map +1 -0
  385. package/dist/hooks/persistent-mode/index.js +322 -0
  386. package/dist/hooks/persistent-mode/index.js.map +1 -0
  387. package/dist/hooks/plugin-patterns/index.d.ts +107 -0
  388. package/dist/hooks/plugin-patterns/index.d.ts.map +1 -0
  389. package/dist/hooks/plugin-patterns/index.js +289 -0
  390. package/dist/hooks/plugin-patterns/index.js.map +1 -0
  391. package/dist/hooks/preemptive-compaction/constants.d.ts +48 -0
  392. package/dist/hooks/preemptive-compaction/constants.d.ts.map +1 -0
  393. package/dist/hooks/preemptive-compaction/constants.js +90 -0
  394. package/dist/hooks/preemptive-compaction/constants.js.map +1 -0
  395. package/dist/hooks/preemptive-compaction/index.d.ts +55 -0
  396. package/dist/hooks/preemptive-compaction/index.d.ts.map +1 -0
  397. package/dist/hooks/preemptive-compaction/index.js +227 -0
  398. package/dist/hooks/preemptive-compaction/index.js.map +1 -0
  399. package/dist/hooks/preemptive-compaction/types.d.ts +76 -0
  400. package/dist/hooks/preemptive-compaction/types.d.ts.map +1 -0
  401. package/dist/hooks/preemptive-compaction/types.js +9 -0
  402. package/dist/hooks/preemptive-compaction/types.js.map +1 -0
  403. package/dist/hooks/ralph-loop/index.d.ts +60 -0
  404. package/dist/hooks/ralph-loop/index.d.ts.map +1 -0
  405. package/dist/hooks/ralph-loop/index.js +155 -0
  406. package/dist/hooks/ralph-loop/index.js.map +1 -0
  407. package/dist/hooks/ralph-verifier/index.d.ts +72 -0
  408. package/dist/hooks/ralph-verifier/index.d.ts.map +1 -0
  409. package/dist/hooks/ralph-verifier/index.js +223 -0
  410. package/dist/hooks/ralph-verifier/index.js.map +1 -0
  411. package/dist/hooks/rules-injector/constants.d.ts +25 -0
  412. package/dist/hooks/rules-injector/constants.d.ts.map +1 -0
  413. package/dist/hooks/rules-injector/constants.js +40 -0
  414. package/dist/hooks/rules-injector/constants.js.map +1 -0
  415. package/dist/hooks/rules-injector/finder.d.ts +24 -0
  416. package/dist/hooks/rules-injector/finder.d.ts.map +1 -0
  417. package/dist/hooks/rules-injector/finder.js +215 -0
  418. package/dist/hooks/rules-injector/finder.js.map +1 -0
  419. package/dist/hooks/rules-injector/index.d.ts +45 -0
  420. package/dist/hooks/rules-injector/index.d.ts.map +1 -0
  421. package/dist/hooks/rules-injector/index.js +187 -0
  422. package/dist/hooks/rules-injector/index.js.map +1 -0
  423. package/dist/hooks/rules-injector/matcher.d.ts +25 -0
  424. package/dist/hooks/rules-injector/matcher.d.ts.map +1 -0
  425. package/dist/hooks/rules-injector/matcher.js +70 -0
  426. package/dist/hooks/rules-injector/matcher.js.map +1 -0
  427. package/dist/hooks/rules-injector/parser.d.ts +20 -0
  428. package/dist/hooks/rules-injector/parser.d.ts.map +1 -0
  429. package/dist/hooks/rules-injector/parser.js +179 -0
  430. package/dist/hooks/rules-injector/parser.js.map +1 -0
  431. package/dist/hooks/rules-injector/storage.d.ts +26 -0
  432. package/dist/hooks/rules-injector/storage.d.ts.map +1 -0
  433. package/dist/hooks/rules-injector/storage.js +61 -0
  434. package/dist/hooks/rules-injector/storage.js.map +1 -0
  435. package/dist/hooks/rules-injector/types.d.ts +101 -0
  436. package/dist/hooks/rules-injector/types.d.ts.map +1 -0
  437. package/dist/hooks/rules-injector/types.js +10 -0
  438. package/dist/hooks/rules-injector/types.js.map +1 -0
  439. package/dist/hooks/session-recovery/constants.d.ts +56 -0
  440. package/dist/hooks/session-recovery/constants.d.ts.map +1 -0
  441. package/dist/hooks/session-recovery/constants.js +78 -0
  442. package/dist/hooks/session-recovery/constants.js.map +1 -0
  443. package/dist/hooks/session-recovery/index.d.ts +53 -0
  444. package/dist/hooks/session-recovery/index.d.ts.map +1 -0
  445. package/dist/hooks/session-recovery/index.js +321 -0
  446. package/dist/hooks/session-recovery/index.js.map +1 -0
  447. package/dist/hooks/session-recovery/storage.d.ts +76 -0
  448. package/dist/hooks/session-recovery/storage.d.ts.map +1 -0
  449. package/dist/hooks/session-recovery/storage.js +383 -0
  450. package/dist/hooks/session-recovery/storage.js.map +1 -0
  451. package/dist/hooks/session-recovery/types.d.ts +145 -0
  452. package/dist/hooks/session-recovery/types.d.ts.map +1 -0
  453. package/dist/hooks/session-recovery/types.js +8 -0
  454. package/dist/hooks/session-recovery/types.js.map +1 -0
  455. package/dist/hooks/sisyphus-orchestrator/constants.d.ts +23 -0
  456. package/dist/hooks/sisyphus-orchestrator/constants.d.ts.map +1 -0
  457. package/dist/hooks/sisyphus-orchestrator/constants.js +142 -0
  458. package/dist/hooks/sisyphus-orchestrator/constants.js.map +1 -0
  459. package/dist/hooks/sisyphus-orchestrator/index.d.ts +113 -0
  460. package/dist/hooks/sisyphus-orchestrator/index.d.ts.map +1 -0
  461. package/dist/hooks/sisyphus-orchestrator/index.js +283 -0
  462. package/dist/hooks/sisyphus-orchestrator/index.js.map +1 -0
  463. package/dist/hooks/the-ascent/index.d.ts +60 -0
  464. package/dist/hooks/the-ascent/index.d.ts.map +1 -0
  465. package/dist/hooks/the-ascent/index.js +155 -0
  466. package/dist/hooks/the-ascent/index.js.map +1 -0
  467. package/dist/hooks/think-mode/detector.d.ts +28 -0
  468. package/dist/hooks/think-mode/detector.d.ts.map +1 -0
  469. package/dist/hooks/think-mode/detector.js +105 -0
  470. package/dist/hooks/think-mode/detector.js.map +1 -0
  471. package/dist/hooks/think-mode/index.d.ts +70 -0
  472. package/dist/hooks/think-mode/index.d.ts.map +1 -0
  473. package/dist/hooks/think-mode/index.js +144 -0
  474. package/dist/hooks/think-mode/index.js.map +1 -0
  475. package/dist/hooks/think-mode/switcher.d.ts +39 -0
  476. package/dist/hooks/think-mode/switcher.d.ts.map +1 -0
  477. package/dist/hooks/think-mode/switcher.js +180 -0
  478. package/dist/hooks/think-mode/switcher.js.map +1 -0
  479. package/dist/hooks/think-mode/types.d.ts +60 -0
  480. package/dist/hooks/think-mode/types.d.ts.map +1 -0
  481. package/dist/hooks/think-mode/types.js +9 -0
  482. package/dist/hooks/think-mode/types.js.map +1 -0
  483. package/dist/hooks/thinking-block-validator/constants.d.ts +37 -0
  484. package/dist/hooks/thinking-block-validator/constants.d.ts.map +1 -0
  485. package/dist/hooks/thinking-block-validator/constants.js +50 -0
  486. package/dist/hooks/thinking-block-validator/constants.js.map +1 -0
  487. package/dist/hooks/thinking-block-validator/index.d.ts +35 -0
  488. package/dist/hooks/thinking-block-validator/index.d.ts.map +1 -0
  489. package/dist/hooks/thinking-block-validator/index.js +156 -0
  490. package/dist/hooks/thinking-block-validator/index.js.map +1 -0
  491. package/dist/hooks/thinking-block-validator/types.d.ts +67 -0
  492. package/dist/hooks/thinking-block-validator/types.d.ts.map +1 -0
  493. package/dist/hooks/thinking-block-validator/types.js +9 -0
  494. package/dist/hooks/thinking-block-validator/types.js.map +1 -0
  495. package/dist/hooks/todo-continuation/index.d.ts +39 -0
  496. package/dist/hooks/todo-continuation/index.d.ts.map +1 -0
  497. package/dist/hooks/todo-continuation/index.js +140 -0
  498. package/dist/hooks/todo-continuation/index.js.map +1 -0
  499. package/dist/hooks/ultrawork-state/index.d.ts +60 -0
  500. package/dist/hooks/ultrawork-state/index.d.ts.map +1 -0
  501. package/dist/hooks/ultrawork-state/index.js +207 -0
  502. package/dist/hooks/ultrawork-state/index.js.map +1 -0
  503. package/dist/index.d.ts +117 -0
  504. package/dist/index.d.ts.map +1 -0
  505. package/dist/index.js +175 -0
  506. package/dist/index.js.map +1 -0
  507. package/dist/installer/hooks.d.ts +196 -0
  508. package/dist/installer/hooks.d.ts.map +1 -0
  509. package/dist/installer/hooks.js +1385 -0
  510. package/dist/installer/hooks.js.map +1 -0
  511. package/dist/installer/index.d.ts +92 -0
  512. package/dist/installer/index.d.ts.map +1 -0
  513. package/dist/installer/index.js +2249 -0
  514. package/dist/installer/index.js.map +1 -0
  515. package/dist/mcp/index.d.ts +6 -0
  516. package/dist/mcp/index.d.ts.map +1 -0
  517. package/dist/mcp/index.js +5 -0
  518. package/dist/mcp/index.js.map +1 -0
  519. package/dist/mcp/servers.d.ts +77 -0
  520. package/dist/mcp/servers.d.ts.map +1 -0
  521. package/dist/mcp/servers.js +122 -0
  522. package/dist/mcp/servers.js.map +1 -0
  523. package/dist/shared/index.d.ts +5 -0
  524. package/dist/shared/index.d.ts.map +1 -0
  525. package/dist/shared/index.js +5 -0
  526. package/dist/shared/index.js.map +1 -0
  527. package/dist/shared/types.d.ts +159 -0
  528. package/dist/shared/types.d.ts.map +1 -0
  529. package/dist/shared/types.js +5 -0
  530. package/dist/shared/types.js.map +1 -0
  531. package/dist/tools/ast-tools.d.ts +63 -0
  532. package/dist/tools/ast-tools.d.ts.map +1 -0
  533. package/dist/tools/ast-tools.js +450 -0
  534. package/dist/tools/ast-tools.js.map +1 -0
  535. package/dist/tools/index.d.ts +52 -0
  536. package/dist/tools/index.d.ts.map +1 -0
  537. package/dist/tools/index.js +120 -0
  538. package/dist/tools/index.js.map +1 -0
  539. package/dist/tools/lsp/client.d.ts +201 -0
  540. package/dist/tools/lsp/client.d.ts.map +1 -0
  541. package/dist/tools/lsp/client.js +454 -0
  542. package/dist/tools/lsp/client.js.map +1 -0
  543. package/dist/tools/lsp/index.d.ts +9 -0
  544. package/dist/tools/lsp/index.d.ts.map +1 -0
  545. package/dist/tools/lsp/index.js +7 -0
  546. package/dist/tools/lsp/index.js.map +1 -0
  547. package/dist/tools/lsp/servers.d.ts +37 -0
  548. package/dist/tools/lsp/servers.d.ts.map +1 -0
  549. package/dist/tools/lsp/servers.js +149 -0
  550. package/dist/tools/lsp/servers.js.map +1 -0
  551. package/dist/tools/lsp/utils.d.ts +58 -0
  552. package/dist/tools/lsp/utils.d.ts.map +1 -0
  553. package/dist/tools/lsp/utils.js +236 -0
  554. package/dist/tools/lsp/utils.js.map +1 -0
  555. package/dist/tools/lsp-tools.d.ts +151 -0
  556. package/dist/tools/lsp-tools.d.ts.map +1 -0
  557. package/dist/tools/lsp-tools.js +358 -0
  558. package/dist/tools/lsp-tools.js.map +1 -0
  559. package/package.json +85 -0
  560. package/scripts/claude-sisyphus.sh +9 -0
  561. package/scripts/install.sh +1774 -0
  562. package/scripts/keyword-detector.mjs +209 -0
  563. package/scripts/keyword-detector.sh +71 -0
  564. package/scripts/persistent-mode.mjs +241 -0
  565. package/scripts/persistent-mode.sh +300 -0
  566. package/scripts/post-tool-verifier.mjs +217 -0
  567. package/scripts/post-tool-verifier.sh +196 -0
  568. package/scripts/pre-tool-enforcer.mjs +99 -0
  569. package/scripts/pre-tool-enforcer.sh +76 -0
  570. package/scripts/sisyphus-aliases.sh +18 -0
  571. package/scripts/stop-continuation.sh +31 -0
  572. package/scripts/test-pr25.sh +525 -0
  573. package/scripts/uninstall.sh +171 -0
@@ -0,0 +1,265 @@
1
+ /**
2
+ * Background Task Management
3
+ *
4
+ * Provides utilities for managing background task execution,
5
+ * similar to oh-my-opencode's Background Task Manager.
6
+ *
7
+ * In Claude Code, background execution is controlled via:
8
+ * - Bash tool's `run_in_background` parameter
9
+ * - Task tool's `run_in_background` parameter
10
+ * - TaskOutput tool for retrieving results
11
+ *
12
+ * This module provides:
13
+ * - Decision heuristics for when to use background execution
14
+ * - Task lifecycle management
15
+ * - Concurrency limit enforcement
16
+ * - System prompt guidance for agents
17
+ */
18
+ /**
19
+ * Default maximum concurrent background tasks
20
+ */
21
+ export const DEFAULT_MAX_BACKGROUND_TASKS = 5;
22
+ /**
23
+ * Patterns that indicate long-running operations
24
+ * These should typically run in background
25
+ */
26
+ export const LONG_RUNNING_PATTERNS = [
27
+ // Package managers
28
+ /\b(npm|yarn|pnpm|bun)\s+(install|ci|update|upgrade)\b/i,
29
+ /\b(pip|pip3)\s+install\b/i,
30
+ /\bcargo\s+(build|install|test)\b/i,
31
+ /\bgo\s+(build|install|test)\b/i,
32
+ /\brustup\s+(update|install)\b/i,
33
+ /\bgem\s+install\b/i,
34
+ /\bcomposer\s+install\b/i,
35
+ /\bmaven|mvn\s+(install|package|test)\b/i,
36
+ /\bgradle\s+(build|test)\b/i,
37
+ // Build commands
38
+ /\b(npm|yarn|pnpm|bun)\s+run\s+(build|compile|bundle)\b/i,
39
+ /\bmake\s*(all|build|install)?\s*$/i,
40
+ /\bcmake\s+--build\b/i,
41
+ /\btsc\s+(--build|-b)?\b/i,
42
+ /\bwebpack\b/i,
43
+ /\brollup\b/i,
44
+ /\besbuild\b/i,
45
+ /\bvite\s+build\b/i,
46
+ // Test suites
47
+ /\b(npm|yarn|pnpm|bun)\s+run\s+test\b/i,
48
+ /\b(jest|mocha|vitest|pytest|cargo\s+test)\b/i,
49
+ /\bgo\s+test\b/i,
50
+ // Docker operations
51
+ /\bdocker\s+(build|pull|push)\b/i,
52
+ /\bdocker-compose\s+(up|build)\b/i,
53
+ // Database operations
54
+ /\b(prisma|typeorm|sequelize)\s+(migrate|generate|push)\b/i,
55
+ // Linting large codebases
56
+ /\b(eslint|prettier)\s+[^|]*\.\s*$/i,
57
+ // Git operations on large repos
58
+ /\bgit\s+(clone|fetch|pull)\b/i,
59
+ ];
60
+ /**
61
+ * Patterns that should always run blocking (foreground)
62
+ * These are quick operations or need immediate feedback
63
+ */
64
+ export const BLOCKING_PATTERNS = [
65
+ // Quick status checks
66
+ /\bgit\s+(status|diff|log|branch)\b/i,
67
+ /\bls\b/i,
68
+ /\bpwd\b/i,
69
+ /\bcat\b/i,
70
+ /\becho\b/i,
71
+ /\bhead\b/i,
72
+ /\btail\b/i,
73
+ /\bwc\b/i,
74
+ /\bwhich\b/i,
75
+ /\btype\b/i,
76
+ // File operations
77
+ /\bcp\b/i,
78
+ /\bmv\b/i,
79
+ /\brm\b/i,
80
+ /\bmkdir\b/i,
81
+ /\btouch\b/i,
82
+ // Environment checks
83
+ /\benv\b/i,
84
+ /\bprintenv\b/i,
85
+ /\bnode\s+-[vpe]\b/i,
86
+ /\bnpm\s+-v\b/i,
87
+ /\bpython\s+--version\b/i,
88
+ ];
89
+ /**
90
+ * Determine if a command should run in background
91
+ *
92
+ * This is the core heuristic function that decides whether a command
93
+ * should be executed with `run_in_background: true`.
94
+ *
95
+ * @param command - The command to analyze
96
+ * @param currentBackgroundCount - Number of currently running background tasks
97
+ * @param maxBackgroundTasks - Maximum allowed concurrent background tasks
98
+ * @returns Decision object with recommendation and reasoning
99
+ */
100
+ export function shouldRunInBackground(command, currentBackgroundCount = 0, maxBackgroundTasks = DEFAULT_MAX_BACKGROUND_TASKS) {
101
+ // Check if at capacity
102
+ if (currentBackgroundCount >= maxBackgroundTasks) {
103
+ return {
104
+ runInBackground: false,
105
+ reason: `At background task limit (${currentBackgroundCount}/${maxBackgroundTasks}). Wait for existing tasks or run blocking.`,
106
+ estimatedDuration: 'unknown',
107
+ confidence: 'high'
108
+ };
109
+ }
110
+ // Check for explicit blocking patterns first
111
+ for (const pattern of BLOCKING_PATTERNS) {
112
+ if (pattern.test(command)) {
113
+ return {
114
+ runInBackground: false,
115
+ reason: 'Quick operation that should complete immediately.',
116
+ estimatedDuration: 'quick',
117
+ confidence: 'high'
118
+ };
119
+ }
120
+ }
121
+ // Check for long-running patterns
122
+ for (const pattern of LONG_RUNNING_PATTERNS) {
123
+ if (pattern.test(command)) {
124
+ return {
125
+ runInBackground: true,
126
+ reason: 'Long-running operation detected. Run in background to continue other work.',
127
+ estimatedDuration: 'long',
128
+ confidence: 'high'
129
+ };
130
+ }
131
+ }
132
+ // Heuristic: commands with multiple operations (piped or chained)
133
+ if ((command.match(/\|/g) || []).length > 2 || (command.match(/&&/g) || []).length > 2) {
134
+ return {
135
+ runInBackground: true,
136
+ reason: 'Complex command chain that may take time.',
137
+ estimatedDuration: 'medium',
138
+ confidence: 'medium'
139
+ };
140
+ }
141
+ // Default: run blocking for unknown commands
142
+ return {
143
+ runInBackground: false,
144
+ reason: 'Unknown command type. Running blocking for immediate feedback.',
145
+ estimatedDuration: 'unknown',
146
+ confidence: 'low'
147
+ };
148
+ }
149
+ /**
150
+ * Create a BackgroundTaskManager instance
151
+ */
152
+ export function createBackgroundTaskManager(state, config) {
153
+ const maxBackgroundTasks = config.permissions?.maxBackgroundTasks ?? DEFAULT_MAX_BACKGROUND_TASKS;
154
+ return {
155
+ registerTask(agentName, prompt) {
156
+ const task = {
157
+ id: `task_${Date.now()}_${Math.random().toString(36).slice(2, 11)}`,
158
+ agentName,
159
+ prompt,
160
+ status: 'pending'
161
+ };
162
+ state.backgroundTasks.push(task);
163
+ return task;
164
+ },
165
+ getTasks() {
166
+ return [...state.backgroundTasks];
167
+ },
168
+ getTasksByStatus(status) {
169
+ return state.backgroundTasks.filter(t => t.status === status);
170
+ },
171
+ getRunningCount() {
172
+ return state.backgroundTasks.filter(t => t.status === 'running' || t.status === 'pending').length;
173
+ },
174
+ canStartNewTask() {
175
+ return this.getRunningCount() < maxBackgroundTasks;
176
+ },
177
+ updateTaskStatus(taskId, status, result, error) {
178
+ const task = state.backgroundTasks.find(t => t.id === taskId);
179
+ if (task) {
180
+ task.status = status;
181
+ if (result !== undefined)
182
+ task.result = result;
183
+ if (error !== undefined)
184
+ task.error = error;
185
+ }
186
+ },
187
+ completeTask(taskId, result) {
188
+ this.updateTaskStatus(taskId, 'completed', result);
189
+ },
190
+ failTask(taskId, error) {
191
+ this.updateTaskStatus(taskId, 'error', undefined, error);
192
+ },
193
+ pruneCompletedTasks(_maxAge = 5 * 60 * 1000) {
194
+ // Note: maxAge-based pruning would require tracking task completion timestamps
195
+ // For now, just prune all completed/errored tasks
196
+ const before = state.backgroundTasks.length;
197
+ state.backgroundTasks = state.backgroundTasks.filter(t => t.status !== 'completed' && t.status !== 'error');
198
+ return before - state.backgroundTasks.length;
199
+ },
200
+ getMaxTasks() {
201
+ return maxBackgroundTasks;
202
+ },
203
+ shouldRunInBackground(command) {
204
+ return shouldRunInBackground(command, this.getRunningCount(), maxBackgroundTasks);
205
+ }
206
+ };
207
+ }
208
+ /**
209
+ * System prompt guidance for background task execution
210
+ *
211
+ * This text should be appended to the system prompt to guide agents
212
+ * on when and how to use background execution.
213
+ */
214
+ export function getBackgroundTaskGuidance(maxBackgroundTasks = DEFAULT_MAX_BACKGROUND_TASKS) {
215
+ return `
216
+ ## Background Task Execution
217
+
218
+ For long-running operations, use the \`run_in_background\` parameter to avoid blocking.
219
+
220
+ ### When to Use Background Execution
221
+
222
+ **Run in Background** (set \`run_in_background: true\`):
223
+ - Package installation: \`npm install\`, \`pip install\`, \`cargo build\`
224
+ - Build processes: \`npm run build\`, \`make\`, \`tsc\`
225
+ - Test suites: \`npm test\`, \`pytest\`, \`cargo test\`
226
+ - Docker operations: \`docker build\`, \`docker pull\`
227
+ - Git operations on large repos: \`git clone\`, \`git fetch\`
228
+ - Database migrations: \`prisma migrate\`, \`typeorm migration:run\`
229
+
230
+ **Run Blocking** (foreground, immediate):
231
+ - Quick status checks: \`git status\`, \`ls\`, \`pwd\`
232
+ - File operations: \`cat\`, \`head\`, \`tail\`
233
+ - Simple commands: \`echo\`, \`which\`, \`env\`
234
+ - Operations needing immediate feedback
235
+
236
+ ### How to Use Background Execution
237
+
238
+ 1. **Start in background:**
239
+ \`\`\`
240
+ Bash(command: "npm run build", run_in_background: true)
241
+ \`\`\`
242
+
243
+ 2. **Continue with other work** while the task runs
244
+
245
+ 3. **Check results later:**
246
+ \`\`\`
247
+ TaskOutput(task_id: "<task_id_from_step_1>", block: false)
248
+ \`\`\`
249
+
250
+ ### Concurrency Limits
251
+
252
+ - Maximum **${maxBackgroundTasks}** concurrent background tasks
253
+ - If at limit, wait for existing tasks to complete or run the new task blocking
254
+ - Use \`TaskOutput\` to check if background tasks have finished
255
+
256
+ ### Decision Checklist
257
+
258
+ Before running a command, ask:
259
+ 1. Will this take more than 5 seconds? → Consider background
260
+ 2. Do I need the result immediately? → Run blocking
261
+ 3. Can I do other useful work while waiting? → Use background
262
+ 4. Am I at the background task limit? → Run blocking or wait
263
+ `;
264
+ }
265
+ //# sourceMappingURL=background-tasks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"background-tasks.js","sourceRoot":"","sources":["../../src/features/background-tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,mBAAmB;IACnB,wDAAwD;IACxD,2BAA2B;IAC3B,mCAAmC;IACnC,gCAAgC;IAChC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,CAAC,CAAC;QACrD,CAAC;QAED,QAAQ,CAAC,MAAc,EAAE,KAAa;YACpC,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAC3D,CAAC;QAED,mBAAmB,CAAC,UAAkB,CAAC,GAAG,EAAE,GAAG,IAAI;YACjD,+EAA+E;YAC/E,kDAAkD;YAClD,MAAM,MAAM,GAAG,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC;YAC5C,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CACvD,CAAC,CAAC,MAAM,KAAK,WAAW,IAAI,CAAC,CAAC,MAAM,KAAK,OAAO,CACjD,CAAC;YACF,OAAO,MAAM,GAAG,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC;QAC/C,CAAC;QAED,WAAW;YACT,OAAO,kBAAkB,CAAC;QAC5B,CAAC;QAED,qBAAqB,CAAC,OAAe;YACnC,OAAO,qBAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,EAAE,kBAAkB,CAAC,CAAC;QACpF,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,qBAA6B,4BAA4B;IACjG,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAqCK,kBAAkB;;;;;;;;;;;CAW/B,CAAC;AACF,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Boulder State Constants
3
+ *
4
+ * Ported from oh-my-opencode's boulder-state.
5
+ */
6
+ /** Olympus state directory */
7
+ export declare const BOULDER_DIR = ".olympus";
8
+ /** Boulder state file name */
9
+ export declare const BOULDER_FILE = "boulder.json";
10
+ /** Full path pattern for boulder state */
11
+ export declare const BOULDER_STATE_PATH = ".olympus/boulder.json";
12
+ /** Notepad directory for learnings */
13
+ export declare const NOTEPAD_DIR = "notepads";
14
+ /** Full path for notepads */
15
+ export declare const NOTEPAD_BASE_PATH = ".olympus/notepads";
16
+ /** Prometheus plan directory */
17
+ export declare const PROMETHEUS_PLANS_DIR = ".olympus/plans";
18
+ /** Plan file extension */
19
+ export declare const PLAN_EXTENSION = ".md";
20
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/features/boulder-state/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,8BAA8B;AAC9B,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC,8BAA8B;AAC9B,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAE3C,0CAA0C;AAC1C,eAAO,MAAM,kBAAkB,0BAAmC,CAAC;AAEnE,sCAAsC;AACtC,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC,6BAA6B;AAC7B,eAAO,MAAM,iBAAiB,sBAAkC,CAAC;AAEjE,gCAAgC;AAChC,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAErD,0BAA0B;AAC1B,eAAO,MAAM,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Boulder State Constants
3
+ *
4
+ * Ported from oh-my-opencode's boulder-state.
5
+ */
6
+ /** Olympus state directory */
7
+ export const BOULDER_DIR = '.olympus';
8
+ /** Boulder state file name */
9
+ export const BOULDER_FILE = 'boulder.json';
10
+ /** Full path pattern for boulder state */
11
+ export const BOULDER_STATE_PATH = `${BOULDER_DIR}/${BOULDER_FILE}`;
12
+ /** Notepad directory for learnings */
13
+ export const NOTEPAD_DIR = 'notepads';
14
+ /** Full path for notepads */
15
+ export const NOTEPAD_BASE_PATH = `${BOULDER_DIR}/${NOTEPAD_DIR}`;
16
+ /** Prometheus plan directory */
17
+ export const PROMETHEUS_PLANS_DIR = '.olympus/plans';
18
+ /** Plan file extension */
19
+ export const PLAN_EXTENSION = '.md';
20
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/features/boulder-state/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,8BAA8B;AAC9B,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAEtC,8BAA8B;AAC9B,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAE3C,0CAA0C;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,WAAW,IAAI,YAAY,EAAE,CAAC;AAEnE,sCAAsC;AACtC,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC;AAEtC,6BAA6B;AAC7B,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,WAAW,IAAI,WAAW,EAAE,CAAC;AAEjE,gCAAgC;AAChC,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAErD,0BAA0B;AAC1B,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Boulder State Module
3
+ *
4
+ * Manages the active work plan state for Olympus orchestrator.
5
+ * Named after Olympus's boulder - the eternal task that must be rolled.
6
+ *
7
+ * Ported from oh-my-opencode's boulder-state.
8
+ */
9
+ export type { BoulderState, PlanProgress, PlanSummary } from './types.js';
10
+ export { BOULDER_DIR, BOULDER_FILE, BOULDER_STATE_PATH, NOTEPAD_DIR, NOTEPAD_BASE_PATH, PROMETHEUS_PLANS_DIR, PLAN_EXTENSION } from './constants.js';
11
+ export { getBoulderFilePath, readBoulderState, writeBoulderState, appendSessionId, clearBoulderState, findPrometheusPlans, getPlanProgress, getPlanName, createBoulderState, getPlanSummaries, hasBoulder, getActivePlanPath } from './storage.js';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/boulder-state/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EAClB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Boulder State Module
3
+ *
4
+ * Manages the active work plan state for Olympus orchestrator.
5
+ * Named after Olympus's boulder - the eternal task that must be rolled.
6
+ *
7
+ * Ported from oh-my-opencode's boulder-state.
8
+ */
9
+ // Constants
10
+ export { BOULDER_DIR, BOULDER_FILE, BOULDER_STATE_PATH, NOTEPAD_DIR, NOTEPAD_BASE_PATH, PROMETHEUS_PLANS_DIR, PLAN_EXTENSION } from './constants.js';
11
+ // Storage operations
12
+ export { getBoulderFilePath, readBoulderState, writeBoulderState, appendSessionId, clearBoulderState, findPrometheusPlans, getPlanProgress, getPlanName, createBoulderState, getPlanSummaries, hasBoulder, getActivePlanPath } from './storage.js';
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/boulder-state/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH,YAAY;AACZ,OAAO,EACL,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACf,MAAM,gBAAgB,CAAC;AAExB,qBAAqB;AACrB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EAClB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Boulder State Storage
3
+ *
4
+ * Handles reading/writing boulder.json for active plan tracking.
5
+ *
6
+ * Ported from oh-my-opencode's boulder-state.
7
+ */
8
+ import type { BoulderState, PlanProgress, PlanSummary } from './types.js';
9
+ /**
10
+ * Get the full path to the boulder state file
11
+ */
12
+ export declare function getBoulderFilePath(directory: string): string;
13
+ /**
14
+ * Read boulder state from disk
15
+ */
16
+ export declare function readBoulderState(directory: string): BoulderState | null;
17
+ /**
18
+ * Write boulder state to disk
19
+ */
20
+ export declare function writeBoulderState(directory: string, state: BoulderState): boolean;
21
+ /**
22
+ * Append a session ID to the boulder state
23
+ */
24
+ export declare function appendSessionId(directory: string, sessionId: string): BoulderState | null;
25
+ /**
26
+ * Clear boulder state (delete the file)
27
+ */
28
+ export declare function clearBoulderState(directory: string): boolean;
29
+ /**
30
+ * Find Prometheus plan files for this project.
31
+ * Prometheus stores plans at: {project}/.olympus/plans/{name}.md
32
+ */
33
+ export declare function findPrometheusPlans(directory: string): string[];
34
+ /**
35
+ * Parse a plan file and count checkbox progress.
36
+ */
37
+ export declare function getPlanProgress(planPath: string): PlanProgress;
38
+ /**
39
+ * Extract plan name from file path.
40
+ */
41
+ export declare function getPlanName(planPath: string): string;
42
+ /**
43
+ * Create a new boulder state for a plan.
44
+ */
45
+ export declare function createBoulderState(planPath: string, sessionId: string): BoulderState;
46
+ /**
47
+ * Get summaries of all available plans
48
+ */
49
+ export declare function getPlanSummaries(directory: string): PlanSummary[];
50
+ /**
51
+ * Check if a boulder is currently active
52
+ */
53
+ export declare function hasBoulder(directory: string): boolean;
54
+ /**
55
+ * Get the active plan path from boulder state
56
+ */
57
+ export declare function getActivePlanPath(directory: string): string | null;
58
+ //# sourceMappingURL=storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["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 * Handles reading/writing boulder.json for active plan tracking.
5
+ *
6
+ * Ported from oh-my-opencode's boulder-state.
7
+ */
8
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync, statSync, unlinkSync } from 'fs';
9
+ import { dirname, join, basename } from 'path';
10
+ import { BOULDER_DIR, BOULDER_FILE, PROMETHEUS_PLANS_DIR, PLAN_EXTENSION } from './constants.js';
11
+ /**
12
+ * Get the full path to the boulder state file
13
+ */
14
+ export function getBoulderFilePath(directory) {
15
+ return join(directory, BOULDER_DIR, BOULDER_FILE);
16
+ }
17
+ /**
18
+ * Read boulder state from disk
19
+ */
20
+ export function readBoulderState(directory) {
21
+ const filePath = getBoulderFilePath(directory);
22
+ if (!existsSync(filePath)) {
23
+ return null;
24
+ }
25
+ try {
26
+ const content = readFileSync(filePath, 'utf-8');
27
+ return JSON.parse(content);
28
+ }
29
+ catch {
30
+ return null;
31
+ }
32
+ }
33
+ /**
34
+ * Write boulder state to disk
35
+ */
36
+ export function writeBoulderState(directory, state) {
37
+ const filePath = getBoulderFilePath(directory);
38
+ try {
39
+ const dir = dirname(filePath);
40
+ if (!existsSync(dir)) {
41
+ mkdirSync(dir, { recursive: true });
42
+ }
43
+ writeFileSync(filePath, JSON.stringify(state, null, 2), 'utf-8');
44
+ return true;
45
+ }
46
+ catch {
47
+ return false;
48
+ }
49
+ }
50
+ /**
51
+ * Append a session ID to the boulder state
52
+ */
53
+ export function appendSessionId(directory, sessionId) {
54
+ const state = readBoulderState(directory);
55
+ if (!state)
56
+ return null;
57
+ if (!state.session_ids.includes(sessionId)) {
58
+ state.session_ids.push(sessionId);
59
+ if (writeBoulderState(directory, state)) {
60
+ return state;
61
+ }
62
+ }
63
+ return state;
64
+ }
65
+ /**
66
+ * Clear boulder state (delete the file)
67
+ */
68
+ export function clearBoulderState(directory) {
69
+ const filePath = getBoulderFilePath(directory);
70
+ try {
71
+ if (existsSync(filePath)) {
72
+ unlinkSync(filePath);
73
+ }
74
+ return true;
75
+ }
76
+ catch {
77
+ return false;
78
+ }
79
+ }
80
+ /**
81
+ * Find Prometheus plan files for this project.
82
+ * Prometheus stores plans at: {project}/.olympus/plans/{name}.md
83
+ */
84
+ export function findPrometheusPlans(directory) {
85
+ const plansDir = join(directory, PROMETHEUS_PLANS_DIR);
86
+ if (!existsSync(plansDir)) {
87
+ return [];
88
+ }
89
+ try {
90
+ const files = readdirSync(plansDir);
91
+ return files
92
+ .filter((f) => f.endsWith(PLAN_EXTENSION))
93
+ .map((f) => join(plansDir, f))
94
+ .sort((a, b) => {
95
+ // Sort by modification time, newest first
96
+ const aStat = statSync(a);
97
+ const bStat = statSync(b);
98
+ return bStat.mtimeMs - aStat.mtimeMs;
99
+ });
100
+ }
101
+ catch {
102
+ return [];
103
+ }
104
+ }
105
+ /**
106
+ * Parse a plan file and count checkbox progress.
107
+ */
108
+ export function getPlanProgress(planPath) {
109
+ if (!existsSync(planPath)) {
110
+ return { total: 0, completed: 0, isComplete: true };
111
+ }
112
+ try {
113
+ const content = readFileSync(planPath, 'utf-8');
114
+ // Match markdown checkboxes: - [ ] or - [x] or - [X]
115
+ const uncheckedMatches = content.match(/^[-*]\s*\[\s*\]/gm) || [];
116
+ const checkedMatches = content.match(/^[-*]\s*\[[xX]\]/gm) || [];
117
+ const total = uncheckedMatches.length + checkedMatches.length;
118
+ const completed = checkedMatches.length;
119
+ return {
120
+ total,
121
+ completed,
122
+ isComplete: total === 0 || completed === total,
123
+ };
124
+ }
125
+ catch {
126
+ return { total: 0, completed: 0, isComplete: true };
127
+ }
128
+ }
129
+ /**
130
+ * Extract plan name from file path.
131
+ */
132
+ export function getPlanName(planPath) {
133
+ return basename(planPath, PLAN_EXTENSION);
134
+ }
135
+ /**
136
+ * Create a new boulder state for a plan.
137
+ */
138
+ export function createBoulderState(planPath, sessionId) {
139
+ return {
140
+ active_plan: planPath,
141
+ started_at: new Date().toISOString(),
142
+ session_ids: [sessionId],
143
+ plan_name: getPlanName(planPath),
144
+ };
145
+ }
146
+ /**
147
+ * Get summaries of all available plans
148
+ */
149
+ export function getPlanSummaries(directory) {
150
+ const plans = findPrometheusPlans(directory);
151
+ return plans.map((planPath) => {
152
+ const stat = statSync(planPath);
153
+ return {
154
+ path: planPath,
155
+ name: getPlanName(planPath),
156
+ progress: getPlanProgress(planPath),
157
+ lastModified: new Date(stat.mtimeMs),
158
+ };
159
+ });
160
+ }
161
+ /**
162
+ * Check if a boulder is currently active
163
+ */
164
+ export function hasBoulder(directory) {
165
+ return readBoulderState(directory) !== null;
166
+ }
167
+ /**
168
+ * Get the active plan path from boulder state
169
+ */
170
+ export function getActivePlanPath(directory) {
171
+ const state = readBoulderState(directory);
172
+ return state?.active_plan ?? null;
173
+ }
174
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/features/boulder-state/storage.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC3G,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjG;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,OAAO,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAE/C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,YA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AAC,QAAQ,EAAE,EAAE;QAC5B,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAChC,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC;YAC3B,QAAQ,EAAE,eAAe,CAAC,QAAQ,CAAC;YACnC,YAAY,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;SACrC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB;IAC1C,OAAO,gBAAgB,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,MAAM,KAAK,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC1C,OAAO,KAAK,EAAE,WAAW,IAAI,IAAI,CAAC;AACpC,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Boulder State Types
3
+ *
4
+ * Manages the active work plan state for Olympus orchestrator.
5
+ * Named after Olympus's boulder - the eternal task that must be rolled.
6
+ *
7
+ * Ported from oh-my-opencode's boulder-state.
8
+ */
9
+ /**
10
+ * State tracking for an active work plan
11
+ */
12
+ export interface BoulderState {
13
+ /** Absolute path to the active plan file */
14
+ active_plan: string;
15
+ /** ISO timestamp when work started */
16
+ started_at: string;
17
+ /** Session IDs that have worked on this plan */
18
+ session_ids: string[];
19
+ /** Plan name derived from filename */
20
+ plan_name: string;
21
+ /** Optional metadata */
22
+ metadata?: Record<string, unknown>;
23
+ }
24
+ /**
25
+ * Progress tracking for a plan's checkboxes
26
+ */
27
+ export interface PlanProgress {
28
+ /** Total number of checkboxes */
29
+ total: number;
30
+ /** Number of completed checkboxes */
31
+ completed: number;
32
+ /** Whether all tasks are done */
33
+ isComplete: boolean;
34
+ }
35
+ /**
36
+ * Summary of available plans
37
+ */
38
+ export interface PlanSummary {
39
+ /** Plan file path */
40
+ path: string;
41
+ /** Plan name */
42
+ name: string;
43
+ /** Progress stats */
44
+ progress: PlanProgress;
45
+ /** Last modified time */
46
+ lastModified: Date;
47
+ }
48
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/boulder-state/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,iCAAiC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAC;IACvB,yBAAyB;IACzB,YAAY,EAAE,IAAI,CAAC;CACpB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Boulder State Types
3
+ *
4
+ * Manages the active work plan state for Olympus orchestrator.
5
+ * Named after Olympus's boulder - the eternal task that must be rolled.
6
+ *
7
+ * Ported from oh-my-opencode's boulder-state.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=types.js.map