oh-my-claude-sisyphus 1.4.1 → 1.6.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 (370) hide show
  1. package/dist/agents/document-writer.d.ts +11 -0
  2. package/dist/agents/document-writer.d.ts.map +1 -0
  3. package/dist/agents/document-writer.js +209 -0
  4. package/dist/agents/document-writer.js.map +1 -0
  5. package/dist/agents/explore.d.ts +12 -0
  6. package/dist/agents/explore.d.ts.map +1 -0
  7. package/dist/agents/explore.js +103 -0
  8. package/dist/agents/explore.js.map +1 -0
  9. package/dist/agents/frontend-engineer.d.ts +11 -0
  10. package/dist/agents/frontend-engineer.d.ts.map +1 -0
  11. package/dist/agents/frontend-engineer.js +115 -0
  12. package/dist/agents/frontend-engineer.js.map +1 -0
  13. package/dist/agents/index.d.ts +17 -1
  14. package/dist/agents/index.d.ts.map +1 -1
  15. package/dist/agents/index.js +21 -1
  16. package/dist/agents/index.js.map +1 -1
  17. package/dist/agents/librarian.d.ts +12 -0
  18. package/dist/agents/librarian.d.ts.map +1 -0
  19. package/dist/agents/librarian.js +103 -0
  20. package/dist/agents/librarian.js.map +1 -0
  21. package/dist/agents/metis.d.ts +12 -0
  22. package/dist/agents/metis.d.ts.map +1 -0
  23. package/dist/agents/metis.js +117 -0
  24. package/dist/agents/metis.js.map +1 -0
  25. package/dist/agents/momus.d.ts +12 -0
  26. package/dist/agents/momus.d.ts.map +1 -0
  27. package/dist/agents/momus.js +128 -0
  28. package/dist/agents/momus.js.map +1 -0
  29. package/dist/agents/multimodal-looker.d.ts +11 -0
  30. package/dist/agents/multimodal-looker.d.ts.map +1 -0
  31. package/dist/agents/multimodal-looker.js +70 -0
  32. package/dist/agents/multimodal-looker.js.map +1 -0
  33. package/dist/agents/oracle.d.ts +13 -0
  34. package/dist/agents/oracle.d.ts.map +1 -0
  35. package/dist/agents/oracle.js +149 -0
  36. package/dist/agents/oracle.js.map +1 -0
  37. package/dist/agents/orchestrator-sisyphus.d.ts +11 -0
  38. package/dist/agents/orchestrator-sisyphus.d.ts.map +1 -0
  39. package/dist/agents/orchestrator-sisyphus.js +115 -0
  40. package/dist/agents/orchestrator-sisyphus.js.map +1 -0
  41. package/dist/agents/prometheus.d.ts +12 -0
  42. package/dist/agents/prometheus.d.ts.map +1 -0
  43. package/dist/agents/prometheus.js +156 -0
  44. package/dist/agents/prometheus.js.map +1 -0
  45. package/dist/agents/sisyphus-junior.d.ts +12 -0
  46. package/dist/agents/sisyphus-junior.d.ts.map +1 -0
  47. package/dist/agents/sisyphus-junior.js +93 -0
  48. package/dist/agents/sisyphus-junior.js.map +1 -0
  49. package/dist/agents/types.d.ts +120 -0
  50. package/dist/agents/types.d.ts.map +1 -0
  51. package/dist/agents/types.js +38 -0
  52. package/dist/agents/types.js.map +1 -0
  53. package/dist/agents/utils.d.ts +49 -0
  54. package/dist/agents/utils.d.ts.map +1 -0
  55. package/dist/agents/utils.js +164 -0
  56. package/dist/agents/utils.js.map +1 -0
  57. package/dist/features/auto-update.d.ts +52 -0
  58. package/dist/features/auto-update.d.ts.map +1 -1
  59. package/dist/features/auto-update.js +167 -0
  60. package/dist/features/auto-update.js.map +1 -1
  61. package/dist/features/background-agent/concurrency.d.ts +53 -0
  62. package/dist/features/background-agent/concurrency.d.ts.map +1 -0
  63. package/dist/features/background-agent/concurrency.js +121 -0
  64. package/dist/features/background-agent/concurrency.js.map +1 -0
  65. package/dist/features/background-agent/index.d.ts +12 -0
  66. package/dist/features/background-agent/index.d.ts.map +1 -0
  67. package/dist/features/background-agent/index.js +12 -0
  68. package/dist/features/background-agent/index.js.map +1 -0
  69. package/dist/features/background-agent/manager.d.ts +134 -0
  70. package/dist/features/background-agent/manager.d.ts.map +1 -0
  71. package/dist/features/background-agent/manager.js +412 -0
  72. package/dist/features/background-agent/manager.js.map +1 -0
  73. package/dist/features/background-agent/types.d.ts +99 -0
  74. package/dist/features/background-agent/types.d.ts.map +1 -0
  75. package/dist/features/background-agent/types.js +9 -0
  76. package/dist/features/background-agent/types.js.map +1 -0
  77. package/dist/features/boulder-state/constants.d.ts +20 -0
  78. package/dist/features/boulder-state/constants.d.ts.map +1 -0
  79. package/dist/features/boulder-state/constants.js +20 -0
  80. package/dist/features/boulder-state/constants.js.map +1 -0
  81. package/dist/features/boulder-state/index.d.ts +12 -0
  82. package/dist/features/boulder-state/index.d.ts.map +1 -0
  83. package/dist/features/boulder-state/index.js +13 -0
  84. package/dist/features/boulder-state/index.js.map +1 -0
  85. package/dist/features/boulder-state/storage.d.ts +58 -0
  86. package/dist/features/boulder-state/storage.d.ts.map +1 -0
  87. package/dist/features/boulder-state/storage.js +174 -0
  88. package/dist/features/boulder-state/storage.js.map +1 -0
  89. package/dist/features/boulder-state/types.d.ts +48 -0
  90. package/dist/features/boulder-state/types.d.ts.map +1 -0
  91. package/dist/features/boulder-state/types.js +10 -0
  92. package/dist/features/boulder-state/types.js.map +1 -0
  93. package/dist/features/builtin-skills/index.d.ts +10 -0
  94. package/dist/features/builtin-skills/index.d.ts.map +1 -0
  95. package/dist/features/builtin-skills/index.js +10 -0
  96. package/dist/features/builtin-skills/index.js.map +1 -0
  97. package/dist/features/builtin-skills/skills.d.ts +21 -0
  98. package/dist/features/builtin-skills/skills.d.ts.map +1 -0
  99. package/dist/features/builtin-skills/skills.js +367 -0
  100. package/dist/features/builtin-skills/skills.js.map +1 -0
  101. package/dist/features/builtin-skills/types.d.ts +60 -0
  102. package/dist/features/builtin-skills/types.d.ts.map +1 -0
  103. package/dist/features/builtin-skills/types.js +9 -0
  104. package/dist/features/builtin-skills/types.js.map +1 -0
  105. package/dist/features/context-injector/collector.d.ts +56 -0
  106. package/dist/features/context-injector/collector.d.ts.map +1 -0
  107. package/dist/features/context-injector/collector.js +122 -0
  108. package/dist/features/context-injector/collector.js.map +1 -0
  109. package/dist/features/context-injector/index.d.ts +12 -0
  110. package/dist/features/context-injector/index.d.ts.map +1 -0
  111. package/dist/features/context-injector/index.js +13 -0
  112. package/dist/features/context-injector/index.js.map +1 -0
  113. package/dist/features/context-injector/injector.d.ts +47 -0
  114. package/dist/features/context-injector/injector.d.ts.map +1 -0
  115. package/dist/features/context-injector/injector.js +103 -0
  116. package/dist/features/context-injector/injector.js.map +1 -0
  117. package/dist/features/context-injector/types.d.ts +103 -0
  118. package/dist/features/context-injector/types.d.ts.map +1 -0
  119. package/dist/features/context-injector/types.js +11 -0
  120. package/dist/features/context-injector/types.js.map +1 -0
  121. package/dist/features/index.d.ts +5 -1
  122. package/dist/features/index.d.ts.map +1 -1
  123. package/dist/features/index.js +25 -1
  124. package/dist/features/index.js.map +1 -1
  125. package/dist/hooks/agent-usage-reminder/constants.d.ts +17 -0
  126. package/dist/hooks/agent-usage-reminder/constants.d.ts.map +1 -0
  127. package/dist/hooks/agent-usage-reminder/constants.js +58 -0
  128. package/dist/hooks/agent-usage-reminder/constants.js.map +1 -0
  129. package/dist/hooks/agent-usage-reminder/index.d.ts +36 -0
  130. package/dist/hooks/agent-usage-reminder/index.d.ts.map +1 -0
  131. package/dist/hooks/agent-usage-reminder/index.js +89 -0
  132. package/dist/hooks/agent-usage-reminder/index.js.map +1 -0
  133. package/dist/hooks/agent-usage-reminder/storage.d.ts +12 -0
  134. package/dist/hooks/agent-usage-reminder/storage.d.ts.map +1 -0
  135. package/dist/hooks/agent-usage-reminder/storage.js +39 -0
  136. package/dist/hooks/agent-usage-reminder/storage.js.map +1 -0
  137. package/dist/hooks/agent-usage-reminder/types.d.ts +14 -0
  138. package/dist/hooks/agent-usage-reminder/types.d.ts.map +1 -0
  139. package/dist/hooks/agent-usage-reminder/types.js +9 -0
  140. package/dist/hooks/agent-usage-reminder/types.js.map +1 -0
  141. package/dist/hooks/auto-slash-command/constants.d.ts +19 -0
  142. package/dist/hooks/auto-slash-command/constants.d.ts.map +1 -0
  143. package/dist/hooks/auto-slash-command/constants.js +28 -0
  144. package/dist/hooks/auto-slash-command/constants.js.map +1 -0
  145. package/dist/hooks/auto-slash-command/detector.d.ts +33 -0
  146. package/dist/hooks/auto-slash-command/detector.d.ts.map +1 -0
  147. package/dist/hooks/auto-slash-command/detector.js +73 -0
  148. package/dist/hooks/auto-slash-command/detector.js.map +1 -0
  149. package/dist/hooks/auto-slash-command/executor.d.ts +29 -0
  150. package/dist/hooks/auto-slash-command/executor.d.ts.map +1 -0
  151. package/dist/hooks/auto-slash-command/executor.js +214 -0
  152. package/dist/hooks/auto-slash-command/executor.js.map +1 -0
  153. package/dist/hooks/auto-slash-command/index.d.ts +53 -0
  154. package/dist/hooks/auto-slash-command/index.d.ts.map +1 -0
  155. package/dist/hooks/auto-slash-command/index.js +105 -0
  156. package/dist/hooks/auto-slash-command/index.js.map +1 -0
  157. package/dist/hooks/auto-slash-command/types.d.ts +77 -0
  158. package/dist/hooks/auto-slash-command/types.d.ts.map +1 -0
  159. package/dist/hooks/auto-slash-command/types.js +9 -0
  160. package/dist/hooks/auto-slash-command/types.js.map +1 -0
  161. package/dist/hooks/background-notification/index.d.ts +60 -0
  162. package/dist/hooks/background-notification/index.d.ts.map +1 -0
  163. package/dist/hooks/background-notification/index.js +180 -0
  164. package/dist/hooks/background-notification/index.js.map +1 -0
  165. package/dist/hooks/background-notification/types.d.ts +64 -0
  166. package/dist/hooks/background-notification/types.d.ts.map +1 -0
  167. package/dist/hooks/background-notification/types.js +8 -0
  168. package/dist/hooks/background-notification/types.js.map +1 -0
  169. package/dist/hooks/bridge.d.ts +68 -0
  170. package/dist/hooks/bridge.d.ts.map +1 -0
  171. package/dist/hooks/bridge.js +225 -0
  172. package/dist/hooks/bridge.js.map +1 -0
  173. package/dist/hooks/comment-checker/constants.d.ts +28 -0
  174. package/dist/hooks/comment-checker/constants.d.ts.map +1 -0
  175. package/dist/hooks/comment-checker/constants.js +189 -0
  176. package/dist/hooks/comment-checker/constants.js.map +1 -0
  177. package/dist/hooks/comment-checker/filters.d.ts +39 -0
  178. package/dist/hooks/comment-checker/filters.d.ts.map +1 -0
  179. package/dist/hooks/comment-checker/filters.js +126 -0
  180. package/dist/hooks/comment-checker/filters.js.map +1 -0
  181. package/dist/hooks/comment-checker/index.d.ts +58 -0
  182. package/dist/hooks/comment-checker/index.d.ts.map +1 -0
  183. package/dist/hooks/comment-checker/index.js +298 -0
  184. package/dist/hooks/comment-checker/index.js.map +1 -0
  185. package/dist/hooks/comment-checker/types.d.ts +88 -0
  186. package/dist/hooks/comment-checker/types.d.ts.map +1 -0
  187. package/dist/hooks/comment-checker/types.js +9 -0
  188. package/dist/hooks/comment-checker/types.js.map +1 -0
  189. package/dist/hooks/context-window-limit-recovery/constants.d.ts +28 -0
  190. package/dist/hooks/context-window-limit-recovery/constants.d.ts.map +1 -0
  191. package/dist/hooks/context-window-limit-recovery/constants.js +85 -0
  192. package/dist/hooks/context-window-limit-recovery/constants.js.map +1 -0
  193. package/dist/hooks/context-window-limit-recovery/index.d.ts +62 -0
  194. package/dist/hooks/context-window-limit-recovery/index.d.ts.map +1 -0
  195. package/dist/hooks/context-window-limit-recovery/index.js +201 -0
  196. package/dist/hooks/context-window-limit-recovery/index.js.map +1 -0
  197. package/dist/hooks/context-window-limit-recovery/parser.d.ts +31 -0
  198. package/dist/hooks/context-window-limit-recovery/parser.d.ts.map +1 -0
  199. package/dist/hooks/context-window-limit-recovery/parser.js +241 -0
  200. package/dist/hooks/context-window-limit-recovery/parser.js.map +1 -0
  201. package/dist/hooks/context-window-limit-recovery/types.d.ts +84 -0
  202. package/dist/hooks/context-window-limit-recovery/types.d.ts.map +1 -0
  203. package/dist/hooks/context-window-limit-recovery/types.js +34 -0
  204. package/dist/hooks/context-window-limit-recovery/types.js.map +1 -0
  205. package/dist/hooks/directory-readme-injector/constants.d.ts +15 -0
  206. package/dist/hooks/directory-readme-injector/constants.d.ts.map +1 -0
  207. package/dist/hooks/directory-readme-injector/constants.js +17 -0
  208. package/dist/hooks/directory-readme-injector/constants.js.map +1 -0
  209. package/dist/hooks/directory-readme-injector/index.d.ts +41 -0
  210. package/dist/hooks/directory-readme-injector/index.d.ts.map +1 -0
  211. package/dist/hooks/directory-readme-injector/index.js +162 -0
  212. package/dist/hooks/directory-readme-injector/index.js.map +1 -0
  213. package/dist/hooks/directory-readme-injector/storage.d.ts +20 -0
  214. package/dist/hooks/directory-readme-injector/storage.d.ts.map +1 -0
  215. package/dist/hooks/directory-readme-injector/storage.js +56 -0
  216. package/dist/hooks/directory-readme-injector/storage.js.map +1 -0
  217. package/dist/hooks/directory-readme-injector/types.d.ts +20 -0
  218. package/dist/hooks/directory-readme-injector/types.d.ts.map +1 -0
  219. package/dist/hooks/directory-readme-injector/types.js +9 -0
  220. package/dist/hooks/directory-readme-injector/types.js.map +1 -0
  221. package/dist/hooks/edit-error-recovery/index.d.ts +62 -0
  222. package/dist/hooks/edit-error-recovery/index.d.ts.map +1 -0
  223. package/dist/hooks/edit-error-recovery/index.js +89 -0
  224. package/dist/hooks/edit-error-recovery/index.js.map +1 -0
  225. package/dist/hooks/empty-message-sanitizer/constants.d.ts +33 -0
  226. package/dist/hooks/empty-message-sanitizer/constants.d.ts.map +1 -0
  227. package/dist/hooks/empty-message-sanitizer/constants.js +37 -0
  228. package/dist/hooks/empty-message-sanitizer/constants.js.map +1 -0
  229. package/dist/hooks/empty-message-sanitizer/index.d.ts +59 -0
  230. package/dist/hooks/empty-message-sanitizer/index.d.ts.map +1 -0
  231. package/dist/hooks/empty-message-sanitizer/index.js +171 -0
  232. package/dist/hooks/empty-message-sanitizer/index.js.map +1 -0
  233. package/dist/hooks/empty-message-sanitizer/types.d.ts +79 -0
  234. package/dist/hooks/empty-message-sanitizer/types.d.ts.map +1 -0
  235. package/dist/hooks/empty-message-sanitizer/types.js +10 -0
  236. package/dist/hooks/empty-message-sanitizer/types.js.map +1 -0
  237. package/dist/hooks/index.d.ts +31 -0
  238. package/dist/hooks/index.d.ts.map +1 -0
  239. package/dist/hooks/index.js +69 -0
  240. package/dist/hooks/index.js.map +1 -0
  241. package/dist/hooks/keyword-detector/index.d.ts +40 -0
  242. package/dist/hooks/keyword-detector/index.d.ts.map +1 -0
  243. package/dist/hooks/keyword-detector/index.js +88 -0
  244. package/dist/hooks/keyword-detector/index.js.map +1 -0
  245. package/dist/hooks/non-interactive-env/constants.d.ts +35 -0
  246. package/dist/hooks/non-interactive-env/constants.d.ts.map +1 -0
  247. package/dist/hooks/non-interactive-env/constants.js +69 -0
  248. package/dist/hooks/non-interactive-env/constants.js.map +1 -0
  249. package/dist/hooks/non-interactive-env/detector.d.ts +2 -0
  250. package/dist/hooks/non-interactive-env/detector.d.ts.map +1 -0
  251. package/dist/hooks/non-interactive-env/detector.js +16 -0
  252. package/dist/hooks/non-interactive-env/detector.js.map +1 -0
  253. package/dist/hooks/non-interactive-env/index.d.ts +14 -0
  254. package/dist/hooks/non-interactive-env/index.d.ts.map +1 -0
  255. package/dist/hooks/non-interactive-env/index.js +72 -0
  256. package/dist/hooks/non-interactive-env/index.js.map +1 -0
  257. package/dist/hooks/non-interactive-env/types.d.ts +14 -0
  258. package/dist/hooks/non-interactive-env/types.d.ts.map +1 -0
  259. package/dist/hooks/non-interactive-env/types.js +2 -0
  260. package/dist/hooks/non-interactive-env/types.js.map +1 -0
  261. package/dist/hooks/preemptive-compaction/constants.d.ts +48 -0
  262. package/dist/hooks/preemptive-compaction/constants.d.ts.map +1 -0
  263. package/dist/hooks/preemptive-compaction/constants.js +90 -0
  264. package/dist/hooks/preemptive-compaction/constants.js.map +1 -0
  265. package/dist/hooks/preemptive-compaction/index.d.ts +55 -0
  266. package/dist/hooks/preemptive-compaction/index.d.ts.map +1 -0
  267. package/dist/hooks/preemptive-compaction/index.js +237 -0
  268. package/dist/hooks/preemptive-compaction/index.js.map +1 -0
  269. package/dist/hooks/preemptive-compaction/types.d.ts +76 -0
  270. package/dist/hooks/preemptive-compaction/types.d.ts.map +1 -0
  271. package/dist/hooks/preemptive-compaction/types.js +9 -0
  272. package/dist/hooks/preemptive-compaction/types.js.map +1 -0
  273. package/dist/hooks/ralph-loop/index.d.ts +60 -0
  274. package/dist/hooks/ralph-loop/index.d.ts.map +1 -0
  275. package/dist/hooks/ralph-loop/index.js +155 -0
  276. package/dist/hooks/ralph-loop/index.js.map +1 -0
  277. package/dist/hooks/rules-injector/constants.d.ts +25 -0
  278. package/dist/hooks/rules-injector/constants.d.ts.map +1 -0
  279. package/dist/hooks/rules-injector/constants.js +40 -0
  280. package/dist/hooks/rules-injector/constants.js.map +1 -0
  281. package/dist/hooks/rules-injector/finder.d.ts +24 -0
  282. package/dist/hooks/rules-injector/finder.d.ts.map +1 -0
  283. package/dist/hooks/rules-injector/finder.js +215 -0
  284. package/dist/hooks/rules-injector/finder.js.map +1 -0
  285. package/dist/hooks/rules-injector/index.d.ts +45 -0
  286. package/dist/hooks/rules-injector/index.d.ts.map +1 -0
  287. package/dist/hooks/rules-injector/index.js +187 -0
  288. package/dist/hooks/rules-injector/index.js.map +1 -0
  289. package/dist/hooks/rules-injector/matcher.d.ts +25 -0
  290. package/dist/hooks/rules-injector/matcher.d.ts.map +1 -0
  291. package/dist/hooks/rules-injector/matcher.js +70 -0
  292. package/dist/hooks/rules-injector/matcher.js.map +1 -0
  293. package/dist/hooks/rules-injector/parser.d.ts +20 -0
  294. package/dist/hooks/rules-injector/parser.d.ts.map +1 -0
  295. package/dist/hooks/rules-injector/parser.js +179 -0
  296. package/dist/hooks/rules-injector/parser.js.map +1 -0
  297. package/dist/hooks/rules-injector/storage.d.ts +26 -0
  298. package/dist/hooks/rules-injector/storage.d.ts.map +1 -0
  299. package/dist/hooks/rules-injector/storage.js +61 -0
  300. package/dist/hooks/rules-injector/storage.js.map +1 -0
  301. package/dist/hooks/rules-injector/types.d.ts +101 -0
  302. package/dist/hooks/rules-injector/types.d.ts.map +1 -0
  303. package/dist/hooks/rules-injector/types.js +10 -0
  304. package/dist/hooks/rules-injector/types.js.map +1 -0
  305. package/dist/hooks/session-recovery/constants.d.ts +56 -0
  306. package/dist/hooks/session-recovery/constants.d.ts.map +1 -0
  307. package/dist/hooks/session-recovery/constants.js +78 -0
  308. package/dist/hooks/session-recovery/constants.js.map +1 -0
  309. package/dist/hooks/session-recovery/index.d.ts +53 -0
  310. package/dist/hooks/session-recovery/index.d.ts.map +1 -0
  311. package/dist/hooks/session-recovery/index.js +321 -0
  312. package/dist/hooks/session-recovery/index.js.map +1 -0
  313. package/dist/hooks/session-recovery/storage.d.ts +76 -0
  314. package/dist/hooks/session-recovery/storage.d.ts.map +1 -0
  315. package/dist/hooks/session-recovery/storage.js +383 -0
  316. package/dist/hooks/session-recovery/storage.js.map +1 -0
  317. package/dist/hooks/session-recovery/types.d.ts +145 -0
  318. package/dist/hooks/session-recovery/types.d.ts.map +1 -0
  319. package/dist/hooks/session-recovery/types.js +8 -0
  320. package/dist/hooks/session-recovery/types.js.map +1 -0
  321. package/dist/hooks/sisyphus-orchestrator/constants.d.ts +23 -0
  322. package/dist/hooks/sisyphus-orchestrator/constants.d.ts.map +1 -0
  323. package/dist/hooks/sisyphus-orchestrator/constants.js +142 -0
  324. package/dist/hooks/sisyphus-orchestrator/constants.js.map +1 -0
  325. package/dist/hooks/sisyphus-orchestrator/index.d.ts +113 -0
  326. package/dist/hooks/sisyphus-orchestrator/index.d.ts.map +1 -0
  327. package/dist/hooks/sisyphus-orchestrator/index.js +283 -0
  328. package/dist/hooks/sisyphus-orchestrator/index.js.map +1 -0
  329. package/dist/hooks/think-mode/detector.d.ts +28 -0
  330. package/dist/hooks/think-mode/detector.d.ts.map +1 -0
  331. package/dist/hooks/think-mode/detector.js +105 -0
  332. package/dist/hooks/think-mode/detector.js.map +1 -0
  333. package/dist/hooks/think-mode/index.d.ts +70 -0
  334. package/dist/hooks/think-mode/index.d.ts.map +1 -0
  335. package/dist/hooks/think-mode/index.js +144 -0
  336. package/dist/hooks/think-mode/index.js.map +1 -0
  337. package/dist/hooks/think-mode/switcher.d.ts +39 -0
  338. package/dist/hooks/think-mode/switcher.d.ts.map +1 -0
  339. package/dist/hooks/think-mode/switcher.js +180 -0
  340. package/dist/hooks/think-mode/switcher.js.map +1 -0
  341. package/dist/hooks/think-mode/types.d.ts +60 -0
  342. package/dist/hooks/think-mode/types.d.ts.map +1 -0
  343. package/dist/hooks/think-mode/types.js +9 -0
  344. package/dist/hooks/think-mode/types.js.map +1 -0
  345. package/dist/hooks/thinking-block-validator/constants.d.ts +37 -0
  346. package/dist/hooks/thinking-block-validator/constants.d.ts.map +1 -0
  347. package/dist/hooks/thinking-block-validator/constants.js +50 -0
  348. package/dist/hooks/thinking-block-validator/constants.js.map +1 -0
  349. package/dist/hooks/thinking-block-validator/index.d.ts +66 -0
  350. package/dist/hooks/thinking-block-validator/index.d.ts.map +1 -0
  351. package/dist/hooks/thinking-block-validator/index.js +205 -0
  352. package/dist/hooks/thinking-block-validator/index.js.map +1 -0
  353. package/dist/hooks/thinking-block-validator/types.d.ts +67 -0
  354. package/dist/hooks/thinking-block-validator/types.d.ts.map +1 -0
  355. package/dist/hooks/thinking-block-validator/types.js +9 -0
  356. package/dist/hooks/thinking-block-validator/types.js.map +1 -0
  357. package/dist/hooks/todo-continuation/index.d.ts +39 -0
  358. package/dist/hooks/todo-continuation/index.d.ts.map +1 -0
  359. package/dist/hooks/todo-continuation/index.js +140 -0
  360. package/dist/hooks/todo-continuation/index.js.map +1 -0
  361. package/dist/index.d.ts +3 -0
  362. package/dist/index.d.ts.map +1 -1
  363. package/dist/index.js +12 -0
  364. package/dist/index.js.map +1 -1
  365. package/dist/installer/index.d.ts +1 -1
  366. package/dist/installer/index.d.ts.map +1 -1
  367. package/dist/installer/index.js +232 -1
  368. package/dist/installer/index.js.map +1 -1
  369. package/package.json +1 -1
  370. package/scripts/install.sh +181 -3
