@fougere/core 0.6.0-alpha.0 → 0.8.0-alpha.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 (510) hide show
  1. package/README.md +1 -1
  2. package/dist/boot/AppLifecycle.d.ts +1 -1
  3. package/dist/boot/AppLifecycle.d.ts.map +1 -1
  4. package/dist/boot/AppLifecycle.js +13 -2
  5. package/dist/boot/AppLifecycle.js.map +1 -1
  6. package/dist/boot/Emissions.d.ts +13 -90
  7. package/dist/boot/Emissions.d.ts.map +1 -1
  8. package/dist/boot/Emissions.js +21 -118
  9. package/dist/boot/Emissions.js.map +1 -1
  10. package/dist/boot/ambient-port.d.ts +3 -24
  11. package/dist/boot/ambient-port.d.ts.map +1 -1
  12. package/dist/boot/ambient.als.d.ts.map +1 -1
  13. package/dist/boot/ambient.als.js +7 -12
  14. package/dist/boot/ambient.als.js.map +1 -1
  15. package/dist/boot/ambient.queue.d.ts +2 -5
  16. package/dist/boot/ambient.queue.d.ts.map +1 -1
  17. package/dist/boot/ambient.queue.js.map +1 -1
  18. package/dist/boot/apply.d.ts +1 -13
  19. package/dist/boot/apply.d.ts.map +1 -1
  20. package/dist/boot/apply.js +9 -16
  21. package/dist/boot/apply.js.map +1 -1
  22. package/dist/boot/auth.d.ts +2 -12
  23. package/dist/boot/auth.d.ts.map +1 -1
  24. package/dist/boot/boot.d.ts +3 -16
  25. package/dist/boot/boot.d.ts.map +1 -1
  26. package/dist/boot/boot.js +4 -11
  27. package/dist/boot/boot.js.map +1 -1
  28. package/dist/boot/bootstrap.d.ts.map +1 -1
  29. package/dist/boot/bootstrap.js +84 -130
  30. package/dist/boot/bootstrap.js.map +1 -1
  31. package/dist/boot/card.d.ts +1 -17
  32. package/dist/boot/card.d.ts.map +1 -1
  33. package/dist/boot/card.js +3 -32
  34. package/dist/boot/card.js.map +1 -1
  35. package/dist/boot/frame.d.ts +8 -32
  36. package/dist/boot/frame.d.ts.map +1 -1
  37. package/dist/boot/frame.js +17 -56
  38. package/dist/boot/frame.js.map +1 -1
  39. package/dist/boot/hosted.d.ts +2 -24
  40. package/dist/boot/hosted.d.ts.map +1 -1
  41. package/dist/boot/hosted.js +10 -15
  42. package/dist/boot/hosted.js.map +1 -1
  43. package/dist/boot/ownership.d.ts +3 -36
  44. package/dist/boot/ownership.d.ts.map +1 -1
  45. package/dist/boot/ownership.js +5 -40
  46. package/dist/boot/ownership.js.map +1 -1
  47. package/dist/boot/ports.d.ts +1 -14
  48. package/dist/boot/ports.d.ts.map +1 -1
  49. package/dist/boot/ports.js +1 -14
  50. package/dist/boot/ports.js.map +1 -1
  51. package/dist/boot/remote.d.ts +5 -38
  52. package/dist/boot/remote.d.ts.map +1 -1
  53. package/dist/boot/remote.js +8 -41
  54. package/dist/boot/remote.js.map +1 -1
  55. package/dist/boot/runner.d.ts +4 -21
  56. package/dist/boot/runner.d.ts.map +1 -1
  57. package/dist/boot/runner.js +4 -17
  58. package/dist/boot/runner.js.map +1 -1
  59. package/dist/boot/seed.d.ts +4 -31
  60. package/dist/boot/seed.d.ts.map +1 -1
  61. package/dist/boot/seed.js +6 -37
  62. package/dist/boot/seed.js.map +1 -1
  63. package/dist/boot/statement-drift.d.ts +2 -21
  64. package/dist/boot/statement-drift.d.ts.map +1 -1
  65. package/dist/boot/statement-drift.js +4 -9
  66. package/dist/boot/statement-drift.js.map +1 -1
  67. package/dist/boot/together.d.ts +4 -8
  68. package/dist/boot/together.d.ts.map +1 -1
  69. package/dist/boot/together.js +15 -50
  70. package/dist/boot/together.js.map +1 -1
  71. package/dist/boot/types.d.ts +31 -173
  72. package/dist/boot/types.d.ts.map +1 -1
  73. package/dist/builtin/config.d.ts +7 -0
  74. package/dist/builtin/config.d.ts.map +1 -0
  75. package/dist/builtin/config.js +15 -0
  76. package/dist/builtin/config.js.map +1 -0
  77. package/dist/{builtins → builtin}/logger.d.ts +4 -25
  78. package/dist/builtin/logger.d.ts.map +1 -0
  79. package/dist/{builtins → builtin}/logger.js +5 -32
  80. package/dist/builtin/logger.js.map +1 -0
  81. package/dist/config-loader.d.ts +9 -67
  82. package/dist/config-loader.d.ts.map +1 -1
  83. package/dist/config-loader.js +5 -18
  84. package/dist/config-loader.js.map +1 -1
  85. package/dist/contract.d.ts +15 -31
  86. package/dist/contract.d.ts.map +1 -1
  87. package/dist/contract.js +13 -26
  88. package/dist/contract.js.map +1 -1
  89. package/dist/criterion.d.ts +37 -0
  90. package/dist/criterion.d.ts.map +1 -0
  91. package/dist/criterion.js +28 -0
  92. package/dist/criterion.js.map +1 -0
  93. package/dist/crypto/encoding.d.ts +2 -15
  94. package/dist/crypto/encoding.d.ts.map +1 -1
  95. package/dist/crypto/encoding.js +2 -15
  96. package/dist/crypto/encoding.js.map +1 -1
  97. package/dist/crypto/node.d.ts.map +1 -1
  98. package/dist/crypto/node.js +1 -7
  99. package/dist/crypto/node.js.map +1 -1
  100. package/dist/crypto/port.d.ts +2 -18
  101. package/dist/crypto/port.d.ts.map +1 -1
  102. package/dist/crypto/port.js +1 -17
  103. package/dist/crypto/port.js.map +1 -1
  104. package/dist/crypto/webcrypto.d.ts.map +1 -1
  105. package/dist/crypto/webcrypto.js +1 -12
  106. package/dist/crypto/webcrypto.js.map +1 -1
  107. package/dist/declare.d.ts +19 -37
  108. package/dist/declare.d.ts.map +1 -1
  109. package/dist/declare.js +23 -30
  110. package/dist/declare.js.map +1 -1
  111. package/dist/define.d.ts +2 -3
  112. package/dist/define.d.ts.map +1 -1
  113. package/dist/define.js +2 -3
  114. package/dist/define.js.map +1 -1
  115. package/dist/descriptor/Fronds.d.ts +3 -28
  116. package/dist/descriptor/Fronds.d.ts.map +1 -1
  117. package/dist/descriptor/Fronds.js +6 -31
  118. package/dist/descriptor/Fronds.js.map +1 -1
  119. package/dist/descriptor/frond.d.ts +25 -60
  120. package/dist/descriptor/frond.d.ts.map +1 -1
  121. package/dist/descriptor/frond.js +5 -1
  122. package/dist/descriptor/frond.js.map +1 -1
  123. package/dist/dispatch/ArgumentResolver.d.ts +1 -1
  124. package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
  125. package/dist/dispatch/ArgumentResolver.js +5 -5
  126. package/dist/dispatch/ArgumentResolver.js.map +1 -1
  127. package/dist/dispatch/DispatchEvent.d.ts +2 -2
  128. package/dist/dispatch/DispatchEvent.d.ts.map +1 -1
  129. package/dist/dispatch/DispatchLifecycle.d.ts +1 -7
  130. package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -1
  131. package/dist/dispatch/DispatchLifecycle.js +1 -7
  132. package/dist/dispatch/DispatchLifecycle.js.map +1 -1
  133. package/dist/dispatch/DispatchPort.d.ts +1 -1
  134. package/dist/dispatch/DispatchPort.d.ts.map +1 -1
  135. package/dist/dispatch/Dispatcher.d.ts +1 -1
  136. package/dist/dispatch/Dispatcher.d.ts.map +1 -1
  137. package/dist/dispatch/Dispatcher.js +2 -2
  138. package/dist/dispatch/Dispatcher.js.map +1 -1
  139. package/dist/{boot → dispatch}/HandlerFacade.d.ts +25 -38
  140. package/dist/dispatch/HandlerFacade.d.ts.map +1 -0
  141. package/dist/{boot → dispatch}/HandlerFacade.js +65 -74
  142. package/dist/dispatch/HandlerFacade.js.map +1 -0
  143. package/dist/dispatch/LocalRoutePolicy.d.ts +1 -1
  144. package/dist/dispatch/LocalRoutePolicy.d.ts.map +1 -1
  145. package/dist/dispatch/LocalRoutePolicy.js +4 -4
  146. package/dist/dispatch/LocalRoutePolicy.js.map +1 -1
  147. package/dist/dispatch/OperationRoute.d.ts +2 -2
  148. package/dist/dispatch/OperationRoute.d.ts.map +1 -1
  149. package/dist/dispatch/OutputView.d.ts +3 -2
  150. package/dist/dispatch/OutputView.d.ts.map +1 -1
  151. package/dist/dispatch/OutputView.js +19 -1
  152. package/dist/dispatch/OutputView.js.map +1 -1
  153. package/dist/dispatch/Route.d.ts +2 -2
  154. package/dist/dispatch/Route.d.ts.map +1 -1
  155. package/dist/dispatch/RoutePolicy.d.ts +1 -1
  156. package/dist/dispatch/RoutePolicy.d.ts.map +1 -1
  157. package/dist/dispatch/RouteRegistry.d.ts +1 -1
  158. package/dist/dispatch/RouteRegistry.d.ts.map +1 -1
  159. package/dist/dispatch/RouteRegistry.js +2 -2
  160. package/dist/dispatch/RouteRegistry.js.map +1 -1
  161. package/dist/dispatch/RouteResolver.d.ts +2 -4
  162. package/dist/dispatch/RouteResolver.d.ts.map +1 -1
  163. package/dist/dispatch/StorageGuard.d.ts +40 -8
  164. package/dist/dispatch/StorageGuard.d.ts.map +1 -1
  165. package/dist/dispatch/StorageGuard.js +151 -20
  166. package/dist/dispatch/StorageGuard.js.map +1 -1
  167. package/dist/dispatch/presenterArguments.d.ts +7 -0
  168. package/dist/dispatch/presenterArguments.d.ts.map +1 -0
  169. package/dist/dispatch/presenterArguments.js +12 -0
  170. package/dist/dispatch/presenterArguments.js.map +1 -0
  171. package/dist/dispatch/remoteRoutes.d.ts +7 -0
  172. package/dist/dispatch/remoteRoutes.d.ts.map +1 -0
  173. package/dist/dispatch/{RemoteRouteResolver.js → remoteRoutes.js} +6 -10
  174. package/dist/dispatch/remoteRoutes.js.map +1 -0
  175. package/dist/dispatch/routeNotFound.d.ts +9 -0
  176. package/dist/dispatch/routeNotFound.d.ts.map +1 -0
  177. package/dist/dispatch/routeNotFound.js +21 -0
  178. package/dist/dispatch/routeNotFound.js.map +1 -0
  179. package/dist/dispatch/validateInput.d.ts +5 -0
  180. package/dist/dispatch/validateInput.d.ts.map +1 -0
  181. package/dist/dispatch/validateInput.js +20 -0
  182. package/dist/dispatch/validateInput.js.map +1 -0
  183. package/dist/effective-operation.d.ts +1 -24
  184. package/dist/effective-operation.d.ts.map +1 -1
  185. package/dist/effective-operation.js +21 -50
  186. package/dist/effective-operation.js.map +1 -1
  187. package/dist/emit.d.ts +4 -42
  188. package/dist/emit.d.ts.map +1 -1
  189. package/dist/emit.js +3 -39
  190. package/dist/emit.js.map +1 -1
  191. package/dist/entry/facade.d.ts +8 -0
  192. package/dist/entry/facade.d.ts.map +1 -0
  193. package/dist/entry/facade.js +28 -0
  194. package/dist/entry/facade.js.map +1 -0
  195. package/dist/entry/transport.d.ts +5 -0
  196. package/dist/entry/transport.d.ts.map +1 -0
  197. package/dist/entry/transport.js +11 -0
  198. package/dist/entry/transport.js.map +1 -0
  199. package/dist/frond-config.d.ts +7 -70
  200. package/dist/frond-config.d.ts.map +1 -1
  201. package/dist/frond-config.js +1 -9
  202. package/dist/frond-config.js.map +1 -1
  203. package/dist/identity-keys.d.ts +2 -5
  204. package/dist/identity-keys.d.ts.map +1 -1
  205. package/dist/identity-keys.js +3 -16
  206. package/dist/identity-keys.js.map +1 -1
  207. package/dist/identity.d.ts +4 -30
  208. package/dist/identity.d.ts.map +1 -1
  209. package/dist/identity.js +11 -73
  210. package/dist/identity.js.map +1 -1
  211. package/dist/imports.d.ts +1 -7
  212. package/dist/imports.d.ts.map +1 -1
  213. package/dist/imports.js +1 -7
  214. package/dist/imports.js.map +1 -1
  215. package/dist/index.d.ts +17 -24
  216. package/dist/index.d.ts.map +1 -1
  217. package/dist/index.js +10 -18
  218. package/dist/index.js.map +1 -1
  219. package/dist/loader.d.ts +1 -8
  220. package/dist/loader.d.ts.map +1 -1
  221. package/dist/loader.js +1 -8
  222. package/dist/loader.js.map +1 -1
  223. package/dist/node.d.ts +2 -11
  224. package/dist/node.d.ts.map +1 -1
  225. package/dist/node.js +2 -11
  226. package/dist/node.js.map +1 -1
  227. package/dist/prefab/collector.d.ts +1 -22
  228. package/dist/prefab/collector.d.ts.map +1 -1
  229. package/dist/prefab/collector.js +1 -22
  230. package/dist/prefab/collector.js.map +1 -1
  231. package/dist/prefab/crud.d.ts +16 -32
  232. package/dist/prefab/crud.d.ts.map +1 -1
  233. package/dist/prefab/crud.js +31 -58
  234. package/dist/prefab/crud.js.map +1 -1
  235. package/dist/prefab/mirror.d.ts +2 -24
  236. package/dist/prefab/mirror.d.ts.map +1 -1
  237. package/dist/prefab/mirror.js +2 -20
  238. package/dist/prefab/mirror.js.map +1 -1
  239. package/dist/prefab/prefab.d.ts +1 -7
  240. package/dist/prefab/prefab.d.ts.map +1 -1
  241. package/dist/prefab/prefab.js +1 -7
  242. package/dist/prefab/prefab.js.map +1 -1
  243. package/dist/prefab/presenter.d.ts +2 -36
  244. package/dist/prefab/presenter.d.ts.map +1 -1
  245. package/dist/prefab/presenter.js +2 -36
  246. package/dist/prefab/presenter.js.map +1 -1
  247. package/dist/prefab/repository.d.ts +5 -73
  248. package/dist/prefab/repository.d.ts.map +1 -1
  249. package/dist/prefab/repository.js +3 -16
  250. package/dist/prefab/repository.js.map +1 -1
  251. package/dist/scan/adapters.d.ts +3 -0
  252. package/dist/scan/adapters.d.ts.map +1 -0
  253. package/dist/scan/adapters.js +25 -0
  254. package/dist/scan/adapters.js.map +1 -0
  255. package/dist/scan/bundling.d.ts +1 -12
  256. package/dist/scan/bundling.d.ts.map +1 -1
  257. package/dist/scan/bundling.js +1 -12
  258. package/dist/scan/bundling.js.map +1 -1
  259. package/dist/scan/contract.d.ts +27 -0
  260. package/dist/scan/contract.d.ts.map +1 -0
  261. package/dist/scan/contract.js +46 -0
  262. package/dist/scan/contract.js.map +1 -0
  263. package/dist/scan/conventions.d.ts +6 -40
  264. package/dist/scan/conventions.d.ts.map +1 -1
  265. package/dist/scan/conventions.js +5 -34
  266. package/dist/scan/conventions.js.map +1 -1
  267. package/dist/scan/emit.d.ts +1 -5
  268. package/dist/scan/emit.d.ts.map +1 -1
  269. package/dist/scan/emit.js +10 -78
  270. package/dist/scan/emit.js.map +1 -1
  271. package/dist/scan/handler-parser.d.ts +4 -26
  272. package/dist/scan/handler-parser.d.ts.map +1 -1
  273. package/dist/scan/handler-parser.js +26 -83
  274. package/dist/scan/handler-parser.js.map +1 -1
  275. package/dist/scan/result.d.ts +3 -16
  276. package/dist/scan/result.d.ts.map +1 -1
  277. package/dist/scan/scanner.d.ts +2 -27
  278. package/dist/scan/scanner.d.ts.map +1 -1
  279. package/dist/scan/scanner.js +45 -133
  280. package/dist/scan/scanner.js.map +1 -1
  281. package/dist/scan/statement.d.ts.map +1 -1
  282. package/dist/scan/statement.js +60 -37
  283. package/dist/scan/statement.js.map +1 -1
  284. package/dist/source.d.ts +53 -0
  285. package/dist/source.d.ts.map +1 -0
  286. package/dist/source.js +18 -0
  287. package/dist/source.js.map +1 -0
  288. package/dist/storage.d.ts +13 -210
  289. package/dist/storage.d.ts.map +1 -1
  290. package/dist/storage.js +4 -68
  291. package/dist/storage.js.map +1 -1
  292. package/dist/store.d.ts +18 -0
  293. package/dist/store.d.ts.map +1 -0
  294. package/dist/store.js +179 -0
  295. package/dist/store.js.map +1 -0
  296. package/dist/verify.d.ts +5 -38
  297. package/dist/verify.d.ts.map +1 -1
  298. package/dist/verify.js +17 -37
  299. package/dist/verify.js.map +1 -1
  300. package/dist/wire/CallLog.d.ts +32 -0
  301. package/dist/wire/CallLog.d.ts.map +1 -0
  302. package/dist/{contract → wire}/CallLog.js.map +1 -1
  303. package/dist/wire/Invocation.d.ts +32 -0
  304. package/dist/wire/Invocation.d.ts.map +1 -0
  305. package/dist/wire/Invocation.js +66 -0
  306. package/dist/wire/Invocation.js.map +1 -0
  307. package/dist/{contract → wire}/RouteAddress.d.ts +5 -0
  308. package/dist/wire/RouteAddress.d.ts.map +1 -0
  309. package/dist/{contract → wire}/RouteAddress.js +7 -0
  310. package/dist/wire/RouteAddress.js.map +1 -0
  311. package/dist/wire/binding.d.ts +5 -21
  312. package/dist/wire/binding.d.ts.map +1 -1
  313. package/dist/wire/binding.js +5 -10
  314. package/dist/wire/binding.js.map +1 -1
  315. package/dist/wire/call.d.ts +24 -133
  316. package/dist/wire/call.d.ts.map +1 -1
  317. package/dist/wire/call.js +15 -41
  318. package/dist/wire/call.js.map +1 -1
  319. package/dist/wire/drift.d.ts +3 -28
  320. package/dist/wire/drift.d.ts.map +1 -1
  321. package/dist/wire/drift.js +4 -23
  322. package/dist/wire/drift.js.map +1 -1
  323. package/dist/wire/errors.d.ts +4 -24
  324. package/dist/wire/errors.d.ts.map +1 -1
  325. package/dist/wire/errors.js +4 -24
  326. package/dist/wire/errors.js.map +1 -1
  327. package/dist/wire/http-error.d.ts +2 -13
  328. package/dist/wire/http-error.d.ts.map +1 -1
  329. package/dist/wire/http-error.js +5 -19
  330. package/dist/wire/http-error.js.map +1 -1
  331. package/dist/wire/loggerMiddleware.d.ts +2 -8
  332. package/dist/wire/loggerMiddleware.d.ts.map +1 -1
  333. package/dist/wire/loggerMiddleware.js +1 -7
  334. package/dist/wire/loggerMiddleware.js.map +1 -1
  335. package/dist/wire/middleware.d.ts +3 -7
  336. package/dist/wire/middleware.d.ts.map +1 -1
  337. package/dist/wire/middleware.js +1 -5
  338. package/dist/wire/middleware.js.map +1 -1
  339. package/dist/wire/operation.d.ts +7 -43
  340. package/dist/wire/operation.d.ts.map +1 -1
  341. package/dist/wire/operation.js +4 -15
  342. package/dist/wire/operation.js.map +1 -1
  343. package/dist/wire/signature.d.ts +4 -25
  344. package/dist/wire/signature.d.ts.map +1 -1
  345. package/package.json +3 -3
  346. package/src/boot/AppLifecycle.ts +15 -2
  347. package/src/boot/Emissions.ts +21 -118
  348. package/src/boot/ambient-port.ts +3 -24
  349. package/src/boot/ambient.als.ts +7 -12
  350. package/src/boot/ambient.queue.ts +2 -5
  351. package/src/boot/apply.ts +9 -16
  352. package/src/boot/auth.ts +2 -12
  353. package/src/boot/boot.ts +6 -21
  354. package/src/boot/bootstrap.ts +95 -140
  355. package/src/boot/card.ts +4 -33
  356. package/src/boot/frame.ts +24 -64
  357. package/src/boot/hosted.ts +12 -34
  358. package/src/boot/ownership.ts +5 -39
  359. package/src/boot/ports.ts +1 -14
  360. package/src/boot/remote.ts +11 -58
  361. package/src/boot/runner.ts +5 -22
  362. package/src/boot/seed.ts +6 -37
  363. package/src/boot/statement-drift.ts +5 -24
  364. package/src/boot/together.ts +18 -51
  365. package/src/boot/types.ts +31 -173
  366. package/src/{builtins → builtin}/config.ts +1 -7
  367. package/src/{builtins → builtin}/logger.ts +6 -39
  368. package/src/config-loader.ts +12 -71
  369. package/src/contract.ts +19 -39
  370. package/src/criterion.ts +54 -0
  371. package/src/crypto/encoding.ts +2 -15
  372. package/src/crypto/node.ts +1 -7
  373. package/src/crypto/port.ts +2 -18
  374. package/src/crypto/webcrypto.ts +1 -12
  375. package/src/declare.ts +42 -41
  376. package/src/define.ts +2 -3
  377. package/src/descriptor/Fronds.ts +6 -31
  378. package/src/descriptor/frond.ts +26 -60
  379. package/src/dispatch/ArgumentResolver.ts +6 -6
  380. package/src/dispatch/DispatchEvent.ts +2 -2
  381. package/src/dispatch/DispatchLifecycle.ts +1 -7
  382. package/src/dispatch/DispatchPort.ts +1 -1
  383. package/src/dispatch/Dispatcher.ts +3 -3
  384. package/src/dispatch/HandlerFacade.ts +231 -0
  385. package/src/dispatch/LocalRoutePolicy.ts +4 -4
  386. package/src/dispatch/OperationRoute.ts +2 -2
  387. package/src/dispatch/OutputView.ts +24 -2
  388. package/src/dispatch/Route.ts +2 -2
  389. package/src/dispatch/RoutePolicy.ts +1 -1
  390. package/src/dispatch/RouteRegistry.ts +2 -2
  391. package/src/dispatch/RouteResolver.ts +2 -4
  392. package/src/dispatch/StorageGuard.ts +175 -19
  393. package/src/dispatch/presenterArguments.ts +25 -0
  394. package/src/dispatch/{RemoteRouteResolver.ts → remoteRoutes.ts} +7 -9
  395. package/src/dispatch/routeNotFound.ts +33 -0
  396. package/src/dispatch/validateInput.ts +28 -0
  397. package/src/effective-operation.ts +21 -50
  398. package/src/emit.ts +5 -63
  399. package/src/entry/facade.ts +44 -0
  400. package/src/entry/transport.ts +16 -0
  401. package/src/frond-config.ts +7 -70
  402. package/src/identity-keys.ts +3 -16
  403. package/src/identity.ts +12 -80
  404. package/src/imports.ts +2 -31
  405. package/src/index.ts +17 -24
  406. package/src/loader.ts +2 -16
  407. package/src/node.ts +2 -11
  408. package/src/prefab/collector.ts +1 -22
  409. package/src/prefab/crud.ts +37 -76
  410. package/src/prefab/mirror.ts +4 -44
  411. package/src/prefab/prefab.ts +2 -21
  412. package/src/prefab/presenter.ts +2 -36
  413. package/src/prefab/repository.ts +7 -83
  414. package/src/scan/adapters.ts +32 -0
  415. package/src/scan/bundling.ts +1 -12
  416. package/src/scan/contract.ts +80 -0
  417. package/src/scan/conventions.ts +6 -40
  418. package/src/scan/emit.ts +11 -80
  419. package/src/scan/handler-parser.ts +27 -96
  420. package/src/scan/result.ts +3 -16
  421. package/src/scan/scanner.ts +46 -132
  422. package/src/scan/statement.ts +73 -41
  423. package/src/source.ts +63 -0
  424. package/src/storage.ts +14 -234
  425. package/src/store.ts +191 -0
  426. package/src/verify.ts +16 -57
  427. package/src/wire/CallLog.ts +30 -0
  428. package/src/{contract → wire}/Invocation.ts +24 -17
  429. package/src/{contract → wire}/RouteAddress.ts +7 -0
  430. package/src/wire/binding.ts +9 -25
  431. package/src/wire/call.ts +30 -133
  432. package/src/wire/drift.ts +5 -30
  433. package/src/wire/errors.ts +4 -24
  434. package/src/wire/http-error.ts +5 -19
  435. package/src/wire/loggerMiddleware.ts +2 -8
  436. package/src/wire/middleware.ts +3 -7
  437. package/src/wire/operation.ts +8 -48
  438. package/src/wire/signature.ts +4 -25
  439. package/dist/boot/HandlerFacade.d.ts.map +0 -1
  440. package/dist/boot/HandlerFacade.js.map +0 -1
  441. package/dist/builtins/config.d.ts +0 -13
  442. package/dist/builtins/config.d.ts.map +0 -1
  443. package/dist/builtins/config.js +0 -21
  444. package/dist/builtins/config.js.map +0 -1
  445. package/dist/builtins/logger.d.ts.map +0 -1
  446. package/dist/builtins/logger.js.map +0 -1
  447. package/dist/contract/Call.d.ts +0 -10
  448. package/dist/contract/Call.d.ts.map +0 -1
  449. package/dist/contract/Call.js +0 -15
  450. package/dist/contract/Call.js.map +0 -1
  451. package/dist/contract/CallLog.d.ts +0 -57
  452. package/dist/contract/CallLog.d.ts.map +0 -1
  453. package/dist/contract/Invocation.d.ts +0 -27
  454. package/dist/contract/Invocation.d.ts.map +0 -1
  455. package/dist/contract/Invocation.js +0 -59
  456. package/dist/contract/Invocation.js.map +0 -1
  457. package/dist/contract/RouteAddress.d.ts.map +0 -1
  458. package/dist/contract/RouteAddress.js.map +0 -1
  459. package/dist/dispatch/InputValidator.d.ts +0 -7
  460. package/dist/dispatch/InputValidator.d.ts.map +0 -1
  461. package/dist/dispatch/InputValidator.js +0 -22
  462. package/dist/dispatch/InputValidator.js.map +0 -1
  463. package/dist/dispatch/OperationExecutor.d.ts +0 -25
  464. package/dist/dispatch/OperationExecutor.d.ts.map +0 -1
  465. package/dist/dispatch/OperationExecutor.js +0 -32
  466. package/dist/dispatch/OperationExecutor.js.map +0 -1
  467. package/dist/dispatch/OutputProjector.d.ts +0 -12
  468. package/dist/dispatch/OutputProjector.d.ts.map +0 -1
  469. package/dist/dispatch/OutputProjector.js +0 -30
  470. package/dist/dispatch/OutputProjector.js.map +0 -1
  471. package/dist/dispatch/PresenterArgumentResolver.d.ts +0 -12
  472. package/dist/dispatch/PresenterArgumentResolver.d.ts.map +0 -1
  473. package/dist/dispatch/PresenterArgumentResolver.js +0 -20
  474. package/dist/dispatch/PresenterArgumentResolver.js.map +0 -1
  475. package/dist/dispatch/RemoteRouteResolver.d.ts +0 -13
  476. package/dist/dispatch/RemoteRouteResolver.d.ts.map +0 -1
  477. package/dist/dispatch/RemoteRouteResolver.js.map +0 -1
  478. package/dist/dispatch/RouteNotFoundError.d.ts +0 -10
  479. package/dist/dispatch/RouteNotFoundError.d.ts.map +0 -1
  480. package/dist/dispatch/RouteNotFoundError.js +0 -24
  481. package/dist/dispatch/RouteNotFoundError.js.map +0 -1
  482. package/dist/entry/DynamicFacade.d.ts +0 -10
  483. package/dist/entry/DynamicFacade.d.ts.map +0 -1
  484. package/dist/entry/DynamicFacade.js +0 -27
  485. package/dist/entry/DynamicFacade.js.map +0 -1
  486. package/dist/entry/FacadeEntry.d.ts +0 -11
  487. package/dist/entry/FacadeEntry.d.ts.map +0 -1
  488. package/dist/entry/FacadeEntry.js +0 -26
  489. package/dist/entry/FacadeEntry.js.map +0 -1
  490. package/dist/entry/TransportEntry.d.ts +0 -13
  491. package/dist/entry/TransportEntry.d.ts.map +0 -1
  492. package/dist/entry/TransportEntry.js +0 -24
  493. package/dist/entry/TransportEntry.js.map +0 -1
  494. package/dist/rows.d.ts +0 -40
  495. package/dist/rows.d.ts.map +0 -1
  496. package/dist/rows.js +0 -146
  497. package/dist/rows.js.map +0 -1
  498. package/src/boot/HandlerFacade.ts +0 -242
  499. package/src/contract/Call.ts +0 -18
  500. package/src/contract/CallLog.ts +0 -55
  501. package/src/dispatch/InputValidator.ts +0 -28
  502. package/src/dispatch/OperationExecutor.ts +0 -60
  503. package/src/dispatch/OutputProjector.ts +0 -32
  504. package/src/dispatch/PresenterArgumentResolver.ts +0 -25
  505. package/src/dispatch/RouteNotFoundError.ts +0 -29
  506. package/src/entry/DynamicFacade.ts +0 -28
  507. package/src/entry/FacadeEntry.ts +0 -32
  508. package/src/entry/TransportEntry.ts +0 -30
  509. package/src/rows.ts +0 -155
  510. /package/dist/{contract → wire}/CallLog.js +0 -0
