oh-my-claude-sisyphus 3.6.0 → 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 (314) hide show
  1. package/commands/omc-setup.md +3 -3
  2. package/commands/release.md +1 -1
  3. package/dist/__tests__/analytics/transcript-scanner.test.js +69 -27
  4. package/dist/__tests__/analytics/transcript-scanner.test.js.map +1 -1
  5. package/dist/__tests__/installer.test.js +2 -1
  6. package/dist/__tests__/installer.test.js.map +1 -1
  7. package/dist/analytics/session-manager.d.ts +24 -0
  8. package/dist/analytics/session-manager.d.ts.map +1 -1
  9. package/dist/analytics/session-manager.js +98 -9
  10. package/dist/analytics/session-manager.js.map +1 -1
  11. package/dist/analytics/transcript-scanner.d.ts +9 -8
  12. package/dist/analytics/transcript-scanner.d.ts.map +1 -1
  13. package/dist/analytics/transcript-scanner.js +146 -16
  14. package/dist/analytics/transcript-scanner.js.map +1 -1
  15. package/dist/cli/analytics.js +0 -0
  16. package/dist/cli/index.js +0 -0
  17. package/dist/hooks/empty-message-sanitizer/__tests__/index.test.d.ts +2 -0
  18. package/dist/hooks/empty-message-sanitizer/__tests__/index.test.d.ts.map +1 -0
  19. package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js +416 -0
  20. package/dist/hooks/empty-message-sanitizer/__tests__/index.test.js.map +1 -0
  21. package/dist/hooks/keyword-detector/__tests__/index.test.d.ts +2 -0
  22. package/dist/hooks/keyword-detector/__tests__/index.test.d.ts.map +1 -0
  23. package/dist/hooks/keyword-detector/__tests__/index.test.js +427 -0
  24. package/dist/hooks/keyword-detector/__tests__/index.test.js.map +1 -0
  25. package/dist/hooks/think-mode/__tests__/index.test.d.ts +2 -0
  26. package/dist/hooks/think-mode/__tests__/index.test.d.ts.map +1 -0
  27. package/dist/hooks/think-mode/__tests__/index.test.js +556 -0
  28. package/dist/hooks/think-mode/__tests__/index.test.js.map +1 -0
  29. package/dist/installer/index.d.ts.map +1 -1
  30. package/dist/installer/index.js +8 -0
  31. package/dist/installer/index.js.map +1 -1
  32. package/package.json +1 -1
  33. package/skills/omc-setup/SKILL.md +27 -3
  34. package/skills/release/SKILL.md +1 -1
  35. package/dist/__tests__/analytics/analytics-summary.test.d.ts +0 -2
  36. package/dist/__tests__/analytics/analytics-summary.test.d.ts.map +0 -1
  37. package/dist/__tests__/analytics/analytics-summary.test.js +0 -267
  38. package/dist/__tests__/analytics/analytics-summary.test.js.map +0 -1
  39. package/dist/__tests__/analytics/cost-estimator.test.d.ts +0 -2
  40. package/dist/__tests__/analytics/cost-estimator.test.d.ts.map +0 -1
  41. package/dist/__tests__/analytics/cost-estimator.test.js +0 -212
  42. package/dist/__tests__/analytics/cost-estimator.test.js.map +0 -1
  43. package/dist/__tests__/hooks/auto-slash-command/executor.test.d.ts +0 -7
  44. package/dist/__tests__/hooks/auto-slash-command/executor.test.d.ts.map +0 -1
  45. package/dist/__tests__/hooks/auto-slash-command/executor.test.js +0 -374
  46. package/dist/__tests__/hooks/auto-slash-command/executor.test.js.map +0 -1
  47. package/dist/__tests__/hud/auto-tracking.integration.test.d.ts +0 -2
  48. package/dist/__tests__/hud/auto-tracking.integration.test.d.ts.map +0 -1
  49. package/dist/__tests__/hud/auto-tracking.integration.test.js +0 -12
  50. package/dist/__tests__/hud/auto-tracking.integration.test.js.map +0 -1
  51. package/dist/__tests__/learned-skills/config.test.d.ts +0 -2
  52. package/dist/__tests__/learned-skills/config.test.d.ts.map +0 -1
  53. package/dist/__tests__/learned-skills/config.test.js +0 -37
  54. package/dist/__tests__/learned-skills/config.test.js.map +0 -1
  55. package/dist/__tests__/learned-skills/detector.test.d.ts +0 -2
  56. package/dist/__tests__/learned-skills/detector.test.d.ts.map +0 -1
  57. package/dist/__tests__/learned-skills/detector.test.js +0 -99
  58. package/dist/__tests__/learned-skills/detector.test.js.map +0 -1
  59. package/dist/__tests__/learned-skills/finder.test.d.ts +0 -2
  60. package/dist/__tests__/learned-skills/finder.test.d.ts.map +0 -1
  61. package/dist/__tests__/learned-skills/finder.test.js +0 -59
  62. package/dist/__tests__/learned-skills/finder.test.js.map +0 -1
  63. package/dist/__tests__/learned-skills/loader.test.d.ts +0 -2
  64. package/dist/__tests__/learned-skills/loader.test.d.ts.map +0 -1
  65. package/dist/__tests__/learned-skills/loader.test.js +0 -69
  66. package/dist/__tests__/learned-skills/loader.test.js.map +0 -1
  67. package/dist/__tests__/learned-skills/parser.test.d.ts +0 -2
  68. package/dist/__tests__/learned-skills/parser.test.d.ts.map +0 -1
  69. package/dist/__tests__/learned-skills/parser.test.js +0 -81
  70. package/dist/__tests__/learned-skills/parser.test.js.map +0 -1
  71. package/dist/__tests__/learned-skills/validator.test.d.ts +0 -2
  72. package/dist/__tests__/learned-skills/validator.test.d.ts.map +0 -1
  73. package/dist/__tests__/learned-skills/validator.test.js +0 -85
  74. package/dist/__tests__/learned-skills/validator.test.js.map +0 -1
  75. package/dist/agents/codex-agents.d.ts +0 -20
  76. package/dist/agents/codex-agents.d.ts.map +0 -1
  77. package/dist/agents/codex-agents.js +0 -36
  78. package/dist/agents/codex-agents.js.map +0 -1
  79. package/dist/agents/document-writer.d.ts +0 -11
  80. package/dist/agents/document-writer.d.ts.map +0 -1
  81. package/dist/agents/document-writer.js +0 -209
  82. package/dist/agents/document-writer.js.map +0 -1
  83. package/dist/agents/frontend-engineer.d.ts +0 -11
  84. package/dist/agents/frontend-engineer.d.ts.map +0 -1
  85. package/dist/agents/frontend-engineer.js +0 -115
  86. package/dist/agents/frontend-engineer.js.map +0 -1
  87. package/dist/agents/librarian.d.ts +0 -12
  88. package/dist/agents/librarian.d.ts.map +0 -1
  89. package/dist/agents/librarian.js +0 -103
  90. package/dist/agents/librarian.js.map +0 -1
  91. package/dist/agents/metis.d.ts +0 -12
  92. package/dist/agents/metis.d.ts.map +0 -1
  93. package/dist/agents/metis.js +0 -117
  94. package/dist/agents/metis.js.map +0 -1
  95. package/dist/agents/momus.d.ts +0 -12
  96. package/dist/agents/momus.d.ts.map +0 -1
  97. package/dist/agents/momus.js +0 -128
  98. package/dist/agents/momus.js.map +0 -1
  99. package/dist/agents/multimodal-looker.d.ts +0 -11
  100. package/dist/agents/multimodal-looker.d.ts.map +0 -1
  101. package/dist/agents/multimodal-looker.js +0 -70
  102. package/dist/agents/multimodal-looker.js.map +0 -1
  103. package/dist/agents/oracle.d.ts +0 -13
  104. package/dist/agents/oracle.d.ts.map +0 -1
  105. package/dist/agents/oracle.js +0 -191
  106. package/dist/agents/oracle.js.map +0 -1
  107. package/dist/agents/orchestrator-sisyphus.d.ts +0 -11
  108. package/dist/agents/orchestrator-sisyphus.d.ts.map +0 -1
  109. package/dist/agents/orchestrator-sisyphus.js +0 -115
  110. package/dist/agents/orchestrator-sisyphus.js.map +0 -1
  111. package/dist/agents/prometheus.d.ts +0 -12
  112. package/dist/agents/prometheus.d.ts.map +0 -1
  113. package/dist/agents/prometheus.js +0 -195
  114. package/dist/agents/prometheus.js.map +0 -1
  115. package/dist/agents/sisyphus-junior.d.ts +0 -12
  116. package/dist/agents/sisyphus-junior.d.ts.map +0 -1
  117. package/dist/agents/sisyphus-junior.js +0 -93
  118. package/dist/agents/sisyphus-junior.js.map +0 -1
  119. package/dist/cli/components/CostDashboard.d.ts +0 -15
  120. package/dist/cli/components/CostDashboard.d.ts.map +0 -1
  121. package/dist/cli/components/CostDashboard.js +0 -15
  122. package/dist/cli/components/CostDashboard.js.map +0 -1
  123. package/dist/cli/components/LiveStats.d.ts +0 -16
  124. package/dist/cli/components/LiveStats.d.ts.map +0 -1
  125. package/dist/cli/components/LiveStats.js +0 -16
  126. package/dist/cli/components/LiveStats.js.map +0 -1
  127. package/dist/cli/components/SessionBrowser.d.ts +0 -14
  128. package/dist/cli/components/SessionBrowser.d.ts.map +0 -1
  129. package/dist/cli/components/SessionBrowser.js +0 -14
  130. package/dist/cli/components/SessionBrowser.js.map +0 -1
  131. package/dist/cli/tui.d.ts +0 -21
  132. package/dist/cli/tui.d.ts.map +0 -1
  133. package/dist/cli/tui.js +0 -21
  134. package/dist/cli/tui.js.map +0 -1
  135. package/dist/hooks/autopilot/signals.d.ts +0 -20
  136. package/dist/hooks/autopilot/signals.d.ts.map +0 -1
  137. package/dist/hooks/autopilot/signals.js +0 -75
  138. package/dist/hooks/autopilot/signals.js.map +0 -1
  139. package/dist/hooks/autopilot/summary.d.ts +0 -27
  140. package/dist/hooks/autopilot/summary.d.ts.map +0 -1
  141. package/dist/hooks/autopilot/summary.js +0 -160
  142. package/dist/hooks/autopilot/summary.js.map +0 -1
  143. package/dist/hooks/autopilot/transition.d.ts +0 -39
  144. package/dist/hooks/autopilot/transition.d.ts.map +0 -1
  145. package/dist/hooks/autopilot/transition.js +0 -216
  146. package/dist/hooks/autopilot/transition.js.map +0 -1
  147. package/dist/hooks/context-window-limit-recovery/constants.d.ts +0 -28
  148. package/dist/hooks/context-window-limit-recovery/constants.d.ts.map +0 -1
  149. package/dist/hooks/context-window-limit-recovery/constants.js +0 -85
  150. package/dist/hooks/context-window-limit-recovery/constants.js.map +0 -1
  151. package/dist/hooks/context-window-limit-recovery/index.d.ts +0 -62
  152. package/dist/hooks/context-window-limit-recovery/index.d.ts.map +0 -1
  153. package/dist/hooks/context-window-limit-recovery/index.js +0 -201
  154. package/dist/hooks/context-window-limit-recovery/index.js.map +0 -1
  155. package/dist/hooks/context-window-limit-recovery/parser.d.ts +0 -31
  156. package/dist/hooks/context-window-limit-recovery/parser.d.ts.map +0 -1
  157. package/dist/hooks/context-window-limit-recovery/parser.js +0 -241
  158. package/dist/hooks/context-window-limit-recovery/parser.js.map +0 -1
  159. package/dist/hooks/context-window-limit-recovery/types.d.ts +0 -84
  160. package/dist/hooks/context-window-limit-recovery/types.d.ts.map +0 -1
  161. package/dist/hooks/context-window-limit-recovery/types.js +0 -34
  162. package/dist/hooks/context-window-limit-recovery/types.js.map +0 -1
  163. package/dist/hooks/edit-error-recovery/index.d.ts +0 -62
  164. package/dist/hooks/edit-error-recovery/index.d.ts.map +0 -1
  165. package/dist/hooks/edit-error-recovery/index.js +0 -89
  166. package/dist/hooks/edit-error-recovery/index.js.map +0 -1
  167. package/dist/hooks/learned-skills/config.d.ts +0 -53
  168. package/dist/hooks/learned-skills/config.d.ts.map +0 -1
  169. package/dist/hooks/learned-skills/config.js +0 -103
  170. package/dist/hooks/learned-skills/config.js.map +0 -1
  171. package/dist/hooks/learned-skills/constants.d.ts +0 -24
  172. package/dist/hooks/learned-skills/constants.d.ts.map +0 -1
  173. package/dist/hooks/learned-skills/constants.js +0 -26
  174. package/dist/hooks/learned-skills/constants.js.map +0 -1
  175. package/dist/hooks/learned-skills/detection-hook.d.ts +0 -39
  176. package/dist/hooks/learned-skills/detection-hook.d.ts.map +0 -1
  177. package/dist/hooks/learned-skills/detection-hook.js +0 -83
  178. package/dist/hooks/learned-skills/detection-hook.js.map +0 -1
  179. package/dist/hooks/learned-skills/detector.d.ts +0 -30
  180. package/dist/hooks/learned-skills/detector.d.ts.map +0 -1
  181. package/dist/hooks/learned-skills/detector.js +0 -150
  182. package/dist/hooks/learned-skills/detector.js.map +0 -1
  183. package/dist/hooks/learned-skills/finder.d.ts +0 -21
  184. package/dist/hooks/learned-skills/finder.d.ts.map +0 -1
  185. package/dist/hooks/learned-skills/finder.js +0 -117
  186. package/dist/hooks/learned-skills/finder.js.map +0 -1
  187. package/dist/hooks/learned-skills/index.d.ts +0 -62
  188. package/dist/hooks/learned-skills/index.d.ts.map +0 -1
  189. package/dist/hooks/learned-skills/index.js +0 -137
  190. package/dist/hooks/learned-skills/index.js.map +0 -1
  191. package/dist/hooks/learned-skills/loader.d.ts +0 -20
  192. package/dist/hooks/learned-skills/loader.d.ts.map +0 -1
  193. package/dist/hooks/learned-skills/loader.js +0 -107
  194. package/dist/hooks/learned-skills/loader.js.map +0 -1
  195. package/dist/hooks/learned-skills/parser.d.ts +0 -21
  196. package/dist/hooks/learned-skills/parser.d.ts.map +0 -1
  197. package/dist/hooks/learned-skills/parser.js +0 -190
  198. package/dist/hooks/learned-skills/parser.js.map +0 -1
  199. package/dist/hooks/learned-skills/promotion.d.ts +0 -29
  200. package/dist/hooks/learned-skills/promotion.d.ts.map +0 -1
  201. package/dist/hooks/learned-skills/promotion.js +0 -87
  202. package/dist/hooks/learned-skills/promotion.js.map +0 -1
  203. package/dist/hooks/learned-skills/types.d.ts +0 -109
  204. package/dist/hooks/learned-skills/types.d.ts.map +0 -1
  205. package/dist/hooks/learned-skills/types.js +0 -8
  206. package/dist/hooks/learned-skills/types.js.map +0 -1
  207. package/dist/hooks/learned-skills/validator.d.ts +0 -15
  208. package/dist/hooks/learned-skills/validator.d.ts.map +0 -1
  209. package/dist/hooks/learned-skills/validator.js +0 -87
  210. package/dist/hooks/learned-skills/validator.js.map +0 -1
  211. package/dist/hooks/learned-skills/writer.d.ts +0 -27
  212. package/dist/hooks/learned-skills/writer.d.ts.map +0 -1
  213. package/dist/hooks/learned-skills/writer.js +0 -126
  214. package/dist/hooks/learned-skills/writer.js.map +0 -1
  215. package/dist/hooks/mnemosyne/config.d.ts +0 -53
  216. package/dist/hooks/mnemosyne/config.d.ts.map +0 -1
  217. package/dist/hooks/mnemosyne/config.js +0 -103
  218. package/dist/hooks/mnemosyne/config.js.map +0 -1
  219. package/dist/hooks/mnemosyne/constants.d.ts +0 -24
  220. package/dist/hooks/mnemosyne/constants.d.ts.map +0 -1
  221. package/dist/hooks/mnemosyne/constants.js +0 -26
  222. package/dist/hooks/mnemosyne/constants.js.map +0 -1
  223. package/dist/hooks/mnemosyne/detection-hook.d.ts +0 -39
  224. package/dist/hooks/mnemosyne/detection-hook.d.ts.map +0 -1
  225. package/dist/hooks/mnemosyne/detection-hook.js +0 -83
  226. package/dist/hooks/mnemosyne/detection-hook.js.map +0 -1
  227. package/dist/hooks/mnemosyne/detector.d.ts +0 -30
  228. package/dist/hooks/mnemosyne/detector.d.ts.map +0 -1
  229. package/dist/hooks/mnemosyne/detector.js +0 -150
  230. package/dist/hooks/mnemosyne/detector.js.map +0 -1
  231. package/dist/hooks/mnemosyne/finder.d.ts +0 -21
  232. package/dist/hooks/mnemosyne/finder.d.ts.map +0 -1
  233. package/dist/hooks/mnemosyne/finder.js +0 -117
  234. package/dist/hooks/mnemosyne/finder.js.map +0 -1
  235. package/dist/hooks/mnemosyne/index.d.ts +0 -62
  236. package/dist/hooks/mnemosyne/index.d.ts.map +0 -1
  237. package/dist/hooks/mnemosyne/index.js +0 -137
  238. package/dist/hooks/mnemosyne/index.js.map +0 -1
  239. package/dist/hooks/mnemosyne/loader.d.ts +0 -20
  240. package/dist/hooks/mnemosyne/loader.d.ts.map +0 -1
  241. package/dist/hooks/mnemosyne/loader.js +0 -113
  242. package/dist/hooks/mnemosyne/loader.js.map +0 -1
  243. package/dist/hooks/mnemosyne/parser.d.ts +0 -21
  244. package/dist/hooks/mnemosyne/parser.d.ts.map +0 -1
  245. package/dist/hooks/mnemosyne/parser.js +0 -190
  246. package/dist/hooks/mnemosyne/parser.js.map +0 -1
  247. package/dist/hooks/mnemosyne/promotion.d.ts +0 -29
  248. package/dist/hooks/mnemosyne/promotion.d.ts.map +0 -1
  249. package/dist/hooks/mnemosyne/promotion.js +0 -87
  250. package/dist/hooks/mnemosyne/promotion.js.map +0 -1
  251. package/dist/hooks/mnemosyne/types.d.ts +0 -109
  252. package/dist/hooks/mnemosyne/types.d.ts.map +0 -1
  253. package/dist/hooks/mnemosyne/types.js +0 -8
  254. package/dist/hooks/mnemosyne/types.js.map +0 -1
  255. package/dist/hooks/mnemosyne/validator.d.ts +0 -15
  256. package/dist/hooks/mnemosyne/validator.d.ts.map +0 -1
  257. package/dist/hooks/mnemosyne/validator.js +0 -87
  258. package/dist/hooks/mnemosyne/validator.js.map +0 -1
  259. package/dist/hooks/mnemosyne/writer.d.ts +0 -27
  260. package/dist/hooks/mnemosyne/writer.d.ts.map +0 -1
  261. package/dist/hooks/mnemosyne/writer.js +0 -126
  262. package/dist/hooks/mnemosyne/writer.js.map +0 -1
  263. package/dist/hooks/ralph-loop/index.d.ts +0 -116
  264. package/dist/hooks/ralph-loop/index.d.ts.map +0 -1
  265. package/dist/hooks/ralph-loop/index.js +0 -322
  266. package/dist/hooks/ralph-loop/index.js.map +0 -1
  267. package/dist/hooks/ralph-prd/index.d.ts +0 -130
  268. package/dist/hooks/ralph-prd/index.d.ts.map +0 -1
  269. package/dist/hooks/ralph-prd/index.js +0 -310
  270. package/dist/hooks/ralph-prd/index.js.map +0 -1
  271. package/dist/hooks/ralph-progress/index.d.ts +0 -102
  272. package/dist/hooks/ralph-progress/index.d.ts.map +0 -1
  273. package/dist/hooks/ralph-progress/index.js +0 -408
  274. package/dist/hooks/ralph-progress/index.js.map +0 -1
  275. package/dist/hooks/ralph-verifier/index.d.ts +0 -72
  276. package/dist/hooks/ralph-verifier/index.d.ts.map +0 -1
  277. package/dist/hooks/ralph-verifier/index.js +0 -223
  278. package/dist/hooks/ralph-verifier/index.js.map +0 -1
  279. package/dist/hooks/session-recovery/constants.d.ts +0 -56
  280. package/dist/hooks/session-recovery/constants.d.ts.map +0 -1
  281. package/dist/hooks/session-recovery/constants.js +0 -78
  282. package/dist/hooks/session-recovery/constants.js.map +0 -1
  283. package/dist/hooks/session-recovery/index.d.ts +0 -53
  284. package/dist/hooks/session-recovery/index.d.ts.map +0 -1
  285. package/dist/hooks/session-recovery/index.js +0 -321
  286. package/dist/hooks/session-recovery/index.js.map +0 -1
  287. package/dist/hooks/session-recovery/storage.d.ts +0 -76
  288. package/dist/hooks/session-recovery/storage.d.ts.map +0 -1
  289. package/dist/hooks/session-recovery/storage.js +0 -383
  290. package/dist/hooks/session-recovery/storage.js.map +0 -1
  291. package/dist/hooks/session-recovery/types.d.ts +0 -145
  292. package/dist/hooks/session-recovery/types.d.ts.map +0 -1
  293. package/dist/hooks/session-recovery/types.js +0 -8
  294. package/dist/hooks/session-recovery/types.js.map +0 -1
  295. package/dist/hooks/sisyphus-orchestrator/constants.d.ts +0 -23
  296. package/dist/hooks/sisyphus-orchestrator/constants.d.ts.map +0 -1
  297. package/dist/hooks/sisyphus-orchestrator/constants.js +0 -142
  298. package/dist/hooks/sisyphus-orchestrator/constants.js.map +0 -1
  299. package/dist/hooks/sisyphus-orchestrator/index.d.ts +0 -113
  300. package/dist/hooks/sisyphus-orchestrator/index.d.ts.map +0 -1
  301. package/dist/hooks/sisyphus-orchestrator/index.js +0 -309
  302. package/dist/hooks/sisyphus-orchestrator/index.js.map +0 -1
  303. package/dist/hooks/ultraqa-loop/index.d.ts +0 -94
  304. package/dist/hooks/ultraqa-loop/index.d.ts.map +0 -1
  305. package/dist/hooks/ultraqa-loop/index.js +0 -216
  306. package/dist/hooks/ultraqa-loop/index.js.map +0 -1
  307. package/dist/hooks/ultrawork-state/index.d.ts +0 -62
  308. package/dist/hooks/ultrawork-state/index.d.ts.map +0 -1
  309. package/dist/hooks/ultrawork-state/index.js +0 -208
  310. package/dist/hooks/ultrawork-state/index.js.map +0 -1
  311. package/dist/hud/sisyphus-state.d.ts +0 -31
  312. package/dist/hud/sisyphus-state.d.ts.map +0 -1
  313. package/dist/hud/sisyphus-state.js +0 -163
  314. package/dist/hud/sisyphus-state.js.map +0 -1
