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,69 @@
1
+ export const HOOK_NAME = "non-interactive-env";
2
+ export const NON_INTERACTIVE_ENV = {
3
+ CI: "true",
4
+ DEBIAN_FRONTEND: "noninteractive",
5
+ GIT_TERMINAL_PROMPT: "0",
6
+ GCM_INTERACTIVE: "never",
7
+ HOMEBREW_NO_AUTO_UPDATE: "1",
8
+ // Block interactive editors - git rebase, commit, etc.
9
+ GIT_EDITOR: ":",
10
+ EDITOR: ":",
11
+ VISUAL: "",
12
+ GIT_SEQUENCE_EDITOR: ":",
13
+ GIT_MERGE_AUTOEDIT: "no",
14
+ // Block pagers
15
+ GIT_PAGER: "cat",
16
+ PAGER: "cat",
17
+ // NPM non-interactive
18
+ npm_config_yes: "true",
19
+ // Pip non-interactive
20
+ PIP_NO_INPUT: "1",
21
+ // Yarn non-interactive
22
+ YARN_ENABLE_IMMUTABLE_INSTALLS: "false",
23
+ };
24
+ /**
25
+ * Shell command guidance for non-interactive environments.
26
+ * These patterns should be followed to avoid hanging on user input.
27
+ */
28
+ export const SHELL_COMMAND_PATTERNS = {
29
+ // Package managers - always use non-interactive flags
30
+ npm: {
31
+ bad: ["npm init", "npm install (prompts)"],
32
+ good: ["npm init -y", "npm install --yes"],
33
+ },
34
+ apt: {
35
+ bad: ["apt-get install pkg"],
36
+ good: ["apt-get install -y pkg", "DEBIAN_FRONTEND=noninteractive apt-get install pkg"],
37
+ },
38
+ pip: {
39
+ bad: ["pip install pkg (with prompts)"],
40
+ good: ["pip install --no-input pkg", "PIP_NO_INPUT=1 pip install pkg"],
41
+ },
42
+ // Git operations - always provide messages/flags
43
+ git: {
44
+ bad: ["git commit", "git merge branch", "git add -p", "git rebase -i"],
45
+ good: ["git commit -m 'msg'", "git merge --no-edit branch", "git add .", "git rebase --no-edit"],
46
+ },
47
+ // System commands - force flags
48
+ system: {
49
+ bad: ["rm file (prompts)", "cp a b (prompts)", "ssh host"],
50
+ good: ["rm -f file", "cp -f a b", "ssh -o BatchMode=yes host", "unzip -o file.zip"],
51
+ },
52
+ // Banned commands - will always hang
53
+ banned: [
54
+ "vim", "nano", "vi", "emacs", // Editors
55
+ "less", "more", "man", // Pagers
56
+ "python (REPL)", "node (REPL)", // REPLs without -c/-e
57
+ "git add -p", "git rebase -i", // Interactive git modes
58
+ ],
59
+ // Workarounds for scripts that require input
60
+ workarounds: {
61
+ yesPipe: "yes | ./script.sh",
62
+ heredoc: `./script.sh <<EOF
63
+ option1
64
+ option2
65
+ EOF`,
66
+ expectAlternative: "Use environment variables or config files instead of expect",
67
+ },
68
+ };
69
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG,qBAAqB,CAAA;AAE9C,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,EAAE,EAAE,MAAM;IACV,eAAe,EAAE,gBAAgB;IACjC,mBAAmB,EAAE,GAAG;IACxB,eAAe,EAAE,OAAO;IACxB,uBAAuB,EAAE,GAAG;IAC5B,uDAAuD;IACvD,UAAU,EAAE,GAAG;IACf,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,EAAE;IACV,mBAAmB,EAAE,GAAG;IACxB,kBAAkB,EAAE,IAAI;IACxB,eAAe;IACf,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,KAAK;IACZ,sBAAsB;IACtB,cAAc,EAAE,MAAM;IACtB,sBAAsB;IACtB,YAAY,EAAE,GAAG;IACjB,uBAAuB;IACvB,8BAA8B,EAAE,OAAO;CACxC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,sDAAsD;IACtD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,UAAU,EAAE,uBAAuB,CAAC;QAC1C,IAAI,EAAE,CAAC,aAAa,EAAE,mBAAmB,CAAC;KAC3C;IACD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,qBAAqB,CAAC;QAC5B,IAAI,EAAE,CAAC,wBAAwB,EAAE,oDAAoD,CAAC;KACvF;IACD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,gCAAgC,CAAC;QACvC,IAAI,EAAE,CAAC,4BAA4B,EAAE,gCAAgC,CAAC;KACvE;IACD,iDAAiD;IACjD,GAAG,EAAE;QACH,GAAG,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,CAAC;QACtE,IAAI,EAAE,CAAC,qBAAqB,EAAE,4BAA4B,EAAE,WAAW,EAAE,sBAAsB,CAAC;KACjG;IACD,gCAAgC;IAChC,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,UAAU,CAAC;QAC1D,IAAI,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,2BAA2B,EAAE,mBAAmB,CAAC;KACpF;IACD,qCAAqC;IACrC,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAY,UAAU;QAClD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAoB,SAAS;QAClD,eAAe,EAAE,aAAa,EAAW,sBAAsB;QAC/D,YAAY,EAAE,eAAe,EAAY,wBAAwB;KAClE;IACD,6CAA6C;IAC7C,WAAW,EAAE;QACX,OAAO,EAAE,mBAAmB;QAC5B,OAAO,EAAE;;;IAGT;QACA,iBAAiB,EAAE,6DAA6D;KACjF;CACO,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function isNonInteractive(): boolean;
2
+ //# sourceMappingURL=detector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/detector.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,IAAI,OAAO,CAkB1C"}
@@ -0,0 +1,16 @@
1
+ export function isNonInteractive() {
2
+ if (process.env.CI === "true" || process.env.CI === "1") {
3
+ return true;
4
+ }
5
+ if (process.env.CLAUDE_CODE_RUN === "true" || process.env.CLAUDE_CODE_NON_INTERACTIVE === "true") {
6
+ return true;
7
+ }
8
+ if (process.env.GITHUB_ACTIONS === "true") {
9
+ return true;
10
+ }
11
+ if (process.stdout.isTTY !== true) {
12
+ return true;
13
+ }
14
+ return false;
15
+ }
16
+ //# sourceMappingURL=detector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detector.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/detector.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB;IAC9B,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,CAAC;QACxD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,MAAM,EAAE,CAAC;QACjG,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,MAAM,EAAE,CAAC;QAC1C,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAClC,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { ShellHook } from "./types.js";
2
+ export * from "./constants.js";
3
+ export * from "./detector.js";
4
+ export * from "./types.js";
5
+ /**
6
+ * Non-interactive environment hook for Claude Code.
7
+ *
8
+ * Detects and handles non-interactive environments (CI, cron, etc.) by:
9
+ * - Warning about banned interactive commands (vim, less, etc.)
10
+ * - Injecting environment variables to prevent git/tools from prompting
11
+ * - Prepending export statements to git commands to block editors/pagers
12
+ */
13
+ export declare const nonInteractiveEnvHook: ShellHook;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAG3C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AA2C1B;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAwBnC,CAAA"}
@@ -0,0 +1,72 @@
1
+ import { HOOK_NAME, NON_INTERACTIVE_ENV, SHELL_COMMAND_PATTERNS } from "./constants.js";
2
+ export * from "./constants.js";
3
+ export * from "./detector.js";
4
+ export * from "./types.js";
5
+ const BANNED_COMMAND_PATTERNS = SHELL_COMMAND_PATTERNS.banned
6
+ .filter((cmd) => !cmd.includes("("))
7
+ .map((cmd) => new RegExp(`\\b${cmd}\\b`));
8
+ function detectBannedCommand(command) {
9
+ for (let i = 0; i < BANNED_COMMAND_PATTERNS.length; i++) {
10
+ if (BANNED_COMMAND_PATTERNS[i].test(command)) {
11
+ return SHELL_COMMAND_PATTERNS.banned[i];
12
+ }
13
+ }
14
+ return undefined;
15
+ }
16
+ /**
17
+ * Shell-escape a value for use in VAR=value prefix.
18
+ * Wraps in single quotes if contains special chars.
19
+ */
20
+ function shellEscape(value) {
21
+ // Empty string needs quotes
22
+ if (value === "")
23
+ return "''";
24
+ // If contains special chars, wrap in single quotes (escape existing single quotes)
25
+ if (/[^a-zA-Z0-9_\-.:\/]/.test(value)) {
26
+ return `'${value.replace(/'/g, "'\\''")}'`;
27
+ }
28
+ return value;
29
+ }
30
+ /**
31
+ * Build export statement for environment variables.
32
+ * Uses `export VAR1=val1 VAR2=val2;` format to ensure variables
33
+ * apply to ALL commands in a chain (e.g., `cmd1 && cmd2`).
34
+ *
35
+ * Previous approach used VAR=value prefix which only applies to the first command.
36
+ */
37
+ function buildEnvPrefix(env) {
38
+ const exports = Object.entries(env)
39
+ .map(([key, value]) => `${key}=${shellEscape(value)}`)
40
+ .join(" ");
41
+ return `export ${exports};`;
42
+ }
43
+ /**
44
+ * Non-interactive environment hook for Claude Code.
45
+ *
46
+ * Detects and handles non-interactive environments (CI, cron, etc.) by:
47
+ * - Warning about banned interactive commands (vim, less, etc.)
48
+ * - Injecting environment variables to prevent git/tools from prompting
49
+ * - Prepending export statements to git commands to block editors/pagers
50
+ */
51
+ export const nonInteractiveEnvHook = {
52
+ name: HOOK_NAME,
53
+ async beforeCommand(command) {
54
+ // Check for banned interactive commands
55
+ const bannedCmd = detectBannedCommand(command);
56
+ const warning = bannedCmd
57
+ ? `Warning: '${bannedCmd}' is an interactive command that may hang in non-interactive environments.`
58
+ : undefined;
59
+ // Only prepend env vars for git commands (editor blocking, pager, etc.)
60
+ const isGitCommand = /\bgit\b/.test(command);
61
+ if (!isGitCommand) {
62
+ return { command, warning };
63
+ }
64
+ // Prepend export statement to command to ensure non-interactive behavior
65
+ // Uses `export VAR=val;` format to ensure variables apply to ALL commands
66
+ // in a chain (e.g., `git add file && git rebase --continue`).
67
+ const envPrefix = buildEnvPrefix(NON_INTERACTIVE_ENV);
68
+ const modifiedCommand = `${envPrefix} ${command}`;
69
+ return { command: modifiedCommand, warning };
70
+ },
71
+ };
72
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAEvF,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAE1B,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,MAAM;KAC1D,MAAM,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;KAC3C,GAAG,CAAC,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAA;AAEnD,SAAS,mBAAmB,CAAC,OAAe;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAuB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACxD,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7C,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;QACzC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,KAAa;IAChC,4BAA4B;IAC5B,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAA;IAC7B,mFAAmF;IACnF,IAAI,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAA;IAC5C,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,GAA2B;IACjD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;SAChC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC;SACrD,IAAI,CAAC,GAAG,CAAC,CAAA;IACZ,OAAO,UAAU,OAAO,GAAG,CAAA;AAC7B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAc;IAC9C,IAAI,EAAE,SAAS;IAEf,KAAK,CAAC,aAAa,CAAC,OAAe;QACjC,wCAAwC;QACxC,MAAM,SAAS,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;QAC9C,MAAM,OAAO,GAAG,SAAS;YACvB,CAAC,CAAC,aAAa,SAAS,4EAA4E;YACpG,CAAC,CAAC,SAAS,CAAA;QAEb,wEAAwE;QACxE,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;QAC7B,CAAC;QAED,yEAAyE;QACzE,0EAA0E;QAC1E,8DAA8D;QAC9D,MAAM,SAAS,GAAG,cAAc,CAAC,mBAAmB,CAAC,CAAA;QACrD,MAAM,eAAe,GAAG,GAAG,SAAS,IAAI,OAAO,EAAE,CAAA;QAEjD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,CAAA;IAC9C,CAAC;CACF,CAAA"}
@@ -0,0 +1,14 @@
1
+ export interface NonInteractiveEnvConfig {
2
+ disabled?: boolean;
3
+ }
4
+ /**
5
+ * Shell hook interface for command interception
6
+ */
7
+ export interface ShellHook {
8
+ name: string;
9
+ beforeCommand?(command: string): Promise<{
10
+ command: string;
11
+ warning?: string;
12
+ }>;
13
+ }
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/hooks/non-interactive-env/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Preemptive Compaction Constants
3
+ *
4
+ * Thresholds and messages for context usage monitoring.
5
+ *
6
+ * Adapted from oh-my-opencode's preemptive-compaction hook.
7
+ */
8
+ /**
9
+ * Default threshold ratio to trigger warning (85%)
10
+ */
11
+ export declare const DEFAULT_THRESHOLD = 0.85;
12
+ /**
13
+ * Critical threshold ratio (95%)
14
+ */
15
+ export declare const CRITICAL_THRESHOLD = 0.95;
16
+ /**
17
+ * Minimum tokens before considering compaction
18
+ */
19
+ export declare const MIN_TOKENS_FOR_COMPACTION = 50000;
20
+ /**
21
+ * Cooldown period between compaction warnings (1 minute)
22
+ */
23
+ export declare const COMPACTION_COOLDOWN_MS = 60000;
24
+ /**
25
+ * Maximum warnings per session before stopping
26
+ */
27
+ export declare const MAX_WARNINGS = 3;
28
+ /**
29
+ * Default context limits for Claude models
30
+ */
31
+ export declare const CLAUDE_DEFAULT_CONTEXT_LIMIT: number;
32
+ /**
33
+ * Average characters per token estimate
34
+ */
35
+ export declare const CHARS_PER_TOKEN = 4;
36
+ /**
37
+ * Warning message when context usage is high
38
+ */
39
+ export declare const CONTEXT_WARNING_MESSAGE = "CONTEXT WINDOW WARNING - APPROACHING LIMIT\n\nYour context usage is getting high. Consider these actions to prevent hitting the limit:\n\n1. USE COMPACT COMMAND\n - Run /compact to summarize the conversation\n - This frees up context space while preserving important information\n\n2. BE MORE CONCISE\n - Show only relevant code portions\n - Use file paths instead of full code blocks\n - Summarize instead of repeating information\n\n3. FOCUS YOUR REQUESTS\n - Work on one task at a time\n - Complete current tasks before starting new ones\n - Avoid unnecessary back-and-forth\n\nCurrent Status: Context usage is high but recoverable.\nAction recommended: Use /compact when convenient.\n";
40
+ /**
41
+ * Critical warning message when context is almost full
42
+ */
43
+ export declare const CONTEXT_CRITICAL_MESSAGE = "CRITICAL: CONTEXT WINDOW ALMOST FULL\n\nYour context usage is critically high. Immediate action required:\n\n1. COMPACT NOW\n - Run /compact immediately to summarize the conversation\n - Without compaction, the next few messages may fail\n\n2. AVOID LARGE OUTPUTS\n - Do not show full files\n - Use summaries instead of detailed outputs\n - Be as concise as possible\n\n3. PREPARE FOR SESSION HANDOFF\n - If compaction doesn't help enough, prepare to continue in a new session\n - Note your current progress and next steps\n\nWARNING: Further messages may fail if context is not reduced.\nAction required: Run /compact now.\n";
44
+ /**
45
+ * Message when compaction was successful
46
+ */
47
+ export declare const COMPACTION_SUCCESS_MESSAGE = "Context compacted successfully. Session can continue normally.";
48
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/preemptive-compaction/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B;;GAEG;AACH,eAAO,MAAM,4BAA4B,QAI5B,CAAC;AAEd;;GAEG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,uBAAuB,qsBAoBnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,ooBAmBpC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,mEAAmE,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Preemptive Compaction Constants
3
+ *
4
+ * Thresholds and messages for context usage monitoring.
5
+ *
6
+ * Adapted from oh-my-opencode's preemptive-compaction hook.
7
+ */
8
+ /**
9
+ * Default threshold ratio to trigger warning (85%)
10
+ */
11
+ export const DEFAULT_THRESHOLD = 0.85;
12
+ /**
13
+ * Critical threshold ratio (95%)
14
+ */
15
+ export const CRITICAL_THRESHOLD = 0.95;
16
+ /**
17
+ * Minimum tokens before considering compaction
18
+ */
19
+ export const MIN_TOKENS_FOR_COMPACTION = 50_000;
20
+ /**
21
+ * Cooldown period between compaction warnings (1 minute)
22
+ */
23
+ export const COMPACTION_COOLDOWN_MS = 60_000;
24
+ /**
25
+ * Maximum warnings per session before stopping
26
+ */
27
+ export const MAX_WARNINGS = 3;
28
+ /**
29
+ * Default context limits for Claude models
30
+ */
31
+ export const CLAUDE_DEFAULT_CONTEXT_LIMIT = process.env.ANTHROPIC_1M_CONTEXT === 'true' ||
32
+ process.env.VERTEX_ANTHROPIC_1M_CONTEXT === 'true'
33
+ ? 1_000_000
34
+ : 200_000;
35
+ /**
36
+ * Average characters per token estimate
37
+ */
38
+ export const CHARS_PER_TOKEN = 4;
39
+ /**
40
+ * Warning message when context usage is high
41
+ */
42
+ export const CONTEXT_WARNING_MESSAGE = `CONTEXT WINDOW WARNING - APPROACHING LIMIT
43
+
44
+ Your context usage is getting high. Consider these actions to prevent hitting the limit:
45
+
46
+ 1. USE COMPACT COMMAND
47
+ - Run /compact to summarize the conversation
48
+ - This frees up context space while preserving important information
49
+
50
+ 2. BE MORE CONCISE
51
+ - Show only relevant code portions
52
+ - Use file paths instead of full code blocks
53
+ - Summarize instead of repeating information
54
+
55
+ 3. FOCUS YOUR REQUESTS
56
+ - Work on one task at a time
57
+ - Complete current tasks before starting new ones
58
+ - Avoid unnecessary back-and-forth
59
+
60
+ Current Status: Context usage is high but recoverable.
61
+ Action recommended: Use /compact when convenient.
62
+ `;
63
+ /**
64
+ * Critical warning message when context is almost full
65
+ */
66
+ export const CONTEXT_CRITICAL_MESSAGE = `CRITICAL: CONTEXT WINDOW ALMOST FULL
67
+
68
+ Your context usage is critically high. Immediate action required:
69
+
70
+ 1. COMPACT NOW
71
+ - Run /compact immediately to summarize the conversation
72
+ - Without compaction, the next few messages may fail
73
+
74
+ 2. AVOID LARGE OUTPUTS
75
+ - Do not show full files
76
+ - Use summaries instead of detailed outputs
77
+ - Be as concise as possible
78
+
79
+ 3. PREPARE FOR SESSION HANDOFF
80
+ - If compaction doesn't help enough, prepare to continue in a new session
81
+ - Note your current progress and next steps
82
+
83
+ WARNING: Further messages may fail if context is not reduced.
84
+ Action required: Run /compact now.
85
+ `;
86
+ /**
87
+ * Message when compaction was successful
88
+ */
89
+ export const COMPACTION_SUCCESS_MESSAGE = `Context compacted successfully. Session can continue normally.`;
90
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/preemptive-compaction/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GACvC,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM;IAC3C,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,MAAM;IAChD,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,OAAO,CAAC;AAEd;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;;;;;;;;;;;;;;CAoBtC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;CAmBvC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,gEAAgE,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Preemptive Compaction Hook
3
+ *
4
+ * Monitors context usage and warns before hitting the context limit.
5
+ * Encourages proactive compaction to prevent context overflow.
6
+ *
7
+ * Adapted from oh-my-opencode's preemptive-compaction hook.
8
+ *
9
+ * Note: This is a simplified version for Claude Code's shell hook system.
10
+ * The original uses OpenCode's plugin event system for automatic summarization.
11
+ * This version injects warning messages to prompt manual compaction.
12
+ */
13
+ import type { ContextUsageResult, PreemptiveCompactionConfig } from './types.js';
14
+ /**
15
+ * Estimate tokens from text content
16
+ */
17
+ export declare function estimateTokens(text: string): number;
18
+ /**
19
+ * Analyze context usage based on conversation content
20
+ */
21
+ export declare function analyzeContextUsage(content: string, config?: PreemptiveCompactionConfig): ContextUsageResult;
22
+ /**
23
+ * Create preemptive compaction hook
24
+ *
25
+ * This hook monitors context usage and injects warning messages
26
+ * when approaching the context limit.
27
+ */
28
+ export declare function createPreemptiveCompactionHook(config?: PreemptiveCompactionConfig): {
29
+ /**
30
+ * PostToolUse - Check context usage after large tool outputs
31
+ */
32
+ postToolUse: (input: {
33
+ tool_name: string;
34
+ session_id: string;
35
+ tool_input: Record<string, unknown>;
36
+ tool_response?: string;
37
+ }) => string | null;
38
+ /**
39
+ * Stop event - Check context before stopping
40
+ */
41
+ stop: (input: {
42
+ session_id: string;
43
+ }) => string | null;
44
+ };
45
+ /**
46
+ * Get estimated token usage for a session
47
+ */
48
+ export declare function getSessionTokenEstimate(sessionId: string): number;
49
+ /**
50
+ * Reset token estimate for a session (e.g., after compaction)
51
+ */
52
+ export declare function resetSessionTokenEstimate(sessionId: string): void;
53
+ export type { PreemptiveCompactionState, TokenInfo, ModelLimits, ContextUsageResult, PreemptiveCompactionConfig, } from './types.js';
54
+ export { DEFAULT_THRESHOLD, CRITICAL_THRESHOLD, MIN_TOKENS_FOR_COMPACTION, COMPACTION_COOLDOWN_MS, MAX_WARNINGS, CLAUDE_DEFAULT_CONTEXT_LIMIT, CHARS_PER_TOKEN, CONTEXT_WARNING_MESSAGE, CONTEXT_CRITICAL_MESSAGE, COMPACTION_SUCCESS_MESSAGE, } from './constants.js';
55
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/preemptive-compaction/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAkBH,OAAO,KAAK,EAIV,kBAAkB,EAClB,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAyDpB;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,0BAA0B,GAClC,kBAAkB,CAyBpB;AA+DD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,CAAC,EAAE,0BAA0B;IAiBjC;;OAEG;yBACkB;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,KAAG,MAAM,GAAG,IAAI;IAwDjB;;OAEG;kBACW;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,KAAG,MAAM,GAAG,IAAI;EAevD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAOjE;AAGD,YAAY,EACV,yBAAyB,EACzB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,sBAAsB,EACtB,YAAY,EACZ,4BAA4B,EAC5B,eAAe,EACf,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC"}