@cyanheads/mcp-ts-core 0.1.0-beta.12

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 (485) hide show
  1. package/CLAUDE.md +583 -0
  2. package/LICENSE +201 -0
  3. package/README.md +287 -0
  4. package/biome.json +103 -0
  5. package/dist/app.d.ts +82 -0
  6. package/dist/app.d.ts.map +1 -0
  7. package/dist/app.js +222 -0
  8. package/dist/app.js.map +1 -0
  9. package/dist/cli/init.d.ts +8 -0
  10. package/dist/cli/init.d.ts.map +1 -0
  11. package/dist/cli/init.js +161 -0
  12. package/dist/cli/init.js.map +1 -0
  13. package/dist/config/index.d.ts +349 -0
  14. package/dist/config/index.d.ts.map +1 -0
  15. package/dist/config/index.js +464 -0
  16. package/dist/config/index.js.map +1 -0
  17. package/dist/context.d.ts +119 -0
  18. package/dist/context.d.ts.map +1 -0
  19. package/dist/context.js +144 -0
  20. package/dist/context.js.map +1 -0
  21. package/dist/index.d.ts +8 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +9 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/mcp-server/prompts/prompt-registration.d.ts +33 -0
  26. package/dist/mcp-server/prompts/prompt-registration.d.ts.map +1 -0
  27. package/dist/mcp-server/prompts/prompt-registration.js +91 -0
  28. package/dist/mcp-server/prompts/prompt-registration.js.map +1 -0
  29. package/dist/mcp-server/prompts/utils/newPromptDefinition.d.ts +49 -0
  30. package/dist/mcp-server/prompts/utils/newPromptDefinition.d.ts.map +1 -0
  31. package/dist/mcp-server/prompts/utils/newPromptDefinition.js +39 -0
  32. package/dist/mcp-server/prompts/utils/newPromptDefinition.js.map +1 -0
  33. package/dist/mcp-server/prompts/utils/promptDefinition.d.ts +37 -0
  34. package/dist/mcp-server/prompts/utils/promptDefinition.d.ts.map +1 -0
  35. package/dist/mcp-server/prompts/utils/promptDefinition.js +2 -0
  36. package/dist/mcp-server/prompts/utils/promptDefinition.js.map +1 -0
  37. package/dist/mcp-server/resources/resource-registration.d.ts +27 -0
  38. package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -0
  39. package/dist/mcp-server/resources/resource-registration.js +85 -0
  40. package/dist/mcp-server/resources/resource-registration.js.map +1 -0
  41. package/dist/mcp-server/resources/utils/newResourceDefinition.d.ts +84 -0
  42. package/dist/mcp-server/resources/utils/newResourceDefinition.d.ts.map +1 -0
  43. package/dist/mcp-server/resources/utils/newResourceDefinition.js +40 -0
  44. package/dist/mcp-server/resources/utils/newResourceDefinition.js.map +1 -0
  45. package/dist/mcp-server/resources/utils/newResourceHandlerFactory.d.ts +32 -0
  46. package/dist/mcp-server/resources/utils/newResourceHandlerFactory.d.ts.map +1 -0
  47. package/dist/mcp-server/resources/utils/newResourceHandlerFactory.js +103 -0
  48. package/dist/mcp-server/resources/utils/newResourceHandlerFactory.js.map +1 -0
  49. package/dist/mcp-server/resources/utils/resourceDefinition.d.ts +94 -0
  50. package/dist/mcp-server/resources/utils/resourceDefinition.d.ts.map +1 -0
  51. package/dist/mcp-server/resources/utils/resourceDefinition.js +2 -0
  52. package/dist/mcp-server/resources/utils/resourceDefinition.js.map +1 -0
  53. package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +14 -0
  54. package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -0
  55. package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +111 -0
  56. package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -0
  57. package/dist/mcp-server/roots/roots-registration.d.ts +22 -0
  58. package/dist/mcp-server/roots/roots-registration.d.ts.map +1 -0
  59. package/dist/mcp-server/roots/roots-registration.js +25 -0
  60. package/dist/mcp-server/roots/roots-registration.js.map +1 -0
  61. package/dist/mcp-server/server.d.ts +34 -0
  62. package/dist/mcp-server/server.d.ts.map +1 -0
  63. package/dist/mcp-server/server.js +62 -0
  64. package/dist/mcp-server/server.js.map +1 -0
  65. package/dist/mcp-server/tasks/core/sessionAwareTaskStore.d.ts +42 -0
  66. package/dist/mcp-server/tasks/core/sessionAwareTaskStore.d.ts.map +1 -0
  67. package/dist/mcp-server/tasks/core/sessionAwareTaskStore.js +70 -0
  68. package/dist/mcp-server/tasks/core/sessionAwareTaskStore.js.map +1 -0
  69. package/dist/mcp-server/tasks/core/storageBackedTaskStore.d.ts +109 -0
  70. package/dist/mcp-server/tasks/core/storageBackedTaskStore.d.ts.map +1 -0
  71. package/dist/mcp-server/tasks/core/storageBackedTaskStore.js +209 -0
  72. package/dist/mcp-server/tasks/core/storageBackedTaskStore.js.map +1 -0
  73. package/dist/mcp-server/tasks/core/taskManager.d.ts +103 -0
  74. package/dist/mcp-server/tasks/core/taskManager.d.ts.map +1 -0
  75. package/dist/mcp-server/tasks/core/taskManager.js +144 -0
  76. package/dist/mcp-server/tasks/core/taskManager.js.map +1 -0
  77. package/dist/mcp-server/tasks/core/taskTypes.d.ts +11 -0
  78. package/dist/mcp-server/tasks/core/taskTypes.d.ts.map +1 -0
  79. package/dist/mcp-server/tasks/core/taskTypes.js +13 -0
  80. package/dist/mcp-server/tasks/core/taskTypes.js.map +1 -0
  81. package/dist/mcp-server/tasks/utils/taskToolDefinition.d.ts +108 -0
  82. package/dist/mcp-server/tasks/utils/taskToolDefinition.d.ts.map +1 -0
  83. package/dist/mcp-server/tasks/utils/taskToolDefinition.js +14 -0
  84. package/dist/mcp-server/tasks/utils/taskToolDefinition.js.map +1 -0
  85. package/dist/mcp-server/tools/tool-registration.d.ts +49 -0
  86. package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -0
  87. package/dist/mcp-server/tools/tool-registration.js +269 -0
  88. package/dist/mcp-server/tools/tool-registration.js.map +1 -0
  89. package/dist/mcp-server/tools/utils/newToolDefinition.d.ts +73 -0
  90. package/dist/mcp-server/tools/utils/newToolDefinition.d.ts.map +1 -0
  91. package/dist/mcp-server/tools/utils/newToolDefinition.js +45 -0
  92. package/dist/mcp-server/tools/utils/newToolDefinition.js.map +1 -0
  93. package/dist/mcp-server/tools/utils/newToolHandlerFactory.d.ts +33 -0
  94. package/dist/mcp-server/tools/utils/newToolHandlerFactory.d.ts.map +1 -0
  95. package/dist/mcp-server/tools/utils/newToolHandlerFactory.js +107 -0
  96. package/dist/mcp-server/tools/utils/newToolHandlerFactory.js.map +1 -0
  97. package/dist/mcp-server/tools/utils/toolDefinition.d.ts +118 -0
  98. package/dist/mcp-server/tools/utils/toolDefinition.d.ts.map +1 -0
  99. package/dist/mcp-server/tools/utils/toolDefinition.js +2 -0
  100. package/dist/mcp-server/tools/utils/toolDefinition.js.map +1 -0
  101. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +34 -0
  102. package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -0
  103. package/dist/mcp-server/tools/utils/toolHandlerFactory.js +68 -0
  104. package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -0
  105. package/dist/mcp-server/transports/ITransport.d.ts +15 -0
  106. package/dist/mcp-server/transports/ITransport.d.ts.map +1 -0
  107. package/dist/mcp-server/transports/ITransport.js +2 -0
  108. package/dist/mcp-server/transports/ITransport.js.map +1 -0
  109. package/dist/mcp-server/transports/auth/authFactory.d.ts +11 -0
  110. package/dist/mcp-server/transports/auth/authFactory.d.ts.map +1 -0
  111. package/dist/mcp-server/transports/auth/authFactory.js +43 -0
  112. package/dist/mcp-server/transports/auth/authFactory.js.map +1 -0
  113. package/dist/mcp-server/transports/auth/authMiddleware.d.ts +24 -0
  114. package/dist/mcp-server/transports/auth/authMiddleware.d.ts.map +1 -0
  115. package/dist/mcp-server/transports/auth/authMiddleware.js +69 -0
  116. package/dist/mcp-server/transports/auth/authMiddleware.js.map +1 -0
  117. package/dist/mcp-server/transports/auth/lib/authContext.d.ts +34 -0
  118. package/dist/mcp-server/transports/auth/lib/authContext.d.ts.map +1 -0
  119. package/dist/mcp-server/transports/auth/lib/authContext.js +25 -0
  120. package/dist/mcp-server/transports/auth/lib/authContext.js.map +1 -0
  121. package/dist/mcp-server/transports/auth/lib/authTypes.d.ts +19 -0
  122. package/dist/mcp-server/transports/auth/lib/authTypes.d.ts.map +1 -0
  123. package/dist/mcp-server/transports/auth/lib/authTypes.js +2 -0
  124. package/dist/mcp-server/transports/auth/lib/authTypes.js.map +1 -0
  125. package/dist/mcp-server/transports/auth/lib/authUtils.d.ts +18 -0
  126. package/dist/mcp-server/transports/auth/lib/authUtils.d.ts.map +1 -0
  127. package/dist/mcp-server/transports/auth/lib/authUtils.js +64 -0
  128. package/dist/mcp-server/transports/auth/lib/authUtils.js.map +1 -0
  129. package/dist/mcp-server/transports/auth/lib/checkScopes.d.ts +25 -0
  130. package/dist/mcp-server/transports/auth/lib/checkScopes.d.ts.map +1 -0
  131. package/dist/mcp-server/transports/auth/lib/checkScopes.js +34 -0
  132. package/dist/mcp-server/transports/auth/lib/checkScopes.js.map +1 -0
  133. package/dist/mcp-server/transports/auth/lib/claimParser.d.ts +34 -0
  134. package/dist/mcp-server/transports/auth/lib/claimParser.d.ts.map +1 -0
  135. package/dist/mcp-server/transports/auth/lib/claimParser.js +58 -0
  136. package/dist/mcp-server/transports/auth/lib/claimParser.js.map +1 -0
  137. package/dist/mcp-server/transports/auth/lib/withAuth.d.ts +25 -0
  138. package/dist/mcp-server/transports/auth/lib/withAuth.d.ts.map +1 -0
  139. package/dist/mcp-server/transports/auth/lib/withAuth.js +30 -0
  140. package/dist/mcp-server/transports/auth/lib/withAuth.js.map +1 -0
  141. package/dist/mcp-server/transports/auth/strategies/authStrategy.d.ts +18 -0
  142. package/dist/mcp-server/transports/auth/strategies/authStrategy.d.ts.map +1 -0
  143. package/dist/mcp-server/transports/auth/strategies/authStrategy.js +2 -0
  144. package/dist/mcp-server/transports/auth/strategies/authStrategy.js.map +1 -0
  145. package/dist/mcp-server/transports/auth/strategies/jwtStrategy.d.ts +14 -0
  146. package/dist/mcp-server/transports/auth/strategies/jwtStrategy.d.ts.map +1 -0
  147. package/dist/mcp-server/transports/auth/strategies/jwtStrategy.js +86 -0
  148. package/dist/mcp-server/transports/auth/strategies/jwtStrategy.js.map +1 -0
  149. package/dist/mcp-server/transports/auth/strategies/oauthStrategy.d.ts +14 -0
  150. package/dist/mcp-server/transports/auth/strategies/oauthStrategy.d.ts.map +1 -0
  151. package/dist/mcp-server/transports/auth/strategies/oauthStrategy.js +113 -0
  152. package/dist/mcp-server/transports/auth/strategies/oauthStrategy.js.map +1 -0
  153. package/dist/mcp-server/transports/http/httpErrorHandler.d.ts +25 -0
  154. package/dist/mcp-server/transports/http/httpErrorHandler.d.ts.map +1 -0
  155. package/dist/mcp-server/transports/http/httpErrorHandler.js +112 -0
  156. package/dist/mcp-server/transports/http/httpErrorHandler.js.map +1 -0
  157. package/dist/mcp-server/transports/http/httpTransport.d.ts +47 -0
  158. package/dist/mcp-server/transports/http/httpTransport.d.ts.map +1 -0
  159. package/dist/mcp-server/transports/http/httpTransport.js +396 -0
  160. package/dist/mcp-server/transports/http/httpTransport.js.map +1 -0
  161. package/dist/mcp-server/transports/http/httpTypes.d.ts +17 -0
  162. package/dist/mcp-server/transports/http/httpTypes.d.ts.map +1 -0
  163. package/dist/mcp-server/transports/http/httpTypes.js +2 -0
  164. package/dist/mcp-server/transports/http/httpTypes.js.map +1 -0
  165. package/dist/mcp-server/transports/http/protectedResourceMetadata.d.ts +21 -0
  166. package/dist/mcp-server/transports/http/protectedResourceMetadata.d.ts.map +1 -0
  167. package/dist/mcp-server/transports/http/protectedResourceMetadata.js +44 -0
  168. package/dist/mcp-server/transports/http/protectedResourceMetadata.js.map +1 -0
  169. package/dist/mcp-server/transports/http/sessionIdUtils.d.ts +33 -0
  170. package/dist/mcp-server/transports/http/sessionIdUtils.d.ts.map +1 -0
  171. package/dist/mcp-server/transports/http/sessionIdUtils.js +54 -0
  172. package/dist/mcp-server/transports/http/sessionIdUtils.js.map +1 -0
  173. package/dist/mcp-server/transports/http/sessionStore.d.ts +87 -0
  174. package/dist/mcp-server/transports/http/sessionStore.d.ts.map +1 -0
  175. package/dist/mcp-server/transports/http/sessionStore.js +209 -0
  176. package/dist/mcp-server/transports/http/sessionStore.js.map +1 -0
  177. package/dist/mcp-server/transports/manager.d.ts +22 -0
  178. package/dist/mcp-server/transports/manager.d.ts.map +1 -0
  179. package/dist/mcp-server/transports/manager.js +62 -0
  180. package/dist/mcp-server/transports/manager.js.map +1 -0
  181. package/dist/mcp-server/transports/stdio/stdioTransport.d.ts +44 -0
  182. package/dist/mcp-server/transports/stdio/stdioTransport.d.ts.map +1 -0
  183. package/dist/mcp-server/transports/stdio/stdioTransport.js +63 -0
  184. package/dist/mcp-server/transports/stdio/stdioTransport.js.map +1 -0
  185. package/dist/services/graph/core/GraphService.d.ts +205 -0
  186. package/dist/services/graph/core/GraphService.d.ts.map +1 -0
  187. package/dist/services/graph/core/GraphService.js +231 -0
  188. package/dist/services/graph/core/GraphService.js.map +1 -0
  189. package/dist/services/graph/core/IGraphProvider.d.ts +295 -0
  190. package/dist/services/graph/core/IGraphProvider.d.ts.map +1 -0
  191. package/dist/services/graph/core/IGraphProvider.js +8 -0
  192. package/dist/services/graph/core/IGraphProvider.js.map +1 -0
  193. package/dist/services/graph/types.d.ts +107 -0
  194. package/dist/services/graph/types.d.ts.map +1 -0
  195. package/dist/services/graph/types.js +8 -0
  196. package/dist/services/graph/types.js.map +1 -0
  197. package/dist/services/llm/core/ILlmProvider.d.ts +86 -0
  198. package/dist/services/llm/core/ILlmProvider.d.ts.map +1 -0
  199. package/dist/services/llm/core/ILlmProvider.js +2 -0
  200. package/dist/services/llm/core/ILlmProvider.js.map +1 -0
  201. package/dist/services/llm/providers/openrouter.provider.d.ts +187 -0
  202. package/dist/services/llm/providers/openrouter.provider.d.ts.map +1 -0
  203. package/dist/services/llm/providers/openrouter.provider.js +302 -0
  204. package/dist/services/llm/providers/openrouter.provider.js.map +1 -0
  205. package/dist/services/llm/types.d.ts +16 -0
  206. package/dist/services/llm/types.d.ts.map +1 -0
  207. package/dist/services/llm/types.js +9 -0
  208. package/dist/services/llm/types.js.map +1 -0
  209. package/dist/services/speech/core/ISpeechProvider.d.ts +92 -0
  210. package/dist/services/speech/core/ISpeechProvider.d.ts.map +1 -0
  211. package/dist/services/speech/core/ISpeechProvider.js +34 -0
  212. package/dist/services/speech/core/ISpeechProvider.js.map +1 -0
  213. package/dist/services/speech/core/SpeechService.d.ts +87 -0
  214. package/dist/services/speech/core/SpeechService.d.ts.map +1 -0
  215. package/dist/services/speech/core/SpeechService.js +135 -0
  216. package/dist/services/speech/core/SpeechService.js.map +1 -0
  217. package/dist/services/speech/providers/elevenlabs.provider.d.ts +77 -0
  218. package/dist/services/speech/providers/elevenlabs.provider.d.ts.map +1 -0
  219. package/dist/services/speech/providers/elevenlabs.provider.js +199 -0
  220. package/dist/services/speech/providers/elevenlabs.provider.js.map +1 -0
  221. package/dist/services/speech/providers/whisper.provider.d.ts +94 -0
  222. package/dist/services/speech/providers/whisper.provider.d.ts.map +1 -0
  223. package/dist/services/speech/providers/whisper.provider.js +240 -0
  224. package/dist/services/speech/providers/whisper.provider.js.map +1 -0
  225. package/dist/services/speech/types.d.ts +173 -0
  226. package/dist/services/speech/types.d.ts.map +1 -0
  227. package/dist/services/speech/types.js +8 -0
  228. package/dist/services/speech/types.js.map +1 -0
  229. package/dist/storage/core/IStorageProvider.d.ts +159 -0
  230. package/dist/storage/core/IStorageProvider.d.ts.map +1 -0
  231. package/dist/storage/core/IStorageProvider.js +2 -0
  232. package/dist/storage/core/IStorageProvider.js.map +1 -0
  233. package/dist/storage/core/StorageService.d.ts +22 -0
  234. package/dist/storage/core/StorageService.d.ts.map +1 -0
  235. package/dist/storage/core/StorageService.js +151 -0
  236. package/dist/storage/core/StorageService.js.map +1 -0
  237. package/dist/storage/core/storageFactory.d.ts +66 -0
  238. package/dist/storage/core/storageFactory.d.ts.map +1 -0
  239. package/dist/storage/core/storageFactory.js +122 -0
  240. package/dist/storage/core/storageFactory.js.map +1 -0
  241. package/dist/storage/core/storageValidation.d.ts +77 -0
  242. package/dist/storage/core/storageValidation.d.ts.map +1 -0
  243. package/dist/storage/core/storageValidation.js +303 -0
  244. package/dist/storage/core/storageValidation.js.map +1 -0
  245. package/dist/storage/providers/cloudflare/d1Provider.d.ts +94 -0
  246. package/dist/storage/providers/cloudflare/d1Provider.d.ts.map +1 -0
  247. package/dist/storage/providers/cloudflare/d1Provider.js +347 -0
  248. package/dist/storage/providers/cloudflare/d1Provider.js.map +1 -0
  249. package/dist/storage/providers/cloudflare/kvProvider.d.ts +21 -0
  250. package/dist/storage/providers/cloudflare/kvProvider.d.ts.map +1 -0
  251. package/dist/storage/providers/cloudflare/kvProvider.js +183 -0
  252. package/dist/storage/providers/cloudflare/kvProvider.js.map +1 -0
  253. package/dist/storage/providers/cloudflare/r2Provider.d.ts +28 -0
  254. package/dist/storage/providers/cloudflare/r2Provider.d.ts.map +1 -0
  255. package/dist/storage/providers/cloudflare/r2Provider.js +222 -0
  256. package/dist/storage/providers/cloudflare/r2Provider.js.map +1 -0
  257. package/dist/storage/providers/fileSystem/fileSystemProvider.d.ts +20 -0
  258. package/dist/storage/providers/fileSystem/fileSystemProvider.d.ts.map +1 -0
  259. package/dist/storage/providers/fileSystem/fileSystemProvider.js +282 -0
  260. package/dist/storage/providers/fileSystem/fileSystemProvider.js.map +1 -0
  261. package/dist/storage/providers/inMemory/inMemoryProvider.d.ts +21 -0
  262. package/dist/storage/providers/inMemory/inMemoryProvider.d.ts.map +1 -0
  263. package/dist/storage/providers/inMemory/inMemoryProvider.js +139 -0
  264. package/dist/storage/providers/inMemory/inMemoryProvider.js.map +1 -0
  265. package/dist/storage/providers/supabase/supabase.types.d.ts +49 -0
  266. package/dist/storage/providers/supabase/supabase.types.d.ts.map +1 -0
  267. package/dist/storage/providers/supabase/supabase.types.js +8 -0
  268. package/dist/storage/providers/supabase/supabase.types.js.map +1 -0
  269. package/dist/storage/providers/supabase/supabaseProvider.d.ts +24 -0
  270. package/dist/storage/providers/supabase/supabaseProvider.d.ts.map +1 -0
  271. package/dist/storage/providers/supabase/supabaseProvider.js +209 -0
  272. package/dist/storage/providers/supabase/supabaseProvider.js.map +1 -0
  273. package/dist/testing/index.d.ts +53 -0
  274. package/dist/testing/index.d.ts.map +1 -0
  275. package/dist/testing/index.js +132 -0
  276. package/dist/testing/index.js.map +1 -0
  277. package/dist/types-global/errors.d.ts +83 -0
  278. package/dist/types-global/errors.d.ts.map +1 -0
  279. package/dist/types-global/errors.js +113 -0
  280. package/dist/types-global/errors.js.map +1 -0
  281. package/dist/utils/formatting/diffFormatter.d.ts +227 -0
  282. package/dist/utils/formatting/diffFormatter.d.ts.map +1 -0
  283. package/dist/utils/formatting/diffFormatter.js +369 -0
  284. package/dist/utils/formatting/diffFormatter.js.map +1 -0
  285. package/dist/utils/formatting/index.d.ts +9 -0
  286. package/dist/utils/formatting/index.d.ts.map +1 -0
  287. package/dist/utils/formatting/index.js +9 -0
  288. package/dist/utils/formatting/index.js.map +1 -0
  289. package/dist/utils/formatting/markdownBuilder.d.ts +543 -0
  290. package/dist/utils/formatting/markdownBuilder.d.ts.map +1 -0
  291. package/dist/utils/formatting/markdownBuilder.js +674 -0
  292. package/dist/utils/formatting/markdownBuilder.js.map +1 -0
  293. package/dist/utils/formatting/tableFormatter.d.ts +261 -0
  294. package/dist/utils/formatting/tableFormatter.d.ts.map +1 -0
  295. package/dist/utils/formatting/tableFormatter.js +456 -0
  296. package/dist/utils/formatting/tableFormatter.js.map +1 -0
  297. package/dist/utils/formatting/treeFormatter.d.ts +344 -0
  298. package/dist/utils/formatting/treeFormatter.d.ts.map +1 -0
  299. package/dist/utils/formatting/treeFormatter.js +400 -0
  300. package/dist/utils/formatting/treeFormatter.js.map +1 -0
  301. package/dist/utils/internal/encoding.d.ts +42 -0
  302. package/dist/utils/internal/encoding.d.ts.map +1 -0
  303. package/dist/utils/internal/encoding.js +87 -0
  304. package/dist/utils/internal/encoding.js.map +1 -0
  305. package/dist/utils/internal/error-handler/errorHandler.d.ts +140 -0
  306. package/dist/utils/internal/error-handler/errorHandler.d.ts.map +1 -0
  307. package/dist/utils/internal/error-handler/errorHandler.js +318 -0
  308. package/dist/utils/internal/error-handler/errorHandler.js.map +1 -0
  309. package/dist/utils/internal/error-handler/helpers.d.ts +98 -0
  310. package/dist/utils/internal/error-handler/helpers.d.ts.map +1 -0
  311. package/dist/utils/internal/error-handler/helpers.js +214 -0
  312. package/dist/utils/internal/error-handler/helpers.js.map +1 -0
  313. package/dist/utils/internal/error-handler/mappings.d.ts +85 -0
  314. package/dist/utils/internal/error-handler/mappings.d.ts.map +1 -0
  315. package/dist/utils/internal/error-handler/mappings.js +234 -0
  316. package/dist/utils/internal/error-handler/mappings.js.map +1 -0
  317. package/dist/utils/internal/error-handler/types.d.ts +160 -0
  318. package/dist/utils/internal/error-handler/types.d.ts.map +1 -0
  319. package/dist/utils/internal/error-handler/types.js +6 -0
  320. package/dist/utils/internal/error-handler/types.js.map +1 -0
  321. package/dist/utils/internal/health.d.ts +60 -0
  322. package/dist/utils/internal/health.d.ts.map +1 -0
  323. package/dist/utils/internal/health.js +46 -0
  324. package/dist/utils/internal/health.js.map +1 -0
  325. package/dist/utils/internal/logger.d.ts +300 -0
  326. package/dist/utils/internal/logger.d.ts.map +1 -0
  327. package/dist/utils/internal/logger.js +573 -0
  328. package/dist/utils/internal/logger.js.map +1 -0
  329. package/dist/utils/internal/performance.d.ts +78 -0
  330. package/dist/utils/internal/performance.d.ts.map +1 -0
  331. package/dist/utils/internal/performance.js +227 -0
  332. package/dist/utils/internal/performance.js.map +1 -0
  333. package/dist/utils/internal/requestContext.d.ts +200 -0
  334. package/dist/utils/internal/requestContext.d.ts.map +1 -0
  335. package/dist/utils/internal/requestContext.js +163 -0
  336. package/dist/utils/internal/requestContext.js.map +1 -0
  337. package/dist/utils/internal/runtime.d.ts +49 -0
  338. package/dist/utils/internal/runtime.d.ts.map +1 -0
  339. package/dist/utils/internal/runtime.js +90 -0
  340. package/dist/utils/internal/runtime.js.map +1 -0
  341. package/dist/utils/internal/startupBanner.d.ts +23 -0
  342. package/dist/utils/internal/startupBanner.d.ts.map +1 -0
  343. package/dist/utils/internal/startupBanner.js +34 -0
  344. package/dist/utils/internal/startupBanner.js.map +1 -0
  345. package/dist/utils/metrics/tokenCounter.d.ts +97 -0
  346. package/dist/utils/metrics/tokenCounter.d.ts.map +1 -0
  347. package/dist/utils/metrics/tokenCounter.js +162 -0
  348. package/dist/utils/metrics/tokenCounter.js.map +1 -0
  349. package/dist/utils/network/fetchWithTimeout.d.ts +91 -0
  350. package/dist/utils/network/fetchWithTimeout.d.ts.map +1 -0
  351. package/dist/utils/network/fetchWithTimeout.js +305 -0
  352. package/dist/utils/network/fetchWithTimeout.js.map +1 -0
  353. package/dist/utils/pagination/pagination.d.ts +157 -0
  354. package/dist/utils/pagination/pagination.d.ts.map +1 -0
  355. package/dist/utils/pagination/pagination.js +191 -0
  356. package/dist/utils/pagination/pagination.js.map +1 -0
  357. package/dist/utils/parsing/csvParser.d.ts +84 -0
  358. package/dist/utils/parsing/csvParser.d.ts.map +1 -0
  359. package/dist/utils/parsing/csvParser.js +132 -0
  360. package/dist/utils/parsing/csvParser.js.map +1 -0
  361. package/dist/utils/parsing/dateParser.d.ts +103 -0
  362. package/dist/utils/parsing/dateParser.d.ts.map +1 -0
  363. package/dist/utils/parsing/dateParser.js +142 -0
  364. package/dist/utils/parsing/dateParser.js.map +1 -0
  365. package/dist/utils/parsing/frontmatterParser.d.ts +91 -0
  366. package/dist/utils/parsing/frontmatterParser.d.ts.map +1 -0
  367. package/dist/utils/parsing/frontmatterParser.js +163 -0
  368. package/dist/utils/parsing/frontmatterParser.js.map +1 -0
  369. package/dist/utils/parsing/index.d.ts +15 -0
  370. package/dist/utils/parsing/index.d.ts.map +1 -0
  371. package/dist/utils/parsing/index.js +15 -0
  372. package/dist/utils/parsing/index.js.map +1 -0
  373. package/dist/utils/parsing/jsonParser.d.ts +115 -0
  374. package/dist/utils/parsing/jsonParser.d.ts.map +1 -0
  375. package/dist/utils/parsing/jsonParser.js +177 -0
  376. package/dist/utils/parsing/jsonParser.js.map +1 -0
  377. package/dist/utils/parsing/pdfParser.d.ts +563 -0
  378. package/dist/utils/parsing/pdfParser.d.ts.map +1 -0
  379. package/dist/utils/parsing/pdfParser.js +775 -0
  380. package/dist/utils/parsing/pdfParser.js.map +1 -0
  381. package/dist/utils/parsing/thinkBlock.d.ts +31 -0
  382. package/dist/utils/parsing/thinkBlock.d.ts.map +1 -0
  383. package/dist/utils/parsing/thinkBlock.js +31 -0
  384. package/dist/utils/parsing/thinkBlock.js.map +1 -0
  385. package/dist/utils/parsing/xmlParser.d.ts +69 -0
  386. package/dist/utils/parsing/xmlParser.d.ts.map +1 -0
  387. package/dist/utils/parsing/xmlParser.js +140 -0
  388. package/dist/utils/parsing/xmlParser.js.map +1 -0
  389. package/dist/utils/parsing/yamlParser.d.ts +64 -0
  390. package/dist/utils/parsing/yamlParser.d.ts.map +1 -0
  391. package/dist/utils/parsing/yamlParser.js +129 -0
  392. package/dist/utils/parsing/yamlParser.js.map +1 -0
  393. package/dist/utils/scheduling/scheduler.d.ts +174 -0
  394. package/dist/utils/scheduling/scheduler.d.ts.map +1 -0
  395. package/dist/utils/scheduling/scheduler.js +248 -0
  396. package/dist/utils/scheduling/scheduler.js.map +1 -0
  397. package/dist/utils/security/idGenerator.d.ts +189 -0
  398. package/dist/utils/security/idGenerator.d.ts.map +1 -0
  399. package/dist/utils/security/idGenerator.js +301 -0
  400. package/dist/utils/security/idGenerator.js.map +1 -0
  401. package/dist/utils/security/index.d.ts +8 -0
  402. package/dist/utils/security/index.d.ts.map +1 -0
  403. package/dist/utils/security/index.js +8 -0
  404. package/dist/utils/security/index.js.map +1 -0
  405. package/dist/utils/security/rateLimiter.d.ts +171 -0
  406. package/dist/utils/security/rateLimiter.d.ts.map +1 -0
  407. package/dist/utils/security/rateLimiter.js +294 -0
  408. package/dist/utils/security/rateLimiter.js.map +1 -0
  409. package/dist/utils/security/sanitization.d.ts +430 -0
  410. package/dist/utils/security/sanitization.d.ts.map +1 -0
  411. package/dist/utils/security/sanitization.js +759 -0
  412. package/dist/utils/security/sanitization.js.map +1 -0
  413. package/dist/utils/telemetry/index.d.ts +12 -0
  414. package/dist/utils/telemetry/index.d.ts.map +1 -0
  415. package/dist/utils/telemetry/index.js +12 -0
  416. package/dist/utils/telemetry/index.js.map +1 -0
  417. package/dist/utils/telemetry/instrumentation.d.ts +62 -0
  418. package/dist/utils/telemetry/instrumentation.d.ts.map +1 -0
  419. package/dist/utils/telemetry/instrumentation.js +223 -0
  420. package/dist/utils/telemetry/instrumentation.js.map +1 -0
  421. package/dist/utils/telemetry/metrics.d.ts +170 -0
  422. package/dist/utils/telemetry/metrics.d.ts.map +1 -0
  423. package/dist/utils/telemetry/metrics.js +205 -0
  424. package/dist/utils/telemetry/metrics.js.map +1 -0
  425. package/dist/utils/telemetry/semconv.d.ts +147 -0
  426. package/dist/utils/telemetry/semconv.d.ts.map +1 -0
  427. package/dist/utils/telemetry/semconv.js +159 -0
  428. package/dist/utils/telemetry/semconv.js.map +1 -0
  429. package/dist/utils/telemetry/trace.d.ts +141 -0
  430. package/dist/utils/telemetry/trace.d.ts.map +1 -0
  431. package/dist/utils/telemetry/trace.js +193 -0
  432. package/dist/utils/telemetry/trace.js.map +1 -0
  433. package/dist/utils/types/guards.d.ts +209 -0
  434. package/dist/utils/types/guards.d.ts.map +1 -0
  435. package/dist/utils/types/guards.js +229 -0
  436. package/dist/utils/types/guards.js.map +1 -0
  437. package/dist/utils/types/index.d.ts +6 -0
  438. package/dist/utils/types/index.d.ts.map +1 -0
  439. package/dist/utils/types/index.js +6 -0
  440. package/dist/utils/types/index.js.map +1 -0
  441. package/dist/worker.d.ts +59 -0
  442. package/dist/worker.d.ts.map +1 -0
  443. package/dist/worker.js +216 -0
  444. package/dist/worker.js.map +1 -0
  445. package/package.json +377 -0
  446. package/skills/README.md +38 -0
  447. package/skills/add-export/SKILL.md +49 -0
  448. package/skills/add-prompt/SKILL.md +97 -0
  449. package/skills/add-provider/SKILL.md +53 -0
  450. package/skills/add-resource/SKILL.md +107 -0
  451. package/skills/add-service/SKILL.md +113 -0
  452. package/skills/add-tool/SKILL.md +110 -0
  453. package/skills/api-auth/SKILL.md +173 -0
  454. package/skills/api-config/SKILL.md +68 -0
  455. package/skills/api-context/SKILL.md +321 -0
  456. package/skills/api-errors/SKILL.md +146 -0
  457. package/skills/api-services/SKILL.md +24 -0
  458. package/skills/api-services/references/graph.md +124 -0
  459. package/skills/api-services/references/llm.md +46 -0
  460. package/skills/api-services/references/speech.md +72 -0
  461. package/skills/api-testing/SKILL.md +263 -0
  462. package/skills/api-utils/SKILL.md +106 -0
  463. package/skills/api-utils/references/formatting.md +237 -0
  464. package/skills/api-utils/references/parsing.md +263 -0
  465. package/skills/api-utils/references/security.md +226 -0
  466. package/skills/api-workers/SKILL.md +165 -0
  467. package/skills/devcheck/SKILL.md +31 -0
  468. package/skills/maintenance/SKILL.md +52 -0
  469. package/skills/migrate-mcp-ts-template/SKILL.md +131 -0
  470. package/skills/release/SKILL.md +67 -0
  471. package/skills/setup/SKILL.md +89 -0
  472. package/skills/walkthrough-init/SKILL.md +50 -0
  473. package/templates/.env.example +17 -0
  474. package/templates/AGENTS.md +113 -0
  475. package/templates/CLAUDE.md +113 -0
  476. package/templates/_tsconfig.json +33 -0
  477. package/templates/biome.template.json +43 -0
  478. package/templates/package.json +26 -0
  479. package/templates/src/index.ts +16 -0
  480. package/templates/src/mcp-server/prompts/definitions/echo.prompt.ts +19 -0
  481. package/templates/src/mcp-server/resources/definitions/echo.resource.ts +30 -0
  482. package/templates/src/mcp-server/tools/definitions/echo.tool.ts +24 -0
  483. package/templates/vitest.config.ts +12 -0
  484. package/tsconfig.base.json +44 -0
  485. package/vitest.config.base.ts +38 -0
