@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/src/wire/call.ts CHANGED
@@ -1,16 +1,22 @@
1
- /**
2
- * Call contract — a frond call is a value.
3
- *
4
- * (frond, entity, op, invocation) → result, or a thrown FougereError.
5
- * A transport is a function that executes this call elsewhere; the local
6
- * runner below is the reference realization. Transports move the value,
7
- * they never reshape it.
8
- */
1
+ /** Call contract — a frond call is a value. */
9
2
  import { Card, type SchemaDescriptor } from '@fougere/schema';
10
3
  import { factsAnnouncedBy } from '../emit.js';
11
- import type { InvocationContext } from '../contract/Invocation.js';
4
+ import { Invocation, type InvocationContext, type PartialInvocation } from './Invocation.js';
5
+ import type { RouteAddress } from './RouteAddress.js';
12
6
  import { FougereError, ErrorCode } from './errors.js';
13
7
 
8
+ /** One normalized request, frozen: where it goes and what the caller supplied. */
9
+ export class Call {
10
+ readonly address: RouteAddress;
11
+ readonly invocation: Invocation;
12
+
13
+ constructor(address: RouteAddress, invocation?: PartialInvocation) {
14
+ this.address = address;
15
+ this.invocation = Invocation.from(invocation);
16
+ Object.freeze(this);
17
+ }
18
+ }
19
+
14
20
  /** Target of a call — which façade operation, wherever it lives. */
