@fougere/core 0.6.0-alpha.0 → 0.7.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 (493) hide show
  1. package/README.md +1 -1
  2. package/dist/boot/Emissions.d.ts +13 -90
  3. package/dist/boot/Emissions.d.ts.map +1 -1
  4. package/dist/boot/Emissions.js +21 -118
  5. package/dist/boot/Emissions.js.map +1 -1
  6. package/dist/boot/ambient-port.d.ts +3 -24
  7. package/dist/boot/ambient-port.d.ts.map +1 -1
  8. package/dist/boot/ambient.als.d.ts.map +1 -1
  9. package/dist/boot/ambient.als.js +7 -12
  10. package/dist/boot/ambient.als.js.map +1 -1
  11. package/dist/boot/ambient.queue.d.ts +2 -5
  12. package/dist/boot/ambient.queue.d.ts.map +1 -1
  13. package/dist/boot/ambient.queue.js.map +1 -1
  14. package/dist/boot/apply.d.ts +1 -13
  15. package/dist/boot/apply.d.ts.map +1 -1
  16. package/dist/boot/apply.js +3 -15
  17. package/dist/boot/apply.js.map +1 -1
  18. package/dist/boot/auth.d.ts +2 -12
  19. package/dist/boot/auth.d.ts.map +1 -1
  20. package/dist/boot/boot.d.ts +3 -16
  21. package/dist/boot/boot.d.ts.map +1 -1
  22. package/dist/boot/boot.js +3 -10
  23. package/dist/boot/boot.js.map +1 -1
  24. package/dist/boot/bootstrap.d.ts.map +1 -1
  25. package/dist/boot/bootstrap.js +61 -127
  26. package/dist/boot/bootstrap.js.map +1 -1
  27. package/dist/boot/card.d.ts +1 -17
  28. package/dist/boot/card.d.ts.map +1 -1
  29. package/dist/boot/card.js +3 -32
  30. package/dist/boot/card.js.map +1 -1
  31. package/dist/boot/frame.d.ts +8 -32
  32. package/dist/boot/frame.d.ts.map +1 -1
  33. package/dist/boot/frame.js +20 -54
  34. package/dist/boot/frame.js.map +1 -1
  35. package/dist/boot/hosted.d.ts +2 -24
  36. package/dist/boot/hosted.d.ts.map +1 -1
  37. package/dist/boot/hosted.js +10 -15
  38. package/dist/boot/hosted.js.map +1 -1
  39. package/dist/boot/ownership.d.ts +3 -36
  40. package/dist/boot/ownership.d.ts.map +1 -1
  41. package/dist/boot/ownership.js +5 -40
  42. package/dist/boot/ownership.js.map +1 -1
  43. package/dist/boot/ports.d.ts +1 -14
  44. package/dist/boot/ports.d.ts.map +1 -1
  45. package/dist/boot/ports.js +1 -14
  46. package/dist/boot/ports.js.map +1 -1
  47. package/dist/boot/remote.d.ts +5 -38
  48. package/dist/boot/remote.d.ts.map +1 -1
  49. package/dist/boot/remote.js +8 -41
  50. package/dist/boot/remote.js.map +1 -1
  51. package/dist/boot/runner.d.ts +4 -21
  52. package/dist/boot/runner.d.ts.map +1 -1
  53. package/dist/boot/runner.js +4 -17
  54. package/dist/boot/runner.js.map +1 -1
  55. package/dist/boot/seed.d.ts +4 -31
  56. package/dist/boot/seed.d.ts.map +1 -1
  57. package/dist/boot/seed.js +6 -37
  58. package/dist/boot/seed.js.map +1 -1
  59. package/dist/boot/statement-drift.d.ts +2 -21
  60. package/dist/boot/statement-drift.d.ts.map +1 -1
  61. package/dist/boot/statement-drift.js +4 -9
  62. package/dist/boot/statement-drift.js.map +1 -1
  63. package/dist/boot/together.d.ts +4 -8
  64. package/dist/boot/together.d.ts.map +1 -1
  65. package/dist/boot/together.js +15 -50
  66. package/dist/boot/together.js.map +1 -1
  67. package/dist/boot/types.d.ts +28 -173
  68. package/dist/boot/types.d.ts.map +1 -1
  69. package/dist/builtin/config.d.ts +7 -0
  70. package/dist/builtin/config.d.ts.map +1 -0
  71. package/dist/builtin/config.js +15 -0
  72. package/dist/builtin/config.js.map +1 -0
  73. package/dist/{builtins → builtin}/logger.d.ts +4 -25
  74. package/dist/builtin/logger.d.ts.map +1 -0
  75. package/dist/{builtins → builtin}/logger.js +5 -32
  76. package/dist/builtin/logger.js.map +1 -0
  77. package/dist/config-loader.d.ts +9 -67
  78. package/dist/config-loader.d.ts.map +1 -1
  79. package/dist/config-loader.js +5 -18
  80. package/dist/config-loader.js.map +1 -1
  81. package/dist/contract.d.ts +13 -31
  82. package/dist/contract.d.ts.map +1 -1
  83. package/dist/contract.js +10 -26
  84. package/dist/contract.js.map +1 -1
  85. package/dist/crypto/encoding.d.ts +2 -15
  86. package/dist/crypto/encoding.d.ts.map +1 -1
  87. package/dist/crypto/encoding.js +2 -15
  88. package/dist/crypto/encoding.js.map +1 -1
  89. package/dist/crypto/node.d.ts.map +1 -1
  90. package/dist/crypto/node.js +1 -7
  91. package/dist/crypto/node.js.map +1 -1
  92. package/dist/crypto/port.d.ts +2 -18
  93. package/dist/crypto/port.d.ts.map +1 -1
  94. package/dist/crypto/port.js +1 -17
  95. package/dist/crypto/port.js.map +1 -1
  96. package/dist/crypto/webcrypto.d.ts.map +1 -1
  97. package/dist/crypto/webcrypto.js +1 -12
  98. package/dist/crypto/webcrypto.js.map +1 -1
  99. package/dist/declare.d.ts +6 -36
  100. package/dist/declare.d.ts.map +1 -1
  101. package/dist/declare.js +4 -29
  102. package/dist/declare.js.map +1 -1
  103. package/dist/define.d.ts +2 -3
  104. package/dist/define.d.ts.map +1 -1
  105. package/dist/define.js +2 -3
  106. package/dist/define.js.map +1 -1
  107. package/dist/descriptor/Fronds.d.ts +3 -28
  108. package/dist/descriptor/Fronds.d.ts.map +1 -1
  109. package/dist/descriptor/Fronds.js +6 -31
  110. package/dist/descriptor/Fronds.js.map +1 -1
  111. package/dist/descriptor/frond.d.ts +14 -63
  112. package/dist/descriptor/frond.d.ts.map +1 -1
  113. package/dist/dispatch/ArgumentResolver.d.ts +1 -1
  114. package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
  115. package/dist/dispatch/ArgumentResolver.js +5 -5
  116. package/dist/dispatch/ArgumentResolver.js.map +1 -1
  117. package/dist/dispatch/DispatchEvent.d.ts +2 -2
  118. package/dist/dispatch/DispatchEvent.d.ts.map +1 -1
  119. package/dist/dispatch/DispatchLifecycle.d.ts +1 -7
  120. package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -1
  121. package/dist/dispatch/DispatchLifecycle.js +1 -7
  122. package/dist/dispatch/DispatchLifecycle.js.map +1 -1
  123. package/dist/dispatch/DispatchPort.d.ts +1 -1
  124. package/dist/dispatch/DispatchPort.d.ts.map +1 -1
  125. package/dist/dispatch/Dispatcher.d.ts +1 -1
  126. package/dist/dispatch/Dispatcher.d.ts.map +1 -1
  127. package/dist/dispatch/Dispatcher.js +2 -2
  128. package/dist/dispatch/Dispatcher.js.map +1 -1
  129. package/dist/{boot → dispatch}/HandlerFacade.d.ts +25 -38
  130. package/dist/dispatch/HandlerFacade.d.ts.map +1 -0
  131. package/dist/{boot → dispatch}/HandlerFacade.js +65 -74
  132. package/dist/dispatch/HandlerFacade.js.map +1 -0
  133. package/dist/dispatch/LocalRoutePolicy.d.ts +1 -1
  134. package/dist/dispatch/LocalRoutePolicy.d.ts.map +1 -1
  135. package/dist/dispatch/LocalRoutePolicy.js +4 -4
  136. package/dist/dispatch/LocalRoutePolicy.js.map +1 -1
  137. package/dist/dispatch/OperationRoute.d.ts +2 -2
  138. package/dist/dispatch/OperationRoute.d.ts.map +1 -1
  139. package/dist/dispatch/OutputView.d.ts +3 -2
  140. package/dist/dispatch/OutputView.d.ts.map +1 -1
  141. package/dist/dispatch/OutputView.js +19 -1
  142. package/dist/dispatch/OutputView.js.map +1 -1
  143. package/dist/dispatch/Route.d.ts +2 -2
  144. package/dist/dispatch/Route.d.ts.map +1 -1
  145. package/dist/dispatch/RoutePolicy.d.ts +1 -1
  146. package/dist/dispatch/RoutePolicy.d.ts.map +1 -1
  147. package/dist/dispatch/RouteRegistry.d.ts +1 -1
  148. package/dist/dispatch/RouteRegistry.d.ts.map +1 -1
  149. package/dist/dispatch/RouteRegistry.js +2 -2
  150. package/dist/dispatch/RouteRegistry.js.map +1 -1
  151. package/dist/dispatch/RouteResolver.d.ts +2 -4
  152. package/dist/dispatch/RouteResolver.d.ts.map +1 -1
  153. package/dist/dispatch/StorageGuard.d.ts +8 -7
  154. package/dist/dispatch/StorageGuard.d.ts.map +1 -1
  155. package/dist/dispatch/StorageGuard.js +61 -18
  156. package/dist/dispatch/StorageGuard.js.map +1 -1
  157. package/dist/dispatch/presenterArguments.d.ts +7 -0
  158. package/dist/dispatch/presenterArguments.d.ts.map +1 -0
  159. package/dist/dispatch/presenterArguments.js +12 -0
  160. package/dist/dispatch/presenterArguments.js.map +1 -0
  161. package/dist/dispatch/remoteRoutes.d.ts +7 -0
  162. package/dist/dispatch/remoteRoutes.d.ts.map +1 -0
  163. package/dist/dispatch/{RemoteRouteResolver.js → remoteRoutes.js} +6 -10
  164. package/dist/dispatch/remoteRoutes.js.map +1 -0
  165. package/dist/dispatch/routeNotFound.d.ts +9 -0
  166. package/dist/dispatch/routeNotFound.d.ts.map +1 -0
  167. package/dist/dispatch/routeNotFound.js +21 -0
  168. package/dist/dispatch/routeNotFound.js.map +1 -0
  169. package/dist/dispatch/validateInput.d.ts +5 -0
  170. package/dist/dispatch/validateInput.d.ts.map +1 -0
  171. package/dist/dispatch/validateInput.js +20 -0
  172. package/dist/dispatch/validateInput.js.map +1 -0
  173. package/dist/effective-operation.d.ts +1 -24
  174. package/dist/effective-operation.d.ts.map +1 -1
  175. package/dist/effective-operation.js +21 -50
  176. package/dist/effective-operation.js.map +1 -1
  177. package/dist/emit.d.ts +4 -42
  178. package/dist/emit.d.ts.map +1 -1
  179. package/dist/emit.js +3 -39
  180. package/dist/emit.js.map +1 -1
  181. package/dist/entry/facade.d.ts +8 -0
  182. package/dist/entry/facade.d.ts.map +1 -0
  183. package/dist/entry/facade.js +28 -0
  184. package/dist/entry/facade.js.map +1 -0
  185. package/dist/entry/transport.d.ts +5 -0
  186. package/dist/entry/transport.d.ts.map +1 -0
  187. package/dist/entry/transport.js +11 -0
  188. package/dist/entry/transport.js.map +1 -0
  189. package/dist/frond-config.d.ts +7 -70
  190. package/dist/frond-config.d.ts.map +1 -1
  191. package/dist/frond-config.js +1 -9
  192. package/dist/frond-config.js.map +1 -1
  193. package/dist/identity-keys.d.ts +2 -5
  194. package/dist/identity-keys.d.ts.map +1 -1
  195. package/dist/identity-keys.js +3 -16
  196. package/dist/identity-keys.js.map +1 -1
  197. package/dist/identity.d.ts +4 -30
  198. package/dist/identity.d.ts.map +1 -1
  199. package/dist/identity.js +11 -73
  200. package/dist/identity.js.map +1 -1
  201. package/dist/imports.d.ts +1 -7
  202. package/dist/imports.d.ts.map +1 -1
  203. package/dist/imports.js +1 -7
  204. package/dist/imports.js.map +1 -1
  205. package/dist/index.d.ts +17 -24
  206. package/dist/index.d.ts.map +1 -1
  207. package/dist/index.js +10 -18
  208. package/dist/index.js.map +1 -1
  209. package/dist/loader.d.ts +1 -8
  210. package/dist/loader.d.ts.map +1 -1
  211. package/dist/loader.js +1 -8
  212. package/dist/loader.js.map +1 -1
  213. package/dist/node.d.ts +2 -11
  214. package/dist/node.d.ts.map +1 -1
  215. package/dist/node.js +2 -11
  216. package/dist/node.js.map +1 -1
  217. package/dist/prefab/collector.d.ts +1 -22
  218. package/dist/prefab/collector.d.ts.map +1 -1
  219. package/dist/prefab/collector.js +1 -22
  220. package/dist/prefab/collector.js.map +1 -1
  221. package/dist/prefab/crud.d.ts +16 -32
  222. package/dist/prefab/crud.d.ts.map +1 -1
  223. package/dist/prefab/crud.js +31 -58
  224. package/dist/prefab/crud.js.map +1 -1
  225. package/dist/prefab/mirror.d.ts +2 -24
  226. package/dist/prefab/mirror.d.ts.map +1 -1
  227. package/dist/prefab/mirror.js +2 -20
  228. package/dist/prefab/mirror.js.map +1 -1
  229. package/dist/prefab/prefab.d.ts +1 -7
  230. package/dist/prefab/prefab.d.ts.map +1 -1
  231. package/dist/prefab/prefab.js +1 -7
  232. package/dist/prefab/prefab.js.map +1 -1
  233. package/dist/prefab/presenter.d.ts +2 -36
  234. package/dist/prefab/presenter.d.ts.map +1 -1
  235. package/dist/prefab/presenter.js +2 -36
  236. package/dist/prefab/presenter.js.map +1 -1
  237. package/dist/prefab/repository.d.ts +5 -73
  238. package/dist/prefab/repository.d.ts.map +1 -1
  239. package/dist/prefab/repository.js +3 -16
  240. package/dist/prefab/repository.js.map +1 -1
  241. package/dist/scan/adapters.d.ts +3 -0
  242. package/dist/scan/adapters.d.ts.map +1 -0
  243. package/dist/scan/adapters.js +25 -0
  244. package/dist/scan/adapters.js.map +1 -0
  245. package/dist/scan/bundling.d.ts +1 -12
  246. package/dist/scan/bundling.d.ts.map +1 -1
  247. package/dist/scan/bundling.js +1 -12
  248. package/dist/scan/bundling.js.map +1 -1
  249. package/dist/scan/conventions.d.ts +6 -40
  250. package/dist/scan/conventions.d.ts.map +1 -1
  251. package/dist/scan/conventions.js +5 -34
  252. package/dist/scan/conventions.js.map +1 -1
  253. package/dist/scan/emit.d.ts +1 -5
  254. package/dist/scan/emit.d.ts.map +1 -1
  255. package/dist/scan/emit.js +4 -38
  256. package/dist/scan/emit.js.map +1 -1
  257. package/dist/scan/handler-parser.d.ts +4 -26
  258. package/dist/scan/handler-parser.d.ts.map +1 -1
  259. package/dist/scan/handler-parser.js +26 -83
  260. package/dist/scan/handler-parser.js.map +1 -1
  261. package/dist/scan/result.d.ts +3 -16
  262. package/dist/scan/result.d.ts.map +1 -1
  263. package/dist/scan/scanner.d.ts +2 -27
  264. package/dist/scan/scanner.d.ts.map +1 -1
  265. package/dist/scan/scanner.js +28 -127
  266. package/dist/scan/scanner.js.map +1 -1
  267. package/dist/scan/statement.d.ts.map +1 -1
  268. package/dist/scan/statement.js +4 -30
  269. package/dist/scan/statement.js.map +1 -1
  270. package/dist/source.d.ts +41 -0
  271. package/dist/source.d.ts.map +1 -0
  272. package/dist/source.js +10 -0
  273. package/dist/source.js.map +1 -0
  274. package/dist/storage.d.ts +13 -210
  275. package/dist/storage.d.ts.map +1 -1
  276. package/dist/storage.js +4 -68
  277. package/dist/storage.js.map +1 -1
  278. package/dist/store.d.ts +18 -0
  279. package/dist/store.d.ts.map +1 -0
  280. package/dist/store.js +146 -0
  281. package/dist/store.js.map +1 -0
  282. package/dist/verify.d.ts +5 -38
  283. package/dist/verify.d.ts.map +1 -1
  284. package/dist/verify.js +17 -37
  285. package/dist/verify.js.map +1 -1
  286. package/dist/wire/CallLog.d.ts +32 -0
  287. package/dist/wire/CallLog.d.ts.map +1 -0
  288. package/dist/{contract → wire}/CallLog.js.map +1 -1
  289. package/dist/wire/Invocation.d.ts +32 -0
  290. package/dist/wire/Invocation.d.ts.map +1 -0
  291. package/dist/wire/Invocation.js +66 -0
  292. package/dist/wire/Invocation.js.map +1 -0
  293. package/dist/{contract → wire}/RouteAddress.d.ts +5 -0
  294. package/dist/wire/RouteAddress.d.ts.map +1 -0
  295. package/dist/{contract → wire}/RouteAddress.js +7 -0
  296. package/dist/wire/RouteAddress.js.map +1 -0
  297. package/dist/wire/binding.d.ts +5 -21
  298. package/dist/wire/binding.d.ts.map +1 -1
  299. package/dist/wire/binding.js +5 -10
  300. package/dist/wire/binding.js.map +1 -1
  301. package/dist/wire/call.d.ts +24 -133
  302. package/dist/wire/call.d.ts.map +1 -1
  303. package/dist/wire/call.js +15 -41
  304. package/dist/wire/call.js.map +1 -1
  305. package/dist/wire/drift.d.ts +3 -28
  306. package/dist/wire/drift.d.ts.map +1 -1
  307. package/dist/wire/drift.js +4 -23
  308. package/dist/wire/drift.js.map +1 -1
  309. package/dist/wire/errors.d.ts +4 -24
  310. package/dist/wire/errors.d.ts.map +1 -1
  311. package/dist/wire/errors.js +4 -24
  312. package/dist/wire/errors.js.map +1 -1
  313. package/dist/wire/http-error.d.ts +2 -13
  314. package/dist/wire/http-error.d.ts.map +1 -1
  315. package/dist/wire/http-error.js +5 -19
  316. package/dist/wire/http-error.js.map +1 -1
  317. package/dist/wire/loggerMiddleware.d.ts +2 -8
  318. package/dist/wire/loggerMiddleware.d.ts.map +1 -1
  319. package/dist/wire/loggerMiddleware.js +1 -7
  320. package/dist/wire/loggerMiddleware.js.map +1 -1
  321. package/dist/wire/middleware.d.ts +3 -7
  322. package/dist/wire/middleware.d.ts.map +1 -1
  323. package/dist/wire/middleware.js +1 -5
  324. package/dist/wire/middleware.js.map +1 -1
  325. package/dist/wire/operation.d.ts +7 -43
  326. package/dist/wire/operation.d.ts.map +1 -1
  327. package/dist/wire/operation.js +4 -15
  328. package/dist/wire/operation.js.map +1 -1
  329. package/dist/wire/signature.d.ts +4 -25
  330. package/dist/wire/signature.d.ts.map +1 -1
  331. package/package.json +3 -3
  332. package/src/boot/Emissions.ts +21 -118
  333. package/src/boot/ambient-port.ts +3 -24
  334. package/src/boot/ambient.als.ts +7 -12
  335. package/src/boot/ambient.queue.ts +2 -5
  336. package/src/boot/apply.ts +3 -15
  337. package/src/boot/auth.ts +2 -12
  338. package/src/boot/boot.ts +5 -20
  339. package/src/boot/bootstrap.ts +69 -136
  340. package/src/boot/card.ts +4 -33
  341. package/src/boot/frame.ts +28 -62
  342. package/src/boot/hosted.ts +12 -34
  343. package/src/boot/ownership.ts +5 -39
  344. package/src/boot/ports.ts +1 -14
  345. package/src/boot/remote.ts +11 -58
  346. package/src/boot/runner.ts +5 -22
  347. package/src/boot/seed.ts +6 -37
  348. package/src/boot/statement-drift.ts +5 -24
  349. package/src/boot/together.ts +18 -51
  350. package/src/boot/types.ts +28 -173
  351. package/src/{builtins → builtin}/config.ts +1 -7
  352. package/src/{builtins → builtin}/logger.ts +6 -39
  353. package/src/config-loader.ts +12 -71
  354. package/src/contract.ts +15 -39
  355. package/src/crypto/encoding.ts +2 -15
  356. package/src/crypto/node.ts +1 -7
  357. package/src/crypto/port.ts +2 -18
  358. package/src/crypto/webcrypto.ts +1 -12
  359. package/src/declare.ts +8 -39
  360. package/src/define.ts +2 -3
  361. package/src/descriptor/Fronds.ts +6 -31
  362. package/src/descriptor/frond.ts +14 -63
  363. package/src/dispatch/ArgumentResolver.ts +6 -6
  364. package/src/dispatch/DispatchEvent.ts +2 -2
  365. package/src/dispatch/DispatchLifecycle.ts +1 -7
  366. package/src/dispatch/DispatchPort.ts +1 -1
  367. package/src/dispatch/Dispatcher.ts +3 -3
  368. package/src/dispatch/HandlerFacade.ts +231 -0
  369. package/src/dispatch/LocalRoutePolicy.ts +4 -4
  370. package/src/dispatch/OperationRoute.ts +2 -2
  371. package/src/dispatch/OutputView.ts +24 -2
  372. package/src/dispatch/Route.ts +2 -2
  373. package/src/dispatch/RoutePolicy.ts +1 -1
  374. package/src/dispatch/RouteRegistry.ts +2 -2
  375. package/src/dispatch/RouteResolver.ts +2 -4
  376. package/src/dispatch/StorageGuard.ts +70 -18
  377. package/src/dispatch/presenterArguments.ts +25 -0
  378. package/src/dispatch/{RemoteRouteResolver.ts → remoteRoutes.ts} +7 -9
  379. package/src/dispatch/routeNotFound.ts +33 -0
  380. package/src/dispatch/validateInput.ts +28 -0
  381. package/src/effective-operation.ts +21 -50
  382. package/src/emit.ts +5 -63
  383. package/src/entry/facade.ts +44 -0
  384. package/src/entry/transport.ts +16 -0
  385. package/src/frond-config.ts +7 -70
  386. package/src/identity-keys.ts +3 -16
  387. package/src/identity.ts +12 -80
  388. package/src/imports.ts +2 -31
  389. package/src/index.ts +17 -24
  390. package/src/loader.ts +2 -16
  391. package/src/node.ts +2 -11
  392. package/src/prefab/collector.ts +1 -22
  393. package/src/prefab/crud.ts +37 -76
  394. package/src/prefab/mirror.ts +4 -44
  395. package/src/prefab/prefab.ts +2 -21
  396. package/src/prefab/presenter.ts +2 -36
  397. package/src/prefab/repository.ts +7 -83
  398. package/src/scan/adapters.ts +32 -0
  399. package/src/scan/bundling.ts +1 -12
  400. package/src/scan/conventions.ts +6 -40
  401. package/src/scan/emit.ts +4 -38
  402. package/src/scan/handler-parser.ts +27 -96
  403. package/src/scan/result.ts +3 -16
  404. package/src/scan/scanner.ts +27 -126
  405. package/src/scan/statement.ts +4 -30
  406. package/src/source.ts +44 -0
  407. package/src/storage.ts +14 -234
  408. package/src/store.ts +152 -0
  409. package/src/verify.ts +16 -57
  410. package/src/wire/CallLog.ts +30 -0
  411. package/src/{contract → wire}/Invocation.ts +24 -17
  412. package/src/{contract → wire}/RouteAddress.ts +7 -0
  413. package/src/wire/binding.ts +9 -25
  414. package/src/wire/call.ts +30 -133
  415. package/src/wire/drift.ts +5 -30
  416. package/src/wire/errors.ts +4 -24
  417. package/src/wire/http-error.ts +5 -19
  418. package/src/wire/loggerMiddleware.ts +2 -8
  419. package/src/wire/middleware.ts +3 -7
  420. package/src/wire/operation.ts +8 -48
  421. package/src/wire/signature.ts +4 -25
  422. package/dist/boot/HandlerFacade.d.ts.map +0 -1
  423. package/dist/boot/HandlerFacade.js.map +0 -1
  424. package/dist/builtins/config.d.ts +0 -13
  425. package/dist/builtins/config.d.ts.map +0 -1
  426. package/dist/builtins/config.js +0 -21
  427. package/dist/builtins/config.js.map +0 -1
  428. package/dist/builtins/logger.d.ts.map +0 -1
  429. package/dist/builtins/logger.js.map +0 -1
  430. package/dist/contract/Call.d.ts +0 -10
  431. package/dist/contract/Call.d.ts.map +0 -1
  432. package/dist/contract/Call.js +0 -15
  433. package/dist/contract/Call.js.map +0 -1
  434. package/dist/contract/CallLog.d.ts +0 -57
  435. package/dist/contract/CallLog.d.ts.map +0 -1
  436. package/dist/contract/Invocation.d.ts +0 -27
  437. package/dist/contract/Invocation.d.ts.map +0 -1
  438. package/dist/contract/Invocation.js +0 -59
  439. package/dist/contract/Invocation.js.map +0 -1
  440. package/dist/contract/RouteAddress.d.ts.map +0 -1
  441. package/dist/contract/RouteAddress.js.map +0 -1
  442. package/dist/dispatch/InputValidator.d.ts +0 -7
  443. package/dist/dispatch/InputValidator.d.ts.map +0 -1
  444. package/dist/dispatch/InputValidator.js +0 -22
  445. package/dist/dispatch/InputValidator.js.map +0 -1
  446. package/dist/dispatch/OperationExecutor.d.ts +0 -25
  447. package/dist/dispatch/OperationExecutor.d.ts.map +0 -1
  448. package/dist/dispatch/OperationExecutor.js +0 -32
  449. package/dist/dispatch/OperationExecutor.js.map +0 -1
  450. package/dist/dispatch/OutputProjector.d.ts +0 -12
  451. package/dist/dispatch/OutputProjector.d.ts.map +0 -1
  452. package/dist/dispatch/OutputProjector.js +0 -30
  453. package/dist/dispatch/OutputProjector.js.map +0 -1
  454. package/dist/dispatch/PresenterArgumentResolver.d.ts +0 -12
  455. package/dist/dispatch/PresenterArgumentResolver.d.ts.map +0 -1
  456. package/dist/dispatch/PresenterArgumentResolver.js +0 -20
  457. package/dist/dispatch/PresenterArgumentResolver.js.map +0 -1
  458. package/dist/dispatch/RemoteRouteResolver.d.ts +0 -13
  459. package/dist/dispatch/RemoteRouteResolver.d.ts.map +0 -1
  460. package/dist/dispatch/RemoteRouteResolver.js.map +0 -1
  461. package/dist/dispatch/RouteNotFoundError.d.ts +0 -10
  462. package/dist/dispatch/RouteNotFoundError.d.ts.map +0 -1
  463. package/dist/dispatch/RouteNotFoundError.js +0 -24
  464. package/dist/dispatch/RouteNotFoundError.js.map +0 -1
  465. package/dist/entry/DynamicFacade.d.ts +0 -10
  466. package/dist/entry/DynamicFacade.d.ts.map +0 -1
  467. package/dist/entry/DynamicFacade.js +0 -27
  468. package/dist/entry/DynamicFacade.js.map +0 -1
  469. package/dist/entry/FacadeEntry.d.ts +0 -11
  470. package/dist/entry/FacadeEntry.d.ts.map +0 -1
  471. package/dist/entry/FacadeEntry.js +0 -26
  472. package/dist/entry/FacadeEntry.js.map +0 -1
  473. package/dist/entry/TransportEntry.d.ts +0 -13
  474. package/dist/entry/TransportEntry.d.ts.map +0 -1
  475. package/dist/entry/TransportEntry.js +0 -24
  476. package/dist/entry/TransportEntry.js.map +0 -1
  477. package/dist/rows.d.ts +0 -40
  478. package/dist/rows.d.ts.map +0 -1
  479. package/dist/rows.js +0 -146
  480. package/dist/rows.js.map +0 -1
  481. package/src/boot/HandlerFacade.ts +0 -242
  482. package/src/contract/Call.ts +0 -18
  483. package/src/contract/CallLog.ts +0 -55
  484. package/src/dispatch/InputValidator.ts +0 -28
  485. package/src/dispatch/OperationExecutor.ts +0 -60
  486. package/src/dispatch/OutputProjector.ts +0 -32
  487. package/src/dispatch/PresenterArgumentResolver.ts +0 -25
  488. package/src/dispatch/RouteNotFoundError.ts +0 -29
  489. package/src/entry/DynamicFacade.ts +0 -28
  490. package/src/entry/FacadeEntry.ts +0 -32
  491. package/src/entry/TransportEntry.ts +0 -30
  492. package/src/rows.ts +0 -155
  493. /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
 
