@liangjie559567/ultrapower 5.5.2 → 5.5.3

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 (1993) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +15 -11
  3. package/README.md +104 -8
  4. package/agents/analyst.md +24 -0
  5. package/bridge/codex-server.cjs +886 -88
  6. package/bridge/gemini-server.cjs +892 -89
  7. package/bridge/mcp-server.cjs +1351 -238
  8. package/bridge/team-bridge.cjs +737 -99
  9. package/commands/brainstorm.md +1 -1
  10. package/commands/execute-plan.md +1 -1
  11. package/commands/wizard.md +5 -0
  12. package/commands/write-plan.md +1 -1
  13. package/dist/__tests__/job-management.test.js +43 -43
  14. package/dist/__tests__/job-management.test.js.map +1 -1
  15. package/dist/__tests__/validateMode.test.js +1 -1
  16. package/dist/__tests__/validateMode.test.js.map +1 -1
  17. package/dist/agents/__tests__/agent-wrapper.test.d.ts +2 -0
  18. package/dist/agents/__tests__/agent-wrapper.test.d.ts.map +1 -0
  19. package/dist/agents/__tests__/agent-wrapper.test.js +37 -0
  20. package/dist/agents/__tests__/agent-wrapper.test.js.map +1 -0
  21. package/dist/agents/__tests__/timeout-config.test.d.ts +2 -0
  22. package/dist/agents/__tests__/timeout-config.test.d.ts.map +1 -0
  23. package/dist/agents/__tests__/timeout-config.test.js +35 -0
  24. package/dist/agents/__tests__/timeout-config.test.js.map +1 -0
  25. package/dist/agents/__tests__/timeout-manager.test.d.ts +2 -0
  26. package/dist/agents/__tests__/timeout-manager.test.d.ts.map +1 -0
  27. package/dist/agents/__tests__/timeout-manager.test.js +37 -0
  28. package/dist/agents/__tests__/timeout-manager.test.js.map +1 -0
  29. package/dist/agents/agent-wrapper.d.ts +22 -0
  30. package/dist/agents/agent-wrapper.d.ts.map +1 -0
  31. package/dist/agents/agent-wrapper.js +54 -0
  32. package/dist/agents/agent-wrapper.js.map +1 -0
  33. package/dist/agents/definitions.d.ts +1 -1
  34. package/dist/agents/definitions.js +1 -1
  35. package/dist/agents/index.d.ts +3 -0
  36. package/dist/agents/index.d.ts.map +1 -1
  37. package/dist/agents/index.js +4 -0
  38. package/dist/agents/index.js.map +1 -1
  39. package/dist/agents/timeout-config.d.ts +19 -0
  40. package/dist/agents/timeout-config.d.ts.map +1 -0
  41. package/dist/agents/timeout-config.js +57 -0
  42. package/dist/agents/timeout-config.js.map +1 -0
  43. package/dist/agents/timeout-manager.d.ts +31 -0
  44. package/dist/agents/timeout-manager.d.ts.map +1 -0
  45. package/dist/agents/timeout-manager.js +53 -0
  46. package/dist/agents/timeout-manager.js.map +1 -0
  47. package/dist/analytics/analytics-summary.d.ts.map +1 -1
  48. package/dist/analytics/analytics-summary.js +7 -1
  49. package/dist/analytics/analytics-summary.js.map +1 -1
  50. package/dist/analytics/metrics-collector.d.ts.map +1 -1
  51. package/dist/analytics/metrics-collector.js +9 -1
  52. package/dist/analytics/metrics-collector.js.map +1 -1
  53. package/dist/analytics/query-engine.d.ts.map +1 -1
  54. package/dist/analytics/query-engine.js +21 -3
  55. package/dist/analytics/query-engine.js.map +1 -1
  56. package/dist/analytics/token-tracker.js +3 -3
  57. package/dist/analytics/token-tracker.js.map +1 -1
  58. package/dist/analytics/transcript-scanner.d.ts.map +1 -1
  59. package/dist/analytics/transcript-scanner.js +20 -13
  60. package/dist/analytics/transcript-scanner.js.map +1 -1
  61. package/dist/audit/logger.d.ts +28 -0
  62. package/dist/audit/logger.d.ts.map +1 -0
  63. package/dist/audit/logger.js +86 -0
  64. package/dist/audit/logger.js.map +1 -0
  65. package/dist/audit/verify-cli.d.ts +2 -0
  66. package/dist/audit/verify-cli.d.ts.map +1 -0
  67. package/dist/audit/verify-cli.js +10 -0
  68. package/dist/audit/verify-cli.js.map +1 -0
  69. package/dist/cli/commands/perf.d.ts +3 -0
  70. package/dist/cli/commands/perf.d.ts.map +1 -0
  71. package/dist/cli/commands/perf.js +25 -0
  72. package/dist/cli/commands/perf.js.map +1 -0
  73. package/dist/cli/commands/plugin.d.ts +6 -0
  74. package/dist/cli/commands/plugin.d.ts.map +1 -0
  75. package/dist/cli/commands/plugin.js +100 -0
  76. package/dist/cli/commands/plugin.js.map +1 -0
  77. package/dist/cli/commands/teleport.js +5 -5
  78. package/dist/cli/commands/teleport.js.map +1 -1
  79. package/dist/cli/index.js +6 -0
  80. package/dist/cli/index.js.map +1 -1
  81. package/dist/compatibility/mcp-bridge.d.ts.map +1 -1
  82. package/dist/compatibility/mcp-bridge.js +4 -3
  83. package/dist/compatibility/mcp-bridge.js.map +1 -1
  84. package/dist/config/loader.d.ts.map +1 -1
  85. package/dist/config/loader.js +40 -6
  86. package/dist/config/loader.js.map +1 -1
  87. package/dist/core/hud-config.d.ts +19 -0
  88. package/dist/core/hud-config.d.ts.map +1 -0
  89. package/dist/core/hud-config.js +6 -0
  90. package/dist/core/hud-config.js.map +1 -0
  91. package/dist/core/job-types.d.ts +22 -0
  92. package/dist/core/job-types.d.ts.map +1 -0
  93. package/dist/core/job-types.js +6 -0
  94. package/dist/core/job-types.js.map +1 -0
  95. package/dist/features/diagnostics/error-matcher.d.ts +12 -0
  96. package/dist/features/diagnostics/error-matcher.d.ts.map +1 -0
  97. package/dist/features/diagnostics/error-matcher.js +41 -0
  98. package/dist/features/diagnostics/error-matcher.js.map +1 -0
  99. package/dist/features/diagnostics/index.d.ts +3 -0
  100. package/dist/features/diagnostics/index.d.ts.map +1 -0
  101. package/dist/features/diagnostics/index.js +3 -0
  102. package/dist/features/diagnostics/index.js.map +1 -0
  103. package/dist/features/diagnostics/solution-suggester.d.ts +12 -0
  104. package/dist/features/diagnostics/solution-suggester.d.ts.map +1 -0
  105. package/dist/features/diagnostics/solution-suggester.js +46 -0
  106. package/dist/features/diagnostics/solution-suggester.js.map +1 -0
  107. package/dist/features/diagnostics/types.d.ts +25 -0
  108. package/dist/features/diagnostics/types.d.ts.map +1 -0
  109. package/dist/features/diagnostics/types.js +5 -0
  110. package/dist/features/diagnostics/types.js.map +1 -0
  111. package/dist/features/rate-limit-wait/daemon.js +1 -1
  112. package/dist/features/rate-limit-wait/daemon.js.map +1 -1
  113. package/dist/features/reflection/data-collector.d.ts +12 -0
  114. package/dist/features/reflection/data-collector.d.ts.map +1 -0
  115. package/dist/features/reflection/data-collector.js +38 -0
  116. package/dist/features/reflection/data-collector.js.map +1 -0
  117. package/dist/features/reflection/index.d.ts +4 -0
  118. package/dist/features/reflection/index.d.ts.map +1 -0
  119. package/dist/features/reflection/index.js +3 -0
  120. package/dist/features/reflection/index.js.map +1 -0
  121. package/dist/features/reflection/report-generator.d.ts +3 -0
  122. package/dist/features/reflection/report-generator.d.ts.map +1 -0
  123. package/dist/features/reflection/report-generator.js +42 -0
  124. package/dist/features/reflection/report-generator.js.map +1 -0
  125. package/dist/features/state-manager/__tests__/cache.test.js +17 -17
  126. package/dist/features/state-manager/__tests__/cache.test.js.map +1 -1
  127. package/dist/features/state-manager/__tests__/encryption-performance.test.d.ts +2 -0
  128. package/dist/features/state-manager/__tests__/encryption-performance.test.d.ts.map +1 -0
  129. package/dist/features/state-manager/__tests__/encryption-performance.test.js +42 -0
  130. package/dist/features/state-manager/__tests__/encryption-performance.test.js.map +1 -0
  131. package/dist/features/state-manager/__tests__/encryption.test.d.ts +2 -0
  132. package/dist/features/state-manager/__tests__/encryption.test.d.ts.map +1 -0
  133. package/dist/features/state-manager/__tests__/encryption.test.js +68 -0
  134. package/dist/features/state-manager/__tests__/encryption.test.js.map +1 -0
  135. package/dist/features/state-manager/encryption.d.ts +24 -0
  136. package/dist/features/state-manager/encryption.d.ts.map +1 -0
  137. package/dist/features/state-manager/encryption.js +86 -0
  138. package/dist/features/state-manager/encryption.js.map +1 -0
  139. package/dist/features/state-manager/index.d.ts +4 -0
  140. package/dist/features/state-manager/index.d.ts.map +1 -1
  141. package/dist/features/state-manager/index.js +95 -7
  142. package/dist/features/state-manager/index.js.map +1 -1
  143. package/dist/features/state-manager/tiered-writer.d.ts +44 -0
  144. package/dist/features/state-manager/tiered-writer.d.ts.map +1 -0
  145. package/dist/features/state-manager/tiered-writer.js +76 -0
  146. package/dist/features/state-manager/tiered-writer.js.map +1 -0
  147. package/dist/features/state-manager/wal.d.ts +21 -0
  148. package/dist/features/state-manager/wal.d.ts.map +1 -0
  149. package/dist/features/state-manager/wal.js +75 -0
  150. package/dist/features/state-manager/wal.js.map +1 -0
  151. package/dist/features/task-templates/index.d.ts +13 -0
  152. package/dist/features/task-templates/index.d.ts.map +1 -0
  153. package/dist/features/task-templates/index.js +31 -0
  154. package/dist/features/task-templates/index.js.map +1 -0
  155. package/dist/features/task-templates/wizard-integration.d.ts +15 -0
  156. package/dist/features/task-templates/wizard-integration.d.ts.map +1 -0
  157. package/dist/features/task-templates/wizard-integration.js +27 -0
  158. package/dist/features/task-templates/wizard-integration.js.map +1 -0
  159. package/dist/features/wizard/__tests__/engine.test.d.ts +2 -0
  160. package/dist/features/wizard/__tests__/engine.test.d.ts.map +1 -0
  161. package/dist/features/wizard/__tests__/engine.test.js +78 -0
  162. package/dist/features/wizard/__tests__/engine.test.js.map +1 -0
  163. package/dist/features/wizard/__tests__/recommendation-engine.test.d.ts +2 -0
  164. package/dist/features/wizard/__tests__/recommendation-engine.test.d.ts.map +1 -0
  165. package/dist/features/wizard/__tests__/recommendation-engine.test.js +43 -0
  166. package/dist/features/wizard/__tests__/recommendation-engine.test.js.map +1 -0
  167. package/dist/features/wizard/engine.d.ts +15 -0
  168. package/dist/features/wizard/engine.d.ts.map +1 -0
  169. package/dist/features/wizard/engine.js +74 -0
  170. package/dist/features/wizard/engine.js.map +1 -0
  171. package/dist/features/wizard/index.d.ts +8 -0
  172. package/dist/features/wizard/index.d.ts.map +1 -0
  173. package/dist/features/wizard/index.js +7 -0
  174. package/dist/features/wizard/index.js.map +1 -0
  175. package/dist/features/wizard/questions.d.ts +6 -0
  176. package/dist/features/wizard/questions.d.ts.map +1 -0
  177. package/dist/features/wizard/questions.js +64 -0
  178. package/dist/features/wizard/questions.js.map +1 -0
  179. package/dist/features/wizard/recommendation-engine.d.ts +6 -0
  180. package/dist/features/wizard/recommendation-engine.d.ts.map +1 -0
  181. package/dist/features/wizard/recommendation-engine.js +33 -0
  182. package/dist/features/wizard/recommendation-engine.js.map +1 -0
  183. package/dist/features/wizard/types.d.ts +23 -0
  184. package/dist/features/wizard/types.d.ts.map +1 -0
  185. package/dist/features/wizard/types.js +5 -0
  186. package/dist/features/wizard/types.js.map +1 -0
  187. package/dist/features/workflow-recommender/context-analyzer.d.ts +6 -0
  188. package/dist/features/workflow-recommender/context-analyzer.d.ts.map +1 -0
  189. package/dist/features/workflow-recommender/context-analyzer.js +20 -0
  190. package/dist/features/workflow-recommender/context-analyzer.js.map +1 -0
  191. package/dist/features/workflow-recommender/index.d.ts +12 -0
  192. package/dist/features/workflow-recommender/index.d.ts.map +1 -0
  193. package/dist/features/workflow-recommender/index.js +9 -0
  194. package/dist/features/workflow-recommender/index.js.map +1 -0
  195. package/dist/features/workflow-recommender/intent-classifier.d.ts +6 -0
  196. package/dist/features/workflow-recommender/intent-classifier.d.ts.map +1 -0
  197. package/dist/features/workflow-recommender/intent-classifier.js +24 -0
  198. package/dist/features/workflow-recommender/intent-classifier.js.map +1 -0
  199. package/dist/features/workflow-recommender/recommendation-engine.d.ts +6 -0
  200. package/dist/features/workflow-recommender/recommendation-engine.d.ts.map +1 -0
  201. package/dist/features/workflow-recommender/recommendation-engine.js +110 -0
  202. package/dist/features/workflow-recommender/recommendation-engine.js.map +1 -0
  203. package/dist/features/workflow-recommender/recommender.d.ts +14 -0
  204. package/dist/features/workflow-recommender/recommender.d.ts.map +1 -0
  205. package/dist/features/workflow-recommender/recommender.js +32 -0
  206. package/dist/features/workflow-recommender/recommender.js.map +1 -0
  207. package/dist/features/workflow-recommender/router-integration.d.ts +9 -0
  208. package/dist/features/workflow-recommender/router-integration.d.ts.map +1 -0
  209. package/dist/features/workflow-recommender/router-integration.js +25 -0
  210. package/dist/features/workflow-recommender/router-integration.js.map +1 -0
  211. package/dist/features/workflow-recommender/types.d.ts +20 -0
  212. package/dist/features/workflow-recommender/types.d.ts.map +1 -0
  213. package/dist/features/workflow-recommender/types.js +5 -0
  214. package/dist/features/workflow-recommender/types.js.map +1 -0
  215. package/dist/hooks/__tests__/bridge-normalize.test.d.ts +2 -0
  216. package/dist/hooks/__tests__/bridge-normalize.test.d.ts.map +1 -0
  217. package/dist/hooks/__tests__/bridge-normalize.test.js +90 -0
  218. package/dist/hooks/__tests__/bridge-normalize.test.js.map +1 -0
  219. package/dist/hooks/__tests__/bridge-security.test.js +23 -41
  220. package/dist/hooks/__tests__/bridge-security.test.js.map +1 -1
  221. package/dist/hooks/auto-slash-command/__tests__/detector.test.d.ts +2 -0
  222. package/dist/hooks/auto-slash-command/__tests__/detector.test.d.ts.map +1 -0
  223. package/dist/hooks/auto-slash-command/__tests__/detector.test.js +70 -0
  224. package/dist/hooks/auto-slash-command/__tests__/detector.test.js.map +1 -0
  225. package/dist/hooks/auto-slash-command/__tests__/executor.test.d.ts +2 -0
  226. package/dist/hooks/auto-slash-command/__tests__/executor.test.d.ts.map +1 -0
  227. package/dist/hooks/auto-slash-command/__tests__/executor.test.js +55 -0
  228. package/dist/hooks/auto-slash-command/__tests__/executor.test.js.map +1 -0
  229. package/dist/hooks/auto-slash-command/__tests__/index.test.d.ts +2 -0
  230. package/dist/hooks/auto-slash-command/__tests__/index.test.d.ts.map +1 -0
  231. package/dist/hooks/auto-slash-command/__tests__/index.test.js +50 -0
  232. package/dist/hooks/auto-slash-command/__tests__/index.test.js.map +1 -0
  233. package/dist/hooks/auto-slash-command/live-data.js +2 -2
  234. package/dist/hooks/auto-slash-command/live-data.js.map +1 -1
  235. package/dist/hooks/autopilot/__tests__/prompts.test.js +19 -1
  236. package/dist/hooks/autopilot/__tests__/prompts.test.js.map +1 -1
  237. package/dist/hooks/autopilot/enforcement.d.ts +1 -1
  238. package/dist/hooks/autopilot/enforcement.d.ts.map +1 -1
  239. package/dist/hooks/autopilot/enforcement.js +1 -1
  240. package/dist/hooks/autopilot/enforcement.js.map +1 -1
  241. package/dist/hooks/axiom-boot/index.d.ts +1 -0
  242. package/dist/hooks/axiom-boot/index.d.ts.map +1 -1
  243. package/dist/hooks/axiom-boot/index.js +13 -0
  244. package/dist/hooks/axiom-boot/index.js.map +1 -1
  245. package/dist/hooks/bridge-normalize.d.ts +43 -3
  246. package/dist/hooks/bridge-normalize.d.ts.map +1 -1
  247. package/dist/hooks/bridge-normalize.js +183 -61
  248. package/dist/hooks/bridge-normalize.js.map +1 -1
  249. package/dist/hooks/bridge-types.d.ts +62 -0
  250. package/dist/hooks/bridge-types.d.ts.map +1 -0
  251. package/dist/hooks/bridge-types.js +6 -0
  252. package/dist/hooks/bridge-types.js.map +1 -0
  253. package/dist/hooks/bridge.d.ts +1 -43
  254. package/dist/hooks/bridge.d.ts.map +1 -1
  255. package/dist/hooks/bridge.js +132 -32
  256. package/dist/hooks/bridge.js.map +1 -1
  257. package/dist/hooks/dependency-analyzer.d.ts +32 -0
  258. package/dist/hooks/dependency-analyzer.d.ts.map +1 -0
  259. package/dist/hooks/dependency-analyzer.js +199 -0
  260. package/dist/hooks/dependency-analyzer.js.map +1 -0
  261. package/dist/hooks/guards/pre-tool.d.ts.map +1 -1
  262. package/dist/hooks/guards/pre-tool.js +8 -2
  263. package/dist/hooks/guards/pre-tool.js.map +1 -1
  264. package/dist/hooks/index.d.ts +2 -1
  265. package/dist/hooks/index.d.ts.map +1 -1
  266. package/dist/hooks/index.js.map +1 -1
  267. package/dist/hooks/learner/__tests__/confidence.test.d.ts +2 -0
  268. package/dist/hooks/learner/__tests__/confidence.test.d.ts.map +1 -0
  269. package/dist/hooks/learner/__tests__/confidence.test.js +42 -0
  270. package/dist/hooks/learner/__tests__/confidence.test.js.map +1 -0
  271. package/dist/hooks/learner/__tests__/detector.test.d.ts +2 -0
  272. package/dist/hooks/learner/__tests__/detector.test.d.ts.map +1 -0
  273. package/dist/hooks/learner/__tests__/detector.test.js +170 -0
  274. package/dist/hooks/learner/__tests__/detector.test.js.map +1 -0
  275. package/dist/hooks/learner/__tests__/index-manager-filter.test.d.ts +14 -0
  276. package/dist/hooks/learner/__tests__/index-manager-filter.test.d.ts.map +1 -0
  277. package/dist/hooks/learner/__tests__/index-manager-filter.test.js +147 -0
  278. package/dist/hooks/learner/__tests__/index-manager-filter.test.js.map +1 -0
  279. package/dist/hooks/learner/__tests__/index-manager-import.test.d.ts +2 -0
  280. package/dist/hooks/learner/__tests__/index-manager-import.test.d.ts.map +1 -0
  281. package/dist/hooks/learner/__tests__/index-manager-import.test.js +43 -0
  282. package/dist/hooks/learner/__tests__/index-manager-import.test.js.map +1 -0
  283. package/dist/hooks/learner/__tests__/index.test.d.ts +2 -0
  284. package/dist/hooks/learner/__tests__/index.test.d.ts.map +1 -0
  285. package/dist/hooks/learner/__tests__/index.test.js +48 -0
  286. package/dist/hooks/learner/__tests__/index.test.js.map +1 -0
  287. package/dist/hooks/learner/__tests__/learning-queue-parser.test.d.ts +10 -0
  288. package/dist/hooks/learner/__tests__/learning-queue-parser.test.d.ts.map +1 -0
  289. package/dist/hooks/learner/__tests__/learning-queue-parser.test.js +131 -0
  290. package/dist/hooks/learner/__tests__/learning-queue-parser.test.js.map +1 -0
  291. package/dist/hooks/learner/__tests__/matcher.test.d.ts +2 -0
  292. package/dist/hooks/learner/__tests__/matcher.test.d.ts.map +1 -0
  293. package/dist/hooks/learner/__tests__/matcher.test.js +114 -0
  294. package/dist/hooks/learner/__tests__/matcher.test.js.map +1 -0
  295. package/dist/hooks/learner/__tests__/promotion.test.d.ts +2 -0
  296. package/dist/hooks/learner/__tests__/promotion.test.d.ts.map +1 -0
  297. package/dist/hooks/learner/__tests__/promotion.test.js +146 -0
  298. package/dist/hooks/learner/__tests__/promotion.test.js.map +1 -0
  299. package/dist/hooks/learner/__tests__/queue-archiver.test.d.ts +13 -0
  300. package/dist/hooks/learner/__tests__/queue-archiver.test.d.ts.map +1 -0
  301. package/dist/hooks/learner/__tests__/queue-archiver.test.js +162 -0
  302. package/dist/hooks/learner/__tests__/queue-archiver.test.js.map +1 -0
  303. package/dist/hooks/learner/__tests__/reflection-archiver.test.d.ts +14 -0
  304. package/dist/hooks/learner/__tests__/reflection-archiver.test.d.ts.map +1 -0
  305. package/dist/hooks/learner/__tests__/reflection-archiver.test.js +159 -0
  306. package/dist/hooks/learner/__tests__/reflection-archiver.test.js.map +1 -0
  307. package/dist/hooks/learner/__tests__/reflection-parser.test.d.ts +14 -0
  308. package/dist/hooks/learner/__tests__/reflection-parser.test.d.ts.map +1 -0
  309. package/dist/hooks/learner/__tests__/reflection-parser.test.js +201 -0
  310. package/dist/hooks/learner/__tests__/reflection-parser.test.js.map +1 -0
  311. package/dist/hooks/learner/__tests__/validator.test.d.ts +2 -0
  312. package/dist/hooks/learner/__tests__/validator.test.d.ts.map +1 -0
  313. package/dist/hooks/learner/__tests__/validator.test.js +123 -0
  314. package/dist/hooks/learner/__tests__/validator.test.js.map +1 -0
  315. package/dist/hooks/learner/__tests__/writer.test.d.ts +2 -0
  316. package/dist/hooks/learner/__tests__/writer.test.d.ts.map +1 -0
  317. package/dist/hooks/learner/__tests__/writer.test.js +141 -0
  318. package/dist/hooks/learner/__tests__/writer.test.js.map +1 -0
  319. package/dist/hooks/learner/confidence.d.ts +10 -0
  320. package/dist/hooks/learner/confidence.d.ts.map +1 -1
  321. package/dist/hooks/learner/confidence.js +17 -0
  322. package/dist/hooks/learner/confidence.js.map +1 -1
  323. package/dist/hooks/learner/detection-hook.js +2 -2
  324. package/dist/hooks/learner/detection-hook.js.map +1 -1
  325. package/dist/hooks/learner/index-manager.d.ts +29 -0
  326. package/dist/hooks/learner/index-manager.d.ts.map +1 -1
  327. package/dist/hooks/learner/index-manager.js +56 -0
  328. package/dist/hooks/learner/index-manager.js.map +1 -1
  329. package/dist/hooks/learner/learning-queue.d.ts +1 -0
  330. package/dist/hooks/learner/learning-queue.d.ts.map +1 -1
  331. package/dist/hooks/learner/learning-queue.js +82 -0
  332. package/dist/hooks/learner/learning-queue.js.map +1 -1
  333. package/dist/hooks/learner/orchestrator.d.ts +12 -1
  334. package/dist/hooks/learner/orchestrator.d.ts.map +1 -1
  335. package/dist/hooks/learner/orchestrator.js +19 -2
  336. package/dist/hooks/learner/orchestrator.js.map +1 -1
  337. package/dist/hooks/learner/promotion.d.ts +10 -0
  338. package/dist/hooks/learner/promotion.d.ts.map +1 -1
  339. package/dist/hooks/learner/promotion.js +33 -0
  340. package/dist/hooks/learner/promotion.js.map +1 -1
  341. package/dist/hooks/learner/queue-archiver.d.ts +21 -0
  342. package/dist/hooks/learner/queue-archiver.d.ts.map +1 -0
  343. package/dist/hooks/learner/queue-archiver.js +147 -0
  344. package/dist/hooks/learner/queue-archiver.js.map +1 -0
  345. package/dist/hooks/learner/reflection-archiver.d.ts +19 -0
  346. package/dist/hooks/learner/reflection-archiver.d.ts.map +1 -0
  347. package/dist/hooks/learner/reflection-archiver.js +113 -0
  348. package/dist/hooks/learner/reflection-archiver.js.map +1 -0
  349. package/dist/hooks/learner/reflection-cleanup.d.ts +22 -0
  350. package/dist/hooks/learner/reflection-cleanup.d.ts.map +1 -0
  351. package/dist/hooks/learner/reflection-cleanup.js +62 -0
  352. package/dist/hooks/learner/reflection-cleanup.js.map +1 -0
  353. package/dist/hooks/learner/reflection-parser.d.ts +26 -0
  354. package/dist/hooks/learner/reflection-parser.d.ts.map +1 -0
  355. package/dist/hooks/learner/reflection-parser.js +139 -0
  356. package/dist/hooks/learner/reflection-parser.js.map +1 -0
  357. package/dist/hooks/learner/reflection.d.ts +8 -1
  358. package/dist/hooks/learner/reflection.d.ts.map +1 -1
  359. package/dist/hooks/learner/reflection.js +19 -2
  360. package/dist/hooks/learner/reflection.js.map +1 -1
  361. package/dist/hooks/learner/types.d.ts +23 -0
  362. package/dist/hooks/learner/types.d.ts.map +1 -1
  363. package/dist/hooks/nexus/config.d.ts.map +1 -1
  364. package/dist/hooks/nexus/config.js +4 -3
  365. package/dist/hooks/nexus/config.js.map +1 -1
  366. package/dist/hooks/nexus/improvement-puller.d.ts.map +1 -1
  367. package/dist/hooks/nexus/improvement-puller.js +4 -2
  368. package/dist/hooks/nexus/improvement-puller.js.map +1 -1
  369. package/dist/hooks/nexus/session-end-hook.d.ts.map +1 -1
  370. package/dist/hooks/nexus/session-end-hook.js +8 -3
  371. package/dist/hooks/nexus/session-end-hook.js.map +1 -1
  372. package/dist/hooks/observability/__tests__/observability.test.d.ts +2 -0
  373. package/dist/hooks/observability/__tests__/observability.test.d.ts.map +1 -0
  374. package/dist/hooks/observability/__tests__/observability.test.js +176 -0
  375. package/dist/hooks/observability/__tests__/observability.test.js.map +1 -0
  376. package/dist/hooks/observability/agent-tracker.d.ts +18 -0
  377. package/dist/hooks/observability/agent-tracker.d.ts.map +1 -0
  378. package/dist/hooks/observability/agent-tracker.js +26 -0
  379. package/dist/hooks/observability/agent-tracker.js.map +1 -0
  380. package/dist/hooks/observability/cost-estimator.d.ts +18 -0
  381. package/dist/hooks/observability/cost-estimator.d.ts.map +1 -0
  382. package/dist/hooks/observability/cost-estimator.js +46 -0
  383. package/dist/hooks/observability/cost-estimator.js.map +1 -0
  384. package/dist/hooks/observability/db.d.ts +5 -0
  385. package/dist/hooks/observability/db.d.ts.map +1 -0
  386. package/dist/hooks/observability/db.js +63 -0
  387. package/dist/hooks/observability/db.js.map +1 -0
  388. package/dist/hooks/observability/query-engine.d.ts +36 -0
  389. package/dist/hooks/observability/query-engine.d.ts.map +1 -0
  390. package/dist/hooks/observability/query-engine.js +78 -0
  391. package/dist/hooks/observability/query-engine.js.map +1 -0
  392. package/dist/hooks/observability/tool-tracker.d.ts +11 -0
  393. package/dist/hooks/observability/tool-tracker.d.ts.map +1 -0
  394. package/dist/hooks/observability/tool-tracker.js +24 -0
  395. package/dist/hooks/observability/tool-tracker.js.map +1 -0
  396. package/dist/hooks/observability/write-queue.d.ts +13 -0
  397. package/dist/hooks/observability/write-queue.d.ts.map +1 -0
  398. package/dist/hooks/observability/write-queue.js +48 -0
  399. package/dist/hooks/observability/write-queue.js.map +1 -0
  400. package/dist/hooks/omc-orchestrator/index.d.ts.map +1 -1
  401. package/dist/hooks/omc-orchestrator/index.js +2 -11
  402. package/dist/hooks/omc-orchestrator/index.js.map +1 -1
  403. package/dist/hooks/parallel-executor.d.ts +24 -0
  404. package/dist/hooks/parallel-executor.d.ts.map +1 -0
  405. package/dist/hooks/parallel-executor.js +82 -0
  406. package/dist/hooks/parallel-executor.js.map +1 -0
  407. package/dist/hooks/permission-handler/index.d.ts +1 -0
  408. package/dist/hooks/permission-handler/index.d.ts.map +1 -1
  409. package/dist/hooks/permission-handler/index.js +60 -5
  410. package/dist/hooks/permission-handler/index.js.map +1 -1
  411. package/dist/hooks/persistent-mode/index.d.ts +2 -21
  412. package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
  413. package/dist/hooks/persistent-mode/index.js +4 -85
  414. package/dist/hooks/persistent-mode/index.js.map +1 -1
  415. package/dist/hooks/persistent-mode/tool-error.d.ts +15 -0
  416. package/dist/hooks/persistent-mode/tool-error.d.ts.map +1 -0
  417. package/dist/hooks/persistent-mode/tool-error.js +80 -0
  418. package/dist/hooks/persistent-mode/tool-error.js.map +1 -0
  419. package/dist/hooks/pre-compact/index.d.ts.map +1 -1
  420. package/dist/hooks/pre-compact/index.js +0 -1
  421. package/dist/hooks/pre-compact/index.js.map +1 -1
  422. package/dist/hooks/project-memory/learner.d.ts +13 -1
  423. package/dist/hooks/project-memory/learner.d.ts.map +1 -1
  424. package/dist/hooks/project-memory/learner.js +24 -12
  425. package/dist/hooks/project-memory/learner.js.map +1 -1
  426. package/dist/hooks/race-detector.d.ts +51 -0
  427. package/dist/hooks/race-detector.d.ts.map +1 -0
  428. package/dist/hooks/race-detector.js +121 -0
  429. package/dist/hooks/race-detector.js.map +1 -0
  430. package/dist/hooks/ralph/__tests__/loop.test.d.ts +2 -0
  431. package/dist/hooks/ralph/__tests__/loop.test.d.ts.map +1 -0
  432. package/dist/hooks/ralph/__tests__/loop.test.js +268 -0
  433. package/dist/hooks/ralph/__tests__/loop.test.js.map +1 -0
  434. package/dist/hooks/ralph/__tests__/prd.test.d.ts +2 -0
  435. package/dist/hooks/ralph/__tests__/prd.test.d.ts.map +1 -0
  436. package/dist/hooks/ralph/__tests__/prd.test.js +197 -0
  437. package/dist/hooks/ralph/__tests__/prd.test.js.map +1 -0
  438. package/dist/hooks/ralph/__tests__/progress.test.d.ts +2 -0
  439. package/dist/hooks/ralph/__tests__/progress.test.d.ts.map +1 -0
  440. package/dist/hooks/ralph/__tests__/progress.test.js +120 -0
  441. package/dist/hooks/ralph/__tests__/progress.test.js.map +1 -0
  442. package/dist/hooks/ralph/__tests__/verifier.test.d.ts +2 -0
  443. package/dist/hooks/ralph/__tests__/verifier.test.d.ts.map +1 -0
  444. package/dist/hooks/ralph/__tests__/verifier.test.js +75 -0
  445. package/dist/hooks/ralph/__tests__/verifier.test.js.map +1 -0
  446. package/dist/hooks/recovery/__tests__/context-window.test.d.ts +2 -0
  447. package/dist/hooks/recovery/__tests__/context-window.test.d.ts.map +1 -0
  448. package/dist/hooks/recovery/__tests__/context-window.test.js +131 -0
  449. package/dist/hooks/recovery/__tests__/context-window.test.js.map +1 -0
  450. package/dist/hooks/recovery/__tests__/edit-error.test.d.ts +2 -0
  451. package/dist/hooks/recovery/__tests__/edit-error.test.d.ts.map +1 -0
  452. package/dist/hooks/recovery/__tests__/edit-error.test.js +88 -0
  453. package/dist/hooks/recovery/__tests__/edit-error.test.js.map +1 -0
  454. package/dist/hooks/recovery/__tests__/index.test.d.ts +2 -0
  455. package/dist/hooks/recovery/__tests__/index.test.d.ts.map +1 -0
  456. package/dist/hooks/recovery/__tests__/index.test.js +270 -0
  457. package/dist/hooks/recovery/__tests__/index.test.js.map +1 -0
  458. package/dist/hooks/recovery/__tests__/session-recovery.test.d.ts +2 -0
  459. package/dist/hooks/recovery/__tests__/session-recovery.test.d.ts.map +1 -0
  460. package/dist/hooks/recovery/__tests__/session-recovery.test.js +129 -0
  461. package/dist/hooks/recovery/__tests__/session-recovery.test.js.map +1 -0
  462. package/dist/hooks/recovery/__tests__/storage.test.d.ts +2 -0
  463. package/dist/hooks/recovery/__tests__/storage.test.d.ts.map +1 -0
  464. package/dist/hooks/recovery/__tests__/storage.test.js +549 -0
  465. package/dist/hooks/recovery/__tests__/storage.test.js.map +1 -0
  466. package/dist/hooks/recovery/session-recovery.js +1 -1
  467. package/dist/hooks/recovery/session-recovery.js.map +1 -1
  468. package/dist/hooks/recovery/storage.js +5 -4
  469. package/dist/hooks/recovery/storage.js.map +1 -1
  470. package/dist/hooks/rules-injector/__tests__/finder.test.d.ts +2 -0
  471. package/dist/hooks/rules-injector/__tests__/finder.test.d.ts.map +1 -0
  472. package/dist/hooks/rules-injector/__tests__/finder.test.js +68 -0
  473. package/dist/hooks/rules-injector/__tests__/finder.test.js.map +1 -0
  474. package/dist/hooks/rules-injector/__tests__/index.test.d.ts +2 -0
  475. package/dist/hooks/rules-injector/__tests__/index.test.d.ts.map +1 -0
  476. package/dist/hooks/rules-injector/__tests__/index.test.js +58 -0
  477. package/dist/hooks/rules-injector/__tests__/index.test.js.map +1 -0
  478. package/dist/hooks/rules-injector/__tests__/matcher.test.d.ts +2 -0
  479. package/dist/hooks/rules-injector/__tests__/matcher.test.d.ts.map +1 -0
  480. package/dist/hooks/rules-injector/__tests__/matcher.test.js +86 -0
  481. package/dist/hooks/rules-injector/__tests__/matcher.test.js.map +1 -0
  482. package/dist/hooks/rules-injector/__tests__/parser.test.d.ts +2 -0
  483. package/dist/hooks/rules-injector/__tests__/parser.test.d.ts.map +1 -0
  484. package/dist/hooks/rules-injector/__tests__/parser.test.js +86 -0
  485. package/dist/hooks/rules-injector/__tests__/parser.test.js.map +1 -0
  486. package/dist/hooks/rules-injector/constants.d.ts +2 -0
  487. package/dist/hooks/rules-injector/constants.d.ts.map +1 -1
  488. package/dist/hooks/rules-injector/constants.js +2 -0
  489. package/dist/hooks/rules-injector/constants.js.map +1 -1
  490. package/dist/hooks/rules-injector/finder.d.ts.map +1 -1
  491. package/dist/hooks/rules-injector/finder.js +12 -4
  492. package/dist/hooks/rules-injector/finder.js.map +1 -1
  493. package/dist/hooks/rules-injector/matcher.d.ts.map +1 -1
  494. package/dist/hooks/rules-injector/matcher.js +15 -8
  495. package/dist/hooks/rules-injector/matcher.js.map +1 -1
  496. package/dist/hooks/session-end/__tests__/index.test.d.ts +2 -0
  497. package/dist/hooks/session-end/__tests__/index.test.d.ts.map +1 -0
  498. package/dist/hooks/session-end/__tests__/index.test.js +77 -0
  499. package/dist/hooks/session-end/__tests__/index.test.js.map +1 -0
  500. package/dist/hooks/session-end/callbacks.d.ts +1 -1
  501. package/dist/hooks/session-end/index.d.ts +2 -21
  502. package/dist/hooks/session-end/index.d.ts.map +1 -1
  503. package/dist/hooks/session-end/index.js.map +1 -1
  504. package/dist/hooks/session-end/types.d.ts +26 -0
  505. package/dist/hooks/session-end/types.d.ts.map +1 -0
  506. package/dist/hooks/session-end/types.js +6 -0
  507. package/dist/hooks/session-end/types.js.map +1 -0
  508. package/dist/hooks/setup/__tests__/index.test.d.ts +2 -0
  509. package/dist/hooks/setup/__tests__/index.test.d.ts.map +1 -0
  510. package/dist/hooks/setup/__tests__/index.test.js +68 -0
  511. package/dist/hooks/setup/__tests__/index.test.js.map +1 -0
  512. package/dist/hooks/skill-bridge.cjs +5 -1
  513. package/dist/hooks/team-pipeline/__tests__/state.test.d.ts +2 -0
  514. package/dist/hooks/team-pipeline/__tests__/state.test.d.ts.map +1 -0
  515. package/dist/hooks/team-pipeline/__tests__/state.test.js +94 -0
  516. package/dist/hooks/team-pipeline/__tests__/state.test.js.map +1 -0
  517. package/dist/hooks/timeout-wrapper.d.ts +32 -0
  518. package/dist/hooks/timeout-wrapper.d.ts.map +1 -0
  519. package/dist/hooks/timeout-wrapper.js +62 -0
  520. package/dist/hooks/timeout-wrapper.js.map +1 -0
  521. package/dist/hooks/todo-continuation/index.d.ts.map +1 -1
  522. package/dist/hooks/todo-continuation/index.js +11 -5
  523. package/dist/hooks/todo-continuation/index.js.map +1 -1
  524. package/dist/hooks/ultrapilot/decomposer.d.ts.map +1 -1
  525. package/dist/hooks/ultrapilot/decomposer.js +5 -6
  526. package/dist/hooks/ultrapilot/decomposer.js.map +1 -1
  527. package/dist/hooks/ultrapilot/state.d.ts.map +1 -1
  528. package/dist/hooks/ultrapilot/state.js +13 -4
  529. package/dist/hooks/ultrapilot/state.js.map +1 -1
  530. package/dist/hooks/ultraqa/index.d.ts.map +1 -1
  531. package/dist/hooks/ultraqa/index.js +11 -2
  532. package/dist/hooks/ultraqa/index.js.map +1 -1
  533. package/dist/hooks/ultrawork/index.d.ts.map +1 -1
  534. package/dist/hooks/ultrawork/index.js +20 -6
  535. package/dist/hooks/ultrawork/index.js.map +1 -1
  536. package/dist/hud/elements/autopilot.d.ts +1 -1
  537. package/dist/hud/elements/autopilot.d.ts.map +1 -1
  538. package/dist/hud/elements/git.d.ts +0 -5
  539. package/dist/hud/elements/git.d.ts.map +1 -1
  540. package/dist/hud/elements/git.js +3 -37
  541. package/dist/hud/elements/git.js.map +1 -1
  542. package/dist/hud/sanitize.d.ts.map +1 -1
  543. package/dist/hud/sanitize.js +16 -17
  544. package/dist/hud/sanitize.js.map +1 -1
  545. package/dist/hud/state.d.ts.map +1 -1
  546. package/dist/hud/state.js +69 -1
  547. package/dist/hud/state.js.map +1 -1
  548. package/dist/hud/types.d.ts +2 -15
  549. package/dist/hud/types.d.ts.map +1 -1
  550. package/dist/hud/types.js.map +1 -1
  551. package/dist/installer/__tests__/hooks.test.d.ts +6 -0
  552. package/dist/installer/__tests__/hooks.test.d.ts.map +1 -0
  553. package/dist/installer/__tests__/hooks.test.js +121 -0
  554. package/dist/installer/__tests__/hooks.test.js.map +1 -0
  555. package/dist/installer/index.d.ts.map +1 -1
  556. package/dist/installer/index.js +11 -10
  557. package/dist/installer/index.js.map +1 -1
  558. package/dist/lib/__tests__/atomic-write.test.js +3 -4
  559. package/dist/lib/__tests__/atomic-write.test.js.map +1 -1
  560. package/dist/lib/__tests__/file-lock.test.d.ts +13 -0
  561. package/dist/lib/__tests__/file-lock.test.d.ts.map +1 -0
  562. package/dist/lib/__tests__/file-lock.test.js +122 -0
  563. package/dist/lib/__tests__/file-lock.test.js.map +1 -0
  564. package/dist/lib/__tests__/plugin-deps.test.d.ts +2 -0
  565. package/dist/lib/__tests__/plugin-deps.test.d.ts.map +1 -0
  566. package/dist/lib/__tests__/plugin-deps.test.js +58 -0
  567. package/dist/lib/__tests__/plugin-deps.test.js.map +1 -0
  568. package/dist/lib/__tests__/plugin-marketplace.test.d.ts +2 -0
  569. package/dist/lib/__tests__/plugin-marketplace.test.d.ts.map +1 -0
  570. package/dist/lib/__tests__/plugin-marketplace.test.js +52 -0
  571. package/dist/lib/__tests__/plugin-marketplace.test.js.map +1 -0
  572. package/dist/lib/__tests__/plugin-rollback.test.d.ts +2 -0
  573. package/dist/lib/__tests__/plugin-rollback.test.d.ts.map +1 -0
  574. package/dist/lib/__tests__/plugin-rollback.test.js +60 -0
  575. package/dist/lib/__tests__/plugin-rollback.test.js.map +1 -0
  576. package/dist/lib/__tests__/plugin-security.test.d.ts +2 -0
  577. package/dist/lib/__tests__/plugin-security.test.d.ts.map +1 -0
  578. package/dist/lib/__tests__/plugin-security.test.js +70 -0
  579. package/dist/lib/__tests__/plugin-security.test.js.map +1 -0
  580. package/dist/lib/__tests__/validateMode.test.d.ts +2 -0
  581. package/dist/lib/__tests__/validateMode.test.d.ts.map +1 -0
  582. package/dist/lib/__tests__/validateMode.test.js +61 -0
  583. package/dist/lib/__tests__/validateMode.test.js.map +1 -0
  584. package/dist/lib/__tests__/version.test.d.ts +6 -0
  585. package/dist/lib/__tests__/version.test.d.ts.map +1 -0
  586. package/dist/lib/__tests__/version.test.js +37 -0
  587. package/dist/lib/__tests__/version.test.js.map +1 -0
  588. package/dist/lib/atomic-write.d.ts.map +1 -1
  589. package/dist/lib/atomic-write.js +6 -8
  590. package/dist/lib/atomic-write.js.map +1 -1
  591. package/dist/lib/constants.d.ts +59 -0
  592. package/dist/lib/constants.d.ts.map +1 -0
  593. package/dist/lib/constants.js +69 -0
  594. package/dist/lib/constants.js.map +1 -0
  595. package/dist/lib/env-validator.d.ts +28 -0
  596. package/dist/lib/env-validator.d.ts.map +1 -0
  597. package/dist/lib/env-validator.js +105 -0
  598. package/dist/lib/env-validator.js.map +1 -0
  599. package/dist/lib/file-cache.d.ts +16 -0
  600. package/dist/lib/file-cache.d.ts.map +1 -0
  601. package/dist/lib/file-cache.js +33 -0
  602. package/dist/lib/file-cache.js.map +1 -0
  603. package/dist/lib/file-lock.d.ts +18 -0
  604. package/dist/lib/file-lock.d.ts.map +1 -0
  605. package/dist/lib/file-lock.js +59 -0
  606. package/dist/lib/file-lock.js.map +1 -0
  607. package/dist/lib/git-utils.d.ts +55 -0
  608. package/dist/lib/git-utils.d.ts.map +1 -0
  609. package/dist/lib/git-utils.js +140 -0
  610. package/dist/lib/git-utils.js.map +1 -0
  611. package/dist/lib/memory-utils.d.ts +7 -0
  612. package/dist/lib/memory-utils.d.ts.map +1 -0
  613. package/dist/lib/memory-utils.js +21 -0
  614. package/dist/lib/memory-utils.js.map +1 -0
  615. package/dist/lib/path-validator.d.ts +25 -0
  616. package/dist/lib/path-validator.d.ts.map +1 -0
  617. package/dist/lib/path-validator.js +88 -0
  618. package/dist/lib/path-validator.js.map +1 -0
  619. package/dist/lib/plugin-deps.d.ts +26 -0
  620. package/dist/lib/plugin-deps.d.ts.map +1 -0
  621. package/dist/lib/plugin-deps.js +59 -0
  622. package/dist/lib/plugin-deps.js.map +1 -0
  623. package/dist/lib/plugin-marketplace.d.ts +12 -0
  624. package/dist/lib/plugin-marketplace.d.ts.map +1 -0
  625. package/dist/lib/plugin-marketplace.js +35 -0
  626. package/dist/lib/plugin-marketplace.js.map +1 -0
  627. package/dist/lib/plugin-rollback.d.ts +22 -0
  628. package/dist/lib/plugin-rollback.d.ts.map +1 -0
  629. package/dist/lib/plugin-rollback.js +66 -0
  630. package/dist/lib/plugin-rollback.js.map +1 -0
  631. package/dist/lib/plugin-security.d.ts +19 -0
  632. package/dist/lib/plugin-security.d.ts.map +1 -0
  633. package/dist/lib/plugin-security.js +87 -0
  634. package/dist/lib/plugin-security.js.map +1 -0
  635. package/dist/lib/safe-json.d.ts +16 -0
  636. package/dist/lib/safe-json.d.ts.map +1 -0
  637. package/dist/lib/safe-json.js +22 -0
  638. package/dist/lib/safe-json.js.map +1 -0
  639. package/dist/lib/validateMode.d.ts +3 -0
  640. package/dist/lib/validateMode.d.ts.map +1 -1
  641. package/dist/lib/validateMode.js +28 -2
  642. package/dist/lib/validateMode.js.map +1 -1
  643. package/dist/lib/worktree-paths.d.ts.map +1 -1
  644. package/dist/lib/worktree-paths.js +4 -24
  645. package/dist/lib/worktree-paths.js.map +1 -1
  646. package/dist/mcp/__tests__/cli-detection.test.d.ts +2 -0
  647. package/dist/mcp/__tests__/cli-detection.test.d.ts.map +1 -0
  648. package/dist/mcp/__tests__/cli-detection.test.js +50 -0
  649. package/dist/mcp/__tests__/cli-detection.test.js.map +1 -0
  650. package/dist/mcp/__tests__/codex-core.test.d.ts +2 -0
  651. package/dist/mcp/__tests__/codex-core.test.d.ts.map +1 -0
  652. package/dist/mcp/__tests__/codex-core.test.js +143 -0
  653. package/dist/mcp/__tests__/codex-core.test.js.map +1 -0
  654. package/dist/mcp/__tests__/codex-integration.test.d.ts +2 -0
  655. package/dist/mcp/__tests__/codex-integration.test.d.ts.map +1 -0
  656. package/dist/mcp/__tests__/codex-integration.test.js +59 -0
  657. package/dist/mcp/__tests__/codex-integration.test.js.map +1 -0
  658. package/dist/mcp/__tests__/gemini-core.test.d.ts +2 -0
  659. package/dist/mcp/__tests__/gemini-core.test.d.ts.map +1 -0
  660. package/dist/mcp/__tests__/gemini-core.test.js +53 -0
  661. package/dist/mcp/__tests__/gemini-core.test.js.map +1 -0
  662. package/dist/mcp/__tests__/gemini-integration.test.d.ts +2 -0
  663. package/dist/mcp/__tests__/gemini-integration.test.d.ts.map +1 -0
  664. package/dist/mcp/__tests__/gemini-integration.test.js +50 -0
  665. package/dist/mcp/__tests__/gemini-integration.test.js.map +1 -0
  666. package/dist/mcp/__tests__/job-state-db-deprecation.test.js +48 -1
  667. package/dist/mcp/__tests__/job-state-db-deprecation.test.js.map +1 -1
  668. package/dist/mcp/__tests__/omc-tools-server.test.d.ts +2 -0
  669. package/dist/mcp/__tests__/omc-tools-server.test.d.ts.map +1 -0
  670. package/dist/mcp/__tests__/omc-tools-server.test.js +108 -0
  671. package/dist/mcp/__tests__/omc-tools-server.test.js.map +1 -0
  672. package/dist/mcp/__tests__/prompt-injection.test.d.ts +2 -0
  673. package/dist/mcp/__tests__/prompt-injection.test.d.ts.map +1 -0
  674. package/dist/mcp/__tests__/prompt-injection.test.js +86 -0
  675. package/dist/mcp/__tests__/prompt-injection.test.js.map +1 -0
  676. package/dist/mcp/adapters/ast-adapter.d.ts +90 -0
  677. package/dist/mcp/adapters/ast-adapter.d.ts.map +1 -0
  678. package/dist/mcp/adapters/ast-adapter.js +36 -0
  679. package/dist/mcp/adapters/ast-adapter.js.map +1 -0
  680. package/dist/mcp/adapters/lsp-adapter.d.ts +6 -0
  681. package/dist/mcp/adapters/lsp-adapter.d.ts.map +1 -0
  682. package/dist/mcp/adapters/lsp-adapter.js +6 -0
  683. package/dist/mcp/adapters/lsp-adapter.js.map +1 -0
  684. package/dist/mcp/adapters/memory-adapter.d.ts +156 -0
  685. package/dist/mcp/adapters/memory-adapter.d.ts.map +1 -0
  686. package/dist/mcp/adapters/memory-adapter.js +59 -0
  687. package/dist/mcp/adapters/memory-adapter.js.map +1 -0
  688. package/dist/mcp/adapters/notepad-adapter.d.ts +115 -0
  689. package/dist/mcp/adapters/notepad-adapter.d.ts.map +1 -0
  690. package/dist/mcp/adapters/notepad-adapter.js +78 -0
  691. package/dist/mcp/adapters/notepad-adapter.js.map +1 -0
  692. package/dist/mcp/adapters/python-adapter.d.ts +46 -0
  693. package/dist/mcp/adapters/python-adapter.d.ts.map +1 -0
  694. package/dist/mcp/adapters/python-adapter.js +44 -0
  695. package/dist/mcp/adapters/python-adapter.js.map +1 -0
  696. package/dist/mcp/adapters/skills-adapter.d.ts +37 -0
  697. package/dist/mcp/adapters/skills-adapter.d.ts.map +1 -0
  698. package/dist/mcp/adapters/skills-adapter.js +35 -0
  699. package/dist/mcp/adapters/skills-adapter.js.map +1 -0
  700. package/dist/mcp/adapters/state-adapter.d.ts +209 -0
  701. package/dist/mcp/adapters/state-adapter.d.ts.map +1 -0
  702. package/dist/mcp/adapters/state-adapter.js +82 -0
  703. package/dist/mcp/adapters/state-adapter.js.map +1 -0
  704. package/dist/mcp/adapters/trace-adapter.d.ts +67 -0
  705. package/dist/mcp/adapters/trace-adapter.d.ts.map +1 -0
  706. package/dist/mcp/adapters/trace-adapter.js +30 -0
  707. package/dist/mcp/adapters/trace-adapter.js.map +1 -0
  708. package/dist/mcp/client/MCPClient.d.ts +22 -0
  709. package/dist/mcp/client/MCPClient.d.ts.map +1 -0
  710. package/dist/mcp/client/MCPClient.js +93 -0
  711. package/dist/mcp/client/MCPClient.js.map +1 -0
  712. package/dist/mcp/client.d.ts +19 -0
  713. package/dist/mcp/client.d.ts.map +1 -0
  714. package/dist/mcp/client.js +34 -0
  715. package/dist/mcp/client.js.map +1 -0
  716. package/dist/mcp/codex-core.d.ts.map +1 -1
  717. package/dist/mcp/codex-core.js +9 -4
  718. package/dist/mcp/codex-core.js.map +1 -1
  719. package/dist/mcp/config/config-loader.d.ts +6 -0
  720. package/dist/mcp/config/config-loader.d.ts.map +1 -0
  721. package/dist/mcp/config/config-loader.js +16 -0
  722. package/dist/mcp/config/config-loader.js.map +1 -0
  723. package/dist/mcp/config/env-replacer.d.ts +10 -0
  724. package/dist/mcp/config/env-replacer.d.ts.map +1 -0
  725. package/dist/mcp/config/env-replacer.js +39 -0
  726. package/dist/mcp/config/env-replacer.js.map +1 -0
  727. package/dist/mcp/config/loader.d.ts +6 -0
  728. package/dist/mcp/config/loader.d.ts.map +1 -0
  729. package/dist/mcp/config/loader.js +51 -0
  730. package/dist/mcp/config/loader.js.map +1 -0
  731. package/dist/mcp/config/schema.d.ts +63 -0
  732. package/dist/mcp/config/schema.d.ts.map +1 -0
  733. package/dist/mcp/config/schema.js +15 -0
  734. package/dist/mcp/config/schema.js.map +1 -0
  735. package/dist/mcp/config-loader.d.ts +6 -0
  736. package/dist/mcp/config-loader.d.ts.map +1 -0
  737. package/dist/mcp/config-loader.js +66 -0
  738. package/dist/mcp/config-loader.js.map +1 -0
  739. package/dist/mcp/config-schema.d.ts +64 -0
  740. package/dist/mcp/config-schema.d.ts.map +1 -0
  741. package/dist/mcp/config-schema.js +18 -0
  742. package/dist/mcp/config-schema.js.map +1 -0
  743. package/dist/mcp/gemini-core.d.ts.map +1 -1
  744. package/dist/mcp/gemini-core.js +16 -1
  745. package/dist/mcp/gemini-core.js.map +1 -1
  746. package/dist/mcp/job-management.d.ts.map +1 -1
  747. package/dist/mcp/job-management.js +201 -7
  748. package/dist/mcp/job-management.js.map +1 -1
  749. package/dist/mcp/job-state-db.d.ts +1 -1
  750. package/dist/mcp/job-state-db.d.ts.map +1 -1
  751. package/dist/mcp/job-state-db.js +22 -5
  752. package/dist/mcp/job-state-db.js.map +1 -1
  753. package/dist/mcp/logger.d.ts +7 -0
  754. package/dist/mcp/logger.d.ts.map +1 -0
  755. package/dist/mcp/logger.js +19 -0
  756. package/dist/mcp/logger.js.map +1 -0
  757. package/dist/mcp/namespace-manager.d.ts +25 -0
  758. package/dist/mcp/namespace-manager.d.ts.map +1 -0
  759. package/dist/mcp/namespace-manager.js +26 -0
  760. package/dist/mcp/namespace-manager.js.map +1 -0
  761. package/dist/mcp/namespace.d.ts +26 -0
  762. package/dist/mcp/namespace.d.ts.map +1 -0
  763. package/dist/mcp/namespace.js +56 -0
  764. package/dist/mcp/namespace.js.map +1 -0
  765. package/dist/mcp/prompt-persistence.d.ts +3 -18
  766. package/dist/mcp/prompt-persistence.d.ts.map +1 -1
  767. package/dist/mcp/prompt-persistence.js +3 -3
  768. package/dist/mcp/prompt-persistence.js.map +1 -1
  769. package/dist/mcp/retry-client.d.ts +22 -0
  770. package/dist/mcp/retry-client.d.ts.map +1 -0
  771. package/dist/mcp/retry-client.js +59 -0
  772. package/dist/mcp/retry-client.js.map +1 -0
  773. package/dist/mcp/standalone-server.js +5 -41
  774. package/dist/mcp/standalone-server.js.map +1 -1
  775. package/dist/mcp/timeout.d.ts +8 -0
  776. package/dist/mcp/timeout.d.ts.map +1 -0
  777. package/dist/mcp/timeout.js +14 -0
  778. package/dist/mcp/timeout.js.map +1 -0
  779. package/dist/mcp/tool-handler.d.ts +14 -0
  780. package/dist/mcp/tool-handler.d.ts.map +1 -0
  781. package/dist/mcp/tool-handler.js +32 -0
  782. package/dist/mcp/tool-handler.js.map +1 -0
  783. package/dist/mcp/tool-resolver.d.ts +13 -0
  784. package/dist/mcp/tool-resolver.d.ts.map +1 -0
  785. package/dist/mcp/tool-resolver.js +30 -0
  786. package/dist/mcp/tool-resolver.js.map +1 -0
  787. package/dist/monitoring/dashboard.d.ts +13 -0
  788. package/dist/monitoring/dashboard.d.ts.map +1 -0
  789. package/dist/monitoring/dashboard.js +93 -0
  790. package/dist/monitoring/dashboard.js.map +1 -0
  791. package/dist/monitoring/index.d.ts +3 -0
  792. package/dist/monitoring/index.d.ts.map +1 -0
  793. package/dist/monitoring/index.js +3 -0
  794. package/dist/monitoring/index.js.map +1 -0
  795. package/dist/monitoring/metrics-collector.d.ts +18 -0
  796. package/dist/monitoring/metrics-collector.d.ts.map +1 -0
  797. package/dist/monitoring/metrics-collector.js +68 -0
  798. package/dist/monitoring/metrics-collector.js.map +1 -0
  799. package/dist/monitoring/test-perf.d.ts +2 -0
  800. package/dist/monitoring/test-perf.d.ts.map +1 -0
  801. package/dist/monitoring/test-perf.js +39 -0
  802. package/dist/monitoring/test-perf.js.map +1 -0
  803. package/dist/notifications/reply-listener.d.ts +25 -0
  804. package/dist/notifications/reply-listener.d.ts.map +1 -1
  805. package/dist/notifications/reply-listener.js +5 -5
  806. package/dist/notifications/reply-listener.js.map +1 -1
  807. package/dist/platform/process-utils.d.ts.map +1 -1
  808. package/dist/platform/process-utils.js +2 -3
  809. package/dist/platform/process-utils.js.map +1 -1
  810. package/dist/team/__tests__/deadlock-detector.test.d.ts +2 -0
  811. package/dist/team/__tests__/deadlock-detector.test.d.ts.map +1 -0
  812. package/dist/team/__tests__/deadlock-detector.test.js +50 -0
  813. package/dist/team/__tests__/deadlock-detector.test.js.map +1 -0
  814. package/dist/team/__tests__/dependency-graph.test.d.ts +2 -0
  815. package/dist/team/__tests__/dependency-graph.test.d.ts.map +1 -0
  816. package/dist/team/__tests__/dependency-graph.test.js +29 -0
  817. package/dist/team/__tests__/dependency-graph.test.js.map +1 -0
  818. package/dist/team/bridge-entry.d.ts +23 -0
  819. package/dist/team/bridge-entry.d.ts.map +1 -1
  820. package/dist/team/bridge-entry.js +83 -52
  821. package/dist/team/bridge-entry.js.map +1 -1
  822. package/dist/team/capabilities.d.ts +1 -2
  823. package/dist/team/capabilities.d.ts.map +1 -1
  824. package/dist/team/capabilities.js.map +1 -1
  825. package/dist/team/deadlock-detector.d.ts +16 -0
  826. package/dist/team/deadlock-detector.d.ts.map +1 -0
  827. package/dist/team/deadlock-detector.js +52 -0
  828. package/dist/team/deadlock-detector.js.map +1 -0
  829. package/dist/team/dependency-graph.d.ts +23 -0
  830. package/dist/team/dependency-graph.d.ts.map +1 -0
  831. package/dist/team/dependency-graph.js +35 -0
  832. package/dist/team/dependency-graph.js.map +1 -0
  833. package/dist/team/inbox-outbox.js +1 -1
  834. package/dist/team/inbox-outbox.js.map +1 -1
  835. package/dist/team/index.d.ts +3 -0
  836. package/dist/team/index.d.ts.map +1 -1
  837. package/dist/team/index.js +2 -0
  838. package/dist/team/index.js.map +1 -1
  839. package/dist/team/mcp-team-bridge.d.ts.map +1 -1
  840. package/dist/team/mcp-team-bridge.js +35 -23
  841. package/dist/team/mcp-team-bridge.js.map +1 -1
  842. package/dist/team/types.d.ts +15 -4
  843. package/dist/team/types.d.ts.map +1 -1
  844. package/dist/team/types.js +0 -1
  845. package/dist/team/types.js.map +1 -1
  846. package/dist/team/unified-team.d.ts +2 -11
  847. package/dist/team/unified-team.d.ts.map +1 -1
  848. package/dist/team/unified-team.js.map +1 -1
  849. package/dist/team/worker-health.d.ts +2 -2
  850. package/dist/team/worker-health.d.ts.map +1 -1
  851. package/dist/team/worker-health.js +74 -6
  852. package/dist/team/worker-health.js.map +1 -1
  853. package/dist/team/worker-restart.d.ts +4 -4
  854. package/dist/team/worker-restart.d.ts.map +1 -1
  855. package/dist/team/worker-restart.js +64 -9
  856. package/dist/team/worker-restart.js.map +1 -1
  857. package/dist/tools/__tests__/ast-tools.test.d.ts +2 -0
  858. package/dist/tools/__tests__/ast-tools.test.d.ts.map +1 -0
  859. package/dist/tools/__tests__/ast-tools.test.js +178 -0
  860. package/dist/tools/__tests__/ast-tools.test.js.map +1 -0
  861. package/dist/tools/__tests__/lsp-tools.test.d.ts +2 -0
  862. package/dist/tools/__tests__/lsp-tools.test.d.ts.map +1 -0
  863. package/dist/tools/__tests__/lsp-tools.test.js +252 -0
  864. package/dist/tools/__tests__/lsp-tools.test.js.map +1 -0
  865. package/dist/tools/ast-tools.d.ts.map +1 -1
  866. package/dist/tools/ast-tools.js +84 -5
  867. package/dist/tools/ast-tools.js.map +1 -1
  868. package/dist/tools/dependency-analyzer.d.ts +34 -0
  869. package/dist/tools/dependency-analyzer.d.ts.map +1 -0
  870. package/dist/tools/dependency-analyzer.js +57 -0
  871. package/dist/tools/dependency-analyzer.js.map +1 -0
  872. package/dist/tools/diagnostics/__tests__/index.test.d.ts +2 -0
  873. package/dist/tools/diagnostics/__tests__/index.test.d.ts.map +1 -0
  874. package/dist/tools/diagnostics/__tests__/index.test.js +111 -0
  875. package/dist/tools/diagnostics/__tests__/index.test.js.map +1 -0
  876. package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.d.ts +2 -0
  877. package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.d.ts.map +1 -0
  878. package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.js +120 -0
  879. package/dist/tools/diagnostics/__tests__/lsp-aggregator.test.js.map +1 -0
  880. package/dist/tools/diagnostics/__tests__/tsc-runner.test.d.ts +2 -0
  881. package/dist/tools/diagnostics/__tests__/tsc-runner.test.d.ts.map +1 -0
  882. package/dist/tools/diagnostics/__tests__/tsc-runner.test.js +86 -0
  883. package/dist/tools/diagnostics/__tests__/tsc-runner.test.js.map +1 -0
  884. package/dist/tools/diagnostics/constants.d.ts +5 -0
  885. package/dist/tools/diagnostics/constants.d.ts.map +1 -0
  886. package/dist/tools/diagnostics/constants.js +5 -0
  887. package/dist/tools/diagnostics/constants.js.map +1 -0
  888. package/dist/tools/diagnostics/index.d.ts +2 -1
  889. package/dist/tools/diagnostics/index.d.ts.map +1 -1
  890. package/dist/tools/diagnostics/index.js +2 -1
  891. package/dist/tools/diagnostics/index.js.map +1 -1
  892. package/dist/tools/diagnostics/lsp-aggregator.js +1 -1
  893. package/dist/tools/diagnostics/lsp-aggregator.js.map +1 -1
  894. package/dist/tools/doc-sync.d.ts +38 -0
  895. package/dist/tools/doc-sync.d.ts.map +1 -0
  896. package/dist/tools/doc-sync.js +67 -0
  897. package/dist/tools/doc-sync.js.map +1 -0
  898. package/dist/tools/index.d.ts +11 -1
  899. package/dist/tools/index.d.ts.map +1 -1
  900. package/dist/tools/index.js +41 -3
  901. package/dist/tools/index.js.map +1 -1
  902. package/dist/tools/lsp/__tests__/utils.test.d.ts +2 -0
  903. package/dist/tools/lsp/__tests__/utils.test.d.ts.map +1 -0
  904. package/dist/tools/lsp/__tests__/utils.test.js +338 -0
  905. package/dist/tools/lsp/__tests__/utils.test.js.map +1 -0
  906. package/dist/tools/lsp/client.d.ts +10 -0
  907. package/dist/tools/lsp/client.d.ts.map +1 -1
  908. package/dist/tools/lsp/client.js +55 -0
  909. package/dist/tools/lsp/client.js.map +1 -1
  910. package/dist/tools/lsp/memory-optimizer.d.ts +19 -0
  911. package/dist/tools/lsp/memory-optimizer.d.ts.map +1 -0
  912. package/dist/tools/lsp/memory-optimizer.js +48 -0
  913. package/dist/tools/lsp/memory-optimizer.js.map +1 -0
  914. package/dist/tools/lsp/utils.d.ts.map +1 -1
  915. package/dist/tools/lsp/utils.js +2 -2
  916. package/dist/tools/lsp/utils.js.map +1 -1
  917. package/dist/tools/memory-tools.js +4 -4
  918. package/dist/tools/memory-tools.js.map +1 -1
  919. package/dist/tools/notepad-tools.d.ts.map +1 -1
  920. package/dist/tools/notepad-tools.js +6 -0
  921. package/dist/tools/notepad-tools.js.map +1 -1
  922. package/dist/tools/parallel-opportunity-detector.d.ts +54 -0
  923. package/dist/tools/parallel-opportunity-detector.d.ts.map +1 -0
  924. package/dist/tools/parallel-opportunity-detector.js +66 -0
  925. package/dist/tools/parallel-opportunity-detector.js.map +1 -0
  926. package/dist/tools/python-repl/__tests__/bridge-manager.test.d.ts +2 -0
  927. package/dist/tools/python-repl/__tests__/bridge-manager.test.d.ts.map +1 -0
  928. package/dist/tools/python-repl/__tests__/bridge-manager.test.js +338 -0
  929. package/dist/tools/python-repl/__tests__/bridge-manager.test.js.map +1 -0
  930. package/dist/tools/python-repl/__tests__/socket-client.test.d.ts +2 -0
  931. package/dist/tools/python-repl/__tests__/socket-client.test.d.ts.map +1 -0
  932. package/dist/tools/python-repl/__tests__/socket-client.test.js +155 -0
  933. package/dist/tools/python-repl/__tests__/socket-client.test.js.map +1 -0
  934. package/dist/tools/python-repl/bridge-manager.d.ts +4 -0
  935. package/dist/tools/python-repl/bridge-manager.d.ts.map +1 -1
  936. package/dist/tools/python-repl/bridge-manager.js +8 -5
  937. package/dist/tools/python-repl/bridge-manager.js.map +1 -1
  938. package/dist/tools/skills-tools.d.ts.map +1 -1
  939. package/dist/tools/skills-tools.js +5 -3
  940. package/dist/tools/skills-tools.js.map +1 -1
  941. package/dist/tools/state-tools.d.ts +6 -0
  942. package/dist/tools/state-tools.d.ts.map +1 -1
  943. package/dist/tools/state-tools.js +108 -87
  944. package/dist/tools/state-tools.js.map +1 -1
  945. package/dist/tools/tool-prefix-migration.d.ts +18 -0
  946. package/dist/tools/tool-prefix-migration.d.ts.map +1 -0
  947. package/dist/tools/tool-prefix-migration.js +80 -0
  948. package/dist/tools/tool-prefix-migration.js.map +1 -0
  949. package/dist/workers/adapter.d.ts +16 -0
  950. package/dist/workers/adapter.d.ts.map +1 -0
  951. package/dist/workers/adapter.js +5 -0
  952. package/dist/workers/adapter.js.map +1 -0
  953. package/dist/workers/cached-adapter.d.ts +21 -0
  954. package/dist/workers/cached-adapter.d.ts.map +1 -0
  955. package/dist/workers/cached-adapter.js +67 -0
  956. package/dist/workers/cached-adapter.js.map +1 -0
  957. package/dist/workers/factory.d.ts +11 -0
  958. package/dist/workers/factory.d.ts.map +1 -0
  959. package/dist/workers/factory.js +54 -0
  960. package/dist/workers/factory.js.map +1 -0
  961. package/dist/workers/index.d.ts +10 -0
  962. package/dist/workers/index.d.ts.map +1 -0
  963. package/dist/workers/index.js +10 -0
  964. package/dist/workers/index.js.map +1 -0
  965. package/dist/workers/json-adapter.d.ts +22 -0
  966. package/dist/workers/json-adapter.d.ts.map +1 -0
  967. package/dist/workers/json-adapter.js +171 -0
  968. package/dist/workers/json-adapter.js.map +1 -0
  969. package/dist/workers/sqlite-adapter.d.ts +22 -0
  970. package/dist/workers/sqlite-adapter.d.ts.map +1 -0
  971. package/dist/workers/sqlite-adapter.js +262 -0
  972. package/dist/workers/sqlite-adapter.js.map +1 -0
  973. package/dist/workers/types.d.ts +41 -0
  974. package/dist/workers/types.d.ts.map +1 -0
  975. package/dist/workers/types.js +5 -0
  976. package/dist/workers/types.js.map +1 -0
  977. package/docs/AGENTS.md +81 -89
  978. package/docs/ARCHITECTURE.md +541 -162
  979. package/docs/CLAUDE.md +1 -1
  980. package/docs/DOCUMENTATION_UPDATE_SUMMARY.md +97 -0
  981. package/docs/FAQ.md +306 -0
  982. package/docs/FEATURES.md +1038 -420
  983. package/docs/INSTALL.md +5 -5
  984. package/docs/INSTALL_FIX_SUMMARY.md +97 -0
  985. package/docs/INSTALL_FIX_VERIFICATION.md +61 -0
  986. package/docs/INSTALL_VERIFICATION_REPORT.md +68 -0
  987. package/docs/KNOWN_ISSUES.md +104 -0
  988. package/docs/LOCAL_INSTALL_VERIFICATION.md +159 -0
  989. package/docs/LOCAL_TEST_INSTALL_REPORT.md +96 -0
  990. package/docs/MAIN_DOCS_UPDATE_REPORT.md +41 -0
  991. package/docs/MIGRATION_GUIDE_v5.5.18.md +177 -0
  992. package/docs/PLUGIN_MARKETPLACE_VERIFICATION.md +187 -0
  993. package/docs/README.md +110 -0
  994. package/docs/REFERENCE.md +930 -786
  995. package/docs/RELEASE_NOTES_v5.5.14.md +97 -0
  996. package/docs/RELEASE_SUMMARY_v5.5.18.md +60 -0
  997. package/docs/TUTORIAL.md +223 -0
  998. package/docs/UPGRADE_VERIFICATION.md +500 -0
  999. package/docs/UPGRADE_VERIFICATION_REPORT.md +96 -0
  1000. package/docs/USER_GUIDE.md +2044 -0
  1001. package/docs/VALIDATION_REPORT.md +165 -0
  1002. package/docs/VERIFICATION_SUMMARY.md +116 -0
  1003. package/docs/adr/001-worker-state-adapter.md +168 -0
  1004. package/docs/adr/002-caching-strategy.md +112 -0
  1005. package/docs/adr/003-gradual-migration.md +193 -0
  1006. package/docs/adr/template.md +97 -0
  1007. package/docs/api/.nojekyll +1 -0
  1008. package/docs/api/assets/hierarchy.js +1 -0
  1009. package/docs/api/assets/highlight.css +85 -0
  1010. package/docs/api/assets/icons.js +18 -0
  1011. package/docs/api/assets/icons.svg +1 -0
  1012. package/docs/api/assets/main.js +60 -0
  1013. package/docs/api/assets/navigation.js +1 -0
  1014. package/docs/api/assets/search.js +1 -0
  1015. package/docs/api/assets/style.css +1633 -0
  1016. package/docs/api/classes/ContextCollector.html +21 -0
  1017. package/docs/api/functions/activateUltrawork.html +2 -0
  1018. package/docs/api/functions/addCustomNote.html +5 -0
  1019. package/docs/api/functions/addDirective.html +2 -0
  1020. package/docs/api/functions/addManualEntry.html +2 -0
  1021. package/docs/api/functions/addPattern.html +3 -0
  1022. package/docs/api/functions/addWorker.html +2 -0
  1023. package/docs/api/functions/addWorkingMemoryEntry.html +2 -0
  1024. package/docs/api/functions/analyzeContextUsage.html +2 -0
  1025. package/docs/api/functions/appendProgress.html +2 -0
  1026. package/docs/api/functions/appendSessionId.html +2 -0
  1027. package/docs/api/functions/applyCommentFilters.html +3 -0
  1028. package/docs/api/functions/assignFileToWorker.html +2 -0
  1029. package/docs/api/functions/backgroundUpdateCheck.html +2 -0
  1030. package/docs/api/functions/buildAxiomBootContext.html +1 -0
  1031. package/docs/api/functions/buildBoulderContinuation.html +2 -0
  1032. package/docs/api/functions/buildDelegationTable.html +2 -0
  1033. package/docs/api/functions/buildKeyTriggersSection.html +2 -0
  1034. package/docs/api/functions/buildOrchestratorReminder.html +2 -0
  1035. package/docs/api/functions/buildUseAvoidSection.html +2 -0
  1036. package/docs/api/functions/buildVerificationReminder.html +2 -0
  1037. package/docs/api/functions/canResumeAutopilot.html +10 -0
  1038. package/docs/api/functions/canStartMode.html +5 -0
  1039. package/docs/api/functions/cancelAutopilot.html +3 -0
  1040. package/docs/api/functions/cancelUltraQA.html +2 -0
  1041. package/docs/api/functions/checkBackgroundNotifications.html +2 -0
  1042. package/docs/api/functions/checkBoulderContinuation.html +2 -0
  1043. package/docs/api/functions/checkDuplicateTriggers.html +2 -0
  1044. package/docs/api/functions/checkExpertGate.html +1 -0
  1045. package/docs/api/functions/checkForComments.html +2 -0
  1046. package/docs/api/functions/checkForUpdates.html +2 -0
  1047. package/docs/api/functions/checkIncompleteTodos.html +13 -0
  1048. package/docs/api/functions/checkPersistentModes.html +3 -0
  1049. package/docs/api/functions/cleanupOrphanedState.html +2 -0
  1050. package/docs/api/functions/cleanupStaleAgents.html +2 -0
  1051. package/docs/api/functions/cleanupTransientState.html +2 -0
  1052. package/docs/api/functions/clearAgentUsageState.html +1 -0
  1053. package/docs/api/functions/clearAllModeStates.html +2 -0
  1054. package/docs/api/functions/clearAutopilot.html +2 -0
  1055. package/docs/api/functions/clearAutopilotState.html +2 -0
  1056. package/docs/api/functions/clearBeadsContext.html +2 -0
  1057. package/docs/api/functions/clearBoulderState.html +2 -0
  1058. package/docs/api/functions/clearDetectionState.html +2 -0
  1059. package/docs/api/functions/clearInjectedPaths.html +2 -0
  1060. package/docs/api/functions/clearInjectedRules.html +2 -0
  1061. package/docs/api/functions/clearLinkedUltraworkState.html +2 -0
  1062. package/docs/api/functions/clearModeState.html +10 -0
  1063. package/docs/api/functions/clearProjectMemorySession.html +4 -0
  1064. package/docs/api/functions/clearRalphState.html +2 -0
  1065. package/docs/api/functions/clearRapidFireDebounce.html +2 -0
  1066. package/docs/api/functions/clearSkillSession.html +2 -0
  1067. package/docs/api/functions/clearThinkModeState.html +2 -0
  1068. package/docs/api/functions/clearTrackingState.html +2 -0
  1069. package/docs/api/functions/clearUltraQAState.html +2 -0
  1070. package/docs/api/functions/clearVerificationState.html +3 -0
  1071. package/docs/api/functions/commandExists.html +2 -0
  1072. package/docs/api/functions/compareVersions.html +3 -0
  1073. package/docs/api/functions/completeUltraQA.html +2 -0
  1074. package/docs/api/functions/completeUltrapilot.html +2 -0
  1075. package/docs/api/functions/completeWorker.html +2 -0
  1076. package/docs/api/functions/containsTokenLimitError.html +2 -0
  1077. package/docs/api/functions/createAgentToolRestrictions.html +3 -0
  1078. package/docs/api/functions/createAgentUsageReminderHook.html +1 -0
  1079. package/docs/api/functions/createAutoSlashCommandHook.html +7 -0
  1080. package/docs/api/functions/createBackgroundNotificationHook.html +7 -0
  1081. package/docs/api/functions/createBackgroundTaskManager.html +2 -0
  1082. package/docs/api/functions/createBoulderState.html +2 -0
  1083. package/docs/api/functions/createCommentCheckerHook.html +6 -0
  1084. package/docs/api/functions/createCompactCheckpoint.html +2 -0
  1085. package/docs/api/functions/createContentHash.html +2 -0
  1086. package/docs/api/functions/createContextInjectorHook.html +7 -0
  1087. package/docs/api/functions/createDirectoryReadmeInjectorHook.html +9 -0
  1088. package/docs/api/functions/createEmptyMessageSanitizerHook.html +6 -0
  1089. package/docs/api/functions/createEnvContext.html +2 -0
  1090. package/docs/api/functions/createHookOutput.html +4 -0
  1091. package/docs/api/functions/createLearnedSkillsHook.html +6 -0
  1092. package/docs/api/functions/createMagicKeywordProcessor.html +2 -0
  1093. package/docs/api/functions/createModeMarker.html +6 -0
  1094. package/docs/api/functions/createPrd.html +2 -0
  1095. package/docs/api/functions/createPreemptiveCompactionHook.html +6 -0
  1096. package/docs/api/functions/createRalphLoopHook.html +2 -0
  1097. package/docs/api/functions/createRecoveryHook.html +7 -0
  1098. package/docs/api/functions/createRulesInjectorHook.html +8 -0
  1099. package/docs/api/functions/createSimplePrd.html +2 -0
  1100. package/docs/api/functions/createSisyphusOrchestratorHook.html +7 -0
  1101. package/docs/api/functions/createSisyphusSession.html +7 -0
  1102. package/docs/api/functions/createThinkModeHook.html +7 -0
  1103. package/docs/api/functions/createThinkingBlockValidatorHook.html +1 -0
  1104. package/docs/api/functions/createTodoContinuationHook.html +2 -0
  1105. package/docs/api/functions/createUltraworkStateHook.html +2 -0
  1106. package/docs/api/functions/deactivateUltrawork.html +8 -0
  1107. package/docs/api/functions/decayHotPaths.html +2 -0
  1108. package/docs/api/functions/decomposeTask.html +11 -0
  1109. package/docs/api/functions/deepMerge.html +2 -0
  1110. package/docs/api/functions/detectArchitectApproval.html +2 -0
  1111. package/docs/api/functions/detectArchitectRejection.html +2 -0
  1112. package/docs/api/functions/detectContextLimitError.html +2 -0
  1113. package/docs/api/functions/detectContextLimitErrorInText.html +2 -0
  1114. package/docs/api/functions/detectDirectivesFromMessage.html +2 -0
  1115. package/docs/api/functions/detectEditError.html +2 -0
  1116. package/docs/api/functions/detectEditErrorInOutput.html +2 -0
  1117. package/docs/api/functions/detectEditErrorInText.html +2 -0
  1118. package/docs/api/functions/detectExtractableMoment.html +2 -0
  1119. package/docs/api/functions/detectKeywordsWithType.html +11 -0
  1120. package/docs/api/functions/detectMagicKeywords.html +2 -0
  1121. package/docs/api/functions/detectProjectEnvironment.html +2 -0
  1122. package/docs/api/functions/detectRecoverableError.html +3 -0
  1123. package/docs/api/functions/detectSessionErrorType.html +2 -0
  1124. package/docs/api/functions/detectSlashCommand.html +3 -0
  1125. package/docs/api/functions/detectThinkKeyword.html +2 -0
  1126. package/docs/api/functions/detectUltrathinkKeyword.html +2 -0
  1127. package/docs/api/functions/discoverAllCommands.html +2 -0
  1128. package/docs/api/functions/enablePrdMode.html +2 -0
  1129. package/docs/api/functions/enhancePrompt.html +2 -0
  1130. package/docs/api/functions/ensureAutopilotDir.html +2 -0
  1131. package/docs/api/functions/ensureDirectoryStructure.html +2 -0
  1132. package/docs/api/functions/ensureModeStateDir.html +2 -0
  1133. package/docs/api/functions/ensureSkillsDir.html +2 -0
  1134. package/docs/api/functions/estimateTokens.html +2 -0
  1135. package/docs/api/functions/executeSlashCommand.html +2 -0
  1136. package/docs/api/functions/expandCommand.html +8 -0
  1137. package/docs/api/functions/expandCommandPrompt.html +6 -0
  1138. package/docs/api/functions/expandCommands.html +2 -0
  1139. package/docs/api/functions/exportSessionSummary.html +2 -0
  1140. package/docs/api/functions/exportWisdomToNotepad.html +2 -0
  1141. package/docs/api/functions/extractPromptText.html +11 -0
  1142. package/docs/api/functions/extractSlashPromptText.html +2 -0
  1143. package/docs/api/functions/extractThinkPromptText.html +2 -0
  1144. package/docs/api/functions/failWorker.html +2 -0
  1145. package/docs/api/functions/findCommand.html +2 -0
  1146. package/docs/api/functions/findMatchingSkills.html +2 -0
  1147. package/docs/api/functions/findPlannerPlans.html +3 -0
  1148. package/docs/api/functions/findPrdPath.html +2 -0
  1149. package/docs/api/functions/findPreviousThinkingContent.html +1 -0
  1150. package/docs/api/functions/findProgressPath.html +2 -0
  1151. package/docs/api/functions/findProjectRoot.html +3 -0
  1152. package/docs/api/functions/findRecoveryEmptyMessages.html +2 -0
  1153. package/docs/api/functions/findRecoveryOrphanThinking.html +2 -0
  1154. package/docs/api/functions/findRecoveryThinkingBlocks.html +2 -0
  1155. package/docs/api/functions/findRuleFiles.html +4 -0
  1156. package/docs/api/functions/findSkillFiles.html +3 -0
  1157. package/docs/api/functions/formatCancelMessage.html +2 -0
  1158. package/docs/api/functions/formatCompactSummary.html +2 -0
  1159. package/docs/api/functions/formatContextSummary.html +3 -0
  1160. package/docs/api/functions/formatDirectivesForContext.html +2 -0
  1161. package/docs/api/functions/formatFailureSummary.html +2 -0
  1162. package/docs/api/functions/formatFile.html +2 -0
  1163. package/docs/api/functions/formatFileChanges.html +2 -0
  1164. package/docs/api/functions/formatFileList.html +2 -0
  1165. package/docs/api/functions/formatFullContext.html +2 -0
  1166. package/docs/api/functions/formatFullNotepad.html +2 -0
  1167. package/docs/api/functions/formatLearningsForContext.html +2 -0
  1168. package/docs/api/functions/formatNextStoryPrompt.html +2 -0
  1169. package/docs/api/functions/formatNotepadContext.html +2 -0
  1170. package/docs/api/functions/formatPatternsForContext.html +2 -0
  1171. package/docs/api/functions/formatPrd.html +2 -0
  1172. package/docs/api/functions/formatPrdStatus.html +2 -0
  1173. package/docs/api/functions/formatPreCompactSummary.html +2 -0
  1174. package/docs/api/functions/formatProgressForContext.html +2 -0
  1175. package/docs/api/functions/formatProgressMessage.html +2 -0
  1176. package/docs/api/functions/formatStory.html +2 -0
  1177. package/docs/api/functions/formatSummary.html +2 -0
  1178. package/docs/api/functions/formatUpdateNotification.html +2 -0
  1179. package/docs/api/functions/formatValidationResults.html +2 -0
  1180. package/docs/api/functions/generateExtractionPrompt.html +2 -0
  1181. package/docs/api/functions/generateSkillFrontmatter.html +2 -0
  1182. package/docs/api/functions/generateSummary.html +2 -0
  1183. package/docs/api/functions/getActiveAgentCount.html +2 -0
  1184. package/docs/api/functions/getActiveExclusiveMode.html +4 -0
  1185. package/docs/api/functions/getActiveModes.html +2 -0
  1186. package/docs/api/functions/getActivePlanPath.html +2 -0
  1187. package/docs/api/functions/getAgentDefinitions.html +2 -0
  1188. package/docs/api/functions/getAgentsByType.html +2 -0
  1189. package/docs/api/functions/getAllCommands.html +2 -0
  1190. package/docs/api/functions/getAllModeStatuses.html +5 -0
  1191. package/docs/api/functions/getAllSkills.html +2 -0
  1192. package/docs/api/functions/getArchitectRejectionContinuationPrompt.html +2 -0
  1193. package/docs/api/functions/getArchitectVerificationPrompt.html +2 -0
  1194. package/docs/api/functions/getAutoFormatMessage.html +2 -0
  1195. package/docs/api/functions/getAutopilotStateAge.html +3 -0
  1196. package/docs/api/functions/getAvailableAgents.html +2 -0
  1197. package/docs/api/functions/getAxiomDir.html +1 -0
  1198. package/docs/api/functions/getBackgroundTaskGuidance.html +4 -0
  1199. package/docs/api/functions/getBeadsContextConfig.html +2 -0
  1200. package/docs/api/functions/getBeadsInstructions.html +2 -0
  1201. package/docs/api/functions/getBoulderFilePath.html +2 -0
  1202. package/docs/api/functions/getCheckpointPath.html +2 -0
  1203. package/docs/api/functions/getClaudeThinkingConfig.html +3 -0
  1204. package/docs/api/functions/getCommand.html +2 -0
  1205. package/docs/api/functions/getCommandsDir.html +2 -0
  1206. package/docs/api/functions/getCompactionQueueDepth.html +3 -0
  1207. package/docs/api/functions/getCompletedWorkers.html +2 -0
  1208. package/docs/api/functions/getDefaultMcpServers.html +1 -0
  1209. package/docs/api/functions/getDefaultModelForCategory.html +2 -0
  1210. package/docs/api/functions/getDetectionStats.html +2 -0
  1211. package/docs/api/functions/getDirectPlanningPrompt.html +3 -0
  1212. package/docs/api/functions/getExecutionPrompt.html +2 -0
  1213. package/docs/api/functions/getExpansionPrompt.html +3 -0
  1214. package/docs/api/functions/getExpertGateMessage.html +1 -0
  1215. package/docs/api/functions/getFailedWorkers.html +2 -0
  1216. package/docs/api/functions/getFormatter.html +2 -0
  1217. package/docs/api/functions/getGitDiffStats.html +2 -0
  1218. package/docs/api/functions/getGlobalStateFilePath.html +4 -0
  1219. package/docs/api/functions/getGoalCommand.html +2 -0
  1220. package/docs/api/functions/getHighVariant.html +3 -0
  1221. package/docs/api/functions/getInstallInfo.html +2 -0
  1222. package/docs/api/functions/getInstalledVersion.html +2 -0
  1223. package/docs/api/functions/getIssuesToFix.html +2 -0
  1224. package/docs/api/functions/getLastDetection.html +2 -0
  1225. package/docs/api/functions/getLearnerConfigValue.html +2 -0
  1226. package/docs/api/functions/getLinter.html +2 -0
  1227. package/docs/api/functions/getManualSection.html +2 -0
  1228. package/docs/api/functions/getMemoryFilePaths.html +1 -0
  1229. package/docs/api/functions/getModeMarkerFilePath.html +2 -0
  1230. package/docs/api/functions/getModeStateFilePath.html +2 -0
  1231. package/docs/api/functions/getNextStory.html +2 -0
  1232. package/docs/api/functions/getNotepadPath.html +2 -0
  1233. package/docs/api/functions/getNotepadStats.html +2 -0
  1234. package/docs/api/functions/getOmcPrdPath.html +2 -0
  1235. package/docs/api/functions/getOmcProgressPath.html +2 -0
  1236. package/docs/api/functions/getOmcSystemPrompt.html +2 -0
  1237. package/docs/api/functions/getOmcToolNames.html +3 -0
  1238. package/docs/api/functions/getPatterns.html +2 -0
  1239. package/docs/api/functions/getPhasePrompt.html +2 -0
  1240. package/docs/api/functions/getPlanName.html +2 -0
  1241. package/docs/api/functions/getPlanPath.html +2 -0
  1242. package/docs/api/functions/getPlanProgress.html +2 -0
  1243. package/docs/api/functions/getPlanSummaries.html +2 -0
  1244. package/docs/api/functions/getPrdCompletionStatus.html +2 -0
  1245. package/docs/api/functions/getPrdPath.html +2 -0
  1246. package/docs/api/functions/getPrdStatus.html +2 -0
  1247. package/docs/api/functions/getPreCommitReminderMessage.html +2 -0
  1248. package/docs/api/functions/getPriorityContext.html +2 -0
  1249. package/docs/api/functions/getProgressContext.html +2 -0
  1250. package/docs/api/functions/getProgressPath.html +2 -0
  1251. package/docs/api/functions/getPromotionCandidates.html +2 -0
  1252. package/docs/api/functions/getQAPrompt.html +2 -0
  1253. package/docs/api/functions/getRalphContext.html +3 -0
  1254. package/docs/api/functions/getReadmesForPath.html +2 -0
  1255. package/docs/api/functions/getRecentLearnings.html +2 -0
  1256. package/docs/api/functions/getRulesForPath.html +2 -0
  1257. package/docs/api/functions/getRunningAgents.html +2 -0
  1258. package/docs/api/functions/getRunningWorkers.html +2 -0
  1259. package/docs/api/functions/getSessionTokenEstimate.html +2 -0
  1260. package/docs/api/functions/getSkillsDir.html +2 -0
  1261. package/docs/api/functions/getSpecPath.html +2 -0
  1262. package/docs/api/functions/getStaleAgents.html +2 -0
  1263. package/docs/api/functions/getStateDir.html +2 -0
  1264. package/docs/api/functions/getStory.html +2 -0
  1265. package/docs/api/functions/getSubagentStateFilePath.html +2 -0
  1266. package/docs/api/functions/getThinkModeState.html +2 -0
  1267. package/docs/api/functions/getThinkingConfig.html +3 -0
  1268. package/docs/api/functions/getTopHotPaths.html +2 -0
  1269. package/docs/api/functions/getTrackingStats.html +2 -0
  1270. package/docs/api/functions/getTransitionPrompt.html +2 -0
  1271. package/docs/api/functions/getUltraworkPersistenceMessage.html +2 -0
  1272. package/docs/api/functions/getValidationPrompt.html +2 -0
  1273. package/docs/api/functions/getValidationSpawnPrompt.html +2 -0
  1274. package/docs/api/functions/getValidationStats.html +1 -0
  1275. package/docs/api/functions/getValidationStatus.html +2 -0
  1276. package/docs/api/functions/getWorkingMemory.html +2 -0
  1277. package/docs/api/functions/handleBackgroundEvent.html +3 -0
  1278. package/docs/api/functions/handleContextWindowRecovery.html +2 -0
  1279. package/docs/api/functions/handleEditErrorRecovery.html +2 -0
  1280. package/docs/api/functions/handlePermissionRequest.html +2 -0
  1281. package/docs/api/functions/handleRecovery.html +10 -0
  1282. package/docs/api/functions/handleSessionEnd.html +2 -0
  1283. package/docs/api/functions/handleSessionRecovery.html +2 -0
  1284. package/docs/api/functions/handleSharedFiles.html +7 -0
  1285. package/docs/api/functions/handleSubagentStart.html +2 -0
  1286. package/docs/api/functions/handleSubagentStop.html +2 -0
  1287. package/docs/api/functions/hasBoulder.html +2 -0
  1288. package/docs/api/functions/hasContentParts.html +1 -0
  1289. package/docs/api/functions/hasModeState.html +3 -0
  1290. package/docs/api/functions/hasPrd.html +2 -0
  1291. package/docs/api/functions/hasTextContent.html +2 -0
  1292. package/docs/api/functions/hasValidContent.html +3 -0
  1293. package/docs/api/functions/incrementAgentCount.html +2 -0
  1294. package/docs/api/functions/incrementRalphIteration.html +2 -0
  1295. package/docs/api/functions/incrementReinforcement.html +2 -0
  1296. package/docs/api/functions/initAutopilot.html +2 -0
  1297. package/docs/api/functions/initNotepad.html +2 -0
  1298. package/docs/api/functions/initPrd.html +2 -0
  1299. package/docs/api/functions/initProgress.html +2 -0
  1300. package/docs/api/functions/initUltrapilot.html +2 -0
  1301. package/docs/api/functions/injectContextIntoText.html +2 -0
  1302. package/docs/api/functions/injectPendingContext.html +3 -0
  1303. package/docs/api/functions/injectRecoveryTextPart.html +2 -0
  1304. package/docs/api/functions/install.html +2 -0
  1305. package/docs/api/functions/integrateResults.html +5 -0
  1306. package/docs/api/functions/isActiveModeRunning.html +2 -0
  1307. package/docs/api/functions/isAllowedPath.html +2 -0
  1308. package/docs/api/functions/isAlreadyHighVariant.html +2 -0
  1309. package/docs/api/functions/isAutopilotActive.html +2 -0
  1310. package/docs/api/functions/isAxiomEnabled.html +1 -0
  1311. package/docs/api/functions/isClaudeInstalled.html +3 -0
  1312. package/docs/api/functions/isClaudeModel.html +2 -0
  1313. package/docs/api/functions/isCompactionInProgress.html +3 -0
  1314. package/docs/api/functions/isDuplicateByContentHash.html +2 -0
  1315. package/docs/api/functions/isDuplicateByRealPath.html +2 -0
  1316. package/docs/api/functions/isExcludedCommand.html +2 -0
  1317. package/docs/api/functions/isExtendedThinkingModel.html +1 -0
  1318. package/docs/api/functions/isFileOwnedByWorker.html +2 -0
  1319. package/docs/api/functions/isFormatterAvailable.html +2 -0
  1320. package/docs/api/functions/isGptModel.html +2 -0
  1321. package/docs/api/functions/isInstalled.html +2 -0
  1322. package/docs/api/functions/isLearnerEnabled.html +2 -0
  1323. package/docs/api/functions/isModeActive.html +6 -0
  1324. package/docs/api/functions/isNonInteractive.html +1 -0
  1325. package/docs/api/functions/isRecoverableError.html +2 -0
  1326. package/docs/api/functions/isSafeCommand.html +2 -0
  1327. package/docs/api/functions/isSessionRecoverable.html +2 -0
  1328. package/docs/api/functions/isSharedFile.html +2 -0
  1329. package/docs/api/functions/isThinkModeActive.html +2 -0
  1330. package/docs/api/functions/isToolPart.html +2 -0
  1331. package/docs/api/functions/isUltraQAActive.html +1 -0
  1332. package/docs/api/functions/isWriteEditTool.html +2 -0
  1333. package/docs/api/functions/learnFromToolOutput.html +7 -0
  1334. package/docs/api/functions/lintFile.html +2 -0
  1335. package/docs/api/functions/listAvailableCommands.html +2 -0
  1336. package/docs/api/functions/listCommands.html +2 -0
  1337. package/docs/api/functions/listPromotableLearnings.html +2 -0
  1338. package/docs/api/functions/loadAgentPrompt.html +7 -0
  1339. package/docs/api/functions/loadAgentUsageState.html +1 -0
  1340. package/docs/api/functions/loadAllSkills.html +3 -0
  1341. package/docs/api/functions/loadConfig.html +2 -0
  1342. package/docs/api/functions/loadInjectedPaths.html +2 -0
  1343. package/docs/api/functions/loadInjectedRules.html +2 -0
  1344. package/docs/api/functions/loadLearnerConfig.html +2 -0
  1345. package/docs/api/functions/loadProjectMemory.html +3 -0
  1346. package/docs/api/functions/loadSkillById.html +2 -0
  1347. package/docs/api/functions/mapDirectoryStructure.html +2 -0
  1348. package/docs/api/functions/markStoryComplete.html +2 -0
  1349. package/docs/api/functions/markStoryIncomplete.html +2 -0
  1350. package/docs/api/functions/mergeAgentConfig.html +2 -0
  1351. package/docs/api/functions/parseAxiomState.html +1 -0
  1352. package/docs/api/functions/parseContextLimitError.html +2 -0
  1353. package/docs/api/functions/parseProgress.html +2 -0
  1354. package/docs/api/functions/parseRuleFrontmatter.html +10 -0
  1355. package/docs/api/functions/parseSkillFile.html +2 -0
  1356. package/docs/api/functions/parseSlashCommand.html +2 -0
  1357. package/docs/api/functions/parseTokenLimitError.html +2 -0
  1358. package/docs/api/functions/performUpdate.html +2 -0
  1359. package/docs/api/functions/prependRecoveryThinkingPart.html +2 -0
  1360. package/docs/api/functions/prependThinkingBlock.html +1 -0
  1361. package/docs/api/functions/processAxiomBoot.html +1 -0
  1362. package/docs/api/functions/processAxiomGuards.html +1 -0
  1363. package/docs/api/functions/processBackgroundNotification.html +2 -0
  1364. package/docs/api/functions/processBackgroundNotificationHook.html +2 -0
  1365. package/docs/api/functions/processEditOutput.html +2 -0
  1366. package/docs/api/functions/processHook.html +3 -0
  1367. package/docs/api/functions/processMessageForSkills.html +2 -0
  1368. package/docs/api/functions/processOrchestratorPostTool.html +3 -0
  1369. package/docs/api/functions/processOrchestratorPreTool.html +3 -0
  1370. package/docs/api/functions/processPermissionRequest.html +2 -0
  1371. package/docs/api/functions/processPreCompact.html +6 -0
  1372. package/docs/api/functions/processProjectMemoryPreCompact.html +3 -0
  1373. package/docs/api/functions/processResponseForDetection.html +3 -0
  1374. package/docs/api/functions/processSessionEnd.html +2 -0
  1375. package/docs/api/functions/processSetup.html +2 -0
  1376. package/docs/api/functions/processSetupInit.html +2 -0
  1377. package/docs/api/functions/processSetupMaintenance.html +2 -0
  1378. package/docs/api/functions/processSlashCommand.html +2 -0
  1379. package/docs/api/functions/processSubagentStart.html +2 -0
  1380. package/docs/api/functions/processSubagentStop.html +2 -0
  1381. package/docs/api/functions/processThinkMode.html +3 -0
  1382. package/docs/api/functions/promoteLearning.html +2 -0
  1383. package/docs/api/functions/pruneOldEntries.html +2 -0
  1384. package/docs/api/functions/pruneOldStateFiles.html +2 -0
  1385. package/docs/api/functions/readActiveContext.html +1 -0
  1386. package/docs/api/functions/readAutopilotState.html +2 -0
  1387. package/docs/api/functions/readBoulderState.html +2 -0
  1388. package/docs/api/functions/readModeMarker.html +4 -0
  1389. package/docs/api/functions/readNotepad.html +2 -0
  1390. package/docs/api/functions/readPrd.html +2 -0
  1391. package/docs/api/functions/readProgress.html +2 -0
  1392. package/docs/api/functions/readProgressRaw.html +2 -0
  1393. package/docs/api/functions/readProjectDecisions.html +1 -0
  1394. package/docs/api/functions/readRalphState.html +2 -0
  1395. package/docs/api/functions/readRecoveryMessages.html +2 -0
  1396. package/docs/api/functions/readRecoveryParts.html +2 -0
  1397. package/docs/api/functions/readTrackingState.html +3 -0
  1398. package/docs/api/functions/readUltraQAState.html +2 -0
  1399. package/docs/api/functions/readUltrapilotState.html +2 -0
  1400. package/docs/api/functions/readUltraworkState.html +4 -0
  1401. package/docs/api/functions/readUserPreferences.html +1 -0
  1402. package/docs/api/functions/readVerificationState.html +3 -0
  1403. package/docs/api/functions/recordArchitectFeedback.html +2 -0
  1404. package/docs/api/functions/recordConflict.html +2 -0
  1405. package/docs/api/functions/recordFailure.html +2 -0
  1406. package/docs/api/functions/recordHookFire.html +2 -0
  1407. package/docs/api/functions/recordHookResult.html +2 -0
  1408. package/docs/api/functions/recordKeywordDetected.html +2 -0
  1409. package/docs/api/functions/recordModeChange.html +2 -0
  1410. package/docs/api/functions/recordPattern.html +2 -0
  1411. package/docs/api/functions/recordSessionMetrics.html +2 -0
  1412. package/docs/api/functions/recordSkillActivated.html +2 -0
  1413. package/docs/api/functions/recordSkillInvoked.html +2 -0
  1414. package/docs/api/functions/recordStoryProgress.html +2 -0
  1415. package/docs/api/functions/recordValidationVerdict.html +2 -0
  1416. package/docs/api/functions/registerBeadsContext.html +3 -0
  1417. package/docs/api/functions/registerProjectMemoryContext.html +6 -0
  1418. package/docs/api/functions/removeCodeBlocks.html +12 -0
  1419. package/docs/api/functions/removeModeMarker.html +5 -0
  1420. package/docs/api/functions/removeSlashCodeBlocks.html +2 -0
  1421. package/docs/api/functions/removeThinkCodeBlocks.html +2 -0
  1422. package/docs/api/functions/replaceRecoveryEmptyTextParts.html +2 -0
  1423. package/docs/api/functions/rescanProjectEnvironment.html +4 -0
  1424. package/docs/api/functions/resetSessionTokenEstimate.html +2 -0
  1425. package/docs/api/functions/resumeAutopilot.html +2 -0
  1426. package/docs/api/functions/runPreCommitChecks.html +2 -0
  1427. package/docs/api/functions/runTests.html +2 -0
  1428. package/docs/api/functions/runTypeCheck.html +2 -0
  1429. package/docs/api/functions/sanitizeMessage.html +2 -0
  1430. package/docs/api/functions/sanitizeMessages.html +2 -0
  1431. package/docs/api/functions/saveAgentUsageState.html +1 -0
  1432. package/docs/api/functions/saveInjectedPaths.html +2 -0
  1433. package/docs/api/functions/saveInjectedRules.html +2 -0
  1434. package/docs/api/functions/saveLearnerConfig.html +2 -0
  1435. package/docs/api/functions/saveModeSummary.html +2 -0
  1436. package/docs/api/functions/saveProjectMemory.html +3 -0
  1437. package/docs/api/functions/saveVersionMetadata.html +2 -0
  1438. package/docs/api/functions/setCurrentStory.html +2 -0
  1439. package/docs/api/functions/setEnvironmentVariables.html +2 -0
  1440. package/docs/api/functions/setLearnerConfigValue.html +2 -0
  1441. package/docs/api/functions/setPriorityContext.html +2 -0
  1442. package/docs/api/functions/shouldActivateThinkMode.html +3 -0
  1443. package/docs/api/functions/shouldActivateUltrathink.html +2 -0
  1444. package/docs/api/functions/shouldApplyRule.html +2 -0
  1445. package/docs/api/functions/shouldCheckForUpdates.html +2 -0
  1446. package/docs/api/functions/shouldCompleteByPrd.html +2 -0
  1447. package/docs/api/functions/shouldPromptExtraction.html +2 -0
  1448. package/docs/api/functions/shouldReinforceUltrawork.html +2 -0
  1449. package/docs/api/functions/shouldRetryValidation.html +2 -0
  1450. package/docs/api/functions/shouldRunInBackground.html +8 -0
  1451. package/docs/api/functions/spawnWorkers.html +7 -0
  1452. package/docs/api/functions/startUltraQA.html +3 -0
  1453. package/docs/api/functions/startUltrapilot.html +7 -0
  1454. package/docs/api/functions/startValidationRound.html +2 -0
  1455. package/docs/api/functions/startVerification.html +2 -0
  1456. package/docs/api/functions/startsWithThinkingBlock.html +1 -0
  1457. package/docs/api/functions/stopUltraQA.html +2 -0
  1458. package/docs/api/functions/stripRecoveryThinkingParts.html +2 -0
  1459. package/docs/api/functions/toSdkMcpFormat.html +2 -0
  1460. package/docs/api/functions/trackAccess.html +2 -0
  1461. package/docs/api/functions/trackProgress.html +5 -0
  1462. package/docs/api/functions/transitionPhase.html +2 -0
  1463. package/docs/api/functions/transitionRalphToUltraQA.html +9 -0
  1464. package/docs/api/functions/transitionToComplete.html +2 -0
  1465. package/docs/api/functions/transitionToFailed.html +2 -0
  1466. package/docs/api/functions/transitionUltraQAToValidation.html +2 -0
  1467. package/docs/api/functions/updateDirectoryAccess.html +2 -0
  1468. package/docs/api/functions/updateExecution.html +2 -0
  1469. package/docs/api/functions/updateExpansion.html +2 -0
  1470. package/docs/api/functions/updatePlanning.html +2 -0
  1471. package/docs/api/functions/updateQA.html +2 -0
  1472. package/docs/api/functions/updateValidation.html +2 -0
  1473. package/docs/api/functions/updateWorkerState.html +2 -0
  1474. package/docs/api/functions/validateAgentConfig.html +2 -0
  1475. package/docs/api/functions/validateCommitMessage.html +2 -0
  1476. package/docs/api/functions/validateConfigFiles.html +2 -0
  1477. package/docs/api/functions/validateExtractionRequest.html +2 -0
  1478. package/docs/api/functions/validateMessage.html +1 -0
  1479. package/docs/api/functions/validateMessages.html +1 -0
  1480. package/docs/api/functions/validateSkillMetadata.html +2 -0
  1481. package/docs/api/functions/writeAutopilotState.html +2 -0
  1482. package/docs/api/functions/writeBoulderState.html +2 -0
  1483. package/docs/api/functions/writePrd.html +2 -0
  1484. package/docs/api/functions/writeRalphState.html +2 -0
  1485. package/docs/api/functions/writeSkill.html +2 -0
  1486. package/docs/api/functions/writeTrackingState.html +5 -0
  1487. package/docs/api/functions/writeUltraQAState.html +2 -0
  1488. package/docs/api/functions/writeUltrapilotState.html +2 -0
  1489. package/docs/api/functions/writeUltraworkState.html +2 -0
  1490. package/docs/api/functions/writeVerificationState.html +2 -0
  1491. package/docs/api/hierarchy.html +1 -0
  1492. package/docs/api/index.html +843 -0
  1493. package/docs/api/interfaces/AgentConfig.html +18 -0
  1494. package/docs/api/interfaces/AgentOverrideConfig.html +10 -0
  1495. package/docs/api/interfaces/AgentPromptMetadata.html +19 -0
  1496. package/docs/api/interfaces/AgentState.html +5 -0
  1497. package/docs/api/interfaces/AgentUsageState.html +8 -0
  1498. package/docs/api/interfaces/AutoSlashCommandHookInput.html +5 -0
  1499. package/docs/api/interfaces/AutoSlashCommandHookOutput.html +3 -0
  1500. package/docs/api/interfaces/AutoSlashCommandResult.html +5 -0
  1501. package/docs/api/interfaces/AutopilotConfig.html +26 -0
  1502. package/docs/api/interfaces/AutopilotExecution.html +16 -0
  1503. package/docs/api/interfaces/AutopilotExpansion.html +12 -0
  1504. package/docs/api/interfaces/AutopilotPlanning.html +8 -0
  1505. package/docs/api/interfaces/AutopilotQA.html +12 -0
  1506. package/docs/api/interfaces/AutopilotResult.html +10 -0
  1507. package/docs/api/interfaces/AutopilotState.html +36 -0
  1508. package/docs/api/interfaces/AutopilotSummary.html +16 -0
  1509. package/docs/api/interfaces/AutopilotValidation.html +10 -0
  1510. package/docs/api/interfaces/AutopilotValidationResult.html +8 -0
  1511. package/docs/api/interfaces/AvailableAgent.html +5 -0
  1512. package/docs/api/interfaces/AxiomBootInput.html +3 -0
  1513. package/docs/api/interfaces/AxiomBootOutput.html +4 -0
  1514. package/docs/api/interfaces/AxiomGuardsInput.html +4 -0
  1515. package/docs/api/interfaces/AxiomGuardsOutput.html +4 -0
  1516. package/docs/api/interfaces/AxiomMemoryFiles.html +5 -0
  1517. package/docs/api/interfaces/AxiomState.html +8 -0
  1518. package/docs/api/interfaces/BackgroundNotificationHookConfig.html +11 -0
  1519. package/docs/api/interfaces/BackgroundNotificationHookInput.html +8 -0
  1520. package/docs/api/interfaces/BackgroundNotificationHookOutput.html +8 -0
  1521. package/docs/api/interfaces/BackgroundTask.html +7 -0
  1522. package/docs/api/interfaces/BackgroundTaskManager.html +26 -0
  1523. package/docs/api/interfaces/BeadsContextConfig.html +4 -0
  1524. package/docs/api/interfaces/BoulderState.html +12 -0
  1525. package/docs/api/interfaces/BuildInfo.html +6 -0
  1526. package/docs/api/interfaces/CanStartResult.html +4 -0
  1527. package/docs/api/interfaces/CancelResult.html +4 -0
  1528. package/docs/api/interfaces/ClaudeThinkingConfig.html +4 -0
  1529. package/docs/api/interfaces/CodeConventions.html +5 -0
  1530. package/docs/api/interfaces/CodebasePattern.html +5 -0
  1531. package/docs/api/interfaces/CommandInfo.html +5 -0
  1532. package/docs/api/interfaces/CommandMetadata.html +7 -0
  1533. package/docs/api/interfaces/CommentCheckResult.html +10 -0
  1534. package/docs/api/interfaces/CommentCheckerConfig.html +6 -0
  1535. package/docs/api/interfaces/CommentInfo.html +14 -0
  1536. package/docs/api/interfaces/CommentPendingCall.html +18 -0
  1537. package/docs/api/interfaces/CommitConfig.html +9 -0
  1538. package/docs/api/interfaces/CompactCheckpoint.html +7 -0
  1539. package/docs/api/interfaces/ContextEntry.html +14 -0
  1540. package/docs/api/interfaces/ContextUsageResult.html +12 -0
  1541. package/docs/api/interfaces/CustomNote.html +5 -0
  1542. package/docs/api/interfaces/DelegationDecision.html +7 -0
  1543. package/docs/api/interfaces/DelegationRoute.html +7 -0
  1544. package/docs/api/interfaces/DelegationRoutingConfig.html +5 -0
  1545. package/docs/api/interfaces/DelegationTrigger.html +6 -0
  1546. package/docs/api/interfaces/DetectedKeyword.html +13 -0
  1547. package/docs/api/interfaces/DetectionConfig.html +8 -0
  1548. package/docs/api/interfaces/DetectionResult.html +13 -0
  1549. package/docs/api/interfaces/DirectoryInfo.html +7 -0
  1550. package/docs/api/interfaces/EmptyMessageSanitizerConfig.html +6 -0
  1551. package/docs/api/interfaces/EmptyMessageSanitizerInput.html +6 -0
  1552. package/docs/api/interfaces/EmptyMessageSanitizerOutput.html +8 -0
  1553. package/docs/api/interfaces/ExecuteResult.html +5 -0
  1554. package/docs/api/interfaces/ExpandedCommand.html +4 -0
  1555. package/docs/api/interfaces/ExternalModelPreference.html +4 -0
  1556. package/docs/api/interfaces/ExternalModelsConfig.html +6 -0
  1557. package/docs/api/interfaces/ExternalModelsDefaults.html +5 -0
  1558. package/docs/api/interfaces/ExternalModelsFallbackPolicy.html +5 -0
  1559. package/docs/api/interfaces/FileOwnership.html +8 -0
  1560. package/docs/api/interfaces/FormatConfig.html +7 -0
  1561. package/docs/api/interfaces/FrameworkDetection.html +4 -0
  1562. package/docs/api/interfaces/FullAgentConfig.html +26 -0
  1563. package/docs/api/interfaces/GateCheckResult.html +5 -0
  1564. package/docs/api/interfaces/GitBranchPattern.html +3 -0
  1565. package/docs/api/interfaces/HookContext.html +5 -0
  1566. package/docs/api/interfaces/HookDefinition.html +5 -0
  1567. package/docs/api/interfaces/HookInput.html +18 -0
  1568. package/docs/api/interfaces/HookOutput.html +10 -0
  1569. package/docs/api/interfaces/HookResult.html +4 -0
  1570. package/docs/api/interfaces/HotPath.html +6 -0
  1571. package/docs/api/interfaces/InjectedPathsData.html +9 -0
  1572. package/docs/api/interfaces/InjectedRulesData.html +10 -0
  1573. package/docs/api/interfaces/InjectedSkillsData.html +8 -0
  1574. package/docs/api/interfaces/InjectionResult.html +8 -0
  1575. package/docs/api/interfaces/InstallOptions.html +9 -0
  1576. package/docs/api/interfaces/InstallResult.html +10 -0
  1577. package/docs/api/interfaces/IntegrationResult.html +14 -0
  1578. package/docs/api/interfaces/LanguageDetection.html +5 -0
  1579. package/docs/api/interfaces/LearnedSkill.html +16 -0
  1580. package/docs/api/interfaces/LearnerConfig.html +18 -0
  1581. package/docs/api/interfaces/LintConfig.html +7 -0
  1582. package/docs/api/interfaces/MagicKeyword.html +4 -0
  1583. package/docs/api/interfaces/MatchResult.html +6 -0
  1584. package/docs/api/interfaces/MessageContext.html +8 -0
  1585. package/docs/api/interfaces/MessageInfo.html +9 -0
  1586. package/docs/api/interfaces/MessagePart.html +15 -0
  1587. package/docs/api/interfaces/MessageWithModel.html +3 -0
  1588. package/docs/api/interfaces/MessageWithParts.html +6 -0
  1589. package/docs/api/interfaces/MessagesTransformHook.html +3 -0
  1590. package/docs/api/interfaces/MessagesTransformInput.html +3 -0
  1591. package/docs/api/interfaces/MessagesTransformOutput.html +3 -0
  1592. package/docs/api/interfaces/ModeConfig.html +13 -0
  1593. package/docs/api/interfaces/ModeStatus.html +4 -0
  1594. package/docs/api/interfaces/ModelRef.html +4 -0
  1595. package/docs/api/interfaces/NonInteractiveEnvConfig.html +2 -0
  1596. package/docs/api/interfaces/NotepadConfig.html +7 -0
  1597. package/docs/api/interfaces/NotepadStats.html +11 -0
  1598. package/docs/api/interfaces/NotificationCheckResult.html +8 -0
  1599. package/docs/api/interfaces/OrchestratorToolInput.html +6 -0
  1600. package/docs/api/interfaces/OrchestratorToolOutput.html +6 -0
  1601. package/docs/api/interfaces/OutputPart.html +4 -0
  1602. package/docs/api/interfaces/PRD.html +9 -0
  1603. package/docs/api/interfaces/PRDStatus.html +13 -0
  1604. package/docs/api/interfaces/ParsedSlashCommand.html +8 -0
  1605. package/docs/api/interfaces/ParsedTokenLimitError.html +16 -0
  1606. package/docs/api/interfaces/PendingContext.html +8 -0
  1607. package/docs/api/interfaces/PermissionHookOutput.html +4 -0
  1608. package/docs/api/interfaces/PermissionRequestInput.html +9 -0
  1609. package/docs/api/interfaces/PersistentModeResult.html +9 -0
  1610. package/docs/api/interfaces/PlanProgress.html +8 -0
  1611. package/docs/api/interfaces/PlanSummary.html +10 -0
  1612. package/docs/api/interfaces/PluginConfig.html +17 -0
  1613. package/docs/api/interfaces/PreCommitResult.html +3 -0
  1614. package/docs/api/interfaces/PreCompactHookOutput.html +4 -0
  1615. package/docs/api/interfaces/PreCompactInput.html +8 -0
  1616. package/docs/api/interfaces/PreemptiveCompactionConfig.html +14 -0
  1617. package/docs/api/interfaces/PriorityContextResult.html +5 -0
  1618. package/docs/api/interfaces/ProgressEntry.html +11 -0
  1619. package/docs/api/interfaces/ProgressLog.html +7 -0
  1620. package/docs/api/interfaces/ProjectMemory.html +14 -0
  1621. package/docs/api/interfaces/ProjectStructure.html +5 -0
  1622. package/docs/api/interfaces/PromotionCandidate.html +9 -0
  1623. package/docs/api/interfaces/PruneResult.html +5 -0
  1624. package/docs/api/interfaces/QualityValidation.html +10 -0
  1625. package/docs/api/interfaces/RalphLoopHook.html +4 -0
  1626. package/docs/api/interfaces/RalphLoopOptions.html +5 -0
  1627. package/docs/api/interfaces/RalphLoopState.html +21 -0
  1628. package/docs/api/interfaces/RecoveryConfig.html +16 -0
  1629. package/docs/api/interfaces/RecoveryMessageData.html +4 -0
  1630. package/docs/api/interfaces/RecoveryResult.html +10 -0
  1631. package/docs/api/interfaces/RecoveryStoredMessageMeta.html +8 -0
  1632. package/docs/api/interfaces/RecoveryStoredReasoningPart.html +7 -0
  1633. package/docs/api/interfaces/RecoveryStoredTextPart.html +9 -0
  1634. package/docs/api/interfaces/RecoveryStoredToolPart.html +9 -0
  1635. package/docs/api/interfaces/RegisterContextOptions.html +12 -0
  1636. package/docs/api/interfaces/ReleaseInfo.html +9 -0
  1637. package/docs/api/interfaces/ResolveDelegationOptions.html +7 -0
  1638. package/docs/api/interfaces/ResolveOptions.html +6 -0
  1639. package/docs/api/interfaces/ResolvedModel.html +5 -0
  1640. package/docs/api/interfaces/RetryState.html +6 -0
  1641. package/docs/api/interfaces/RuleFileCandidate.html +12 -0
  1642. package/docs/api/interfaces/RuleFrontmatterResult.html +6 -0
  1643. package/docs/api/interfaces/RuleInfo.html +18 -0
  1644. package/docs/api/interfaces/RuleMetadata.html +9 -0
  1645. package/docs/api/interfaces/RuleToInject.html +10 -0
  1646. package/docs/api/interfaces/SessionEndHookOutput.html +2 -0
  1647. package/docs/api/interfaces/SessionEndInput.html +9 -0
  1648. package/docs/api/interfaces/SessionMetrics.html +9 -0
  1649. package/docs/api/interfaces/SessionState.html +5 -0
  1650. package/docs/api/interfaces/SetupHookOutput.html +3 -0
  1651. package/docs/api/interfaces/SetupInput.html +7 -0
  1652. package/docs/api/interfaces/SetupResult.html +5 -0
  1653. package/docs/api/interfaces/ShellHook.html +4 -0
  1654. package/docs/api/interfaces/SisyphusOptions.html +14 -0
  1655. package/docs/api/interfaces/SisyphusSession.html +16 -0
  1656. package/docs/api/interfaces/SkillExtractionRequest.html +12 -0
  1657. package/docs/api/interfaces/SkillFileCandidate.html +10 -0
  1658. package/docs/api/interfaces/SkillHookContext.html +5 -0
  1659. package/docs/api/interfaces/SkillMetadata.html +22 -0
  1660. package/docs/api/interfaces/SkillParseResult.html +5 -0
  1661. package/docs/api/interfaces/SubagentHookOutput.html +3 -0
  1662. package/docs/api/interfaces/SubagentInfo.html +14 -0
  1663. package/docs/api/interfaces/SubagentStartInput.html +10 -0
  1664. package/docs/api/interfaces/SubagentStopInput.html +11 -0
  1665. package/docs/api/interfaces/SubagentTrackingState.html +6 -0
  1666. package/docs/api/interfaces/TaskExecutionDecision.html +10 -0
  1667. package/docs/api/interfaces/TechStack.html +5 -0
  1668. package/docs/api/interfaces/ThinkModeInput.html +4 -0
  1669. package/docs/api/interfaces/ThinkModeState.html +12 -0
  1670. package/docs/api/interfaces/ThinkingValidatorMessageInfo.html +6 -0
  1671. package/docs/api/interfaces/ThinkingValidatorMessagePart.html +9 -0
  1672. package/docs/api/interfaces/ThinkingValidatorMessageWithParts.html +4 -0
  1673. package/docs/api/interfaces/TodoContinuationHook.html +2 -0
  1674. package/docs/api/interfaces/TransitionResult.html +4 -0
  1675. package/docs/api/interfaces/TruncateState.html +6 -0
  1676. package/docs/api/interfaces/UltraQAOptions.html +5 -0
  1677. package/docs/api/interfaces/UltraQAResult.html +9 -0
  1678. package/docs/api/interfaces/UltraQAState.html +19 -0
  1679. package/docs/api/interfaces/UltrapilotConfig.html +14 -0
  1680. package/docs/api/interfaces/UltrapilotState.html +26 -0
  1681. package/docs/api/interfaces/UltraworkState.html +17 -0
  1682. package/docs/api/interfaces/UpdateCheckResult.html +7 -0
  1683. package/docs/api/interfaces/UpdateResult.html +7 -0
  1684. package/docs/api/interfaces/UserDirective.html +7 -0
  1685. package/docs/api/interfaces/UserStory.html +15 -0
  1686. package/docs/api/interfaces/ValidationCoordinatorResult.html +6 -0
  1687. package/docs/api/interfaces/ValidationResult.html +10 -0
  1688. package/docs/api/interfaces/VerificationState.html +17 -0
  1689. package/docs/api/interfaces/VersionMetadata.html +12 -0
  1690. package/docs/api/interfaces/WorkerState.html +24 -0
  1691. package/docs/api/interfaces/WriteSkillResult.html +6 -0
  1692. package/docs/api/media/EVOLUTION.md +605 -0
  1693. package/docs/api/media/INSTALL.md +542 -0
  1694. package/docs/api/media/MIGRATION.md +1158 -0
  1695. package/docs/api/media/NEXUS.md +562 -0
  1696. package/docs/api/media/REFERENCE.md +1222 -0
  1697. package/docs/api/media/mcp-server-usage.md +240 -0
  1698. package/docs/api/modules.html +1 -0
  1699. package/docs/api/types/AgentCategory.html +2 -0
  1700. package/docs/api/types/AgentCost.html +3 -0
  1701. package/docs/api/types/AgentFactory.html +2 -0
  1702. package/docs/api/types/AgentOverrides.html +2 -0
  1703. package/docs/api/types/AutopilotPhase.html +2 -0
  1704. package/docs/api/types/AutopilotSignal.html +2 -0
  1705. package/docs/api/types/CommandScope.html +2 -0
  1706. package/docs/api/types/ContextPriority.html +3 -0
  1707. package/docs/api/types/ContextSourceType.html +3 -0
  1708. package/docs/api/types/DelegationProvider.html +2 -0
  1709. package/docs/api/types/DelegationTool.html +2 -0
  1710. package/docs/api/types/ExecutionMode.html +3 -0
  1711. package/docs/api/types/ExternalModelProvider.html +2 -0
  1712. package/docs/api/types/GateType.html +3 -0
  1713. package/docs/api/types/InjectionStrategy.html +2 -0
  1714. package/docs/api/types/KeywordType.html +10 -0
  1715. package/docs/api/types/ModelType.html +2 -0
  1716. package/docs/api/types/QAStatus.html +2 -0
  1717. package/docs/api/types/RecoveryErrorType.html +2 -0
  1718. package/docs/api/types/RecoveryStoredPart.html +2 -0
  1719. package/docs/api/types/TaskTool.html +1 -0
  1720. package/docs/api/types/ThinkingConfig.html +2 -0
  1721. package/docs/api/types/UltraQAGoalType.html +1 -0
  1722. package/docs/api/types/UserStoryInput.html +2 -0
  1723. package/docs/api/types/ValidationVerdict.html +2 -0
  1724. package/docs/api/types/ValidationVerdictType.html +2 -0
  1725. package/docs/api/variables/AGENTS_DIR.html +1 -0
  1726. package/docs/api/variables/AGENTS_FILENAME.html +2 -0
  1727. package/docs/api/variables/AGENT_TOOLS.html +2 -0
  1728. package/docs/api/variables/ALLOWED_PATH_PREFIX.html +2 -0
  1729. package/docs/api/variables/ANALYST_PROMPT_METADATA.html +1 -0
  1730. package/docs/api/variables/ARCHITECT_PROMPT_METADATA.html +1 -0
  1731. package/docs/api/variables/AUTO_SLASH_COMMAND_HOOK_NAME.html +4 -0
  1732. package/docs/api/variables/AUTO_SLASH_COMMAND_TAG_CLOSE.html +1 -0
  1733. package/docs/api/variables/AUTO_SLASH_COMMAND_TAG_OPEN.html +2 -0
  1734. package/docs/api/variables/BACKGROUND_NOTIFICATION_HOOK_NAME.html +2 -0
  1735. package/docs/api/variables/BDD_KEYWORDS.html +2 -0
  1736. package/docs/api/variables/BEADS_INSTRUCTIONS.html +1 -0
  1737. package/docs/api/variables/BEADS_RUST_INSTRUCTIONS.html +1 -0
  1738. package/docs/api/variables/BLOCKING_PATTERNS.html +3 -0
  1739. package/docs/api/variables/BOULDER_CONTINUATION_PROMPT.html +2 -0
  1740. package/docs/api/variables/BOULDER_DIR.html +2 -0
  1741. package/docs/api/variables/BOULDER_FILE.html +2 -0
  1742. package/docs/api/variables/BOULDER_STATE_PATH.html +2 -0
  1743. package/docs/api/variables/CHARS_PER_TOKEN.html +2 -0
  1744. package/docs/api/variables/CI_COMMANDS.html +2 -0
  1745. package/docs/api/variables/CI_GATE_MESSAGE.html +1 -0
  1746. package/docs/api/variables/CLAUDE_CONFIG_DIR.html +2 -0
  1747. package/docs/api/variables/CLAUDE_DEFAULT_CONTEXT_LIMIT.html +2 -0
  1748. package/docs/api/variables/COMMANDS_DIR.html +1 -0
  1749. package/docs/api/variables/COMMENT_CHECKER_MESSAGE_HEADER.html +2 -0
  1750. package/docs/api/variables/COMPACTION_COOLDOWN_MS.html +2 -0
  1751. package/docs/api/variables/CONTENT_PART_TYPES.html +2 -0
  1752. package/docs/api/variables/CONTEXT_CRITICAL_MESSAGE.html +2 -0
  1753. package/docs/api/variables/CONTEXT_FILENAMES.html +2 -0
  1754. package/docs/api/variables/CONTEXT_LIMIT_RECOVERY_MESSAGE.html +2 -0
  1755. package/docs/api/variables/CONTEXT_LIMIT_SHORT_MESSAGE.html +2 -0
  1756. package/docs/api/variables/CONTEXT_WARNING_MESSAGE.html +2 -0
  1757. package/docs/api/variables/CRITICAL_THRESHOLD.html +2 -0
  1758. package/docs/api/variables/CRITIC_PROMPT_METADATA.html +1 -0
  1759. package/docs/api/variables/DEFAULT_CONFIG.html +2 -0
  1760. package/docs/api/variables/DEFAULT_MAX_BACKGROUND_TASKS.html +2 -0
  1761. package/docs/api/variables/DEFAULT_THINKING_CONTENT.html +2 -0
  1762. package/docs/api/variables/DIRECT_WORK_REMINDER.html +2 -0
  1763. package/docs/api/variables/DOCUMENT_SPECIALIST_PROMPT_METADATA.html +1 -0
  1764. package/docs/api/variables/DOCUMENT_WRITER_PROMPT_METADATA.html +1 -0
  1765. package/docs/api/variables/EDIT_ERROR_PATTERNS.html +2 -0
  1766. package/docs/api/variables/EDIT_ERROR_REMINDER.html +3 -0
  1767. package/docs/api/variables/EMPTY_MESSAGE_SANITIZER_DEBUG_PREFIX.html +2 -0
  1768. package/docs/api/variables/EMPTY_MESSAGE_SANITIZER_ERROR_PATTERNS.html +2 -0
  1769. package/docs/api/variables/EMPTY_MESSAGE_SANITIZER_HOOK_NAME.html +2 -0
  1770. package/docs/api/variables/ENTRY_SEPARATOR.html +1 -0
  1771. package/docs/api/variables/EXCLUDED_COMMANDS.html +3 -0
  1772. package/docs/api/variables/EXPERT_GATE_MESSAGE.html +1 -0
  1773. package/docs/api/variables/EXPLORE_PROMPT_METADATA.html +1 -0
  1774. package/docs/api/variables/EXTENSION_TO_LANGUAGE.html +2 -0
  1775. package/docs/api/variables/FEATURE_FLAG_KEY.html +2 -0
  1776. package/docs/api/variables/FRONTEND_ENGINEER_PROMPT_METADATA.html +1 -0
  1777. package/docs/api/variables/GITHUB_API_URL.html +1 -0
  1778. package/docs/api/variables/INSTALLER_CLAUDE_CONFIG_DIR.html +2 -0
  1779. package/docs/api/variables/INSTALLER_VERSION.html +2 -0
  1780. package/docs/api/variables/LINE_COMMENT_PATTERNS.html +2 -0
  1781. package/docs/api/variables/LONG_RUNNING_PATTERNS.html +3 -0
  1782. package/docs/api/variables/MANUAL_HEADER.html +1 -0
  1783. package/docs/api/variables/MAX_SKILLS_PER_SESSION.html +2 -0
  1784. package/docs/api/variables/MAX_SKILL_CONTENT_LENGTH.html +2 -0
  1785. package/docs/api/variables/MAX_WARNINGS.html +2 -0
  1786. package/docs/api/variables/MIN_QUALITY_SCORE.html +2 -0
  1787. package/docs/api/variables/MODE_CONFIGS.html +4 -0
  1788. package/docs/api/variables/MULTIMODAL_LOOKER_PROMPT_METADATA.html +1 -0
  1789. package/docs/api/variables/NON_EMPTY_CONTENT_RECOVERY_MESSAGE.html +2 -0
  1790. package/docs/api/variables/NON_INTERACTIVE_ENV.html +1 -0
  1791. package/docs/api/variables/NON_INTERACTIVE_ENV_HOOK_NAME.html +1 -0
  1792. package/docs/api/variables/NOTEPAD_BASE_PATH.html +2 -0
  1793. package/docs/api/variables/NOTEPAD_DEFAULT_CONFIG.html +1 -0
  1794. package/docs/api/variables/NOTEPAD_DIR.html +2 -0
  1795. package/docs/api/variables/NOTEPAD_FILENAME.html +1 -0
  1796. package/docs/api/variables/OMC_ORCHESTRATOR_HOOK_NAME.html +4 -0
  1797. package/docs/api/variables/ORCHESTRATOR_DELEGATION_REQUIRED.html +2 -0
  1798. package/docs/api/variables/PATTERNS_HEADER.html +1 -0
  1799. package/docs/api/variables/PLACEHOLDER_TEXT.html +3 -0
  1800. package/docs/api/variables/PLANNER_PLANS_DIR.html +2 -0
  1801. package/docs/api/variables/PLANNER_PROMPT_METADATA.html +1 -0
  1802. package/docs/api/variables/PLAN_EXTENSION.html +2 -0
  1803. package/docs/api/variables/PRD_EXAMPLE_FILENAME.html +1 -0
  1804. package/docs/api/variables/PRD_FILENAME.html +1 -0
  1805. package/docs/api/variables/PREEMPTIVE_DEFAULT_THRESHOLD.html +2 -0
  1806. package/docs/api/variables/PREVENTED_ERROR.html +2 -0
  1807. package/docs/api/variables/PRIORITY_HEADER.html +1 -0
  1808. package/docs/api/variables/PROGRESS_FILENAME.html +1 -0
  1809. package/docs/api/variables/PROJECT_MARKERS.html +2 -0
  1810. package/docs/api/variables/PROJECT_RULE_FILES.html +2 -0
  1811. package/docs/api/variables/PROJECT_RULE_SUBDIRS.html +2 -0
  1812. package/docs/api/variables/PROJECT_SKILLS_SUBDIR.html +2 -0
  1813. package/docs/api/variables/RAPID_FIRE_DEBOUNCE_MS.html +7 -0
  1814. package/docs/api/variables/README_FILENAME.html +2 -0
  1815. package/docs/api/variables/README_INJECTOR_STORAGE.html +1 -0
  1816. package/docs/api/variables/README_TRACKED_TOOLS.html +2 -0
  1817. package/docs/api/variables/RECOVERY_FAILED_MESSAGE.html +2 -0
  1818. package/docs/api/variables/RECOVERY_MESSAGES.html +2 -0
  1819. package/docs/api/variables/RECOVERY_PLACEHOLDER_TEXT.html +2 -0
  1820. package/docs/api/variables/REMINDER_MESSAGE.html +2 -0
  1821. package/docs/api/variables/REPO_NAME.html +1 -0
  1822. package/docs/api/variables/REPO_OWNER.html +2 -0
  1823. package/docs/api/variables/RETRY_CONFIG.html +6 -0
  1824. package/docs/api/variables/RULES_INJECTOR_STORAGE.html +1 -0
  1825. package/docs/api/variables/RULE_EXTENSIONS.html +2 -0
  1826. package/docs/api/variables/SHELL_COMMAND_PATTERNS.html +3 -0
  1827. package/docs/api/variables/SINGLE_TASK_DIRECTIVE.html +2 -0
  1828. package/docs/api/variables/SISYPHUS_JUNIOR_PROMPT_METADATA.html +1 -0
  1829. package/docs/api/variables/SKILL_EXTENSION.html +2 -0
  1830. package/docs/api/variables/SLASH_COMMAND_PATTERN.html +2 -0
  1831. package/docs/api/variables/STALE_STATE_MAX_AGE_MS.html +2 -0
  1832. package/docs/api/variables/SYNTHETIC_THINKING_ID_PREFIX.html +2 -0
  1833. package/docs/api/variables/TARGET_TOOLS.html +2 -0
  1834. package/docs/api/variables/THINKING_BLOCK_VALIDATOR_HOOK_NAME.html +2 -0
  1835. package/docs/api/variables/THINKING_CONFIGS.html +2 -0
  1836. package/docs/api/variables/THINKING_MODEL_PATTERNS.html +3 -0
  1837. package/docs/api/variables/THINKING_PART_TYPES.html +2 -0
  1838. package/docs/api/variables/TOKEN_LIMIT_KEYWORDS.html +2 -0
  1839. package/docs/api/variables/TOKEN_LIMIT_PATTERNS.html +2 -0
  1840. package/docs/api/variables/TOOL_PART_TYPES.html +2 -0
  1841. package/docs/api/variables/TRACKED_TOOLS.html +2 -0
  1842. package/docs/api/variables/TRUNCATE_CONFIG.html +6 -0
  1843. package/docs/api/variables/TRUNCATION_APPLIED_MESSAGE.html +2 -0
  1844. package/docs/api/variables/TYPE_CHECKER_PREFIXES.html +2 -0
  1845. package/docs/api/variables/ULTRAPILOT_DEFAULT_CONFIG.html +2 -0
  1846. package/docs/api/variables/USER_GATE_MESSAGE.html +1 -0
  1847. package/docs/api/variables/USER_RULE_DIR.html +2 -0
  1848. package/docs/api/variables/USER_SKILLS_DIR.html +2 -0
  1849. package/docs/api/variables/VERIFICATION_REMINDER.html +2 -0
  1850. package/docs/api/variables/VERSION_FILE.html +1 -0
  1851. package/docs/api/variables/WORKING_MEMORY_HEADER.html +1 -0
  1852. package/docs/api/variables/WRITE_EDIT_TOOLS.html +2 -0
  1853. package/docs/api/variables/allCustomTools.html +3 -0
  1854. package/docs/api/variables/analystAgent.html +1 -0
  1855. package/docs/api/variables/architectAgent.html +1 -0
  1856. package/docs/api/variables/astTools.html +2 -0
  1857. package/docs/api/variables/contextCollector.html +2 -0
  1858. package/docs/api/variables/criticAgent.html +1 -0
  1859. package/docs/api/variables/designerAgent.html +1 -0
  1860. package/docs/api/variables/executorAgent.html +1 -0
  1861. package/docs/api/variables/exploreAgent.html +1 -0
  1862. package/docs/api/variables/lspTools.html +2 -0
  1863. package/docs/api/variables/nonInteractiveEnvHook.html +8 -0
  1864. package/docs/api/variables/omcSystemPrompt.html +2 -0
  1865. package/docs/api/variables/omcToolNames.html +3 -0
  1866. package/docs/api/variables/omcToolsServer.html +4 -0
  1867. package/docs/api/variables/plannerAgent.html +1 -0
  1868. package/docs/api/variables/researcherAgent.html +1 -0
  1869. package/docs/api/variables/visionAgent.html +1 -0
  1870. package/docs/api/variables/writerAgent.html +1 -0
  1871. package/docs/features/.gitkeep +0 -0
  1872. package/docs/getting-started/.gitkeep +0 -0
  1873. package/docs/getting-started/concepts.md +103 -0
  1874. package/docs/getting-started/installation.md +100 -0
  1875. package/docs/getting-started/quickstart.md +96 -0
  1876. package/docs/guides/.gitkeep +0 -0
  1877. package/docs/guides/mcp-server-usage.md +240 -0
  1878. package/docs/guides/task-templates-guide.md +153 -0
  1879. package/docs/guides/tool-name-migration.md +97 -0
  1880. package/docs/guides/troubleshooting-guide.md +110 -0
  1881. package/docs/guides/v5.5.13-new-features.md +234 -0
  1882. package/docs/guides/wizard-user-guide.md +85 -0
  1883. package/docs/guides/workflow-recommendation-guide.md +97 -0
  1884. package/docs/mcp/README.md +82 -0
  1885. package/docs/mcp/client-guide.md +337 -0
  1886. package/docs/mcp/configuration.md +292 -0
  1887. package/docs/mcp/overview.md +204 -0
  1888. package/docs/mcp/performance.md +300 -0
  1889. package/docs/mcp/server-guide.md +300 -0
  1890. package/docs/mcp-compatibility-matrix.md +52 -0
  1891. package/docs/plans/2026-03-02-docs-comprehensive-update-design.md +187 -0
  1892. package/docs/plans/2026-03-02-docs-comprehensive-update.md +1395 -0
  1893. package/docs/plans/2026-03-05-mcp-adoption-atomic-tasks.md +1436 -0
  1894. package/docs/plans/2026-03-05-mcp-adoption-plan.md +531 -0
  1895. package/docs/prd/documentation-system-draft.md +227 -0
  1896. package/docs/prd/documentation-system-rough.md +515 -0
  1897. package/docs/prd/memory-evolution-optimize-rough.md +508 -0
  1898. package/docs/prd/user_guide-rough.md +636 -0
  1899. package/docs/reviews/documentation-system/review_critic.md +312 -0
  1900. package/docs/reviews/documentation-system/review_domain.md +390 -0
  1901. package/docs/reviews/documentation-system/review_product.md +151 -0
  1902. package/docs/reviews/documentation-system/review_tech.md +236 -0
  1903. package/docs/reviews/documentation-system/review_ux.md +213 -0
  1904. package/docs/reviews/documentation-system/summary.md +149 -0
  1905. package/docs/reviews/draft-prd-agent-observability/review_critic.md +71 -0
  1906. package/docs/reviews/draft-prd-agent-observability/review_domain.md +100 -0
  1907. package/docs/reviews/draft-prd-agent-observability/review_product.md +78 -0
  1908. package/docs/reviews/draft-prd-agent-observability/review_tech.md +66 -0
  1909. package/docs/reviews/draft-prd-agent-observability/review_ux.md +70 -0
  1910. package/docs/reviews/draft-prd-agent-observability/rough_prd.md +135 -0
  1911. package/docs/reviews/draft-prd-memory-evolution-optimize/review_critic.md +302 -0
  1912. package/docs/reviews/draft-prd-memory-evolution-optimize/review_domain.md +237 -0
  1913. package/docs/reviews/draft-prd-memory-evolution-optimize/review_product.md +140 -0
  1914. package/docs/reviews/draft-prd-memory-evolution-optimize/review_tech.md +240 -0
  1915. package/docs/reviews/draft-prd-memory-evolution-optimize/review_ux.md +121 -0
  1916. package/docs/reviews/draft-prd-three-directions/review_product.md +103 -0
  1917. package/docs/reviews/draft-prd-three-directions/review_tech.md +135 -0
  1918. package/docs/reviews/draft-prd-three-directions/review_ux.md +88 -0
  1919. package/docs/reviews/memory-evolution-optimize/summary.md +94 -0
  1920. package/docs/reviews/ultrapower-security/review_critic.md +450 -0
  1921. package/docs/reviews/ultrapower-tech-review/review_tech.md +180 -0
  1922. package/docs/reviews/user_guide/summary.md +129 -0
  1923. package/docs/standards/AGENTS.md +1 -1
  1924. package/docs/standards/README.md +3 -3
  1925. package/docs/standards/agent-lifecycle.md +80 -1
  1926. package/docs/standards/anti-patterns.md +1 -1
  1927. package/docs/standards/audit-report.md +2 -2
  1928. package/docs/standards/contribution-guide.md +67 -41
  1929. package/docs/standards/hook-execution-order.md +1 -1
  1930. package/docs/standards/runtime-protection.md +42 -1
  1931. package/docs/standards/state-machine.md +1 -1
  1932. package/docs/standards/user-guide.md +54 -1
  1933. package/docs/tasks/documentation-system/implementation-plan.md +292 -0
  1934. package/docs/tasks/documentation-system/manifest.md +425 -0
  1935. package/docs/tasks/memory-evolution-optimize/manifest.md +475 -0
  1936. package/docs/tasks/user_guide/manifest.md +333 -0
  1937. package/docs/troubleshooting/agent-timeouts.md +37 -0
  1938. package/docs/troubleshooting/common-errors.md +37 -0
  1939. package/docs/troubleshooting/hook-failures.md +29 -0
  1940. package/docs/troubleshooting/performance-issues.md +41 -0
  1941. package/docs/troubleshooting/state-corruption.md +36 -0
  1942. package/docs/troubleshooting/tool-name-length-error.md +57 -0
  1943. package/docs/troubleshooting.md +621 -0
  1944. package/package.json +4 -2
  1945. package/scripts/analyze-dependencies.ts +47 -0
  1946. package/scripts/analyze-hook-coverage.ts +55 -0
  1947. package/scripts/bump-version.mjs +14 -10
  1948. package/scripts/measure-memory.mjs +11 -0
  1949. package/scripts/memory-stress-test.mjs +39 -0
  1950. package/scripts/migrate-tool-names.js +100 -0
  1951. package/scripts/parallel-build.mjs +15 -0
  1952. package/scripts/performance-regression.ts +28 -0
  1953. package/scripts/plugin-setup.mjs +117 -1
  1954. package/scripts/profiling.ts +95 -0
  1955. package/scripts/release-steps.mjs +10 -4
  1956. package/scripts/run-profiling.ts +64 -0
  1957. package/scripts/test-parallel-execution.ts +72 -0
  1958. package/scripts/test-race-detection.ts +57 -0
  1959. package/scripts/test-tiered-writer.ts +60 -0
  1960. package/scripts/test-wal-integration.ts +29 -0
  1961. package/scripts/test-wal.ts +48 -0
  1962. package/scripts/verify-all.sh +122 -0
  1963. package/scripts/verify-install.sh +89 -0
  1964. package/skills/AGENTS.md +98 -28
  1965. package/skills/ax-evolve/SKILL.md +11 -1
  1966. package/skills/ax-export/SKILL.md +7 -8
  1967. package/skills/ax-knowledge/AGENTS.md +27 -2
  1968. package/skills/ax-knowledge/SKILL.md +39 -7
  1969. package/skills/ax-reflect/SKILL.md +2 -0
  1970. package/skills/ax-status/SKILL.md +34 -1
  1971. package/skills/executing-plans/SKILL.md +4 -4
  1972. package/skills/next-step-router/SKILL.md +17 -0
  1973. package/skills/release/SKILL.md +42 -0
  1974. package/skills/requesting-code-review/SKILL.md +3 -3
  1975. package/skills/subagent-driven-development/SKILL.md +8 -8
  1976. package/skills/subagent-driven-development/code-quality-reviewer-prompt.md +1 -1
  1977. package/skills/systematic-debugging/SKILL.md +3 -3
  1978. package/skills/trace/SKILL.md +41 -0
  1979. package/skills/wizard/SKILL.md +103 -72
  1980. package/skills/writing-plans/SKILL.md +3 -3
  1981. package/skills/writing-skills/SKILL.md +4 -4
  1982. package/skills/writing-skills/testing-skills-with-subagents.md +1 -1
  1983. package/templates/tasks/README.md +45 -0
  1984. package/templates/tasks/bug-fix.md +37 -0
  1985. package/templates/tasks/code-review.md +36 -0
  1986. package/templates/tasks/feature-development.md +43 -0
  1987. package/templates/tasks/refactoring.md +37 -0
  1988. package/templates/tasks/security-audit.md +37 -0
  1989. package/docs/prd/ultrapower-standards-draft.md +0 -191
  1990. package/docs/prd/ultrapower-standards-rough.md +0 -560
  1991. package/docs/reviews/draft-prd-ultrapower-pain-fix/review_tech.md +0 -219
  1992. package/docs/reviews/draft_prd_pain_points/review_domain.md +0 -215
  1993. package/docs/reviews/ultrapower-full-bugfix-plan/review_product.md +0 -135