15
21
  export interface FrondCall {
16
22
  /** Frond name, when the caller knows it. Routing hint only. */
@@ -25,49 +31,27 @@ export interface FrondCall {
25
31
  export type Transport = (call: FrondCall, invocation: InvocationContext) => Promise<unknown>;
26
32
 
27
33
  /** Reserved namespace — calls the runner answers itself, never a façade. */
28
- /**
29
- * What a receiver accepts before it stops reading a body.
30
- *
31
- * Stated once because it was stated FOUR times — `transport/http/policy.ts` said so in its
32
- * own comment ("spelled in four packages") while three doors kept their own literal, so
33
- * raising the cap here used to leave three of them refusing at the old one.
34
- *
35
- * `@fougere/http` keeps a fourth copy on purpose: it declares no Fougere dependency at all,
36
- * and giving a leaf port a dependency on the kernel to share a number is the wrong trade.
37
- */
34
+ /** What a receiver accepts before it stops reading an input. */
38
35
  export const MAX_BODY_BYTES = 1024 * 1024;
39
36
 
40
37
  export const RPC_ENTITY = 'rpc';
41
38
 
42
- /**
43
- * What an `rpc` op answers — the door for what the app says about ITSELF, never about a row.
44
- *
45
- * `discover` is core's own, registered like any other (`bootstrap.ts`): a package declares
46
- * its reading beside it, and an app that installed none serves none.
47
- */
39
+ /** What an `rpc` op answers — the door for what the app says about ITSELF, never about a row. */
48
40
  export type RpcAnswer = (invocation: InvocationContext, surface?: string) => unknown;
49
41
 
50
- /**
51
- * Everything a caller's envelope covers — the call as the sender meant it.
52
- *
53
- * Here and not beside the signing code because it is a CONTRACT: the sender binds it,
54
- * the receiver re-presents what arrived, and a frond written in another language reads
55
- * this shape without reading our crypto. `body` is bound by digest (arbitrary, possibly
56
- * large), the rest by value — which is what keeps a canonical-JSON dependency out.
57
- */
42
+ /** Everything a caller's envelope covers — the call as the sender meant it. */
58
43
  export interface SignedCall {
59
44
  entity: string;
60
45
  op: string;
61
46
  params?: Record<string, unknown>;
62
47
  query?: Record<string, unknown>;
63
- body?: unknown;
48
+ input?: unknown;
64
49
  state?: Record<string, unknown>;
65
50
  }
66
51
 
67
52
  /**
68
- * One operation, as a stranger meets it — its name, what it is for, what it takes
69
- * and whether it reads or writes. Everything here already existed on the contract;
70
- * it just never left the process.
53
+ * One operation, as a stranger meets it — its name, what it is for, what it takes and whether it
54
+ * reads or writes.
71
55
  */
72
56
  export interface CardOp {
73
57
  name: string;
@@ -79,57 +63,21 @@ export interface CardOp {
79
63
  output?: SchemaDescriptor;
80
64
  /** `query` reads, `command` writes — the same call REST turns into GET vs POST. */
81
65
  kind: 'query' | 'command';
82
- /**
83
- * How much `output` describes: one row, maybe one, many, a page, or nothing shaped.
84
- * `output` alone is the shape of a ROW, so a consumer generating a signature from
85
- * this card would otherwise have to guess — and `list` returning a page rather than
86
- * an array is exactly the guess it would get wrong.
87
- */
66
+ /** How much `output` describes. */
88
67
  cardinality?: 'one' | 'maybe' | 'many' | 'page' | 'none';
89
68
  }
90
69
 
91
- /**
92
- * What an app hosts — the wire projection of its scanned fronds.
93
- *
94
- * Two lists per frond, and they are duals: **what you may call**, and **what you will
95
- * receive**. A door is entered from outside; a fact leaves on its own.
96
- *
97
- * `doors` was called `entities` and the name lied: an entry is an ADDRESS, and the shape
98
- * behind it is optional (`facadeKeyOf` builds its key from a handler's name, which need not
99
- * be an entity's). The lie cost something real — `fougere sync` demanded a descriptor on
100
- * every entry and refused whole cards over a health check.
101
- */
70
+ /** What an app hosts — the wire projection of its scanned fronds. */
102
71
  export interface IdentityCard {
103
72
  fronds: {
104
73
  name: string;
105
74
  doors: {
106
75
  name: string;
107
76
  ops: CardOp[];
108
- /**
109
- * The shape stored under this name — **absent when nothing is**. A handler may
110
- * carry no entity (`bootstrap`: *pointing at nothing is legal*), and a door with
111
- * no rows behind it is ordinary: a health check, a computation, a search across
112
- * several shapes. A reader that needs the shape must say what it does without one.
113
- */
77
+ /** The shape stored under this name — **absent when nothing is**. */
114
78
  schema?: SchemaDescriptor;
115
79
  }[];
116
- /**
117
- * The facts this frond ANNOUNCES — one entry per `Emit<T>` its handlers inject.
118
- *
119
- * They carry no operation, which is why they cannot ride in `doors`: the rule there is
120
- * *hosting means answering*, and an entity with no façade is excluded on purpose (it
121
- * would publish the auth tables to anyone who asks). A fact is the opposite case —
122
- * someone WROTE that it leaves, so publishing its shape is honouring a statement, not
123
- * leaking one.
124
- *
125
- * Without this, a fact stopped at the repository boundary: `remotes:` gives the
126
- * location, colocation gives the contract, and across two repositories there is no
127
- * colocation. The subscriber had to hand-copy the emitter's declaration.
128
- *
129
- * `schema` is absent when the announced type is not a declared entity — legal (nothing
130
- * requires a fact to be one) and worth saying rather than hiding: the name travels, the
131
- * shape does not, and a consumer can see exactly that.
132
- */
80
+ /** The facts this frond ANNOUNCES — one entry per `Emit<T>` its handlers inject. */
133
81
  facts: { name: string; schema?: SchemaDescriptor }[];
134
82
  }[];
135
83
  }
@@ -150,17 +98,7 @@ export interface Edge {
150
98
  errors: number;
151
99
  }
152
100
 
153
- /**
154
- * The shape of the system as ONE process discovered it — the answer to `rpc.topology`.
155
- *
156
- * Here and not in the package that produces it, for the reason `SignedCall` is here: it
157
- * crosses a process boundary, so a reader consumes it without depending on the producer.
158
- * `@fougere/observability` fills it; a panel reads it; neither imports the other.
159
- *
160
- * Nothing in it is declared — a frond is `local` because this process scanned it, `remote`
161
- * because it answered a call nobody here hosts. `remotes:` states an intent, and the two
162
- * disagree exactly when something is misconfigured.
163
- */
101
+ /** The shape of the system as ONE process discovered it — the answer to `rpc.topology`. */
164
102
  export interface TopologyReport {
165
103
  /** When this process started counting — an edge count is read against it. */
166
104
  since: number;
@@ -170,18 +108,7 @@ export interface TopologyReport {
170
108
  edges: Edge[];
171
109
  }
172
110
 
173
- /**
174
- * The shape a card must have to be walked — `fronds`, and each frond's `doors`.
175
- *
176
- * A card crosses a process boundary, so it is judged like anything else that does.
177
- * The check lives beside the type because two readers walk it: the boot indexes a
178
- * remote's doors, and `fougere sync` writes classes from them. `TypeError:
179
- * card.fronds is not iterable` was what a malformed card produced at the boot,
180
- * naming neither the remote nor the address.
181
- *
182
- * The descriptor behind a door is NOT checked here — `Card.toSchema` refuses it, and
183
- * only where one is consumed.
184
- */
111
+ /** The shape a card must have to be walked — `fronds`, and each frond's `doors`. */
185
112
  export function assertIdentityCard(value: unknown, source: string): IdentityCard {
186
113
  const card = value as IdentityCard | undefined;
187
114
  const fronds = Array.isArray(card?.fronds) ? card.fronds : undefined;
@@ -205,49 +132,19 @@ function cardRefusal(source: string, what: string): FougereError {
205
132
 
206
133
  /** A façade as the runtime holds it: op names to functions, nothing typed about them. */
207
134
 
208
- /**
209
- * The door built in front of a handler — the framework's second port, after `Storage`.
210
- *
211
- * `Facade<PostHandler>` is what a neighbouring frond injects. It names what ARRIVES
212
- * rather than what is written: never the handler (nobody injects it, and its methods take
213
- * positional arguments), but the door, whose every op takes the invocation and whose
214
- * implementation is the local façade or a doublure. A signature therefore says nothing
215
- * about where the other frond runs, which is the whole point.
216
- *
217
- * `keyof T` is the right set by construction, not by approximation: the scan skips
218
- * `private` and `protected` (`handler-parser.ts`) because "TypeScript already has the
219
- * word for it", so a handler's public methods ARE its operations — and `keyof` excludes
220
- * the rest for the same reason.
221
- */
135
+ /** The door built in front of a handler — the framework's second port, after `Storage`. */
222
136
  export type Facade<T> = {
223
137
  [K in keyof T]: T[K] extends (...args: never[]) => infer R
224
138
  ? (invocation?: InvocationContext) => R
225
139
  : never;
226
140
  };
227
141
 
228
- /**
229
- * The container key of a façade — THE one place that spells the format.
230
- *
231
- * A surface is a named audience, and it is a key: `handlers/public/PostHandler.ts`
232
- * registers `public:postHandler` next to the default `postHandler`. The default
233
- * surface is the empty key, so callers that know nothing about surfaces keep
234
- * designating exactly what they designated before.
235
- *
236
- * Nobody outside this package builds this string: adapters ask `app.facadeFor()`,
237
- * which is why an adapter can stay structurally typed and core-free.
238
- */
142
+ /** The container key of a façade — THE one place that spells the format. */
239
143
  export function facadeKeyOf(entityName: string, surface?: string): string {
240
144
  return surface ? `${surface}:${entityName}Handler` : `${entityName}Handler`;
241
145
  }
242
146
 
243
- /**
244
- * Where the contracts behind a façade live — the dual of `facadeKeyOf`.
245
- *
246
- * The façade answers calls; it does not say what it answers. That sentence used
247
- * to be true only inside `buildFacade`, so anything asking the app what it hosts
248
- * got bare names. A door and its terms are registered together, under the same
249
- * audience.
250
- */
147
+ /** Where the contracts behind a façade live — the dual of `facadeKeyOf`. */
251
148
  export function contractsKeyOf(entityName: string, surface?: string): string {
252
149
  return `${facadeKeyOf(entityName, surface)}:contracts`;
253
150
  }
package/src/wire/drift.ts CHANGED
@@ -1,13 +1,7 @@
1
1
  import { Card, type Change, type SchemaDescriptor } from '@fougere/schema';
2
2
  import type { IdentityCard } from './call.js';
3
3
 
4
- /**
5
- * What separates the copy a consumer holds from what the producer actually serves.
6
- *
7
- * It lives beside `IdentityCard` and not in `@fougere/testing` for the reason the card
8
- * itself does: the subject is the card, and a second reader arrived — the dev panel, which
9
- * must not drag a 426 KB faker in to compare two of them.
10
- */
4
+ /** What separates the copy a consumer holds from what the producer actually serves. */
11
5
  export interface CardDrift {
12
6
  frond: string;
13
7
  /** A door the consumer calls that the producer no longer serves. */
@@ -41,26 +35,13 @@ function factsOf(card: IdentityCard, frond: string): Map<string, SchemaDescripto
41
35
  return found;
42
36
  }
43
37
 
44
- /**
45
- * What a consumer's synced copy no longer matches in what the producer serves.
46
- *
47
- * The gap TypeScript cannot see, and the only place the gradient genuinely lies: the code
48
- * is identical in-process and split, but one side may have aged. `fougere sync` wrote the
49
- * consumer's copy three weeks ago, the producer moved on, and it still compiles —
50
- * production is where that is found today. This is what Pact sells; the material was
51
- * already here, in `rpc.discover` and in `Card.diff`.
52
- *
53
- * Read in ONE direction on purpose: what the consumer holds, checked against what is
54
- * served. A producer serving MORE than the consumer knows is not drift — it is a producer
55
- * that moved forward without breaking anyone, which is the whole point of the order the
56
- * repo already states (re-sync the readers, then deploy the sender).
57
- */
38
+ /** What a consumer's synced copy no longer matches in what the producer serves. */
58
39
  export function driftOf(mine: IdentityCard, theirs: IdentityCard, frond: string): CardDrift {
59
- const held = doorsOf(mine, frond);
40
+ const mineDoors = doorsOf(mine, frond);
60
41
  const served = doorsOf(theirs, frond);
61
42
  const drift: CardDrift = { frond, missingDoors: [], missingOps: [], shapes: [], facts: [] };
62
43
 
63
- for (const [name, door] of held) {
44
+ for (const [name, door] of mineDoors) {
64
45
  const there = served.get(name);
65
46
  if (!there) { drift.missingDoors.push(name); continue; }
66
47
 
@@ -97,13 +78,7 @@ export function agrees(drift: CardDrift): boolean {
97
78
  && drift.facts.length === 0;
98
79
  }
99
80
 
100
- /**
101
- * The drift, in the words a deploy needs.
102
- *
103
- * A fact says the order out loud, because the repo already states it as a rule and
104
- * nothing enforced it: a fact is judged strictly, so a reader that has not been re-synced
105
- * refuses what the sender now announces.
106
- */
81
+ /** The drift, in the words a deploy needs. */
107
82
  export function explain(drift: CardDrift): string[] {
108
83
  const lines: string[] = [];
109
84
  for (const door of drift.missingDoors) lines.push(`${drift.frond}.${door} — you call it, it is not served`);
@@ -1,11 +1,4 @@
1
- /**
2
- * The error vocabulary — what a refusal IS, independently of who hears it.
3
- *
4
- * It travels on the wire (`toJSON`/`fromJSON`) and through the browser-safe
5
- * `@fougere/core/contract`, so nothing here may know about HTTP, a logger, or a
6
- * middleware chain. Its HTTP reading is one file over, in `http-error.ts`; it used
7
- * to live in `middleware.ts`, which named the one concept this is not.
8
- */
1
+ /** The error vocabulary — what a refusal IS, independently of who hears it. */
9
2
 
10
3
  import type { ValidationError } from '@fougere/schema';
11
4
 
@@ -79,12 +72,7 @@ export class FougereError extends Error {
79
72
  };
80
73
  }
81
74
 
82
- /**
83
- * Dual of toJSON — rebuild a typed error from its wire form.
84
- *
85
- * Wire input is untrusted: an unknown code degrades to INTERNAL_ERROR
86
- * (original code kept in details) instead of forging a fake semantic code.
87
- */
75
+ /** Dual of toJSON — rebuild a typed error from its wire form. */
88
76
  static fromJSON(json: unknown): FougereError {
89
77
  const raw = (typeof json === 'object' && json !== null ? json : {}) as Record<string, unknown>;
90
78
  const known = Object.values(ErrorCode).includes(raw.code as ErrorCode);
@@ -99,16 +87,8 @@ export class FougereError extends Error {
99
87
  }
100
88
 
101
89
  /**
102
- * The refusals behind a VALIDATION_FAILED, or nothing — the ONE place that reads
103
- * `details` under that code.
104
- *
105
- * `details` is `unknown` because it is genuinely polymorphic: `StorageGuard.judge` puts a
106
- * `string[]` there under INTERNAL_ERROR, `fromJSON` puts `{ originalCode, details }`
107
- * there for a code it does not know. So the shape is not the field's, it is a reading
108
- * of the PAIR (code, details) — which is why this is a reader and not a narrower type.
109
- *
110
- * It judges rather than casts: five call sites asserted `{ path, message }[]` by hand,
111
- * and a malformed VALIDATION_FAILED would have been accepted as structured refusals.
90
+ * The refusals behind a VALIDATION_FAILED, or nothing — the ONE place that reads `details` under
91
+ * that code.
112
92
  */
113
93
  export function validationErrorsOf(error: unknown): ValidationError[] | undefined {
114
94
  if (!(error instanceof FougereError) || error.code !== ErrorCode.VALIDATION_FAILED) return undefined;
@@ -1,17 +1,9 @@
1
- /**
2
- * HTTP reading of an error — used by HTTP bridges (REST, Next, Inertia).
3
- *
4
- * Not imported by GraphQL, CLI, or event bus bridges. The vocabulary it projects
5
- * is in `errors.ts` and knows nothing of this file.
6
- */
1
+ /** HTTP reading of an error — used by HTTP bridges (REST, Next, Inertia). */
7
2
  import { FougereError, ErrorCode } from './errors.js';
8
- import { Logger } from '../builtins/logger.js';
3
+ import { Logger } from '../builtin/logger.js';
9
4
  /**
10
- * An INTERNAL_ERROR is the one class of error whose message never leaves: it was not
11
- * written for a caller and may quote a path, a query or a row. Masking it is right, and
12
- * masking it *silently* is how a bug becomes unobservable — the operator loses the same
13
- * sentence the attacker does. So the mask and the record live in one function: whoever
14
- * calls `toPublicError` cannot forget the half that keeps the error findable.
5
+ * An INTERNAL_ERROR is the one class of error whose message never leaves: it was not written for a
6
+ * caller and may quote a path, a query or a row.
15
7
  */
16
8
  const log = new Logger('error');
17
9
 
@@ -42,13 +34,7 @@ function httpStatusFor(code: ErrorCode): number {
42
34
  return HTTP_STATUS[code] ?? 500;
43
35
  }
44
36
 
45
- /**
46
- * Serialize an application error for an untrusted caller.
47
- *
48
- * Every code but INTERNAL_ERROR was written for the caller and travels whole. An
49
- * INTERNAL_ERROR is replaced by a constant — and logged here, with its cause, so the
50
- * sentence exists exactly once: on the server.
51
- */
37
+ /** Serialize an application error for an untrusted caller. */
52
38
  export function toPublicError(err: FougereError): ReturnType<FougereError['toJSON']> {
53
39
  if (err.code !== ErrorCode.INTERNAL_ERROR) return err.toJSON();
54
40
  const where = [err.entity, err.operation].filter(Boolean).join('.');
@@ -2,15 +2,9 @@
2
2
  * Logger middleware — logs every operation with timing.
3
3
  */
4
4
  import type { AppMiddleware } from './middleware.js';
5
- import type { Logger } from '../builtins/logger.js';
5
+ import type { Logger } from '../builtin/logger.js';
6
6
 
7
- /**
8
- * Create a logger middleware that logs operation entry, exit, and errors.
9
- *
10
- * ```ts
11
- * app.use(loggerMiddleware(app.resolve('Logger')))
12
- * ```
13
- */
7
+ /** Create a logger middleware that logs operation entry, exit, and errors. */
14
8
  export function loggerMiddleware(logger: Logger): AppMiddleware {
15
9
  return async (ctx, next) => {
16
10
  const start = performance.now();
@@ -1,8 +1,4 @@
1
- /**
2
- * App-level middleware — intercepts handler facade operations.
3
- *
4
- * Works regardless of entry point (HTTP, Nitro, event bus, CLI, tests).
5
- */
1
+ /** App-level middleware — intercepts handler facade operations. */
6
2
 
7
3
  // ── Types ───────────────────────────────────────
8
4
  export interface OperationContext {
@@ -19,8 +15,8 @@ export interface OperationContext {
19
15
  args: unknown[];
20
16
  /** Extensible bag — middlewares deposit data here (user, permissions, etc.). */
21
17
  state: Record<string, unknown>;
22
- /** Transport-agnostic invocation context (params, query, body, state). */
23
- invocation?: import('../contract/Invocation.js').InvocationContext;
18
+ /** Transport-agnostic invocation context (params, query, input, state). */
19
+ invocation?: import('../wire/Invocation.js').InvocationContext;
24
20
  }
25
21
 
26
22
  export type AppNext = () => Promise<unknown>;
@@ -2,14 +2,7 @@ import type { SchemaView } from '@fougere/schema';
2
2
  import type { BindingPlan } from './binding.js';
3
3
  import type { Signature, TypeRef, Param } from './signature.js';
4
4
 
5
- /**
6
- * The contract of one operation — everything the façade needs to serve a call.
7
- *
8
- * Produced two ways, indistinguishable once here: the scan DERIVES it from a
9
- * method's parsed signature, a prefab handler DECLARES it outright. The façade
10
- * consumes contracts and nothing else — it knows no operation by name, and a
11
- * declared contract survives a scan that resolved nothing.
12
- */
5
+ /** The contract of one operation — everything the façade needs to serve a call. */
13
6
  export interface OperationContract {
14
7
  /** Judged on the way in. The view carries its own mode (`partial()` → patch). */
15
8
  input?: SchemaView;
@@ -17,43 +10,15 @@ export interface OperationContract {
17
10
  output?: SchemaView;
18
11
  /** Where each argument is read from in the invocation. */
19
12
  binding?: BindingPlan;
20
- /**
21
- * The operation in words, for a caller that meets it over the wire and has to
22
- * choose. Same three producers as the rest: the scan derives it from the method's
23
- * doc comment, a prefab declares it, config states it and wins.
24
- */
13
+ /** The operation in words, for a caller that meets it over the wire and has to choose. */
25
14
  description?: string;
26
- /**
27
- * How MUCH comes back — the half of the return type that `output` cannot say.
28
- *
29
- * `output` is the shape of ONE row; it is silent on whether the op hands back one,
30
- * several, or a page. The prefab knows (`list` returns a `ListResult`, `findById`
31
- * returns `T | undefined`) and the card did not, so anything generating a signature
32
- * from the card would have written `list(): Promise<Post[]>` — false, and a false
33
- * signature is worse than none.
34
- *
35
- * `none` says there is no shaped output at all (a boolean, a void), not that the op
36
- * returns nothing.
37
- */
15
+ /** How MUCH comes back — the half of the return type that `output` cannot say. */
38
16
  cardinality?: 'one' | 'maybe' | 'many' | 'page' | 'none';
39
- /**
40
- * The argument names and TYPES — the one thing `binding` cannot say.
41
- *
42
- * `binding` says where an argument is read from, `cardinality` how much comes back;
43
- * neither gives a type, and a GraphQL argument needs one. So this is not the scan's
44
- * private material: a prefab fills it too, from signatures it wrote itself. `binding`
45
- * still wins on where an argument comes from.
46
- */
17
+ /** The argument names and TYPES — the one thing `binding` cannot say. */
47
18
  signature?: Signature;
48
19
  }
49
20
 
50
- /**
51
- * Read an op's cardinality off its parsed return type.
52
- *
53
- * `Promise` is unwrapped first — it says when, not how much. `ListResult<T>` extends
54
- * `Array<T>`, so it must be recognised BEFORE the array test or a page would read as
55
- * a plain list and lose its `total`/`hasMore`.
56
- */
21
+ /** Read an op's cardinality off its parsed return type. */
57
22
  export function cardinalityOf(type: TypeRef | undefined): OperationContract['cardinality'] {
58
23
  if (!type) return undefined;
59
24
  const inner = type.name === 'Promise' ? type.generics?.[0] : type;
@@ -87,11 +52,7 @@ export interface OperationKindInference {
87
52
  commandMatches: string[];
88
53
  }
89
54
 
90
- /**
91
- * Deliberately finite: these are verbs whose leading use carries a stable read meaning.
92
- * `stats` and `check` preserve conventions already used by the project; the rest are the
93
- * ordinary query vocabulary shared by the built-in adapters.
94
- */
55
+ /** Deliberately finite. */
95
56
  const QUERY_VERBS = new Set([
96
57
  'all', 'check', 'count', 'exists', 'fetch', 'find', 'get', 'has', 'health', 'list',
97
58
  'load', 'mine', 'ping', 'quote', 'read', 'search', 'stats', 'status', 'who',
@@ -128,9 +89,8 @@ function wordsOf(name: string): string[] {
128
89
  }
129
90
 
130
91
  /**
131
- * Infer only when the leading word names one convention and a composed clause does not
132
- * name the opposite one. This is intentionally partial: `ofBook`, `computeReport` and
133
- * `getOrCreateUser` have no inferred kind instead of falling through to command/query.
92
+ * Infer only when the leading word names one convention and a composed clause does not name the
93
+ * opposite one.
134
94
  */
135
95
  export function inferOperationKind(name: string): OperationKindInference {
136
96
  const words = wordsOf(name);
@@ -1,8 +1,4 @@
1
- /**
2
- * A method's signature, as a contract is built from it — the shape, never the reading.
3
- *
4
- * The scan derives one from source; `frond.config.ts` states one. Neither owns the shape.
5
- */
1
+ /** A method's signature, as a contract is built from it — the shape, never the reading. */
6
2
  /** A type reference — primitives, entities, arrays, generics. */
7
3
  export interface TypeRef {
8
4
  /** Raw type text as written in source (e.g. 'Pagination<Post>'). */
@@ -11,13 +7,7 @@ export interface TypeRef {
11
7
  name: string;
12
8
  /** Whether this is an array (T[] or Array<T>) — true at any depth. */
13
9
  array?: boolean;
14
- /**
15
- * How MANY array levels: `string[]` is 1, `string[][]` is 2. `array` only ever said
16
- * "at least one", which sufficed while one level meant one thing. It stopped sufficing
17
- * when a presenter method started taking the page — there the outer level IS the page
18
- * and what remains is the field, so telling `string[]` from `string[][]` is telling a
19
- * computed string from a computed list.
20
- */
10
+ /** How MANY array levels. */
21
11
  arrayDepth?: number;
22
12
  /** Generic type arguments (e.g. for Pagination<Post> → [{ name: 'Post' }]). */
23
13
  generics?: TypeRef[];
@@ -41,19 +31,8 @@ export interface Signature {
41
31
  name: string;
42
32
  params: Param[];
43
33
  returnType?: TypeRef;
44
- /**
45
- * Came from a base class, not from the file being scanned. What a prefab
46
- * handler declares about its own ops beats this — the scan reads a signature
47
- * and guesses, the builder knows.
48
- */
34
+ /** Came from a base class, not from the file being scanned. */
49
35
  inherited?: boolean;
50
- /**
51
- * The operation in words — the first sentence of the method's doc comment.
52
- *
53
- * Not a new thing to write: handlers already carry it (`/** Judge: the author,
54
- * a draft… *&#47;`), the AST already holds it, and nothing read it. A caller that
55
- * discovers an operation over the wire has its name and its schema; what the
56
- * operation is FOR lived only in the source.
57
- */
36
+ /** The operation in words — the first sentence of the method's doc comment. */
58
37
  description?: string;
59
38
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"HandlerFacade.d.ts","sourceRoot":"","sources":["../../src/boot/HandlerFacade.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAM3D,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAsB,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAE5F,OAAO,KAAK,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E,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC;CACF"}
@@ -1,13 +0,0 @@
1
- /**
2
- * The process environment, as a service — so a handler asks for it rather than reading it.
3
- *
4
- * `process` is absent on a Worker, where the environment arrives as a binding. Read through
5
- * `globalThis` and treated as empty when there is none: a missing variable and a missing
6
- * `process` are the same answer to a caller, and the fallback already says what to do.
7
- */
8
- export declare class Config {
9
- private readonly env;
10
- constructor(env?: Record<string, string | undefined>);
11
- get<T = string>(key: string, fallback?: T): T;
12
- }
13
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/builtins/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAkB;IAErF,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC;CAG9C"}
@@ -1,21 +0,0 @@
1
- /**
2
- * The process environment, as a service — so a handler asks for it rather than reading it.
3
- *
4
- * `process` is absent on a Worker, where the environment arrives as a binding. Read through
5
- * `globalThis` and treated as empty when there is none: a missing variable and a missing
6
- * `process` are the same answer to a caller, and the fallback already says what to do.
7
- */
8
- export class Config {
9
- env;
10
- constructor(env = envOfProcess()) {
11
- this.env = env;
12
- }
13
- get(key, fallback) {
14
- return this.env[key] ?? fallback;
15
- }
16
- }
17
- function envOfProcess() {
18
- const proc = globalThis.process;
19
- return proc?.env ?? {};
20
- }
21
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/builtins/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,OAAO,MAAM;IACY;IAA7B,YAA6B,MAA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