mcpmake 0.1.1 → 0.2.1

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 (385) hide show
  1. package/README.md +88 -635
  2. package/dist/commands/bundle.d.ts +1 -0
  3. package/dist/commands/bundle.d.ts.map +1 -0
  4. package/dist/commands/bundle.js +5 -4
  5. package/dist/commands/bundle.js.map +1 -0
  6. package/dist/commands/ci.d.ts +1 -0
  7. package/dist/commands/ci.d.ts.map +1 -0
  8. package/dist/commands/ci.js +3 -2
  9. package/dist/commands/ci.js.map +1 -0
  10. package/dist/commands/deploy.d.ts +1 -0
  11. package/dist/commands/deploy.d.ts.map +1 -0
  12. package/dist/commands/deploy.js +4 -3
  13. package/dist/commands/deploy.js.map +1 -0
  14. package/dist/commands/diff.d.ts +1 -0
  15. package/dist/commands/diff.d.ts.map +1 -0
  16. package/dist/commands/diff.js +5 -4
  17. package/dist/commands/diff.js.map +1 -0
  18. package/dist/commands/from/describe.d.ts +1 -0
  19. package/dist/commands/from/describe.d.ts.map +1 -0
  20. package/dist/commands/from/describe.js +11 -10
  21. package/dist/commands/from/describe.js.map +1 -0
  22. package/dist/commands/from/har.d.ts +1 -0
  23. package/dist/commands/from/har.d.ts.map +1 -0
  24. package/dist/commands/from/har.js +14 -13
  25. package/dist/commands/from/har.js.map +1 -0
  26. package/dist/commands/from/openapi.d.ts +1 -0
  27. package/dist/commands/from/openapi.d.ts.map +1 -0
  28. package/dist/commands/from/openapi.js +17 -16
  29. package/dist/commands/from/openapi.js.map +1 -0
  30. package/dist/commands/from/postman.d.ts +1 -0
  31. package/dist/commands/from/postman.d.ts.map +1 -0
  32. package/dist/commands/from/postman.js +13 -12
  33. package/dist/commands/from/postman.js.map +1 -0
  34. package/dist/commands/from/stainless.d.ts +110 -0
  35. package/dist/commands/from/stainless.d.ts.map +1 -0
  36. package/dist/commands/from/stainless.js +272 -0
  37. package/dist/commands/from/stainless.js.map +1 -0
  38. package/dist/commands/from/target-support.d.ts +1 -0
  39. package/dist/commands/from/target-support.d.ts.map +1 -0
  40. package/dist/commands/from/target-support.js +2 -1
  41. package/dist/commands/from/target-support.js.map +1 -0
  42. package/dist/commands/from/url.d.ts +1 -0
  43. package/dist/commands/from/url.d.ts.map +1 -0
  44. package/dist/commands/from/url.js +14 -13
  45. package/dist/commands/from/url.js.map +1 -0
  46. package/dist/commands/from/website.d.ts +1 -0
  47. package/dist/commands/from/website.d.ts.map +1 -0
  48. package/dist/commands/from/website.js +17 -16
  49. package/dist/commands/from/website.js.map +1 -0
  50. package/dist/commands/lint.d.ts +1 -0
  51. package/dist/commands/lint.d.ts.map +1 -0
  52. package/dist/commands/lint.js +6 -5
  53. package/dist/commands/lint.js.map +1 -0
  54. package/dist/commands/merge.d.ts +1 -0
  55. package/dist/commands/merge.d.ts.map +1 -0
  56. package/dist/commands/merge.js +3 -2
  57. package/dist/commands/merge.js.map +1 -0
  58. package/dist/commands/publish.d.ts +1 -0
  59. package/dist/commands/publish.d.ts.map +1 -0
  60. package/dist/commands/publish.js +4 -3
  61. package/dist/commands/publish.js.map +1 -0
  62. package/dist/commands/rescan.d.ts +1 -0
  63. package/dist/commands/rescan.d.ts.map +1 -0
  64. package/dist/commands/rescan.js +12 -11
  65. package/dist/commands/rescan.js.map +1 -0
  66. package/dist/commands/update.d.ts +1 -0
  67. package/dist/commands/update.d.ts.map +1 -0
  68. package/dist/commands/update.js +10 -9
  69. package/dist/commands/update.js.map +1 -0
  70. package/dist/commands/verify.d.ts +1 -0
  71. package/dist/commands/verify.d.ts.map +1 -0
  72. package/dist/commands/verify.js +7 -6
  73. package/dist/commands/verify.js.map +1 -0
  74. package/dist/index.d.ts +1 -0
  75. package/dist/index.d.ts.map +1 -0
  76. package/dist/index.js +23 -2
  77. package/dist/index.js.map +1 -0
  78. package/dist/registry/official-registry.d.ts +1 -0
  79. package/dist/registry/official-registry.d.ts.map +1 -0
  80. package/dist/registry/official-registry.js +1 -0
  81. package/dist/registry/official-registry.js.map +1 -0
  82. package/package.json +20 -46
  83. package/dist/analyzer/auth-detector.d.ts +0 -12
  84. package/dist/analyzer/auth-detector.js +0 -142
  85. package/dist/analyzer/dom-parser.d.ts +0 -10
  86. package/dist/analyzer/dom-parser.js +0 -259
  87. package/dist/analyzer/goal-crawler.d.ts +0 -25
  88. package/dist/analyzer/goal-crawler.js +0 -177
  89. package/dist/analyzer/hybrid-detector.d.ts +0 -28
  90. package/dist/analyzer/hybrid-detector.js +0 -96
  91. package/dist/analyzer/index.d.ts +0 -12
  92. package/dist/analyzer/index.js +0 -8
  93. package/dist/analyzer/screenshot-capture.d.ts +0 -29
  94. package/dist/analyzer/screenshot-capture.js +0 -42
  95. package/dist/analyzer/selector-builder.d.ts +0 -19
  96. package/dist/analyzer/selector-builder.js +0 -199
  97. package/dist/analyzer/semantic-analyzer.d.ts +0 -13
  98. package/dist/analyzer/semantic-analyzer.js +0 -145
  99. package/dist/analyzer/site-crawler.d.ts +0 -38
  100. package/dist/analyzer/site-crawler.js +0 -235
  101. package/dist/cloud/billing/billing-engine.d.ts +0 -44
  102. package/dist/cloud/billing/billing-engine.js +0 -81
  103. package/dist/cloud/billing/credit-store.d.ts +0 -64
  104. package/dist/cloud/billing/credit-store.js +0 -168
  105. package/dist/cloud/billing/index.d.ts +0 -4
  106. package/dist/cloud/billing/index.js +0 -2
  107. package/dist/cloud/billing/usage-store.d.ts +0 -42
  108. package/dist/cloud/billing/usage-store.js +0 -85
  109. package/dist/cloud/billing/usage-tracker.d.ts +0 -38
  110. package/dist/cloud/billing/usage-tracker.js +0 -95
  111. package/dist/cloud/build-pipeline.d.ts +0 -39
  112. package/dist/cloud/build-pipeline.js +0 -310
  113. package/dist/cloud/build-queue.d.ts +0 -30
  114. package/dist/cloud/build-queue.js +0 -70
  115. package/dist/cloud/caddy-manager.d.ts +0 -18
  116. package/dist/cloud/caddy-manager.js +0 -97
  117. package/dist/cloud/container-backend.d.ts +0 -62
  118. package/dist/cloud/container-backend.js +0 -59
  119. package/dist/cloud/container-manager.d.ts +0 -64
  120. package/dist/cloud/container-manager.js +0 -301
  121. package/dist/cloud/crypto.d.ts +0 -27
  122. package/dist/cloud/crypto.js +0 -63
  123. package/dist/cloud/db/index.d.ts +0 -27
  124. package/dist/cloud/db/index.js +0 -53
  125. package/dist/cloud/db/migrations.d.ts +0 -12
  126. package/dist/cloud/db/migrations.js +0 -329
  127. package/dist/cloud/db/pg-store.d.ts +0 -45
  128. package/dist/cloud/db/pg-store.js +0 -336
  129. package/dist/cloud/failure-tracker.d.ts +0 -51
  130. package/dist/cloud/failure-tracker.js +0 -102
  131. package/dist/cloud/idle-monitor.d.ts +0 -30
  132. package/dist/cloud/idle-monitor.js +0 -70
  133. package/dist/cloud/mailer.d.ts +0 -21
  134. package/dist/cloud/mailer.js +0 -193
  135. package/dist/cloud/mcp-proxy.d.ts +0 -58
  136. package/dist/cloud/mcp-proxy.js +0 -203
  137. package/dist/cloud/metric-samples.d.ts +0 -43
  138. package/dist/cloud/metric-samples.js +0 -85
  139. package/dist/cloud/metrics.d.ts +0 -26
  140. package/dist/cloud/metrics.js +0 -59
  141. package/dist/cloud/multipart.d.ts +0 -26
  142. package/dist/cloud/multipart.js +0 -132
  143. package/dist/cloud/observability.d.ts +0 -27
  144. package/dist/cloud/observability.js +0 -98
  145. package/dist/cloud/rate-limiter.d.ts +0 -31
  146. package/dist/cloud/rate-limiter.js +0 -58
  147. package/dist/cloud/request-security.d.ts +0 -5
  148. package/dist/cloud/request-security.js +0 -74
  149. package/dist/cloud/resource-monitor.d.ts +0 -69
  150. package/dist/cloud/resource-monitor.js +0 -130
  151. package/dist/cloud/secret-store.d.ts +0 -38
  152. package/dist/cloud/secret-store.js +0 -103
  153. package/dist/cloud/security.d.ts +0 -26
  154. package/dist/cloud/security.js +0 -142
  155. package/dist/cloud/server.d.ts +0 -21
  156. package/dist/cloud/server.js +0 -1079
  157. package/dist/cloud/shared-state.d.ts +0 -72
  158. package/dist/cloud/shared-state.js +0 -159
  159. package/dist/cloud/ssrf.d.ts +0 -43
  160. package/dist/cloud/ssrf.js +0 -150
  161. package/dist/cloud/store.d.ts +0 -41
  162. package/dist/cloud/store.js +0 -75
  163. package/dist/cloud/stripe.d.ts +0 -78
  164. package/dist/cloud/stripe.js +0 -317
  165. package/dist/cloud/telemetry-store.d.ts +0 -53
  166. package/dist/cloud/telemetry-store.js +0 -108
  167. package/dist/cloud/web/auth.d.ts +0 -225
  168. package/dist/cloud/web/auth.js +0 -555
  169. package/dist/cloud/web/charts.d.ts +0 -70
  170. package/dist/cloud/web/charts.js +0 -178
  171. package/dist/cloud/web/csrf.d.ts +0 -14
  172. package/dist/cloud/web/csrf.js +0 -22
  173. package/dist/cloud/web/docs.d.ts +0 -40
  174. package/dist/cloud/web/docs.js +0 -174
  175. package/dist/cloud/web/router.d.ts +0 -25
  176. package/dist/cloud/web/router.js +0 -1921
  177. package/dist/cloud/web/static/alpine.min.js +0 -5
  178. package/dist/cloud/web/static/favicon.svg +0 -4
  179. package/dist/cloud/web/static/htmx-sse.js +0 -290
  180. package/dist/cloud/web/static/htmx.min.js +0 -1
  181. package/dist/cloud/web/static/style.css +0 -2683
  182. package/dist/cloud/web/static-server.d.ts +0 -13
  183. package/dist/cloud/web/static-server.js +0 -73
  184. package/dist/cloud/web/template-engine.d.ts +0 -27
  185. package/dist/cloud/web/template-engine.js +0 -146
  186. package/dist/cloud/web/templates/layouts/admin.hbs +0 -57
  187. package/dist/cloud/web/templates/layouts/auth.hbs +0 -138
  188. package/dist/cloud/web/templates/layouts/base.hbs +0 -16
  189. package/dist/cloud/web/templates/layouts/dashboard.hbs +0 -39
  190. package/dist/cloud/web/templates/layouts/landing.hbs +0 -82
  191. package/dist/cloud/web/templates/pages/admin/overview.hbs +0 -123
  192. package/dist/cloud/web/templates/pages/admin/servers.hbs +0 -129
  193. package/dist/cloud/web/templates/pages/admin/telemetry.hbs +0 -39
  194. package/dist/cloud/web/templates/pages/admin/user-edit.hbs +0 -91
  195. package/dist/cloud/web/templates/pages/admin/users.hbs +0 -179
  196. package/dist/cloud/web/templates/pages/auth/forgot-password.hbs +0 -25
  197. package/dist/cloud/web/templates/pages/auth/login.hbs +0 -33
  198. package/dist/cloud/web/templates/pages/auth/register.hbs +0 -32
  199. package/dist/cloud/web/templates/pages/auth/reset-password.hbs +0 -34
  200. package/dist/cloud/web/templates/pages/dashboard/billing.hbs +0 -140
  201. package/dist/cloud/web/templates/pages/dashboard/create.hbs +0 -173
  202. package/dist/cloud/web/templates/pages/dashboard/index.hbs +0 -8
  203. package/dist/cloud/web/templates/pages/dashboard/server-detail.hbs +0 -280
  204. package/dist/cloud/web/templates/pages/dashboard/server-logs.hbs +0 -35
  205. package/dist/cloud/web/templates/pages/dashboard/server-metrics.hbs +0 -63
  206. package/dist/cloud/web/templates/pages/dashboard/servers-partial.hbs +0 -21
  207. package/dist/cloud/web/templates/pages/dashboard/servers.hbs +0 -44
  208. package/dist/cloud/web/templates/pages/docs/show.hbs +0 -16
  209. package/dist/cloud/web/templates/pages/errors/404.hbs +0 -9
  210. package/dist/cloud/web/templates/pages/errors/500.hbs +0 -8
  211. package/dist/cloud/web/templates/pages/landing/index.hbs +0 -223
  212. package/dist/cloud/web/templates/pages/legal/privacy.hbs +0 -71
  213. package/dist/cloud/web/templates/pages/legal/terms.hbs +0 -73
  214. package/dist/cloud/web/templates/partials/admin-stats.hbs +0 -52
  215. package/dist/cloud/web/templates/partials/flash-message.hbs +0 -6
  216. package/dist/cloud/web/templates/partials/pricing-table.hbs +0 -103
  217. package/dist/cloud/web/templates/partials/server-card.hbs +0 -19
  218. package/dist/cloud/web/templates/partials/status-badge.hbs +0 -1
  219. package/dist/config/configurable-command.d.ts +0 -13
  220. package/dist/config/configurable-command.js +0 -70
  221. package/dist/config/mcpmake-config.d.ts +0 -68
  222. package/dist/config/mcpmake-config.js +0 -207
  223. package/dist/docs/cli.md +0 -400
  224. package/dist/docs/mcp-2026-07-28-migration.md +0 -78
  225. package/dist/docs/migrate-from-stainless.md +0 -94
  226. package/dist/docs/quickstart.md +0 -166
  227. package/dist/docs/show-hn.md +0 -26
  228. package/dist/docs/website-servers.md +0 -169
  229. package/dist/emitter/code-writer.d.ts +0 -8
  230. package/dist/emitter/code-writer.js +0 -25
  231. package/dist/emitter/index.d.ts +0 -32
  232. package/dist/emitter/index.js +0 -280
  233. package/dist/emitter/mcpb-bundler.d.ts +0 -31
  234. package/dist/emitter/mcpb-bundler.js +0 -172
  235. package/dist/emitter/project-scaffolder.d.ts +0 -4
  236. package/dist/emitter/project-scaffolder.js +0 -89
  237. package/dist/emitter/python-template-loader.d.ts +0 -4
  238. package/dist/emitter/python-template-loader.js +0 -30
  239. package/dist/emitter/python-templates/dockerfile.hbs +0 -14
  240. package/dist/emitter/python-templates/env.example.hbs +0 -6
  241. package/dist/emitter/python-templates/requirements.txt.hbs +0 -4
  242. package/dist/emitter/python-templates/server.py.hbs +0 -77
  243. package/dist/emitter/site-scaffolder.d.ts +0 -13
  244. package/dist/emitter/site-scaffolder.js +0 -70
  245. package/dist/emitter/site-template-loader.d.ts +0 -5
  246. package/dist/emitter/site-template-loader.js +0 -47
  247. package/dist/emitter/site-templates/browser-manager.ts.hbs +0 -233
  248. package/dist/emitter/site-templates/config.ts.hbs +0 -28
  249. package/dist/emitter/site-templates/dockerfile.hbs +0 -31
  250. package/dist/emitter/site-templates/env.example.hbs +0 -19
  251. package/dist/emitter/site-templates/package.json.hbs +0 -26
  252. package/dist/emitter/site-templates/server-main-http.ts.hbs +0 -108
  253. package/dist/emitter/site-templates/server-main.ts.hbs +0 -23
  254. package/dist/emitter/site-templates/tool-handler-action.ts.hbs +0 -86
  255. package/dist/emitter/site-templates/tool-handler-form.ts.hbs +0 -116
  256. package/dist/emitter/site-templates/tool-handler-lifecycle.ts.hbs +0 -146
  257. package/dist/emitter/site-templates/tool-index.ts.hbs +0 -11
  258. package/dist/emitter/template-loader.d.ts +0 -1
  259. package/dist/emitter/template-loader.js +0 -27
  260. package/dist/emitter/templates/auth-provider.ts.hbs +0 -57
  261. package/dist/emitter/templates/config.ts.hbs +0 -63
  262. package/dist/emitter/templates/discovery.ts.hbs +0 -301
  263. package/dist/emitter/templates/dockerfile.hbs +0 -34
  264. package/dist/emitter/templates/env.example.hbs +0 -28
  265. package/dist/emitter/templates/gitignore.hbs +0 -5
  266. package/dist/emitter/templates/http-executor.ts.hbs +0 -117
  267. package/dist/emitter/templates/oauth.ts.hbs +0 -188
  268. package/dist/emitter/templates/package.json.hbs +0 -25
  269. package/dist/emitter/templates/prompts.ts.hbs +0 -22
  270. package/dist/emitter/templates/readme.md.hbs +0 -123
  271. package/dist/emitter/templates/resources.ts.hbs +0 -63
  272. package/dist/emitter/templates/server-main-http.ts.hbs +0 -407
  273. package/dist/emitter/templates/server-main.ts.hbs +0 -40
  274. package/dist/emitter/templates/task-handlers.ts.hbs +0 -189
  275. package/dist/emitter/templates/task-manager.ts.hbs +0 -139
  276. package/dist/emitter/templates/task-sse.ts.hbs +0 -105
  277. package/dist/emitter/templates/tool-handler.ts.hbs +0 -124
  278. package/dist/emitter/templates/tool-index.ts.hbs +0 -11
  279. package/dist/emitter/templates/tool-test.ts.hbs +0 -57
  280. package/dist/emitter/templates/trace.ts.hbs +0 -79
  281. package/dist/emitter/templates/tsconfig.json.hbs +0 -16
  282. package/dist/emitter/templates/types.ts.hbs +0 -5
  283. package/dist/emitter/worker-template-loader.d.ts +0 -5
  284. package/dist/emitter/worker-template-loader.js +0 -33
  285. package/dist/emitter/worker-templates/config.ts.hbs +0 -54
  286. package/dist/emitter/worker-templates/dev-vars.example.hbs +0 -10
  287. package/dist/emitter/worker-templates/gitignore.hbs +0 -6
  288. package/dist/emitter/worker-templates/package.json.hbs +0 -24
  289. package/dist/emitter/worker-templates/readme.md.hbs +0 -53
  290. package/dist/emitter/worker-templates/server.test.ts.hbs +0 -20
  291. package/dist/emitter/worker-templates/tool-handler.ts.hbs +0 -85
  292. package/dist/emitter/worker-templates/tool-index.ts.hbs +0 -28
  293. package/dist/emitter/worker-templates/tsconfig.json.hbs +0 -17
  294. package/dist/emitter/worker-templates/worker.ts.hbs +0 -242
  295. package/dist/emitter/worker-templates/wrangler.toml.hbs +0 -19
  296. package/dist/generator/spec-generator.d.ts +0 -6
  297. package/dist/generator/spec-generator.js +0 -50
  298. package/dist/parser/har-filter.d.ts +0 -8
  299. package/dist/parser/har-filter.js +0 -71
  300. package/dist/parser/har-loader.d.ts +0 -2
  301. package/dist/parser/har-loader.js +0 -14
  302. package/dist/parser/har-normalizer.d.ts +0 -20
  303. package/dist/parser/har-normalizer.js +0 -78
  304. package/dist/parser/index.d.ts +0 -10
  305. package/dist/parser/index.js +0 -6
  306. package/dist/parser/openapi-loader.d.ts +0 -6
  307. package/dist/parser/openapi-loader.js +0 -308
  308. package/dist/parser/operation-extractor.d.ts +0 -13
  309. package/dist/parser/operation-extractor.js +0 -155
  310. package/dist/parser/overlay-loader.d.ts +0 -10
  311. package/dist/parser/overlay-loader.js +0 -184
  312. package/dist/parser/postman-loader.d.ts +0 -9
  313. package/dist/parser/postman-loader.js +0 -106
  314. package/dist/parser/schema-converter.d.ts +0 -12
  315. package/dist/parser/schema-converter.js +0 -117
  316. package/dist/plugins/adapter.d.ts +0 -40
  317. package/dist/plugins/adapter.js +0 -15
  318. package/dist/plugins/loader.d.ts +0 -25
  319. package/dist/plugins/loader.js +0 -58
  320. package/dist/pricing.d.ts +0 -55
  321. package/dist/pricing.js +0 -133
  322. package/dist/providers/index.d.ts +0 -15
  323. package/dist/providers/index.js +0 -56
  324. package/dist/recorder/browser-recorder.d.ts +0 -22
  325. package/dist/recorder/browser-recorder.js +0 -205
  326. package/dist/rescan/diff-engine.d.ts +0 -5
  327. package/dist/rescan/diff-engine.js +0 -312
  328. package/dist/rescan/index.d.ts +0 -3
  329. package/dist/rescan/index.js +0 -2
  330. package/dist/rescan/rescan-runner.d.ts +0 -42
  331. package/dist/rescan/rescan-runner.js +0 -69
  332. package/dist/rescan/rescan-scheduler.d.ts +0 -41
  333. package/dist/rescan/rescan-scheduler.js +0 -179
  334. package/dist/site-transformer/browser-tools.d.ts +0 -10
  335. package/dist/site-transformer/browser-tools.js +0 -59
  336. package/dist/site-transformer/index.d.ts +0 -2
  337. package/dist/site-transformer/index.js +0 -2
  338. package/dist/site-transformer/selector-healer.d.ts +0 -8
  339. package/dist/site-transformer/selector-healer.js +0 -106
  340. package/dist/site-transformer/tool-generator.d.ts +0 -13
  341. package/dist/site-transformer/tool-generator.js +0 -245
  342. package/dist/transformer/auth-detector.d.ts +0 -13
  343. package/dist/transformer/auth-detector.js +0 -90
  344. package/dist/transformer/catalog-builder.d.ts +0 -18
  345. package/dist/transformer/catalog-builder.js +0 -56
  346. package/dist/transformer/client-compat.d.ts +0 -6
  347. package/dist/transformer/client-compat.js +0 -44
  348. package/dist/transformer/har-clusterer.d.ts +0 -9
  349. package/dist/transformer/har-clusterer.js +0 -27
  350. package/dist/transformer/har-dedup.d.ts +0 -10
  351. package/dist/transformer/har-dedup.js +0 -81
  352. package/dist/transformer/har-schema-inferrer.d.ts +0 -15
  353. package/dist/transformer/har-schema-inferrer.js +0 -90
  354. package/dist/transformer/har-to-operations.d.ts +0 -13
  355. package/dist/transformer/har-to-operations.js +0 -192
  356. package/dist/transformer/index.d.ts +0 -8
  357. package/dist/transformer/index.js +0 -6
  358. package/dist/transformer/llm-namer.d.ts +0 -6
  359. package/dist/transformer/llm-namer.js +0 -59
  360. package/dist/transformer/naming.d.ts +0 -4
  361. package/dist/transformer/naming.js +0 -30
  362. package/dist/transformer/operation-filter.d.ts +0 -13
  363. package/dist/transformer/operation-filter.js +0 -52
  364. package/dist/transformer/resource-builder.d.ts +0 -12
  365. package/dist/transformer/resource-builder.js +0 -80
  366. package/dist/transformer/schema-merger.d.ts +0 -14
  367. package/dist/transformer/schema-merger.js +0 -65
  368. package/dist/transformer/tool-builder.d.ts +0 -3
  369. package/dist/transformer/tool-builder.js +0 -114
  370. package/dist/types/index.d.ts +0 -131
  371. package/dist/types/index.js +0 -1
  372. package/dist/types/site.d.ts +0 -284
  373. package/dist/types/site.js +0 -8
  374. package/dist/utils/fail.d.ts +0 -48
  375. package/dist/utils/fail.js +0 -204
  376. package/dist/utils/fs.d.ts +0 -5
  377. package/dist/utils/fs.js +0 -28
  378. package/dist/utils/interactive.d.ts +0 -6
  379. package/dist/utils/interactive.js +0 -30
  380. package/dist/utils/logger.d.ts +0 -1
  381. package/dist/utils/logger.js +0 -2
  382. package/dist/utils/sanitize.d.ts +0 -28
  383. package/dist/utils/sanitize.js +0 -44
  384. package/dist/utils/watcher.d.ts +0 -11
  385. package/dist/utils/watcher.js +0 -36