@@ -2245,8 +2245,8 @@ var require_resolve = __commonJS({
2245
2245
  }
2246
2246
  return count;
2247
2247
  }
2248
- function getFullPath(resolver, id = "", normalize2) {
2249
- if (normalize2 !== false)
2248
+ function getFullPath(resolver, id = "", normalize6) {
2249
+ if (normalize6 !== false)
2250
2250
  id = normalizeId(id);
2251
2251
  const p = resolver.parse(id);
2252
2252
  return _getFullPath(resolver, p);
@@ -2994,7 +2994,7 @@ var require_compile = __commonJS({
2994
2994
  const schOrFunc = root.refs[ref];
2995
2995
  if (schOrFunc)
2996
2996
  return schOrFunc;
2997
- let _sch = resolve5.call(this, root, ref);
2997
+ let _sch = resolve6.call(this, root, ref);
2998
2998
  if (_sch === void 0) {
2999
2999
  const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
3000
3000
  const { schemaId } = this.opts;
@@ -3021,7 +3021,7 @@ var require_compile = __commonJS({
3021
3021
  function sameSchemaEnv(s1, s2) {
3022
3022
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
3023
3023
  }
3024
- function resolve5(root, ref) {
3024
+ function resolve6(root, ref) {
3025
3025
  let sch;
3026
3026
  while (typeof (sch = this.refs[ref]) == "string")
3027
3027
  ref = sch;
@@ -3236,8 +3236,8 @@ var require_utils = __commonJS({
3236
3236
  }
3237
3237
  return ind;
3238
3238
  }
3239
- function removeDotSegments(path10) {
3240
- let input = path10;
3239
+ function removeDotSegments(path12) {
3240
+ let input = path12;
3241
3241
  const output = [];
3242
3242
  let nextSlash = -1;
3243
3243
  let len = 0;
@@ -3436,8 +3436,8 @@ var require_schemes = __commonJS({
3436
3436
  wsComponent.secure = void 0;
3437
3437
  }
3438
3438
  if (wsComponent.resourceName) {
3439
- const [path10, query] = wsComponent.resourceName.split("?");
3440
- wsComponent.path = path10 && path10 !== "/" ? path10 : void 0;
3439
+ const [path12, query] = wsComponent.resourceName.split("?");
3440
+ wsComponent.path = path12 && path12 !== "/" ? path12 : void 0;
3441
3441
  wsComponent.query = query;
3442
3442
  wsComponent.resourceName = void 0;
3443
3443
  }
@@ -3586,7 +3586,7 @@ var require_fast_uri = __commonJS({
3586
3586
  "use strict";
3587
3587
  var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
3588
3588
  var { SCHEMES, getSchemeHandler } = require_schemes();
3589
- function normalize2(uri, options) {
3589
+ function normalize6(uri, options) {
3590
3590
  if (typeof uri === "string") {
3591
3591
  uri = /** @type {T} */
3592
3592
  serialize(parse5(uri, options), options);
@@ -3596,55 +3596,55 @@ var require_fast_uri = __commonJS({
3596
3596
  }
3597
3597
  return uri;
3598
3598
  }
3599
- function resolve5(baseURI, relativeURI, options) {
3599
+ function resolve6(baseURI, relativeURI, options) {
3600
3600
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
3601
3601
  const resolved = resolveComponent(parse5(baseURI, schemelessOptions), parse5(relativeURI, schemelessOptions), schemelessOptions, true);
3602
3602
  schemelessOptions.skipEscape = true;
3603
3603
  return serialize(resolved, schemelessOptions);
3604
3604
  }
3605
- function resolveComponent(base, relative3, options, skipNormalization) {
3605
+ function resolveComponent(base, relative4, options, skipNormalization) {
3606
3606
  const target = {};
3607
3607
  if (!skipNormalization) {
3608
3608
  base = parse5(serialize(base, options), options);
3609
- relative3 = parse5(serialize(relative3, options), options);
3609
+ relative4 = parse5(serialize(relative4, options), options);
3610
3610
  }
3611
3611
  options = options || {};
3612
- if (!options.tolerant && relative3.scheme) {
3613
- target.scheme = relative3.scheme;
3614
- target.userinfo = relative3.userinfo;
3615
- target.host = relative3.host;
3616
- target.port = relative3.port;
3617
- target.path = removeDotSegments(relative3.path || "");
3618
- target.query = relative3.query;
3612
+ if (!options.tolerant && relative4.scheme) {
3613
+ target.scheme = relative4.scheme;
3614
+ target.userinfo = relative4.userinfo;
3615
+ target.host = relative4.host;
3616
+ target.port = relative4.port;
3617
+ target.path = removeDotSegments(relative4.path || "");
3618
+ target.query = relative4.query;
3619
3619
  } else {
3620
- if (relative3.userinfo !== void 0 || relative3.host !== void 0 || relative3.port !== void 0) {
3621
- target.userinfo = relative3.userinfo;
3622
- target.host = relative3.host;
3623
- target.port = relative3.port;
3624
- target.path = removeDotSegments(relative3.path || "");
3625
- target.query = relative3.query;
3620
+ if (relative4.userinfo !== void 0 || relative4.host !== void 0 || relative4.port !== void 0) {
3621
+ target.userinfo = relative4.userinfo;
3622
+ target.host = relative4.host;
3623
+ target.port = relative4.port;
3624
+ target.path = removeDotSegments(relative4.path || "");
3625
+ target.query = relative4.query;
3626
3626
  } else {
3627
- if (!relative3.path) {
3627
+ if (!relative4.path) {
3628
3628
  target.path = base.path;
3629
- if (relative3.query !== void 0) {
3630
- target.query = relative3.query;
3629
+ if (relative4.query !== void 0) {
3630
+ target.query = relative4.query;
3631
3631
  } else {
3632
3632
  target.query = base.query;
3633
3633
  }
3634
3634
  } else {
3635
- if (relative3.path[0] === "/") {
3636
- target.path = removeDotSegments(relative3.path);
3635
+ if (relative4.path[0] === "/") {
3636
+ target.path = removeDotSegments(relative4.path);
3637
3637
  } else {
3638
3638
  if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
3639
- target.path = "/" + relative3.path;
3639
+ target.path = "/" + relative4.path;
3640
3640
  } else if (!base.path) {
3641
- target.path = relative3.path;
3641
+ target.path = relative4.path;
3642
3642
  } else {
3643
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative3.path;
3643
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative4.path;
3644
3644
  }
3645
3645
  target.path = removeDotSegments(target.path);
3646
3646
  }
3647
- target.query = relative3.query;
3647
+ target.query = relative4.query;
3648
3648
  }
3649
3649
  target.userinfo = base.userinfo;
3650
3650
  target.host = base.host;
@@ -3652,7 +3652,7 @@ var require_fast_uri = __commonJS({
3652
3652
  }
3653
3653
  target.scheme = base.scheme;
3654
3654
  }
3655
- target.fragment = relative3.fragment;
3655
+ target.fragment = relative4.fragment;
3656
3656
  return target;
3657
3657
  }
3658
3658
  function equal(uriA, uriB, options) {
@@ -3822,8 +3822,8 @@ var require_fast_uri = __commonJS({
3822
3822
  }
3823
3823
  var fastUri = {
3824
3824
  SCHEMES,
3825
- normalize: normalize2,
3826
- resolve: resolve5,
3825
+ normalize: normalize6,
3826
+ resolve: resolve6,
3827
3827
  resolveComponent,
3828
3828
  equal,
3829
3829
  serialize,
@@ -6799,12 +6799,12 @@ var require_dist = __commonJS({
6799
6799
  throw new Error(`Unknown format "${name}"`);
6800
6800
  return f;
6801
6801
  };
6802
- function addFormats(ajv, list, fs8, exportName) {
6802
+ function addFormats(ajv, list, fs10, exportName) {
6803
6803
  var _a;
6804
6804
  var _b;
6805
6805
  (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
6806
6806
  for (const f of list)
6807
- ajv.addFormat(f, fs8[f]);
6807
+ ajv.addFormat(f, fs10[f]);
6808
6808
  }
6809
6809
  module2.exports = exports2 = formatsPlugin;
6810
6810
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -7290,8 +7290,8 @@ function getErrorMap() {
7290
7290
 
7291
7291
  // node_modules/zod/v3/helpers/parseUtil.js
7292
7292
  var makeIssue = (params) => {
7293
- const { data, path: path10, errorMaps, issueData } = params;
7294
- const fullPath = [...path10, ...issueData.path || []];
7293
+ const { data, path: path12, errorMaps, issueData } = params;
7294
+ const fullPath = [...path12, ...issueData.path || []];
7295
7295
  const fullIssue = {
7296
7296
  ...issueData,
7297
7297
  path: fullPath
@@ -7407,11 +7407,11 @@ var errorUtil;
7407
7407
 
7408
7408
  // node_modules/zod/v3/types.js
7409
7409
  var ParseInputLazyPath = class {
7410
- constructor(parent, value, path10, key) {
7410
+ constructor(parent, value, path12, key) {
7411
7411
  this._cachedPath = [];
7412
7412
  this.parent = parent;
7413
7413
  this.data = value;
7414
- this._path = path10;
7414
+ this._path = path12;
7415
7415
  this._key = key;
7416
7416
  }
7417
7417
  get path() {
@@ -11048,15 +11048,15 @@ function assignProp(target, prop, value) {
11048
11048
  configurable: true
11049
11049
  });
11050
11050
  }
11051
- function getElementAtPath(obj, path10) {
11052
- if (!path10)
11051
+ function getElementAtPath(obj, path12) {
11052
+ if (!path12)
11053
11053
  return obj;
11054
- return path10.reduce((acc, key) => acc?.[key], obj);
11054
+ return path12.reduce((acc, key) => acc?.[key], obj);
11055
11055
  }
11056
11056
  function promiseAllObject(promisesObj) {
11057
11057
  const keys = Object.keys(promisesObj);
11058
- const promises = keys.map((key) => promisesObj[key]);
11059
- return Promise.all(promises).then((results) => {
11058
+ const promises2 = keys.map((key) => promisesObj[key]);
11059
+ return Promise.all(promises2).then((results) => {
11060
11060
  const resolvedObj = {};
11061
11061
  for (let i = 0; i < keys.length; i++) {
11062
11062
  resolvedObj[keys[i]] = results[i];
@@ -11371,11 +11371,11 @@ function aborted(x, startIndex = 0) {
11371
11371
  }
11372
11372
  return false;
11373
11373
  }
11374
- function prefixIssues(path10, issues) {
11374
+ function prefixIssues(path12, issues) {
11375
11375
  return issues.map((iss) => {
11376
11376
  var _a;
11377
11377
  (_a = iss).path ?? (_a.path = []);
11378
- iss.path.unshift(path10);
11378
+ iss.path.unshift(path12);
11379
11379
  return iss;
11380
11380
  });
11381
11381
  }
@@ -16674,7 +16674,7 @@ var Protocol = class {
16674
16674
  return;
16675
16675
  }
16676
16676
  const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1e3;
16677
- await new Promise((resolve5) => setTimeout(resolve5, pollInterval));
16677
+ await new Promise((resolve6) => setTimeout(resolve6, pollInterval));
16678
16678
  options?.signal?.throwIfAborted();
16679
16679
  }
16680
16680
  } catch (error2) {
@@ -16691,7 +16691,7 @@ var Protocol = class {
16691
16691
  */
16692
16692
  request(request, resultSchema, options) {
16693
16693
  const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
16694
- return new Promise((resolve5, reject) => {
16694
+ return new Promise((resolve6, reject) => {
16695
16695
  const earlyReject = (error2) => {
16696
16696
  reject(error2);
16697
16697
  };
@@ -16769,7 +16769,7 @@ var Protocol = class {
16769
16769
  if (!parseResult.success) {
16770
16770
  reject(parseResult.error);
16771
16771
  } else {
16772
- resolve5(parseResult.data);
16772
+ resolve6(parseResult.data);
16773
16773
  }
16774
16774
  } catch (error2) {
16775
16775
  reject(error2);
@@ -17030,12 +17030,12 @@ var Protocol = class {
17030
17030
  }
17031
17031
  } catch {
17032
17032
  }
17033
- return new Promise((resolve5, reject) => {
17033
+ return new Promise((resolve6, reject) => {
17034
17034
  if (signal.aborted) {
17035
17035
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
17036
17036
  return;
17037
17037
  }
17038
- const timeoutId = setTimeout(resolve5, interval);
17038
+ const timeoutId = setTimeout(resolve6, interval);
17039
17039
  signal.addEventListener("abort", () => {
17040
17040
  clearTimeout(timeoutId);
17041
17041
  reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
@@ -17764,12 +17764,12 @@ var StdioServerTransport = class {
17764
17764
  this.onclose?.();
17765
17765
  }
17766
17766
  send(message) {
17767
- return new Promise((resolve5) => {
17767
+ return new Promise((resolve6) => {
17768
17768
  const json = serializeMessage(message);
17769
17769
  if (this._stdout.write(json)) {
17770
- resolve5();
17770
+ resolve6();
17771
17771
  } else {
17772
- this._stdout.once("drain", resolve5);
17772
+ this._stdout.once("drain", resolve6);
17773
17773
  }
17774
17774
  });
17775
17775
  }
@@ -17972,7 +17972,7 @@ var LspClient = class {
17972
17972
  Install with: ${this.serverConfig.installHint}`
17973
17973
  );
17974
17974
  }
17975
- return new Promise((resolve5, reject) => {
17975
+ return new Promise((resolve6, reject) => {
17976
17976
  this.process = (0, import_child_process2.spawn)(this.serverConfig.command, this.serverConfig.args, {
17977
17977
  cwd: this.workspaceRoot,
17978
17978
  stdio: ["pipe", "pipe", "pipe"],
@@ -17998,7 +17998,7 @@ Install with: ${this.serverConfig.installHint}`
17998
17998
  });
17999
17999
  this.initialize().then(() => {
18000
18000
  this.initialized = true;
18001
- resolve5();
18001
+ resolve6();
18002
18002
  }).catch(reject);
18003
18003
  });
18004
18004
  }
@@ -18106,13 +18106,13 @@ Install with: ${this.serverConfig.installHint}`
18106
18106
  const message = `Content-Length: ${Buffer.byteLength(content)}\r
18107
18107
  \r
18108
18108
  ${content}`;
18109
- return new Promise((resolve5, reject) => {
18109
+ return new Promise((resolve6, reject) => {
18110
18110
  const timeoutHandle = setTimeout(() => {
18111
18111
  this.pendingRequests.delete(id);
18112
18112
  reject(new Error(`LSP request '${method}' timed out after ${timeout}ms`));
18113
18113
  }, timeout);
18114
18114
  this.pendingRequests.set(id, {
18115
- resolve: resolve5,
18115
+ resolve: resolve6,
18116
18116
  reject,
18117
18117
  timeout: timeoutHandle
18118
18118
  });
@@ -18181,7 +18181,7 @@ ${content}`;
18181
18181
  }
18182
18182
  });
18183
18183
  this.openDocuments.add(uri);
18184
- await new Promise((resolve5) => setTimeout(resolve5, 100));
18184
+ await new Promise((resolve6) => setTimeout(resolve6, 100));
18185
18185
  }
18186
18186
  /**
18187
18187
  * Close a document
@@ -18347,8 +18347,46 @@ var LspClientManager = class {
18347
18347
  lastUsed = /* @__PURE__ */ new Map();
18348
18348
  inFlightCount = /* @__PURE__ */ new Map();
18349
18349
  idleTimer = null;
18350
+ warmupPromises = /* @__PURE__ */ new Map();
18351
+ symbolCache = /* @__PURE__ */ new Map();
18350
18352
  constructor() {
18351
18353
  this.startIdleCheck();
18354
+ this.warmupCommonServers();
18355
+ }
18356
+ /**
18357
+ * Warmup common language servers in background
18358
+ */
18359
+ warmupCommonServers() {
18360
+ const cwd = process.cwd();
18361
+ const commonServers = ["typescript", "python"];
18362
+ for (const serverKey of commonServers) {
18363
+ const config2 = getServerForFile(`.${serverKey === "typescript" ? "ts" : "py"}`);
18364
+ if (config2 && commandExists(config2.command)) {
18365
+ const key = `${cwd}:${config2.command}`;
18366
+ const warmup = (async () => {
18367
+ try {
18368
+ const client = new LspClient(cwd, config2);
18369
+ await client.connect();
18370
+ this.clients.set(key, client);
18371
+ this.lastUsed.set(key, Date.now());
18372
+ const symbols = await client.workspaceSymbols("");
18373
+ this.symbolCache.set(key, { symbols, timestamp: Date.now() });
18374
+ } catch {
18375
+ }
18376
+ })();
18377
+ this.warmupPromises.set(key, warmup);
18378
+ }
18379
+ }
18380
+ }
18381
+ /**
18382
+ * Get cached workspace symbols if available
18383
+ */
18384
+ getCachedSymbols(key) {
18385
+ const cached2 = this.symbolCache.get(key);
18386
+ if (cached2 && Date.now() - cached2.timestamp < 3e5) {
18387
+ return cached2.symbols;
18388
+ }
18389
+ return null;
18352
18390
  }
18353
18391
  /**
18354
18392
  * Get or create a client for a file
@@ -18360,6 +18398,11 @@ var LspClientManager = class {
18360
18398
  }
18361
18399
  const workspaceRoot = this.findWorkspaceRoot(filePath);
18362
18400
  const key = `${workspaceRoot}:${serverConfig.command}`;
18401
+ const warmup = this.warmupPromises.get(key);
18402
+ if (warmup) {
18403
+ await warmup;
18404
+ this.warmupPromises.delete(key);
18405
+ }
18363
18406
  let client = this.clients.get(key);
18364
18407
  if (!client) {
18365
18408
  client = new LspClient(workspaceRoot, serverConfig);
@@ -18381,6 +18424,11 @@ var LspClientManager = class {
18381
18424
  }
18382
18425
  const workspaceRoot = this.findWorkspaceRoot(filePath);
18383
18426
  const key = `${workspaceRoot}:${serverConfig.command}`;
18427
+ const warmup = this.warmupPromises.get(key);
18428
+ if (warmup) {
18429
+ await warmup;
18430
+ this.warmupPromises.delete(key);
18431
+ }
18384
18432
  let client = this.clients.get(key);
18385
18433
  if (!client) {
18386
18434
  client = new LspClient(workspaceRoot, serverConfig);
@@ -18480,6 +18528,8 @@ var LspClientManager = class {
18480
18528
  this.clients.clear();
18481
18529
  this.lastUsed.clear();
18482
18530
  this.inFlightCount.clear();
18531
+ this.warmupPromises.clear();
18532
+ this.symbolCache.clear();
18483
18533
  }
18484
18534
  /** Expose in-flight count for testing */
18485
18535
  getInFlightCount(key) {
@@ -18548,11 +18598,12 @@ function formatRange(range) {
18548
18598
  function formatLocation(location) {
18549
18599
  const uri = location.uri || location.targetUri;
18550
18600
  if (!uri) return "Unknown location";
18551
- const path10 = uriToPath(uri);
18552
- const locationRange = location.range || location.targetRange || location.targetSelectionRange;
18553
- if (!locationRange) return path10;
18601
+ const path12 = uriToPath(uri);
18602
+ const loc = location;
18603
+ const locationRange = loc.range || loc.targetRange || loc.targetSelectionRange;
18604
+ if (!locationRange) return path12;
18554
18605
  const range = formatRange(locationRange);
18555
- return `${path10}:${range}`;
18606
+ return `${path12}:${range}`;
18556
18607
  }
18557
18608
  function formatHover(hover) {
18558
18609
  if (!hover) return "No hover information available";
@@ -18638,8 +18689,8 @@ function formatWorkspaceEdit(edit) {
18638
18689
  const lines = [];
18639
18690
  if (edit.changes) {
18640
18691
  for (const [uri, changes] of Object.entries(edit.changes)) {
18641
- const path10 = uriToPath(uri);
18642
- lines.push(`File: ${path10}`);
18692
+ const path12 = uriToPath(uri);
18693
+ lines.push(`File: ${path12}`);
18643
18694
  for (const change of changes) {
18644
18695
  const range = formatRange(change.range);
18645
18696
  const preview = change.newText.length > 50 ? change.newText.slice(0, 50) + "..." : change.newText;
@@ -18649,8 +18700,8 @@ function formatWorkspaceEdit(edit) {
18649
18700
  }
18650
18701
  if (edit.documentChanges) {
18651
18702
  for (const docChange of edit.documentChanges) {
18652
- const path10 = uriToPath(docChange.textDocument.uri);
18653
- lines.push(`File: ${path10}`);
18703
+ const path12 = uriToPath(docChange.textDocument.uri);
18704
+ lines.push(`File: ${path12}`);
18654
18705
  for (const change of docChange.edits) {
18655
18706
  const range = formatRange(change.range);
18656
18707
  const preview = change.newText.length > 50 ? change.newText.slice(0, 50) + "..." : change.newText;
@@ -18738,6 +18789,11 @@ function parseTscOutput(output) {
18738
18789
  // src/tools/diagnostics/lsp-aggregator.ts
18739
18790
  var import_fs3 = require("fs");
18740
18791
  var import_path4 = require("path");
18792
+
18793
+ // src/tools/diagnostics/constants.ts
18794
+ var LSP_DIAGNOSTICS_WAIT_MS = 300;
18795
+
18796
+ // src/tools/diagnostics/lsp-aggregator.ts
18741
18797
  function findFiles(directory, extensions, ignoreDirs = []) {
18742
18798
  const results = [];
18743
18799
  const ignoreDirSet = new Set(ignoreDirs);
@@ -18777,7 +18833,7 @@ async function runLspAggregatedDiagnostics(directory, extensions = [".ts", ".tsx
18777
18833
  try {
18778
18834
  await lspClientManager.runWithClientLease(file, async (client) => {
18779
18835
  await client.openDocument(file);
18780
- await new Promise((resolve5) => setTimeout(resolve5, LSP_DIAGNOSTICS_WAIT_MS));
18836
+ await new Promise((resolve6) => setTimeout(resolve6, LSP_DIAGNOSTICS_WAIT_MS));
18781
18837
  const diagnostics = client.getDiagnostics(file);
18782
18838
  for (const diagnostic of diagnostics) {
18783
18839
  allDiagnostics.push({
@@ -18803,7 +18859,6 @@ async function runLspAggregatedDiagnostics(directory, extensions = [".ts", ".tsx
18803
18859
  }
18804
18860
 
18805
18861
  // src/tools/diagnostics/index.ts
18806
- var LSP_DIAGNOSTICS_WAIT_MS = 300;
18807
18862
  async function runDirectoryDiagnostics(directory, strategy = "auto") {
18808
18863
  const tsconfigPath = (0, import_path5.join)(directory, "tsconfig.json");
18809
18864
  const hasTsconfig = (0, import_fs4.existsSync)(tsconfigPath);
@@ -19028,7 +19083,7 @@ var lspDiagnosticsTool = {
19028
19083
  const { file, severity } = args;
19029
19084
  return withLspClient(file, "diagnostics", async (client) => {
19030
19085
  await client.openDocument(file);
19031
- await new Promise((resolve5) => setTimeout(resolve5, LSP_DIAGNOSTICS_WAIT_MS));
19086
+ await new Promise((resolve6) => setTimeout(resolve6, LSP_DIAGNOSTICS_WAIT_MS));
19032
19087
  let diagnostics = client.getDiagnostics(file);
19033
19088
  if (severity) {
19034
19089
  const severityMap = {
@@ -19259,10 +19314,35 @@ var lspTools = [
19259
19314
  var import_fs5 = require("fs");
19260
19315
  var import_path6 = require("path");
19261
19316
  var import_module = require("module");
19317
+ var import_child_process4 = require("child_process");
19262
19318
  var import_meta = {};
19263
19319
  var sgModule = null;
19264
19320
  var sgLoadFailed = false;
19265
19321
  var sgLoadError = "";
19322
+ var installAttempted = false;
19323
+ async function tryInstallAstGrep() {
19324
+ if (process.env.AST_AUTO_INSTALL === "false") {
19325
+ return false;
19326
+ }
19327
+ try {
19328
+ (0, import_child_process4.execSync)("npm --version", { stdio: "ignore", timeout: 5e3 });
19329
+ } catch {
19330
+ sgLoadError = "npm not available";
19331
+ return false;
19332
+ }
19333
+ try {
19334
+ console.log("Installing @ast-grep/napi...");
19335
+ (0, import_child_process4.execSync)("npm install -g @ast-grep/napi --silent", {
19336
+ stdio: "inherit",
19337
+ timeout: 3e4
19338
+ });
19339
+ console.log("Installation complete");
19340
+ return true;
19341
+ } catch (error2) {
19342
+ sgLoadError = `Installation failed: ${error2 instanceof Error ? error2.message : String(error2)}`;
19343
+ return false;
19344
+ }
19345
+ }
19266
19346
  async function getSgModule() {
19267
19347
  if (sgLoadFailed) {
19268
19348
  return null;
@@ -19275,6 +19355,26 @@ async function getSgModule() {
19275
19355
  try {
19276
19356
  sgModule = await import("@ast-grep/napi");
19277
19357
  } catch (error2) {
19358
+ if (!installAttempted) {
19359
+ installAttempted = true;
19360
+ const installed = await tryInstallAstGrep();
19361
+ if (installed) {
19362
+ try {
19363
+ const require2 = (0, import_module.createRequire)(import_meta.url || __filename || process.cwd() + "/");
19364
+ sgModule = require2("@ast-grep/napi");
19365
+ return sgModule;
19366
+ } catch {
19367
+ try {
19368
+ sgModule = await import("@ast-grep/napi");
19369
+ return sgModule;
19370
+ } catch (retryError) {
19371
+ sgLoadFailed = true;
19372
+ sgLoadError = retryError instanceof Error ? retryError.message : String(retryError);
19373
+ return null;
19374
+ }
19375
+ }
19376
+ }
19377
+ }
19278
19378
  sgLoadFailed = true;
19279
19379
  sgLoadError = error2 instanceof Error ? error2.message : String(error2);
19280
19380
  return null;
@@ -19359,6 +19459,27 @@ var EXT_TO_LANG = {
19359
19459
  ".yaml": "yaml",
19360
19460
  ".yml": "yaml"
19361
19461
  };
19462
+ async function readFileStream(filePath, onProgress) {
19463
+ const stat = (0, import_fs5.statSync)(filePath);
19464
+ const fileSize = stat.size;
19465
+ const LARGE_FILE_THRESHOLD = 10 * 1024 * 1024;
19466
+ if (fileSize < LARGE_FILE_THRESHOLD) {
19467
+ return (0, import_fs5.readFileSync)(filePath, "utf-8");
19468
+ }
19469
+ return new Promise((resolve6, reject) => {
19470
+ const chunks = [];
19471
+ let bytesRead = 0;
19472
+ const stream = (0, import_fs5.createReadStream)(filePath, { encoding: "utf-8" });
19473
+ stream.on("data", (chunk) => {
19474
+ const str = typeof chunk === "string" ? chunk : chunk.toString("utf-8");
19475
+ chunks.push(str);
19476
+ bytesRead += Buffer.byteLength(str, "utf-8");
19477
+ onProgress?.(bytesRead, fileSize);
19478
+ });
19479
+ stream.on("end", () => resolve6(chunks.join("")));
19480
+ stream.on("error", reject);
19481
+ });
19482
+ }
19362
19483
  function getFilesForLanguage(dirPath, language, maxFiles = 1e3) {
19363
19484
  const files = [];
19364
19485
  const extensions = Object.entries(EXT_TO_LANG).filter(([_, lang]) => lang === language).map(([ext]) => ext);
@@ -19440,30 +19561,41 @@ Note: Patterns must be valid AST nodes for the language.`,
19440
19561
  const {
19441
19562
  pattern,
19442
19563
  language,
19443
- path: path10 = ".",
19564
+ path: path12 = ".",
19444
19565
  context = 2,
19445
19566
  maxResults = 20
19446
19567
  } = args;
19447
19568
  try {
19448
19569
  const sg = await getSgModule();
19449
19570
  if (!sg) {
19571
+ const errorMsg = installAttempted ? `Auto-installation failed: ${sgLoadError}
19572
+
19573
+ Please install manually:
19574
+ npm install -g @ast-grep/napi
19575
+
19576
+ Or disable auto-install:
19577
+ export AST_AUTO_INSTALL=false` : `@ast-grep/napi is not available.
19578
+
19579
+ Install manually:
19580
+ npm install -g @ast-grep/napi
19581
+
19582
+ Error: ${sgLoadError}`;
19450
19583
  return {
19451
19584
  content: [
19452
19585
  {
19453
19586
  type: "text",
19454
- text: `@ast-grep/napi is not available. Install it with: npm install -g @ast-grep/napi
19455
- Error: ${sgLoadError}`
19587
+ text: errorMsg
19456
19588
  }
19457
19589
  ]
19458
19590
  };
19459
19591
  }
19460
- const files = getFilesForLanguage(path10, language);
19592
+ const files = getFilesForLanguage(path12, language);
19461
19593
  if (files.length === 0) {
19462
19594
  return {
19463
19595
  content: [
19464
19596
  {
19465
19597
  type: "text",
19466
- text: `No ${language} files found in ${path10}`
19598
+ text: `No ${language} files found in ${path12}`
19467
19599
  }
19468
19600
  ]
19469
19601
  };
@@ -19473,7 +19605,7 @@ Error: ${sgLoadError}`
19473
19605
  for (const filePath of files) {
19474
19606
  if (totalMatches >= maxResults) break;
19475
19607
  try {
19476
- const content = (0, import_fs5.readFileSync)(filePath, "utf-8");
19608
+ const content = await readFileStream(filePath);
19477
19609
  const root = sg.parse(toLangEnum(sg, language), content).root();
19478
19610
  const matches = root.findAll(pattern);
19479
19611
  for (const match of matches) {
@@ -19503,7 +19635,7 @@ Error: ${sgLoadError}`
19503
19635
  type: "text",
19504
19636
  text: `No matches found for pattern: ${pattern}
19505
19637
 
19506
- Searched ${files.length} ${language} file(s) in ${path10}
19638
+ Searched ${files.length} ${language} file(s) in ${path12}
19507
19639
 
19508
19640
  Tip: Ensure the pattern is a valid AST node. For example:
19509
19641
  - Use "function $NAME" not just "$NAME"
@@ -19563,27 +19695,38 @@ IMPORTANT: dryRun=true (default) only previews changes. Set dryRun=false to appl
19563
19695
  dryRun: external_exports.boolean().optional().describe("Preview only, don't apply changes (default: true)")
19564
19696
  },
19565
19697
  handler: async (args) => {
19566
- const { pattern, replacement, language, path: path10 = ".", dryRun = true } = args;
19698
+ const { pattern, replacement, language, path: path12 = ".", dryRun = true } = args;
19567
19699
  try {
19568
19700
  const sg = await getSgModule();
19569
19701
  if (!sg) {
19702
+ const errorMsg = installAttempted ? `Auto-installation failed: ${sgLoadError}
19703
+
19704
+ Please install manually:
19705
+ npm install -g @ast-grep/napi
19706
+
19707
+ Or disable auto-install:
19708
+ export AST_AUTO_INSTALL=false` : `@ast-grep/napi is not available.
19709
+
19710
+ Install manually:
19711
+ npm install -g @ast-grep/napi
19712
+
19713
+ Error: ${sgLoadError}`;
19570
19714
  return {
19571
19715
  content: [
19572
19716
  {
19573
19717
  type: "text",
19574
- text: `@ast-grep/napi is not available. Install it with: npm install -g @ast-grep/napi
19575
- Error: ${sgLoadError}`
19718
+ text: errorMsg
19576
19719
  }
19577
19720
  ]
19578
19721
  };
19579
19722
  }
19580
- const files = getFilesForLanguage(path10, language);
19723
+ const files = getFilesForLanguage(path12, language);
19581
19724
  if (files.length === 0) {
19582
19725
  return {
19583
19726
  content: [
19584
19727
  {
19585
19728
  type: "text",
19586
- text: `No ${language} files found in ${path10}`
19729
+ text: `No ${language} files found in ${path12}`
19587
19730
  }
19588
19731
  ]
19589
19732
  };
@@ -19592,7 +19735,7 @@ Error: ${sgLoadError}`
19592
19735
  let totalReplacements = 0;
19593
19736
  for (const filePath of files) {
19594
19737
  try {
19595
- const content = (0, import_fs5.readFileSync)(filePath, "utf-8");
19738
+ const content = await readFileStream(filePath);
19596
19739
  const root = sg.parse(toLangEnum(sg, language), content).root();
19597
19740
  const matches = root.findAll(pattern);
19598
19741
  if (matches.length === 0) continue;
@@ -19651,7 +19794,7 @@ Error: ${sgLoadError}`
19651
19794
  type: "text",
19652
19795
  text: `No matches found for pattern: ${pattern}
19653
19796
 
19654
- Searched ${files.length} ${language} file(s) in ${path10}`
19797
+ Searched ${files.length} ${language} file(s) in ${path12}`
19655
19798
  }
19656
19799
  ]
19657
19800
  };
@@ -19802,7 +19945,7 @@ var fsSync2 = __toESM(require("fs"), 1);
19802
19945
  var path4 = __toESM(require("path"), 1);
19803
19946
  var os2 = __toESM(require("os"), 1);
19804
19947
  var crypto3 = __toESM(require("crypto"), 1);
19805
- var import_child_process5 = require("child_process");
19948
+ var import_child_process6 = require("child_process");
19806
19949
  var import_util6 = require("util");
19807
19950
 
19808
19951
  // src/lib/atomic-write.ts
@@ -19901,7 +20044,6 @@ function atomicWriteJsonSync(filePath, data) {
19901
20044
  }
19902
20045
  async function safeReadJson(filePath) {
19903
20046
  try {
19904
- await fs2.access(filePath);
19905
20047
  const content = await fs2.readFile(filePath, "utf-8");
19906
20048
  return JSON.parse(content);
19907
20049
  } catch (err) {
@@ -19909,7 +20051,7 @@ async function safeReadJson(filePath) {
19909
20051
  if (error2.code === "ENOENT") {
19910
20052
  return null;
19911
20053
  }
19912
- return null;
20054
+ throw err;
19913
20055
  }
19914
20056
  }
19915
20057
 
@@ -19917,10 +20059,10 @@ async function safeReadJson(filePath) {
19917
20059
  var path3 = __toESM(require("path"), 1);
19918
20060
 
19919
20061
  // src/platform/process-utils.ts
19920
- var import_child_process4 = require("child_process");
20062
+ var import_child_process5 = require("child_process");
19921
20063
  var import_util5 = require("util");
19922
20064
  var fsPromises = __toESM(require("fs/promises"), 1);
19923
- var execFileAsync = (0, import_util5.promisify)(import_child_process4.execFile);
20065
+ var execFileAsync = (0, import_util5.promisify)(import_child_process5.execFile);
19924
20066
  function isProcessAlive(pid) {
19925
20067
  if (!Number.isInteger(pid) || pid <= 0) return false;
19926
20068
  try {
@@ -19998,7 +20140,7 @@ async function getProcessStartTimeLinux(pid) {
19998
20140
  var PLATFORM = process.platform;
19999
20141
 
20000
20142
  // src/tools/python-repl/session-lock.ts
20001
- var execFileAsync2 = (0, import_util6.promisify)(import_child_process5.execFile);
20143
+ var execFileAsync2 = (0, import_util6.promisify)(import_child_process6.execFile);
20002
20144
  var STALE_LOCK_AGE_MS = 6e4;
20003
20145
  var DEFAULT_ACQUIRE_TIMEOUT_MS = 3e4;
20004
20146
  var LOCK_RETRY_INTERVAL_MS = 100;
@@ -20283,7 +20425,7 @@ var SessionLock = class {
20283
20425
  }
20284
20426
  };
20285
20427
  function sleep(ms) {
20286
- return new Promise((resolve5) => setTimeout(resolve5, ms));
20428
+ return new Promise((resolve6) => setTimeout(resolve6, ms));
20287
20429
  }
20288
20430
 
20289
20431
  // src/tools/python-repl/socket-client.ts
@@ -20313,7 +20455,7 @@ var JsonRpcError = class extends Error {
20313
20455
  }
20314
20456
  };
20315
20457
  async function sendSocketRequest(socketPath, method, params, timeout = 6e4) {
20316
- return new Promise((resolve5, reject) => {
20458
+ return new Promise((resolve6, reject) => {
20317
20459
  const id = (0, import_crypto.randomUUID)();
20318
20460
  const request = {
20319
20461
  jsonrpc: "2.0",
@@ -20377,7 +20519,7 @@ async function sendSocketRequest(socketPath, method, params, timeout = 6e4) {
20377
20519
  ));
20378
20520
  return;
20379
20521
  }
20380
- resolve5(response.result);
20522
+ resolve6(response.result);
20381
20523
  } catch (e) {
20382
20524
  reject(new Error(
20383
20525
  `Failed to parse JSON-RPC response: ${e.message}`
@@ -20425,15 +20567,15 @@ async function sendSocketRequest(socketPath, method, params, timeout = 6e4) {
20425
20567
  }
20426
20568
 
20427
20569
  // src/tools/python-repl/bridge-manager.ts
20428
- var import_child_process6 = require("child_process");
20570
+ var import_child_process7 = require("child_process");
20429
20571
  var fs4 = __toESM(require("fs"), 1);
20430
20572
  var fsPromises2 = __toESM(require("fs/promises"), 1);
20431
20573
  var path5 = __toESM(require("path"), 1);
20432
20574
  var import_url2 = require("url");
20433
- var import_child_process7 = require("child_process");
20575
+ var import_child_process8 = require("child_process");
20434
20576
  var import_util7 = require("util");
20435
20577
  var import_meta2 = {};
20436
- var execFileAsync3 = (0, import_util7.promisify)(import_child_process7.execFile);
20578
+ var execFileAsync3 = (0, import_util7.promisify)(import_child_process8.execFile);
20437
20579
  var BRIDGE_SPAWN_TIMEOUT_MS = 3e4;
20438
20580
  var DEFAULT_GRACE_PERIOD_MS = 5e3;
20439
20581
  var SIGTERM_GRACE_MS = 2500;
@@ -20561,12 +20703,15 @@ async function spawnBridgeServer(sessionId, projectDir) {
20561
20703
  const effectiveProjectDir = projectDir || process.cwd();
20562
20704
  const pythonEnv = await ensurePythonEnvironment(effectiveProjectDir);
20563
20705
  const bridgeArgs = [bridgePath, socketPath];
20564
- const proc = (0, import_child_process6.spawn)(pythonEnv.pythonPath, bridgeArgs, {
20706
+ const proc = (0, import_child_process7.spawn)(pythonEnv.pythonPath, bridgeArgs, {
20565
20707
  stdio: ["ignore", "ignore", "pipe"],
20566
20708
  cwd: effectiveProjectDir,
20567
20709
  env: { ...process.env, PYTHONUNBUFFERED: "1" },
20568
20710
  detached: true
20569
20711
  });
20712
+ if (!proc.pid) {
20713
+ throw new Error("Failed to spawn bridge server: no PID assigned");
20714
+ }
20570
20715
  proc.unref();
20571
20716
  const MAX_STDERR_CHARS = 64 * 1024;
20572
20717
  let stderrBuffer = "";
@@ -20612,7 +20757,7 @@ async function spawnBridgeServer(sessionId, projectDir) {
20612
20757
  async function ensureBridge(sessionId, projectDir) {
20613
20758
  const metaPath = getBridgeMetaPath(sessionId);
20614
20759
  const expectedSocketPath = getBridgeSocketPath(sessionId);
20615
- const meta = await safeReadJson(metaPath);
20760
+ const meta = await safeReadJson(metaPath).catch(() => null);
20616
20761
  if (meta && isValidBridgeMeta(meta)) {
20617
20762
  if (meta.sessionId !== sessionId) {
20618
20763
  await deleteBridgeMeta(sessionId);
@@ -20641,7 +20786,7 @@ async function killBridgeWithEscalation(sessionId, options) {
20641
20786
  const gracePeriod = options?.gracePeriodMs ?? DEFAULT_GRACE_PERIOD_MS;
20642
20787
  const startTime = Date.now();
20643
20788
  const metaPath = getBridgeMetaPath(sessionId);
20644
- const meta = await safeReadJson(metaPath);
20789
+ const meta = await safeReadJson(metaPath).catch(() => null);
20645
20790
  if (!meta || !isValidBridgeMeta(meta)) {
20646
20791
  return { terminated: true };
20647
20792
  }
@@ -20695,7 +20840,7 @@ async function deleteBridgeMeta(sessionId) {
20695
20840
  }
20696
20841
  }
20697
20842
  function sleep2(ms) {
20698
- return new Promise((resolve5) => setTimeout(resolve5, ms));
20843
+ return new Promise((resolve6) => setTimeout(resolve6, ms));
20699
20844
  }
20700
20845
 
20701
20846
  // src/tools/python-repl/tool.ts
@@ -21137,13 +21282,86 @@ function resetExecutionCounter(sessionId) {
21137
21282
  executionCounters.delete(sessionId);
21138
21283
  }
21139
21284
 
21285
+ // src/tools/python-repl/index.ts
21286
+ var pythonReplTool2 = {
21287
+ name: "python_repl",
21288
+ description: `Execute Python code in a persistent REPL environment with variable persistence across invocations.
21289
+
21290
+ Actions:
21291
+ - execute: Run Python code (variables persist between calls)
21292
+ - reset: Clear namespace and reset environment
21293
+ - get_state: Get memory usage and list of defined variables
21294
+ - interrupt: Stop long-running execution
21295
+
21296
+ Features:
21297
+ - Variables persist across tool calls within the same session
21298
+ - Structured output markers: [OBJECTIVE], [DATA], [FINDING], [STAT:*], [LIMITATION]
21299
+ - Memory tracking (RSS/VMS)
21300
+ - Automatic timeout handling (default 5 minutes)
21301
+ - Session locking for safe concurrent access
21302
+
21303
+ Use this instead of Bash heredocs when you need:
21304
+ - Multi-step analysis with state persistence
21305
+ - Large datasets that shouldn't be reloaded
21306
+ - Iterative ML model training
21307
+ - Any workflow benefiting from Python state persistence`,
21308
+ schema: pythonReplSchema,
21309
+ handler: pythonReplHandler
21310
+ };
21311
+
21140
21312
  // src/tools/state-tools.ts
21141
21313
  var import_fs8 = require("fs");
21142
21314
 
21143
21315
  // src/lib/worktree-paths.ts
21144
- var import_child_process8 = require("child_process");
21145
21316
  var import_fs6 = require("fs");
21146
21317
  var import_path7 = require("path");
21318
+
21319
+ // src/lib/git-utils.ts
21320
+ var import_child_process9 = require("child_process");
21321
+ var GIT_TIMEOUT = 5e3;
21322
+ var CACHE_TTL = 1e3;
21323
+ var cache = /* @__PURE__ */ new Map();
21324
+ function getCached(key) {
21325
+ const entry = cache.get(key);
21326
+ if (!entry) return null;
21327
+ if (Date.now() - entry.timestamp > CACHE_TTL) {
21328
+ cache.delete(key);
21329
+ return null;
21330
+ }
21331
+ return entry.value;
21332
+ }
21333
+ function setCache(key, value) {
21334
+ cache.set(key, { value, timestamp: Date.now() });
21335
+ }
21336
+ function execGit(command, cwd) {
21337
+ try {
21338
+ return (0, import_child_process9.execSync)(`git --no-pager ${command}`, {
21339
+ cwd,
21340
+ encoding: "utf-8",
21341
+ timeout: GIT_TIMEOUT,
21342
+ stdio: ["pipe", "pipe", "pipe"],
21343
+ shell: process.platform === "win32" ? "cmd.exe" : void 0
21344
+ }).trim();
21345
+ } catch {
21346
+ return "";
21347
+ }
21348
+ }
21349
+ function getWorktreeRoot(cwd) {
21350
+ const key = `root:${cwd || process.cwd()}`;
21351
+ const cached2 = getCached(key);
21352
+ if (cached2) return cached2;
21353
+ try {
21354
+ const root = execGit("rev-parse --show-toplevel", cwd);
21355
+ if (root) {
21356
+ setCache(key, root);
21357
+ return root;
21358
+ }
21359
+ } catch {
21360
+ }
21361
+ return null;
21362
+ }
21363
+
21364
+ // src/lib/worktree-paths.ts
21147
21365
  var OmcPaths = {
21148
21366
  ROOT: ".omc",
21149
21367
  STATE: ".omc/state",
@@ -21159,23 +21377,8 @@ var OmcPaths = {
21159
21377
  AUTOPILOT: ".omc/autopilot",
21160
21378
  SKILLS: ".omc/skills"
21161
21379
  };
21162
- var worktreeCache = null;
21163
- function getWorktreeRoot(cwd) {
21164
- const effectiveCwd = cwd || process.cwd();
21165
- if (worktreeCache && worktreeCache.cwd === effectiveCwd) {
21166
- return worktreeCache.root || null;
21167
- }
21168
- try {
21169
- const root = (0, import_child_process8.execSync)("git rev-parse --show-toplevel", {
21170
- cwd: effectiveCwd,
21171
- encoding: "utf-8",
21172
- stdio: ["pipe", "pipe", "pipe"]
21173
- }).trim();
21174
- worktreeCache = { cwd: effectiveCwd, root };
21175
- return root;
21176
- } catch {
21177
- return null;
21178
- }
21380
+ function getWorktreeRoot2(cwd) {
21381
+ return getWorktreeRoot(cwd);
21179
21382
  }
21180
21383
  function validatePath(inputPath) {
21181
21384
  if (inputPath.includes("..")) {
@@ -21187,7 +21390,7 @@ function validatePath(inputPath) {
21187
21390
  }
21188
21391
  function resolveOmcPath(relativePath, worktreeRoot) {
21189
21392
  validatePath(relativePath);
21190
- const root = worktreeRoot || getWorktreeRoot() || process.cwd();
21393
+ const root = worktreeRoot || getWorktreeRoot2() || process.cwd();
21191
21394
  const omcDir = (0, import_path7.join)(root, OmcPaths.ROOT);
21192
21395
  const fullPath = (0, import_path7.normalize)((0, import_path7.resolve)(omcDir, relativePath));
21193
21396
  const relativeToRoot = (0, import_path7.relative)(root, fullPath);
@@ -21211,11 +21414,11 @@ function ensureOmcDir(relativePath, worktreeRoot) {
21211
21414
  return fullPath;
21212
21415
  }
21213
21416
  function getWorktreeNotepadPath(worktreeRoot) {
21214
- const root = worktreeRoot || getWorktreeRoot() || process.cwd();
21417
+ const root = worktreeRoot || getWorktreeRoot2() || process.cwd();
21215
21418
  return (0, import_path7.join)(root, OmcPaths.NOTEPAD);
21216
21419
  }
21217
21420
  function getWorktreeProjectMemoryPath(worktreeRoot) {
21218
- const root = worktreeRoot || getWorktreeRoot() || process.cwd();
21421
+ const root = worktreeRoot || getWorktreeRoot2() || process.cwd();
21219
21422
  return (0, import_path7.join)(root, OmcPaths.PROJECT_MEMORY);
21220
21423
  }
21221
21424
  var SESSION_ID_REGEX = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/;
@@ -21240,11 +21443,11 @@ function resolveSessionStatePath(stateName, sessionId, worktreeRoot) {
21240
21443
  }
21241
21444
  function getSessionStateDir(sessionId, worktreeRoot) {
21242
21445
  validateSessionId(sessionId);
21243
- const root = worktreeRoot || getWorktreeRoot() || process.cwd();
21446
+ const root = worktreeRoot || getWorktreeRoot2() || process.cwd();
21244
21447
  return (0, import_path7.join)(root, OmcPaths.SESSIONS, sessionId);
21245
21448
  }
21246
21449
  function listSessionIds(worktreeRoot) {
21247
- const root = worktreeRoot || getWorktreeRoot() || process.cwd();
21450
+ const root = worktreeRoot || getWorktreeRoot2() || process.cwd();
21248
21451
  const sessionsDir = (0, import_path7.join)(root, OmcPaths.SESSIONS);
21249
21452
  if (!(0, import_fs6.existsSync)(sessionsDir)) {
21250
21453
  return [];
@@ -21264,7 +21467,7 @@ function ensureSessionStateDir(sessionId, worktreeRoot) {
21264
21467
  return sessionDir;
21265
21468
  }
21266
21469
  function validateWorkingDirectory(workingDirectory) {
21267
- const trustedRoot = getWorktreeRoot(process.cwd()) || process.cwd();
21470
+ const trustedRoot = getWorktreeRoot2(process.cwd()) || process.cwd();
21268
21471
  if (!workingDirectory) {
21269
21472
  return trustedRoot;
21270
21473
  }
@@ -21275,7 +21478,7 @@ function validateWorkingDirectory(workingDirectory) {
21275
21478
  } catch {
21276
21479
  trustedRootReal = trustedRoot;
21277
21480
  }
21278
- const providedRoot = getWorktreeRoot(resolved);
21481
+ const providedRoot = getWorktreeRoot2(resolved);
21279
21482
  if (providedRoot) {
21280
21483
  let providedRootReal;
21281
21484
  try {
@@ -21514,6 +21717,129 @@ function getActiveSessionsForMode(mode, cwd) {
21514
21717
  return sessionIds.filter((sid) => isJsonModeActive(cwd, mode, sid));
21515
21718
  }
21516
21719
 
21720
+ // src/audit/logger.ts
21721
+ var import_crypto2 = require("crypto");
21722
+ var fs5 = __toESM(require("fs"), 1);
21723
+ var path6 = __toESM(require("path"), 1);
21724
+
21725
+ // src/lib/safe-json.ts
21726
+ function safeJsonParse(content, filePath) {
21727
+ try {
21728
+ const data = JSON.parse(content);
21729
+ return { success: true, data };
21730
+ } catch (error2) {
21731
+ const errorMsg = filePath ? `Failed to parse JSON from ${filePath}: ${error2 instanceof Error ? error2.message : String(error2)}` : `Failed to parse JSON: ${error2 instanceof Error ? error2.message : String(error2)}`;
21732
+ return { success: false, error: errorMsg };
21733
+ }
21734
+ }
21735
+
21736
+ // src/lib/constants.ts
21737
+ var SIZE_LIMIT = {
21738
+ AUDIT_LOG_MAX: 10 * 1024 * 1024,
21739
+ // 审计日志最大 10MB
21740
+ MAX_CONCURRENT_TASKS: 1e3,
21741
+ // 最大并发任务数
21742
+ MAX_TASKS_PER_CONFIG: 100,
21743
+ // 配置中最大任务数
21744
+ TELEGRAM_MESSAGE_MAX: 500,
21745
+ // Telegram 消息最大长度
21746
+ SANITIZE_DEFAULT: 30
21747
+ // 默认清理长度
21748
+ };
21749
+ var TIME_THRESHOLD = {
21750
+ DURATION_WARNING: 2 * 60 * 1e3,
21751
+ // 2分钟警告
21752
+ DURATION_CRITICAL: 5 * 60 * 1e3,
21753
+ // 5分钟严重
21754
+ SESSION_STALE: 24 * 60 * 60 * 1e3,
21755
+ // 24小时过期
21756
+ WORKING_MEMORY_TTL: 7,
21757
+ // 工作记忆保留天数
21758
+ UPDATE_CHECK_INTERVAL: 24
21759
+ // 更新检查间隔(小时)
21760
+ };
21761
+
21762
+ // src/audit/logger.ts
21763
+ var AuditLogger = class {
21764
+ logPath;
21765
+ secretKey;
21766
+ maxSize = SIZE_LIMIT.AUDIT_LOG_MAX;
21767
+ constructor(logDir) {
21768
+ this.logPath = path6.join(logDir, "audit.log");
21769
+ this.secretKey = this.deriveSecretKey();
21770
+ this.ensureLogDir(logDir);
21771
+ }
21772
+ deriveSecretKey() {
21773
+ const seed = process.env.OMC_AUDIT_SECRET || "default-seed";
21774
+ return Buffer.from((0, import_crypto2.createHmac)("sha256", "omc-audit").update(seed).digest("hex"));
21775
+ }
21776
+ sign(entry) {
21777
+ const payload = JSON.stringify(entry);
21778
+ return (0, import_crypto2.createHmac)("sha256", this.secretKey).update(payload).digest("hex");
21779
+ }
21780
+ async log(entry) {
21781
+ const fullEntry = {
21782
+ ...entry,
21783
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
21784
+ };
21785
+ fullEntry.signature = this.sign(fullEntry);
21786
+ await this.appendLog(JSON.stringify(fullEntry) + "\n");
21787
+ await this.rotateIfNeeded();
21788
+ }
21789
+ async appendLog(line) {
21790
+ await fs5.promises.appendFile(this.logPath, line, "utf8");
21791
+ }
21792
+ async rotateIfNeeded() {
21793
+ try {
21794
+ const stats = await fs5.promises.stat(this.logPath);
21795
+ if (stats.size >= this.maxSize) {
21796
+ const rotatedPath = `${this.logPath}.${Date.now()}`;
21797
+ await fs5.promises.rename(this.logPath, rotatedPath);
21798
+ }
21799
+ } catch (err) {
21800
+ if (err.code !== "ENOENT") throw err;
21801
+ }
21802
+ }
21803
+ async verify() {
21804
+ try {
21805
+ const content = await fs5.promises.readFile(this.logPath, "utf8");
21806
+ const lines = content.split("\n").filter(Boolean);
21807
+ let valid = 0, invalid = 0;
21808
+ for (const line of lines) {
21809
+ const result = safeJsonParse(line);
21810
+ if (!result.success) {
21811
+ invalid++;
21812
+ console.error(`[audit] Failed to parse entry: ${result.error}`);
21813
+ continue;
21814
+ }
21815
+ const entry = result.data;
21816
+ const { signature, ...payload } = entry;
21817
+ const expectedSig = this.sign(payload);
21818
+ if (signature === expectedSig) {
21819
+ valid++;
21820
+ } else {
21821
+ invalid++;
21822
+ console.error(`[audit] Invalid signature at ${entry.timestamp}`);
21823
+ }
21824
+ }
21825
+ return { valid, invalid };
21826
+ } catch (err) {
21827
+ if (err.code === "ENOENT") return { valid: 0, invalid: 0 };
21828
+ throw err;
21829
+ }
21830
+ }
21831
+ ensureLogDir(dir) {
21832
+ if (!fs5.existsSync(dir)) {
21833
+ fs5.mkdirSync(dir, { recursive: true });
21834
+ }
21835
+ }
21836
+ };
21837
+ var auditLogger = new AuditLogger(".omc/logs");
21838
+
21839
+ // src/lib/path-validator.ts
21840
+ var path7 = __toESM(require("path"), 1);
21841
+ var fs6 = __toESM(require("fs"), 1);
21842
+
21517
21843
  // src/lib/validateMode.ts
21518
21844
  var VALID_MODES = [
21519
21845
  "autopilot",
@@ -21532,6 +21858,27 @@ function assertValidMode(mode) {
21532
21858
  if (!validateMode(mode)) {
21533
21859
  const raw = typeof mode === "string" ? mode : String(mode);
21534
21860
  const display = raw.length > 50 ? `${raw.slice(0, 50)}...(truncated)` : raw;
21861
+ if (typeof mode === "string" && (mode.includes("..") || mode.includes("/") || mode.includes("\\") || mode.startsWith(".") || /^[a-zA-Z]:/.test(mode))) {
21862
+ auditLogger.log({
21863
+ actor: "system",
21864
+ action: "path_validation_failed",
21865
+ resource: display,
21866
+ result: "failure",
21867
+ metadata: { reason: "path_traversal_attempt" }
21868
+ }).catch(() => {
21869
+ });
21870
+ throw new Error(
21871
+ `Path traversal attempt detected: "${display}". Valid modes are: ${VALID_MODES.join(", ")}`
21872
+ );
21873
+ }
21874
+ auditLogger.log({
21875
+ actor: "system",
21876
+ action: "path_validation_failed",
21877
+ resource: display,
21878
+ result: "failure",
21879
+ metadata: { reason: "invalid_mode" }
21880
+ }).catch(() => {
21881
+ });
21535
21882
  throw new Error(
21536
21883
  `Invalid mode: "${display}". Valid modes are: ${VALID_MODES.join(", ")}`
21537
21884
  );
@@ -21539,7 +21886,47 @@ function assertValidMode(mode) {
21539
21886
  return mode;
21540
21887
  }
21541
21888
 
21889
+ // src/lib/memory-utils.ts
21890
+ function pruneMap(map, maxSize) {
21891
+ if (map.size <= maxSize) return;
21892
+ const toDelete = map.size - maxSize;
21893
+ let count = 0;
21894
+ for (const key of map.keys()) {
21895
+ if (count++ >= toDelete) break;
21896
+ map.delete(key);
21897
+ }
21898
+ }
21899
+
21542
21900
  // src/tools/state-tools.ts
21901
+ var stateCache = /* @__PURE__ */ new Map();
21902
+ var CACHE_MAX_SIZE = 50;
21903
+ var CACHE_TTL_MS = 5e3;
21904
+ var cacheHits = 0;
21905
+ var cacheMisses = 0;
21906
+ function getCacheKey(mode, root, sessionId) {
21907
+ return `${mode}:${root}:${sessionId || "legacy"}`;
21908
+ }
21909
+ function getCached2(key) {
21910
+ const entry = stateCache.get(key);
21911
+ if (!entry) {
21912
+ cacheMisses++;
21913
+ return null;
21914
+ }
21915
+ if (Date.now() - entry.timestamp > CACHE_TTL_MS) {
21916
+ stateCache.delete(key);
21917
+ cacheMisses++;
21918
+ return null;
21919
+ }
21920
+ cacheHits++;
21921
+ return entry.data;
21922
+ }
21923
+ function setCache2(key, data) {
21924
+ stateCache.set(key, { data, timestamp: Date.now() });
21925
+ pruneMap(stateCache, CACHE_MAX_SIZE);
21926
+ }
21927
+ function invalidateCache(key) {
21928
+ stateCache.delete(key);
21929
+ }
21543
21930
  var STATE_TOOL_MODES = [
21544
21931
  "autopilot",
21545
21932
  "ultrapilot",
@@ -21614,8 +22001,20 @@ Expected path: ${statePath2}`
21614
22001
  }]
21615
22002
  };
21616
22003
  }
21617
- const content = (0, import_fs8.readFileSync)(statePath2, "utf-8");
21618
- const state = JSON.parse(content);
22004
+ const cacheKey = getCacheKey(mode, root, sessionId);
22005
+ let data = getCached2(cacheKey);
22006
+ if (!data) {
22007
+ const content = (0, import_fs8.readFileSync)(statePath2, "utf-8");
22008
+ const result = safeJsonParse(content, statePath2);
22009
+ if (!result.success) {
22010
+ return {
22011
+ content: [{ type: "text", text: result.error }],
22012
+ isError: true
22013
+ };
22014
+ }
22015
+ data = result.data;
22016
+ setCache2(cacheKey, data);
22017
+ }
21619
22018
  return {
21620
22019
  content: [{
21621
22020
  type: "text",
@@ -21624,7 +22023,7 @@ Expected path: ${statePath2}`
21624
22023
  Path: ${statePath2}
21625
22024
 
21626
22025
  \`\`\`json
21627
- ${JSON.stringify(state, null, 2)}
22026
+ ${JSON.stringify(data, null, 2)}
21628
22027
  \`\`\``
21629
22028
  }]
21630
22029
  };
@@ -21657,21 +22056,21 @@ Note: Reading from legacy/aggregate path (no session_id). This may include state
21657
22056
 
21658
22057
  `;
21659
22058
  if (legacyExists) {
21660
- try {
21661
- const content = (0, import_fs8.readFileSync)(statePath, "utf-8");
21662
- const state = JSON.parse(content);
22059
+ const content = (0, import_fs8.readFileSync)(statePath, "utf-8");
22060
+ const result = safeJsonParse(content, statePath);
22061
+ if (result.success) {
21663
22062
  output += `### Legacy Path (shared)
21664
22063
  Path: ${statePath}
21665
22064
 
21666
22065
  \`\`\`json
21667
- ${JSON.stringify(state, null, 2)}
22066
+ ${JSON.stringify(result.data, null, 2)}
21668
22067
  \`\`\`
21669
22068
 
21670
22069
  `;
21671
- } catch {
22070
+ } else {
21672
22071
  output += `### Legacy Path (shared)
21673
22072
  Path: ${statePath}
21674
- *Error reading state file*
22073
+ *${result.error}*
21675
22074
 
21676
22075
  `;
21677
22076
  }
@@ -21682,21 +22081,21 @@ Path: ${statePath}
21682
22081
  `;
21683
22082
  for (const sid of activeSessions) {
21684
22083
  const sessionStatePath = MODE_CONFIGS[mode] ? getStateFilePath(root, mode, sid) : resolveSessionStatePath(mode, sid, root);
21685
- try {
21686
- const content = (0, import_fs8.readFileSync)(sessionStatePath, "utf-8");
21687
- const state = JSON.parse(content);
22084
+ const content = (0, import_fs8.readFileSync)(sessionStatePath, "utf-8");
22085
+ const result = safeJsonParse(content, sessionStatePath);
22086
+ if (result.success) {
21688
22087
  output += `**Session: ${sid}**
21689
22088
  Path: ${sessionStatePath}
21690
22089
 
21691
22090
  \`\`\`json
21692
- ${JSON.stringify(state, null, 2)}
22091
+ ${JSON.stringify(result.data, null, 2)}
21693
22092
  \`\`\`
21694
22093
 
21695
22094
  `;
21696
- } catch {
22095
+ } else {
21697
22096
  output += `**Session: ${sid}**
21698
22097
  Path: ${sessionStatePath}
21699
- *Error reading state file*
22098
+ *${result.error}*
21700
22099
 
21701
22100
  `;
21702
22101
  }
@@ -21811,6 +22210,8 @@ var stateWriteTool = {
21811
22210
  }
21812
22211
  };
21813
22212
  atomicWriteJsonSync(statePath, stateWithMeta);
22213
+ const cacheKey = getCacheKey(mode, root, sessionId);
22214
+ invalidateCache(cacheKey);
21814
22215
  const sessionInfo = sessionId ? ` (session: ${sessionId})` : " (legacy path)";
21815
22216
  const warningMessage = sessionId ? "" : "\n\nWARNING: No session_id provided. State written to legacy shared path which may leak across parallel sessions. Pass session_id for session-scoped isolation.";
21816
22217
  return {
@@ -21860,6 +22261,8 @@ var stateClearTool = {
21860
22261
  const sessionId = session_id;
21861
22262
  if (sessionId) {
21862
22263
  validateSessionId(sessionId);
22264
+ const cacheKey = getCacheKey(mode, root, sessionId);
22265
+ invalidateCache(cacheKey);
21863
22266
  if (MODE_CONFIGS[mode]) {
21864
22267
  const success = clearModeState(mode, root, sessionId);
21865
22268
  if (success) {
@@ -21989,16 +22392,13 @@ var stateListActiveTool = {
21989
22392
  if (sessionId) {
21990
22393
  validateSessionId(sessionId);
21991
22394
  const activeModes = [...getActiveModes(root, sessionId)];
21992
- try {
21993
- const ralplanPath2 = resolveSessionStatePath("ralplan", sessionId, root);
21994
- if ((0, import_fs8.existsSync)(ralplanPath2)) {
21995
- const content = (0, import_fs8.readFileSync)(ralplanPath2, "utf-8");
21996
- const state = JSON.parse(content);
21997
- if (state.active) {
21998
- activeModes.push("ralplan");
21999
- }
22395
+ const ralplanPath2 = resolveSessionStatePath("ralplan", sessionId, root);
22396
+ if ((0, import_fs8.existsSync)(ralplanPath2)) {
22397
+ const content = (0, import_fs8.readFileSync)(ralplanPath2, "utf-8");
22398
+ const result = safeJsonParse(content, ralplanPath2);
22399
+ if (result.success && result.data?.active) {
22400
+ activeModes.push("ralplan");
22000
22401
  }
22001
- } catch {
22002
22402
  }
22003
22403
  if (activeModes.length === 0) {
22004
22404
  return {
@@ -22024,13 +22424,10 @@ ${modeList}`
22024
22424
  const legacyActiveModes = [...getActiveModes(root)];
22025
22425
  const ralplanPath = getStatePath("ralplan", root);
22026
22426
  if ((0, import_fs8.existsSync)(ralplanPath)) {
22027
- try {
22028
- const content = (0, import_fs8.readFileSync)(ralplanPath, "utf-8");
22029
- const state = JSON.parse(content);
22030
- if (state.active) {
22031
- legacyActiveModes.push("ralplan");
22032
- }
22033
- } catch {
22427
+ const content = (0, import_fs8.readFileSync)(ralplanPath, "utf-8");
22428
+ const result = safeJsonParse(content, ralplanPath);
22429
+ if (result.success && result.data?.active) {
22430
+ legacyActiveModes.push("ralplan");
22034
22431
  }
22035
22432
  }
22036
22433
  for (const mode of legacyActiveModes) {
@@ -22042,16 +22439,13 @@ ${modeList}`
22042
22439
  const sessionIds = listSessionIds(root);
22043
22440
  for (const sid of sessionIds) {
22044
22441
  const sessionActiveModes = [...getActiveModes(root, sid)];
22045
- try {
22046
- const ralplanSessionPath = resolveSessionStatePath("ralplan", sid, root);
22047
- if ((0, import_fs8.existsSync)(ralplanSessionPath)) {
22048
- const content = (0, import_fs8.readFileSync)(ralplanSessionPath, "utf-8");
22049
- const state = JSON.parse(content);
22050
- if (state.active) {
22051
- sessionActiveModes.push("ralplan");
22052
- }
22442
+ const ralplanSessionPath = resolveSessionStatePath("ralplan", sid, root);
22443
+ if ((0, import_fs8.existsSync)(ralplanSessionPath)) {
22444
+ const content = (0, import_fs8.readFileSync)(ralplanSessionPath, "utf-8");
22445
+ const result = safeJsonParse(content, ralplanSessionPath);
22446
+ if (result.success && result.data?.active) {
22447
+ sessionActiveModes.push("ralplan");
22053
22448
  }
22054
- } catch {
22055
22449
  }
22056
22450
  for (const mode of sessionActiveModes) {
22057
22451
  if (!modeSessionMap.has(mode)) {
@@ -22110,23 +22504,19 @@ var stateGetStatusTool = {
22110
22504
  validateSessionId(sessionId);
22111
22505
  const statePath = MODE_CONFIGS[mode] ? getStateFilePath(root, mode, sessionId) : resolveSessionStatePath(mode, sessionId, root);
22112
22506
  const active = MODE_CONFIGS[mode] ? isModeActive(mode, root, sessionId) : (0, import_fs8.existsSync)(statePath) && (() => {
22113
- try {
22114
- const content = (0, import_fs8.readFileSync)(statePath, "utf-8");
22115
- const state = JSON.parse(content);
22116
- return state.active === true;
22117
- } catch {
22118
- return false;
22119
- }
22507
+ const content = (0, import_fs8.readFileSync)(statePath, "utf-8");
22508
+ const result = safeJsonParse(content, statePath);
22509
+ return result.success && result.data?.active === true;
22120
22510
  })();
22121
22511
  let statePreview = "No state file";
22122
22512
  if ((0, import_fs8.existsSync)(statePath)) {
22123
- try {
22124
- const content = (0, import_fs8.readFileSync)(statePath, "utf-8");
22125
- const state = JSON.parse(content);
22126
- statePreview = JSON.stringify(state, null, 2).slice(0, 500);
22513
+ const content = (0, import_fs8.readFileSync)(statePath, "utf-8");
22514
+ const result = safeJsonParse(content, statePath);
22515
+ if (result.success) {
22516
+ statePreview = JSON.stringify(result.data, null, 2).slice(0, 500);
22127
22517
  if (statePreview.length >= 500) statePreview += "\n...(truncated)";
22128
- } catch {
22129
- statePreview = "Error reading state file";
22518
+ } else {
22519
+ statePreview = result.error;
22130
22520
  }
22131
22521
  }
22132
22522
  lines2.push(`### Session: ${sessionId}`);
@@ -22147,13 +22537,9 @@ ${statePreview}
22147
22537
  }
22148
22538
  const legacyPath = getStatePath(mode, root);
22149
22539
  const legacyActive = MODE_CONFIGS[mode] ? isModeActive(mode, root) : (0, import_fs8.existsSync)(legacyPath) && (() => {
22150
- try {
22151
- const content = (0, import_fs8.readFileSync)(legacyPath, "utf-8");
22152
- const state = JSON.parse(content);
22153
- return state.active === true;
22154
- } catch {
22155
- return false;
22156
- }
22540
+ const content = (0, import_fs8.readFileSync)(legacyPath, "utf-8");
22541
+ const result = safeJsonParse(content, legacyPath);
22542
+ return result.success && result.data?.active === true;
22157
22543
  })();
22158
22544
  lines2.push(`### Legacy Path`);
22159
22545
  lines2.push(`- **Active:** ${legacyActive ? "Yes" : "No"}`);
@@ -22161,17 +22547,13 @@ ${statePreview}
22161
22547
  lines2.push(`- **Exists:** ${(0, import_fs8.existsSync)(legacyPath) ? "Yes" : "No"}
22162
22548
  `);
22163
22549
  const activeSessions = MODE_CONFIGS[mode] ? getActiveSessionsForMode(mode, root) : listSessionIds(root).filter((sid) => {
22164
- try {
22165
- const sessionPath = resolveSessionStatePath(mode, sid, root);
22166
- if ((0, import_fs8.existsSync)(sessionPath)) {
22167
- const content = (0, import_fs8.readFileSync)(sessionPath, "utf-8");
22168
- const state = JSON.parse(content);
22169
- return state.active === true;
22170
- }
22171
- return false;
22172
- } catch {
22173
- return false;
22550
+ const sessionPath = resolveSessionStatePath(mode, sid, root);
22551
+ if ((0, import_fs8.existsSync)(sessionPath)) {
22552
+ const content = (0, import_fs8.readFileSync)(sessionPath, "utf-8");
22553
+ const result = safeJsonParse(content, sessionPath);
22554
+ return result.success && result.data?.active === true;
22174
22555
  }
22556
+ return false;
22175
22557
  });
22176
22558
  if (activeSessions.length > 0) {
22177
22559
  lines2.push(`### Active Sessions (${activeSessions.length})`);
@@ -22206,12 +22588,9 @@ No active sessions for this mode.`);
22206
22588
  const ralplanPath = sessionId ? resolveSessionStatePath("ralplan", sessionId, root) : getStatePath("ralplan", root);
22207
22589
  let ralplanActive = false;
22208
22590
  if ((0, import_fs8.existsSync)(ralplanPath)) {
22209
- try {
22210
- const content = (0, import_fs8.readFileSync)(ralplanPath, "utf-8");
22211
- const state = JSON.parse(content);
22212
- ralplanActive = state.active === true;
22213
- } catch {
22214
- }
22591
+ const content = (0, import_fs8.readFileSync)(ralplanPath, "utf-8");
22592
+ const result = safeJsonParse(content, ralplanPath);
22593
+ ralplanActive = result.success && result.data?.active === true;
22215
22594
  }
22216
22595
  const ralplanIcon = ralplanActive ? "[ACTIVE]" : "[INACTIVE]";
22217
22596
  lines.push(`${ralplanIcon} **ralplan**: ${ralplanActive ? "Active" : "Inactive"}`);
@@ -22560,6 +22939,7 @@ ${sectionContent}`
22560
22939
  };
22561
22940
  } catch (error2) {
22562
22941
  return {
22942
+ isError: true,
22563
22943
  content: [{
22564
22944
  type: "text",
22565
22945
  text: `Error reading notepad: ${error2 instanceof Error ? error2.message : String(error2)}`
@@ -22603,6 +22983,7 @@ var notepadWritePriorityTool = {
22603
22983
  };
22604
22984
  } catch (error2) {
22605
22985
  return {
22986
+ isError: true,
22606
22987
  content: [{
22607
22988
  type: "text",
22608
22989
  text: `Error writing to Priority Context: ${error2 instanceof Error ? error2.message : String(error2)}`
@@ -22640,6 +23021,7 @@ var notepadWriteWorkingTool = {
22640
23021
  };
22641
23022
  } catch (error2) {
22642
23023
  return {
23024
+ isError: true,
22643
23025
  content: [{
22644
23026
  type: "text",
22645
23027
  text: `Error writing to Working Memory: ${error2 instanceof Error ? error2.message : String(error2)}`
@@ -22677,6 +23059,7 @@ var notepadWriteManualTool = {
22677
23059
  };
22678
23060
  } catch (error2) {
22679
23061
  return {
23062
+ isError: true,
22680
23063
  content: [{
22681
23064
  type: "text",
22682
23065
  text: `Error writing to MANUAL: ${error2 instanceof Error ? error2.message : String(error2)}`
@@ -22709,6 +23092,7 @@ var notepadPruneTool = {
22709
23092
  };
22710
23093
  } catch (error2) {
22711
23094
  return {
23095
+ isError: true,
22712
23096
  content: [{
22713
23097
  type: "text",
22714
23098
  text: `Error pruning notepad: ${error2 instanceof Error ? error2.message : String(error2)}`
@@ -22752,6 +23136,7 @@ var notepadStatsTool = {
22752
23136
  };
22753
23137
  } catch (error2) {
22754
23138
  return {
23139
+ isError: true,
22755
23140
  content: [{
22756
23141
  type: "text",
22757
23142
  text: `Error getting notepad stats: ${error2 instanceof Error ? error2.message : String(error2)}`
@@ -22978,7 +23363,7 @@ async function addCustomNote(projectRoot, category, content) {
22978
23363
 
22979
23364
  // src/tools/memory-tools.ts
22980
23365
  var projectMemoryReadTool = {
22981
- name: "project_memory_read",
23366
+ name: "mem_read",
22982
23367
  description: "Read the project memory. Can read the full memory or a specific section.",
22983
23368
  schema: {
22984
23369
  section: external_exports.enum(["all", "techStack", "build", "conventions", "structure", "notes", "directives"]).optional().describe("Section to read (default: all)"),
@@ -23045,7 +23430,7 @@ ${JSON.stringify(data, null, 2)}
23045
23430
  }
23046
23431
  };
23047
23432
  var projectMemoryWriteTool = {
23048
- name: "project_memory_write",
23433
+ name: "mem_write",
23049
23434
  description: "Write/update project memory. Can replace entirely or merge with existing memory.",
23050
23435
  schema: {
23051
23436
  memory: external_exports.record(external_exports.string(), external_exports.unknown()).describe("The memory object to write"),
@@ -23090,7 +23475,7 @@ Path: ${getWorktreeProjectMemoryPath(root)}`
23090
23475
  }
23091
23476
  };
23092
23477
  var projectMemoryAddNoteTool = {
23093
- name: "project_memory_add_note",
23478
+ name: "mem_add_note",
23094
23479
  description: "Add a custom note to project memory. Notes are categorized and persisted across sessions.",
23095
23480
  schema: {
23096
23481
  category: external_exports.string().max(50).describe('Note category (e.g., "build", "test", "deploy", "env", "architecture")'),
@@ -23131,7 +23516,7 @@ var projectMemoryAddNoteTool = {
23131
23516
  }
23132
23517
  };
23133
23518
  var projectMemoryAddDirectiveTool = {
23134
- name: "project_memory_add_directive",
23519
+ name: "mem_add_directive",
23135
23520
  description: "Add a user directive to project memory. Directives are instructions that persist across sessions and survive compaction.",
23136
23521
  schema: {
23137
23522
  directive: external_exports.string().max(500).describe('The directive (e.g., "Always use TypeScript strict mode")'),
@@ -23728,16 +24113,763 @@ No events recorded.`
23728
24113
  };
23729
24114
  var traceTools = [traceTimelineTool, traceSummaryTool];
23730
24115
 
23731
- // src/mcp/standalone-server.ts
23732
- var allTools = [
23733
- ...lspTools,
23734
- ...astTools,
23735
- pythonReplTool,
23736
- ...stateTools,
23737
- ...notepadTools,
23738
- ...memoryTools,
23739
- ...traceTools
24116
+ // src/tools/skills-tools.ts
24117
+ var import_path22 = require("path");
24118
+ var import_os4 = require("os");
24119
+
24120
+ // src/hooks/learner/loader.ts
24121
+ var import_fs15 = require("fs");
24122
+ var import_crypto3 = require("crypto");
24123
+ var import_path21 = require("path");
24124
+
24125
+ // src/hooks/learner/finder.ts
24126
+ var import_fs14 = require("fs");
24127
+ var import_path20 = require("path");
24128
+
24129
+ // src/hooks/learner/constants.ts
24130
+ var import_path19 = require("path");
24131
+ var import_os3 = require("os");
24132
+
24133
+ // src/utils/paths.ts
24134
+ var import_path18 = require("path");
24135
+ var import_fs13 = require("fs");
24136
+ var import_os2 = require("os");
24137
+
24138
+ // src/utils/config-dir.ts
24139
+ var import_node_os = require("node:os");
24140
+ var import_node_path = require("node:path");
24141
+ function getConfigDir() {
24142
+ return process.env.CLAUDE_CONFIG_DIR || (0, import_node_path.join)((0, import_node_os.homedir)(), ".claude");
24143
+ }
24144
+
24145
+ // src/utils/paths.ts
24146
+ function getClaudeConfigDir() {
24147
+ return getConfigDir();
24148
+ }
24149
+
24150
+ // src/hooks/learner/constants.ts
24151
+ var USER_SKILLS_DIR = (0, import_path19.join)(getClaudeConfigDir(), "skills", "omc-learned");
24152
+ var GLOBAL_SKILLS_DIR = (0, import_path19.join)((0, import_os3.homedir)(), ".omc", "skills");
24153
+ var PROJECT_SKILLS_SUBDIR = OmcPaths.SKILLS;
24154
+ var MAX_RECURSION_DEPTH = 10;
24155
+ var SKILL_EXTENSION = ".md";
24156
+ var DEBUG_ENABLED = process.env.OMC_DEBUG === "1";
24157
+
24158
+ // src/hooks/learner/finder.ts
24159
+ function findSkillFilesRecursive(dir, results, depth = 0) {
24160
+ if (!(0, import_fs14.existsSync)(dir)) return;
24161
+ if (depth > MAX_RECURSION_DEPTH) return;
24162
+ try {
24163
+ const entries = (0, import_fs14.readdirSync)(dir, { withFileTypes: true });
24164
+ for (const entry of entries) {
24165
+ const fullPath = (0, import_path20.join)(dir, entry.name);
24166
+ if (entry.isDirectory()) {
24167
+ findSkillFilesRecursive(fullPath, results, depth + 1);
24168
+ } else if (entry.isFile() && entry.name.endsWith(SKILL_EXTENSION)) {
24169
+ results.push(fullPath);
24170
+ }
24171
+ }
24172
+ } catch (error2) {
24173
+ if (DEBUG_ENABLED) {
24174
+ console.error("[learner] Error scanning directory:", error2);
24175
+ }
24176
+ }
24177
+ }
24178
+ function safeRealpathSync(filePath) {
24179
+ try {
24180
+ return (0, import_fs14.realpathSync)(filePath);
24181
+ } catch {
24182
+ return filePath;
24183
+ }
24184
+ }
24185
+ function isWithinBoundary(realPath, boundary) {
24186
+ const normalizedReal = (0, import_path20.normalize)(realPath);
24187
+ const normalizedBoundary = (0, import_path20.normalize)(boundary);
24188
+ return normalizedReal === normalizedBoundary || normalizedReal.startsWith(normalizedBoundary + import_path20.sep);
24189
+ }
24190
+ function findSkillFiles(projectRoot, options) {
24191
+ const candidates = [];
24192
+ const seenRealPaths = /* @__PURE__ */ new Set();
24193
+ const scope = options?.scope ?? "all";
24194
+ if (projectRoot && (scope === "project" || scope === "all")) {
24195
+ const projectSkillsDir = (0, import_path20.join)(projectRoot, PROJECT_SKILLS_SUBDIR);
24196
+ const projectFiles = [];
24197
+ findSkillFilesRecursive(projectSkillsDir, projectFiles);
24198
+ for (const filePath of projectFiles) {
24199
+ const realPath = safeRealpathSync(filePath);
24200
+ if (seenRealPaths.has(realPath)) continue;
24201
+ if (!isWithinBoundary(realPath, projectSkillsDir)) {
24202
+ if (DEBUG_ENABLED) {
24203
+ console.warn("[learner] Symlink escape blocked:", filePath);
24204
+ }
24205
+ continue;
24206
+ }
24207
+ seenRealPaths.add(realPath);
24208
+ candidates.push({
24209
+ path: filePath,
24210
+ realPath,
24211
+ scope: "project",
24212
+ sourceDir: projectSkillsDir
24213
+ });
24214
+ }
24215
+ }
24216
+ if (scope === "user" || scope === "all") {
24217
+ const userDirs = [GLOBAL_SKILLS_DIR, USER_SKILLS_DIR];
24218
+ for (const userDir of userDirs) {
24219
+ const userFiles = [];
24220
+ findSkillFilesRecursive(userDir, userFiles);
24221
+ for (const filePath of userFiles) {
24222
+ const realPath = safeRealpathSync(filePath);
24223
+ if (seenRealPaths.has(realPath)) continue;
24224
+ if (!isWithinBoundary(realPath, userDir)) {
24225
+ if (DEBUG_ENABLED) {
24226
+ console.warn("[learner] Symlink escape blocked:", filePath);
24227
+ }
24228
+ continue;
24229
+ }
24230
+ seenRealPaths.add(realPath);
24231
+ candidates.push({
24232
+ path: filePath,
24233
+ realPath,
24234
+ scope: "user",
24235
+ sourceDir: userDir
24236
+ });
24237
+ }
24238
+ }
24239
+ }
24240
+ return candidates;
24241
+ }
24242
+
24243
+ // src/hooks/learner/parser.ts
24244
+ function parseSkillFile(rawContent) {
24245
+ const frontmatterRegex = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/;
24246
+ const match = rawContent.match(frontmatterRegex);
24247
+ if (!match) {
24248
+ return {
24249
+ metadata: {},
24250
+ content: rawContent,
24251
+ valid: false,
24252
+ errors: ["Missing YAML frontmatter"]
24253
+ };
24254
+ }
24255
+ const yamlContent = match[1];
24256
+ const content = match[2].trim();
24257
+ const errors = [];
24258
+ try {
24259
+ const metadata = parseYamlMetadata(yamlContent);
24260
+ if (!metadata.id && metadata.name) {
24261
+ metadata.id = metadata.name.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
24262
+ }
24263
+ if (!metadata.source) {
24264
+ metadata.source = "manual";
24265
+ }
24266
+ if (!metadata.name) errors.push("Missing required field: name");
24267
+ if (!metadata.description) errors.push("Missing required field: description");
24268
+ if (!metadata.triggers || metadata.triggers.length === 0) {
24269
+ errors.push("Missing required field: triggers");
24270
+ }
24271
+ return {
24272
+ metadata,
24273
+ content,
24274
+ valid: errors.length === 0,
24275
+ errors
24276
+ };
24277
+ } catch (e) {
24278
+ return {
24279
+ metadata: {},
24280
+ content: rawContent,
24281
+ valid: false,
24282
+ errors: [`YAML parse error: ${e}`]
24283
+ };
24284
+ }
24285
+ }
24286
+ function parseYamlMetadata(yamlContent) {
24287
+ const lines = yamlContent.split("\n");
24288
+ const metadata = {};
24289
+ let i = 0;
24290
+ while (i < lines.length) {
24291
+ const line = lines[i];
24292
+ const colonIndex = line.indexOf(":");
24293
+ if (colonIndex === -1) {
24294
+ i++;
24295
+ continue;
24296
+ }
24297
+ const key = line.slice(0, colonIndex).trim();
24298
+ const rawValue = line.slice(colonIndex + 1).trim();
24299
+ switch (key) {
24300
+ case "id":
24301
+ metadata.id = parseStringValue(rawValue);
24302
+ break;
24303
+ case "name":
24304
+ metadata.name = parseStringValue(rawValue);
24305
+ break;
24306
+ case "description":
24307
+ metadata.description = parseStringValue(rawValue);
24308
+ break;
24309
+ case "source":
24310
+ metadata.source = parseStringValue(rawValue);
24311
+ break;
24312
+ case "createdAt":
24313
+ metadata.createdAt = parseStringValue(rawValue);
24314
+ break;
24315
+ case "sessionId":
24316
+ metadata.sessionId = parseStringValue(rawValue);
24317
+ break;
24318
+ case "quality":
24319
+ metadata.quality = parseInt(rawValue, 10) || void 0;
24320
+ break;
24321
+ case "usageCount":
24322
+ metadata.usageCount = parseInt(rawValue, 10) || 0;
24323
+ break;
24324
+ case "triggers":
24325
+ case "tags": {
24326
+ const { value, consumed } = parseArrayValue(rawValue, lines, i);
24327
+ if (key === "triggers") {
24328
+ metadata.triggers = Array.isArray(value) ? value : [value];
24329
+ } else {
24330
+ metadata.tags = Array.isArray(value) ? value : [value];
24331
+ }
24332
+ i += consumed - 1;
24333
+ break;
24334
+ }
24335
+ }
24336
+ i++;
24337
+ }
24338
+ return metadata;
24339
+ }
24340
+ function parseStringValue(value) {
24341
+ if (!value) return "";
24342
+ if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
24343
+ return value.slice(1, -1);
24344
+ }
24345
+ return value;
24346
+ }
24347
+ function parseArrayValue(rawValue, lines, currentIndex) {
24348
+ if (rawValue.startsWith("[")) {
24349
+ const endIdx = rawValue.lastIndexOf("]");
24350
+ if (endIdx === -1) return { value: [], consumed: 1 };
24351
+ const content = rawValue.slice(1, endIdx).trim();
24352
+ if (!content) return { value: [], consumed: 1 };
24353
+ const items = content.split(",").map((s) => parseStringValue(s.trim())).filter(Boolean);
24354
+ return { value: items, consumed: 1 };
24355
+ }
24356
+ if (!rawValue || rawValue === "") {
24357
+ const items = [];
24358
+ let consumed = 1;
24359
+ for (let j = currentIndex + 1; j < lines.length; j++) {
24360
+ const nextLine = lines[j];
24361
+ const arrayMatch = nextLine.match(/^\s+-\s*(.*)$/);
24362
+ if (arrayMatch) {
24363
+ const itemValue = parseStringValue(arrayMatch[1].trim());
24364
+ if (itemValue) items.push(itemValue);
24365
+ consumed++;
24366
+ } else if (nextLine.trim() === "") {
24367
+ consumed++;
24368
+ } else {
24369
+ break;
24370
+ }
24371
+ }
24372
+ if (items.length > 0) {
24373
+ return { value: items, consumed };
24374
+ }
24375
+ }
24376
+ return { value: parseStringValue(rawValue), consumed: 1 };
24377
+ }
24378
+
24379
+ // src/hooks/learner/loader.ts
24380
+ function createContentHash(content) {
24381
+ return (0, import_crypto3.createHash)("sha256").update(content).digest("hex").slice(0, 16);
24382
+ }
24383
+ function loadAllSkills(projectRoot) {
24384
+ const candidates = findSkillFiles(projectRoot);
24385
+ const seenIds = /* @__PURE__ */ new Map();
24386
+ for (const candidate of candidates) {
24387
+ try {
24388
+ const rawContent = (0, import_fs15.readFileSync)(candidate.path, "utf-8");
24389
+ const { metadata, content, valid, errors } = parseSkillFile(rawContent);
24390
+ if (!valid) {
24391
+ if (DEBUG_ENABLED) {
24392
+ console.warn(`Invalid skill file ${candidate.path}: ${errors.join(", ")}`);
24393
+ }
24394
+ continue;
24395
+ }
24396
+ const skillId = metadata.id;
24397
+ const relativePath = (0, import_path21.normalize)((0, import_path21.relative)(candidate.sourceDir, candidate.path));
24398
+ const skill = {
24399
+ path: candidate.path,
24400
+ relativePath,
24401
+ scope: candidate.scope,
24402
+ metadata,
24403
+ content,
24404
+ contentHash: createContentHash(content),
24405
+ priority: candidate.scope === "project" ? 1 : 0
24406
+ };
24407
+ const existing = seenIds.get(skillId);
24408
+ if (!existing || skill.priority > existing.priority) {
24409
+ seenIds.set(skillId, skill);
24410
+ }
24411
+ } catch (e) {
24412
+ if (DEBUG_ENABLED) {
24413
+ console.warn(`Error loading skill ${candidate.path}:`, e);
24414
+ }
24415
+ }
24416
+ }
24417
+ return Array.from(seenIds.values()).sort((a, b) => b.priority - a.priority);
24418
+ }
24419
+
24420
+ // src/tools/skills-tools.ts
24421
+ function getAllowedBoundaries() {
24422
+ return [process.cwd(), (0, import_os4.homedir)()];
24423
+ }
24424
+ function validateProjectRoot(input) {
24425
+ const normalized = (0, import_path22.normalize)((0, import_path22.resolve)(input));
24426
+ if (input.includes("..")) {
24427
+ throw new Error("Invalid project root: path traversal not allowed");
24428
+ }
24429
+ const isWithinAllowed = getAllowedBoundaries().some((boundary) => {
24430
+ const normalizedBoundary = (0, import_path22.normalize)(boundary);
24431
+ return normalized === normalizedBoundary || normalized.startsWith(normalizedBoundary + import_path22.sep);
24432
+ });
24433
+ if (!isWithinAllowed) {
24434
+ throw new Error("Invalid project root: path is outside allowed directories");
24435
+ }
24436
+ return normalized;
24437
+ }
24438
+ var loadLocalSchema = {
24439
+ projectRoot: external_exports.string().max(500).optional().describe("Project root directory (defaults to cwd)")
24440
+ };
24441
+ var loadGlobalSchema = {};
24442
+ var listSkillsSchema = {
24443
+ projectRoot: external_exports.string().max(500).optional().describe("Project root directory (defaults to cwd)")
24444
+ };
24445
+ function formatSkillOutput(skills) {
24446
+ if (skills.length === 0) {
24447
+ return "No skills found in the searched directories.";
24448
+ }
24449
+ const lines = [];
24450
+ for (const skill of skills) {
24451
+ lines.push(`### ${skill.metadata.id}`);
24452
+ lines.push(`- **Name:** ${skill.metadata.name}`);
24453
+ lines.push(`- **Description:** ${skill.metadata.description}`);
24454
+ lines.push(`- **Triggers:** ${skill.metadata.triggers.join(", ")}`);
24455
+ if (skill.metadata.tags?.length) {
24456
+ lines.push(`- **Tags:** ${skill.metadata.tags.join(", ")}`);
24457
+ }
24458
+ lines.push(`- **Scope:** ${skill.scope}`);
24459
+ lines.push(`- **Path:** ${skill.relativePath}`);
24460
+ lines.push("");
24461
+ }
24462
+ return lines.join("\n");
24463
+ }
24464
+ var loadLocalTool = {
24465
+ name: "load_omc_skills_local",
24466
+ description: "Load and list skills from the project-local .omc/skills/ directory. Returns skill metadata (id, name, description, triggers, tags) for all discovered project-scoped skills.",
24467
+ schema: loadLocalSchema,
24468
+ handler: async (args) => {
24469
+ const projectRoot = args.projectRoot ? validateProjectRoot(args.projectRoot) : process.cwd();
24470
+ const allSkills = loadAllSkills(projectRoot);
24471
+ const projectSkills = allSkills.filter((s) => s.scope === "project");
24472
+ return {
24473
+ content: [{
24474
+ type: "text",
24475
+ text: `## Project Skills (${projectSkills.length})
24476
+
24477
+ ${formatSkillOutput(projectSkills)}`
24478
+ }]
24479
+ };
24480
+ }
24481
+ };
24482
+ var loadGlobalTool = {
24483
+ name: "load_omc_skills_global",
24484
+ description: "Load and list skills from global user directories (~/.omc/skills/ and ~/.claude/skills/omc-learned/). Returns skill metadata for all discovered user-scoped skills.",
24485
+ schema: loadGlobalSchema,
24486
+ handler: async (_args) => {
24487
+ const allSkills = loadAllSkills(null);
24488
+ const userSkills = allSkills.filter((s) => s.scope === "user");
24489
+ return {
24490
+ content: [{
24491
+ type: "text",
24492
+ text: `## Global User Skills (${userSkills.length})
24493
+
24494
+ ${formatSkillOutput(userSkills)}`
24495
+ }]
24496
+ };
24497
+ }
24498
+ };
24499
+ var listSkillsTool = {
24500
+ name: "list_omc_skills",
24501
+ description: "List all available skills (both project-local and global user skills). Project skills take priority over user skills with the same ID.",
24502
+ schema: listSkillsSchema,
24503
+ handler: async (args) => {
24504
+ const projectRoot = args.projectRoot ? validateProjectRoot(args.projectRoot) : process.cwd();
24505
+ const skills = loadAllSkills(projectRoot);
24506
+ const projectSkills = skills.filter((s) => s.scope === "project");
24507
+ const userSkills = skills.filter((s) => s.scope === "user");
24508
+ let output = `## All Available Skills (${skills.length} total)
24509
+
24510
+ `;
24511
+ if (projectSkills.length > 0) {
24512
+ output += `### Project Skills (${projectSkills.length})
24513
+
24514
+ ${formatSkillOutput(projectSkills)}
24515
+ `;
24516
+ }
24517
+ if (userSkills.length > 0) {
24518
+ output += `### User Skills (${userSkills.length})
24519
+
24520
+ ${formatSkillOutput(userSkills)}`;
24521
+ }
24522
+ if (skills.length === 0) {
24523
+ output = "## No Skills Found\n\nNo skill files were discovered in any searched directories.\n\nSearched:\n- Project: .omc/skills/\n- Global: ~/.omc/skills/\n- Legacy: ~/.claude/skills/omc-learned/";
24524
+ }
24525
+ return {
24526
+ content: [{
24527
+ type: "text",
24528
+ text: output
24529
+ }]
24530
+ };
24531
+ }
24532
+ };
24533
+ var skillsTools = [loadLocalTool, loadGlobalTool, listSkillsTool];
24534
+
24535
+ // src/tools/dependency-analyzer.ts
24536
+ var import_fs16 = require("fs");
24537
+ var import_path23 = require("path");
24538
+ var DependencyAnalyzerSchema = external_exports.object({
24539
+ filePath: external_exports.string().describe("File path to analyze"),
24540
+ depth: external_exports.number().optional().describe("Dependency depth (default: 1)")
24541
+ });
24542
+ var dependencyAnalyzerTool = {
24543
+ name: "dependency_analyzer",
24544
+ description: "Analyze file-level dependencies (imports/requires)",
24545
+ schema: DependencyAnalyzerSchema.shape,
24546
+ handler: async (args) => {
24547
+ try {
24548
+ const { filePath, depth = 1 } = args;
24549
+ const content = (0, import_fs16.readFileSync)(filePath, "utf-8");
24550
+ const deps = extractDependencies(content, filePath);
24551
+ return {
24552
+ content: [{
24553
+ type: "text",
24554
+ text: JSON.stringify({ file: filePath, dependencies: deps, depth }, null, 2)
24555
+ }]
24556
+ };
24557
+ } catch (error2) {
24558
+ return {
24559
+ content: [{
24560
+ type: "text",
24561
+ text: `Error: ${error2 instanceof Error ? error2.message : String(error2)}`
24562
+ }],
24563
+ isError: true
24564
+ };
24565
+ }
24566
+ }
24567
+ };
24568
+ function extractDependencies(content, filePath) {
24569
+ const deps = [];
24570
+ const dir = (0, import_path23.dirname)(filePath);
24571
+ const importRegex = /import\s+.*?\s+from\s+['"]([^'"]+)['"]/g;
24572
+ const requireRegex = /require\(['"]([^'"]+)['"]\)/g;
24573
+ let match;
24574
+ while ((match = importRegex.exec(content)) !== null) {
24575
+ deps.push(resolveImport(match[1], dir));
24576
+ }
24577
+ while ((match = requireRegex.exec(content)) !== null) {
24578
+ deps.push(resolveImport(match[1], dir));
24579
+ }
24580
+ return [...new Set(deps)];
24581
+ }
24582
+ function resolveImport(importPath, baseDir) {
24583
+ if (importPath.startsWith(".")) {
24584
+ return (0, import_path23.join)(baseDir, importPath);
24585
+ }
24586
+ return importPath;
24587
+ }
24588
+
24589
+ // src/tools/doc-sync.ts
24590
+ var import_fs17 = require("fs");
24591
+ var DocSyncSchema = external_exports.object({
24592
+ sourceFile: external_exports.string().describe("Source code file with comments"),
24593
+ targetDoc: external_exports.string().describe("Target documentation file"),
24594
+ section: external_exports.string().optional().describe("Section to update (default: append)")
24595
+ });
24596
+ var docSyncTool = {
24597
+ name: "doc_sync",
24598
+ description: "Sync code comments to documentation files",
24599
+ schema: DocSyncSchema.shape,
24600
+ handler: async (args) => {
24601
+ try {
24602
+ const { sourceFile, targetDoc, section } = args;
24603
+ const code = (0, import_fs17.readFileSync)(sourceFile, "utf-8");
24604
+ const rules = extractSecurityRules(code);
24605
+ if (rules.length === 0) {
24606
+ return {
24607
+ content: [{ type: "text", text: "No security rules found" }]
24608
+ };
24609
+ }
24610
+ const docContent = (0, import_fs17.readFileSync)(targetDoc, "utf-8");
24611
+ const updated = section ? updateSection(docContent, section, rules) : appendRules(docContent, rules);
24612
+ (0, import_fs17.writeFileSync)(targetDoc, updated, "utf-8");
24613
+ return {
24614
+ content: [{
24615
+ type: "text",
24616
+ text: `Synced ${rules.length} rules to ${targetDoc}`
24617
+ }]
24618
+ };
24619
+ } catch (error2) {
24620
+ return {
24621
+ content: [{
24622
+ type: "text",
24623
+ text: `Error: ${error2 instanceof Error ? error2.message : String(error2)}`
24624
+ }],
24625
+ isError: true
24626
+ };
24627
+ }
24628
+ }
24629
+ };
24630
+ function extractSecurityRules(code) {
24631
+ const rules = [];
24632
+ const regex = /\/\*\*[\s\S]*?@security\s+([\s\S]*?)\*\//g;
24633
+ let match;
24634
+ while ((match = regex.exec(code)) !== null) {
24635
+ rules.push(match[1].trim());
24636
+ }
24637
+ return rules;
24638
+ }
24639
+ function updateSection(doc, section, rules) {
24640
+ const marker = `## ${section}`;
24641
+ const idx = doc.indexOf(marker);
24642
+ if (idx === -1) return appendRules(doc, rules);
24643
+ const nextSection = doc.indexOf("\n## ", idx + marker.length);
24644
+ const before = doc.slice(0, idx + marker.length);
24645
+ const after = nextSection === -1 ? "" : doc.slice(nextSection);
24646
+ return `${before}
24647
+
24648
+ ${rules.map((r) => `- ${r}`).join("\n")}
24649
+ ${after}`;
24650
+ }
24651
+ function appendRules(doc, rules) {
24652
+ return `${doc}
24653
+
24654
+ ## Auto-Generated Rules
24655
+
24656
+ ${rules.map((r) => `- ${r}`).join("\n")}
24657
+ `;
24658
+ }
24659
+
24660
+ // src/tools/parallel-opportunity-detector.ts
24661
+ var ParallelOpportunitySchema = external_exports.object({
24662
+ tasks: external_exports.array(external_exports.object({
24663
+ id: external_exports.string(),
24664
+ dependencies: external_exports.array(external_exports.string()).optional()
24665
+ })).describe("Task list with dependencies")
24666
+ });
24667
+ var parallelOpportunityDetectorTool = {
24668
+ name: "parallel_opportunity_detector",
24669
+ description: "Analyze task dependency graph and recommend parallel strategies",
24670
+ schema: ParallelOpportunitySchema.shape,
24671
+ handler: async (args) => {
24672
+ try {
24673
+ const { tasks } = args;
24674
+ const graph = buildDependencyGraph(tasks);
24675
+ const phases = detectParallelPhases(graph);
24676
+ const recommendation = generateRecommendation(phases);
24677
+ return {
24678
+ content: [{
24679
+ type: "text",
24680
+ text: JSON.stringify(recommendation, null, 2)
24681
+ }]
24682
+ };
24683
+ } catch (error2) {
24684
+ return {
24685
+ content: [{
24686
+ type: "text",
24687
+ text: `Error: ${error2 instanceof Error ? error2.message : String(error2)}`
24688
+ }],
24689
+ isError: true
24690
+ };
24691
+ }
24692
+ }
24693
+ };
24694
+ function buildDependencyGraph(tasks) {
24695
+ const graph = /* @__PURE__ */ new Map();
24696
+ tasks.forEach((t) => graph.set(t.id, t.dependencies || []));
24697
+ return graph;
24698
+ }
24699
+ function detectParallelPhases(graph) {
24700
+ const phases = [];
24701
+ const completed = /* @__PURE__ */ new Set();
24702
+ while (completed.size < graph.size) {
24703
+ const ready = Array.from(graph.entries()).filter(([id, deps]) => !completed.has(id) && deps.every((d) => completed.has(d))).map(([id]) => id);
24704
+ if (ready.length === 0) break;
24705
+ phases.push(ready);
24706
+ ready.forEach((id) => completed.add(id));
24707
+ }
24708
+ return phases;
24709
+ }
24710
+ function generateRecommendation(phases) {
24711
+ return {
24712
+ totalPhases: phases.length,
24713
+ phases: phases.map((p, i) => ({
24714
+ phase: i + 1,
24715
+ parallelTasks: p,
24716
+ count: p.length
24717
+ })),
24718
+ strategy: phases.length > 1 ? "team" : "sequential"
24719
+ };
24720
+ }
24721
+
24722
+ // src/tools/tool-prefix-migration.ts
24723
+ var DEPRECATION_MAP = {
24724
+ // LSP Tools
24725
+ "lsp_hover": { oldName: "lsp_hover", newName: "ultrapower:lsp_hover", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24726
+ "lsp_goto_definition": { oldName: "lsp_goto_definition", newName: "ultrapower:lsp_goto_definition", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24727
+ "lsp_find_references": { oldName: "lsp_find_references", newName: "ultrapower:lsp_find_references", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24728
+ "lsp_document_symbols": { oldName: "lsp_document_symbols", newName: "ultrapower:lsp_document_symbols", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24729
+ "lsp_workspace_symbols": { oldName: "lsp_workspace_symbols", newName: "ultrapower:lsp_workspace_symbols", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24730
+ "lsp_diagnostics": { oldName: "lsp_diagnostics", newName: "ultrapower:lsp_diagnostics", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24731
+ "lsp_servers": { oldName: "lsp_servers", newName: "ultrapower:lsp_servers", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24732
+ "lsp_prepare_rename": { oldName: "lsp_prepare_rename", newName: "ultrapower:lsp_prepare_rename", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24733
+ "lsp_rename": { oldName: "lsp_rename", newName: "ultrapower:lsp_rename", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24734
+ "lsp_code_actions": { oldName: "lsp_code_actions", newName: "ultrapower:lsp_code_actions", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24735
+ "lsp_code_action_resolve": { oldName: "lsp_code_action_resolve", newName: "ultrapower:lsp_code_action_resolve", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24736
+ "lsp_diagnostics_directory": { oldName: "lsp_diagnostics_directory", newName: "ultrapower:lsp_diagnostics_directory", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24737
+ // State Tools
24738
+ "state_read": { oldName: "state_read", newName: "ultrapower:state_read", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24739
+ "state_write": { oldName: "state_write", newName: "ultrapower:state_write", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24740
+ "state_clear": { oldName: "state_clear", newName: "ultrapower:state_clear", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24741
+ "state_list_active": { oldName: "state_list_active", newName: "ultrapower:state_list_active", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24742
+ "state_get_status": { oldName: "state_get_status", newName: "ultrapower:state_get_status", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24743
+ // Notepad Tools
24744
+ "notepad_read": { oldName: "notepad_read", newName: "ultrapower:notepad_read", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24745
+ "notepad_write_priority": { oldName: "notepad_write_priority", newName: "ultrapower:notepad_write_priority", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24746
+ "notepad_write_working": { oldName: "notepad_write_working", newName: "ultrapower:notepad_write_working", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24747
+ "notepad_write_manual": { oldName: "notepad_write_manual", newName: "ultrapower:notepad_write_manual", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24748
+ "notepad_prune": { oldName: "notepad_prune", newName: "ultrapower:notepad_prune", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24749
+ "notepad_stats": { oldName: "notepad_stats", newName: "ultrapower:notepad_stats", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24750
+ // Memory Tools
24751
+ "project_memory_read": { oldName: "project_memory_read", newName: "ultrapower:project_memory_read", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24752
+ "project_memory_write": { oldName: "project_memory_write", newName: "ultrapower:project_memory_write", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24753
+ "project_memory_add_note": { oldName: "project_memory_add_note", newName: "ultrapower:project_memory_add_note", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24754
+ "project_memory_add_directive": { oldName: "project_memory_add_directive", newName: "ultrapower:project_memory_add_directive", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24755
+ // AST Tools
24756
+ "ast_grep_search": { oldName: "ast_grep_search", newName: "ultrapower:ast_grep_search", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24757
+ "ast_grep_replace": { oldName: "ast_grep_replace", newName: "ultrapower:ast_grep_replace", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24758
+ // Python REPL
24759
+ "python_repl": { oldName: "python_repl", newName: "ultrapower:python_repl", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24760
+ // Trace Tools
24761
+ "trace_timeline": { oldName: "trace_timeline", newName: "ultrapower:trace_timeline", deprecatedSince: "5.6.0", removalVersion: "6.0.0" },
24762
+ "trace_summary": { oldName: "trace_summary", newName: "ultrapower:trace_summary", deprecatedSince: "5.6.0", removalVersion: "6.0.0" }
24763
+ };
24764
+ function createDeprecationWarning(info) {
24765
+ return `\u26A0\uFE0F DEPRECATED: Tool '${info.oldName}' is deprecated since v${info.deprecatedSince} and will be removed in v${info.removalVersion}.
24766
+ Please use '${info.newName}' instead.
24767
+
24768
+ `;
24769
+ }
24770
+ function wrapWithDeprecation(tool) {
24771
+ const deprecationInfo = DEPRECATION_MAP[tool.name];
24772
+ if (!deprecationInfo) return tool;
24773
+ const originalHandler = tool.handler;
24774
+ return {
24775
+ ...tool,
24776
+ handler: async (args) => {
24777
+ const result = await originalHandler(args);
24778
+ const warning = createDeprecationWarning(deprecationInfo);
24779
+ if (result.content && result.content[0]) {
24780
+ result.content[0].text = warning + result.content[0].text;
24781
+ }
24782
+ return result;
24783
+ }
24784
+ };
24785
+ }
24786
+ function createPrefixedTool(tool) {
24787
+ return {
24788
+ ...tool,
24789
+ name: `ultrapower:${tool.name}`
24790
+ };
24791
+ }
24792
+ function registerToolWithBothNames(tool) {
24793
+ const prefixedTool = createPrefixedTool(tool);
24794
+ const deprecatedTool = wrapWithDeprecation(tool);
24795
+ return [prefixedTool, deprecatedTool];
24796
+ }
24797
+
24798
+ // src/tools/index.ts
24799
+ var allCustomTools = [
24800
+ ...lspTools.flatMap(registerToolWithBothNames),
24801
+ ...astTools.flatMap(registerToolWithBothNames),
24802
+ ...registerToolWithBothNames(pythonReplTool2),
24803
+ ...stateTools.flatMap(registerToolWithBothNames),
24804
+ ...notepadTools.flatMap(registerToolWithBothNames),
24805
+ ...memoryTools.flatMap(registerToolWithBothNames),
24806
+ ...traceTools.flatMap(registerToolWithBothNames),
24807
+ ...registerToolWithBothNames(dependencyAnalyzerTool),
24808
+ ...registerToolWithBothNames(docSyncTool),
24809
+ ...registerToolWithBothNames(parallelOpportunityDetectorTool),
24810
+ ...skillsTools
23740
24811
  ];
24812
+
24813
+ // src/mcp/namespace-manager.ts
24814
+ function parseNamespace(namespacedName) {
24815
+ const match = namespacedName.match(/^mcp__([^_]+)__(.+)$/);
24816
+ if (!match) return null;
24817
+ return { serverName: match[1], toolName: match[2] };
24818
+ }
24819
+ function isNamespaced(name) {
24820
+ return /^mcp__[^_]+__.+$/.test(name);
24821
+ }
24822
+
24823
+ // src/mcp/tool-resolver.ts
24824
+ function resolveTool(name) {
24825
+ const directMatch = allCustomTools.find((t) => t.name === name);
24826
+ if (directMatch) return directMatch;
24827
+ if (isNamespaced(name)) {
24828
+ const parsed = parseNamespace(name);
24829
+ if (parsed) {
24830
+ return allCustomTools.find((t) => t.name === parsed.toolName);
24831
+ }
24832
+ }
24833
+ return void 0;
24834
+ }
24835
+
24836
+ // src/mcp/timeout.ts
24837
+ var DEFAULT_TIMEOUT_MS = 3e4;
24838
+ async function withTimeout(fn, timeoutMs = DEFAULT_TIMEOUT_MS) {
24839
+ return Promise.race([
24840
+ fn(),
24841
+ new Promise(
24842
+ (_, reject) => setTimeout(() => reject(new Error(`Operation timed out after ${timeoutMs}ms`)), timeoutMs)
24843
+ )
24844
+ ]);
24845
+ }
24846
+
24847
+ // src/mcp/tool-handler.ts
24848
+ async function handleToolCall(name, args) {
24849
+ const tool = resolveTool(name);
24850
+ if (!tool) {
24851
+ return {
24852
+ content: [{ type: "text", text: `Unknown tool: ${name}` }],
24853
+ isError: true
24854
+ };
24855
+ }
24856
+ try {
24857
+ const result = await withTimeout(() => tool.handler(args ?? {}));
24858
+ return {
24859
+ content: result.content,
24860
+ isError: false
24861
+ };
24862
+ } catch (error2) {
24863
+ const message = error2 instanceof Error ? error2.message : String(error2);
24864
+ return {
24865
+ content: [{ type: "text", text: `Error executing ${name}: ${message}` }],
24866
+ isError: true
24867
+ };
24868
+ }
24869
+ }
24870
+
24871
+ // src/mcp/standalone-server.ts
24872
+ var allTools = allCustomTools;
23741
24873
  function zodToJsonSchema2(schema) {
23742
24874
  const rawShape = schema instanceof external_exports.ZodObject ? schema.shape : schema;
23743
24875
  const properties = {};
@@ -23819,26 +24951,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
23819
24951
  });
23820
24952
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
23821
24953
  const { name, arguments: args } = request.params;
23822
- const tool = allTools.find((t) => t.name === name);
23823
- if (!tool) {
23824
- return {
23825
- content: [{ type: "text", text: `Unknown tool: ${name}` }],
23826
- isError: true
23827
- };
23828
- }
23829
- try {
23830
- const result = await tool.handler(args ?? {});
23831
- return {
23832
- content: result.content,
23833
- isError: false
23834
- };
23835
- } catch (error2) {
23836
- const errorMessage = error2 instanceof Error ? error2.message : String(error2);
23837
- return {
23838
- content: [{ type: "text", text: `Error: ${errorMessage}` }],
23839
- isError: true
23840
- };
23841
- }
24954
+ return handleToolCall(name, args);
23842
24955
  });
23843
24956
  async function main() {
23844
24957
  const transport = new StdioServerTransport();