@@ -0,0 +1,543 @@
1
+ /**
2
+ * @fileoverview Markdown builder utility for creating well-structured, semantic markdown content
3
+ * @module utils/formatting/markdownBuilder
4
+ */
5
+ /**
6
+ * Utility class for building well-formatted markdown content with consistent structure.
7
+ *
8
+ * Provides a fluent API for creating markdown documents with proper spacing, hierarchy,
9
+ * and semantic structure. Eliminates string concatenation and ensures consistent
10
+ * formatting across tool response formatters. Each method appends to an internal buffer
11
+ * and returns `this` for chaining; call {@link MarkdownBuilder.build} to produce the
12
+ * final string.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const output = new MarkdownBuilder()
17
+ * .h1('Commit Created Successfully')
18
+ * .keyValue('Commit Hash', 'abc123def')
19
+ * .keyValue('Author', 'John Doe')
20
+ * .section('Files Changed', () => {
21
+ * // `section` calls the callback immediately; builder state is mutated in place
22
+ * })
23
+ * .list(['file1.ts', 'file2.ts'])
24
+ * .build();
25
+ * ```
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * // Using the `markdown()` factory shorthand
30
+ * import { markdown } from '@cyanheads/mcp-ts-core/utils/formatting';
31
+ *
32
+ * const md = markdown()
33
+ * .h2('Results')
34
+ * .table(['Name', 'Status'], [['foo', 'ok'], ['bar', 'fail']])
35
+ * .build();
36
+ * ```
37
+ */
38
+ export declare class MarkdownBuilder {
39
+ private sections;
40
+ /**
41
+ * Add a level 1 heading (`# text`).
42
+ *
43
+ * @param text - The heading text
44
+ * @param emoji - Optional emoji prepended before the text with a space
45
+ * @returns this builder for chaining
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * markdown().h1('Report').build(); // '# Report'
50
+ * markdown().h1('Report', '📋').build(); // '# 📋 Report'
51
+ * ```
52
+ */
53
+ h1(text: string, emoji?: string): this;
54
+ /**
55
+ * Add a level 2 heading (`## text`).
56
+ *
57
+ * @param text - The heading text
58
+ * @param emoji - Optional emoji prepended before the text with a space
59
+ * @returns this builder for chaining
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * markdown().h2('Section').build(); // '## Section'
64
+ * ```
65
+ */
66
+ h2(text: string, emoji?: string): this;
67
+ /**
68
+ * Add a level 3 heading (`### text`).
69
+ *
70
+ * @param text - The heading text
71
+ * @param emoji - Optional emoji prepended before the text with a space
72
+ * @returns this builder for chaining
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * markdown().h3('Subsection').build(); // '### Subsection'
77
+ * ```
78
+ */
79
+ h3(text: string, emoji?: string): this;
80
+ /**
81
+ * Add a level 4 heading (`#### text`).
82
+ *
83
+ * @param text - The heading text
84
+ * @param emoji - Optional emoji prepended before the text with a space
85
+ * @returns this builder for chaining
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * markdown().h4('Detail').build(); // '#### Detail'
90
+ * ```
91
+ */
92
+ h4(text: string, emoji?: string): this;
93
+ /**
94
+ * Add a bold key-value pair on a single line (`**key:** value`).
95
+ * `null` values are rendered as the string `'null'`.
96
+ *
97
+ * @param key - The key label, rendered in bold
98
+ * @param value - The value; `null` renders as `'null'`
99
+ * @returns this builder for chaining
100
+ *
101
+ * @example
102
+ * ```typescript
103
+ * markdown().keyValue('Status', 'active').build(); // '**Status:** active'
104
+ * markdown().keyValue('Count', 42).build(); // '**Count:** 42'
105
+ * markdown().keyValue('Flag', null).build(); // '**Flag:** null'
106
+ * ```
107
+ */
108
+ keyValue(key: string, value: string | number | boolean | null): this;
109
+ /**
110
+ * Add a plain (unbolded) key-value pair on a single line (`key: value`).
111
+ * Use when less visual emphasis is desired compared to {@link keyValue}.
112
+ * `null` values are rendered as the string `'null'`.
113
+ *
114
+ * @param key - The key label, rendered without formatting
115
+ * @param value - The value; `null` renders as `'null'`
116
+ * @returns this builder for chaining
117
+ *
118
+ * @example
119
+ * ```typescript
120
+ * markdown().keyValuePlain('host', 'localhost').build(); // 'host: localhost'
121
+ * ```
122
+ */
123
+ keyValuePlain(key: string, value: string | number | boolean | null): this;
124
+ /**
125
+ * Add a bulleted (`-`) or numbered list. Empty arrays are silently ignored.
126
+ *
127
+ * @param items - Array of string items to render
128
+ * @param ordered - When `true`, renders a numbered list (`1.`, `2.`, …); defaults to `false` (bulleted)
129
+ * @returns this builder for chaining
130
+ *
131
+ * @example
132
+ * ```typescript
133
+ * markdown().list(['alpha', 'beta', 'gamma']).build();
134
+ * // - alpha
135
+ * // - beta
136
+ * // - gamma
137
+ *
138
+ * markdown().list(['first', 'second'], true).build();
139
+ * // 1. first
140
+ * // 2. second
141
+ * ```
142
+ */
143
+ list(items: string[], ordered?: boolean): this;
144
+ /**
145
+ * Add a fenced code block with optional syntax highlighting.
146
+ *
147
+ * @param content - The code content placed verbatim inside the fence
148
+ * @param language - Language identifier for syntax highlighting (e.g. `'typescript'`, `'json'`, `'diff'`); defaults to no language
149
+ * @returns this builder for chaining
150
+ *
151
+ * @example
152
+ * ```typescript
153
+ * markdown().codeBlock('const x = 1;', 'typescript').build();
154
+ * // ```typescript
155
+ * // const x = 1;
156
+ * // ```
157
+ * ```
158
+ */
159
+ codeBlock(content: string, language?: string): this;
160
+ /**
161
+ * Append inline code wrapped in single backticks (`` `code` ``).
162
+ * No trailing newline is added — suitable for inline use within a sentence.
163
+ *
164
+ * @param code - The code text to wrap
165
+ * @returns this builder for chaining
166
+ *
167
+ * @example
168
+ * ```typescript
169
+ * markdown().text('Call ').inlineCode('build()').text(' when done.').build();
170
+ * // Call `build()` when done.
171
+ * ```
172
+ */
173
+ inlineCode(code: string): this;
174
+ /**
175
+ * Add a paragraph of text followed by two newlines.
176
+ *
177
+ * @param text - The paragraph content
178
+ * @returns this builder for chaining
179
+ *
180
+ * @example
181
+ * ```typescript
182
+ * markdown().paragraph('Hello world.').paragraph('Second paragraph.').build();
183
+ * // Hello world.
184
+ * //
185
+ * // Second paragraph.
186
+ * ```
187
+ */
188
+ paragraph(text: string): this;
189
+ /**
190
+ * Add a blockquote. Each line of `text` is prefixed with `> `.
191
+ *
192
+ * @param text - The quoted text; multi-line strings are handled correctly
193
+ * @returns this builder for chaining
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * markdown().blockquote('Line one\nLine two').build();
198
+ * // > Line one
199
+ * // > Line two
200
+ * ```
201
+ */
202
+ blockquote(text: string): this;
203
+ /**
204
+ * Add a horizontal rule.
205
+ * @returns this builder for chaining
206
+ */
207
+ hr(): this;
208
+ /**
209
+ * Append an inline markdown link (`[text](url)`).
210
+ * No trailing newline is added — suitable for inline use within a sentence.
211
+ *
212
+ * @param text - The visible link label
213
+ * @param url - The link target URL
214
+ * @returns this builder for chaining
215
+ *
216
+ * @example
217
+ * ```typescript
218
+ * markdown().text('See ').link('the docs', 'https://example.com').text(' for details.').build();
219
+ * // See [the docs](https://example.com) for details.
220
+ * ```
221
+ */
222
+ link(text: string, url: string): this;
223
+ /**
224
+ * Add a GFM-style table. Returns without modification if `headers` or `rows` is empty.
225
+ * All separator cells use `---`; no alignment syntax is applied.
226
+ *
227
+ * @param headers - Column header labels
228
+ * @param rows - Data rows; each inner array should have the same length as `headers`
229
+ * @returns this builder for chaining
230
+ *
231
+ * @example
232
+ * ```typescript
233
+ * markdown().table(['Name', 'Status'], [['foo', 'ok'], ['bar', 'fail']]).build();
234
+ * // | Name | Status |
235
+ * // | --- | --- |
236
+ * // | foo | ok |
237
+ * // | bar | fail |
238
+ * ```
239
+ */
240
+ table(headers: string[], rows: string[][]): this;
241
+ /**
242
+ * Add a headed section by rendering a heading then immediately invoking a callback.
243
+ * The callback is called synchronously; any builder calls inside it mutate the same
244
+ * instance. Defaults to heading level 2 when no level is provided.
245
+ *
246
+ * @param title - The section heading text
247
+ * @param levelOrContent - Heading level (`2`|`3`|`4`) or callback when using the two-arg overload
248
+ * @param content - Callback that appends section body content (required when `level` is provided)
249
+ * @returns this builder for chaining
250
+ *
251
+ * @example
252
+ * ```typescript
253
+ * const md = markdown();
254
+ * md.section('Files Changed', () => {
255
+ * md.list(['file1.ts', 'file2.ts']);
256
+ * });
257
+ * // ## Files Changed
258
+ * //
259
+ * // - file1.ts
260
+ * // - file2.ts
261
+ *
262
+ * md.section('Details', 3, () => {
263
+ * md.paragraph('Nested at level 3.');
264
+ * });
265
+ * // ### Details
266
+ * //
267
+ * // Nested at level 3.
268
+ * ```
269
+ */
270
+ section(title: string, content: () => void): this;
271
+ section(title: string, level: 2 | 3 | 4, content: () => void): this;
272
+ /**
273
+ * Add a collapsible `<details>`/`<summary>` HTML block.
274
+ * The `summary` is always visible; `details` content is collapsed by default.
275
+ * Not all markdown renderers support this — GitHub and GitLab do.
276
+ *
277
+ * @param summary - The always-visible summary label
278
+ * @param details - The collapsible body content (plain text or markdown)
279
+ * @returns this builder for chaining
280
+ *
281
+ * @example
282
+ * ```typescript
283
+ * markdown().details('Show stack trace', 'Error: something went wrong\n at foo.ts:10').build();
284
+ * // <details>
285
+ * // <summary>Show stack trace</summary>
286
+ * //
287
+ * // Error: something went wrong
288
+ * // at foo.ts:10
289
+ * //
290
+ * // </details>
291
+ * ```
292
+ */
293
+ details(summary: string, details: string): this;
294
+ /**
295
+ * Add a status/alert box (GitHub/GitLab style).
296
+ * Renders as a highlighted blockquote with an icon.
297
+ *
298
+ * Supported types:
299
+ * - 'note': 📝 Neutral information
300
+ * - 'tip': 💡 Helpful suggestions
301
+ * - 'important': ❗ Critical information
302
+ * - 'warning': ⚠️ Warning/caution
303
+ * - 'caution': 🚨 Danger/destructive action
304
+ *
305
+ * @param type - Alert type
306
+ * @param content - Alert content (can be multi-line)
307
+ * @returns this builder for chaining
308
+ *
309
+ * @example
310
+ * ```typescript
311
+ * md.alert('warning', 'This operation cannot be undone!');
312
+ * // Renders: > [!WARNING]
313
+ * // > This operation cannot be undone!
314
+ * ```
315
+ */
316
+ alert(type: 'note' | 'tip' | 'important' | 'warning' | 'caution', content: string): this;
317
+ /**
318
+ * Add a task list with checkboxes (GitHub style).
319
+ *
320
+ * @param items - Array of tasks with checked status
321
+ * @returns this builder for chaining
322
+ *
323
+ * @example
324
+ * ```typescript
325
+ * md.taskList([
326
+ * { checked: true, text: 'Complete setup' },
327
+ * { checked: false, text: 'Run tests' },
328
+ * ]);
329
+ * // Renders: - [x] Complete setup
330
+ * // - [ ] Run tests
331
+ * ```
332
+ */
333
+ taskList(items: Array<{
334
+ checked: boolean;
335
+ text: string;
336
+ }>): this;
337
+ /**
338
+ * Add an image with alt text and optional title.
339
+ *
340
+ * @param altText - Alternative text for the image
341
+ * @param url - Image URL
342
+ * @param title - Optional title (shown on hover)
343
+ * @returns this builder for chaining
344
+ *
345
+ * @example
346
+ * ```typescript
347
+ * md.image('Architecture diagram', '/assets/diagram.png', 'System Architecture');
348
+ * // Renders: ![Architecture diagram](/assets/diagram.png "System Architecture")
349
+ * ```
350
+ */
351
+ image(altText: string, url: string, title?: string): this;
352
+ /**
353
+ * Add strikethrough text.
354
+ *
355
+ * @param text - Text to strike through
356
+ * @returns this builder for chaining
357
+ *
358
+ * @example
359
+ * ```typescript
360
+ * md.text('Price: ').strikethrough('$100').text(' $80');
361
+ * // Renders: Price: ~~$100~~ $80
362
+ * ```
363
+ */
364
+ strikethrough(text: string): this;
365
+ /**
366
+ * Add a `diff`-language fenced code block showing additions and deletions.
367
+ * Rendering order: context lines (two-space indent) → deletions (`- ` prefix) → additions (`+ ` prefix).
368
+ * If all three arrays are empty or omitted, nothing is appended.
369
+ *
370
+ * @param changes - Line arrays for the diff
371
+ * @param changes.context - Unchanged context lines (rendered with two-space indent)
372
+ * @param changes.deletions - Removed lines (rendered with `- ` prefix)
373
+ * @param changes.additions - Added lines (rendered with `+ ` prefix)
374
+ * @returns this builder for chaining
375
+ *
376
+ * @example
377
+ * ```typescript
378
+ * markdown().diff({
379
+ * context: ['// Configuration'],
380
+ * deletions: ['const oldFeature = false;'],
381
+ * additions: ['const newFeature = true;'],
382
+ * }).build();
383
+ * // ```diff
384
+ * // // Configuration
385
+ * // - const oldFeature = false;
386
+ * // + const newFeature = true;
387
+ * // ```
388
+ * ```
389
+ */
390
+ diff(changes: {
391
+ additions?: string[];
392
+ deletions?: string[];
393
+ context?: string[];
394
+ }): this;
395
+ /**
396
+ * Add a badge/shield (uses shields.io style).
397
+ *
398
+ * @param label - Badge label (left side)
399
+ * @param message - Badge message (right side)
400
+ * @param color - Optional color (e.g., 'green', 'red', 'blue', 'yellow')
401
+ * @returns this builder for chaining
402
+ *
403
+ * @example
404
+ * ```typescript
405
+ * md.badge('build', 'passing', 'green');
406
+ * // Renders: ![build: passing](https://img.shields.io/badge/build-passing-green)
407
+ * ```
408
+ */
409
+ badge(label: string, message: string, color?: string): this;
410
+ /**
411
+ * Add bold text.
412
+ *
413
+ * @param text - Text to make bold
414
+ * @returns this builder for chaining
415
+ *
416
+ * @example
417
+ * ```typescript
418
+ * md.text('This is ').bold('important').text(' information.');
419
+ * // Renders: This is **important** information.
420
+ * ```
421
+ */
422
+ bold(text: string): this;
423
+ /**
424
+ * Add italic text.
425
+ *
426
+ * @param text - Text to make italic
427
+ * @returns this builder for chaining
428
+ *
429
+ * @example
430
+ * ```typescript
431
+ * md.text('This is ').italic('emphasized').text('.');
432
+ * // Renders: This is *emphasized*.
433
+ * ```
434
+ */
435
+ italic(text: string): this;
436
+ /**
437
+ * Add bold and italic text.
438
+ *
439
+ * @param text - Text to make bold and italic
440
+ * @returns this builder for chaining
441
+ *
442
+ * @example
443
+ * ```typescript
444
+ * md.boldItalic('Very important');
445
+ * // Renders: ***Very important***
446
+ * ```
447
+ */
448
+ boldItalic(text: string): this;
449
+ /**
450
+ * Append a raw markdown string directly to the buffer without any transformation.
451
+ * Use this for custom formatting not covered by other methods.
452
+ *
453
+ * @param markdown - Raw markdown string appended verbatim
454
+ * @returns this builder for chaining
455
+ *
456
+ * @example
457
+ * ```typescript
458
+ * markdown().raw('> custom blockquote\n\n').build();
459
+ * // > custom blockquote
460
+ * ```
461
+ */
462
+ raw(markdown: string): this;
463
+ /**
464
+ * Add a blank line for spacing.
465
+ * @returns this builder for chaining
466
+ */
467
+ blankLine(): this;
468
+ /**
469
+ * Append plain text without any markdown formatting or implicit line breaks.
470
+ * Useful for building inline content by interleaving with methods like
471
+ * {@link bold}, {@link italic}, {@link inlineCode}, and {@link link}.
472
+ *
473
+ * @param text - The text to append verbatim
474
+ * @returns this builder for chaining
475
+ *
476
+ * @example
477
+ * ```typescript
478
+ * markdown().text('Result: ').bold('42').text(' items found.').build();
479
+ * // Result: **42** items found.
480
+ * ```
481
+ */
482
+ text(text: string): this;
483
+ /**
484
+ * Conditionally append content. The callback is invoked synchronously only when
485
+ * `condition` is `true`; otherwise the builder is returned unchanged.
486
+ *
487
+ * @param condition - When `true`, the callback is invoked
488
+ * @param content - Callback that appends content to this builder
489
+ * @returns this builder for chaining
490
+ *
491
+ * @example
492
+ * ```typescript
493
+ * md.when(files.length > 0, () => {
494
+ * md.h2('Files Changed').list(files);
495
+ * });
496
+ * ```
497
+ */
498
+ when(condition: boolean, content: () => void): this;
499
+ /**
500
+ * Concatenate all buffered sections and return the final markdown string.
501
+ * Leading and trailing whitespace is trimmed so documents always end cleanly.
502
+ * The builder instance is NOT reset — call {@link reset} explicitly if reuse is needed.
503
+ *
504
+ * @returns The complete markdown document as a trimmed string
505
+ *
506
+ * @example
507
+ * ```typescript
508
+ * const output = markdown().h1('Hello').paragraph('World').build();
509
+ * // '# Hello\n\nWorld'
510
+ * ```
511
+ */
512
+ build(): string;
513
+ /**
514
+ * Clear all buffered content so the builder can be reused for a new document.
515
+ *
516
+ * @returns this builder for chaining
517
+ *
518
+ * @example
519
+ * ```typescript
520
+ * const md = markdown().h1('Draft');
521
+ * md.reset().h1('Final').build(); // '# Final'
522
+ * ```
523
+ */
524
+ reset(): this;
525
+ }
526
+ /**
527
+ * Factory function that creates a new {@link MarkdownBuilder} instance.
528
+ * Prefer this over `new MarkdownBuilder()` for concise call-site syntax.
529
+ *
530
+ * @returns A fresh, empty `MarkdownBuilder`
531
+ *
532
+ * @example
533
+ * ```typescript
534
+ * import { markdown } from '@cyanheads/mcp-ts-core/utils/formatting';
535
+ *
536
+ * const output = markdown()
537
+ * .h1('Summary')
538
+ * .keyValue('Total', 5)
539
+ * .build();
540
+ * ```
541
+ */
542
+ export declare function markdown(): MarkdownBuilder;
543
+ //# sourceMappingURL=markdownBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownBuilder.d.ts","sourceRoot":"","sources":["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