package/README.md CHANGED
@@ -4,7 +4,7 @@ A frond call is a **value**: `(entity, op, invocation)`. `createLocalRunner` exe
4
4
  strictly locally; `createAppRunner` follows the topology (local façades, remote
5
5
  stand-ins). Transports move the value — they never reshape it.
6
6
 
7
- The façade judges the input, projects the output, and exposes only what a contract
7
+ The façade validates the input, projects the output, and exposes only what a contract
8
8
  declares. It also canonicalizes optional input before binding: omission is `undefined`,
9
9
  JSON may omit its property, and an explicit `null` is never rewritten.
10
10
 
@@ -14,5 +14,5 @@ export declare class AppLifecycle {
14
14
  down(app: App): Promise<void>;
15
15
  }
16
16
  /** The replaceable migration slot of the application lifecycle. */
17
- export declare function migrating(migrate?: Extension['up']): Extension;
17
+ export declare function migrating(migrate?: (app: App) => void | string | Promise<void | string>, report?: (message: string) => void): Extension;
18
18
  //# sourceMappingURL=AppLifecycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppLifecycle.d.ts","sourceRoot":"","sources":["../../src/boot/AppLifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,gEAAgE;AAChE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED,yEAAyE;AACzE,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAE3C,GAAG,CAAC,GAAG,UAAU,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,EAAE,GAAG,IAAI;IAU5D,KAAK,IAAI,MAAM,EAAE;IAIX,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3B,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAapC;AAED,mEAAmE;AACnE,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAE9D"}
