@liangjie559567/ultrapower 5.5.11 → 5.5.13

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 (491) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/bridge/mcp-server.cjs +145 -38
  4. package/commands/wizard.md +5 -0
  5. package/dist/__tests__/validateMode.test.js +1 -1
  6. package/dist/__tests__/validateMode.test.js.map +1 -1
  7. package/dist/agents/__tests__/agent-wrapper.test.d.ts +2 -0
  8. package/dist/agents/__tests__/agent-wrapper.test.d.ts.map +1 -0
  9. package/dist/agents/__tests__/agent-wrapper.test.js +37 -0
  10. package/dist/agents/__tests__/agent-wrapper.test.js.map +1 -0
  11. package/dist/agents/__tests__/timeout-config.test.d.ts +2 -0
  12. package/dist/agents/__tests__/timeout-config.test.d.ts.map +1 -0
  13. package/dist/agents/__tests__/timeout-config.test.js +35 -0
  14. package/dist/agents/__tests__/timeout-config.test.js.map +1 -0
  15. package/dist/agents/__tests__/timeout-manager.test.d.ts +2 -0
  16. package/dist/agents/__tests__/timeout-manager.test.d.ts.map +1 -0
  17. package/dist/agents/__tests__/timeout-manager.test.js +37 -0
  18. package/dist/agents/__tests__/timeout-manager.test.js.map +1 -0
  19. package/dist/agents/agent-wrapper.d.ts +22 -0
  20. package/dist/agents/agent-wrapper.d.ts.map +1 -0
  21. package/dist/agents/agent-wrapper.js +51 -0
  22. package/dist/agents/agent-wrapper.js.map +1 -0
  23. package/dist/agents/index.d.ts +3 -0
  24. package/dist/agents/index.d.ts.map +1 -1
  25. package/dist/agents/index.js +4 -0
  26. package/dist/agents/index.js.map +1 -1
  27. package/dist/agents/timeout-config.d.ts +19 -0
  28. package/dist/agents/timeout-config.d.ts.map +1 -0
  29. package/dist/agents/timeout-config.js +57 -0
  30. package/dist/agents/timeout-config.js.map +1 -0
  31. package/dist/agents/timeout-manager.d.ts +30 -0
  32. package/dist/agents/timeout-manager.d.ts.map +1 -0
  33. package/dist/agents/timeout-manager.js +47 -0
  34. package/dist/agents/timeout-manager.js.map +1 -0
  35. package/dist/analytics/analytics-summary.d.ts.map +1 -1
  36. package/dist/analytics/analytics-summary.js +7 -1
  37. package/dist/analytics/analytics-summary.js.map +1 -1
  38. package/dist/analytics/metrics-collector.d.ts.map +1 -1
  39. package/dist/analytics/metrics-collector.js +9 -1
  40. package/dist/analytics/metrics-collector.js.map +1 -1
  41. package/dist/analytics/query-engine.d.ts.map +1 -1
  42. package/dist/analytics/query-engine.js +21 -3
  43. package/dist/analytics/query-engine.js.map +1 -1
  44. package/dist/analytics/token-tracker.js +3 -3
  45. package/dist/analytics/token-tracker.js.map +1 -1
  46. package/dist/analytics/transcript-scanner.d.ts.map +1 -1
  47. package/dist/analytics/transcript-scanner.js +1 -0
  48. package/dist/analytics/transcript-scanner.js.map +1 -1
  49. package/dist/audit/logger.d.ts +28 -0
  50. package/dist/audit/logger.d.ts.map +1 -0
  51. package/dist/audit/logger.js +78 -0
  52. package/dist/audit/logger.js.map +1 -0
  53. package/dist/audit/verify-cli.d.ts +2 -0
  54. package/dist/audit/verify-cli.d.ts.map +1 -0
  55. package/dist/audit/verify-cli.js +10 -0
  56. package/dist/audit/verify-cli.js.map +1 -0
  57. package/dist/core/hud-config.d.ts +19 -0
  58. package/dist/core/hud-config.d.ts.map +1 -0
  59. package/dist/core/hud-config.js +6 -0
  60. package/dist/core/hud-config.js.map +1 -0
  61. package/dist/core/job-types.d.ts +22 -0
  62. package/dist/core/job-types.d.ts.map +1 -0
  63. package/dist/core/job-types.js +6 -0
  64. package/dist/core/job-types.js.map +1 -0
  65. package/dist/features/diagnostics/error-matcher.d.ts +12 -0
  66. package/dist/features/diagnostics/error-matcher.d.ts.map +1 -0
  67. package/dist/features/diagnostics/error-matcher.js +41 -0
  68. package/dist/features/diagnostics/error-matcher.js.map +1 -0
  69. package/dist/features/diagnostics/index.d.ts +3 -0
  70. package/dist/features/diagnostics/index.d.ts.map +1 -0
  71. package/dist/features/diagnostics/index.js +3 -0
  72. package/dist/features/diagnostics/index.js.map +1 -0
  73. package/dist/features/diagnostics/solution-suggester.d.ts +12 -0
  74. package/dist/features/diagnostics/solution-suggester.d.ts.map +1 -0
  75. package/dist/features/diagnostics/solution-suggester.js +46 -0
  76. package/dist/features/diagnostics/solution-suggester.js.map +1 -0
  77. package/dist/features/diagnostics/types.d.ts +25 -0
  78. package/dist/features/diagnostics/types.d.ts.map +1 -0
  79. package/dist/features/diagnostics/types.js +5 -0
  80. package/dist/features/diagnostics/types.js.map +1 -0
  81. package/dist/features/state-manager/__tests__/cache.test.js +17 -17
  82. package/dist/features/state-manager/__tests__/cache.test.js.map +1 -1
  83. package/dist/features/state-manager/__tests__/encryption-performance.test.d.ts +2 -0
  84. package/dist/features/state-manager/__tests__/encryption-performance.test.d.ts.map +1 -0
  85. package/dist/features/state-manager/__tests__/encryption-performance.test.js +42 -0
  86. package/dist/features/state-manager/__tests__/encryption-performance.test.js.map +1 -0
  87. package/dist/features/state-manager/__tests__/encryption.test.d.ts +2 -0
  88. package/dist/features/state-manager/__tests__/encryption.test.d.ts.map +1 -0
  89. package/dist/features/state-manager/__tests__/encryption.test.js +68 -0
  90. package/dist/features/state-manager/__tests__/encryption.test.js.map +1 -0
  91. package/dist/features/state-manager/encryption.d.ts +24 -0
  92. package/dist/features/state-manager/encryption.d.ts.map +1 -0
  93. package/dist/features/state-manager/encryption.js +86 -0
  94. package/dist/features/state-manager/encryption.js.map +1 -0
  95. package/dist/features/state-manager/index.d.ts +4 -0
  96. package/dist/features/state-manager/index.d.ts.map +1 -1
  97. package/dist/features/state-manager/index.js +94 -6
  98. package/dist/features/state-manager/index.js.map +1 -1
  99. package/dist/features/state-manager/tiered-writer.d.ts +44 -0
  100. package/dist/features/state-manager/tiered-writer.d.ts.map +1 -0
  101. package/dist/features/state-manager/tiered-writer.js +76 -0
  102. package/dist/features/state-manager/tiered-writer.js.map +1 -0
  103. package/dist/features/state-manager/wal.d.ts +21 -0
  104. package/dist/features/state-manager/wal.d.ts.map +1 -0
  105. package/dist/features/state-manager/wal.js +75 -0
  106. package/dist/features/state-manager/wal.js.map +1 -0
  107. package/dist/features/task-templates/index.d.ts +13 -0
  108. package/dist/features/task-templates/index.d.ts.map +1 -0
  109. package/dist/features/task-templates/index.js +31 -0
  110. package/dist/features/task-templates/index.js.map +1 -0
  111. package/dist/features/task-templates/wizard-integration.d.ts +15 -0
  112. package/dist/features/task-templates/wizard-integration.d.ts.map +1 -0
  113. package/dist/features/task-templates/wizard-integration.js +27 -0
  114. package/dist/features/task-templates/wizard-integration.js.map +1 -0
  115. package/dist/features/wizard/__tests__/engine.test.d.ts +2 -0
  116. package/dist/features/wizard/__tests__/engine.test.d.ts.map +1 -0
  117. package/dist/features/wizard/__tests__/engine.test.js +78 -0
  118. package/dist/features/wizard/__tests__/engine.test.js.map +1 -0
  119. package/dist/features/wizard/__tests__/recommendation-engine.test.d.ts +2 -0
  120. package/dist/features/wizard/__tests__/recommendation-engine.test.d.ts.map +1 -0
  121. package/dist/features/wizard/__tests__/recommendation-engine.test.js +43 -0
  122. package/dist/features/wizard/__tests__/recommendation-engine.test.js.map +1 -0
  123. package/dist/features/wizard/engine.d.ts +15 -0
  124. package/dist/features/wizard/engine.d.ts.map +1 -0
  125. package/dist/features/wizard/engine.js +74 -0
  126. package/dist/features/wizard/engine.js.map +1 -0
  127. package/dist/features/wizard/index.d.ts +8 -0
  128. package/dist/features/wizard/index.d.ts.map +1 -0
  129. package/dist/features/wizard/index.js +7 -0
  130. package/dist/features/wizard/index.js.map +1 -0
  131. package/dist/features/wizard/questions.d.ts +6 -0
  132. package/dist/features/wizard/questions.d.ts.map +1 -0
  133. package/dist/features/wizard/questions.js +64 -0
  134. package/dist/features/wizard/questions.js.map +1 -0
  135. package/dist/features/wizard/recommendation-engine.d.ts +6 -0
  136. package/dist/features/wizard/recommendation-engine.d.ts.map +1 -0
  137. package/dist/features/wizard/recommendation-engine.js +33 -0
  138. package/dist/features/wizard/recommendation-engine.js.map +1 -0
  139. package/dist/features/wizard/types.d.ts +23 -0
  140. package/dist/features/wizard/types.d.ts.map +1 -0
  141. package/dist/features/wizard/types.js +5 -0
  142. package/dist/features/wizard/types.js.map +1 -0
  143. package/dist/features/workflow-recommender/context-analyzer.d.ts +6 -0
  144. package/dist/features/workflow-recommender/context-analyzer.d.ts.map +1 -0
  145. package/dist/features/workflow-recommender/context-analyzer.js +20 -0
  146. package/dist/features/workflow-recommender/context-analyzer.js.map +1 -0
  147. package/dist/features/workflow-recommender/index.d.ts +8 -0
  148. package/dist/features/workflow-recommender/index.d.ts.map +1 -0
  149. package/dist/features/workflow-recommender/index.js +7 -0
  150. package/dist/features/workflow-recommender/index.js.map +1 -0
  151. package/dist/features/workflow-recommender/intent-classifier.d.ts +6 -0
  152. package/dist/features/workflow-recommender/intent-classifier.d.ts.map +1 -0
  153. package/dist/features/workflow-recommender/intent-classifier.js +24 -0
  154. package/dist/features/workflow-recommender/intent-classifier.js.map +1 -0
  155. package/dist/features/workflow-recommender/recommendation-engine.d.ts +6 -0
  156. package/dist/features/workflow-recommender/recommendation-engine.d.ts.map +1 -0
  157. package/dist/features/workflow-recommender/recommendation-engine.js +110 -0
  158. package/dist/features/workflow-recommender/recommendation-engine.js.map +1 -0
  159. package/dist/features/workflow-recommender/types.d.ts +20 -0
  160. package/dist/features/workflow-recommender/types.d.ts.map +1 -0
  161. package/dist/features/workflow-recommender/types.js +5 -0
  162. package/dist/features/workflow-recommender/types.js.map +1 -0
  163. package/dist/hooks/__tests__/bridge-normalize.test.d.ts +2 -0
  164. package/dist/hooks/__tests__/bridge-normalize.test.d.ts.map +1 -0
  165. package/dist/hooks/__tests__/bridge-normalize.test.js +90 -0
  166. package/dist/hooks/__tests__/bridge-normalize.test.js.map +1 -0
  167. package/dist/hooks/__tests__/bridge-security.test.js +23 -41
  168. package/dist/hooks/__tests__/bridge-security.test.js.map +1 -1
  169. package/dist/hooks/auto-slash-command/__tests__/detector.test.d.ts +2 -0
  170. package/dist/hooks/auto-slash-command/__tests__/detector.test.d.ts.map +1 -0
  171. package/dist/hooks/auto-slash-command/__tests__/detector.test.js +70 -0
  172. package/dist/hooks/auto-slash-command/__tests__/detector.test.js.map +1 -0
  173. package/dist/hooks/auto-slash-command/__tests__/executor.test.d.ts +2 -0
  174. package/dist/hooks/auto-slash-command/__tests__/executor.test.d.ts.map +1 -0
  175. package/dist/hooks/auto-slash-command/__tests__/executor.test.js +55 -0
  176. package/dist/hooks/auto-slash-command/__tests__/executor.test.js.map +1 -0
  177. package/dist/hooks/auto-slash-command/__tests__/index.test.d.ts +2 -0
  178. package/dist/hooks/auto-slash-command/__tests__/index.test.d.ts.map +1 -0
  179. package/dist/hooks/auto-slash-command/__tests__/index.test.js +50 -0
  180. package/dist/hooks/auto-slash-command/__tests__/index.test.js.map +1 -0
  181. package/dist/hooks/autopilot/__tests__/prompts.test.js +19 -1
  182. package/dist/hooks/autopilot/__tests__/prompts.test.js.map +1 -1
  183. package/dist/hooks/autopilot/enforcement.d.ts +1 -1
  184. package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
  185. package/dist/hooks/autopilot/enforcement.js +1 -1
  186. package/dist/hooks/autopilot/enforcement.js.map +1 -1
  187. package/dist/hooks/bridge-normalize.d.ts +43 -3
  188. package/dist/hooks/bridge-normalize.d.ts.map +1 -1
  189. package/dist/hooks/bridge-normalize.js +110 -15
  190. package/dist/hooks/bridge-normalize.js.map +1 -1
  191. package/dist/hooks/bridge-types.d.ts +48 -0
  192. package/dist/hooks/bridge-types.d.ts.map +1 -0
  193. package/dist/hooks/bridge-types.js +6 -0
  194. package/dist/hooks/bridge-types.js.map +1 -0
  195. package/dist/hooks/bridge.d.ts +1 -43
  196. package/dist/hooks/bridge.d.ts.map +1 -1
  197. package/dist/hooks/bridge.js +18 -2
  198. package/dist/hooks/bridge.js.map +1 -1
  199. package/dist/hooks/dependency-analyzer.d.ts +32 -0
  200. package/dist/hooks/dependency-analyzer.d.ts.map +1 -0
  201. package/dist/hooks/dependency-analyzer.js +199 -0
  202. package/dist/hooks/dependency-analyzer.js.map +1 -0
  203. package/dist/hooks/index.d.ts +2 -1
  204. package/dist/hooks/index.d.ts.map +1 -1
  205. package/dist/hooks/index.js.map +1 -1
  206. package/dist/hooks/learner/__tests__/detector.test.d.ts +2 -0
  207. package/dist/hooks/learner/__tests__/detector.test.d.ts.map +1 -0
  208. package/dist/hooks/learner/__tests__/detector.test.js +170 -0
  209. package/dist/hooks/learner/__tests__/detector.test.js.map +1 -0
  210. package/dist/hooks/learner/__tests__/index.test.d.ts +2 -0
  211. package/dist/hooks/learner/__tests__/index.test.d.ts.map +1 -0
  212. package/dist/hooks/learner/__tests__/index.test.js +48 -0
  213. package/dist/hooks/learner/__tests__/index.test.js.map +1 -0
  214. package/dist/hooks/learner/__tests__/matcher.test.d.ts +2 -0
  215. package/dist/hooks/learner/__tests__/matcher.test.d.ts.map +1 -0
  216. package/dist/hooks/learner/__tests__/matcher.test.js +114 -0
  217. package/dist/hooks/learner/__tests__/matcher.test.js.map +1 -0
  218. package/dist/hooks/learner/__tests__/promotion.test.d.ts +2 -0
  219. package/dist/hooks/learner/__tests__/promotion.test.d.ts.map +1 -0
  220. package/dist/hooks/learner/__tests__/promotion.test.js +146 -0
  221. package/dist/hooks/learner/__tests__/promotion.test.js.map +1 -0
  222. package/dist/hooks/learner/__tests__/validator.test.d.ts +2 -0
  223. package/dist/hooks/learner/__tests__/validator.test.d.ts.map +1 -0
  224. package/dist/hooks/learner/__tests__/validator.test.js +123 -0
  225. package/dist/hooks/learner/__tests__/validator.test.js.map +1 -0
  226. package/dist/hooks/learner/__tests__/writer.test.d.ts +2 -0
  227. package/dist/hooks/learner/__tests__/writer.test.d.ts.map +1 -0
  228. package/dist/hooks/learner/__tests__/writer.test.js +141 -0
  229. package/dist/hooks/learner/__tests__/writer.test.js.map +1 -0
  230. package/dist/hooks/learner/detection-hook.js +2 -2
  231. package/dist/hooks/learner/detection-hook.js.map +1 -1
  232. package/dist/hooks/parallel-executor.d.ts +24 -0
  233. package/dist/hooks/parallel-executor.d.ts.map +1 -0
  234. package/dist/hooks/parallel-executor.js +82 -0
  235. package/dist/hooks/parallel-executor.js.map +1 -0
  236. package/dist/hooks/persistent-mode/index.d.ts +2 -21
  237. package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
  238. package/dist/hooks/persistent-mode/index.js +4 -85
  239. package/dist/hooks/persistent-mode/index.js.map +1 -1
  240. package/dist/hooks/persistent-mode/tool-error.d.ts +15 -0
  241. package/dist/hooks/persistent-mode/tool-error.d.ts.map +1 -0
  242. package/dist/hooks/persistent-mode/tool-error.js +80 -0
  243. package/dist/hooks/persistent-mode/tool-error.js.map +1 -0
  244. package/dist/hooks/pre-compact/index.d.ts.map +1 -1
  245. package/dist/hooks/pre-compact/index.js +0 -1
  246. package/dist/hooks/pre-compact/index.js.map +1 -1
  247. package/dist/hooks/project-memory/learner.d.ts +13 -1
  248. package/dist/hooks/project-memory/learner.d.ts.map +1 -1
  249. package/dist/hooks/project-memory/learner.js +24 -12
  250. package/dist/hooks/project-memory/learner.js.map +1 -1
  251. package/dist/hooks/race-detector.d.ts +51 -0
  252. package/dist/hooks/race-detector.d.ts.map +1 -0
  253. package/dist/hooks/race-detector.js +121 -0
  254. package/dist/hooks/race-detector.js.map +1 -0
  255. package/dist/hooks/ralph/__tests__/loop.test.d.ts +2 -0
  256. package/dist/hooks/ralph/__tests__/loop.test.d.ts.map +1 -0
  257. package/dist/hooks/ralph/__tests__/loop.test.js +268 -0
  258. package/dist/hooks/ralph/__tests__/loop.test.js.map +1 -0
  259. package/dist/hooks/ralph/__tests__/prd.test.d.ts +2 -0
  260. package/dist/hooks/ralph/__tests__/prd.test.d.ts.map +1 -0
  261. package/dist/hooks/ralph/__tests__/prd.test.js +197 -0
  262. package/dist/hooks/ralph/__tests__/prd.test.js.map +1 -0
  263. package/dist/hooks/ralph/__tests__/progress.test.d.ts +2 -0
  264. package/dist/hooks/ralph/__tests__/progress.test.d.ts.map +1 -0
  265. package/dist/hooks/ralph/__tests__/progress.test.js +120 -0
  266. package/dist/hooks/ralph/__tests__/progress.test.js.map +1 -0
  267. package/dist/hooks/ralph/__tests__/verifier.test.d.ts +2 -0
  268. package/dist/hooks/ralph/__tests__/verifier.test.d.ts.map +1 -0
  269. package/dist/hooks/ralph/__tests__/verifier.test.js +75 -0
  270. package/dist/hooks/ralph/__tests__/verifier.test.js.map +1 -0
  271. package/dist/hooks/recovery/__tests__/context-window.test.d.ts +2 -0
  272. package/dist/hooks/recovery/__tests__/context-window.test.d.ts.map +1 -0
  273. package/dist/hooks/recovery/__tests__/context-window.test.js +131 -0
  274. package/dist/hooks/recovery/__tests__/context-window.test.js.map +1 -0
  275. package/dist/hooks/recovery/__tests__/edit-error.test.d.ts +2 -0
  276. package/dist/hooks/recovery/__tests__/edit-error.test.d.ts.map +1 -0
  277. package/dist/hooks/recovery/__tests__/edit-error.test.js +88 -0
  278. package/dist/hooks/recovery/__tests__/edit-error.test.js.map +1 -0
  279. package/dist/hooks/recovery/__tests__/index.test.d.ts +2 -0
  280. package/dist/hooks/recovery/__tests__/index.test.d.ts.map +1 -0
  281. package/dist/hooks/recovery/__tests__/index.test.js +270 -0
  282. package/dist/hooks/recovery/__tests__/index.test.js.map +1 -0
  283. package/dist/hooks/recovery/__tests__/session-recovery.test.d.ts +2 -0
  284. package/dist/hooks/recovery/__tests__/session-recovery.test.d.ts.map +1 -0
  285. package/dist/hooks/recovery/__tests__/session-recovery.test.js +129 -0
  286. package/dist/hooks/recovery/__tests__/session-recovery.test.js.map +1 -0
  287. package/dist/hooks/recovery/__tests__/storage.test.d.ts +2 -0
  288. package/dist/hooks/recovery/__tests__/storage.test.d.ts.map +1 -0
  289. package/dist/hooks/recovery/__tests__/storage.test.js +549 -0
  290. package/dist/hooks/recovery/__tests__/storage.test.js.map +1 -0
  291. package/dist/hooks/rules-injector/__tests__/finder.test.d.ts +2 -0
  292. package/dist/hooks/rules-injector/__tests__/finder.test.d.ts.map +1 -0
  293. package/dist/hooks/rules-injector/__tests__/finder.test.js +68 -0
  294. package/dist/hooks/rules-injector/__tests__/finder.test.js.map +1 -0
  295. package/dist/hooks/rules-injector/__tests__/index.test.d.ts +2 -0
  296. package/dist/hooks/rules-injector/__tests__/index.test.d.ts.map +1 -0
  297. package/dist/hooks/rules-injector/__tests__/index.test.js +58 -0
  298. package/dist/hooks/rules-injector/__tests__/index.test.js.map +1 -0
  299. package/dist/hooks/rules-injector/__tests__/matcher.test.d.ts +2 -0
  300. package/dist/hooks/rules-injector/__tests__/matcher.test.d.ts.map +1 -0
  301. package/dist/hooks/rules-injector/__tests__/matcher.test.js +86 -0
  302. package/dist/hooks/rules-injector/__tests__/matcher.test.js.map +1 -0
  303. package/dist/hooks/rules-injector/__tests__/parser.test.d.ts +2 -0
  304. package/dist/hooks/rules-injector/__tests__/parser.test.d.ts.map +1 -0
  305. package/dist/hooks/rules-injector/__tests__/parser.test.js +86 -0
  306. package/dist/hooks/rules-injector/__tests__/parser.test.js.map +1 -0
  307. package/dist/hooks/session-end/__tests__/index.test.d.ts +2 -0
  308. package/dist/hooks/session-end/__tests__/index.test.d.ts.map +1 -0
  309. package/dist/hooks/session-end/__tests__/index.test.js +77 -0
  310. package/dist/hooks/session-end/__tests__/index.test.js.map +1 -0
  311. package/dist/hooks/session-end/callbacks.d.ts +1 -1
  312. package/dist/hooks/session-end/index.d.ts +2 -21
  313. package/dist/hooks/session-end/index.d.ts.map +1 -1
  314. package/dist/hooks/session-end/index.js.map +1 -1
  315. package/dist/hooks/session-end/types.d.ts +26 -0
  316. package/dist/hooks/session-end/types.d.ts.map +1 -0
  317. package/dist/hooks/session-end/types.js +6 -0
  318. package/dist/hooks/session-end/types.js.map +1 -0
  319. package/dist/hooks/setup/__tests__/index.test.d.ts +2 -0
  320. package/dist/hooks/setup/__tests__/index.test.d.ts.map +1 -0
  321. package/dist/hooks/setup/__tests__/index.test.js +68 -0
  322. package/dist/hooks/setup/__tests__/index.test.js.map +1 -0
  323. package/dist/hooks/team-pipeline/__tests__/state.test.d.ts +2 -0
  324. package/dist/hooks/team-pipeline/__tests__/state.test.d.ts.map +1 -0
  325. package/dist/hooks/team-pipeline/__tests__/state.test.js +94 -0
  326. package/dist/hooks/team-pipeline/__tests__/state.test.js.map +1 -0
  327. package/dist/hud/elements/autopilot.d.ts +1 -1
  328. package/dist/hud/elements/autopilot.d.ts.map +1 -1
  329. package/dist/hud/state.d.ts.map +1 -1
  330. package/dist/hud/state.js +69 -1
  331. package/dist/hud/state.js.map +1 -1
  332. package/dist/hud/types.d.ts +2 -15
  333. package/dist/hud/types.d.ts.map +1 -1
  334. package/dist/hud/types.js.map +1 -1
  335. package/dist/lib/__tests__/validateMode.test.d.ts +2 -0
  336. package/dist/lib/__tests__/validateMode.test.d.ts.map +1 -0
  337. package/dist/lib/__tests__/validateMode.test.js +61 -0
  338. package/dist/lib/__tests__/validateMode.test.js.map +1 -0
  339. package/dist/lib/path-validator.d.ts +25 -0
  340. package/dist/lib/path-validator.d.ts.map +1 -0
  341. package/dist/lib/path-validator.js +81 -0
  342. package/dist/lib/path-validator.js.map +1 -0
  343. package/dist/lib/validateMode.d.ts +3 -0
  344. package/dist/lib/validateMode.d.ts.map +1 -1
  345. package/dist/lib/validateMode.js +28 -2
  346. package/dist/lib/validateMode.js.map +1 -1
  347. package/dist/mcp/__tests__/cli-detection.test.d.ts +2 -0
  348. package/dist/mcp/__tests__/cli-detection.test.d.ts.map +1 -0
  349. package/dist/mcp/__tests__/cli-detection.test.js +50 -0
  350. package/dist/mcp/__tests__/cli-detection.test.js.map +1 -0
  351. package/dist/mcp/__tests__/codex-core.test.d.ts +2 -0
  352. package/dist/mcp/__tests__/codex-core.test.d.ts.map +1 -0
  353. package/dist/mcp/__tests__/codex-core.test.js +143 -0
  354. package/dist/mcp/__tests__/codex-core.test.js.map +1 -0
  355. package/dist/mcp/__tests__/codex-integration.test.d.ts +2 -0
  356. package/dist/mcp/__tests__/codex-integration.test.d.ts.map +1 -0
  357. package/dist/mcp/__tests__/codex-integration.test.js +59 -0
  358. package/dist/mcp/__tests__/codex-integration.test.js.map +1 -0
  359. package/dist/mcp/__tests__/gemini-core.test.d.ts +2 -0
  360. package/dist/mcp/__tests__/gemini-core.test.d.ts.map +1 -0
  361. package/dist/mcp/__tests__/gemini-core.test.js +53 -0
  362. package/dist/mcp/__tests__/gemini-core.test.js.map +1 -0
  363. package/dist/mcp/__tests__/gemini-integration.test.d.ts +2 -0
  364. package/dist/mcp/__tests__/gemini-integration.test.d.ts.map +1 -0
  365. package/dist/mcp/__tests__/gemini-integration.test.js +50 -0
  366. package/dist/mcp/__tests__/gemini-integration.test.js.map +1 -0
  367. package/dist/mcp/__tests__/job-state-db-deprecation.test.js +48 -1
  368. package/dist/mcp/__tests__/job-state-db-deprecation.test.js.map +1 -1
  369. package/dist/mcp/__tests__/omc-tools-server.test.d.ts +2 -0
  370. package/dist/mcp/__tests__/omc-tools-server.test.d.ts.map +1 -0
  371. package/dist/mcp/__tests__/omc-tools-server.test.js +108 -0
  372. package/dist/mcp/__tests__/omc-tools-server.test.js.map +1 -0
  373. package/dist/mcp/__tests__/prompt-injection.test.d.ts +2 -0
  374. package/dist/mcp/__tests__/prompt-injection.test.d.ts.map +1 -0
  375. package/dist/mcp/__tests__/prompt-injection.test.js +86 -0
  376. package/dist/mcp/__tests__/prompt-injection.test.js.map +1 -0
  377. package/dist/mcp/job-state-db.d.ts +1 -1
  378. package/dist/mcp/job-state-db.d.ts.map +1 -1
  379. package/dist/mcp/prompt-persistence.d.ts +2 -17
  380. package/dist/mcp/prompt-persistence.d.ts.map +1 -1
  381. package/dist/mcp/prompt-persistence.js.map +1 -1
  382. package/dist/team/__tests__/deadlock-detector.test.d.ts +2 -0
  383. package/dist/team/__tests__/deadlock-detector.test.d.ts.map +1 -0
  384. package/dist/team/__tests__/deadlock-detector.test.js +50 -0
  385. package/dist/team/__tests__/deadlock-detector.test.js.map +1 -0
  386. package/dist/team/__tests__/dependency-graph.test.d.ts +2 -0
  387. package/dist/team/__tests__/dependency-graph.test.d.ts.map +1 -0
  388. package/dist/team/__tests__/dependency-graph.test.js +29 -0
  389. package/dist/team/__tests__/dependency-graph.test.js.map +1 -0
  390. package/dist/team/capabilities.d.ts +1 -2
  391. package/dist/team/capabilities.d.ts.map +1 -1
  392. package/dist/team/capabilities.js.map +1 -1
  393. package/dist/team/deadlock-detector.d.ts +16 -0
  394. package/dist/team/deadlock-detector.d.ts.map +1 -0
  395. package/dist/team/deadlock-detector.js +52 -0
  396. package/dist/team/deadlock-detector.js.map +1 -0
  397. package/dist/team/dependency-graph.d.ts +23 -0
  398. package/dist/team/dependency-graph.d.ts.map +1 -0
  399. package/dist/team/dependency-graph.js +35 -0
  400. package/dist/team/dependency-graph.js.map +1 -0
  401. package/dist/team/index.d.ts +3 -0
  402. package/dist/team/index.d.ts.map +1 -1
  403. package/dist/team/index.js +2 -0
  404. package/dist/team/index.js.map +1 -1
  405. package/dist/team/types.d.ts +15 -4
  406. package/dist/team/types.d.ts.map +1 -1
  407. package/dist/team/types.js +0 -1
  408. package/dist/team/types.js.map +1 -1
  409. package/dist/team/unified-team.d.ts +2 -11
  410. package/dist/team/unified-team.d.ts.map +1 -1
  411. package/dist/team/unified-team.js.map +1 -1
  412. package/dist/tools/__tests__/ast-tools.test.d.ts +2 -0
  413. package/dist/tools/__tests__/ast-tools.test.d.ts.map +1 -0
  414. package/dist/tools/__tests__/ast-tools.test.js +178 -0
  415. package/dist/tools/__tests__/ast-tools.test.js.map +1 -0
  416. package/dist/tools/__tests__/lsp-tools.test.d.ts +2 -0
  417. package/dist/tools/__tests__/lsp-tools.test.d.ts.map +1 -0
  418. package/dist/tools/__tests__/lsp-tools.test.js +252 -0
  419. package/dist/tools/__tests__/lsp-tools.test.js.map +1 -0
  420. package/dist/tools/diagnostics/__tests__/index.test.d.ts +2 -0
  421. package/dist/tools/diagnostics/__tests__/index.test.d.ts.map +1 -0
  422. package/dist/tools/diagnostics/__tests__/index.test.js +111 -0
  423. package/dist/tools/diagnostics/__tests__/index.test.js.map +1 -0
  424. package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.d.ts +2 -0
  425. package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.d.ts.map +1 -0
  426. package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.js +120 -0
  427. package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.js.map +1 -0
  428. package/dist/tools/diagnostics/__tests__/tsc-runner.test.d.ts +2 -0
  429. package/dist/tools/diagnostics/__tests__/tsc-runner.test.d.ts.map +1 -0
  430. package/dist/tools/diagnostics/__tests__/tsc-runner.test.js +86 -0
  431. package/dist/tools/diagnostics/__tests__/tsc-runner.test.js.map +1 -0
  432. package/dist/tools/diagnostics/constants.d.ts +5 -0
  433. package/dist/tools/diagnostics/constants.d.ts.map +1 -0
  434. package/dist/tools/diagnostics/constants.js +5 -0
  435. package/dist/tools/diagnostics/constants.js.map +1 -0
  436. package/dist/tools/diagnostics/index.d.ts +2 -1
  437. package/dist/tools/diagnostics/index.d.ts.map +1 -1
  438. package/dist/tools/diagnostics/index.js +2 -1
  439. package/dist/tools/diagnostics/index.js.map +1 -1
  440. package/dist/tools/diagnostics/lsp-aggregator.js +1 -1
  441. package/dist/tools/diagnostics/lsp-aggregator.js.map +1 -1
  442. package/dist/tools/lsp/__tests__/utils.test.d.ts +2 -0
  443. package/dist/tools/lsp/__tests__/utils.test.d.ts.map +1 -0
  444. package/dist/tools/lsp/__tests__/utils.test.js +338 -0
  445. package/dist/tools/lsp/__tests__/utils.test.js.map +1 -0
  446. package/dist/tools/lsp/utils.d.ts.map +1 -1
  447. package/dist/tools/lsp/utils.js +2 -2
  448. package/dist/tools/lsp/utils.js.map +1 -1
  449. package/dist/tools/python-repl/__tests__/bridge-manager.test.d.ts +2 -0
  450. package/dist/tools/python-repl/__tests__/bridge-manager.test.d.ts.map +1 -0
  451. package/dist/tools/python-repl/__tests__/bridge-manager.test.js +338 -0
  452. package/dist/tools/python-repl/__tests__/bridge-manager.test.js.map +1 -0
  453. package/dist/tools/python-repl/__tests__/socket-client.test.d.ts +2 -0
  454. package/dist/tools/python-repl/__tests__/socket-client.test.d.ts.map +1 -0
  455. package/dist/tools/python-repl/__tests__/socket-client.test.js +155 -0
  456. package/dist/tools/python-repl/__tests__/socket-client.test.js.map +1 -0
  457. package/dist/tools/python-repl/bridge-manager.d.ts +4 -0
  458. package/dist/tools/python-repl/bridge-manager.d.ts.map +1 -1
  459. package/dist/tools/python-repl/bridge-manager.js +4 -1
  460. package/dist/tools/python-repl/bridge-manager.js.map +1 -1
  461. package/docs/CLAUDE.md +1 -1
  462. package/docs/guides/task-templates-guide.md +153 -0
  463. package/docs/guides/troubleshooting-guide.md +110 -0
  464. package/docs/guides/wizard-user-guide.md +85 -0
  465. package/docs/guides/workflow-recommendation-guide.md +97 -0
  466. package/docs/reviews/ultrapower-security/review_critic.md +450 -0
  467. package/docs/reviews/ultrapower-tech-review/review_tech.md +180 -0
  468. package/docs/troubleshooting/agent-timeouts.md +37 -0
  469. package/docs/troubleshooting/common-errors.md +37 -0
  470. package/docs/troubleshooting/hook-failures.md +29 -0
  471. package/docs/troubleshooting/performance-issues.md +41 -0
  472. package/docs/troubleshooting/state-corruption.md +36 -0
  473. package/package.json +2 -1
  474. package/scripts/analyze-dependencies.ts +47 -0
  475. package/scripts/analyze-hook-coverage.ts +55 -0
  476. package/scripts/performance-regression.ts +28 -0
  477. package/scripts/profiling.ts +95 -0
  478. package/scripts/run-profiling.ts +64 -0
  479. package/scripts/test-parallel-execution.ts +72 -0
  480. package/scripts/test-race-detection.ts +57 -0
  481. package/scripts/test-tiered-writer.ts +60 -0
  482. package/scripts/test-wal-integration.ts +29 -0
  483. package/scripts/test-wal.ts +48 -0
  484. package/skills/next-step-router/SKILL.md +17 -0
  485. package/skills/wizard/SKILL.md +103 -72
  486. package/templates/tasks/README.md +45 -0
  487. package/templates/tasks/bug-fix.md +37 -0
  488. package/templates/tasks/code-review.md +36 -0
  489. package/templates/tasks/feature-development.md +43 -0
  490. package/templates/tasks/refactoring.md +37 -0
  491. package/templates/tasks/security-audit.md +37 -0