@@ -1,62 +0,0 @@
1
- /**
2
- * Edit Error Recovery Hook
3
- *
4
- * Detects Edit tool errors caused by AI mistakes and injects
5
- * a recovery reminder to guide corrective action.
6
- *
7
- * Common Edit tool failures:
8
- * - oldString and newString must be different (trying to "edit" to same content)
9
- * - oldString not found (wrong assumption about file content)
10
- * - oldString found multiple times (ambiguous match, need more context)
11
- *
12
- * Ported from oh-my-opencode's edit-error-recovery hook.
13
- */
14
- /**
15
- * Known Edit tool error patterns that indicate the AI made a mistake
16
- */
17
- export declare const EDIT_ERROR_PATTERNS: readonly ["oldString and newString must be different", "oldString not found", "oldString found multiple times", "old_string not found", "old_string and new_string must be different"];
18
- /**
19
- * System reminder injected when Edit tool fails due to AI mistake
20
- * Short, direct, and commanding - forces immediate corrective action
21
- */
22
- export declare const EDIT_ERROR_REMINDER = "\n[EDIT ERROR - IMMEDIATE ACTION REQUIRED]\n\nYou made an Edit mistake. STOP and do this NOW:\n\n1. READ the file immediately to see its ACTUAL current state\n2. VERIFY what the content really looks like (your assumption was wrong)\n3. APOLOGIZE briefly to the user for the error\n4. CONTINUE with corrected action based on the real file content\n\nDO NOT attempt another edit until you've read and verified the file state.\n";
23
- /**
24
- * Check if an output contains an edit error pattern
25
- */
26
- export declare function detectEditError(output: string): boolean;
27
- /**
28
- * Inject the edit error recovery reminder into the output
29
- */
30
- export declare function injectEditErrorRecovery(output: string): string;
31
- /**
32
- * Hook input interface for tool execution
33
- */
34
- export interface ToolExecuteInput {
35
- tool: string;
36
- sessionId: string;
37
- callId: string;
38
- }
39
- /**
40
- * Hook output interface for tool execution
41
- */
42
- export interface ToolExecuteOutput {
43
- title: string;
44
- output: string;
45
- metadata?: unknown;
46
- }
47
- /**
48
- * Creates the edit error recovery hook for Claude Code.
49
- * This is the main export for hook registration.
50
- */
51
- export declare function createEditErrorRecoveryHook(): {
52
- /**
53
- * After tool execution, check for Edit errors and inject recovery reminder.
54
- */
55
- afterToolExecute: (input: ToolExecuteInput, output: ToolExecuteOutput) => ToolExecuteOutput;
56
- };
57
- /**
58
- * Process edit tool output and inject recovery if needed.
59
- * Simplified function for direct use without hook context.
60
- */
61
- export declare function processEditOutput(toolName: string, output: string): string;
62
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/edit-error-recovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB,wLAMtB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,mBAAmB,8aAW/B,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKvD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAK9D;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,2BAA2B;IAEvC;;OAEG;8BAEM,gBAAgB,UACf,iBAAiB,KACxB,iBAAiB;EAevB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAK1E"}
@@ -1,89 +0,0 @@
1
- /**
2
- * Edit Error Recovery Hook
3
- *
4
- * Detects Edit tool errors caused by AI mistakes and injects
5
- * a recovery reminder to guide corrective action.
6
- *
7
- * Common Edit tool failures:
8
- * - oldString and newString must be different (trying to "edit" to same content)
9
- * - oldString not found (wrong assumption about file content)
10
- * - oldString found multiple times (ambiguous match, need more context)
11
- *
12
- * Ported from oh-my-opencode's edit-error-recovery hook.
13
- */
14
- /**
15
- * Known Edit tool error patterns that indicate the AI made a mistake
16
- */
17
- export const EDIT_ERROR_PATTERNS = [
18
- 'oldString and newString must be different',
19
- 'oldString not found',
20
- 'oldString found multiple times',
21
- 'old_string not found',
22
- 'old_string and new_string must be different',
23
- ];
24
- /**
25
- * System reminder injected when Edit tool fails due to AI mistake
26
- * Short, direct, and commanding - forces immediate corrective action
27
- */
28
- export const EDIT_ERROR_REMINDER = `
29
- [EDIT ERROR - IMMEDIATE ACTION REQUIRED]
30
-
31
- You made an Edit mistake. STOP and do this NOW:
32
-
33
- 1. READ the file immediately to see its ACTUAL current state
34
- 2. VERIFY what the content really looks like (your assumption was wrong)
35
- 3. APOLOGIZE briefly to the user for the error
36
- 4. CONTINUE with corrected action based on the real file content
37
-
38
- DO NOT attempt another edit until you've read and verified the file state.
39
- `;
40
- /**
41
- * Check if an output contains an edit error pattern
42
- */
43
- export function detectEditError(output) {
44
- const outputLower = output.toLowerCase();
45
- return EDIT_ERROR_PATTERNS.some((pattern) => outputLower.includes(pattern.toLowerCase()));
46
- }
47
- /**
48
- * Inject the edit error recovery reminder into the output
49
- */
50
- export function injectEditErrorRecovery(output) {
51
- if (detectEditError(output)) {
52
- return output + EDIT_ERROR_REMINDER;
53
- }
54
- return output;
55
- }
56
- /**
57
- * Creates the edit error recovery hook for Claude Code.
58
- * This is the main export for hook registration.
59
- */
60
- export function createEditErrorRecoveryHook() {
61
- return {
62
- /**
63
- * After tool execution, check for Edit errors and inject recovery reminder.
64
- */
65
- afterToolExecute: (input, output) => {
66
- if (input.tool.toLowerCase() !== 'edit') {
67
- return output;
68
- }
69
- if (detectEditError(output.output)) {
70
- return {
71
- ...output,
72
- output: output.output + EDIT_ERROR_REMINDER,
73
- };
74
- }
75
- return output;
76
- },
77
- };
78
- }
79
- /**
80
- * Process edit tool output and inject recovery if needed.
81
- * Simplified function for direct use without hook context.
82
- */
83
- export function processEditOutput(toolName, output) {
84
- if (toolName.toLowerCase() !== 'edit') {
85
- return output;
86
- }
87
- return injectEditErrorRecovery(output);
88
- }
89
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/edit-error-recovery/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,2CAA2C;IAC3C,qBAAqB;IACrB,gCAAgC;IAChC,sBAAsB;IACtB,6CAA6C;CACrC,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;CAWlC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAC1C,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAC5C,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAc;IACpD,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,OAAO,MAAM,GAAG,mBAAmB,CAAC;IACtC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAoBD;;;GAGG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL;;WAEG;QACH,gBAAgB,EAAE,CAChB,KAAuB,EACvB,MAAyB,EACN,EAAE;YACrB,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;gBACxC,OAAO,MAAM,CAAC;YAChB,CAAC;YAED,IAAI,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnC,OAAO;oBACL,GAAG,MAAM;oBACT,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,mBAAmB;iBAC5C,CAAC;YACJ,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAgB,EAAE,MAAc;IAChE,IAAI,QAAQ,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC"}
@@ -1,53 +0,0 @@
1
- /**
2
- * Claudeception Configuration
3
- *
4
- * Handles configuration loading and validation.
5
- */
6
- export interface ClaudeceptionConfig {
7
- /** Feature enabled/disabled */
8
- enabled: boolean;
9
- /** Detection configuration */
10
- detection: {
11
- /** Enable auto-detection */
12
- enabled: boolean;
13
- /** Confidence threshold for prompting (0-100) */
14
- promptThreshold: number;
15
- /** Cooldown between prompts (messages) */
16
- promptCooldown: number;
17
- };
18
- /** Quality gate configuration */
19
- quality: {
20
- /** Minimum score to accept (0-100) */
21
- minScore: number;
22
- /** Minimum problem length */
23
- minProblemLength: number;
24
- /** Minimum solution length */
25
- minSolutionLength: number;
26
- };
27
- /** Storage configuration */
28
- storage: {
29
- /** Maximum skills per scope */
30
- maxSkillsPerScope: number;
31
- /** Auto-prune old skills */
32
- autoPrune: boolean;
33
- /** Days before auto-prune (if enabled) */
34
- pruneDays: number;
35
- };
36
- }
37
- /**
38
- * Load configuration from disk.
39
- */
40
- export declare function loadConfig(): ClaudeceptionConfig;
41
- /**
42
- * Save configuration to disk.
43
- */
44
- export declare function saveConfig(config: Partial<ClaudeceptionConfig>): boolean;
45
- /**
46
- * Get a specific config value.
47
- */
48
- export declare function getConfigValue<K extends keyof ClaudeceptionConfig>(key: K): ClaudeceptionConfig[K];
49
- /**
50
- * Update a specific config value.
51
- */
52
- export declare function setConfigValue<K extends keyof ClaudeceptionConfig>(key: K, value: ClaudeceptionConfig[K]): boolean;
53
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/hooks/learned-skills/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,8BAA8B;IAC9B,SAAS,EAAE;QACT,4BAA4B;QAC5B,OAAO,EAAE,OAAO,CAAC;QACjB,iDAAiD;QACjD,eAAe,EAAE,MAAM,CAAC;QACxB,0CAA0C;QAC1C,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,iCAAiC;IACjC,OAAO,EAAE;QACP,sCAAsC;QACtC,QAAQ,EAAE,MAAM,CAAC;QACjB,6BAA6B;QAC7B,gBAAgB,EAAE,MAAM,CAAC;QACzB,8BAA8B;QAC9B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,4BAA4B;IAC5B,OAAO,EAAE;QACP,+BAA+B;QAC/B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,4BAA4B;QAC5B,SAAS,EAAE,OAAO,CAAC;QACnB,0CAA0C;QAC1C,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAuBD;;GAEG;AACH,wBAAgB,UAAU,IAAI,mBAAmB,CAehD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,OAAO,CAgBxE;AA0BD;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,mBAAmB,EAChE,GAAG,EAAE,CAAC,GACL,mBAAmB,CAAC,CAAC,CAAC,CAGxB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,mBAAmB,EAChE,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC5B,OAAO,CAIT"}
@@ -1,103 +0,0 @@
1
- /**
2
- * Claudeception Configuration
3
- *
4
- * Handles configuration loading and validation.
5
- */
6
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
7
- import { join } from 'path';
8
- import { homedir } from 'os';
9
- import { DEBUG_ENABLED } from './constants.js';
10
- const DEFAULT_CONFIG = {
11
- enabled: true,
12
- detection: {
13
- enabled: true,
14
- promptThreshold: 60,
15
- promptCooldown: 5,
16
- },
17
- quality: {
18
- minScore: 50,
19
- minProblemLength: 10,
20
- minSolutionLength: 20,
21
- },
22
- storage: {
23
- maxSkillsPerScope: 100,
24
- autoPrune: false,
25
- pruneDays: 90,
26
- },
27
- };
28
- const CONFIG_PATH = join(homedir(), '.claude', 'sisyphus', 'claudeception.json');
29
- /**
30
- * Load configuration from disk.
31
- */
32
- export function loadConfig() {
33
- if (!existsSync(CONFIG_PATH)) {
34
- return DEFAULT_CONFIG;
35
- }
36
- try {
37
- const content = readFileSync(CONFIG_PATH, 'utf-8');
38
- const loaded = JSON.parse(content);
39
- return mergeConfig(DEFAULT_CONFIG, loaded);
40
- }
41
- catch (error) {
42
- if (DEBUG_ENABLED) {
43
- console.error('[learned-skills] Error loading config:', error);
44
- }
45
- return DEFAULT_CONFIG;
46
- }
47
- }
48
- /**
49
- * Save configuration to disk.
50
- */
51
- export function saveConfig(config) {
52
- const merged = mergeConfig(DEFAULT_CONFIG, config);
53
- try {
54
- const dir = join(homedir(), '.claude', 'sisyphus');
55
- if (!existsSync(dir)) {
56
- mkdirSync(dir, { recursive: true });
57
- }
58
- writeFileSync(CONFIG_PATH, JSON.stringify(merged, null, 2));
59
- return true;
60
- }
61
- catch (error) {
62
- if (DEBUG_ENABLED) {
63
- console.error('[learned-skills] Error saving config:', error);
64
- }
65
- return false;
66
- }
67
- }
68
- /**
69
- * Merge partial config with defaults.
70
- */
71
- function mergeConfig(defaults, partial) {
72
- return {
73
- enabled: partial.enabled ?? defaults.enabled,
74
- detection: {
75
- ...defaults.detection,
76
- ...partial.detection,
77
- },
78
- quality: {
79
- ...defaults.quality,
80
- ...partial.quality,
81
- },
82
- storage: {
83
- ...defaults.storage,
84
- ...partial.storage,
85
- },
86
- };
87
- }
88
- /**
89
- * Get a specific config value.
90
- */
91
- export function getConfigValue(key) {
92
- const config = loadConfig();
93
- return config[key];
94
- }
95
- /**
96
- * Update a specific config value.
97
- */
98
- export function setConfigValue(key, value) {
99
- const config = loadConfig();
100
- config[key] = value;
101
- return saveConfig(config);
102
- }
103
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/hooks/learned-skills/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,M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CAAC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Learned Skills Constants
3
- */
4
- /** User-level skills directory */
5
- export declare const USER_SKILLS_DIR: string;
6
- /** Project-level skills subdirectory */
7
- export declare const PROJECT_SKILLS_SUBDIR = ".sisyphus/skills";
8
- /** Valid skill file extension */
9
- export declare const SKILL_EXTENSION = ".md";
10
- /** Feature flag key for enabling/disabling */
11
- export declare const FEATURE_FLAG_KEY = "claudeception.enabled";
12
- /** Default feature flag value */
13
- export declare const FEATURE_FLAG_DEFAULT = true;
14
- /** Maximum skill content length (characters) */
15
- export declare const MAX_SKILL_CONTENT_LENGTH = 4000;
16
- /** Minimum quality score for auto-injection */
17
- export declare const MIN_QUALITY_SCORE = 50;
18
- /** Required metadata fields */
19
- export declare const REQUIRED_METADATA_FIELDS: string[];
20
- /** Maximum skills to inject per session */
21
- export declare const MAX_SKILLS_PER_SESSION = 10;
22
- /** Debug mode enabled */
23
- export declare const DEBUG_ENABLED: boolean;
24
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/hooks/learned-skills/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,kCAAkC;AAClC,eAAO,MAAM,eAAe,QAA2D,CAAC;AAExF,wCAAwC;AACxC,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD,iCAAiC;AACjC,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC,8CAA8C;AAC9C,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AAExD,iCAAiC;AACjC,eAAO,MAAM,oBAAoB,OAAO,CAAC;AAEzC,gDAAgD;AAChD,eAAO,MAAM,wBAAwB,OAAO,CAAC;AAE7C,+CAA+C;AAC/C,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,+BAA+B;AAC/B,eAAO,MAAM,wBAAwB,UAAsD,CAAC;AAE5F,2CAA2C;AAC3C,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,yBAAyB;AACzB,eAAO,MAAM,aAAa,SAAqC,CAAC"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Learned Skills Constants
3
- */
4
- import { join } from 'path';
5
- import { homedir } from 'os';
6
- /** User-level skills directory */
7
- export const USER_SKILLS_DIR = join(homedir(), '.claude', 'skills', 'sisyphus-learned');
8
- /** Project-level skills subdirectory */
9
- export const PROJECT_SKILLS_SUBDIR = '.sisyphus/skills';
10
- /** Valid skill file extension */
11
- export const SKILL_EXTENSION = '.md';
12
- /** Feature flag key for enabling/disabling */
13
- export const FEATURE_FLAG_KEY = 'claudeception.enabled';
14
- /** Default feature flag value */
15
- export const FEATURE_FLAG_DEFAULT = true;
16
- /** Maximum skill content length (characters) */
17
- export const MAX_SKILL_CONTENT_LENGTH = 4000;
18
- /** Minimum quality score for auto-injection */
19
- export const MIN_QUALITY_SCORE = 50;
20
- /** Required metadata fields */
21
- export const REQUIRED_METADATA_FIELDS = ['id', 'name', 'description', 'triggers', 'source'];
22
- /** Maximum skills to inject per session */
23
- export const MAX_SKILLS_PER_SESSION = 10;
24
- /** Debug mode enabled */
25
- export const DEBUG_ENABLED = process.env.SISYPHUS_DEBUG === '1';
26
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/hooks/learned-skills/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,kCAAkC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC;AAExF,wCAAwC;AACxC,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AAExD,iCAAiC;AACjC,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AAErC,8CAA8C;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAExD,iCAAiC;AACjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAEzC,gDAAgD;AAChD,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C,+CAA+C;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC,+BAA+B;AAC/B,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;AAE5F,2CAA2C;AAC3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAEzC,yBAAyB;AACzB,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,GAAG,CAAC"}
@@ -1,39 +0,0 @@
1
- /**
2
- * Detection Hook
3
- *
4
- * Integrates skill detection into the message flow.
5
- */
6
- import type { DetectionResult } from './detector.js';
7
- /**
8
- * Configuration for detection behavior.
9
- */
10
- export interface DetectionConfig {
11
- /** Minimum confidence to prompt (0-100) */
12
- promptThreshold: number;
13
- /** Cooldown between prompts (messages) */
14
- promptCooldown: number;
15
- /** Enable/disable auto-detection */
16
- enabled: boolean;
17
- }
18
- /**
19
- * Process assistant response for skill detection.
20
- * Returns prompt text if extraction should be suggested, null otherwise.
21
- */
22
- export declare function processResponseForDetection(assistantMessage: string, userMessage: string | undefined, sessionId: string, config?: Partial<DetectionConfig>): string | null;
23
- /**
24
- * Get the last detection result for a session.
25
- */
26
- export declare function getLastDetection(sessionId: string): DetectionResult | null;
27
- /**
28
- * Clear detection state for a session.
29
- */
30
- export declare function clearDetectionState(sessionId: string): void;
31
- /**
32
- * Get detection statistics for a session.
33
- */
34
- export declare function getDetectionStats(sessionId: string): {
35
- messagesSincePrompt: number;
36
- promptedCount: number;
37
- lastDetection: DetectionResult | null;
38
- };
39
- //# sourceMappingURL=detection-hook.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detection-hook.d.ts","sourceRoot":"","sources":["../../../src/hooks/learned-skills/detection-hook.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,eAAe,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,cAAc,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB;AAiCD;;;GAGG;AACH,wBAAgB,2BAA2B,CACzC,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,SAAS,EAAE,MAAM,EACjB,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,GACpC,MAAM,GAAG,IAAI,CA2Bf;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAE1E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAE3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG;IACpD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;CACvC,CAcA"}
@@ -1,83 +0,0 @@
1
- /**
2
- * Detection Hook
3
- *
4
- * Integrates skill detection into the message flow.
5
- */
6
- import { detectExtractableMoment, shouldPromptExtraction, generateExtractionPrompt } from './detector.js';
7
- import { isClaudeceptionEnabled } from './index.js';
8
- const DEFAULT_CONFIG = {
9
- promptThreshold: 60,
10
- promptCooldown: 5,
11
- enabled: true,
12
- };
13
- const sessionStates = new Map();
14
- /**
15
- * Get or create session state.
16
- */
17
- function getSessionState(sessionId) {
18
- if (!sessionStates.has(sessionId)) {
19
- sessionStates.set(sessionId, {
20
- messagesSincePrompt: 0,
21
- lastDetection: null,
22
- promptedCount: 0,
23
- });
24
- }
25
- return sessionStates.get(sessionId);
26
- }
27
- /**
28
- * Process assistant response for skill detection.
29
- * Returns prompt text if extraction should be suggested, null otherwise.
30
- */
31
- export function processResponseForDetection(assistantMessage, userMessage, sessionId, config = {}) {
32
- const mergedConfig = { ...DEFAULT_CONFIG, ...config };
33
- if (!mergedConfig.enabled || !isClaudeceptionEnabled()) {
34
- return null;
35
- }
36
- const state = getSessionState(sessionId);
37
- state.messagesSincePrompt++;
38
- // Check cooldown
39
- if (state.messagesSincePrompt < mergedConfig.promptCooldown) {
40
- return null;
41
- }
42
- // Detect extractable moment
43
- const detection = detectExtractableMoment(assistantMessage, userMessage);
44
- state.lastDetection = detection;
45
- // Check if we should prompt
46
- if (shouldPromptExtraction(detection, mergedConfig.promptThreshold)) {
47
- state.messagesSincePrompt = 0;
48
- state.promptedCount++;
49
- return generateExtractionPrompt(detection);
50
- }
51
- return null;
52
- }
53
- /**
54
- * Get the last detection result for a session.
55
- */
56
- export function getLastDetection(sessionId) {
57
- return sessionStates.get(sessionId)?.lastDetection || null;
58
- }
59
- /**
60
- * Clear detection state for a session.
61
- */
62
- export function clearDetectionState(sessionId) {
63
- sessionStates.delete(sessionId);
64
- }
65
- /**
66
- * Get detection statistics for a session.
67
- */
68
- export function getDetectionStats(sessionId) {
69
- const state = sessionStates.get(sessionId);
70
- if (!state) {
71
- return {
72
- messagesSincePrompt: 0,
73
- promptedCount: 0,
74
- lastDetection: null,
75
- };
76
- }
77
- return {
78
- messagesSincePrompt: state.messagesSincePrompt,
79
- promptedCount: state.promptedCount,
80
- lastDetection: state.lastDetection,
81
- };
82
- }
83
- //# sourceMappingURL=detection-hook.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detection-hook.js","sourceRoot":"","sources":["../../../src/hooks/learned-skills/detection-hook.ts"],"names":[],"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AAa,GAAG,SAAS,CAAC;IAEhC,4BAA4B;IAC5B,IAAI,sBAAsB,CAAC,SAAS,EAAE,YAAY,CAAC,eAAe,CAAC,EAAE,CAAC;QACpE,KAAK,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAC9B,KAAK,CAAC,aAAa,EAAE,CAAC;QACtB,OAAO,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,aAAa,IAAI,IAAI,CAAC;AAC7D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IAKjD,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO;YACL,mBAAmB,EAAE,CAAC;YACtB,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,IAAI;SACpB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;QAC9C,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,aAAa,EAAE,KAAK,CAAC,aAAa;KACnC,CAAC;AACJ,CAAC"}
@@ -1,30 +0,0 @@
1
- /**
2
- * Extractable Moment Detector
3
- *
4
- * Detects patterns in conversation that indicate a skill could be extracted.
5
- */
6
- export interface DetectionResult {
7
- /** Whether an extractable moment was detected */
8
- detected: boolean;
9
- /** Confidence score (0-100) */
10
- confidence: number;
11
- /** Type of pattern detected */
12
- patternType: 'problem-solution' | 'technique' | 'workaround' | 'optimization' | 'best-practice';
13
- /** Suggested trigger keywords */
14
- suggestedTriggers: string[];
15
- /** Reason for detection */
16
- reason: string;
17
- }
18
- /**
19
- * Detect if a message contains an extractable skill moment.
20
- */
21
- export declare function detectExtractableMoment(assistantMessage: string, userMessage?: string): DetectionResult;
22
- /**
23
- * Check if detection confidence meets threshold for prompting.
24
- */
25
- export declare function shouldPromptExtraction(detection: DetectionResult, threshold?: number): boolean;
26
- /**
27
- * Generate a prompt for skill extraction confirmation.
28
- */
29
- export declare function generateExtractionPrompt(detection: DetectionResult): string;
30
- //# sourceMappingURL=detector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/hooks/learned-skills/detector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,+BAA+B;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,WAAW,EAAE,kBAAkB,GAAG,WAAW,GAAG,YAAY,GAAG,cAAc,GAAG,eAAe,CAAC;IAChG,iCAAiC;IACjC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AA2ED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,MAAM,EACxB,WAAW,CAAC,EAAE,MAAM,GACnB,eAAe,CAiDjB;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,eAAe,EAC1B,SAAS,GAAE,MAAW,GACrB,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,CAiB3E"}