mcp-adr-analysis-server 2.1.11 → 2.1.20

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 (362) hide show
  1. package/README.md +55 -8
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/src/index.d.ts +69 -2
  4. package/dist/src/index.d.ts.map +1 -1
  5. package/dist/src/index.js +1638 -551
  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/tools/adr-bootstrap-validation-tool.d.ts.map +1 -1
  111. package/dist/src/tools/adr-bootstrap-validation-tool.js +214 -4
  112. package/dist/src/tools/adr-bootstrap-validation-tool.js.map +1 -1
  113. package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
  114. package/dist/src/tools/adr-suggestion-tool.js +4 -1
  115. package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
  116. package/dist/src/tools/adr-validation-tool.d.ts +52 -0
  117. package/dist/src/tools/adr-validation-tool.d.ts.map +1 -1
  118. package/dist/src/tools/adr-validation-tool.js +52 -0
  119. package/dist/src/tools/adr-validation-tool.js.map +1 -1
  120. package/dist/src/tools/bootstrap-validation-loop-tool.d.ts +262 -0
  121. package/dist/src/tools/bootstrap-validation-loop-tool.d.ts.map +1 -0
  122. package/dist/src/tools/bootstrap-validation-loop-tool.js +1934 -0
  123. package/dist/src/tools/bootstrap-validation-loop-tool.js.map +1 -0
  124. package/dist/src/tools/conversation-memory-tool.d.ts +48 -0
  125. package/dist/src/tools/conversation-memory-tool.d.ts.map +1 -0
  126. package/dist/src/tools/conversation-memory-tool.js +254 -0
  127. package/dist/src/tools/conversation-memory-tool.js.map +1 -0
  128. package/dist/src/tools/deployment-analysis-tool.d.ts.map +1 -1
  129. package/dist/src/tools/deployment-analysis-tool.js +47 -5
  130. package/dist/src/tools/deployment-analysis-tool.js.map +1 -1
  131. package/dist/src/tools/deployment-guidance-tool.d.ts.map +1 -1
  132. package/dist/src/tools/deployment-guidance-tool.js +48 -1
  133. package/dist/src/tools/deployment-guidance-tool.js.map +1 -1
  134. package/dist/src/tools/deployment-readiness-tool.d.ts.map +1 -1
  135. package/dist/src/tools/deployment-readiness-tool.js +15 -1
  136. package/dist/src/tools/deployment-readiness-tool.js.map +1 -1
  137. package/dist/src/tools/expand-analysis-tool.d.ts +23 -0
  138. package/dist/src/tools/expand-analysis-tool.d.ts.map +1 -0
  139. package/dist/src/tools/expand-analysis-tool.js +107 -0
  140. package/dist/src/tools/expand-analysis-tool.js.map +1 -0
  141. package/dist/src/tools/get-server-context-tool.d.ts +67 -0
  142. package/dist/src/tools/get-server-context-tool.d.ts.map +1 -0
  143. package/dist/src/tools/get-server-context-tool.js +75 -0
  144. package/dist/src/tools/get-server-context-tool.js.map +1 -0
  145. package/dist/src/tools/llm-cloud-management-tool.d.ts +62 -0
  146. package/dist/src/tools/llm-cloud-management-tool.d.ts.map +1 -0
  147. package/dist/src/tools/llm-cloud-management-tool.js +202 -0
  148. package/dist/src/tools/llm-cloud-management-tool.js.map +1 -0
  149. package/dist/src/tools/llm-database-management-tool.d.ts +62 -0
  150. package/dist/src/tools/llm-database-management-tool.d.ts.map +1 -0
  151. package/dist/src/tools/llm-database-management-tool.js +203 -0
  152. package/dist/src/tools/llm-database-management-tool.js.map +1 -0
  153. package/dist/src/tools/llm-web-search-tool.d.ts +59 -0
  154. package/dist/src/tools/llm-web-search-tool.d.ts.map +1 -0
  155. package/dist/src/tools/llm-web-search-tool.js +165 -0
  156. package/dist/src/tools/llm-web-search-tool.js.map +1 -0
  157. package/dist/src/tools/mcp-planning-tool.d.ts.map +1 -1
  158. package/dist/src/tools/mcp-planning-tool.js +10 -3
  159. package/dist/src/tools/mcp-planning-tool.js.map +1 -1
  160. package/dist/src/tools/memory-loading-tool.d.ts.map +1 -1
  161. package/dist/src/tools/memory-loading-tool.js +4 -2
  162. package/dist/src/tools/memory-loading-tool.js.map +1 -1
  163. package/dist/src/tools/perform-research-tool.d.ts +45 -1
  164. package/dist/src/tools/perform-research-tool.d.ts.map +1 -1
  165. package/dist/src/tools/perform-research-tool.js +146 -2
  166. package/dist/src/tools/perform-research-tool.js.map +1 -1
  167. package/dist/src/tools/review-existing-adrs-tool.d.ts.map +1 -1
  168. package/dist/src/tools/review-existing-adrs-tool.js +4 -1
  169. package/dist/src/tools/review-existing-adrs-tool.js.map +1 -1
  170. package/dist/src/tools/tool-chain-orchestrator.d.ts +15 -94
  171. package/dist/src/tools/tool-chain-orchestrator.d.ts.map +1 -1
  172. package/dist/src/tools/tool-chain-orchestrator.js +2 -2
  173. package/dist/src/tools/tool-chain-orchestrator.js.map +1 -1
  174. package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts +25 -120
  175. package/dist/src/tools/troubleshoot-guided-workflow-tool.d.ts.map +1 -1
  176. package/dist/src/tools/troubleshoot-guided-workflow-tool.js +2 -2
  177. package/dist/src/types/ape-framework.d.ts +50 -283
  178. package/dist/src/types/ape-framework.d.ts.map +1 -1
  179. package/dist/src/types/conversation-memory.d.ts +184 -0
  180. package/dist/src/types/conversation-memory.d.ts.map +1 -0
  181. package/dist/src/types/conversation-memory.js +8 -0
  182. package/dist/src/types/conversation-memory.js.map +1 -0
  183. package/dist/src/types/index.d.ts +112 -339
  184. package/dist/src/types/index.d.ts.map +1 -1
  185. package/dist/src/types/knowledge-generation.d.ts +96 -401
  186. package/dist/src/types/knowledge-generation.d.ts.map +1 -1
  187. package/dist/src/types/knowledge-graph-schemas.d.ts +77 -715
  188. package/dist/src/types/knowledge-graph-schemas.d.ts.map +1 -1
  189. package/dist/src/types/knowledge-graph-schemas.js +8 -8
  190. package/dist/src/types/knowledge-graph-schemas.js.map +1 -1
  191. package/dist/src/types/memory-entities.d.ts +1230 -6164
  192. package/dist/src/types/memory-entities.d.ts.map +1 -1
  193. package/dist/src/types/memory-entities.js +8 -8
  194. package/dist/src/types/memory-entities.js.map +1 -1
  195. package/dist/src/types/reflexion-framework.d.ts +35 -264
  196. package/dist/src/types/reflexion-framework.d.ts.map +1 -1
  197. package/dist/src/types/reflexion-framework.js +1 -1
  198. package/dist/src/types/reflexion-framework.js.map +1 -1
  199. package/dist/src/types/state-reinforcement.d.ts +87 -0
  200. package/dist/src/types/state-reinforcement.d.ts.map +1 -0
  201. package/dist/src/types/state-reinforcement.js +5 -0
  202. package/dist/src/types/state-reinforcement.js.map +1 -0
  203. package/dist/src/types/tiered-response.d.ts +61 -0
  204. package/dist/src/types/tiered-response.d.ts.map +1 -0
  205. package/dist/src/types/tiered-response.js +8 -0
  206. package/dist/src/types/tiered-response.js.map +1 -0
  207. package/dist/src/types/tool-context.d.ts +50 -0
  208. package/dist/src/types/tool-context.d.ts.map +1 -0
  209. package/dist/src/types/tool-context.js +20 -0
  210. package/dist/src/types/tool-context.js.map +1 -0
  211. package/dist/src/utils/adr-action-analyzer.d.ts +23 -0
  212. package/dist/src/utils/adr-action-analyzer.d.ts.map +1 -0
  213. package/dist/src/utils/adr-action-analyzer.js +323 -0
  214. package/dist/src/utils/adr-action-analyzer.js.map +1 -0
  215. package/dist/src/utils/adr-context-detector.d.ts +33 -0
  216. package/dist/src/utils/adr-context-detector.d.ts.map +1 -0
  217. package/dist/src/utils/adr-context-detector.js +279 -0
  218. package/dist/src/utils/adr-context-detector.js.map +1 -0
  219. package/dist/src/utils/adr-discovery.d.ts +28 -2
  220. package/dist/src/utils/adr-discovery.d.ts.map +1 -1
  221. package/dist/src/utils/adr-discovery.js +91 -7
  222. package/dist/src/utils/adr-discovery.js.map +1 -1
  223. package/dist/src/utils/adr-knowledge-initializer.d.ts +54 -0
  224. package/dist/src/utils/adr-knowledge-initializer.d.ts.map +1 -0
  225. package/dist/src/utils/adr-knowledge-initializer.js +240 -0
  226. package/dist/src/utils/adr-knowledge-initializer.js.map +1 -0
  227. package/dist/src/utils/adr-timeline-extractor.d.ts +21 -0
  228. package/dist/src/utils/adr-timeline-extractor.d.ts.map +1 -0
  229. package/dist/src/utils/adr-timeline-extractor.js +294 -0
  230. package/dist/src/utils/adr-timeline-extractor.js.map +1 -0
  231. package/dist/src/utils/adr-timeline-types.d.ts +234 -0
  232. package/dist/src/utils/adr-timeline-types.d.ts.map +1 -0
  233. package/dist/src/utils/adr-timeline-types.js +7 -0
  234. package/dist/src/utils/adr-timeline-types.js.map +1 -0
  235. package/dist/src/utils/ai-executor.d.ts +36 -0
  236. package/dist/src/utils/ai-executor.d.ts.map +1 -1
  237. package/dist/src/utils/ai-executor.js +36 -0
  238. package/dist/src/utils/ai-executor.js.map +1 -1
  239. package/dist/src/utils/conditional-request.d.ts +105 -0
  240. package/dist/src/utils/conditional-request.d.ts.map +1 -0
  241. package/dist/src/utils/conditional-request.js +186 -0
  242. package/dist/src/utils/conditional-request.js.map +1 -0
  243. package/dist/src/utils/config.d.ts +72 -18
  244. package/dist/src/utils/config.d.ts.map +1 -1
  245. package/dist/src/utils/config.js +75 -0
  246. package/dist/src/utils/config.js.map +1 -1
  247. package/dist/src/utils/context-document-manager.d.ts +112 -0
  248. package/dist/src/utils/context-document-manager.d.ts.map +1 -0
  249. package/dist/src/utils/context-document-manager.js +351 -0
  250. package/dist/src/utils/context-document-manager.js.map +1 -0
  251. package/dist/src/utils/conversation-memory-manager.d.ts +86 -0
  252. package/dist/src/utils/conversation-memory-manager.d.ts.map +1 -0
  253. package/dist/src/utils/conversation-memory-manager.js +443 -0
  254. package/dist/src/utils/conversation-memory-manager.js.map +1 -0
  255. package/dist/src/utils/dag-executor.d.ts +106 -0
  256. package/dist/src/utils/dag-executor.d.ts.map +1 -0
  257. package/dist/src/utils/dag-executor.js +453 -0
  258. package/dist/src/utils/dag-executor.js.map +1 -0
  259. package/dist/src/utils/deployment-analysis.d.ts.map +1 -1
  260. package/dist/src/utils/deployment-analysis.js +4 -1
  261. package/dist/src/utils/deployment-analysis.js.map +1 -1
  262. package/dist/src/utils/deployment-type-registry.d.ts +52 -0
  263. package/dist/src/utils/deployment-type-registry.d.ts.map +1 -0
  264. package/dist/src/utils/deployment-type-registry.js +543 -0
  265. package/dist/src/utils/deployment-type-registry.js.map +1 -0
  266. package/dist/src/utils/dynamic-deployment-intelligence.d.ts +117 -0
  267. package/dist/src/utils/dynamic-deployment-intelligence.d.ts.map +1 -0
  268. package/dist/src/utils/dynamic-deployment-intelligence.js +445 -0
  269. package/dist/src/utils/dynamic-deployment-intelligence.js.map +1 -0
  270. package/dist/src/utils/environment-analysis.d.ts.map +1 -1
  271. package/dist/src/utils/environment-analysis.js +4 -1
  272. package/dist/src/utils/environment-analysis.js.map +1 -1
  273. package/dist/src/utils/knowledge-graph-manager.d.ts +16 -1
  274. package/dist/src/utils/knowledge-graph-manager.d.ts.map +1 -1
  275. package/dist/src/utils/knowledge-graph-manager.js +159 -3
  276. package/dist/src/utils/knowledge-graph-manager.js.map +1 -1
  277. package/dist/src/utils/mermaid-diagrams.d.ts +101 -0
  278. package/dist/src/utils/mermaid-diagrams.d.ts.map +1 -0
  279. package/dist/src/utils/mermaid-diagrams.js +445 -0
  280. package/dist/src/utils/mermaid-diagrams.js.map +1 -0
  281. package/dist/src/utils/monitoring.d.ts +249 -0
  282. package/dist/src/utils/monitoring.d.ts.map +1 -0
  283. package/dist/src/utils/monitoring.js +513 -0
  284. package/dist/src/utils/monitoring.js.map +1 -0
  285. package/dist/src/utils/pattern-contribution-helper.d.ts +60 -0
  286. package/dist/src/utils/pattern-contribution-helper.d.ts.map +1 -0
  287. package/dist/src/utils/pattern-contribution-helper.js +308 -0
  288. package/dist/src/utils/pattern-contribution-helper.js.map +1 -0
  289. package/dist/src/utils/pattern-loader.d.ts +183 -0
  290. package/dist/src/utils/pattern-loader.d.ts.map +1 -0
  291. package/dist/src/utils/pattern-loader.js +200 -0
  292. package/dist/src/utils/pattern-loader.js.map +1 -0
  293. package/dist/src/utils/pattern-research-utility.d.ts +107 -0
  294. package/dist/src/utils/pattern-research-utility.d.ts.map +1 -0
  295. package/dist/src/utils/pattern-research-utility.js +360 -0
  296. package/dist/src/utils/pattern-research-utility.js.map +1 -0
  297. package/dist/src/utils/pattern-to-dag-converter.d.ts +62 -0
  298. package/dist/src/utils/pattern-to-dag-converter.d.ts.map +1 -0
  299. package/dist/src/utils/pattern-to-dag-converter.js +265 -0
  300. package/dist/src/utils/pattern-to-dag-converter.js.map +1 -0
  301. package/dist/src/utils/platform-detector.d.ts +86 -0
  302. package/dist/src/utils/platform-detector.d.ts.map +1 -0
  303. package/dist/src/utils/platform-detector.js +509 -0
  304. package/dist/src/utils/platform-detector.js.map +1 -0
  305. package/dist/src/utils/research-integration.d.ts.map +1 -1
  306. package/dist/src/utils/research-integration.js +8 -2
  307. package/dist/src/utils/research-integration.js.map +1 -1
  308. package/dist/src/utils/research-orchestrator.d.ts +135 -3
  309. package/dist/src/utils/research-orchestrator.d.ts.map +1 -1
  310. package/dist/src/utils/research-orchestrator.js +440 -27
  311. package/dist/src/utils/research-orchestrator.js.map +1 -1
  312. package/dist/src/utils/research-questions.d.ts.map +1 -1
  313. package/dist/src/utils/research-questions.js +4 -1
  314. package/dist/src/utils/research-questions.js.map +1 -1
  315. package/dist/src/utils/resource-extractor.d.ts +57 -0
  316. package/dist/src/utils/resource-extractor.d.ts.map +1 -0
  317. package/dist/src/utils/resource-extractor.js +323 -0
  318. package/dist/src/utils/resource-extractor.js.map +1 -0
  319. package/dist/src/utils/resource-versioning.d.ts +124 -0
  320. package/dist/src/utils/resource-versioning.d.ts.map +1 -0
  321. package/dist/src/utils/resource-versioning.js +272 -0
  322. package/dist/src/utils/resource-versioning.js.map +1 -0
  323. package/dist/src/utils/root-manager.d.ts +118 -0
  324. package/dist/src/utils/root-manager.d.ts.map +1 -0
  325. package/dist/src/utils/root-manager.js +154 -0
  326. package/dist/src/utils/root-manager.js.map +1 -0
  327. package/dist/src/utils/rule-generation.d.ts.map +1 -1
  328. package/dist/src/utils/rule-generation.js +4 -1
  329. package/dist/src/utils/rule-generation.js.map +1 -1
  330. package/dist/src/utils/server-context-generator.d.ts +47 -0
  331. package/dist/src/utils/server-context-generator.d.ts.map +1 -0
  332. package/dist/src/utils/server-context-generator.js +666 -0
  333. package/dist/src/utils/server-context-generator.js.map +1 -0
  334. package/dist/src/utils/state-reinforcement-manager.d.ts +60 -0
  335. package/dist/src/utils/state-reinforcement-manager.d.ts.map +1 -0
  336. package/dist/src/utils/state-reinforcement-manager.js +200 -0
  337. package/dist/src/utils/state-reinforcement-manager.js.map +1 -0
  338. package/dist/src/utils/system-card-manager.d.ts +194 -0
  339. package/dist/src/utils/system-card-manager.d.ts.map +1 -0
  340. package/dist/src/utils/system-card-manager.js +336 -0
  341. package/dist/src/utils/system-card-manager.js.map +1 -0
  342. package/dist/src/utils/tiered-response-manager.d.ts +40 -0
  343. package/dist/src/utils/tiered-response-manager.d.ts.map +1 -0
  344. package/dist/src/utils/tiered-response-manager.js +243 -0
  345. package/dist/src/utils/tiered-response-manager.js.map +1 -0
  346. package/dist/src/utils/validated-pattern-definitions.d.ts +219 -0
  347. package/dist/src/utils/validated-pattern-definitions.d.ts.map +1 -0
  348. package/dist/src/utils/validated-pattern-definitions.js +1511 -0
  349. package/dist/src/utils/validated-pattern-definitions.js.map +1 -0
  350. package/package.json +22 -13
  351. package/dist/src/prompts/todo-prompts.d.ts +0 -49
  352. package/dist/src/prompts/todo-prompts.d.ts.map +0 -1
  353. package/dist/src/prompts/todo-prompts.js +0 -824
  354. package/dist/src/prompts/todo-prompts.js.map +0 -1
  355. package/dist/src/types/todo-json-schemas.d.ts +0 -17
  356. package/dist/src/types/todo-json-schemas.d.ts.map +0 -1
  357. package/dist/src/types/todo-json-schemas.js +0 -9
  358. package/dist/src/types/todo-json-schemas.js.map +0 -1
  359. package/dist/src/utils/todo-file-watcher.d.ts +0 -14
  360. package/dist/src/utils/todo-file-watcher.d.ts.map +0 -1
  361. package/dist/src/utils/todo-file-watcher.js +0 -25
  362. package/dist/src/utils/todo-file-watcher.js.map +0 -1
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Project Status Resource
3
+ * Provides comprehensive project status and health metrics
4
+ */
5
+ import { ResourceGenerationResult } from './index.js';
6
+ export interface ProjectStatus {
7
+ version: string;
8
+ timestamp: string;
9
+ overallHealth: 'excellent' | 'good' | 'fair' | 'poor';
10
+ components: {
11
+ tasks: any;
12
+ research: any;
13
+ rules: any;
14
+ };
15
+ metrics: {
16
+ completionRate: number;
17
+ qualityScore: number;
18
+ resourceCoverage: number;
19
+ };
20
+ }
21
+ /**
22
+ * Generate comprehensive project status resource aggregating data from multiple sources.
23
+ *
24
+ * This function provides a holistic view of the project's current state by combining
25
+ * task management, research documentation, and rule compliance metrics.
26
+ *
27
+ * @returns Promise resolving to resource generation result containing:
28
+ * - data: Complete project status including health metrics and component breakdown
29
+ * - contentType: "application/json"
30
+ * - lastModified: ISO timestamp of generation
31
+ * - cacheKey: Unique identifier for caching
32
+ * - ttl: Cache duration (120 seconds)
33
+ * - etag: Entity tag for cache validation
34
+ *
35
+ * @throws {McpAdrError} When resource generation fails due to:
36
+ * - Inability to generate todo/research/rules resources
37
+ * - Invalid data structure from component resources
38
+ * - Cache operation failures
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * const status = await generateProjectStatusResource();
43
+ * console.log(`Project health: ${status.data.overallHealth}`);
44
+ * console.log(`Completion rate: ${status.data.metrics.completionRate}%`);
45
+ *
46
+ * // Expected output structure:
47
+ * {
48
+ * data: {
49
+ * version: "1.0.0",
50
+ * timestamp: "2025-10-12T17:00:00.000Z",
51
+ * overallHealth: "good",
52
+ * components: {
53
+ * tasks: { summary: { total: 10, completed: 7 } },
54
+ * research: { summary: { total: 5 } },
55
+ * rules: { summary: { enabled: 15, total: 20 } }
56
+ * },
57
+ * metrics: {
58
+ * completionRate: 70,
59
+ * qualityScore: 85,
60
+ * resourceCoverage: 35
61
+ * }
62
+ * },
63
+ * contentType: "application/json",
64
+ * cacheKey: "project-status:current",
65
+ * ttl: 120
66
+ * }
67
+ * ```
68
+ *
69
+ * @since v2.0.0
70
+ * @see {@link generateTodoListResource} for task management data
71
+ * @see {@link generateResearchIndexResource} for research documentation
72
+ * @see {@link generateRuleCatalogResource} for rule compliance
73
+ */
74
+ export declare function generateProjectStatusResource(): Promise<ResourceGenerationResult>;
75
+ //# sourceMappingURL=project-status-resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-status-resource.d.ts","sourceRoot":"","sources":["../../../src/resources/project-status-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAKtD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACtD,UAAU,EAAE;QACV,KAAK,EAAE,GAAG,CAAC;QACX,QAAQ,EAAE,GAAG,CAAC;QACd,KAAK,EAAE,GAAG,CAAC;KACZ,CAAC;IACF,OAAO,EAAE;QACP,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;CACH;AAwFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,wBAAwB,CAAC,CAwDvF"}
@@ -0,0 +1,189 @@
1
+ /**
2
+ * Project Status Resource
3
+ * Provides comprehensive project status and health metrics
4
+ */
5
+ import { McpAdrError } from '../types/index.js';
6
+ import { resourceCache, generateETag } from './resource-cache.js';
7
+ import { generateTodoListResource } from './todo-list-resource.js';
8
+ import { generateResearchIndexResource } from './research-index-resource.js';
9
+ import { generateRuleCatalogResource } from './rule-catalog-resource.js';
10
+ /**
11
+ * Calculate overall health score
12
+ */
13
+ function calculateOverallHealth(components) {
14
+ // Simple heuristic based on completion rates and issues
15
+ let score = 0;
16
+ let maxScore = 0;
17
+ for (const component of components) {
18
+ if (component && typeof component === 'object') {
19
+ maxScore += 100;
20
+ if (component.summary) {
21
+ // Score based on completion
22
+ if (component.summary.completed !== undefined && component.summary.total !== undefined) {
23
+ const completionRate = component.summary.total > 0
24
+ ? (component.summary.completed / component.summary.total) * 100
25
+ : 100;
26
+ score += completionRate;
27
+ }
28
+ else {
29
+ score += 75; // Neutral score if no completion data
30
+ }
31
+ }
32
+ else {
33
+ score += 50; // Lower score for missing data
34
+ }
35
+ }
36
+ }
37
+ const avgScore = maxScore > 0 ? (score / maxScore) * 100 : 50;
38
+ if (avgScore >= 90)
39
+ return 'excellent';
40
+ if (avgScore >= 75)
41
+ return 'good';
42
+ if (avgScore >= 50)
43
+ return 'fair';
44
+ return 'poor';
45
+ }
46
+ /**
47
+ * Calculate completion rate from todo statistics
48
+ */
49
+ function calculateCompletionRate(todoStats) {
50
+ if (!todoStats || !todoStats.summary)
51
+ return 0;
52
+ const { total, completed } = todoStats.summary;
53
+ return total > 0 ? (completed / total) * 100 : 0;
54
+ }
55
+ /**
56
+ * Calculate quality score from various metrics
57
+ */
58
+ function calculateQualityScore(components) {
59
+ // Simplified quality score calculation
60
+ // In production, this would analyze code quality, test coverage, etc.
61
+ let score = 75; // Baseline score
62
+ // Adjust based on rule compliance
63
+ if (components.rules && components.rules.summary) {
64
+ const { enabled, total } = components.rules.summary;
65
+ if (total > 0) {
66
+ score += (enabled / total) * 10;
67
+ }
68
+ }
69
+ // Adjust based on research documentation
70
+ if (components.research && components.research.summary) {
71
+ const { total } = components.research.summary;
72
+ if (total > 5) {
73
+ score += 5; // Bonus for good documentation
74
+ }
75
+ }
76
+ return Math.min(Math.max(score, 0), 100);
77
+ }
78
+ /**
79
+ * Calculate resource coverage
80
+ */
81
+ function calculateResourceCoverage() {
82
+ // Currently: 7 resources (3 original refactored + 4 new)
83
+ // Target: 20+ resources
84
+ const current = 7;
85
+ const target = 20;
86
+ return (current / target) * 100;
87
+ }
88
+ /**
89
+ * Generate comprehensive project status resource aggregating data from multiple sources.
90
+ *
91
+ * This function provides a holistic view of the project's current state by combining
92
+ * task management, research documentation, and rule compliance metrics.
93
+ *
94
+ * @returns Promise resolving to resource generation result containing:
95
+ * - data: Complete project status including health metrics and component breakdown
96
+ * - contentType: "application/json"
97
+ * - lastModified: ISO timestamp of generation
98
+ * - cacheKey: Unique identifier for caching
99
+ * - ttl: Cache duration (120 seconds)
100
+ * - etag: Entity tag for cache validation
101
+ *
102
+ * @throws {McpAdrError} When resource generation fails due to:
103
+ * - Inability to generate todo/research/rules resources
104
+ * - Invalid data structure from component resources
105
+ * - Cache operation failures
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * const status = await generateProjectStatusResource();
110
+ * console.log(`Project health: ${status.data.overallHealth}`);
111
+ * console.log(`Completion rate: ${status.data.metrics.completionRate}%`);
112
+ *
113
+ * // Expected output structure:
114
+ * {
115
+ * data: {
116
+ * version: "1.0.0",
117
+ * timestamp: "2025-10-12T17:00:00.000Z",
118
+ * overallHealth: "good",
119
+ * components: {
120
+ * tasks: { summary: { total: 10, completed: 7 } },
121
+ * research: { summary: { total: 5 } },
122
+ * rules: { summary: { enabled: 15, total: 20 } }
123
+ * },
124
+ * metrics: {
125
+ * completionRate: 70,
126
+ * qualityScore: 85,
127
+ * resourceCoverage: 35
128
+ * }
129
+ * },
130
+ * contentType: "application/json",
131
+ * cacheKey: "project-status:current",
132
+ * ttl: 120
133
+ * }
134
+ * ```
135
+ *
136
+ * @since v2.0.0
137
+ * @see {@link generateTodoListResource} for task management data
138
+ * @see {@link generateResearchIndexResource} for research documentation
139
+ * @see {@link generateRuleCatalogResource} for rule compliance
140
+ */
141
+ export async function generateProjectStatusResource() {
142
+ try {
143
+ const cacheKey = 'project-status:current';
144
+ // Check cache
145
+ const cached = await resourceCache.get(cacheKey);
146
+ if (cached) {
147
+ return cached;
148
+ }
149
+ // Aggregate status from multiple sources
150
+ const todoResource = await generateTodoListResource();
151
+ const researchResource = await generateResearchIndexResource();
152
+ const rulesResource = await generateRuleCatalogResource();
153
+ const components = {
154
+ tasks: todoResource.data,
155
+ research: researchResource.data,
156
+ rules: rulesResource.data,
157
+ };
158
+ const projectStatusData = {
159
+ version: '1.0.0',
160
+ timestamp: new Date().toISOString(),
161
+ overallHealth: calculateOverallHealth([
162
+ todoResource.data,
163
+ researchResource.data,
164
+ rulesResource.data,
165
+ ]),
166
+ components,
167
+ metrics: {
168
+ completionRate: calculateCompletionRate(todoResource.data),
169
+ qualityScore: calculateQualityScore(components),
170
+ resourceCoverage: calculateResourceCoverage(),
171
+ },
172
+ };
173
+ const result = {
174
+ data: projectStatusData,
175
+ contentType: 'application/json',
176
+ lastModified: new Date().toISOString(),
177
+ cacheKey,
178
+ ttl: 120, // 2 minutes cache (status changes frequently)
179
+ etag: generateETag(projectStatusData),
180
+ };
181
+ // Cache result
182
+ resourceCache.set(cacheKey, result, result.ttl);
183
+ return result;
184
+ }
185
+ catch (error) {
186
+ throw new McpAdrError(`Failed to generate project status resource: ${error instanceof Error ? error.message : String(error)}`, 'RESOURCE_GENERATION_ERROR');
187
+ }
188
+ }
189
+ //# sourceMappingURL=project-status-resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-status-resource.js","sourceRoot":"","sources":["../../../src/resources/project-status-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8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;SACF,CAAC;QAEF,MAAM,MAAM,GAA6B;YACvC,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,kBAAkB;YAC/B,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACtC,QAAQ;YACR,GAAG,EAAE,GAAG,EAAE,8CAA8C;YACxD,IAAI,EAAE,YAAY,CAAC,iBAAiB,CAAC;SACtC,CAAC;QAEF,eAAe;QACf,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;QAEhD,OAAO,MAAM,CAAC;IAChB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,WAAW,CACnB,+CAA+C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EACvG,2BAA2B,CAC5B,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Research by Topic Resource - Topic-specific research documents
3
+ * URI Pattern: adr://research/{topic}
4
+ */
5
+ import { URLSearchParams } from 'url';
6
+ import { ResourceGenerationResult } from './index.js';
7
+ export interface ResearchDocument {
8
+ id: string;
9
+ title: string;
10
+ topic: string;
11
+ path: string;
12
+ content: string;
13
+ lastModified: string;
14
+ wordCount: number;
15
+ size: number;
16
+ }
17
+ /**
18
+ * Generate research by topic resource
19
+ */
20
+ export declare function generateResearchByTopicResource(params: Record<string, string>, _searchParams: URLSearchParams): Promise<ResourceGenerationResult>;
21
+ //# sourceMappingURL=research-by-topic-resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"research-by-topic-resource.d.ts","sourceRoot":"","sources":["../../../src/resources/research-by-topic-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAKtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAGtD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AA8DD;;GAEG;AACH,wBAAsB,+BAA+B,CACnD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,aAAa,EAAE,eAAe,GAC7B,OAAO,CAAC,wBAAwB,CAAC,CAgFnC"}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * Research by Topic Resource - Topic-specific research documents
3
+ * URI Pattern: adr://research/{topic}
4
+ */
5
+ import * as path from 'path';
6
+ import * as fs from 'fs/promises';
7
+ import { McpAdrError } from '../types/index.js';
8
+ import { resourceCache, generateETag } from './resource-cache.js';
9
+ import { resourceRouter } from './resource-router.js';
10
+ /**
11
+ * Extract title from markdown content
12
+ */
13
+ function extractTitle(content) {
14
+ const titleMatch = content.match(/^#\s+(.+)$/m);
15
+ if (titleMatch && titleMatch[1]) {
16
+ return titleMatch[1].trim();
17
+ }
18
+ return 'Untitled';
19
+ }
20
+ /**
21
+ * Generate topic summary from documents
22
+ */
23
+ function generateTopicSummary(documents) {
24
+ const firstDoc = documents[0];
25
+ return {
26
+ totalWords: documents.reduce((sum, doc) => sum + doc.wordCount, 0),
27
+ totalSize: documents.reduce((sum, doc) => sum + doc.size, 0),
28
+ lastUpdated: documents.length > 0 && firstDoc
29
+ ? documents.reduce((latest, doc) => (doc.lastModified > latest ? doc.lastModified : latest), firstDoc.lastModified)
30
+ : new Date().toISOString(),
31
+ documentCount: documents.length,
32
+ };
33
+ }
34
+ /**
35
+ * Check if a file matches the topic
36
+ */
37
+ function matchesTopic(filename, content, topic) {
38
+ const normalizedTopic = topic.toLowerCase().replace(/-/g, '_');
39
+ const normalizedFilename = filename.toLowerCase();
40
+ const normalizedContent = content.toLowerCase();
41
+ // Check filename
42
+ if (normalizedFilename.includes(topic.toLowerCase()) ||
43
+ normalizedFilename.includes(normalizedTopic)) {
44
+ return true;
45
+ }
46
+ // Check content (first 1000 characters for keywords)
47
+ const contentPreview = normalizedContent.substring(0, 1000);
48
+ if (contentPreview.includes(topic.toLowerCase()) || contentPreview.includes(normalizedTopic)) {
49
+ return true;
50
+ }
51
+ return false;
52
+ }
53
+ /**
54
+ * Generate research by topic resource
55
+ */
56
+ export async function generateResearchByTopicResource(params, _searchParams) {
57
+ const topic = params['topic'];
58
+ if (!topic) {
59
+ throw new McpAdrError('Missing required parameter: topic', 'INVALID_PARAMS');
60
+ }
61
+ const cacheKey = `research-topic:${topic}`;
62
+ // Check cache
63
+ const cached = await resourceCache.get(cacheKey);
64
+ if (cached) {
65
+ return cached;
66
+ }
67
+ const researchDirs = ['docs/research', 'custom/research'];
68
+ const relatedDocs = [];
69
+ // Scan research directories
70
+ for (const dir of researchDirs) {
71
+ const fullPath = path.resolve(process.cwd(), dir);
72
+ try {
73
+ const files = await fs.readdir(fullPath);
74
+ for (const file of files) {
75
+ if (file.endsWith('.md')) {
76
+ const filePath = path.join(fullPath, file);
77
+ const content = await fs.readFile(filePath, 'utf-8');
78
+ // Check if file matches topic
79
+ if (matchesTopic(file, content, topic)) {
80
+ const stats = await fs.stat(filePath);
81
+ relatedDocs.push({
82
+ id: file.replace('.md', ''),
83
+ title: extractTitle(content),
84
+ topic,
85
+ path: path.join(dir, file),
86
+ content,
87
+ lastModified: stats.mtime.toISOString(),
88
+ wordCount: content.split(/\s+/).length,
89
+ size: stats.size,
90
+ });
91
+ }
92
+ }
93
+ }
94
+ }
95
+ catch {
96
+ // Directory doesn't exist or can't be read, skip silently
97
+ continue;
98
+ }
99
+ }
100
+ // Sort by last modified (newest first)
101
+ relatedDocs.sort((a, b) => b.lastModified.localeCompare(a.lastModified));
102
+ if (relatedDocs.length === 0) {
103
+ throw new McpAdrError(`No research documents found for topic: ${topic}`, 'RESOURCE_NOT_FOUND');
104
+ }
105
+ const topicData = {
106
+ topic,
107
+ documentCount: relatedDocs.length,
108
+ documents: relatedDocs,
109
+ summary: generateTopicSummary(relatedDocs),
110
+ };
111
+ const result = {
112
+ data: topicData,
113
+ contentType: 'application/json',
114
+ lastModified: new Date().toISOString(),
115
+ cacheKey,
116
+ ttl: 600, // 10 minutes cache
117
+ etag: generateETag(topicData),
118
+ };
119
+ // Cache result
120
+ resourceCache.set(cacheKey, result, result.ttl);
121
+ return result;
122
+ }
123
+ // Register route
124
+ resourceRouter.register('/research/{topic}', generateResearchByTopicResource, 'Research documents filtered by topic');
125
+ //# sourceMappingURL=research-by-topic-resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"research-by-topic-resource.js","sourceRoot":"","sources":["../../../src/resources/research-by-topic-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAatD;;GAEG;AACH,SAAS,YAAY,CAAC,OAAe;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAChD,IAAI,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;GAEG;AACH,SAAS,oBAAoB,CAAC,SAA6B;IAMzD,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;I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ACf,WAAW,EAAE,kBAAkB;QAC/B,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACtC,QAAQ;QACR,GAAG,EAAE,GAAG,EAAE,mBAAmB;QAC7B,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC;KAC9B,CAAC;IAEF,eAAe;IACf,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IAEhD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,iBAAiB;AACjB,cAAc,CAAC,QAAQ,CACrB,mBAAmB,EACnB,+BAA+B,EAC/B,sCAAsC,CACvC,CAAC"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Research Index Resource
3
+ * Provides access to research documents and findings
4
+ */
5
+ import { ResourceGenerationResult } from './index.js';
6
+ export interface ResearchDocument {
7
+ id: string;
8
+ title: string;
9
+ topic: string;
10
+ path: string;
11
+ lastModified: string;
12
+ wordCount: number;
13
+ size: number;
14
+ }
15
+ /**
16
+ * Generate comprehensive research document index resource with metadata and categorization.
17
+ *
18
+ * Scans project research directories and builds an index of all research documents with
19
+ * metadata including titles, topics, word counts, file sizes, and last modified dates.
20
+ * Supports multiple research directories for organizational flexibility.
21
+ *
22
+ * **Scanned Directories:**
23
+ * - `docs/research/` - Primary research documentation
24
+ * - `custom/research/` - Custom user research notes
25
+ *
26
+ * **Document Extraction:**
27
+ * - Title: Extracted from first H1 heading or filename
28
+ * - Topic: Derived from filename prefix or directory structure
29
+ * - Metadata: Word count, file size, last modified timestamp
30
+ *
31
+ * @returns Promise resolving to resource generation result containing:
32
+ * - data: Complete research index with documents array and summary statistics
33
+ * - contentType: "application/json"
34
+ * - lastModified: ISO timestamp of generation
35
+ * - cacheKey: "research-index:current"
36
+ * - ttl: Cache duration (300 seconds / 5 minutes)
37
+ * - etag: Entity tag for cache validation
38
+ *
39
+ * @throws {McpAdrError} When research index generation fails due to:
40
+ * - RESOURCE_GENERATION_ERROR: File system access errors or markdown parsing failures
41
+ * - Cache operation failures
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const researchIndex = await generateResearchIndexResource();
46
+ *
47
+ * console.log(`Total research documents: ${researchIndex.data.summary.total}`);
48
+ * console.log(`Topics covered: ${researchIndex.data.summary.byTopic.length}`);
49
+ * console.log(`Total words: ${researchIndex.data.summary.totalWords}`);
50
+ *
51
+ * // Find research by topic
52
+ * const architectureDocs = researchIndex.data.documents.filter(
53
+ * doc => doc.topic === 'architecture'
54
+ * );
55
+ * console.log(`Architecture research docs: ${architectureDocs.length}`);
56
+ *
57
+ * // Sort by recency
58
+ * const recentDocs = researchIndex.data.documents
59
+ * .sort((a, b) => new Date(b.lastModified).getTime() - new Date(a.lastModified).getTime())
60
+ * .slice(0, 5);
61
+ *
62
+ * // Expected output structure:
63
+ * {
64
+ * data: {
65
+ * version: "1.0.0",
66
+ * timestamp: "2025-10-12T17:00:00.000Z",
67
+ * summary: {
68
+ * total: 55,
69
+ * byTopic: {
70
+ * "performance": 12,
71
+ * "security": 8,
72
+ * "architecture": 15
73
+ * },
74
+ * totalWords: 45000,
75
+ * averageWordCount: 818
76
+ * },
77
+ * documents: [
78
+ * {
79
+ * id: "perform_research_research_001",
80
+ * title: "TypeScript Performance Optimization",
81
+ * topic: "performance",
82
+ * path: "docs/research/perform_research_research_001.md",
83
+ * lastModified: "2025-10-10T12:00:00.000Z",
84
+ * wordCount: 1250,
85
+ * size: 8192
86
+ * }
87
+ * ]
88
+ * },
89
+ * contentType: "application/json",
90
+ * cacheKey: "research-index:current",
91
+ * ttl: 300
92
+ * }
93
+ * ```
94
+ *
95
+ * @since v2.0.0
96
+ * @see {@link extractTitle} for title extraction logic
97
+ * @see {@link extractTopic} for topic categorization
98
+ */
99
+ export declare function generateResearchIndexResource(): Promise<ResourceGenerationResult>;
100
+ //# sourceMappingURL=research-index-resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"research-index-resource.d.ts","sourceRoot":"","sources":["../../../src/resources/research-index-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAkDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,wBAAwB,CAAC,CA+EvF"}