@warlock.js/core 5.31.0 → 5.33.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 (1097) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/esm/application/app.d.mts +3 -3
  3. package/esm/application/app.d.mts.map +1 -1
  4. package/esm/application/application-config-types.d.mts +9 -2
  5. package/esm/application/application-config-types.d.mts.map +1 -1
  6. package/esm/application/application.d.mts +5 -7
  7. package/esm/application/application.d.mts.map +1 -1
  8. package/esm/application/application.mjs +3 -1
  9. package/esm/application/application.mjs.map +1 -1
  10. package/esm/application/boot-signal.d.mts +22 -20
  11. package/esm/application/boot-signal.d.mts.map +1 -1
  12. package/esm/application/boot-signal.mjs +15 -9
  13. package/esm/application/boot-signal.mjs.map +1 -1
  14. package/esm/application/index.d.mts +2 -1
  15. package/esm/application/index.mjs +1 -1
  16. package/esm/application/public-url.d.mts +1 -2
  17. package/esm/application/public-url.d.mts.map +1 -1
  18. package/esm/application/roles.d.mts +10 -11
  19. package/esm/application/roles.d.mts.map +1 -1
  20. package/esm/benchmark/benchmark-snapshots.d.mts +1 -3
  21. package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
  22. package/esm/benchmark/benchmark.d.mts +1 -3
  23. package/esm/benchmark/benchmark.d.mts.map +1 -1
  24. package/esm/benchmark/channels/console.channel.d.mts +1 -3
  25. package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
  26. package/esm/benchmark/channels/noop.channel.d.mts +1 -3
  27. package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
  28. package/esm/benchmark/index.mjs +1 -1
  29. package/esm/benchmark/profiler.d.mts +1 -3
  30. package/esm/benchmark/profiler.d.mts.map +1 -1
  31. package/esm/benchmark/profiler.mjs +2 -1
  32. package/esm/benchmark/profiler.mjs.map +1 -1
  33. package/esm/benchmark/types.d.mts +22 -17
  34. package/esm/benchmark/types.d.mts.map +1 -1
  35. package/esm/bootstrap/setup.d.mts +1 -2
  36. package/esm/bootstrap/setup.d.mts.map +1 -1
  37. package/esm/bootstrap.d.mts +1 -2
  38. package/esm/bootstrap.d.mts.map +1 -1
  39. package/esm/cache/database-cache-driver.d.mts +3 -5
  40. package/esm/cache/database-cache-driver.d.mts.map +1 -1
  41. package/esm/cache/database-cache-driver.mjs +1 -1
  42. package/esm/cache/index.d.mts +2 -1
  43. package/esm/cache/index.mjs +1 -1
  44. package/esm/cli/cli-commands.manager.mjs +6 -3
  45. package/esm/cli/cli-commands.manager.mjs.map +1 -1
  46. package/esm/cli/commands/agents-md/agents-md-command.action.mjs +3 -2
  47. package/esm/cli/commands/agents-md/agents-md-command.action.mjs.map +1 -1
  48. package/esm/cli/commands/ai/ai-command.action.mjs +140 -0
  49. package/esm/cli/commands/ai/ai-command.action.mjs.map +1 -0
  50. package/esm/cli/commands/ai.command.mjs +50 -0
  51. package/esm/cli/commands/ai.command.mjs.map +1 -0
  52. package/esm/cli/commands/board/board-command.action.mjs +1 -1
  53. package/esm/cli/commands/check/check-command.action.mjs +4 -1
  54. package/esm/cli/commands/check/check-command.action.mjs.map +1 -1
  55. package/esm/cli/commands/check/child-typecheck.mjs +1 -1
  56. package/esm/cli/commands/check/child-typecheck.mjs.map +1 -1
  57. package/esm/cli/commands/check/format-problems.mjs +1 -1
  58. package/esm/cli/commands/check.command.mjs +6 -1
  59. package/esm/cli/commands/check.command.mjs.map +1 -1
  60. package/esm/cli/commands/dev-server.command.mjs +3 -2
  61. package/esm/cli/commands/dev-server.command.mjs.map +1 -1
  62. package/esm/cli/commands/doctor/check.types.d.mts +29 -16
  63. package/esm/cli/commands/doctor/check.types.d.mts.map +1 -1
  64. package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs +22 -27
  65. package/esm/cli/commands/doctor/checks/locales-ts-deprecated.check.mjs.map +1 -1
  66. package/esm/cli/commands/doctor/doctor-command.action.mjs +2 -1
  67. package/esm/cli/commands/doctor/doctor-command.action.mjs.map +1 -1
  68. package/esm/cli/commands/explain/explain-command.action.mjs +1 -1
  69. package/esm/cli/commands/generate/generators/controller.generator.mjs +5 -2
  70. package/esm/cli/commands/generate/generators/controller.generator.mjs.map +1 -1
  71. package/esm/cli/commands/generate/generators/endpoint.generator.mjs +5 -3
  72. package/esm/cli/commands/generate/generators/endpoint.generator.mjs.map +1 -1
  73. package/esm/cli/commands/generate/generators/model.generator.mjs +3 -2
  74. package/esm/cli/commands/generate/generators/model.generator.mjs.map +1 -1
  75. package/esm/cli/commands/generate/generators/repository.generator.mjs +3 -1
  76. package/esm/cli/commands/generate/generators/repository.generator.mjs.map +1 -1
  77. package/esm/cli/commands/generate/generators/resource.generator.mjs +3 -1
  78. package/esm/cli/commands/generate/generators/resource.generator.mjs.map +1 -1
  79. package/esm/cli/commands/generate/generators/service.generator.mjs +3 -1
  80. package/esm/cli/commands/generate/generators/service.generator.mjs.map +1 -1
  81. package/esm/cli/commands/generate/templates/endpoint-stubs.mjs +2 -2
  82. package/esm/cli/commands/generate/templates/endpoint-stubs.mjs.map +1 -1
  83. package/esm/cli/commands/generate/utils/endpoint-schema.mjs +1 -2
  84. package/esm/cli/commands/generate/utils/endpoint-schema.mjs.map +1 -1
  85. package/esm/cli/commands/generate/utils/name-parser.mjs +1 -1
  86. package/esm/cli/commands/generate/utils/path-resolver.mjs +1 -1
  87. package/esm/cli/commands/inspect/inspect-command.action.mjs +3 -2
  88. package/esm/cli/commands/inspect/inspect-command.action.mjs.map +1 -1
  89. package/esm/cli/commands/issue/collect-environment.mjs +187 -0
  90. package/esm/cli/commands/issue/collect-environment.mjs.map +1 -0
  91. package/esm/cli/commands/issue/issue-command.action.mjs +70 -0
  92. package/esm/cli/commands/issue/issue-command.action.mjs.map +1 -0
  93. package/esm/cli/commands/issue.command.mjs +31 -0
  94. package/esm/cli/commands/issue.command.mjs.map +1 -0
  95. package/esm/cli/commands/mcp/mcp-command.action.mjs +15 -14
  96. package/esm/cli/commands/mcp/mcp-command.action.mjs.map +1 -1
  97. package/esm/cli/commands/openapi-generator.action.mjs +1 -1
  98. package/esm/cli/commands/pm2/pm2-command.action.mjs +91 -0
  99. package/esm/cli/commands/pm2/pm2-command.action.mjs.map +1 -0
  100. package/esm/cli/commands/pm2/pm2-config.mjs +115 -0
  101. package/esm/cli/commands/pm2/pm2-config.mjs.map +1 -0
  102. package/esm/cli/commands/pm2.command.mjs +53 -0
  103. package/esm/cli/commands/pm2.command.mjs.map +1 -0
  104. package/esm/cli/commands/postman-generator.action.mjs +1 -1
  105. package/esm/cli/commands/routes/format-routes-table.mjs +1 -1
  106. package/esm/cli/commands/routes/route-row.mjs +1 -1
  107. package/esm/cli/commands/routes/routes-diff.action.mjs +2 -2
  108. package/esm/cli/commands/routes/routes-diff.action.mjs.map +1 -1
  109. package/esm/cli/commands/test.command.mjs +1 -1
  110. package/esm/cli/commands/trace/trace-command.action.mjs +1 -1
  111. package/esm/cli/commands-loader.mjs +1 -1
  112. package/esm/cli/framework-cli-commands.mjs +6 -0
  113. package/esm/cli/framework-cli-commands.mjs.map +1 -1
  114. package/esm/cli/parse-cli-args.mjs +2 -2
  115. package/esm/cli/parse-cli-args.mjs.map +1 -1
  116. package/esm/cli/start.d.mts +1 -1
  117. package/esm/cli/string-similarity.mjs +1 -1
  118. package/esm/commands/cli-command.d.mts +2 -4
  119. package/esm/commands/cli-command.d.mts.map +1 -1
  120. package/esm/commands/index.d.mts +2 -1
  121. package/esm/commands/index.mjs +1 -1
  122. package/esm/commands/types.d.mts +8 -8
  123. package/esm/commands/types.d.mts.map +1 -1
  124. package/esm/config/config-getter.d.mts +2 -3
  125. package/esm/config/config-getter.d.mts.map +1 -1
  126. package/esm/config/config-getter.mjs +5 -5
  127. package/esm/config/config-getter.mjs.map +1 -1
  128. package/esm/config/config-handlers.d.mts +1 -3
  129. package/esm/config/config-handlers.d.mts.map +1 -1
  130. package/esm/config/config-loader.d.mts +1 -2
  131. package/esm/config/config-loader.d.mts.map +1 -1
  132. package/esm/config/config-loader.mjs +3 -3
  133. package/esm/config/config-loader.mjs.map +1 -1
  134. package/esm/config/config-manager.mjs +1 -1
  135. package/esm/config/config-schema.d.mts +19 -16
  136. package/esm/config/config-schema.d.mts.map +1 -1
  137. package/esm/config/config-setter.d.mts +2 -4
  138. package/esm/config/config-setter.d.mts.map +1 -1
  139. package/esm/config/config-setter.mjs +2 -2
  140. package/esm/config/config-setter.mjs.map +1 -1
  141. package/esm/config/config-special-handlers.d.mts +2 -4
  142. package/esm/config/config-special-handlers.d.mts.map +1 -1
  143. package/esm/config/index.d.mts +2 -1
  144. package/esm/config/index.mjs +1 -1
  145. package/esm/config/types.d.mts +4 -5
  146. package/esm/config/types.d.mts.map +1 -1
  147. package/esm/connectors/access-connector.d.mts +1 -3
  148. package/esm/connectors/access-connector.d.mts.map +1 -1
  149. package/esm/connectors/access-connector.mjs +2 -2
  150. package/esm/connectors/access-connector.mjs.map +1 -1
  151. package/esm/connectors/ai-connector.d.mts +1 -3
  152. package/esm/connectors/ai-connector.d.mts.map +1 -1
  153. package/esm/connectors/ai-connector.mjs +2 -2
  154. package/esm/connectors/ai-connector.mjs.map +1 -1
  155. package/esm/connectors/assert-no-reserved-connector-names.d.mts +1 -3
  156. package/esm/connectors/assert-no-reserved-connector-names.d.mts.map +1 -1
  157. package/esm/connectors/assert-unique-connector-names.d.mts +1 -3
  158. package/esm/connectors/assert-unique-connector-names.d.mts.map +1 -1
  159. package/esm/connectors/assert-unique-connector-names.mjs +2 -1
  160. package/esm/connectors/assert-unique-connector-names.mjs.map +1 -1
  161. package/esm/connectors/base-connector.d.mts +1 -3
  162. package/esm/connectors/base-connector.d.mts.map +1 -1
  163. package/esm/connectors/cache-connector.d.mts +1 -3
  164. package/esm/connectors/cache-connector.d.mts.map +1 -1
  165. package/esm/connectors/cache-connector.mjs +3 -3
  166. package/esm/connectors/cache-connector.mjs.map +1 -1
  167. package/esm/connectors/connectors-manager.d.mts +2 -4
  168. package/esm/connectors/connectors-manager.d.mts.map +1 -1
  169. package/esm/connectors/connectors-manager.mjs +3 -6
  170. package/esm/connectors/connectors-manager.mjs.map +1 -1
  171. package/esm/connectors/database-connector.d.mts +1 -3
  172. package/esm/connectors/database-connector.d.mts.map +1 -1
  173. package/esm/connectors/database-connector.mjs +2 -2
  174. package/esm/connectors/database-connector.mjs.map +1 -1
  175. package/esm/connectors/describe-server-address.mjs +4 -4
  176. package/esm/connectors/describe-server-address.mjs.map +1 -1
  177. package/esm/connectors/herald-connector.d.mts +1 -3
  178. package/esm/connectors/herald-connector.d.mts.map +1 -1
  179. package/esm/connectors/herald-connector.mjs +2 -2
  180. package/esm/connectors/herald-connector.mjs.map +1 -1
  181. package/esm/connectors/http-connector.d.mts +1 -3
  182. package/esm/connectors/http-connector.d.mts.map +1 -1
  183. package/esm/connectors/http-connector.mjs +8 -7
  184. package/esm/connectors/http-connector.mjs.map +1 -1
  185. package/esm/connectors/index.d.mts +2 -1
  186. package/esm/connectors/index.mjs +1 -1
  187. package/esm/connectors/logger-connector.d.mts +1 -3
  188. package/esm/connectors/logger-connector.d.mts.map +1 -1
  189. package/esm/connectors/logger-connector.mjs +2 -2
  190. package/esm/connectors/logger-connector.mjs.map +1 -1
  191. package/esm/connectors/mail-connector.d.mts +1 -3
  192. package/esm/connectors/mail-connector.d.mts.map +1 -1
  193. package/esm/connectors/mail-connector.mjs +2 -2
  194. package/esm/connectors/mail-connector.mjs.map +1 -1
  195. package/esm/connectors/notifications-connector.d.mts +1 -3
  196. package/esm/connectors/notifications-connector.d.mts.map +1 -1
  197. package/esm/connectors/notifications-connector.mjs +2 -2
  198. package/esm/connectors/notifications-connector.mjs.map +1 -1
  199. package/esm/connectors/register-configured-connectors.d.mts +2 -4
  200. package/esm/connectors/register-configured-connectors.d.mts.map +1 -1
  201. package/esm/connectors/shutdown-timeout.mjs +7 -0
  202. package/esm/connectors/shutdown-timeout.mjs.map +1 -0
  203. package/esm/connectors/socket-connector.d.mts +1 -3
  204. package/esm/connectors/socket-connector.d.mts.map +1 -1
  205. package/esm/connectors/socket-connector.mjs +20 -11
  206. package/esm/connectors/socket-connector.mjs.map +1 -1
  207. package/esm/connectors/storage.connector.d.mts +1 -3
  208. package/esm/connectors/storage.connector.d.mts.map +1 -1
  209. package/esm/connectors/storage.connector.mjs +2 -2
  210. package/esm/connectors/storage.connector.mjs.map +1 -1
  211. package/esm/connectors/types.d.mts +17 -14
  212. package/esm/connectors/types.d.mts.map +1 -1
  213. package/esm/container/container-instance-registry.mjs.map +1 -1
  214. package/esm/container/development-app-modules.d.mts +7 -5
  215. package/esm/container/development-app-modules.d.mts.map +1 -1
  216. package/esm/container/development-model-modules.d.mts +6 -5
  217. package/esm/container/development-model-modules.d.mts.map +1 -1
  218. package/esm/container/index.d.mts +4 -4
  219. package/esm/container/index.d.mts.map +1 -1
  220. package/esm/database/index.d.mts +3 -1
  221. package/esm/database/index.mjs +1 -1
  222. package/esm/database/migrate-action.mjs +1 -1
  223. package/esm/database/models/database-log/database-log.d.mts +2 -3
  224. package/esm/database/models/database-log/database-log.d.mts.map +1 -1
  225. package/esm/database/models/database-log/index.d.mts +2 -1
  226. package/esm/database/models/database-log/index.mjs +1 -1
  227. package/esm/database/seed-command-action.mjs +1 -1
  228. package/esm/database/seeds/seeder.d.mts +2 -4
  229. package/esm/database/seeds/seeder.d.mts.map +1 -1
  230. package/esm/database/seeds/seeder.errors.d.mts +2 -3
  231. package/esm/database/seeds/seeder.errors.d.mts.map +1 -1
  232. package/esm/database/seeds/seeders.manager.mjs +2 -1
  233. package/esm/database/seeds/seeders.manager.mjs.map +1 -1
  234. package/esm/database/seeds/types.d.mts +7 -8
  235. package/esm/database/seeds/types.d.mts.map +1 -1
  236. package/esm/database/utils.d.mts +4 -5
  237. package/esm/database/utils.d.mts.map +1 -1
  238. package/esm/dev-server/app-module-registry.mjs +1 -1
  239. package/esm/dev-server/create-worker.mjs +5 -3
  240. package/esm/dev-server/create-worker.mjs.map +1 -1
  241. package/esm/dev-server/dependency-graph.d.mts +1 -3
  242. package/esm/dev-server/dependency-graph.d.mts.map +1 -1
  243. package/esm/dev-server/dependency-graph.mjs +1 -1
  244. package/esm/dev-server/dependency-graph.mjs.map +1 -1
  245. package/esm/dev-server/extract-translation-keys.mjs +16 -17
  246. package/esm/dev-server/extract-translation-keys.mjs.map +1 -1
  247. package/esm/dev-server/file-manager.d.mts +3 -7
  248. package/esm/dev-server/file-manager.d.mts.map +1 -1
  249. package/esm/dev-server/file-operations.d.mts +1 -3
  250. package/esm/dev-server/file-operations.d.mts.map +1 -1
  251. package/esm/dev-server/files-watcher.mjs +12 -11
  252. package/esm/dev-server/files-watcher.mjs.map +1 -1
  253. package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +6 -8
  254. package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
  255. package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +36 -115
  256. package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
  257. package/esm/dev-server/health-checker/default-health-checkers.mjs +6 -15
  258. package/esm/dev-server/health-checker/default-health-checkers.mjs.map +1 -1
  259. package/esm/dev-server/health-checker/eslint-support.mjs +27 -0
  260. package/esm/dev-server/health-checker/eslint-support.mjs.map +1 -0
  261. package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +7 -6
  262. package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
  263. package/esm/dev-server/health-checker/file-health-result.d.mts +2 -2
  264. package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
  265. package/esm/dev-server/health-checker/files-healthcare.manager.mjs +1 -0
  266. package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
  267. package/esm/dev-server/health-checker/oxlint-runner.mjs +6 -5
  268. package/esm/dev-server/health-checker/oxlint-runner.mjs.map +1 -1
  269. package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +1 -1
  270. package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs +2 -11
  271. package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs.map +1 -1
  272. package/esm/dev-server/health-checker/workers/oxlint-health.worker.d.mts +1 -1
  273. package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +1 -1
  274. package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +40 -174
  275. package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
  276. package/esm/dev-server/loader/hook-thread.d.mts +4 -8
  277. package/esm/dev-server/loader/hook-thread.d.mts.map +1 -1
  278. package/esm/dev-server/loader/load-hook.d.mts +10 -6
  279. package/esm/dev-server/loader/load-hook.d.mts.map +1 -1
  280. package/esm/dev-server/loader/load-hook.mjs +4 -3
  281. package/esm/dev-server/loader/load-hook.mjs.map +1 -1
  282. package/esm/dev-server/loader/own-resolver.mjs +1 -1
  283. package/esm/dev-server/loader/register-loader.mjs +3 -2
  284. package/esm/dev-server/loader/register-loader.mjs.map +1 -1
  285. package/esm/dev-server/loader/resolve-hook.d.mts +2 -2
  286. package/esm/dev-server/loader/resolve-hook.d.mts.map +1 -1
  287. package/esm/dev-server/loader/resolve-hook.mjs +2 -1
  288. package/esm/dev-server/loader/resolve-hook.mjs.map +1 -1
  289. package/esm/dev-server/loader/transpile-cache.mjs +2 -1
  290. package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
  291. package/esm/dev-server/manifest-manager.d.mts +1 -3
  292. package/esm/dev-server/manifest-manager.d.mts.map +1 -1
  293. package/esm/dev-server/model-module-registry.mjs +3 -3
  294. package/esm/dev-server/model-module-registry.mjs.map +1 -1
  295. package/esm/dev-server/model-resource-typings.mjs +40 -47
  296. package/esm/dev-server/model-resource-typings.mjs.map +1 -1
  297. package/esm/dev-server/module-loader.mjs +2 -2
  298. package/esm/dev-server/module-loader.mjs.map +1 -1
  299. package/esm/dev-server/package-json-manager.mjs +1 -1
  300. package/esm/dev-server/parse-imports.mjs +6 -38
  301. package/esm/dev-server/parse-imports.mjs.map +1 -1
  302. package/esm/dev-server/read-config-ast.mjs +3 -33
  303. package/esm/dev-server/read-config-ast.mjs.map +1 -1
  304. package/esm/dev-server/ready-block.mjs +1 -1
  305. package/esm/dev-server/shortcuts.mjs +1 -1
  306. package/esm/dev-server/special-files-collector.d.mts +2 -4
  307. package/esm/dev-server/special-files-collector.d.mts.map +1 -1
  308. package/esm/dev-server/supervisor.mjs +1 -1
  309. package/esm/dev-server/tsconfig-manager.mjs +3 -3
  310. package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
  311. package/esm/dev-server/type-generator.mjs +28 -35
  312. package/esm/dev-server/type-generator.mjs.map +1 -1
  313. package/esm/dev-server/types.d.mts +3 -4
  314. package/esm/dev-server/types.d.mts.map +1 -1
  315. package/esm/dev-server/update-check-cache.mjs +2 -2
  316. package/esm/dev-server/update-check-cache.mjs.map +1 -1
  317. package/esm/encryption/encrypt.d.mts +2 -3
  318. package/esm/encryption/encrypt.d.mts.map +1 -1
  319. package/esm/encryption/hash.d.mts +1 -2
  320. package/esm/encryption/hash.d.mts.map +1 -1
  321. package/esm/encryption/index.mjs +1 -1
  322. package/esm/encryption/password.d.mts +2 -3
  323. package/esm/encryption/password.d.mts.map +1 -1
  324. package/esm/encryption/types.d.mts +2 -3
  325. package/esm/encryption/types.d.mts.map +1 -1
  326. package/esm/errors/error-codes.d.mts +29 -22
  327. package/esm/errors/error-codes.d.mts.map +1 -1
  328. package/esm/errors/warlock-error.d.mts +1 -3
  329. package/esm/errors/warlock-error.d.mts.map +1 -1
  330. package/esm/generations/add-command.action.mjs +3 -2
  331. package/esm/generations/add-command.action.mjs.map +1 -1
  332. package/esm/generations/features/bull-board.feature.mjs +2 -1
  333. package/esm/generations/features/bull-board.feature.mjs.map +1 -1
  334. package/esm/generations/features/index.mjs +2 -0
  335. package/esm/generations/features/index.mjs.map +1 -1
  336. package/esm/generations/features/notifications.feature.mjs +2 -1
  337. package/esm/generations/features/notifications.feature.mjs.map +1 -1
  338. package/esm/generations/features/process.feature.mjs +65 -0
  339. package/esm/generations/features/process.feature.mjs.map +1 -0
  340. package/esm/generations/features/shared/merge-web-sitemap-config.mjs +16 -23
  341. package/esm/generations/features/shared/merge-web-sitemap-config.mjs.map +1 -1
  342. package/esm/generations/features/shared/patch-tsconfig-include.mjs +1 -1
  343. package/esm/generations/features/shared/relocate-conflicting-home-route.mjs +1 -1
  344. package/esm/generations/features/sitemap.feature.mjs +2 -1
  345. package/esm/generations/features/sitemap.feature.mjs.map +1 -1
  346. package/esm/generations/generation-fs.mjs +1 -1
  347. package/esm/generations/generation-run.mjs +1 -1
  348. package/esm/generations/stubs.mjs +1 -1
  349. package/esm/generations/stubs.mjs.map +1 -1
  350. package/esm/http/boot-port-preflight.d.mts +4 -5
  351. package/esm/http/boot-port-preflight.d.mts.map +1 -1
  352. package/esm/http/boot-port-preflight.mjs +2 -2
  353. package/esm/http/boot-port-preflight.mjs.map +1 -1
  354. package/esm/http/bounded-stream-queue.d.mts +4 -4
  355. package/esm/http/bounded-stream-queue.d.mts.map +1 -1
  356. package/esm/http/bounded-stream-queue.mjs +1 -1
  357. package/esm/http/bounded-stream-queue.mjs.map +1 -1
  358. package/esm/http/build-cors-options.mjs +2 -2
  359. package/esm/http/build-cors-options.mjs.map +1 -1
  360. package/esm/http/build-rate-limit-options.d.mts +2 -3
  361. package/esm/http/build-rate-limit-options.d.mts.map +1 -1
  362. package/esm/http/build-rate-limit-options.mjs +1 -1
  363. package/esm/http/build-rate-limit-options.mjs.map +1 -1
  364. package/esm/http/conditional-request.d.mts +14 -13
  365. package/esm/http/conditional-request.d.mts.map +1 -1
  366. package/esm/http/config.d.mts +2 -4
  367. package/esm/http/config.d.mts.map +1 -1
  368. package/esm/http/config.mjs +2 -2
  369. package/esm/http/config.mjs.map +1 -1
  370. package/esm/http/context/request-context.d.mts +6 -7
  371. package/esm/http/context/request-context.d.mts.map +1 -1
  372. package/esm/http/context/request-memo.d.mts +1 -2
  373. package/esm/http/context/request-memo.d.mts.map +1 -1
  374. package/esm/http/createHttpApplication.d.mts +2 -3
  375. package/esm/http/createHttpApplication.d.mts.map +1 -1
  376. package/esm/http/createHttpApplication.mjs +2 -2
  377. package/esm/http/createHttpApplication.mjs.map +1 -1
  378. package/esm/http/csp.d.mts +10 -12
  379. package/esm/http/csp.d.mts.map +1 -1
  380. package/esm/http/csp.mjs +2 -2
  381. package/esm/http/csp.mjs.map +1 -1
  382. package/esm/http/csrf-default-guard.d.mts +2 -4
  383. package/esm/http/csrf-default-guard.d.mts.map +1 -1
  384. package/esm/http/csrf-default-guard.mjs +1 -1
  385. package/esm/http/csrf-default-guard.mjs.map +1 -1
  386. package/esm/http/csrf-origin-policy.d.mts +7 -9
  387. package/esm/http/csrf-origin-policy.d.mts.map +1 -1
  388. package/esm/http/csrf-origin-policy.mjs +2 -2
  389. package/esm/http/csrf-origin-policy.mjs.map +1 -1
  390. package/esm/http/database/RequestLog.d.mts +2 -3
  391. package/esm/http/database/RequestLog.d.mts.map +1 -1
  392. package/esm/http/error-codes.d.mts +1 -2
  393. package/esm/http/error-codes.d.mts.map +1 -1
  394. package/esm/http/error-mapper.d.mts +2 -4
  395. package/esm/http/error-mapper.d.mts.map +1 -1
  396. package/esm/http/error-mapper.mjs +2 -2
  397. package/esm/http/error-mapper.mjs.map +1 -1
  398. package/esm/http/errors/errors.d.mts +28 -29
  399. package/esm/http/errors/errors.d.mts.map +1 -1
  400. package/esm/http/escape-header-value.d.mts +1 -2
  401. package/esm/http/escape-header-value.d.mts.map +1 -1
  402. package/esm/http/events.d.mts +2 -4
  403. package/esm/http/events.d.mts.map +1 -1
  404. package/esm/http/health.d.mts +4 -4
  405. package/esm/http/health.d.mts.map +1 -1
  406. package/esm/http/index.d.mts +4 -1
  407. package/esm/http/index.mjs +1 -1
  408. package/esm/http/middleware/cache-response-middleware.d.mts +2 -4
  409. package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
  410. package/esm/http/middleware/concurrency-limit.middleware.d.mts +3 -3
  411. package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
  412. package/esm/http/middleware/idempotency.middleware.d.mts +3 -3
  413. package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
  414. package/esm/http/middleware/idempotency.middleware.mjs +6 -6
  415. package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
  416. package/esm/http/middleware/index.d.mts +3 -1
  417. package/esm/http/middleware/index.mjs +1 -1
  418. package/esm/http/middleware/inject-request-context.d.mts +2 -4
  419. package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
  420. package/esm/http/middleware/inject-request-context.mjs +3 -3
  421. package/esm/http/middleware/inject-request-context.mjs.map +1 -1
  422. package/esm/http/middleware/ip-filter.middleware.d.mts +3 -3
  423. package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
  424. package/esm/http/middleware/maintenance.middleware.d.mts +3 -3
  425. package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
  426. package/esm/http/middleware/maintenance.middleware.mjs +4 -4
  427. package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
  428. package/esm/http/middleware/max-body-size.middleware.d.mts +2 -2
  429. package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
  430. package/esm/http/middleware/middleware-list.d.mts +1 -3
  431. package/esm/http/middleware/middleware-list.d.mts.map +1 -1
  432. package/esm/http/middleware/rate-limit.middleware.d.mts +3 -3
  433. package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
  434. package/esm/http/middleware/rate-limit.middleware.mjs +2 -2
  435. package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
  436. package/esm/http/middleware/utils/cidr-match.d.mts +2 -3
  437. package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
  438. package/esm/http/middleware/utils/idempotency-key.d.mts +3 -5
  439. package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
  440. package/esm/http/middleware/utils/index.d.mts +2 -1
  441. package/esm/http/middleware/utils/parse-size.d.mts +1 -2
  442. package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
  443. package/esm/http/middleware/utils/parse-size.mjs +2 -2
  444. package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
  445. package/esm/http/plugins.d.mts +2 -4
  446. package/esm/http/plugins.d.mts.map +1 -1
  447. package/esm/http/plugins.mjs +10 -10
  448. package/esm/http/plugins.mjs.map +1 -1
  449. package/esm/http/port-preflight.d.mts +3 -4
  450. package/esm/http/port-preflight.d.mts.map +1 -1
  451. package/esm/http/port-preflight.mjs +2 -0
  452. package/esm/http/port-preflight.mjs.map +1 -1
  453. package/esm/http/rate-limit-cache-store.mjs +4 -3
  454. package/esm/http/rate-limit-cache-store.mjs.map +1 -1
  455. package/esm/http/ready-report.d.mts +15 -10
  456. package/esm/http/ready-report.d.mts.map +1 -1
  457. package/esm/http/request-controller.d.mts +1 -3
  458. package/esm/http/request-controller.d.mts.map +1 -1
  459. package/esm/http/request-log-snapshot.d.mts +20 -16
  460. package/esm/http/request-log-snapshot.d.mts.map +1 -1
  461. package/esm/http/request-log-snapshot.mjs +3 -3
  462. package/esm/http/request-log-snapshot.mjs.map +1 -1
  463. package/esm/http/request.d.mts +8 -7
  464. package/esm/http/request.d.mts.map +1 -1
  465. package/esm/http/request.mjs +8 -7
  466. package/esm/http/request.mjs.map +1 -1
  467. package/esm/http/response.d.mts +12 -11
  468. package/esm/http/response.d.mts.map +1 -1
  469. package/esm/http/response.mjs +7 -7
  470. package/esm/http/response.mjs.map +1 -1
  471. package/esm/http/safe-redirect.d.mts +3 -4
  472. package/esm/http/safe-redirect.d.mts.map +1 -1
  473. package/esm/http/serialized.d.mts +12 -13
  474. package/esm/http/serialized.d.mts.map +1 -1
  475. package/esm/http/server-rebuilt.d.mts +3 -5
  476. package/esm/http/server-rebuilt.d.mts.map +1 -1
  477. package/esm/http/server.d.mts +9 -9
  478. package/esm/http/server.d.mts.map +1 -1
  479. package/esm/http/server.mjs +4 -4
  480. package/esm/http/server.mjs.map +1 -1
  481. package/esm/http/stream-react-response.d.mts +7 -7
  482. package/esm/http/stream-react-response.d.mts.map +1 -1
  483. package/esm/http/tracing/index.mjs +1 -1
  484. package/esm/http/tracing/trace-id.d.mts +2 -3
  485. package/esm/http/tracing/trace-id.d.mts.map +1 -1
  486. package/esm/http/tracing/tracing-dispatcher.d.mts +10 -11
  487. package/esm/http/tracing/tracing-dispatcher.d.mts.map +1 -1
  488. package/esm/http/tracing/tracing-dispatcher.mjs +2 -2
  489. package/esm/http/tracing/tracing-dispatcher.mjs.map +1 -1
  490. package/esm/http/tracing/tracing.type.d.mts +11 -9
  491. package/esm/http/tracing/tracing.type.d.mts.map +1 -1
  492. package/esm/http/types.d.mts +49 -43
  493. package/esm/http/types.d.mts.map +1 -1
  494. package/esm/http/uploaded-file.d.mts +6 -5
  495. package/esm/http/uploaded-file.d.mts.map +1 -1
  496. package/esm/http/uploads/generate-image-variants.d.mts +6 -6
  497. package/esm/http/uploads/generate-image-variants.d.mts.map +1 -1
  498. package/esm/http/uploads/generate-image-variants.mjs +1 -1
  499. package/esm/http/uploads/generate-image-variants.mjs.map +1 -1
  500. package/esm/http/uploads/image-variant-cache-entries.mjs +1 -1
  501. package/esm/http/uploads/image-variant-cache.mjs +8 -8
  502. package/esm/http/uploads/image-variant-cache.mjs.map +1 -1
  503. package/esm/http/uploads/image-variant-types.d.mts +7 -9
  504. package/esm/http/uploads/image-variant-types.d.mts.map +1 -1
  505. package/esm/http/uploads/image-variants-config-error.d.mts +1 -2
  506. package/esm/http/uploads/image-variants-config-error.d.mts.map +1 -1
  507. package/esm/http/uploads/index.d.mts +2 -1
  508. package/esm/http/uploads/index.mjs +1 -1
  509. package/esm/http/uploads/parse-uploaded-file-query.mjs +1 -1
  510. package/esm/http/uploads/parse-uploaded-file-query.mjs.map +1 -1
  511. package/esm/http/uploads/purge-image-variants.d.mts +2 -4
  512. package/esm/http/uploads/purge-image-variants.d.mts.map +1 -1
  513. package/esm/http/uploads/resolve-image-variant.d.mts +3 -5
  514. package/esm/http/uploads/resolve-image-variant.d.mts.map +1 -1
  515. package/esm/http/uploads/resolve-image-variants-config.mjs +4 -4
  516. package/esm/http/uploads/resolve-image-variants-config.mjs.map +1 -1
  517. package/esm/http/uploads/resolve-original-content-type.mjs +1 -1
  518. package/esm/http/uploads/resolve-original-content-type.mjs.map +1 -1
  519. package/esm/http/uploads/trim-image-variant-cache.mjs +3 -3
  520. package/esm/http/uploads/trim-image-variant-cache.mjs.map +1 -1
  521. package/esm/http/uploads/uploaded-file.controller.d.mts +6 -5
  522. package/esm/http/uploads/uploaded-file.controller.d.mts.map +1 -1
  523. package/esm/http/uploads/uploaded-file.controller.mjs +2 -1
  524. package/esm/http/uploads/uploaded-file.controller.mjs.map +1 -1
  525. package/esm/http/uploads/variant-cache-key.mjs +1 -1
  526. package/esm/http/uploads-config.d.mts +2 -4
  527. package/esm/http/uploads-config.d.mts.map +1 -1
  528. package/esm/http/uploads-types.d.mts +19 -17
  529. package/esm/http/uploads-types.d.mts.map +1 -1
  530. package/esm/http/xmlable.d.mts +1 -2
  531. package/esm/http/xmlable.d.mts.map +1 -1
  532. package/esm/image/image.d.mts +6 -7
  533. package/esm/image/image.d.mts.map +1 -1
  534. package/esm/image/image.mjs.map +1 -1
  535. package/esm/image/index.d.mts +2 -1
  536. package/esm/image/index.mjs +1 -1
  537. package/esm/index.d.mts +28 -2
  538. package/esm/index.mjs +7 -2
  539. package/esm/loader/app-module-importer.d.mts +1 -2
  540. package/esm/loader/app-module-importer.d.mts.map +1 -1
  541. package/esm/localization/index.mjs +1 -1
  542. package/esm/localization/parse-locale-dictionary.d.mts +4 -5
  543. package/esm/localization/parse-locale-dictionary.d.mts.map +1 -1
  544. package/esm/localization/parse-locale-dictionary.mjs +1 -1
  545. package/esm/localization/parse-locale-dictionary.mjs.map +1 -1
  546. package/esm/localization/register-locale-dictionary.d.mts +3 -4
  547. package/esm/localization/register-locale-dictionary.d.mts.map +1 -1
  548. package/esm/localization/register-locale-dictionary.mjs +2 -2
  549. package/esm/localization/register-locale-dictionary.mjs.map +1 -1
  550. package/esm/logger/fatal-visibility.d.mts +1 -2
  551. package/esm/logger/fatal-visibility.d.mts.map +1 -1
  552. package/esm/logger/index.d.mts +2 -1
  553. package/esm/logger/index.mjs +1 -1
  554. package/esm/logger/logger.d.mts +1 -3
  555. package/esm/logger/logger.d.mts.map +1 -1
  556. package/esm/logger/types.d.mts +2 -3
  557. package/esm/logger/types.d.mts.map +1 -1
  558. package/esm/mail/config.d.mts +12 -14
  559. package/esm/mail/config.d.mts.map +1 -1
  560. package/esm/mail/events.d.mts +4 -6
  561. package/esm/mail/events.d.mts.map +1 -1
  562. package/esm/mail/index.d.mts +2 -1
  563. package/esm/mail/index.mjs +1 -1
  564. package/esm/mail/mail.d.mts +1 -3
  565. package/esm/mail/mail.d.mts.map +1 -1
  566. package/esm/mail/mailer-pool.d.mts +5 -7
  567. package/esm/mail/mailer-pool.d.mts.map +1 -1
  568. package/esm/mail/react-mail.d.mts +1 -3
  569. package/esm/mail/react-mail.d.mts.map +1 -1
  570. package/esm/mail/send-mail.d.mts +1 -3
  571. package/esm/mail/send-mail.d.mts.map +1 -1
  572. package/esm/mail/send-mail.mjs +2 -1
  573. package/esm/mail/send-mail.mjs.map +1 -1
  574. package/esm/mail/test-mailbox.d.mts +11 -13
  575. package/esm/mail/test-mailbox.d.mts.map +1 -1
  576. package/esm/mail/types.d.mts +17 -18
  577. package/esm/mail/types.d.mts.map +1 -1
  578. package/esm/manifest/manifest-manager.mjs +1 -1
  579. package/esm/openapi/build-openapi-document.d.mts +2 -4
  580. package/esm/openapi/build-openapi-document.d.mts.map +1 -1
  581. package/esm/openapi/cast-schema.mjs +1 -1
  582. package/esm/openapi/development-openapi-provider.d.mts +5 -6
  583. package/esm/openapi/development-openapi-provider.d.mts.map +1 -1
  584. package/esm/openapi/index.d.mts +3 -1
  585. package/esm/openapi/index.mjs +1 -1
  586. package/esm/openapi/openapi-child-output.mjs +2 -2
  587. package/esm/openapi/openapi-child-output.mjs.map +1 -1
  588. package/esm/openapi/postman/build-request-url.mjs +1 -1
  589. package/esm/openapi/postman/example-from-schema.d.mts +1 -3
  590. package/esm/openapi/postman/example-from-schema.d.mts.map +1 -1
  591. package/esm/openapi/postman/index.d.mts +2 -1
  592. package/esm/openapi/postman/openapi-to-postman-collection.d.mts +3 -5
  593. package/esm/openapi/postman/openapi-to-postman-collection.d.mts.map +1 -1
  594. package/esm/openapi/postman/postman-types.d.mts +19 -18
  595. package/esm/openapi/postman/postman-types.d.mts.map +1 -1
  596. package/esm/openapi/postman/schema-refs.d.mts +1 -3
  597. package/esm/openapi/postman/schema-refs.d.mts.map +1 -1
  598. package/esm/openapi/postman/uuid-v5.mjs +1 -1
  599. package/esm/openapi/schema-registry.d.mts +1 -1
  600. package/esm/openapi/security.mjs +1 -1
  601. package/esm/openapi/types.d.mts +23 -21
  602. package/esm/openapi/types.d.mts.map +1 -1
  603. package/esm/production/assert-generated-imports.mjs +1 -1
  604. package/esm/production/build-contributions.mjs +1 -1
  605. package/esm/production/bundle-framework-dependencies.mjs +1 -1
  606. package/esm/production/dist-build-manifest.mjs +1 -1
  607. package/esm/production/esbuild-plugins.mjs.map +1 -1
  608. package/esm/production/esbuild-preflight.mjs +1 -1
  609. package/esm/production/production-builder.mjs +2 -1
  610. package/esm/production/production-builder.mjs.map +1 -1
  611. package/esm/production/production-supervisor.mjs +1 -1
  612. package/esm/production/registration-child-runner.mjs +4 -3
  613. package/esm/production/registration-child-runner.mjs.map +1 -1
  614. package/esm/production/resolve-build-config.d.mts +4 -4
  615. package/esm/production/resolve-build-config.d.mts.map +1 -1
  616. package/esm/production/resolve-build-config.mjs +1 -1
  617. package/esm/production/route-registration-child.d.mts +1 -1
  618. package/esm/production/route-registration-child.mjs +8 -7
  619. package/esm/production/route-registration-child.mjs.map +1 -1
  620. package/esm/production/tsconfig-path-aliases.mjs +1 -1
  621. package/esm/react/index.d.mts +1 -3
  622. package/esm/react/index.d.mts.map +1 -1
  623. package/esm/react/index.mjs.map +1 -1
  624. package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +3 -4
  625. package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
  626. package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +2 -3
  627. package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
  628. package/esm/repositories/adapters/cascade/filter-applicator.mjs +10 -9
  629. package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
  630. package/esm/repositories/adapters/cascade/index.d.mts +2 -1
  631. package/esm/repositories/adapters/cascade/index.mjs +1 -1
  632. package/esm/repositories/contracts/index.d.mts +2 -1
  633. package/esm/repositories/contracts/query-builder.contract.d.mts +4 -6
  634. package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
  635. package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -3
  636. package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
  637. package/esm/repositories/contracts/types.d.mts +23 -25
  638. package/esm/repositories/contracts/types.d.mts.map +1 -1
  639. package/esm/repositories/index.d.mts +4 -1
  640. package/esm/repositories/index.mjs +1 -1
  641. package/esm/repositories/repository.manager.d.mts +2 -3
  642. package/esm/repositories/repository.manager.d.mts.map +1 -1
  643. package/esm/repositories/repository.manager.mjs +2 -2
  644. package/esm/repositories/repository.manager.mjs.map +1 -1
  645. package/esm/resource/define-resource.d.mts +3 -5
  646. package/esm/resource/define-resource.d.mts.map +1 -1
  647. package/esm/resource/index.d.mts +2 -1
  648. package/esm/resource/index.mjs +1 -1
  649. package/esm/resource/nullable-resource.d.mts +5 -7
  650. package/esm/resource/nullable-resource.d.mts.map +1 -1
  651. package/esm/resource/register-resource.d.mts +1 -3
  652. package/esm/resource/register-resource.d.mts.map +1 -1
  653. package/esm/resource/resource-field-builder.d.mts +1 -3
  654. package/esm/resource/resource-field-builder.d.mts.map +1 -1
  655. package/esm/resource/resource.d.mts +3 -5
  656. package/esm/resource/resource.d.mts.map +1 -1
  657. package/esm/resource/resource.mjs +4 -2
  658. package/esm/resource/resource.mjs.map +1 -1
  659. package/esm/resource/types.d.mts +21 -21
  660. package/esm/resource/types.d.mts.map +1 -1
  661. package/esm/restful/index.d.mts +2 -1
  662. package/esm/restful/index.mjs +1 -1
  663. package/esm/restful/restful.d.mts +12 -32
  664. package/esm/restful/restful.d.mts.map +1 -1
  665. package/esm/router/index.d.mts +2 -1
  666. package/esm/router/index.mjs +1 -1
  667. package/esm/router/named-api-routes-with-responses.mjs +2 -1
  668. package/esm/router/named-api-routes-with-responses.mjs.map +1 -1
  669. package/esm/router/normalize-request-path.d.mts +1 -2
  670. package/esm/router/normalize-request-path.d.mts.map +1 -1
  671. package/esm/router/normalize-route-path.d.mts +1 -2
  672. package/esm/router/normalize-route-path.d.mts.map +1 -1
  673. package/esm/router/positional-handler-diagnostics.d.mts +15 -13
  674. package/esm/router/positional-handler-diagnostics.d.mts.map +1 -1
  675. package/esm/router/resolve-route-rate-limit.mjs +3 -3
  676. package/esm/router/resolve-route-rate-limit.mjs.map +1 -1
  677. package/esm/router/route-builder.d.mts +1 -3
  678. package/esm/router/route-builder.d.mts.map +1 -1
  679. package/esm/router/route-guard-names.mjs +1 -1
  680. package/esm/router/route-guard-names.mjs.map +1 -1
  681. package/esm/router/route-name-method-suffix.d.mts +2 -3
  682. package/esm/router/route-name-method-suffix.d.mts.map +1 -1
  683. package/esm/router/route-name-taken-error.d.mts +1 -3
  684. package/esm/router/route-name-taken-error.d.mts.map +1 -1
  685. package/esm/router/route-registry.d.mts +1 -3
  686. package/esm/router/route-registry.d.mts.map +1 -1
  687. package/esm/router/router.d.mts +2 -4
  688. package/esm/router/router.d.mts.map +1 -1
  689. package/esm/router/router.mjs +8 -6
  690. package/esm/router/router.mjs.map +1 -1
  691. package/esm/router/types.d.mts +25 -26
  692. package/esm/router/types.d.mts.map +1 -1
  693. package/esm/router/unguarded-route-diagnostics.d.mts +6 -8
  694. package/esm/router/unguarded-route-diagnostics.d.mts.map +1 -1
  695. package/esm/secrets/errors.d.mts +9 -0
  696. package/esm/secrets/errors.d.mts.map +1 -0
  697. package/esm/secrets/errors.mjs +22 -0
  698. package/esm/secrets/errors.mjs.map +1 -0
  699. package/esm/secrets/file-backend.mjs +167 -0
  700. package/esm/secrets/file-backend.mjs.map +1 -0
  701. package/esm/secrets/index.d.mts +6 -0
  702. package/esm/secrets/index.mjs +6 -0
  703. package/esm/secrets/keyring-backend.mjs +50 -0
  704. package/esm/secrets/keyring-backend.mjs.map +1 -0
  705. package/esm/secrets/memory-backend.d.mts +12 -0
  706. package/esm/secrets/memory-backend.d.mts.map +1 -0
  707. package/esm/secrets/memory-backend.mjs +28 -0
  708. package/esm/secrets/memory-backend.mjs.map +1 -0
  709. package/esm/secrets/secret-store.d.mts +25 -0
  710. package/esm/secrets/secret-store.d.mts.map +1 -0
  711. package/esm/secrets/secret-store.mjs +117 -0
  712. package/esm/secrets/secret-store.mjs.map +1 -0
  713. package/esm/secrets/secrets.d.mts +11 -0
  714. package/esm/secrets/secrets.d.mts.map +1 -0
  715. package/esm/secrets/secrets.mjs +63 -0
  716. package/esm/secrets/secrets.mjs.map +1 -0
  717. package/esm/secrets/types.d.mts +22 -0
  718. package/esm/secrets/types.d.mts.map +1 -0
  719. package/esm/socket/index.d.mts +2 -1
  720. package/esm/socket/index.mjs +2 -2
  721. package/esm/socket/types.d.mts +2 -4
  722. package/esm/socket/types.d.mts.map +1 -1
  723. package/esm/socket/utils.d.mts +8 -3
  724. package/esm/socket/utils.d.mts.map +1 -1
  725. package/esm/socket/utils.mjs +12 -1
  726. package/esm/socket/utils.mjs.map +1 -1
  727. package/esm/storage/config.d.mts +4 -6
  728. package/esm/storage/config.d.mts.map +1 -1
  729. package/esm/storage/context/storage-driver-context.d.mts +3 -4
  730. package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
  731. package/esm/storage/drivers/cloud-driver.d.mts +2 -4
  732. package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
  733. package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
  734. package/esm/storage/drivers/do-spaces-driver.d.mts +1 -3
  735. package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
  736. package/esm/storage/drivers/local-driver.d.mts +2 -3
  737. package/esm/storage/drivers/local-driver.d.mts.map +1 -1
  738. package/esm/storage/drivers/local-driver.mjs +8 -3
  739. package/esm/storage/drivers/local-driver.mjs.map +1 -1
  740. package/esm/storage/drivers/r2-driver.d.mts +1 -3
  741. package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
  742. package/esm/storage/drivers/s3-driver.d.mts +1 -3
  743. package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
  744. package/esm/storage/index.d.mts +2 -1
  745. package/esm/storage/index.mjs +1 -1
  746. package/esm/storage/local-disk-roots.mjs +2 -2
  747. package/esm/storage/local-disk-roots.mjs.map +1 -1
  748. package/esm/storage/scoped-storage.d.mts +2 -3
  749. package/esm/storage/scoped-storage.d.mts.map +1 -1
  750. package/esm/storage/storage-file.d.mts +1 -3
  751. package/esm/storage/storage-file.d.mts.map +1 -1
  752. package/esm/storage/storage.d.mts +3 -4
  753. package/esm/storage/storage.d.mts.map +1 -1
  754. package/esm/storage/types.d.mts +36 -36
  755. package/esm/storage/types.d.mts.map +1 -1
  756. package/esm/storage/utils/classify-ip-address.d.mts +1 -2
  757. package/esm/storage/utils/classify-ip-address.d.mts.map +1 -1
  758. package/esm/storage/utils/contain-path.d.mts +1 -2
  759. package/esm/storage/utils/contain-path.d.mts.map +1 -1
  760. package/esm/storage/utils/mime.d.mts +2 -3
  761. package/esm/storage/utils/mime.d.mts.map +1 -1
  762. package/esm/storage/utils/safe-fetch.d.mts +6 -6
  763. package/esm/storage/utils/safe-fetch.d.mts.map +1 -1
  764. package/esm/storage/utils/safe-fetch.mjs +3 -3
  765. package/esm/storage/utils/safe-fetch.mjs.map +1 -1
  766. package/esm/storage/utils/storage-capability-error.d.mts +1 -3
  767. package/esm/storage/utils/storage-capability-error.d.mts.map +1 -1
  768. package/esm/storage/utils/storage-error.d.mts +2 -3
  769. package/esm/storage/utils/storage-error.d.mts.map +1 -1
  770. package/esm/storage/utils/storage-not-initialized-error.d.mts +1 -2
  771. package/esm/storage/utils/storage-not-initialized-error.d.mts.map +1 -1
  772. package/esm/tests/authenticated-test-client.d.mts +5 -6
  773. package/esm/tests/authenticated-test-client.d.mts.map +1 -1
  774. package/esm/tests/factories.d.mts +38 -23
  775. package/esm/tests/factories.d.mts.map +1 -1
  776. package/esm/tests/fakes/cache-fake.d.mts +14 -9
  777. package/esm/tests/fakes/cache-fake.d.mts.map +1 -1
  778. package/esm/tests/fakes/clock-fake.d.mts +13 -8
  779. package/esm/tests/fakes/clock-fake.d.mts.map +1 -1
  780. package/esm/tests/fakes/fake-assertion-error.d.mts +2 -3
  781. package/esm/tests/fakes/fake-assertion-error.d.mts.map +1 -1
  782. package/esm/tests/fakes/ids-fake.d.mts +5 -4
  783. package/esm/tests/fakes/ids-fake.d.mts.map +1 -1
  784. package/esm/tests/fakes/index.d.mts +3 -1
  785. package/esm/tests/fakes/index.mjs +2 -1
  786. package/esm/tests/fakes/mail-fake.d.mts +21 -13
  787. package/esm/tests/fakes/mail-fake.d.mts.map +1 -1
  788. package/esm/tests/fakes/queue-fake.d.mts +21 -13
  789. package/esm/tests/fakes/queue-fake.d.mts.map +1 -1
  790. package/esm/tests/fakes/secrets-fake.d.mts +13 -0
  791. package/esm/tests/fakes/secrets-fake.d.mts.map +1 -0
  792. package/esm/tests/fakes/secrets-fake.mjs +50 -0
  793. package/esm/tests/fakes/secrets-fake.mjs.map +1 -0
  794. package/esm/tests/fakes/storage-fake.d.mts +12 -8
  795. package/esm/tests/fakes/storage-fake.d.mts.map +1 -1
  796. package/esm/tests/fakes/storage-fake.mjs +1 -1
  797. package/esm/tests/fakes/test-fakes.d.mts +9 -10
  798. package/esm/tests/fakes/test-fakes.d.mts.map +1 -1
  799. package/esm/tests/fakes/test-fakes.mjs +6 -3
  800. package/esm/tests/fakes/test-fakes.mjs.map +1 -1
  801. package/esm/tests/index.d.mts +3 -1
  802. package/esm/tests/index.mjs +2 -1
  803. package/esm/tests/snapshot-response.d.mts +4 -5
  804. package/esm/tests/snapshot-response.d.mts.map +1 -1
  805. package/esm/tests/start-http-development-server.d.mts +4 -6
  806. package/esm/tests/start-http-development-server.d.mts.map +1 -1
  807. package/esm/tests/start-http-development-server.mjs +5 -5
  808. package/esm/tests/start-http-development-server.mjs.map +1 -1
  809. package/esm/tests/test-connectors-selection.d.mts +2 -2
  810. package/esm/tests/test-connectors-selection.d.mts.map +1 -1
  811. package/esm/tests/test-connectors-selection.mjs +1 -1
  812. package/esm/tests/test-helpers.d.mts +11 -12
  813. package/esm/tests/test-helpers.d.mts.map +1 -1
  814. package/esm/tests/test-http-server.d.mts +14 -10
  815. package/esm/tests/test-http-server.d.mts.map +1 -1
  816. package/esm/tests/test-lifecycle-state.mjs +1 -1
  817. package/esm/tests/vitest-setup.d.mts +7 -8
  818. package/esm/tests/vitest-setup.d.mts.map +1 -1
  819. package/esm/tests/vitest-setup.mjs.map +1 -1
  820. package/esm/tooling/agents-md/agents-md-markers.d.mts +4 -5
  821. package/esm/tooling/agents-md/agents-md-markers.d.mts.map +1 -1
  822. package/esm/tooling/agents-md/agents-md-markers.mjs +2 -1
  823. package/esm/tooling/agents-md/agents-md-markers.mjs.map +1 -1
  824. package/esm/tooling/agents-md/agents-md-refresher.d.mts +19 -12
  825. package/esm/tooling/agents-md/agents-md-refresher.d.mts.map +1 -1
  826. package/esm/tooling/agents-md/installed-skills.d.mts +13 -9
  827. package/esm/tooling/agents-md/installed-skills.d.mts.map +1 -1
  828. package/esm/tooling/agents-md/render-agents-md.d.mts +8 -7
  829. package/esm/tooling/agents-md/render-agents-md.d.mts.map +1 -1
  830. package/esm/tooling/agents-md/render-agents-md.mjs +2 -2
  831. package/esm/tooling/agents-md/render-agents-md.mjs.map +1 -1
  832. package/esm/tooling/agents-md/write-agents-md.d.mts +17 -12
  833. package/esm/tooling/agents-md/write-agents-md.d.mts.map +1 -1
  834. package/esm/tooling/board/board-message.d.mts +4 -6
  835. package/esm/tooling/board/board-message.d.mts.map +1 -1
  836. package/esm/tooling/board/board.d.mts +50 -38
  837. package/esm/tooling/board/board.d.mts.map +1 -1
  838. package/esm/tooling/board/board.mjs +4 -3
  839. package/esm/tooling/board/board.mjs.map +1 -1
  840. package/esm/tooling/board/board.types.d.mts +32 -23
  841. package/esm/tooling/board/board.types.d.mts.map +1 -1
  842. package/esm/tooling/check/changed-files.d.mts +4 -6
  843. package/esm/tooling/check/changed-files.d.mts.map +1 -1
  844. package/esm/tooling/check/changed-files.mjs +2 -2
  845. package/esm/tooling/check/changed-files.mjs.map +1 -1
  846. package/esm/tooling/check/check-report.types.d.mts +22 -17
  847. package/esm/tooling/check/check-report.types.d.mts.map +1 -1
  848. package/esm/tooling/check/code-style-conventions.mjs +25 -25
  849. package/esm/tooling/check/code-style-conventions.mjs.map +1 -1
  850. package/esm/tooling/check/conventions-step.d.mts +4 -6
  851. package/esm/tooling/check/conventions-step.d.mts.map +1 -1
  852. package/esm/tooling/check/conventions-step.mjs +7 -18
  853. package/esm/tooling/check/conventions-step.mjs.map +1 -1
  854. package/esm/tooling/check/environment-step.d.mts +2 -4
  855. package/esm/tooling/check/environment-step.d.mts.map +1 -1
  856. package/esm/tooling/check/environment-step.mjs +1 -1
  857. package/esm/tooling/check/index.mjs +1 -1
  858. package/esm/tooling/check/lint-step.d.mts +5 -12
  859. package/esm/tooling/check/lint-step.d.mts.map +1 -1
  860. package/esm/tooling/check/lint-step.mjs +16 -12
  861. package/esm/tooling/check/lint-step.mjs.map +1 -1
  862. package/esm/tooling/check/request-input.mjs +15 -15
  863. package/esm/tooling/check/request-input.mjs.map +1 -1
  864. package/esm/tooling/check/run-check.d.mts +24 -14
  865. package/esm/tooling/check/run-check.d.mts.map +1 -1
  866. package/esm/tooling/check/run-check.mjs +2 -2
  867. package/esm/tooling/check/run-check.mjs.map +1 -1
  868. package/esm/tooling/check/run-tests.d.mts +22 -15
  869. package/esm/tooling/check/run-tests.d.mts.map +1 -1
  870. package/esm/tooling/check/security-conventions.mjs +133 -131
  871. package/esm/tooling/check/security-conventions.mjs.map +1 -1
  872. package/esm/tooling/check/source-ast.mjs +92 -132
  873. package/esm/tooling/check/source-ast.mjs.map +1 -1
  874. package/esm/tooling/check/tests-step.d.mts +7 -8
  875. package/esm/tooling/check/tests-step.d.mts.map +1 -1
  876. package/esm/tooling/check/tests-step.mjs +3 -3
  877. package/esm/tooling/check/tests-step.mjs.map +1 -1
  878. package/esm/tooling/dev-state/dev-server-state.d.mts +17 -13
  879. package/esm/tooling/dev-state/dev-server-state.d.mts.map +1 -1
  880. package/esm/tooling/devtools/devtools-client.d.mts +29 -20
  881. package/esm/tooling/devtools/devtools-client.d.mts.map +1 -1
  882. package/esm/tooling/generate/generation.d.mts +34 -22
  883. package/esm/tooling/generate/generation.d.mts.map +1 -1
  884. package/esm/tooling/generate/generation.mjs +9 -5
  885. package/esm/tooling/generate/generation.mjs.map +1 -1
  886. package/esm/tooling/generate/generator-spec.d.mts +9 -9
  887. package/esm/tooling/generate/generator-spec.d.mts.map +1 -1
  888. package/esm/tooling/generate/index.mjs +1 -1
  889. package/esm/tooling/generate/project-files.mjs +3 -3
  890. package/esm/tooling/generate/project-files.mjs.map +1 -1
  891. package/esm/tooling/generate/run-cli.d.mts +14 -11
  892. package/esm/tooling/generate/run-cli.d.mts.map +1 -1
  893. package/esm/tooling/generate/run-cli.mjs +2 -2
  894. package/esm/tooling/generate/run-cli.mjs.map +1 -1
  895. package/esm/tooling/generate/unified-diff.d.mts +10 -7
  896. package/esm/tooling/generate/unified-diff.d.mts.map +1 -1
  897. package/esm/tooling/index.d.mts +1 -0
  898. package/esm/tooling/inspect/boot-for-inspect.d.mts +7 -7
  899. package/esm/tooling/inspect/boot-for-inspect.d.mts.map +1 -1
  900. package/esm/tooling/inspect/collect-config.mjs +3 -3
  901. package/esm/tooling/inspect/collect-config.mjs.map +1 -1
  902. package/esm/tooling/inspect/collect-models.d.mts +4 -3
  903. package/esm/tooling/inspect/collect-models.d.mts.map +1 -1
  904. package/esm/tooling/inspect/collect-models.mjs +1 -1
  905. package/esm/tooling/inspect/collect-packages.d.mts +1 -2
  906. package/esm/tooling/inspect/collect-packages.d.mts.map +1 -1
  907. package/esm/tooling/inspect/collect-pages.mjs +10 -10
  908. package/esm/tooling/inspect/collect-pages.mjs.map +1 -1
  909. package/esm/tooling/inspect/collect-routes.mjs +1 -1
  910. package/esm/tooling/inspect/event-recorder.d.mts +7 -7
  911. package/esm/tooling/inspect/event-recorder.d.mts.map +1 -1
  912. package/esm/tooling/inspect/index.d.mts +2 -1
  913. package/esm/tooling/inspect/index.mjs +1 -1
  914. package/esm/tooling/inspect/inspect-app.d.mts +25 -16
  915. package/esm/tooling/inspect/inspect-app.d.mts.map +1 -1
  916. package/esm/tooling/inspect/inspect-report.schema.d.mts +1 -2
  917. package/esm/tooling/inspect/inspect-report.schema.d.mts.map +1 -1
  918. package/esm/tooling/inspect/inspect-report.types.d.mts +86 -54
  919. package/esm/tooling/inspect/inspect-report.types.d.mts.map +1 -1
  920. package/esm/tooling/mcp/create-mcp-context.d.mts +11 -8
  921. package/esm/tooling/mcp/create-mcp-context.d.mts.map +1 -1
  922. package/esm/tooling/mcp/db-schema.d.mts +10 -9
  923. package/esm/tooling/mcp/db-schema.d.mts.map +1 -1
  924. package/esm/tooling/mcp/docs-search.d.mts +20 -15
  925. package/esm/tooling/mcp/docs-search.d.mts.map +1 -1
  926. package/esm/tooling/mcp/index.mjs +1 -1
  927. package/esm/tooling/mcp/load-ai-tools.d.mts +7 -8
  928. package/esm/tooling/mcp/load-ai-tools.d.mts.map +1 -1
  929. package/esm/tooling/mcp/load-ai-tools.mjs +2 -1
  930. package/esm/tooling/mcp/load-ai-tools.mjs.map +1 -1
  931. package/esm/tooling/mcp/mcp-tools.d.mts +29 -19
  932. package/esm/tooling/mcp/mcp-tools.d.mts.map +1 -1
  933. package/esm/tooling/mcp/mcp-tools.mjs +3 -2
  934. package/esm/tooling/mcp/mcp-tools.mjs.map +1 -1
  935. package/esm/tooling/mcp/start-mcp-server.d.mts +24 -17
  936. package/esm/tooling/mcp/start-mcp-server.d.mts.map +1 -1
  937. package/esm/tooling/mcp/start-mcp-server.mjs +1 -1
  938. package/esm/tooling/mcp/start-mcp-server.mjs.map +1 -1
  939. package/esm/tooling/mcp/tool-input.d.mts +7 -7
  940. package/esm/tooling/mcp/tool-input.d.mts.map +1 -1
  941. package/esm/tooling/problem.d.mts +27 -17
  942. package/esm/tooling/problem.d.mts.map +1 -1
  943. package/esm/tooling/syntax/ast.mjs +230 -0
  944. package/esm/tooling/syntax/ast.mjs.map +1 -0
  945. package/esm/tooling/syntax/imports.mjs +34 -0
  946. package/esm/tooling/syntax/imports.mjs.map +1 -0
  947. package/esm/tooling/trace/trace-report.types.d.mts +36 -22
  948. package/esm/tooling/trace/trace-report.types.d.mts.map +1 -1
  949. package/esm/tooling/trace/trace-request.d.mts +27 -20
  950. package/esm/tooling/trace/trace-request.d.mts.map +1 -1
  951. package/esm/tooling/trace/trace-request.mjs +2 -2
  952. package/esm/tooling/trace/trace-request.mjs.map +1 -1
  953. package/esm/tooling/typecheck/index.mjs +1 -1
  954. package/esm/tooling/typecheck/run-typecheck.d.mts +15 -48
  955. package/esm/tooling/typecheck/run-typecheck.d.mts.map +1 -1
  956. package/esm/tooling/typecheck/run-typecheck.mjs +42 -105
  957. package/esm/tooling/typecheck/run-typecheck.mjs.map +1 -1
  958. package/esm/tooling/typescript/compiler.d.mts +31 -0
  959. package/esm/tooling/typescript/compiler.d.mts.map +1 -0
  960. package/esm/tooling/typescript/compiler.mjs +120 -0
  961. package/esm/tooling/typescript/compiler.mjs.map +1 -0
  962. package/esm/updater/update-warlock-packages.mjs +3 -2
  963. package/esm/updater/update-warlock-packages.mjs.map +1 -1
  964. package/esm/upgrade/codemods/index.mjs +3 -1
  965. package/esm/upgrade/codemods/index.mjs.map +1 -1
  966. package/esm/upgrade/codemods/logger-sync-calls.mjs +1 -1
  967. package/esm/upgrade/codemods/logger-sync-calls.mjs.map +1 -1
  968. package/esm/upgrade/codemods/oxc-toolchain.mjs +142 -0
  969. package/esm/upgrade/codemods/oxc-toolchain.mjs.map +1 -0
  970. package/esm/upgrade/codemods/request-log-snapshot.mjs +1 -1
  971. package/esm/upgrade/codemods/request-log-snapshot.mjs.map +1 -1
  972. package/esm/upgrade/codemods/toolchain-templates.mjs +244 -0
  973. package/esm/upgrade/codemods/toolchain-templates.mjs.map +1 -0
  974. package/esm/upgrade/diff.mjs +1 -1
  975. package/esm/upgrade/diff.mjs.map +1 -1
  976. package/esm/upgrade/load-ts-morph.mjs +3 -2
  977. package/esm/upgrade/load-ts-morph.mjs.map +1 -1
  978. package/esm/upgrade/run-upgrade.mjs +26 -7
  979. package/esm/upgrade/run-upgrade.mjs.map +1 -1
  980. package/esm/use-cases/index.d.mts +2 -1
  981. package/esm/use-cases/index.mjs +1 -1
  982. package/esm/use-cases/types.d.mts +116 -63
  983. package/esm/use-cases/types.d.mts.map +1 -1
  984. package/esm/use-cases/use-case-broadcast.d.mts +1 -3
  985. package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
  986. package/esm/use-cases/use-case-events.d.mts +3 -5
  987. package/esm/use-cases/use-case-events.d.mts.map +1 -1
  988. package/esm/use-cases/use-case-pipeline.d.mts +6 -6
  989. package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
  990. package/esm/use-cases/use-case.d.mts +2 -4
  991. package/esm/use-cases/use-case.d.mts.map +1 -1
  992. package/esm/use-cases/use-case.errors.d.mts +1 -3
  993. package/esm/use-cases/use-case.errors.d.mts.map +1 -1
  994. package/esm/use-cases/use-cases-registry.d.mts +8 -10
  995. package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
  996. package/esm/utils/app-log.d.mts +1 -2
  997. package/esm/utils/app-log.d.mts.map +1 -1
  998. package/esm/utils/clock.d.mts +8 -6
  999. package/esm/utils/clock.d.mts.map +1 -1
  1000. package/esm/utils/database-log.d.mts +3 -4
  1001. package/esm/utils/database-log.d.mts.map +1 -1
  1002. package/esm/utils/environment.d.mts +4 -5
  1003. package/esm/utils/environment.d.mts.map +1 -1
  1004. package/esm/utils/framework-vesion.mjs.map +1 -1
  1005. package/esm/utils/get-localized.d.mts +2 -3
  1006. package/esm/utils/get-localized.d.mts.map +1 -1
  1007. package/esm/utils/ids.d.mts +9 -6
  1008. package/esm/utils/ids.d.mts.map +1 -1
  1009. package/esm/utils/index.d.mts +2 -1
  1010. package/esm/utils/index.mjs +1 -1
  1011. package/esm/utils/normalized-path.d.mts +1 -2
  1012. package/esm/utils/normalized-path.d.mts.map +1 -1
  1013. package/esm/utils/npm-registry.d.mts +1 -2
  1014. package/esm/utils/npm-registry.d.mts.map +1 -1
  1015. package/esm/utils/paths.d.mts +13 -14
  1016. package/esm/utils/paths.d.mts.map +1 -1
  1017. package/esm/utils/paths.mjs +2 -2
  1018. package/esm/utils/paths.mjs.map +1 -1
  1019. package/esm/utils/promise-all-object.d.mts +1 -2
  1020. package/esm/utils/promise-all-object.d.mts.map +1 -1
  1021. package/esm/utils/queue.d.mts +1 -2
  1022. package/esm/utils/queue.d.mts.map +1 -1
  1023. package/esm/utils/runtime.d.mts +11 -10
  1024. package/esm/utils/runtime.d.mts.map +1 -1
  1025. package/esm/utils/sleep.d.mts +1 -2
  1026. package/esm/utils/sleep.d.mts.map +1 -1
  1027. package/esm/utils/sluggable.d.mts +1 -3
  1028. package/esm/utils/sluggable.d.mts.map +1 -1
  1029. package/esm/utils/to-json.d.mts +1 -2
  1030. package/esm/utils/to-json.d.mts.map +1 -1
  1031. package/esm/utils/types.d.mts +1 -2
  1032. package/esm/utils/types.d.mts.map +1 -1
  1033. package/esm/utils/urls.d.mts +5 -6
  1034. package/esm/utils/urls.d.mts.map +1 -1
  1035. package/esm/utils/version-compare.d.mts +1 -2
  1036. package/esm/utils/version-compare.d.mts.map +1 -1
  1037. package/esm/validation/database/exists-except-current-id.d.mts +2 -3
  1038. package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
  1039. package/esm/validation/database/exists-except-current-user.d.mts +2 -3
  1040. package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
  1041. package/esm/validation/database/index.d.mts +2 -1
  1042. package/esm/validation/database/index.mjs +1 -1
  1043. package/esm/validation/database/types.d.mts +14 -10
  1044. package/esm/validation/database/types.d.mts.map +1 -1
  1045. package/esm/validation/database/unique-except-current-id.d.mts +2 -3
  1046. package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
  1047. package/esm/validation/database/unique-except-current-user.d.mts +2 -3
  1048. package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
  1049. package/esm/validation/file/file.d.mts +4 -6
  1050. package/esm/validation/file/file.d.mts.map +1 -1
  1051. package/esm/validation/file/index.d.mts +2 -1
  1052. package/esm/validation/file/index.mjs +1 -1
  1053. package/esm/validation/index.d.mts +5 -1
  1054. package/esm/validation/index.mjs +1 -1
  1055. package/esm/validation/plugins/index.mjs +1 -1
  1056. package/esm/validation/types.d.mts +6 -4
  1057. package/esm/validation/types.d.mts.map +1 -1
  1058. package/esm/validation/validateAll.mjs +2 -2
  1059. package/esm/validation/validateAll.mjs.map +1 -1
  1060. package/esm/validation/validation-failure-status.mjs +2 -2
  1061. package/esm/validation/validation-failure-status.mjs.map +1 -1
  1062. package/esm/validation/validators/file-validator.d.mts +2 -4
  1063. package/esm/validation/validators/file-validator.d.mts.map +1 -1
  1064. package/esm/validation/validators/index.d.mts +2 -1
  1065. package/esm/validation/validators/index.mjs +1 -1
  1066. package/esm/vite/lower-stage3-decorators.d.mts +2 -3
  1067. package/esm/vite/lower-stage3-decorators.d.mts.map +1 -1
  1068. package/esm/warlock-config/define-config.d.mts +1 -3
  1069. package/esm/warlock-config/define-config.d.mts.map +1 -1
  1070. package/esm/warlock-config/define-config.mjs +3 -2
  1071. package/esm/warlock-config/define-config.mjs.map +1 -1
  1072. package/esm/warlock-config/index.d.mts +2 -1
  1073. package/esm/warlock-config/index.mjs +1 -1
  1074. package/esm/warlock-config/types.d.mts +8 -6
  1075. package/esm/warlock-config/types.d.mts.map +1 -1
  1076. package/esm/warlock-config/warlock-config.manager.d.mts +5 -7
  1077. package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
  1078. package/esm/warlock-config/warlock-config.manager.mjs +2 -1
  1079. package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
  1080. package/esm/warlock-config/warn-deprecated-config.mjs +1 -1
  1081. package/llms-full.txt +379 -22
  1082. package/llms.txt +3 -2
  1083. package/package.json +27 -15
  1084. package/skills/README.md +2 -1
  1085. package/skills/create-module/SKILL.md +7 -0
  1086. package/skills/index.md +3 -1
  1087. package/skills/report-framework-issue.md +154 -0
  1088. package/skills/run-app/SKILL.md +120 -10
  1089. package/skills/store-secrets/SKILL.md +102 -0
  1090. package/skills/test-fakes/SKILL.md +13 -11
  1091. package/skills/upgrade-from-5-29/SKILL.md +78 -0
  1092. package/skills/warlock-check/SKILL.md +6 -1
  1093. package/skills/warlock-doctor/SKILL.md +9 -0
  1094. package/skills/wire-socket/SKILL.md +19 -0
  1095. package/skills/write-cli-command/SKILL.md +21 -0
  1096. package/esm/tooling/check/index.d.mts +0 -8
  1097. package/esm/tooling/typecheck/index.d.mts +0 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,67 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