1
+ {"version":3,"file":"AppLifecycle.d.ts","sourceRoot":"","sources":["../../src/boot/AppLifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,gEAAgE;AAChE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvC;AAED,yEAAyE;AACzE,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAE3C,GAAG,CAAC,GAAG,UAAU,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,EAAE,GAAG,IAAI;IAU5D,KAAK,IAAI,MAAM,EAAE;IAIX,EAAE,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3B,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAapC;AAED,mEAAmE;AACnE,wBAAgB,SAAS,CACvB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC,EAC9D,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,GACjC,SAAS,CAYX"}
@@ -36,7 +36,18 @@ export class AppLifecycle {
36
36
  }
37
37
  }
38
38
  /** The replaceable migration slot of the application lifecycle. */
39
- export function migrating(migrate) {
40
- return migrate ? { name: 'migrate', up: migrate } : { name: 'migrate' };
39
+ export function migrating(migrate, report) {
40
+ if (!migrate)
41
+ return { name: 'migrate' };
42
+ // What a pass DECLINED to change was thrown away at every call site — the same shape
43
+ // `seeding` already has: the source knows what it found, the boot owns the voice.
44
+ return {
45
+ name: 'migrate',
46
+ up: async (app) => {
47
+ const said = await migrate(app);
48
+ if (said)
49
+ report?.(said);
50
+ },
51
+ };
41
52
  }
42
53
  //# sourceMappingURL=AppLifecycle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppLifecycle.js","sourceRoot":"","sources":["../../src/boot/AppLifecycle.ts"],"names":[],"mappings":"AASA,yEAAyE;AACzE,MAAM,OAAO,YAAY;IACN,OAAO,GAAgB,EAAE,CAAC;IAE3C,GAAG,CAAC,GAAG,UAA8C;QACnD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,CAAC,SAAS;gBAAE,SA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CAAC;gBACH,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;YAC9B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,MAAM,kCAAkC,CAAC,CAAC;QACzF,CAAC;IACH,CAAC;CACF;AAED,mEAAmE;AACnE,MAAM,UAAU,SAAS,CACvB,OAA8D,EAC9D,MAAkC;IAElC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAEzC,qFAAqF;IACrF,kFAAkF;IAClF,OAAO;QACL,IAAI,EAAE,SAAS;QACf,EAAE,EAAE,KAAK,EAAE,GAAQ,EAAE,EAAE;YACrB,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;YAChC,IAAI,IAAI;gBAAE,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,21 +1,11 @@
1
1
  import { type SchemaView } from '@fougere/schema';
2
2
  import type { Container } from '@fougere/container';
3
- import type { Logger } from '../builtins/logger.js';
3
+ import type { Logger } from '../builtin/logger.js';
4
4
  import type { Fronds } from '../descriptor/Fronds.js';
5
5
  import type { OperationsMap } from '../wire/operation.js';
6
6
  /** Carries an announced fact out of this process — see `CreateAppOptions.onEmit`. */
7
7
  type Carrier = (fact: string, payload: unknown) => void | Promise<void>;
8
- /**
9
- * Emissions — the only place in Fougere where an initiator names a SUBJECT.
10
- *
11
- * It was eight closures over four collections in the middle of the boot, which is a
12
- * class that had not been named: the announced set, the subscriber index, the chain
13
- * carried in async context, and the shapes a fact is judged against.
14
- *
15
- * **It is a resolver, not a channel.** It answers *who*, then hands over to the door
16
- * that already exists — so a subscriber keeps its judge, its binding and its
17
- * middlewares, and nothing here is durable.
18
- */
8
+ /** Emissions — the only place in Fougere where an initiator names a SUBJECT. */
19
9
  export declare class Emissions {
20
10
  private readonly shapes;
21
11
  private readonly container;
@@ -24,102 +14,35 @@ export declare class Emissions {
24
14
  /** Who listens to what. Filled as each door's contracts are resolved. */
25
15
  private readonly subscribers;
26
16
  /**
27
- * What is announced here, read from the DEPS and not from the subscribers: a handler
28
- * declaring `Emit<PostPublished>` must resolve it whether or not anybody listens, and
29
- * announcing to nobody is legal.
17
+ * What is announced here, read from the DEPS and not from the subscribers: a handler declaring
18
+ * `Emit<PostPublished>` must resolve it whether or not anybody listens, and announcing to nobody
19
+ * is legal.
30
20
  */
31
21
  private readonly announced;
32
22
  constructor(fronds: Fronds, shapes: Map<string, SchemaView>, container: Container, log: Logger, carry?: Carrier | undefined);
33
23
  /**
34
24
  * Who listens to what — read from the PLAN, where `{ kind: 'fact' }` is a sentence
35
25
  * `computeBindingPlan` already wrote, so nothing re-derives what a parameter is.
36
- *
37
- * It is called for a frond hosted here AND for one declared remote. A remote frond is
38
- * still scanned — only its hosting is elsewhere — so its subscriptions are known, and
39
- * its door resolves to a doublure. That is the whole reason an emission crosses a
40
- * process without a line of transport code: the emitter learned the signature locally
41
- * and calls the same key. Noting only the hosted ones left the index EMPTY under a
42
- * split, and a fact announced to a remote listener reached nobody, in silence.
43
26
  */
44
27
  note(contracts: OperationsMap, door: string): void;
45
- /** The shape a fact is judged by, when the fact is a declared entity. */
28
+ /** The shape a fact is validated by, when the fact is a declared entity. */
46
29
  shapeOf(fact: string): SchemaView | undefined;
47
30
  /** The facts this process has a listener for — what a carrier subscribes to on its behalf. */
48
31
  listensTo(): string[];
49
- /**
50
- * Register one emission value per fact — announced here, or merely listened to.
51
- *
52
- * A process that only subscribes still needs the value, because `deliver` is what a
53
- * carrier calls and it goes through the same door. Called once every door has been
54
- * built, so the two sets are complete.
55
- */
32
+ /** Register one emission value per fact — announced here, or merely listened to. */
56
33
  register(): void;
57
- /**
58
- * Announcing. Dispatch, never delivery — the emitter is handed back the moment every
59
- * subscriber has been HANDED the fact, not when any of them is done.
60
- *
61
- * The `EventBus` this replaces did `await Promise.all(handlers)` and passed their
62
- * rejections up, which made a publication hostage to its own indexer.
63
- */
34
+ /** Announcing. */
64
35
  private announce;
65
- /**
66
- * Receiving. **The opposite rule, deliberately**: this one waits, and it tells.
67
- *
68
- * `deliver` is what a CARRIER calls, and a carrier's whole job is to know whether the
69
- * fact landed — at-least-once is retrying what failed, so a delivery that cannot report
70
- * makes durability impossible to build on top. It used to be the announcement itself:
71
- * it resolved before any subscriber had run and swallowed every failure into a log, so a
72
- * queue calling it could only ever ack blindly.
73
- *
74
- * That is not a contradiction of "dispatch is not delivery". That rule protects the
75
- * EMITTER, which must not become hostage to a subscriber; a carrier is not the emitter,
76
- * it is precisely the party whose business this is.
77
- *
78
- * What it still does not do is HOLD anything. A fact refused here is refused, and the
79
- * carrier decides whether it comes back — which is the whole of Fougere's position on
80
- * durability: the channel goes underneath, it is not reimplemented here.
81
- */
36
+ /** Receiving. */
82
37
  deliver(fact: string, payload: unknown): Promise<void>;
83
38
  /**
84
- * The announcement realizes the fact's own `lifecycle.create` — a `created()` stamped,
85
- * an id generated, a default applied.
86
- *
87
- * `applyCreate` (`schema/src/schema/axis/lifecycle/apply.ts`) is where the split is realized:
88
- * the judge never fills a hole, the STORAGE does, at the point of persistence. A fact has no storage, so nobody did — the judge declared an
89
- * absent `created()` legal and omitted it, and a subscriber received a value missing a
90
- * field its own type promises. Announcing is a fact's point of persistence.
91
- *
92
- * Announcing only, never `deliver`: a fact that arrives from elsewhere was stamped by
93
- * its sender, and stamping it again would give one fact a different identity in every
94
- * process that relayed it.
95
- *
96
- * **A typed emitter cannot reach this yet.** `Emit<T>` names the ROW type, where a
97
- * `created()` field is present and required, so `announce({ id, title })` is a compile
98
- * error and the author writes `at: new Date()` anyway. So this runs for a payload built
99
- * outside the type — a bridge, a replay, a test — and is inert for everyone else.
39
+ * The announcement realizes the fact's own `lifecycle.create` — a `created()` stamped, an id
40
+ * generated, a default applied.
100
41
  */
101
42
  private stamped;
102
- /**
103
- * Hand the fact to every listener in THIS process, and give back one promise each.
104
- *
105
- * The call goes THROUGH the door, so a subscriber meets the same judge, the same binding
106
- * and the same middlewares as any caller. Nothing new answers for correctness — that is
107
- * the dividend of a subscriber being an ordinary op rather than a special kind.
108
- *
109
- * It returns the promises rather than settling them, because the two callers want
110
- * opposite things and only one of them is wrong to wait.
111
- */
43
+ /** Hand the fact to every listener in THIS process, and give back one promise each. */
112
44
  private handToListeners;
113
- /**
114
- * A subscriber refusing the SHAPE, said in one line instead of dumped as an error.
115
- *
116
- * This is the one refusal nobody else will ever see. A door hands its 400 back to the
117
- * caller who can fix it; a fact is dispatched, not delivered, so the sender learns
118
- * nothing and the log is the whole of the evidence. The most likely cause is also the
119
- * one a stack trace hides worst — this process's copy is older than the sender's — so
120
- * the line names the fields and the remedy, and hedges because a genuinely bad payload
121
- * produces the same refusal.
122
- */
45
+ /** A subscriber refusing the SHAPE, said in one line instead of dumped as an error. */
123
46
  private describeRefusal;
124
47
  }
125
48
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Emissions.d.ts","sourceRoot":"","sources":["../../src/boot/Emissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAKpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAQ1D,qFAAqF;AACrF,KAAK,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,GAAG,OAAO,CAAC,I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IAOf,uFAAuF;IACvF,OAAO,CAAC,eAAe;IA8BvB,uFAAuF;IACvF,OAAO,CAAC,eAAe;CAMxB"}
@@ -2,18 +2,8 @@ import { applyCreate } from '@fougere/schema';
2
2
  import { validationErrorsOf } from '../wire/errors.js';
3
3
  import { emitKeyOf, factsAnnouncedBy } from '../emit.js';
4
4
  import { ambient } from '#ambient';
5
- import { EMPTY_INVOCATION } from '../contract/Invocation.js';
6
- /**
7
- * Emissions — the only place in Fougere where an initiator names a SUBJECT.
8
- *
9
- * It was eight closures over four collections in the middle of the boot, which is a
10
- * class that had not been named: the announced set, the subscriber index, the chain
11
- * carried in async context, and the shapes a fact is judged against.
12
- *
13
- * **It is a resolver, not a channel.** It answers *who*, then hands over to the door
14
- * that already exists — so a subscriber keeps its judge, its binding and its
15
- * middlewares, and nothing here is durable.
16
- */
5
+ import { EMPTY_INVOCATION } from '../wire/Invocation.js';
6
+ /** Emissions — the only place in Fougere where an initiator names a SUBJECT. */
17
7
  export class Emissions {
18
8
  shapes;
19
9
  container;
@@ -22,9 +12,9 @@ export class Emissions {
22
12
  /** Who listens to what. Filled as each door's contracts are resolved. */
23
13
  subscribers = new Map();
24
14
  /**
25
- * What is announced here, read from the DEPS and not from the subscribers: a handler
26
- * declaring `Emit<PostPublished>` must resolve it whether or not anybody listens, and
27
- * announcing to nobody is legal.
15
+ * What is announced here, read from the DEPS and not from the subscribers: a handler declaring
16
+ * `Emit<PostPublished>` must resolve it whether or not anybody listens, and announcing to nobody
17
+ * is legal.
28
18
  */
29
19
  announced;
30
20
  constructor(fronds, shapes, container, log, carry) {
@@ -37,13 +27,6 @@ export class Emissions {
37
27
  /**
38
28
  * Who listens to what — read from the PLAN, where `{ kind: 'fact' }` is a sentence
39
29
  * `computeBindingPlan` already wrote, so nothing re-derives what a parameter is.
40
- *
41
- * It is called for a frond hosted here AND for one declared remote. A remote frond is
42
- * still scanned — only its hosting is elsewhere — so its subscriptions are known, and
43
- * its door resolves to a doublure. That is the whole reason an emission crosses a
44
- * process without a line of transport code: the emitter learned the signature locally
45
- * and calls the same key. Noting only the hosted ones left the index EMPTY under a
46
- * split, and a fact announced to a remote listener reached nobody, in silence.
47
30
  */
48
31
  note(contracts, door) {
49
32
  for (const [op, contract] of contracts) {
@@ -56,7 +39,7 @@ export class Emissions {
56
39
  }
57
40
  }
58
41
  }
59
- /** The shape a fact is judged by, when the fact is a declared entity. */
42
+ /** The shape a fact is validated by, when the fact is a declared entity. */
60
43
  shapeOf(fact) {
61
44
  return this.shapes.get(fact);
62
45
  }
@@ -64,13 +47,7 @@ export class Emissions {
64
47
  listensTo() {
65
48
  return [...this.subscribers.keys()];
66
49
  }
67
- /**
68
- * Register one emission value per fact — announced here, or merely listened to.
69
- *
70
- * A process that only subscribes still needs the value, because `deliver` is what a
71
- * carrier calls and it goes through the same door. Called once every door has been
72
- * built, so the two sets are complete.
73
- */
50
+ /** Register one emission value per fact — announced here, or merely listened to. */
74
51
  register() {
75
52
  for (const fact of new Set([...this.announced, ...this.subscribers.keys()])) {
76
53
  this.container.registerValue(emitKeyOf(fact), (raw) => this.announce(fact, raw));
@@ -79,66 +56,24 @@ export class Emissions {
79
56
  this.log.warn('no async context on this runtime — an emission ring is not detected');
80
57
  }
81
58
  }
82
- /**
83
- * Announcing. Dispatch, never delivery — the emitter is handed back the moment every
84
- * subscriber has been HANDED the fact, not when any of them is done.
85
- *
86
- * The `EventBus` this replaces did `await Promise.all(handlers)` and passed their
87
- * rejections up, which made a publication hostage to its own indexer.
88
- */
59
+ /** Announcing. */
89
60
  async announce(fact, raw) {
90
61
  /**
91
- * A fact announced inside a frame that then rolls back is a lie, and nothing can take
92
- * it back: announcing is DISPATCH — every subscriber has been handed the fact and the
93
- * carrier has already put it on the wire — while the frame's writes are still
94
- * provisional.
95
- *
96
- * Refused rather than deferred to the commit. Deferring would make `Emit<T>` behave
97
- * differently depending on where it is called from, which is the hidden runtime the
98
- * doctrine refuses; and it opens a window between the commit and the announcement whose
99
- * only remedy is an outbox — a table, therefore durability, the one thing Fougere says
100
- * it does not hold.
101
- *
102
- * A fact designates something that HAS happened. `run` returning is when that becomes
103
- * true, so that is where the announcement belongs.
62
+ * A fact announced inside a frame that then rolls back is a lie, and nothing can take it back:
63
+ * announcing is DISPATCH — every subscriber has been handed the fact and the carrier has
64
+ * already put it on the wire — while the frame's writes are still provisional.
104
65
  */
105
66
  await ambient.beforeAnnounce(fact);
106
67
  const payload = this.stamped(fact, raw);
107
- /**
108
- * Whoever is not in this process — and it is the ONLY way to reach them.
109
- *
110
- * The local dispatch finds its listeners by having READ their code, so it stops at
111
- * the repository boundary: another team's Frond is not on this disk, and the
112
- * emission reaches nobody. A carrier hands the fact to a name instead, and the far
113
- * side subscribes to that same name from ITS own code. Neither reads the other.
114
- *
115
- * `deliver` deliberately does NOT come here: a hub that resolved this value to hand
116
- * on an incoming reading echoed it straight back to the whole fleet.
117
- */
118
- const carried = this.carry?.(fact, payload);
119
- if (carried)
120
- void Promise.resolve(carried).catch((cause) => this.log.error(`${fact} — carrier refused it`, cause));
68
+ /** Whoever is not in this process — and it is the ONLY way to reach them. */
69
+ const delivery = this.carry?.(fact, payload);
70
+ if (delivery)
71
+ void Promise.resolve(delivery).catch((cause) => this.log.error(`${fact} carrier refused it`, cause));
121
72
  for (const { door, op, done } of this.handToListeners(fact, payload)) {
122
73
  void done.catch((cause) => this.log.error(`${fact} → ${door}.${op}`, this.describeRefusal(fact, cause) ?? cause));
123
74
  }
124
75
  }
125
- /**
126
- * Receiving. **The opposite rule, deliberately**: this one waits, and it tells.
127
- *
128
- * `deliver` is what a CARRIER calls, and a carrier's whole job is to know whether the
129
- * fact landed — at-least-once is retrying what failed, so a delivery that cannot report
130
- * makes durability impossible to build on top. It used to be the announcement itself:
131
- * it resolved before any subscriber had run and swallowed every failure into a log, so a
132
- * queue calling it could only ever ack blindly.
133
- *
134
- * That is not a contradiction of "dispatch is not delivery". That rule protects the
135
- * EMITTER, which must not become hostage to a subscriber; a carrier is not the emitter,
136
- * it is precisely the party whose business this is.
137
- *
138
- * What it still does not do is HOLD anything. A fact refused here is refused, and the
139
- * carrier decides whether it comes back — which is the whole of Fougere's position on
140
- * durability: the channel goes underneath, it is not reimplemented here.
141
- */
76
+ /** Receiving. */
142
77
  async deliver(fact, payload) {
143
78
  const handed = this.handToListeners(fact, payload);
144
79
  const settled = await Promise.allSettled(handed.map((h) => h.done));
@@ -153,22 +88,8 @@ export class Emissions {
153
88
  }
154
89
  }
155
90
  /**
156
- * The announcement realizes the fact's own `lifecycle.create` — a `created()` stamped,
157
- * an id generated, a default applied.
158
- *
159
- * `applyCreate` (`schema/src/schema/axis/lifecycle/apply.ts`) is where the split is realized:
160
- * the judge never fills a hole, the STORAGE does, at the point of persistence. A fact has no storage, so nobody did — the judge declared an
161
- * absent `created()` legal and omitted it, and a subscriber received a value missing a
162
- * field its own type promises. Announcing is a fact's point of persistence.
163
- *
164
- * Announcing only, never `deliver`: a fact that arrives from elsewhere was stamped by
165
- * its sender, and stamping it again would give one fact a different identity in every
166
- * process that relayed it.
167
- *
168
- * **A typed emitter cannot reach this yet.** `Emit<T>` names the ROW type, where a
169
- * `created()` field is present and required, so `announce({ id, title })` is a compile
170
- * error and the author writes `at: new Date()` anyway. So this runs for a payload built
171
- * outside the type — a bridge, a replay, a test — and is inert for everyone else.
91
+ * The announcement realizes the fact's own `lifecycle.create` — a `created()` stamped, an id
92
+ * generated, a default applied.
172
93
  */
173
94
  stamped(fact, raw) {
174
95
  const shape = this.shapes.get(fact);
@@ -176,16 +97,7 @@ export class Emissions {
176
97
  ? applyCreate(shape.getFields(), raw)
177
98
  : raw;
178
99
  }
179
- /**
180
- * Hand the fact to every listener in THIS process, and give back one promise each.
181
- *
182
- * The call goes THROUGH the door, so a subscriber meets the same judge, the same binding
183
- * and the same middlewares as any caller. Nothing new answers for correctness — that is
184
- * the dividend of a subscriber being an ordinary op rather than a special kind.
185
- *
186
- * It returns the promises rather than settling them, because the two callers want
187
- * opposite things and only one of them is wrong to wait.
188
- */
100
+ /** Hand the fact to every listener in THIS process, and give back one promise each. */
189
101
  handToListeners(fact, payload) {
190
102
  const walked = ambient.currentChain();
191
103
  if (walked.includes(fact)) {
@@ -208,20 +120,11 @@ export class Emissions {
208
120
  catch (cause) {
209
121
  throw new Error(`${fact} → ${door} could not be reached`, { cause });
210
122
  }
211
- return facade[op]({ ...EMPTY_INVOCATION, body: payload });
123
+ return facade[op]({ ...EMPTY_INVOCATION, input: payload });
212
124
  }),
213
125
  }));
214
126
  }
215
- /**
216
- * A subscriber refusing the SHAPE, said in one line instead of dumped as an error.
217
- *
218
- * This is the one refusal nobody else will ever see. A door hands its 400 back to the
219
- * caller who can fix it; a fact is dispatched, not delivered, so the sender learns
220
- * nothing and the log is the whole of the evidence. The most likely cause is also the
221
- * one a stack trace hides worst — this process's copy is older than the sender's — so
222
- * the line names the fields and the remedy, and hedges because a genuinely bad payload
223
- * produces the same refusal.
224
- */
127
+ /** A subscriber refusing the SHAPE, said in one line instead of dumped as an error. */
225
128
  describeRefusal(fact, cause) {
226
129
  const refusals = validationErrorsOf(cause);
227
130
  if (!refusals?.length)
@@ -1 +1 @@
1
- {"version":3,"file":"Emissions.js","sourceRoot":"","sources":["../../src/boot/Emissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAE/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAc7D;;;;;;;;;;GAUG;AACH,MAAM,OAAO,SAAS;IAaD;IACA;IACA;IACA;IAfnB,yEAAyE;IACxD,WAAW,GAAG,IAAI,GAAG,EAAsB,CAAC;IAE7D;;;;OAIG;IACc,SAAS,CAAc;IAExC,YACE,MAAc,EACG,MAA+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,CAAC,KAAK,CAAC,GAAG,IAAI,mCAAmC,CAAC,CAAC;YAC3D,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YACtC,IAAI;YACJ,EAAE;YACF,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;gBACxC,IAAI,MAAgC,CAAC;gBACrC,IAAI,CAAC;oBACH,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAA2B,IAAI,CAAC,CAAC;gBAClE,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,MAAM,IAAI,uBAAuB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;gBACvE,CAAC;gBACD,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7D,CAAC,CAAC;SACH,CAAC,CAAC,CAAC;IACN,CAAC;IAED,uFAAuF;IAC/E,eAAe,CAAC,IAAY,EAAE,KAAc;QAClD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;QAC3C,IAAI,CAAC,QAAQ,EAAE,MAAM;YAAE,OAAO,SAAS,CAAC;QACxC,OAAO,uBAAuB,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;cACtF,QAAQ,IAAI,kFAAkF,CAAC;IACrG,CAAC;CACF"}
@@ -1,36 +1,15 @@
1
- /**
2
- * What a call needs to know about the call it is inside, and the two ways to answer it.
3
- *
4
- * One realization reads an async context (`ambient.als.ts`), the other cannot and waits
5
- * its turn instead (`ambient.queue.ts`). `#ambient` in package.json picks one per runtime,
6
- * so a bundle for a host without async context never names `node:async_hooks`.
7
- */
1
+ /** What a call needs to know about the call it is inside, and the two ways to answer it. */
8
2
  export interface Ambient {
9
3
  /** True when this runtime has no async context, and the boot says so. */
10
4
  readonly degraded: boolean;
11
- /**
12
- * Run `fn` as the frame `key`. A frame opened inside another must not proceed.
13
- *
14
- * Measured on SQLite: a second transaction on the same connection WAITS for the first,
15
- * so a nested frame hangs on one engine and returns when split across two.
16
- */
5
+ /** Run `fn` as the frame `key`. */
17
6
  enterFrame<R>(key: string, fn: () => Promise<R>): Promise<R>;
18
7
  /**
19
8
  * Settle before `fact` is dispatched: a fact announced inside a frame that then rolls
20
9
  * back is a lie. Refuses when the caller's own frame can be told, waits when it cannot.
21
10
  */
22
11
  beforeAnnounce(fact: string): Promise<void>;
23
- /**
24
- * The facts already being announced up the stack, so a fact cannot cause itself.
25
- *
26
- * A CHAIN and not a depth: `A → B → D` and `A → C → D` is a diamond, perfectly legal,
27
- * while `A → … → A` never ends. Empty where it cannot be followed.
28
- *
29
- * Detecting this at boot was the first idea and it was wrong: `Emit<G>` is a CONSTRUCTOR
30
- * dependency, so it belongs to the handler and not to one of its methods. A handler that
31
- * subscribes to `A` in one method and emits `G` from another would have been refused for
32
- * a cycle it never walks.
33
- */
12
+ /** The facts already being announced up the stack, so a fact cannot cause itself. */
34
13
  currentChain(): readonly string[];
35
14
  /** Run `fn` with `fact` appended to the emission chain. */
36
15
  enterChain<R>(fact: string, fn: () => Promise<R>): Promise<R>;
@@ -1 +1 @@
1
- {"version":3,"file":"ambient-port.d.ts","sourceRoot":"","sources":["../../src/boot/ambient-port.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACtB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B;;;;;OAKG;IACH,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE7D;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C;;;;;;;;;;OAUG;IACH,YAAY,IAAI,SAAS,MAAM,EAAE,CAAC;IAElC,2DAA2D;IAC3D,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC/D"}
1
+ {"version":3,"file":"ambient-port.d.ts","sourceRoot":"","sources":["../../src/boot/ambient-port.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,MAAM,WAAW,OAAO;IACtB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B,mCAAmC;IACnC,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE7D;;;OAGG;IACH,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C,qFAAqF;IACrF,YAAY,IAAI,SAAS,MAAM,EAAE,CAAC;IAElC,2DAA2D;IAC3D,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"ambient.als.d.ts","sourceRoot":"","sources":["../../src/boot/ambient.als.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKjD,eAAO,MAAM,OAAO,EAAE,OA8BrB,CAAC"}
1
+ {"version":3,"file":"ambient.als.d.ts","sourceRoot":"","sources":["../../src/boot/ambient.als.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKjD,eAAO,MAAM,OAAO,EAAE,OA8BrB,CAAC"}
@@ -1,28 +1,23 @@
1
- /**
2
- * The realization that can tell whose frame is open: an async context.
3
- *
4
- * Chosen by `#ambient` wherever `node:async_hooks` exists — Node, Deno, Bun, and workerd
5
- * with `nodejs_als`. Every refusal here is immediate and names its cause.
6
- */
1
+ /** The realization that can tell whose frame is open: an async context. */
7
2
  import { AsyncLocalStorage } from 'node:async_hooks';
8
3
  const frame = new AsyncLocalStorage();
9
4
  const chain = new AsyncLocalStorage();
10
5
  export const ambient = {
11
6
  degraded: false,
12
7
  enterFrame(key, fn) {
13
- const held = frame.getStore();
14
- if (held !== undefined) {
15
- return Promise.reject(new Error(`Together<[…]> (${key}) cannot be opened inside ${held}: on one engine the second `
8
+ const open = frame.getStore();
9
+ if (open !== undefined) {
10
+ return Promise.reject(new Error(`Together<[…]> (${key}) cannot be opened inside ${open}: on one engine the second `
16
11
  + `transaction waits for the first and the call hangs. Two frames that must both hold `
17
12
  + `are ONE frame — declare a single Together naming every member.`));
18
13
  }
19
14
  return frame.run(key, fn);
20
15
  },
21
16
  beforeAnnounce(fact) {
22
- const held = frame.getStore();
23
- if (held === undefined)
17
+ const open = frame.getStore();
18
+ if (open === undefined)
24
19
  return Promise.resolve();
25
- return Promise.reject(new Error(`${fact} cannot be announced inside Together<[…]> (${held}): announcing is dispatch, `
20
+ return Promise.reject(new Error(`${fact} cannot be announced inside Together<[…]> (${open}): announcing is dispatch, `
26
21
  + `so subscribers and the carrier would have it while these writes can still be taken `
27
22
  + `back. Announce after run() returns, when it is true.`));
28
23
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ambient.als.js","sourceRoot":"","sources":["../../src/boot/ambient.als.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM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esses — it waits its turn.
4
- *
5
- * Two consequences the boot reports rather than hides: frames run one at a time, and a
6
- * frame opened inside another is not refused, it waits for itself and times out.
2
+ * The realization for a runtime with no async context: it cannot tell whose frame is open, so it
3
+ * never guesses — it waits its turn.
7
4
  */
8
5
  import type { Ambient } from './ambient-port.js';
9
6
  export declare const ambient: Ambient;
@@ -1 +1 @@
1
- {"version":3,"file":"ambient.queue.d.ts","sourceRoot":"","sources":["../../src/boot/ambient.queue.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAmBjD,eAAO,MAAM,OAAO,EAAE,OAgDrB,CAAC"}
1
+ {"version":3,"file":"ambient.queue.d.ts","sourceRoot":"","sources":["../../src/boot/ambient.queue.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAmBjD,eAAO,MAAM,OAAO,EAAE,OAgDrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ambient.queue.js","sourceRoot":"","sources":["../../src/boot/ambient.queue.ts"],"names":[],"mappings":"AASA,iGAAiG;AACjG,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC,IAAI,IAA+B,CAAC;AACpC,IAAI,MAA0B,CAAC;AAE/B,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;AAEhC,gGAAgG;AAChG,SAAS,QAAQ,CAAC,CAAgB,EAAE,EAAU;IAC5C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG,GAAG,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QACxD,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,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gD,CACnD,CAAC;YACJ,CAAC;YACD,MAAM,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,CAAC;QACD,qFAAqF;QACrF,8EAA8E;QAC9E,IAAI,OAAO,GAAG,OAAqB,CAAC;QACpC,IAAI,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,GAAG,GAAG,CAAC;QACb,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;gBAAS,CAAC;YACT,IAAI,GAAG,SAAS,CAAC;YACjB,MAAM,GAAG,SAAS,CAAC;YACnB,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,cAAc,CAAC,KAAa;QAChC,OAAO,IAAI;YAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACvD,CAAC;IAED,sFAAsF;IACtF,YAAY,EAAE,GAAG,EAAE,CAAC,EAAE;IAEtB,UAAU,CAAI,KAAa,EAAE,EAAoB;QAC/C,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;CACF,CAAC"}
@@ -5,18 +5,6 @@ export interface ConfigApplication {
5
5
  /** What differs from the config in force and did NOT take effect. */
6
6
  pending: string[];
7
7
  }
8
- /**
9
- * What a (re-)read config changes in a process that is already running.
10
- *
11
- * The rule it realizes, and the only one worth remembering: **a value that is
12
- * CONSULTED can change under a running app; a value that was CONSUMED to build
13
- * something cannot, without rebuilding what it built.** `logLevel` is consulted at
14
- * every emission, so it moves. `db` opened a connection, `ports:` registered a class,
15
- * the entities built façades — those are consumed, and this function reports them
16
- * rather than pretending.
17
- *
18
- * The list of consulted keys is not declared anywhere: a key is consulted when this
19
- * function does something with it, which is the only definition that cannot go stale.
20
- */
8
+ /** What a (re-)read config changes in a process that is already running. */
21
9
  export declare function applyConfig(next: FougereConfig, inForce?: FougereConfig): ConfigApplication;
22
10
  //# sourceMappingURL=apply.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/boot/apply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,qEAAqE;IACrE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,iBAAiB,CAsB3F"}
1
+ {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../src/boot/apply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIzD,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,qEAAqE;IACrE,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,iBAAiB,CA2B3F"}