@@ -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,IAAI,CAAC,CAAC;AAExE;;;;;;;;;;GAUG;AACH,qBAAa,SAAS;IAalB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IAfzB,yEAAyE;IACzE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAE7D;;;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O,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAExE,gFAAgF;AAChF,qBAAa,SAAS;IAalB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IAfzB,yEAAyE;IACzE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiC;IAE7D;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;gBAGtC,MAAM,EAAE,MAAM,EACG,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EAC/B,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,OAAO,YAAA;IAKlC;;;OAGG;IACH,IAAI,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAWlD,4EAA4E;IAC5E,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAI7C,8FAA8F;IAC9F,SAAS,IAAI,MAAM,EAAE;IAIrB,oFAAoF;IACpF,QAAQ,IAAI,IAAI;IAShB,kBAAkB;YACJ,QAAQ;IAmBtB,iBAAiB;IACX,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB5D;;;OAGG;IACH,OAAO,CAAC,OAAO;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+B,EAC/B,SAAoB,EACpB,GAAW,EACX,KAAe;QAHf,WAAM,GAAN,MAAM,CAAyB;QAC/B,cAAS,GAAT,SAAS,CAAW;QACpB,QAAG,GAAH,GAAG,CAAQ;QACX,UAAK,GAAL,KAAK,CAAU;QAEhC,IAAI,CAAC,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAA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C,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,kBAAkB,CAAC;AAGrD,MAAM,KAAK,GAAG,IAAI,iBAAiB,EAAU,CAAC;AAC9C,MAAM,KAAK,GAAG,IAAI,iBAAiB,EAAqB,CAAC;AAEzD,MAAM,CAAC,MAAM,OAAO,GAAY;IAC9B,QAAQ,EAAE,KAAK;IAEf,UAAU,CAAI,GAAW,EAAE,EAAoB;QAC7C,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC9B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,QAAQ,EAAE,CAAC;QAC9B,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAC7B,kBAAkB,GAAG,6BAA6B,IAAI,6BAA6B;kBACjF,qFAAqF;kBACrF,gEAAgE,CACnE,CAAC,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,cAAc,CAAC,IAAY;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC9B,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QACjD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAC7B,GAAG,IAAI,8CAA8C,IAAI,6BAA6B;cACpF,qFAAqF;cACrF,sDAAsD,CACzD,CAAC,CAAC;IACL,CAAC;IAED,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE;IAE1C,UAAU,CAAI,IAAY,EAAE,EAAoB;QAC9C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF,CAAC"}
@@ -1,9 +1,6 @@
1
1
  /**
2
- * The realization for a runtime with no async context: it cannot tell whose frame is
3
- * open, so it never guesses — 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,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAY;IAC9B,QAAQ,EAAE,IAAI;IAEd,KAAK,CAAC,UAAU,CAAI,GAAW,EAAE,EAAoB;QACnD,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,iBAAiB,CAAC;QAChD,SAAS,CAAC;YACR,gFAAgF;YAChF,oDAAoD;YACpD,IAA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AAM,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,CAsB3F"}
@@ -1,23 +1,11 @@
1
- import { setLogLevel, logLevel, envLevel } from '../builtins/logger.js';
1
+ import { setLogLevel, logLevel, envLevel } from '../builtin/logger.js';
2
2
  import { dequal } from 'dequal';
3
- /**
4
- * What a (re-)read config changes in a process that is already running.
5
- *
6
- * The rule it realizes, and the only one worth remembering: **a value that is
7
- * CONSULTED can change under a running app; a value that was CONSUMED to build
8
- * something cannot, without rebuilding what it built.** `logLevel` is consulted at
9
- * every emission, so it moves. `db` opened a connection, `ports:` registered a class,
10
- * the entities built façades — those are consumed, and this function reports them
11
- * rather than pretending.
12
- *
13
- * The list of consulted keys is not declared anywhere: a key is consulted when this
14
- * function does something with it, which is the only definition that cannot go stale.
15
- */
3
+ /** What a (re-)read config changes in a process that is already running. */
16
4
  export function applyConfig(next, inForce) {
17
5
  const applied = [];
18
6
  const pending = [];
19
7
  // The CLI speaks through the environment, so it keeps winning over the file — read
20
- // through `envLevel`, which is where the environment is already judged. Casting it
8
+ // through `envLevel`, which is where the environment is already validated. Casting it
21
9
  // here was a second reader that validated nothing: `FOUGERE_LOG_LEVEL=verbose` set
22
10
  // the threshold to `undefined` and every log passed.
23
11
  const wanted = envLevel() ?? next.logLevel ?? 'debug';
@@ -1 +1 @@
1
- {"version":3,"file":"apply.js","sourceRoot":"","sources":["../../src/boot/apply.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAShC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,WAAW,CAAC,IAAmB,EAAE,OAAuB;IACtE,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,mFAAmF;IACnF,mFAAmF;IACnF,mFAAmF;IACnF,qDAAqD;IACrD,MAAM,MAAM,GAAG,QAAQ,EAAE,IAAI,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC;IACtD,MAAM,MAAM,GAAG,QAAQ,EAAE,CAAC;IAC1B,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,WAAW,CAAC,MAAM,CAAC,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC,aAAa,MAAM,MAAM,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,IAAI,GAAG,KAAK,UAAU,IAAI,CAAC,OAAO;YAAE,SAAS;QAC7C,IAAI,CAAC,MAAM,CAAE,IAAgC,CAAC,GAAG,CAAC,EAAG,OAAmC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC/F,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC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';
6
6
  import type { Storage, StorageFactory } from '../storage.js';
7
- /**
8
- * Lazy auth declaration written in fougere.config.ts.
9
- *
10
- * Each @fougere/auth-* package exports a factory (e.g. `betterAuth(opts)`) that
11
- * returns this shape. The `create()` method is called once at boot with the
12
- * resolved db + storageFactory, so the provider can wire its engine through Fougere.
13
- */
7
+ /** Lazy auth declaration written in fougere.config.ts. */
14
8
  export interface AuthConfig {
15
9
  /** Build the runtime — invoked by createApp at boot with the resolved storage handles. */
16
10
  create(ctx: AuthContext): AuthRuntime | Promise<AuthRuntime>;
@@ -37,11 +31,7 @@ export interface AuthContext {
37
31
  export interface AuthRuntime {
38
32
  /** Entities used by the provider, including any defaults it filled in. */
39
33
  entities: Record<string, SchemaView>;
40
- /**
41
- * Per-entity ORMs the provider built for itself. Exposed so app code can
42
- * query auth tables (e.g. list active sessions for a user) without rebuilding
43
- * the same Storage.
44
- */
34
+ /** Per-entity ORMs the provider built for itself. */
45
35
  storages: Record<string, Storage>;
46
36
  /** Web Standard handler that processes /auth/* requests. */
47
37
  handler: (request: Request) => Promise<Response>;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/boot/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,0FAA0F;IAC1F,MAAM,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7D;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACvC;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,iFAAiF;IACjF,EAAE,EAAE,OAAO,CAAC;IACZ,gFAAgF;IAChF,cAAc,EAA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