@@ -1,284 +0,0 @@
1
- /**
2
- * Type definitions for the Website-to-MCP pipeline.
3
- *
4
- * These types represent DOM-based interactions (forms, buttons, links)
5
- * rather than HTTP API calls. They form a parallel pipeline to the
6
- * existing OperationDescriptor/ToolDefinition types in index.ts.
7
- */
8
- import type { EnvVarDescriptor, TransportMode } from './index.js';
9
- export type SelectorStrategy = 'data-testid' | 'id' | 'aria-label' | 'name' | 'role' | 'css-path' | 'xpath';
10
- export interface SelectorSet {
11
- /** Best available selector string */
12
- primary: string;
13
- /** Ordered fallback selectors */
14
- fallbacks: string[];
15
- /** Strategy used for the primary selector */
16
- strategy: SelectorStrategy;
17
- /** 0-1 confidence score for selector stability */
18
- confidence: number;
19
- /** LLM-inferred human-readable label, e.g. "Login button" */
20
- humanLabel?: string;
21
- }
22
- export type FormFieldType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'select' | 'checkbox' | 'radio' | 'textarea' | 'hidden' | 'file' | 'date' | 'datetime-local' | 'color' | 'range' | 'other';
23
- export interface FormFieldDescriptor {
24
- /** Form field name attribute */
25
- name: string;
26
- /** Input type */
27
- fieldType: FormFieldType;
28
- /** Selector set for this field */
29
- selector: SelectorSet;
30
- /** Associated <label> text or aria-label */
31
- label?: string;
32
- /** Placeholder text */
33
- placeholder?: string;
34
- /** Whether the field is required */
35
- required: boolean;
36
- /** Options for <select>, radio groups, and datalists */
37
- options?: string[];
38
- /** Default or current value */
39
- defaultValue?: string;
40
- }
41
- export interface FormDescriptor {
42
- /** Generated stable ID for this form */
43
- formId: string;
44
- /** Form action URL (if present) */
45
- action?: string;
46
- /** Form method */
47
- method: 'get' | 'post';
48
- /** Selector set for the <form> element */
49
- selector: SelectorSet;
50
- /** Fields within the form */
51
- fields: FormFieldDescriptor[];
52
- /** Submit button selector */
53
- submitButton?: SelectorSet;
54
- /** LLM-inferred semantic name, e.g. "login_form", "search_form" */
55
- semanticName?: string;
56
- /** LLM-inferred description of what this form does */
57
- description?: string;
58
- }
59
- export interface ButtonDescriptor {
60
- /** Generated stable ID */
61
- buttonId: string;
62
- /** Selector set for the button element */
63
- selector: SelectorSet;
64
- /** Visible button text */
65
- text?: string;
66
- /** aria-label value */
67
- ariaLabel?: string;
68
- /** LLM-inferred action, e.g. "add_to_cart", "submit_order" */
69
- semanticAction?: string;
70
- /** LLM-inferred description */
71
- description?: string;
72
- /** Button type */
73
- type: 'submit' | 'button' | 'link' | 'other';
74
- /** href for link-style buttons */
75
- href?: string;
76
- }
77
- export interface LinkDescriptor {
78
- /** Generated stable ID */
79
- linkId: string;
80
- /** Selector set for the <a> element */
81
- selector: SelectorSet;
82
- /** Visible link text */
83
- text?: string;
84
- /** Link destination */
85
- href: string;
86
- /** Whether this link navigates to a new page (vs anchor/JS action) */
87
- isNavigation: boolean;
88
- /** LLM-inferred semantic action */
89
- semanticAction?: string;
90
- }
91
- export interface PageDescriptor {
92
- /** Generated stable ID */
93
- pageId: string;
94
- /** Canonical URL of the page */
95
- url: string;
96
- /** URL pattern for parameterized pages (e.g. /products/:id) */
97
- urlPattern?: string;
98
- /** Page title from <title> or first <h1> */
99
- title?: string;
100
- /** LLM-inferred semantic name, e.g. "login_page", "search_results" */
101
- semanticName?: string;
102
- /** LLM-inferred description */
103
- description?: string;
104
- /** Forms discovered on this page */
105
- forms: FormDescriptor[];
106
- /** Standalone buttons (not inside forms) */
107
- buttons: ButtonDescriptor[];
108
- /** Links discovered on this page */
109
- links: LinkDescriptor[];
110
- /** SHA-256 hash of the analysis screenshot */
111
- screenshotHash?: string;
112
- /** ISO timestamp of when this page was analyzed */
113
- analyzedAt: string;
114
- }
115
- export type AuthFlowType = 'form-login' | 'oauth-redirect' | 'basic-auth' | 'cookie-session' | 'unknown';
116
- export interface AuthFlowDescriptor {
117
- /** Detected auth mechanism */
118
- type: AuthFlowType;
119
- /** The page containing the login form */
120
- loginPage?: PageDescriptor;
121
- /** The login form descriptor */
122
- loginForm?: FormDescriptor;
123
- /** Selector for the username/email field */
124
- usernameField?: SelectorSet;
125
- /** Selector for the password field */
126
- passwordField?: SelectorSet;
127
- /** Selector for the submit/login button */
128
- submitButton?: SelectorSet;
129
- /** How to detect if the user is currently logged in */
130
- sessionIndicator?: {
131
- /** Element present when logged in (e.g. user avatar, logout button) */
132
- selector?: SelectorSet;
133
- /** Cookie name that indicates an active session */
134
- cookie?: string;
135
- /** URL pattern after successful login (e.g. /dashboard) */
136
- urlPattern?: string;
137
- };
138
- }
139
- export interface SiteDescriptor {
140
- /** Unique identifier for this site analysis */
141
- siteId: string;
142
- /** Base URL of the site */
143
- baseUrl: string;
144
- /** All discovered pages */
145
- pages: PageDescriptor[];
146
- /** Detected authentication flow */
147
- authFlow?: AuthFlowDescriptor;
148
- /** ISO timestamp of the analysis */
149
- analyzedAt: string;
150
- /** Version number, incremented on rescan */
151
- version: number;
152
- /** How deep the crawler went */
153
- crawlDepth: number;
154
- /** Site metadata */
155
- metadata: {
156
- title?: string;
157
- description?: string;
158
- favicon?: string;
159
- };
160
- }
161
- export type SiteToolType = 'page-action' | 'element-action' | 'navigation' | 'browser-lifecycle';
162
- export interface SiteToolDefinition {
163
- /** Tool name (kebab-case, MCP-compatible) */
164
- name: string;
165
- /** Human-readable title */
166
- title: string;
167
- /** Tool description */
168
- description: string;
169
- /** Zod schema code for tool input parameters */
170
- inputSchemaCode: string;
171
- /** Output file name */
172
- fileName: string;
173
- /** Generated function name (camelCase) */
174
- functionName: string;
175
- /** What kind of site tool this is */
176
- toolType: SiteToolType;
177
- /** Which page this tool operates on */
178
- pageId?: string;
179
- /** Page URL for navigation */
180
- pageUrl?: string;
181
- /** Form descriptor (for form-based page-action tools) */
182
- form?: FormDescriptor;
183
- /** Button descriptor (for element-action tools) */
184
- button?: ButtonDescriptor;
185
- /** Link descriptor (for navigation tools) */
186
- link?: LinkDescriptor;
187
- /** All selectors this tool depends on */
188
- selectors: SelectorSet[];
189
- /** Whether this tool returns a screenshot alongside text */
190
- returnsScreenshot: boolean;
191
- /** MCP tool annotations */
192
- annotations?: {
193
- readOnlyHint?: boolean;
194
- destructiveHint?: boolean;
195
- idempotentHint?: boolean;
196
- };
197
- }
198
- export interface BrowserConfig {
199
- /** Run browser in headless mode */
200
- headless: boolean;
201
- /** Idle timeout before auto-closing browser (ms) */
202
- idleTimeoutMs: number;
203
- /** Browser viewport dimensions */
204
- viewport: {
205
- width: number;
206
- height: number;
207
- };
208
- /** Custom user agent string */
209
- userAgent?: string;
210
- /** Maximum concurrent browser sessions (default: 10) */
211
- maxSessions?: number;
212
- }
213
- export interface SiteProjectManifest {
214
- /** Server name (kebab-case) */
215
- serverName: string;
216
- /** Server version */
217
- serverVersion: string;
218
- /** Target website base URL */
219
- baseUrl: string;
220
- /** MCP transport mode */
221
- transport: TransportMode;
222
- /** Full site descriptor (embedded in generated project) */
223
- siteDescriptor: SiteDescriptor;
224
- /** Generated tools */
225
- tools: SiteToolDefinition[];
226
- /** Environment variables the generated server needs */
227
- envVars: EnvVarDescriptor[];
228
- /** Playwright browser configuration */
229
- browserConfig: BrowserConfig;
230
- }
231
- /**
232
- * Regeneration metadata written to the generated project root as
233
- * `mcpmake.site.json` so `mcpmake rescan` can rebuild the project from a
234
- * freshly crawled SiteDescriptor without re-specifying the original CLI flags.
235
- * The SiteDescriptor itself lives in `src/site-descriptor.json` and the tools
236
- * are regenerated deterministically, so neither is duplicated here.
237
- */
238
- export interface SiteRegenMetadata {
239
- serverName: string;
240
- serverVersion: string;
241
- transport: TransportMode;
242
- baseUrl: string;
243
- envVars: EnvVarDescriptor[];
244
- browserConfig: BrowserConfig;
245
- }
246
- export type ChangeType = 'added' | 'removed' | 'modified' | 'selector-broken';
247
- export type ElementType = 'page' | 'form' | 'button' | 'link' | 'field';
248
- export interface SiteChangeEntry {
249
- /** What kind of change */
250
- changeType: ChangeType;
251
- /** What kind of element changed */
252
- elementType: ElementType;
253
- /** ID of the element that changed */
254
- elementId: string;
255
- /** Page where the change occurred */
256
- pageId: string;
257
- /** Human-readable description of the change */
258
- description: string;
259
- /** ISO timestamp */
260
- timestamp: string;
261
- /** Previous value (for modified/removed) */
262
- oldValue?: unknown;
263
- /** New value (for added/modified) */
264
- newValue?: unknown;
265
- }
266
- export interface RescanResult {
267
- /** Previous site descriptor version */
268
- previousVersion: number;
269
- /** New version number */
270
- newVersion: number;
271
- /** All changes detected */
272
- changes: SiteChangeEntry[];
273
- /** Selectors that no longer resolve */
274
- brokenSelectors: Array<{
275
- toolName: string;
276
- selector: SelectorSet;
277
- /** New selector if self-healing succeeded */
278
- healedSelector?: SelectorSet;
279
- }>;
280
- /** Updated site descriptor */
281
- newSiteDescriptor: SiteDescriptor;
282
- /** ISO timestamp of the rescan */
283
- timestamp: string;
284
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * Type definitions for the Website-to-MCP pipeline.
3
- *
4
- * These types represent DOM-based interactions (forms, buttons, links)
5
- * rather than HTTP API calls. They form a parallel pipeline to the
6
- * existing OperationDescriptor/ToolDefinition types in index.ts.
7
- */
8
- export {};
@@ -1,48 +0,0 @@
1
- /**
2
- * Centralized failure exit with opt-in, redacted error reporting.
3
- *
4
- * Why a shared helper instead of wrapping citty's `runMain`: the commands don't
5
- * `throw` on user-facing failures — they call `logger.error(...)` and then
6
- * `process.exit(1)` directly. `process.exit()` terminates the event loop
7
- * synchronously and bypasses every `try/catch` (including citty's `runMain`
8
- * handler), so a wrapper around `runMain` would never observe these exits. The
9
- * only reliable place to hook reporting is the failure site itself, so each
10
- * command calls `await fail(...)` where it used to log-and-exit.
11
- *
12
- * Telemetry is strictly opt-in (consent modes `prompt` | `auto` | `off`), never
13
- * blocks or breaks the CLI (timeout + swallowed errors, mirroring
14
- * `fetchPricing`), and auto-degrades to `off` in non-TTY / CI environments so it
15
- * can never hang a pipeline waiting for input.
16
- */
17
- type ConsentMode = 'prompt' | 'auto' | 'off';
18
- /**
19
- * Apply every redaction pass. Run on both errorMessage and stack before use.
20
- *
21
- * Exported (as `redactText`) so the redaction contract can be unit-tested
22
- * directly without invoking `fail()` (which calls `process.exit`).
23
- */
24
- export declare function redactText(input: string): string;
25
- /** Inputs that decide telemetry consent, injectable so the logic is testable. */
26
- export interface TelemetryEnv {
27
- /** The mode read from config (anything else is treated as the `prompt` default). */
28
- configured?: unknown;
29
- /** Whether stdout is an interactive TTY. */
30
- isTTY?: boolean;
31
- /** Whether we are running in CI (truthy `$CI`). */
32
- ci?: boolean;
33
- }
34
- /**
35
- * Pure consent resolver: given the configured mode and the environment, decide
36
- * the effective {@link ConsentMode}.
37
- *
38
- * Auto-degrades to `'off'` whenever there is no interactive TTY or we're in CI —
39
- * otherwise the CLI could hang waiting for input that will never come. Exported
40
- * so this branchy decision can be unit-tested without touching real env/config.
41
- */
42
- export declare function resolveTelemetryMode(env: TelemetryEnv): ConsentMode;
43
- /**
44
- * Log a user-facing failure message, optionally report it (consent permitting),
45
- * then exit with code 1. Never throws; always exits.
46
- */
47
- export declare function fail(message: string, error?: unknown): Promise<never>;
48
- export {};
@@ -1,204 +0,0 @@
1
- /**
2
- * Centralized failure exit with opt-in, redacted error reporting.
3
- *
4
- * Why a shared helper instead of wrapping citty's `runMain`: the commands don't
5
- * `throw` on user-facing failures — they call `logger.error(...)` and then
6
- * `process.exit(1)` directly. `process.exit()` terminates the event loop
7
- * synchronously and bypasses every `try/catch` (including citty's `runMain`
8
- * handler), so a wrapper around `runMain` would never observe these exits. The
9
- * only reliable place to hook reporting is the failure site itself, so each
10
- * command calls `await fail(...)` where it used to log-and-exit.
11
- *
12
- * Telemetry is strictly opt-in (consent modes `prompt` | `auto` | `off`), never
13
- * blocks or breaks the CLI (timeout + swallowed errors, mirroring
14
- * `fetchPricing`), and auto-degrades to `off` in non-TTY / CI environments so it
15
- * can never hang a pipeline waiting for input.
16
- */
17
- import os from 'node:os';
18
- import { consola } from 'consola';
19
- import { logger } from './logger.js';
20
- import { loadConfig, globalConfig } from '../config/mcpmake-config.js';
21
- import { DEFAULT_PRICING_SERVER } from '../pricing.js';
22
- /** Keep in sync with `meta.version` in src/index.ts. */
23
- const CLI_VERSION = '0.1.0';
24
- /** How long to wait for the report POST before giving up (never blocks longer). */
25
- const REPORT_TIMEOUT_MS = 4_000;
26
- /** Server-side caps — fields are truncated to these lengths before sending. */
27
- const CAPS = {
28
- command: 200,
29
- errorMessage: 2000,
30
- stack: 16_000,
31
- cliVersion: 40,
32
- platform: 60,
33
- nodeVersion: 40,
34
- };
35
- // --- Redaction helpers -----------------------------------------------------
36
- /** Replace the user's home directory (and generic /Users|/home/<name>) with `~`. */
37
- function redactHomePaths(input) {
38
- let out = input;
39
- const home = os.homedir();
40
- if (home) {
41
- out = out.split(home).join('~');
42
- }
43
- // Catch home dirs other than the current user's (e.g. paths from logs/CI).
44
- out = out.replace(/\/(?:Users|home)\/[^/\s]+/g, '~');
45
- return out;
46
- }
47
- /** Strip bearer tokens: `Bearer <token>` → `Bearer [redacted]`. */
48
- function redactBearerTokens(input) {
49
- return input.replace(/Bearer\s+\S+/g, 'Bearer [redacted]');
50
- }
51
- /** Strip mcpmake-style tokens (`mf_<hex>`). */
52
- function redactMfTokens(input) {
53
- return input.replace(/mf_[a-f0-9]+/g, 'mf_[redacted]');
54
- }
55
- /** Strip URL query strings (`?foo=bar` → `?[redacted]`) so creds in URLs don't leak. */
56
- function redactQueryStrings(input) {
57
- return input.replace(/\?[^\s'"]+/g, '?[redacted]');
58
- }
59
- /**
60
- * Apply every redaction pass. Run on both errorMessage and stack before use.
61
- *
62
- * Exported (as `redactText`) so the redaction contract can be unit-tested
63
- * directly without invoking `fail()` (which calls `process.exit`).
64
- */
65
- export function redactText(input) {
66
- return redactQueryStrings(redactMfTokens(redactBearerTokens(redactHomePaths(input))));
67
- }
68
- /** @deprecated internal alias — prefer the exported `redactText`. */
69
- const redact = redactText;
70
- function truncate(input, max) {
71
- return input.length > max ? input.slice(0, max) : input;
72
- }
73
- // --- Payload assembly ------------------------------------------------------
74
- /**
75
- * Best-effort command name from argv, e.g. `from openapi` or `deploy`. Joins the
76
- * first one or two non-flag tokens (subcommands like `from openapi` need two).
77
- */
78
- function deriveCommand() {
79
- const tokens = process.argv.slice(2).filter((t) => !t.startsWith('-'));
80
- return tokens.slice(0, 2).join(' ');
81
- }
82
- function buildPayload(message, error) {
83
- const errorMessage = error instanceof Error && error.message ? error.message : message;
84
- const stack = error instanceof Error && error.stack ? error.stack : '';
85
- return {
86
- // Redact the command too: a positional arg can be a path or URL with creds
87
- // (e.g. a mistyped `mcpmake /Users/me/secret.yaml`).
88
- command: truncate(redact(deriveCommand()), CAPS.command),
89
- errorMessage: truncate(redact(errorMessage), CAPS.errorMessage),
90
- stack: truncate(redact(stack), CAPS.stack),
91
- cliVersion: truncate(CLI_VERSION, CAPS.cliVersion),
92
- platform: truncate(`${process.platform} ${process.arch}`, CAPS.platform),
93
- nodeVersion: truncate(process.version, CAPS.nodeVersion),
94
- };
95
- }
96
- /**
97
- * Pure consent resolver: given the configured mode and the environment, decide
98
- * the effective {@link ConsentMode}.
99
- *
100
- * Auto-degrades to `'off'` whenever there is no interactive TTY or we're in CI —
101
- * otherwise the CLI could hang waiting for input that will never come. Exported
102
- * so this branchy decision can be unit-tested without touching real env/config.
103
- */
104
- export function resolveTelemetryMode(env) {
105
- const value = env.configured;
106
- const mode = value === 'prompt' || value === 'auto' || value === 'off' ? value : 'prompt';
107
- // Critical: never prompt or block when there is no interactive TTY or we're in
108
- // CI — otherwise the CLI hangs waiting for input that will never come.
109
- if (!env.isTTY || env.ci) {
110
- return 'off';
111
- }
112
- return mode;
113
- }
114
- /** Read the `telemetry` global config key; default `prompt`. Then apply env gates. */
115
- function resolveConsent() {
116
- let configured;
117
- try {
118
- const loaded = loadConfig();
119
- if (loaded) {
120
- configured = globalConfig(loaded.data).telemetry;
121
- }
122
- }
123
- catch {
124
- // A malformed config must never block a failure exit — keep the default.
125
- }
126
- return resolveTelemetryMode({
127
- // consola.prompt reads stdin and writes stdout, so require BOTH to be a TTY —
128
- // otherwise a redirected stream could let a prompt appear (or block) wrongly.
129
- configured,
130
- isTTY: Boolean(process.stdout.isTTY) && Boolean(process.stdin.isTTY),
131
- ci: Boolean(process.env.CI),
132
- });
133
- }
134
- // --- Reporting -------------------------------------------------------------
135
- function reportServer() {
136
- return process.env.MCPMAKE_SERVER || DEFAULT_PRICING_SERVER;
137
- }
138
- /** Multi-line preview of exactly what will be sent (already redacted). */
139
- function previewReport(payload) {
140
- logger.info('');
141
- logger.info('Opt-in error report (redacted) — exactly what would be sent:');
142
- logger.info(` command: ${payload.command || '(none)'}`);
143
- logger.info(` errorMessage: ${payload.errorMessage}`);
144
- if (payload.stack) {
145
- logger.info(` stack: ${payload.stack.split('\n')[0]} ...`);
146
- }
147
- logger.info(` cliVersion: ${payload.cliVersion}`);
148
- logger.info(` platform: ${payload.platform}`);
149
- logger.info(` nodeVersion: ${payload.nodeVersion}`);
150
- logger.info('Not sent: no file contents, no environment variables, no secrets.');
151
- logger.info('');
152
- }
153
- /**
154
- * POST the report. Mirrors the AbortController + timeout + swallow-everything
155
- * pattern in `fetchPricing`: this must never throw or block the CLI. The server
156
- * rejects `Content-Encoding`, so we send a plain JSON body.
157
- */
158
- async function sendReport(payload) {
159
- const controller = new AbortController();
160
- const timer = setTimeout(() => controller.abort(), REPORT_TIMEOUT_MS);
161
- try {
162
- const base = reportServer().replace(/\/+$/, '');
163
- await fetch(`${base}/api/telemetry/report`, {
164
- method: 'POST',
165
- headers: { 'Content-Type': 'application/json' },
166
- body: JSON.stringify(payload),
167
- signal: controller.signal,
168
- });
169
- }
170
- catch {
171
- // Reporting is best-effort; a failure here must never affect the CLI.
172
- }
173
- finally {
174
- clearTimeout(timer);
175
- }
176
- }
177
- /**
178
- * Log a user-facing failure message, optionally report it (consent permitting),
179
- * then exit with code 1. Never throws; always exits.
180
- */
181
- export async function fail(message, error) {
182
- logger.error(message);
183
- const consent = resolveConsent();
184
- if (consent !== 'off') {
185
- const payload = buildPayload(message, error);
186
- try {
187
- if (consent === 'prompt') {
188
- previewReport(payload);
189
- const ok = await consola.prompt('Send this report?', { type: 'confirm' });
190
- if (ok === true) {
191
- await sendReport(payload);
192
- }
193
- }
194
- else {
195
- // auto: send silently.
196
- await sendReport(payload);
197
- }
198
- }
199
- catch {
200
- // Prompting/reporting must never get in the way of the exit.
201
- }
202
- }
203
- process.exit(1);
204
- }
@@ -1,5 +0,0 @@
1
- export declare function ensureDir(dir: string): Promise<void>;
2
- export declare function writeFileSafe(filePath: string, content: string, options: {
3
- force: boolean;
4
- }): Promise<boolean>;
5
- export declare function pathExists(filePath: string): Promise<boolean>;
package/dist/utils/fs.js DELETED
@@ -1,28 +0,0 @@
1
- import { mkdir, writeFile, access } from 'node:fs/promises';
2
- import { dirname } from 'node:path';
3
- export async function ensureDir(dir) {
4
- await mkdir(dir, { recursive: true });
5
- }
6
- export async function writeFileSafe(filePath, content, options) {
7
- if (!options.force) {
8
- try {
9
- await access(filePath);
10
- return false; // file exists, skip
11
- }
12
- catch {
13
- // file doesn't exist, proceed
14
- }
15
- }
16
- await ensureDir(dirname(filePath));
17
- await writeFile(filePath, content, 'utf-8');
18
- return true;
19
- }
20
- export async function pathExists(filePath) {
21
- try {
22
- await access(filePath);
23
- return true;
24
- }
25
- catch {
26
- return false;
27
- }
28
- }
@@ -1,6 +0,0 @@
1
- import type { OperationDescriptor } from '../types/index.js';
2
- /**
3
- * Show detected operations and let user confirm, skip, or rename before generation.
4
- * Returns the filtered/modified list of operations to proceed with.
5
- */
6
- export declare function confirmOperations(operations: OperationDescriptor[]): Promise<OperationDescriptor[]>;
@@ -1,30 +0,0 @@
1
- import { createInterface } from 'node:readline';
2
- import { logger } from './logger.js';
3
- /**
4
- * Show detected operations and let user confirm, skip, or rename before generation.
5
- * Returns the filtered/modified list of operations to proceed with.
6
- */
7
- export async function confirmOperations(operations) {
8
- const rl = createInterface({ input: process.stdin, output: process.stderr });
9
- const ask = (question) => new Promise((resolve) => rl.question(question, resolve));
10
- logger.info('');
11
- logger.info(`Detected ${operations.length} operations:`);
12
- logger.info('');
13
- for (let i = 0; i < operations.length; i++) {
14
- const op = operations[i];
15
- logger.info(` ${i + 1}. [${op.method.toUpperCase()}] ${op.path} → ${op.operationId}` +
16
- (op.summary ? ` — ${op.summary}` : ''));
17
- }
18
- logger.info('');
19
- const answer = await ask('Enter numbers to exclude (comma-separated), or press Enter to keep all: ');
20
- rl.close();
21
- if (!answer.trim())
22
- return operations;
23
- const excludeIndices = new Set(answer
24
- .split(',')
25
- .map((s) => parseInt(s.trim(), 10) - 1)
26
- .filter((n) => !isNaN(n) && n >= 0 && n < operations.length));
27
- const result = operations.filter((_, i) => !excludeIndices.has(i));
28
- logger.info(`Proceeding with ${result.length} operations (excluded ${excludeIndices.size})`);
29
- return result;
30
- }
@@ -1 +0,0 @@
1
- export declare const logger: import("consola").ConsolaInstance;
@@ -1,2 +0,0 @@
1
- import { consola } from 'consola';
2
- export const logger = consola.withTag('mcpmake');
@@ -1,28 +0,0 @@
1
- /**
2
- * Sanitize a string for safe embedding in a JavaScript/TypeScript single-quoted string literal.
3
- * Escapes backslashes, single quotes, and newlines.
4
- */
5
- export declare function escapeStringLiteral(str: string): string;
6
- /**
7
- * Sanitize a string for safe embedding in a JavaScript/TypeScript template literal.
8
- * Escapes backticks, ${} expressions, and backslashes.
9
- */
10
- export declare function escapeTemplateLiteral(str: string): string;
11
- /**
12
- * Validate that an identifier (operationId, param name) contains only safe characters.
13
- * Strips anything that isn't alphanumeric, underscore, or hyphen.
14
- */
15
- export declare function sanitizeIdentifier(str: string): string;
16
- /**
17
- * Validate that a URL path template contains only safe characters.
18
- * Allows: alphanumeric, /, {, }, -, _, .
19
- */
20
- export declare function sanitizePathTemplate(str: string): string;
21
- /**
22
- * Sanitize a file name — strip path separators and traversal sequences.
23
- */
24
- export declare function sanitizeFileName(str: string): string;
25
- /**
26
- * Check if a key is a dangerous prototype pollution key.
27
- */
28
- export declare function isDangerousKey(key: string): boolean;