oh-my-claude-sisyphus 3.5.8 → 3.6.1

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 (399) hide show
  1. package/agents/executor-high.md +2 -0
  2. package/agents/executor-low.md +2 -0
  3. package/agents/executor.md +2 -0
  4. package/agents/templates/base-agent.md +9 -0
  5. package/commands/cancel.md +8 -8
  6. package/commands/omc-setup.md +3 -3
  7. package/commands/release.md +1 -1
  8. package/commands/swarm.md +350 -148
  9. package/dist/__tests__/analytics/transcript-scanner.test.js +69 -27
  10. package/dist/__tests__/analytics/transcript-scanner.test.js.map +1 -1
  11. package/dist/__tests__/hooks.test.js +10 -9
  12. package/dist/__tests__/hooks.test.js.map +1 -1
  13. package/dist/__tests__/installer.test.js +2 -1
  14. package/dist/__tests__/installer.test.js.map +1 -1
  15. package/dist/agents/preamble.d.ts +14 -0
  16. package/dist/agents/preamble.d.ts.map +1 -0
  17. package/dist/agents/preamble.js +26 -0
  18. package/dist/agents/preamble.js.map +1 -0
  19. package/dist/analytics/session-manager.d.ts +24 -0
  20. package/dist/analytics/session-manager.d.ts.map +1 -1
  21. package/dist/analytics/session-manager.js +98 -9
  22. package/dist/analytics/session-manager.js.map +1 -1
  23. package/dist/analytics/transcript-scanner.d.ts +9 -8
  24. package/dist/analytics/transcript-scanner.d.ts.map +1 -1
  25. package/dist/analytics/transcript-scanner.js +146 -16
  26. package/dist/analytics/transcript-scanner.js.map +1 -1
  27. package/dist/cli/analytics.js +0 -0
  28. package/dist/cli/index.js +0 -0
  29. package/dist/hooks/autopilot/__tests__/cancel.test.js +14 -4
  30. package/dist/hooks/autopilot/__tests__/cancel.test.js.map +1 -1
  31. package/dist/hooks/autopilot/__tests__/state.test.js +1 -0
  32. package/dist/hooks/autopilot/__tests__/state.test.js.map +1 -1
  33. package/dist/hooks/autopilot/__tests__/summary.test.js +38 -3
  34. package/dist/hooks/autopilot/__tests__/summary.test.js.map +1 -1
  35. package/dist/hooks/autopilot/state.d.ts +1 -1
  36. package/dist/hooks/autopilot/state.d.ts.map +1 -1
  37. package/dist/hooks/autopilot/state.js +15 -8
  38. package/dist/hooks/autopilot/state.js.map +1 -1
  39. package/dist/hooks/empty-message-sanitizer/__tests__/index.test.d.ts +2 -0
  40. package/dist/hooks/empty-message-sanitizer/__tests__/index.test.d.ts.map +1 -0
  41. package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js +416 -0
  42. package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js.map +1 -0
  43. package/dist/hooks/index.d.ts +2 -0
  44. package/dist/hooks/index.d.ts.map +1 -1
  45. package/dist/hooks/index.js +7 -0
  46. package/dist/hooks/index.js.map +1 -1
  47. package/dist/hooks/keyword-detector/__tests__/index.test.d.ts +2 -0
  48. package/dist/hooks/keyword-detector/__tests__/index.test.d.ts.map +1 -0
  49. package/dist/hooks/keyword-detector/__tests__/index.test.js +427 -0
  50. package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -0
  51. package/dist/hooks/mode-registry/index.d.ts +135 -0
  52. package/dist/hooks/mode-registry/index.d.ts.map +1 -0
  53. package/dist/hooks/mode-registry/index.js +445 -0
  54. package/dist/hooks/mode-registry/index.js.map +1 -0
  55. package/dist/hooks/mode-registry/types.d.ts +31 -0
  56. package/dist/hooks/mode-registry/types.d.ts.map +1 -0
  57. package/dist/hooks/mode-registry/types.js +7 -0
  58. package/dist/hooks/mode-registry/types.js.map +1 -0
  59. package/dist/hooks/ralph/loop.js +6 -6
  60. package/dist/hooks/ralph/loop.js.map +1 -1
  61. package/dist/hooks/swarm/__tests__/claiming.test.d.ts +2 -0
  62. package/dist/hooks/swarm/__tests__/claiming.test.d.ts.map +1 -0
  63. package/dist/hooks/swarm/__tests__/claiming.test.js +170 -0
  64. package/dist/hooks/swarm/__tests__/claiming.test.js.map +1 -0
  65. package/dist/hooks/swarm/__tests__/index.test.d.ts +2 -0
  66. package/dist/hooks/swarm/__tests__/index.test.d.ts.map +1 -0
  67. package/dist/hooks/swarm/__tests__/index.test.js +157 -0
  68. package/dist/hooks/swarm/__tests__/index.test.js.map +1 -0
  69. package/dist/hooks/swarm/__tests__/mode-registry.test.d.ts +2 -0
  70. package/dist/hooks/swarm/__tests__/mode-registry.test.d.ts.map +1 -0
  71. package/dist/hooks/swarm/__tests__/mode-registry.test.js +177 -0
  72. package/dist/hooks/swarm/__tests__/mode-registry.test.js.map +1 -0
  73. package/dist/hooks/swarm/claiming.d.ts +101 -0
  74. package/dist/hooks/swarm/claiming.d.ts.map +1 -0
  75. package/dist/hooks/swarm/claiming.js +460 -0
  76. package/dist/hooks/swarm/claiming.js.map +1 -0
  77. package/dist/hooks/swarm/index.d.ts +221 -0
  78. package/dist/hooks/swarm/index.d.ts.map +1 -0
  79. package/dist/hooks/swarm/index.js +413 -0
  80. package/dist/hooks/swarm/index.js.map +1 -0
  81. package/dist/hooks/swarm/state.d.ts +94 -0
  82. package/dist/hooks/swarm/state.d.ts.map +1 -0
  83. package/dist/hooks/swarm/state.js +530 -0
  84. package/dist/hooks/swarm/state.js.map +1 -0
  85. package/dist/hooks/swarm/types.d.ts +116 -0
  86. package/dist/hooks/swarm/types.d.ts.map +1 -0
  87. package/dist/hooks/swarm/types.js +22 -0
  88. package/dist/hooks/swarm/types.js.map +1 -0
  89. package/dist/hooks/think-mode/__tests__/index.test.d.ts +2 -0
  90. package/dist/hooks/think-mode/__tests__/index.test.d.ts.map +1 -0
  91. package/dist/hooks/think-mode/__tests__/index.test.js +556 -0
  92. package/dist/hooks/think-mode/__tests__/index.test.js.map +1 -0
  93. package/dist/hooks/ultrapilot/decomposer.d.ts +141 -0
  94. package/dist/hooks/ultrapilot/decomposer.d.ts.map +1 -0
  95. package/dist/hooks/ultrapilot/decomposer.js +377 -0
  96. package/dist/hooks/ultrapilot/decomposer.js.map +1 -0
  97. package/dist/hooks/ultrapilot/index.d.ts +31 -0
  98. package/dist/hooks/ultrapilot/index.d.ts.map +1 -1
  99. package/dist/hooks/ultrapilot/index.js +43 -2
  100. package/dist/hooks/ultrapilot/index.js.map +1 -1
  101. package/dist/hooks/ultrapilot/state.d.ts +1 -1
  102. package/dist/hooks/ultrapilot/state.d.ts.map +1 -1
  103. package/dist/hooks/ultrapilot/state.js +7 -0
  104. package/dist/hooks/ultrapilot/state.js.map +1 -1
  105. package/dist/hooks/ultraqa/index.js +5 -5
  106. package/dist/hooks/ultraqa/index.js.map +1 -1
  107. package/dist/hooks/ultrawork/index.js +3 -3
  108. package/dist/hooks/ultrawork/index.js.map +1 -1
  109. package/dist/installer/index.d.ts.map +1 -1
  110. package/dist/installer/index.js +8 -0
  111. package/dist/installer/index.js.map +1 -1
  112. package/package.json +3 -1
  113. package/skills/autopilot/SKILL.md +18 -0
  114. package/skills/cancel/SKILL.md +166 -141
  115. package/skills/ecomode/SKILL.md +14 -0
  116. package/skills/omc-setup/SKILL.md +27 -3
  117. package/skills/pipeline/SKILL.md +13 -0
  118. package/skills/ralph/SKILL.md +22 -1
  119. package/skills/release/SKILL.md +1 -1
  120. package/skills/swarm/SKILL.md +521 -197
  121. package/skills/ultrapilot/SKILL.md +82 -13
  122. package/skills/ultraqa/SKILL.md +13 -0
  123. package/skills/ultrawork/SKILL.md +14 -0
  124. package/dist/__tests__/analytics/analytics-summary.test.d.ts +0 -2
  125. package/dist/__tests__/analytics/analytics-summary.test.d.ts.map +0 -1
  126. package/dist/__tests__/analytics/analytics-summary.test.js +0 -267
  127. package/dist/__tests__/analytics/analytics-summary.test.js.map +0 -1
  128. package/dist/__tests__/analytics/cost-estimator.test.d.ts +0 -2
  129. package/dist/__tests__/analytics/cost-estimator.test.d.ts.map +0 -1
  130. package/dist/__tests__/analytics/cost-estimator.test.js +0 -212
  131. package/dist/__tests__/analytics/cost-estimator.test.js.map +0 -1
  132. package/dist/__tests__/hooks/auto-slash-command/executor.test.d.ts +0 -7
  133. package/dist/__tests__/hooks/auto-slash-command/executor.test.d.ts.map +0 -1
  134. package/dist/__tests__/hooks/auto-slash-command/executor.test.js +0 -374
  135. package/dist/__tests__/hooks/auto-slash-command/executor.test.js.map +0 -1
  136. package/dist/__tests__/hud/auto-tracking.integration.test.d.ts +0 -2
  137. package/dist/__tests__/hud/auto-tracking.integration.test.d.ts.map +0 -1
  138. package/dist/__tests__/hud/auto-tracking.integration.test.js +0 -12
  139. package/dist/__tests__/hud/auto-tracking.integration.test.js.map +0 -1
  140. package/dist/__tests__/learned-skills/config.test.d.ts +0 -2
  141. package/dist/__tests__/learned-skills/config.test.d.ts.map +0 -1
  142. package/dist/__tests__/learned-skills/config.test.js +0 -37
  143. package/dist/__tests__/learned-skills/config.test.js.map +0 -1
  144. package/dist/__tests__/learned-skills/detector.test.d.ts +0 -2
  145. package/dist/__tests__/learned-skills/detector.test.d.ts.map +0 -1
  146. package/dist/__tests__/learned-skills/detector.test.js +0 -99
  147. package/dist/__tests__/learned-skills/detector.test.js.map +0 -1
  148. package/dist/__tests__/learned-skills/finder.test.d.ts +0 -2
  149. package/dist/__tests__/learned-skills/finder.test.d.ts.map +0 -1
  150. package/dist/__tests__/learned-skills/finder.test.js +0 -59
  151. package/dist/__tests__/learned-skills/finder.test.js.map +0 -1
  152. package/dist/__tests__/learned-skills/loader.test.d.ts +0 -2
  153. package/dist/__tests__/learned-skills/loader.test.d.ts.map +0 -1
  154. package/dist/__tests__/learned-skills/loader.test.js +0 -69
  155. package/dist/__tests__/learned-skills/loader.test.js.map +0 -1
  156. package/dist/__tests__/learned-skills/parser.test.d.ts +0 -2
  157. package/dist/__tests__/learned-skills/parser.test.d.ts.map +0 -1
  158. package/dist/__tests__/learned-skills/parser.test.js +0 -81
  159. package/dist/__tests__/learned-skills/parser.test.js.map +0 -1
  160. package/dist/__tests__/learned-skills/validator.test.d.ts +0 -2
  161. package/dist/__tests__/learned-skills/validator.test.d.ts.map +0 -1
  162. package/dist/__tests__/learned-skills/validator.test.js +0 -85
  163. package/dist/__tests__/learned-skills/validator.test.js.map +0 -1
  164. package/dist/agents/document-writer.d.ts +0 -11
  165. package/dist/agents/document-writer.d.ts.map +0 -1
  166. package/dist/agents/document-writer.js +0 -209
  167. package/dist/agents/document-writer.js.map +0 -1
  168. package/dist/agents/frontend-engineer.d.ts +0 -11
  169. package/dist/agents/frontend-engineer.d.ts.map +0 -1
  170. package/dist/agents/frontend-engineer.js +0 -115
  171. package/dist/agents/frontend-engineer.js.map +0 -1
  172. package/dist/agents/librarian.d.ts +0 -12
  173. package/dist/agents/librarian.d.ts.map +0 -1
  174. package/dist/agents/librarian.js +0 -103
  175. package/dist/agents/librarian.js.map +0 -1
  176. package/dist/agents/metis.d.ts +0 -12
  177. package/dist/agents/metis.d.ts.map +0 -1
  178. package/dist/agents/metis.js +0 -117
  179. package/dist/agents/metis.js.map +0 -1
  180. package/dist/agents/momus.d.ts +0 -12
  181. package/dist/agents/momus.d.ts.map +0 -1
  182. package/dist/agents/momus.js +0 -128
  183. package/dist/agents/momus.js.map +0 -1
  184. package/dist/agents/multimodal-looker.d.ts +0 -11
  185. package/dist/agents/multimodal-looker.d.ts.map +0 -1
  186. package/dist/agents/multimodal-looker.js +0 -70
  187. package/dist/agents/multimodal-looker.js.map +0 -1
  188. package/dist/agents/oracle.d.ts +0 -13
  189. package/dist/agents/oracle.d.ts.map +0 -1
  190. package/dist/agents/oracle.js +0 -191
  191. package/dist/agents/oracle.js.map +0 -1
  192. package/dist/agents/orchestrator-sisyphus.d.ts +0 -11
  193. package/dist/agents/orchestrator-sisyphus.d.ts.map +0 -1
  194. package/dist/agents/orchestrator-sisyphus.js +0 -115
  195. package/dist/agents/orchestrator-sisyphus.js.map +0 -1
  196. package/dist/agents/prometheus.d.ts +0 -12
  197. package/dist/agents/prometheus.d.ts.map +0 -1
  198. package/dist/agents/prometheus.js +0 -195
  199. package/dist/agents/prometheus.js.map +0 -1
  200. package/dist/agents/sisyphus-junior.d.ts +0 -12
  201. package/dist/agents/sisyphus-junior.d.ts.map +0 -1
  202. package/dist/agents/sisyphus-junior.js +0 -93
  203. package/dist/agents/sisyphus-junior.js.map +0 -1
  204. package/dist/cli/components/CostDashboard.d.ts +0 -15
  205. package/dist/cli/components/CostDashboard.d.ts.map +0 -1
  206. package/dist/cli/components/CostDashboard.js +0 -15
  207. package/dist/cli/components/CostDashboard.js.map +0 -1
  208. package/dist/cli/components/LiveStats.d.ts +0 -16
  209. package/dist/cli/components/LiveStats.d.ts.map +0 -1
  210. package/dist/cli/components/LiveStats.js +0 -16
  211. package/dist/cli/components/LiveStats.js.map +0 -1
  212. package/dist/cli/components/SessionBrowser.d.ts +0 -14
  213. package/dist/cli/components/SessionBrowser.d.ts.map +0 -1
  214. package/dist/cli/components/SessionBrowser.js +0 -14
  215. package/dist/cli/components/SessionBrowser.js.map +0 -1
  216. package/dist/cli/tui.d.ts +0 -21
  217. package/dist/cli/tui.d.ts.map +0 -1
  218. package/dist/cli/tui.js +0 -21
  219. package/dist/cli/tui.js.map +0 -1
  220. package/dist/hooks/autopilot/signals.d.ts +0 -20
  221. package/dist/hooks/autopilot/signals.d.ts.map +0 -1
  222. package/dist/hooks/autopilot/signals.js +0 -75
  223. package/dist/hooks/autopilot/signals.js.map +0 -1
  224. package/dist/hooks/autopilot/summary.d.ts +0 -27
  225. package/dist/hooks/autopilot/summary.d.ts.map +0 -1
  226. package/dist/hooks/autopilot/summary.js +0 -160
  227. package/dist/hooks/autopilot/summary.js.map +0 -1
  228. package/dist/hooks/autopilot/transition.d.ts +0 -39
  229. package/dist/hooks/autopilot/transition.d.ts.map +0 -1
  230. package/dist/hooks/autopilot/transition.js +0 -216
  231. package/dist/hooks/autopilot/transition.js.map +0 -1
  232. package/dist/hooks/context-window-limit-recovery/constants.d.ts +0 -28
  233. package/dist/hooks/context-window-limit-recovery/constants.d.ts.map +0 -1
  234. package/dist/hooks/context-window-limit-recovery/constants.js +0 -85
  235. package/dist/hooks/context-window-limit-recovery/constants.js.map +0 -1
  236. package/dist/hooks/context-window-limit-recovery/index.d.ts +0 -62
  237. package/dist/hooks/context-window-limit-recovery/index.d.ts.map +0 -1
  238. package/dist/hooks/context-window-limit-recovery/index.js +0 -201
  239. package/dist/hooks/context-window-limit-recovery/index.js.map +0 -1
  240. package/dist/hooks/context-window-limit-recovery/parser.d.ts +0 -31
  241. package/dist/hooks/context-window-limit-recovery/parser.d.ts.map +0 -1
  242. package/dist/hooks/context-window-limit-recovery/parser.js +0 -241
  243. package/dist/hooks/context-window-limit-recovery/parser.js.map +0 -1
  244. package/dist/hooks/context-window-limit-recovery/types.d.ts +0 -84
  245. package/dist/hooks/context-window-limit-recovery/types.d.ts.map +0 -1
  246. package/dist/hooks/context-window-limit-recovery/types.js +0 -34
  247. package/dist/hooks/context-window-limit-recovery/types.js.map +0 -1
  248. package/dist/hooks/edit-error-recovery/index.d.ts +0 -62
  249. package/dist/hooks/edit-error-recovery/index.d.ts.map +0 -1
  250. package/dist/hooks/edit-error-recovery/index.js +0 -89
  251. package/dist/hooks/edit-error-recovery/index.js.map +0 -1
  252. package/dist/hooks/learned-skills/config.d.ts +0 -53
  253. package/dist/hooks/learned-skills/config.d.ts.map +0 -1
  254. package/dist/hooks/learned-skills/config.js +0 -103
  255. package/dist/hooks/learned-skills/config.js.map +0 -1
  256. package/dist/hooks/learned-skills/constants.d.ts +0 -24
  257. package/dist/hooks/learned-skills/constants.d.ts.map +0 -1
  258. package/dist/hooks/learned-skills/constants.js +0 -26
  259. package/dist/hooks/learned-skills/constants.js.map +0 -1
  260. package/dist/hooks/learned-skills/detection-hook.d.ts +0 -39
  261. package/dist/hooks/learned-skills/detection-hook.d.ts.map +0 -1
  262. package/dist/hooks/learned-skills/detection-hook.js +0 -83
  263. package/dist/hooks/learned-skills/detection-hook.js.map +0 -1
  264. package/dist/hooks/learned-skills/detector.d.ts +0 -30
  265. package/dist/hooks/learned-skills/detector.d.ts.map +0 -1
  266. package/dist/hooks/learned-skills/detector.js +0 -150
  267. package/dist/hooks/learned-skills/detector.js.map +0 -1
  268. package/dist/hooks/learned-skills/finder.d.ts +0 -21
  269. package/dist/hooks/learned-skills/finder.d.ts.map +0 -1
  270. package/dist/hooks/learned-skills/finder.js +0 -117
  271. package/dist/hooks/learned-skills/finder.js.map +0 -1
  272. package/dist/hooks/learned-skills/index.d.ts +0 -62
  273. package/dist/hooks/learned-skills/index.d.ts.map +0 -1
  274. package/dist/hooks/learned-skills/index.js +0 -137
  275. package/dist/hooks/learned-skills/index.js.map +0 -1
  276. package/dist/hooks/learned-skills/loader.d.ts +0 -20
  277. package/dist/hooks/learned-skills/loader.d.ts.map +0 -1
  278. package/dist/hooks/learned-skills/loader.js +0 -107
  279. package/dist/hooks/learned-skills/loader.js.map +0 -1
  280. package/dist/hooks/learned-skills/parser.d.ts +0 -21
  281. package/dist/hooks/learned-skills/parser.d.ts.map +0 -1
  282. package/dist/hooks/learned-skills/parser.js +0 -190
  283. package/dist/hooks/learned-skills/parser.js.map +0 -1
  284. package/dist/hooks/learned-skills/promotion.d.ts +0 -29
  285. package/dist/hooks/learned-skills/promotion.d.ts.map +0 -1
  286. package/dist/hooks/learned-skills/promotion.js +0 -87
  287. package/dist/hooks/learned-skills/promotion.js.map +0 -1
  288. package/dist/hooks/learned-skills/types.d.ts +0 -109
  289. package/dist/hooks/learned-skills/types.d.ts.map +0 -1
  290. package/dist/hooks/learned-skills/types.js +0 -8
  291. package/dist/hooks/learned-skills/types.js.map +0 -1
  292. package/dist/hooks/learned-skills/validator.d.ts +0 -15
  293. package/dist/hooks/learned-skills/validator.d.ts.map +0 -1
  294. package/dist/hooks/learned-skills/validator.js +0 -87
  295. package/dist/hooks/learned-skills/validator.js.map +0 -1
  296. package/dist/hooks/learned-skills/writer.d.ts +0 -27
  297. package/dist/hooks/learned-skills/writer.d.ts.map +0 -1
  298. package/dist/hooks/learned-skills/writer.js +0 -126
  299. package/dist/hooks/learned-skills/writer.js.map +0 -1
  300. package/dist/hooks/mnemosyne/config.d.ts +0 -53
  301. package/dist/hooks/mnemosyne/config.d.ts.map +0 -1
  302. package/dist/hooks/mnemosyne/config.js +0 -103
  303. package/dist/hooks/mnemosyne/config.js.map +0 -1
  304. package/dist/hooks/mnemosyne/constants.d.ts +0 -24
  305. package/dist/hooks/mnemosyne/constants.d.ts.map +0 -1
  306. package/dist/hooks/mnemosyne/constants.js +0 -26
  307. package/dist/hooks/mnemosyne/constants.js.map +0 -1
  308. package/dist/hooks/mnemosyne/detection-hook.d.ts +0 -39
  309. package/dist/hooks/mnemosyne/detection-hook.d.ts.map +0 -1
  310. package/dist/hooks/mnemosyne/detection-hook.js +0 -83
  311. package/dist/hooks/mnemosyne/detection-hook.js.map +0 -1
  312. package/dist/hooks/mnemosyne/detector.d.ts +0 -30
  313. package/dist/hooks/mnemosyne/detector.d.ts.map +0 -1
  314. package/dist/hooks/mnemosyne/detector.js +0 -150
  315. package/dist/hooks/mnemosyne/detector.js.map +0 -1
  316. package/dist/hooks/mnemosyne/finder.d.ts +0 -21
  317. package/dist/hooks/mnemosyne/finder.d.ts.map +0 -1
  318. package/dist/hooks/mnemosyne/finder.js +0 -117
  319. package/dist/hooks/mnemosyne/finder.js.map +0 -1
  320. package/dist/hooks/mnemosyne/index.d.ts +0 -62
  321. package/dist/hooks/mnemosyne/index.d.ts.map +0 -1
  322. package/dist/hooks/mnemosyne/index.js +0 -137
  323. package/dist/hooks/mnemosyne/index.js.map +0 -1
  324. package/dist/hooks/mnemosyne/loader.d.ts +0 -20
  325. package/dist/hooks/mnemosyne/loader.d.ts.map +0 -1
  326. package/dist/hooks/mnemosyne/loader.js +0 -113
  327. package/dist/hooks/mnemosyne/loader.js.map +0 -1
  328. package/dist/hooks/mnemosyne/parser.d.ts +0 -21
  329. package/dist/hooks/mnemosyne/parser.d.ts.map +0 -1
  330. package/dist/hooks/mnemosyne/parser.js +0 -190
  331. package/dist/hooks/mnemosyne/parser.js.map +0 -1
  332. package/dist/hooks/mnemosyne/promotion.d.ts +0 -29
  333. package/dist/hooks/mnemosyne/promotion.d.ts.map +0 -1
  334. package/dist/hooks/mnemosyne/promotion.js +0 -87
  335. package/dist/hooks/mnemosyne/promotion.js.map +0 -1
  336. package/dist/hooks/mnemosyne/types.d.ts +0 -109
  337. package/dist/hooks/mnemosyne/types.d.ts.map +0 -1
  338. package/dist/hooks/mnemosyne/types.js +0 -8
  339. package/dist/hooks/mnemosyne/types.js.map +0 -1
  340. package/dist/hooks/mnemosyne/validator.d.ts +0 -15
  341. package/dist/hooks/mnemosyne/validator.d.ts.map +0 -1
  342. package/dist/hooks/mnemosyne/validator.js +0 -87
  343. package/dist/hooks/mnemosyne/validator.js.map +0 -1
  344. package/dist/hooks/mnemosyne/writer.d.ts +0 -27
  345. package/dist/hooks/mnemosyne/writer.d.ts.map +0 -1
  346. package/dist/hooks/mnemosyne/writer.js +0 -126
  347. package/dist/hooks/mnemosyne/writer.js.map +0 -1
  348. package/dist/hooks/ralph-loop/index.d.ts +0 -116
  349. package/dist/hooks/ralph-loop/index.d.ts.map +0 -1
  350. package/dist/hooks/ralph-loop/index.js +0 -322
  351. package/dist/hooks/ralph-loop/index.js.map +0 -1
  352. package/dist/hooks/ralph-prd/index.d.ts +0 -130
  353. package/dist/hooks/ralph-prd/index.d.ts.map +0 -1
  354. package/dist/hooks/ralph-prd/index.js +0 -310
  355. package/dist/hooks/ralph-prd/index.js.map +0 -1
  356. package/dist/hooks/ralph-progress/index.d.ts +0 -102
  357. package/dist/hooks/ralph-progress/index.d.ts.map +0 -1
  358. package/dist/hooks/ralph-progress/index.js +0 -408
  359. package/dist/hooks/ralph-progress/index.js.map +0 -1
  360. package/dist/hooks/ralph-verifier/index.d.ts +0 -72
  361. package/dist/hooks/ralph-verifier/index.d.ts.map +0 -1
  362. package/dist/hooks/ralph-verifier/index.js +0 -223
  363. package/dist/hooks/ralph-verifier/index.js.map +0 -1
  364. package/dist/hooks/session-recovery/constants.d.ts +0 -56
  365. package/dist/hooks/session-recovery/constants.d.ts.map +0 -1
  366. package/dist/hooks/session-recovery/constants.js +0 -78
  367. package/dist/hooks/session-recovery/constants.js.map +0 -1
  368. package/dist/hooks/session-recovery/index.d.ts +0 -53
  369. package/dist/hooks/session-recovery/index.d.ts.map +0 -1
  370. package/dist/hooks/session-recovery/index.js +0 -321
  371. package/dist/hooks/session-recovery/index.js.map +0 -1
  372. package/dist/hooks/session-recovery/storage.d.ts +0 -76
  373. package/dist/hooks/session-recovery/storage.d.ts.map +0 -1
  374. package/dist/hooks/session-recovery/storage.js +0 -383
  375. package/dist/hooks/session-recovery/storage.js.map +0 -1
  376. package/dist/hooks/session-recovery/types.d.ts +0 -145
  377. package/dist/hooks/session-recovery/types.d.ts.map +0 -1
  378. package/dist/hooks/session-recovery/types.js +0 -8
  379. package/dist/hooks/session-recovery/types.js.map +0 -1
  380. package/dist/hooks/sisyphus-orchestrator/constants.d.ts +0 -23
  381. package/dist/hooks/sisyphus-orchestrator/constants.d.ts.map +0 -1
  382. package/dist/hooks/sisyphus-orchestrator/constants.js +0 -142
  383. package/dist/hooks/sisyphus-orchestrator/constants.js.map +0 -1
  384. package/dist/hooks/sisyphus-orchestrator/index.d.ts +0 -113
  385. package/dist/hooks/sisyphus-orchestrator/index.d.ts.map +0 -1
  386. package/dist/hooks/sisyphus-orchestrator/index.js +0 -309
  387. package/dist/hooks/sisyphus-orchestrator/index.js.map +0 -1
  388. package/dist/hooks/ultraqa-loop/index.d.ts +0 -94
  389. package/dist/hooks/ultraqa-loop/index.d.ts.map +0 -1
  390. package/dist/hooks/ultraqa-loop/index.js +0 -216
  391. package/dist/hooks/ultraqa-loop/index.js.map +0 -1
  392. package/dist/hooks/ultrawork-state/index.d.ts +0 -62
  393. package/dist/hooks/ultrawork-state/index.d.ts.map +0 -1
  394. package/dist/hooks/ultrawork-state/index.js +0 -208
  395. package/dist/hooks/ultrawork-state/index.js.map +0 -1
  396. package/dist/hud/sisyphus-state.d.ts +0 -31
  397. package/dist/hud/sisyphus-state.d.ts.map +0 -1
  398. package/dist/hud/sisyphus-state.js +0 -163
  399. package/dist/hud/sisyphus-state.js.map +0 -1
