@decaf-ts/mcp-server 0.4.9 → 0.4.16

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 (650) hide show
  1. package/dist/assets/code/patterns/builder.json +10 -0
  2. package/dist/assets/prompts/documentation/class.json +10 -0
  3. package/dist/assets/prompts/documentation/constant.json +10 -0
  4. package/dist/assets/prompts/documentation/decorator.json +10 -0
  5. package/dist/assets/prompts/documentation/file.json +10 -0
  6. package/dist/assets/prompts/documentation/function.json +10 -0
  7. package/dist/assets/prompts/documentation/interface.json +10 -0
  8. package/dist/assets/prompts/documentation/iterate.json +10 -0
  9. package/dist/assets/prompts/documentation/module.json +10 -0
  10. package/dist/assets/prompts/documentation/prefix.json +10 -0
  11. package/dist/assets/prompts/documentation/repo.json +10 -0
  12. package/dist/assets/prompts/documentation/suffix.json +10 -0
  13. package/dist/assets/prompts/repository/readme.json +10 -0
  14. package/dist/assets/prompts/repository/release_notes.json +10 -0
  15. package/dist/assets/prompts/repository/setup.json +10 -0
  16. package/dist/assets/prompts/tests/coverage.json +10 -0
  17. package/dist/mcp-server.cjs +1 -1
  18. package/dist/mcp-server.cjs.map +1 -1
  19. package/dist/mcp-server.js +1 -1
  20. package/dist/mcp-server.js.map +1 -1
  21. package/lib/assets/code/patterns/builder.json +10 -0
  22. package/lib/assets/prompts/documentation/class.json +10 -0
  23. package/lib/assets/prompts/documentation/constant.json +10 -0
  24. package/lib/assets/prompts/documentation/decorator.json +10 -0
  25. package/lib/assets/prompts/documentation/file.json +10 -0
  26. package/lib/assets/prompts/documentation/function.json +10 -0
  27. package/lib/assets/prompts/documentation/interface.json +10 -0
  28. package/lib/assets/prompts/documentation/iterate.json +10 -0
  29. package/lib/assets/prompts/documentation/module.json +10 -0
  30. package/lib/assets/prompts/documentation/prefix.json +10 -0
  31. package/lib/assets/prompts/documentation/repo.json +10 -0
  32. package/lib/assets/prompts/documentation/suffix.json +10 -0
  33. package/lib/assets/prompts/repository/readme.json +10 -0
  34. package/lib/assets/prompts/repository/release_notes.json +10 -0
  35. package/lib/assets/prompts/repository/setup.json +10 -0
  36. package/lib/assets/prompts/tests/coverage.json +10 -0
  37. package/lib/builders/builder.cjs +19 -4
  38. package/lib/builders/builder.d.ts +14 -4
  39. package/lib/builders/builder.js.map +1 -1
  40. package/lib/builders/index.cjs +3 -2
  41. package/lib/builders/index.d.ts +1 -2
  42. package/lib/builders/index.js.map +1 -1
  43. package/lib/builders/prompt-builder.cjs +172 -12
  44. package/lib/builders/prompt-builder.d.ts +29 -5
  45. package/lib/builders/prompt-builder.js.map +1 -1
  46. package/lib/builders/resource-builder.cjs +4 -4
  47. package/lib/builders/resource-builder.d.ts +2 -2
  48. package/lib/builders/resource-builder.js.map +1 -1
  49. package/lib/builders/tool-builder.cjs +27 -9
  50. package/lib/builders/tool-builder.d.ts +7 -6
  51. package/lib/builders/tool-builder.js.map +1 -1
  52. package/lib/builders/types.cjs +3 -0
  53. package/lib/builders/types.d.ts +17 -0
  54. package/lib/builders/types.js.map +1 -0
  55. package/lib/esm/builders/builder.d.ts +14 -4
  56. package/lib/esm/builders/builder.js +19 -4
  57. package/lib/esm/builders/builder.js.map +1 -1
  58. package/lib/esm/builders/index.d.ts +1 -2
  59. package/lib/esm/builders/index.js +3 -2
  60. package/lib/esm/builders/index.js.map +1 -1
  61. package/lib/esm/builders/prompt-builder.d.ts +29 -5
  62. package/lib/esm/builders/prompt-builder.js +172 -13
  63. package/lib/esm/builders/prompt-builder.js.map +1 -1
  64. package/lib/esm/builders/resource-builder.d.ts +2 -2
  65. package/lib/esm/builders/resource-builder.js +3 -3
  66. package/lib/esm/builders/resource-builder.js.map +1 -1
  67. package/lib/esm/builders/tool-builder.d.ts +7 -6
  68. package/lib/esm/builders/tool-builder.js +28 -10
  69. package/lib/esm/builders/tool-builder.js.map +1 -1
  70. package/lib/esm/builders/types.d.ts +17 -0
  71. package/lib/esm/builders/types.js +2 -0
  72. package/lib/esm/builders/types.js.map +1 -0
  73. package/lib/esm/index.d.ts +0 -2
  74. package/lib/esm/index.js +3 -2
  75. package/lib/esm/index.js.map +1 -1
  76. package/lib/esm/jira/errors.d.ts +0 -0
  77. package/lib/esm/jira/errors.js +42 -0
  78. package/lib/esm/jira/errors.js.map +1 -0
  79. package/lib/esm/jira/jira-client-factory.d.ts +0 -0
  80. package/lib/esm/jira/jira-client-factory.js +74 -0
  81. package/lib/esm/jira/jira-client-factory.js.map +1 -0
  82. package/lib/esm/jira/schema-utils.d.ts +5 -0
  83. package/lib/esm/jira/schema-utils.js +52 -0
  84. package/lib/esm/jira/schema-utils.js.map +1 -0
  85. package/lib/esm/jira/tool-utils.d.ts +0 -0
  86. package/lib/esm/jira/tool-utils.js +65 -0
  87. package/lib/esm/jira/tool-utils.js.map +1 -0
  88. package/lib/esm/mcp-server.d.ts +2 -2
  89. package/lib/esm/mcp-server.js +132 -170
  90. package/lib/esm/mcp-server.js.map +1 -1
  91. package/lib/esm/modules/jira/auth-providers.d.ts +0 -0
  92. package/lib/esm/modules/jira/auth-providers.js +33 -0
  93. package/lib/esm/modules/jira/auth-providers.js.map +1 -0
  94. package/lib/esm/modules/jira/error-normalizer.d.ts +0 -0
  95. package/lib/esm/modules/jira/error-normalizer.js +13 -0
  96. package/lib/esm/modules/jira/error-normalizer.js.map +1 -0
  97. package/lib/esm/modules/jira/index.d.ts +1 -0
  98. package/lib/esm/modules/jira/index.js +17 -0
  99. package/lib/esm/modules/jira/index.js.map +1 -0
  100. package/lib/esm/modules/jira/makeJiraClient.d.ts +10 -0
  101. package/lib/esm/modules/jira/makeJiraClient.js +44 -0
  102. package/lib/esm/modules/jira/makeJiraClient.js.map +1 -0
  103. package/lib/esm/modules/jira/prompts/create-issue-prompt.d.ts +0 -0
  104. package/lib/esm/modules/jira/prompts/create-issue-prompt.js +33 -0
  105. package/lib/esm/modules/jira/prompts/create-issue-prompt.js.map +1 -0
  106. package/lib/esm/modules/jira/register.d.ts +0 -0
  107. package/lib/esm/modules/jira/register.js +244 -0
  108. package/lib/esm/modules/jira/register.js.map +1 -0
  109. package/lib/esm/modules/jira/schemas/create-issue-input.d.ts +0 -0
  110. package/lib/esm/modules/jira/schemas/create-issue-input.js +13 -0
  111. package/lib/esm/modules/jira/schemas/create-issue-input.js.map +1 -0
  112. package/lib/esm/modules/jira/schemas/issue-schema.d.ts +0 -0
  113. package/lib/esm/modules/jira/schemas/issue-schema.js +13 -0
  114. package/lib/esm/modules/jira/schemas/issue-schema.js.map +1 -0
  115. package/lib/esm/modules/jira/tools/agile-board-list.d.ts +0 -0
  116. package/lib/esm/modules/jira/tools/agile-board-list.js +27 -0
  117. package/lib/esm/modules/jira/tools/agile-board-list.js.map +1 -0
  118. package/lib/esm/modules/jira/tools/issue-create.d.ts +0 -0
  119. package/lib/esm/modules/jira/tools/issue-create.js +69 -0
  120. package/lib/esm/modules/jira/tools/issue-create.js.map +1 -0
  121. package/lib/esm/modules/jira/tools/issue-transition.d.ts +0 -0
  122. package/lib/esm/modules/jira/tools/issue-transition.js +27 -0
  123. package/lib/esm/modules/jira/tools/issue-transition.js.map +1 -0
  124. package/lib/esm/modules/jira/tools/project-list.d.ts +0 -0
  125. package/lib/esm/modules/jira/tools/project-list.js +27 -0
  126. package/lib/esm/modules/jira/tools/project-list.js.map +1 -0
  127. package/lib/esm/modules/jira/tools/search-jql.d.ts +0 -0
  128. package/lib/esm/modules/jira/tools/search-jql.js +27 -0
  129. package/lib/esm/modules/jira/tools/search-jql.js.map +1 -0
  130. package/lib/esm/modules/jira/types.d.ts +13 -0
  131. package/lib/esm/modules/jira/types.js +2 -0
  132. package/lib/esm/modules/jira/types.js.map +1 -0
  133. package/lib/esm/prompts/code/design-patterns/builder.js +1 -3
  134. package/lib/esm/prompts/code/design-patterns/builder.js.map +1 -1
  135. package/lib/esm/prompts/contants.d.ts +4 -0
  136. package/lib/esm/prompts/contants.js +6 -0
  137. package/lib/esm/prompts/contants.js.map +1 -0
  138. package/lib/esm/prompts/index.js +16 -22
  139. package/lib/esm/prompts/index.js.map +1 -1
  140. package/lib/esm/prompts/issue/create-prompt.d.ts +3 -0
  141. package/lib/esm/prompts/issue/create-prompt.js +31 -0
  142. package/lib/esm/prompts/issue/create-prompt.js.map +1 -0
  143. package/lib/esm/prompts/jsdocs-prompts.d.ts +2 -0
  144. package/lib/esm/prompts/jsdocs-prompts.js +27 -0
  145. package/lib/esm/prompts/jsdocs-prompts.js.map +1 -0
  146. package/lib/esm/prompts/sprint/plan-sprint-prompt.d.ts +2 -0
  147. package/lib/esm/prompts/sprint/plan-sprint-prompt.js +26 -0
  148. package/lib/esm/prompts/sprint/plan-sprint-prompt.js.map +1 -0
  149. package/lib/esm/resources/decoration-schematics/index.d.ts +0 -0
  150. package/lib/esm/resources/decoration-schematics/index.js +72 -0
  151. package/lib/esm/resources/decoration-schematics/index.js.map +1 -0
  152. package/lib/esm/resources/example-resource/index.d.ts +0 -2
  153. package/lib/esm/resources/example-resource/index.js +27 -18
  154. package/lib/esm/resources/example-resource/index.js.map +1 -1
  155. package/lib/esm/resources/fields-resource.d.ts +0 -0
  156. package/lib/esm/resources/fields-resource.js +50 -0
  157. package/lib/esm/resources/fields-resource.js.map +1 -0
  158. package/lib/esm/resources/golden-overrides/index.d.ts +0 -0
  159. package/lib/esm/resources/golden-overrides/index.js +57 -0
  160. package/lib/esm/resources/golden-overrides/index.js.map +1 -0
  161. package/lib/esm/resources/index.d.ts +0 -2
  162. package/lib/esm/resources/index.js +8 -3
  163. package/lib/esm/resources/index.js.map +1 -1
  164. package/lib/esm/resources/projects-resource.d.ts +0 -0
  165. package/lib/esm/resources/projects-resource.js +59 -0
  166. package/lib/esm/resources/projects-resource.js.map +1 -0
  167. package/lib/esm/resources/repo-metadata/index.d.ts +0 -2
  168. package/lib/esm/resources/repo-metadata/index.js +33 -24
  169. package/lib/esm/resources/repo-metadata/index.js.map +1 -1
  170. package/lib/esm/tools/agile/board-list-tool.d.ts +0 -0
  171. package/lib/esm/tools/agile/board-list-tool.js +49 -0
  172. package/lib/esm/tools/agile/board-list-tool.js.map +1 -0
  173. package/lib/esm/tools/ast/ts-ast-tool.d.ts +0 -2
  174. package/lib/esm/tools/ast/ts-ast-tool.js +79 -66
  175. package/lib/esm/tools/ast/ts-ast-tool.js.map +1 -1
  176. package/lib/esm/tools/ast/types.d.ts +0 -105
  177. package/lib/esm/tools/ast/types.js +69 -32
  178. package/lib/esm/tools/ast/types.js.map +1 -1
  179. package/lib/esm/tools/ast/utils.d.ts +0 -5
  180. package/lib/esm/tools/ast/utils.js +69 -57
  181. package/lib/esm/tools/ast/utils.js.map +1 -1
  182. package/lib/esm/tools/ast-jsdoc-tools/apply.d.ts +0 -6
  183. package/lib/esm/tools/ast-jsdoc-tools/apply.js +32 -28
  184. package/lib/esm/tools/ast-jsdoc-tools/apply.js.map +1 -1
  185. package/lib/esm/tools/ast-jsdoc-tools/cli.d.ts +0 -2
  186. package/lib/esm/tools/ast-jsdoc-tools/cli.js +17 -32
  187. package/lib/esm/tools/ast-jsdoc-tools/cli.js.map +1 -1
  188. package/lib/esm/tools/ast-jsdoc-tools/contracts/validator.d.ts +0 -0
  189. package/lib/esm/tools/ast-jsdoc-tools/contracts/validator.js +8 -0
  190. package/lib/esm/tools/ast-jsdoc-tools/contracts/validator.js.map +1 -0
  191. package/lib/esm/tools/ast-jsdoc-tools/enumerator.d.ts +0 -1
  192. package/lib/esm/tools/ast-jsdoc-tools/enumerator.js +25 -24
  193. package/lib/esm/tools/ast-jsdoc-tools/enumerator.js.map +1 -1
  194. package/lib/esm/tools/ast-jsdoc-tools/fileRunner.d.ts +0 -11
  195. package/lib/esm/tools/ast-jsdoc-tools/fileRunner.js +38 -28
  196. package/lib/esm/tools/ast-jsdoc-tools/fileRunner.js.map +1 -1
  197. package/lib/esm/tools/ast-jsdoc-tools/formatter.d.ts +0 -6
  198. package/lib/esm/tools/ast-jsdoc-tools/formatter.js +21 -17
  199. package/lib/esm/tools/ast-jsdoc-tools/formatter.js.map +1 -1
  200. package/lib/esm/tools/ast-jsdoc-tools/generator.d.ts +0 -12
  201. package/lib/esm/tools/ast-jsdoc-tools/generator.js +68 -54
  202. package/lib/esm/tools/ast-jsdoc-tools/generator.js.map +1 -1
  203. package/lib/esm/tools/ast-jsdoc-tools/index.d.ts +0 -7
  204. package/lib/esm/tools/ast-jsdoc-tools/index.js +43 -28
  205. package/lib/esm/tools/ast-jsdoc-tools/index.js.map +1 -1
  206. package/lib/esm/tools/ast-jsdoc-tools/interactive.d.ts +0 -1
  207. package/lib/esm/tools/ast-jsdoc-tools/interactive.js +8 -6
  208. package/lib/esm/tools/ast-jsdoc-tools/interactive.js.map +1 -1
  209. package/lib/esm/tools/ast-jsdoc-tools/parser.d.ts +0 -13
  210. package/lib/esm/tools/ast-jsdoc-tools/parser.js +88 -70
  211. package/lib/esm/tools/ast-jsdoc-tools/parser.js.map +1 -1
  212. package/lib/esm/tools/ast-jsdoc-tools/patch.d.ts +0 -2
  213. package/lib/esm/tools/ast-jsdoc-tools/patch.js +25 -22
  214. package/lib/esm/tools/ast-jsdoc-tools/patch.js.map +1 -1
  215. package/lib/esm/tools/ast-jsdoc-tools/promptRunner.d.ts +0 -0
  216. package/lib/esm/tools/ast-jsdoc-tools/promptRunner.js +40 -0
  217. package/lib/esm/tools/ast-jsdoc-tools/promptRunner.js.map +1 -0
  218. package/lib/esm/tools/ast-jsdoc-tools/prompts/loader.d.ts +0 -10
  219. package/lib/esm/tools/ast-jsdoc-tools/prompts/loader.js +33 -25
  220. package/lib/esm/tools/ast-jsdoc-tools/prompts/loader.js.map +1 -1
  221. package/lib/esm/tools/ast-jsdoc-tools/repoRunner.d.ts +0 -16
  222. package/lib/esm/tools/ast-jsdoc-tools/repoRunner.js +123 -60
  223. package/lib/esm/tools/ast-jsdoc-tools/repoRunner.js.map +1 -1
  224. package/lib/esm/tools/ast-jsdoc-tools/tool0/generator-tool.d.ts +0 -0
  225. package/lib/esm/tools/ast-jsdoc-tools/tool0/generator-tool.js +34 -0
  226. package/lib/esm/tools/ast-jsdoc-tools/tool0/generator-tool.js.map +1 -0
  227. package/lib/esm/tools/ast-jsdoc-tools/tool1/extractor.d.ts +0 -0
  228. package/lib/esm/tools/ast-jsdoc-tools/tool1/extractor.js +196 -0
  229. package/lib/esm/tools/ast-jsdoc-tools/tool1/extractor.js.map +1 -0
  230. package/lib/esm/tools/ast-jsdoc-tools/tool2/suggester.d.ts +0 -0
  231. package/lib/esm/tools/ast-jsdoc-tools/tool2/suggester.js +67 -0
  232. package/lib/esm/tools/ast-jsdoc-tools/tool2/suggester.js.map +1 -0
  233. package/lib/esm/tools/ast-jsdoc-tools/tool3/fileProcessor.d.ts +0 -0
  234. package/lib/esm/tools/ast-jsdoc-tools/tool3/fileProcessor.js +35 -0
  235. package/lib/esm/tools/ast-jsdoc-tools/tool3/fileProcessor.js.map +1 -0
  236. package/lib/esm/tools/ast-jsdoc-tools/tool4/repoRunner.d.ts +0 -0
  237. package/lib/esm/tools/ast-jsdoc-tools/tool4/repoRunner.js +116 -0
  238. package/lib/esm/tools/ast-jsdoc-tools/tool4/repoRunner.js.map +1 -0
  239. package/lib/esm/tools/ast-jsdoc-tools/tools/jsdoc-generator.d.ts +0 -5
  240. package/lib/esm/tools/ast-jsdoc-tools/tools/jsdoc-generator.js +79 -77
  241. package/lib/esm/tools/ast-jsdoc-tools/tools/jsdoc-generator.js.map +1 -1
  242. package/lib/esm/tools/ast-jsdoc-tools/utils/backups.d.ts +0 -0
  243. package/lib/esm/tools/ast-jsdoc-tools/utils/backups.js +14 -0
  244. package/lib/esm/tools/ast-jsdoc-tools/utils/backups.js.map +1 -0
  245. package/lib/esm/tools/ast-jsdoc-tools/utils/conflict-detector.d.ts +0 -5
  246. package/lib/esm/tools/ast-jsdoc-tools/utils/conflict-detector.js +29 -29
  247. package/lib/esm/tools/ast-jsdoc-tools/utils/conflict-detector.js.map +1 -1
  248. package/lib/esm/tools/ast-jsdoc-tools/utils/context-schema.d.ts +0 -7
  249. package/lib/esm/tools/ast-jsdoc-tools/utils/context-schema.js +29 -28
  250. package/lib/esm/tools/ast-jsdoc-tools/utils/context-schema.js.map +1 -1
  251. package/lib/esm/tools/ast-jsdoc-tools/utils/heuristics.d.ts +0 -2
  252. package/lib/esm/tools/ast-jsdoc-tools/utils/heuristics.js +27 -30
  253. package/lib/esm/tools/ast-jsdoc-tools/utils/heuristics.js.map +1 -1
  254. package/lib/esm/tools/ast-jsdoc-tools/utils/logging.d.ts +0 -0
  255. package/lib/esm/tools/ast-jsdoc-tools/utils/logging.js +18 -0
  256. package/lib/esm/tools/ast-jsdoc-tools/utils/logging.js.map +1 -0
  257. package/lib/esm/tools/ast-jsdoc-tools/utils/ts-project.d.ts +0 -12
  258. package/lib/esm/tools/ast-jsdoc-tools/utils/ts-project.js +22 -20
  259. package/lib/esm/tools/ast-jsdoc-tools/utils/ts-project.js.map +1 -1
  260. package/lib/esm/tools/decoration/builder.d.ts +0 -0
  261. package/lib/esm/tools/decoration/builder.js +81 -0
  262. package/lib/esm/tools/decoration/builder.js.map +1 -0
  263. package/lib/esm/tools/decoration/decorators.d.ts +0 -0
  264. package/lib/esm/tools/decoration/decorators.js +37 -0
  265. package/lib/esm/tools/decoration/decorators.js.map +1 -0
  266. package/lib/esm/tools/decoration/index.d.ts +0 -0
  267. package/lib/esm/tools/decoration/index.js +49 -0
  268. package/lib/esm/tools/decoration/index.js.map +1 -0
  269. package/lib/esm/tools/file-summarizer/index.d.ts +0 -2
  270. package/lib/esm/tools/file-summarizer/index.js +41 -28
  271. package/lib/esm/tools/file-summarizer/index.js.map +1 -1
  272. package/lib/esm/tools/index.d.ts +0 -2
  273. package/lib/esm/tools/index.js +30 -5
  274. package/lib/esm/tools/index.js.map +1 -1
  275. package/lib/esm/tools/issue/create-tool.d.ts +0 -0
  276. package/lib/esm/tools/issue/create-tool.js +132 -0
  277. package/lib/esm/tools/issue/create-tool.js.map +1 -0
  278. package/lib/esm/tools/issue/transition-tool.d.ts +0 -0
  279. package/lib/esm/tools/issue/transition-tool.js +41 -0
  280. package/lib/esm/tools/issue/transition-tool.js.map +1 -0
  281. package/lib/esm/tools/jsdoc/ts-jsdoc-element-tool.d.ts +0 -2
  282. package/lib/esm/tools/jsdoc/ts-jsdoc-element-tool.js +110 -83
  283. package/lib/esm/tools/jsdoc/ts-jsdoc-element-tool.js.map +1 -1
  284. package/lib/esm/tools/jsdoc/utils.d.ts +0 -5
  285. package/lib/esm/tools/jsdoc/utils.js +59 -52
  286. package/lib/esm/tools/jsdoc/utils.js.map +1 -1
  287. package/lib/esm/tools/project/list-tool.d.ts +0 -0
  288. package/lib/esm/tools/project/list-tool.js +47 -0
  289. package/lib/esm/tools/project/list-tool.js.map +1 -0
  290. package/lib/esm/tools/search/jql-tool.d.ts +0 -0
  291. package/lib/esm/tools/search/jql-tool.js +49 -0
  292. package/lib/esm/tools/search/jql-tool.js.map +1 -0
  293. package/lib/esm/tools/testing/ts-jest-list-tests.d.ts +0 -2
  294. package/lib/esm/tools/testing/ts-jest-list-tests.js +70 -52
  295. package/lib/esm/tools/testing/ts-jest-list-tests.js.map +1 -1
  296. package/lib/esm/types.d.ts +7 -11
  297. package/lib/esm/utils/assets.d.ts +13 -0
  298. package/lib/esm/utils/assets.js +78 -0
  299. package/lib/esm/utils/assets.js.map +1 -0
  300. package/lib/esm/utils/banner.js +3 -3
  301. package/lib/esm/utils/banner.js.map +1 -1
  302. package/lib/esm/utils/constants.d.ts +8 -0
  303. package/lib/esm/utils/constants.js +11 -0
  304. package/lib/esm/utils/constants.js.map +1 -0
  305. package/lib/esm/utils/conversions.d.ts +2 -0
  306. package/lib/esm/utils/conversions.js +23 -0
  307. package/lib/esm/utils/conversions.js.map +1 -0
  308. package/lib/esm/utils/environment.d.ts +32 -0
  309. package/lib/esm/utils/environment.js +43 -0
  310. package/lib/esm/utils/environment.js.map +1 -0
  311. package/lib/esm/utils/icons.d.ts +0 -0
  312. package/lib/esm/utils/icons.js +2 -0
  313. package/lib/esm/utils/icons.js.map +1 -0
  314. package/lib/esm/utils/initialization.d.ts +1 -0
  315. package/lib/esm/utils/initialization.js +20 -0
  316. package/lib/esm/utils/initialization.js.map +1 -0
  317. package/lib/esm/utils/normalization.d.ts +0 -0
  318. package/lib/esm/utils/normalization.js +2 -0
  319. package/lib/esm/utils/normalization.js.map +1 -0
  320. package/lib/esm/utils/utils.d.ts +1 -0
  321. package/lib/esm/utils/utils.js +8 -0
  322. package/lib/esm/utils/utils.js.map +1 -0
  323. package/lib/esm/version.d.ts +1 -1
  324. package/lib/esm/version.js +1 -1
  325. package/lib/index.cjs +3 -2
  326. package/lib/index.d.ts +0 -2
  327. package/lib/index.js.map +1 -1
  328. package/lib/jira/errors.cjs +42 -0
  329. package/lib/jira/errors.d.ts +0 -0
  330. package/lib/jira/errors.js.map +1 -0
  331. package/lib/jira/jira-client-factory.cjs +74 -0
  332. package/lib/jira/jira-client-factory.d.ts +0 -0
  333. package/lib/jira/jira-client-factory.js.map +1 -0
  334. package/lib/jira/schema-utils.cjs +58 -0
  335. package/lib/jira/schema-utils.d.ts +5 -0
  336. package/lib/jira/schema-utils.js.map +1 -0
  337. package/lib/jira/tool-utils.cjs +65 -0
  338. package/lib/jira/tool-utils.d.ts +0 -0
  339. package/lib/jira/tool-utils.js.map +1 -0
  340. package/lib/mcp-server.cjs +133 -204
  341. package/lib/mcp-server.d.ts +2 -2
  342. package/lib/mcp-server.js.map +1 -1
  343. package/lib/modules/jira/auth-providers.cjs +33 -0
  344. package/lib/modules/jira/auth-providers.d.ts +0 -0
  345. package/lib/modules/jira/auth-providers.js.map +1 -0
  346. package/lib/modules/jira/error-normalizer.cjs +13 -0
  347. package/lib/modules/jira/error-normalizer.d.ts +0 -0
  348. package/lib/modules/jira/error-normalizer.js.map +1 -0
  349. package/lib/modules/jira/index.cjs +33 -0
  350. package/lib/modules/jira/index.d.ts +1 -0
  351. package/lib/modules/jira/index.js.map +1 -0
  352. package/lib/modules/jira/makeJiraClient.cjs +47 -0
  353. package/lib/modules/jira/makeJiraClient.d.ts +10 -0
  354. package/lib/modules/jira/makeJiraClient.js.map +1 -0
  355. package/lib/modules/jira/prompts/create-issue-prompt.cjs +33 -0
  356. package/lib/modules/jira/prompts/create-issue-prompt.d.ts +0 -0
  357. package/lib/modules/jira/prompts/create-issue-prompt.js.map +1 -0
  358. package/lib/modules/jira/register.cjs +244 -0
  359. package/lib/modules/jira/register.d.ts +0 -0
  360. package/lib/modules/jira/register.js.map +1 -0
  361. package/lib/modules/jira/schemas/create-issue-input.cjs +13 -0
  362. package/lib/modules/jira/schemas/create-issue-input.d.ts +0 -0
  363. package/lib/modules/jira/schemas/create-issue-input.js.map +1 -0
  364. package/lib/modules/jira/schemas/issue-schema.cjs +13 -0
  365. package/lib/modules/jira/schemas/issue-schema.d.ts +0 -0
  366. package/lib/modules/jira/schemas/issue-schema.js.map +1 -0
  367. package/lib/modules/jira/tools/agile-board-list.cjs +27 -0
  368. package/lib/modules/jira/tools/agile-board-list.d.ts +0 -0
  369. package/lib/modules/jira/tools/agile-board-list.js.map +1 -0
  370. package/lib/modules/jira/tools/issue-create.cjs +69 -0
  371. package/lib/modules/jira/tools/issue-create.d.ts +0 -0
  372. package/lib/modules/jira/tools/issue-create.js.map +1 -0
  373. package/lib/modules/jira/tools/issue-transition.cjs +27 -0
  374. package/lib/modules/jira/tools/issue-transition.d.ts +0 -0
  375. package/lib/modules/jira/tools/issue-transition.js.map +1 -0
  376. package/lib/modules/jira/tools/project-list.cjs +27 -0
  377. package/lib/modules/jira/tools/project-list.d.ts +0 -0
  378. package/lib/modules/jira/tools/project-list.js.map +1 -0
  379. package/lib/modules/jira/tools/search-jql.cjs +27 -0
  380. package/lib/modules/jira/tools/search-jql.d.ts +0 -0
  381. package/lib/modules/jira/tools/search-jql.js.map +1 -0
  382. package/lib/modules/jira/types.cjs +3 -0
  383. package/lib/modules/jira/types.d.ts +13 -0
  384. package/lib/modules/jira/types.js.map +1 -0
  385. package/lib/prompts/code/design-patterns/builder.cjs +1 -3
  386. package/lib/prompts/code/design-patterns/builder.js.map +1 -1
  387. package/lib/prompts/contants.cjs +9 -0
  388. package/lib/prompts/contants.d.ts +4 -0
  389. package/lib/prompts/contants.js.map +1 -0
  390. package/lib/prompts/index.cjs +16 -22
  391. package/lib/prompts/index.js.map +1 -1
  392. package/lib/prompts/issue/create-prompt.cjs +34 -0
  393. package/lib/prompts/issue/create-prompt.d.ts +3 -0
  394. package/lib/prompts/issue/create-prompt.js.map +1 -0
  395. package/lib/prompts/jsdocs-prompts.cjs +30 -0
  396. package/lib/prompts/jsdocs-prompts.d.ts +2 -0
  397. package/lib/prompts/jsdocs-prompts.js.map +1 -0
  398. package/lib/prompts/sprint/plan-sprint-prompt.cjs +29 -0
  399. package/lib/prompts/sprint/plan-sprint-prompt.d.ts +2 -0
  400. package/lib/prompts/sprint/plan-sprint-prompt.js.map +1 -0
  401. package/lib/resources/decoration-schematics/index.cjs +72 -0
  402. package/lib/resources/decoration-schematics/index.d.ts +0 -0
  403. package/lib/resources/decoration-schematics/index.js.map +1 -0
  404. package/lib/resources/example-resource/index.cjs +26 -20
  405. package/lib/resources/example-resource/index.d.ts +0 -2
  406. package/lib/resources/example-resource/index.js.map +1 -1
  407. package/lib/resources/fields-resource.cjs +50 -0
  408. package/lib/resources/fields-resource.d.ts +0 -0
  409. package/lib/resources/fields-resource.js.map +1 -0
  410. package/lib/resources/golden-overrides/index.cjs +57 -0
  411. package/lib/resources/golden-overrides/index.d.ts +0 -0
  412. package/lib/resources/golden-overrides/index.js.map +1 -0
  413. package/lib/resources/index.cjs +7 -5
  414. package/lib/resources/index.d.ts +0 -2
  415. package/lib/resources/index.js.map +1 -1
  416. package/lib/resources/projects-resource.cjs +59 -0
  417. package/lib/resources/projects-resource.d.ts +0 -0
  418. package/lib/resources/projects-resource.js.map +1 -0
  419. package/lib/resources/repo-metadata/index.cjs +32 -26
  420. package/lib/resources/repo-metadata/index.d.ts +0 -2
  421. package/lib/resources/repo-metadata/index.js.map +1 -1
  422. package/lib/tools/agile/board-list-tool.cjs +49 -0
  423. package/lib/tools/agile/board-list-tool.d.ts +0 -0
  424. package/lib/tools/agile/board-list-tool.js.map +1 -0
  425. package/lib/tools/ast/ts-ast-tool.cjs +78 -68
  426. package/lib/tools/ast/ts-ast-tool.d.ts +0 -2
  427. package/lib/tools/ast/ts-ast-tool.js.map +1 -1
  428. package/lib/tools/ast/types.cjs +68 -34
  429. package/lib/tools/ast/types.d.ts +0 -105
  430. package/lib/tools/ast/types.js.map +1 -1
  431. package/lib/tools/ast/utils.cjs +68 -63
  432. package/lib/tools/ast/utils.d.ts +0 -5
  433. package/lib/tools/ast/utils.js.map +1 -1
  434. package/lib/tools/ast-jsdoc-tools/apply.cjs +31 -34
  435. package/lib/tools/ast-jsdoc-tools/apply.d.ts +0 -6
  436. package/lib/tools/ast-jsdoc-tools/apply.js.map +1 -1
  437. package/lib/tools/ast-jsdoc-tools/cli.cjs +16 -36
  438. package/lib/tools/ast-jsdoc-tools/cli.d.ts +0 -2
  439. package/lib/tools/ast-jsdoc-tools/cli.js.map +1 -1
  440. package/lib/tools/ast-jsdoc-tools/contracts/validator.cjs +8 -0
  441. package/lib/tools/ast-jsdoc-tools/contracts/validator.d.ts +0 -0
  442. package/lib/tools/ast-jsdoc-tools/contracts/validator.js.map +1 -0
  443. package/lib/tools/ast-jsdoc-tools/enumerator.cjs +24 -29
  444. package/lib/tools/ast-jsdoc-tools/enumerator.d.ts +0 -1
  445. package/lib/tools/ast-jsdoc-tools/enumerator.js.map +1 -1
  446. package/lib/tools/ast-jsdoc-tools/fileRunner.cjs +37 -33
  447. package/lib/tools/ast-jsdoc-tools/fileRunner.d.ts +0 -11
  448. package/lib/tools/ast-jsdoc-tools/fileRunner.js.map +1 -1
  449. package/lib/tools/ast-jsdoc-tools/formatter.cjs +20 -19
  450. package/lib/tools/ast-jsdoc-tools/formatter.d.ts +0 -6
  451. package/lib/tools/ast-jsdoc-tools/formatter.js.map +1 -1
  452. package/lib/tools/ast-jsdoc-tools/generator.cjs +67 -56
  453. package/lib/tools/ast-jsdoc-tools/generator.d.ts +0 -12
  454. package/lib/tools/ast-jsdoc-tools/generator.js.map +1 -1
  455. package/lib/tools/ast-jsdoc-tools/index.cjs +42 -31
  456. package/lib/tools/ast-jsdoc-tools/index.d.ts +0 -7
  457. package/lib/tools/ast-jsdoc-tools/index.js.map +1 -1
  458. package/lib/tools/ast-jsdoc-tools/interactive.cjs +7 -8
  459. package/lib/tools/ast-jsdoc-tools/interactive.d.ts +0 -1
  460. package/lib/tools/ast-jsdoc-tools/interactive.js.map +1 -1
  461. package/lib/tools/ast-jsdoc-tools/parser.cjs +87 -75
  462. package/lib/tools/ast-jsdoc-tools/parser.d.ts +0 -13
  463. package/lib/tools/ast-jsdoc-tools/parser.js.map +1 -1
  464. package/lib/tools/ast-jsdoc-tools/patch.cjs +24 -27
  465. package/lib/tools/ast-jsdoc-tools/patch.d.ts +0 -2
  466. package/lib/tools/ast-jsdoc-tools/patch.js.map +1 -1
  467. package/lib/tools/ast-jsdoc-tools/promptRunner.cjs +40 -0
  468. package/lib/tools/ast-jsdoc-tools/promptRunner.d.ts +0 -0
  469. package/lib/tools/ast-jsdoc-tools/promptRunner.js.map +1 -0
  470. package/lib/tools/ast-jsdoc-tools/prompts/loader.cjs +32 -30
  471. package/lib/tools/ast-jsdoc-tools/prompts/loader.d.ts +0 -10
  472. package/lib/tools/ast-jsdoc-tools/prompts/loader.js.map +1 -1
  473. package/lib/tools/ast-jsdoc-tools/repoRunner.cjs +122 -65
  474. package/lib/tools/ast-jsdoc-tools/repoRunner.d.ts +0 -16
  475. package/lib/tools/ast-jsdoc-tools/repoRunner.js.map +1 -1
  476. package/lib/tools/ast-jsdoc-tools/tool0/generator-tool.cjs +34 -0
  477. package/lib/tools/ast-jsdoc-tools/tool0/generator-tool.d.ts +0 -0
  478. package/lib/tools/ast-jsdoc-tools/tool0/generator-tool.js.map +1 -0
  479. package/lib/tools/ast-jsdoc-tools/tool1/extractor.cjs +196 -0
  480. package/lib/tools/ast-jsdoc-tools/tool1/extractor.d.ts +0 -0
  481. package/lib/tools/ast-jsdoc-tools/tool1/extractor.js.map +1 -0
  482. package/lib/tools/ast-jsdoc-tools/tool2/suggester.cjs +67 -0
  483. package/lib/tools/ast-jsdoc-tools/tool2/suggester.d.ts +0 -0
  484. package/lib/tools/ast-jsdoc-tools/tool2/suggester.js.map +1 -0
  485. package/lib/tools/ast-jsdoc-tools/tool3/fileProcessor.cjs +35 -0
  486. package/lib/tools/ast-jsdoc-tools/tool3/fileProcessor.d.ts +0 -0
  487. package/lib/tools/ast-jsdoc-tools/tool3/fileProcessor.js.map +1 -0
  488. package/lib/tools/ast-jsdoc-tools/tool4/repoRunner.cjs +116 -0
  489. package/lib/tools/ast-jsdoc-tools/tool4/repoRunner.d.ts +0 -0
  490. package/lib/tools/ast-jsdoc-tools/tool4/repoRunner.js.map +1 -0
  491. package/lib/tools/ast-jsdoc-tools/tools/jsdoc-generator.cjs +78 -79
  492. package/lib/tools/ast-jsdoc-tools/tools/jsdoc-generator.d.ts +0 -5
  493. package/lib/tools/ast-jsdoc-tools/tools/jsdoc-generator.js.map +1 -1
  494. package/lib/tools/ast-jsdoc-tools/utils/backups.cjs +14 -0
  495. package/lib/tools/ast-jsdoc-tools/utils/backups.d.ts +0 -0
  496. package/lib/tools/ast-jsdoc-tools/utils/backups.js.map +1 -0
  497. package/lib/tools/ast-jsdoc-tools/utils/conflict-detector.cjs +28 -31
  498. package/lib/tools/ast-jsdoc-tools/utils/conflict-detector.d.ts +0 -5
  499. package/lib/tools/ast-jsdoc-tools/utils/conflict-detector.js.map +1 -1
  500. package/lib/tools/ast-jsdoc-tools/utils/context-schema.cjs +28 -30
  501. package/lib/tools/ast-jsdoc-tools/utils/context-schema.d.ts +0 -7
  502. package/lib/tools/ast-jsdoc-tools/utils/context-schema.js.map +1 -1
  503. package/lib/tools/ast-jsdoc-tools/utils/heuristics.cjs +26 -32
  504. package/lib/tools/ast-jsdoc-tools/utils/heuristics.d.ts +0 -2
  505. package/lib/tools/ast-jsdoc-tools/utils/heuristics.js.map +1 -1
  506. package/lib/tools/ast-jsdoc-tools/utils/logging.cjs +18 -0
  507. package/lib/tools/ast-jsdoc-tools/utils/logging.d.ts +0 -0
  508. package/lib/tools/ast-jsdoc-tools/utils/logging.js.map +1 -0
  509. package/lib/tools/ast-jsdoc-tools/utils/ts-project.cjs +21 -55
  510. package/lib/tools/ast-jsdoc-tools/utils/ts-project.d.ts +0 -12
  511. package/lib/tools/ast-jsdoc-tools/utils/ts-project.js.map +1 -1
  512. package/lib/tools/decoration/builder.cjs +81 -0
  513. package/lib/tools/decoration/builder.d.ts +0 -0
  514. package/lib/tools/decoration/builder.js.map +1 -0
  515. package/lib/tools/decoration/decorators.cjs +37 -0
  516. package/lib/tools/decoration/decorators.d.ts +0 -0
  517. package/lib/tools/decoration/decorators.js.map +1 -0
  518. package/lib/tools/decoration/index.cjs +49 -0
  519. package/lib/tools/decoration/index.d.ts +0 -0
  520. package/lib/tools/decoration/index.js.map +1 -0
  521. package/lib/tools/file-summarizer/index.cjs +40 -30
  522. package/lib/tools/file-summarizer/index.d.ts +0 -2
  523. package/lib/tools/file-summarizer/index.js.map +1 -1
  524. package/lib/tools/index.cjs +29 -7
  525. package/lib/tools/index.d.ts +0 -2
  526. package/lib/tools/index.js.map +1 -1
  527. package/lib/tools/issue/create-tool.cjs +132 -0
  528. package/lib/tools/issue/create-tool.d.ts +0 -0
  529. package/lib/tools/issue/create-tool.js.map +1 -0
  530. package/lib/tools/issue/transition-tool.cjs +41 -0
  531. package/lib/tools/issue/transition-tool.d.ts +0 -0
  532. package/lib/tools/issue/transition-tool.js.map +1 -0
  533. package/lib/tools/jsdoc/ts-jsdoc-element-tool.cjs +109 -85
  534. package/lib/tools/jsdoc/ts-jsdoc-element-tool.d.ts +0 -2
  535. package/lib/tools/jsdoc/ts-jsdoc-element-tool.js.map +1 -1
  536. package/lib/tools/jsdoc/utils.cjs +58 -58
  537. package/lib/tools/jsdoc/utils.d.ts +0 -5
  538. package/lib/tools/jsdoc/utils.js.map +1 -1
  539. package/lib/tools/project/list-tool.cjs +47 -0
  540. package/lib/tools/project/list-tool.d.ts +0 -0
  541. package/lib/tools/project/list-tool.js.map +1 -0
  542. package/lib/tools/search/jql-tool.cjs +49 -0
  543. package/lib/tools/search/jql-tool.d.ts +0 -0
  544. package/lib/tools/search/jql-tool.js.map +1 -0
  545. package/lib/tools/testing/ts-jest-list-tests.cjs +69 -54
  546. package/lib/tools/testing/ts-jest-list-tests.d.ts +0 -2
  547. package/lib/tools/testing/ts-jest-list-tests.js.map +1 -1
  548. package/lib/types.d.ts +7 -11
  549. package/lib/utils/assets.cjs +114 -0
  550. package/lib/utils/assets.d.ts +13 -0
  551. package/lib/utils/assets.js.map +1 -0
  552. package/lib/utils/banner.cjs +48 -18
  553. package/lib/utils/banner.js.map +1 -1
  554. package/lib/utils/constants.cjs +14 -0
  555. package/lib/utils/constants.d.ts +8 -0
  556. package/lib/utils/constants.js.map +1 -0
  557. package/lib/utils/conversions.cjs +26 -0
  558. package/lib/utils/conversions.d.ts +2 -0
  559. package/lib/utils/conversions.js.map +1 -0
  560. package/lib/utils/environment.cjs +49 -0
  561. package/lib/utils/environment.d.ts +32 -0
  562. package/lib/utils/environment.js.map +1 -0
  563. package/lib/utils/icons.cjs +2 -0
  564. package/lib/utils/icons.d.ts +0 -0
  565. package/lib/utils/icons.js.map +1 -0
  566. package/lib/utils/initialization.cjs +23 -0
  567. package/lib/utils/initialization.d.ts +1 -0
  568. package/lib/utils/initialization.js.map +1 -0
  569. package/lib/utils/normalization.cjs +2 -0
  570. package/lib/utils/normalization.d.ts +0 -0
  571. package/lib/utils/normalization.js.map +1 -0
  572. package/lib/utils/utils.cjs +11 -0
  573. package/lib/utils/utils.d.ts +1 -0
  574. package/lib/utils/utils.js.map +1 -0
  575. package/lib/version.cjs +1 -1
  576. package/lib/version.d.ts +1 -1
  577. package/package.json +27 -23
  578. package/workdocs/assets/slogans.json +198 -0
  579. package/lib/environment.cjs +0 -32
  580. package/lib/environment.d.ts +0 -71
  581. package/lib/environment.js.map +0 -1
  582. package/lib/esm/environment.d.ts +0 -71
  583. package/lib/esm/environment.js +0 -29
  584. package/lib/esm/environment.js.map +0 -1
  585. package/lib/esm/prompts/example-prompt/index.d.ts +0 -2
  586. package/lib/esm/prompts/example-prompt/index.js +0 -18
  587. package/lib/esm/prompts/example-prompt/index.js.map +0 -1
  588. package/lib/esm/prompts/interactive-jsdoc/index.d.ts +0 -2
  589. package/lib/esm/prompts/interactive-jsdoc/index.js +0 -18
  590. package/lib/esm/prompts/interactive-jsdoc/index.js.map +0 -1
  591. package/lib/esm/prompts/jsdocs/class-prompt.d.ts +0 -2
  592. package/lib/esm/prompts/jsdocs/class-prompt.js +0 -52
  593. package/lib/esm/prompts/jsdocs/class-prompt.js.map +0 -1
  594. package/lib/esm/prompts/jsdocs/const-prompt.d.ts +0 -2
  595. package/lib/esm/prompts/jsdocs/const-prompt.js +0 -24
  596. package/lib/esm/prompts/jsdocs/const-prompt.js.map +0 -1
  597. package/lib/esm/prompts/jsdocs/constants.d.ts +0 -4
  598. package/lib/esm/prompts/jsdocs/constants.js +0 -46
  599. package/lib/esm/prompts/jsdocs/constants.js.map +0 -1
  600. package/lib/esm/prompts/jsdocs/decorator-prompt.d.ts +0 -2
  601. package/lib/esm/prompts/jsdocs/decorator-prompt.js +0 -42
  602. package/lib/esm/prompts/jsdocs/decorator-prompt.js.map +0 -1
  603. package/lib/esm/prompts/jsdocs/enum-prompt.d.ts +0 -2
  604. package/lib/esm/prompts/jsdocs/enum-prompt.js +0 -24
  605. package/lib/esm/prompts/jsdocs/enum-prompt.js.map +0 -1
  606. package/lib/esm/prompts/jsdocs/function-prompt.d.ts +0 -2
  607. package/lib/esm/prompts/jsdocs/function-prompt.js +0 -43
  608. package/lib/esm/prompts/jsdocs/function-prompt.js.map +0 -1
  609. package/lib/esm/prompts/jsdocs/interface-prompt.d.ts +0 -2
  610. package/lib/esm/prompts/jsdocs/interface-prompt.js +0 -24
  611. package/lib/esm/prompts/jsdocs/interface-prompt.js.map +0 -1
  612. package/lib/esm/prompts/jsdocs/types-prompt.d.ts +0 -2
  613. package/lib/esm/prompts/jsdocs/types-prompt.js +0 -24
  614. package/lib/esm/prompts/jsdocs/types-prompt.js.map +0 -1
  615. package/lib/esm/tools/example-tool/index.d.ts +0 -2
  616. package/lib/esm/tools/example-tool/index.js +0 -29
  617. package/lib/esm/tools/example-tool/index.js.map +0 -1
  618. package/lib/prompts/example-prompt/index.cjs +0 -21
  619. package/lib/prompts/example-prompt/index.d.ts +0 -2
  620. package/lib/prompts/example-prompt/index.js.map +0 -1
  621. package/lib/prompts/interactive-jsdoc/index.cjs +0 -21
  622. package/lib/prompts/interactive-jsdoc/index.d.ts +0 -2
  623. package/lib/prompts/interactive-jsdoc/index.js.map +0 -1
  624. package/lib/prompts/jsdocs/class-prompt.cjs +0 -55
  625. package/lib/prompts/jsdocs/class-prompt.d.ts +0 -2
  626. package/lib/prompts/jsdocs/class-prompt.js.map +0 -1
  627. package/lib/prompts/jsdocs/const-prompt.cjs +0 -27
  628. package/lib/prompts/jsdocs/const-prompt.d.ts +0 -2
  629. package/lib/prompts/jsdocs/const-prompt.js.map +0 -1
  630. package/lib/prompts/jsdocs/constants.cjs +0 -49
  631. package/lib/prompts/jsdocs/constants.d.ts +0 -4
  632. package/lib/prompts/jsdocs/constants.js.map +0 -1
  633. package/lib/prompts/jsdocs/decorator-prompt.cjs +0 -45
  634. package/lib/prompts/jsdocs/decorator-prompt.d.ts +0 -2
  635. package/lib/prompts/jsdocs/decorator-prompt.js.map +0 -1
  636. package/lib/prompts/jsdocs/enum-prompt.cjs +0 -27
  637. package/lib/prompts/jsdocs/enum-prompt.d.ts +0 -2
  638. package/lib/prompts/jsdocs/enum-prompt.js.map +0 -1
  639. package/lib/prompts/jsdocs/function-prompt.cjs +0 -46
  640. package/lib/prompts/jsdocs/function-prompt.d.ts +0 -2
  641. package/lib/prompts/jsdocs/function-prompt.js.map +0 -1
  642. package/lib/prompts/jsdocs/interface-prompt.cjs +0 -27
  643. package/lib/prompts/jsdocs/interface-prompt.d.ts +0 -2
  644. package/lib/prompts/jsdocs/interface-prompt.js.map +0 -1
  645. package/lib/prompts/jsdocs/types-prompt.cjs +0 -27
  646. package/lib/prompts/jsdocs/types-prompt.d.ts +0 -2
  647. package/lib/prompts/jsdocs/types-prompt.js.map +0 -1
  648. package/lib/tools/example-tool/index.cjs +0 -32
  649. package/lib/tools/example-tool/index.d.ts +0 -2
  650. package/lib/tools/example-tool/index.js.map +0 -1
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "builder",
3
+ "description": "Documents a Typescript class, the decaf way",
4
+ "title": "Class Documentation",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "document the entire class and each of its functions including always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @class tags when applicable.\ninclude @param tags in the class documentation and its type definitions\nInclude detailed @description for all properties.\nInclude @template tags when necessary.\nDo NOT document the constructor, but include the constructor arguments as @param in the class documentation\nFor methods and functions:\n- include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n- create a usage example under the @example tag on the class documentation\n- create mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @class\n7 - @example\n8 - @mermaid;\n\nignore @mermaid for methods with less that 15 lines and constructors.\nRespond only with the full JSDoc comment block for the class and its methods.\nNEVER user @memberOf in the class or any of it's methods"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "class",
3
+ "description": "Documents a Typescript class, the decaf way",
4
+ "title": "Class Documentation",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "document the entire class and each of its functions including always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @class tags when applicable.\ninclude @param tags in the class documentation and its type definitions\nInclude detailed @description for all properties.\nInclude @template tags when necessary.\nInclude @extends and @implements when necessary\nDo NOT document the constructor, but include the constructor arguments as @param in the class documentation\nFor methods and functions:\n- include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n- create a usage example under the @example tag on the class documentation\n- create mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @class\n7 - @extends\n8 - @implements\n9 - @example\n10 - @mermaid;\n\nignore @mermaid for methods with less that 15 lines and constructors.\nRespond only with the full JSDoc comment block for the class and its methods.\nNEVER user @memberOf in the class or any of it's methods\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "constant",
3
+ "description": "Document constants, enums, and typedefs with detailed JSDoc guidance.",
4
+ "title": "Constant Documentation",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @const and @typeDef tags when appropriate.\nInclude detailed @description for all properties.\n- For enums, include @enum and @readonly, and add inline documentation for each member\n- For object-like constants:\n - Create a @typedef with @property for each key\n - Reference it in the constant using @type\n - Alternatively, document each key inline if small\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @property;\n6 - @const followed by the const or enum name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nRespond with the JSDoc comment block(s) for both the typedef and the constant or enum.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "decorator",
3
+ "description": "Document decorators and decorator factories with JSDoc guidance.",
4
+ "title": "Decorator Documentation",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if ithas over 10 lines\n8 - @category one of: \"Decorators\", \"Class Decorators\", \"Method Decorators\", \"Property Decorators\", \"Parameter Decorators\"\nOutput only the full JSDoc comment block for the function.\nDO NOT refer to the module it belongs with @memberOf\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "file",
3
+ "description": "Instruction for documenting a full TypeScript file according to content types (classes, interfaces, functions, etc.).",
4
+ "title": "File Documentation",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "Document file according to:\n\n- classes: read the file [./doc_class.md](doc_class.md) and follow that instruction\n- interfaces and types: read the file [./doc_interface.md](./interface.md) and follow that instruction\n- decorators (file MUST be called decorators.ts): read the file [./doc_decorator.md](./decorator.md) and follow that instruction\n- functions: read the file [./doc_function.md](./function.md) and follow that instruction\n- enums and constants: read the file [./doc_constant.md](./constant.md) and follow that instruction\n\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "function",
3
+ "description": "Document functions and methods with detailed JSDoc guidance, including parameters and return types.",
4
+ "title": "Function Documentation",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if ithas over 10 lines\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the full JSDoc comment block for the function.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "interface",
3
+ "description": "Document interfaces and type definitions with detailed JSDoc guidance.",
4
+ "title": "Interface Documentation",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\n Include @interface and @typeDef an @template tags when appropriate.\n Include detailed @description for all properties.\n For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n\n The order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @interface or @typeDef followed by the interface or type name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the completed JSDoc comment block for the type or interface.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "iterate",
3
+ "description": "Instructions to iterate on documentation until the docs build successfully.",
4
+ "title": "Documentation Iterate",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "when you are finished:\n - build the docs with `npm run docs`;\n - if it's not successful, analyze the outcome and go back and fix it;\n - iterate as long as necessary until the documentation builds properly\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "module",
3
+ "description": "Generate a JSDoc block for a TypeScript module using better-docs formatting.",
4
+ "title": "Module Documentation",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "Generate a JSDoc comment block for a TypeScript module file using better-docs formatting:\n- Add @module with the name of the module\n- Add @description and @summary\n- Do NOT document individual exports\n- The summary should explain the role of the module and what it exposes (classes, utils, etc.)\n- Include references to key exported objects using @link where appropriate\n\nRespond with only the JSDoc block for the module file.\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n\nrespond upon completion without additional input\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "prefix",
3
+ "description": "Prefix/template instructions for writing JSDoc comments for classes and modules.",
4
+ "title": "Documentation Prefix",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "You're a senior TypeScript developer writing JSDoc documentation for a class to be used with better-docs. Given the module code:\nGenerate a JSDoc comment block for a TypeScript module file using better-docs formatting:\n```"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "repo",
3
+ "description": "Instructions for documenting a repository: reading files, understanding code, documenting modules, and building docs.",
4
+ "title": "Repository Documentation",
5
+ "effort": "medium",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "the user need to give a <base_path> representing where to run commands on, and where to consider the root folder.\nescaping this root folder for anything must be granted explicit permission by the user.\n\nexecute all tasks in order:\n\ntask 1 - read all files under `<base_path>/src/**/*.ts` and store them in <files>. <files> must include all code files in all folders of <base_path>/src and their child folders, for all possible levels within <base_path>/src.\ntask 2 - understand the content of each file, the repository as a whole. Identify main Classes, Functions, and overall functionality\ntask 3 - in <files>, find the module file `<base_path>/src/index.ts`.\ntask 4 - read the file `<base_path>/.codex/prompts/doc.md` and `.<base_path>/.codex/prompts/module.md` for instructions on how to document the module file.\ntask 5 - for each of the remaining files in <files>, read the file `<base_path>/.codex/prompts/doc.md` and `./.codex/prompts/file.md` for instructions on how to document that file. Use the module name created in task 4 for eventual @memberOf reference.\ntask 6 - build the docs by running in <base_path> the command `npm run docs`.\ntask 7 - if task 6 fails, fix the issues and go back to task 6. Iterate until doc generation is successful\n\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "suffix",
3
+ "description": "Non-negotiable rules and notes for generating JSDoc where certain complex types must be simplified.",
4
+ "title": "Documentation Suffix",
5
+ "effort": "low",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "\nNON NEGOTIABLE:\n- when documenting a function type as a parameter, ALWAYS use the function(type1,type2):return_type syntax;\n- when documenting a constructor type as a parameter `{new (...args: any[]): T}`, ALWAYS use the Constructor<T> syntax;\n - `keyof type` and `T[K]` `infer...` and other complex types are not supported by the documentation engine. simplify them accordingly, eg: `keyof type` => `string`\n- if the element is already documented, only restructure, correct, or improve the documentation. NEVER remove correct information\n- NEVER omit or change any code!\n\nNOTES:\n- Do not request additional input from the user unless you find a situation you cannot document successfully\n\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "readme",
3
+ "description": "Guidance to generate a repository README including examples and workdocs updates.",
4
+ "title": "Repository README",
5
+ "effort": "medium",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "the user need to give a <base_path> representing where to run commands on, and where to consider the root folder.\nescaping this root folder for anything must be granted explicit permission by the user.\n\ntask 1 - read all files under `<base_path>/src/**/*.ts` and store them in <files>.\ntask 2 - understand the content of each file, the repository as a whole. Identify main Classes, Functions, and overall functionality\ntask 3 - read all files under `<base_path>/tests/**/*.ts` and store them in <tests>.\ntask 4 - understand the content of each test file, and how to use the main objects of the repository and what for.\ntask 5 - if there's a file `<base_path>/workdocs/ai/focus-areas.md`, read it. if not ask the user for focus points for the description and examples (user can say no)\ntask 6 - from the identified elements and eventual focus provided, elaborate a short summary of the intent of the library and write in `<base_path>/workdocs/1-Header.md` under the banner and title\ntask 7 - write examples in the `workdocs/5-HowToUse.md` file for all the identified elements, giving high priority to the focus points if provided\n- each item MUST contain:\n - Description of the use case;\n - complex items should be accompanied by a detailed sequence diagram in mermaid (using appropriate markdown mermaid notation). it should be colorized using pleasant pastel colors and ensure color consistency between similar entities across different mermaid charts \n - typescript example(s) using the appropriate typescript code notation in md format\n - many sure to provide EXACT WORKING examples for the <files>, not examples for similar apis.\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "release_notes",
3
+ "description": "Instructions to generate release notes and changelog based on commits and tracked files.",
4
+ "title": "Repository Release Notes",
5
+ "effort": "medium",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "You are preparing release notes for this repo.\n1) Summarize notable changes since the last tag:\n a) compile the unique TICKETS for the commits since the last tag (TICKETS follow the pattern DECAF-XXX in the commit message);\n b) if there's a file `<base_path>/workdocs/ai/tracked-files.json` read the file list and:\n 1 - analyze all changes in those files since the last tag;\n 2 - identify any breaking changes in the api;\n 3 - identify any extended/corrected functionality from those changes;\n2) Create a <base_path>/workdocs/reports/CHANGELOG.md file (or append a new version section on top of existing file):\n a) for the new section add:\n 1 - new features section (bullet points with detailed description of each new feature);\n 2 - fixed bugs section (bullet points with detailed description of each fixed bug);\n 3 - breaking changes section (bullet points with detailed description of breaking changes);\n b) all bullet points must match a TICKET. Do not repeat TICKETS between features|bugs|breaking changes. summarize them into one (TICKETS can repeat in different sections, just not in the same one)\n3) Create (or replace) a <base_path>/workdocs/reports/DEPENDENCIES.md file:\n a) include section for dependencies including the output from `npm ls --prod --all --include=peer` wrapped in a shell code block;\n b) if any of the listed packages has vulnerabilities include section vulnerabilities, detailing the package, how it's used, the vulnerability, if it affects the code, and if so, the impact (and or fix/mitigating conditions)\n4) Create (or replace) a <base_path>/workdocs/reports/RELEASE_NOTES.md file:\n a) include, for each TICKET a succint description of the changes and their impact;\n b) include upgrade instructions if applicable;\n c) include summary of breaking changes if applicable, along with link to CHANGELOG file;\n d) include summary of vulnerabilities if applicable, along with link to DEPENDENCIES file;\n e) include a markdown table with a human readable version of the coverage report;\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "setup",
3
+ "description": "Instructions to verify and optionally initialize a repository, updating scripts, prompts, and workflows.",
4
+ "title": "Repository Setup",
5
+ "effort": "medium",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "You are ensuring the correctness of the documentation for this repo. \nYou need the user to provide the <base_path> of the repo. \noptionally, the user can provide ask to do an initialization of the repository.;\nThen you will:\n1) if the user requested initialization:\n a) ask for <repo_name> if not already provided by the user; \n b) check if the repo name in package.json matches <repo_name>, if not, update it. Do the same for all repo-related content in package.json, <base_path>/workdows/**/*.;\n c) ask for <license> if not already provided by the user.;\n d) check if the license in package.json matches <license>, if not, update it. Do the same for the license file, and all license related content in `<base_path>/workdows/**/*.md`.\n e) update all md files under `<base_path>/.codex/prompts/**/*.md` with the latest version from `github.com/decaf-ts/ts-workspace` getting the files from `<ts-workspace_repo_root>/.codex/prompts/*.md`.\n f) update all npm scripts `<base_path>/package.json` to match those in `github.com/decaf-ts/ts-workspace/package.json`. Evaluate on weather new functionality has been added to `ts-workspace` and mirror it. If the command has been adjusted for this repository leave it as is. When in doubt ask the user.\n g) update all github actions `<base_path>/.github/workflows` to match those in `github.com/decaf-ts/ts-workspace`, getting the files from `<ts-workspace_repo_root>/.github/workflows/*.(yml|yaml)`. Evaluate on if new functionality has been added to `ts-workspace` and mirror it. If the command has been adjusted for this repository leave it as is. When in doubt ask the user.\n2) match all the scripts in package.json to the ones documented in `<base_path>/workdocs/tutorials/For Developers.md#scripts`. Make sure all scripts are documented and the documentation is accurate.\n3) match all the test scripts in package.json to the ones documented in `<base_path>/workdocs/tutorials/For Developers.md#tests`. Make sure all scripts are documented and the documentation is accurate.\n4) make sure all the links and badges in `<base_path>/workdocs/**/*.md` are references to the repo in `<base_path>` working and up to date.\n5) perform all necessary fixes to ensure everything is correct\n"
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "coverage",
3
+ "description": "Instructions to run coverage, analyze results, and create tests until a target coverage is reached.",
4
+ "title": "Repository Test & Coverage",
5
+ "effort": "medium",
6
+ "reasoning": "medium",
7
+ "cost": "free",
8
+ "placeholders": [],
9
+ "prompt": "the user needs to give a <base_path> representing where to run commands on, and where to consider the root folder.\nescaping this root folder for anything must be granted explicit permission by the user.\nthe user can optionally provide <coverage>, a percentage number between 0 and 100 representing the minimum documentation coverage required. If not provided assume 90%.\n\n\ntask 1 - read all files under `<base_path>/src/**/*.ts` and store them in <files>.\ntask 2 - understand the content of each file, the repository as a whole. Identify main Classes, Functions, and overall functionality\ntask 3 - run coverage by running `npm run coverage`.\ntask 4 - extract the coverage report. If coverage is bellow <coverage>, create new tests (unit or integration) under `<base_path>/tests`;\ntask 5 - repeat tasks 3 and 4 until coverage is equal or above <coverage> with all tests passing.\ntask 6 - update the coverage config in `<base-path>/workdocs/reports` to reflect the new coverage percentage (round down to the nearest integer).\nNOTES:\n - Avoid mocking at all costs! Use real instances and dependencies.\n - the coverage report (after running the coverage command) can be found in `<base_path>/workdocs/reports/coverage`.\n - If a bug in the code is found, propose a fix to the user. if the user accepts it, apply the fix and continue with the tasks.\n - Always run the test command with env variables USE_WATCHMAN=false WATCHMAN_DISABLE=1 JEST_DISABLE_WATCHMAN=1 and the flag --watchman=false. If that still fails also add the flag --runInBand\n"
10
+ }
@@ -1,2 +1,2 @@
1
- var e,t;e=this,t=function(e,t,r,n,o,s,i,a,c,d,l,m,u,p,h,g){"use strict";function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var y,b,S,v=f(a),w=f(c);(e=>{e[e.NONE=0]="NONE",e[e.BASIC=1]="BASIC",e[e.ADVANCED=2]="ADVANCED",e[e.HIGH=3]="HIGH"})(y||(y={})),(e=>{e[e.NONE=0]="NONE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(b||(b={})),(e=>{e[e.FREE=0]="FREE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(S||(S={}));class x extends r.Model{constructor(e){super(e),r.Model.fromObject(this,e)}log(e){const{sessionId:t,requestId:r,authInfo:o}=e||{};let s="string"==typeof t&&t.length>0?n.Logging.for(t).for(this):n.Logging.for(this);return o&&o.clientId&&(s=s.for(o.clientId)),r&&(s=s.for(r.toString())),s}setDescription(e){return this.description=e,this}setName(e){return this.name=e,this}setTitle(e){return this.title=e,this}}t.__decorate([r.required(),t.__metadata("design:type",String)],x.prototype,"description",void 0),t.__decorate([r.required(),t.__metadata("design:type",String)],x.prototype,"name",void 0),t.__decorate([r.required(),t.__metadata("design:type",String)],x.prototype,"title",void 0);class T extends x{constructor(e){super(e),this.reasoning=y.NONE,this.effort=b.NONE,this.cost=S.FREE}setReasoning(e){return this.reasoning=e,this}setEffort(e){return this.effort=e,this}setCost(e){return this.cost=e,this}}t.__decorate([r.required(),t.__metadata("design:type",Number)],T.prototype,"reasoning",void 0),t.__decorate([r.required(),t.__metadata("design:type",Number)],T.prototype,"effort",void 0),t.__decorate([r.required(),t.__metadata("design:type",Number)],T.prototype,"cost",void 0);class N extends T{setCb(e){return this.cb=e,this}setArgsSchema(e){return this.argsSchema=e,this}constructor(e){super(e)}static get builder(){return new N}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerPrompt(this.name,{title:this.title,description:this.description,argsSchema:this.argsSchema},async(e,t)=>{const r=this.log(t);e=e||{},r.verbose(`Executing prompt ${this.name} with args: ${JSON.stringify(e)}`),e._meta=Object.assign(e._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const n=await Promise.resolve(this.cb(e,t));return r.verbose(`Prompt ${this.name} executed successfully.`),r.debug("Prompt execution meta: "+JSON.stringify(n._meta)),n})}catch(e){throw n.Logging.for(this).error("Failed to register prompt "+this.name,e),e}}}t.__decorate([r.required(),t.__metadata("design:type",Object)],N.prototype,"cb",void 0),t.__decorate([r.required(),t.__metadata("design:type",Object)],N.prototype,"argsSchema",void 0);class _ extends x{setCb(e){return this.cb=e,this}setConfig(e){return this.config=e,this}setUriOtTemplate(e){return this.uriOrTemplate=e,this}constructor(e){super(e)}static get builder(){return new _}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{const t="string"==typeof this.uriOrTemplate&&this.uriOrTemplate.includes("{")?new s.ResourceTemplate(new o.UriTemplate(this.uriOrTemplate),{list:void 0}):this.uriOrTemplate,r=Object.assign(this.config,{_meta:{}}),n=async(e,t)=>{const r=this.log(t);r.verbose(`Requesting resource ${this.name} from ${e.toString()}`);const n=await Promise.resolve(this.cb(e,t));return r.verbose(`Resource ${this.name} retrieved successfully.`),r.debug("Resource retrieval meta: "+JSON.stringify(n._meta)),n};return e.resource(this.name,t,r,n)}catch(e){throw n.Logging.for(this).error("Error registering resource "+this.name,e),e}}}t.__decorate([r.required(),t.__metadata("design:type",String)],_.prototype,"uriOrTemplate",void 0),t.__decorate([r.required(),t.__metadata("design:type",Function)],_.prototype,"cb",void 0),t.__decorate([r.required(),t.__metadata("design:type",Object)],_.prototype,"config",void 0);class E extends T{setAnnotations(e){return this.annotations=Object.assign(this.annotations,e),this}setCb(e){return this.cb=e,this}setInputSchema(e){return this.inputSchema=e,this}setOutputSchema(e){return this.outputSchema=e,this}constructor(e){super(e),this.annotations={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}static get builder(){return new E}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerTool(this.name,{title:this.title,description:this.description,inputSchema:this.inputSchema,outputSchema:this.outputSchema,annotations:this.annotations,_meta:{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}}},async(e,t)=>{const r=this.log(t);r.verbose(`Executing tool ${this.name} with args: ${JSON.stringify(e)}`),t._meta=Object.assign(t._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const n=await Promise.resolve(this.cb(e,t));return r.verbose(`Tool ${this.name} executed successfully.`),r.debug("Tool execution meta: "+JSON.stringify(n._meta)),n})}catch(e){throw n.Logging.for(this).error("Error building tool",e),e}}}t.__decorate([r.required(),t.__metadata("design:type",Object)],E.prototype,"annotations",void 0),t.__decorate([r.required(),t.__metadata("design:type",Object)],E.prototype,"cb",void 0),t.__decorate([r.type(Object.name),r.required(),t.__metadata("design:type",Object)],E.prototype,"inputSchema",void 0),t.__decorate([r.type(Object.name),t.__metadata("design:type",Object)],E.prototype,"outputSchema",void 0);const O=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];let D=null;async function j(e){const t=D||(D=new l.Project({tsConfigFilePath:void 0,skipAddingFilesFromTsConfig:!0}),D),r=t.addSourceFileAtPathIfExists(e)||t.createSourceFile(e,void 0,{overwrite:!1});try{await Promise.race([t.resolveSourceFileDependencies(),new Promise(e=>setTimeout(e,2e3))])}catch(e){}const n=r.getExportedDeclarations();return{astObjects:Array.from(n.entries()).flatMap(([t,r])=>r.map(r=>{const n="function"==typeof r.getStartLineNumber?r.getStartLineNumber():0,o="function"==typeof r.getEndLineNumber?r.getEndLineNumber():0,s="function"==typeof r.getKindName?(r.getKindName()+"").toLowerCase():"unknown",i="function"==typeof r.getStartLinePos?r.getStartLinePos():0;return{id:`${e}::${t}`,name:t,kind:s,location:{filePath:e,startLine:n,startColumn:i,endLine:o,endColumn:0},isExported:!0}}))}}const A="ts.ast.extract",C="AST Extraction Tool for TypeScript",P=d.z.object({filePath:d.z.string().describe("The path to the TypeScript file to analyze.")}).describe(`the input schema for the ${A} tool`);d.z.object({}).describe(`the output schema for the ${A} tool`);const I=E.builder.setName(A).setTitle(C).setDescription("Extracts and analyzes the Abstract Syntax Tree (AST) of TypeScript code to provide insights into its structure and components.").setInputSchema(P).setAnnotations({title:C,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}).setCb(async(e,t)=>{const{filePath:r}=e,n=await Promise.race([j(r),new Promise(e=>setTimeout(()=>e(null),1500))]);if(!n||!n.astObjects)return{content:[{type:"text",text:"No AST objects or analysis timed out"}],structuredContent:{astObjects:[]}};const o=n.astObjects.map(e=>({id:e.id,name:e.name,kind:e.kind||"unknown",location:e.location,isExported:!!e.isExported,signature:e.signature,parentId:e.parentId,children:e.children,decorators:e.decorators,contextHints:e.contextHints||[]}));return{content:[{type:"text",text:`Found ${o.length} AST objects`}],structuredContent:{astObjects:o}}}),$=E.builder.setName("example-tool").setTitle("Example: Reverse String Tool").setDescription("Reverses the provided `text` input and returns the result.").setInputSchema(d.z.object({text:d.z.string()})).setCb(async(e,t)=>{const r=((e?.text??"")+"").split("").reverse().join("");return{content:[{type:"text",text:r}],structuredContent:{result:r}}}).setReasoning(y.NONE).setEffort(b.NONE).setCost(S.FREE),k=E.builder.setName("ast.jsdoc").setTitle("AST \u2192 JSDoc Tool").setDescription("Generate suggested JSDoc comments for TypeScript AST objects (MVP stub).").setInputSchema(d.z.object({filePath:d.z.string()})).setCb(async(e,t)=>{const r=[{type:"text",text:"Not implemented (stub)"}];return{content:r,structuredContent:{content:r}}}).setReasoning(y.BASIC).setEffort(b.LOW).setCost(S.FREE),R=[I,$,E.builder.setName("file.summarizer").setTitle("File Summarizer").setDescription("Produce a short structured summary for a TypeScript file.").setInputSchema(d.z.object({filePath:d.z.string()})).setCb(async(e,t)=>{if(!(e?.filePath??e?.path))return{content:[{type:"text",text:""}]};const r=await(async()=>({astObjects:[]}))().catch(()=>null),n=r&&r.astObjects||[],o=n.map(e=>e.name||e.id||e.kind).slice(0,20),s=`Found ${n.length} AST objects. Top names: ${o.join(", ")}`;return{content:[{type:"text",text:s}],structuredContent:{summary:s},_meta:{count:n.length}}}).setReasoning(y.NONE).setEffort(b.NONE).setCost(S.FREE),k];var q=Object.freeze({__proto__:null,Tools:R});const z="You're a senior TypeScript developer writing JSDoc documentation for a class to be used with better-docs. Given the module code:\nGenerate a JSDoc comment block for a TypeScript module file using better-docs formatting:",J="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\n Include @interface and @typeDef an @template tags when appropriate.\n Include detailed @description for all properties.\n For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n\n The order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @interface or @typeDef followed by the interface or type name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the completed JSDoc comment block for the type or interface.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",M="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @const and @typeDef tags when appropriate.\nInclude detailed @description for all properties.\n- For enums, include @enum and @readonly, and add inline documentation for each member\n- For object-like constants:\n - Create a @typedef with @property for each key\n - Reference it in the constant using @type\n - Alternatively, document each key inline if small\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @property;\n6 - @const followed by the const or enum name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nRespond with the JSDoc comment block(s) for both the typedef and the constant or enum.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",L="NOTES:\n - when document a function/method parameters, and there is a template type involved, ALWAYS reference it using the @template tag;\n - when documenting a function type as a parameter, ALWAYS use the function(type1,type2):return_type syntax;\n ",F=d.z.object({}),H=N.builder.setName("ts.jsdoc.class").setTitle("Class JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript class according to a curated template and prompt.").setArgsSchema(F).setReasoning(y.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\ndocument the entire class and each of its functions including always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @class tags when applicable.\ninclude @param tags in the class documentation and its type definitions\nInclude detailed @description for all properties.\nInclude @template tags when necessary.\nDo NOT document the constructor, but include the constructor arguments as @param in the class documentation\nFor methods and functions:\n- include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n- create a usage example under the @example tag on the class documentation\n- create mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @class\n7 - @example\n8 - @mermaid;\n\nignore @mermaid for methods with less that 15 lines and constructors.\nRespond only with the full JSDoc comment block for the class and its methods.\nNEVER user @memberOf in the class or any of it's methods\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\nnever omit or change any code, including the constructor\n${L}`}}],_meta:{}})),B=d.z.object({}),G=N.builder.setName("ts.jsdoc.const").setTitle("Const JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript constant according to a curated template and prompt.").setArgsSchema(B).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\n${M}\n${L}`}}]})),U=d.z.object({}),V=N.builder.setName("ts.jsdoc.decorator").setTitle("Decorator JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript Decorator according to a curated template and prompt.").setArgsSchema(U).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if it has over 10 lines\n8 - @category one of: "Decorators", "Class Decorators", "Method Decorators", "Property Decorators", "Parameter Decorators"\nOutput only the full JSDoc comment block for the function.\nDO NOT refer to the module it belongs with @memberOf\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${L}`}}]})),W=d.z.object({}),K=N.builder.setName("ts.jsdoc.enum").setTitle("Enum JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript enum according to a curated template and prompt.").setArgsSchema(W).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\n${M}\n${L}`}}]})),Y=d.z.object({}),Q=N.builder.setName("ts.jsdoc.function").setTitle("Function JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript function according to a curated template and prompt.").setArgsSchema(Y).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if ithas over 10 lines\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the full JSDoc comment block for the function.\nrefer to the module it belongs with @memberOf this the \`@memberOf module:<module_name>\` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${L}`}}]})),X=d.z.object({}),Z=N.builder.setName("ts.jsdoc.interface").setTitle("Interface JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript interface according to a curated template and prompt.").setArgsSchema(X).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\n${J}\n${L}`}}]})),ee=d.z.object({}),te=N.builder.setName("ts.jsdoc.type").setTitle("Type JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript type according to a curated template and prompt.").setArgsSchema(ee).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${z}\n${J}\n${L}`}}]})),re=d.z.object({className:d.z.string().describe("the class name to turn into a builder")}),ne=N.builder.setName("ts.code.dp.builder").setTitle("Typescript builder design patter prompt").setDescription("for a class, with a defined set of properties, scafold a builder design pattern").setArgsSchema(re).setReasoning(y.BASIC).setCb((e,t)=>(e.className=n.toPascalCase(e.className),{messages:[{role:"user",content:{type:"text",text:`You're a senior TypeScript developer writing typescript code.You're a senior TypeScript developer writing typescript code.\nTransform the selected class into a builder design pattern implementation in Typescript.\nuse @decaf-ts validation decorators to enforce the validation of your builder.\n\n- must extend the Model Class from @decaf-ts/decorator-validation;\n- each property must be marked as protected;\n- each property must have a setter method that returns 'this' for chaining;\n- the build() method must validate the properties using hasErrors() method from Model class;\n- if validation fails, throw an error with the validation errors;\n- if validation passes, return an instance of the original class with the set properties;\n- optionally (but do so by default) add the static builder and from methods from the example;\n- if the clasee already follows the pattern but has properties without decoration or without setters, simple add them;\n\nexample:\n\noriginal class:\n\`\`\`typescript\nexport class ${e.className} {\n description!: string;\n name!: string = "default name";\n title!: string;\n age?: string;\n dateOfBirth!: Date;\n}}\n\`\`\` \n\nresulting builder pattern implementation:\n\`\`\`typescript\nexport class ${e.className}Builder extends Model {\n\n @minlength(10\n @required()\n protected description!: string;\n \n @required()\n protected name!: string = "default value;\n \n @required()\n protected title!: string;\n \n @min(18)\n protected age?: string;\n \n @date()\n protected dateOfBirth!: Date;\n\n protected constructor(arg?: ModelArg<${e.className}Builder>>) {\n super(arg);\n Model.fromModel(this, arg);\n }\n\n setDescription(value: string) {\n this.description = value;\n return this;\n }\n\n setName(value: string) {\n this.name = value;\n return this;\n }\n\n setTitle(value: string) {\n this.title = value;\n return this;\n }\n setAge(value: number) {\n this.age = value;\n return this;\n }\n setDate(value: Date) {\n this.age = value;\n return this;\n }\n \n build(...args: any[]): ${e.className}Builder | Promise<${e.className}Builder> {\n const errs = this.hasErrors();\n if (errs) throw new Error(errs.toString());\n \n return // code that builds OBJ here\n }\n \n static get builder(): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to get a new builder instance\n }\n \n static from<K extends keyof ${e.className}Builder>(obj: K, ${e.className}Builder[K]): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to create a builder from an object\n }\n}\n\`\`\` \n\n`}}],_meta:{}})),oe=d.z.object({text:d.z.string().optional()}),se=N.builder.setName("example.prompt.echo").setTitle("Example: Echo Prompt").setDescription("Returns a short prompt containing the provided `text` as a user message.").setArgsSchema(oe).setReasoning(y.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:e?.text??"(no text provided)"}}],_meta:{}})),ie=d.z.object({code:d.z.string().optional(),astObject:d.z.any().optional()}),ae=[H,G,V,K,Q,Z,te,ne,se,N.builder.setName("interactive.jsdoc.assistant").setTitle("Interactive JSDoc Assistant").setDescription("Produce a ready-to-insert JSDoc block for a provided code snippet or AST object.").setArgsSchema(ie).setReasoning(y.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:"Generate a complete JSDoc comment block for the following code. Respond only with the full JSDoc block.\n\n"+(e?.code??"")}}],_meta:{}}))],ce=[_.builder.setName("example.resource.hello").setTitle("Example: Hello Resource").setDescription("A tiny example resource that returns a simple payload for any URI.").setUriOtTemplate("example://hello/{name}").setConfig({description:"Example resource",_meta:{usage:{reasoning:y.NONE,effort:b.NONE,cost:S.FREE}}}).setCb(async(e,t)=>({content:{type:"text",text:"hello from example resource"},_meta:{}})),_.builder.setName("repo.metadata").setTitle("Repository Metadata Resource").setDescription("Expose basic repository metadata such as package.json and lint rules.").setUriOtTemplate("repo://metadata/{file}").setConfig({description:"Repository metadata resource",_meta:{usage:{reasoning:y.NONE,effort:b.NONE,cost:S.FREE}}}).setCb(async(e,t)=>{const r=e.pathname.replace(/^\//,"")||"package.json";try{const e=a.resolve(process.cwd(),r),t=await m.readFile(e,{encoding:"utf8"}),n=JSON.parse(t);return{content:{type:"json",data:JSON.stringify(n)},_meta:{}}}catch(e){return{content:{type:"text",text:""},_meta:{}}}})],de="##VERSION##",le="##PACKAGE##";g.Metadata.registerLibrary(le,de);const me={mcpId:le,name:"Official Decaf-TS MCP Server",title:"Official Decaf-TS MCP Server",description:"Provides precise coding assistance for the decaf-ts framework",version:de,websiteUrl:"https://decaf-ts.github.io",repositoryUrl:"https://github.com/decaf-ts",license:"AGPL-3.0",contacts:[{name:"Decaf-TS",url:"https://decaf-ts.github.io"}],tags:"server,official,decaf-ts",metadata:{},icons:[{src:"workdocs/assets/favicon.svg",mimeType:"image/svg+xml",sizes:"any"}]},ue=n.LoggedEnvironment.accumulate(me);class pe extends n.LoggedClass{get client(){if(!this._mcp)throw Error("Mcp server requires Mcp client");return this._mcp}constructor(){super()}async load(){try{const e=await Promise.all(ce.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} resources`);const t=await Promise.all(ae.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${t.length} prompts`);const r=await Promise.all(R.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${r.length} tools`);try{const e=await Promise.resolve().then(()=>q),t=Object.values(e).filter(e=>e&&"function"==typeof e.build).filter(e=>!R.includes(e));if(t.length>0){const e=await Promise.all(t.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} exported builders from tools module`)}}catch(e){this.log.verbose("No additional exported builders loaded from tools module: "+e)}}catch(e){throw this.log.error("Error loading core MCP components",e),e}}async boot(e="stdio"){const t=this.log;this.log.for(this.boot).info("McpServer booting..."),((e=n.Logging.get())=>{let t;try{t=(()=>{let e,t=__dirname;try{for(;t&&t!==v.default.parse(t).root;){const r=v.default.join(t,"node_modules");if(w.default.existsSync(r)&&w.default.statSync(r).isDirectory()){e=r;break}const n=v.default.dirname(t);if(n===t)break;t=n}}catch{}const r=[];if(e){const t=v.default.join(e,"@decaf-ts");try{if(w.default.existsSync(t)&&w.default.statSync(t).isDirectory()){const e=w.default.readdirSync(t);for(const n of e){const e=v.default.join(t,n);try{const t=v.default.join(e,"workdocs","assets","slogans.json");if(w.default.existsSync(t)&&w.default.statSync(t).isFile()){const e=w.default.readFileSync(t,"utf-8"),n=JSON.parse(e);if(Array.isArray(n))for(const e of n)"string"==typeof e&&e.trim().length>0&&r.push(e.trim())}}catch{}}}}catch{}}return 0===r.length?"Decaf: strongly brewed TypeScript.":r[Math.floor(Math.random()*r.length)]})()}catch{t="Decaf: strongly brewed TypeScript."}const r="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),o=r.reduce((e,t)=>Math.max(e,t.length),0);r.push("# "+t.padStart(o-3)),r.forEach((t,r)=>{const n=O[r%O.length]||"",o=e?e.info.bind(e):(()=>{}).bind();try{o(i.style(t||"").raw(n).text)}catch{o((t||"")+"")}})})(this.log);const r=((Array.isArray(ue.icons)?ue.icons:[ue.icons])||[]).map(e=>{const t="string"==typeof e?.src?e.src:(e?.src??"")+"",r="string"==typeof e?.mimeType?e.mimeType:(e?.mimeType??"")+"";let n=[];return Array.isArray(e?.sizes)?n=e.sizes.map(e=>e+""):"string"==typeof e?.sizes&&(n=(e.sizes+"").split(",").map(e=>e.trim())),{src:t,mimeType:r,sizes:n}}),o=ue.contacts;let a;if(null!=o)if(Array.isArray(o))a=o.map(e=>({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0}));else if("object"==typeof o){const e=Object.keys(o||{}).filter(e=>/^[0-9]+$/.test(e)).sort((e,t)=>Number(e)-Number(t));if(e.length>0)a=e.map(e=>{const t=o[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}});else if("number"==typeof o.length){const e=Number(o.length)||0;a=[];for(let t=0;e>t;t++){const e=o[t];a.push({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0})}}else a=Object.keys(o).filter(e=>"length"!==e).map(e=>{const t=o[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}})}const c={id:ue.mcpId,name:ue.name,title:ue.title,description:ue.description,websiteUrl:ue.websiteUrl,repositoryUrl:ue.repositoryUrl,version:ue.version,license:ue.license,contacts:a,tags:ue.tags?ue.tags.split(","):void 0,metadata:ue.metadata,icons:r};this._mcp=new s.McpServer(c,{instructions:"You are an AI assistant designed to help users with programming tasks related to the Decaf-TS framework. \nProvide clear, concise, and accurate information.\nIf you don't know the answer, admit it rather than making up information.\nAlways prioritize the user's intent and provide helpful suggestions when appropriate.\n",capabilities:{logging:{},completions:{},resources:{},tools:{},prompts:{}}});try{await this.load()}catch(e){throw this.log.error("Error loading resources/prompts/tools: "+e),e}if("string"==typeof e)switch(e){case"stdio":e=new p.StdioServerTransport;break;case"http":e=new u.StreamableHTTPServerTransport({sessionIdGenerator:()=>h.v4(),onsessioninitialized:e=>t.verbose("Session initialized: "+e),onsessionclosed:e=>t.verbose("Session closed: "+e),enableJsonResponse:!0,eventStore:void 0,allowedHosts:["*"],allowedOrigins:["*"],enableDnsRebindingProtection:!0});break;default:throw Error("Invalid transport type: "+e)}return this.client.connect(e)}}e.Builder=x,e.McpServer=pe,e.PACKAGE_NAME=le,e.PromptBuilder=N,e.ResourceBuilder=_,e.ToolBuilder=E,e.UsableBuilder=T,e.VERSION=de},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("tslib"),require("@decaf-ts/decorator-validation"),require("@decaf-ts/logging"),require("@modelcontextprotocol/sdk/shared/uriTemplate"),require("@modelcontextprotocol/sdk/server/mcp"),require("styled-string-builder"),require("path"),require("fs"),require("zod"),require("ts-morph"),require("fs/promises"),require("@modelcontextprotocol/sdk/server/streamableHttp"),require("@modelcontextprotocol/sdk/server/stdio"),require("uuid"),require("@decaf-ts/decoration")):"function"==typeof define&&define.amd?define(["exports","tslib","@decaf-ts/decorator-validation","@decaf-ts/logging","@modelcontextprotocol/sdk/shared/uriTemplate","@modelcontextprotocol/sdk/server/mcp","styled-string-builder","path","fs","zod","ts-morph","fs/promises","@modelcontextprotocol/sdk/server/streamableHttp","@modelcontextprotocol/sdk/server/stdio","uuid","@decaf-ts/decoration"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["mcp-server"]={},e.tslib,e.decafTsDecoratorValidation,e.decafTsLogging,e.uriTemplate,e.mcp,e.styledStringBuilder,e.path,e.fs,e.zod,e.tsMorph,e.fsPromises,e.streamableHttp,e.stdio,e.uuid,e.decafTsDecoration);
1
+ var e,t;e=this,t=function(e,t,r,s,o,i,a,n,c,d,p,l,h,f,m){"use strict";function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function g(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(r=>{if("default"!==r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}}),t.default=e,Object.freeze(t)}var y=g(s),b=u(s),_=g(o);const S=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];var v,w,E,j,O;(e=>{e[e.NONE=0]="NONE",e[e.BASIC=1]="BASIC",e[e.ADVANCED=2]="ADVANCED",e[e.HIGH=3]="HIGH"})(v||(v={})),(e=>{e[e.NONE=0]="NONE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(w||(w={})),(e=>{e[e.FREE=0]="FREE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(E||(E={}));class x extends a.Model{get log(){return this._log||(this._log=t.Logging.for(this)),this._log}constructor(e){super(e)}logFor(e){const{sessionId:t,requestId:r,authInfo:s}=e||{};let o="string"==typeof t&&t.length>0?this.log.for(t):this.log;return s&&s.clientId&&(o=o.for(s.clientId)),r&&(o=o.for(r.toString())),o}setDescription(e){return this.description=e,this}getDescription(){return this.description}setName(e){return this.name=e,this}getName(){return this.name}setTitle(e){return this.title=e,this}}i.__decorate([a.required(),i.__metadata("design:type",String)],x.prototype,"description",void 0),i.__decorate([a.required(),i.__metadata("design:type",String)],x.prototype,"name",void 0),i.__decorate([a.required(),i.__metadata("design:type",String)],x.prototype,"title",void 0);class N extends x{constructor(e){super(e),this.reasoning=v.NONE,this.effort=w.NONE,this.cost=E.FREE}setReasoning(e){return this.reasoning=e,this}setEffort(e){return this.effort=e,this}setCost(e){return this.cost=e,this}}function P(e){if(!e)return;let t=e,r=t&&t._def;for(;r&&"ZodObject"!==r.typeName;){if("ZodEffects"===r.typeName&&r.schema)t=r.schema;else if("ZodOptional"===r.typeName&&r.innerType)t=r.innerType;else if("ZodDefault"===r.typeName&&r.innerType)t=r.innerType;else if("ZodNullable"===r.typeName&&r.innerType)t=r.innerType;else{if(!r.schema)return;t=r.schema}r=t&&t._def}return r&&"ZodObject"===r.typeName?r:void 0}function A(e){switch(e){case"none":return v.NONE;case"basic":return v.BASIC;case"advanced":return v.ADVANCED;case"high":return v.HIGH;case"medium":return w.MEDIUM;case"low":return E.LOW;case"free":return E.FREE;default:throw new p.InternalError("Cannon convert unknown level "+e)}}i.__decorate([a.required(),i.__metadata("design:type",Number)],N.prototype,"reasoning",void 0),i.__decorate([a.required(),i.__metadata("design:type",Number)],N.prototype,"effort",void 0),i.__decorate([a.required(),i.__metadata("design:type",Number)],N.prototype,"cost",void 0),(e=>{e.ASSETS="assets"})(j||(j={})),(e=>{e.PROMPT="prompts",e.DOCUMENTATION="documentation",e.CODE="code"})(O||(O={}));let D=class extends t.LoggedClass{constructor(e=y.join(process.cwd(),"lib",j.ASSETS)){super(),this.basePath=e}listAssets(...e){const t=y.join(this.basePath,...e);return _.readdirSync(t)}listPrompts(){return this.listAssets(O.PROMPT)}getAsset(e,t="md",...r){const s=y.join(this.basePath,...r),o=y.join(s,`${e}.${t}`);return _.readFileSync(o,"utf-8")}getAllAssets(e,...t){return this.listAssets(e,...t).reduce((r,s)=>{const o=y.extname(s),i=y.basename(s,o),a=o.replace(/^\./,"")||void 0;return r[i]=this.getAsset(i,a??void 0,e,...t),r},{})}toPromptDef(e){return e.effort=A(e.effort),e.reasoning=A(e.reasoning),e.cost=A(e.cost),e}getPrompt(e,...r){const s=this.getAsset(t.toSnakeCase(e),"json",O.PROMPT,...r);let o;try{o=JSON.parse(s)}catch(t){throw new p.SerializationError(`Failed to parse prompt ${e} in categories ${r}: ${t}`)}return this.toPromptDef(o)}getAllPrompts(...e){const t=this.getAllAssets(O.PROMPT,...e);return Object.entries(t).reduce((t,[r,s])=>{try{t[r]=JSON.parse(s)}catch(t){throw new p.SerializationError(`Failed to parse prompt ${r} in categories ${e}: ${t}`)}return t},t)}};D=i.__decorate([c.injectable(),i.__metadata("design:paramtypes",[Object])],D);class T extends N{constructor(e){super(e)}setCb(e){return this.cb=e,this}setArgsSchema(e){return this.argsSchema=e,this}static get builder(){return new T}static patchPrompt(e,r,s,o){const i=(r=Array.isArray(r)?r:Object.keys(r)).filter(e=>!Object.prototype.hasOwnProperty.call(s,e));if(i.length)throw new p.ValidationError("Missing replacements for placeholders: "+i.join(", "));o&&(o.verbose("Patching prompt with placeholders: "+JSON.stringify(r)),o.debug("Values: "+JSON.stringify(s)));const a=r.reduce((e,t)=>(e[t]=s[t],e),{});return t.sf(e,a)}patchPrompt(e,t,r,s){return T.patchPrompt(e,t,r,s||this.log.for(this.patchPrompt))}build(e,t){const r=this.log.for(this.build),s=this.hasErrors();if(s)throw new p.ValidationError(s.toString());try{this.argsSchema&&((e,t="schema")=>{if(!P(e))throw Error(`Registration error: provided a non-canonical ${t}. Export a ZodObject (z.object(...)).`)})(this.argsSchema,"argsSchema");const r=(e=>{if(!e)return;if(e&&"object"==typeof e&&!e._def)return e;const t=P(e);return t?"function"==typeof t.shape?t.shape():t.shape||void 0:void 0})(this.argsSchema);return e.registerPrompt(this.name,{title:this.title,description:this.description,argsSchema:r},async(e,r)=>{const s=this.logFor(r);e=Object.assign({},t,e||{}),s.verbose(`Executing prompt ${this.name} with args: ${JSON.stringify(e)}`),e._meta=Object.assign(e._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const o=await Promise.resolve(this.cb(e,r));return s.verbose(`Prompt ${this.name} executed successfully.`),s.debug("Prompt execution meta: "+JSON.stringify(o._meta)),o})}catch(e){throw r.error("Failed to register prompt "+(this.name||this.constructor.name),e),e}}}i.__decorate([c.inject(D),i.__metadata("design:type",D)],T.prototype,"assets",void 0),i.__decorate([a.required(),i.__metadata("design:type",Object)],T.prototype,"cb",void 0),i.__decorate([a.required(),i.__metadata("design:type",n.ZodObject)],T.prototype,"argsSchema",void 0),i.__decorate([d.prop(),i.__metadata("design:type",Object)],T.prototype,"placeholders",void 0);class C extends T{setCategory(e){return this.promptCategory=e,this}addPrefix(e){return this.prefixes=this.prefixes||[],this.prefixes.push(e),this}addSuffix(e){return this.suffixes=this.suffixes||[],this.suffixes.push(e),this}constructor(e){super(e)}build(e){const t=(d.Metadata.properties(C)||[]).filter(e=>!["assets","promptCategory","prefixes","suffixes"].includes(e)),r=this.hasErrors(...t);if(r)throw new p.ValidationError(r.toString());const s=this.assets.getPrompt(this.name,this.promptCategory);a.Model.fromObject(this,s);const o=(this.prefixes||[]).map(e=>this.assets.getPrompt(e,this.promptCategory)),i=(this.suffixes||[]).map(e=>this.assets.getPrompt(e,this.promptCategory)),c=[...new Set([...s.placeholders,...o.map(e=>e.placeholders||[]),...i.map(e=>e.placeholders||[])].flat())].reduce((e,t)=>(e[t]=n.z.string().describe("The description for "+t),e),{});return this.setArgsSchema(n.z.object(c)),this.setCb((e,t)=>{const r=this.logFor(t).for(C).for(this.promptCategory).for(this.name);function s(e=[]){return Array.isArray(e)?e:Object.keys(e)}const o=(this.prefixes||[]).map(e=>this.assets.getPrompt(e,this.promptCategory)),i=(this.suffixes||[]).map(e=>this.assets.getPrompt(e,this.promptCategory)),a=this.assets.getPrompt(this.name,this.promptCategory),n=[...new Set([...o.map(e=>s(e.placeholders)).flat(),...i.map(e=>s(e.placeholders)).flat(),...s(a.placeholders).flat()])];return{messages:[{role:"user",content:{type:"text",text:this.patchPrompt([...o.map(e=>e.prompt),a.prompt,...i.map(e=>e.prompt)].join("\n\n"),n,e,r)}}],_meta:{}}}),super.build(e)}setReasoning(e){throw new p.InternalError("Named prompt builders don't require callback")}setEffort(e){throw new p.InternalError("Named prompt builders don't require callback")}setCost(e){throw new p.InternalError("Named prompt builders don't require callback")}setDescription(e){throw new p.InternalError("Named prompt builders don't require callback")}setTitle(e){throw new p.InternalError("Named prompt builders don't require callback")}static get builder(){return new C}}var I;function M(e,t=[],r=[]){const s=C.builder.setCategory(I.DOCS).setName(e);return["prefix",...t].forEach(e=>s.addPrefix(e)),["suffix",...r].forEach(e=>s.addSuffix(e)),s}i.__decorate([a.required(),i.__metadata("design:type",String)],C.prototype,"promptCategory",void 0),i.__decorate([a.list(String),a.minlength(1),i.__metadata("design:type",Array)],C.prototype,"prefixes",void 0),i.__decorate([a.minlength(1),a.list(String),i.__metadata("design:type",Array)],C.prototype,"suffixes",void 0),(e=>{e.DOCS="documentation",e.CODE="code"})(I||(I={}));const q=[M("class"),M("constant"),M("decorator"),M("function"),M("module"),M("file"),M("repo",[],["iterate"])],k="##VERSION##";d.Metadata.registerLibrary("##PACKAGE##",k);const H={mcpId:"decaf",name:"decaf-ts mcp server",title:"Decaf-TS MCP Server",description:"Provides precise coding assistance for the decaf-ts framework",version:k,websiteUrl:"https://decaf-ts.github.io",repositoryUrl:"https://github.com/decaf-ts/mcp-server",license:"AGPL-3.0",workingDir:process.cwd(),assetDir:b.default.join(process.cwd(),"lib","assets"),contacts:[{name:"Decaf-TS",url:"https://decaf-ts.github.io"}],tags:"server,official,decaf-ts",metadata:{},icons:[{src:"workdocs/assets/favicon.svg",mimeType:"image/svg+xml",sizes:"any"}],jira:{host:"decaf-ts.atlassian.net",email:"",apiKey:""}},z=t.LoggedEnvironment.accumulate(H);t.Logging.setConfig(z);class L extends t.LoggedClass{get client(){if(!this._mcp)throw Error("Mcp server requires Mcp client");return this._mcp}constructor(){super()}async load(){const e=this.log.for(this.load);for(const t of q)try{e.info("loading prompt "+t.getName());const r=t.build(this.client);e.verbose(`Loaded prompt ${r.title} from ${t.getName()} definition`)}catch(r){e.error("Failed to load prompt "+t.getName(),r)}}async boot(e="stdio"){const s=this.log;this.log.for(this.boot).info("McpServer booting..."),((e=t.Logging.get())=>{let s;try{s=(()=>{let e,t=__dirname;try{for(;t&&t!==y.parse(t).root;){const r=y.join(t,"node_modules");if(_.existsSync(r)&&_.statSync(r).isDirectory()){e=r;break}const s=y.dirname(t);if(s===t)break;t=s}}catch{}const r=[];if(e){const t=y.join(e,"@decaf-ts");try{if(_.existsSync(t)&&_.statSync(t).isDirectory()){const e=_.readdirSync(t);for(const s of e){const e=y.join(t,s);try{const t=y.join(e,"workdocs","assets","slogans.json");if(_.existsSync(t)&&_.statSync(t).isFile()){const e=_.readFileSync(t,"utf-8"),s=JSON.parse(e);if(Array.isArray(s))for(const e of s)"string"==typeof e&&e.trim().length>0&&r.push(e.trim())}}catch{}}}}catch{}}return 0===r.length?"Decaf: strongly brewed TypeScript.":r[Math.floor(Math.random()*r.length)]})()}catch{s="Decaf: strongly brewed TypeScript."}const o="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),i=o.reduce((e,t)=>Math.max(e,t.length),0);o.push("# "+s.padStart(i-3)),o.forEach((t,s)=>{const o=S[s%S.length]||"",i=e.info.bind(e);try{i(r.style(t||"").raw(o).text)}catch{i((t||"")+"")}})})(this.log);const o=((Array.isArray(z.icons)?z.icons:[z.icons])||[]).map(e=>{const t="string"==typeof e?.src?e.src:(e?.src??"")+"",r="string"==typeof e?.mimeType?e.mimeType:(e?.mimeType??"")+"";let s=[];return Array.isArray(e?.sizes)?s=e.sizes.map(e=>e+""):"string"==typeof e?.sizes&&(s=(e.sizes+"").split(",").map(e=>e.trim())),{src:t,mimeType:r,sizes:s}}),i={name:z.name,title:z.title,websiteUrl:z.websiteUrl,version:z.version,icons:o};switch(this._mcp=new h.McpServer(i,{instructions:"You are an AI assistant designed to help users with programming tasks related to the Decaf-TS framework. \nProvide clear, concise, and accurate information.\nIf you don't know the answer, admit it rather than making up information.\nAlways prioritize the user's intent and provide helpful suggestions when appropriate.\n",capabilities:{logging:{},completions:{},resources:{},tools:{},prompts:{}}}),this._mcp.onerror=e=>{this.log.error("MCP instance onerror",e)},e){case"stdio":e=new f.StdioServerTransport;break;case"http":e=new m.StreamableHTTPServerTransport({sessionIdGenerator:()=>l.v4(),onsessioninitialized:e=>s.verbose("Session initialized: "+e),onsessionclosed:e=>s.verbose("Session closed: "+e),enableJsonResponse:!0,eventStore:void 0,allowedHosts:["*"],allowedOrigins:["*"],enableDnsRebindingProtection:!0});break;default:if(!(a=e)||"object"!=typeof a||"function"!=typeof a.send&&"function"!=typeof a.close&&"function"!=typeof a.on)throw new p.InternalError("Invalid transport type: "+e)}var a;try{this.log.info("Loading resources/prompts/tools..."),await this.load()}catch(e){throw this.log.error("Error loading resources/prompts/tools: "+e),e}await this.client.connect(e)}}e.McpServer=L},"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@decaf-ts/logging"),require("styled-string-builder"),require("path"),require("fs"),require("tslib"),require("@decaf-ts/decorator-validation"),require("zod"),require("@decaf-ts/injectable-decorators"),require("@decaf-ts/decoration"),require("@decaf-ts/db-decorators"),require("uuid"),require("@modelcontextprotocol/sdk/server/mcp.js"),require("@modelcontextprotocol/sdk/server/stdio.js"),require("@modelcontextprotocol/sdk/server/streamableHttp.js")):"function"==typeof define&&define.amd?define(["exports","@decaf-ts/logging","styled-string-builder","path","fs","tslib","@decaf-ts/decorator-validation","zod","@decaf-ts/injectable-decorators","@decaf-ts/decoration","@decaf-ts/db-decorators","uuid","@modelcontextprotocol/sdk/server/mcp.js","@modelcontextprotocol/sdk/server/stdio.js","@modelcontextprotocol/sdk/server/streamableHttp.js"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["mcp-server"]={},e.decafTsLogging,e.styledStringBuilder,e.path,e.fs,e.tslib,e.decafTsDecoratorValidation,e.zod,e.decafTsInjectableDecorators,e.decafTsDecoration,e.decafTsDbDecorators,e.uuid,e.mcp_js,e.stdio_js,e.streamableHttp_js);
2
2
  //# sourceMappingURL=mcp-server.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-server.cjs","sources":["../src/constants.ts","../src/builders/builder.ts","../src/builders/prompt-builder.ts","../src/builders/resource-builder.ts","../src/builders/tool-builder.ts","../src/utils/banner.ts","../src/tools/ast/utils.ts","../src/tools/ast/ts-ast-tool.ts","../src/tools/example-tool/index.ts","../src/tools/ast-jsdoc-tools/index.ts","../src/tools/index.ts","../src/tools/file-summarizer/index.ts","../src/prompts/jsdocs/constants.ts","../src/prompts/jsdocs/class-prompt.ts","../src/prompts/jsdocs/const-prompt.ts","../src/prompts/jsdocs/decorator-prompt.ts","../src/prompts/jsdocs/enum-prompt.ts","../src/prompts/jsdocs/function-prompt.ts","../src/prompts/jsdocs/interface-prompt.ts","../src/prompts/jsdocs/types-prompt.ts","../src/prompts/code/design-patterns/builder.ts","../src/prompts/example-prompt/index.ts","../src/prompts/interactive-jsdoc/index.ts","../src/prompts/index.ts","../src/resources/index.ts","../src/resources/example-resource/index.ts","../src/resources/repo-metadata/index.ts","../src/version.ts","../src/environment.ts","../src/mcp-server.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["ReasoningLevel","EffortLevel","Cost","Builder","Model","constructor","arg","super","fromObject","this","log","extra","sessionId","requestId","authInfo","length","Logging","for","clientId","toString","setDescription","value","description","setName","name","setTitle","title","__decorate","required","prototype","UsableBuilder","reasoning","NONE","effort","cost","FREE","setReasoning","setEffort","setCost","PromptBuilder","setCb","cb","setArgsSchema","argsSchema","builder","build","server","errs","hasErrors","Error","registerPrompt","async","args","verbose","JSON","stringify","_meta","Object","assign","usage","result","Promise","resolve","debug","e","error","ResourceBuilder","setConfig","config","setUriOtTemplate","uriOrTemplate","uriOrTemplateArg","includes","ResourceTemplate","UriTemplate","list","undefined","metadata","readCb","uri","resource","ToolBuilder","setAnnotations","annotations","setInputSchema","inputSchema","setOutputSchema","outputSchema","readOnlyHint","destructiveHint","idempotentHint","openWorldHint","registerTool","type","colors","_project","analyzeFile","filePath","project","Project","tsConfigFilePath","skipAddingFilesFromTsConfig","source","addSourceFileAtPathIfExists","createSourceFile","overwrite","race","resolveSourceFileDependencies","res","setTimeout","err","exported","getExportedDeclarations","astObjects","Array","from","entries","flatMap","decls","map","d","start","getStartLineNumber","end","getEndLineNumber","kind","getKindName","String","toLowerCase","startColumn","getStartLinePos","id","location","startLine","endLine","endColumn","isExported","toolName","toolTitle","z","object","string","describe","zod","TsAstTool","content","text","structuredContent","objects","o","signature","parentId","children","decorators","contextHints","ExampleTool","_extra","reversed","split","reverse","join","AstJsdocTool","_args","BASIC","LOW","Tools","path","catch","names","slice","summary","count","BaseJSDocPrompt","TypesPrompt","ConstantsPrompt","Footer","TsDocClassPrompt","messages","role","TsDocConstPrompt","TsDocDecoratorPrompt","TsDocEnumPrompt","TsDocFunctionPrompt","TsDocInterfacePrompt","TsDocTypeePrompt","className","TsCodeDesignPatterBuilderPrompt","toPascalCase","optional","ExamplePrompt","code","astObject","any","Prompts","Resources","_uri","file","pathname","replace","p","process","cwd","raw","readFile","encoding","parsed","parse","data","VERSION","PACKAGE_NAME","Metadata","registerLibrary","DefaultMcpEnvironment","mcpId","version","websiteUrl","repositoryUrl","license","contacts","url","tags","icons","src","mimeType","sizes","Environment","LoggedEnvironment","accumulate","McpServer","LoggedClass","client","_mcp","load","loadedResourced","all","r","loadedPrompts","loadedTools","toolsModule","toLoad","values","filter","v","c","loadedExported","t","boot","transportType","info","logger","get","message","nodeModulesDir","current","__dirname","root","candidate","fs","existsSync","statSync","isDirectory","parent","dirname","slogans","scopeDir","pkgs","readdirSync","pkg","depPath","slogansPath","isFile","readFileSync","isArray","s","trim","push","Math","floor","random","getSlogan","banner","maxLength","reduce","max","line","padStart","forEach","index","color","logFn","bind","console","style","printBanner","normalizedIcons","i","contactsRaw","normalizedContacts","email","numericKeys","keys","k","test","sort","a","b","Number","len","serverInfo","MCP","instructions","capabilities","logging","completions","resources","tools","prompts","StdioServerTransport","StreamableHTTPServerTransport","sessionIdGenerator","v4","onsessioninitialized","onsessionclosed","enableJsonResponse","eventStore","allowedHosts","allowedOrigins","enableDnsRebindingProtection","connect"],"mappings":"oJAAYA,EAOAC,EAOAC,gBAdZ,CAAYF,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,SAAA,GAAA,WACAA,EAAAA,EAAA,KAAA,GAAA,MACD,EALD,CAAYA,IAAAA,EAKX,CAAA,IAED,CAAYC,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,IAAA,GAAA,MACAA,EAAAA,EAAA,OAAA,GAAA,SACAA,EAAAA,EAAA,KAA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,wBAAwBzC,GACtCsT,gBAAkBtT,GAChBF,EAAI2C,QAAQ,mBAAmBzC,GACjCuT,oBAAoB,EACpBC,gBAAYxP,EACZyP,aAAc,CAAC,KACfC,eAAgB,CAAC,KACjBC,8BAA8B,IAEhC,MACF,QACE,MAAUtR,MAAM,2BAA2BsM,GAGjD,OAAO9O,KAAK6N,OAAOkG,QAAQjF,EAC5B"}
1
+ {"version":3,"file":"mcp-server.cjs","sources":["../src/utils/banner.ts","../src/constants.ts","../src/utils/constants.ts","../src/builders/builder.ts","../src/jira/schema-utils.ts","../src/utils/conversions.ts","../src/utils/assets.ts","../src/builders/prompt-builder.ts","../src/prompts/contants.ts","../src/prompts/jsdocs-prompts.ts","../src/prompts/index.ts","../src/version.ts","../src/utils/environment.ts","../src/mcp-server.ts","../src/utils/initialization.ts","../src/utils/utils.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"names":["colors","ReasoningLevel","EffortLevel","Cost","Paths","AssetCategory","Builder","Model","log","this","_log","Logging","for","constructor","arg","super","logFor","extra","sessionId","requestId","authInfo","length","clientId","toString","setDescription","value","description","getDescription","setName","name","getName","setTitle","title","__decorate","required","prototype","UsableBuilder","reasoning","NONE","effort","cost","FREE","setReasoning","setEffort","setCost","findUnderlyingZodObject","s","cur","def","_def","typeName","schema","innerType","undefined","toLevel","lvl","BASIC","ADVANCED","HIGH","MEDIUM","LOW","InternalError","AssetReader","LoggedClass","basePath","path","join","process","cwd","ASSETS","listAssets","folder","assetDir","fs","readdirSync","listPrompts","PROMPT","getAsset","format","categories","filePath","readFileSync","getAllAssets","category","reduce","acc","fileName","extWithDot","extname","basename","replace","toPromptDef","getPrompt","text","toSnakeCase","JSON","parse","e","SerializationError","getAllPrompts","texts","Object","entries","prompt","injectable","PromptBuilder","setCb","cb","setArgsSchema","argsSchema","builder","patchPrompt","placeholders","replacements","missing","Array","isArray","keys","filter","p","hasOwnProperty","call","ValidationError","verbose","stringify","debug","filteredReplacements","key","sf","build","server","errs","hasErrors","Error","ensureZodObject","argsShape","shape","extractShape","registerPrompt","async","args","assign","_meta","usage","result","Promise","resolve","error","inject","ZodObject","prop","NamedPromptBuilder","setCategory","promptCategory","addPrefix","prefixes","push","addSuffix","suffixes","toIgnoreProps","Metadata","properties","k","includes","promptDef","assets","fromObject","map","argSchema","Set","flat","el","z","string","describe","object","parsePlaceholders","messages","role","content","type","PromptCategories","namedPromptBuilder","extraPrefix","extraSuffix","pb","DOCS","forEach","list","String","minlength","Prompts","VERSION","registerLibrary","DefaultMcpEnvironment","mcpId","version","websiteUrl","repositoryUrl","license","workingDir","contacts","url","tags","metadata","icons","src","mimeType","sizes","jira","host","email","apiKey","Environment","LoggedEnvironment","accumulate","setConfig","McpServer","client","_mcp","load","info","boot","transportType","logger","get","message","nodeModulesDir","current","__dirname","root","candidate","existsSync","statSync","isDirectory","parent","dirname","slogans","scopeDir","pkgs","pkg","depPath","slogansPath","isFile","raw","parsed","trim","Math","floor","random","getSlogan","banner","split","maxLength","max","line","padStart","index","color","logFn","bind","style","printBanner","normalizedIcons","i","serverInfo","MCP","instructions","capabilities","logging","completions","resources","tools","prompts","onerror","err","StdioServerTransport","StreamableHTTPServerTransport","sessionIdGenerator","v4","onsessioninitialized","onsessionclosed","enableJsonResponse","eventStore","allowedHosts","allowedOrigins","enableDnsRebindingProtection","send","close","on","connect"],"mappings":"6aAKA,MAAMA,EAAS,CACb,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,iBACA,kBCdF,IAAYC,EAOAC,EAOAC,ECdAC,EAIAC,EDJZ,CAAYJ,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,MAAA,GAAA,QACAA,EAAAA,EAAA,SAAA,GAAA,WACAA,EAAAA,EAAA,KAAA,GAAA,MACD,EALD,CAAYA,IAAAA,EAKX,CAAA,IAED,CAAYC,IACVA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,IAAA,GAAA,MACAA,EA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,EACDC,MAAO,CAEN,EACDC,QAAS,CAER,KAMJxQ,KAAKkN,KAAauD,QAAWC,IAC5B1Q,KAAKD,IAAI2I,MAAM,uBAAwBgI,IAGjCpD,GACN,IAAK,QACHA,EAAgB,IAAIqD,EAAAA,qBACpB,MACF,IAAK,OACHrD,EAAgB,IAAIsD,EAAAA,8BAA8B,CAChDC,mBAAoB,IAAMC,EAAAA,KAC1BC,qBAAuBtQ,GACrBV,EAAImH,QAAQ,wBAAwBzG,GACtCuQ,gBAAkBvQ,GAChBV,EAAImH,QAAQ,mBAAmBzG,GACjCwQ,oBAAoB,EACpBC,gBAAYtO,EACZuO,aAAc,CAAC,KACfC,eAAgB,CAAC,KACjBC,8BAA8B,IAEhC,MACF,QACE,KEhMwBhR,EFgMHiN,IE7LV,iBAARjN,GACc,mBAAbA,EAAIiR,MACW,mBAAdjR,EAAIkR,OACO,mBAAXlR,EAAImR,GF2LP,MAAM,IAAIpO,EAAaA,cACrB,2BAAkCkK,GElMxC,IAA0BjN,EFuM5B,IACEL,KAAKD,IAAIqN,KAAK,4CACRpN,KAAKmN,MACZ,CAAC,MAAOuD,GAEP,MADA1Q,KAAKD,IAAI2I,MAAM,0CAA0CgI,GACnDA,CACP,OAEK1Q,KAAKiN,OAAOwE,QAAQnE,EAC3B"}
@@ -1,2 +1,2 @@
1
- import{__decorate as e,__metadata as t}from"tslib";import{required as n,Model as r,type as o}from"@decaf-ts/decorator-validation";import{Logging as s,toPascalCase as i,LoggedEnvironment as a,LoggedClass as c}from"@decaf-ts/logging";import{UriTemplate as l}from"@modelcontextprotocol/sdk/shared/uriTemplate";import{ResourceTemplate as d,McpServer as m}from"@modelcontextprotocol/sdk/server/mcp";import{style as p}from"styled-string-builder";import u,{resolve as h}from"path";import g from"fs";import{z as f}from"zod";import{Project as y}from"ts-morph";import{readFile as b}from"fs/promises";import{StreamableHTTPServerTransport as S}from"@modelcontextprotocol/sdk/server/streamableHttp";import{StdioServerTransport as w}from"@modelcontextprotocol/sdk/server/stdio";import{v4 as v}from"uuid";import{Metadata as x}from"@decaf-ts/decoration";var N,O,E;(e=>{e[e.NONE=0]="NONE",e[e.BASIC=1]="BASIC",e[e.ADVANCED=2]="ADVANCED",e[e.HIGH=3]="HIGH"})(N||(N={})),(e=>{e[e.NONE=0]="NONE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(O||(O={})),(e=>{e[e.FREE=0]="FREE",e[e.LOW=1]="LOW",e[e.MEDIUM=2]="MEDIUM",e[e.HIGH=3]="HIGH"})(E||(E={}));class T extends r{constructor(e){super(e),r.fromObject(this,e)}log(e){const{sessionId:t,requestId:n,authInfo:r}=e||{};let o="string"==typeof t&&t.length>0?s.for(t).for(this):s.for(this);return r&&r.clientId&&(o=o.for(r.clientId)),n&&(o=o.for(n.toString())),o}setDescription(e){return this.description=e,this}setName(e){return this.name=e,this}setTitle(e){return this.title=e,this}}e([n(),t("design:type",String)],T.prototype,"description",void 0),e([n(),t("design:type",String)],T.prototype,"name",void 0),e([n(),t("design:type",String)],T.prototype,"title",void 0);class D extends T{constructor(e){super(e),this.reasoning=N.NONE,this.effort=O.NONE,this.cost=E.FREE}setReasoning(e){return this.reasoning=e,this}setEffort(e){return this.effort=e,this}setCost(e){return this.cost=e,this}}e([n(),t("design:type",Number)],D.prototype,"reasoning",void 0),e([n(),t("design:type",Number)],D.prototype,"effort",void 0),e([n(),t("design:type",Number)],D.prototype,"cost",void 0);class j extends D{setCb(e){return this.cb=e,this}setArgsSchema(e){return this.argsSchema=e,this}constructor(e){super(e)}static get builder(){return new j}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerPrompt(this.name,{title:this.title,description:this.description,argsSchema:this.argsSchema},async(e,t)=>{const n=this.log(t);e=e||{},n.verbose(`Executing prompt ${this.name} with args: ${JSON.stringify(e)}`),e._meta=Object.assign(e._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const r=await Promise.resolve(this.cb(e,t));return n.verbose(`Prompt ${this.name} executed successfully.`),n.debug("Prompt execution meta: "+JSON.stringify(r._meta)),r})}catch(e){throw s.for(this).error("Failed to register prompt "+this.name,e),e}}}e([n(),t("design:type",Object)],j.prototype,"cb",void 0),e([n(),t("design:type",Object)],j.prototype,"argsSchema",void 0);class A extends T{setCb(e){return this.cb=e,this}setConfig(e){return this.config=e,this}setUriOtTemplate(e){return this.uriOrTemplate=e,this}constructor(e){super(e)}static get builder(){return new A}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{const t="string"==typeof this.uriOrTemplate&&this.uriOrTemplate.includes("{")?new d(new l(this.uriOrTemplate),{list:void 0}):this.uriOrTemplate,n=Object.assign(this.config,{_meta:{}}),r=async(e,t)=>{const n=this.log(t);n.verbose(`Requesting resource ${this.name} from ${e.toString()}`);const r=await Promise.resolve(this.cb(e,t));return n.verbose(`Resource ${this.name} retrieved successfully.`),n.debug("Resource retrieval meta: "+JSON.stringify(r._meta)),r};return e.resource(this.name,t,n,r)}catch(e){throw s.for(this).error("Error registering resource "+this.name,e),e}}}e([n(),t("design:type",String)],A.prototype,"uriOrTemplate",void 0),e([n(),t("design:type",Function)],A.prototype,"cb",void 0),e([n(),t("design:type",Object)],A.prototype,"config",void 0);class C extends D{setAnnotations(e){return this.annotations=Object.assign(this.annotations,e),this}setCb(e){return this.cb=e,this}setInputSchema(e){return this.inputSchema=e,this}setOutputSchema(e){return this.outputSchema=e,this}constructor(e){super(e),this.annotations={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}static get builder(){return new C}build(e){const t=this.hasErrors();if(t)throw Error(t.toString());try{return e.registerTool(this.name,{title:this.title,description:this.description,inputSchema:this.inputSchema,outputSchema:this.outputSchema,annotations:this.annotations,_meta:{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}}},async(e,t)=>{const n=this.log(t);n.verbose(`Executing tool ${this.name} with args: ${JSON.stringify(e)}`),t._meta=Object.assign(t._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const r=await Promise.resolve(this.cb(e,t));return n.verbose(`Tool ${this.name} executed successfully.`),n.debug("Tool execution meta: "+JSON.stringify(r._meta)),r})}catch(e){throw s.for(this).error("Error building tool",e),e}}}e([n(),t("design:type",Object)],C.prototype,"annotations",void 0),e([n(),t("design:type",Object)],C.prototype,"cb",void 0),e([o(Object.name),n(),t("design:type",Object)],C.prototype,"inputSchema",void 0),e([o(Object.name),t("design:type",Object)],C.prototype,"outputSchema",void 0);const I=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];let $=null;async function P(e){const t=$||($=new y({tsConfigFilePath:void 0,skipAddingFilesFromTsConfig:!0}),$),n=t.addSourceFileAtPathIfExists(e)||t.createSourceFile(e,void 0,{overwrite:!1});try{await Promise.race([t.resolveSourceFileDependencies(),new Promise(e=>setTimeout(e,2e3))])}catch(e){}const r=n.getExportedDeclarations();return{astObjects:Array.from(r.entries()).flatMap(([t,n])=>n.map(n=>{const r="function"==typeof n.getStartLineNumber?n.getStartLineNumber():0,o="function"==typeof n.getEndLineNumber?n.getEndLineNumber():0,s="function"==typeof n.getKindName?(n.getKindName()+"").toLowerCase():"unknown",i="function"==typeof n.getStartLinePos?n.getStartLinePos():0;return{id:`${e}::${t}`,name:t,kind:s,location:{filePath:e,startLine:r,startColumn:i,endLine:o,endColumn:0},isExported:!0}}))}}const k="ts.ast.extract",R="AST Extraction Tool for TypeScript",J=f.object({filePath:f.string().describe("The path to the TypeScript file to analyze.")}).describe(`the input schema for the ${k} tool`);f.object({}).describe(`the output schema for the ${k} tool`);const _=C.builder.setName(k).setTitle(R).setDescription("Extracts and analyzes the Abstract Syntax Tree (AST) of TypeScript code to provide insights into its structure and components.").setInputSchema(J).setAnnotations({title:R,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}).setCb(async(e,t)=>{const{filePath:n}=e,r=await Promise.race([P(n),new Promise(e=>setTimeout(()=>e(null),1500))]);if(!r||!r.astObjects)return{content:[{type:"text",text:"No AST objects or analysis timed out"}],structuredContent:{astObjects:[]}};const o=r.astObjects.map(e=>({id:e.id,name:e.name,kind:e.kind||"unknown",location:e.location,isExported:!!e.isExported,signature:e.signature,parentId:e.parentId,children:e.children,decorators:e.decorators,contextHints:e.contextHints||[]}));return{content:[{type:"text",text:`Found ${o.length} AST objects`}],structuredContent:{astObjects:o}}}),F=C.builder.setName("example-tool").setTitle("Example: Reverse String Tool").setDescription("Reverses the provided `text` input and returns the result.").setInputSchema(f.object({text:f.string()})).setCb(async(e,t)=>{const n=((e?.text??"")+"").split("").reverse().join("");return{content:[{type:"text",text:n}],structuredContent:{result:n}}}).setReasoning(N.NONE).setEffort(O.NONE).setCost(E.FREE),M=C.builder.setName("ast.jsdoc").setTitle("AST \u2192 JSDoc Tool").setDescription("Generate suggested JSDoc comments for TypeScript AST objects (MVP stub).").setInputSchema(f.object({filePath:f.string()})).setCb(async(e,t)=>{const n=[{type:"text",text:"Not implemented (stub)"}];return{content:n,structuredContent:{content:n}}}).setReasoning(N.BASIC).setEffort(O.LOW).setCost(E.FREE),H=[_,F,C.builder.setName("file.summarizer").setTitle("File Summarizer").setDescription("Produce a short structured summary for a TypeScript file.").setInputSchema(f.object({filePath:f.string()})).setCb(async(e,t)=>{if(!(e?.filePath??e?.path))return{content:[{type:"text",text:""}]};const n=await(async()=>({astObjects:[]}))().catch(()=>null),r=n&&n.astObjects||[],o=r.map(e=>e.name||e.id||e.kind).slice(0,20),s=`Found ${r.length} AST objects. Top names: ${o.join(", ")}`;return{content:[{type:"text",text:s}],structuredContent:{summary:s},_meta:{count:r.length}}}).setReasoning(N.NONE).setEffort(O.NONE).setCost(E.FREE),M];var L=Object.freeze({__proto__:null,Tools:H});const B="You're a senior TypeScript developer writing JSDoc documentation for a class to be used with better-docs. Given the module code:\nGenerate a JSDoc comment block for a TypeScript module file using better-docs formatting:",G="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\n Include @interface and @typeDef an @template tags when appropriate.\n Include detailed @description for all properties.\n For methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n\n The order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @interface or @typeDef followed by the interface or type name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the completed JSDoc comment block for the type or interface.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",z="document the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @const and @typeDef tags when appropriate.\nInclude detailed @description for all properties.\n- For enums, include @enum and @readonly, and add inline documentation for each member\n- For object-like constants:\n - Create a @typedef with @property for each key\n - Reference it in the constant using @type\n - Alternatively, document each key inline if small\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @property;\n6 - @const followed by the const or enum name;\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nRespond with the JSDoc comment block(s) for both the typedef and the constant or enum.\nrefer to the module it belongs with @memberOf this the `@memberOf module:<module_name>` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information",U="NOTES:\n - when document a function/method parameters, and there is a template type involved, ALWAYS reference it using the @template tag;\n - when documenting a function type as a parameter, ALWAYS use the function(type1,type2):return_type syntax;\n ",q=f.object({}),V=j.builder.setName("ts.jsdoc.class").setTitle("Class JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript class according to a curated template and prompt.").setArgsSchema(q).setReasoning(N.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\ndocument the entire class and each of its functions including always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @class tags when applicable.\ninclude @param tags in the class documentation and its type definitions\nInclude detailed @description for all properties.\nInclude @template tags when necessary.\nDo NOT document the constructor, but include the constructor arguments as @param in the class documentation\nFor methods and functions:\n- include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\n- create a usage example under the @example tag on the class documentation\n- create mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param;\n5 - @return;\n6 - @class\n7 - @example\n8 - @mermaid;\n\nignore @mermaid for methods with less that 15 lines and constructors.\nRespond only with the full JSDoc comment block for the class and its methods.\nNEVER user @memberOf in the class or any of it's methods\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\nnever omit or change any code, including the constructor\n${U}`}}],_meta:{}})),W=f.object({}),K=j.builder.setName("ts.jsdoc.const").setTitle("Const JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript constant according to a curated template and prompt.").setArgsSchema(W).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${z}\n${U}`}}]})),Y=f.object({}),Q=j.builder.setName("ts.jsdoc.decorator").setTitle("Decorator JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript Decorator according to a curated template and prompt.").setArgsSchema(Y).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if it has over 10 lines\n8 - @category one of: "Decorators", "Class Decorators", "Method Decorators", "Property Decorators", "Parameter Decorators"\nOutput only the full JSDoc comment block for the function.\nDO NOT refer to the module it belongs with @memberOf\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${U}`}}]})),X=f.object({}),Z=j.builder.setName("ts.jsdoc.enum").setTitle("Enum JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript enum according to a curated template and prompt.").setArgsSchema(X).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${z}\n${U}`}}]})),ee=f.object({}),te=j.builder.setName("ts.jsdoc.function").setTitle("Function JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript function according to a curated template and prompt.").setArgsSchema(ee).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\ndocument the target code, always including the @description tag with a short description of the target, and a@summary tag with a more detailed one.\nInclude @function an @template tags when appropriate.\nInclude detailed @description for all properties.\nFor methods, include @description and @summary tags as defined for the target. also document every argument, including its type definition, and return type, referencing @template tags when necessary.\ncreate mermaid sequence diagrams under the @mermaid tag;\n\nThe order of tags (when applicable) should be as follows:\n1 - @description;\n2 - @summary;\n3 - @template;\n4 - @param including type definitions;\n5 - @return;\n6 - @function followed by the interface or type name;\n7 - @mermaid with the sequence diagram for the function if ithas over 10 lines\n8 - @memberOf referencing the appropriate module using the appropriate syntax\n\nOutput only the full JSDoc comment block for the function.\nrefer to the module it belongs with @memberOf this the \`@memberOf module:<module_name>\` syntax\nnever omit or change any code\nif the element is already documented, only restructure, correct, or add to the documentation. NEVER remove existing information\n${U}`}}]})),ne=f.object({}),re=j.builder.setName("ts.jsdoc.interface").setTitle("Interface JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript interface according to a curated template and prompt.").setArgsSchema(ne).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${G}\n${U}`}}]})),oe=f.object({}),se=j.builder.setName("ts.jsdoc.type").setTitle("Type JSDocs Prompt").setDescription("Generate JSDoc comments for a TypeScript type according to a curated template and prompt.").setArgsSchema(oe).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:`${B}\n${G}\n${U}`}}]})),ie=f.object({className:f.string().describe("the class name to turn into a builder")}),ae=j.builder.setName("ts.code.dp.builder").setTitle("Typescript builder design patter prompt").setDescription("for a class, with a defined set of properties, scafold a builder design pattern").setArgsSchema(ie).setReasoning(N.BASIC).setCb((e,t)=>(e.className=i(e.className),{messages:[{role:"user",content:{type:"text",text:`You're a senior TypeScript developer writing typescript code.You're a senior TypeScript developer writing typescript code.\nTransform the selected class into a builder design pattern implementation in Typescript.\nuse @decaf-ts validation decorators to enforce the validation of your builder.\n\n- must extend the Model Class from @decaf-ts/decorator-validation;\n- each property must be marked as protected;\n- each property must have a setter method that returns 'this' for chaining;\n- the build() method must validate the properties using hasErrors() method from Model class;\n- if validation fails, throw an error with the validation errors;\n- if validation passes, return an instance of the original class with the set properties;\n- optionally (but do so by default) add the static builder and from methods from the example;\n- if the clasee already follows the pattern but has properties without decoration or without setters, simple add them;\n\nexample:\n\noriginal class:\n\`\`\`typescript\nexport class ${e.className} {\n description!: string;\n name!: string = "default name";\n title!: string;\n age?: string;\n dateOfBirth!: Date;\n}}\n\`\`\` \n\nresulting builder pattern implementation:\n\`\`\`typescript\nexport class ${e.className}Builder extends Model {\n\n @minlength(10\n @required()\n protected description!: string;\n \n @required()\n protected name!: string = "default value;\n \n @required()\n protected title!: string;\n \n @min(18)\n protected age?: string;\n \n @date()\n protected dateOfBirth!: Date;\n\n protected constructor(arg?: ModelArg<${e.className}Builder>>) {\n super(arg);\n Model.fromModel(this, arg);\n }\n\n setDescription(value: string) {\n this.description = value;\n return this;\n }\n\n setName(value: string) {\n this.name = value;\n return this;\n }\n\n setTitle(value: string) {\n this.title = value;\n return this;\n }\n setAge(value: number) {\n this.age = value;\n return this;\n }\n setDate(value: Date) {\n this.age = value;\n return this;\n }\n \n build(...args: any[]): ${e.className}Builder | Promise<${e.className}Builder> {\n const errs = this.hasErrors();\n if (errs) throw new Error(errs.toString());\n \n return // code that builds OBJ here\n }\n \n static get builder(): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to get a new builder instance\n }\n \n static from<K extends keyof ${e.className}Builder>(obj: K, ${e.className}Builder[K]): ${e.className}Builder {\n return new ${e.className}Builder(); // static method to create a builder from an object\n }\n}\n\`\`\` \n\n`}}],_meta:{}})),ce=f.object({text:f.string().optional()}),le=j.builder.setName("example.prompt.echo").setTitle("Example: Echo Prompt").setDescription("Returns a short prompt containing the provided `text` as a user message.").setArgsSchema(ce).setReasoning(N.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:e?.text??"(no text provided)"}}],_meta:{}})),de=f.object({code:f.string().optional(),astObject:f.any().optional()}),me=[V,K,Q,Z,te,re,se,ae,le,j.builder.setName("interactive.jsdoc.assistant").setTitle("Interactive JSDoc Assistant").setDescription("Produce a ready-to-insert JSDoc block for a provided code snippet or AST object.").setArgsSchema(de).setReasoning(N.BASIC).setCb((e,t)=>({messages:[{role:"user",content:{type:"text",text:"Generate a complete JSDoc comment block for the following code. Respond only with the full JSDoc block.\n\n"+(e?.code??"")}}],_meta:{}}))],pe=[A.builder.setName("example.resource.hello").setTitle("Example: Hello Resource").setDescription("A tiny example resource that returns a simple payload for any URI.").setUriOtTemplate("example://hello/{name}").setConfig({description:"Example resource",_meta:{usage:{reasoning:N.NONE,effort:O.NONE,cost:E.FREE}}}).setCb(async(e,t)=>({content:{type:"text",text:"hello from example resource"},_meta:{}})),A.builder.setName("repo.metadata").setTitle("Repository Metadata Resource").setDescription("Expose basic repository metadata such as package.json and lint rules.").setUriOtTemplate("repo://metadata/{file}").setConfig({description:"Repository metadata resource",_meta:{usage:{reasoning:N.NONE,effort:O.NONE,cost:E.FREE}}}).setCb(async(e,t)=>{const n=e.pathname.replace(/^\//,"")||"package.json";try{const e=h(process.cwd(),n),t=await b(e,{encoding:"utf8"}),r=JSON.parse(t);return{content:{type:"json",data:JSON.stringify(r)},_meta:{}}}catch(e){return{content:{type:"text",text:""},_meta:{}}}})],ue="##VERSION##",he="##PACKAGE##";x.registerLibrary(he,ue);const ge={mcpId:he,name:"Official Decaf-TS MCP Server",title:"Official Decaf-TS MCP Server",description:"Provides precise coding assistance for the decaf-ts framework",version:ue,websiteUrl:"https://decaf-ts.github.io",repositoryUrl:"https://github.com/decaf-ts",license:"AGPL-3.0",contacts:[{name:"Decaf-TS",url:"https://decaf-ts.github.io"}],tags:"server,official,decaf-ts",metadata:{},icons:[{src:"workdocs/assets/favicon.svg",mimeType:"image/svg+xml",sizes:"any"}]},fe=a.accumulate(ge);class ye extends c{get client(){if(!this._mcp)throw Error("Mcp server requires Mcp client");return this._mcp}constructor(){super()}async load(){try{const e=await Promise.all(pe.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} resources`);const t=await Promise.all(me.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${t.length} prompts`);const n=await Promise.all(H.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${n.length} tools`);try{const e=await Promise.resolve().then(()=>L),t=Object.values(e).filter(e=>e&&"function"==typeof e.build).filter(e=>!H.includes(e));if(t.length>0){const e=await Promise.all(t.map(e=>e.build(this.client)));this.log.verbose(`Loaded ${e.length} exported builders from tools module`)}}catch(e){this.log.verbose("No additional exported builders loaded from tools module: "+e)}}catch(e){throw this.log.error("Error loading core MCP components",e),e}}async boot(e="stdio"){const t=this.log;this.log.for(this.boot).info("McpServer booting..."),((e=s.get())=>{let t;try{t=(()=>{let e,t=__dirname;try{for(;t&&t!==u.parse(t).root;){const n=u.join(t,"node_modules");if(g.existsSync(n)&&g.statSync(n).isDirectory()){e=n;break}const r=u.dirname(t);if(r===t)break;t=r}}catch{}const n=[];if(e){const t=u.join(e,"@decaf-ts");try{if(g.existsSync(t)&&g.statSync(t).isDirectory()){const e=g.readdirSync(t);for(const r of e){const e=u.join(t,r);try{const t=u.join(e,"workdocs","assets","slogans.json");if(g.existsSync(t)&&g.statSync(t).isFile()){const e=g.readFileSync(t,"utf-8"),r=JSON.parse(e);if(Array.isArray(r))for(const e of r)"string"==typeof e&&e.trim().length>0&&n.push(e.trim())}}catch{}}}}catch{}}return 0===n.length?"Decaf: strongly brewed TypeScript.":n[Math.floor(Math.random()*n.length)]})()}catch{t="Decaf: strongly brewed TypeScript."}const n="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),r=n.reduce((e,t)=>Math.max(e,t.length),0);n.push("# "+t.padStart(r-3)),n.forEach((t,n)=>{const r=I[n%I.length]||"",o=e?e.info.bind(e):(()=>{}).bind();try{o(p(t||"").raw(r).text)}catch{o((t||"")+"")}})})(this.log);const n=((Array.isArray(fe.icons)?fe.icons:[fe.icons])||[]).map(e=>{const t="string"==typeof e?.src?e.src:(e?.src??"")+"",n="string"==typeof e?.mimeType?e.mimeType:(e?.mimeType??"")+"";let r=[];return Array.isArray(e?.sizes)?r=e.sizes.map(e=>e+""):"string"==typeof e?.sizes&&(r=(e.sizes+"").split(",").map(e=>e.trim())),{src:t,mimeType:n,sizes:r}}),r=fe.contacts;let o;if(null!=r)if(Array.isArray(r))o=r.map(e=>({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0}));else if("object"==typeof r){const e=Object.keys(r||{}).filter(e=>/^[0-9]+$/.test(e)).sort((e,t)=>Number(e)-Number(t));if(e.length>0)o=e.map(e=>{const t=r[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}});else if("number"==typeof r.length){const e=Number(r.length)||0;o=[];for(let t=0;e>t;t++){const e=r[t];o.push({name:"string"==typeof e?.name?e.name:(e?.name??"")+"",email:"string"==typeof e?.email?e.email:e?.email?e.email+"":void 0,url:"string"==typeof e?.url?e.url:e?.url?e.url+"":void 0})}}else o=Object.keys(r).filter(e=>"length"!==e).map(e=>{const t=r[e];return{name:"string"==typeof t?.name?t.name:(t?.name??"")+"",email:"string"==typeof t?.email?t.email:t?.email?t.email+"":void 0,url:"string"==typeof t?.url?t.url:t?.url?t.url+"":void 0}})}const i={id:fe.mcpId,name:fe.name,title:fe.title,description:fe.description,websiteUrl:fe.websiteUrl,repositoryUrl:fe.repositoryUrl,version:fe.version,license:fe.license,contacts:o,tags:fe.tags?fe.tags.split(","):void 0,metadata:fe.metadata,icons:n};this._mcp=new m(i,{instructions:"You are an AI assistant designed to help users with programming tasks related to the Decaf-TS framework. \nProvide clear, concise, and accurate information.\nIf you don't know the answer, admit it rather than making up information.\nAlways prioritize the user's intent and provide helpful suggestions when appropriate.\n",capabilities:{logging:{},completions:{},resources:{},tools:{},prompts:{}}});try{await this.load()}catch(e){throw this.log.error("Error loading resources/prompts/tools: "+e),e}if("string"==typeof e)switch(e){case"stdio":e=new w;break;case"http":e=new S({sessionIdGenerator:()=>v(),onsessioninitialized:e=>t.verbose("Session initialized: "+e),onsessionclosed:e=>t.verbose("Session closed: "+e),enableJsonResponse:!0,eventStore:void 0,allowedHosts:["*"],allowedOrigins:["*"],enableDnsRebindingProtection:!0});break;default:throw Error("Invalid transport type: "+e)}return this.client.connect(e)}}export{T as Builder,ye as McpServer,he as PACKAGE_NAME,j as PromptBuilder,A as ResourceBuilder,C as ToolBuilder,D as UsableBuilder,ue as VERSION};
1
+ import{Logging as t,LoggedClass as e,toSnakeCase as s,sf as r,LoggedEnvironment as o}from"@decaf-ts/logging";import{style as i}from"styled-string-builder";import*as n from"path";import a from"path";import*as c from"fs";import{__decorate as p,__metadata as h}from"tslib";import{required as d,Model as m,list as l,minlength as f}from"@decaf-ts/decorator-validation";import{ZodObject as g,z as u}from"zod";import{injectable as y,inject as b}from"@decaf-ts/injectable-decorators";import{prop as w,Metadata as S}from"@decaf-ts/decoration";import{InternalError as v,SerializationError as N,ValidationError as O}from"@decaf-ts/db-decorators";import{v4 as x}from"uuid";import{McpServer as E}from"@modelcontextprotocol/sdk/server/mcp.js";import{StdioServerTransport as A}from"@modelcontextprotocol/sdk/server/stdio.js";import{StreamableHTTPServerTransport as P}from"@modelcontextprotocol/sdk/server/streamableHttp.js";const j=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];var C,D,I,T,M;(t=>{t[t.NONE=0]="NONE",t[t.BASIC=1]="BASIC",t[t.ADVANCED=2]="ADVANCED",t[t.HIGH=3]="HIGH"})(C||(C={})),(t=>{t[t.NONE=0]="NONE",t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=3]="HIGH"})(D||(D={})),(t=>{t[t.FREE=0]="FREE",t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=3]="HIGH"})(I||(I={}));class k extends m{get log(){return this._log||(this._log=t.for(this)),this._log}constructor(t){super(t)}logFor(t){const{sessionId:e,requestId:s,authInfo:r}=t||{};let o="string"==typeof e&&e.length>0?this.log.for(e):this.log;return r&&r.clientId&&(o=o.for(r.clientId)),s&&(o=o.for(s.toString())),o}setDescription(t){return this.description=t,this}getDescription(){return this.description}setName(t){return this.name=t,this}getName(){return this.name}setTitle(t){return this.title=t,this}}p([d(),h("design:type",String)],k.prototype,"description",void 0),p([d(),h("design:type",String)],k.prototype,"name",void 0),p([d(),h("design:type",String)],k.prototype,"title",void 0);class _ extends k{constructor(t){super(t),this.reasoning=C.NONE,this.effort=D.NONE,this.cost=I.FREE}setReasoning(t){return this.reasoning=t,this}setEffort(t){return this.effort=t,this}setCost(t){return this.cost=t,this}}function H(t){if(!t)return;let e=t,s=e&&e._def;for(;s&&"ZodObject"!==s.typeName;){if("ZodEffects"===s.typeName&&s.schema)e=s.schema;else if("ZodOptional"===s.typeName&&s.innerType)e=s.innerType;else if("ZodDefault"===s.typeName&&s.innerType)e=s.innerType;else if("ZodNullable"===s.typeName&&s.innerType)e=s.innerType;else{if(!s.schema)return;e=s.schema}s=e&&e._def}return s&&"ZodObject"===s.typeName?s:void 0}function F(t){switch(t){case"none":return C.NONE;case"basic":return C.BASIC;case"advanced":return C.ADVANCED;case"high":return C.HIGH;case"medium":return D.MEDIUM;case"low":return I.LOW;case"free":return I.FREE;default:throw new v("Cannon convert unknown level "+t)}}p([d(),h("design:type",Number)],_.prototype,"reasoning",void 0),p([d(),h("design:type",Number)],_.prototype,"effort",void 0),p([d(),h("design:type",Number)],_.prototype,"cost",void 0),(t=>{t.ASSETS="assets"})(T||(T={})),(t=>{t.PROMPT="prompts",t.DOCUMENTATION="documentation",t.CODE="code"})(M||(M={}));let R=class extends e{constructor(t=n.join(process.cwd(),"lib",T.ASSETS)){super(),this.basePath=t}listAssets(...t){const e=n.join(this.basePath,...t);return c.readdirSync(e)}listPrompts(){return this.listAssets(M.PROMPT)}getAsset(t,e="md",...s){const r=n.join(this.basePath,...s),o=n.join(r,`${t}.${e}`);return c.readFileSync(o,"utf-8")}getAllAssets(t,...e){return this.listAssets(t,...e).reduce((s,r)=>{const o=n.extname(r),i=n.basename(r,o),a=o.replace(/^\./,"")||void 0;return s[i]=this.getAsset(i,a??void 0,t,...e),s},{})}toPromptDef(t){return t.effort=F(t.effort),t.reasoning=F(t.reasoning),t.cost=F(t.cost),t}getPrompt(t,...e){const r=this.getAsset(s(t),"json",M.PROMPT,...e);let o;try{o=JSON.parse(r)}catch(s){throw new N(`Failed to parse prompt ${t} in categories ${e}: ${s}`)}return this.toPromptDef(o)}getAllPrompts(...t){const e=this.getAllAssets(M.PROMPT,...t);return Object.entries(e).reduce((e,[s,r])=>{try{e[s]=JSON.parse(r)}catch(e){throw new N(`Failed to parse prompt ${s} in categories ${t}: ${e}`)}return e},e)}};R=p([y(),h("design:paramtypes",[Object])],R);class $ extends _{constructor(t){super(t)}setCb(t){return this.cb=t,this}setArgsSchema(t){return this.argsSchema=t,this}static get builder(){return new $}static patchPrompt(t,e,s,o){const i=(e=Array.isArray(e)?e:Object.keys(e)).filter(t=>!Object.prototype.hasOwnProperty.call(s,t));if(i.length)throw new O("Missing replacements for placeholders: "+i.join(", "));o&&(o.verbose("Patching prompt with placeholders: "+JSON.stringify(e)),o.debug("Values: "+JSON.stringify(s)));const n=e.reduce((t,e)=>(t[e]=s[e],t),{});return r(t,n)}patchPrompt(t,e,s,r){return $.patchPrompt(t,e,s,r||this.log.for(this.patchPrompt))}build(t,e){const s=this.log.for(this.build),r=this.hasErrors();if(r)throw new O(r.toString());try{this.argsSchema&&((t,e="schema")=>{if(!H(t))throw Error(`Registration error: provided a non-canonical ${e}. Export a ZodObject (z.object(...)).`)})(this.argsSchema,"argsSchema");const s=(t=>{if(!t)return;if(t&&"object"==typeof t&&!t._def)return t;const e=H(t);return e?"function"==typeof e.shape?e.shape():e.shape||void 0:void 0})(this.argsSchema);return t.registerPrompt(this.name,{title:this.title,description:this.description,argsSchema:s},async(t,s)=>{const r=this.logFor(s);t=Object.assign({},e,t||{}),r.verbose(`Executing prompt ${this.name} with args: ${JSON.stringify(t)}`),t._meta=Object.assign(t._meta||{},{usage:{reasoning:this.reasoning,effort:this.effort,cost:this.cost}});const o=await Promise.resolve(this.cb(t,s));return r.verbose(`Prompt ${this.name} executed successfully.`),r.debug("Prompt execution meta: "+JSON.stringify(o._meta)),o})}catch(t){throw s.error("Failed to register prompt "+(this.name||this.constructor.name),t),t}}}p([b(R),h("design:type",R)],$.prototype,"assets",void 0),p([d(),h("design:type",Object)],$.prototype,"cb",void 0),p([d(),h("design:type",g)],$.prototype,"argsSchema",void 0),p([w(),h("design:type",Object)],$.prototype,"placeholders",void 0);class z extends ${setCategory(t){return this.promptCategory=t,this}addPrefix(t){return this.prefixes=this.prefixes||[],this.prefixes.push(t),this}addSuffix(t){return this.suffixes=this.suffixes||[],this.suffixes.push(t),this}constructor(t){super(t)}build(t){const e=(S.properties(z)||[]).filter(t=>!["assets","promptCategory","prefixes","suffixes"].includes(t)),s=this.hasErrors(...e);if(s)throw new O(s.toString());const r=this.assets.getPrompt(this.name,this.promptCategory);m.fromObject(this,r);const o=(this.prefixes||[]).map(t=>this.assets.getPrompt(t,this.promptCategory)),i=(this.suffixes||[]).map(t=>this.assets.getPrompt(t,this.promptCategory)),n=[...new Set([...r.placeholders,...o.map(t=>t.placeholders||[]),...i.map(t=>t.placeholders||[])].flat())].reduce((t,e)=>(t[e]=u.string().describe("The description for "+e),t),{});return this.setArgsSchema(u.object(n)),this.setCb((t,e)=>{const s=this.logFor(e).for(z).for(this.promptCategory).for(this.name);function r(t=[]){return Array.isArray(t)?t:Object.keys(t)}const o=(this.prefixes||[]).map(t=>this.assets.getPrompt(t,this.promptCategory)),i=(this.suffixes||[]).map(t=>this.assets.getPrompt(t,this.promptCategory)),n=this.assets.getPrompt(this.name,this.promptCategory),a=[...new Set([...o.map(t=>r(t.placeholders)).flat(),...i.map(t=>r(t.placeholders)).flat(),...r(n.placeholders).flat()])];return{messages:[{role:"user",content:{type:"text",text:this.patchPrompt([...o.map(t=>t.prompt),n.prompt,...i.map(t=>t.prompt)].join("\n\n"),a,t,s)}}],_meta:{}}}),super.build(t)}setReasoning(t){throw new v("Named prompt builders don't require callback")}setEffort(t){throw new v("Named prompt builders don't require callback")}setCost(t){throw new v("Named prompt builders don't require callback")}setDescription(t){throw new v("Named prompt builders don't require callback")}setTitle(t){throw new v("Named prompt builders don't require callback")}static get builder(){return new z}}var G;function U(t,e=[],s=[]){const r=z.builder.setCategory(G.DOCS).setName(t);return["prefix",...e].forEach(t=>r.addPrefix(t)),["suffix",...s].forEach(t=>r.addSuffix(t)),r}p([d(),h("design:type",String)],z.prototype,"promptCategory",void 0),p([l(String),f(1),h("design:type",Array)],z.prototype,"prefixes",void 0),p([f(1),l(String),h("design:type",Array)],z.prototype,"suffixes",void 0),(t=>{t.DOCS="documentation",t.CODE="code"})(G||(G={}));const L=[U("class"),U("constant"),U("decorator"),U("function"),U("module"),U("file"),U("repo",[],["iterate"])],J="##VERSION##";S.registerLibrary("##PACKAGE##",J);const q={mcpId:"decaf",name:"decaf-ts mcp server",title:"Decaf-TS MCP Server",description:"Provides precise coding assistance for the decaf-ts framework",version:J,websiteUrl:"https://decaf-ts.github.io",repositoryUrl:"https://github.com/decaf-ts/mcp-server",license:"AGPL-3.0",workingDir:process.cwd(),assetDir:a.join(process.cwd(),"lib","assets"),contacts:[{name:"Decaf-TS",url:"https://decaf-ts.github.io"}],tags:"server,official,decaf-ts",metadata:{},icons:[{src:"workdocs/assets/favicon.svg",mimeType:"image/svg+xml",sizes:"any"}],jira:{host:"decaf-ts.atlassian.net",email:"",apiKey:""}},Z=o.accumulate(q);t.setConfig(Z);class V extends e{get client(){if(!this._mcp)throw Error("Mcp server requires Mcp client");return this._mcp}constructor(){super()}async load(){const t=this.log.for(this.load);for(const e of L)try{t.info("loading prompt "+e.getName());const s=e.build(this.client);t.verbose(`Loaded prompt ${s.title} from ${e.getName()} definition`)}catch(s){t.error("Failed to load prompt "+e.getName(),s)}}async boot(e="stdio"){const s=this.log;this.log.for(this.boot).info("McpServer booting..."),((e=t.get())=>{let s;try{s=(()=>{let t,e=__dirname;try{for(;e&&e!==n.parse(e).root;){const s=n.join(e,"node_modules");if(c.existsSync(s)&&c.statSync(s).isDirectory()){t=s;break}const r=n.dirname(e);if(r===e)break;e=r}}catch{}const s=[];if(t){const e=n.join(t,"@decaf-ts");try{if(c.existsSync(e)&&c.statSync(e).isDirectory()){const t=c.readdirSync(e);for(const r of t){const t=n.join(e,r);try{const e=n.join(t,"workdocs","assets","slogans.json");if(c.existsSync(e)&&c.statSync(e).isFile()){const t=c.readFileSync(e,"utf-8"),r=JSON.parse(t);if(Array.isArray(r))for(const t of r)"string"==typeof t&&t.trim().length>0&&s.push(t.trim())}}catch{}}}}catch{}}return 0===s.length?"Decaf: strongly brewed TypeScript.":s[Math.floor(Math.random()*s.length)]})()}catch{s="Decaf: strongly brewed TypeScript."}const r="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),o=r.reduce((t,e)=>Math.max(t,e.length),0);r.push("# "+s.padStart(o-3)),r.forEach((t,s)=>{const r=j[s%j.length]||"",o=e.info.bind(e);try{o(i(t||"").raw(r).text)}catch{o((t||"")+"")}})})(this.log);const r=((Array.isArray(Z.icons)?Z.icons:[Z.icons])||[]).map(t=>{const e="string"==typeof t?.src?t.src:(t?.src??"")+"",s="string"==typeof t?.mimeType?t.mimeType:(t?.mimeType??"")+"";let r=[];return Array.isArray(t?.sizes)?r=t.sizes.map(t=>t+""):"string"==typeof t?.sizes&&(r=(t.sizes+"").split(",").map(t=>t.trim())),{src:e,mimeType:s,sizes:r}}),o={name:Z.name,title:Z.title,websiteUrl:Z.websiteUrl,version:Z.version,icons:r};switch(this._mcp=new E(o,{instructions:"You are an AI assistant designed to help users with programming tasks related to the Decaf-TS framework. \nProvide clear, concise, and accurate information.\nIf you don't know the answer, admit it rather than making up information.\nAlways prioritize the user's intent and provide helpful suggestions when appropriate.\n",capabilities:{logging:{},completions:{},resources:{},tools:{},prompts:{}}}),this._mcp.onerror=t=>{this.log.error("MCP instance onerror",t)},e){case"stdio":e=new A;break;case"http":e=new P({sessionIdGenerator:()=>x(),onsessioninitialized:t=>s.verbose("Session initialized: "+t),onsessionclosed:t=>s.verbose("Session closed: "+t),enableJsonResponse:!0,eventStore:void 0,allowedHosts:["*"],allowedOrigins:["*"],enableDnsRebindingProtection:!0});break;default:if(!(a=e)||"object"!=typeof a||"function"!=typeof a.send&&"function"!=typeof a.close&&"function"!=typeof a.on)throw new v("Invalid transport type: "+e)}var a;try{this.log.info("Loading resources/prompts/tools..."),await this.load()}catch(t){throw this.log.error("Error loading resources/prompts/tools: "+t),t}await this.client.connect(e)}}export{V as McpServer};
2
2
  //# sourceMappingURL=mcp-server.js.map