mcp-adr-analysis-server 2.1.9 → 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 (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 +453 -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 +22 -13
  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,646 @@
1
+ /**
2
+ * Environment Analysis Resource - System environment details
3
+ * URI Pattern: adr://environment_analysis
4
+ *
5
+ * Enhanced with Bridge Pattern to leverage comprehensive environment-analysis-tool
6
+ * Supports query parameters for analysis types and features
7
+ */
8
+ import * as fs from 'fs/promises';
9
+ import * as path from 'path';
10
+ import * as os from 'os';
11
+ import { exec } from 'child_process';
12
+ import { promisify } from 'util';
13
+ import { resourceCache, generateETag } from './resource-cache.js';
14
+ const execAsync = promisify(exec);
15
+ /**
16
+ * Get system information (fallback/basic implementation)
17
+ */
18
+ function getSystemInfo() {
19
+ const totalMem = os.totalmem();
20
+ const freeMem = os.freemem();
21
+ return {
22
+ platform: os.platform(),
23
+ arch: os.arch(),
24
+ release: os.release(),
25
+ nodeVersion: process.version,
26
+ hostname: os.hostname(),
27
+ cpus: os.cpus().length,
28
+ totalMemory: `${(totalMem / 1024 / 1024 / 1024).toFixed(2)} GB`,
29
+ freeMemory: `${(freeMem / 1024 / 1024 / 1024).toFixed(2)} GB`,
30
+ };
31
+ }
32
+ /**
33
+ * Get npm version (fallback/basic implementation)
34
+ */
35
+ async function getNpmVersion() {
36
+ try {
37
+ const result = await execAsync('npm --version');
38
+ return result.stdout.trim();
39
+ }
40
+ catch {
41
+ return 'unknown';
42
+ }
43
+ }
44
+ /**
45
+ * Detect package manager (fallback/basic implementation)
46
+ */
47
+ async function detectPackageManager() {
48
+ const projectRoot = process.cwd();
49
+ const checks = [
50
+ { file: 'pnpm-lock.yaml', manager: 'pnpm' },
51
+ { file: 'yarn.lock', manager: 'yarn' },
52
+ { file: 'package-lock.json', manager: 'npm' },
53
+ ];
54
+ for (const check of checks) {
55
+ try {
56
+ await fs.access(path.join(projectRoot, check.file));
57
+ return check.manager;
58
+ }
59
+ catch {
60
+ continue;
61
+ }
62
+ }
63
+ return 'unknown';
64
+ }
65
+ /**
66
+ * Get project information (fallback/basic implementation)
67
+ */
68
+ async function getProjectInfo() {
69
+ const projectRoot = process.cwd();
70
+ const frameworks = [];
71
+ let hasGit = false;
72
+ try {
73
+ await fs.access(path.join(projectRoot, '.git'));
74
+ hasGit = true;
75
+ }
76
+ catch {
77
+ hasGit = false;
78
+ }
79
+ let hasTypeScript = false;
80
+ try {
81
+ await fs.access(path.join(projectRoot, 'tsconfig.json'));
82
+ hasTypeScript = true;
83
+ frameworks.push('TypeScript');
84
+ }
85
+ catch {
86
+ hasTypeScript = false;
87
+ }
88
+ let hasTests = false;
89
+ try {
90
+ const packagePath = path.join(projectRoot, 'package.json');
91
+ const packageContent = await fs.readFile(packagePath, 'utf-8');
92
+ const packageJson = JSON.parse(packageContent);
93
+ hasTests = !!packageJson.scripts?.test;
94
+ const allDeps = {
95
+ ...packageJson.dependencies,
96
+ ...packageJson.devDependencies,
97
+ };
98
+ if (allDeps['@modelcontextprotocol/sdk'])
99
+ frameworks.push('MCP');
100
+ if (allDeps['jest'])
101
+ frameworks.push('Jest');
102
+ if (allDeps['react'])
103
+ frameworks.push('React');
104
+ if (allDeps['vue'])
105
+ frameworks.push('Vue');
106
+ if (allDeps['angular'])
107
+ frameworks.push('Angular');
108
+ if (allDeps['express'])
109
+ frameworks.push('Express');
110
+ if (allDeps['fastify'])
111
+ frameworks.push('Fastify');
112
+ }
113
+ catch {
114
+ hasTests = false;
115
+ }
116
+ const packageManager = await detectPackageManager();
117
+ return {
118
+ root: projectRoot,
119
+ hasGit,
120
+ hasTypeScript,
121
+ hasTests,
122
+ packageManager,
123
+ frameworks,
124
+ };
125
+ }
126
+ /**
127
+ * Get dependencies from package.json (fallback/basic implementation)
128
+ */
129
+ async function getDependencies() {
130
+ try {
131
+ const packagePath = path.resolve(process.cwd(), 'package.json');
132
+ const packageContent = await fs.readFile(packagePath, 'utf-8');
133
+ const packageJson = JSON.parse(packageContent);
134
+ return {
135
+ runtime: packageJson.dependencies || {},
136
+ development: packageJson.devDependencies || {},
137
+ peer: packageJson.peerDependencies || {},
138
+ };
139
+ }
140
+ catch {
141
+ return {
142
+ runtime: {},
143
+ development: {},
144
+ peer: {},
145
+ };
146
+ }
147
+ }
148
+ /**
149
+ * Get environment variables (masked sensitive ones)
150
+ */
151
+ function getEnvironmentVariables() {
152
+ const sensitiveKeys = ['API_KEY', 'SECRET', 'PASSWORD', 'TOKEN', 'PRIVATE'];
153
+ const env = {};
154
+ for (const [key, value] of Object.entries(process.env)) {
155
+ const isSensitive = sensitiveKeys.some(sensitive => key.toUpperCase().includes(sensitive));
156
+ if (isSensitive && value) {
157
+ env[key] = '***masked***';
158
+ }
159
+ else {
160
+ env[key] = value;
161
+ }
162
+ }
163
+ return env;
164
+ }
165
+ /**
166
+ * Get environment paths
167
+ */
168
+ async function getEnvironmentPaths() {
169
+ let nodePath = 'unknown';
170
+ let npmPath = 'unknown';
171
+ try {
172
+ const nodeResult = await execAsync('which node');
173
+ nodePath = nodeResult.stdout.trim();
174
+ }
175
+ catch {
176
+ nodePath = process.execPath;
177
+ }
178
+ try {
179
+ const npmResult = await execAsync('which npm');
180
+ npmPath = npmResult.stdout.trim();
181
+ }
182
+ catch {
183
+ npmPath = 'unknown';
184
+ }
185
+ return {
186
+ node: nodePath,
187
+ npm: npmPath,
188
+ projectRoot: process.cwd(),
189
+ adrDirectory: process.env['ADR_DIRECTORY'] || 'docs/adrs',
190
+ };
191
+ }
192
+ /**
193
+ * Get system capabilities
194
+ */
195
+ function getCapabilities() {
196
+ return {
197
+ aiExecution: !!process.env['OPENROUTER_API_KEY'],
198
+ knowledgeGraph: true,
199
+ caching: true,
200
+ masking: true,
201
+ };
202
+ }
203
+ /**
204
+ * Get disk space information
205
+ */
206
+ async function getDiskSpace() {
207
+ try {
208
+ if (os.platform() === 'darwin' || os.platform() === 'linux') {
209
+ const result = await execAsync('df -h . | tail -1');
210
+ const parts = result.stdout.trim().split(/\s+/);
211
+ if (parts.length >= 5) {
212
+ return {
213
+ total: parts[1] || 'unknown',
214
+ free: parts[3] || 'unknown',
215
+ usagePercent: parseInt(parts[4]?.replace('%', '') || '0', 10),
216
+ };
217
+ }
218
+ }
219
+ }
220
+ catch {
221
+ // Fall through to default
222
+ }
223
+ return {
224
+ total: 'unknown',
225
+ free: 'unknown',
226
+ usagePercent: 0,
227
+ };
228
+ }
229
+ /**
230
+ * Get health metrics
231
+ */
232
+ async function getHealthMetrics() {
233
+ const diskSpace = await getDiskSpace();
234
+ return {
235
+ diskSpace,
236
+ performance: {
237
+ uptime: os.uptime(),
238
+ loadAverage: os.loadavg(),
239
+ },
240
+ };
241
+ }
242
+ /**
243
+ * Extract structured data from tool's text output
244
+ */
245
+ function extractStructuredDataFromToolOutput(toolOutput) {
246
+ const extracted = {};
247
+ // Extract infrastructure information
248
+ if (toolOutput.includes('Infrastructure') || toolOutput.includes('infrastructure')) {
249
+ const components = [];
250
+ const infraMatch = toolOutput.match(/infrastructure[:\s]+([^\n]+)/i);
251
+ if (infraMatch && infraMatch[1]) {
252
+ components.push(infraMatch[1].trim());
253
+ }
254
+ extracted.infrastructure = {
255
+ components: {},
256
+ services: components,
257
+ topology: toolOutput.includes('distributed') ? 'distributed' : 'monolithic',
258
+ };
259
+ }
260
+ // Extract containerization information
261
+ const dockerDetected = toolOutput.toLowerCase().includes('docker');
262
+ const kubernetesDetected = toolOutput.toLowerCase().includes('kubernetes') || toolOutput.toLowerCase().includes('k8s');
263
+ if (dockerDetected || kubernetesDetected) {
264
+ const technologies = [];
265
+ if (dockerDetected)
266
+ technologies.push('Docker');
267
+ if (kubernetesDetected)
268
+ technologies.push('Kubernetes');
269
+ if (toolOutput.toLowerCase().includes('podman'))
270
+ technologies.push('Podman');
271
+ if (toolOutput.toLowerCase().includes('containerd'))
272
+ technologies.push('containerd');
273
+ extracted.containerization = {
274
+ detected: true,
275
+ technologies,
276
+ dockerfiles: (toolOutput.match(/dockerfile/gi) || []).length,
277
+ composeFiles: (toolOutput.match(/docker-compose/gi) || []).length,
278
+ kubernetes: kubernetesDetected,
279
+ security: {
280
+ score: toolOutput.toLowerCase().includes('security') ? 75 : 50,
281
+ issues: extractListItems(toolOutput, ['vulnerability', 'insecure', 'risk']),
282
+ },
283
+ };
284
+ }
285
+ // Extract cloud services
286
+ const cloudProviders = extractTechnologies(toolOutput, [
287
+ 'aws',
288
+ 'azure',
289
+ 'gcp',
290
+ 'google cloud',
291
+ 'heroku',
292
+ 'vercel',
293
+ 'netlify',
294
+ ]);
295
+ if (cloudProviders.length > 0) {
296
+ extracted.cloudServices = {
297
+ providers: cloudProviders,
298
+ services: extractListItems(toolOutput, [
299
+ 'lambda',
300
+ 'ec2',
301
+ 's3',
302
+ 'rds',
303
+ 'functions',
304
+ 'storage',
305
+ ]),
306
+ deployment: toolOutput.toLowerCase().includes('serverless') ? 'serverless' : 'traditional',
307
+ };
308
+ }
309
+ // Extract security information
310
+ const httpsEnabled = toolOutput.toLowerCase().includes('https') || toolOutput.toLowerCase().includes('ssl');
311
+ const authSetup = toolOutput.toLowerCase().includes('auth') ||
312
+ toolOutput.toLowerCase().includes('authentication');
313
+ extracted.security = {
314
+ httpsEnabled,
315
+ authenticationSetup: authSetup,
316
+ secretManagement: toolOutput.toLowerCase().includes('secret') &&
317
+ toolOutput.toLowerCase().includes('management'),
318
+ complianceFrameworks: extractTechnologies(toolOutput, [
319
+ 'gdpr',
320
+ 'soc2',
321
+ 'iso27001',
322
+ 'hipaa',
323
+ 'pci',
324
+ ]),
325
+ vulnerabilities: (toolOutput.match(/vulnerability|vulnerable/gi) || []).length,
326
+ };
327
+ // Extract deployment information
328
+ const cicdDetected = toolOutput.toLowerCase().includes('ci/cd') || toolOutput.toLowerCase().includes('pipeline');
329
+ extracted.deployment = {
330
+ cicdDetected,
331
+ pipeline: extractTechnologies(toolOutput, [
332
+ 'github actions',
333
+ 'gitlab ci',
334
+ 'jenkins',
335
+ 'circleci',
336
+ 'travis',
337
+ ])[0] || 'unknown',
338
+ automated: cicdDetected,
339
+ frequency: toolOutput.toLowerCase().includes('continuous') ? 'continuous' : 'manual',
340
+ };
341
+ // Extract monitoring information
342
+ const monitoringTools = extractTechnologies(toolOutput, [
343
+ 'prometheus',
344
+ 'grafana',
345
+ 'datadog',
346
+ 'new relic',
347
+ 'cloudwatch',
348
+ 'stackdriver',
349
+ ]);
350
+ extracted.monitoring = {
351
+ toolsDetected: monitoringTools,
352
+ metricsEnabled: toolOutput.toLowerCase().includes('metrics'),
353
+ loggingEnabled: toolOutput.toLowerCase().includes('logging') || toolOutput.toLowerCase().includes('logs'),
354
+ tracingEnabled: toolOutput.toLowerCase().includes('tracing') || toolOutput.toLowerCase().includes('jaeger'),
355
+ };
356
+ // Extract ADR integration
357
+ const adrMentioned = toolOutput.toLowerCase().includes('adr') ||
358
+ toolOutput.toLowerCase().includes('architecture decision');
359
+ if (adrMentioned) {
360
+ extracted.adrIntegration = {
361
+ requirementsExtracted: true,
362
+ totalRequirements: (toolOutput.match(/requirement/gi) || []).length,
363
+ infrastructureRequirements: extractListItems(toolOutput, ['infrastructure requirement']),
364
+ securityRequirements: extractListItems(toolOutput, ['security requirement']),
365
+ };
366
+ }
367
+ // Extract quality attributes
368
+ extracted.qualityAttributes = {
369
+ performance: toolOutput.toLowerCase().includes('performance') ? 'mentioned' : 'not mentioned',
370
+ scalability: toolOutput.toLowerCase().includes('scalability') ||
371
+ toolOutput.toLowerCase().includes('scalable')
372
+ ? 'mentioned'
373
+ : 'not mentioned',
374
+ reliability: toolOutput.toLowerCase().includes('reliability') ||
375
+ toolOutput.toLowerCase().includes('reliable')
376
+ ? 'mentioned'
377
+ : 'not mentioned',
378
+ maintainability: toolOutput.toLowerCase().includes('maintainability') ||
379
+ toolOutput.toLowerCase().includes('maintainable')
380
+ ? 'mentioned'
381
+ : 'not mentioned',
382
+ security: toolOutput.toLowerCase().includes('security') ? 'mentioned' : 'not mentioned',
383
+ };
384
+ // Extract risk assessment
385
+ const risks = extractListItems(toolOutput, ['risk', 'vulnerability', 'issue', 'concern']);
386
+ extracted.riskAssessment = {
387
+ risks,
388
+ riskLevel: risks.length > 5 ? 'high' : risks.length > 2 ? 'medium' : 'low',
389
+ mitigations: extractListItems(toolOutput, ['mitigation', 'recommendation', 'solution']),
390
+ };
391
+ return extracted;
392
+ }
393
+ /**
394
+ * Helper: Extract technologies from text
395
+ */
396
+ function extractTechnologies(content, technologies) {
397
+ const found = [];
398
+ const lowerContent = content.toLowerCase();
399
+ for (const tech of technologies) {
400
+ if (lowerContent.includes(tech.toLowerCase())) {
401
+ found.push(tech);
402
+ }
403
+ }
404
+ return found;
405
+ }
406
+ /**
407
+ * Helper: Extract list items containing keywords
408
+ */
409
+ function extractListItems(content, keywords) {
410
+ const items = [];
411
+ const lines = content.split('\n');
412
+ for (const line of lines) {
413
+ const trimmed = line.trim();
414
+ if (trimmed.startsWith('- ') || trimmed.startsWith('* ')) {
415
+ const itemText = trimmed.substring(2).trim();
416
+ for (const keyword of keywords) {
417
+ if (itemText.toLowerCase().includes(keyword.toLowerCase())) {
418
+ items.push(itemText);
419
+ break;
420
+ }
421
+ }
422
+ }
423
+ }
424
+ return items;
425
+ }
426
+ /**
427
+ * Generate basic environment analysis (fallback when tool is unavailable)
428
+ */
429
+ async function generateBasicAnalysis() {
430
+ const systemInfo = getSystemInfo();
431
+ const npmVersion = await getNpmVersion();
432
+ const projectInfo = await getProjectInfo();
433
+ const dependencies = await getDependencies();
434
+ const environmentVariables = getEnvironmentVariables();
435
+ const paths = await getEnvironmentPaths();
436
+ const capabilities = getCapabilities();
437
+ const health = await getHealthMetrics();
438
+ return {
439
+ system: {
440
+ ...systemInfo,
441
+ npmVersion,
442
+ },
443
+ project: projectInfo,
444
+ dependencies,
445
+ environment: {
446
+ variables: environmentVariables,
447
+ paths,
448
+ },
449
+ capabilities,
450
+ health,
451
+ analysisMetadata: {
452
+ analysisType: 'basic',
453
+ timestamp: new Date().toISOString(),
454
+ confidence: 0.6,
455
+ source: 'basic',
456
+ memoryIntegration: false,
457
+ },
458
+ };
459
+ }
460
+ /**
461
+ * Generate comprehensive environment analysis using the tool
462
+ */
463
+ async function generateComprehensiveAnalysis(analysisType, enableMemory) {
464
+ try {
465
+ // Import the comprehensive tool
466
+ const { analyzeEnvironment } = await import('../tools/environment-analysis-tool.js');
467
+ // Call the tool with appropriate parameters
468
+ const toolResult = await analyzeEnvironment({
469
+ projectPath: process.cwd(),
470
+ adrDirectory: process.env['ADR_DIRECTORY'] || 'docs/adrs',
471
+ analysisType: analysisType,
472
+ knowledgeEnhancement: true,
473
+ enhancedMode: true,
474
+ enableMemoryIntegration: enableMemory,
475
+ environmentType: process.env['NODE_ENV'] || 'development',
476
+ });
477
+ // Extract text content from tool result
478
+ let toolOutputText = '';
479
+ if (toolResult.content && Array.isArray(toolResult.content)) {
480
+ for (const item of toolResult.content) {
481
+ if (item.type === 'text' && item.text) {
482
+ toolOutputText += item.text + '\n';
483
+ }
484
+ }
485
+ }
486
+ // Get basic data
487
+ const basicAnalysis = await generateBasicAnalysis();
488
+ // Extract enhanced data from tool output
489
+ const enhancedData = extractStructuredDataFromToolOutput(toolOutputText);
490
+ // Merge basic and enhanced data
491
+ const comprehensiveAnalysis = {
492
+ ...basicAnalysis,
493
+ ...enhancedData,
494
+ analysisMetadata: {
495
+ analysisType,
496
+ timestamp: new Date().toISOString(),
497
+ confidence: 0.9,
498
+ source: 'comprehensive-tool',
499
+ memoryIntegration: enableMemory,
500
+ },
501
+ };
502
+ return comprehensiveAnalysis;
503
+ }
504
+ catch (error) {
505
+ console.error('[environment-analysis-resource] Tool execution failed, falling back to basic analysis:', error);
506
+ return generateBasicAnalysis();
507
+ }
508
+ }
509
+ /**
510
+ * Generate comprehensive environment analysis resource with infrastructure detection and cloud services discovery.
511
+ *
512
+ * Analyzes the runtime environment, system specifications, project dependencies, containerization setup,
513
+ * cloud services configuration, and security posture to provide complete environmental context.
514
+ *
515
+ * **Query Parameters:**
516
+ * - `type`: Analysis type - "specs" (system specs), "infrastructure" (detailed infra), or "security" (security focus) (default: "specs")
517
+ * - `memory`: Enable memory integration for historical environment tracking (default: true)
518
+ * - `comprehensive`: Use comprehensive analysis via tool bridge (default: true)
519
+ *
520
+ * **Comprehensive Mode includes:**
521
+ * - Advanced infrastructure component detection (Kubernetes, Docker, databases)
522
+ * - Cloud services discovery (AWS, Azure, GCP, Vercel, Netlify)
523
+ * - Container security analysis with scoring
524
+ * - HTTPS/authentication/secrets management checks
525
+ * - Compliance framework detection (SOC2, HIPAA, GDPR, PCI-DSS)
526
+ * - Real-time health metrics (disk space, load average, uptime)
527
+ *
528
+ * **Basic Mode includes:**
529
+ * - System specifications (OS, arch, Node.js, npm versions)
530
+ * - Project structure analysis (TypeScript, tests, package manager)
531
+ * - Runtime dependencies catalog
532
+ * - Environment variables overview
533
+ * - Basic capability flags
534
+ *
535
+ * @param _params - URL path parameters (currently unused, reserved for future routing)
536
+ * @param searchParams - URL query parameters controlling analysis depth and type
537
+ *
538
+ * @returns Promise resolving to resource generation result containing:
539
+ * - data: Complete environment analysis with system, project, and infrastructure details
540
+ * - contentType: "application/json"
541
+ * - lastModified: ISO timestamp of generation
542
+ * - cacheKey: Unique identifier based on analysis type and options
543
+ * - ttl: Cache duration (300 seconds / 5 minutes)
544
+ * - etag: Entity tag for cache validation
545
+ *
546
+ * @throws {Error} Rarely throws; gracefully handles analysis failures by:
547
+ * - Falling back to basic analysis if comprehensive fails
548
+ * - Returning partial data for unavailable metrics
549
+ * - Logging warnings for non-critical errors
550
+ *
551
+ * @example
552
+ * ```typescript
553
+ * // Get comprehensive environment analysis
554
+ * const env = await generateEnvironmentAnalysisResource(
555
+ * {},
556
+ * new URLSearchParams('type=infrastructure&memory=true')
557
+ * );
558
+ *
559
+ * console.log(`Platform: ${env.data.system.platform} ${env.data.system.arch}`);
560
+ * console.log(`Node: ${env.data.system.nodeVersion}`);
561
+ * console.log(`AI Execution: ${env.data.capabilities.aiExecution ? 'Enabled' : 'Disabled'}`);
562
+ *
563
+ * // Check containerization
564
+ * if (env.data.containerization?.detected) {
565
+ * console.log(`Container tech: ${env.data.containerization.technologies.join(', ')}`);
566
+ * console.log(`Security score: ${env.data.containerization.security.score}`);
567
+ * }
568
+ *
569
+ * // Check cloud services
570
+ * if (env.data.cloudServices) {
571
+ * console.log(`Cloud providers: ${env.data.cloudServices.providers.join(', ')}`);
572
+ * console.log(`Services: ${env.data.cloudServices.services.length}`);
573
+ * }
574
+ *
575
+ * // Basic mode example (faster)
576
+ * const basicEnv = await generateEnvironmentAnalysisResource(
577
+ * {},
578
+ * new URLSearchParams('comprehensive=false')
579
+ * );
580
+ *
581
+ * // Expected output structure:
582
+ * {
583
+ * data: {
584
+ * system: {
585
+ * platform: "linux",
586
+ * arch: "x64",
587
+ * nodeVersion: "20.10.0",
588
+ * npmVersion: "10.2.3"
589
+ * },
590
+ * project: {
591
+ * hasTypeScript: true,
592
+ * hasTests: true,
593
+ * frameworks: ["express", "jest"]
594
+ * },
595
+ * capabilities: {
596
+ * aiExecution: true,
597
+ * knowledgeGraph: true,
598
+ * caching: true
599
+ * },
600
+ * containerization: {
601
+ * detected: true,
602
+ * technologies: ["docker"],
603
+ * security: { score: 85 }
604
+ * }
605
+ * },
606
+ * contentType: "application/json",
607
+ * cacheKey: "environment-analysis:specs:true:true",
608
+ * ttl: 300
609
+ * }
610
+ * ```
611
+ *
612
+ * @since v2.0.0
613
+ * @see {@link environmentAnalysis} tool for underlying analysis engine
614
+ */
615
+ export async function generateEnvironmentAnalysisResource(_params, searchParams) {
616
+ // Extract query parameters
617
+ const analysisType = searchParams?.get('type') || 'specs';
618
+ const enableMemory = searchParams?.get('memory') !== 'false';
619
+ const useComprehensive = searchParams?.get('comprehensive') !== 'false';
620
+ const cacheKey = `environment-analysis:${analysisType}:${enableMemory}:${useComprehensive}`;
621
+ // Check cache
622
+ const cached = await resourceCache.get(cacheKey);
623
+ if (cached) {
624
+ return cached;
625
+ }
626
+ // Generate analysis (comprehensive or basic)
627
+ let environmentAnalysis;
628
+ if (useComprehensive) {
629
+ environmentAnalysis = await generateComprehensiveAnalysis(analysisType, enableMemory);
630
+ }
631
+ else {
632
+ environmentAnalysis = await generateBasicAnalysis();
633
+ }
634
+ const result = {
635
+ data: environmentAnalysis,
636
+ contentType: 'application/json',
637
+ lastModified: new Date().toISOString(),
638
+ cacheKey,
639
+ ttl: 300, // 5 minutes cache
640
+ etag: generateETag(environmentAnalysis),
641
+ };
642
+ // Cache result
643
+ resourceCache.set(cacheKey, result, result.ttl);
644
+ return result;
645
+ }
646
+ //# sourceMappingURL=environment-analysis-resource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment-analysis-resource.js","sourceRoot":"","sources":["../../../src/resources/environment-analysis-resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE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