keq 2.8.13 → 2.9.0

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 (842) hide show
  1. package/.claude/settings.local.json +26 -0
  2. package/CHANGELOG.md +14 -0
  3. package/dist/esm/src/create-request.js +2 -0
  4. package/dist/esm/src/middlewares/mutex-flow-control-middleware.d.ts +2 -0
  5. package/dist/esm/src/middlewares/mutex-flow-control-middleware.js +22 -0
  6. package/dist/esm/src/types/keq-flow-control.d.ts +1 -1
  7. package/dist/esm/src/types/keq-global.d.ts +1 -0
  8. package/dist/esm/src/util/create-response-proxy.js +2 -2
  9. package/dist/esm/src/util/fork.js +3 -3
  10. package/dist/umd/src/create-request.js +3 -1
  11. package/dist/umd/src/middlewares/mutex-flow-control-middleware.d.ts +2 -0
  12. package/dist/umd/src/middlewares/mutex-flow-control-middleware.js +36 -0
  13. package/dist/umd/src/types/keq-flow-control.d.ts +1 -1
  14. package/dist/umd/src/types/keq-global.d.ts +1 -0
  15. package/dist/umd/src/util/create-response-proxy.js +2 -2
  16. package/dist/umd/src/util/fork.js +3 -3
  17. package/package.json +1 -1
  18. package/packages/cache/.turbo/turbo-build.log +26 -16
  19. package/packages/cache/dist/index.d.mts +354 -0
  20. package/packages/cache/dist/index.d.mts.map +1 -0
  21. package/packages/cache/dist/index.d.ts +352 -5
  22. package/packages/cache/dist/index.d.ts.map +1 -1
  23. package/packages/cache/dist/index.js +1211 -1256
  24. package/packages/cache/dist/index.js.map +1 -1
  25. package/packages/cache/dist/index.mjs +1183 -1231
  26. package/packages/cache/dist/index.mjs.map +1 -1
  27. package/packages/cli/.turbo/turbo-build.log +88 -24
  28. package/packages/cli/dist/cli.cjs +1333 -2891
  29. package/packages/cli/dist/cli.cjs.map +1 -1
  30. package/packages/cli/dist/cli.d.cts +1 -0
  31. package/packages/cli/dist/cli.d.mts +1 -0
  32. package/packages/cli/dist/cli.mjs +1359 -0
  33. package/packages/cli/dist/cli.mjs.map +1 -0
  34. package/packages/cli/dist/compiler-0Kli6UCr.cjs +738 -0
  35. package/packages/cli/dist/compiler-0Kli6UCr.cjs.map +1 -0
  36. package/packages/cli/dist/compiler-C3AE8j54.mjs +715 -0
  37. package/packages/cli/dist/compiler-C3AE8j54.mjs.map +1 -0
  38. package/packages/cli/dist/index.cjs +18 -2853
  39. package/packages/cli/dist/index.cjs.map +1 -1
  40. package/packages/cli/dist/index.d.cts +17 -0
  41. package/packages/cli/dist/index.d.cts.map +1 -0
  42. package/packages/cli/dist/index.d.mts +17 -0
  43. package/packages/cli/dist/index.d.mts.map +1 -0
  44. package/packages/cli/dist/index.mjs +10 -0
  45. package/packages/cli/dist/index.mjs.map +1 -0
  46. package/packages/cli/dist/init-BNhD2oCI.mjs +168 -0
  47. package/packages/cli/dist/init-BNhD2oCI.mjs.map +1 -0
  48. package/packages/cli/dist/init-DqxLcRSQ.cjs +170 -0
  49. package/packages/cli/dist/init-DqxLcRSQ.cjs.map +1 -0
  50. package/packages/cli/dist/logger-D7PyVZo3.cjs +46 -0
  51. package/packages/cli/dist/logger-D7PyVZo3.cjs.map +1 -0
  52. package/packages/cli/dist/logger-QLBHySQ3.mjs +12 -0
  53. package/packages/cli/dist/logger-QLBHySQ3.mjs.map +1 -0
  54. package/packages/cli/dist/micro-function.translator-BmJZzkKh.cjs +16 -0
  55. package/packages/cli/dist/micro-function.translator-BmJZzkKh.cjs.map +1 -0
  56. package/packages/cli/dist/micro-function.translator-CDfkj4Tt.mjs +11 -0
  57. package/packages/cli/dist/micro-function.translator-CDfkj4Tt.mjs.map +1 -0
  58. package/packages/cli/dist/mock-command-Bp1LxSls.mjs +350 -0
  59. package/packages/cli/dist/mock-command-Bp1LxSls.mjs.map +1 -0
  60. package/packages/cli/dist/mock-command-WZcfy5Iq.cjs +353 -0
  61. package/packages/cli/dist/mock-command-WZcfy5Iq.cjs.map +1 -0
  62. package/packages/cli/dist/plugins-CgMhaNZq.cjs +3558 -0
  63. package/packages/cli/dist/plugins-CgMhaNZq.cjs.map +1 -0
  64. package/packages/cli/dist/plugins-DCvJ8iHR.mjs +3280 -0
  65. package/packages/cli/dist/plugins-DCvJ8iHR.mjs.map +1 -0
  66. package/packages/cli/dist/plugins.cjs +36 -2425
  67. package/packages/cli/dist/plugins.d.cts +2 -0
  68. package/packages/cli/dist/plugins.d.mts +2 -0
  69. package/packages/cli/dist/plugins.mjs +2 -0
  70. package/packages/cli/dist/runtime-config-BWQlPhiB.d.cts +780 -0
  71. package/packages/cli/dist/runtime-config-BWQlPhiB.d.cts.map +1 -0
  72. package/packages/cli/dist/runtime-config-CrzK-Ucf.d.mts +780 -0
  73. package/packages/cli/dist/runtime-config-CrzK-Ucf.d.mts.map +1 -0
  74. package/packages/cli/dist/translators.cjs +14 -0
  75. package/packages/cli/dist/translators.cjs.map +1 -0
  76. package/packages/cli/dist/translators.d.cts +14 -0
  77. package/packages/cli/dist/translators.d.cts.map +1 -0
  78. package/packages/cli/dist/translators.d.mts +14 -0
  79. package/packages/cli/dist/translators.d.mts.map +1 -0
  80. package/packages/cli/dist/translators.mjs +12 -0
  81. package/packages/cli/dist/translators.mjs.map +1 -0
  82. package/packages/cli/node_modules/.bin/eslint +2 -2
  83. package/packages/cli/node_modules/.bin/jiti +2 -2
  84. package/packages/cli/node_modules/.bin/js-yaml +2 -2
  85. package/packages/cli/node_modules/.bin/jsf +21 -0
  86. package/packages/cli/node_modules/.bin/jsonpath +2 -2
  87. package/packages/cli/node_modules/.bin/jsonpath-plus +2 -2
  88. package/packages/cli/node_modules/.bin/semver +2 -2
  89. package/packages/cli/node_modules/.bin/tsc +4 -4
  90. package/packages/cli/node_modules/.bin/tsserver +4 -4
  91. package/packages/exception/.turbo/turbo-build.log +26 -31
  92. package/packages/exception/dist/index.d.mts +21 -0
  93. package/packages/exception/dist/index.d.mts.map +1 -0
  94. package/packages/exception/dist/index.d.ts +21 -0
  95. package/packages/exception/dist/index.d.ts.map +1 -0
  96. package/packages/exception/dist/index.js +97 -105
  97. package/packages/exception/dist/index.js.map +1 -1
  98. package/packages/exception/dist/index.mjs +92 -104
  99. package/packages/exception/dist/index.mjs.map +1 -1
  100. package/packages/headers/.turbo/turbo-build.log +26 -16
  101. package/packages/headers/dist/index.d.mts +46 -0
  102. package/packages/headers/dist/index.d.mts.map +1 -0
  103. package/packages/headers/dist/index.d.ts +46 -0
  104. package/packages/headers/dist/index.d.ts.map +1 -0
  105. package/packages/headers/dist/index.js +68 -64
  106. package/packages/headers/dist/index.js.map +1 -1
  107. package/packages/headers/dist/index.mjs +62 -43
  108. package/packages/headers/dist/index.mjs.map +1 -1
  109. package/packages/keq/.turbo/turbo-build.log +26 -16
  110. package/packages/keq/dist/index.d.mts +962 -0
  111. package/packages/keq/dist/index.d.mts.map +1 -0
  112. package/packages/keq/dist/index.d.ts +961 -7
  113. package/packages/keq/dist/index.d.ts.map +1 -1
  114. package/packages/keq/dist/index.js +1727 -1830
  115. package/packages/keq/dist/index.js.map +1 -1
  116. package/packages/keq/dist/index.mjs +1671 -1805
  117. package/packages/keq/dist/index.mjs.map +1 -1
  118. package/packages/nestjs/.turbo/turbo-build.log +26 -16
  119. package/packages/nestjs/dist/index.d.mts +52 -0
  120. package/packages/nestjs/dist/index.d.mts.map +1 -0
  121. package/packages/nestjs/dist/index.d.ts +51 -2
  122. package/packages/nestjs/dist/index.d.ts.map +1 -1
  123. package/packages/nestjs/dist/index.js +156 -60
  124. package/packages/nestjs/dist/index.js.map +1 -1
  125. package/packages/nestjs/dist/index.mjs +133 -42
  126. package/packages/nestjs/dist/index.mjs.map +1 -1
  127. package/packages/test/.turbo/turbo-build.log +1 -1
  128. package/packages/url/.turbo/turbo-build.log +26 -16
  129. package/packages/url/dist/index.d.mts +9 -0
  130. package/packages/url/dist/index.d.mts.map +1 -0
  131. package/packages/url/dist/index.d.ts +9 -0
  132. package/packages/url/dist/index.d.ts.map +1 -0
  133. package/packages/url/dist/index.js +36 -60
  134. package/packages/url/dist/index.js.map +1 -1
  135. package/packages/url/dist/index.mjs +33 -39
  136. package/packages/url/dist/index.mjs.map +1 -1
  137. package/packages/cache/dist/cache-entry/cache-entry.d.ts +0 -17
  138. package/packages/cache/dist/cache-entry/cache-entry.d.ts.map +0 -1
  139. package/packages/cache/dist/cache-entry/index.d.ts +0 -4
  140. package/packages/cache/dist/cache-entry/index.d.ts.map +0 -1
  141. package/packages/cache/dist/cache-entry/types/cache-entry-build-options.d.ts +0 -8
  142. package/packages/cache/dist/cache-entry/types/cache-entry-build-options.d.ts.map +0 -1
  143. package/packages/cache/dist/cache-entry/types/cache-entry-options.d.ts +0 -7
  144. package/packages/cache/dist/cache-entry/types/cache-entry-options.d.ts.map +0 -1
  145. package/packages/cache/dist/cache.d.ts +0 -38
  146. package/packages/cache/dist/cache.d.ts.map +0 -1
  147. package/packages/cache/dist/constants/eviction.enum.d.ts +0 -7
  148. package/packages/cache/dist/constants/eviction.enum.d.ts.map +0 -1
  149. package/packages/cache/dist/constants/index.d.ts +0 -5
  150. package/packages/cache/dist/constants/index.d.ts.map +0 -1
  151. package/packages/cache/dist/constants/max-expired-at.d.ts +0 -2
  152. package/packages/cache/dist/constants/max-expired-at.d.ts.map +0 -1
  153. package/packages/cache/dist/constants/size.enum.d.ts +0 -7
  154. package/packages/cache/dist/constants/size.enum.d.ts.map +0 -1
  155. package/packages/cache/dist/constants/strategy.enum.d.ts +0 -7
  156. package/packages/cache/dist/constants/strategy.enum.d.ts.map +0 -1
  157. package/packages/cache/dist/exceptions/cache-exception.d.ts +0 -5
  158. package/packages/cache/dist/exceptions/cache-exception.d.ts.map +0 -1
  159. package/packages/cache/dist/exceptions/index.d.ts +0 -2
  160. package/packages/cache/dist/exceptions/index.d.ts.map +0 -1
  161. package/packages/cache/dist/request-cache-handler/index.d.ts +0 -2
  162. package/packages/cache/dist/request-cache-handler/index.d.ts.map +0 -1
  163. package/packages/cache/dist/request-cache-handler/request-cache-handler.d.ts +0 -23
  164. package/packages/cache/dist/request-cache-handler/request-cache-handler.d.ts.map +0 -1
  165. package/packages/cache/dist/storage/index.d.ts +0 -6
  166. package/packages/cache/dist/storage/index.d.ts.map +0 -1
  167. package/packages/cache/dist/storage/indexed-db-storage/base-indexed-db-storage.d.ts +0 -22
  168. package/packages/cache/dist/storage/indexed-db-storage/base-indexed-db-storage.d.ts.map +0 -1
  169. package/packages/cache/dist/storage/indexed-db-storage/constants/default-table-name.d.ts +0 -2
  170. package/packages/cache/dist/storage/indexed-db-storage/constants/default-table-name.d.ts.map +0 -1
  171. package/packages/cache/dist/storage/indexed-db-storage/index.d.ts +0 -3
  172. package/packages/cache/dist/storage/indexed-db-storage/index.d.ts.map +0 -1
  173. package/packages/cache/dist/storage/indexed-db-storage/indexed-db-storage.d.ts +0 -12
  174. package/packages/cache/dist/storage/indexed-db-storage/indexed-db-storage.d.ts.map +0 -1
  175. package/packages/cache/dist/storage/indexed-db-storage/lfu-indexed-db-storage.d.ts +0 -11
  176. package/packages/cache/dist/storage/indexed-db-storage/lfu-indexed-db-storage.d.ts.map +0 -1
  177. package/packages/cache/dist/storage/indexed-db-storage/lru-indexed-db-storage.d.ts +0 -11
  178. package/packages/cache/dist/storage/indexed-db-storage/lru-indexed-db-storage.d.ts.map +0 -1
  179. package/packages/cache/dist/storage/indexed-db-storage/random-indexed-db-storage.d.ts +0 -11
  180. package/packages/cache/dist/storage/indexed-db-storage/random-indexed-db-storage.d.ts.map +0 -1
  181. package/packages/cache/dist/storage/indexed-db-storage/ttl-indexed-db-storage.d.ts +0 -11
  182. package/packages/cache/dist/storage/indexed-db-storage/ttl-indexed-db-storage.d.ts.map +0 -1
  183. package/packages/cache/dist/storage/indexed-db-storage/types/index.d.ts +0 -7
  184. package/packages/cache/dist/storage/indexed-db-storage/types/index.d.ts.map +0 -1
  185. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-metadata.d.ts +0 -12
  186. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-metadata.d.ts.map +0 -1
  187. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-response.d.ts +0 -8
  188. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-response.d.ts.map +0 -1
  189. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-visits.d.ts +0 -14
  190. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-entry-visits.d.ts.map +0 -1
  191. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-schema.d.ts +0 -29
  192. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-schema.d.ts.map +0 -1
  193. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-options.d.ts +0 -14
  194. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-options.d.ts.map +0 -1
  195. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-size.d.ts +0 -13
  196. package/packages/cache/dist/storage/indexed-db-storage/types/indexed-db-storage-size.d.ts.map +0 -1
  197. package/packages/cache/dist/storage/internal-storage/internal-storage.d.ts +0 -16
  198. package/packages/cache/dist/storage/internal-storage/internal-storage.d.ts.map +0 -1
  199. package/packages/cache/dist/storage/internal-storage/types/events.d.ts +0 -16
  200. package/packages/cache/dist/storage/internal-storage/types/events.d.ts.map +0 -1
  201. package/packages/cache/dist/storage/internal-storage/types/storage-options.d.ts +0 -20
  202. package/packages/cache/dist/storage/internal-storage/types/storage-options.d.ts.map +0 -1
  203. package/packages/cache/dist/storage/keq-cache-storage.d.ts +0 -20
  204. package/packages/cache/dist/storage/keq-cache-storage.d.ts.map +0 -1
  205. package/packages/cache/dist/storage/memory-storage/base-memory-storage.d.ts +0 -31
  206. package/packages/cache/dist/storage/memory-storage/base-memory-storage.d.ts.map +0 -1
  207. package/packages/cache/dist/storage/memory-storage/index.d.ts +0 -3
  208. package/packages/cache/dist/storage/memory-storage/index.d.ts.map +0 -1
  209. package/packages/cache/dist/storage/memory-storage/lfu-memory-storage.d.ts +0 -11
  210. package/packages/cache/dist/storage/memory-storage/lfu-memory-storage.d.ts.map +0 -1
  211. package/packages/cache/dist/storage/memory-storage/lru-memory-storage.d.ts +0 -11
  212. package/packages/cache/dist/storage/memory-storage/lru-memory-storage.d.ts.map +0 -1
  213. package/packages/cache/dist/storage/memory-storage/memory-storage.d.ts +0 -13
  214. package/packages/cache/dist/storage/memory-storage/memory-storage.d.ts.map +0 -1
  215. package/packages/cache/dist/storage/memory-storage/random-memory-storage.d.ts +0 -11
  216. package/packages/cache/dist/storage/memory-storage/random-memory-storage.d.ts.map +0 -1
  217. package/packages/cache/dist/storage/memory-storage/ttl-memory-storage.d.ts +0 -11
  218. package/packages/cache/dist/storage/memory-storage/ttl-memory-storage.d.ts.map +0 -1
  219. package/packages/cache/dist/storage/memory-storage/types/index.d.ts +0 -3
  220. package/packages/cache/dist/storage/memory-storage/types/index.d.ts.map +0 -1
  221. package/packages/cache/dist/storage/memory-storage/types/memory-storage-options.d.ts +0 -9
  222. package/packages/cache/dist/storage/memory-storage/types/memory-storage-options.d.ts.map +0 -1
  223. package/packages/cache/dist/storage/memory-storage/types/memory-storage-size.d.ts +0 -13
  224. package/packages/cache/dist/storage/memory-storage/types/memory-storage-size.d.ts.map +0 -1
  225. package/packages/cache/dist/storage/memory-storage/utils/humanize-size.d.ts +0 -6
  226. package/packages/cache/dist/storage/memory-storage/utils/humanize-size.d.ts.map +0 -1
  227. package/packages/cache/dist/storage/memory-storage/utils/index.d.ts +0 -3
  228. package/packages/cache/dist/storage/memory-storage/utils/index.d.ts.map +0 -1
  229. package/packages/cache/dist/storage/memory-storage/utils/serialize-response-body.d.ts +0 -6
  230. package/packages/cache/dist/storage/memory-storage/utils/serialize-response-body.d.ts.map +0 -1
  231. package/packages/cache/dist/storage/multi-tier-storage/index.d.ts +0 -3
  232. package/packages/cache/dist/storage/multi-tier-storage/index.d.ts.map +0 -1
  233. package/packages/cache/dist/storage/multi-tier-storage/multi-tier-storage.d.ts +0 -36
  234. package/packages/cache/dist/storage/multi-tier-storage/multi-tier-storage.d.ts.map +0 -1
  235. package/packages/cache/dist/storage/multi-tier-storage/types/index.d.ts +0 -2
  236. package/packages/cache/dist/storage/multi-tier-storage/types/index.d.ts.map +0 -1
  237. package/packages/cache/dist/storage/multi-tier-storage/types/multi-tier-storage-options.d.ts +0 -5
  238. package/packages/cache/dist/storage/multi-tier-storage/types/multi-tier-storage-options.d.ts.map +0 -1
  239. package/packages/cache/dist/storage/tier-storage/index.d.ts +0 -3
  240. package/packages/cache/dist/storage/tier-storage/index.d.ts.map +0 -1
  241. package/packages/cache/dist/storage/tier-storage/tier-storage.d.ts +0 -15
  242. package/packages/cache/dist/storage/tier-storage/tier-storage.d.ts.map +0 -1
  243. package/packages/cache/dist/storage/tier-storage/types/index.d.ts +0 -2
  244. package/packages/cache/dist/storage/tier-storage/types/index.d.ts.map +0 -1
  245. package/packages/cache/dist/storage/tier-storage/types/tier-storage-options.d.ts +0 -21
  246. package/packages/cache/dist/storage/tier-storage/types/tier-storage-options.d.ts.map +0 -1
  247. package/packages/cache/dist/strategies/cache-first.d.ts +0 -3
  248. package/packages/cache/dist/strategies/cache-first.d.ts.map +0 -1
  249. package/packages/cache/dist/strategies/index.d.ts +0 -5
  250. package/packages/cache/dist/strategies/index.d.ts.map +0 -1
  251. package/packages/cache/dist/strategies/network-first.d.ts +0 -3
  252. package/packages/cache/dist/strategies/network-first.d.ts.map +0 -1
  253. package/packages/cache/dist/strategies/network-only.d.ts +0 -3
  254. package/packages/cache/dist/strategies/network-only.d.ts.map +0 -1
  255. package/packages/cache/dist/strategies/stale-while-revalidate.d.ts +0 -3
  256. package/packages/cache/dist/strategies/stale-while-revalidate.d.ts.map +0 -1
  257. package/packages/cache/dist/types/index.d.ts +0 -6
  258. package/packages/cache/dist/types/index.d.ts.map +0 -1
  259. package/packages/cache/dist/types/keq-cache-key.d.ts +0 -4
  260. package/packages/cache/dist/types/keq-cache-key.d.ts.map +0 -1
  261. package/packages/cache/dist/types/keq-cache-pattern.d.ts +0 -3
  262. package/packages/cache/dist/types/keq-cache-pattern.d.ts.map +0 -1
  263. package/packages/cache/dist/types/keq-cache-rule.d.ts +0 -6
  264. package/packages/cache/dist/types/keq-cache-rule.d.ts.map +0 -1
  265. package/packages/cache/dist/types/keq-cache-strategy.d.ts +0 -6
  266. package/packages/cache/dist/types/keq-cache-strategy.d.ts.map +0 -1
  267. package/packages/cache/dist/types/request-cache-options.d.ts +0 -34
  268. package/packages/cache/dist/types/request-cache-options.d.ts.map +0 -1
  269. package/packages/cache/dist/utils/get-response-bytes.d.ts +0 -2
  270. package/packages/cache/dist/utils/get-response-bytes.d.ts.map +0 -1
  271. package/packages/cache/dist/utils/index.d.ts +0 -4
  272. package/packages/cache/dist/utils/index.d.ts.map +0 -1
  273. package/packages/cache/dist/utils/logger.d.ts +0 -5
  274. package/packages/cache/dist/utils/logger.d.ts.map +0 -1
  275. package/packages/cache/dist/utils/random.d.ts +0 -2
  276. package/packages/cache/dist/utils/random.d.ts.map +0 -1
  277. package/packages/cli/dist/cli.d.ts +0 -3
  278. package/packages/cli/dist/cli.d.ts.map +0 -1
  279. package/packages/cli/dist/cli.js +0 -2899
  280. package/packages/cli/dist/cli.js.map +0 -1
  281. package/packages/cli/dist/compiler/compiler.d.ts +0 -17
  282. package/packages/cli/dist/compiler/compiler.d.ts.map +0 -1
  283. package/packages/cli/dist/compiler/index.d.ts +0 -4
  284. package/packages/cli/dist/compiler/index.d.ts.map +0 -1
  285. package/packages/cli/dist/compiler/intercepter/index.d.ts +0 -3
  286. package/packages/cli/dist/compiler/intercepter/index.d.ts.map +0 -1
  287. package/packages/cli/dist/compiler/intercepter/perfect-error-message.d.ts +0 -3
  288. package/packages/cli/dist/compiler/intercepter/perfect-error-message.d.ts.map +0 -1
  289. package/packages/cli/dist/compiler/intercepter/print-information.d.ts +0 -5
  290. package/packages/cli/dist/compiler/intercepter/print-information.d.ts.map +0 -1
  291. package/packages/cli/dist/compiler/tasks/compile/index.d.ts +0 -6
  292. package/packages/cli/dist/compiler/tasks/compile/index.d.ts.map +0 -1
  293. package/packages/cli/dist/compiler/tasks/download/index.d.ts +0 -10
  294. package/packages/cli/dist/compiler/tasks/download/index.d.ts.map +0 -1
  295. package/packages/cli/dist/compiler/tasks/index.d.ts +0 -6
  296. package/packages/cli/dist/compiler/tasks/index.d.ts.map +0 -1
  297. package/packages/cli/dist/compiler/tasks/persist/index.d.ts +0 -5
  298. package/packages/cli/dist/compiler/tasks/persist/index.d.ts.map +0 -1
  299. package/packages/cli/dist/compiler/tasks/setup/index.d.ts +0 -15
  300. package/packages/cli/dist/compiler/tasks/setup/index.d.ts.map +0 -1
  301. package/packages/cli/dist/compiler/tasks/setup/utils/find-nearest-package-json.d.ts +0 -6
  302. package/packages/cli/dist/compiler/tasks/setup/utils/find-nearest-package-json.d.ts.map +0 -1
  303. package/packages/cli/dist/compiler/tasks/setup/utils/get-project-module-system.d.ts +0 -5
  304. package/packages/cli/dist/compiler/tasks/setup/utils/get-project-module-system.d.ts.map +0 -1
  305. package/packages/cli/dist/compiler/tasks/setup/utils/index.d.ts +0 -4
  306. package/packages/cli/dist/compiler/tasks/setup/utils/index.d.ts.map +0 -1
  307. package/packages/cli/dist/compiler/tasks/setup/utils/validate-modules.d.ts +0 -2
  308. package/packages/cli/dist/compiler/tasks/setup/utils/validate-modules.d.ts.map +0 -1
  309. package/packages/cli/dist/compiler/tasks/types/base-task-options.d.ts +0 -6
  310. package/packages/cli/dist/compiler/tasks/types/base-task-options.d.ts.map +0 -1
  311. package/packages/cli/dist/compiler/tasks/types/index.d.ts +0 -3
  312. package/packages/cli/dist/compiler/tasks/types/index.d.ts.map +0 -1
  313. package/packages/cli/dist/compiler/tasks/types/task-wrapper.d.ts +0 -4
  314. package/packages/cli/dist/compiler/tasks/types/task-wrapper.d.ts.map +0 -1
  315. package/packages/cli/dist/compiler/types/compiler-context.d.ts +0 -11
  316. package/packages/cli/dist/compiler/types/compiler-context.d.ts.map +0 -1
  317. package/packages/cli/dist/compiler/types/compiler-hooks.d.ts +0 -18
  318. package/packages/cli/dist/compiler/types/compiler-hooks.d.ts.map +0 -1
  319. package/packages/cli/dist/compiler/types/index.d.ts +0 -3
  320. package/packages/cli/dist/compiler/types/index.d.ts.map +0 -1
  321. package/packages/cli/dist/constants/file-naming-style.d.ts +0 -14
  322. package/packages/cli/dist/constants/file-naming-style.d.ts.map +0 -1
  323. package/packages/cli/dist/constants/index.d.ts +0 -4
  324. package/packages/cli/dist/constants/index.d.ts.map +0 -1
  325. package/packages/cli/dist/constants/qs-array-format.d.ts +0 -9
  326. package/packages/cli/dist/constants/qs-array-format.d.ts.map +0 -1
  327. package/packages/cli/dist/constants/supported-methods.d.ts +0 -2
  328. package/packages/cli/dist/constants/supported-methods.d.ts.map +0 -1
  329. package/packages/cli/dist/define-keq-config.d.ts +0 -3
  330. package/packages/cli/dist/define-keq-config.d.ts.map +0 -1
  331. package/packages/cli/dist/exception.d.ts +0 -6
  332. package/packages/cli/dist/exception.d.ts.map +0 -1
  333. package/packages/cli/dist/generators/index.d.ts +0 -2
  334. package/packages/cli/dist/generators/index.d.ts.map +0 -1
  335. package/packages/cli/dist/index.d.ts +0 -6
  336. package/packages/cli/dist/index.d.ts.map +0 -1
  337. package/packages/cli/dist/index.js +0 -2808
  338. package/packages/cli/dist/index.js.map +0 -1
  339. package/packages/cli/dist/models/anchor.d.ts +0 -20
  340. package/packages/cli/dist/models/anchor.d.ts.map +0 -1
  341. package/packages/cli/dist/models/api-document_v3_1.d.ts +0 -16
  342. package/packages/cli/dist/models/api-document_v3_1.d.ts.map +0 -1
  343. package/packages/cli/dist/models/artifact.d.ts +0 -17
  344. package/packages/cli/dist/models/artifact.d.ts.map +0 -1
  345. package/packages/cli/dist/models/asset.d.ts +0 -5
  346. package/packages/cli/dist/models/asset.d.ts.map +0 -1
  347. package/packages/cli/dist/models/index.d.ts +0 -8
  348. package/packages/cli/dist/models/index.d.ts.map +0 -1
  349. package/packages/cli/dist/models/module-definition.d.ts +0 -7
  350. package/packages/cli/dist/models/module-definition.d.ts.map +0 -1
  351. package/packages/cli/dist/models/operation-definition.d.ts +0 -23
  352. package/packages/cli/dist/models/operation-definition.d.ts.map +0 -1
  353. package/packages/cli/dist/models/schema-definition.d.ts +0 -20
  354. package/packages/cli/dist/models/schema-definition.d.ts.map +0 -1
  355. package/packages/cli/dist/models/utils/to-comment.d.ts +0 -2
  356. package/packages/cli/dist/models/utils/to-comment.d.ts.map +0 -1
  357. package/packages/cli/dist/plugins/body-fallback/index.d.ts +0 -6
  358. package/packages/cli/dist/plugins/body-fallback/index.d.ts.map +0 -1
  359. package/packages/cli/dist/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.d.ts +0 -5
  360. package/packages/cli/dist/plugins/chinese-to-pinyin/chinese-to-pinyin.plugin.d.ts.map +0 -1
  361. package/packages/cli/dist/plugins/chinese-to-pinyin/index.d.ts +0 -2
  362. package/packages/cli/dist/plugins/chinese-to-pinyin/index.d.ts.map +0 -1
  363. package/packages/cli/dist/plugins/download-http-file/download-http-file.plugin.d.ts +0 -8
  364. package/packages/cli/dist/plugins/download-http-file/download-http-file.plugin.d.ts.map +0 -1
  365. package/packages/cli/dist/plugins/download-http-file/index.d.ts +0 -2
  366. package/packages/cli/dist/plugins/download-http-file/index.d.ts.map +0 -1
  367. package/packages/cli/dist/plugins/download-local-file/download-local-file.plugin.d.ts +0 -6
  368. package/packages/cli/dist/plugins/download-local-file/download-local-file.plugin.d.ts.map +0 -1
  369. package/packages/cli/dist/plugins/download-local-file/index.d.ts +0 -2
  370. package/packages/cli/dist/plugins/download-local-file/index.d.ts.map +0 -1
  371. package/packages/cli/dist/plugins/eslint/index.d.ts +0 -15
  372. package/packages/cli/dist/plugins/eslint/index.d.ts.map +0 -1
  373. package/packages/cli/dist/plugins/generate-declaration/constants/index.d.ts +0 -2
  374. package/packages/cli/dist/plugins/generate-declaration/constants/index.d.ts.map +0 -1
  375. package/packages/cli/dist/plugins/generate-declaration/constants/metadata-storage.d.ts +0 -12
  376. package/packages/cli/dist/plugins/generate-declaration/constants/metadata-storage.d.ts.map +0 -1
  377. package/packages/cli/dist/plugins/generate-declaration/generate-declaration.plugin.d.ts +0 -15
  378. package/packages/cli/dist/plugins/generate-declaration/generate-declaration.plugin.d.ts.map +0 -1
  379. package/packages/cli/dist/plugins/generate-declaration/generators/index.d.ts +0 -3
  380. package/packages/cli/dist/plugins/generate-declaration/generators/index.d.ts.map +0 -1
  381. package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/index.d.ts +0 -2
  382. package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/index.d.ts.map +0 -1
  383. package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/operation.generator.d.ts +0 -15
  384. package/packages/cli/dist/plugins/generate-declaration/generators/operation-declaration/operation.generator.d.ts.map +0 -1
  385. package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/index.d.ts +0 -2
  386. package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/index.d.ts.map +0 -1
  387. package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/schema.generator.d.ts +0 -15
  388. package/packages/cli/dist/plugins/generate-declaration/generators/schema-declaration/schema.generator.d.ts.map +0 -1
  389. package/packages/cli/dist/plugins/generate-declaration/index.d.ts +0 -3
  390. package/packages/cli/dist/plugins/generate-declaration/index.d.ts.map +0 -1
  391. package/packages/cli/dist/plugins/generate-micro-function/constants/index.d.ts +0 -2
  392. package/packages/cli/dist/plugins/generate-micro-function/constants/index.d.ts.map +0 -1
  393. package/packages/cli/dist/plugins/generate-micro-function/constants/metadata-storage.d.ts +0 -11
  394. package/packages/cli/dist/plugins/generate-micro-function/constants/metadata-storage.d.ts.map +0 -1
  395. package/packages/cli/dist/plugins/generate-micro-function/generate-micro-function.plugin.d.ts +0 -11
  396. package/packages/cli/dist/plugins/generate-micro-function/generate-micro-function.plugin.d.ts.map +0 -1
  397. package/packages/cli/dist/plugins/generate-micro-function/generators/index.d.ts +0 -3
  398. package/packages/cli/dist/plugins/generate-micro-function/generators/index.d.ts.map +0 -1
  399. package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/index.d.ts +0 -2
  400. package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/index.d.ts.map +0 -1
  401. package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/micro-function.generator.d.ts +0 -15
  402. package/packages/cli/dist/plugins/generate-micro-function/generators/micro_function/micro-function.generator.d.ts.map +0 -1
  403. package/packages/cli/dist/plugins/generate-micro-function/generators/request/index.d.ts +0 -2
  404. package/packages/cli/dist/plugins/generate-micro-function/generators/request/index.d.ts.map +0 -1
  405. package/packages/cli/dist/plugins/generate-micro-function/generators/request/request.generator.d.ts +0 -11
  406. package/packages/cli/dist/plugins/generate-micro-function/generators/request/request.generator.d.ts.map +0 -1
  407. package/packages/cli/dist/plugins/generate-micro-function/index.d.ts +0 -3
  408. package/packages/cli/dist/plugins/generate-micro-function/index.d.ts.map +0 -1
  409. package/packages/cli/dist/plugins/generate-nestjs-module/constants/index.d.ts +0 -2
  410. package/packages/cli/dist/plugins/generate-nestjs-module/constants/index.d.ts.map +0 -1
  411. package/packages/cli/dist/plugins/generate-nestjs-module/constants/metadata-storage.d.ts +0 -10
  412. package/packages/cli/dist/plugins/generate-nestjs-module/constants/metadata-storage.d.ts.map +0 -1
  413. package/packages/cli/dist/plugins/generate-nestjs-module/generate-nestjs-module.d.ts +0 -10
  414. package/packages/cli/dist/plugins/generate-nestjs-module/generate-nestjs-module.d.ts.map +0 -1
  415. package/packages/cli/dist/plugins/generate-nestjs-module/generators/index.d.ts +0 -2
  416. package/packages/cli/dist/plugins/generate-nestjs-module/generators/index.d.ts.map +0 -1
  417. package/packages/cli/dist/plugins/generate-nestjs-module/generators/nestjs-module.generator.d.ts +0 -14
  418. package/packages/cli/dist/plugins/generate-nestjs-module/generators/nestjs-module.generator.d.ts.map +0 -1
  419. package/packages/cli/dist/plugins/generate-nestjs-module/index.d.ts +0 -3
  420. package/packages/cli/dist/plugins/generate-nestjs-module/index.d.ts.map +0 -1
  421. package/packages/cli/dist/plugins/index.d.ts +0 -15
  422. package/packages/cli/dist/plugins/index.d.ts.map +0 -1
  423. package/packages/cli/dist/plugins/initialize/index.d.ts +0 -2
  424. package/packages/cli/dist/plugins/initialize/index.d.ts.map +0 -1
  425. package/packages/cli/dist/plugins/initialize/initialize.plugin.d.ts +0 -15
  426. package/packages/cli/dist/plugins/initialize/initialize.plugin.d.ts.map +0 -1
  427. package/packages/cli/dist/plugins/overwrite-operation-id/index.d.ts +0 -2
  428. package/packages/cli/dist/plugins/overwrite-operation-id/index.d.ts.map +0 -1
  429. package/packages/cli/dist/plugins/overwrite-operation-id/overwrite-operation-id.plugin.d.ts +0 -20
  430. package/packages/cli/dist/plugins/overwrite-operation-id/overwrite-operation-id.plugin.d.ts.map +0 -1
  431. package/packages/cli/dist/plugins/overwrite-query-options/index.d.ts +0 -2
  432. package/packages/cli/dist/plugins/overwrite-query-options/index.d.ts.map +0 -1
  433. package/packages/cli/dist/plugins/overwrite-query-options/overwrite-query-options.plugin.d.ts +0 -18
  434. package/packages/cli/dist/plugins/overwrite-query-options/overwrite-query-options.plugin.d.ts.map +0 -1
  435. package/packages/cli/dist/plugins/prettier/index.d.ts +0 -2
  436. package/packages/cli/dist/plugins/prettier/index.d.ts.map +0 -1
  437. package/packages/cli/dist/plugins/prettier/prettier.plugin.d.ts +0 -6
  438. package/packages/cli/dist/plugins/prettier/prettier.plugin.d.ts.map +0 -1
  439. package/packages/cli/dist/plugins/shaking/index.d.ts +0 -2
  440. package/packages/cli/dist/plugins/shaking/index.d.ts.map +0 -1
  441. package/packages/cli/dist/plugins/shaking/shaking.plugin.d.ts +0 -8
  442. package/packages/cli/dist/plugins/shaking/shaking.plugin.d.ts.map +0 -1
  443. package/packages/cli/dist/plugins/terminal-select/index.d.ts +0 -2
  444. package/packages/cli/dist/plugins/terminal-select/index.d.ts.map +0 -1
  445. package/packages/cli/dist/plugins/terminal-select/terminal-select.plugin.d.ts +0 -18
  446. package/packages/cli/dist/plugins/terminal-select/terminal-select.plugin.d.ts.map +0 -1
  447. package/packages/cli/dist/plugins/terminal-select/types/ignore-mode.d.ts +0 -2
  448. package/packages/cli/dist/plugins/terminal-select/types/ignore-mode.d.ts.map +0 -1
  449. package/packages/cli/dist/plugins/terminal-select/types/index.d.ts +0 -2
  450. package/packages/cli/dist/plugins/terminal-select/types/index.d.ts.map +0 -1
  451. package/packages/cli/dist/plugins/terminal-select/utils/index.d.ts +0 -2
  452. package/packages/cli/dist/plugins/terminal-select/utils/index.d.ts.map +0 -1
  453. package/packages/cli/dist/plugins/terminal-select/utils/select-operation-definitions.d.ts +0 -5
  454. package/packages/cli/dist/plugins/terminal-select/utils/select-operation-definitions.d.ts.map +0 -1
  455. package/packages/cli/dist/plugins.cjs.map +0 -1
  456. package/packages/cli/dist/plugins.js +0 -2365
  457. package/packages/cli/dist/plugins.js.map +0 -1
  458. package/packages/cli/dist/transformers/api-document/api-document.transformer.d.ts +0 -8
  459. package/packages/cli/dist/transformers/api-document/api-document.transformer.d.ts.map +0 -1
  460. package/packages/cli/dist/transformers/api-document/index.d.ts +0 -2
  461. package/packages/cli/dist/transformers/api-document/index.d.ts.map +0 -1
  462. package/packages/cli/dist/transformers/api-document/nestjs-client.renderer.d.ts +0 -14
  463. package/packages/cli/dist/transformers/api-document/nestjs-client.renderer.d.ts.map +0 -1
  464. package/packages/cli/dist/transformers/api-document/nestjs-module.renderer.d.ts +0 -12
  465. package/packages/cli/dist/transformers/api-document/nestjs-module.renderer.d.ts.map +0 -1
  466. package/packages/cli/dist/transformers/entrypoint/entrypoint.transformer.d.ts +0 -10
  467. package/packages/cli/dist/transformers/entrypoint/entrypoint.transformer.d.ts.map +0 -1
  468. package/packages/cli/dist/transformers/entrypoint/index.d.ts +0 -2
  469. package/packages/cli/dist/transformers/entrypoint/index.d.ts.map +0 -1
  470. package/packages/cli/dist/transformers/index.d.ts +0 -6
  471. package/packages/cli/dist/transformers/index.d.ts.map +0 -1
  472. package/packages/cli/dist/transformers/json-schema/comment.renderer.d.ts +0 -8
  473. package/packages/cli/dist/transformers/json-schema/comment.renderer.d.ts.map +0 -1
  474. package/packages/cli/dist/transformers/json-schema/declaration.renderer.d.ts +0 -26
  475. package/packages/cli/dist/transformers/json-schema/declaration.renderer.d.ts.map +0 -1
  476. package/packages/cli/dist/transformers/json-schema/index.d.ts +0 -4
  477. package/packages/cli/dist/transformers/json-schema/index.d.ts.map +0 -1
  478. package/packages/cli/dist/transformers/json-schema/json-schema.transformer.d.ts +0 -7
  479. package/packages/cli/dist/transformers/json-schema/json-schema.transformer.d.ts.map +0 -1
  480. package/packages/cli/dist/transformers/json-schema/reference.transformer.d.ts +0 -5
  481. package/packages/cli/dist/transformers/json-schema/reference.transformer.d.ts.map +0 -1
  482. package/packages/cli/dist/transformers/json-schema/types/any-other-attribute.d.ts +0 -5
  483. package/packages/cli/dist/transformers/json-schema/types/any-other-attribute.d.ts.map +0 -1
  484. package/packages/cli/dist/transformers/json-schema/types/index.d.ts +0 -3
  485. package/packages/cli/dist/transformers/json-schema/types/index.d.ts.map +0 -1
  486. package/packages/cli/dist/transformers/json-schema/types/mixed-schema-object.d.ts +0 -7
  487. package/packages/cli/dist/transformers/json-schema/types/mixed-schema-object.d.ts.map +0 -1
  488. package/packages/cli/dist/transformers/operation-definition/comment.renderer.d.ts +0 -8
  489. package/packages/cli/dist/transformers/operation-definition/comment.renderer.d.ts.map +0 -1
  490. package/packages/cli/dist/transformers/operation-definition/declaration.renderer.d.ts +0 -20
  491. package/packages/cli/dist/transformers/operation-definition/declaration.renderer.d.ts.map +0 -1
  492. package/packages/cli/dist/transformers/operation-definition/index.d.ts +0 -3
  493. package/packages/cli/dist/transformers/operation-definition/index.d.ts.map +0 -1
  494. package/packages/cli/dist/transformers/operation-definition/micro-function.renderer.d.ts +0 -19
  495. package/packages/cli/dist/transformers/operation-definition/micro-function.renderer.d.ts.map +0 -1
  496. package/packages/cli/dist/transformers/operation-definition/nestjs-method.renderer.d.ts +0 -15
  497. package/packages/cli/dist/transformers/operation-definition/nestjs-method.renderer.d.ts.map +0 -1
  498. package/packages/cli/dist/transformers/operation-definition/operation-definition.transformer.d.ts +0 -11
  499. package/packages/cli/dist/transformers/operation-definition/operation-definition.transformer.d.ts.map +0 -1
  500. package/packages/cli/dist/transformers/operation-definition/typescript-snippet.d.ts +0 -22
  501. package/packages/cli/dist/transformers/operation-definition/typescript-snippet.d.ts.map +0 -1
  502. package/packages/cli/dist/transformers/operation-definition/utils/index.d.ts +0 -2
  503. package/packages/cli/dist/transformers/operation-definition/utils/index.d.ts.map +0 -1
  504. package/packages/cli/dist/transformers/operation-definition/utils/type-name-factory.d.ts +0 -4
  505. package/packages/cli/dist/transformers/operation-definition/utils/type-name-factory.d.ts.map +0 -1
  506. package/packages/cli/dist/transformers/schema-definition/index.d.ts +0 -2
  507. package/packages/cli/dist/transformers/schema-definition/index.d.ts.map +0 -1
  508. package/packages/cli/dist/transformers/schema-definition/schema-definition.transformer.d.ts +0 -10
  509. package/packages/cli/dist/transformers/schema-definition/schema-definition.transformer.d.ts.map +0 -1
  510. package/packages/cli/dist/transformers/types/renderer.d.ts +0 -4
  511. package/packages/cli/dist/transformers/types/renderer.d.ts.map +0 -1
  512. package/packages/cli/dist/types/build-cli-options.d.ts +0 -19
  513. package/packages/cli/dist/types/build-cli-options.d.ts.map +0 -1
  514. package/packages/cli/dist/types/generator.d.ts +0 -7
  515. package/packages/cli/dist/types/generator.d.ts.map +0 -1
  516. package/packages/cli/dist/types/index.d.ts +0 -6
  517. package/packages/cli/dist/types/index.d.ts.map +0 -1
  518. package/packages/cli/dist/types/plugin.d.ts +0 -5
  519. package/packages/cli/dist/types/plugin.d.ts.map +0 -1
  520. package/packages/cli/dist/types/runtime-config.d.ts +0 -32
  521. package/packages/cli/dist/types/runtime-config.d.ts.map +0 -1
  522. package/packages/cli/dist/types/to-code-options.d.ts +0 -4
  523. package/packages/cli/dist/types/to-code-options.d.ts.map +0 -1
  524. package/packages/cli/dist/utils/debugger.d.ts +0 -7
  525. package/packages/cli/dist/utils/debugger.d.ts.map +0 -1
  526. package/packages/cli/dist/utils/ignore-matcher.d.ts +0 -18
  527. package/packages/cli/dist/utils/ignore-matcher.d.ts.map +0 -1
  528. package/packages/cli/dist/utils/indent.d.ts +0 -2
  529. package/packages/cli/dist/utils/indent.d.ts.map +0 -1
  530. package/packages/cli/dist/utils/is-keywords.d.ts +0 -2
  531. package/packages/cli/dist/utils/is-keywords.d.ts.map +0 -1
  532. package/packages/cli/dist/utils/is-reserved-word.d.ts +0 -2
  533. package/packages/cli/dist/utils/is-reserved-word.d.ts.map +0 -1
  534. package/packages/cli/dist/utils/json-schema-utils/index.d.ts +0 -11
  535. package/packages/cli/dist/utils/json-schema-utils/index.d.ts.map +0 -1
  536. package/packages/cli/dist/utils/json-schema-utils/is-array.d.ts +0 -3
  537. package/packages/cli/dist/utils/json-schema-utils/is-array.d.ts.map +0 -1
  538. package/packages/cli/dist/utils/json-schema-utils/is-mixed.d.ts +0 -4
  539. package/packages/cli/dist/utils/json-schema-utils/is-mixed.d.ts.map +0 -1
  540. package/packages/cli/dist/utils/json-schema-utils/is-non-array.d.ts +0 -3
  541. package/packages/cli/dist/utils/json-schema-utils/is-non-array.d.ts.map +0 -1
  542. package/packages/cli/dist/utils/json-schema-utils/is-ref.d.ts +0 -3
  543. package/packages/cli/dist/utils/json-schema-utils/is-ref.d.ts.map +0 -1
  544. package/packages/cli/dist/utils/json-schema-utils/types/any-other-attribute.d.ts +0 -5
  545. package/packages/cli/dist/utils/json-schema-utils/types/any-other-attribute.d.ts.map +0 -1
  546. package/packages/cli/dist/utils/json-schema-utils/types/mixed-schema-object.d.ts +0 -7
  547. package/packages/cli/dist/utils/json-schema-utils/types/mixed-schema-object.d.ts.map +0 -1
  548. package/packages/cli/dist/utils/logger.d.ts +0 -6
  549. package/packages/cli/dist/utils/logger.d.ts.map +0 -1
  550. package/packages/cli/dist/utils/openapi-utils/dereference-deep.d.ts +0 -3
  551. package/packages/cli/dist/utils/openapi-utils/dereference-deep.d.ts.map +0 -1
  552. package/packages/cli/dist/utils/openapi-utils/dereference-operation.d.ts +0 -4
  553. package/packages/cli/dist/utils/openapi-utils/dereference-operation.d.ts.map +0 -1
  554. package/packages/cli/dist/utils/openapi-utils/dereference.d.ts +0 -3
  555. package/packages/cli/dist/utils/openapi-utils/dereference.d.ts.map +0 -1
  556. package/packages/cli/dist/utils/openapi-utils/index.d.ts +0 -19
  557. package/packages/cli/dist/utils/openapi-utils/index.d.ts.map +0 -1
  558. package/packages/cli/dist/utils/openapi-utils/is-ref-defined.d.ts +0 -3
  559. package/packages/cli/dist/utils/openapi-utils/is-ref-defined.d.ts.map +0 -1
  560. package/packages/cli/dist/utils/openapi-utils/map-operation.d.ts +0 -4
  561. package/packages/cli/dist/utils/openapi-utils/map-operation.d.ts.map +0 -1
  562. package/packages/cli/dist/utils/openapi-utils/map-parameter.d.ts +0 -4
  563. package/packages/cli/dist/utils/openapi-utils/map-parameter.d.ts.map +0 -1
  564. package/packages/cli/dist/utils/openapi-utils/remove-undefined-ref.d.ts +0 -3
  565. package/packages/cli/dist/utils/openapi-utils/remove-undefined-ref.d.ts.map +0 -1
  566. package/packages/cli/dist/utils/openapi-utils/to-3_1.d.ts +0 -3
  567. package/packages/cli/dist/utils/openapi-utils/to-3_1.d.ts.map +0 -1
  568. package/packages/exception/dist/plugins/index.d.mts +0 -12
  569. package/packages/exception/dist/plugins/index.d.ts +0 -12
  570. package/packages/exception/dist/plugins/index.js +0 -95
  571. package/packages/exception/dist/plugins/index.mjs +0 -68
  572. package/packages/exception/node_modules/.bin/keq +0 -21
  573. package/packages/keq/dist/context/execution-context.d.ts +0 -26
  574. package/packages/keq/dist/context/execution-context.d.ts.map +0 -1
  575. package/packages/keq/dist/context/index.d.ts +0 -5
  576. package/packages/keq/dist/context/index.d.ts.map +0 -1
  577. package/packages/keq/dist/context/middleware-context.d.ts +0 -11
  578. package/packages/keq/dist/context/middleware-context.d.ts.map +0 -1
  579. package/packages/keq/dist/context/orchestrator-context.d.ts +0 -18
  580. package/packages/keq/dist/context/orchestrator-context.d.ts.map +0 -1
  581. package/packages/keq/dist/context/shared-context.d.ts +0 -43
  582. package/packages/keq/dist/context/shared-context.d.ts.map +0 -1
  583. package/packages/keq/dist/context/types/index.d.ts +0 -6
  584. package/packages/keq/dist/context/types/index.d.ts.map +0 -1
  585. package/packages/keq/dist/context/types/keq-context-data.d.ts +0 -7
  586. package/packages/keq/dist/context/types/keq-context-data.d.ts.map +0 -1
  587. package/packages/keq/dist/context/types/keq-context-emitter.d.ts +0 -35
  588. package/packages/keq/dist/context/types/keq-context-emitter.d.ts.map +0 -1
  589. package/packages/keq/dist/context/types/keq-context-options/index.d.ts +0 -6
  590. package/packages/keq/dist/context/types/keq-context-options/index.d.ts.map +0 -1
  591. package/packages/keq/dist/context/types/keq-context-options/keq-context-options.d.ts +0 -5
  592. package/packages/keq/dist/context/types/keq-context-options/keq-context-options.d.ts.map +0 -1
  593. package/packages/keq/dist/context/types/keq-context-options/keq-middleware-options.d.ts +0 -33
  594. package/packages/keq/dist/context/types/keq-context-options/keq-middleware-options.d.ts.map +0 -1
  595. package/packages/keq/dist/context/types/keq-context-options/keq-module-options.d.ts +0 -5
  596. package/packages/keq/dist/context/types/keq-context-options/keq-module-options.d.ts.map +0 -1
  597. package/packages/keq/dist/context/types/keq-context-options/keq-resolve-with-mode.d.ts +0 -2
  598. package/packages/keq/dist/context/types/keq-context-options/keq-resolve-with-mode.d.ts.map +0 -1
  599. package/packages/keq/dist/context/types/keq-context-options/keq-retry-options.d.ts +0 -9
  600. package/packages/keq/dist/context/types/keq-context-options/keq-retry-options.d.ts.map +0 -1
  601. package/packages/keq/dist/context/types/keq-context.d.ts +0 -17
  602. package/packages/keq/dist/context/types/keq-context.d.ts.map +0 -1
  603. package/packages/keq/dist/context/types/keq-global.d.ts +0 -7
  604. package/packages/keq/dist/context/types/keq-global.d.ts.map +0 -1
  605. package/packages/keq/dist/context/utils/assign-shared-context.d.ts +0 -3
  606. package/packages/keq/dist/context/utils/assign-shared-context.d.ts.map +0 -1
  607. package/packages/keq/dist/context/utils/clone-shared-context.d.ts +0 -3
  608. package/packages/keq/dist/context/utils/clone-shared-context.d.ts.map +0 -1
  609. package/packages/keq/dist/context/utils/create-proxy-response.d.ts +0 -2
  610. package/packages/keq/dist/context/utils/create-proxy-response.d.ts.map +0 -1
  611. package/packages/keq/dist/context/utils/fork.d.ts +0 -6
  612. package/packages/keq/dist/context/utils/fork.d.ts.map +0 -1
  613. package/packages/keq/dist/context/utils/index.d.ts +0 -5
  614. package/packages/keq/dist/context/utils/index.d.ts.map +0 -1
  615. package/packages/keq/dist/context/utils/watch-object.d.ts +0 -5
  616. package/packages/keq/dist/context/utils/watch-object.d.ts.map +0 -1
  617. package/packages/keq/dist/exception/abort.exception.d.ts +0 -4
  618. package/packages/keq/dist/exception/abort.exception.d.ts.map +0 -1
  619. package/packages/keq/dist/exception/exception.d.ts +0 -5
  620. package/packages/keq/dist/exception/exception.d.ts.map +0 -1
  621. package/packages/keq/dist/exception/http-exceptions/bad-gateway.exception.d.ts +0 -5
  622. package/packages/keq/dist/exception/http-exceptions/bad-gateway.exception.d.ts.map +0 -1
  623. package/packages/keq/dist/exception/http-exceptions/bad-request.exception.d.ts +0 -5
  624. package/packages/keq/dist/exception/http-exceptions/bad-request.exception.d.ts.map +0 -1
  625. package/packages/keq/dist/exception/http-exceptions/conflict.exception.d.ts +0 -5
  626. package/packages/keq/dist/exception/http-exceptions/conflict.exception.d.ts.map +0 -1
  627. package/packages/keq/dist/exception/http-exceptions/content-too-large.exception.d.ts +0 -5
  628. package/packages/keq/dist/exception/http-exceptions/content-too-large.exception.d.ts.map +0 -1
  629. package/packages/keq/dist/exception/http-exceptions/forbidden.exception.d.ts +0 -5
  630. package/packages/keq/dist/exception/http-exceptions/forbidden.exception.d.ts.map +0 -1
  631. package/packages/keq/dist/exception/http-exceptions/gateway-timeout.exception.d.ts +0 -5
  632. package/packages/keq/dist/exception/http-exceptions/gateway-timeout.exception.d.ts.map +0 -1
  633. package/packages/keq/dist/exception/http-exceptions/http-version-not-supported.exception.d.ts +0 -5
  634. package/packages/keq/dist/exception/http-exceptions/http-version-not-supported.exception.d.ts.map +0 -1
  635. package/packages/keq/dist/exception/http-exceptions/im-a-teapot.exception.d.ts +0 -5
  636. package/packages/keq/dist/exception/http-exceptions/im-a-teapot.exception.d.ts.map +0 -1
  637. package/packages/keq/dist/exception/http-exceptions/index.d.ts +0 -22
  638. package/packages/keq/dist/exception/http-exceptions/index.d.ts.map +0 -1
  639. package/packages/keq/dist/exception/http-exceptions/internal-server-error.exception.d.ts +0 -5
  640. package/packages/keq/dist/exception/http-exceptions/internal-server-error.exception.d.ts.map +0 -1
  641. package/packages/keq/dist/exception/http-exceptions/method-not-allowed.exception.d.ts +0 -5
  642. package/packages/keq/dist/exception/http-exceptions/method-not-allowed.exception.d.ts.map +0 -1
  643. package/packages/keq/dist/exception/http-exceptions/not-acceptable.exception.d.ts +0 -5
  644. package/packages/keq/dist/exception/http-exceptions/not-acceptable.exception.d.ts.map +0 -1
  645. package/packages/keq/dist/exception/http-exceptions/not-founded.exception.d.ts +0 -5
  646. package/packages/keq/dist/exception/http-exceptions/not-founded.exception.d.ts.map +0 -1
  647. package/packages/keq/dist/exception/http-exceptions/not-implemented.exception.d.ts +0 -5
  648. package/packages/keq/dist/exception/http-exceptions/not-implemented.exception.d.ts.map +0 -1
  649. package/packages/keq/dist/exception/http-exceptions/precondition-failed.exception.d.ts +0 -5
  650. package/packages/keq/dist/exception/http-exceptions/precondition-failed.exception.d.ts.map +0 -1
  651. package/packages/keq/dist/exception/http-exceptions/proxy-authentication-required.exception.d.ts +0 -5
  652. package/packages/keq/dist/exception/http-exceptions/proxy-authentication-required.exception.d.ts.map +0 -1
  653. package/packages/keq/dist/exception/http-exceptions/request-timeout.exception.d.ts +0 -5
  654. package/packages/keq/dist/exception/http-exceptions/request-timeout.exception.d.ts.map +0 -1
  655. package/packages/keq/dist/exception/http-exceptions/request.exception.d.ts +0 -12
  656. package/packages/keq/dist/exception/http-exceptions/request.exception.d.ts.map +0 -1
  657. package/packages/keq/dist/exception/http-exceptions/service-unavailable.exception.d.ts +0 -5
  658. package/packages/keq/dist/exception/http-exceptions/service-unavailable.exception.d.ts.map +0 -1
  659. package/packages/keq/dist/exception/http-exceptions/too-many-requests.exception.d.ts +0 -5
  660. package/packages/keq/dist/exception/http-exceptions/too-many-requests.exception.d.ts.map +0 -1
  661. package/packages/keq/dist/exception/http-exceptions/unauthorized.exception.d.ts +0 -5
  662. package/packages/keq/dist/exception/http-exceptions/unauthorized.exception.d.ts.map +0 -1
  663. package/packages/keq/dist/exception/http-exceptions/unsupported-media-type.exception.d.ts +0 -5
  664. package/packages/keq/dist/exception/http-exceptions/unsupported-media-type.exception.d.ts.map +0 -1
  665. package/packages/keq/dist/exception/http-exceptions/uri-too-long.exception.d.ts +0 -5
  666. package/packages/keq/dist/exception/http-exceptions/uri-too-long.exception.d.ts.map +0 -1
  667. package/packages/keq/dist/exception/index.d.ts +0 -6
  668. package/packages/keq/dist/exception/index.d.ts.map +0 -1
  669. package/packages/keq/dist/exception/timeout.exception.d.ts +0 -5
  670. package/packages/keq/dist/exception/timeout.exception.d.ts.map +0 -1
  671. package/packages/keq/dist/exception/type.exception.d.ts +0 -5
  672. package/packages/keq/dist/exception/type.exception.d.ts.map +0 -1
  673. package/packages/keq/dist/middleware/index.d.ts +0 -3
  674. package/packages/keq/dist/middleware/index.d.ts.map +0 -1
  675. package/packages/keq/dist/middleware/types/index.d.ts +0 -3
  676. package/packages/keq/dist/middleware/types/index.d.ts.map +0 -1
  677. package/packages/keq/dist/middleware/types/keq-middleware.d.ts +0 -8
  678. package/packages/keq/dist/middleware/types/keq-middleware.d.ts.map +0 -1
  679. package/packages/keq/dist/middleware/types/keq-next.d.ts +0 -2
  680. package/packages/keq/dist/middleware/types/keq-next.d.ts.map +0 -1
  681. package/packages/keq/dist/middleware/utils/compose-middleware.d.ts +0 -7
  682. package/packages/keq/dist/middleware/utils/compose-middleware.d.ts.map +0 -1
  683. package/packages/keq/dist/middleware/utils/get-middleware-name.d.ts +0 -3
  684. package/packages/keq/dist/middleware/utils/get-middleware-name.d.ts.map +0 -1
  685. package/packages/keq/dist/middleware/utils/index.d.ts +0 -3
  686. package/packages/keq/dist/middleware/utils/index.d.ts.map +0 -1
  687. package/packages/keq/dist/middlewares/fetch-middleware/index.d.ts +0 -6
  688. package/packages/keq/dist/middlewares/fetch-middleware/index.d.ts.map +0 -1
  689. package/packages/keq/dist/middlewares/flow-control-middleware/abort-flow-control-middleware.d.ts +0 -3
  690. package/packages/keq/dist/middlewares/flow-control-middleware/abort-flow-control-middleware.d.ts.map +0 -1
  691. package/packages/keq/dist/middlewares/flow-control-middleware/index.d.ts +0 -4
  692. package/packages/keq/dist/middlewares/flow-control-middleware/index.d.ts.map +0 -1
  693. package/packages/keq/dist/middlewares/flow-control-middleware/serial-flow-control-middleware.d.ts +0 -3
  694. package/packages/keq/dist/middlewares/flow-control-middleware/serial-flow-control-middleware.d.ts.map +0 -1
  695. package/packages/keq/dist/middlewares/flow-control-middleware/types/keq-flow-control.d.ts +0 -9
  696. package/packages/keq/dist/middlewares/flow-control-middleware/types/keq-flow-control.d.ts.map +0 -1
  697. package/packages/keq/dist/middlewares/index.d.ts +0 -4
  698. package/packages/keq/dist/middlewares/index.d.ts.map +0 -1
  699. package/packages/keq/dist/middlewares/timeout-middleware/index.d.ts +0 -6
  700. package/packages/keq/dist/middlewares/timeout-middleware/index.d.ts.map +0 -1
  701. package/packages/keq/dist/orchestrator/executor.d.ts +0 -13
  702. package/packages/keq/dist/orchestrator/executor.d.ts.map +0 -1
  703. package/packages/keq/dist/orchestrator/index.d.ts +0 -3
  704. package/packages/keq/dist/orchestrator/index.d.ts.map +0 -1
  705. package/packages/keq/dist/orchestrator/orchestrator.d.ts +0 -20
  706. package/packages/keq/dist/orchestrator/orchestrator.d.ts.map +0 -1
  707. package/packages/keq/dist/request/core.d.ts +0 -54
  708. package/packages/keq/dist/request/core.d.ts.map +0 -1
  709. package/packages/keq/dist/request/create-request.d.ts +0 -7
  710. package/packages/keq/dist/request/create-request.d.ts.map +0 -1
  711. package/packages/keq/dist/request/index.d.ts +0 -6
  712. package/packages/keq/dist/request/index.d.ts.map +0 -1
  713. package/packages/keq/dist/request/keq.d.ts +0 -120
  714. package/packages/keq/dist/request/keq.d.ts.map +0 -1
  715. package/packages/keq/dist/request/request.d.ts +0 -79
  716. package/packages/keq/dist/request/request.d.ts.map +0 -1
  717. package/packages/keq/dist/request/types/api-schema/api-schema-select.d.ts +0 -42
  718. package/packages/keq/dist/request/types/api-schema/api-schema-select.d.ts.map +0 -1
  719. package/packages/keq/dist/request/types/api-schema/api-schema.d.ts +0 -8
  720. package/packages/keq/dist/request/types/api-schema/api-schema.d.ts.map +0 -1
  721. package/packages/keq/dist/request/types/api-schema/default-operation.d.ts +0 -18
  722. package/packages/keq/dist/request/types/api-schema/default-operation.d.ts.map +0 -1
  723. package/packages/keq/dist/request/types/api-schema/extract-method-operations.d.ts +0 -31
  724. package/packages/keq/dist/request/types/api-schema/extract-method-operations.d.ts.map +0 -1
  725. package/packages/keq/dist/request/types/api-schema/index.d.ts +0 -6
  726. package/packages/keq/dist/request/types/api-schema/index.d.ts.map +0 -1
  727. package/packages/keq/dist/request/types/api-schema/operation.d.ts +0 -17
  728. package/packages/keq/dist/request/types/api-schema/operation.d.ts.map +0 -1
  729. package/packages/keq/dist/request/types/content-type.d.ts +0 -3
  730. package/packages/keq/dist/request/types/content-type.d.ts.map +0 -1
  731. package/packages/keq/dist/request/types/index.d.ts +0 -8
  732. package/packages/keq/dist/request/types/index.d.ts.map +0 -1
  733. package/packages/keq/dist/request/types/keq-attachable-file.d.ts +0 -2
  734. package/packages/keq/dist/request/types/keq-attachable-file.d.ts.map +0 -1
  735. package/packages/keq/dist/request/types/keq-param-value.d.ts +0 -3
  736. package/packages/keq/dist/request/types/keq-param-value.d.ts.map +0 -1
  737. package/packages/keq/dist/request/types/keq-query-options.d.ts +0 -7
  738. package/packages/keq/dist/request/types/keq-query-options.d.ts.map +0 -1
  739. package/packages/keq/dist/request/types/keq-query-value.d.ts +0 -8
  740. package/packages/keq/dist/request/types/keq-query-value.d.ts.map +0 -1
  741. package/packages/keq/dist/request/types/server-sent-event.d.ts +0 -3
  742. package/packages/keq/dist/request/types/server-sent-event.d.ts.map +0 -1
  743. package/packages/keq/dist/request/utils/fix-content-type.d.ts +0 -4
  744. package/packages/keq/dist/request/utils/fix-content-type.d.ts.map +0 -1
  745. package/packages/keq/dist/request/utils/get-location-id.d.ts +0 -2
  746. package/packages/keq/dist/request/utils/get-location-id.d.ts.map +0 -1
  747. package/packages/keq/dist/request/utils/index.d.ts +0 -7
  748. package/packages/keq/dist/request/utils/index.d.ts.map +0 -1
  749. package/packages/keq/dist/request/utils/intelligent-parse-response.d.ts +0 -2
  750. package/packages/keq/dist/request/utils/intelligent-parse-response.d.ts.map +0 -1
  751. package/packages/keq/dist/request/utils/merge-keq-request-body.d.ts +0 -3
  752. package/packages/keq/dist/request/utils/merge-keq-request-body.d.ts.map +0 -1
  753. package/packages/keq/dist/request/utils/query-stringify.d.ts +0 -3
  754. package/packages/keq/dist/request/utils/query-stringify.d.ts.map +0 -1
  755. package/packages/keq/dist/request/utils/resolve-with.d.ts +0 -3
  756. package/packages/keq/dist/request/utils/resolve-with.d.ts.map +0 -1
  757. package/packages/keq/dist/request-init/index.d.ts +0 -4
  758. package/packages/keq/dist/request-init/index.d.ts.map +0 -1
  759. package/packages/keq/dist/request-init/request-init.d.ts +0 -42
  760. package/packages/keq/dist/request-init/request-init.d.ts.map +0 -1
  761. package/packages/keq/dist/request-init/types/index.d.ts +0 -3
  762. package/packages/keq/dist/request-init/types/index.d.ts.map +0 -1
  763. package/packages/keq/dist/request-init/types/keq-body-init.d.ts +0 -2
  764. package/packages/keq/dist/request-init/types/keq-body-init.d.ts.map +0 -1
  765. package/packages/keq/dist/request-init/types/keq-request-method.d.ts +0 -2
  766. package/packages/keq/dist/request-init/types/keq-request-method.d.ts.map +0 -1
  767. package/packages/keq/dist/request-init/utils/assign-request-init.d.ts +0 -3
  768. package/packages/keq/dist/request-init/utils/assign-request-init.d.ts.map +0 -1
  769. package/packages/keq/dist/request-init/utils/clone-body.d.ts +0 -2
  770. package/packages/keq/dist/request-init/utils/clone-body.d.ts.map +0 -1
  771. package/packages/keq/dist/request-init/utils/clone-headers.d.ts +0 -2
  772. package/packages/keq/dist/request-init/utils/clone-headers.d.ts.map +0 -1
  773. package/packages/keq/dist/request-init/utils/clone-request-init.d.ts +0 -3
  774. package/packages/keq/dist/request-init/utils/clone-request-init.d.ts.map +0 -1
  775. package/packages/keq/dist/request-init/utils/compile-url.d.ts +0 -3
  776. package/packages/keq/dist/request-init/utils/compile-url.d.ts.map +0 -1
  777. package/packages/keq/dist/request-init/utils/index.d.ts +0 -7
  778. package/packages/keq/dist/request-init/utils/index.d.ts.map +0 -1
  779. package/packages/keq/dist/request-init/utils/to-form-data.d.ts +0 -2
  780. package/packages/keq/dist/request-init/utils/to-form-data.d.ts.map +0 -1
  781. package/packages/keq/dist/request-init/utils/to-url-search-params.d.ts +0 -2
  782. package/packages/keq/dist/request-init/utils/to-url-search-params.d.ts.map +0 -1
  783. package/packages/keq/dist/router/index.d.ts +0 -4
  784. package/packages/keq/dist/router/index.d.ts.map +0 -1
  785. package/packages/keq/dist/router/keq-host-route.d.ts +0 -3
  786. package/packages/keq/dist/router/keq-host-route.d.ts.map +0 -1
  787. package/packages/keq/dist/router/keq-location-route.d.ts +0 -3
  788. package/packages/keq/dist/router/keq-location-route.d.ts.map +0 -1
  789. package/packages/keq/dist/router/keq-method-route.d.ts +0 -3
  790. package/packages/keq/dist/router/keq-method-route.d.ts.map +0 -1
  791. package/packages/keq/dist/router/keq-module-route.d.ts +0 -3
  792. package/packages/keq/dist/router/keq-module-route.d.ts.map +0 -1
  793. package/packages/keq/dist/router/keq-pathname-route.d.ts +0 -3
  794. package/packages/keq/dist/router/keq-pathname-route.d.ts.map +0 -1
  795. package/packages/keq/dist/router/keq-router.d.ts +0 -32
  796. package/packages/keq/dist/router/keq-router.d.ts.map +0 -1
  797. package/packages/keq/dist/router/types/index.d.ts +0 -2
  798. package/packages/keq/dist/router/types/index.d.ts.map +0 -1
  799. package/packages/keq/dist/router/types/keq-route.d.ts +0 -7
  800. package/packages/keq/dist/router/types/keq-route.d.ts.map +0 -1
  801. package/packages/keq/dist/router/utils/compose-route.d.ts +0 -3
  802. package/packages/keq/dist/router/utils/compose-route.d.ts.map +0 -1
  803. package/packages/keq/dist/router/utils/index.d.ts +0 -2
  804. package/packages/keq/dist/router/utils/index.d.ts.map +0 -1
  805. package/packages/keq/dist/types/enabled-if-string-index.d.ts +0 -24
  806. package/packages/keq/dist/types/enabled-if-string-index.d.ts.map +0 -1
  807. package/packages/keq/dist/types/exclude-unknown-properties.d.ts +0 -19
  808. package/packages/keq/dist/types/exclude-unknown-properties.d.ts.map +0 -1
  809. package/packages/keq/dist/types/index-keys.d.ts +0 -18
  810. package/packages/keq/dist/types/index-keys.d.ts.map +0 -1
  811. package/packages/keq/dist/types/index.d.ts +0 -7
  812. package/packages/keq/dist/types/index.d.ts.map +0 -1
  813. package/packages/keq/dist/types/literal-keys.d.ts +0 -18
  814. package/packages/keq/dist/types/literal-keys.d.ts.map +0 -1
  815. package/packages/keq/dist/types/loose-nested-like.d.ts +0 -11
  816. package/packages/keq/dist/types/loose-nested-like.d.ts.map +0 -1
  817. package/packages/keq/dist/types/string-index-value-of.d.ts +0 -18
  818. package/packages/keq/dist/types/string-index-value-of.d.ts.map +0 -1
  819. package/packages/keq/dist/utils/base64.d.ts +0 -3
  820. package/packages/keq/dist/utils/base64.d.ts.map +0 -1
  821. package/packages/keq/dist/utils/index.d.ts +0 -4
  822. package/packages/keq/dist/utils/index.d.ts.map +0 -1
  823. package/packages/keq/dist/utils/shallow-clone.d.ts +0 -5
  824. package/packages/keq/dist/utils/shallow-clone.d.ts.map +0 -1
  825. package/packages/keq/dist/utils/sleep.d.ts +0 -2
  826. package/packages/keq/dist/utils/sleep.d.ts.map +0 -1
  827. package/packages/keq/dist/validator/index.d.ts +0 -2
  828. package/packages/keq/dist/validator/index.d.ts.map +0 -1
  829. package/packages/keq/dist/validator/validator.d.ts +0 -65
  830. package/packages/keq/dist/validator/validator.d.ts.map +0 -1
  831. package/packages/keq/node_modules/.bin/tsc +0 -21
  832. package/packages/keq/node_modules/.bin/tsserver +0 -21
  833. package/packages/nestjs/dist/keq.module-definition.d.ts +0 -3
  834. package/packages/nestjs/dist/keq.module-definition.d.ts.map +0 -1
  835. package/packages/nestjs/dist/keq.module.d.ts +0 -7
  836. package/packages/nestjs/dist/keq.module.d.ts.map +0 -1
  837. package/packages/nestjs/dist/types/index.d.ts +0 -2
  838. package/packages/nestjs/dist/types/index.d.ts.map +0 -1
  839. package/packages/nestjs/dist/types/keq-module-options.d.ts +0 -5
  840. package/packages/nestjs/dist/types/keq-module-options.d.ts.map +0 -1
  841. package/packages/nestjs/node_modules/.bin/tsc +0 -21
  842. package/packages/nestjs/node_modules/.bin/tsserver +0 -21
