@warlock.js/core 5.30.0 → 5.31.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 (797) hide show
  1. package/CHANGELOG.md +142 -36
  2. package/README.md +28 -23
  3. package/bin/source-load-hook.mjs +63 -0
  4. package/bin/warlock.js +102 -42
  5. package/esm/cli/commands/add.command.mjs +4 -2
  6. package/esm/cli/commands/add.command.mjs.map +1 -1
  7. package/esm/cli/commands/agents-md/agents-md-command.action.mjs +69 -0
  8. package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -0
  9. package/esm/cli/commands/agents-md.command.mjs +38 -0
  10. package/esm/cli/commands/agents-md.command.mjs.map +1 -0
  11. package/esm/cli/commands/board/board-command.action.mjs +279 -0
  12. package/esm/cli/commands/board/board-command.action.mjs.map +1 -0
  13. package/esm/cli/commands/board.command.mjs +78 -0
  14. package/esm/cli/commands/board.command.mjs.map +1 -0
  15. package/esm/cli/commands/build.command.mjs +6 -1
  16. package/esm/cli/commands/build.command.mjs.map +1 -1
  17. package/esm/cli/commands/check/check-command.action.mjs +57 -0
  18. package/esm/cli/commands/check/check-command.action.mjs.map +1 -0
  19. package/esm/cli/commands/check/child-typecheck.mjs +66 -0
  20. package/esm/cli/commands/check/child-typecheck.mjs.map +1 -0
  21. package/esm/cli/commands/check/format-problems.mjs +43 -0
  22. package/esm/cli/commands/check/format-problems.mjs.map +1 -0
  23. package/esm/cli/commands/check/typecheck-command.action.mjs +61 -0
  24. package/esm/cli/commands/check/typecheck-command.action.mjs.map +1 -0
  25. package/esm/cli/commands/check.command.mjs +50 -0
  26. package/esm/cli/commands/check.command.mjs.map +1 -0
  27. package/esm/cli/commands/dev-server.command.mjs +9 -1
  28. package/esm/cli/commands/dev-server.command.mjs.map +1 -1
  29. package/esm/cli/commands/doctor/boot-for-diagnostics.mjs +8 -3
  30. package/esm/cli/commands/doctor/boot-for-diagnostics.mjs.map +1 -1
  31. package/esm/cli/commands/doctor/check.types.d.mts +76 -0
  32. package/esm/cli/commands/doctor/check.types.d.mts.map +1 -0
  33. package/esm/cli/commands/doctor/checks/config.check.mjs +1 -0
  34. package/esm/cli/commands/doctor/checks/config.check.mjs.map +1 -1
  35. package/esm/cli/commands/doctor/checks/connectors.check.mjs +2 -0
  36. package/esm/cli/commands/doctor/checks/connectors.check.mjs.map +1 -1
  37. package/esm/cli/commands/doctor/checks/handler-signature.check.mjs +1 -0
  38. package/esm/cli/commands/doctor/checks/handler-signature.check.mjs.map +1 -1
  39. package/esm/cli/commands/doctor/checks/health.check.mjs +3 -0
  40. package/esm/cli/commands/doctor/checks/health.check.mjs.map +1 -1
  41. package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs +1 -0
  42. package/esm/cli/commands/doctor/checks/jwt-secret.check.mjs.map +1 -1
  43. package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +1 -0
  44. package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
  45. package/esm/cli/commands/doctor/checks/optional-peers.check.mjs +1 -0
  46. package/esm/cli/commands/doctor/checks/optional-peers.check.mjs.map +1 -1
  47. package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs +4 -0
  48. package/esm/cli/commands/doctor/checks/release-hygiene.check.mjs.map +1 -1
  49. package/esm/cli/commands/doctor/checks/routes.check.mjs +3 -0
  50. package/esm/cli/commands/doctor/checks/routes.check.mjs.map +1 -1
  51. package/esm/cli/commands/doctor/doctor-command.action.mjs +14 -6
  52. package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
  53. package/esm/cli/commands/doctor/format-report.mjs +30 -2
  54. package/esm/cli/commands/doctor/format-report.mjs.map +1 -1
  55. package/esm/cli/commands/doctor.command.mjs +4 -0
  56. package/esm/cli/commands/doctor.command.mjs.map +1 -1
  57. package/esm/cli/commands/explain/explain-command.action.mjs +64 -0
  58. package/esm/cli/commands/explain/explain-command.action.mjs.map +1 -0
  59. package/esm/cli/commands/explain.command.mjs +23 -0
  60. package/esm/cli/commands/explain.command.mjs.map +1 -0
  61. package/esm/cli/commands/generate/generate.command.mjs +124 -124
  62. package/esm/cli/commands/generate/generate.command.mjs.map +1 -1
  63. package/esm/cli/commands/generate/generators/endpoint.generator.mjs +311 -0
  64. package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -0
  65. package/esm/cli/commands/generate/generators/migration.generator.mjs +1 -1
  66. package/esm/cli/commands/generate/generators/migration.generator.mjs.map +1 -1
  67. package/esm/cli/commands/generate/generators/model.generator.mjs +1 -1
  68. package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +341 -0
  69. package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -0
  70. package/esm/cli/commands/generate/templates/stubs.mjs +19 -6
  71. package/esm/cli/commands/generate/templates/stubs.mjs.map +1 -1
  72. package/esm/cli/commands/generate/utils/endpoint-schema.mjs +137 -0
  73. package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -0
  74. package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
  75. package/esm/cli/commands/generate/utils/name-parser.mjs.map +1 -1
  76. package/esm/cli/commands/generate/utils/prompt.mjs.map +1 -1
  77. package/esm/cli/commands/generate/utils/writer.mjs +38 -13
  78. package/esm/cli/commands/generate/utils/writer.mjs.map +1 -1
  79. package/esm/cli/commands/inspect/inspect-command.action.mjs +72 -0
  80. package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -0
  81. package/esm/cli/commands/inspect.command.mjs +39 -0
  82. package/esm/cli/commands/inspect.command.mjs.map +1 -0
  83. package/esm/cli/commands/mcp/mcp-command.action.mjs +103 -0
  84. package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -0
  85. package/esm/cli/commands/mcp.command.mjs +76 -0
  86. package/esm/cli/commands/mcp.command.mjs.map +1 -0
  87. package/esm/cli/commands/openapi-generator.action.mjs.map +1 -1
  88. package/esm/cli/commands/openapi-generator.command.mjs.map +1 -1
  89. package/esm/cli/commands/postman-generator.action.mjs.map +1 -1
  90. package/esm/cli/commands/postman-generator.command.mjs.map +1 -1
  91. package/esm/cli/commands/routes/routes-diff.action.mjs +1 -1
  92. package/esm/cli/commands/test.command.mjs +131 -0
  93. package/esm/cli/commands/test.command.mjs.map +1 -0
  94. package/esm/cli/commands/trace/trace-command.action.mjs +145 -0
  95. package/esm/cli/commands/trace/trace-command.action.mjs.map +1 -0
  96. package/esm/cli/commands/trace.command.mjs +60 -0
  97. package/esm/cli/commands/trace.command.mjs.map +1 -0
  98. package/esm/cli/commands/typecheck.command.mjs +40 -0
  99. package/esm/cli/commands/typecheck.command.mjs.map +1 -0
  100. package/esm/cli/commands/upgrade.command.mjs +46 -0
  101. package/esm/cli/commands/upgrade.command.mjs.map +1 -0
  102. package/esm/cli/flush-and-exit.mjs +34 -0
  103. package/esm/cli/flush-and-exit.mjs.map +1 -0
  104. package/esm/cli/framework-cli-commands.mjs +23 -1
  105. package/esm/cli/framework-cli-commands.mjs.map +1 -1
  106. package/esm/cli/parse-cli-args.mjs +1 -0
  107. package/esm/cli/parse-cli-args.mjs.map +1 -1
  108. package/esm/config/config-loader.d.mts.map +1 -1
  109. package/esm/config/config-loader.mjs +34 -13
  110. package/esm/config/config-loader.mjs.map +1 -1
  111. package/esm/config/config-schema.d.mts +67 -0
  112. package/esm/config/config-schema.d.mts.map +1 -0
  113. package/esm/config/config-schema.mjs +77 -0
  114. package/esm/config/config-schema.mjs.map +1 -0
  115. package/esm/config/index.d.mts +6 -0
  116. package/esm/config/index.mjs +1 -0
  117. package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
  118. package/esm/connectors/assert-no-reserved-connector-names.mjs +2 -1
  119. package/esm/connectors/assert-no-reserved-connector-names.mjs.map +1 -1
  120. package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
  121. package/esm/connectors/assert-unique-connector-names.mjs +26 -2
  122. package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
  123. package/esm/connectors/http-connector.d.mts.map +1 -1
  124. package/esm/connectors/http-connector.mjs +3 -2
  125. package/esm/connectors/http-connector.mjs.map +1 -1
  126. package/esm/connectors/single-server-warnings.mjs.map +1 -1
  127. package/esm/connectors/socket-connector.d.mts.map +1 -1
  128. package/esm/connectors/socket-connector.mjs.map +1 -1
  129. package/esm/container/index.d.mts.map +1 -1
  130. package/esm/container/index.mjs.map +1 -1
  131. package/esm/database/migrate-action.mjs.map +1 -1
  132. package/esm/database/models/database-log/database-log.d.mts +0 -28
  133. package/esm/database/models/database-log/database-log.d.mts.map +1 -1
  134. package/esm/database/seeds/seeder.errors.d.mts +4 -0
  135. package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
  136. package/esm/database/seeds/seeder.errors.mjs +2 -0
  137. package/esm/database/seeds/seeder.errors.mjs.map +1 -1
  138. package/esm/dev-server/boot-precondition-error.mjs +1 -0
  139. package/esm/dev-server/boot-precondition-error.mjs.map +1 -1
  140. package/esm/dev-server/create-worker.mjs +15 -9
  141. package/esm/dev-server/create-worker.mjs.map +1 -1
  142. package/esm/dev-server/dev-agent-tooling.mjs +135 -0
  143. package/esm/dev-server/dev-agent-tooling.mjs.map +1 -0
  144. package/esm/dev-server/dev-logger.mjs.map +1 -1
  145. package/esm/dev-server/development-server.mjs +8 -0
  146. package/esm/dev-server/development-server.mjs.map +1 -1
  147. package/esm/dev-server/files-orchestrator.mjs +4 -5
  148. package/esm/dev-server/files-orchestrator.mjs.map +1 -1
  149. package/esm/dev-server/files-watcher.mjs +1 -1
  150. package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +2 -3
  151. package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
  152. package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs +33 -0
  153. package/esm/dev-server/health-checker/checkers/oxlint-health-checker.mjs.map +1 -0
  154. package/esm/dev-server/health-checker/default-health-checkers.mjs +31 -0
  155. package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -0
  156. package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +9 -3
  157. package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
  158. package/esm/dev-server/health-checker/files-healthcare.manager.mjs +15 -4
  159. package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
  160. package/esm/dev-server/health-checker/oxlint-runner.mjs +302 -0
  161. package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -0
  162. package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -0
  163. package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs +42 -0
  164. package/esm/dev-server/health-checker/workers/oxlint-health.worker.mjs.map +1 -0
  165. package/esm/dev-server/loader/loader-port-acks.mjs +1 -1
  166. package/esm/dev-server/loader/loader-port-acks.mjs.map +1 -1
  167. package/esm/dev-server/loader/register-loader.mjs +1 -1
  168. package/esm/dev-server/loader/register-loader.mjs.map +1 -1
  169. package/esm/dev-server/loader/resolve-hook.mjs +1 -1
  170. package/esm/dev-server/loader/transpile-cache.mjs +1 -1
  171. package/esm/dev-server/model-resource-typings.mjs.map +1 -1
  172. package/esm/dev-server/module-loader.mjs +1 -0
  173. package/esm/dev-server/module-loader.mjs.map +1 -1
  174. package/esm/dev-server/parse-imports.mjs +1 -1
  175. package/esm/dev-server/parse-imports.mjs.map +1 -1
  176. package/esm/dev-server/route-types-publisher.mjs +1 -1
  177. package/esm/dev-server/start-development-server.mjs.map +1 -1
  178. package/esm/dev-server/translation-keys-sources.mjs +1 -1
  179. package/esm/dev-server/translation-keys-sources.mjs.map +1 -1
  180. package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
  181. package/esm/dev-server/type-generator.mjs +3 -3
  182. package/esm/dev-server/type-generator.mjs.map +1 -1
  183. package/esm/dev-server/types.d.mts.map +1 -1
  184. package/esm/errors/container-key-missing-error.mjs +1 -0
  185. package/esm/errors/container-key-missing-error.mjs.map +1 -1
  186. package/esm/errors/error-codes.d.mts +653 -0
  187. package/esm/errors/error-codes.d.mts.map +1 -0
  188. package/esm/errors/error-codes.mjs +634 -0
  189. package/esm/errors/error-codes.mjs.map +1 -0
  190. package/esm/errors/esbuild-binary-missing-error.mjs +1 -0
  191. package/esm/errors/esbuild-binary-missing-error.mjs.map +1 -1
  192. package/esm/errors/index.d.mts +3 -1
  193. package/esm/errors/index.mjs +3 -1
  194. package/esm/errors/unknown-locale-error.mjs +1 -0
  195. package/esm/errors/unknown-locale-error.mjs.map +1 -1
  196. package/esm/errors/warlock-error.d.mts +23 -0
  197. package/esm/errors/warlock-error.d.mts.map +1 -0
  198. package/esm/errors/warlock-error.mjs +22 -0
  199. package/esm/errors/warlock-error.mjs.map +1 -0
  200. package/esm/generations/add-command.action.mjs +19 -3
  201. package/esm/generations/add-command.action.mjs.map +1 -1
  202. package/esm/generations/features/access.feature.mjs +1 -1
  203. package/esm/generations/features/access.feature.mjs.map +1 -1
  204. package/esm/generations/features/bull-board.feature.mjs +1 -1
  205. package/esm/generations/features/bull-board.feature.mjs.map +1 -1
  206. package/esm/generations/features/mysql.feature.mjs.map +1 -1
  207. package/esm/generations/features/notifications.feature.mjs +5 -2
  208. package/esm/generations/features/notifications.feature.mjs.map +1 -1
  209. package/esm/generations/features/queue.feature.mjs +1 -1
  210. package/esm/generations/features/queue.feature.mjs.map +1 -1
  211. package/esm/generations/features/react-email.feature.mjs +1 -1
  212. package/esm/generations/features/react-email.feature.mjs.map +1 -1
  213. package/esm/generations/features/shadcn.feature.mjs +1 -1
  214. package/esm/generations/features/shadcn.feature.mjs.map +1 -1
  215. package/esm/generations/features/shared/link-ai-package-import.mjs +1 -1
  216. package/esm/generations/features/shared/link-ai-package-import.mjs.map +1 -1
  217. package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
  218. package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
  219. package/esm/generations/features/shared/patch-tsconfig-include.mjs.map +1 -1
  220. package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
  221. package/esm/generations/features/shared/relocate-conflicting-home-route.mjs.map +1 -1
  222. package/esm/generations/features/sitemap.feature.mjs +1 -1
  223. package/esm/generations/features/sitemap.feature.mjs.map +1 -1
  224. package/esm/generations/features/tailwind.feature.mjs +1 -1
  225. package/esm/generations/features/tailwind.feature.mjs.map +1 -1
  226. package/esm/generations/features/test.feature.mjs +11 -6
  227. package/esm/generations/features/test.feature.mjs.map +1 -1
  228. package/esm/generations/features/web.feature.mjs +1 -1
  229. package/esm/generations/features/web.feature.mjs.map +1 -1
  230. package/esm/generations/generation-fs.mjs +73 -0
  231. package/esm/generations/generation-fs.mjs.map +1 -0
  232. package/esm/generations/generation-run.mjs +185 -0
  233. package/esm/generations/generation-run.mjs.map +1 -0
  234. package/esm/generations/stubs.mjs +155 -13
  235. package/esm/generations/stubs.mjs.map +1 -1
  236. package/esm/http/bounded-stream-queue.d.mts +10 -0
  237. package/esm/http/bounded-stream-queue.d.mts.map +1 -0
  238. package/esm/http/bounded-stream-queue.mjs +97 -0
  239. package/esm/http/bounded-stream-queue.mjs.map +1 -0
  240. package/esm/http/build-rate-limit-options.d.mts +13 -0
  241. package/esm/http/build-rate-limit-options.d.mts.map +1 -1
  242. package/esm/http/build-rate-limit-options.mjs.map +1 -1
  243. package/esm/http/conditional-request.d.mts +86 -0
  244. package/esm/http/conditional-request.d.mts.map +1 -0
  245. package/esm/http/conditional-request.mjs +121 -0
  246. package/esm/http/conditional-request.mjs.map +1 -0
  247. package/esm/http/csp.d.mts +2 -0
  248. package/esm/http/csp.d.mts.map +1 -1
  249. package/esm/http/csp.mjs +1 -0
  250. package/esm/http/csp.mjs.map +1 -1
  251. package/esm/http/csrf-origin-policy.mjs.map +1 -1
  252. package/esm/http/database/RequestLog.d.mts +24 -84
  253. package/esm/http/database/RequestLog.d.mts.map +1 -1
  254. package/esm/http/errors/errors.d.mts +2 -0
  255. package/esm/http/errors/errors.d.mts.map +1 -1
  256. package/esm/http/errors/errors.mjs +1 -0
  257. package/esm/http/errors/errors.mjs.map +1 -1
  258. package/esm/http/escape-header-value.d.mts +18 -0
  259. package/esm/http/escape-header-value.d.mts.map +1 -0
  260. package/esm/http/escape-header-value.mjs +27 -0
  261. package/esm/http/escape-header-value.mjs.map +1 -0
  262. package/esm/http/flush-pending-cookies.mjs.map +1 -1
  263. package/esm/http/index.d.mts +5 -2
  264. package/esm/http/index.mjs +4 -1
  265. package/esm/http/lazy-static.mjs +194 -0
  266. package/esm/http/lazy-static.mjs.map +1 -0
  267. package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
  268. package/esm/http/plugins.d.mts.map +1 -1
  269. package/esm/http/plugins.mjs +7 -4
  270. package/esm/http/plugins.mjs.map +1 -1
  271. package/esm/http/rate-limit-cache-store.mjs +2 -1
  272. package/esm/http/rate-limit-cache-store.mjs.map +1 -1
  273. package/esm/http/request-log-snapshot.d.mts +12 -5
  274. package/esm/http/request-log-snapshot.d.mts.map +1 -1
  275. package/esm/http/request-log-snapshot.mjs +83 -4
  276. package/esm/http/request-log-snapshot.mjs.map +1 -1
  277. package/esm/http/request.d.mts +2 -2
  278. package/esm/http/request.d.mts.map +1 -1
  279. package/esm/http/request.mjs +5 -4
  280. package/esm/http/request.mjs.map +1 -1
  281. package/esm/http/response.d.mts +11 -1
  282. package/esm/http/response.d.mts.map +1 -1
  283. package/esm/http/response.mjs +164 -76
  284. package/esm/http/response.mjs.map +1 -1
  285. package/esm/http/safe-redirect.d.mts +51 -0
  286. package/esm/http/safe-redirect.d.mts.map +1 -0
  287. package/esm/http/safe-redirect.mjs +80 -0
  288. package/esm/http/safe-redirect.mjs.map +1 -0
  289. package/esm/http/serialized.d.mts.map +1 -1
  290. package/esm/http/server.d.mts +3 -1
  291. package/esm/http/server.d.mts.map +1 -1
  292. package/esm/http/server.mjs +14 -4
  293. package/esm/http/server.mjs.map +1 -1
  294. package/esm/http/stream-transport.mjs +4 -2
  295. package/esm/http/stream-transport.mjs.map +1 -1
  296. package/esm/http/types.d.mts +44 -11
  297. package/esm/http/types.d.mts.map +1 -1
  298. package/esm/http/uploads/generate-image-variant.mjs +1 -1
  299. package/esm/http/uploads/generate-image-variants.d.mts +10 -7
  300. package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
  301. package/esm/http/uploads/generate-image-variants.mjs +61 -24
  302. package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
  303. package/esm/http/uploads/image-variant-cache-entries.mjs +78 -0
  304. package/esm/http/uploads/image-variant-cache-entries.mjs.map +1 -0
  305. package/esm/http/uploads/image-variant-cache.mjs +72 -30
  306. package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
  307. package/esm/http/uploads/image-variant-types.d.mts +2 -0
  308. package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
  309. package/esm/http/uploads/image-variants-config-error.d.mts +3 -1
  310. package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
  311. package/esm/http/uploads/image-variants-config-error.mjs +3 -2
  312. package/esm/http/uploads/image-variants-config-error.mjs.map +1 -1
  313. package/esm/http/uploads/load-variant-source.mjs +1 -1
  314. package/esm/http/uploads/load-variant-source.mjs.map +1 -1
  315. package/esm/http/uploads/purge-image-variants.d.mts +7 -2
  316. package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
  317. package/esm/http/uploads/purge-image-variants.mjs +16 -16
  318. package/esm/http/uploads/purge-image-variants.mjs.map +1 -1
  319. package/esm/http/uploads/remote-variant-source.mjs +115 -0
  320. package/esm/http/uploads/remote-variant-source.mjs.map +1 -0
  321. package/esm/http/uploads/resolve-image-variant.d.mts +3 -4
  322. package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
  323. package/esm/http/uploads/resolve-image-variant.mjs +10 -18
  324. package/esm/http/uploads/resolve-image-variant.mjs.map +1 -1
  325. package/esm/http/uploads/resolve-image-variants-config.mjs +5 -3
  326. package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
  327. package/esm/http/uploads/resolve-remote-image-variant.mjs +89 -0
  328. package/esm/http/uploads/resolve-remote-image-variant.mjs.map +1 -0
  329. package/esm/http/uploads/trim-image-variant-cache.mjs +193 -0
  330. package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -0
  331. package/esm/http/uploads/uploaded-file.controller.d.mts +5 -3
  332. package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
  333. package/esm/http/uploads/uploaded-file.controller.mjs +16 -8
  334. package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
  335. package/esm/http/uploads/variant-cache-key.mjs +1 -1
  336. package/esm/http/uploads-types.d.mts +6 -2
  337. package/esm/http/uploads-types.d.mts.map +1 -1
  338. package/esm/index.d.mts +17 -6
  339. package/esm/index.mjs +14 -3
  340. package/esm/localization/parse-locale-dictionary.d.mts +2 -0
  341. package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
  342. package/esm/localization/parse-locale-dictionary.mjs +1 -0
  343. package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
  344. package/esm/mail/config.d.mts +12 -1
  345. package/esm/mail/config.d.mts.map +1 -1
  346. package/esm/mail/config.mjs +16 -1
  347. package/esm/mail/config.mjs.map +1 -1
  348. package/esm/mail/index.d.mts +1 -1
  349. package/esm/mail/index.mjs +1 -1
  350. package/esm/net/index.d.mts +2 -0
  351. package/esm/net/index.mjs +3 -0
  352. package/esm/openapi/build-openapi-document.d.mts.map +1 -1
  353. package/esm/openapi/build-openapi-document.mjs +8 -5
  354. package/esm/openapi/build-openapi-document.mjs.map +1 -1
  355. package/esm/openapi/error-responses.mjs +28 -2
  356. package/esm/openapi/error-responses.mjs.map +1 -1
  357. package/esm/openapi/postman/build-request-body.mjs.map +1 -1
  358. package/esm/openapi/postman/build-request-url.mjs.map +1 -1
  359. package/esm/openapi/postman/build-saved-responses.mjs.map +1 -1
  360. package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
  361. package/esm/openapi/postman/example-from-schema.mjs.map +1 -1
  362. package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
  363. package/esm/openapi/postman/openapi-to-postman-collection.mjs.map +1 -1
  364. package/esm/openapi/postman/schema-refs.mjs.map +1 -1
  365. package/esm/openapi/postman/uuid-v5.mjs.map +1 -1
  366. package/esm/openapi/request-schemas.mjs.map +1 -1
  367. package/esm/openapi/response-schemas.mjs.map +1 -1
  368. package/esm/openapi/schema-registry.d.mts +1 -0
  369. package/esm/openapi/schema-registry.mjs.map +1 -1
  370. package/esm/openapi/security.mjs.map +1 -1
  371. package/esm/openapi/types.d.mts +3 -2
  372. package/esm/openapi/types.d.mts.map +1 -1
  373. package/esm/production/assert-generated-imports.mjs +1 -0
  374. package/esm/production/assert-generated-imports.mjs.map +1 -1
  375. package/esm/production/production-builder.mjs +12 -4
  376. package/esm/production/production-builder.mjs.map +1 -1
  377. package/esm/production/resolve-build-config.mjs +1 -0
  378. package/esm/production/resolve-build-config.mjs.map +1 -1
  379. package/esm/production/route-registration-child.mjs.map +1 -1
  380. package/esm/production/route-registration-snapshot.mjs.map +1 -1
  381. package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
  382. package/esm/repositories/contracts/types.d.mts.map +1 -1
  383. package/esm/repositories/repository.manager.mjs.map +1 -1
  384. package/esm/resource/resource.d.mts.map +1 -1
  385. package/esm/resource/resource.mjs.map +1 -1
  386. package/esm/resource/types.d.mts.map +1 -1
  387. package/esm/restful/restful.d.mts +5 -5
  388. package/esm/restful/restful.d.mts.map +1 -1
  389. package/esm/restful/restful.mjs.map +1 -1
  390. package/esm/router/build-route-rate-limit.mjs.map +1 -1
  391. package/esm/router/dev-dispatch.mjs +31 -12
  392. package/esm/router/dev-dispatch.mjs.map +1 -1
  393. package/esm/router/index.d.mts +4 -2
  394. package/esm/router/index.mjs +2 -0
  395. package/esm/router/log-request-lifecycle.mjs.map +1 -1
  396. package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
  397. package/esm/router/positional-handler-diagnostics.mjs.map +1 -1
  398. package/esm/router/resolve-route-rate-limit.mjs +47 -0
  399. package/esm/router/resolve-route-rate-limit.mjs.map +1 -0
  400. package/esm/router/resolve-route-validation.mjs +19 -0
  401. package/esm/router/resolve-route-validation.mjs.map +1 -0
  402. package/esm/router/route-guard-names.mjs +30 -0
  403. package/esm/router/route-guard-names.mjs.map +1 -0
  404. package/esm/router/route-name-taken-error.d.mts +14 -0
  405. package/esm/router/route-name-taken-error.d.mts.map +1 -0
  406. package/esm/router/route-name-taken-error.mjs +18 -0
  407. package/esm/router/route-name-taken-error.mjs.map +1 -0
  408. package/esm/router/router.d.mts +32 -13
  409. package/esm/router/router.d.mts.map +1 -1
  410. package/esm/router/router.mjs +71 -38
  411. package/esm/router/router.mjs.map +1 -1
  412. package/esm/router/types.d.mts +137 -17
  413. package/esm/router/types.d.mts.map +1 -1
  414. package/esm/router/unguarded-route-diagnostics.d.mts +40 -0
  415. package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -0
  416. package/esm/router/unguarded-route-diagnostics.mjs +95 -0
  417. package/esm/router/unguarded-route-diagnostics.mjs.map +1 -0
  418. package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
  419. package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
  420. package/esm/storage/drivers/local-driver.d.mts.map +1 -1
  421. package/esm/storage/drivers/local-driver.mjs.map +1 -1
  422. package/esm/storage/local-disk-roots.mjs +24 -0
  423. package/esm/storage/local-disk-roots.mjs.map +1 -0
  424. package/esm/storage/storage.d.mts +14 -0
  425. package/esm/storage/storage.d.mts.map +1 -1
  426. package/esm/storage/storage.mjs +22 -0
  427. package/esm/storage/storage.mjs.map +1 -1
  428. package/esm/storage/types.d.mts.map +1 -1
  429. package/esm/storage/utils/storage-not-initialized-error.d.mts +2 -0
  430. package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
  431. package/esm/storage/utils/storage-not-initialized-error.mjs +1 -0
  432. package/esm/storage/utils/storage-not-initialized-error.mjs.map +1 -1
  433. package/esm/tests/authenticated-test-client.d.mts +32 -0
  434. package/esm/tests/authenticated-test-client.d.mts.map +1 -0
  435. package/esm/tests/authenticated-test-client.mjs +40 -0
  436. package/esm/tests/authenticated-test-client.mjs.map +1 -0
  437. package/esm/tests/factories.d.mts +59 -0
  438. package/esm/tests/factories.d.mts.map +1 -0
  439. package/esm/tests/factories.mjs +105 -0
  440. package/esm/tests/factories.mjs.map +1 -0
  441. package/esm/tests/fakes/cache-fake.d.mts +29 -0
  442. package/esm/tests/fakes/cache-fake.d.mts.map +1 -0
  443. package/esm/tests/fakes/cache-fake.mjs +79 -0
  444. package/esm/tests/fakes/cache-fake.mjs.map +1 -0
  445. package/esm/tests/fakes/clock-fake.d.mts +32 -0
  446. package/esm/tests/fakes/clock-fake.d.mts.map +1 -0
  447. package/esm/tests/fakes/clock-fake.mjs +69 -0
  448. package/esm/tests/fakes/clock-fake.mjs.map +1 -0
  449. package/esm/tests/fakes/fake-assertion-error.d.mts +13 -0
  450. package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -0
  451. package/esm/tests/fakes/fake-assertion-error.mjs +20 -0
  452. package/esm/tests/fakes/fake-assertion-error.mjs.map +1 -0
  453. package/esm/tests/fakes/ids-fake.d.mts +22 -0
  454. package/esm/tests/fakes/ids-fake.d.mts.map +1 -0
  455. package/esm/tests/fakes/ids-fake.mjs +57 -0
  456. package/esm/tests/fakes/ids-fake.mjs.map +1 -0
  457. package/esm/tests/fakes/index.d.mts +8 -0
  458. package/esm/tests/fakes/index.mjs +10 -0
  459. package/esm/tests/fakes/mail-fake.d.mts +41 -0
  460. package/esm/tests/fakes/mail-fake.d.mts.map +1 -0
  461. package/esm/tests/fakes/mail-fake.mjs +111 -0
  462. package/esm/tests/fakes/mail-fake.mjs.map +1 -0
  463. package/esm/tests/fakes/queue-fake.d.mts +48 -0
  464. package/esm/tests/fakes/queue-fake.d.mts.map +1 -0
  465. package/esm/tests/fakes/queue-fake.mjs +134 -0
  466. package/esm/tests/fakes/queue-fake.mjs.map +1 -0
  467. package/esm/tests/fakes/storage-fake.d.mts +31 -0
  468. package/esm/tests/fakes/storage-fake.d.mts.map +1 -0
  469. package/esm/tests/fakes/storage-fake.mjs +122 -0
  470. package/esm/tests/fakes/storage-fake.mjs.map +1 -0
  471. package/esm/tests/fakes/test-fakes.d.mts +39 -0
  472. package/esm/tests/fakes/test-fakes.d.mts.map +1 -0
  473. package/esm/tests/fakes/test-fakes.mjs +90 -0
  474. package/esm/tests/fakes/test-fakes.mjs.map +1 -0
  475. package/esm/tests/index.d.mts +14 -2
  476. package/esm/tests/index.mjs +15 -2
  477. package/esm/tests/snapshot-response.d.mts +34 -0
  478. package/esm/tests/snapshot-response.d.mts.map +1 -0
  479. package/esm/tests/snapshot-response.mjs +42 -0
  480. package/esm/tests/snapshot-response.mjs.map +1 -0
  481. package/esm/tests/start-http-development-server.d.mts +22 -0
  482. package/esm/tests/start-http-development-server.d.mts.map +1 -1
  483. package/esm/tests/start-http-development-server.mjs +36 -3
  484. package/esm/tests/start-http-development-server.mjs.map +1 -1
  485. package/esm/tests/test-helpers.d.mts +20 -1
  486. package/esm/tests/test-helpers.d.mts.map +1 -1
  487. package/esm/tests/test-helpers.mjs +40 -27
  488. package/esm/tests/test-helpers.mjs.map +1 -1
  489. package/esm/tests/test-http-server.d.mts +62 -0
  490. package/esm/tests/test-http-server.d.mts.map +1 -0
  491. package/esm/tests/test-http-server.mjs +119 -0
  492. package/esm/tests/test-http-server.mjs.map +1 -0
  493. package/esm/tests/vitest-setup.d.mts +11 -0
  494. package/esm/tests/vitest-setup.d.mts.map +1 -1
  495. package/esm/tests/vitest-setup.mjs +12 -4
  496. package/esm/tests/vitest-setup.mjs.map +1 -1
  497. package/esm/tooling/agents-md/agents-md-markers.d.mts +27 -0
  498. package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -0
  499. package/esm/tooling/agents-md/agents-md-markers.mjs +59 -0
  500. package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -0
  501. package/esm/tooling/agents-md/agents-md-refresher.d.mts +36 -0
  502. package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -0
  503. package/esm/tooling/agents-md/agents-md-refresher.mjs +72 -0
  504. package/esm/tooling/agents-md/agents-md-refresher.mjs.map +1 -0
  505. package/esm/tooling/agents-md/index.mjs +7 -0
  506. package/esm/tooling/agents-md/installed-skills.d.mts +30 -0
  507. package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -0
  508. package/esm/tooling/agents-md/installed-skills.mjs +74 -0
  509. package/esm/tooling/agents-md/installed-skills.mjs.map +1 -0
  510. package/esm/tooling/agents-md/render-agents-md.d.mts +33 -0
  511. package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -0
  512. package/esm/tooling/agents-md/render-agents-md.mjs +195 -0
  513. package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -0
  514. package/esm/tooling/agents-md/write-agents-md.d.mts +33 -0
  515. package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -0
  516. package/esm/tooling/agents-md/write-agents-md.mjs +49 -0
  517. package/esm/tooling/agents-md/write-agents-md.mjs.map +1 -0
  518. package/esm/tooling/board/board-message.d.mts +31 -0
  519. package/esm/tooling/board/board-message.d.mts.map +1 -0
  520. package/esm/tooling/board/board-message.mjs +86 -0
  521. package/esm/tooling/board/board-message.mjs.map +1 -0
  522. package/esm/tooling/board/board.d.mts +109 -0
  523. package/esm/tooling/board/board.d.mts.map +1 -0
  524. package/esm/tooling/board/board.mjs +406 -0
  525. package/esm/tooling/board/board.mjs.map +1 -0
  526. package/esm/tooling/board/board.types.d.mts +72 -0
  527. package/esm/tooling/board/board.types.d.mts.map +1 -0
  528. package/esm/tooling/board/board.types.mjs +54 -0
  529. package/esm/tooling/board/board.types.mjs.map +1 -0
  530. package/esm/tooling/check/changed-files.d.mts +33 -0
  531. package/esm/tooling/check/changed-files.d.mts.map +1 -0
  532. package/esm/tooling/check/changed-files.mjs +73 -0
  533. package/esm/tooling/check/changed-files.mjs.map +1 -0
  534. package/esm/tooling/check/check-report.types.d.mts +62 -0
  535. package/esm/tooling/check/check-report.types.d.mts.map +1 -0
  536. package/esm/tooling/check/check-report.types.mjs +37 -0
  537. package/esm/tooling/check/check-report.types.mjs.map +1 -0
  538. package/esm/tooling/check/code-style-conventions.mjs +106 -0
  539. package/esm/tooling/check/code-style-conventions.mjs.map +1 -0
  540. package/esm/tooling/check/conventions-step.d.mts +34 -0
  541. package/esm/tooling/check/conventions-step.d.mts.map +1 -0
  542. package/esm/tooling/check/conventions-step.mjs +184 -0
  543. package/esm/tooling/check/conventions-step.mjs.map +1 -0
  544. package/esm/tooling/check/environment-step.d.mts +18 -0
  545. package/esm/tooling/check/environment-step.d.mts.map +1 -0
  546. package/esm/tooling/check/environment-step.mjs +78 -0
  547. package/esm/tooling/check/environment-step.mjs.map +1 -0
  548. package/esm/tooling/check/index.d.mts +8 -0
  549. package/esm/tooling/check/index.mjs +10 -0
  550. package/esm/tooling/check/lint-step.d.mts +19 -0
  551. package/esm/tooling/check/lint-step.d.mts.map +1 -0
  552. package/esm/tooling/check/lint-step.mjs +111 -0
  553. package/esm/tooling/check/lint-step.mjs.map +1 -0
  554. package/esm/tooling/check/request-input.mjs +132 -0
  555. package/esm/tooling/check/request-input.mjs.map +1 -0
  556. package/esm/tooling/check/run-check.d.mts +35 -0
  557. package/esm/tooling/check/run-check.d.mts.map +1 -0
  558. package/esm/tooling/check/run-check.mjs +192 -0
  559. package/esm/tooling/check/run-check.mjs.map +1 -0
  560. package/esm/tooling/check/run-tests.d.mts +48 -0
  561. package/esm/tooling/check/run-tests.d.mts.map +1 -0
  562. package/esm/tooling/check/run-tests.mjs +93 -0
  563. package/esm/tooling/check/run-tests.mjs.map +1 -0
  564. package/esm/tooling/check/security-conventions.mjs +648 -0
  565. package/esm/tooling/check/security-conventions.mjs.map +1 -0
  566. package/esm/tooling/check/source-ast.mjs +195 -0
  567. package/esm/tooling/check/source-ast.mjs.map +1 -0
  568. package/esm/tooling/check/source-files.mjs +27 -0
  569. package/esm/tooling/check/source-files.mjs.map +1 -0
  570. package/esm/tooling/check/tests-step.d.mts +34 -0
  571. package/esm/tooling/check/tests-step.d.mts.map +1 -0
  572. package/esm/tooling/check/tests-step.mjs +177 -0
  573. package/esm/tooling/check/tests-step.mjs.map +1 -0
  574. package/esm/tooling/dev-state/dev-server-state.d.mts +39 -0
  575. package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -0
  576. package/esm/tooling/dev-state/dev-server-state.mjs +67 -0
  577. package/esm/tooling/dev-state/dev-server-state.mjs.map +1 -0
  578. package/esm/tooling/devtools/devtools-client.d.mts +91 -0
  579. package/esm/tooling/devtools/devtools-client.d.mts.map +1 -0
  580. package/esm/tooling/devtools/devtools-client.mjs +155 -0
  581. package/esm/tooling/devtools/devtools-client.mjs.map +1 -0
  582. package/esm/tooling/generate/generation.d.mts +78 -0
  583. package/esm/tooling/generate/generation.d.mts.map +1 -0
  584. package/esm/tooling/generate/generation.mjs +123 -0
  585. package/esm/tooling/generate/generation.mjs.map +1 -0
  586. package/esm/tooling/generate/generator-spec.d.mts +57 -0
  587. package/esm/tooling/generate/generator-spec.d.mts.map +1 -0
  588. package/esm/tooling/generate/generator-spec.mjs +102 -0
  589. package/esm/tooling/generate/generator-spec.mjs.map +1 -0
  590. package/esm/tooling/generate/index.mjs +6 -0
  591. package/esm/tooling/generate/project-files.mjs +121 -0
  592. package/esm/tooling/generate/project-files.mjs.map +1 -0
  593. package/esm/tooling/generate/run-cli.d.mts +40 -0
  594. package/esm/tooling/generate/run-cli.d.mts.map +1 -0
  595. package/esm/tooling/generate/run-cli.mjs +93 -0
  596. package/esm/tooling/generate/run-cli.mjs.map +1 -0
  597. package/esm/tooling/generate/unified-diff.d.mts +37 -0
  598. package/esm/tooling/generate/unified-diff.d.mts.map +1 -0
  599. package/esm/tooling/generate/unified-diff.mjs +161 -0
  600. package/esm/tooling/generate/unified-diff.mjs.map +1 -0
  601. package/esm/tooling/index.d.mts +41 -0
  602. package/esm/tooling/index.mjs +45 -0
  603. package/esm/tooling/inspect/boot-for-inspect.d.mts +23 -0
  604. package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -0
  605. package/esm/tooling/inspect/boot-for-inspect.mjs +63 -0
  606. package/esm/tooling/inspect/boot-for-inspect.mjs.map +1 -0
  607. package/esm/tooling/inspect/collect-config.mjs +77 -0
  608. package/esm/tooling/inspect/collect-config.mjs.map +1 -0
  609. package/esm/tooling/inspect/collect-models.d.mts +9 -0
  610. package/esm/tooling/inspect/collect-models.d.mts.map +1 -0
  611. package/esm/tooling/inspect/collect-models.mjs +154 -0
  612. package/esm/tooling/inspect/collect-models.mjs.map +1 -0
  613. package/esm/tooling/inspect/collect-packages.d.mts +10 -0
  614. package/esm/tooling/inspect/collect-packages.d.mts.map +1 -0
  615. package/esm/tooling/inspect/collect-packages.mjs +157 -0
  616. package/esm/tooling/inspect/collect-packages.mjs.map +1 -0
  617. package/esm/tooling/inspect/collect-pages.mjs +108 -0
  618. package/esm/tooling/inspect/collect-pages.mjs.map +1 -0
  619. package/esm/tooling/inspect/collect-routes.mjs +168 -0
  620. package/esm/tooling/inspect/collect-routes.mjs.map +1 -0
  621. package/esm/tooling/inspect/event-recorder.d.mts +37 -0
  622. package/esm/tooling/inspect/event-recorder.d.mts.map +1 -0
  623. package/esm/tooling/inspect/event-recorder.mjs +91 -0
  624. package/esm/tooling/inspect/event-recorder.mjs.map +1 -0
  625. package/esm/tooling/inspect/index.d.mts +7 -0
  626. package/esm/tooling/inspect/index.mjs +7 -0
  627. package/esm/tooling/inspect/inspect-app.d.mts +53 -0
  628. package/esm/tooling/inspect/inspect-app.d.mts.map +1 -0
  629. package/esm/tooling/inspect/inspect-app.mjs +92 -0
  630. package/esm/tooling/inspect/inspect-app.mjs.map +1 -0
  631. package/esm/tooling/inspect/inspect-report.schema.d.mts +15 -0
  632. package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -0
  633. package/esm/tooling/inspect/inspect-report.schema.mjs +463 -0
  634. package/esm/tooling/inspect/inspect-report.schema.mjs.map +1 -0
  635. package/esm/tooling/inspect/inspect-report.types.d.mts +196 -0
  636. package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -0
  637. package/esm/tooling/inspect/inspect-report.types.mjs +33 -0
  638. package/esm/tooling/inspect/inspect-report.types.mjs.map +1 -0
  639. package/esm/tooling/mcp/create-mcp-context.d.mts +26 -0
  640. package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -0
  641. package/esm/tooling/mcp/create-mcp-context.mjs +75 -0
  642. package/esm/tooling/mcp/create-mcp-context.mjs.map +1 -0
  643. package/esm/tooling/mcp/db-schema.d.mts +49 -0
  644. package/esm/tooling/mcp/db-schema.d.mts.map +1 -0
  645. package/esm/tooling/mcp/db-schema.mjs +56 -0
  646. package/esm/tooling/mcp/db-schema.mjs.map +1 -0
  647. package/esm/tooling/mcp/docs-search.d.mts +72 -0
  648. package/esm/tooling/mcp/docs-search.d.mts.map +1 -0
  649. package/esm/tooling/mcp/docs-search.mjs +178 -0
  650. package/esm/tooling/mcp/docs-search.mjs.map +1 -0
  651. package/esm/tooling/mcp/index.mjs +9 -0
  652. package/esm/tooling/mcp/load-ai-tools.d.mts +62 -0
  653. package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -0
  654. package/esm/tooling/mcp/load-ai-tools.mjs +44 -0
  655. package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -0
  656. package/esm/tooling/mcp/mcp-tools.d.mts +60 -0
  657. package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -0
  658. package/esm/tooling/mcp/mcp-tools.mjs +513 -0
  659. package/esm/tooling/mcp/mcp-tools.mjs.map +1 -0
  660. package/esm/tooling/mcp/start-mcp-server.d.mts +56 -0
  661. package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -0
  662. package/esm/tooling/mcp/start-mcp-server.mjs +126 -0
  663. package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -0
  664. package/esm/tooling/mcp/tool-input.d.mts +75 -0
  665. package/esm/tooling/mcp/tool-input.d.mts.map +1 -0
  666. package/esm/tooling/mcp/tool-input.mjs +72 -0
  667. package/esm/tooling/mcp/tool-input.mjs.map +1 -0
  668. package/esm/tooling/problem.d.mts +45 -0
  669. package/esm/tooling/problem.d.mts.map +1 -0
  670. package/esm/tooling/problem.mjs +28 -0
  671. package/esm/tooling/problem.mjs.map +1 -0
  672. package/esm/tooling/trace/trace-report.types.d.mts +71 -0
  673. package/esm/tooling/trace/trace-report.types.d.mts.map +1 -0
  674. package/esm/tooling/trace/trace-report.types.mjs +7 -0
  675. package/esm/tooling/trace/trace-report.types.mjs.map +1 -0
  676. package/esm/tooling/trace/trace-request.d.mts +83 -0
  677. package/esm/tooling/trace/trace-request.d.mts.map +1 -0
  678. package/esm/tooling/trace/trace-request.mjs +241 -0
  679. package/esm/tooling/trace/trace-request.mjs.map +1 -0
  680. package/esm/tooling/typecheck/index.d.mts +1 -0
  681. package/esm/tooling/typecheck/index.mjs +3 -0
  682. package/esm/tooling/typecheck/run-typecheck.d.mts +59 -0
  683. package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -0
  684. package/esm/tooling/typecheck/run-typecheck.mjs +153 -0
  685. package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -0
  686. package/esm/upgrade/codemods/head-viewport.mjs +46 -0
  687. package/esm/upgrade/codemods/head-viewport.mjs.map +1 -0
  688. package/esm/upgrade/codemods/helpers.mjs +81 -0
  689. package/esm/upgrade/codemods/helpers.mjs.map +1 -0
  690. package/esm/upgrade/codemods/index.mjs +34 -0
  691. package/esm/upgrade/codemods/index.mjs.map +1 -0
  692. package/esm/upgrade/codemods/logger-sync-calls.mjs +57 -0
  693. package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -0
  694. package/esm/upgrade/codemods/package-json.mjs +122 -0
  695. package/esm/upgrade/codemods/package-json.mjs.map +1 -0
  696. package/esm/upgrade/codemods/request-log-snapshot.mjs +82 -0
  697. package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -0
  698. package/esm/upgrade/codemods/review-sites.mjs +262 -0
  699. package/esm/upgrade/codemods/review-sites.mjs.map +1 -0
  700. package/esm/upgrade/diff.mjs +119 -0
  701. package/esm/upgrade/diff.mjs.map +1 -0
  702. package/esm/upgrade/format-upgrade-report.mjs +32 -0
  703. package/esm/upgrade/format-upgrade-report.mjs.map +1 -0
  704. package/esm/upgrade/load-ts-morph.mjs +48 -0
  705. package/esm/upgrade/load-ts-morph.mjs.map +1 -0
  706. package/esm/upgrade/notes.mjs +16 -0
  707. package/esm/upgrade/notes.mjs.map +1 -0
  708. package/esm/upgrade/run-upgrade.mjs +246 -0
  709. package/esm/upgrade/run-upgrade.mjs.map +1 -0
  710. package/esm/upgrade/upgrade-command.action.mjs +37 -0
  711. package/esm/upgrade/upgrade-command.action.mjs.map +1 -0
  712. package/esm/upgrade/version.mjs +39 -0
  713. package/esm/upgrade/version.mjs.map +1 -0
  714. package/esm/use-cases/use-cases-registry.mjs.map +1 -1
  715. package/esm/utils/clock.d.mts +33 -0
  716. package/esm/utils/clock.d.mts.map +1 -0
  717. package/esm/utils/clock.mjs +27 -0
  718. package/esm/utils/clock.mjs.map +1 -0
  719. package/esm/utils/framework-vesion.mjs +1 -1
  720. package/esm/utils/framework-vesion.mjs.map +1 -1
  721. package/esm/utils/ids.d.mts +32 -0
  722. package/esm/utils/ids.d.mts.map +1 -0
  723. package/esm/utils/ids.mjs +33 -0
  724. package/esm/utils/ids.mjs.map +1 -0
  725. package/esm/utils/index.d.mts +3 -0
  726. package/esm/utils/index.mjs +3 -0
  727. package/esm/utils/runtime.d.mts +59 -0
  728. package/esm/utils/runtime.d.mts.map +1 -0
  729. package/esm/utils/runtime.mjs +85 -0
  730. package/esm/utils/runtime.mjs.map +1 -0
  731. package/esm/validation/index.d.mts +1 -1
  732. package/esm/validation/types.d.mts +57 -2
  733. package/esm/validation/types.d.mts.map +1 -1
  734. package/esm/validation/validateAll.mjs +19 -2
  735. package/esm/validation/validateAll.mjs.map +1 -1
  736. package/esm/validation/validation-failure-status.mjs +15 -0
  737. package/esm/validation/validation-failure-status.mjs.map +1 -0
  738. package/esm/validation/validators/file-validator.d.mts +0 -16
  739. package/esm/validation/validators/file-validator.d.mts.map +1 -1
  740. package/esm/warlock-config/bundle-config.mjs +1 -1
  741. package/esm/warlock-config/types.d.mts +27 -3
  742. package/esm/warlock-config/types.d.mts.map +1 -1
  743. package/llms-full.txt +3166 -736
  744. package/llms.txt +16 -6
  745. package/package.json +43 -13
  746. package/schemas/inspect-report.schema.json +554 -0
  747. package/skills/README.md +9 -0
  748. package/skills/add-connector/SKILL.md +26 -38
  749. package/skills/benchmark-code/SKILL.md +30 -24
  750. package/skills/build-restful/SKILL.md +14 -14
  751. package/skills/build-url/SKILL.md +18 -18
  752. package/skills/configure-app/SKILL.md +107 -14
  753. package/skills/create-controller/SKILL.md +25 -12
  754. package/skills/create-module/SKILL.md +3 -3
  755. package/skills/define-resource/SKILL.md +32 -29
  756. package/skills/encrypt-data/SKILL.md +21 -19
  757. package/skills/generate-openapi/SKILL.md +50 -24
  758. package/skills/hash-password/SKILL.md +2 -2
  759. package/skills/health-checks/SKILL.md +24 -7
  760. package/skills/index.md +9 -4
  761. package/skills/lower-stage3-decorators/SKILL.md +4 -4
  762. package/skills/make-endpoint/SKILL.md +110 -0
  763. package/skills/model-factories/SKILL.md +92 -0
  764. package/skills/process-image/SKILL.md +32 -30
  765. package/skills/register-route/SKILL.md +109 -10
  766. package/skills/request-memo/SKILL.md +1 -1
  767. package/skills/request-tracing/SKILL.md +4 -1
  768. package/skills/resolve-path/SKILL.md +45 -44
  769. package/skills/retry-operation/SKILL.md +20 -11
  770. package/skills/run-app/SKILL.md +106 -22
  771. package/skills/send-response/SKILL.md +179 -14
  772. package/skills/store-file/SKILL.md +93 -53
  773. package/skills/test-fakes/SKILL.md +123 -0
  774. package/skills/test-http/SKILL.md +125 -21
  775. package/skills/test-service/SKILL.md +41 -1
  776. package/skills/update-packages/SKILL.md +29 -18
  777. package/skills/upgrade-from-5-29/SKILL.md +413 -0
  778. package/skills/upload-file/SKILL.md +31 -33
  779. package/skills/use-app-context/SKILL.md +38 -31
  780. package/skills/use-middleware/SKILL.md +45 -25
  781. package/skills/use-model-transformers/SKILL.md +37 -28
  782. package/skills/use-repository/SKILL.md +2 -2
  783. package/skills/validate-input/SKILL.md +72 -28
  784. package/skills/warlock-agents-md/SKILL.md +96 -0
  785. package/skills/warlock-board/SKILL.md +123 -0
  786. package/skills/warlock-check/SKILL.md +132 -0
  787. package/skills/warlock-conventions/SKILL.md +115 -0
  788. package/skills/warlock-doctor/SKILL.md +55 -22
  789. package/skills/warlock-inspect/SKILL.md +134 -0
  790. package/skills/warlock-mcp/SKILL.md +120 -0
  791. package/skills/warlock-routes/SKILL.md +18 -11
  792. package/skills/warlock-trace/SKILL.md +81 -0
  793. package/skills/wire-socket/SKILL.md +8 -8
  794. package/skills/write-seeder/SKILL.md +46 -32
  795. package/skills/write-use-case/SKILL.md +40 -27
  796. package/esm/http/uploads/matches-if-none-match.mjs +0 -13
  797. package/esm/http/uploads/matches-if-none-match.mjs.map +0 -1
