mcp-adr-analysis-server 2.1.9 → 2.1.19

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 (408) hide show
  1. package/README.md +55 -8
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/src/index.d.ts +78 -2
  4. package/dist/src/index.d.ts.map +1 -1
  5. package/dist/src/index.js +1793 -577
  6. package/dist/src/index.js.map +1 -1
  7. package/dist/src/prompts/index.d.ts.map +1 -1
  8. package/dist/src/prompts/index.js +23 -6
  9. package/dist/src/prompts/index.js.map +1 -1
  10. package/dist/src/prompts/validated-pattern-prompts.d.ts +33 -0
  11. package/dist/src/prompts/validated-pattern-prompts.d.ts.map +1 -0
  12. package/dist/src/prompts/validated-pattern-prompts.js +337 -0
  13. package/dist/src/prompts/validated-pattern-prompts.js.map +1 -0
  14. package/dist/src/resources/adr-by-id-resource.d.ts +116 -0
  15. package/dist/src/resources/adr-by-id-resource.d.ts.map +1 -0
  16. package/dist/src/resources/adr-by-id-resource.js +213 -0
  17. package/dist/src/resources/adr-by-id-resource.js.map +1 -0
  18. package/dist/src/resources/code-quality-resource.d.ts +105 -0
  19. package/dist/src/resources/code-quality-resource.d.ts.map +1 -0
  20. package/dist/src/resources/code-quality-resource.js +282 -0
  21. package/dist/src/resources/code-quality-resource.js.map +1 -0
  22. package/dist/src/resources/deployment-history-resource.d.ts +214 -0
  23. package/dist/src/resources/deployment-history-resource.d.ts.map +1 -0
  24. package/dist/src/resources/deployment-history-resource.js +308 -0
  25. package/dist/src/resources/deployment-history-resource.js.map +1 -0
  26. package/dist/src/resources/deployment-status-resource.d.ts +256 -0
  27. package/dist/src/resources/deployment-status-resource.d.ts.map +1 -0
  28. package/dist/src/resources/deployment-status-resource.js +665 -0
  29. package/dist/src/resources/deployment-status-resource.js.map +1 -0
  30. package/dist/src/resources/environment-analysis-resource.d.ts +237 -0
  31. package/dist/src/resources/environment-analysis-resource.d.ts.map +1 -0
  32. package/dist/src/resources/environment-analysis-resource.js +646 -0
  33. package/dist/src/resources/environment-analysis-resource.js.map +1 -0
  34. package/dist/src/resources/index.d.ts +6 -2
  35. package/dist/src/resources/index.d.ts.map +1 -1
  36. package/dist/src/resources/index.js +247 -492
  37. package/dist/src/resources/index.js.map +1 -1
  38. package/dist/src/resources/memory-snapshots-resource.d.ts +180 -0
  39. package/dist/src/resources/memory-snapshots-resource.d.ts.map +1 -0
  40. package/dist/src/resources/memory-snapshots-resource.js +847 -0
  41. package/dist/src/resources/memory-snapshots-resource.js.map +1 -0
  42. package/dist/src/resources/pattern-base-code-by-platform-resource.d.ts +35 -0
  43. package/dist/src/resources/pattern-base-code-by-platform-resource.d.ts.map +1 -0
  44. package/dist/src/resources/pattern-base-code-by-platform-resource.js +72 -0
  45. package/dist/src/resources/pattern-base-code-by-platform-resource.js.map +1 -0
  46. package/dist/src/resources/pattern-by-name-resource.d.ts +53 -0
  47. package/dist/src/resources/pattern-by-name-resource.d.ts.map +1 -0
  48. package/dist/src/resources/pattern-by-name-resource.js +200 -0
  49. package/dist/src/resources/pattern-by-name-resource.js.map +1 -0
  50. package/dist/src/resources/pattern-sources-by-platform-resource.d.ts +26 -0
  51. package/dist/src/resources/pattern-sources-by-platform-resource.d.ts.map +1 -0
  52. package/dist/src/resources/pattern-sources-by-platform-resource.js +59 -0
  53. package/dist/src/resources/pattern-sources-by-platform-resource.js.map +1 -0
  54. package/dist/src/resources/project-metrics-resource.d.ts +180 -0
  55. package/dist/src/resources/project-metrics-resource.d.ts.map +1 -0
  56. package/dist/src/resources/project-metrics-resource.js +487 -0
  57. package/dist/src/resources/project-metrics-resource.js.map +1 -0
  58. package/dist/src/resources/project-status-resource.d.ts +75 -0
  59. package/dist/src/resources/project-status-resource.d.ts.map +1 -0
  60. package/dist/src/resources/project-status-resource.js +189 -0
  61. package/dist/src/resources/project-status-resource.js.map +1 -0
  62. package/dist/src/resources/research-by-topic-resource.d.ts +21 -0
  63. package/dist/src/resources/research-by-topic-resource.d.ts.map +1 -0
  64. package/dist/src/resources/research-by-topic-resource.js +125 -0
  65. package/dist/src/resources/research-by-topic-resource.js.map +1 -0
  66. package/dist/src/resources/research-index-resource.d.ts +100 -0
  67. package/dist/src/resources/research-index-resource.d.ts.map +1 -0
  68. package/dist/src/resources/research-index-resource.js +200 -0
  69. package/dist/src/resources/research-index-resource.js.map +1 -0
  70. package/dist/src/resources/resource-cache.d.ts +144 -0
  71. package/dist/src/resources/resource-cache.d.ts.map +1 -0
  72. package/dist/src/resources/resource-cache.js +316 -0
  73. package/dist/src/resources/resource-cache.js.map +1 -0
  74. package/dist/src/resources/resource-router.d.ts +45 -0
  75. package/dist/src/resources/resource-router.d.ts.map +1 -0
  76. package/dist/src/resources/resource-router.js +96 -0
  77. package/dist/src/resources/resource-router.js.map +1 -0
  78. package/dist/src/resources/rule-by-id-resource.d.ts +38 -0
  79. package/dist/src/resources/rule-by-id-resource.d.ts.map +1 -0
  80. package/dist/src/resources/rule-by-id-resource.js +104 -0
  81. package/dist/src/resources/rule-by-id-resource.js.map +1 -0
  82. package/dist/src/resources/rule-catalog-resource.d.ts +126 -0
  83. package/dist/src/resources/rule-catalog-resource.d.ts.map +1 -0
  84. package/dist/src/resources/rule-catalog-resource.js +224 -0
  85. package/dist/src/resources/rule-catalog-resource.js.map +1 -0
  86. package/dist/src/resources/rule-generation-resource.d.ts +80 -0
  87. package/dist/src/resources/rule-generation-resource.d.ts.map +1 -0
  88. package/dist/src/resources/rule-generation-resource.js +282 -0
  89. package/dist/src/resources/rule-generation-resource.js.map +1 -0
  90. package/dist/src/resources/technology-by-name-resource.d.ts +43 -0
  91. package/dist/src/resources/technology-by-name-resource.d.ts.map +1 -0
  92. package/dist/src/resources/technology-by-name-resource.js +176 -0
  93. package/dist/src/resources/technology-by-name-resource.js.map +1 -0
  94. package/dist/src/resources/todo-by-id-resource.d.ts +46 -0
  95. package/dist/src/resources/todo-by-id-resource.d.ts.map +1 -0
  96. package/dist/src/resources/todo-by-id-resource.js +192 -0
  97. package/dist/src/resources/todo-by-id-resource.js.map +1 -0
  98. package/dist/src/resources/todo-list-resource.d.ts +96 -0
  99. package/dist/src/resources/todo-list-resource.d.ts.map +1 -0
  100. package/dist/src/resources/todo-list-resource.js +209 -0
  101. package/dist/src/resources/todo-list-resource.js.map +1 -0
  102. package/dist/src/resources/validated-pattern-by-platform-resource.d.ts +14 -0
  103. package/dist/src/resources/validated-pattern-by-platform-resource.d.ts.map +1 -0
  104. package/dist/src/resources/validated-pattern-by-platform-resource.js +45 -0
  105. package/dist/src/resources/validated-pattern-by-platform-resource.js.map +1 -0
  106. package/dist/src/resources/validated-patterns-catalog-resource.d.ts +36 -0
  107. package/dist/src/resources/validated-patterns-catalog-resource.d.ts.map +1 -0
  108. package/dist/src/resources/validated-patterns-catalog-resource.js +57 -0
  109. package/dist/src/resources/validated-patterns-catalog-resource.js.map +1 -0
  110. package/dist/src/templates/domain-knowledge-templates.d.ts.map +1 -1
  111. package/dist/src/templates/domain-knowledge-templates.js +49 -49
  112. package/dist/src/templates/domain-knowledge-templates.js.map +1 -1
  113. package/dist/src/tools/adr-bootstrap-validation-tool.d.ts.map +1 -1
  114. package/dist/src/tools/adr-bootstrap-validation-tool.js +214 -4
  115. package/dist/src/tools/adr-bootstrap-validation-tool.js.map +1 -1
  116. package/dist/src/tools/adr-suggestion-tool.d.ts +2 -2
  117. package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
  118. package/dist/src/tools/adr-suggestion-tool.js +129 -12
  119. package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
  120. package/dist/src/tools/adr-validation-tool.d.ts +98 -0
  121. package/dist/src/tools/adr-validation-tool.d.ts.map +1 -0
  122. package/dist/src/tools/adr-validation-tool.js +372 -0
  123. package/dist/src/tools/adr-validation-tool.js.map +1 -0
  124. package/dist/src/tools/bootstrap-validation-loop-tool.d.ts +262 -0
  125. package/dist/src/tools/bootstrap-validation-loop-tool.d.ts.map +1 -0
  126. package/dist/src/tools/bootstrap-validation-loop-tool.js +1934 -0
  127. package/dist/src/tools/bootstrap-validation-loop-tool.js.map +1 -0
  128. package/dist/src/tools/conversation-memory-tool.d.ts +48 -0
  129. package/dist/src/tools/conversation-memory-tool.d.ts.map +1 -0
  130. package/dist/src/tools/conversation-memory-tool.js +254 -0
  131. package/dist/src/tools/conversation-memory-tool.js.map +1 -0
  132. package/dist/src/tools/deployment-analysis-tool.d.ts.map +1 -1
  133. package/dist/src/tools/deployment-analysis-tool.js +82 -6
  134. package/dist/src/tools/deployment-analysis-tool.js.map +1 -1
  135. package/dist/src/tools/deployment-guidance-tool.d.ts.map +1 -1
  136. package/dist/src/tools/deployment-guidance-tool.js +126 -25
  137. package/dist/src/tools/deployment-guidance-tool.js.map +1 -1
  138. package/dist/src/tools/deployment-readiness-tool.d.ts.map +1 -1
  139. package/dist/src/tools/deployment-readiness-tool.js +166 -5
  140. package/dist/src/tools/deployment-readiness-tool.js.map +1 -1
  141. package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
  142. package/dist/src/tools/environment-analysis-tool.js +36 -1
  143. package/dist/src/tools/environment-analysis-tool.js.map +1 -1
  144. package/dist/src/tools/expand-analysis-tool.d.ts +23 -0
  145. package/dist/src/tools/expand-analysis-tool.d.ts.map +1 -0
  146. package/dist/src/tools/expand-analysis-tool.js +107 -0
  147. package/dist/src/tools/expand-analysis-tool.js.map +1 -0
  148. package/dist/src/tools/get-server-context-tool.d.ts +67 -0
  149. package/dist/src/tools/get-server-context-tool.d.ts.map +1 -0
  150. package/dist/src/tools/get-server-context-tool.js +75 -0
  151. package/dist/src/tools/get-server-context-tool.js.map +1 -0
  152. package/dist/src/tools/interactive-adr-planning-tool.d.ts.map +1 -1
  153. package/dist/src/tools/interactive-adr-planning-tool.js +82 -9
  154. package/dist/src/tools/interactive-adr-planning-tool.js.map +1 -1
  155. package/dist/src/tools/llm-cloud-management-tool.d.ts +62 -0
  156. package/dist/src/tools/llm-cloud-management-tool.d.ts.map +1 -0
  157. package/dist/src/tools/llm-cloud-management-tool.js +202 -0
  158. package/dist/src/tools/llm-cloud-management-tool.js.map +1 -0
  159. package/dist/src/tools/llm-database-management-tool.d.ts +62 -0
  160. package/dist/src/tools/llm-database-management-tool.d.ts.map +1 -0
  161. package/dist/src/tools/llm-database-management-tool.js +203 -0
  162. package/dist/src/tools/llm-database-management-tool.js.map +1 -0
  163. package/dist/src/tools/llm-web-search-tool.d.ts +59 -0
  164. package/dist/src/tools/llm-web-search-tool.d.ts.map +1 -0
  165. package/dist/src/tools/llm-web-search-tool.js +165 -0
  166. package/dist/src/tools/llm-web-search-tool.js.map +1 -0
  167. package/dist/src/tools/mcp-planning-tool.d.ts.map +1 -1
  168. package/dist/src/tools/mcp-planning-tool.js +10 -3
  169. package/dist/src/tools/mcp-planning-tool.js.map +1 -1
  170. package/dist/src/tools/memory-loading-tool.d.ts.map +1 -1
  171. package/dist/src/tools/memory-loading-tool.js +4 -2
  172. package/dist/src/tools/memory-loading-tool.js.map +1 -1
  173. package/dist/src/tools/perform-research-tool.d.ts +61 -0
  174. package/dist/src/tools/perform-research-tool.d.ts.map +1 -0
  175. package/dist/src/tools/perform-research-tool.js +324 -0
  176. package/dist/src/tools/perform-research-tool.js.map +1 -0
  177. package/dist/src/tools/research-question-tool.d.ts.map +1 -1
  178. package/dist/src/tools/research-question-tool.js +11 -9
  179. package/dist/src/tools/research-question-tool.js.map +1 -1
  180. package/dist/src/tools/review-existing-adrs-tool.d.ts.map +1 -1
  181. package/dist/src/tools/review-existing-adrs-tool.js +42 -3
  182. package/dist/src/tools/review-existing-adrs-tool.js.map +1 -1
  183. package/dist/src/tools/tool-chain-orchestrator.d.ts +15 -94
  184. package/dist/src/tools/tool-chain-orchestrator.d.ts.map +1 -1
  185. package/dist/src/tools/tool-chain-orchestrator.js +2 -2
  186. package/dist/src/tools/tool-chain-orchestrator.js.map +1 -1
  187. package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts +25 -120
  188. package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts.map +1 -1
  189. package/dist/src/tools/troubleshoot-guided-workflow-tool.js +91 -2
  190. package/dist/src/tools/troubleshoot-guided-workflow-tool.js.map +1 -1
  191. package/dist/src/types/ape-framework.d.ts +50 -283
  192. package/dist/src/types/ape-framework.d.ts.map +1 -1
  193. package/dist/src/types/conversation-context.d.ts.map +1 -1
  194. package/dist/src/types/conversation-context.js +12 -12
  195. package/dist/src/types/conversation-context.js.map +1 -1
  196. package/dist/src/types/conversation-memory.d.ts +184 -0
  197. package/dist/src/types/conversation-memory.d.ts.map +1 -0
  198. package/dist/src/types/conversation-memory.js +8 -0
  199. package/dist/src/types/conversation-memory.js.map +1 -0
  200. package/dist/src/types/index.d.ts +112 -339
  201. package/dist/src/types/index.d.ts.map +1 -1
  202. package/dist/src/types/knowledge-generation.d.ts +96 -401
  203. package/dist/src/types/knowledge-generation.d.ts.map +1 -1
  204. package/dist/src/types/knowledge-graph-schemas.d.ts +77 -715
  205. package/dist/src/types/knowledge-graph-schemas.d.ts.map +1 -1
  206. package/dist/src/types/knowledge-graph-schemas.js +8 -8
  207. package/dist/src/types/knowledge-graph-schemas.js.map +1 -1
  208. package/dist/src/types/memory-entities.d.ts +1230 -6164
  209. package/dist/src/types/memory-entities.d.ts.map +1 -1
  210. package/dist/src/types/memory-entities.js +8 -8
  211. package/dist/src/types/memory-entities.js.map +1 -1
  212. package/dist/src/types/reflexion-framework.d.ts +35 -264
  213. package/dist/src/types/reflexion-framework.d.ts.map +1 -1
  214. package/dist/src/types/reflexion-framework.js +1 -1
  215. package/dist/src/types/reflexion-framework.js.map +1 -1
  216. package/dist/src/types/state-reinforcement.d.ts +87 -0
  217. package/dist/src/types/state-reinforcement.d.ts.map +1 -0
  218. package/dist/src/types/state-reinforcement.js +5 -0
  219. package/dist/src/types/state-reinforcement.js.map +1 -0
  220. package/dist/src/types/tiered-response.d.ts +61 -0
  221. package/dist/src/types/tiered-response.d.ts.map +1 -0
  222. package/dist/src/types/tiered-response.js +8 -0
  223. package/dist/src/types/tiered-response.js.map +1 -0
  224. package/dist/src/types/tool-context.d.ts +50 -0
  225. package/dist/src/types/tool-context.d.ts.map +1 -0
  226. package/dist/src/types/tool-context.js +20 -0
  227. package/dist/src/types/tool-context.js.map +1 -0
  228. package/dist/src/utils/adr-action-analyzer.d.ts +23 -0
  229. package/dist/src/utils/adr-action-analyzer.d.ts.map +1 -0
  230. package/dist/src/utils/adr-action-analyzer.js +323 -0
  231. package/dist/src/utils/adr-action-analyzer.js.map +1 -0
  232. package/dist/src/utils/adr-context-detector.d.ts +33 -0
  233. package/dist/src/utils/adr-context-detector.d.ts.map +1 -0
  234. package/dist/src/utils/adr-context-detector.js +279 -0
  235. package/dist/src/utils/adr-context-detector.js.map +1 -0
  236. package/dist/src/utils/adr-discovery.d.ts +28 -2
  237. package/dist/src/utils/adr-discovery.d.ts.map +1 -1
  238. package/dist/src/utils/adr-discovery.js +91 -7
  239. package/dist/src/utils/adr-discovery.js.map +1 -1
  240. package/dist/src/utils/adr-knowledge-initializer.d.ts +54 -0
  241. package/dist/src/utils/adr-knowledge-initializer.d.ts.map +1 -0
  242. package/dist/src/utils/adr-knowledge-initializer.js +240 -0
  243. package/dist/src/utils/adr-knowledge-initializer.js.map +1 -0
  244. package/dist/src/utils/adr-timeline-extractor.d.ts +21 -0
  245. package/dist/src/utils/adr-timeline-extractor.d.ts.map +1 -0
  246. package/dist/src/utils/adr-timeline-extractor.js +294 -0
  247. package/dist/src/utils/adr-timeline-extractor.js.map +1 -0
  248. package/dist/src/utils/adr-timeline-types.d.ts +234 -0
  249. package/dist/src/utils/adr-timeline-types.d.ts.map +1 -0
  250. package/dist/src/utils/adr-timeline-types.js +7 -0
  251. package/dist/src/utils/adr-timeline-types.js.map +1 -0
  252. package/dist/src/utils/ai-executor.d.ts +36 -0
  253. package/dist/src/utils/ai-executor.d.ts.map +1 -1
  254. package/dist/src/utils/ai-executor.js +39 -3
  255. package/dist/src/utils/ai-executor.js.map +1 -1
  256. package/dist/src/utils/apply-cot-enhancement.d.ts.map +1 -1
  257. package/dist/src/utils/apply-cot-enhancement.js +15 -15
  258. package/dist/src/utils/apply-cot-enhancement.js.map +1 -1
  259. package/dist/src/utils/automatic-prompt-engineering.d.ts.map +1 -1
  260. package/dist/src/utils/automatic-prompt-engineering.js +68 -58
  261. package/dist/src/utils/automatic-prompt-engineering.js.map +1 -1
  262. package/dist/src/utils/conditional-request.d.ts +105 -0
  263. package/dist/src/utils/conditional-request.d.ts.map +1 -0
  264. package/dist/src/utils/conditional-request.js +186 -0
  265. package/dist/src/utils/conditional-request.js.map +1 -0
  266. package/dist/src/utils/config.d.ts +72 -18
  267. package/dist/src/utils/config.d.ts.map +1 -1
  268. package/dist/src/utils/config.js +75 -0
  269. package/dist/src/utils/config.js.map +1 -1
  270. package/dist/src/utils/context-document-manager.d.ts +112 -0
  271. package/dist/src/utils/context-document-manager.d.ts.map +1 -0
  272. package/dist/src/utils/context-document-manager.js +351 -0
  273. package/dist/src/utils/context-document-manager.js.map +1 -0
  274. package/dist/src/utils/conversation-memory-manager.d.ts +86 -0
  275. package/dist/src/utils/conversation-memory-manager.d.ts.map +1 -0
  276. package/dist/src/utils/conversation-memory-manager.js +443 -0
  277. package/dist/src/utils/conversation-memory-manager.js.map +1 -0
  278. package/dist/src/utils/dag-executor.d.ts +106 -0
  279. package/dist/src/utils/dag-executor.d.ts.map +1 -0
  280. package/dist/src/utils/dag-executor.js +420 -0
  281. package/dist/src/utils/dag-executor.js.map +1 -0
  282. package/dist/src/utils/deployment-analysis.d.ts.map +1 -1
  283. package/dist/src/utils/deployment-analysis.js +17 -9
  284. package/dist/src/utils/deployment-analysis.js.map +1 -1
  285. package/dist/src/utils/deployment-type-registry.d.ts +52 -0
  286. package/dist/src/utils/deployment-type-registry.d.ts.map +1 -0
  287. package/dist/src/utils/deployment-type-registry.js +543 -0
  288. package/dist/src/utils/deployment-type-registry.js.map +1 -0
  289. package/dist/src/utils/dynamic-deployment-intelligence.d.ts +117 -0
  290. package/dist/src/utils/dynamic-deployment-intelligence.d.ts.map +1 -0
  291. package/dist/src/utils/dynamic-deployment-intelligence.js +445 -0
  292. package/dist/src/utils/dynamic-deployment-intelligence.js.map +1 -0
  293. package/dist/src/utils/environment-analysis.d.ts.map +1 -1
  294. package/dist/src/utils/environment-analysis.js +63 -44
  295. package/dist/src/utils/environment-analysis.js.map +1 -1
  296. package/dist/src/utils/environment-capability-registry.d.ts +101 -0
  297. package/dist/src/utils/environment-capability-registry.d.ts.map +1 -0
  298. package/dist/src/utils/environment-capability-registry.js +489 -0
  299. package/dist/src/utils/environment-capability-registry.js.map +1 -0
  300. package/dist/src/utils/index.d.ts +3 -3
  301. package/dist/src/utils/index.d.ts.map +1 -1
  302. package/dist/src/utils/index.js +3 -3
  303. package/dist/src/utils/index.js.map +1 -1
  304. package/dist/src/utils/knowledge-generation.d.ts.map +1 -1
  305. package/dist/src/utils/knowledge-generation.js +61 -35
  306. package/dist/src/utils/knowledge-generation.js.map +1 -1
  307. package/dist/src/utils/knowledge-graph-manager.d.ts +19 -0
  308. package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
  309. package/dist/src/utils/knowledge-graph-manager.js +165 -1
  310. package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
  311. package/dist/src/utils/llm-artifact-detector.d.ts.map +1 -1
  312. package/dist/src/utils/llm-artifact-detector.js +28 -24
  313. package/dist/src/utils/llm-artifact-detector.js.map +1 -1
  314. package/dist/src/utils/mermaid-diagrams.d.ts +101 -0
  315. package/dist/src/utils/mermaid-diagrams.d.ts.map +1 -0
  316. package/dist/src/utils/mermaid-diagrams.js +445 -0
  317. package/dist/src/utils/mermaid-diagrams.js.map +1 -0
  318. package/dist/src/utils/monitoring.d.ts +249 -0
  319. package/dist/src/utils/monitoring.d.ts.map +1 -0
  320. package/dist/src/utils/monitoring.js +513 -0
  321. package/dist/src/utils/monitoring.js.map +1 -0
  322. package/dist/src/utils/pattern-contribution-helper.d.ts +60 -0
  323. package/dist/src/utils/pattern-contribution-helper.d.ts.map +1 -0
  324. package/dist/src/utils/pattern-contribution-helper.js +308 -0
  325. package/dist/src/utils/pattern-contribution-helper.js.map +1 -0
  326. package/dist/src/utils/pattern-loader.d.ts +183 -0
  327. package/dist/src/utils/pattern-loader.d.ts.map +1 -0
  328. package/dist/src/utils/pattern-loader.js +200 -0
  329. package/dist/src/utils/pattern-loader.js.map +1 -0
  330. package/dist/src/utils/pattern-research-utility.d.ts +107 -0
  331. package/dist/src/utils/pattern-research-utility.d.ts.map +1 -0
  332. package/dist/src/utils/pattern-research-utility.js +360 -0
  333. package/dist/src/utils/pattern-research-utility.js.map +1 -0
  334. package/dist/src/utils/pattern-to-dag-converter.d.ts +62 -0
  335. package/dist/src/utils/pattern-to-dag-converter.d.ts.map +1 -0
  336. package/dist/src/utils/pattern-to-dag-converter.js +265 -0
  337. package/dist/src/utils/pattern-to-dag-converter.js.map +1 -0
  338. package/dist/src/utils/platform-detector.d.ts +86 -0
  339. package/dist/src/utils/platform-detector.d.ts.map +1 -0
  340. package/dist/src/utils/platform-detector.js +509 -0
  341. package/dist/src/utils/platform-detector.js.map +1 -0
  342. package/dist/src/utils/prompt-composition.d.ts.map +1 -1
  343. package/dist/src/utils/prompt-composition.js +1 -4
  344. package/dist/src/utils/prompt-composition.js.map +1 -1
  345. package/dist/src/utils/reflexion.d.ts.map +1 -1
  346. package/dist/src/utils/reflexion.js +51 -42
  347. package/dist/src/utils/reflexion.js.map +1 -1
  348. package/dist/src/utils/research-integration.d.ts.map +1 -1
  349. package/dist/src/utils/research-integration.js +8 -2
  350. package/dist/src/utils/research-integration.js.map +1 -1
  351. package/dist/src/utils/research-orchestrator.d.ts +209 -0
  352. package/dist/src/utils/research-orchestrator.d.ts.map +1 -0
  353. package/dist/src/utils/research-orchestrator.js +863 -0
  354. package/dist/src/utils/research-orchestrator.js.map +1 -0
  355. package/dist/src/utils/research-questions.d.ts.map +1 -1
  356. package/dist/src/utils/research-questions.js +4 -1
  357. package/dist/src/utils/research-questions.js.map +1 -1
  358. package/dist/src/utils/resource-extractor.d.ts +57 -0
  359. package/dist/src/utils/resource-extractor.d.ts.map +1 -0
  360. package/dist/src/utils/resource-extractor.js +323 -0
  361. package/dist/src/utils/resource-extractor.js.map +1 -0
  362. package/dist/src/utils/resource-versioning.d.ts +124 -0
  363. package/dist/src/utils/resource-versioning.d.ts.map +1 -0
  364. package/dist/src/utils/resource-versioning.js +272 -0
  365. package/dist/src/utils/resource-versioning.js.map +1 -0
  366. package/dist/src/utils/root-manager.d.ts +118 -0
  367. package/dist/src/utils/root-manager.d.ts.map +1 -0
  368. package/dist/src/utils/root-manager.js +154 -0
  369. package/dist/src/utils/root-manager.js.map +1 -0
  370. package/dist/src/utils/rule-generation.d.ts.map +1 -1
  371. package/dist/src/utils/rule-generation.js +4 -1
  372. package/dist/src/utils/rule-generation.js.map +1 -1
  373. package/dist/src/utils/server-context-generator.d.ts +47 -0
  374. package/dist/src/utils/server-context-generator.d.ts.map +1 -0
  375. package/dist/src/utils/server-context-generator.js +666 -0
  376. package/dist/src/utils/server-context-generator.js.map +1 -0
  377. package/dist/src/utils/state-reinforcement-manager.d.ts +60 -0
  378. package/dist/src/utils/state-reinforcement-manager.d.ts.map +1 -0
  379. package/dist/src/utils/state-reinforcement-manager.js +200 -0
  380. package/dist/src/utils/state-reinforcement-manager.js.map +1 -0
  381. package/dist/src/utils/system-card-manager.d.ts +194 -0
  382. package/dist/src/utils/system-card-manager.d.ts.map +1 -0
  383. package/dist/src/utils/system-card-manager.js +336 -0
  384. package/dist/src/utils/system-card-manager.js.map +1 -0
  385. package/dist/src/utils/tiered-response-manager.d.ts +40 -0
  386. package/dist/src/utils/tiered-response-manager.d.ts.map +1 -0
  387. package/dist/src/utils/tiered-response-manager.js +243 -0
  388. package/dist/src/utils/tiered-response-manager.js.map +1 -0
  389. package/dist/src/utils/tree-sitter-analyzer.d.ts.map +1 -1
  390. package/dist/src/utils/tree-sitter-analyzer.js +83 -11
  391. package/dist/src/utils/tree-sitter-analyzer.js.map +1 -1
  392. package/dist/src/utils/validated-pattern-definitions.d.ts +219 -0
  393. package/dist/src/utils/validated-pattern-definitions.d.ts.map +1 -0
  394. package/dist/src/utils/validated-pattern-definitions.js +1511 -0
  395. package/dist/src/utils/validated-pattern-definitions.js.map +1 -0
  396. package/package.json +21 -12
  397. package/dist/src/prompts/todo-prompts.d.ts +0 -49
  398. package/dist/src/prompts/todo-prompts.d.ts.map +0 -1
  399. package/dist/src/prompts/todo-prompts.js +0 -824
  400. package/dist/src/prompts/todo-prompts.js.map +0 -1
  401. package/dist/src/types/todo-json-schemas.d.ts +0 -17
  402. package/dist/src/types/todo-json-schemas.d.ts.map +0 -1
  403. package/dist/src/types/todo-json-schemas.js +0 -9
  404. package/dist/src/types/todo-json-schemas.js.map +0 -1
  405. package/dist/src/utils/todo-file-watcher.d.ts +0 -14
  406. package/dist/src/utils/todo-file-watcher.d.ts.map +0 -1
  407. package/dist/src/utils/todo-file-watcher.js +0 -25
  408. package/dist/src/utils/todo-file-watcher.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Types for state reinforcement and context injection