@@ -0,0 +1,1359 @@
1
+ #!/usr/bin/env node
2
+ import { n as Matcher, t as Compiler } from "./compiler-C3AE8j54.mjs";
3
+ import { F as FileTracker, W as SupportedMethods } from "./plugins-DCvJ8iHR.mjs";
4
+ import { t as logger } from "./logger-QLBHySQ3.mjs";
5
+ import fs from "fs-extra";
6
+ import * as path$1 from "path";
7
+ import path from "path";
8
+ import { cosmiconfig } from "cosmiconfig";
9
+ import * as R from "ramda";
10
+ import picomatch from "picomatch";
11
+ import * as yaml from "js-yaml";
12
+ import semver from "semver";
13
+ import { Argument, Command, Option } from "commander";
14
+ import os from "os";
15
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
16
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
17
+ import { z } from "zod";
18
+ //#region src/utils/xprod-merge.ts
19
+ /**
20
+ * 对多个对象数组执行笛卡尔积合并
21
+ * @example
22
+ * xprodMerge([{ a: 1 }, { a: 2 }], [{b: 1}], [{ c: 1 }])
23
+ * // => [{ a: 1, b: 1, c: 1}, { a: 2, b:1, c: 1 }]
24
+ */
25
+ function xprodMerge(...lists) {
26
+ if (lists.length === 0) return [];
27
+ if (lists.length === 1) return lists[0];
28
+ return lists.reduce((acc, curr) => R.chain((item1) => R.map((item2) => R.mergeAll([item1, item2]), curr), acc));
29
+ }
30
+ //#endregion
31
+ //#region src/commands/utils/xprod-filter-rules.ts
32
+ function xprodFilterRules(options) {
33
+ return xprodMerge((options.module || ["*"]).map((moduleName) => ({
34
+ deny: false,
35
+ persist: options.persist,
36
+ moduleName
37
+ })), options.method ? [{ operationMethod: options.method.toLowerCase() }] : [{ operationMethod: "*" }], options.pathname ? [{ operationPathname: options.pathname }] : [{ operationPathname: "/**" }]);
38
+ }
39
+ //#endregion
40
+ //#region src/commands/build.ts
41
+ function registerBuildCommand(program) {
42
+ program.command("build").description("Build and generate API client code from OpenAPI/Swagger specifications").option("-c --config <config>", "The keq-cli config file").option("--module <modules...>", "Filter module(s) to generate").option("--debug", "Print debug information").option("--tolerant", "Tolerate wrong swagger/openapi structure").option("--fresh", "Clean the output directory before building").option("-i --interactive", "Interactive select the scope of generation").addOption(new Option("--method <method>", "Only generate files of the specified operation method").choices([...SupportedMethods, ...SupportedMethods.map((method) => method.toUpperCase())])).option("--pathname <pathname>", "Only generate files of the specified operation pathname").action(async (options) => {
43
+ const filterRules = [];
44
+ if (options.module || options.method || options.pathname) filterRules.push({
45
+ deny: true,
46
+ persist: false,
47
+ moduleName: "*",
48
+ operationMethod: "*",
49
+ operationPathname: "/**"
50
+ }, ...xprodFilterRules({
51
+ module: options.module,
52
+ method: options.method,
53
+ pathname: options.pathname,
54
+ persist: false
55
+ }));
56
+ else if (options.interactive) filterRules.push({
57
+ deny: true,
58
+ persist: false,
59
+ moduleName: "*",
60
+ operationMethod: "*",
61
+ operationPathname: "/**"
62
+ });
63
+ await new Compiler({
64
+ build: true,
65
+ persist: true,
66
+ fresh: !!options.fresh,
67
+ config: options.config,
68
+ debug: !!options.debug,
69
+ tolerant: !!options.tolerant,
70
+ interactive: !!options.interactive && { mode: "allow" },
71
+ filter: filterRules.length > 0 ? { rules: filterRules } : void 0
72
+ }).run();
73
+ });
74
+ }
75
+ //#endregion
76
+ //#region src/commands/filter.ts
77
+ function registerFilterCommand(program) {
78
+ program.command("filter").description("Manage filter rules for API generation using .keqfilter file").addArgument(new Argument("<mode>", "The filter mode").choices([
79
+ "all",
80
+ "deny",
81
+ "allow"
82
+ ]).argRequired()).option("-c --config <config>", "The keq-cli config file").option("--debug", "Print debug information").option("--tolerant", "Tolerate wrong swagger/openapi structure").option("--module <modules...>").option("--build", "Build after updating .keqfilter file").addOption(new Option("--method <method>", "Only generate files of the specified operation method").choices([...SupportedMethods, ...SupportedMethods.map((method) => method.toUpperCase())])).option("--pathname <pathnames>", "Only generate files of the specified operation pathname").option("-i --interactive", "Interactive select the scope of generation").action(async (mode, options) => {
83
+ let compiler;
84
+ if (mode === "all") {
85
+ if (options.build) throw new Error("'--build' cannot be used with 'all' mode");
86
+ if (options.interactive) throw new Error("'--interactive' cannot be used with 'all' mode");
87
+ if (options.module) throw new Error("'--module' cannot be used with 'all' mode");
88
+ if (options.method) throw new Error("'--method' cannot be used with 'all' mode");
89
+ if (options.pathname) throw new Error("'--pathname' cannot be used with 'all' mode");
90
+ compiler = new Compiler({
91
+ build: false,
92
+ persist: true,
93
+ config: options.config,
94
+ debug: !!options.debug,
95
+ tolerant: !!options.tolerant,
96
+ interactive: false,
97
+ filter: { rules: [{
98
+ persist: true,
99
+ deny: true,
100
+ moduleName: "*",
101
+ operationMethod: "*",
102
+ operationPathname: "/**"
103
+ }] }
104
+ });
105
+ } else if (options.interactive) {
106
+ if (options.interactive) {
107
+ if (options.method) throw new Error("'--method' cannot be used with '--interactive'");
108
+ if (options.pathname) throw new Error("'--pathname' cannot be used with '--interactive'");
109
+ }
110
+ compiler = new Compiler({
111
+ build: !!options.build,
112
+ persist: true,
113
+ config: options.config,
114
+ debug: !!options.debug,
115
+ tolerant: !!options.tolerant,
116
+ interactive: {
117
+ mode,
118
+ persist: true
119
+ },
120
+ filter: { rules: [{
121
+ persist: false,
122
+ deny: true,
123
+ moduleName: "*",
124
+ operationMethod: "*",
125
+ operationPathname: "/**"
126
+ }] }
127
+ });
128
+ } else {
129
+ if (!options.method && !options.pathname) throw new Error("at least one of '-i --interactive', '--method' or '--pathname' must be specified");
130
+ const moduleNames = options.module || ["*"];
131
+ compiler = new Compiler({
132
+ build: !!options.build,
133
+ persist: true,
134
+ config: options.config,
135
+ debug: !!options.debug,
136
+ tolerant: !!options.tolerant,
137
+ filter: { rules: moduleNames.map((moduleNames) => ({
138
+ persist: true,
139
+ deny: mode === "deny",
140
+ moduleName: moduleNames,
141
+ operationMethod: options.method,
142
+ operationPathname: options.pathname
143
+ })) },
144
+ interactive: false
145
+ });
146
+ }
147
+ await compiler.run();
148
+ });
149
+ }
150
+ //#endregion
151
+ //#region src/utils/scan-generated-files.ts
152
+ /**
153
+ * Recursively find all files in a directory
154
+ */
155
+ async function findAllFiles(dir, extensions) {
156
+ const results = [];
157
+ async function scan(currentDir) {
158
+ let entries;
159
+ try {
160
+ entries = await fs.readdir(currentDir);
161
+ } catch (err) {
162
+ return;
163
+ }
164
+ for (const entry of entries) {
165
+ if (entry === "node_modules" || entry === ".git") continue;
166
+ const fullPath = path$1.join(currentDir, entry);
167
+ let stat;
168
+ try {
169
+ stat = await fs.stat(fullPath);
170
+ } catch (err) {
171
+ continue;
172
+ }
173
+ if (stat.isDirectory()) await scan(fullPath);
174
+ else if (stat.isFile()) if (!extensions) results.push(fullPath);
175
+ else {
176
+ const ext = path$1.extname(fullPath);
177
+ if (extensions.includes(ext)) results.push(fullPath);
178
+ }
179
+ }
180
+ }
181
+ await scan(dir);
182
+ return results;
183
+ }
184
+ /**
185
+ * Scan all files in the output directory
186
+ * @param outdir The output directory to scan
187
+ * @returns List of all files with their paths
188
+ */
189
+ async function scanAllFiles(outdir) {
190
+ const absoluteOutdir = path$1.resolve(outdir);
191
+ if (!await fs.exists(absoluteOutdir)) return [];
192
+ return (await findAllFiles(absoluteOutdir)).map((file) => ({
193
+ absolutePath: file,
194
+ relativePath: path$1.relative(absoluteOutdir, file)
195
+ }));
196
+ }
197
+ /**
198
+ * Find invalid files that are not in the current artifacts list
199
+ * This includes both non-generated files and outdated generated files
200
+ * @param outdir The output directory
201
+ * @param validFilePaths List of valid file paths (relative to outdir)
202
+ * @returns List of invalid files
203
+ */
204
+ async function findInvalidFiles(outdir, validFilePaths) {
205
+ const allFiles = await scanAllFiles(outdir);
206
+ const validPathsSet = new Set(validFilePaths.map((p) => path$1.normalize(p)));
207
+ return allFiles.filter((file) => {
208
+ const normalizedPath = path$1.normalize(file.relativePath);
209
+ return !validPathsSet.has(normalizedPath);
210
+ });
211
+ }
212
+ //#endregion
213
+ //#region src/commands/list.ts
214
+ function registerListCommand(program) {
215
+ program.command("list").description("List generated files based on current configuration").option("-c --config <config>", "The keq-cli config file").option("--invalid", "List only invalid generated files (files not in current build)").option("--debug", "Print debug information").option("--tolerant", "Tolerate wrong swagger/openapi structure").action(async (options) => {
216
+ const compiler = new Compiler({
217
+ build: true,
218
+ persist: false,
219
+ silent: true,
220
+ config: options.config,
221
+ debug: !!options.debug,
222
+ tolerant: !!options.tolerant
223
+ });
224
+ await compiler.run();
225
+ const context = compiler.context;
226
+ if (!context.rc) throw new Error("Failed to load configuration");
227
+ if (options.invalid) {
228
+ const validFilePaths = (context.artifacts || []).map((artifact) => artifact.filepath);
229
+ const invalidFiles = await findInvalidFiles(context.rc.outdir, validFilePaths);
230
+ for (const file of invalidFiles) {
231
+ const fullPath = `./${path$1.join(context.rc.outdir, file.relativePath)}`;
232
+ console.log(fullPath);
233
+ }
234
+ } else {
235
+ const artifacts = context.artifacts || [];
236
+ for (const artifact of artifacts) {
237
+ const fullPath = `./${path$1.join(context.rc.outdir, artifact.filepath)}`;
238
+ console.log(fullPath);
239
+ }
240
+ }
241
+ });
242
+ }
243
+ //#endregion
244
+ //#region src/commands/apis.ts
245
+ function registerApisCommand(program) {
246
+ program.command("apis").description("List API operations and components from OpenAPI/Swagger specifications").option("-c --config <config>", "The keq-cli config file").option("--tolerant", "Tolerate wrong swagger/openapi structure").addOption(new Option("--includes <includes...>", "Include specific parts").choices(["operations", "components"])).option("--module <modules...>", "Filter module(s) to list").addOption(new Option("--method <method>", "Only generate files of the specified operation method").choices([...SupportedMethods, ...SupportedMethods.map((method) => method.toUpperCase())])).option("--pathname <pathnames>", "Only generate files of the specified operation pathname").addOption(new Option("--format <format>", "Output format").choices(["compact", "json"])).option("--json", "Output in JSON format (shortcut for --format json)").option("--all", "Ignore .keqfilter rules and show all modules/operations").option("--debug", "Print debug information").action(async (options) => {
247
+ if (options.all && (options.module || options.method || options.pathname)) throw new Error("'--all' cannot be used with '--module', '--method', or '--pathname'");
248
+ const filterRules = [];
249
+ if (options.module || options.method || options.pathname) filterRules.push({
250
+ deny: true,
251
+ persist: false,
252
+ moduleName: "*",
253
+ operationMethod: "*",
254
+ operationPathname: "/**"
255
+ }, ...xprodFilterRules({
256
+ module: options.module,
257
+ method: options.method,
258
+ pathname: options.pathname,
259
+ persist: false
260
+ }));
261
+ const compiler = new Compiler({
262
+ build: true,
263
+ persist: false,
264
+ silent: true,
265
+ config: options.config,
266
+ debug: !!options.debug,
267
+ tolerant: !!options.tolerant,
268
+ filter: options.all ? false : filterRules.length > 0 ? { rules: filterRules } : void 0
269
+ });
270
+ await compiler.run();
271
+ const documents = compiler.context.documents || [];
272
+ const includesList = options.includes || ["operations", "components"];
273
+ const includeOperations = includesList.includes("operations");
274
+ const includeComponents = includesList.includes("components");
275
+ const result = documents.map((document) => {
276
+ const item = { module: document.module.name };
277
+ if (includeOperations) item.operations = document.operations.map((operation) => ({
278
+ method: operation.method.toUpperCase(),
279
+ path: operation.pathname,
280
+ operationId: operation.operationId,
281
+ summary: operation.operation.summary || "",
282
+ description: operation.operation.description || ""
283
+ }));
284
+ if (includeComponents) item.components = { schemas: document.schemas.map((schema) => {
285
+ const schemaObj = schema.schema;
286
+ return {
287
+ name: schema.name,
288
+ description: schemaObj.description || ""
289
+ };
290
+ }) };
291
+ return item;
292
+ });
293
+ const format = options.format || (options.json ? "json" : void 0);
294
+ if (format === "json") console.log(JSON.stringify(result, null, 2));
295
+ else if (format === "compact") {
296
+ for (const item of result) {
297
+ console.log(`\nModule: ${item.module}`);
298
+ console.log("─".repeat(70));
299
+ if (includeOperations) {
300
+ console.log("\n APIs:");
301
+ if (!item.operations || item.operations.length === 0) console.log(" (No APIs)");
302
+ else for (const operation of item.operations) {
303
+ const method = operation.method.padEnd(7);
304
+ const desc = operation.summary || operation.description;
305
+ const descText = desc ? ` ${desc}` : "";
306
+ console.log(` ${method} ${operation.path}${descText}`);
307
+ }
308
+ }
309
+ if (includeComponents) {
310
+ console.log("\n Schemas:");
311
+ if (!item.components || item.components.schemas.length === 0) console.log(" (No Schemas)");
312
+ else for (const schema of item.components.schemas) {
313
+ const desc = schema.description ? ` ${schema.description}` : "";
314
+ console.log(` ${schema.name}${desc}`);
315
+ }
316
+ }
317
+ }
318
+ const totalApis = result.reduce((sum, item) => sum + (item.operations?.length || 0), 0);
319
+ const totalSchemas = result.reduce((sum, item) => sum + (item.components?.schemas.length || 0), 0);
320
+ console.log("\n" + "─".repeat(70));
321
+ const parts = [`${result.length} modules`];
322
+ if (includeOperations) parts.push(`${totalApis} APIs`);
323
+ if (includeComponents) parts.push(`${totalSchemas} Schemas`);
324
+ console.log(`Total: ${parts.join(", ")}`);
325
+ } else {
326
+ for (const item of result) {
327
+ console.log(`\nModule: ${item.module}`);
328
+ console.log("─".repeat(70));
329
+ if (includeOperations) {
330
+ console.log("\n APIs:");
331
+ if (!item.operations || item.operations.length === 0) console.log(" (No APIs)");
332
+ else for (const operation of item.operations) {
333
+ const method = operation.method.padEnd(7);
334
+ console.log(` ${method} ${operation.path}`);
335
+ const desc = operation.summary || operation.description;
336
+ if (desc) console.log(` ${desc}`);
337
+ }
338
+ }
339
+ if (includeComponents) {
340
+ console.log("\n Schemas:");
341
+ if (!item.components || item.components.schemas.length === 0) console.log(" (No Schemas)");
342
+ else for (const schema of item.components.schemas) {
343
+ console.log(` ${schema.name}`);
344
+ if (schema.description) console.log(` ${schema.description}`);
345
+ }
346
+ }
347
+ }
348
+ const totalApis = result.reduce((sum, item) => sum + (item.operations?.length || 0), 0);
349
+ const totalSchemas = result.reduce((sum, item) => sum + (item.components?.schemas.length || 0), 0);
350
+ console.log("\n" + "─".repeat(70));
351
+ const parts = [`${result.length} modules`];
352
+ if (includeOperations) parts.push(`${totalApis} APIs`);
353
+ if (includeComponents) parts.push(`${totalSchemas} Schemas`);
354
+ console.log(`Total: ${parts.join(", ")}`);
355
+ }
356
+ });
357
+ }
358
+ //#endregion
359
+ //#region src/commands/mock.ts
360
+ function registerMockCommand(program) {
361
+ program.command("mock").description("Start a mock server based on OpenAPI specifications").option("-c --config <config>", "The keq-cli config file").option("-p --port <port>", "Port to listen on", "3939").option("--host <host>", "Host to bind to", "localhost").option("--module <modules...>", "Filter module(s) to mock").option("--cors", "Enable CORS headers", true).option("--delay <delay>", "Response delay in ms (or min-max range like \"100-500\")").option("--max-depth <depth>", "Max schema depth for mock data generation", "10").option("--ref-depth <depth>", "Max $ref recursion depth for circular schemas", "5").option("--debug", "Print debug information").option("--tolerant", "Tolerate wrong swagger/openapi structure").action(async (options) => {
362
+ const { mockCommand } = await import("./mock-command-Bp1LxSls.mjs");
363
+ await mockCommand(options);
364
+ });
365
+ }
366
+ //#endregion
367
+ //#region src/commands/init.ts
368
+ function registerInitCommand(program) {
369
+ program.command("init").description("Initialize keq configuration file").option("-f --force", "Force overwrite existing config file").action(async (options) => {
370
+ const { initConfig } = await import("./init-BNhD2oCI.mjs");
371
+ await initConfig(options);
372
+ });
373
+ }
374
+ //#endregion
375
+ //#region src/search/embedder.ts
376
+ const MODEL_NAME = "intfloat/multilingual-e5-small";
377
+ const CACHE_DIR = path.join(os.homedir(), ".cache", "keq", "models");
378
+ let transformers = null;
379
+ let loadError = null;
380
+ let extractor = null;
381
+ var EmbedderUnavailableError = class extends Error {
382
+ constructor(cause) {
383
+ super("@huggingface/transformers is not installed. Semantic search is unavailable.\nRun `pnpm add @huggingface/transformers` to enable this feature.");
384
+ this.name = "EmbedderUnavailableError";
385
+ if (cause) this.cause = cause;
386
+ }
387
+ };
388
+ async function loadTransformers() {
389
+ if (transformers) return transformers;
390
+ if (loadError) throw new EmbedderUnavailableError(loadError);
391
+ try {
392
+ transformers = await import("@huggingface/transformers");
393
+ return transformers;
394
+ } catch (e) {
395
+ loadError = e instanceof Error ? e : new Error(String(e));
396
+ throw new EmbedderUnavailableError(loadError);
397
+ }
398
+ }
399
+ async function getEmbedder() {
400
+ if (extractor) return extractor;
401
+ const { pipeline, env } = await loadTransformers();
402
+ env.cacheDir = CACHE_DIR;
403
+ env.allowLocalModels = true;
404
+ extractor = await pipeline("feature-extraction", MODEL_NAME, { dtype: "fp32" });
405
+ return extractor;
406
+ }
407
+ async function embed(texts) {
408
+ return (await (await getEmbedder())(texts.map((t) => `query: ${t}`), {
409
+ pooling: "mean",
410
+ normalize: true
411
+ })).tolist().map((vec) => new Float32Array(vec));
412
+ }
413
+ async function embedDocuments(texts) {
414
+ return (await (await getEmbedder())(texts.map((t) => `passage: ${t}`), {
415
+ pooling: "mean",
416
+ normalize: true
417
+ })).tolist().map((vec) => new Float32Array(vec));
418
+ }
419
+ function cosineSimilarity(a, b) {
420
+ let dot = 0;
421
+ for (let i = 0; i < a.length; i++) dot += a[i] * b[i];
422
+ return dot;
423
+ }
424
+ //#endregion
425
+ //#region src/search/search-engine.ts
426
+ var SearchEngine = class {
427
+ operations = [];
428
+ async buildIndex(documents) {
429
+ this.operations = [];
430
+ for (const document of documents) for (const op of document.operations) {
431
+ const tags = op.operation.tags || [];
432
+ const summary = op.operation.summary || "";
433
+ const description = op.operation.description || "";
434
+ const text = [
435
+ op.method.toUpperCase(),
436
+ op.pathname,
437
+ op.operationId,
438
+ summary,
439
+ description,
440
+ ...tags
441
+ ].filter(Boolean).join(" ");
442
+ this.operations.push({
443
+ id: `${document.module.name}:${op.method}:${op.pathname}`,
444
+ module: document.module.name,
445
+ method: op.method.toUpperCase(),
446
+ pathname: op.pathname,
447
+ operationId: op.operationId,
448
+ summary,
449
+ description,
450
+ tags,
451
+ text,
452
+ operation: op.operation
453
+ });
454
+ }
455
+ const embeddings = await embedDocuments(this.operations.map((op) => op.text));
456
+ for (let i = 0; i < this.operations.length; i++) this.operations[i].embedding = embeddings[i];
457
+ }
458
+ async search(query, options) {
459
+ const limit = options?.limit ?? 10;
460
+ const modules = options?.module;
461
+ let candidates = this.operations;
462
+ if (modules && modules.length > 0) candidates = candidates.filter((op) => modules.includes(op.module));
463
+ if (candidates.length === 0) return [];
464
+ const [queryEmbedding] = await embed([query]);
465
+ return candidates.filter((op) => op.embedding).map((op) => ({
466
+ op,
467
+ score: cosineSimilarity(queryEmbedding, op.embedding)
468
+ })).sort((a, b) => b.score - a.score).slice(0, limit).map(({ op, score }) => ({
469
+ score: Math.round(score * 1e3) / 1e3,
470
+ module: op.module,
471
+ method: op.method,
472
+ pathname: op.pathname,
473
+ operationId: op.operationId,
474
+ summary: op.summary,
475
+ description: op.description,
476
+ tags: op.tags
477
+ }));
478
+ }
479
+ getDetail(module, method, pathname) {
480
+ const op = this.operations.find((o) => o.module === module && o.method === method.toUpperCase() && o.pathname === pathname);
481
+ if (!op) return void 0;
482
+ const operation = op.operation;
483
+ return {
484
+ score: 1,
485
+ module: op.module,
486
+ method: op.method,
487
+ pathname: op.pathname,
488
+ operationId: op.operationId,
489
+ summary: op.summary,
490
+ description: op.description,
491
+ tags: op.tags,
492
+ parameters: operation.parameters || [],
493
+ requestBody: operation.requestBody || null,
494
+ responses: operation.responses || null
495
+ };
496
+ }
497
+ listModules() {
498
+ return [...new Set(this.operations.map((op) => op.module))];
499
+ }
500
+ };
501
+ //#endregion
502
+ //#region src/commands/search.ts
503
+ function registerSearchCommand(program) {
504
+ program.command("search").description("Semantic search for API operations using natural language").argument("<query>", "Natural language search query").option("-c --config <config>", "The keq-cli config file").option("--module <modules...>", "Filter module(s) to search").option("--limit <limit>", "Maximum number of results", "10").option("--detail", "Include full request/response schema in results").addOption(new Option("--format <format>", "Output format").choices(["json", "compact"]).default("json")).option("--all", "Ignore .keqfilter rules").option("--tolerant", "Tolerate wrong swagger/openapi structure").option("--debug", "Print debug information").action(async (query, options) => {
505
+ const filterRules = [];
506
+ if (options.module && !options.all) filterRules.push({
507
+ deny: true,
508
+ persist: false,
509
+ moduleName: "*",
510
+ operationMethod: "*",
511
+ operationPathname: "/**"
512
+ }, ...xprodFilterRules({
513
+ module: options.module,
514
+ persist: false
515
+ }));
516
+ const compiler = new Compiler({
517
+ build: true,
518
+ persist: false,
519
+ silent: true,
520
+ config: options.config,
521
+ debug: !!options.debug,
522
+ tolerant: !!options.tolerant,
523
+ filter: options.all ? false : filterRules.length > 0 ? { rules: filterRules } : void 0
524
+ });
525
+ await compiler.run();
526
+ const documents = compiler.context.documents || [];
527
+ const engine = new SearchEngine();
528
+ try {
529
+ await engine.buildIndex(documents);
530
+ } catch (e) {
531
+ if (e instanceof EmbedderUnavailableError) {
532
+ console.error(e.message);
533
+ process.exit(1);
534
+ }
535
+ throw e;
536
+ }
537
+ const limit = parseInt(options.limit, 10);
538
+ const results = await engine.search(query, {
539
+ limit,
540
+ module: options.module
541
+ });
542
+ if (options.detail) printResults(results.map((r) => {
543
+ return engine.getDetail(r.module, r.method, r.pathname) || r;
544
+ }), options.format);
545
+ else printResults(results, options.format);
546
+ });
547
+ }
548
+ function printResults(results, format) {
549
+ if (format === "json") console.log(JSON.stringify({
550
+ results,
551
+ total: results.length
552
+ }, null, 2));
553
+ else {
554
+ for (const r of results) {
555
+ const method = String(r.method).padEnd(7);
556
+ const score = String(r.score);
557
+ console.log(` [${score}] ${method} ${String(r.pathname)}`);
558
+ if (typeof r.summary === "string") console.log(` ${r.summary}`);
559
+ console.log(` ${String(r.module)} | ${String(r.operationId)}`);
560
+ console.log();
561
+ }
562
+ console.log(`Total: ${results.length} results`);
563
+ }
564
+ }
565
+ //#endregion
566
+ //#region src/mcp/compiler-provider.ts
567
+ /**
568
+ * Manages the Compiler lifecycle with automatic lazy reload.
569
+ * Tracks .keqrc and .keqfilter for changes; getters transparently
570
+ * re-compile when config files are modified, with built-in concurrency protection.
571
+ */
572
+ var CompilerProvider = class CompilerProvider {
573
+ tracker = new FileTracker();
574
+ _engine = new SearchEngine();
575
+ _engineAvailable = false;
576
+ _documents = [];
577
+ _context = {};
578
+ _matcher = new Matcher([]);
579
+ _keqfilterPath = "";
580
+ _configPath = "";
581
+ _loaded = false;
582
+ _loadPromise = null;
583
+ options;
584
+ constructor(options) {
585
+ this.options = options;
586
+ }
587
+ get configPath() {
588
+ return this._configPath;
589
+ }
590
+ static async init(options) {
591
+ const provider = new CompilerProvider(options);
592
+ const explore = cosmiconfig("keq");
593
+ const result = options.config ? await explore.load(options.config) : await explore.search();
594
+ if (!result) throw new Error("Cannot find config file.");
595
+ const configFilepath = result.filepath;
596
+ const keqfilterPath = path.resolve(path.dirname(configFilepath), ".keqfilter");
597
+ provider._keqfilterPath = keqfilterPath;
598
+ provider._configPath = configFilepath;
599
+ await provider.tracker.track(configFilepath);
600
+ await provider.tracker.track(keqfilterPath);
601
+ return provider;
602
+ }
603
+ async getDocuments() {
604
+ await this.ensureLoaded();
605
+ return this._documents;
606
+ }
607
+ async getEngine() {
608
+ await this.ensureLoaded();
609
+ if (!this._engineAvailable) throw new EmbedderUnavailableError();
610
+ return this._engine;
611
+ }
612
+ async getContext() {
613
+ await this.ensureLoaded();
614
+ return this._context;
615
+ }
616
+ async getMatcher() {
617
+ await this.ensureLoaded();
618
+ return this._matcher;
619
+ }
620
+ async invalidate() {
621
+ await this.tracker.forceReload(() => this.reload());
622
+ }
623
+ async ensureLoaded() {
624
+ if (this._loaded) {
625
+ await this.tracker.ensureFresh(() => this.reload());
626
+ return;
627
+ }
628
+ if (this._loadPromise) {
629
+ await this._loadPromise;
630
+ return;
631
+ }
632
+ this._loadPromise = this.reload().finally(() => {
633
+ this._loadPromise = null;
634
+ });
635
+ await this._loadPromise;
636
+ }
637
+ async reload() {
638
+ const { config, debug, tolerant } = this.options;
639
+ const compiler = new Compiler({
640
+ build: true,
641
+ persist: false,
642
+ silent: true,
643
+ config,
644
+ debug,
645
+ tolerant,
646
+ filter: false
647
+ });
648
+ await compiler.run();
649
+ this._context = compiler.context;
650
+ this._documents = compiler.context.documents || [];
651
+ try {
652
+ await this._engine.buildIndex(this._documents);
653
+ this._engineAvailable = true;
654
+ } catch (e) {
655
+ if (e instanceof EmbedderUnavailableError) this._engineAvailable = false;
656
+ else throw e;
657
+ }
658
+ if (await fs.exists(this._keqfilterPath)) this._matcher = await Matcher.read(this._keqfilterPath);
659
+ else this._matcher = new Matcher([]);
660
+ await this.tracker.snapshot();
661
+ this._loaded = true;
662
+ }
663
+ };
664
+ //#endregion
665
+ //#region src/mcp/find-config-in-dir.ts
666
+ const CONFIG_FILENAMES = [
667
+ ".keqrc",
668
+ ".keqrc.ts",
669
+ ".keqrc.js",
670
+ ".keqrc.mjs",
671
+ ".keqrc.cjs",
672
+ ".keqrc.json",
673
+ ".keqrc.yml",
674
+ ".keqrc.yaml",
675
+ "keq.config.ts",
676
+ "keq.config.js",
677
+ "keq.config.mjs",
678
+ "keq.config.cjs",
679
+ "keq.config.json",
680
+ "keq.config.yml",
681
+ "keq.config.yaml"
682
+ ];
683
+ async function findConfigInDir(dir) {
684
+ for (const filename of CONFIG_FILENAMES) {
685
+ const filePath = path.resolve(dir, filename);
686
+ if (await fs.pathExists(filePath)) return filePath;
687
+ }
688
+ return null;
689
+ }
690
+ //#endregion
691
+ //#region src/mcp/compiler-provider-registry.ts
692
+ /**
693
+ * Manages multiple CompilerProvider instances for monorepo/multi-project support.
694
+ * Lazily initializes providers on first access and dynamically registers new projects
695
+ * when an unknown project directory is requested.
696
+ */
697
+ var CompilerProviderRegistry = class {
698
+ entries = /* @__PURE__ */ new Map();
699
+ providers = /* @__PURE__ */ new Map();
700
+ options;
701
+ constructor(options) {
702
+ this.options = options;
703
+ }
704
+ register(entry) {
705
+ this.entries.set(entry.projectDir, entry);
706
+ }
707
+ has(projectDir) {
708
+ return this.entries.has(projectDir);
709
+ }
710
+ list() {
711
+ return [...this.entries.values()];
712
+ }
713
+ async resolve(projectDir) {
714
+ const entry = await this.resolveEntry(projectDir);
715
+ const cached = this.providers.get(entry.projectDir);
716
+ if (cached) return cached;
717
+ const provider = await CompilerProvider.init({
718
+ config: entry.configPath,
719
+ debug: this.options.debug,
720
+ tolerant: this.options.tolerant
721
+ });
722
+ this.providers.set(entry.projectDir, provider);
723
+ return provider;
724
+ }
725
+ getConfigPath(projectDir) {
726
+ return this.resolveEntrySync(projectDir).configPath;
727
+ }
728
+ async resolveEntry(projectDir) {
729
+ if (!projectDir) return this.resolveDefault();
730
+ if (!path.isAbsolute(projectDir)) throw new Error(`The 'project' parameter must be an absolute path. Received: ${projectDir}`);
731
+ const existing = this.entries.get(projectDir);
732
+ if (existing) return existing;
733
+ const configPath = await findConfigInDir(projectDir);
734
+ if (!configPath) throw new Error(`No keqrc config file found in ${projectDir}`);
735
+ const entry = {
736
+ configPath,
737
+ projectDir
738
+ };
739
+ this.register(entry);
740
+ return entry;
741
+ }
742
+ resolveEntrySync(projectDir) {
743
+ if (!projectDir) return this.resolveDefault();
744
+ if (!path.isAbsolute(projectDir)) throw new Error(`The 'project' parameter must be an absolute path. Received: ${projectDir}`);
745
+ const existing = this.entries.get(projectDir);
746
+ if (!existing) throw new Error(`No keqrc config file found in ${projectDir}`);
747
+ return existing;
748
+ }
749
+ resolveDefault() {
750
+ if (this.entries.size === 0) throw new Error("No keq project found. Please specify 'project' parameter with the absolute path to your project directory containing a keqrc config file.");
751
+ if (this.entries.size === 1) return this.entries.values().next().value;
752
+ const projects = [...this.entries.values()].map((e) => `- ${e.projectDir} (${path.basename(e.configPath)})`).join("\n");
753
+ throw new Error(`This is a monorepo with multiple keq projects. Please specify 'project' parameter with one of the following project directories:\n${projects}`);
754
+ }
755
+ };
756
+ //#endregion
757
+ //#region src/mcp/discover-projects.ts
758
+ async function discoverProjects(config) {
759
+ if (config) {
760
+ const configPath = path.resolve(config);
761
+ return [{
762
+ configPath,
763
+ projectDir: path.dirname(configPath)
764
+ }];
765
+ }
766
+ const monorepoEntries = await discoverFromMonorepo(process.cwd());
767
+ if (monorepoEntries.length > 0) return monorepoEntries;
768
+ const result = await cosmiconfig("keq").search();
769
+ if (result) return [{
770
+ configPath: result.filepath,
771
+ projectDir: path.dirname(result.filepath)
772
+ }];
773
+ return [];
774
+ }
775
+ async function discoverFromMonorepo(root) {
776
+ const workspaceGlobs = await getWorkspaceGlobs(root);
777
+ if (workspaceGlobs.length === 0) return [];
778
+ const dirs = [root, ...await expandWorkspaceGlobs(root, workspaceGlobs)];
779
+ const entries = [];
780
+ for (const dir of dirs) {
781
+ const configPath = await findConfigInDir(dir);
782
+ if (configPath) entries.push({
783
+ configPath,
784
+ projectDir: dir
785
+ });
786
+ }
787
+ return entries;
788
+ }
789
+ async function getWorkspaceGlobs(root) {
790
+ const pnpmWorkspacePath = path.join(root, "pnpm-workspace.yaml");
791
+ if (await fs.pathExists(pnpmWorkspacePath)) {
792
+ const content = await fs.readFile(pnpmWorkspacePath, "utf-8");
793
+ const parsed = yaml.load(content);
794
+ if (parsed?.packages) return parsed.packages;
795
+ }
796
+ const packageJsonPath = path.join(root, "package.json");
797
+ if (await fs.pathExists(packageJsonPath)) {
798
+ const pkg = await fs.readJson(packageJsonPath);
799
+ if (Array.isArray(pkg.workspaces)) return pkg.workspaces;
800
+ if (Array.isArray(pkg.workspaces?.packages)) return pkg.workspaces.packages;
801
+ }
802
+ return [];
803
+ }
804
+ async function expandWorkspaceGlobs(root, globs) {
805
+ const dirs = [];
806
+ for (const glob of globs) {
807
+ const parts = glob.split("/");
808
+ const baseParts = [];
809
+ let globPart = "";
810
+ for (let i = 0; i < parts.length; i++) {
811
+ if (parts[i].includes("*") || parts[i].includes("{") || parts[i].includes("?")) {
812
+ globPart = parts.slice(i).join("/");
813
+ break;
814
+ }
815
+ baseParts.push(parts[i]);
816
+ }
817
+ const baseDir = path.join(root, ...baseParts);
818
+ if (!await fs.pathExists(baseDir)) continue;
819
+ if (!globPart) {
820
+ const fullPath = path.resolve(root, glob);
821
+ if (await fs.pathExists(fullPath)) dirs.push(fullPath);
822
+ continue;
823
+ }
824
+ const matcher = picomatch(globPart);
825
+ const candidates = await fs.readdir(baseDir, { withFileTypes: true });
826
+ for (const entry of candidates) {
827
+ if (!entry.isDirectory()) continue;
828
+ if (matcher(entry.name)) dirs.push(path.join(baseDir, entry.name));
829
+ }
830
+ }
831
+ return dirs;
832
+ }
833
+ //#endregion
834
+ //#region src/commands/mcp.ts
835
+ function getFilterAnnotation(matcher, op) {
836
+ if (op && matcher.isOperationDenied(op)) return "This API is excluded from the code generation list by .keqfilter rules";
837
+ return "This API is included in the code generation list";
838
+ }
839
+ function registerMcpCommand(program) {
840
+ program.command("mcp").description("Start keq MCP server").option("-c --config <config>", "The keq-cli config file").option("--tolerant", "Tolerate wrong swagger/openapi structure").option("--debug", "Print debug information").action(async (options) => {
841
+ const config = options.config;
842
+ const tolerant = !!options.tolerant;
843
+ const debug = !!options.debug;
844
+ const entries = await discoverProjects(config);
845
+ const registry = new CompilerProviderRegistry({
846
+ debug,
847
+ tolerant
848
+ });
849
+ for (const entry of entries) registry.register(entry);
850
+ const server = new McpServer({
851
+ name: "keq",
852
+ version: "1.0.0",
853
+ description: "查询和搜索项目中对接的所有后端服务 API 接口。当用户想了解后端有哪些接口、查找某个功能的 API、查看接口的请求参数和响应格式时使用。支持自然语言语义搜索(中英文)。也可为接口生成 TypeScript 客户端代码。数据来源:项目配置的 Swagger/OpenAPI 规范文档。"
854
+ });
855
+ const projectParam = z.string().optional().describe("项目目录绝对路径,用于 monorepo 中指定操作哪个子项目。非 monorepo 项目无需提供。");
856
+ server.registerTool("search_apis", {
857
+ description: "通过语义匹配搜索项目中的后端 API 接口。仅当用户描述了具体功能或业务场景(如\"用户登录\"、\"搜索商品\")来查找相关接口时使用。如果用户想查看所有接口或按模块/路径浏览接口列表,应使用 list_apis 而非此工具。支持中英文自然语言,返回按相关度排序的接口列表。",
858
+ inputSchema: {
859
+ project: projectParam,
860
+ query: z.string().describe("自然语言搜索词,如\"用户登录\"、\"搜索商品\"、\"订单列表\"等"),
861
+ module: z.array(z.string()).optional().describe("按模块名筛选,限定在特定后端服务中搜索"),
862
+ limit: z.number().optional().default(10).describe("返回结果数量上限")
863
+ },
864
+ annotations: {
865
+ readOnlyHint: true,
866
+ destructiveHint: false
867
+ }
868
+ }, async ({ project, query, module, limit }) => {
869
+ try {
870
+ const provider = await registry.resolve(project);
871
+ const engine = await provider.getEngine();
872
+ const matcher = await provider.getMatcher();
873
+ const documents = await provider.getDocuments();
874
+ const annotated = (await engine.search(query, {
875
+ limit,
876
+ module
877
+ })).map((result) => {
878
+ const { score, ...rest } = result;
879
+ const op = documents.find((d) => d.module.name === result.module)?.operations.find((o) => o.method.toLowerCase() === result.method.toLowerCase() && o.pathname === result.pathname);
880
+ return {
881
+ ...rest,
882
+ "x-keq-score": score,
883
+ "x-keq-filter": getFilterAnnotation(matcher, op)
884
+ };
885
+ });
886
+ return { content: [{
887
+ type: "text",
888
+ text: JSON.stringify(annotated, null, 2)
889
+ }] };
890
+ } catch (error) {
891
+ return {
892
+ content: [{
893
+ type: "text",
894
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
895
+ }],
896
+ isError: true
897
+ };
898
+ }
899
+ });
900
+ server.registerTool("get_api_detail", {
901
+ description: "获取某个 API 接口的完整详情,包含请求参数、请求体、响应体的结构定义。当用户想知道某个接口怎么调用、需要传什么参数、返回什么数据时使用。需要先通过 search_apis 或 list_apis 获取接口的 module、method、pathname。",
902
+ inputSchema: {
903
+ project: projectParam,
904
+ module: z.string().describe("Module name"),
905
+ method: z.string().describe("HTTP method (GET, POST, PUT, DELETE, etc.)"),
906
+ pathname: z.string().describe("API pathname (e.g. /api/v1/users)")
907
+ },
908
+ annotations: {
909
+ readOnlyHint: true,
910
+ destructiveHint: false
911
+ }
912
+ }, async ({ project, module, method, pathname }) => {
913
+ try {
914
+ const provider = await registry.resolve(project);
915
+ const engine = await provider.getEngine();
916
+ const matcher = await provider.getMatcher();
917
+ const documents = await provider.getDocuments();
918
+ const detail = engine.getDetail(module, method, pathname);
919
+ if (!detail) return {
920
+ content: [{
921
+ type: "text",
922
+ text: "API not found"
923
+ }],
924
+ isError: true
925
+ };
926
+ const op = documents.find((d) => d.module.name === module)?.operations.find((o) => o.method.toLowerCase() === method.toLowerCase() && o.pathname === pathname);
927
+ return { content: [{
928
+ type: "text",
929
+ text: JSON.stringify({
930
+ ...detail,
931
+ "x-keq-filter": getFilterAnnotation(matcher, op)
932
+ }, null, 2)
933
+ }] };
934
+ } catch (error) {
935
+ return {
936
+ content: [{
937
+ type: "text",
938
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
939
+ }],
940
+ isError: true
941
+ };
942
+ }
943
+ });
944
+ server.registerTool("list_modules", {
945
+ description: "列出项目对接的所有后端服务模块。当用户想知道项目接入了哪些后端系统、有哪些服务可用时使用。每个模块对应一个后端服务的 API 文档。",
946
+ inputSchema: { project: projectParam },
947
+ annotations: {
948
+ readOnlyHint: true,
949
+ destructiveHint: false
950
+ }
951
+ }, async ({ project }) => {
952
+ try {
953
+ const modules = (await (await registry.resolve(project)).getEngine()).listModules();
954
+ return { content: [{
955
+ type: "text",
956
+ text: JSON.stringify(modules, null, 2)
957
+ }] };
958
+ } catch (error) {
959
+ return {
960
+ content: [{
961
+ type: "text",
962
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
963
+ }],
964
+ isError: true
965
+ };
966
+ }
967
+ });
968
+ server.registerTool("list_apis", {
969
+ description: "列出项目中所有可用的后端 API 接口。当用户想查看所有接口、浏览某个服务的全部接口、查询某个系统有哪些接口、或按条件筛选接口(如只看 GET 请求或某个路径下的接口)时使用。如果用户描述了具体功能来查找接口(如\"搜索商品的接口\"),应使用 search_apis。",
970
+ inputSchema: {
971
+ project: projectParam,
972
+ module: z.array(z.string()).optional().describe("Filter by module names"),
973
+ method: z.string().optional().describe("Filter by HTTP method (GET, POST, PUT, DELETE, etc.)"),
974
+ pathname: z.string().optional().describe("Filter by pathname pattern (glob supported)"),
975
+ includes: z.array(z.enum(["operations", "components"])).optional().default(["operations"]).describe("What to include in results")
976
+ },
977
+ annotations: {
978
+ readOnlyHint: true,
979
+ destructiveHint: false
980
+ }
981
+ }, async ({ project, module, method, pathname, includes }) => {
982
+ try {
983
+ const provider = await registry.resolve(project);
984
+ const documents = await provider.getDocuments();
985
+ const matcher = await provider.getMatcher();
986
+ const result = documents.filter((doc) => !module || module.includes(doc.module.name)).map((document) => {
987
+ const item = { module: document.module.name };
988
+ if (includes.includes("operations")) {
989
+ let ops = document.operations;
990
+ if (method) ops = ops.filter((op) => op.method.toLowerCase() === method.toLowerCase());
991
+ if (pathname) {
992
+ const match = picomatch(pathname);
993
+ ops = ops.filter((op) => match(op.pathname));
994
+ }
995
+ item.operations = ops.map((op) => ({
996
+ method: op.method.toUpperCase(),
997
+ path: op.pathname,
998
+ operationId: op.operationId,
999
+ summary: op.operation.summary || "",
1000
+ description: op.operation.description || "",
1001
+ "x-keq-filter": getFilterAnnotation(matcher, op)
1002
+ }));
1003
+ }
1004
+ if (includes.includes("components")) item.components = { schemas: document.schemas.map((schema) => {
1005
+ const schemaObj = schema.schema;
1006
+ return {
1007
+ name: schema.name,
1008
+ description: schemaObj.description || ""
1009
+ };
1010
+ }) };
1011
+ return item;
1012
+ });
1013
+ return { content: [{
1014
+ type: "text",
1015
+ text: JSON.stringify(result, null, 2)
1016
+ }] };
1017
+ } catch (error) {
1018
+ return {
1019
+ content: [{
1020
+ type: "text",
1021
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
1022
+ }],
1023
+ isError: true
1024
+ };
1025
+ }
1026
+ });
1027
+ server.registerTool("build_apis", {
1028
+ description: "为后端 API 接口生成类型安全的 TypeScript 请求函数代码。当用户想生成某个接口的调用代码、需要类型安全的 HTTP 客户端时使用。可按模块、方法、路径范围筛选要生成的接口。生成的文件写入项目配置的输出目录。",
1029
+ inputSchema: {
1030
+ project: projectParam,
1031
+ module: z.array(z.string()).optional().describe("Module(s) to generate code for"),
1032
+ method: z.string().optional().describe("HTTP method filter (e.g. GET, POST)"),
1033
+ pathname: z.string().optional().describe("Pathname filter (glob pattern supported, e.g. /api/v1/users/**)"),
1034
+ fresh: z.boolean().optional().default(false).describe("Clean output directory before building")
1035
+ },
1036
+ annotations: {
1037
+ readOnlyHint: false,
1038
+ destructiveHint: false
1039
+ }
1040
+ }, async ({ project, module, method, pathname, fresh }) => {
1041
+ try {
1042
+ const provider = await registry.resolve(project);
1043
+ const configPath = registry.getConfigPath(project);
1044
+ const filterRules = [];
1045
+ if (module || method || pathname) filterRules.push({
1046
+ deny: true,
1047
+ persist: false,
1048
+ moduleName: "*",
1049
+ operationMethod: "*",
1050
+ operationPathname: "/**"
1051
+ }, ...xprodFilterRules({
1052
+ module,
1053
+ method,
1054
+ pathname,
1055
+ persist: false
1056
+ }));
1057
+ const buildCompiler = new Compiler({
1058
+ build: true,
1059
+ persist: true,
1060
+ silent: true,
1061
+ fresh,
1062
+ config: configPath,
1063
+ debug,
1064
+ tolerant,
1065
+ filter: filterRules.length > 0 ? { rules: filterRules } : void 0
1066
+ });
1067
+ await buildCompiler.run();
1068
+ const artifacts = buildCompiler.context.artifacts || [];
1069
+ const rc = buildCompiler.context.rc;
1070
+ const files = artifacts.map((a) => rc ? `./${path$1.join(rc.outdir, a.filepath)}` : a.filepath);
1071
+ await provider.invalidate();
1072
+ return { content: [{
1073
+ type: "text",
1074
+ text: JSON.stringify({
1075
+ generated: files.length,
1076
+ files
1077
+ }, null, 2)
1078
+ }] };
1079
+ } catch (error) {
1080
+ return {
1081
+ content: [{
1082
+ type: "text",
1083
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
1084
+ }],
1085
+ isError: true
1086
+ };
1087
+ }
1088
+ });
1089
+ server.registerTool("list_generated_files", {
1090
+ description: "列出已生成的 API 客户端代码文件。当用户想查看哪些接口已经生成了代码、或想找出过期/无效的生成文件时使用。",
1091
+ inputSchema: {
1092
+ project: projectParam,
1093
+ invalid: z.boolean().optional().default(false).describe("If true, only list invalid/stale files not matching current build")
1094
+ },
1095
+ annotations: {
1096
+ readOnlyHint: true,
1097
+ destructiveHint: false
1098
+ }
1099
+ }, async ({ project, invalid }) => {
1100
+ try {
1101
+ const context = await (await registry.resolve(project)).getContext();
1102
+ const rc = context.rc;
1103
+ if (!rc) return {
1104
+ content: [{
1105
+ type: "text",
1106
+ text: "Error: Failed to load configuration"
1107
+ }],
1108
+ isError: true
1109
+ };
1110
+ if (invalid) {
1111
+ const validFilePaths = (context.artifacts || []).map((a) => a.filepath);
1112
+ const files = (await findInvalidFiles(rc.outdir, validFilePaths)).map((f) => `./${path$1.join(rc.outdir, f.relativePath)}`);
1113
+ return { content: [{
1114
+ type: "text",
1115
+ text: JSON.stringify({
1116
+ count: files.length,
1117
+ files
1118
+ }, null, 2)
1119
+ }] };
1120
+ }
1121
+ const files = (context.artifacts || []).map((a) => `./${path$1.join(rc.outdir, a.filepath)}`);
1122
+ return { content: [{
1123
+ type: "text",
1124
+ text: JSON.stringify({
1125
+ count: files.length,
1126
+ files
1127
+ }, null, 2)
1128
+ }] };
1129
+ } catch (error) {
1130
+ return {
1131
+ content: [{
1132
+ type: "text",
1133
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
1134
+ }],
1135
+ isError: true
1136
+ };
1137
+ }
1138
+ });
1139
+ server.registerTool("get_filter_rules", {
1140
+ description: "查看当前的接口过滤规则。过滤规则决定哪些 API 接口会被纳入代码生成范围。当用户想了解哪些接口被排除或包含在生成列表中时使用。",
1141
+ inputSchema: { project: projectParam },
1142
+ annotations: {
1143
+ readOnlyHint: true,
1144
+ destructiveHint: false
1145
+ }
1146
+ }, async ({ project }) => {
1147
+ try {
1148
+ await registry.resolve(project);
1149
+ const configPath = registry.getConfigPath(project);
1150
+ const filterPath = path$1.resolve(path$1.dirname(configPath), ".keqfilter");
1151
+ if (!await fs.exists(filterPath)) return { content: [{
1152
+ type: "text",
1153
+ text: JSON.stringify({
1154
+ exists: false,
1155
+ content: ""
1156
+ }, null, 2)
1157
+ }] };
1158
+ const content = await fs.readFile(filterPath, "utf-8");
1159
+ return { content: [{
1160
+ type: "text",
1161
+ text: JSON.stringify({
1162
+ exists: true,
1163
+ content
1164
+ }, null, 2)
1165
+ }] };
1166
+ } catch (error) {
1167
+ return {
1168
+ content: [{
1169
+ type: "text",
1170
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
1171
+ }],
1172
+ isError: true
1173
+ };
1174
+ }
1175
+ });
1176
+ server.registerTool("add_filter_rule", {
1177
+ description: "添加接口过滤规则,控制哪些 API 需要生成代码。当用户想排除某些不需要的接口、或只保留特定接口时使用。deny 模式排除接口,allow 模式包含接口。",
1178
+ inputSchema: {
1179
+ project: projectParam,
1180
+ mode: z.enum(["deny", "allow"]).describe("Rule mode: deny excludes APIs, allow includes them"),
1181
+ module: z.string().optional().default("*").describe("Module name pattern (glob supported)"),
1182
+ method: z.string().optional().default("*").describe("HTTP method pattern (e.g. GET, POST, or * for all)"),
1183
+ pathname: z.string().describe("Pathname pattern (glob supported, e.g. /api/v1/users/**)"),
1184
+ build: z.boolean().optional().default(false).describe("Whether to rebuild after adding the rule")
1185
+ },
1186
+ annotations: {
1187
+ readOnlyHint: false,
1188
+ destructiveHint: false
1189
+ }
1190
+ }, async ({ project, mode, module, method, pathname, build }) => {
1191
+ try {
1192
+ const provider = await registry.resolve(project);
1193
+ await new Compiler({
1194
+ build,
1195
+ persist: true,
1196
+ silent: true,
1197
+ config: registry.getConfigPath(project),
1198
+ debug,
1199
+ tolerant,
1200
+ filter: { rules: [{
1201
+ persist: true,
1202
+ deny: mode === "deny",
1203
+ moduleName: module,
1204
+ operationMethod: method.toLowerCase(),
1205
+ operationPathname: pathname
1206
+ }] }
1207
+ }).run();
1208
+ if (build) await provider.invalidate();
1209
+ return { content: [{
1210
+ type: "text",
1211
+ text: JSON.stringify({
1212
+ success: true,
1213
+ rule: {
1214
+ mode,
1215
+ module,
1216
+ method,
1217
+ pathname
1218
+ }
1219
+ }, null, 2)
1220
+ }] };
1221
+ } catch (error) {
1222
+ return {
1223
+ content: [{
1224
+ type: "text",
1225
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
1226
+ }],
1227
+ isError: true
1228
+ };
1229
+ }
1230
+ });
1231
+ server.registerTool("remove_filter_rule", {
1232
+ description: "移除已有的接口过滤规则。当用户想恢复之前被排除的接口、或调整过滤策略时使用。",
1233
+ inputSchema: {
1234
+ project: projectParam,
1235
+ mode: z.enum(["deny", "allow"]).describe("Which section the rule is in"),
1236
+ module: z.string().describe("Exact module name pattern to match"),
1237
+ method: z.string().describe("Exact method pattern to match"),
1238
+ pathname: z.string().describe("Exact pathname pattern to match"),
1239
+ build: z.boolean().optional().default(false).describe("Whether to rebuild after removing the rule")
1240
+ },
1241
+ annotations: {
1242
+ readOnlyHint: false,
1243
+ destructiveHint: false
1244
+ }
1245
+ }, async ({ project, mode, module, method, pathname, build }) => {
1246
+ try {
1247
+ const provider = await registry.resolve(project);
1248
+ const configPath = registry.getConfigPath(project);
1249
+ const filterPath = path$1.resolve(path$1.dirname(configPath), ".keqfilter");
1250
+ if (!await fs.exists(filterPath)) return {
1251
+ content: [{
1252
+ type: "text",
1253
+ text: "Error: .keqfilter file not found"
1254
+ }],
1255
+ isError: true
1256
+ };
1257
+ const content = await fs.readFile(filterPath, "utf-8");
1258
+ const isDeny = mode === "deny";
1259
+ const targetMethod = method.toLowerCase();
1260
+ const lines = content.split("\n");
1261
+ const resultLines = [];
1262
+ let currentSection = null;
1263
+ let skipNext = false;
1264
+ for (const line of lines) {
1265
+ const trimmed = line.replace(/#.*$/, "").trim();
1266
+ if (trimmed === "[deny]") {
1267
+ currentSection = "deny";
1268
+ resultLines.push(line);
1269
+ continue;
1270
+ }
1271
+ if (trimmed === "[allow]") {
1272
+ currentSection = "allow";
1273
+ resultLines.push(line);
1274
+ continue;
1275
+ }
1276
+ if (!trimmed) {
1277
+ if (!skipNext) resultLines.push(line);
1278
+ skipNext = false;
1279
+ continue;
1280
+ }
1281
+ const matched = trimmed.match(/^([^\s]+)\s+([^:\s]+):(.*)$/);
1282
+ if (matched && currentSection === (isDeny ? "deny" : "allow")) {
1283
+ const [, ruleMethod, ruleModule, rulePathname] = matched;
1284
+ if (ruleMethod.toLowerCase() === targetMethod && ruleModule === module && rulePathname === pathname) {
1285
+ skipNext = false;
1286
+ continue;
1287
+ }
1288
+ }
1289
+ resultLines.push(line);
1290
+ skipNext = false;
1291
+ }
1292
+ await fs.writeFile(filterPath, resultLines.join("\n"), "utf-8");
1293
+ if (build) {
1294
+ await new Compiler({
1295
+ build: true,
1296
+ persist: true,
1297
+ silent: true,
1298
+ config: configPath,
1299
+ debug,
1300
+ tolerant
1301
+ }).run();
1302
+ await provider.invalidate();
1303
+ }
1304
+ return { content: [{
1305
+ type: "text",
1306
+ text: JSON.stringify({
1307
+ success: true,
1308
+ removed: {
1309
+ mode,
1310
+ module,
1311
+ method,
1312
+ pathname
1313
+ }
1314
+ }, null, 2)
1315
+ }] };
1316
+ } catch (error) {
1317
+ return {
1318
+ content: [{
1319
+ type: "text",
1320
+ text: `Error: ${error instanceof Error ? error.message : String(error)}`
1321
+ }],
1322
+ isError: true
1323
+ };
1324
+ }
1325
+ });
1326
+ const transport = new StdioServerTransport();
1327
+ await server.connect(transport);
1328
+ if (registry.list().length === 1) (await registry.resolve()).getEngine().catch(() => {});
1329
+ });
1330
+ }
1331
+ //#endregion
1332
+ //#region src/cli.ts
1333
+ if (semver.lt(process.version, "20.0.0")) throw new Error("Node.js version must be greater than 20");
1334
+ const program = new Command();
1335
+ registerBuildCommand(program);
1336
+ registerFilterCommand(program);
1337
+ registerListCommand(program);
1338
+ registerApisCommand(program);
1339
+ registerMockCommand(program);
1340
+ registerInitCommand(program);
1341
+ registerSearchCommand(program);
1342
+ registerMcpCommand(program);
1343
+ async function main() {
1344
+ program.on("command:*", function(operands) {
1345
+ throw new Error(`Unknown command '${String(operands[0])}'`);
1346
+ });
1347
+ try {
1348
+ await program.parseAsync(process.argv);
1349
+ } catch (err) {
1350
+ if (process.argv.includes("--debug")) console.error(err);
1351
+ else logger.error(err instanceof Error ? err.message : String(err));
1352
+ process.exit(1);
1353
+ }
1354
+ }
1355
+ main();
1356
+ //#endregion
1357
+ export {};
1358
+
1359
+ //# sourceMappingURL=cli.mjs.map