@@ -0,0 +1,168 @@
1
+ import { config } from "../../config/config-getter.mjs";
2
+ import { buildRateLimitOptions } from "../../http/build-rate-limit-options.mjs";
3
+ import { buildDeclaredResponses } from "../../openapi/response-schemas.mjs";
4
+ import { expandMethods } from "../../openapi/paths.mjs";
5
+ import { buildRequestParts } from "../../openapi/request-schemas.mjs";
6
+ import { readRouteAuth } from "../../openapi/security.mjs";
7
+
8
+ //#region ../../packages/core/src/tooling/inspect/collect-routes.ts
9
+ /** Display order of methods within one path, matching `warlock routes`. */
10
+ const METHOD_ORDER = [
11
+ "GET",
12
+ "POST",
13
+ "PUT",
14
+ "PATCH",
15
+ "DELETE",
16
+ "OPTIONS",
17
+ "HEAD",
18
+ "ALL"
19
+ ];
20
+ function methodRank(method) {
21
+ const index = METHOD_ORDER.indexOf(method);
22
+ return index === -1 ? METHOD_ORDER.length : index;
23
+ }
24
+ /** The name of a function, without the `bound ` prefix `bind()` adds. */
25
+ function functionName(value) {
26
+ if (typeof value !== "function") return "anonymous";
27
+ const name = value.name.replace(/^bound /, "").trim();
28
+ return name.length > 0 ? name : "anonymous";
29
+ }
30
+ function limitValue(value) {
31
+ if (typeof value === "number") return value;
32
+ return value === void 0 || value === null ? null : "dynamic";
33
+ }
34
+ function windowValue(value) {
35
+ if (typeof value === "number" || typeof value === "string") return value;
36
+ return value === void 0 || value === null ? null : "dynamic";
37
+ }
38
+ /**
39
+ * The limiter a route runs under: its own `rateLimit` options, else the global
40
+ * `http.rateLimit` limiter (built with the same defaults the HTTP connector
41
+ * uses), else none. `rateLimit: false` exempts the route from the global
42
+ * limiter; `rateLimit: true` keeps it under the global policy.
43
+ */
44
+ function readRateLimit(route, global) {
45
+ if (typeof route.rateLimit === "object" && route.rateLimit !== null) return {
46
+ source: "route",
47
+ max: route.rateLimit.max,
48
+ timeWindow: route.rateLimit.timeWindow
49
+ };
50
+ if (!global || route.rateLimit === false) return {
51
+ source: "none",
52
+ max: null,
53
+ timeWindow: null
54
+ };
55
+ return {
56
+ source: "global",
57
+ max: limitValue(global.max),
58
+ timeWindow: windowValue(global.timeWindow)
59
+ };
60
+ }
61
+ /**
62
+ * What the route's request logs keep: the route's `logging` option over
63
+ * `http.logging`, the same precedence `resolveRequestLoggingOptions` applies.
64
+ * Private URL rules can only remove more, per URL, so they are flagged rather
65
+ * than evaluated.
66
+ */
67
+ function readLogging(route, global) {
68
+ return {
69
+ body: route.logging?.body ?? global.body ?? true,
70
+ query: route.logging?.query ?? global.query ?? true,
71
+ privateRules: (global.private?.length ?? 0) > 0
72
+ };
73
+ }
74
+ function globalRateLimit(warnings) {
75
+ try {
76
+ const options = buildRateLimitOptions(config.get("http.rateLimit"));
77
+ return options ? {
78
+ max: options.max,
79
+ timeWindow: options.timeWindow
80
+ } : null;
81
+ } catch (error) {
82
+ warnings.push({
83
+ code: null,
84
+ message: `http.rateLimit could not be read: ${error instanceof Error ? error.message : String(error)}`,
85
+ source: "routes"
86
+ });
87
+ return null;
88
+ }
89
+ }
90
+ /**
91
+ * Describe every route: identity, middleware chain, guard, limits, logging and
92
+ * the request/response schemas the OpenAPI generator derives (the same
93
+ * `buildRequestParts` / `buildDeclaredResponses` code, so `inspect` and
94
+ * `generate.openapi` never disagree). Resource `$ref`s land in `registry`.
95
+ */
96
+ function collectRoutes(routes, registry, warnings) {
97
+ const rateLimit = globalRateLimit(warnings);
98
+ const logging = config.get("http.logging") ?? {};
99
+ return routes.map((route) => {
100
+ const method = String(route.method).toUpperCase();
101
+ const label = `${method} ${route.path}`;
102
+ const warn = (message) => {
103
+ warnings.push({
104
+ code: message.includes("JSON Schema") ? "WL4001" : null,
105
+ message: `${label}: ${message}`,
106
+ source: route.sourceFile || null
107
+ });
108
+ };
109
+ const handler = route.handler;
110
+ const validation = handler?.validation;
111
+ const auth = readRouteAuth(route.middleware, warn);
112
+ const request = buildRequestParts({
113
+ method: expandMethods(route.method)[0] ?? "get",
114
+ path: route.path,
115
+ validation,
116
+ warn
117
+ });
118
+ const body = request.requestBody?.content["application/json"]?.schema;
119
+ const responses = {};
120
+ for (const [status, response] of Object.entries(buildDeclaredResponses(handler?.responseSchema, registry, warn))) {
121
+ const schema = response.content?.["application/json"]?.schema;
122
+ responses[status] = {
123
+ description: response.description,
124
+ schema: schema ?? null
125
+ };
126
+ }
127
+ return {
128
+ method,
129
+ path: route.path,
130
+ name: route.name ? route.name : null,
131
+ sourceFile: route.sourceFile ? route.sourceFile : null,
132
+ handler: functionName(handler),
133
+ description: route.description ?? handler?.description ?? null,
134
+ isPage: route.isPage === true,
135
+ middleware: (route.middleware ?? []).map(functionName),
136
+ auth: auth ? {
137
+ required: true,
138
+ sources: auth.sources,
139
+ userTypes: auth.userTypes
140
+ } : {
141
+ required: false,
142
+ sources: [],
143
+ userTypes: []
144
+ },
145
+ csrf: route.csrf !== false,
146
+ rateLimit: readRateLimit(route, rateLimit),
147
+ logging: readLogging(route, logging),
148
+ request: {
149
+ parameters: request.parameters.map((parameter) => ({
150
+ name: parameter.name,
151
+ in: parameter.in,
152
+ required: parameter.required === true,
153
+ schema: parameter.schema
154
+ })),
155
+ body: body ?? null,
156
+ customValidation: typeof validation?.validate === "function"
157
+ },
158
+ responses
159
+ };
160
+ }).sort((first, second) => {
161
+ if (first.path !== second.path) return first.path < second.path ? -1 : 1;
162
+ return methodRank(first.method) - methodRank(second.method);
163
+ });
164
+ }
165
+
166
+ //#endregion
167
+ export { collectRoutes };
168
+ //# sourceMappingURL=collect-routes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect-routes.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/inspect/collect-routes.ts"],"sourcesContent":["import { config } from \"../../config/config-getter\";\nimport { buildRateLimitOptions } from \"../../http/build-rate-limit-options\";\nimport type { HttpLoggingConfig } from \"../../http/request-log-snapshot\";\nimport { expandMethods } from \"../../openapi/paths\";\nimport { buildRequestParts } from \"../../openapi/request-schemas\";\nimport { buildDeclaredResponses } from \"../../openapi/response-schemas\";\nimport type { SchemaRegistry } from \"../../openapi/schema-registry\";\nimport { readRouteAuth } from \"../../openapi/security\";\nimport type { Route } from \"../../router/types\";\nimport type {\n InspectRoute,\n InspectRouteLogging,\n InspectRouteRateLimit,\n InspectWarning,\n JsonSchema,\n} from \"./inspect-report.types\";\n\n/** Display order of methods within one path, matching `warlock routes`. */\nconst METHOD_ORDER = [\"GET\", \"POST\", \"PUT\", \"PATCH\", \"DELETE\", \"OPTIONS\", \"HEAD\", \"ALL\"];\n\nfunction methodRank(method: string): number {\n const index = METHOD_ORDER.indexOf(method);\n\n return index === -1 ? METHOD_ORDER.length : index;\n}\n\n/** The name of a function, without the `bound ` prefix `bind()` adds. */\nexport function functionName(value: unknown): string {\n if (typeof value !== \"function\") return \"anonymous\";\n\n const name = value.name.replace(/^bound /, \"\").trim();\n\n return name.length > 0 ? name : \"anonymous\";\n}\n\nfunction limitValue(value: unknown): number | \"dynamic\" | null {\n if (typeof value === \"number\") return value;\n\n return value === undefined || value === null ? null : \"dynamic\";\n}\n\nfunction windowValue(value: unknown): number | string | null {\n if (typeof value === \"number\" || typeof value === \"string\") return value;\n\n return value === undefined || value === null ? null : \"dynamic\";\n}\n\n/**\n * The limiter a route runs under: its own `rateLimit` options, else the global\n * `http.rateLimit` limiter (built with the same defaults the HTTP connector\n * uses), else none. `rateLimit: false` exempts the route from the global\n * limiter; `rateLimit: true` keeps it under the global policy.\n */\nfunction readRateLimit(\n route: Route,\n global: Record<string, unknown> | null,\n): InspectRouteRateLimit {\n if (typeof route.rateLimit === \"object\" && route.rateLimit !== null) {\n return { source: \"route\", max: route.rateLimit.max, timeWindow: route.rateLimit.timeWindow };\n }\n\n if (!global || route.rateLimit === false) {\n return { source: \"none\", max: null, timeWindow: null };\n }\n\n return {\n source: \"global\",\n max: limitValue(global.max),\n timeWindow: windowValue(global.timeWindow),\n };\n}\n\n/**\n * What the route's request logs keep: the route's `logging` option over\n * `http.logging`, the same precedence `resolveRequestLoggingOptions` applies.\n * Private URL rules can only remove more, per URL, so they are flagged rather\n * than evaluated.\n */\nfunction readLogging(route: Route, global: HttpLoggingConfig): InspectRouteLogging {\n return {\n body: route.logging?.body ?? global.body ?? true,\n query: route.logging?.query ?? global.query ?? true,\n privateRules: (global.private?.length ?? 0) > 0,\n };\n}\n\nfunction globalRateLimit(warnings: InspectWarning[]): Record<string, unknown> | null {\n try {\n const options = buildRateLimitOptions(config.get(\"http.rateLimit\"));\n\n return options ? { max: options.max, timeWindow: options.timeWindow } : null;\n } catch (error) {\n warnings.push({\n code: null,\n message: `http.rateLimit could not be read: ${error instanceof Error ? error.message : String(error)}`,\n source: \"routes\",\n });\n\n return null;\n }\n}\n\n/**\n * Describe every route: identity, middleware chain, guard, limits, logging and\n * the request/response schemas the OpenAPI generator derives (the same\n * `buildRequestParts` / `buildDeclaredResponses` code, so `inspect` and\n * `generate.openapi` never disagree). Resource `$ref`s land in `registry`.\n */\nexport function collectRoutes(\n routes: readonly Route[],\n registry: SchemaRegistry,\n warnings: InspectWarning[],\n): InspectRoute[] {\n const rateLimit = globalRateLimit(warnings);\n const logging = (config.get(\"http.logging\") ?? {}) as HttpLoggingConfig;\n\n const collected = routes.map((route): InspectRoute => {\n const method = String(route.method).toUpperCase();\n const label = `${method} ${route.path}`;\n const warn = (message: string) => {\n warnings.push({\n code: message.includes(\"JSON Schema\") ? \"WL4001\" : null,\n message: `${label}: ${message}`,\n source: route.sourceFile || null,\n });\n };\n const handler = route.handler as Route[\"handler\"] | undefined;\n const validation = handler?.validation;\n const auth = readRouteAuth(route.middleware, warn);\n const request = buildRequestParts({\n method: expandMethods(route.method)[0] ?? \"get\",\n path: route.path,\n validation,\n warn,\n });\n const body = request.requestBody?.content[\"application/json\"]?.schema;\n const responses: InspectRoute[\"responses\"] = {};\n\n for (const [status, response] of Object.entries(\n buildDeclaredResponses(handler?.responseSchema, registry, warn),\n )) {\n const schema: JsonSchema | undefined = response.content?.[\"application/json\"]?.schema;\n\n responses[status] = { description: response.description, schema: schema ?? null };\n }\n\n return {\n method,\n path: route.path,\n name: route.name ? route.name : null,\n sourceFile: route.sourceFile ? route.sourceFile : null,\n handler: functionName(handler),\n description: route.description ?? handler?.description ?? null,\n isPage: route.isPage === true,\n middleware: (route.middleware ?? []).map(functionName),\n auth: auth\n ? { required: true, sources: auth.sources, userTypes: auth.userTypes }\n : { required: false, sources: [], userTypes: [] },\n csrf: route.csrf !== false,\n rateLimit: readRateLimit(route, rateLimit),\n logging: readLogging(route, logging),\n request: {\n parameters: request.parameters.map((parameter) => ({\n name: parameter.name,\n in: parameter.in,\n required: parameter.required === true,\n schema: parameter.schema,\n })),\n body: body ?? null,\n customValidation: typeof validation?.validate === \"function\",\n },\n responses,\n };\n });\n\n return collected.sort((first, second) => {\n if (first.path !== second.path) return first.path < second.path ? -1 : 1;\n\n return methodRank(first.method) - methodRank(second.method);\n });\n}\n"],"mappings":";;;;;;;;;AAkBA,MAAM,eAAe;CAAC;CAAO;CAAQ;CAAO;CAAS;CAAU;CAAW;CAAQ;AAAK;AAEvF,SAAS,WAAW,QAAwB;CAC1C,MAAM,QAAQ,aAAa,QAAQ,MAAM;CAEzC,OAAO,UAAU,KAAK,aAAa,SAAS;AAC9C;;AAGA,SAAgB,aAAa,OAAwB;CACnD,IAAI,OAAO,UAAU,YAAY,OAAO;CAExC,MAAM,OAAO,MAAM,KAAK,QAAQ,WAAW,EAAE,CAAC,CAAC,KAAK;CAEpD,OAAO,KAAK,SAAS,IAAI,OAAO;AAClC;AAEA,SAAS,WAAW,OAA2C;CAC7D,IAAI,OAAO,UAAU,UAAU,OAAO;CAEtC,OAAO,UAAU,UAAa,UAAU,OAAO,OAAO;AACxD;AAEA,SAAS,YAAY,OAAwC;CAC3D,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU,OAAO;CAEnE,OAAO,UAAU,UAAa,UAAU,OAAO,OAAO;AACxD;;;;;;;AAQA,SAAS,cACP,OACA,QACuB;CACvB,IAAI,OAAO,MAAM,cAAc,YAAY,MAAM,cAAc,MAC7D,OAAO;EAAE,QAAQ;EAAS,KAAK,MAAM,UAAU;EAAK,YAAY,MAAM,UAAU;CAAW;CAG7F,IAAI,CAAC,UAAU,MAAM,cAAc,OACjC,OAAO;EAAE,QAAQ;EAAQ,KAAK;EAAM,YAAY;CAAK;CAGvD,OAAO;EACL,QAAQ;EACR,KAAK,WAAW,OAAO,GAAG;EAC1B,YAAY,YAAY,OAAO,UAAU;CAC3C;AACF;;;;;;;AAQA,SAAS,YAAY,OAAc,QAAgD;CACjF,OAAO;EACL,MAAM,MAAM,SAAS,QAAQ,OAAO,QAAQ;EAC5C,OAAO,MAAM,SAAS,SAAS,OAAO,SAAS;EAC/C,eAAe,OAAO,SAAS,UAAU,KAAK;CAChD;AACF;AAEA,SAAS,gBAAgB,UAA4D;CACnF,IAAI;EACF,MAAM,UAAU,sBAAsB,OAAO,IAAI,gBAAgB,CAAC;EAElE,OAAO,UAAU;GAAE,KAAK,QAAQ;GAAK,YAAY,QAAQ;EAAW,IAAI;CAC1E,SAAS,OAAO;EACd,SAAS,KAAK;GACZ,MAAM;GACN,SAAS,qCAAqC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;GACnG,QAAQ;EACV,CAAC;EAED,OAAO;CACT;AACF;;;;;;;AAQA,SAAgB,cACd,QACA,UACA,UACgB;CAChB,MAAM,YAAY,gBAAgB,QAAQ;CAC1C,MAAM,UAAW,OAAO,IAAI,cAAc,KAAK,CAAC;CA6DhD,OA3DkB,OAAO,KAAK,UAAwB;EACpD,MAAM,SAAS,OAAO,MAAM,MAAM,CAAC,CAAC,YAAY;EAChD,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM;EACjC,MAAM,QAAQ,YAAoB;GAChC,SAAS,KAAK;IACZ,MAAM,QAAQ,SAAS,aAAa,IAAI,WAAW;IACnD,SAAS,GAAG,MAAM,IAAI;IACtB,QAAQ,MAAM,cAAc;GAC9B,CAAC;EACH;EACA,MAAM,UAAU,MAAM;EACtB,MAAM,aAAa,SAAS;EAC5B,MAAM,OAAO,cAAc,MAAM,YAAY,IAAI;EACjD,MAAM,UAAU,kBAAkB;GAChC,QAAQ,cAAc,MAAM,MAAM,CAAC,CAAC,MAAM;GAC1C,MAAM,MAAM;GACZ;GACA;EACF,CAAC;EACD,MAAM,OAAO,QAAQ,aAAa,QAAQ,mBAAmB,EAAE;EAC/D,MAAM,YAAuC,CAAC;EAE9C,KAAK,MAAM,CAAC,QAAQ,aAAa,OAAO,QACtC,uBAAuB,SAAS,gBAAgB,UAAU,IAAI,CAChE,GAAG;GACD,MAAM,SAAiC,SAAS,UAAU,mBAAmB,EAAE;GAE/E,UAAU,UAAU;IAAE,aAAa,SAAS;IAAa,QAAQ,UAAU;GAAK;EAClF;EAEA,OAAO;GACL;GACA,MAAM,MAAM;GACZ,MAAM,MAAM,OAAO,MAAM,OAAO;GAChC,YAAY,MAAM,aAAa,MAAM,aAAa;GAClD,SAAS,aAAa,OAAO;GAC7B,aAAa,MAAM,eAAe,SAAS,eAAe;GAC1D,QAAQ,MAAM,WAAW;GACzB,aAAa,MAAM,cAAc,CAAC,EAAC,CAAE,IAAI,YAAY;GACrD,MAAM,OACF;IAAE,UAAU;IAAM,SAAS,KAAK;IAAS,WAAW,KAAK;GAAU,IACnE;IAAE,UAAU;IAAO,SAAS,CAAC;IAAG,WAAW,CAAC;GAAE;GAClD,MAAM,MAAM,SAAS;GACrB,WAAW,cAAc,OAAO,SAAS;GACzC,SAAS,YAAY,OAAO,OAAO;GACnC,SAAS;IACP,YAAY,QAAQ,WAAW,KAAK,eAAe;KACjD,MAAM,UAAU;KAChB,IAAI,UAAU;KACd,UAAU,UAAU,aAAa;KACjC,QAAQ,UAAU;IACpB,EAAE;IACF,MAAM,QAAQ;IACd,kBAAkB,OAAO,YAAY,aAAa;GACpD;GACA;EACF;CACF,CAEe,CAAC,CAAC,MAAM,OAAO,WAAW;EACvC,IAAI,MAAM,SAAS,OAAO,MAAM,OAAO,MAAM,OAAO,OAAO,OAAO,KAAK;EAEvE,OAAO,WAAW,MAAM,MAAM,IAAI,WAAW,OAAO,MAAM;CAC5D,CAAC;AACH"}
@@ -0,0 +1,37 @@
1
+ import { InspectEvent } from "./inspect-report.types.mjs";
2
+
3
+ //#region ../../packages/core/src/tooling/inspect/event-recorder.d.ts
4
+ /** One listener an app module registered. */
5
+ type RecordedListener = {
6
+ event: string; /** The listener's function name, `"anonymous"` when it has none. */
7
+ name: string; /** Project-relative file whose import registered it. */
8
+ sourceFile: string;
9
+ };
10
+ /**
11
+ * Records the listeners app modules register on `@mongez/events` while they
12
+ * are imported.
13
+ *
14
+ * The bus keeps its subscriptions private and does not say who registered
15
+ * them, so the recorder wraps `subscribe` (which `on` and `addEventListener`
16
+ * call) for the duration of the boot pass and notes the module being imported
17
+ * at that moment. Listeners registered outside an app module import (by the
18
+ * framework itself) are not app facts and are not recorded.
19
+ */
20
+ declare class EventRecorder {
21
+ private readonly records;
22
+ private readonly restores;
23
+ /**
24
+ * Start recording on the given buses (core's own `@mongez/events` instance
25
+ * when none are given). A bus is wrapped once even if listed twice.
26
+ */
27
+ start(buses?: readonly unknown[]): this;
28
+ /** Stop recording and put the original `subscribe` back. */
29
+ stop(): this;
30
+ /** What was recorded so far. */
31
+ list(): RecordedListener[];
32
+ }
33
+ /** Group recorded listeners by event, sorted, for the report. */
34
+ declare function groupListeners(records: readonly RecordedListener[]): InspectEvent[];
35
+ //#endregion
36
+ export { EventRecorder, RecordedListener, groupListeners };
37
+ //# sourceMappingURL=event-recorder.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-recorder.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/inspect/event-recorder.ts"],"mappings":";;;;KAIY,gBAAA;EACV,KAAA,UAD0B;EAG1B,IAAA,UAH0B;EAK1B,UAAA;AAAA;;;AAAU;AA6CZ;;;;;;;cAAa,aAAA;EAAA,iBACM,OAAA;EAAA,iBAEA,QAAA;EAkDF;;AAAgB;AAMjC;EAlDS,KAAA,CAAM,KAAA;;EAmCN,IAAA;EAewC;EANxC,IAAA,IAAQ,gBAAgB;AAAA;;iBAMjB,cAAA,CAAe,OAAA,WAAkB,gBAAA,KAAqB,YAAY"}
@@ -0,0 +1,91 @@
1
+ import events from "@mongez/events";
2
+
3
+ //#region ../../packages/core/src/tooling/inspect/event-recorder.ts
4
+ function isEventBus(value) {
5
+ return typeof value === "object" && value !== null && typeof Reflect.get(value, "subscribe") === "function";
6
+ }
7
+ function listenerName(callback) {
8
+ if (typeof callback !== "function") return "anonymous";
9
+ const name = callback.name.replace(/^bound /, "").trim();
10
+ return name.length > 0 ? name : "anonymous";
11
+ }
12
+ /** The file the module loader is importing right now, if any. */
13
+ function currentModuleFile() {
14
+ const file = Reflect.get(globalThis, "__currentModuleFile");
15
+ if (typeof file !== "object" || file === null) return void 0;
16
+ const relativePath = Reflect.get(file, "relativePath");
17
+ return typeof relativePath === "string" ? relativePath : void 0;
18
+ }
19
+ /**
20
+ * Records the listeners app modules register on `@mongez/events` while they
21
+ * are imported.
22
+ *
23
+ * The bus keeps its subscriptions private and does not say who registered
24
+ * them, so the recorder wraps `subscribe` (which `on` and `addEventListener`
25
+ * call) for the duration of the boot pass and notes the module being imported
26
+ * at that moment. Listeners registered outside an app module import (by the
27
+ * framework itself) are not app facts and are not recorded.
28
+ */
29
+ var EventRecorder = class {
30
+ constructor() {
31
+ this.records = [];
32
+ this.restores = [];
33
+ }
34
+ /**
35
+ * Start recording on the given buses (core's own `@mongez/events` instance
36
+ * when none are given). A bus is wrapped once even if listed twice.
37
+ */
38
+ start(buses = [events]) {
39
+ const seen = /* @__PURE__ */ new Set();
40
+ for (const bus of buses) {
41
+ if (!isEventBus(bus) || seen.has(bus)) continue;
42
+ seen.add(bus);
43
+ const original = bus.subscribe;
44
+ const hadOwn = Object.prototype.hasOwnProperty.call(bus, "subscribe");
45
+ const records = this.records;
46
+ bus.subscribe = function(event, callback) {
47
+ const sourceFile = currentModuleFile();
48
+ if (sourceFile !== void 0 && typeof event === "string") records.push({
49
+ event,
50
+ name: listenerName(callback),
51
+ sourceFile
52
+ });
53
+ return original.call(this, event, callback);
54
+ };
55
+ this.restores.push(() => {
56
+ if (hadOwn) bus.subscribe = original;
57
+ else Reflect.deleteProperty(bus, "subscribe");
58
+ });
59
+ }
60
+ return this;
61
+ }
62
+ /** Stop recording and put the original `subscribe` back. */
63
+ stop() {
64
+ for (const restore of this.restores.splice(0).reverse()) restore();
65
+ return this;
66
+ }
67
+ /** What was recorded so far. */
68
+ list() {
69
+ return [...this.records];
70
+ }
71
+ };
72
+ /** Group recorded listeners by event, sorted, for the report. */
73
+ function groupListeners(records) {
74
+ const byEvent = /* @__PURE__ */ new Map();
75
+ for (const record of records) {
76
+ const listeners = byEvent.get(record.event) ?? [];
77
+ listeners.push({
78
+ name: record.name,
79
+ sourceFile: record.sourceFile
80
+ });
81
+ byEvent.set(record.event, listeners);
82
+ }
83
+ return [...byEvent.entries()].map(([event, listeners]) => ({
84
+ event,
85
+ listeners
86
+ })).sort((first, second) => first.event.localeCompare(second.event));
87
+ }
88
+
89
+ //#endregion
90
+ export { EventRecorder, groupListeners };
91
+ //# sourceMappingURL=event-recorder.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event-recorder.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/inspect/event-recorder.ts"],"sourcesContent":["import events from \"@mongez/events\";\nimport type { InspectEvent } from \"./inspect-report.types\";\n\n/** One listener an app module registered. */\nexport type RecordedListener = {\n event: string;\n /** The listener's function name, `\"anonymous\"` when it has none. */\n name: string;\n /** Project-relative file whose import registered it. */\n sourceFile: string;\n};\n\n/** The slice of an `@mongez/events` bus the recorder wraps. */\ntype EventBus = {\n subscribe: (event: string, callback: (...args: never[]) => unknown) => unknown;\n};\n\nfunction isEventBus(value: unknown): value is EventBus {\n return (\n typeof value === \"object\" &&\n value !== null &&\n typeof Reflect.get(value, \"subscribe\") === \"function\"\n );\n}\n\nfunction listenerName(callback: unknown): string {\n if (typeof callback !== \"function\") return \"anonymous\";\n\n const name = callback.name.replace(/^bound /, \"\").trim();\n\n return name.length > 0 ? name : \"anonymous\";\n}\n\n/** The file the module loader is importing right now, if any. */\nfunction currentModuleFile(): string | undefined {\n const file: unknown = Reflect.get(globalThis, \"__currentModuleFile\");\n\n if (typeof file !== \"object\" || file === null) return undefined;\n\n const relativePath = Reflect.get(file, \"relativePath\");\n\n return typeof relativePath === \"string\" ? relativePath : undefined;\n}\n\n/**\n * Records the listeners app modules register on `@mongez/events` while they\n * are imported.\n *\n * The bus keeps its subscriptions private and does not say who registered\n * them, so the recorder wraps `subscribe` (which `on` and `addEventListener`\n * call) for the duration of the boot pass and notes the module being imported\n * at that moment. Listeners registered outside an app module import (by the\n * framework itself) are not app facts and are not recorded.\n */\nexport class EventRecorder {\n private readonly records: RecordedListener[] = [];\n\n private readonly restores: (() => void)[] = [];\n\n /**\n * Start recording on the given buses (core's own `@mongez/events` instance\n * when none are given). A bus is wrapped once even if listed twice.\n */\n public start(buses: readonly unknown[] = [events]): this {\n const seen = new Set<unknown>();\n\n for (const bus of buses) {\n if (!isEventBus(bus) || seen.has(bus)) continue;\n\n seen.add(bus);\n\n const original = bus.subscribe;\n const hadOwn = Object.prototype.hasOwnProperty.call(bus, \"subscribe\");\n const records = this.records;\n\n bus.subscribe = function (this: unknown, event, callback) {\n const sourceFile = currentModuleFile();\n\n if (sourceFile !== undefined && typeof event === \"string\") {\n records.push({ event, name: listenerName(callback), sourceFile });\n }\n\n return original.call(this, event, callback);\n };\n\n this.restores.push(() => {\n if (hadOwn) {\n bus.subscribe = original;\n } else {\n Reflect.deleteProperty(bus, \"subscribe\");\n }\n });\n }\n\n return this;\n }\n\n /** Stop recording and put the original `subscribe` back. */\n public stop(): this {\n for (const restore of this.restores.splice(0).reverse()) {\n restore();\n }\n\n return this;\n }\n\n /** What was recorded so far. */\n public list(): RecordedListener[] {\n return [...this.records];\n }\n}\n\n/** Group recorded listeners by event, sorted, for the report. */\nexport function groupListeners(records: readonly RecordedListener[]): InspectEvent[] {\n const byEvent = new Map<string, InspectEvent[\"listeners\"]>();\n\n for (const record of records) {\n const listeners = byEvent.get(record.event) ?? [];\n\n listeners.push({ name: record.name, sourceFile: record.sourceFile });\n byEvent.set(record.event, listeners);\n }\n\n return [...byEvent.entries()]\n .map(([event, listeners]) => ({ event, listeners }))\n .sort((first, second) => first.event.localeCompare(second.event));\n}\n"],"mappings":";;;AAiBA,SAAS,WAAW,OAAmC;CACrD,OACE,OAAO,UAAU,YACjB,UAAU,QACV,OAAO,QAAQ,IAAI,OAAO,WAAW,MAAM;AAE/C;AAEA,SAAS,aAAa,UAA2B;CAC/C,IAAI,OAAO,aAAa,YAAY,OAAO;CAE3C,MAAM,OAAO,SAAS,KAAK,QAAQ,WAAW,EAAE,CAAC,CAAC,KAAK;CAEvD,OAAO,KAAK,SAAS,IAAI,OAAO;AAClC;;AAGA,SAAS,oBAAwC;CAC/C,MAAM,OAAgB,QAAQ,IAAI,YAAY,qBAAqB;CAEnE,IAAI,OAAO,SAAS,YAAY,SAAS,MAAM,OAAO;CAEtD,MAAM,eAAe,QAAQ,IAAI,MAAM,cAAc;CAErD,OAAO,OAAO,iBAAiB,WAAW,eAAe;AAC3D;;;;;;;;;;;AAYA,IAAa,gBAAb,MAA2B;;iBACsB,CAAC;kBAEJ,CAAC;;;;;;CAM7C,AAAO,MAAM,QAA4B,CAAC,MAAM,GAAS;EACvD,MAAM,uBAAO,IAAI,IAAa;EAE9B,KAAK,MAAM,OAAO,OAAO;GACvB,IAAI,CAAC,WAAW,GAAG,KAAK,KAAK,IAAI,GAAG,GAAG;GAEvC,KAAK,IAAI,GAAG;GAEZ,MAAM,WAAW,IAAI;GACrB,MAAM,SAAS,OAAO,UAAU,eAAe,KAAK,KAAK,WAAW;GACpE,MAAM,UAAU,KAAK;GAErB,IAAI,YAAY,SAAyB,OAAO,UAAU;IACxD,MAAM,aAAa,kBAAkB;IAErC,IAAI,eAAe,UAAa,OAAO,UAAU,UAC/C,QAAQ,KAAK;KAAE;KAAO,MAAM,aAAa,QAAQ;KAAG;IAAW,CAAC;IAGlE,OAAO,SAAS,KAAK,MAAM,OAAO,QAAQ;GAC5C;GAEA,KAAK,SAAS,WAAW;IACvB,IAAI,QACF,IAAI,YAAY;SAEhB,QAAQ,eAAe,KAAK,WAAW;GAE3C,CAAC;EACH;EAEA,OAAO;CACT;;CAGA,AAAO,OAAa;EAClB,KAAK,MAAM,WAAW,KAAK,SAAS,OAAO,CAAC,CAAC,CAAC,QAAQ,GACpD,QAAQ;EAGV,OAAO;CACT;;CAGA,AAAO,OAA2B;EAChC,OAAO,CAAC,GAAG,KAAK,OAAO;CACzB;AACF;;AAGA,SAAgB,eAAe,SAAsD;CACnF,MAAM,0BAAU,IAAI,IAAuC;CAE3D,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,YAAY,QAAQ,IAAI,OAAO,KAAK,KAAK,CAAC;EAEhD,UAAU,KAAK;GAAE,MAAM,OAAO;GAAM,YAAY,OAAO;EAAW,CAAC;EACnE,QAAQ,IAAI,OAAO,OAAO,SAAS;CACrC;CAEA,OAAO,CAAC,GAAG,QAAQ,QAAQ,CAAC,CAAC,CAC1B,KAAK,CAAC,OAAO,gBAAgB;EAAE;EAAO;CAAU,EAAE,CAAC,CACnD,MAAM,OAAO,WAAW,MAAM,MAAM,cAAc,OAAO,KAAK,CAAC;AACpE"}
@@ -0,0 +1,7 @@
1
+ import { INSPECT_SCHEMA_VERSION, INSPECT_SECTIONS, InspectConfigKey, InspectEvent, InspectJob, InspectModel, InspectModelColumn, InspectModelRelation, InspectPackage, InspectPage, InspectParameter, InspectReport, InspectResource, InspectRoute, InspectRouteAuth, InspectRouteLogging, InspectRouteRateLimit, InspectSchedule, InspectSection, InspectWarning, JsonSchema } from "./inspect-report.types.mjs";
2
+ import { EventRecorder, RecordedListener, groupListeners } from "./event-recorder.mjs";
3
+ import { InspectModelModule } from "./collect-models.mjs";
4
+ import { AppModuleImporter } from "./collect-packages.mjs";
5
+ import { InspectOptions, inspectApp, isInspectSection, parseInspectSections } from "./inspect-app.mjs";
6
+ import { InspectBootResult, bootForInspect, inspectOptionsFromBoot } from "./boot-for-inspect.mjs";
7
+ import { INSPECT_REPORT_JSON_SCHEMA } from "./inspect-report.schema.mjs";
@@ -0,0 +1,7 @@
1
+ import { EventRecorder, groupListeners } from "./event-recorder.mjs";
2
+ import { bootForInspect, inspectOptionsFromBoot } from "./boot-for-inspect.mjs";
3
+ import { INSPECT_SCHEMA_VERSION, INSPECT_SECTIONS } from "./inspect-report.types.mjs";
4
+ import { inspectApp, isInspectSection, parseInspectSections } from "./inspect-app.mjs";
5
+ import { INSPECT_REPORT_JSON_SCHEMA } from "./inspect-report.schema.mjs";
6
+
7
+ export { };
@@ -0,0 +1,53 @@
1
+ import { Route } from "../../router/types.mjs";
2
+ import { InspectReport, InspectSection, InspectWarning } from "./inspect-report.types.mjs";
3
+ import { RecordedListener } from "./event-recorder.mjs";
4
+ import { InspectModelModule } from "./collect-models.mjs";
5
+ import { AppModuleImporter } from "./collect-packages.mjs";
6
+
7
+ //#region ../../packages/core/src/tooling/inspect/inspect-app.d.ts
8
+ /** Inputs of {@link inspectApp}. Every field is optional. */
9
+ type InspectOptions = {
10
+ /** Project root. Default: `process.cwd()`. */cwd?: string; /** The sections to include. Default: all of {@link INSPECT_SECTIONS}. */
11
+ sections?: readonly InspectSection[]; /** The routes to describe. Default: `router.list()`. */
12
+ routes?: readonly Route[]; /** Model modules the boot pass imported (their exports are scanned for model classes). */
13
+ modelModules?: readonly InspectModelModule[]; /** Listeners recorded while app modules were imported (see `EventRecorder`). */
14
+ events?: readonly RecordedListener[]; /** Warnings found before inspecting (by the boot pass); listed first. */
15
+ warnings?: readonly InspectWarning[]; /** App modules that failed to import; each becomes a `WL2001` warning. */
16
+ moduleFailures?: readonly {
17
+ file: string;
18
+ message: string;
19
+ }[]; /** The `web` connector's installed pages. Default: read from the registered connectors. */
20
+ pages?: readonly unknown[];
21
+ /**
22
+ * Name a resource class in `components.schemas`, usually by its export name
23
+ * (`PostResource`). Unnamed resources fall back to the class name.
24
+ */
25
+ resolveResourceName?: (resource: unknown) => string | undefined; /** The loaded config tree. Default: everything `config` holds. */
26
+ config?: Record<string, unknown>; /** How packages are imported as the app resolves them (`@warlock.js/queue`, `/scheduler`). */
27
+ importFromApp?: AppModuleImporter; /** Clock, for `generatedAt`. */
28
+ now?: () => Date;
29
+ };
30
+ /** Whether a string is a section name. */
31
+ declare function isInspectSection(value: string): value is InspectSection;
32
+ /**
33
+ * Parse a `--section routes,models` value. Throws on an unknown name, listing
34
+ * the valid ones. An empty value means every section.
35
+ */
36
+ declare function parseInspectSections(value: string | undefined): InspectSection[];
37
+ /**
38
+ * Describe the application from its in-process registries: routes, models,
39
+ * resources, config keys, event listeners, pages, queue jobs, scheduled
40
+ * tasks and installed `@warlock.js/*` packages.
41
+ *
42
+ * Reads what is ALREADY registered and boots nothing, so it can run inside a
43
+ * live dev process as well as after the `warlock inspect` boot pass. Never
44
+ * throws for one unreadable item: it becomes an entry in `warnings`.
45
+ *
46
+ * @example
47
+ * const report = await inspectApp({ sections: ["routes"] });
48
+ * report.routes?.filter((route) => !route.auth.required && route.method !== "GET");
49
+ */
50
+ declare function inspectApp(options?: InspectOptions): Promise<InspectReport>;
51
+ //#endregion
52
+ export { InspectOptions, inspectApp, isInspectSection, parseInspectSections };
53
+ //# sourceMappingURL=inspect-app.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect-app.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/inspect/inspect-app.ts"],"mappings":";;;;;;;;KA0BY,cAAA;EAAA,8CAEV,GAAA;EAEA,QAAA,YAAoB,cAAA,IAEF;EAAlB,MAAA,YAAkB,KAAA,IAIA;EAFlB,YAAA,YAAwB,kBAAA,IAef;EAbT,MAAA,YAAkB,gBAAA,IAiBN;EAfZ,QAAA,YAAoB,cAAA,IAeJ;EAbhB,cAAA;IAA4B,IAAA;IAAc,OAAA;EAAA,KARxB;EAUlB,KAAA;EARwB;;;;EAaxB,mBAAA,IAAuB,QAAA,kCAPvB;EASA,MAAA,GAAS,MAAA,mBATiC;EAW1C,aAAA,GAAgB,iBAAA,EAJhB;EAMA,GAAA,SAAY,IAAA;AAAA;;iBAIE,gBAAA,CAAiB,KAAA,WAAgB,KAAA,IAAS,cAAc;;;;;iBAQxD,oBAAA,CAAqB,KAAA,uBAA4B,cAAc;AAR/E;;;;;;;;AAAwE;AAQxE;;;;AARA,iBAuCsB,UAAA,CAAW,OAAA,GAAS,cAAA,GAAsB,OAAA,CAAQ,aAAA"}
@@ -0,0 +1,92 @@
1
+ import { Application } from "../../application/application.mjs";
2
+ import { router } from "../../router/router.mjs";
3
+ import { SchemaRegistry } from "../../openapi/schema-registry.mjs";
4
+ import { groupListeners } from "./event-recorder.mjs";
5
+ import { collectConfig } from "./collect-config.mjs";
6
+ import { collectModels, collectResources } from "./collect-models.mjs";
7
+ import { collectJobs, collectPackages, collectSchedules, createAppModuleImporter, readAppPackage } from "./collect-packages.mjs";
8
+ import { collectPages, installedPagesFromConnectors } from "./collect-pages.mjs";
9
+ import { collectRoutes } from "./collect-routes.mjs";
10
+ import { INSPECT_SCHEMA_VERSION, INSPECT_SECTIONS } from "./inspect-report.types.mjs";
11
+
12
+ //#region ../../packages/core/src/tooling/inspect/inspect-app.ts
13
+ /** Whether a string is a section name. */
14
+ function isInspectSection(value) {
15
+ return INSPECT_SECTIONS.includes(value);
16
+ }
17
+ /**
18
+ * Parse a `--section routes,models` value. Throws on an unknown name, listing
19
+ * the valid ones. An empty value means every section.
20
+ */
21
+ function parseInspectSections(value) {
22
+ if (value === void 0 || value.trim() === "") return [...INSPECT_SECTIONS];
23
+ const requested = value.split(",").map((name) => name.trim()).filter((name) => name.length > 0);
24
+ const unknown = requested.filter((name) => !isInspectSection(name));
25
+ if (unknown.length > 0) throw new Error(`Unknown inspect section(s): ${unknown.join(", ")}. Valid sections: ${INSPECT_SECTIONS.join(", ")}.`);
26
+ return INSPECT_SECTIONS.filter((section) => requested.includes(section));
27
+ }
28
+ /**
29
+ * Describe the application from its in-process registries: routes, models,
30
+ * resources, config keys, event listeners, pages, queue jobs, scheduled
31
+ * tasks and installed `@warlock.js/*` packages.
32
+ *
33
+ * Reads what is ALREADY registered and boots nothing, so it can run inside a
34
+ * live dev process as well as after the `warlock inspect` boot pass. Never
35
+ * throws for one unreadable item: it becomes an entry in `warnings`.
36
+ *
37
+ * @example
38
+ * const report = await inspectApp({ sections: ["routes"] });
39
+ * report.routes?.filter((route) => !route.auth.required && route.method !== "GET");
40
+ */
41
+ async function inspectApp(options = {}) {
42
+ const cwd = options.cwd ?? process.cwd();
43
+ const sections = options.sections ? [...options.sections] : [...INSPECT_SECTIONS];
44
+ const wants = new Set(sections);
45
+ const warnings = [...options.warnings ?? []];
46
+ const registry = new SchemaRegistry(options.resolveResourceName, (message) => {
47
+ warnings.push({
48
+ code: null,
49
+ message,
50
+ source: "resources"
51
+ });
52
+ });
53
+ const importFromApp = options.importFromApp ?? createAppModuleImporter(cwd);
54
+ for (const failure of options.moduleFailures ?? []) warnings.push({
55
+ code: "WL2001",
56
+ message: `${failure.file} failed to load: ${failure.message}`,
57
+ source: failure.file
58
+ });
59
+ const app = readAppPackage(cwd);
60
+ const report = {
61
+ schemaVersion: 1,
62
+ generatedAt: (options.now ?? (() => /* @__PURE__ */ new Date()))().toISOString(),
63
+ app: {
64
+ name: app.name,
65
+ version: app.version,
66
+ root: cwd,
67
+ node: process.version,
68
+ environment: String(Application.environment ?? "development"),
69
+ runtimeStrategy: String(Application.runtimeStrategy ?? "development")
70
+ },
71
+ sections: INSPECT_SECTIONS.filter((section) => wants.has(section)),
72
+ components: { schemas: {} },
73
+ warnings
74
+ };
75
+ const routes = collectRoutes(options.routes ?? router.list(), registry, warnings);
76
+ const { models, resourceModels } = collectModels(options.modelModules ?? [], registry, warnings);
77
+ if (wants.has("routes")) report.routes = routes;
78
+ if (wants.has("models")) report.models = models;
79
+ if (wants.has("resources")) report.resources = collectResources(registry, resourceModels);
80
+ if (wants.has("config")) report.config = collectConfig(cwd, options.config);
81
+ if (wants.has("events")) report.events = groupListeners(options.events ?? []);
82
+ if (wants.has("pages")) report.pages = collectPages(options.pages ?? installedPagesFromConnectors(), cwd, warnings);
83
+ if (wants.has("jobs")) report.jobs = await collectJobs(importFromApp, warnings);
84
+ if (wants.has("schedules")) report.schedules = await collectSchedules(importFromApp, warnings);
85
+ if (wants.has("packages")) report.packages = collectPackages(cwd);
86
+ report.components.schemas = registry.schemas;
87
+ return report;
88
+ }
89
+
90
+ //#endregion
91
+ export { inspectApp, isInspectSection, parseInspectSections };
92
+ //# sourceMappingURL=inspect-app.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect-app.mjs","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/inspect/inspect-app.ts"],"sourcesContent":["import { Application } from \"../../application/application\";\nimport { SchemaRegistry } from \"../../openapi/schema-registry\";\nimport { router } from \"../../router/router\";\nimport type { Route } from \"../../router/types\";\nimport { collectConfig } from \"./collect-config\";\nimport { collectModels, collectResources, type InspectModelModule } from \"./collect-models\";\nimport {\n type AppModuleImporter,\n collectJobs,\n collectPackages,\n collectSchedules,\n createAppModuleImporter,\n readAppPackage,\n} from \"./collect-packages\";\nimport { collectPages, installedPagesFromConnectors } from \"./collect-pages\";\nimport { collectRoutes } from \"./collect-routes\";\nimport { groupListeners, type RecordedListener } from \"./event-recorder\";\nimport {\n INSPECT_SCHEMA_VERSION,\n INSPECT_SECTIONS,\n type InspectReport,\n type InspectSection,\n type InspectWarning,\n} from \"./inspect-report.types\";\n\n/** Inputs of {@link inspectApp}. Every field is optional. */\nexport type InspectOptions = {\n /** Project root. Default: `process.cwd()`. */\n cwd?: string;\n /** The sections to include. Default: all of {@link INSPECT_SECTIONS}. */\n sections?: readonly InspectSection[];\n /** The routes to describe. Default: `router.list()`. */\n routes?: readonly Route[];\n /** Model modules the boot pass imported (their exports are scanned for model classes). */\n modelModules?: readonly InspectModelModule[];\n /** Listeners recorded while app modules were imported (see `EventRecorder`). */\n events?: readonly RecordedListener[];\n /** Warnings found before inspecting (by the boot pass); listed first. */\n warnings?: readonly InspectWarning[];\n /** App modules that failed to import; each becomes a `WL2001` warning. */\n moduleFailures?: readonly { file: string; message: string }[];\n /** The `web` connector's installed pages. Default: read from the registered connectors. */\n pages?: readonly unknown[];\n /**\n * Name a resource class in `components.schemas`, usually by its export name\n * (`PostResource`). Unnamed resources fall back to the class name.\n */\n resolveResourceName?: (resource: unknown) => string | undefined;\n /** The loaded config tree. Default: everything `config` holds. */\n config?: Record<string, unknown>;\n /** How packages are imported as the app resolves them (`@warlock.js/queue`, `/scheduler`). */\n importFromApp?: AppModuleImporter;\n /** Clock, for `generatedAt`. */\n now?: () => Date;\n};\n\n/** Whether a string is a section name. */\nexport function isInspectSection(value: string): value is InspectSection {\n return (INSPECT_SECTIONS as readonly string[]).includes(value);\n}\n\n/**\n * Parse a `--section routes,models` value. Throws on an unknown name, listing\n * the valid ones. An empty value means every section.\n */\nexport function parseInspectSections(value: string | undefined): InspectSection[] {\n if (value === undefined || value.trim() === \"\") return [...INSPECT_SECTIONS];\n\n const requested = value\n .split(\",\")\n .map((name) => name.trim())\n .filter((name) => name.length > 0);\n const unknown = requested.filter((name) => !isInspectSection(name));\n\n if (unknown.length > 0) {\n throw new Error(\n `Unknown inspect section(s): ${unknown.join(\", \")}. Valid sections: ${INSPECT_SECTIONS.join(\", \")}.`,\n );\n }\n\n return INSPECT_SECTIONS.filter((section) => requested.includes(section));\n}\n\n/**\n * Describe the application from its in-process registries: routes, models,\n * resources, config keys, event listeners, pages, queue jobs, scheduled\n * tasks and installed `@warlock.js/*` packages.\n *\n * Reads what is ALREADY registered and boots nothing, so it can run inside a\n * live dev process as well as after the `warlock inspect` boot pass. Never\n * throws for one unreadable item: it becomes an entry in `warnings`.\n *\n * @example\n * const report = await inspectApp({ sections: [\"routes\"] });\n * report.routes?.filter((route) => !route.auth.required && route.method !== \"GET\");\n */\nexport async function inspectApp(options: InspectOptions = {}): Promise<InspectReport> {\n const cwd = options.cwd ?? process.cwd();\n const sections = options.sections ? [...options.sections] : [...INSPECT_SECTIONS];\n const wants = new Set<InspectSection>(sections);\n const warnings: InspectWarning[] = [...(options.warnings ?? [])];\n const registry = new SchemaRegistry(options.resolveResourceName, (message) => {\n warnings.push({ code: null, message, source: \"resources\" });\n });\n const importFromApp = options.importFromApp ?? createAppModuleImporter(cwd);\n\n for (const failure of options.moduleFailures ?? []) {\n warnings.push({\n code: \"WL2001\",\n message: `${failure.file} failed to load: ${failure.message}`,\n source: failure.file,\n });\n }\n\n const app = readAppPackage(cwd);\n const report: InspectReport = {\n schemaVersion: INSPECT_SCHEMA_VERSION,\n generatedAt: (options.now ?? (() => new Date()))().toISOString(),\n app: {\n name: app.name,\n version: app.version,\n root: cwd,\n node: process.version,\n environment: String(Application.environment ?? \"development\"),\n runtimeStrategy: String(Application.runtimeStrategy ?? \"development\"),\n },\n sections: INSPECT_SECTIONS.filter((section) => wants.has(section)),\n components: { schemas: {} },\n warnings,\n };\n\n // Routes and models register the resources they reference, so `resources`\n // (and `components`) are filled from both even when only one is printed.\n const routes = collectRoutes(options.routes ?? router.list(), registry, warnings);\n const { models, resourceModels } = collectModels(options.modelModules ?? [], registry, warnings);\n\n if (wants.has(\"routes\")) report.routes = routes;\n if (wants.has(\"models\")) report.models = models;\n if (wants.has(\"resources\")) report.resources = collectResources(registry, resourceModels);\n if (wants.has(\"config\")) report.config = collectConfig(cwd, options.config);\n if (wants.has(\"events\")) report.events = groupListeners(options.events ?? []);\n\n if (wants.has(\"pages\")) {\n report.pages = collectPages(options.pages ?? installedPagesFromConnectors(), cwd, warnings);\n }\n\n if (wants.has(\"jobs\")) report.jobs = await collectJobs(importFromApp, warnings);\n if (wants.has(\"schedules\")) report.schedules = await collectSchedules(importFromApp, warnings);\n if (wants.has(\"packages\")) report.packages = collectPackages(cwd);\n\n report.components.schemas = registry.schemas;\n\n return report;\n}\n"],"mappings":";;;;;;;;;;;;;AAyDA,SAAgB,iBAAiB,OAAwC;CACvE,OAAQ,iBAAuC,SAAS,KAAK;AAC/D;;;;;AAMA,SAAgB,qBAAqB,OAA6C;CAChF,IAAI,UAAU,UAAa,MAAM,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,gBAAgB;CAE3E,MAAM,YAAY,MACf,MAAM,GAAG,CAAC,CACV,KAAK,SAAS,KAAK,KAAK,CAAC,CAAC,CAC1B,QAAQ,SAAS,KAAK,SAAS,CAAC;CACnC,MAAM,UAAU,UAAU,QAAQ,SAAS,CAAC,iBAAiB,IAAI,CAAC;CAElE,IAAI,QAAQ,SAAS,GACnB,MAAM,IAAI,MACR,+BAA+B,QAAQ,KAAK,IAAI,EAAE,oBAAoB,iBAAiB,KAAK,IAAI,EAAE,EACpG;CAGF,OAAO,iBAAiB,QAAQ,YAAY,UAAU,SAAS,OAAO,CAAC;AACzE;;;;;;;;;;;;;;AAeA,eAAsB,WAAW,UAA0B,CAAC,GAA2B;CACrF,MAAM,MAAM,QAAQ,OAAO,QAAQ,IAAI;CACvC,MAAM,WAAW,QAAQ,WAAW,CAAC,GAAG,QAAQ,QAAQ,IAAI,CAAC,GAAG,gBAAgB;CAChF,MAAM,QAAQ,IAAI,IAAoB,QAAQ;CAC9C,MAAM,WAA6B,CAAC,GAAI,QAAQ,YAAY,CAAC,CAAE;CAC/D,MAAM,WAAW,IAAI,eAAe,QAAQ,sBAAsB,YAAY;EAC5E,SAAS,KAAK;GAAE,MAAM;GAAM;GAAS,QAAQ;EAAY,CAAC;CAC5D,CAAC;CACD,MAAM,gBAAgB,QAAQ,iBAAiB,wBAAwB,GAAG;CAE1E,KAAK,MAAM,WAAW,QAAQ,kBAAkB,CAAC,GAC/C,SAAS,KAAK;EACZ,MAAM;EACN,SAAS,GAAG,QAAQ,KAAK,mBAAmB,QAAQ;EACpD,QAAQ,QAAQ;CAClB,CAAC;CAGH,MAAM,MAAM,eAAe,GAAG;CAC9B,MAAM,SAAwB;EAC5B;EACA,cAAc,QAAQ,8BAAc,IAAI,KAAK,GAAE,CAAE,CAAC,CAAC,YAAY;EAC/D,KAAK;GACH,MAAM,IAAI;GACV,SAAS,IAAI;GACb,MAAM;GACN,MAAM,QAAQ;GACd,aAAa,OAAO,YAAY,eAAe,aAAa;GAC5D,iBAAiB,OAAO,YAAY,mBAAmB,aAAa;EACtE;EACA,UAAU,iBAAiB,QAAQ,YAAY,MAAM,IAAI,OAAO,CAAC;EACjE,YAAY,EAAE,SAAS,CAAC,EAAE;EAC1B;CACF;CAIA,MAAM,SAAS,cAAc,QAAQ,UAAU,OAAO,KAAK,GAAG,UAAU,QAAQ;CAChF,MAAM,EAAE,QAAQ,mBAAmB,cAAc,QAAQ,gBAAgB,CAAC,GAAG,UAAU,QAAQ;CAE/F,IAAI,MAAM,IAAI,QAAQ,GAAG,OAAO,SAAS;CACzC,IAAI,MAAM,IAAI,QAAQ,GAAG,OAAO,SAAS;CACzC,IAAI,MAAM,IAAI,WAAW,GAAG,OAAO,YAAY,iBAAiB,UAAU,cAAc;CACxF,IAAI,MAAM,IAAI,QAAQ,GAAG,OAAO,SAAS,cAAc,KAAK,QAAQ,MAAM;CAC1E,IAAI,MAAM,IAAI,QAAQ,GAAG,OAAO,SAAS,eAAe,QAAQ,UAAU,CAAC,CAAC;CAE5E,IAAI,MAAM,IAAI,OAAO,GACnB,OAAO,QAAQ,aAAa,QAAQ,SAAS,6BAA6B,GAAG,KAAK,QAAQ;CAG5F,IAAI,MAAM,IAAI,MAAM,GAAG,OAAO,OAAO,MAAM,YAAY,eAAe,QAAQ;CAC9E,IAAI,MAAM,IAAI,WAAW,GAAG,OAAO,YAAY,MAAM,iBAAiB,eAAe,QAAQ;CAC7F,IAAI,MAAM,IAAI,UAAU,GAAG,OAAO,WAAW,gBAAgB,GAAG;CAEhE,OAAO,WAAW,UAAU,SAAS;CAErC,OAAO;AACT"}
@@ -0,0 +1,15 @@
1
+ //#region ../../packages/core/src/tooling/inspect/inspect-report.schema.d.ts
2
+ /**
3
+ * JSON Schema (draft 2020-12) of the `warlock inspect` report, schema version 1.
4
+ *
5
+ * Shipped twice: as this constant, and as
6
+ * `@warlock.js/core/schemas/inspect-report.schema.json` for tools that are not
7
+ * JavaScript. A test keeps the two identical. Objects allow additional
8
+ * properties on purpose: within schema version 1 fields are only added, and a
9
+ * validator written today must accept tomorrow's reports.
10
+ */
11
+ /** The report's JSON Schema, draft 2020-12. */
12
+ declare const INSPECT_REPORT_JSON_SCHEMA: Record<string, unknown>;
13
+ //#endregion
14
+ export { INSPECT_REPORT_JSON_SCHEMA };
15
+ //# sourceMappingURL=inspect-report.schema.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect-report.schema.d.mts","names":[],"sources":["../../../../../../../../../packages/core/src/tooling/inspect/inspect-report.schema.ts"],"mappings":";;AAkRA;;;;AAA+C;;;;;cAAlC,0BAAA,EAA4B,MAAM"}