3
+ */
4
+ /**
5
+ * Context reinforcement configuration
6
+ */
7
+ export interface ContextReinforcementConfig {
8
+ /**
9
+ * Inject context every N turns
10
+ * @default 5
11
+ */
12
+ turnInterval: number;
13
+ /**
14
+ * Inject context when response exceeds this token count
15
+ * @default 3000
16
+ */
17
+ tokenThreshold: number;
18
+ /**
19
+ * Include recent knowledge graph intents
20
+ * @default true
21
+ */
22
+ includeKnowledgeGraphContext: boolean;
23
+ /**
24
+ * Maximum number of recent intents to include
25
+ * @default 3
26
+ */
27
+ maxRecentIntents: number;
28
+ }
29
+ /**
30
+ * Enriched response with context reinforcement
31
+ */
32
+ export interface EnrichedResponse {
33
+ /**
34
+ * Original response content
35
+ */
36
+ originalContent: string;
37
+ /**
38
+ * Enhanced content with context injection
39
+ */
40
+ enrichedContent: string;
41
+ /**
42
+ * Whether context was injected
43
+ */
44
+ contextInjected: boolean;
45
+ /**
46
+ * Reason for context injection (turn-based, token-threshold, or none)
47
+ */
48
+ injectionReason?: 'turn-interval' | 'token-threshold' | 'none';
49
+ /**
50
+ * Token count of original response
51
+ */
52
+ tokenCount: number;
53
+ /**
54
+ * Current turn number
55
+ */
56
+ turnNumber: number;
57
+ }
58
+ /**
59
+ * Core context reminder structure
60
+ */
61
+ export interface CoreContextReminder {
62
+ /**
63
+ * Primary objective reminder
64
+ */
65
+ objective: string;
66
+ /**
67
+ * Key architectural principles
68
+ */
69
+ principles: string[];
70
+ /**
71
+ * Recent knowledge graph intents
72
+ */
73
+ recentIntents?: Array<{
74
+ intent: string;
75
+ timestamp: string;
76
+ outcome: string;
77
+ }>;
78
+ /**
79
+ * Active conversation state
80
+ */
81
+ conversationState?: {
82
+ phase: string;
83
+ focus: string;
84
+ nextSteps: string[];
85
+ };
86
+ }
87
+ //# sourceMappingURL=state-reinforcement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-reinforcement.d.ts","sourceRoot":"","sources":["../../../src/types/state-reinforcement.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,4BAA4B,EAAE,OAAO,CAAC;IAEtC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,GAAG,iBAAiB,GAAG,MAAM,CAAC;IAE/D;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC;QACpB,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IAEH;;OAEG;IACH,iBAAiB,CAAC,EAAE;QAClB,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;CACH"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Types for state reinforcement and context injection
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=state-reinforcement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-reinforcement.js","sourceRoot":"","sources":["../../../src/types/state-reinforcement.ts"],"names":[],"mappings":"AAAA;;GAEG"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Tiered Response System
3
+ *
4
+ * Implements conversational summarization to combat context decay.
5
+ * Returns compact summaries with references to full analysis stored in memory.
6
+ */
7
+ export interface TieredResponseSection {
8
+ /** Brief summary of this section (100-200 tokens) */
9
+ summary: string;
10
+ /** Whether full details are available for expansion */
11
+ hasDetails: boolean;
12
+ /** Token count of full content (for transparency) */
13
+ fullTokenCount?: number;
14
+ }
15
+ export interface TieredResponse {
16
+ /** Executive summary (300-500 tokens) - always shown */
17
+ summary: string;
18
+ /** Unique ID to retrieve full analysis from memory */
19
+ expandableId: string;
20
+ /** Timestamp when analysis was created */
21
+ timestamp: string;
22
+ /** Tool that generated this response */
23
+ toolName: string;
24
+ /** Expandable sections with summaries */
25
+ sections: Record<string, TieredResponseSection>;
26
+ /** Estimated token savings vs full response */
27
+ tokenSavings?: {
28
+ summaryTokens: number;
29
+ fullTokens: number;
30
+ savingsPercent: number;
31
+ };
32
+ }
33
+ export interface ExpandableContent {
34
+ /** Full analysis content */
35
+ content: string;
36
+ /** Section breakdown for partial expansion */
37
+ sections: Record<string, string>;
38
+ /** Metadata */
39
+ metadata: {
40
+ toolName: string;
41
+ timestamp: string;
42
+ toolArgs: any;
43
+ tokenCount: number;
44
+ };
45
+ }
46
+ /**
47
+ * Configuration for tiered response generation
48
+ */
49
+ export interface TieredResponseConfig {
50
+ /** Maximum tokens for summary (default: 500) */
51
+ maxSummaryTokens?: number;
52
+ /** Maximum tokens per section summary (default: 150) */
53
+ maxSectionSummaryTokens?: number;
54
+ /** Whether to use AI for summarization (default: true) */
55
+ useAiSummarization?: boolean;
56
+ /** Temperature for AI summarization (default: 0.3) */
57
+ summarizationTemperature?: number;
58
+ /** Minimum token count to trigger tiering (default: 2000) */
59
+ tieringThreshold?: number;
60
+ }
61
+ //# sourceMappingURL=tiered-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tiered-response.d.ts","sourceRoot":"","sources":["../../../src/types/tiered-response.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,qBAAqB;IACpC,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,qDAAqD;IACrD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAEhB,sDAAsD;IACtD,YAAY,EAAE,MAAM,CAAC;IAErB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAElB,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IAEjB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAEhD,+CAA+C;IAC/C,YAAY,CAAC,EAAE;QACb,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAED,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAEhB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEjC,eAAe;IACf,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,GAAG,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,wDAAwD;IACxD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC,0DAA0D;IAC1D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,sDAAsD;IACtD,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Tiered Response System
3
+ *
4
+ * Implements conversational summarization to combat context decay.
5
+ * Returns compact summaries with references to full analysis stored in memory.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=tiered-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tiered-response.js","sourceRoot":"","sources":["../../../src/types/tiered-response.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Tool Context for MCP Protocol
3
+ *
4
+ * Provides logging and progress notification capabilities to tools,
5
+ * following MCP best practices for real-time user feedback.
6
+ *
7
+ * @see https://modelcontextprotocol.io/docs/concepts/tools
8
+ */
9
+ /**
10
+ * Context passed to tool implementations for logging and progress reporting
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * async function myTool(args: MyArgs, context: ToolContext) {
15
+ * context.info('Starting operation...');
16
+ * // ... do work ...
17
+ * context.report_progress(50, 100);
18
+ * // ... more work ...
19
+ * context.info('Operation complete');
20
+ * }
21
+ * ```
22
+ */
23
+ export interface ToolContext {
24
+ /**
25
+ * Send an informational log message to the client
26
+ * @param message - Log message to display
27
+ */
28
+ info(message: string): void;
29
+ /**
30
+ * Report progress on long-running operations
31
+ * @param progress - Current progress value
32
+ * @param total - Optional total value for percentage calculation
33
+ */
34
+ report_progress(progress: number, total?: number): void;
35
+ /**
36
+ * Send a warning log message to the client
37
+ * @param message - Warning message to display
38
+ */
39
+ warn?(message: string): void;
40
+ /**
41
+ * Send an error log message to the client
42
+ * @param message - Error message to display
43
+ */
44
+ error?(message: string): void;
45
+ }
46
+ /**
47
+ * Create a no-op context for tools that don't support progress
48
+ */
49
+ export declare function createNoOpContext(): ToolContext;
50
+ //# sourceMappingURL=tool-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-context.d.ts","sourceRoot":"","sources":["../../../src/types/tool-context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExD;;;OAGG;IACH,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;;OAGG;IACH,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAO/C"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Tool Context for MCP Protocol
3
+ *
4
+ * Provides logging and progress notification capabilities to tools,
5
+ * following MCP best practices for real-time user feedback.
6
+ *
7
+ * @see https://modelcontextprotocol.io/docs/concepts/tools
8
+ */
9
+ /**
10
+ * Create a no-op context for tools that don't support progress
11
+ */
12
+ export function createNoOpContext() {
13
+ return {
14
+ info: () => { },
15
+ report_progress: () => { },
16
+ warn: () => { },
17
+ error: () => { },
18
+ };
19
+ }
20
+ //# sourceMappingURL=tool-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-context.js","sourceRoot":"","sources":["../../../src/types/tool-context.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2CH;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QACd,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;QACzB,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QACd,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;KAChB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * ADR Action Analyzer
3
+ *
4
+ * Generates actionable work items from timeline analysis
5
+ * with priority scoring and effort estimation
6
+ */
7
+ import type { AdrWorkQueue, ThresholdProfile } from './adr-timeline-types.js';
8
+ import type { DiscoveredAdr } from './adr-discovery.js';
9
+ /**
10
+ * Generate action items from ADRs based on timeline analysis
11
+ */
12
+ export declare function generateActionItems(adrs: DiscoveredAdr[], baseThresholds: ThresholdProfile, options?: {
13
+ useAdrTypeModifiers?: boolean;
14
+ projectPath?: string;
15
+ }): Promise<AdrWorkQueue>;
16
+ /**
17
+ * Format action items into a readable report
18
+ */
19
+ export declare function formatActionReport(workQueue: AdrWorkQueue, context?: {
20
+ projectPath: string;
21
+ thresholdProfile: string;
22
+ }): string;
23
+ //# sourceMappingURL=adr-action-analyzer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adr-action-analyzer.d.ts","sourceRoot":"","sources":["../../../src/utils/adr-action-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAEV,YAAY,EACZ,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,aAAa,EAAE,EACrB,cAAc,EAAE,gBAAgB,EAChC,OAAO,GAAE;IACP,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,OAAO,CAAC,YAAY,CAAC,CAuBvB;AA8QD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,YAAY,EACvB,OAAO,CAAC,EAAE;IACR,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,GACA,MAAM,CA0DR"}
@@ -0,0 +1,323 @@
1
+ /**
2
+ * ADR Action Analyzer
3
+ *
4
+ * Generates actionable work items from timeline analysis
5
+ * with priority scoring and effort estimation
6
+ */
7
+ import { detectAdrType, adjustThresholdsForAdrType } from './adr-context-detector.js';
8
+ /**
9
+ * Generate action items from ADRs based on timeline analysis
10
+ */
11
+ export async function generateActionItems(adrs, baseThresholds, options = {}) {
12
+ const { useAdrTypeModifiers = true } = options;
13
+ const actionItems = [];
14
+ for (const adr of adrs) {
15
+ if (!adr.timeline) {
16
+ continue; // Skip ADRs without timeline data
17
+ }
18
+ // Detect ADR type and adjust thresholds if enabled
19
+ const adrType = useAdrTypeModifiers ? detectAdrType(adr) : 'feature';
20
+ const thresholds = useAdrTypeModifiers
21
+ ? adjustThresholdsForAdrType(baseThresholds, adrType)
22
+ : baseThresholds;
23
+ // Analyze this ADR for actions
24
+ const actions = analyzeAdrActions(adr, thresholds);
25
+ actionItems.push(...actions);
26
+ }
27
+ // Sort and categorize actions
28
+ return categorizeActions(actionItems);
29
+ }
30
+ /**
31
+ * Analyze a single ADR for required actions
32
+ */
33
+ function analyzeAdrActions(adr, thresholds) {
34
+ const actions = [];
35
+ const timeline = adr.timeline;
36
+ const status = adr.status.toLowerCase();
37
+ // RULE 1: Stale Proposed ADRs (CRITICAL)
38
+ if (status === 'proposed' && timeline.age_days > thresholds.staleProposedDays) {
39
+ const urgency = calculateUrgencyScore(timeline.age_days, thresholds.staleProposedDays, thresholds.staleProposedDays * 2);
40
+ actions.push({
41
+ adrFilename: adr.filename,
42
+ adrTitle: adr.title,
43
+ adrStatus: adr.status,
44
+ priority: urgency > 80 ? 'critical' : 'high',
45
+ urgencyScore: urgency,
46
+ actionType: 'review',
47
+ actionDescription: 'Review and make final decision',
48
+ rationale: `ADR has been in "Proposed" status for ${timeline.age_days} days ` +
49
+ `(>${thresholds.staleProposedDays} days threshold). ` +
50
+ `Prolonged proposed status creates uncertainty and blocks related work.`,
51
+ estimatedEffort: 'medium',
52
+ dueDate: addDays(new Date(), 14).toISOString(),
53
+ blockers: [
54
+ 'May need stakeholder alignment',
55
+ 'May require additional research',
56
+ 'Team may need to evaluate alternatives',
57
+ ],
58
+ timeline,
59
+ });
60
+ }
61
+ // RULE 2: Accepted but Not Implemented (HIGH)
62
+ // Note: Full implementation detection requires expensive analysis
63
+ // For now, we flag based on age alone
64
+ if (status === 'accepted' && timeline.age_days > thresholds.acceptedUnimplementedDays) {
65
+ const urgency = calculateUrgencyScore(timeline.age_days, thresholds.acceptedUnimplementedDays, thresholds.acceptedUnimplementedDays * 2);
66
+ actions.push({
67
+ adrFilename: adr.filename,
68
+ adrTitle: adr.title,
69
+ adrStatus: adr.status,
70
+ priority: urgency > 70 ? 'high' : 'medium',
71
+ urgencyScore: urgency,
72
+ actionType: 'implement',
73
+ actionDescription: 'Begin implementation of accepted decision',
74
+ rationale: `ADR was accepted ${timeline.age_days} days ago ` +
75
+ `(>${thresholds.acceptedUnimplementedDays} days threshold). ` +
76
+ `Accepted decisions should be implemented promptly to maintain architectural integrity.`,
77
+ estimatedEffort: estimateImplementationEffort(adr),
78
+ dueDate: addDays(new Date(), 30).toISOString(),
79
+ blockers: [
80
+ 'May need team capacity allocation',
81
+ 'May have dependencies on other work',
82
+ 'May require infrastructure changes',
83
+ ],
84
+ timeline,
85
+ });
86
+ }
87
+ // RULE 3: Outdated ADR Documentation (MEDIUM)
88
+ if ((status === 'accepted' || status === 'implemented') &&
89
+ timeline.days_since_update > thresholds.outdatedAdrDays) {
90
+ const urgency = calculateUrgencyScore(timeline.days_since_update, thresholds.outdatedAdrDays, thresholds.outdatedAdrDays * 2);
91
+ actions.push({
92
+ adrFilename: adr.filename,
93
+ adrTitle: adr.title,
94
+ adrStatus: adr.status,
95
+ priority: 'medium',
96
+ urgencyScore: urgency,
97
+ actionType: 'update',
98
+ actionDescription: 'Update ADR to reflect current state',
99
+ rationale: `ADR hasn't been updated in ${timeline.days_since_update} days ` +
100
+ `(>${thresholds.outdatedAdrDays} days threshold). ` +
101
+ `Documentation may have drifted from actual implementation.`,
102
+ estimatedEffort: 'low',
103
+ dueDate: addDays(new Date(), 60).toISOString(),
104
+ blockers: [
105
+ 'May need to document implementation details',
106
+ 'May need to update consequences section',
107
+ ],
108
+ timeline,
109
+ });
110
+ }
111
+ // RULE 4: Deprecated without Superseding ADR (MEDIUM)
112
+ if (status === 'deprecated' && timeline.age_days > thresholds.outdatedAdrDays) {
113
+ const urgency = calculateUrgencyScore(timeline.age_days, thresholds.outdatedAdrDays, thresholds.outdatedAdrDays * 2);
114
+ actions.push({
115
+ adrFilename: adr.filename,
116
+ adrTitle: adr.title,
117
+ adrStatus: adr.status,
118
+ priority: 'medium',
119
+ urgencyScore: urgency,
120
+ actionType: 'close',
121
+ actionDescription: 'Document superseding decision or archive',
122
+ rationale: `ADR deprecated ${timeline.age_days} days ago ` +
123
+ `(>${thresholds.outdatedAdrDays} days threshold). ` +
124
+ `Should either document the new decision or archive if no longer relevant.`,
125
+ estimatedEffort: 'low',
126
+ dueDate: addDays(new Date(), 30).toISOString(),
127
+ blockers: [
128
+ 'May need to create superseding ADR',
129
+ 'May need to verify deprecated decision is fully replaced',
130
+ ],
131
+ timeline,
132
+ });
133
+ }
134
+ // RULE 5: Long-Dormant ADRs (LOW)
135
+ if (timeline.days_since_update > thresholds.dormantAdrDays) {
136
+ const urgency = calculateUrgencyScore(timeline.days_since_update, thresholds.dormantAdrDays, thresholds.dormantAdrDays * 1.5);
137
+ actions.push({
138
+ adrFilename: adr.filename,
139
+ adrTitle: adr.title,
140
+ adrStatus: adr.status,
141
+ priority: 'low',
142
+ urgencyScore: urgency,
143
+ actionType: 'review',
144
+ actionDescription: 'Verify ADR is still relevant',
145
+ rationale: `ADR hasn't been updated in ${Math.floor(timeline.days_since_update / 365)} years ` +
146
+ `(>${Math.floor(thresholds.dormantAdrDays / 365)} years threshold). ` +
147
+ `May be obsolete or need archival.`,
148
+ estimatedEffort: 'low',
149
+ dueDate: addDays(new Date(), 90).toISOString(),
150
+ blockers: [],
151
+ timeline,
152
+ });
153
+ }
154
+ // RULE 6: Rapid Status Changes (MEDIUM - may indicate instability)
155
+ if (timeline.age_days < 30 && timeline.days_since_update < thresholds.rapidChangeDays) {
156
+ actions.push({
157
+ adrFilename: adr.filename,
158
+ adrTitle: adr.title,
159
+ adrStatus: adr.status,
160
+ priority: 'medium',
161
+ urgencyScore: 70,
162
+ actionType: 'review',
163
+ actionDescription: 'Review recent decision changes for stability',
164
+ rationale: `ADR is new (${timeline.age_days} days) and was recently modified ` +
165
+ `(${timeline.days_since_update} days ago). ` +
166
+ `Rapid changes may indicate unstable requirements or unclear context.`,
167
+ estimatedEffort: 'low',
168
+ dueDate: addDays(new Date(), 7).toISOString(),
169
+ blockers: [
170
+ 'May need to stabilize requirements',
171
+ 'May need additional stakeholder input',
172
+ ],
173
+ timeline,
174
+ });
175
+ }
176
+ return actions;
177
+ }
178
+ /**
179
+ * Calculate urgency score (0-100) based on age thresholds
180
+ */
181
+ function calculateUrgencyScore(actualDays, warningThreshold, criticalThreshold) {
182
+ if (actualDays < warningThreshold)
183
+ return 0;
184
+ if (actualDays >= criticalThreshold)
185
+ return 100;
186
+ // Linear interpolation between warning and critical
187
+ const range = criticalThreshold - warningThreshold;
188
+ const over = actualDays - warningThreshold;
189
+ return Math.min(100, Math.floor((over / range) * 100));
190
+ }
191
+ /**
192
+ * Estimate implementation effort based on ADR content
193
+ */
194
+ function estimateImplementationEffort(adr) {
195
+ const content = (adr.content || '').toLowerCase();
196
+ // Simple heuristics
197
+ const hasInfrastructure = /infrastructure|deployment|database|migration/i.test(content);
198
+ const hasMultipleServices = /service|microservice|api/gi.test(content) && (content.match(/service/gi) || []).length > 3;
199
+ const hasBreakingChanges = /breaking|migration|backward/i.test(content);
200
+ if (hasInfrastructure || hasBreakingChanges)
201
+ return 'high';
202
+ if (hasMultipleServices)
203
+ return 'medium';
204
+ return 'low';
205
+ }
206
+ /**
207
+ * Add days to a date
208
+ */
209
+ function addDays(date, days) {
210
+ const result = new Date(date);
211
+ result.setDate(result.getDate() + days);
212
+ return result;
213
+ }
214
+ /**
215
+ * Categorize actions into priority buckets
216
+ */
217
+ function categorizeActions(actions) {
218
+ // Sort by urgency score (highest first)
219
+ actions.sort((a, b) => b.urgencyScore - a.urgencyScore);
220
+ const critical = actions.filter((a) => a.priority === 'critical');
221
+ const high = actions.filter((a) => a.priority === 'high');
222
+ const medium = actions.filter((a) => a.priority === 'medium');
223
+ const low = actions.filter((a) => a.priority === 'low');
224
+ // Estimate total hours based on effort
225
+ const effortHours = {
226
+ low: 1,
227
+ medium: 3,
228
+ high: 6,
229
+ };
230
+ const estimatedHours = actions.reduce((total, action) => {
231
+ return total + effortHours[action.estimatedEffort];
232
+ }, 0);
233
+ return {
234
+ critical,
235
+ high,
236
+ medium,
237
+ low,
238
+ summary: {
239
+ totalActions: actions.length,
240
+ criticalCount: critical.length,
241
+ estimatedHours,
242
+ },
243
+ };
244
+ }
245
+ /**
246
+ * Format action items into a readable report
247
+ */
248
+ export function formatActionReport(workQueue, context) {
249
+ const { critical, high, medium, low, summary } = workQueue;
250
+ let report = '# ADR Timeline Analysis - Action Queue\n\n';
251
+ if (context) {
252
+ report += `**Project:** ${context.projectPath}\n`;
253
+ report += `**Threshold Profile:** ${context.thresholdProfile}\n`;
254
+ }
255
+ report += `**Analysis Date:** ${new Date().toISOString().split('T')[0]}\n\n`;
256
+ report += '## Summary\n\n';
257
+ report += `- **Total Actions Required:** ${summary.totalActions}\n`;
258
+ report += `- **Critical Priority:** ${summary.criticalCount}\n`;
259
+ report += `- **Estimated Total Effort:** ${summary.estimatedHours} hours\n\n`;
260
+ report += '---\n\n';
261
+ // Critical actions
262
+ if (critical.length > 0) {
263
+ report += `## 🚨 CRITICAL PRIORITY (${critical.length} actions)\n\n`;
264
+ critical.forEach((action, idx) => {
265
+ report += formatActionItem(action, idx + 1);
266
+ });
267
+ }
268
+ // High priority actions
269
+ if (high.length > 0) {
270
+ report += `## âš ī¸ HIGH PRIORITY (${high.length} actions)\n\n`;
271
+ high.forEach((action, idx) => {
272
+ report += formatActionItem(action, idx + 1);
273
+ });
274
+ }
275
+ // Medium priority actions
276
+ if (medium.length > 0) {
277
+ report += `## 📋 MEDIUM PRIORITY (${medium.length} actions)\n\n`;
278
+ medium.forEach((action, idx) => {
279
+ report += formatActionItem(action, idx + 1);
280
+ });
281
+ }
282
+ // Low priority actions
283
+ if (low.length > 0) {
284
+ report += `## â„šī¸ LOW PRIORITY (${low.length} actions)\n\n`;
285
+ low.forEach((action, idx) => {
286
+ report += formatActionItem(action, idx + 1);
287
+ });
288
+ }
289
+ // No actions
290
+ if (summary.totalActions === 0) {
291
+ report += '## ✅ No Actions Required\n\n';
292
+ report += 'All ADRs are up to date and within acceptable thresholds.\n\n';
293
+ }
294
+ return report;
295
+ }
296
+ /**
297
+ * Format a single action item
298
+ */
299
+ function formatActionItem(action, index) {
300
+ let item = `### ${index}. ${action.adrTitle}\n\n`;
301
+ item += `**File:** \`${action.adrFilename}\` \n`;
302
+ item += `**Status:** ${action.adrStatus} \n`;
303
+ item += `**Age:** ${action.timeline.age_days} days \n`;
304
+ item += `**Last Updated:** ${action.timeline.days_since_update} days ago \n\n`;
305
+ item += `**Action Required:** ${action.actionDescription} \n`;
306
+ item += `**Urgency Score:** ${action.urgencyScore}/100 \n`;
307
+ item += `**Estimated Effort:** ${action.estimatedEffort.toUpperCase()} \n`;
308
+ if (action.dueDate) {
309
+ item += `**Suggested Due Date:** ${action.dueDate.split('T')[0]} \n`;
310
+ }
311
+ item += '\n';
312
+ item += `**Why This Matters:** \n${action.rationale}\n\n`;
313
+ if (action.blockers.length > 0) {
314
+ item += `**Potential Blockers:**\n`;
315
+ action.blockers.forEach((blocker) => {
316
+ item += `- ${blocker}\n`;
317
+ });
318
+ item += '\n';
319
+ }
320
+ item += '---\n\n';
321
+ return item;
322
+ }
323
+ //# sourceMappingURL=adr-action-analyzer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adr-action-analyzer.js","sourceRoot":"","sources":["../../../src/utils/adr-action-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEtF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,IAAqB,EACrB,cAAgC,EAChC,UAGI,EAAE;IAEN,MAAM,EAAE,mBAAmB,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IAE/C,MAAM,WAAW,GAAoB,EAAE,CAAC;IAExC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAClB,SAAS,CAAC,kCAAkC;QAC9C,CAAC;QAED,mDAAmD;QACnD,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACrE,MAAM,UAAU,GAAG,mBAAmB;YACpC,CAAC,CAAC,0BAA0B,CAAC,cAAc,EAAE,OAAO,CAAC;YACrD,CAAC,CAAC,cA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CAAC;IACf,CAAC;IAED,IAAI,IAAI,SAAS,CAAC;IAElB,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * ADR Context Detector
3
+ *
4
+ * Automatically detects project context (phase, activity level, velocity)
5
+ * to select appropriate thresholds for timeline analysis
6
+ */
7
+ import type { ProjectContext, ThresholdProfile, AdrType } from './adr-timeline-types.js';
8
+ import type { DiscoveredAdr } from './adr-discovery.js';
9
+ /**
10
+ * Predefined threshold profiles for different project contexts
11
+ */
12
+ export declare const THRESHOLD_PROFILES: Record<string, ThresholdProfile>;
13
+ /**
14
+ * ADR type modifiers (multiply thresholds by these values)
15
+ */
16
+ export declare const ADR_TYPE_MODIFIERS: Record<AdrType, number>;
17
+ /**
18
+ * Detect project context from git history and ADR patterns
19
+ */
20
+ export declare function detectProjectContext(projectPath: string, adrs: DiscoveredAdr[]): Promise<ProjectContext>;
21
+ /**
22
+ * Select appropriate threshold profile
23
+ */
24
+ export declare function selectThresholdProfile(context: ProjectContext, override?: string): ThresholdProfile;
25
+ /**
26
+ * Detect ADR type from content
27
+ */
28
+ export declare function detectAdrType(adr: DiscoveredAdr): AdrType;
29
+ /**
30
+ * Apply ADR-type specific adjustments to thresholds
31
+ */
32
+ export declare function adjustThresholdsForAdrType(baseThresholds: ThresholdProfile, adrType: AdrType): ThresholdProfile;
33
+ //# sourceMappingURL=adr-context-detector.d.ts.map