7
  > ⚠ **Versioning: `@warlock.js/*` does not follow SemVer strictly — breaking changes may ship in a minor.** This is a deliberate decision, not an oversight: the framework is pre-adoption and the cost of a major per behaviour fix currently outweighs the benefit. **Pin an exact version or a tilde range (`~4.13.0`) if you need to opt into changes rather than receive them.** Every breaking change is marked **BREAKING** in its entry and summarised in an _Upgrading_ section at the top of the release. **This policy will change once the framework has consumers beyond its author.**
8
8
 
9
+ ## 5.33.0 - 2026-10-19
10
+
11
+ ### Added
12
+
13
+ - `oxc-toolchain`, a 5.33.0 `warlock upgrade` codemod, migrates generated configs, package scripts/dependencies, editor settings and literal dev health switches to Oxlint/Oxfmt. Customized files are retained with file:line review guidance; additions and deletions honor `--dry-run` and `--json`.
14
+
15
+ ### Changed
16
+
17
+ - **BREAKING** ESLint no longer starts from config detection alone in the dev server or `warlock check`. TypeScript and configured Oxlint remain the default health checkers; `check` defaults to Oxlint.
18
+
19
+ ### Deprecated
20
+
21
+ - ESLint/Prettier support is removed in 5.34.0. Explicit ESLint opt-ins emit one deprecation warning per process on stderr with migration instructions.
22
+
23
+ ### Upgrading
24
+
25
+ - Run `npx warlock upgrade --from 5.32 --to 5.33.0` (preview with `--dry-run`), install dependencies and review customized configs. To retain legacy lint checks temporarily, set `devServer.healthCheckers.eslint: true` and select `warlock check --lint eslint`. See the upgrade skill's "5.32 to 5.33" section.
26
+ - `broadcastSocketEvent(event, ...args)` dispatches through the existing socket connector's adapter and returns `false` when no socket server is available. Web page-cache invalidations use this path to notify clients across processes configured with a shared adapter.
27
+ - Add app-scoped `secrets.get/set/remove/has` and `environmentName`, also exported from `@warlock.js/core/secrets`, with lazy optional OS keychain storage, read-only scoped environment lookup, authenticated encrypted owner-only files, typed errors, logger masking and explicit memory backends.
28
+ - Add `secretsFake` to the default test fakes, with isolated memory storage and assertions that never reveal credentials; opt out with `tests.fakes: { secrets: false }`.
29
+ - `warlock ai measure --model <id> [--tools <module>] [--system <file>] [--skills <dir>] [--json]` lazily loads AI and reports per-part input tokens and priced USD. Supports provider-qualified IDs, configured model modules, and JSON output without app bootstrap.
30
+ - Optional `warlock pm2 init` generates `ecosystem.config.cjs` from app/build config with a `<project>-<app>-<env>` name, readiness URL, `wait_ready`, startup timeout and a kill timeout matched to `app.shutdownTimeout`. PM2 stays outside core's dependencies. Fork mode is the default; cluster mode requires a socket adapter and WebSocket-only transports when sockets are configured.
31
+ - `warlock pm2 reload [--id <pm2-id>]` verifies the exact app name, working directory and bundle path before reloading numeric PM2 ids sequentially. Document rolling reload limits, shared-server stops by PM2 id and logger output formatting.
32
+
33
+ ### Changed
34
+
35
+ - Completed application boot now sends PM2's `"ready"` IPC message without disconnecting its channel; the existing `warlock start` readiness protocol remains supported. Cluster workers skip the exclusive port preflight so they can share their primary's listener during rolling reloads.
36
+
37
+ ### Fixed
38
+
39
+ - Type the socket connector’s raw HTTP(S) server across asynchronous listener startup; keep native-keyring test doubles declaration-safe and cover the documented `check --lint` option.
40
+ - Socket-only connector boot awaits its listener and rejects bind failures before application readiness can be announced.
41
+
42
+ ### Upgrading
43
+
44
+ - Rebuild production bundles to include PM2 readiness before using `wait_ready`. Generate with the target `NODE_ENV`, review the ecosystem file, and start the bundle directly under PM2. Cluster sockets require `socket.adapter`, `socket.options.transports: ["websocket"]` and WebSocket-only clients; polling deployments need sticky routing to individual listeners. Fork reloads can interrupt traffic.
45
+ - Add `warlock add process` with exact family dependency, typed supervisor config, application recovery/shutdown hooks, optional devtools registration, next steps and idempotent file generation.
46
+
47
+ ## 5.32.0 - 2026-10-18
48
+
49
+ ### Added
50
+
51
+ - `warlock issue [--type bug|feature] [--title "..."] [--json]` collects installed environment details and a static config summary without booting the app, then prints a bounded pre-filled framework issue URL; it never submits anything. Add bug/feature issue forms and the `report-framework-issue.md` agent topic with minimal-repro, privacy, duplicate-search and user-consent guidance.
52
+
53
+ ### Security
54
+
55
+ - Upgrade esbuild to ^0.28.2, past the Windows development-server advisory [GHSA-g7r4-m6w7-qqqr](https://github.com/advisories/GHSA-g7r4-m6w7-qqqr) (patched in 0.28.1).
56
+
57
+ ### Changed
58
+
59
+ - Clarify the upgrade skill: new scaffolds default to Oxlint/Oxfmt and TypeScript 7.0.2; explicit ESLint mode stays on TypeScript 6.0.3 to satisfy typescript-eslint, with deprecation planned for 5.33 and removal for 5.34.
60
+
61
+ - Verify generated web stubs with the scaffold’s TypeScript-independent Prettier import sorter, including an explicit no-plugin negative control and decorator parsing; align the contact controller stub’s inline type-specifier order.
62
+ - **BREAKING:** pin `typescript` to 7.0.2, whose `tsc` command uses the native Go compiler. Apps must remove `baseUrl`, rebase `paths`, replace `moduleResolution: "node"` / `"node10"`, and declare ambient Node types explicitly.
63
+ - Preserve incremental CLI checks and changed-file filtering; reuse a native compiler session for per-file development diagnostics and close it on shutdown.
64
+ - Parse imports, configuration, translation keys, model/resource typings, convention checks, page discovery and doctor migrations with OXC instead of the removed JavaScript compiler API.
65
+
66
+ ### Fixed
67
+
68
+ - Fix source development workers on Node.js 24 failing to load Node builtins through native dependencies, restoring background TypeScript health checks.
69
+
9
70
  ## 5.31.0 - 2026-10-18
10
71
 
11
72
  ### Security
@@ -1,8 +1,8 @@
1
1
  import { Router } from "../router/router.mjs";
2
+ import "../router/index.mjs";
2
3
  import { DataSource } from "@warlock.js/cascade";
3
4
  import { FastifyInstance } from "fastify";
4
5
  import { Server } from "socket.io";
5
-
6
6
  //#region ../../packages/core/src/application/app.d.ts
7
7
  type RuntimeApplication = {
8
8
  socket: Server | undefined;
@@ -10,7 +10,7 @@ type RuntimeApplication = {
10
10
  router: Router;
11
11
  database: DataSource | undefined;
12
12
  };
13
- declare const app: RuntimeApplication;
13
+ export declare const app: RuntimeApplication;
14
14
  //#endregion
15
- export { app };
15
+ export {};
16
16
  //# sourceMappingURL=app.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/app.ts"],"mappings":";;;;;;KAMK,kBAAA;EACH,MAAA,EAAQ,MAAA;EACR,IAAA,EAAM,eAAA;EACN,MAAA,EAAQ,MAAA;EACR,QAAA,EAAU,UAAA;AAAA;AAAA,cAGC,GAAA,EAAK,kBAkCjB"}
1
+ {"version":3,"file":"app.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/app.ts"],"mappings":";;;;;;KAMK;EACH,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,UAAU;;qBAGC,KAAK"}
@@ -1,9 +1,17 @@
1
1
  //#region ../../packages/core/src/application/application-config-types.d.ts
2
- type AppConfigurations = {
2
+ export type AppConfigurations = {
3
3
  /**
4
4
  * App name
5
5
  */
6
6
  appName?: string;
7
+ /**
8
+ * Overall connector shutdown budget in milliseconds. PM2 config generation
9
+ * uses the same value for `kill_timeout`. Allow enough time for HTTP draining
10
+ * and the remaining connectors; tune `http.gracefulShutdown.timeout` below it.
11
+ *
12
+ * @default 10000
13
+ */
14
+ shutdownTimeout?: number;
7
15
  /**
8
16
  * Default locale code
9
17
  *
@@ -35,5 +43,4 @@ type AppConfigurations = {
35
43
  localeCodes?: string[];
36
44
  };
37
45
  //#endregion
38
- export { AppConfigurations };
39
46
  //# sourceMappingURL=application-config-types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"application-config-types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/application-config-types.ts"],"mappings":";KAAY,iBAAA;EAAA;;;EAIV,OAAA;EAAA;;;;;EAMA,UAAA;EAuBW;AAAA;;;;EAjBX,OAAA;;;;;;;;;EASA,SAAA;;;;EAIA,QAAA;;;;EAIA,WAAA;AAAA"}
1
+ {"version":3,"file":"application-config-types.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/application-config-types.ts"],"mappings":";YAAY;;;;EAIV;;;;;;;;EAQA;;;;;;EAMA;;;;;;EAMA;;;;;;;;;EASA;;;;EAIA;;;;EAIA"}
@@ -1,6 +1,5 @@
1
1
  import { Environment, RuntimeStrategy } from "../utils/environment.mjs";
2
2
  import { AppRole } from "./roles.mjs";
3
-
4
3
  //#region ../../packages/core/src/application/application.d.ts
5
4
  /**
6
5
  * Snapshot of the global facts known the moment the application finished
@@ -8,7 +7,7 @@ import { AppRole } from "./roles.mjs";
8
7
  * (locales, events, main, routes) are loaded. Passed to every
9
8
  * `Application.onceBooted` listener and resolved from `Application.whenBooted`.
10
9
  */
11
- type BootContext = {
10
+ export type BootContext = {
12
11
  environment: Environment;
13
12
  runtimeStrategy: RuntimeStrategy;
14
13
  /**
@@ -22,7 +21,7 @@ type BootContext = {
22
21
  * rejection is caught and logged so a single listener can never break boot or
23
22
  * the other listeners.
24
23
  */
25
- type BootListener = (context: BootContext) => void | Promise<void>;
24
+ export type BootListener = (context: BootContext) => void | Promise<void>;
26
25
  /**
27
26
  * A callback registered through `Application.onValidateBoot`. May be async —
28
27
  * unlike {@link BootListener}, its rejection is NOT caught: it aborts boot.
@@ -33,14 +32,14 @@ type BootListener = (context: BootContext) => void | Promise<void>;
33
32
  * that contract stays fire-and-forget on purpose (it is the right behaviour
34
33
  * for plugins reacting to boot, not for gating it).
35
34
  */
36
- type BootValidator = () => void | Promise<void>;
35
+ export type BootValidator = () => void | Promise<void>;
37
36
  /**
38
37
  * A callback registered through `Application.onShutdown`. Runs once, while the
39
38
  * connectors (db, cache, http) are still up, so it can release app-owned
40
39
  * resources cleanly. May be async — its rejection is caught and logged.
41
40
  */
42
- type ShutdownListener = () => void | Promise<void>;
43
- declare class Application {
41
+ export type ShutdownListener = () => void | Promise<void>;
42
+ export declare class Application {
44
43
  /**
45
44
  * Project start time regarding the process start time
46
45
  */
@@ -294,5 +293,4 @@ declare class Application {
294
293
  static get publicPath(): string;
295
294
  }
296
295
  //#endregion
297
- export { Application, BootContext, BootListener, BootValidator, ShutdownListener };
298
296
  //# sourceMappingURL=application.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"application.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/application.ts"],"mappings":";;;;;;AAkBA;;;;KAAY,WAAA;EACV,WAAA,EAAa,WAAA;EACb,eAAA,EAAiB,eAAe;EAAf;;;AAKH;EAAd,cAAA;AAAA;;;;;;KAQU,YAAA,IAAgB,OAAA,EAAS,WAAA,YAAuB,OAAO;AAAA;AAYnE;;;;AAAgD;AAkBhD;;;;AA9BmE,KAYvD,aAAA,gBAA6B,OAAO;AAoBhD;;;;;AAAA,KAFY,gBAAA,gBAAgC,OAAO;AAAA,cAEtC,WAAA;EAwHyB;;;EAAA,gBApHb,SAAA,EAAS,IAAA;EA4OY;;;EAAA,OAvO9B,eAAA,EAAiB,eAAA;EAqVG;;;EAAA,eAhVnB,MAAA;EAkYa;;;EAAA,eA7Xb,WAAA;EAfiB;;;;EAAA,eAqBjB,aAAA;EAAA;;;;;EAAA,eAOA,SAAA;EA8BG;;;;EAAA,eAxBH,cAAA;EAiDD;;;;;;EAAA,eAzCC,UAAA;EA0EqB;;;;EAAA,eApErB,YAAA;EA8JD;;;EAAA,eAzJC,iBAAA;EAuL6B;;;EAAA,WAlL1B,OAAA;EAiOO;;;EAAA,OA1NX,kBAAA,CAAmB,QAAA,EAAU,eAAA;EA2QzB;;;;;EAAA,WAlQA,QAAA;EAuRA;;;;;EAAA,OA9QJ,aAAA,CAAc,IAAA;EA6SV;;;;;;;;;;;;AAsDU;;EAtDV,OA3RJ,UAAA,CAAW,QAAA,EAAU,YAAA;;;;;SAerB,UAAA,IAAc,OAAA,CAAQ,WAAA;;;;;;;;;;;;;;;SAwBtB,UAAA,CAAW,OAAA,EAAS,WAAA;;;;;iBAgCb,eAAA;;;;;;;;;;;;;;;;;;;;;;;;SAkCP,cAAA,CAAe,SAAA,EAAW,aAAA;;;;;;;;;;;;;;;;;;SA8BpB,oBAAA,IAAwB,OAAA;;;;;;aAgC1B,cAAA;;;;;;;;;;;;SAeJ,UAAA,CAAW,QAAA,EAAU,gBAAA;;;;;;;;;;SAmBf,gBAAA,IAAoB,OAAA;;;;;iBAmBnB,mBAAA;;;;aAWH,MAAA;;;;aAOA,WAAA,IAAe,WAAA;;;;SAOnB,cAAA,CAAe,GAAA,EAAK,WAAA;;;;aAOhB,YAAA;;;;aAOA,aAAA;;;;aAOA,MAAA;;;;;;aASA,KAAA,IAAS,WAAA,CAAY,OAAA;;;;;aAQrB,KAAA,IAAS,WAAA;;;;;;;;;SAYb,OAAA,CAAQ,IAAA,EAAM,OAAA;;;;aAOV,QAAA;;;;aAOA,OAAA;;;;aAOA,OAAA;;;;aAOA,WAAA;;;;aAOA,WAAA;;;;aAOA,UAAA;AAAA"}
1
+ {"version":3,"file":"application.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/application.ts"],"mappings":";;;;;;;;;YAkBY;EACV,aAAa;EACb,iBAAiB;;;;;EAKjB;;;;;;;YAQU,gBAAgB,SAAS,uBAAuB;;;;;;;;;;;YAYhD,6BAA6B;;;;;;YAkB7B,gCAAgC;qBAE/B;;;;kBAIY,WAAS;;;;SAKlB,iBAAiB;;;;iBAKhB;;;;iBAKA;;;;;iBAMA;;;;;;iBAOA;;;;;iBAMA;;;;;;;iBAQA;;;;;iBAMA;;;;iBAKA;;;;aAKG;;;;SAOJ,mBAAmB,UAAU;;;;;;aASzB;;;;;;SASJ,cAAc;;;;;;;;;;;;;;;SAkBd,WAAW,UAAU;;;;;SAerB,cAAc,QAAQ;;;;;;;;;;;;;;;SAwBtB,WAAW,SAAS;;;;;iBAgCb;;;;;;;;;;;;;;;;;;;;;;;;SAkCP,eAAe,WAAW;;;;;;;;;;;;;;;;;;SA8BpB,wBAAwB;;;;;;aAgC1B;;;;;;;;;;;;SAeJ,WAAW,UAAU;;;;;;;;;;SAmBf,oBAAoB;;;;;iBAmBnB;;;;aAWH;;;;aAOA,eAAe;;;;SAOnB,eAAe,KAAK;;;;aAOhB;;;;aAOA;;;;aAOA;;;;;;aASA,SAAS,YAAY;;;;;aAQrB,SAAS;;;;;;;;;SAYb,QAAQ,MAAM;;;;aAOV;;;;aAOA;;;;aAOA;;;;aAOA;;;;aAOA;;;;aAOA"}
@@ -185,7 +185,9 @@ var Application = class {
185
185
  for (const validator of validators) try {
186
186
  await validator();
187
187
  } catch (error) {
188
- throw new ErrorWithCause(`Startup validator "${validator.name || "<anonymous>"}" rejected boot: ${error instanceof Error ? error.message : String(error)}. Fix the condition it checks, or remove the validator if it no longer applies — boot cannot proceed while it fails.`, { cause: error });
188
+ const name = validator.name || "<anonymous>";
189
+ const cause = error instanceof Error ? error.message : String(error);
190
+ throw new ErrorWithCause(`Startup validator "${name}" rejected boot: ${cause}. Fix the condition it checks, or remove the validator if it no longer applies — boot cannot proceed while it fails.`, { cause: error });
189
191
  }
190
192
  }
191
193
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"application.mjs","names":[],"sources":["../../../../../../../../packages/core/src/application/application.ts"],"sourcesContent":["import { log } from \"@warlock.js/logger\";\nimport { BOOT_SIGNAL_VERSION, sendBootSignal } from \"./boot-signal\";\nimport {\n environment,\n setEnvironment,\n type Environment,\n type RuntimeStrategy,\n} from \"../utils/environment\";\nimport { getFrameworkVersion } from \"../utils/framework-vesion\";\nimport { appPath, publicPath, rootPath, srcPath, storagePath, uploadsPath } from \"../utils/paths\";\nimport { getRoles, getSites, hasRole, type AppRole } from \"./roles\";\n\n/**\n * Snapshot of the global facts known the moment the application finished\n * booting: every connector (early + late) is active and all app files\n * (locales, events, main, routes) are loaded. Passed to every\n * `Application.onceBooted` listener and resolved from `Application.whenBooted`.\n */\nexport type BootContext = {\n environment: Environment;\n runtimeStrategy: RuntimeStrategy;\n /**\n * Wall-clock milliseconds the boot took. The dev server measures it; the\n * production entry omits it.\n */\n bootDurationMs?: number;\n};\n\n/**\n * A callback registered through `Application.onceBooted`. May be async — its\n * rejection is caught and logged so a single listener can never break boot or\n * the other listeners.\n */\nexport type BootListener = (context: BootContext) => void | Promise<void>;\n\n/**\n * A callback registered through `Application.onValidateBoot`. May be async —\n * unlike {@link BootListener}, its rejection is NOT caught: it aborts boot.\n *\n * Use this for configuration that makes the application WRONG rather than\n * degraded when missing (a signing secret, a required integration key) — the\n * kind of check that must fail closed. Use `onceBooted` for everything else;\n * that contract stays fire-and-forget on purpose (it is the right behaviour\n * for plugins reacting to boot, not for gating it).\n */\nexport type BootValidator = () => void | Promise<void>;\n\n/**\n * `new Error(message, { cause })` is ES2022, and this package still compiles\n * against the ES2020 lib, where `Error` is typed as taking a message only.\n * Node has supported the option since v16, so this is the type layer\n * catching up with the runtime, not a change in what the code does. Same\n * workaround as `image.ts` (see #16).\n */\ntype ErrorWithCauseConstructor = new (message: string, options: { cause: unknown }) => Error;\n\nconst ErrorWithCause = Error as ErrorWithCauseConstructor;\n\n/**\n * A callback registered through `Application.onShutdown`. Runs once, while the\n * connectors (db, cache, http) are still up, so it can release app-owned\n * resources cleanly. May be async — its rejection is caught and logged.\n */\nexport type ShutdownListener = () => void | Promise<void>;\n\nexport class Application {\n /**\n * Project start time regarding the process start time\n */\n public static readonly startedAt = new Date(Date.now() - process.uptime() * 1000);\n\n /**\n * Runtime strategy\n */\n public static runtimeStrategy: RuntimeStrategy;\n\n /**\n * Whether the application has finished booting. Flipped once by `markBooted`.\n */\n private static booted = false;\n\n /**\n * The boot context, set once booted so it can be replayed to late subscribers.\n */\n private static bootContext: BootContext | undefined;\n\n /**\n * Listeners queued before boot completed, drained in registration order by\n * `markBooted`.\n */\n private static bootListeners: BootListener[] = [];\n\n /**\n * Whether `runStartupValidators` has already run. Flipped once, so a\n * validator registered afterwards is refused instead of silently skipped\n * or run too late to matter.\n */\n private static validated = false;\n\n /**\n * Startup validators queued before `runStartupValidators` ran, drained in\n * registration order.\n */\n private static bootValidators: BootValidator[] = [];\n\n /**\n * The http port this process actually bound, once it has. Reported in the\n * readiness signal so a supervisor knows where to send its health check\n * instead of re-deriving it from config it may not be able to read.\n * Undefined for an app with no http connector — a queue worker still boots.\n */\n private static servedPort: number | undefined;\n\n /**\n * Whether the application has begun (or finished) shutting down. Flipped once\n * by `runShutdownHooks`.\n */\n private static shuttingDown = false;\n\n /**\n * Teardown callbacks, run once when shutdown begins.\n */\n private static shutdownListeners: ShutdownListener[] = [];\n\n /**\n * Get framework version\n */\n public static get version() {\n return getFrameworkVersion();\n }\n\n /**\n * Set the runtime strategy\n */\n public static setRuntimeStrategy(strategy: RuntimeStrategy) {\n this.runtimeStrategy = strategy;\n }\n\n /**\n * Whether the application has finished booting — every connector in both\n * the early and late phases is active and all app files (locales, events,\n * main, routes) have been loaded.\n */\n public static get isBooted(): boolean {\n return this.booted;\n }\n\n /**\n * Record the http port this process bound.\n *\n * @internal The http connector calls this after a successful `listen`.\n */\n public static setServedPort(port: number): void {\n this.servedPort = port;\n }\n\n /**\n * Run a callback once the application is fully booted.\n *\n * App files (`main` / `events` / `routes` / locales) are imported BEFORE the\n * late-phase connectors (http, socket) start, so a listener registered at\n * import time waits for the whole sequence to finish before it runs. If the\n * application is already booted, the callback runs on the next microtask —\n * so a late subscriber never silently misses the event.\n *\n * @example\n * Application.onceBooted(({ environment }) => {\n * log.info(\"app\", \"booted\", `ready in ${environment}`);\n * });\n */\n public static onceBooted(listener: BootListener): void {\n if (this.booted && this.bootContext) {\n const context = this.bootContext;\n void this.runBootListener(listener, context);\n\n return;\n }\n\n this.bootListeners.push(listener);\n }\n\n /**\n * Promise form of {@link onceBooted} — resolves with the boot context once\n * the application is booted, or immediately if it already is.\n */\n public static whenBooted(): Promise<BootContext> {\n if (this.booted && this.bootContext) {\n return Promise.resolve(this.bootContext);\n }\n\n return new Promise<BootContext>((resolve) => {\n this.onceBooted((context) => resolve(context));\n });\n }\n\n /**\n * Flip the boot latch and drain every queued listener. The dev server and\n * the production entry call this once, right after the late phase starts. It\n * is idempotent — a second call is a no-op, so a double-invoke can never\n * double-fire listeners.\n *\n * Also reports readiness to a supervising parent process — this is the one\n * moment in the lifecycle where \"the application is serving\" is true, so it\n * is the only honest source for `warlock start`'s success banner. Sent before\n * the listeners run: a slow or hanging `onceBooted` listener must not delay\n * the parent's view of a server that is already accepting requests.\n *\n * @internal Framework entry points call this; application code must not.\n */\n public static markBooted(context: BootContext): void {\n if (this.booted) {\n return;\n }\n\n this.booted = true;\n this.bootContext = context;\n\n sendBootSignal({\n type: \"warlock:ready\",\n version: BOOT_SIGNAL_VERSION,\n pid: process.pid,\n at: new Date().toISOString(),\n environment: context.environment,\n runtimeStrategy: context.runtimeStrategy,\n bootDurationMs: context.bootDurationMs,\n port: this.servedPort,\n roles: [...this.roles],\n });\n\n const listeners = this.bootListeners;\n this.bootListeners = [];\n\n for (const listener of listeners) {\n void this.runBootListener(listener, context);\n }\n }\n\n /**\n * Invoke a single boot listener, isolating its failure so neither boot nor\n * the remaining listeners are affected.\n */\n private static async runBootListener(\n listener: BootListener,\n context: BootContext,\n ): Promise<void> {\n try {\n await listener(context);\n } catch (error) {\n log.error(\"application\", \"booted-listener\", error as Error);\n }\n }\n\n /**\n * Register a startup validator — distinct from {@link onceBooted}. A\n * rejecting validator aborts boot instead of being caught and logged, so\n * this is where configuration that must fail closed belongs (a signing\n * secret, a required integration key), not `onceBooted`.\n *\n * Must be registered before the framework calls `runStartupValidators` —\n * typically at module scope in `src/app/main.ts`, the same place a\n * `BootListener` would be registered. Registering one after validation has\n * already run throws: by then a rejection could no longer stop the app\n * from serving, so running it late would silently defeat the guarantee\n * this hook exists to give.\n *\n * @example\n * Application.onValidateBoot(() => {\n * if (!env(\"JWT_SECRET\")) {\n * throw new Error(\n * \"JWT_SECRET is not set. Sessions cannot be signed without it. \" +\n * \"Generate one with `yarn jwt` and put it in .env.\",\n * );\n * }\n * });\n */\n public static onValidateBoot(validator: BootValidator): void {\n if (this.validated) {\n throw new Error(\n \"Application.onValidateBoot(): startup validators already ran — \" +\n \"this validator was registered too late to block boot. Register it \" +\n \"before the framework calls Application.runStartupValidators(), \" +\n \"typically at module scope in `src/app/main.ts`.\",\n );\n }\n\n this.bootValidators.push(validator);\n }\n\n /**\n * Run every registered startup validator, in registration order, and abort\n * on the first rejection. Idempotent — a second call is a no-op.\n *\n * Distinct from `runBootListener`: a listener's failure is isolated so it\n * can never break boot; a validator's failure IS the boot failing — that is\n * the entire point of registering one instead of the other. The thrown\n * error names the failing validator and the original cause, so whatever\n * catches it (the dev server's boot try/catch, the production entry's\n * top-level await) reports which check failed and why, not a bare\n * rejection.\n *\n * @internal Framework entry points call this once app code (main.ts et al)\n * has loaded and BEFORE late-phase connectors (http, socket) start, so a\n * failing validator runs before anything can bind a port or accept a\n * request. Application code must not call this directly.\n */\n public static async runStartupValidators(): Promise<void> {\n if (this.validated) {\n return;\n }\n\n this.validated = true;\n\n const validators = this.bootValidators;\n this.bootValidators = [];\n\n for (const validator of validators) {\n try {\n await validator();\n } catch (error) {\n const name = validator.name || \"<anonymous>\";\n const cause = error instanceof Error ? error.message : String(error);\n\n throw new ErrorWithCause(\n `Startup validator \"${name}\" rejected boot: ${cause}. ` +\n `Fix the condition it checks, or remove the validator if it no ` +\n `longer applies — boot cannot proceed while it fails.`,\n { cause: error },\n );\n }\n }\n }\n\n /**\n * Whether the application has begun shutting down. Once true, readiness\n * checks report not-ready so a load balancer drains this instance before the\n * HTTP server stops accepting requests.\n */\n public static get isShuttingDown(): boolean {\n return this.shuttingDown;\n }\n\n /**\n * Register a teardown callback, run once when the application shuts down —\n * before the connectors (db, cache, http) are torn down, so it can still use\n * them. The natural place to close an app-owned resource opened in\n * `onceBooted`. If shutdown has already begun, the callback runs immediately.\n *\n * @example\n * Application.onShutdown(async () => {\n * await myQueueConsumer.stop();\n * });\n */\n public static onShutdown(listener: ShutdownListener): void {\n if (this.shuttingDown) {\n void this.runShutdownListener(listener);\n\n return;\n }\n\n this.shutdownListeners.push(listener);\n }\n\n /**\n * Flip the shutdown latch and run every teardown callback. The connectors\n * manager calls this at the start of shutdown — before any connector is torn\n * down. Idempotent and error-isolated: each callback is awaited, a thrown one\n * is logged and does not stop the rest. Listeners run LIFO (reverse of\n * registration), mirroring resource-unwind order.\n *\n * @internal Framework entry points call this; application code must not.\n */\n public static async runShutdownHooks(): Promise<void> {\n if (this.shuttingDown) {\n return;\n }\n\n this.shuttingDown = true;\n\n const listeners = this.shutdownListeners.reverse();\n this.shutdownListeners = [];\n\n for (const listener of listeners) {\n await this.runShutdownListener(listener);\n }\n }\n\n /**\n * Invoke a single teardown callback, isolating its failure so the rest still\n * run and shutdown is never blocked by one bad hook.\n */\n private static async runShutdownListener(listener: ShutdownListener): Promise<void> {\n try {\n await listener();\n } catch (error) {\n log.error(\"application\", \"shutdown-listener\", error as Error);\n }\n }\n\n /**\n * Get project uptime in milliseconds\n */\n public static get uptime(): number {\n return process.uptime() * 1000;\n }\n\n /**\n * Get the current environment\n */\n public static get environment(): Environment {\n return environment();\n }\n\n /**\n * Set the current environment\n */\n public static setEnvironment(env: Environment) {\n setEnvironment(env);\n }\n\n /**\n * Check if the application is running in production environment\n */\n public static get isProduction(): boolean {\n return this.environment === \"production\";\n }\n\n /**\n * Check if the application is running in development environment\n */\n public static get isDevelopment(): boolean {\n return this.environment === \"development\";\n }\n\n /**\n * Check if the application is running in test environment\n */\n public static get isTest(): boolean {\n return this.environment === \"test\";\n }\n\n /**\n * The roles this process serves — `WARLOCK_ROLES`, resolved once at\n * bootstrap. Every role is on when the variable is absent (plain `warlock\n * start`, `warlock dev`, and tests).\n */\n public static get roles(): ReadonlySet<AppRole> {\n return getRoles();\n }\n\n /**\n * The site keys this process installs pages for — `WARLOCK_SITES`,\n * resolved once at bootstrap. `undefined` means every site.\n */\n public static get sites(): ReadonlySet<string> | undefined {\n return getSites();\n }\n\n /**\n * Whether this process serves the given role.\n *\n * @example\n * if (Application.hasRole(\"worker\")) {\n * scheduler.start();\n * }\n */\n public static hasRole(role: AppRole): boolean {\n return hasRole(role);\n }\n\n /**\n * Get the root path\n */\n public static get rootPath(): string {\n return rootPath();\n }\n\n /**\n * Get the src path\n */\n public static get srcPath(): string {\n return srcPath();\n }\n\n /**\n * Get the app path\n */\n public static get appPath(): string {\n return appPath();\n }\n\n /**\n * Get the storage path\n */\n public static get storagePath(): string {\n return storagePath();\n }\n\n /**\n * Get the uploads path\n */\n public static get uploadsPath(): string {\n return uploadsPath();\n }\n\n /**\n * Get the public path\n */\n public static get publicPath(): string {\n return publicPath();\n }\n}\n"],"mappings":";;;;;;;;AAwDA,MAAM,iBAAiB;AASvB,IAAa,cAAb,MAAyB;;mCAIY,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,OAAO,IAAI,GAAI;;;gBAUxD;;;uBAWuB,CAAC;;;mBAOrB;;;wBAMsB,CAAC;;;sBAcpB;;;2BAKyB,CAAC;;;;;CAKxD,WAAkB,UAAU;EAC1B,OAAO,oBAAoB;CAC7B;;;;CAKA,OAAc,mBAAmB,UAA2B;EAC1D,KAAK,kBAAkB;CACzB;;;;;;CAOA,WAAkB,WAAoB;EACpC,OAAO,KAAK;CACd;;;;;;CAOA,OAAc,cAAc,MAAoB;EAC9C,KAAK,aAAa;CACpB;;;;;;;;;;;;;;;CAgBA,OAAc,WAAW,UAA8B;EACrD,IAAI,KAAK,UAAU,KAAK,aAAa;GACnC,MAAM,UAAU,KAAK;GACrB,AAAK,KAAK,gBAAgB,UAAU,OAAO;GAE3C;EACF;EAEA,KAAK,cAAc,KAAK,QAAQ;CAClC;;;;;CAMA,OAAc,aAAmC;EAC/C,IAAI,KAAK,UAAU,KAAK,aACtB,OAAO,QAAQ,QAAQ,KAAK,WAAW;EAGzC,OAAO,IAAI,SAAsB,YAAY;GAC3C,KAAK,YAAY,YAAY,QAAQ,OAAO,CAAC;EAC/C,CAAC;CACH;;;;;;;;;;;;;;;CAgBA,OAAc,WAAW,SAA4B;EACnD,IAAI,KAAK,QACP;EAGF,KAAK,SAAS;EACd,KAAK,cAAc;EAEnB,eAAe;GACb,MAAM;GACN;GACA,KAAK,QAAQ;GACb,qBAAI,IAAI,KAAK,EAAC,CAAC,YAAY;GAC3B,aAAa,QAAQ;GACrB,iBAAiB,QAAQ;GACzB,gBAAgB,QAAQ;GACxB,MAAM,KAAK;GACX,OAAO,CAAC,GAAG,KAAK,KAAK;EACvB,CAAC;EAED,MAAM,YAAY,KAAK;EACvB,KAAK,gBAAgB,CAAC;EAEtB,KAAK,MAAM,YAAY,WACrB,AAAK,KAAK,gBAAgB,UAAU,OAAO;CAE/C;;;;;CAMA,aAAqB,gBACnB,UACA,SACe;EACf,IAAI;GACF,MAAM,SAAS,OAAO;EACxB,SAAS,OAAO;GACd,IAAI,MAAM,eAAe,mBAAmB,KAAc;EAC5D;CACF;;;;;;;;;;;;;;;;;;;;;;;;CAyBA,OAAc,eAAe,WAAgC;EAC3D,IAAI,KAAK,WACP,MAAM,IAAI,MACR,iPAIF;EAGF,KAAK,eAAe,KAAK,SAAS;CACpC;;;;;;;;;;;;;;;;;;CAmBA,aAAoB,uBAAsC;EACxD,IAAI,KAAK,WACP;EAGF,KAAK,YAAY;EAEjB,MAAM,aAAa,KAAK;EACxB,KAAK,iBAAiB,CAAC;EAEvB,KAAK,MAAM,aAAa,YACtB,IAAI;GACF,MAAM,UAAU;EAClB,SAAS,OAAO;GAId,MAAM,IAAI,eACR,sBAJW,UAAU,QAAQ,cAIF,mBAHf,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAGb,uHAGpD,EAAE,OAAO,MAAM,CACjB;EACF;CAEJ;;;;;;CAOA,WAAkB,iBAA0B;EAC1C,OAAO,KAAK;CACd;;;;;;;;;;;;CAaA,OAAc,WAAW,UAAkC;EACzD,IAAI,KAAK,cAAc;GACrB,AAAK,KAAK,oBAAoB,QAAQ;GAEtC;EACF;EAEA,KAAK,kBAAkB,KAAK,QAAQ;CACtC;;;;;;;;;;CAWA,aAAoB,mBAAkC;EACpD,IAAI,KAAK,cACP;EAGF,KAAK,eAAe;EAEpB,MAAM,YAAY,KAAK,kBAAkB,QAAQ;EACjD,KAAK,oBAAoB,CAAC;EAE1B,KAAK,MAAM,YAAY,WACrB,MAAM,KAAK,oBAAoB,QAAQ;CAE3C;;;;;CAMA,aAAqB,oBAAoB,UAA2C;EAClF,IAAI;GACF,MAAM,SAAS;EACjB,SAAS,OAAO;GACd,IAAI,MAAM,eAAe,qBAAqB,KAAc;EAC9D;CACF;;;;CAKA,WAAkB,SAAiB;EACjC,OAAO,QAAQ,OAAO,IAAI;CAC5B;;;;CAKA,WAAkB,cAA2B;EAC3C,OAAO,YAAY;CACrB;;;;CAKA,OAAc,eAAe,KAAkB;EAC7C,eAAe,GAAG;CACpB;;;;CAKA,WAAkB,eAAwB;EACxC,OAAO,KAAK,gBAAgB;CAC9B;;;;CAKA,WAAkB,gBAAyB;EACzC,OAAO,KAAK,gBAAgB;CAC9B;;;;CAKA,WAAkB,SAAkB;EAClC,OAAO,KAAK,gBAAgB;CAC9B;;;;;;CAOA,WAAkB,QAA8B;EAC9C,OAAO,SAAS;CAClB;;;;;CAMA,WAAkB,QAAyC;EACzD,OAAO,SAAS;CAClB;;;;;;;;;CAUA,OAAc,QAAQ,MAAwB;EAC5C,OAAO,QAAQ,IAAI;CACrB;;;;CAKA,WAAkB,WAAmB;EACnC,OAAO,SAAS;CAClB;;;;CAKA,WAAkB,UAAkB;EAClC,OAAO,QAAQ;CACjB;;;;CAKA,WAAkB,UAAkB;EAClC,OAAO,QAAQ;CACjB;;;;CAKA,WAAkB,cAAsB;EACtC,OAAO,YAAY;CACrB;;;;CAKA,WAAkB,cAAsB;EACtC,OAAO,YAAY;CACrB;;;;CAKA,WAAkB,aAAqB;EACrC,OAAO,WAAW;CACpB;AACF"}
1
+ {"version":3,"file":"application.mjs","names":[],"sources":["../../../../../../../../packages/core/src/application/application.ts"],"sourcesContent":["import { log } from \"@warlock.js/logger\";\nimport { BOOT_SIGNAL_VERSION, sendBootSignal } from \"./boot-signal\";\nimport {\n environment,\n setEnvironment,\n type Environment,\n type RuntimeStrategy,\n} from \"../utils/environment\";\nimport { getFrameworkVersion } from \"../utils/framework-vesion\";\nimport { appPath, publicPath, rootPath, srcPath, storagePath, uploadsPath } from \"../utils/paths\";\nimport { getRoles, getSites, hasRole, type AppRole } from \"./roles\";\n\n/**\n * Snapshot of the global facts known the moment the application finished\n * booting: every connector (early + late) is active and all app files\n * (locales, events, main, routes) are loaded. Passed to every\n * `Application.onceBooted` listener and resolved from `Application.whenBooted`.\n */\nexport type BootContext = {\n environment: Environment;\n runtimeStrategy: RuntimeStrategy;\n /**\n * Wall-clock milliseconds the boot took. The dev server measures it; the\n * production entry omits it.\n */\n bootDurationMs?: number;\n};\n\n/**\n * A callback registered through `Application.onceBooted`. May be async — its\n * rejection is caught and logged so a single listener can never break boot or\n * the other listeners.\n */\nexport type BootListener = (context: BootContext) => void | Promise<void>;\n\n/**\n * A callback registered through `Application.onValidateBoot`. May be async —\n * unlike {@link BootListener}, its rejection is NOT caught: it aborts boot.\n *\n * Use this for configuration that makes the application WRONG rather than\n * degraded when missing (a signing secret, a required integration key) — the\n * kind of check that must fail closed. Use `onceBooted` for everything else;\n * that contract stays fire-and-forget on purpose (it is the right behaviour\n * for plugins reacting to boot, not for gating it).\n */\nexport type BootValidator = () => void | Promise<void>;\n\n/**\n * `new Error(message, { cause })` is ES2022, and this package still compiles\n * against the ES2020 lib, where `Error` is typed as taking a message only.\n * Node has supported the option since v16, so this is the type layer\n * catching up with the runtime, not a change in what the code does. Same\n * workaround as `image.ts` (see #16).\n */\ntype ErrorWithCauseConstructor = new (message: string, options: { cause: unknown }) => Error;\n\nconst ErrorWithCause = Error as ErrorWithCauseConstructor;\n\n/**\n * A callback registered through `Application.onShutdown`. Runs once, while the\n * connectors (db, cache, http) are still up, so it can release app-owned\n * resources cleanly. May be async — its rejection is caught and logged.\n */\nexport type ShutdownListener = () => void | Promise<void>;\n\nexport class Application {\n /**\n * Project start time regarding the process start time\n */\n public static readonly startedAt = new Date(Date.now() - process.uptime() * 1000);\n\n /**\n * Runtime strategy\n */\n public static runtimeStrategy: RuntimeStrategy;\n\n /**\n * Whether the application has finished booting. Flipped once by `markBooted`.\n */\n private static booted = false;\n\n /**\n * The boot context, set once booted so it can be replayed to late subscribers.\n */\n private static bootContext: BootContext | undefined;\n\n /**\n * Listeners queued before boot completed, drained in registration order by\n * `markBooted`.\n */\n private static bootListeners: BootListener[] = [];\n\n /**\n * Whether `runStartupValidators` has already run. Flipped once, so a\n * validator registered afterwards is refused instead of silently skipped\n * or run too late to matter.\n */\n private static validated = false;\n\n /**\n * Startup validators queued before `runStartupValidators` ran, drained in\n * registration order.\n */\n private static bootValidators: BootValidator[] = [];\n\n /**\n * The http port this process actually bound, once it has. Reported in the\n * readiness signal so a supervisor knows where to send its health check\n * instead of re-deriving it from config it may not be able to read.\n * Undefined for an app with no http connector — a queue worker still boots.\n */\n private static servedPort: number | undefined;\n\n /**\n * Whether the application has begun (or finished) shutting down. Flipped once\n * by `runShutdownHooks`.\n */\n private static shuttingDown = false;\n\n /**\n * Teardown callbacks, run once when shutdown begins.\n */\n private static shutdownListeners: ShutdownListener[] = [];\n\n /**\n * Get framework version\n */\n public static get version() {\n return getFrameworkVersion();\n }\n\n /**\n * Set the runtime strategy\n */\n public static setRuntimeStrategy(strategy: RuntimeStrategy) {\n this.runtimeStrategy = strategy;\n }\n\n /**\n * Whether the application has finished booting — every connector in both\n * the early and late phases is active and all app files (locales, events,\n * main, routes) have been loaded.\n */\n public static get isBooted(): boolean {\n return this.booted;\n }\n\n /**\n * Record the http port this process bound.\n *\n * @internal The http connector calls this after a successful `listen`.\n */\n public static setServedPort(port: number): void {\n this.servedPort = port;\n }\n\n /**\n * Run a callback once the application is fully booted.\n *\n * App files (`main` / `events` / `routes` / locales) are imported BEFORE the\n * late-phase connectors (http, socket) start, so a listener registered at\n * import time waits for the whole sequence to finish before it runs. If the\n * application is already booted, the callback runs on the next microtask —\n * so a late subscriber never silently misses the event.\n *\n * @example\n * Application.onceBooted(({ environment }) => {\n * log.info(\"app\", \"booted\", `ready in ${environment}`);\n * });\n */\n public static onceBooted(listener: BootListener): void {\n if (this.booted && this.bootContext) {\n const context = this.bootContext;\n void this.runBootListener(listener, context);\n\n return;\n }\n\n this.bootListeners.push(listener);\n }\n\n /**\n * Promise form of {@link onceBooted} — resolves with the boot context once\n * the application is booted, or immediately if it already is.\n */\n public static whenBooted(): Promise<BootContext> {\n if (this.booted && this.bootContext) {\n return Promise.resolve(this.bootContext);\n }\n\n return new Promise<BootContext>((resolve) => {\n this.onceBooted((context) => resolve(context));\n });\n }\n\n /**\n * Flip the boot latch and drain every queued listener. The dev server and\n * the production entry call this once, right after the late phase starts. It\n * is idempotent — a second call is a no-op, so a double-invoke can never\n * double-fire listeners.\n *\n * Also reports readiness to a supervising parent process — this is the one\n * moment in the lifecycle where \"the application is serving\" is true, so it\n * is the only honest source for `warlock start`'s success banner. Sent before\n * the listeners run: a slow or hanging `onceBooted` listener must not delay\n * the parent's view of a server that is already accepting requests.\n *\n * @internal Framework entry points call this; application code must not.\n */\n public static markBooted(context: BootContext): void {\n if (this.booted) {\n return;\n }\n\n this.booted = true;\n this.bootContext = context;\n\n sendBootSignal({\n type: \"warlock:ready\",\n version: BOOT_SIGNAL_VERSION,\n pid: process.pid,\n at: new Date().toISOString(),\n environment: context.environment,\n runtimeStrategy: context.runtimeStrategy,\n bootDurationMs: context.bootDurationMs,\n port: this.servedPort,\n roles: [...this.roles],\n });\n\n const listeners = this.bootListeners;\n this.bootListeners = [];\n\n for (const listener of listeners) {\n void this.runBootListener(listener, context);\n }\n }\n\n /**\n * Invoke a single boot listener, isolating its failure so neither boot nor\n * the remaining listeners are affected.\n */\n private static async runBootListener(\n listener: BootListener,\n context: BootContext,\n ): Promise<void> {\n try {\n await listener(context);\n } catch (error) {\n log.error(\"application\", \"booted-listener\", error as Error);\n }\n }\n\n /**\n * Register a startup validator — distinct from {@link onceBooted}. A\n * rejecting validator aborts boot instead of being caught and logged, so\n * this is where configuration that must fail closed belongs (a signing\n * secret, a required integration key), not `onceBooted`.\n *\n * Must be registered before the framework calls `runStartupValidators` —\n * typically at module scope in `src/app/main.ts`, the same place a\n * `BootListener` would be registered. Registering one after validation has\n * already run throws: by then a rejection could no longer stop the app\n * from serving, so running it late would silently defeat the guarantee\n * this hook exists to give.\n *\n * @example\n * Application.onValidateBoot(() => {\n * if (!env(\"JWT_SECRET\")) {\n * throw new Error(\n * \"JWT_SECRET is not set. Sessions cannot be signed without it. \" +\n * \"Generate one with `yarn jwt` and put it in .env.\",\n * );\n * }\n * });\n */\n public static onValidateBoot(validator: BootValidator): void {\n if (this.validated) {\n throw new Error(\n \"Application.onValidateBoot(): startup validators already ran — \" +\n \"this validator was registered too late to block boot. Register it \" +\n \"before the framework calls Application.runStartupValidators(), \" +\n \"typically at module scope in `src/app/main.ts`.\",\n );\n }\n\n this.bootValidators.push(validator);\n }\n\n /**\n * Run every registered startup validator, in registration order, and abort\n * on the first rejection. Idempotent — a second call is a no-op.\n *\n * Distinct from `runBootListener`: a listener's failure is isolated so it\n * can never break boot; a validator's failure IS the boot failing — that is\n * the entire point of registering one instead of the other. The thrown\n * error names the failing validator and the original cause, so whatever\n * catches it (the dev server's boot try/catch, the production entry's\n * top-level await) reports which check failed and why, not a bare\n * rejection.\n *\n * @internal Framework entry points call this once app code (main.ts et al)\n * has loaded and BEFORE late-phase connectors (http, socket) start, so a\n * failing validator runs before anything can bind a port or accept a\n * request. Application code must not call this directly.\n */\n public static async runStartupValidators(): Promise<void> {\n if (this.validated) {\n return;\n }\n\n this.validated = true;\n\n const validators = this.bootValidators;\n this.bootValidators = [];\n\n for (const validator of validators) {\n try {\n await validator();\n } catch (error) {\n const name = validator.name || \"<anonymous>\";\n const cause = error instanceof Error ? error.message : String(error);\n\n throw new ErrorWithCause(\n `Startup validator \"${name}\" rejected boot: ${cause}. ` +\n `Fix the condition it checks, or remove the validator if it no ` +\n `longer applies — boot cannot proceed while it fails.`,\n { cause: error },\n );\n }\n }\n }\n\n /**\n * Whether the application has begun shutting down. Once true, readiness\n * checks report not-ready so a load balancer drains this instance before the\n * HTTP server stops accepting requests.\n */\n public static get isShuttingDown(): boolean {\n return this.shuttingDown;\n }\n\n /**\n * Register a teardown callback, run once when the application shuts down —\n * before the connectors (db, cache, http) are torn down, so it can still use\n * them. The natural place to close an app-owned resource opened in\n * `onceBooted`. If shutdown has already begun, the callback runs immediately.\n *\n * @example\n * Application.onShutdown(async () => {\n * await myQueueConsumer.stop();\n * });\n */\n public static onShutdown(listener: ShutdownListener): void {\n if (this.shuttingDown) {\n void this.runShutdownListener(listener);\n\n return;\n }\n\n this.shutdownListeners.push(listener);\n }\n\n /**\n * Flip the shutdown latch and run every teardown callback. The connectors\n * manager calls this at the start of shutdown — before any connector is torn\n * down. Idempotent and error-isolated: each callback is awaited, a thrown one\n * is logged and does not stop the rest. Listeners run LIFO (reverse of\n * registration), mirroring resource-unwind order.\n *\n * @internal Framework entry points call this; application code must not.\n */\n public static async runShutdownHooks(): Promise<void> {\n if (this.shuttingDown) {\n return;\n }\n\n this.shuttingDown = true;\n\n const listeners = this.shutdownListeners.reverse();\n this.shutdownListeners = [];\n\n for (const listener of listeners) {\n await this.runShutdownListener(listener);\n }\n }\n\n /**\n * Invoke a single teardown callback, isolating its failure so the rest still\n * run and shutdown is never blocked by one bad hook.\n */\n private static async runShutdownListener(listener: ShutdownListener): Promise<void> {\n try {\n await listener();\n } catch (error) {\n log.error(\"application\", \"shutdown-listener\", error as Error);\n }\n }\n\n /**\n * Get project uptime in milliseconds\n */\n public static get uptime(): number {\n return process.uptime() * 1000;\n }\n\n /**\n * Get the current environment\n */\n public static get environment(): Environment {\n return environment();\n }\n\n /**\n * Set the current environment\n */\n public static setEnvironment(env: Environment) {\n setEnvironment(env);\n }\n\n /**\n * Check if the application is running in production environment\n */\n public static get isProduction(): boolean {\n return this.environment === \"production\";\n }\n\n /**\n * Check if the application is running in development environment\n */\n public static get isDevelopment(): boolean {\n return this.environment === \"development\";\n }\n\n /**\n * Check if the application is running in test environment\n */\n public static get isTest(): boolean {\n return this.environment === \"test\";\n }\n\n /**\n * The roles this process serves — `WARLOCK_ROLES`, resolved once at\n * bootstrap. Every role is on when the variable is absent (plain `warlock\n * start`, `warlock dev`, and tests).\n */\n public static get roles(): ReadonlySet<AppRole> {\n return getRoles();\n }\n\n /**\n * The site keys this process installs pages for — `WARLOCK_SITES`,\n * resolved once at bootstrap. `undefined` means every site.\n */\n public static get sites(): ReadonlySet<string> | undefined {\n return getSites();\n }\n\n /**\n * Whether this process serves the given role.\n *\n * @example\n * if (Application.hasRole(\"worker\")) {\n * scheduler.start();\n * }\n */\n public static hasRole(role: AppRole): boolean {\n return hasRole(role);\n }\n\n /**\n * Get the root path\n */\n public static get rootPath(): string {\n return rootPath();\n }\n\n /**\n * Get the src path\n */\n public static get srcPath(): string {\n return srcPath();\n }\n\n /**\n * Get the app path\n */\n public static get appPath(): string {\n return appPath();\n }\n\n /**\n * Get the storage path\n */\n public static get storagePath(): string {\n return storagePath();\n }\n\n /**\n * Get the uploads path\n */\n public static get uploadsPath(): string {\n return uploadsPath();\n }\n\n /**\n * Get the public path\n */\n public static get publicPath(): string {\n return publicPath();\n }\n}\n"],"mappings":";;;;;;;;AAwDA,MAAM,iBAAiB;AASvB,IAAa,cAAb,MAAyB;;mCAIY,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,OAAO,IAAI,GAAI;;;gBAUxD;;;uBAWuB,CAAC;;;mBAOrB;;;wBAMsB,CAAC;;;sBAcpB;;;2BAKyB,CAAC;;;;;CAKxD,WAAkB,UAAU;EAC1B,OAAO,oBAAoB;CAC7B;;;;CAKA,OAAc,mBAAmB,UAA2B;EAC1D,KAAK,kBAAkB;CACzB;;;;;;CAOA,WAAkB,WAAoB;EACpC,OAAO,KAAK;CACd;;;;;;CAOA,OAAc,cAAc,MAAoB;EAC9C,KAAK,aAAa;CACpB;;;;;;;;;;;;;;;CAgBA,OAAc,WAAW,UAA8B;EACrD,IAAI,KAAK,UAAU,KAAK,aAAa;GACnC,MAAM,UAAU,KAAK;GACrB,AAAK,KAAK,gBAAgB,UAAU,OAAO;GAE3C;EACF;EAEA,KAAK,cAAc,KAAK,QAAQ;CAClC;;;;;CAMA,OAAc,aAAmC;EAC/C,IAAI,KAAK,UAAU,KAAK,aACtB,OAAO,QAAQ,QAAQ,KAAK,WAAW;EAGzC,OAAO,IAAI,SAAsB,YAAY;GAC3C,KAAK,YAAY,YAAY,QAAQ,OAAO,CAAC;EAC/C,CAAC;CACH;;;;;;;;;;;;;;;CAgBA,OAAc,WAAW,SAA4B;EACnD,IAAI,KAAK,QACP;EAGF,KAAK,SAAS;EACd,KAAK,cAAc;EAEnB,eAAe;GACb,MAAM;GACN;GACA,KAAK,QAAQ;GACb,qBAAI,IAAI,KAAK,EAAC,CAAC,YAAY;GAC3B,aAAa,QAAQ;GACrB,iBAAiB,QAAQ;GACzB,gBAAgB,QAAQ;GACxB,MAAM,KAAK;GACX,OAAO,CAAC,GAAG,KAAK,KAAK;EACvB,CAAC;EAED,MAAM,YAAY,KAAK;EACvB,KAAK,gBAAgB,CAAC;EAEtB,KAAK,MAAM,YAAY,WACrB,AAAK,KAAK,gBAAgB,UAAU,OAAO;CAE/C;;;;;CAMA,aAAqB,gBACnB,UACA,SACe;EACf,IAAI;GACF,MAAM,SAAS,OAAO;EACxB,SAAS,OAAO;GACd,IAAI,MAAM,eAAe,mBAAmB,KAAc;EAC5D;CACF;;;;;;;;;;;;;;;;;;;;;;;;CAyBA,OAAc,eAAe,WAAgC;EAC3D,IAAI,KAAK,WACP,MAAM,IAAI,MACR,iPAIF;EAGF,KAAK,eAAe,KAAK,SAAS;CACpC;;;;;;;;;;;;;;;;;;CAmBA,aAAoB,uBAAsC;EACxD,IAAI,KAAK,WACP;EAGF,KAAK,YAAY;EAEjB,MAAM,aAAa,KAAK;EACxB,KAAK,iBAAiB,CAAC;EAEvB,KAAK,MAAM,aAAa,YACtB,IAAI;GACF,MAAM,UAAU;EAClB,SAAS,OAAO;GACd,MAAM,OAAO,UAAU,QAAQ;GAC/B,MAAM,QAAQ,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;GAEnE,MAAM,IAAI,eACR,sBAAsB,KAAK,mBAAmB,MAAM,uHAGpD,EAAE,OAAO,MAAM,CACjB;EACF;CAEJ;;;;;;CAOA,WAAkB,iBAA0B;EAC1C,OAAO,KAAK;CACd;;;;;;;;;;;;CAaA,OAAc,WAAW,UAAkC;EACzD,IAAI,KAAK,cAAc;GACrB,AAAK,KAAK,oBAAoB,QAAQ;GAEtC;EACF;EAEA,KAAK,kBAAkB,KAAK,QAAQ;CACtC;;;;;;;;;;CAWA,aAAoB,mBAAkC;EACpD,IAAI,KAAK,cACP;EAGF,KAAK,eAAe;EAEpB,MAAM,YAAY,KAAK,kBAAkB,QAAQ;EACjD,KAAK,oBAAoB,CAAC;EAE1B,KAAK,MAAM,YAAY,WACrB,MAAM,KAAK,oBAAoB,QAAQ;CAE3C;;;;;CAMA,aAAqB,oBAAoB,UAA2C;EAClF,IAAI;GACF,MAAM,SAAS;EACjB,SAAS,OAAO;GACd,IAAI,MAAM,eAAe,qBAAqB,KAAc;EAC9D;CACF;;;;CAKA,WAAkB,SAAiB;EACjC,OAAO,QAAQ,OAAO,IAAI;CAC5B;;;;CAKA,WAAkB,cAA2B;EAC3C,OAAO,YAAY;CACrB;;;;CAKA,OAAc,eAAe,KAAkB;EAC7C,eAAe,GAAG;CACpB;;;;CAKA,WAAkB,eAAwB;EACxC,OAAO,KAAK,gBAAgB;CAC9B;;;;CAKA,WAAkB,gBAAyB;EACzC,OAAO,KAAK,gBAAgB;CAC9B;;;;CAKA,WAAkB,SAAkB;EAClC,OAAO,KAAK,gBAAgB;CAC9B;;;;;;CAOA,WAAkB,QAA8B;EAC9C,OAAO,SAAS;CAClB;;;;;CAMA,WAAkB,QAAyC;EACzD,OAAO,SAAS;CAClB;;;;;;;;;CAUA,OAAc,QAAQ,MAAwB;EAC5C,OAAO,QAAQ,IAAI;CACrB;;;;CAKA,WAAkB,WAAmB;EACnC,OAAO,SAAS;CAClB;;;;CAKA,WAAkB,UAAkB;EAClC,OAAO,QAAQ;CACjB;;;;CAKA,WAAkB,UAAkB;EAClC,OAAO,QAAQ;CACjB;;;;CAKA,WAAkB,cAAsB;EACtC,OAAO,YAAY;CACrB;;;;CAKA,WAAkB,cAAsB;EACtC,OAAO,YAAY;CACrB;;;;CAKA,WAAkB,aAAqB;EACrC,OAAO,WAAW;CACpB;AACF"}
@@ -1,12 +1,11 @@
1
1
  import { Environment, RuntimeStrategy } from "../utils/environment.mjs";
2
-
3
2
  //#region ../../packages/core/src/application/boot-signal.d.ts
4
3
  /**
5
4
  * The only message type the boot channel carries today. Named rather than
6
5
  * inlined because both the sender (`sendBootSignal`) and the receiver
7
6
  * (`warlock start`) must agree on the exact literal.
8
7
  */
9
- type BootSignalType = "warlock:ready";
8
+ export type BootSignalType = "warlock:ready";
10
9
  /**
11
10
  * Schema version of {@link BootSignal}.
12
11
  *
@@ -14,7 +13,7 @@ type BootSignalType = "warlock:ready";
14
13
  * a shipped wire format without a flag day, and this one has to be able to
15
14
  * evolve while older CLIs are still supervising newer bundles.
16
15
  */
17
- declare const BOOT_SIGNAL_VERSION = 1;
16
+ export declare const BOOT_SIGNAL_VERSION = 1;
18
17
  /**
19
18
  * What a booted child process tells its supervising parent over the IPC
20
19
  * channel `warlock start` opens for it.
@@ -23,38 +22,42 @@ declare const BOOT_SIGNAL_VERSION = 1;
23
22
  * success banner **only** when this arrives, so anything watching that banner
24
23
  * (a CI gate, a process supervisor) transitively depends on it.
25
24
  */
26
- type BootSignal = {
25
+ export type BootSignal = {
27
26
  type: BootSignalType;
28
- version: number; /** The application process, so a supervisor can address it directly. */
29
- pid: number; /** When the boot completed, ISO-8601. */
27
+ version: number;
28
+ /** The application process, so a supervisor can address it directly. */
29
+ pid: number;
30
+ /** When the boot completed, ISO-8601. */
30
31
  at: string;
31
32
  environment: Environment;
32
33
  runtimeStrategy: RuntimeStrategy;
33
- bootDurationMs?: number; /** The bound http port, absent for an app with no http connector. */
34
- port?: number; /** The roles this process serves — see `Application.roles`. */
34
+ bootDurationMs?: number;
35
+ /** The bound http port, absent for an app with no http connector. */
36
+ port?: number;
37
+ /** The roles this process serves — see `Application.roles`. */
35
38
  roles: string[];
36
39
  };
37
40
  /**
38
41
  * Environment flag `warlock start` sets on the process it supervises.
39
42
  *
40
43
  * An IPC channel alone is NOT proof that the parent speaks this protocol —
41
- * pm2, a vitest worker fork, and any custom supervisor all hand their child a
44
+ * a vitest worker fork or a custom supervisor may hand their child a
42
45
  * channel they use for their own messages. Writing to one of those, and then
43
46
  * closing it, corrupts someone else's protocol and can kill the process. The
44
47
  * flag is the handshake: only a parent that set it gets signalled.
45
48
  */
46
- declare const BOOT_SIGNAL_ENV_KEY = "WARLOCK_BOOT_SIGNAL";
49
+ export declare const BOOT_SIGNAL_ENV_KEY = "WARLOCK_BOOT_SIGNAL";
47
50
  /**
48
51
  * Report a completed boot to the parent process, if one is supervising.
49
52
  *
50
- * Two conditions must both hold: the process was spawned with an `ipc` stdio
51
- * channel (`process.send` exists), and the parent identified itself with
52
- * {@link BOOT_SIGNAL_ENV_KEY}. A bundle run directly (`node app.mjs`, a Docker
53
- * `CMD`) or under a foreign supervisor is a no-op, so the signal never changes
54
- * how a standalone process behaves and never touches a channel we don't own.
53
+ * The versioned signal requires an IPC channel (`process.send` exists) and
54
+ * the parent's {@link BOOT_SIGNAL_ENV_KEY} handshake. With IPC and `pm_id`,
55
+ * PM2 instead receives its documented `"ready"` message and keeps its channel
56
+ * open for logs and worker coordination.
57
+ * Standalone bundles and unrecognized supervisors remain silent.
55
58
  *
56
- * The channel is closed as soon as the message is flushed. An open IPC channel
57
- * holds a `ref` on the child's event loop, which would keep a finished or
59
+ * The `warlock start` channel is closed as soon as its message is flushed.
60
+ * An open IPC channel holds a `ref` on the child's event loop, keeping a finished or
58
61
  * wedged process alive and indistinguishable from a healthy server — the exact
59
62
  * confusion this signal exists to remove. One message, then disconnect.
60
63
  *
@@ -62,7 +65,7 @@ declare const BOOT_SIGNAL_ENV_KEY = "WARLOCK_BOOT_SIGNAL";
62
65
  * detached or died, and a supervisor going away must never take down a
63
66
  * healthy application.
64
67
  */
65
- declare function sendBootSignal(signal: BootSignal): void;
68
+ export declare function sendBootSignal(signal: BootSignal): void;
66
69
  /**
67
70
  * Narrow an arbitrary IPC payload to a {@link BootSignal}.
68
71
  *
@@ -72,7 +75,6 @@ declare function sendBootSignal(signal: BootSignal): void;
72
75
  * accepted — readiness is readiness, and refusing it would make an old
73
76
  * supervisor report a healthy app as failed.
74
77
  */
75
- declare function isBootSignal(message: unknown): message is BootSignal;
78
+ export declare function isBootSignal(message: unknown): message is BootSignal;
76
79
  //#endregion
77
- export { BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, BootSignal, BootSignalType, isBootSignal, sendBootSignal };
78
80
  //# sourceMappingURL=boot-signal.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"boot-signal.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/boot-signal.ts"],"mappings":";;;;;AAOA;;;KAAY,cAAA;AAAc;AAS1B;;;;AAAgC;AAUhC;AAnB0B,cASb,mBAAA;;;;;;;;;KAUD,UAAA;EACV,IAAA,EAAM,cAAA;EACN,OAAA,UAKA;EAHA,GAAA,UAIA;EAFA,EAAA;EACA,WAAA,EAAa,WAAA;EACb,eAAA,EAAiB,eAAA;EACjB,cAAA,WAIK;EAFL,IAAA,WAcW;EAZX,KAAA;AAAA;;AAY8B;AAoBhC;;;;AAAiD;AA4BjD;;cAhDa,mBAAA;;;;;;AAgDwD;;;;;;;;;;;;;iBA5BrD,cAAA,CAAe,MAAkB,EAAV,UAAU;;;;;;;;;;iBA4BjC,YAAA,CAAa,OAAA,YAAmB,OAAA,IAAW,UAAU"}
1
+ {"version":3,"file":"boot-signal.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/boot-signal.ts"],"mappings":";;;;;;;YAOY;;;;;;;;qBASC;;;;;;;;;YAUD;EACV,MAAM;EACN;;EAEA;;EAEA;EACA,aAAa;EACb,iBAAiB;EACjB;;EAEA;;EAEA;;;;;;;;;;;qBAYW;;;;;;;;;;;;;;;;;;;wBAoBG,eAAe,QAAQ;;;;;;;;;;wBA2CvB,aAAa,mBAAmB,WAAW"}
@@ -11,7 +11,7 @@ const BOOT_SIGNAL_VERSION = 1;
11
11
  * Environment flag `warlock start` sets on the process it supervises.
12
12
  *
13
13
  * An IPC channel alone is NOT proof that the parent speaks this protocol —
14
- * pm2, a vitest worker fork, and any custom supervisor all hand their child a
14
+ * a vitest worker fork or a custom supervisor may hand their child a
15
15
  * channel they use for their own messages. Writing to one of those, and then
16
16
  * closing it, corrupts someone else's protocol and can kill the process. The
17
17
  * flag is the handshake: only a parent that set it gets signalled.
@@ -20,14 +20,14 @@ const BOOT_SIGNAL_ENV_KEY = "WARLOCK_BOOT_SIGNAL";
20
20
  /**
21
21
  * Report a completed boot to the parent process, if one is supervising.
22
22
  *
23
- * Two conditions must both hold: the process was spawned with an `ipc` stdio
24
- * channel (`process.send` exists), and the parent identified itself with
25
- * {@link BOOT_SIGNAL_ENV_KEY}. A bundle run directly (`node app.mjs`, a Docker
26
- * `CMD`) or under a foreign supervisor is a no-op, so the signal never changes
27
- * how a standalone process behaves and never touches a channel we don't own.
23
+ * The versioned signal requires an IPC channel (`process.send` exists) and
24
+ * the parent's {@link BOOT_SIGNAL_ENV_KEY} handshake. With IPC and `pm_id`,
25
+ * PM2 instead receives its documented `"ready"` message and keeps its channel
26
+ * open for logs and worker coordination.
27
+ * Standalone bundles and unrecognized supervisors remain silent.
28
28
  *
29
- * The channel is closed as soon as the message is flushed. An open IPC channel
30
- * holds a `ref` on the child's event loop, which would keep a finished or
29
+ * The `warlock start` channel is closed as soon as its message is flushed.
30
+ * An open IPC channel holds a `ref` on the child's event loop, keeping a finished or
31
31
  * wedged process alive and indistinguishable from a healthy server — the exact
32
32
  * confusion this signal exists to remove. One message, then disconnect.
33
33
  *
@@ -36,7 +36,13 @@ const BOOT_SIGNAL_ENV_KEY = "WARLOCK_BOOT_SIGNAL";
36
36
  * healthy application.
37
37
  */
38
38
  function sendBootSignal(signal) {
39
- if (typeof process.send !== "function" || process.env["WARLOCK_BOOT_SIGNAL"] !== "1") return;
39
+ if (typeof process.send !== "function") return;
40
+ if (process.env["WARLOCK_BOOT_SIGNAL"] !== "1") {
41
+ if (process.env.pm_id !== void 0) try {
42
+ process.send("ready", void 0, void 0, () => {});
43
+ } catch {}
44
+ return;
45
+ }
40
46
  delete process.env[BOOT_SIGNAL_ENV_KEY];
41
47
  try {
42
48
  process.send(signal, void 0, void 0, () => {
@@ -1 +1 @@
1
- {"version":3,"file":"boot-signal.mjs","names":[],"sources":["../../../../../../../../packages/core/src/application/boot-signal.ts"],"sourcesContent":["import type { Environment, RuntimeStrategy } from \"../utils/environment\";\n\n/**\n * The only message type the boot channel carries today. Named rather than\n * inlined because both the sender (`sendBootSignal`) and the receiver\n * (`warlock start`) must agree on the exact literal.\n */\nexport type BootSignalType = \"warlock:ready\";\n\n/**\n * Schema version of {@link BootSignal}.\n *\n * Present from the first release on purpose: a version field cannot be added to\n * a shipped wire format without a flag day, and this one has to be able to\n * evolve while older CLIs are still supervising newer bundles.\n */\nexport const BOOT_SIGNAL_VERSION = 1;\n\n/**\n * What a booted child process tells its supervising parent over the IPC\n * channel `warlock start` opens for it.\n *\n * This is a wire contract, not an internal detail: `warlock start` prints its\n * success banner **only** when this arrives, so anything watching that banner\n * (a CI gate, a process supervisor) transitively depends on it.\n */\nexport type BootSignal = {\n type: BootSignalType;\n version: number;\n /** The application process, so a supervisor can address it directly. */\n pid: number;\n /** When the boot completed, ISO-8601. */\n at: string;\n environment: Environment;\n runtimeStrategy: RuntimeStrategy;\n bootDurationMs?: number;\n /** The bound http port, absent for an app with no http connector. */\n port?: number;\n /** The roles this process serves — see `Application.roles`. */\n roles: string[];\n};\n\n/**\n * Environment flag `warlock start` sets on the process it supervises.\n *\n * An IPC channel alone is NOT proof that the parent speaks this protocol —\n * pm2, a vitest worker fork, and any custom supervisor all hand their child a\n * channel they use for their own messages. Writing to one of those, and then\n * closing it, corrupts someone else's protocol and can kill the process. The\n * flag is the handshake: only a parent that set it gets signalled.\n */\nexport const BOOT_SIGNAL_ENV_KEY = \"WARLOCK_BOOT_SIGNAL\";\n\n/**\n * Report a completed boot to the parent process, if one is supervising.\n *\n * Two conditions must both hold: the process was spawned with an `ipc` stdio\n * channel (`process.send` exists), and the parent identified itself with\n * {@link BOOT_SIGNAL_ENV_KEY}. A bundle run directly (`node app.mjs`, a Docker\n * `CMD`) or under a foreign supervisor is a no-op, so the signal never changes\n * how a standalone process behaves and never touches a channel we don't own.\n *\n * The channel is closed as soon as the message is flushed. An open IPC channel\n * holds a `ref` on the child's event loop, which would keep a finished or\n * wedged process alive and indistinguishable from a healthy server — the exact\n * confusion this signal exists to remove. One message, then disconnect.\n *\n * Failure to send is deliberately swallowed: the parent may have already\n * detached or died, and a supervisor going away must never take down a\n * healthy application.\n */\nexport function sendBootSignal(signal: BootSignal): void {\n if (typeof process.send !== \"function\" || process.env[BOOT_SIGNAL_ENV_KEY] !== \"1\") {\n return;\n }\n\n // Consumed here so it cannot be inherited by anything this app itself spawns\n // and make a grandchild report readiness on a channel meant for someone else.\n delete process.env[BOOT_SIGNAL_ENV_KEY];\n\n try {\n process.send(signal, undefined, undefined, () => {\n process.disconnect?.();\n });\n } catch {\n // The channel closed between the check and the write — the app is up\n // regardless, and there is no longer anyone to tell.\n }\n}\n\n/**\n * Narrow an arbitrary IPC payload to a {@link BootSignal}.\n *\n * The parent receives whatever the child chooses to send, so the message is\n * untrusted input and is validated before it is allowed to flip the parent's\n * \"the server is up\" state. A *newer* version than this CLI knows is still\n * accepted — readiness is readiness, and refusing it would make an old\n * supervisor report a healthy app as failed.\n */\nexport function isBootSignal(message: unknown): message is BootSignal {\n if (typeof message !== \"object\" || message === null) {\n return false;\n }\n\n const candidate = message as { type?: unknown; version?: unknown };\n\n return candidate.type === \"warlock:ready\" && typeof candidate.version === \"number\";\n}\n"],"mappings":";;;;;;;;AAgBA,MAAa,sBAAsB;;;;;;;;;;AAmCnC,MAAa,sBAAsB;;;;;;;;;;;;;;;;;;;AAoBnC,SAAgB,eAAe,QAA0B;CACvD,IAAI,OAAO,QAAQ,SAAS,cAAc,QAAQ,+BAA6B,KAC7E;CAKF,OAAO,QAAQ,IAAI;CAEnB,IAAI;EACF,QAAQ,KAAK,QAAQ,QAAW,cAAiB;GAC/C,QAAQ,aAAa;EACvB,CAAC;CACH,QAAQ,CAGR;AACF;;;;;;;;;;AAWA,SAAgB,aAAa,SAAyC;CACpE,IAAI,OAAO,YAAY,YAAY,YAAY,MAC7C,OAAO;CAGT,MAAM,YAAY;CAElB,OAAO,UAAU,SAAS,mBAAmB,OAAO,UAAU,YAAY;AAC5E"}
1
+ {"version":3,"file":"boot-signal.mjs","names":[],"sources":["../../../../../../../../packages/core/src/application/boot-signal.ts"],"sourcesContent":["import type { Environment, RuntimeStrategy } from \"../utils/environment\";\n\n/**\n * The only message type the boot channel carries today. Named rather than\n * inlined because both the sender (`sendBootSignal`) and the receiver\n * (`warlock start`) must agree on the exact literal.\n */\nexport type BootSignalType = \"warlock:ready\";\n\n/**\n * Schema version of {@link BootSignal}.\n *\n * Present from the first release on purpose: a version field cannot be added to\n * a shipped wire format without a flag day, and this one has to be able to\n * evolve while older CLIs are still supervising newer bundles.\n */\nexport const BOOT_SIGNAL_VERSION = 1;\n\n/**\n * What a booted child process tells its supervising parent over the IPC\n * channel `warlock start` opens for it.\n *\n * This is a wire contract, not an internal detail: `warlock start` prints its\n * success banner **only** when this arrives, so anything watching that banner\n * (a CI gate, a process supervisor) transitively depends on it.\n */\nexport type BootSignal = {\n type: BootSignalType;\n version: number;\n /** The application process, so a supervisor can address it directly. */\n pid: number;\n /** When the boot completed, ISO-8601. */\n at: string;\n environment: Environment;\n runtimeStrategy: RuntimeStrategy;\n bootDurationMs?: number;\n /** The bound http port, absent for an app with no http connector. */\n port?: number;\n /** The roles this process serves — see `Application.roles`. */\n roles: string[];\n};\n\n/**\n * Environment flag `warlock start` sets on the process it supervises.\n *\n * An IPC channel alone is NOT proof that the parent speaks this protocol —\n * a vitest worker fork or a custom supervisor may hand their child a\n * channel they use for their own messages. Writing to one of those, and then\n * closing it, corrupts someone else's protocol and can kill the process. The\n * flag is the handshake: only a parent that set it gets signalled.\n */\nexport const BOOT_SIGNAL_ENV_KEY = \"WARLOCK_BOOT_SIGNAL\";\n\n/**\n * Report a completed boot to the parent process, if one is supervising.\n *\n * The versioned signal requires an IPC channel (`process.send` exists) and\n * the parent's {@link BOOT_SIGNAL_ENV_KEY} handshake. With IPC and `pm_id`,\n * PM2 instead receives its documented `\"ready\"` message and keeps its channel\n * open for logs and worker coordination.\n * Standalone bundles and unrecognized supervisors remain silent.\n *\n * The `warlock start` channel is closed as soon as its message is flushed.\n * An open IPC channel holds a `ref` on the child's event loop, keeping a finished or\n * wedged process alive and indistinguishable from a healthy server — the exact\n * confusion this signal exists to remove. One message, then disconnect.\n *\n * Failure to send is deliberately swallowed: the parent may have already\n * detached or died, and a supervisor going away must never take down a\n * healthy application.\n */\nexport function sendBootSignal(signal: BootSignal): void {\n if (typeof process.send !== \"function\") {\n return;\n }\n\n // PM2 injects pm_id (including \"0\") in both fork and cluster mode. Its\n // ProcessContainer uses this channel for logs too: never disconnect it.\n // https://github.com/Unitech/pm2/blob/master/lib/ProcessContainer.js\n // https://pm2.keymetrics.io/docs/usage/signals-clean-restart/\n if (process.env[BOOT_SIGNAL_ENV_KEY] !== \"1\") {\n if (process.env.pm_id !== undefined) {\n try {\n process.send(\"ready\", undefined, undefined, () => {});\n } catch {\n // A detached supervisor must not take down an already booted app.\n }\n }\n return;\n }\n\n // Consumed here so it cannot be inherited by anything this app itself spawns\n // and make a grandchild report readiness on a channel meant for someone else.\n delete process.env[BOOT_SIGNAL_ENV_KEY];\n\n try {\n process.send(signal, undefined, undefined, () => {\n process.disconnect?.();\n });\n } catch {\n // The channel closed between the check and the write — the app is up\n // regardless, and there is no longer anyone to tell.\n }\n}\n\n/**\n * Narrow an arbitrary IPC payload to a {@link BootSignal}.\n *\n * The parent receives whatever the child chooses to send, so the message is\n * untrusted input and is validated before it is allowed to flip the parent's\n * \"the server is up\" state. A *newer* version than this CLI knows is still\n * accepted — readiness is readiness, and refusing it would make an old\n * supervisor report a healthy app as failed.\n */\nexport function isBootSignal(message: unknown): message is BootSignal {\n if (typeof message !== \"object\" || message === null) {\n return false;\n }\n\n const candidate = message as { type?: unknown; version?: unknown };\n\n return candidate.type === \"warlock:ready\" && typeof candidate.version === \"number\";\n}\n"],"mappings":";;;;;;;;AAgBA,MAAa,sBAAsB;;;;;;;;;;AAmCnC,MAAa,sBAAsB;;;;;;;;;;;;;;;;;;;AAoBnC,SAAgB,eAAe,QAA0B;CACvD,IAAI,OAAO,QAAQ,SAAS,YAC1B;CAOF,IAAI,QAAQ,+BAA6B,KAAK;EAC5C,IAAI,QAAQ,IAAI,UAAU,QACxB,IAAI;GACF,QAAQ,KAAK,SAAS,QAAW,cAAiB,CAAC,CAAC;EACtD,QAAQ,CAER;EAEF;CACF;CAIA,OAAO,QAAQ,IAAI;CAEnB,IAAI;EACF,QAAQ,KAAK,QAAQ,QAAW,cAAiB;GAC/C,QAAQ,aAAa;EACvB,CAAC;CACH,QAAQ,CAGR;AACF;;;;;;;;;;AAWA,SAAgB,aAAa,SAAyC;CACpE,IAAI,OAAO,YAAY,YAAY,YAAY,MAC7C,OAAO;CAGT,MAAM,YAAY;CAElB,OAAO,UAAU,SAAS,mBAAmB,OAAO,UAAU,YAAY;AAC5E"}
@@ -3,4 +3,5 @@ import { APP_ROLES, AppRole, assertSitesRequireWebRole, getRoles, getSites, hasR
3
3
  import { Application, BootContext, BootListener, BootValidator, ShutdownListener } from "./application.mjs";
4
4
  import { BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, BootSignal, BootSignalType, isBootSignal, sendBootSignal } from "./boot-signal.mjs";
5
5
  import { AppConfigurations } from "./application-config-types.mjs";
6
- import { getPublicUrl } from "./public-url.mjs";
6
+ import { getPublicUrl } from "./public-url.mjs";
7
+ export { APP_ROLES, AppConfigurations, AppRole, Application, BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, BootContext, BootListener, BootSignal, BootSignalType, BootValidator, ShutdownListener, app, assertSitesRequireWebRole, getPublicUrl, getRoles, getSites, hasRole, isBootSignal, parseRoles, parseSites, resetRolesCacheForTests, sendBootSignal, servesHttp };
@@ -4,4 +4,4 @@ import { Application } from "./application.mjs";
4
4
  import { app } from "./app.mjs";
5
5
  import { getPublicUrl } from "./public-url.mjs";
6
6
 
7
- export { };
7
+ export { APP_ROLES, Application, BOOT_SIGNAL_ENV_KEY, BOOT_SIGNAL_VERSION, app, assertSitesRequireWebRole, getPublicUrl, getRoles, getSites, hasRole, isBootSignal, parseRoles, parseSites, resetRolesCacheForTests, sendBootSignal, servesHttp };
@@ -14,7 +14,6 @@
14
14
  * value (e.g. the sitemap route, at boot) is responsible for failing loudly
15
15
  * itself, naming both `app.publicUrl` and `PUBLIC_APP_URL`.
16
16
  */
17
- declare function getPublicUrl(): string | undefined;
17
+ export declare function getPublicUrl(): string | undefined;
18
18
  //#endregion
19
- export { getPublicUrl };
20
19
  //# sourceMappingURL=public-url.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-url.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/public-url.ts"],"mappings":";;AAiBA;;;;AAA4B;;;;;;;;;;iBAAZ,YAAA"}
1
+ {"version":3,"file":"public-url.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/public-url.ts"],"mappings":";;;;;;;;;;;;;;;;wBAiBgB"}
@@ -4,12 +4,12 @@
4
4
  * `api` and `web` both bind the http port (§`servesHttp`); `worker` never
5
5
  * does — it exists to run queue workers, the scheduler and `worker.ts`.
6
6
  */
7
- declare const APP_ROLES: readonly ["api", "web", "worker"];
7
+ export declare const APP_ROLES: readonly ["api", "web", "worker"];
8
8
  /**
9
9
  * One of {@link APP_ROLES}. What `Application.hasRole` checks and what
10
10
  * `warlock start --role` accepts, comma-separated.
11
11
  */
12
- type AppRole = (typeof APP_ROLES)[number];
12
+ export type AppRole = (typeof APP_ROLES)[number];
13
13
  /**
14
14
  * Parse a `--role` / `WARLOCK_ROLES` value into the set of roles a process
15
15
  * should serve.
@@ -20,7 +20,7 @@ type AppRole = (typeof APP_ROLES)[number];
20
20
  * an entry that is not one of {@link APP_ROLES}, throws rather than silently
21
21
  * falling back to "every role", since that would mask a typo as full traffic.
22
22
  */
23
- declare function parseRoles(value: string | undefined): ReadonlySet<AppRole>;
23
+ export declare function parseRoles(value: string | undefined): ReadonlySet<AppRole>;
24
24
  /**
25
25
  * Parse a `--sites` / `WARLOCK_SITES` value into the set of site keys a
26
26
  * `web` process should install pages for.
@@ -31,34 +31,34 @@ declare function parseRoles(value: string | undefined): ReadonlySet<AppRole>;
31
31
  * passed. Cross-checking against the active roles and against `web.sites`
32
32
  * config happens where both are known, not here.
33
33
  */
34
- declare function parseSites(value: string | undefined): ReadonlySet<string> | undefined;
34
+ export declare function parseSites(value: string | undefined): ReadonlySet<string> | undefined;
35
35
  /**
36
36
  * `--sites` only makes sense alongside the `web` role — an `api`- or
37
37
  * `worker`-only process never installs pages, so a sites filter on it could
38
38
  * never do anything, and staying silent about that would hide a
39
39
  * misconfigured deploy.
40
40
  */
41
- declare function assertSitesRequireWebRole(roles: ReadonlySet<AppRole>, sites: ReadonlySet<string> | undefined): void;
41
+ export declare function assertSitesRequireWebRole(roles: ReadonlySet<AppRole>, sites: ReadonlySet<string> | undefined): void;
42
42
  /**
43
43
  * The roles this process serves. See {@link resolveRoles}.
44
44
  */
45
- declare function getRoles(): ReadonlySet<AppRole>;
45
+ export declare function getRoles(): ReadonlySet<AppRole>;
46
46
  /**
47
47
  * The sites this process installs pages for, or `undefined` for every site.
48
48
  * See {@link resolveSites}.
49
49
  */
50
- declare function getSites(): ReadonlySet<string> | undefined;
50
+ export declare function getSites(): ReadonlySet<string> | undefined;
51
51
  /**
52
52
  * Whether this process serves the given role.
53
53
  */
54
- declare function hasRole(role: AppRole): boolean;
54
+ export declare function hasRole(role: AppRole): boolean;
55
55
  /**
56
56
  * Whether this process should bind the http port — true when it serves
57
57
  * `api` or `web`, false for a `worker`-only process. Shared by the http
58
58
  * connector (skips `listen()`) and the production port preflight (skips the
59
59
  * probe), so both agree on the same condition.
60
60
  */
61
- declare function servesHttp(): boolean;
61
+ export declare function servesHttp(): boolean;
62
62
  /**
63
63
  * Drop the cached roles/sites so the next call to {@link getRoles} /
64
64
  * {@link getSites} re-reads `process.env`.
@@ -66,7 +66,6 @@ declare function servesHttp(): boolean;
66
66
  * @internal Test-only — production code resolves once per process on
67
67
  * purpose (see {@link resolveRoles}).
68
68
  */
69
- declare function resetRolesCacheForTests(): void;
69
+ export declare function resetRolesCacheForTests(): void;
70
70
  //#endregion
71
- export { APP_ROLES, AppRole, assertSitesRequireWebRole, getRoles, getSites, hasRole, parseRoles, parseSites, resetRolesCacheForTests, servesHttp };
72
71
  //# sourceMappingURL=roles.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"roles.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/roles.ts"],"mappings":";;AAKA;;;;cAAa,SAAA;AAMb;;;;AAAA,KAAY,OAAA,WAAkB,SAAS;AAcvC;;;;;;;;AAA0E;AAiC1E;AAjCA,iBAAgB,UAAA,CAAW,KAAA,uBAA4B,WAAW,CAAC,OAAA;;;AAiCD;AAuBlE;;;;;;;iBAvBgB,UAAA,CAAW,KAAA,uBAA4B,WAAW;;;;;;;iBAuBlD,yBAAA,CACd,KAAA,EAAO,WAAA,CAAY,OAAA,GACnB,KAAA,EAAO,WAAA;AA0CT;;;AAAA,iBAAgB,QAAA,IAAY,WAAW,CAAC,OAAA;AAAO;AAQ/C;;;AAR+C,iBAQ/B,QAAA,IAAY,WAAW;AAAA;AAOvC;;AAPuC,iBAOvB,OAAA,CAAQ,IAAa,EAAP,OAAO;;AAAA;AAUrC;;;;iBAAgB,UAAA;AAahB;;;;AAAuC;;;AAAvC,iBAAgB,uBAAA"}
1
+ {"version":3,"file":"roles.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/application/roles.ts"],"mappings":";;;;;;qBAKa;;;;;YAMD,kBAAkB;;;;;;;;;;;wBAcd,WAAW,4BAA4B,YAAY;;;;;;;;;;;wBAiCnD,WAAW,4BAA4B;;;;;;;wBAuBvC,0BACd,OAAO,YAAY,UACnB,OAAO;;;;wBA0CO,YAAY,YAAY;;;;;wBAQxB,YAAY;;;;wBAOZ,QAAQ,MAAM;;;;;;;wBAUd;;;;;;;;wBAaA"}
@@ -1,7 +1,6 @@
1
1
  import { BenchmarkErrorResult, BenchmarkSnapshotsOptions, BenchmarkSuccessResult } from "./types.mjs";
2
-
3
2
  //#region ../../packages/core/src/benchmark/benchmark-snapshots.d.ts
4
- declare class BenchmarkSnapshots {
3
+ export declare class BenchmarkSnapshots {
5
4
  private readonly maxSnapshots;
6
5
  private readonly capture;
7
6
  private readonly snapshots;
@@ -47,5 +46,4 @@ declare class BenchmarkSnapshots {
47
46
  reset(name?: string): void;
48
47
  }
49
48
  //#endregion
50
- export { BenchmarkSnapshots };
51
49
  //# sourceMappingURL=benchmark-snapshots.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"benchmark-snapshots.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/benchmark-snapshots.ts"],"mappings":";;;cAMa,kBAAA;EAAA,iBACM,YAAA;EAAA,iBACA,OAAA;EAAA,iBACA,SAAA;cAKE,OAAA,GAAU,yBAAA;EAAA;;;;;;;;;EActB,MAAA,CAAO,MAAA,EAAQ,sBAAA,YAAkC,oBAAA;EArBvC;;;;;;;;;EAgDV,YAAA,CAAa,IAAA,YAAgB,sBAAA,YAAkC,oBAAA;EAA/D;;;;;;;;EAYA,YAAA,IAAgB,MAAA,UAEpB,sBAAA,YAAkC,oBAAA;EAoBxB;;AAAa;;;;;;;EAAnB,KAAA,CAAM,IAAA;AAAA"}
1
+ {"version":3,"file":"benchmark-snapshots.d.mts","names":[],"sources":["../../../../../../../../packages/core/src/benchmark/benchmark-snapshots.ts"],"mappings":";;qBAMa;mBACM;mBACA;mBACA;EAKjB,YAAmB,UAAU;;;;;;;;;;EActB,OAAO,QAAQ,kCAAkC;;;;;;;;;;EA2BjD,aAAa,gBAAgB,kCAAkC;;;;;;;;;EAY/D,gBAAgB,gBAEpB,kCAAkC;;;;;;;;;;EAoB9B,MAAM"}