@@ -0,0 +1,383 @@
1
+ /**
2
+ * Session Recovery Storage Operations
3
+ *
4
+ * Functions for reading and manipulating stored session data.
5
+ * Adapted from oh-my-opencode's session-recovery hook.
6
+ */
7
+ import { existsSync, mkdirSync, readdirSync, readFileSync, unlinkSync, writeFileSync, } from "node:fs";
8
+ import { join } from "node:path";
9
+ import { MESSAGE_STORAGE, PART_STORAGE, THINKING_TYPES, META_TYPES, PLACEHOLDER_TEXT, } from "./constants.js";
10
+ /**
11
+ * Generate a unique part ID
12
+ */
13
+ export function generatePartId() {
14
+ const timestamp = Date.now().toString(16);
15
+ const random = Math.random().toString(36).substring(2, 10);
16
+ return `prt_${timestamp}${random}`;
17
+ }
18
+ /**
19
+ * Get the directory containing messages for a session
20
+ */
21
+ export function getMessageDir(sessionID) {
22
+ if (!existsSync(MESSAGE_STORAGE))
23
+ return "";
24
+ const directPath = join(MESSAGE_STORAGE, sessionID);
25
+ if (existsSync(directPath)) {
26
+ return directPath;
27
+ }
28
+ for (const dir of readdirSync(MESSAGE_STORAGE)) {
29
+ const sessionPath = join(MESSAGE_STORAGE, dir, sessionID);
30
+ if (existsSync(sessionPath)) {
31
+ return sessionPath;
32
+ }
33
+ }
34
+ return "";
35
+ }
36
+ /**
37
+ * Read all messages for a session
38
+ */
39
+ export function readMessages(sessionID) {
40
+ const messageDir = getMessageDir(sessionID);
41
+ if (!messageDir || !existsSync(messageDir))
42
+ return [];
43
+ const messages = [];
44
+ for (const file of readdirSync(messageDir)) {
45
+ if (!file.endsWith(".json"))
46
+ continue;
47
+ try {
48
+ const content = readFileSync(join(messageDir, file), "utf-8");
49
+ messages.push(JSON.parse(content));
50
+ }
51
+ catch {
52
+ continue;
53
+ }
54
+ }
55
+ return messages.sort((a, b) => {
56
+ const aTime = a.time?.created ?? 0;
57
+ const bTime = b.time?.created ?? 0;
58
+ if (aTime !== bTime)
59
+ return aTime - bTime;
60
+ return a.id.localeCompare(b.id);
61
+ });
62
+ }
63
+ /**
64
+ * Read all parts for a message
65
+ */
66
+ export function readParts(messageID) {
67
+ const partDir = join(PART_STORAGE, messageID);
68
+ if (!existsSync(partDir))
69
+ return [];
70
+ const parts = [];
71
+ for (const file of readdirSync(partDir)) {
72
+ if (!file.endsWith(".json"))
73
+ continue;
74
+ try {
75
+ const content = readFileSync(join(partDir, file), "utf-8");
76
+ parts.push(JSON.parse(content));
77
+ }
78
+ catch {
79
+ continue;
80
+ }
81
+ }
82
+ return parts;
83
+ }
84
+ /**
85
+ * Check if a part has content (not thinking/meta)
86
+ */
87
+ export function hasContent(part) {
88
+ if (THINKING_TYPES.has(part.type))
89
+ return false;
90
+ if (META_TYPES.has(part.type))
91
+ return false;
92
+ if (part.type === "text") {
93
+ const textPart = part;
94
+ return !!(textPart.text?.trim());
95
+ }
96
+ if (part.type === "tool" || part.type === "tool_use") {
97
+ return true;
98
+ }
99
+ if (part.type === "tool_result") {
100
+ return true;
101
+ }
102
+ return false;
103
+ }
104
+ /**
105
+ * Check if a message has content
106
+ */
107
+ export function messageHasContent(messageID) {
108
+ const parts = readParts(messageID);
109
+ return parts.some(hasContent);
110
+ }
111
+ /**
112
+ * Inject a text part into a message
113
+ */
114
+ export function injectTextPart(sessionID, messageID, text) {
115
+ const partDir = join(PART_STORAGE, messageID);
116
+ if (!existsSync(partDir)) {
117
+ mkdirSync(partDir, { recursive: true });
118
+ }
119
+ const partId = generatePartId();
120
+ const part = {
121
+ id: partId,
122
+ sessionID,
123
+ messageID,
124
+ type: "text",
125
+ text,
126
+ synthetic: true,
127
+ };
128
+ try {
129
+ writeFileSync(join(partDir, `${partId}.json`), JSON.stringify(part, null, 2));
130
+ return true;
131
+ }
132
+ catch {
133
+ return false;
134
+ }
135
+ }
136
+ /**
137
+ * Find all messages with empty content
138
+ */
139
+ export function findEmptyMessages(sessionID) {
140
+ const messages = readMessages(sessionID);
141
+ const emptyIds = [];
142
+ for (const msg of messages) {
143
+ if (!messageHasContent(msg.id)) {
144
+ emptyIds.push(msg.id);
145
+ }
146
+ }
147
+ return emptyIds;
148
+ }
149
+ /**
150
+ * Find empty message by index (with fuzzy matching)
151
+ */
152
+ export function findEmptyMessageByIndex(sessionID, targetIndex) {
153
+ const messages = readMessages(sessionID);
154
+ // Try nearby indices in case of system messages causing offset
155
+ const indicesToTry = [
156
+ targetIndex,
157
+ targetIndex - 1,
158
+ targetIndex + 1,
159
+ targetIndex - 2,
160
+ targetIndex + 2,
161
+ targetIndex - 3,
162
+ targetIndex - 4,
163
+ targetIndex - 5,
164
+ ];
165
+ for (const idx of indicesToTry) {
166
+ if (idx < 0 || idx >= messages.length)
167
+ continue;
168
+ const targetMsg = messages[idx];
169
+ if (!messageHasContent(targetMsg.id)) {
170
+ return targetMsg.id;
171
+ }
172
+ }
173
+ return null;
174
+ }
175
+ /**
176
+ * Find messages that have thinking blocks
177
+ */
178
+ export function findMessagesWithThinkingBlocks(sessionID) {
179
+ const messages = readMessages(sessionID);
180
+ const result = [];
181
+ for (const msg of messages) {
182
+ if (msg.role !== "assistant")
183
+ continue;
184
+ const parts = readParts(msg.id);
185
+ const hasThinking = parts.some((p) => THINKING_TYPES.has(p.type));
186
+ if (hasThinking) {
187
+ result.push(msg.id);
188
+ }
189
+ }
190
+ return result;
191
+ }
192
+ /**
193
+ * Find messages that have thinking but no content
194
+ */
195
+ export function findMessagesWithThinkingOnly(sessionID) {
196
+ const messages = readMessages(sessionID);
197
+ const result = [];
198
+ for (const msg of messages) {
199
+ if (msg.role !== "assistant")
200
+ continue;
201
+ const parts = readParts(msg.id);
202
+ if (parts.length === 0)
203
+ continue;
204
+ const hasThinking = parts.some((p) => THINKING_TYPES.has(p.type));
205
+ const hasTextContent = parts.some(hasContent);
206
+ if (hasThinking && !hasTextContent) {
207
+ result.push(msg.id);
208
+ }
209
+ }
210
+ return result;
211
+ }
212
+ /**
213
+ * Find messages with orphan thinking (thinking not first)
214
+ */
215
+ export function findMessagesWithOrphanThinking(sessionID) {
216
+ const messages = readMessages(sessionID);
217
+ const result = [];
218
+ for (const msg of messages) {
219
+ if (msg.role !== "assistant")
220
+ continue;
221
+ const parts = readParts(msg.id);
222
+ if (parts.length === 0)
223
+ continue;
224
+ const sortedParts = [...parts].sort((a, b) => a.id.localeCompare(b.id));
225
+ const firstPart = sortedParts[0];
226
+ const firstIsThinking = THINKING_TYPES.has(firstPart.type);
227
+ if (!firstIsThinking) {
228
+ result.push(msg.id);
229
+ }
230
+ }
231
+ return result;
232
+ }
233
+ /**
234
+ * Find the most recent thinking content from previous assistant messages
235
+ */
236
+ function findLastThinkingContent(sessionID, beforeMessageID) {
237
+ const messages = readMessages(sessionID);
238
+ const currentIndex = messages.findIndex((m) => m.id === beforeMessageID);
239
+ if (currentIndex === -1)
240
+ return "";
241
+ for (let i = currentIndex - 1; i >= 0; i--) {
242
+ const msg = messages[i];
243
+ if (msg.role !== "assistant")
244
+ continue;
245
+ const parts = readParts(msg.id);
246
+ for (const part of parts) {
247
+ if (THINKING_TYPES.has(part.type)) {
248
+ const thinking = part.thinking;
249
+ const reasoning = part.text;
250
+ const content = thinking || reasoning;
251
+ if (content && content.trim().length > 0) {
252
+ return content;
253
+ }
254
+ }
255
+ }
256
+ }
257
+ return "";
258
+ }
259
+ /**
260
+ * Prepend a thinking part to a message
261
+ */
262
+ export function prependThinkingPart(sessionID, messageID) {
263
+ const partDir = join(PART_STORAGE, messageID);
264
+ if (!existsSync(partDir)) {
265
+ mkdirSync(partDir, { recursive: true });
266
+ }
267
+ const previousThinking = findLastThinkingContent(sessionID, messageID);
268
+ const partId = `prt_0000000000_thinking`;
269
+ const part = {
270
+ id: partId,
271
+ sessionID,
272
+ messageID,
273
+ type: "thinking",
274
+ thinking: previousThinking || "[Continuing from previous reasoning]",
275
+ synthetic: true,
276
+ };
277
+ try {
278
+ writeFileSync(join(partDir, `${partId}.json`), JSON.stringify(part, null, 2));
279
+ return true;
280
+ }
281
+ catch {
282
+ return false;
283
+ }
284
+ }
285
+ /**
286
+ * Strip all thinking parts from a message
287
+ */
288
+ export function stripThinkingParts(messageID) {
289
+ const partDir = join(PART_STORAGE, messageID);
290
+ if (!existsSync(partDir))
291
+ return false;
292
+ let anyRemoved = false;
293
+ for (const file of readdirSync(partDir)) {
294
+ if (!file.endsWith(".json"))
295
+ continue;
296
+ try {
297
+ const filePath = join(partDir, file);
298
+ const content = readFileSync(filePath, "utf-8");
299
+ const part = JSON.parse(content);
300
+ if (THINKING_TYPES.has(part.type)) {
301
+ unlinkSync(filePath);
302
+ anyRemoved = true;
303
+ }
304
+ }
305
+ catch {
306
+ continue;
307
+ }
308
+ }
309
+ return anyRemoved;
310
+ }
311
+ /**
312
+ * Replace empty text parts with placeholder text
313
+ */
314
+ export function replaceEmptyTextParts(messageID, replacementText = PLACEHOLDER_TEXT) {
315
+ const partDir = join(PART_STORAGE, messageID);
316
+ if (!existsSync(partDir))
317
+ return false;
318
+ let anyReplaced = false;
319
+ for (const file of readdirSync(partDir)) {
320
+ if (!file.endsWith(".json"))
321
+ continue;
322
+ try {
323
+ const filePath = join(partDir, file);
324
+ const content = readFileSync(filePath, "utf-8");
325
+ const part = JSON.parse(content);
326
+ if (part.type === "text") {
327
+ const textPart = part;
328
+ if (!textPart.text?.trim()) {
329
+ textPart.text = replacementText;
330
+ textPart.synthetic = true;
331
+ writeFileSync(filePath, JSON.stringify(textPart, null, 2));
332
+ anyReplaced = true;
333
+ }
334
+ }
335
+ }
336
+ catch {
337
+ continue;
338
+ }
339
+ }
340
+ return anyReplaced;
341
+ }
342
+ /**
343
+ * Find messages with empty text parts
344
+ */
345
+ export function findMessagesWithEmptyTextParts(sessionID) {
346
+ const messages = readMessages(sessionID);
347
+ const result = [];
348
+ for (const msg of messages) {
349
+ const parts = readParts(msg.id);
350
+ const hasEmptyTextPart = parts.some((p) => {
351
+ if (p.type !== "text")
352
+ return false;
353
+ const textPart = p;
354
+ return !textPart.text?.trim();
355
+ });
356
+ if (hasEmptyTextPart) {
357
+ result.push(msg.id);
358
+ }
359
+ }
360
+ return result;
361
+ }
362
+ /**
363
+ * Find message by index that needs thinking block
364
+ */
365
+ export function findMessageByIndexNeedingThinking(sessionID, targetIndex) {
366
+ const messages = readMessages(sessionID);
367
+ if (targetIndex < 0 || targetIndex >= messages.length)
368
+ return null;
369
+ const targetMsg = messages[targetIndex];
370
+ if (targetMsg.role !== "assistant")
371
+ return null;
372
+ const parts = readParts(targetMsg.id);
373
+ if (parts.length === 0)
374
+ return null;
375
+ const sortedParts = [...parts].sort((a, b) => a.id.localeCompare(b.id));
376
+ const firstPart = sortedParts[0];
377
+ const firstIsThinking = THINKING_TYPES.has(firstPart.type);
378
+ if (!firstIsThinking) {
379
+ return targetMsg.id;
380
+ }
381
+ return null;
382
+ }
383
+ //# sourceMappingURL=storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.js","sourceRoot":"","sources":["../../../src/hooks/session-recovery/storage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,eAAe,EACf,YAAY,EACZ,cAAc,EACd,UAAU,EACV,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAOxB;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC3D,OAAO,OAAO,SAAS,GAAG,MAAM,EAAE,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,SAAiB;IAC7C,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC;QAAE,OAAO,EAAE,CAAC;IAE5C,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;IACpD,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC;QAC/C,MAAM,WAAW,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ACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iCAAiC,CAC/C,SAAiB,EACjB,WAAmB;IAEnB,MAAM,QAAQ,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAEzC,IAAI,WAAW,GAAG,CAAC,IAAI,WAAW,IAAI,QAAQ,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEnE,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IACxC,IAAI,SAAS,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAEhD,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACtC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEpC,MAAM,WAAW,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,eAAe,GAAG,cAAc,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAE3D,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,SAAS,CAAC,EAAE,CAAC;IACtB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Session Recovery Types
3
+ *
4
+ * Types for session state recovery when Claude Code restarts or crashes.
5
+ * Adapted from oh-my-opencode's session-recovery hook.
6
+ */
7
+ export type ThinkingPartType = "thinking" | "redacted_thinking" | "reasoning";
8
+ export type MetaPartType = "step-start" | "step-finish";
9
+ export type ContentPartType = "text" | "tool" | "tool_use" | "tool_result";
10
+ /**
11
+ * Stored message metadata
12
+ */
13
+ export interface StoredMessageMeta {
14
+ id: string;
15
+ sessionID: string;
16
+ role: "user" | "assistant";
17
+ parentID?: string;
18
+ time?: {
19
+ created: number;
20
+ completed?: number;
21
+ };
22
+ error?: unknown;
23
+ }
24
+ /**
25
+ * Stored text part
26
+ */
27
+ export interface StoredTextPart {
28
+ id: string;
29
+ sessionID: string;
30
+ messageID: string;
31
+ type: "text";
32
+ text: string;
33
+ synthetic?: boolean;
34
+ ignored?: boolean;
35
+ }
36
+ /**
37
+ * Stored tool part
38
+ */
39
+ export interface StoredToolPart {
40
+ id: string;
41
+ sessionID: string;
42
+ messageID: string;
43
+ type: "tool";
44
+ callID: string;
45
+ tool: string;
46
+ state: {
47
+ status: "pending" | "running" | "completed" | "error";
48
+ input: Record<string, unknown>;
49
+ output?: string;
50
+ error?: string;
51
+ };
52
+ }
53
+ /**
54
+ * Stored reasoning/thinking part
55
+ */
56
+ export interface StoredReasoningPart {
57
+ id: string;
58
+ sessionID: string;
59
+ messageID: string;
60
+ type: "reasoning";
61
+ text: string;
62
+ }
63
+ /**
64
+ * Stored step part
65
+ */
66
+ export interface StoredStepPart {
67
+ id: string;
68
+ sessionID: string;
69
+ messageID: string;
70
+ type: "step-start" | "step-finish";
71
+ }
72
+ /**
73
+ * Union of all stored part types
74
+ */
75
+ export type StoredPart = StoredTextPart | StoredToolPart | StoredReasoningPart | StoredStepPart | {
76
+ id: string;
77
+ sessionID: string;
78
+ messageID: string;
79
+ type: string;
80
+ [key: string]: unknown;
81
+ };
82
+ /**
83
+ * Message data structure
84
+ */
85
+ export interface MessageData {
86
+ info?: {
87
+ id?: string;
88
+ role?: string;
89
+ sessionID?: string;
90
+ parentID?: string;
91
+ error?: unknown;
92
+ agent?: string;
93
+ model?: {
94
+ providerID: string;
95
+ modelID: string;
96
+ };
97
+ system?: string;
98
+ tools?: Record<string, boolean>;
99
+ };
100
+ parts?: Array<{
101
+ type: string;
102
+ id?: string;
103
+ text?: string;
104
+ thinking?: string;
105
+ name?: string;
106
+ input?: Record<string, unknown>;
107
+ callID?: string;
108
+ }>;
109
+ }
110
+ /**
111
+ * Resume configuration
112
+ */
113
+ export interface ResumeConfig {
114
+ sessionID: string;
115
+ agent?: string;
116
+ model?: {
117
+ providerID: string;
118
+ modelID: string;
119
+ };
120
+ }
121
+ /**
122
+ * Recovery error types
123
+ */
124
+ export type RecoveryErrorType = "tool_result_missing" | "thinking_block_order" | "thinking_disabled_violation" | "empty_content" | null;
125
+ /**
126
+ * Recovery result
127
+ */
128
+ export interface RecoveryResult {
129
+ attempted: boolean;
130
+ success: boolean;
131
+ message?: string;
132
+ errorType?: string;
133
+ }
134
+ /**
135
+ * Session recovery configuration
136
+ */
137
+ export interface SessionRecoveryConfig {
138
+ /** Whether to enable auto-resume after recovery */
139
+ autoResume?: boolean;
140
+ /** Whether to enable detailed logging */
141
+ debug?: boolean;
142
+ /** Custom recovery messages */
143
+ customMessages?: Partial<Record<RecoveryErrorType & string, string>>;
144
+ }
145
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/hooks/session-recovery/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,mBAAmB,GAAG,WAAW,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,aAAa,CAAC;AACxD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,aAAa,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE;QACL,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,KAA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B,GAC7B,eAAe,GACf,IAAI,CAAC;AAET;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+BAA+B;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,GAAG,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtE"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Session Recovery Types
3
+ *
4
+ * Types for session state recovery when Claude Code restarts or crashes.
5
+ * Adapted from oh-my-opencode's session-recovery hook.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/hooks/session-recovery/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Sisyphus Orchestrator Constants
3
+ *
4
+ * Message templates and configuration for orchestrator behavior enforcement.
5
+ *
6
+ * Adapted from oh-my-opencode's sisyphus-orchestrator hook.
7
+ */
8
+ export declare const HOOK_NAME = "sisyphus-orchestrator";
9
+ /** Paths that orchestrator IS allowed to modify directly */
10
+ export declare const ALLOWED_PATH_PREFIX = ".sisyphus/";
11
+ /** Tools that perform file modifications */
12
+ export declare const WRITE_EDIT_TOOLS: string[];
13
+ /** Reminder when orchestrator performs direct file work */
14
+ export declare const DIRECT_WORK_REMINDER = "\n\n---\n\n[SYSTEM REMINDER - DELEGATION REQUIRED]\n\nYou just performed direct file modifications outside `.sisyphus/`.\n\n**You are an ORCHESTRATOR, not an IMPLEMENTER.**\n\nAs an orchestrator, you should:\n- **DELEGATE** implementation work to subagents via the Task tool\n- **VERIFY** the work done by subagents\n- **COORDINATE** multiple tasks and ensure completion\n\nYou should NOT:\n- Write code directly (except for `.sisyphus/` files like plans and notepads)\n- Make direct file edits outside `.sisyphus/`\n- Implement features yourself\n\n**If you need to make changes:**\n1. Use the Task tool to delegate to an appropriate subagent\n2. Provide clear instructions in the prompt\n3. Verify the subagent's work after completion\n\n---\n";
15
+ /** Strong warning when orchestrator tries to modify source files */
16
+ export declare const ORCHESTRATOR_DELEGATION_REQUIRED = "\n\n---\n\n[CRITICAL SYSTEM DIRECTIVE - DELEGATION REQUIRED]\n\n**STOP. YOU ARE VIOLATING ORCHESTRATOR PROTOCOL.**\n\nYou (orchestrator-sisyphus) are attempting to directly modify a file outside `.sisyphus/`.\n\n**Path attempted:** $FILE_PATH\n\n---\n\n**THIS IS FORBIDDEN** (except for VERIFICATION purposes)\n\nAs an ORCHESTRATOR, you MUST:\n1. **DELEGATE** all implementation work via the Task tool\n2. **VERIFY** the work done by subagents (reading files is OK)\n3. **COORDINATE** - you orchestrate, you don't implement\n\n**ALLOWED direct file operations:**\n- Files inside `.sisyphus/` (plans, notepads, drafts)\n- Reading files for verification\n- Running diagnostics/tests\n\n**FORBIDDEN direct file operations:**\n- Writing/editing source code\n- Creating new files outside `.sisyphus/`\n- Any implementation work\n\n---\n\n**IF THIS IS FOR VERIFICATION:**\nProceed if you are verifying subagent work by making a small fix.\nBut for any substantial changes, USE the Task tool.\n\n**CORRECT APPROACH:**\n```\nTask tool with subagent_type=\"sisyphus-junior\"\nprompt=\"[specific single task with clear acceptance criteria]\"\n```\n\nDELEGATE. DON'T IMPLEMENT.\n\n---\n";
17
+ /** Continuation prompt for boulder state */
18
+ export declare const BOULDER_CONTINUATION_PROMPT = "[SYSTEM REMINDER - BOULDER CONTINUATION]\n\nYou have an active work plan with incomplete tasks. Continue working.\n\nRULES:\n- Proceed without asking for permission\n- Mark each checkbox [x] in the plan file when done\n- Use the notepad at .sisyphus/notepads/{PLAN_NAME}/ to record learnings\n- Do not stop until all tasks are complete\n- If blocked, document the blocker and move to the next task";
19
+ /** Verification reminder for subagent work */
20
+ export declare const VERIFICATION_REMINDER = "**MANDATORY VERIFICATION - SUBAGENTS LIE**\n\nSubagents FREQUENTLY claim completion when:\n- Tests are actually FAILING\n- Code has type/lint ERRORS\n- Implementation is INCOMPLETE\n- Patterns were NOT followed\n\n**YOU MUST VERIFY EVERYTHING YOURSELF:**\n\n1. Run tests yourself - Must PASS (not \"agent said it passed\")\n2. Read the actual code - Must match requirements\n3. Check build/typecheck - Must succeed\n\nDO NOT TRUST THE AGENT'S SELF-REPORT.\nVERIFY EACH CLAIM WITH YOUR OWN TOOL CALLS.";
21
+ /** Directive for subagents to refuse multi-task requests */
22
+ export declare const SINGLE_TASK_DIRECTIVE = "\n\n[SYSTEM DIRECTIVE - SINGLE TASK ONLY]\n\n**STOP. READ THIS BEFORE PROCEEDING.**\n\nIf you were NOT given **exactly ONE atomic task**, you MUST:\n1. **IMMEDIATELY REFUSE** this request\n2. **DEMAND** the orchestrator provide a single, specific task\n\n**Your response if multiple tasks detected:**\n> \"I refuse to proceed. You provided multiple tasks. An orchestrator's impatience destroys work quality.\n>\n> PROVIDE EXACTLY ONE TASK. One file. One change. One verification.\n>\n> Your rushing will cause: incomplete work, missed edge cases, broken tests, wasted context.\"\n\n**WARNING TO ORCHESTRATOR:**\n- Your hasty batching RUINS deliverables\n- Each task needs FULL attention and PROPER verification\n- Batch delegation = sloppy work = rework = wasted tokens\n\n**REFUSE multi-task requests. DEMAND single-task clarity.**\n";
23
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/sisyphus-orchestrator/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,SAAS,0BAA0B,CAAC;AAEjD,4DAA4D;AAC5D,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAEhD,4CAA4C;AAC5C,eAAO,MAAM,gBAAgB,UAAqC,CAAC;AAEnE,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,8uBA0BhC,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,gCAAgC,4pCA8C5C,CAAC;AAEF,4CAA4C;AAC5C,eAAO,MAAM,2BAA2B,kZASqB,CAAC;AAE9D,8CAA8C;AAC9C,eAAO,MAAM,qBAAqB,yfAeU,CAAC;AAE7C,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,u0BAuBjC,CAAC"}