@@ -1,223 +0,0 @@
1
- /**
2
- * Ralph Verifier
3
- *
4
- * Adds architect verification to ralph completion claims.
5
- * When ralph outputs a completion promise, instead of immediately
6
- * accepting it, we trigger an architect verification phase.
7
- *
8
- * Flow:
9
- * 1. Ralph outputs <promise>TASK_COMPLETE</promise>
10
- * 2. System detects this and enters verification mode
11
- * 3. Architect agent is invoked to verify the work
12
- * 4. If architect approves -> truly complete
13
- * 5. If architect finds flaws -> continue ralph with architect feedback
14
- */
15
- import { existsSync, readFileSync, writeFileSync, unlinkSync, mkdirSync } from 'fs';
16
- import { join } from 'path';
17
- const DEFAULT_MAX_VERIFICATION_ATTEMPTS = 3;
18
- /**
19
- * Get verification state file path
20
- */
21
- function getVerificationStatePath(directory) {
22
- return join(directory, '.omc', 'ralph-verification.json');
23
- }
24
- /**
25
- * Read verification state
26
- */
27
- export function readVerificationState(directory) {
28
- const statePath = getVerificationStatePath(directory);
29
- if (!existsSync(statePath)) {
30
- return null;
31
- }
32
- try {
33
- return JSON.parse(readFileSync(statePath, 'utf-8'));
34
- }
35
- catch {
36
- return null;
37
- }
38
- }
39
- /**
40
- * Write verification state
41
- */
42
- export function writeVerificationState(directory, state) {
43
- const statePath = getVerificationStatePath(directory);
44
- const stateDir = join(directory, '.omc');
45
- if (!existsSync(stateDir)) {
46
- try {
47
- mkdirSync(stateDir, { recursive: true });
48
- }
49
- catch {
50
- return false;
51
- }
52
- }
53
- try {
54
- writeFileSync(statePath, JSON.stringify(state, null, 2));
55
- return true;
56
- }
57
- catch {
58
- return false;
59
- }
60
- }
61
- /**
62
- * Clear verification state
63
- */
64
- export function clearVerificationState(directory) {
65
- const statePath = getVerificationStatePath(directory);
66
- if (existsSync(statePath)) {
67
- try {
68
- unlinkSync(statePath);
69
- return true;
70
- }
71
- catch {
72
- return false;
73
- }
74
- }
75
- return true;
76
- }
77
- /**
78
- * Start verification process
79
- */
80
- export function startVerification(directory, completionClaim, originalTask) {
81
- const state = {
82
- pending: true,
83
- completion_claim: completionClaim,
84
- verification_attempts: 0,
85
- max_verification_attempts: DEFAULT_MAX_VERIFICATION_ATTEMPTS,
86
- requested_at: new Date().toISOString(),
87
- original_task: originalTask
88
- };
89
- writeVerificationState(directory, state);
90
- return state;
91
- }
92
- /**
93
- * Record architect feedback
94
- */
95
- export function recordArchitectFeedback(directory, approved, feedback) {
96
- const state = readVerificationState(directory);
97
- if (!state) {
98
- return null;
99
- }
100
- state.verification_attempts += 1;
101
- state.architect_approved = approved;
102
- state.architect_feedback = feedback;
103
- if (approved) {
104
- // Clear state on approval
105
- clearVerificationState(directory);
106
- return { ...state, pending: false };
107
- }
108
- // Check if max attempts reached
109
- if (state.verification_attempts >= state.max_verification_attempts) {
110
- clearVerificationState(directory);
111
- return { ...state, pending: false };
112
- }
113
- // Continue verification loop
114
- writeVerificationState(directory, state);
115
- return state;
116
- }
117
- /**
118
- * Generate architect verification prompt
119
- */
120
- export function getArchitectVerificationPrompt(state) {
121
- return `<ralph-verification>
122
-
123
- [ARCHITECT VERIFICATION REQUIRED - Attempt ${state.verification_attempts + 1}/${state.max_verification_attempts}]
124
-
125
- The agent claims the task is complete. Before accepting, YOU MUST verify with Architect.
126
-
127
- **Original Task:**
128
- ${state.original_task}
129
-
130
- **Completion Claim:**
131
- ${state.completion_claim}
132
-
133
- ${state.architect_feedback ? `**Previous Architect Feedback (rejected):**\n${state.architect_feedback}\n` : ''}
134
-
135
- ## MANDATORY VERIFICATION STEPS
136
-
137
- 1. **Spawn Architect Agent** for verification:
138
- \`\`\`
139
- Task(subagent_type="architect", prompt="Verify this task completion claim...")
140
- \`\`\`
141
-
142
- 2. **Architect must check:**
143
- - Are ALL requirements from the original task met?
144
- - Is the implementation complete, not partial?
145
- - Are there any obvious bugs or issues?
146
- - Does the code compile/run without errors?
147
- - Are tests passing (if applicable)?
148
-
149
- 3. **Based on Architect's response:**
150
- - If APPROVED: Output \`<architect-approved>VERIFIED_COMPLETE</architect-approved>\`
151
- - If REJECTED: Continue working on the identified issues
152
-
153
- DO NOT output the completion promise again until Architect approves.
154
-
155
- </ralph-verification>
156
-
157
- ---
158
-
159
- `;
160
- }
161
- /**
162
- * Generate continuation prompt after architect rejection
163
- */
164
- export function getArchitectRejectionContinuationPrompt(state) {
165
- return `<ralph-continuation-after-rejection>
166
-
167
- [ARCHITECT REJECTED - Continue Working]
168
-
169
- Architect found issues with your completion claim. You must address them.
170
-
171
- **Architect Feedback:**
172
- ${state.architect_feedback}
173
-
174
- **Original Task:**
175
- ${state.original_task}
176
-
177
- ## INSTRUCTIONS
178
-
179
- 1. Address ALL issues identified by Architect
180
- 2. Do NOT claim completion again until issues are fixed
181
- 3. When truly done, output the completion promise again
182
- 4. Another Architect verification will be triggered
183
-
184
- Continue working now.
185
-
186
- </ralph-continuation-after-rejection>
187
-
188
- ---
189
-
190
- `;
191
- }
192
- /**
193
- * Check if text contains architect approval
194
- */
195
- export function detectArchitectApproval(text) {
196
- return /<architect-approved>.*?VERIFIED_COMPLETE.*?<\/architect-approved>/is.test(text);
197
- }
198
- /**
199
- * Check if text contains architect rejection indicators
200
- */
201
- export function detectArchitectRejection(text) {
202
- // Look for explicit rejection patterns
203
- const rejectionPatterns = [
204
- /architect.*?(rejected|found issues|not complete|incomplete)/i,
205
- /issues? (found|identified|detected)/i,
206
- /not yet complete/i,
207
- /missing.*?(implementation|feature|test)/i,
208
- /bug.*?(found|detected|identified)/i,
209
- /error.*?(found|detected|identified)/i
210
- ];
211
- for (const pattern of rejectionPatterns) {
212
- if (pattern.test(text)) {
213
- // Extract feedback (rough heuristic)
214
- const feedbackMatch = text.match(/(?:architect|feedback|issue|problem|error|bug)[:\s]+([^.]+\.)/i);
215
- return {
216
- rejected: true,
217
- feedback: feedbackMatch ? feedbackMatch[1] : 'Architect found issues with the implementation.'
218
- };
219
- }
220
- }
221
- return { rejected: false, feedback: '' };
222
- }
223
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/ralph-verifier/index.ts"],"names":[],"mappings":"A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AC;IAEF,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;QACxC,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACvB,qCAAqC;YACrC,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;YACnG,OAAO;gBACL,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iDAAiD;aAC/F,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC3C,CAAC"}
@@ -1,56 +0,0 @@
1
- /**
2
- * Session Recovery Constants
3
- *
4
- * Constants for session recovery including storage paths and recovery messages.
5
- * Adapted from oh-my-opencode's session-recovery hook.
6
- */
7
- export declare const CLAUDE_CODE_STORAGE: string;
8
- export declare const MESSAGE_STORAGE: string;
9
- export declare const PART_STORAGE: string;
10
- /**
11
- * Part type sets for categorization
12
- */
13
- export declare const THINKING_TYPES: Set<string>;
14
- export declare const META_TYPES: Set<string>;
15
- export declare const CONTENT_TYPES: Set<string>;
16
- /**
17
- * Recovery messages
18
- */
19
- export declare const RECOVERY_RESUME_TEXT = "[session recovered - continuing previous task]";
20
- export declare const PLACEHOLDER_TEXT = "[user interrupted]";
21
- /**
22
- * Toast/notification messages for recovery
23
- */
24
- export declare const RECOVERY_MESSAGES: {
25
- readonly tool_result_missing: {
26
- readonly title: "Tool Crash Recovery";
27
- readonly message: "Injecting cancelled tool results...";
28
- };
29
- readonly thinking_block_order: {
30
- readonly title: "Thinking Block Recovery";
31
- readonly message: "Fixing message structure...";
32
- };
33
- readonly thinking_disabled_violation: {
34
- readonly title: "Thinking Strip Recovery";
35
- readonly message: "Stripping thinking blocks...";
36
- };
37
- readonly empty_content: {
38
- readonly title: "Empty Content Recovery";
39
- readonly message: "Adding placeholder content...";
40
- };
41
- };
42
- /**
43
- * Recovery error patterns
44
- */
45
- export declare const ERROR_PATTERNS: {
46
- readonly tool_result_missing: readonly ["tool_use", "tool_result"];
47
- readonly thinking_block_order: readonly ["thinking", "first block", "must start with", "preceeding", "final block", "cannot be thinking"];
48
- readonly thinking_disabled_violation: readonly ["thinking is disabled", "cannot contain"];
49
- readonly empty_content: readonly ["empty", "content", "message"];
50
- };
51
- /**
52
- * Debug logging configuration
53
- */
54
- export declare const DEBUG: boolean;
55
- export declare const DEBUG_LOG_PATH: string;
56
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/session-recovery/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoBH,eAAO,MAAM,mBAAmB,QAA4B,CAAC;AAC7D,eAAO,MAAM,eAAe,QAAuC,CAAC;AACpE,eAAO,MAAM,YAAY,QAAoC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,cAAc,aAA0D,CAAC;AACtF,eAAO,MAAM,UAAU,aAAyC,CAAC;AACjE,eAAO,MAAM,aAAa,aAAuD,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,oBAAoB,mDAAmD,CAAC;AACrF,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;CAiBpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;CAYjB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,KAAK,SAA6C,CAAC;AAChE,eAAO,MAAM,cAAc,QAA+C,CAAC"}
@@ -1,78 +0,0 @@
1
- /**
2
- * Session Recovery Constants
3
- *
4
- * Constants for session recovery including storage paths and recovery messages.
5
- * Adapted from oh-my-opencode's session-recovery hook.
6
- */
7
- import { join } from "node:path";
8
- import { homedir, tmpdir } from "node:os";
9
- /**
10
- * Get the data directory for Claude Code storage
11
- * Follows XDG Base Directory specification
12
- */
13
- function getDataDir() {
14
- return process.env.XDG_DATA_HOME ?? join(homedir(), ".local", "share");
15
- }
16
- /**
17
- * Get the Claude Code storage directory
18
- */
19
- function getClaudeCodeStorageDir() {
20
- return join(getDataDir(), "claude-code", "storage");
21
- }
22
- export const CLAUDE_CODE_STORAGE = getClaudeCodeStorageDir();
23
- export const MESSAGE_STORAGE = join(CLAUDE_CODE_STORAGE, "message");
24
- export const PART_STORAGE = join(CLAUDE_CODE_STORAGE, "part");
25
- /**
26
- * Part type sets for categorization
27
- */
28
- export const THINKING_TYPES = new Set(["thinking", "redacted_thinking", "reasoning"]);
29
- export const META_TYPES = new Set(["step-start", "step-finish"]);
30
- export const CONTENT_TYPES = new Set(["text", "tool", "tool_use", "tool_result"]);
31
- /**
32
- * Recovery messages
33
- */
34
- export const RECOVERY_RESUME_TEXT = "[session recovered - continuing previous task]";
35
- export const PLACEHOLDER_TEXT = "[user interrupted]";
36
- /**
37
- * Toast/notification messages for recovery
38
- */
39
- export const RECOVERY_MESSAGES = {
40
- tool_result_missing: {
41
- title: "Tool Crash Recovery",
42
- message: "Injecting cancelled tool results...",
43
- },
44
- thinking_block_order: {
45
- title: "Thinking Block Recovery",
46
- message: "Fixing message structure...",
47
- },
48
- thinking_disabled_violation: {
49
- title: "Thinking Strip Recovery",
50
- message: "Stripping thinking blocks...",
51
- },
52
- empty_content: {
53
- title: "Empty Content Recovery",
54
- message: "Adding placeholder content...",
55
- },
56
- };
57
- /**
58
- * Recovery error patterns
59
- */
60
- export const ERROR_PATTERNS = {
61
- tool_result_missing: ["tool_use", "tool_result"],
62
- thinking_block_order: [
63
- "thinking",
64
- "first block",
65
- "must start with",
66
- "preceeding",
67
- "final block",
68
- "cannot be thinking",
69
- ],
70
- thinking_disabled_violation: ["thinking is disabled", "cannot contain"],
71
- empty_content: ["empty", "content", "message"],
72
- };
73
- /**
74
- * Debug logging configuration
75
- */
76
- export const DEBUG = process.env.SESSION_RECOVERY_DEBUG === "1";
77
- export const DEBUG_LOG_PATH = join(tmpdir(), "session-recovery-debug.log");
78
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/session-recovery/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAE1C;;;GAGG;AACH,SAAS,UAAU;IACjB,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzE,CAAC;AAED;;GAEG;AACH,SAAS,uBAAuB;IAC9B,OAAO,IAAI,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,EAAE,CAAC;AAC7D,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,mBAAmB,EAAE,WAAW,CAAC,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;AAElF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,gDAAgD,CAAC;AACrF,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,mBAAmB,EAAE;QACnB,KAAK,EAAE,qBAAqB;QAC5B,OAAO,EAAE,qCAAqC;KAC/C;IACD,oBAAoB,EAAE;QACpB,KAAK,EAAE,yBAAyB;QAChC,OAAO,EAAE,6BAA6B;KACvC;IACD,2BAA2B,EAAE;QAC3B,KAAK,EAAE,yBAAyB;QAChC,OAAO,EAAE,8BAA8B;KACxC;IACD,aAAa,EAAE;QACb,KAAK,EAAE,wBAAwB;QAC/B,OAAO,EAAE,+BAA+B;KACzC;CACO,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,mBAAmB,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;IAChD,oBAAoB,EAAE;QACpB,UAAU;QACV,aAAa;QACb,iBAAiB;QACjB,YAAY;QACZ,aAAa;QACb,oBAAoB;KACrB;IACD,2BAA2B,EAAE,CAAC,sBAAsB,EAAE,gBAAgB,CAAC;IACvE,aAAa,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC;CACtC,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,GAAG,CAAC;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,4BAA4B,CAAC,CAAC"}
@@ -1,53 +0,0 @@
1
- /**
2
- * Session Recovery Hook
3
- *
4
- * Helps recover session state when Claude Code restarts or crashes.
5
- * Detects and fixes various error conditions that can cause session failures.
6
- *
7
- * Adapted from oh-my-opencode's session-recovery hook for Claude Code's
8
- * shell hook system.
9
- *
10
- * Recovery Strategies:
11
- * 1. Tool Result Missing: Inject cancelled tool results for orphaned tool_use
12
- * 2. Thinking Block Order: Fix messages where thinking isn't first
13
- * 3. Thinking Disabled: Strip thinking blocks when model doesn't support them
14
- * 4. Empty Content: Add placeholder text to empty messages
15
- */
16
- import type { MessageData, RecoveryErrorType, RecoveryResult, SessionRecoveryConfig } from "./types.js";
17
- /**
18
- * Detect the type of recoverable error
19
- */
20
- export declare function detectErrorType(error: unknown): RecoveryErrorType;
21
- /**
22
- * Check if an error is recoverable
23
- */
24
- export declare function isRecoverableError(error: unknown): boolean;
25
- /**
26
- * Main recovery handler
27
- */
28
- export declare function handleSessionRecovery(sessionID: string, error: unknown, failedMessage?: MessageData, config?: SessionRecoveryConfig): Promise<RecoveryResult>;
29
- /**
30
- * Create session recovery hook for Claude Code
31
- */
32
- export declare function createSessionRecoveryHook(config?: SessionRecoveryConfig): {
33
- /**
34
- * Check for errors during tool execution or message processing
35
- */
36
- onError: (input: {
37
- session_id: string;
38
- error: unknown;
39
- message?: MessageData;
40
- }) => Promise<RecoveryResult>;
41
- /**
42
- * Check if an error is recoverable
43
- */
44
- isRecoverable: (error: unknown) => boolean;
45
- /**
46
- * Get recovery message for an error type
47
- */
48
- getRecoveryMessage: (errorType: RecoveryErrorType) => string | undefined;
49
- };
50
- export type { MessageData, RecoveryErrorType, RecoveryResult, SessionRecoveryConfig, StoredMessageMeta, StoredPart, StoredTextPart, StoredToolPart, } from "./types.js";
51
- export { RECOVERY_MESSAGES, PLACEHOLDER_TEXT, } from "./constants.js";
52
- export { findEmptyMessages, findMessagesWithThinkingBlocks, findMessagesWithOrphanThinking, readMessages, readParts, } from "./storage.js";
53
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/session-recovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACtB,MAAM,YAAY,CAAC;AA4DpB;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CA+BjE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE1D;AA2LD;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,EACd,aAAa,CAAC,EAAE,WAAW,EAC3B,MAAM,CAAC,EAAE,qBAAqB,GAC7B,OAAO,CAAC,cAAc,CAAC,CAqDzB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,CAAC,EAAE,qBAAqB;IAIpE;;OAEG;qBACoB;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,OAAO,CAAC;QACf,OAAO,CAAC,EAAE,WAAW,CAAC;KACvB,KAAG,OAAO,CAAC,cAAc,CAAC;IAS3B;;OAEG;2BACoB,OAAO,KAAG,OAAO;IAIxC;;OAEG;oCAC6B,iBAAiB,KAAG,MAAM,GAAG,SAAS;EAMzE;AAGD,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,8BAA8B,EAC9B,8BAA8B,EAC9B,YAAY,EACZ,SAAS,GACV,MAAM,cAAc,CAAC"}