@@ -0,0 +1,88 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { detectEditError, injectEditErrorRecovery, handleEditErrorRecovery, processEditOutput } from '../edit-error.js';
3
+ describe('Edit Error Recovery', () => {
4
+ describe('detectEditError', () => {
5
+ it('detects "oldString not found" error', () => {
6
+ expect(detectEditError('Error: oldString not found in file')).toBe(true);
7
+ });
8
+ it('detects "old_string not found" error', () => {
9
+ expect(detectEditError('Error: old_string not found')).toBe(true);
10
+ });
11
+ it('detects "oldString and newString must be different" error', () => {
12
+ expect(detectEditError('oldString and newString must be different')).toBe(true);
13
+ });
14
+ it('detects "old_string and new_string must be different" error', () => {
15
+ expect(detectEditError('old_string and new_string must be different')).toBe(true);
16
+ });
17
+ it('detects "oldString found multiple times" error', () => {
18
+ expect(detectEditError('Error: oldString found multiple times')).toBe(true);
19
+ });
20
+ it('is case insensitive', () => {
21
+ expect(detectEditError('ERROR: OLDSTRING NOT FOUND')).toBe(true);
22
+ });
23
+ it('returns false for normal output', () => {
24
+ expect(detectEditError('File updated successfully')).toBe(false);
25
+ });
26
+ });
27
+ describe('injectEditErrorRecovery', () => {
28
+ it('injects reminder when error detected', () => {
29
+ const output = 'Error: oldString not found';
30
+ const result = injectEditErrorRecovery(output);
31
+ expect(result).toContain(output);
32
+ expect(result).toContain('[EDIT ERROR - IMMEDIATE ACTION REQUIRED]');
33
+ });
34
+ it('does not inject reminder for normal output', () => {
35
+ const output = 'File updated successfully';
36
+ const result = injectEditErrorRecovery(output);
37
+ expect(result).toBe(output);
38
+ });
39
+ });
40
+ describe('handleEditErrorRecovery', () => {
41
+ it('returns not attempted for non-Edit tools', () => {
42
+ const result = handleEditErrorRecovery('Read', 'Error: oldString not found');
43
+ expect(result.attempted).toBe(false);
44
+ expect(result.success).toBe(false);
45
+ });
46
+ it('handles Edit tool with error', () => {
47
+ const result = handleEditErrorRecovery('Edit', 'Error: oldString not found');
48
+ expect(result.attempted).toBe(true);
49
+ expect(result.success).toBe(true);
50
+ expect(result.errorType).toBe('edit_error');
51
+ expect(result.message).toContain('[EDIT ERROR - IMMEDIATE ACTION REQUIRED]');
52
+ });
53
+ it('is case insensitive for tool name', () => {
54
+ const result = handleEditErrorRecovery('EDIT', 'Error: oldString not found');
55
+ expect(result.attempted).toBe(true);
56
+ expect(result.success).toBe(true);
57
+ });
58
+ it('returns not attempted for Edit tool without error', () => {
59
+ const result = handleEditErrorRecovery('Edit', 'File updated successfully');
60
+ expect(result.attempted).toBe(false);
61
+ expect(result.success).toBe(false);
62
+ });
63
+ });
64
+ describe('processEditOutput', () => {
65
+ it('processes Edit tool output with error', () => {
66
+ const output = 'Error: oldString not found';
67
+ const result = processEditOutput('Edit', output);
68
+ expect(result).toContain(output);
69
+ expect(result).toContain('[EDIT ERROR - IMMEDIATE ACTION REQUIRED]');
70
+ });
71
+ it('does not process non-Edit tool output', () => {
72
+ const output = 'Error: oldString not found';
73
+ const result = processEditOutput('Read', output);
74
+ expect(result).toBe(output);
75
+ });
76
+ it('is case insensitive for tool name', () => {
77
+ const output = 'Error: oldString not found';
78
+ const result = processEditOutput('edit', output);
79
+ expect(result).toContain('[EDIT ERROR - IMMEDIATE ACTION REQUIRED]');
80
+ });
81
+ it('returns unchanged output for Edit tool without error', () => {
82
+ const output = 'File updated successfully';
83
+ const result = processEditOutput('Edit', output);
84
+ expect(result).toBe(output);
85
+ });
86
+ });
87
+ });
88
+ //# sourceMappingURL=edit-error.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-error.test.js","sourceRoot":"","sources":["../../../../src/hooks/recovery/__tests__/edit-error.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACv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AG,4BAA4B,CAAC;YAC5C,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACjD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,MAAM,MAAM,GAAG,4BAA4B,CAAC;YAC5C,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACjD,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,0CAA0C,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;YAC9D,MAAM,MAAM,GAAG,2BAA2B,CAAC;YAC3C,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YACjD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../src/hooks/recovery/__tests__/index.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,270 @@
1
+ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
2
+ import { createRecoveryHook, handleRecovery, detectRecoverableError, detectEditErrorInOutput, parseContextLimitError, detectContextLimitErrorInText, detectEditErrorInText, isSessionRecoverable } from '../index.js';
3
+ import * as contextWindow from '../context-window.js';
4
+ import * as sessionRecovery from '../session-recovery.js';
5
+ import * as editError from '../edit-error.js';
6
+ describe('Recovery Hook', () => {
7
+ beforeEach(() => {
8
+ vi.clearAllMocks();
9
+ });
10
+ afterEach(() => {
11
+ vi.restoreAllMocks();
12
+ });
13
+ describe('handleRecovery', () => {
14
+ it('returns not attempted when no error provided', async () => {
15
+ const result = await handleRecovery({
16
+ sessionId: 'test-session'
17
+ });
18
+ expect(result.attempted).toBe(false);
19
+ expect(result.success).toBe(false);
20
+ });
21
+ it('handles context window limit error with priority 1', async () => {
22
+ const error = { message: 'prompt is too long: 210000 tokens > 200000 maximum' };
23
+ vi.spyOn(contextWindow, 'handleContextWindowRecovery').mockReturnValue({
24
+ attempted: true,
25
+ success: true,
26
+ errorType: 'context_window_limit'
27
+ });
28
+ const result = await handleRecovery({
29
+ sessionId: 'test-session',
30
+ error
31
+ });
32
+ expect(result.attempted).toBe(true);
33
+ expect(result.success).toBe(true);
34
+ expect(result.errorType).toBe('context_window_limit');
35
+ });
36
+ it('handles session recovery error with priority 2', async () => {
37
+ const error = { message: 'tool_use requires tool_result' };
38
+ vi.spyOn(contextWindow, 'handleContextWindowRecovery').mockReturnValue({
39
+ attempted: false,
40
+ success: false
41
+ });
42
+ vi.spyOn(sessionRecovery, 'handleSessionRecovery').mockResolvedValue({
43
+ attempted: true,
44
+ success: true,
45
+ errorType: 'tool_result_missing'
46
+ });
47
+ const result = await handleRecovery({
48
+ sessionId: 'test-session',
49
+ error
50
+ });
51
+ expect(result.attempted).toBe(true);
52
+ expect(result.success).toBe(true);
53
+ expect(result.errorType).toBe('tool_result_missing');
54
+ });
55
+ it('handles edit error with priority 3', async () => {
56
+ vi.spyOn(editError, 'handleEditErrorRecovery').mockReturnValue({
57
+ attempted: true,
58
+ success: true,
59
+ errorType: 'edit_error'
60
+ });
61
+ const result = await handleRecovery({
62
+ sessionId: 'test-session',
63
+ toolName: 'Edit',
64
+ toolOutput: 'Error: old_string not found'
65
+ });
66
+ expect(result.attempted).toBe(true);
67
+ expect(result.success).toBe(true);
68
+ });
69
+ it('respects priority order: context window > session > edit', async () => {
70
+ const error = { message: 'prompt is too long: 210000 tokens' };
71
+ const contextSpy = vi.spyOn(contextWindow, 'handleContextWindowRecovery').mockReturnValue({
72
+ attempted: true,
73
+ success: true,
74
+ errorType: 'context_window_limit'
75
+ });
76
+ const sessionSpy = vi.spyOn(sessionRecovery, 'handleSessionRecovery');
77
+ await handleRecovery({
78
+ sessionId: 'test-session',
79
+ error,
80
+ toolName: 'Edit',
81
+ toolOutput: 'Error: old_string not found'
82
+ });
83
+ expect(contextSpy).toHaveBeenCalled();
84
+ expect(sessionSpy).not.toHaveBeenCalled();
85
+ });
86
+ it('falls through to next priority when recovery fails', async () => {
87
+ const error = { message: 'tool_use requires tool_result' };
88
+ vi.spyOn(contextWindow, 'handleContextWindowRecovery').mockReturnValue({
89
+ attempted: false,
90
+ success: false
91
+ });
92
+ vi.spyOn(sessionRecovery, 'handleSessionRecovery').mockResolvedValue({
93
+ attempted: true,
94
+ success: false
95
+ });
96
+ vi.spyOn(editError, 'handleEditErrorRecovery').mockReturnValue({
97
+ attempted: true,
98
+ success: true
99
+ });
100
+ const result = await handleRecovery({
101
+ sessionId: 'test-session',
102
+ error,
103
+ toolName: 'Edit',
104
+ toolOutput: 'Error: old_string not found'
105
+ });
106
+ expect(result.attempted).toBe(true);
107
+ expect(result.success).toBe(true);
108
+ });
109
+ it('returns not attempted when all recoveries fail', async () => {
110
+ const error = { message: 'unknown error' };
111
+ vi.spyOn(contextWindow, 'handleContextWindowRecovery').mockReturnValue({
112
+ attempted: false,
113
+ success: false
114
+ });
115
+ vi.spyOn(sessionRecovery, 'handleSessionRecovery').mockResolvedValue({
116
+ attempted: false,
117
+ success: false
118
+ });
119
+ const result = await handleRecovery({
120
+ sessionId: 'test-session',
121
+ error
122
+ });
123
+ expect(result.attempted).toBe(false);
124
+ expect(result.success).toBe(false);
125
+ });
126
+ });
127
+ describe('createRecoveryHook', () => {
128
+ it('creates hook with all required methods', () => {
129
+ const hook = createRecoveryHook();
130
+ expect(typeof hook.onError).toBe('function');
131
+ expect(typeof hook.afterToolExecute).toBe('function');
132
+ expect(typeof hook.isRecoverable).toBe('function');
133
+ expect(typeof hook.getRecoveryType).toBe('function');
134
+ });
135
+ it('onError handles context window limit', async () => {
136
+ const hook = createRecoveryHook();
137
+ const error = { message: 'prompt is too long: 210000 tokens' };
138
+ vi.spyOn(contextWindow, 'handleContextWindowRecovery').mockReturnValue({
139
+ attempted: true,
140
+ success: true
141
+ });
142
+ const result = await hook.onError({ sessionId: 'test', error });
143
+ expect(result.attempted).toBe(true);
144
+ });
145
+ it('onError handles session recovery', async () => {
146
+ const hook = createRecoveryHook();
147
+ const error = { message: 'tool_use requires tool_result' };
148
+ vi.spyOn(contextWindow, 'handleContextWindowRecovery').mockReturnValue({
149
+ attempted: false,
150
+ success: false
151
+ });
152
+ vi.spyOn(sessionRecovery, 'handleSessionRecovery').mockResolvedValue({
153
+ attempted: true,
154
+ success: true
155
+ });
156
+ const result = await hook.onError({ sessionId: 'test', error });
157
+ expect(result.attempted).toBe(true);
158
+ });
159
+ it('afterToolExecute handles edit errors', () => {
160
+ const hook = createRecoveryHook();
161
+ vi.spyOn(editError, 'handleEditErrorRecovery').mockReturnValue({
162
+ attempted: true,
163
+ success: true
164
+ });
165
+ const result = hook.afterToolExecute({
166
+ sessionId: 'test',
167
+ tool: 'Edit',
168
+ output: 'Error: old_string not found'
169
+ });
170
+ expect(result.recovery?.attempted).toBe(true);
171
+ });
172
+ it('isRecoverable detects context limit errors', () => {
173
+ const hook = createRecoveryHook();
174
+ const error = { message: 'prompt is too long: 210000 tokens' };
175
+ expect(hook.isRecoverable(error)).toBe(true);
176
+ });
177
+ it('isRecoverable detects session errors', () => {
178
+ const hook = createRecoveryHook();
179
+ const error = { message: 'tool_use requires tool_result' };
180
+ expect(hook.isRecoverable(error)).toBe(true);
181
+ });
182
+ it('isRecoverable returns false for unknown errors', () => {
183
+ const hook = createRecoveryHook();
184
+ const error = { message: 'unknown error' };
185
+ expect(hook.isRecoverable(error)).toBe(false);
186
+ });
187
+ it('getRecoveryType returns context_window_limit', () => {
188
+ const hook = createRecoveryHook();
189
+ const error = { message: 'prompt is too long: 210000 tokens' };
190
+ expect(hook.getRecoveryType(error)).toBe('context_window_limit');
191
+ });
192
+ it('getRecoveryType returns thinking_block_order', () => {
193
+ const hook = createRecoveryHook();
194
+ const error = { message: 'thinking must start with first block' };
195
+ expect(hook.getRecoveryType(error)).toBe('thinking_block_order');
196
+ });
197
+ it('getRecoveryType returns null for unknown errors', () => {
198
+ const hook = createRecoveryHook();
199
+ const error = { message: 'unknown error' };
200
+ expect(hook.getRecoveryType(error)).toBeUndefined();
201
+ });
202
+ });
203
+ describe('detectRecoverableError', () => {
204
+ it('detects context window limit error', () => {
205
+ const error = { message: 'prompt is too long: 210000 tokens' };
206
+ const result = detectRecoverableError(error);
207
+ expect(result.recoverable).toBe(true);
208
+ expect(result.type).toBe('context_window_limit');
209
+ });
210
+ it('detects session recovery error', () => {
211
+ const error = { message: 'tool_use requires tool_result' };
212
+ const result = detectRecoverableError(error);
213
+ expect(result.recoverable).toBe(true);
214
+ expect(result.type).toBe('tool_result_missing');
215
+ });
216
+ it('returns not recoverable for unknown error', () => {
217
+ const error = { message: 'unknown error' };
218
+ const result = detectRecoverableError(error);
219
+ expect(result.recoverable).toBe(false);
220
+ expect(result.type).toBeUndefined();
221
+ });
222
+ });
223
+ describe('utility functions', () => {
224
+ it('parseContextLimitError extracts token counts', () => {
225
+ const error = { message: 'prompt is too long: 210000 tokens > 200000 maximum' };
226
+ const result = parseContextLimitError(error);
227
+ expect(result).not.toBeNull();
228
+ expect(result?.currentTokens).toBe(210000);
229
+ expect(result?.maxTokens).toBe(200000);
230
+ });
231
+ it('parseContextLimitError returns null for non-context errors', () => {
232
+ const error = { message: 'unknown error' };
233
+ const result = parseContextLimitError(error);
234
+ expect(result).toBeNull();
235
+ });
236
+ it('detectContextLimitErrorInText detects context limit', () => {
237
+ const text = 'prompt is too long: 210000 tokens > 200000 maximum';
238
+ expect(detectContextLimitErrorInText(text)).toBe(true);
239
+ });
240
+ it('detectContextLimitErrorInText returns false for normal text', () => {
241
+ const text = 'normal output text';
242
+ expect(detectContextLimitErrorInText(text)).toBe(false);
243
+ });
244
+ it('detectEditErrorInText detects edit errors', () => {
245
+ const text = 'Error: old_string not found in file';
246
+ expect(detectEditErrorInText(text)).toBe(true);
247
+ });
248
+ it('detectEditErrorInText returns false for normal text', () => {
249
+ const text = 'normal output text';
250
+ expect(detectEditErrorInText(text)).toBe(false);
251
+ });
252
+ it('detectEditErrorInOutput detects edit errors', () => {
253
+ const output = 'Error: old_string not found';
254
+ expect(detectEditErrorInOutput(output)).toBe(true);
255
+ });
256
+ it('detectEditErrorInOutput returns false for success output', () => {
257
+ const output = 'File updated successfully';
258
+ expect(detectEditErrorInOutput(output)).toBe(false);
259
+ });
260
+ it('isSessionRecoverable detects session errors', () => {
261
+ const error = { message: 'tool_use requires tool_result' };
262
+ expect(isSessionRecoverable(error)).toBe(true);
263
+ });
264
+ it('isSessionRecoverable returns false for non-session errors', () => {
265
+ const error = { message: 'unknown error' };
266
+ expect(isSessionRecoverable(error)).toBe(false);
267
+ });
268
+ });
269
+ });
270
+ //# sourceMappingURL=index.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/hooks/recovery/__tests__/index.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAE9C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,UAAU,CAAC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,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACrD,MAAM,MAAM,GAAG,6BAA6B,CAAC;YAC7C,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;YAClE,MAAM,MAAM,GAAG,2BAA2B,CAAC;YAC3C,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;YACrD,MAAM,KAAK,GAAG,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC;YAC3D,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;YACnE,MAAM,KAAK,GAAG,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;YAC3C,MAAM,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=session-recovery.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-recovery.test.d.ts","sourceRoot":"","sources":["../../../../src/hooks/recovery/__tests__/session-recovery.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,129 @@
1
+ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
2
+ import { detectErrorType, isRecoverableError, handleSessionRecovery } from '../session-recovery.js';
3
+ import * as storage from '../storage.js';
4
+ describe('Session Recovery', () => {
5
+ beforeEach(() => {
6
+ vi.clearAllMocks();
7
+ });
8
+ afterEach(() => {
9
+ vi.restoreAllMocks();
10
+ });
11
+ describe('detectErrorType', () => {
12
+ it('detects tool_result_missing error', () => {
13
+ const error = { message: 'tool_use requires tool_result' };
14
+ expect(detectErrorType(error)).toBe('tool_result_missing');
15
+ });
16
+ it('detects thinking_block_order error', () => {
17
+ const error = { message: 'thinking must start with first block' };
18
+ expect(detectErrorType(error)).toBe('thinking_block_order');
19
+ });
20
+ it('detects thinking_disabled_violation error', () => {
21
+ const error = { message: 'thinking is disabled and cannot contain blocks' };
22
+ expect(detectErrorType(error)).toBe('thinking_disabled_violation');
23
+ });
24
+ it('detects empty_content error', () => {
25
+ const error = { message: 'empty content in message' };
26
+ expect(detectErrorType(error)).toBe('empty_content');
27
+ });
28
+ it('returns null for non-recoverable error', () => {
29
+ const error = { message: 'unknown error type' };
30
+ expect(detectErrorType(error)).toBeNull();
31
+ });
32
+ it('handles string error', () => {
33
+ const error = 'tool_use requires tool_result';
34
+ expect(detectErrorType(error)).toBe('tool_result_missing');
35
+ });
36
+ it('handles nested error object', () => {
37
+ const error = { data: { error: { message: 'thinking must start with first block' } } };
38
+ expect(detectErrorType(error)).toBe('thinking_block_order');
39
+ });
40
+ });
41
+ describe('isRecoverableError', () => {
42
+ it('returns true for recoverable error', () => {
43
+ const error = { message: 'tool_use requires tool_result' };
44
+ expect(isRecoverableError(error)).toBe(true);
45
+ });
46
+ it('returns false for non-recoverable error', () => {
47
+ const error = { message: 'unknown error' };
48
+ expect(isRecoverableError(error)).toBe(false);
49
+ });
50
+ });
51
+ describe('handleSessionRecovery', () => {
52
+ it('returns not attempted for non-recoverable error', async () => {
53
+ const result = await handleSessionRecovery('session-1', { message: 'unknown' });
54
+ expect(result.attempted).toBe(false);
55
+ expect(result.success).toBe(false);
56
+ });
57
+ it('handles tool_result_missing error', async () => {
58
+ const error = { message: 'tool_use requires tool_result' };
59
+ const result = await handleSessionRecovery('session-1', error);
60
+ expect(result.attempted).toBe(true);
61
+ expect(result.errorType).toBe('tool_result_missing');
62
+ });
63
+ it('handles thinking_block_order error with orphan messages', async () => {
64
+ vi.spyOn(storage, 'findMessagesWithOrphanThinking').mockReturnValue(['msg_001']);
65
+ vi.spyOn(storage, 'prependThinkingPart').mockReturnValue(true);
66
+ const error = { message: 'thinking must start with first block' };
67
+ const result = await handleSessionRecovery('session-1', error);
68
+ expect(result.attempted).toBe(true);
69
+ expect(result.errorType).toBe('thinking_block_order');
70
+ expect(result.success).toBe(true);
71
+ });
72
+ it('handles thinking_block_order error with message index', async () => {
73
+ vi.spyOn(storage, 'findMessageByIndexNeedingThinking').mockReturnValue('msg_002');
74
+ vi.spyOn(storage, 'prependThinkingPart').mockReturnValue(true);
75
+ const error = { message: 'thinking must start with first block at messages.5' };
76
+ const result = await handleSessionRecovery('session-1', error);
77
+ expect(result.attempted).toBe(true);
78
+ expect(result.success).toBe(true);
79
+ });
80
+ it('handles thinking_disabled_violation error with thinking blocks', async () => {
81
+ vi.spyOn(storage, 'findMessagesWithThinkingBlocks').mockReturnValue(['msg_003']);
82
+ vi.spyOn(storage, 'stripThinkingParts').mockReturnValue(true);
83
+ const error = { message: 'thinking is disabled and cannot contain' };
84
+ const result = await handleSessionRecovery('session-1', error);
85
+ expect(result.attempted).toBe(true);
86
+ expect(result.success).toBe(true);
87
+ });
88
+ it('handles empty_content error with empty text parts', async () => {
89
+ vi.spyOn(storage, 'findMessagesWithEmptyTextParts').mockReturnValue(['msg_004']);
90
+ vi.spyOn(storage, 'replaceEmptyTextParts').mockReturnValue(true);
91
+ vi.spyOn(storage, 'findMessagesWithThinkingOnly').mockReturnValue([]);
92
+ vi.spyOn(storage, 'findEmptyMessages').mockReturnValue([]);
93
+ const error = { message: 'empty content in message' };
94
+ const result = await handleSessionRecovery('session-1', error);
95
+ expect(result.attempted).toBe(true);
96
+ expect(result.success).toBe(true);
97
+ });
98
+ it('handles empty_content error with thinking-only messages', async () => {
99
+ vi.spyOn(storage, 'findMessagesWithEmptyTextParts').mockReturnValue([]);
100
+ vi.spyOn(storage, 'findMessagesWithThinkingOnly').mockReturnValue(['msg_005']);
101
+ vi.spyOn(storage, 'injectTextPart').mockReturnValue(true);
102
+ vi.spyOn(storage, 'findEmptyMessages').mockReturnValue([]);
103
+ const error = { message: 'empty content in message' };
104
+ const result = await handleSessionRecovery('session-1', error);
105
+ expect(result.attempted).toBe(true);
106
+ expect(result.success).toBe(true);
107
+ });
108
+ it('handles empty_content error with empty messages', async () => {
109
+ vi.spyOn(storage, 'findMessagesWithEmptyTextParts').mockReturnValue([]);
110
+ vi.spyOn(storage, 'findMessagesWithThinkingOnly').mockReturnValue([]);
111
+ vi.spyOn(storage, 'findEmptyMessages').mockReturnValue(['msg_006']);
112
+ vi.spyOn(storage, 'injectTextPart').mockReturnValue(true);
113
+ const error = { message: 'empty content in message' };
114
+ const result = await handleSessionRecovery('session-1', error);
115
+ expect(result.attempted).toBe(true);
116
+ expect(result.success).toBe(true);
117
+ });
118
+ it('handles recovery failure with exception', async () => {
119
+ vi.spyOn(storage, 'findMessagesWithOrphanThinking').mockImplementation(() => {
120
+ throw new Error('Storage error');
121
+ });
122
+ const error = { message: 'thinking must start with first block' };
123
+ const result = await handleSessionRecovery('session-1', error);
124
+ expect(result.attempted).toBe(true);
125
+ expect(result.success).toBe(false);
126
+ });
127
+ });
128
+ });
129
+ //# sourceMappingURL=session-recovery.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-recovery.test.js","sourceRoot":"","sources":["../../../../src/hooks/recovery/__tests__/session-recovery.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,KAAK,OAAO,MAAM,eAA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AAE,sCAAsC,EAAE,CAAC;YAClE,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;YAC/D,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=storage.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage.test.d.ts","sourceRoot":"","sources":["../../../../src/hooks/recovery/__tests__/storage.test.ts"],"names":[],"mappings":""}