@fougere/core 0.2.0-alpha.2 → 0.3.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 (414) hide show
  1. package/README.md +2 -1
  2. package/dist/boot/AppLifecycle.d.ts +18 -0
  3. package/dist/boot/AppLifecycle.d.ts.map +1 -0
  4. package/dist/boot/AppLifecycle.js +42 -0
  5. package/dist/boot/AppLifecycle.js.map +1 -0
  6. package/dist/boot/Emissions.d.ts +126 -0
  7. package/dist/boot/Emissions.d.ts.map +1 -0
  8. package/dist/boot/Emissions.js +233 -0
  9. package/dist/boot/Emissions.js.map +1 -0
  10. package/dist/boot/HandlerFacade.d.ts +72 -0
  11. package/dist/boot/HandlerFacade.d.ts.map +1 -0
  12. package/dist/boot/HandlerFacade.js +174 -0
  13. package/dist/boot/HandlerFacade.js.map +1 -0
  14. package/dist/boot/Lifecycle.d.ts +4 -0
  15. package/dist/boot/Lifecycle.d.ts.map +1 -0
  16. package/dist/boot/Lifecycle.js +3 -0
  17. package/dist/boot/Lifecycle.js.map +1 -0
  18. package/dist/boot/ambient-port.d.ts +38 -0
  19. package/dist/boot/ambient-port.d.ts.map +1 -0
  20. package/dist/boot/ambient-port.js +2 -0
  21. package/dist/boot/ambient-port.js.map +1 -0
  22. package/dist/boot/ambient.als.d.ts +3 -0
  23. package/dist/boot/ambient.als.d.ts.map +1 -0
  24. package/dist/boot/ambient.als.js +34 -0
  25. package/dist/boot/ambient.als.js.map +1 -0
  26. package/dist/boot/ambient.queue.d.ts +10 -0
  27. package/dist/boot/ambient.queue.d.ts.map +1 -0
  28. package/dist/boot/ambient.queue.js +60 -0
  29. package/dist/boot/ambient.queue.js.map +1 -0
  30. package/dist/boot/apply.d.ts +22 -0
  31. package/dist/boot/apply.d.ts.map +1 -0
  32. package/dist/boot/apply.js +48 -0
  33. package/dist/boot/apply.js.map +1 -0
  34. package/dist/boot/auth.d.ts +53 -0
  35. package/dist/boot/auth.d.ts.map +1 -0
  36. package/dist/boot/auth.js +2 -0
  37. package/dist/boot/auth.js.map +1 -0
  38. package/dist/{binding.d.ts → boot/binding.d.ts} +14 -17
  39. package/dist/boot/binding.d.ts.map +1 -0
  40. package/dist/{binding.js → boot/binding.js} +19 -10
  41. package/dist/boot/binding.js.map +1 -0
  42. package/dist/{boot.d.ts → boot/boot.d.ts} +25 -5
  43. package/dist/boot/boot.d.ts.map +1 -0
  44. package/dist/boot/boot.js +70 -0
  45. package/dist/boot/boot.js.map +1 -0
  46. package/dist/boot/bootstrap.d.ts.map +1 -0
  47. package/dist/boot/bootstrap.js +721 -0
  48. package/dist/boot/bootstrap.js.map +1 -0
  49. package/dist/boot/egress.d.ts +8 -0
  50. package/dist/boot/egress.d.ts.map +1 -0
  51. package/dist/boot/egress.js +11 -0
  52. package/dist/boot/egress.js.map +1 -0
  53. package/dist/boot/frame.d.ts +44 -0
  54. package/dist/boot/frame.d.ts.map +1 -0
  55. package/dist/boot/frame.js +181 -0
  56. package/dist/boot/frame.js.map +1 -0
  57. package/dist/boot/ownership.d.ts +42 -0
  58. package/dist/boot/ownership.d.ts.map +1 -0
  59. package/dist/boot/ownership.js +127 -0
  60. package/dist/boot/ownership.js.map +1 -0
  61. package/dist/boot/ports.d.ts +17 -0
  62. package/dist/boot/ports.d.ts.map +1 -0
  63. package/dist/boot/ports.js +57 -0
  64. package/dist/boot/ports.js.map +1 -0
  65. package/dist/{remote.d.ts → boot/remote.d.ts} +11 -3
  66. package/dist/boot/remote.d.ts.map +1 -0
  67. package/dist/{remote.js → boot/remote.js} +24 -26
  68. package/dist/boot/remote.js.map +1 -0
  69. package/dist/{seed.d.ts → boot/seed.d.ts} +13 -1
  70. package/dist/boot/seed.d.ts.map +1 -0
  71. package/dist/{seed.js → boot/seed.js} +24 -3
  72. package/dist/boot/seed.js.map +1 -0
  73. package/dist/boot/together.d.ts +26 -0
  74. package/dist/boot/together.d.ts.map +1 -0
  75. package/dist/boot/together.js +163 -0
  76. package/dist/boot/together.js.map +1 -0
  77. package/dist/boot/types.d.ts +260 -0
  78. package/dist/boot/types.d.ts.map +1 -0
  79. package/dist/boot/types.js.map +1 -0
  80. package/dist/builtins/config.d.ts +9 -0
  81. package/dist/builtins/config.d.ts.map +1 -1
  82. package/dist/builtins/config.js +16 -1
  83. package/dist/builtins/config.js.map +1 -1
  84. package/dist/builtins/logger.d.ts +37 -4
  85. package/dist/builtins/logger.d.ts.map +1 -1
  86. package/dist/builtins/logger.js +66 -7
  87. package/dist/builtins/logger.js.map +1 -1
  88. package/dist/config-loader.d.ts +39 -35
  89. package/dist/config-loader.d.ts.map +1 -1
  90. package/dist/config-loader.js +15 -54
  91. package/dist/config-loader.js.map +1 -1
  92. package/dist/contract/Call.d.ts +10 -0
  93. package/dist/contract/Call.d.ts.map +1 -0
  94. package/dist/contract/Call.js +15 -0
  95. package/dist/contract/Call.js.map +1 -0
  96. package/dist/contract/Invocation.d.ts +27 -0
  97. package/dist/contract/Invocation.d.ts.map +1 -0
  98. package/dist/contract/Invocation.js +59 -0
  99. package/dist/contract/Invocation.js.map +1 -0
  100. package/dist/contract/RouteAddress.d.ts +17 -0
  101. package/dist/contract/RouteAddress.d.ts.map +1 -0
  102. package/dist/contract/RouteAddress.js +38 -0
  103. package/dist/contract/RouteAddress.js.map +1 -0
  104. package/dist/contract.d.ts +25 -19
  105. package/dist/contract.d.ts.map +1 -1
  106. package/dist/contract.js +25 -10
  107. package/dist/contract.js.map +1 -1
  108. package/dist/crypto/encoding.d.ts +25 -0
  109. package/dist/crypto/encoding.d.ts.map +1 -0
  110. package/dist/crypto/encoding.js +58 -0
  111. package/dist/crypto/encoding.js.map +1 -0
  112. package/dist/crypto/node.d.ts +4 -0
  113. package/dist/crypto/node.d.ts.map +1 -0
  114. package/dist/crypto/node.js +25 -0
  115. package/dist/crypto/node.js.map +1 -0
  116. package/dist/crypto/port.d.ts +42 -0
  117. package/dist/crypto/port.d.ts.map +1 -0
  118. package/dist/crypto/port.js +19 -0
  119. package/dist/crypto/port.js.map +1 -0
  120. package/dist/crypto/webcrypto.d.ts +4 -0
  121. package/dist/crypto/webcrypto.d.ts.map +1 -0
  122. package/dist/crypto/webcrypto.js +34 -0
  123. package/dist/crypto/webcrypto.js.map +1 -0
  124. package/dist/dispatch/ArgumentResolver.d.ts +10 -0
  125. package/dist/dispatch/ArgumentResolver.d.ts.map +1 -0
  126. package/dist/dispatch/ArgumentResolver.js +12 -0
  127. package/dist/dispatch/ArgumentResolver.js.map +1 -0
  128. package/dist/dispatch/ArrayResult.d.ts +3 -0
  129. package/dist/dispatch/ArrayResult.d.ts.map +1 -0
  130. package/dist/dispatch/ArrayResult.js +11 -0
  131. package/dist/dispatch/ArrayResult.js.map +1 -0
  132. package/dist/dispatch/DispatchEvent.d.ts +18 -0
  133. package/dist/dispatch/DispatchEvent.d.ts.map +1 -0
  134. package/dist/dispatch/DispatchEvent.js +30 -0
  135. package/dist/dispatch/DispatchEvent.js.map +1 -0
  136. package/dist/dispatch/DispatchLifecycle.d.ts +9 -0
  137. package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -0
  138. package/dist/dispatch/DispatchLifecycle.js +25 -0
  139. package/dist/dispatch/DispatchLifecycle.js.map +1 -0
  140. package/dist/dispatch/DispatchPort.d.ts +6 -0
  141. package/dist/dispatch/DispatchPort.d.ts.map +1 -0
  142. package/dist/dispatch/DispatchPort.js +2 -0
  143. package/dist/dispatch/DispatchPort.js.map +1 -0
  144. package/dist/dispatch/Dispatcher.d.ts +16 -0
  145. package/dist/dispatch/Dispatcher.d.ts.map +1 -0
  146. package/dist/dispatch/Dispatcher.js +44 -0
  147. package/dist/dispatch/Dispatcher.js.map +1 -0
  148. package/dist/dispatch/InFlight.d.ts +12 -0
  149. package/dist/dispatch/InFlight.d.ts.map +1 -0
  150. package/dist/dispatch/InFlight.js +46 -0
  151. package/dist/dispatch/InFlight.js.map +1 -0
  152. package/dist/dispatch/InputValidator.d.ts +7 -0
  153. package/dist/dispatch/InputValidator.d.ts.map +1 -0
  154. package/dist/dispatch/InputValidator.js +21 -0
  155. package/dist/dispatch/InputValidator.js.map +1 -0
  156. package/dist/dispatch/LocalRoutePolicy.d.ts +11 -0
  157. package/dist/dispatch/LocalRoutePolicy.d.ts.map +1 -0
  158. package/dist/dispatch/LocalRoutePolicy.js +32 -0
  159. package/dist/dispatch/LocalRoutePolicy.js.map +1 -0
  160. package/dist/dispatch/OperationExecutor.d.ts +25 -0
  161. package/dist/dispatch/OperationExecutor.d.ts.map +1 -0
  162. package/dist/dispatch/OperationExecutor.js +32 -0
  163. package/dist/dispatch/OperationExecutor.js.map +1 -0
  164. package/dist/dispatch/OperationRoute.d.ts +13 -0
  165. package/dist/dispatch/OperationRoute.d.ts.map +1 -0
  166. package/dist/dispatch/OperationRoute.js +15 -0
  167. package/dist/dispatch/OperationRoute.js.map +1 -0
  168. package/dist/dispatch/OutputProjector.d.ts +12 -0
  169. package/dist/dispatch/OutputProjector.d.ts.map +1 -0
  170. package/dist/dispatch/OutputProjector.js +30 -0
  171. package/dist/dispatch/OutputProjector.js.map +1 -0
  172. package/dist/dispatch/OutputView.d.ts +8 -0
  173. package/dist/dispatch/OutputView.d.ts.map +1 -0
  174. package/dist/dispatch/OutputView.js +10 -0
  175. package/dist/dispatch/OutputView.js.map +1 -0
  176. package/dist/dispatch/PresenterArgumentResolver.d.ts +12 -0
  177. package/dist/dispatch/PresenterArgumentResolver.d.ts.map +1 -0
  178. package/dist/dispatch/PresenterArgumentResolver.js +20 -0
  179. package/dist/dispatch/PresenterArgumentResolver.js.map +1 -0
  180. package/dist/dispatch/PresenterExecutor.d.ts +11 -0
  181. package/dist/dispatch/PresenterExecutor.d.ts.map +1 -0
  182. package/dist/dispatch/PresenterExecutor.js +56 -0
  183. package/dist/dispatch/PresenterExecutor.js.map +1 -0
  184. package/dist/dispatch/RemoteRouteResolver.d.ts +13 -0
  185. package/dist/dispatch/RemoteRouteResolver.d.ts.map +1 -0
  186. package/dist/dispatch/RemoteRouteResolver.js +18 -0
  187. package/dist/dispatch/RemoteRouteResolver.js.map +1 -0
  188. package/dist/dispatch/Route.d.ts +10 -0
  189. package/dist/dispatch/Route.d.ts.map +1 -0
  190. package/dist/dispatch/Route.js +2 -0
  191. package/dist/dispatch/Route.js.map +1 -0
  192. package/dist/dispatch/RouteNotFoundError.d.ts +10 -0
  193. package/dist/dispatch/RouteNotFoundError.d.ts.map +1 -0
  194. package/dist/dispatch/RouteNotFoundError.js +24 -0
  195. package/dist/dispatch/RouteNotFoundError.js.map +1 -0
  196. package/dist/dispatch/RoutePolicy.d.ts +8 -0
  197. package/dist/dispatch/RoutePolicy.d.ts.map +1 -0
  198. package/dist/dispatch/RoutePolicy.js +2 -0
  199. package/dist/dispatch/RoutePolicy.js.map +1 -0
  200. package/dist/dispatch/RouteRegistry.d.ts +18 -0
  201. package/dist/dispatch/RouteRegistry.d.ts.map +1 -0
  202. package/dist/dispatch/RouteRegistry.js +62 -0
  203. package/dist/dispatch/RouteRegistry.js.map +1 -0
  204. package/dist/dispatch/RouteResolver.d.ts +7 -0
  205. package/dist/dispatch/RouteResolver.d.ts.map +1 -0
  206. package/dist/dispatch/RouteResolver.js +2 -0
  207. package/dist/dispatch/RouteResolver.js.map +1 -0
  208. package/dist/dispatch/StorageGuard.d.ts +15 -0
  209. package/dist/dispatch/StorageGuard.d.ts.map +1 -0
  210. package/dist/dispatch/StorageGuard.js +63 -0
  211. package/dist/dispatch/StorageGuard.js.map +1 -0
  212. package/dist/effective-operation.d.ts +90 -0
  213. package/dist/effective-operation.d.ts.map +1 -0
  214. package/dist/effective-operation.js +450 -0
  215. package/dist/effective-operation.js.map +1 -0
  216. package/dist/emit.js +2 -2
  217. package/dist/emit.js.map +1 -1
  218. package/dist/entry/DynamicFacade.d.ts +10 -0
  219. package/dist/entry/DynamicFacade.d.ts.map +1 -0
  220. package/dist/entry/DynamicFacade.js +27 -0
  221. package/dist/entry/DynamicFacade.js.map +1 -0
  222. package/dist/entry/FacadeEntry.d.ts +11 -0
  223. package/dist/entry/FacadeEntry.d.ts.map +1 -0
  224. package/dist/entry/FacadeEntry.js +26 -0
  225. package/dist/entry/FacadeEntry.js.map +1 -0
  226. package/dist/entry/TransportEntry.d.ts +13 -0
  227. package/dist/entry/TransportEntry.d.ts.map +1 -0
  228. package/dist/entry/TransportEntry.js +24 -0
  229. package/dist/entry/TransportEntry.js.map +1 -0
  230. package/dist/frond-config.d.ts +24 -7
  231. package/dist/frond-config.d.ts.map +1 -1
  232. package/dist/frond-config.js.map +1 -1
  233. package/dist/graph.d.ts +1 -1
  234. package/dist/graph.d.ts.map +1 -1
  235. package/dist/graph.js +3 -2
  236. package/dist/graph.js.map +1 -1
  237. package/dist/identity-keys.d.ts +14 -0
  238. package/dist/identity-keys.d.ts.map +1 -0
  239. package/dist/identity-keys.js +37 -0
  240. package/dist/identity-keys.js.map +1 -0
  241. package/dist/identity.d.ts +58 -0
  242. package/dist/identity.d.ts.map +1 -0
  243. package/dist/identity.js +182 -0
  244. package/dist/identity.js.map +1 -0
  245. package/dist/imports.d.ts +1 -1
  246. package/dist/imports.d.ts.map +1 -1
  247. package/dist/imports.js +7 -3
  248. package/dist/imports.js.map +1 -1
  249. package/dist/index.d.ts +57 -38
  250. package/dist/index.d.ts.map +1 -1
  251. package/dist/index.js +38 -32
  252. package/dist/index.js.map +1 -1
  253. package/dist/loader.d.ts +16 -0
  254. package/dist/loader.d.ts.map +1 -0
  255. package/dist/loader.js +25 -0
  256. package/dist/loader.js.map +1 -0
  257. package/dist/node.d.ts +21 -0
  258. package/dist/node.d.ts.map +1 -0
  259. package/dist/node.js +24 -0
  260. package/dist/node.js.map +1 -0
  261. package/dist/orm.d.ts +69 -8
  262. package/dist/orm.d.ts.map +1 -1
  263. package/dist/orm.js +35 -2
  264. package/dist/orm.js.map +1 -1
  265. package/dist/prefab/collector.d.ts +29 -0
  266. package/dist/prefab/collector.d.ts.map +1 -0
  267. package/dist/prefab/collector.js +34 -0
  268. package/dist/prefab/collector.js.map +1 -0
  269. package/dist/{crud.d.ts → prefab/crud.d.ts} +7 -8
  270. package/dist/prefab/crud.d.ts.map +1 -0
  271. package/dist/{crud.js → prefab/crud.js} +39 -5
  272. package/dist/prefab/crud.js.map +1 -0
  273. package/dist/prefab/mirror.d.ts +52 -0
  274. package/dist/prefab/mirror.d.ts.map +1 -0
  275. package/dist/prefab/mirror.js +66 -0
  276. package/dist/prefab/mirror.js.map +1 -0
  277. package/dist/prefab/prefab.d.ts +15 -0
  278. package/dist/prefab/prefab.d.ts.map +1 -0
  279. package/dist/prefab/prefab.js +19 -0
  280. package/dist/prefab/prefab.js.map +1 -0
  281. package/dist/{presenter.d.ts → prefab/presenter.d.ts} +6 -17
  282. package/dist/prefab/presenter.d.ts.map +1 -0
  283. package/dist/{presenter.js → prefab/presenter.js} +5 -23
  284. package/dist/prefab/presenter.js.map +1 -0
  285. package/dist/prefab/repository.d.ts +104 -0
  286. package/dist/prefab/repository.d.ts.map +1 -0
  287. package/dist/prefab/repository.js +62 -0
  288. package/dist/prefab/repository.js.map +1 -0
  289. package/dist/scan/Fronds.d.ts +45 -0
  290. package/dist/scan/Fronds.d.ts.map +1 -0
  291. package/dist/scan/Fronds.js +66 -0
  292. package/dist/scan/Fronds.js.map +1 -0
  293. package/dist/scan/conventions.d.ts +74 -0
  294. package/dist/scan/conventions.d.ts.map +1 -0
  295. package/dist/scan/conventions.js +82 -0
  296. package/dist/scan/conventions.js.map +1 -0
  297. package/dist/scan/emit.d.ts +14 -0
  298. package/dist/scan/emit.d.ts.map +1 -0
  299. package/dist/scan/emit.js +211 -0
  300. package/dist/scan/emit.js.map +1 -0
  301. package/dist/scan/frond.d.ts +224 -0
  302. package/dist/scan/frond.d.ts.map +1 -0
  303. package/dist/scan/frond.js +2 -0
  304. package/dist/scan/frond.js.map +1 -0
  305. package/dist/{handler-parser.d.ts → scan/handler-parser.d.ts} +18 -9
  306. package/dist/scan/handler-parser.d.ts.map +1 -0
  307. package/dist/scan/handler-parser.js +625 -0
  308. package/dist/scan/handler-parser.js.map +1 -0
  309. package/dist/scan/scan-cache.d.ts +16 -0
  310. package/dist/scan/scan-cache.d.ts.map +1 -0
  311. package/dist/{scan-cache.js → scan/scan-cache.js} +27 -20
  312. package/dist/scan/scan-cache.js.map +1 -0
  313. package/dist/scan/scanner.d.ts +20 -0
  314. package/dist/scan/scanner.d.ts.map +1 -0
  315. package/dist/{scanner.js → scan/scanner.js} +185 -167
  316. package/dist/scan/scanner.js.map +1 -0
  317. package/dist/verify.d.ts +16 -3
  318. package/dist/verify.d.ts.map +1 -1
  319. package/dist/verify.js +21 -18
  320. package/dist/verify.js.map +1 -1
  321. package/dist/{call.d.ts → wire/call.d.ts} +70 -1
  322. package/dist/wire/call.d.ts.map +1 -0
  323. package/dist/{call.js → wire/call.js} +48 -75
  324. package/dist/wire/call.js.map +1 -0
  325. package/dist/{middleware.d.ts → wire/errors.d.ts} +18 -19
  326. package/dist/wire/errors.d.ts.map +1 -0
  327. package/dist/{middleware.js → wire/errors.js} +26 -14
  328. package/dist/wire/errors.js.map +1 -0
  329. package/dist/{errors.d.ts → wire/http-error.d.ts} +5 -6
  330. package/dist/wire/http-error.d.ts.map +1 -0
  331. package/dist/{errors.js → wire/http-error.js} +7 -6
  332. package/dist/wire/http-error.js.map +1 -0
  333. package/dist/wire/invocation.d.ts +4 -0
  334. package/dist/wire/invocation.d.ts.map +1 -0
  335. package/dist/wire/invocation.js +3 -0
  336. package/dist/wire/invocation.js.map +1 -0
  337. package/dist/{middleware/logger.d.ts → wire/loggerMiddleware.d.ts} +3 -3
  338. package/dist/wire/loggerMiddleware.d.ts.map +1 -0
  339. package/dist/{middleware/logger.js → wire/loggerMiddleware.js} +2 -2
  340. package/dist/wire/loggerMiddleware.js.map +1 -0
  341. package/dist/wire/middleware.d.ts +29 -0
  342. package/dist/wire/middleware.d.ts.map +1 -0
  343. package/dist/wire/middleware.js +20 -0
  344. package/dist/wire/middleware.js.map +1 -0
  345. package/dist/{operation.d.ts → wire/operation.d.ts} +39 -10
  346. package/dist/wire/operation.d.ts.map +1 -0
  347. package/dist/wire/operation.js +167 -0
  348. package/dist/wire/operation.js.map +1 -0
  349. package/package.json +24 -7
  350. package/dist/binding.d.ts.map +0 -1
  351. package/dist/binding.js.map +0 -1
  352. package/dist/boot.d.ts.map +0 -1
  353. package/dist/boot.js +0 -53
  354. package/dist/boot.js.map +0 -1
  355. package/dist/bootstrap.d.ts.map +0 -1
  356. package/dist/bootstrap.js +0 -879
  357. package/dist/bootstrap.js.map +0 -1
  358. package/dist/call.d.ts.map +0 -1
  359. package/dist/call.js.map +0 -1
  360. package/dist/collector.d.ts +0 -28
  361. package/dist/collector.d.ts.map +0 -1
  362. package/dist/collector.js +0 -32
  363. package/dist/collector.js.map +0 -1
  364. package/dist/crud.d.ts.map +0 -1
  365. package/dist/crud.js.map +0 -1
  366. package/dist/egress.d.ts +0 -52
  367. package/dist/egress.d.ts.map +0 -1
  368. package/dist/egress.js +0 -186
  369. package/dist/egress.js.map +0 -1
  370. package/dist/errors.d.ts.map +0 -1
  371. package/dist/errors.js.map +0 -1
  372. package/dist/handler-parser.d.ts.map +0 -1
  373. package/dist/handler-parser.js +0 -505
  374. package/dist/handler-parser.js.map +0 -1
  375. package/dist/invocation.d.ts +0 -20
  376. package/dist/invocation.d.ts.map +0 -1
  377. package/dist/invocation.js +0 -15
  378. package/dist/invocation.js.map +0 -1
  379. package/dist/middleware/error-handler.d.ts +0 -15
  380. package/dist/middleware/error-handler.d.ts.map +0 -1
  381. package/dist/middleware/error-handler.js +0 -29
  382. package/dist/middleware/error-handler.js.map +0 -1
  383. package/dist/middleware/logger.d.ts.map +0 -1
  384. package/dist/middleware/logger.js.map +0 -1
  385. package/dist/middleware.d.ts.map +0 -1
  386. package/dist/middleware.js.map +0 -1
  387. package/dist/mirror.d.ts +0 -93
  388. package/dist/mirror.d.ts.map +0 -1
  389. package/dist/mirror.js +0 -96
  390. package/dist/mirror.js.map +0 -1
  391. package/dist/operation.d.ts.map +0 -1
  392. package/dist/operation.js +0 -95
  393. package/dist/operation.js.map +0 -1
  394. package/dist/presenter.d.ts.map +0 -1
  395. package/dist/presenter.js.map +0 -1
  396. package/dist/remote.d.ts.map +0 -1
  397. package/dist/remote.js.map +0 -1
  398. package/dist/repository.d.ts +0 -55
  399. package/dist/repository.d.ts.map +0 -1
  400. package/dist/repository.js +0 -26
  401. package/dist/repository.js.map +0 -1
  402. package/dist/scan-cache.d.ts +0 -10
  403. package/dist/scan-cache.d.ts.map +0 -1
  404. package/dist/scan-cache.js.map +0 -1
  405. package/dist/scanner.d.ts +0 -34
  406. package/dist/scanner.d.ts.map +0 -1
  407. package/dist/scanner.js.map +0 -1
  408. package/dist/seed.d.ts.map +0 -1
  409. package/dist/seed.js.map +0 -1
  410. package/dist/types.d.ts +0 -421
  411. package/dist/types.d.ts.map +0 -1
  412. package/dist/types.js.map +0 -1
  413. /package/dist/{bootstrap.d.ts → boot/bootstrap.d.ts} +0 -0
  414. /package/dist/{types.js → boot/types.js} +0 -0
package/dist/verify.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { App } from './types.js';
1
+ import type { FrondDescriptor } from './scan/frond.js';
2
2
  /**
3
3
  * What a rule found in an app.
4
4
  *
@@ -9,6 +9,15 @@ import type { App } from './types.js';
9
9
  export interface Violation {
10
10
  /** Rule name, stable — 'cross-frond-dependency'. */
11
11
  rule: string;
12
+ /**
13
+ * What it costs, decided by the rule that raises it — never by whoever renders it.
14
+ *
15
+ * The two rules here are not the same animal: a cross-frond dependency resolves
16
+ * today and stops resolving the day the other frond answers over the wire, while a
17
+ * collector declared elsewhere is already wrong in one process. A reader holding a
18
+ * table of rule names would be a second opinion on a fact the rule already has.
19
+ */
20
+ severity: 'blocking' | 'warning';
12
21
  /** The frond the subject lives in. */
13
22
  frond: string;
14
23
  /** What violates it — 'PostHandler'. */
@@ -48,10 +57,14 @@ export interface Violation {
48
57
  *
49
58
  * Pure over `app.fronds`: no mount, no process, no file. Call it from a test.
50
59
  */
51
- export declare function verify(app: Pick<App, 'fronds'>): Violation[];
60
+ export declare function verify(app: {
61
+ fronds: readonly FrondDescriptor[];
62
+ }): Violation[];
52
63
  /**
53
64
  * The same verdict, as an assertion. Throws naming every rule that failed, so a
54
65
  * test is one line and its output is the sentence — not a diff of two objects.
55
66
  */
56
- export declare function assertSplittable(app: Pick<App, 'fronds'>): void;
67
+ export declare function assertSplittable(app: {
68
+ fronds: readonly FrondDescriptor[];
69
+ }): void;
57
70
  //# sourceMappingURL=verify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAmB,MAAM,YAAY,CAAC;AAMvD;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,SAAS,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;CACjB;AAwCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,SAAS,EAAE,CA+E5D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,IAAI,CAK/D"}
1
+ {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAOvD;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,QAAQ,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,SAAS,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;CACjB;AAwCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE;IAAE,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE,GAAG,SAAS,EAAE,CAiF/E;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE;IAAE,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE,GAAG,IAAI,CAKlF"}
package/dist/verify.js CHANGED
@@ -1,7 +1,8 @@
1
- import { repositoryKeyOf } from './repository.js';
1
+ import { registrationKeyOf } from '@fougere/schema';
2
+ import { repositoryKeyOf } from './prefab/repository.js';
2
3
  import { ormKeyOf } from './orm.js';
3
- import { presenterKeyOf } from './presenter.js';
4
- import { collectorKeyOf } from './collector.js';
4
+ import { presenterKeyOf } from './prefab/presenter.js';
5
+ import { collectorKeyOf } from './prefab/collector.js';
5
6
  /**
6
7
  * The container keys a frond registers in its own scope, keyed as a handler's
7
8
  * `deps` spell them — DI resolves by type name, so both sides are PascalCase.
@@ -18,7 +19,7 @@ function registrationsOf(frond) {
18
19
  for (const p of frond.presenters)
19
20
  put(presenterKeyOf(p.entityName), 'presenter');
20
21
  for (const c of frond.collectors)
21
- put(collectorKeyOf(c.entityName), 'collector');
22
+ put(collectorKeyOf(c.typeName), 'collector');
22
23
  for (const e of frond.entities) {
23
24
  put(ormKeyOf(e.name), 'ORM');
24
25
  put(repositoryKeyOf(e.name), 'repository');
@@ -65,7 +66,7 @@ export function verify(app) {
65
66
  const collectorFronds = new Map();
66
67
  for (const frond of app.fronds) {
67
68
  for (const c of frond.collectors)
68
- collectorFronds.set(c.entityName, frond.name);
69
+ collectorFronds.set(c.typeName, frond.name);
69
70
  }
70
71
  const violations = [];
71
72
  for (const frond of app.fronds) {
@@ -84,6 +85,7 @@ export function verify(app) {
84
85
  continue;
85
86
  violations.push({
86
87
  rule: 'cross-frond-dependency',
88
+ severity: 'warning',
87
89
  frond: frond.name,
88
90
  subject: subject.name,
89
91
  filePath: subject.filePath,
@@ -96,35 +98,36 @@ export function verify(app) {
96
98
  }
97
99
  }
98
100
  // Rule 2 — an operation parameter that wanted a collector this frond has not
99
- // got. `computeBindingPlan` gates the collector branch on the frond's OWN
100
- // collector set (`collectorEntityNames`, bootstrap.ts), then falls through to
101
- // branch 4, "Everything else body" (`computeBindingPlan`, binding.ts). So the
102
- // parameter does not go missing: it carries what the caller sent. Measured in
103
- // tests/collector-frond.test.ts.
104
- const own = new Set(frond.collectors.map((c) => c.entityName));
101
+ // got. The preliminary binding convention can only see this frond's collector
102
+ // set, so it produces body evidence. EffectiveOperation refuses that evidence
103
+ // before boot: another frond's collector proves the provenance is not a body.
104
+ const own = new Set(frond.collectors.map((c) => c.typeName));
105
105
  for (const handler of frond.handlers) {
106
106
  for (const [opName, op] of handler.operations) {
107
107
  for (const param of op.signature?.params ?? []) {
108
- const wanted = param.type.name.toLowerCase();
108
+ // Same key the scan writes and the binding plan looks up — `toLowerCase()`
109
+ // here missed a two-word type in BOTH directions: neither confirmed the
110
+ // collector was local nor found it elsewhere, so the rule reported nothing.
111
+ const wanted = registrationKeyOf(param.type.name);
109
112
  if (own.has(wanted))
110
113
  continue;
111
114
  const elsewhere = collectorFronds.get(wanted);
112
- // No collector anywhere for that type = an ordinary body parameter,
113
- // which is what branch 4 is FOR. Only a collector that exists in the
114
- // wrong place makes the fall-through a lie.
115
+ // No collector anywhere for that type may be an ordinary body parameter.
116
+ // Only a collector that exists in the wrong place makes that interpretation
117
+ // provably false.
115
118
  if (!elsewhere)
116
119
  continue;
117
120
  violations.push({
118
121
  rule: 'collector-in-another-frond',
122
+ severity: 'blocking',
119
123
  frond: frond.name,
120
124
  subject: `${handler.ctor.name}.${opName}(${param.name})`,
121
125
  filePath: handler.filePath,
122
126
  dependsOn: { key: collectorKeyOf(wanted), frond: elsewhere, kind: 'collector' },
123
127
  message: `'${param.name}' is typed ${param.type.name}, and the collector that produces one ` +
124
128
  `is declared in frond '${elsewhere}'. A binding plan only sees its own frond's ` +
125
- `collectors, so this parameter falls through to the request body — it receives ` +
126
- `what the CALLER sent. An op that judges it (\`if (${param.name}.role !== 'admin') throw\`) ` +
127
- `is judging the caller's own claim about themselves. ` +
129
+ `collectors, so the preliminary body interpretation is invalid. Fougere refuses ` +
130
+ `the operation before it can receive what the caller sent. ` +
128
131
  `Move the collector into '${frond.name}'.`,
129
132
  });
130
133
  }
@@ -1 +1 @@
1
- {"version":3,"file":"verify.js","sourceRoot":"","sources":["../src/verify.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAmChD;;;;;;;GAOG;AACH,SAAS,eAAe,CAAC,KAAsB;IAC7C,MAAM,GAAG,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC5C,MAAM,GAAG,GAAG,CAAC,GAAW,EAAE,IAAY,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,EA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AQ;wBAC1B,SAAS,EAAE,EAAE,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;wBAC/E,OAAO,EACL,IAAI,KAAK,CAAC,IAAI,cAAc,KAAK,CAAC,IAAI,CAAC,IAAI,wCAAwC;4BACnF,yBAAyB,SAAS,8CAA8C;4BAChF,iFAAiF;4BACjF,4DAA4D;4BAC5D,4BAA4B,KAAK,CAAC,IAAI,IAAI;qBAC7C,CAAC,CAAC;gBACL,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAA2C;IAC1E,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACpC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IAClH,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,CAAC,MAAM,uDAAuD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjH,CAAC"}
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import { type SchemaDescriptor } from '@fougere/schema';
10
10
  import type { InvocationContext } from './invocation.js';
11
- import type { App } from './types.js';
11
+ import type { App } from '../boot/types.js';
12
12
  /** Target of a call — which façade operation, wherever it lives. */
13
13
  export interface FrondCall {
14
14
  /** Frond name, when the caller knows it. Routing hint only. */
@@ -22,6 +22,29 @@ export interface FrondCall {
22
22
  export type Transport = (call: FrondCall, invocation: InvocationContext) => Promise<unknown>;
23
23
  /** Reserved namespace — calls the runner answers itself, never a façade. */
24
24
  export declare const RPC_ENTITY = "rpc";
25
+ /**
26
+ * What an `rpc` op answers — the door for what the app says about ITSELF, never about a row.
27
+ *
28
+ * `discover` is core's own, registered like any other (`bootstrap.ts`): a package declares
29
+ * its reading beside it, and an app that installed none serves none.
30
+ */
31
+ export type RpcAnswer = (invocation: InvocationContext, surface?: string) => unknown;
32
+ /**
33
+ * Everything a caller's envelope covers — the call as the sender meant it.
34
+ *
35
+ * Here and not beside the signing code because it is a CONTRACT: the sender binds it,
36
+ * the receiver re-presents what arrived, and a frond written in another language reads
37
+ * this shape without reading our crypto. `body` is bound by digest (arbitrary, possibly
38
+ * large), the rest by value — which is what keeps a canonical-JSON dependency out.
39
+ */
40
+ export interface SignedCall {
41
+ entity: string;
42
+ op: string;
43
+ params?: Record<string, unknown>;
44
+ query?: Record<string, unknown>;
45
+ body?: unknown;
46
+ state?: Record<string, unknown>;
47
+ }
25
48
  /**
26
49
  * One operation, as a stranger meets it — its name, what it is for, what it takes
27
50
  * and whether it reads or writes. Everything here already existed on the contract;
@@ -93,6 +116,52 @@ export interface IdentityCard {
93
116
  }>;
94
117
  }>;
95
118
  }
119
+ /** A frond this process knows about, and whether it runs here. */
120
+ export interface FrondPlacement {
121
+ frond: string;
122
+ placement: 'local' | 'remote';
123
+ entities: number;
124
+ doors: number;
125
+ }
126
+ /** One frond calling another — an edge of the graph, counted where the call was made. */
127
+ export interface Edge {
128
+ from: string;
129
+ to: string;
130
+ count: number;
131
+ errors: number;
132
+ }
133
+ /**
134
+ * The shape of the system as ONE process discovered it — the answer to `rpc.topology`.
135
+ *
136
+ * Here and not in the package that produces it, for the reason `SignedCall` is here: it
137
+ * crosses a process boundary, so a reader consumes it without depending on the producer.
138
+ * `@fougere/observability` fills it; a panel reads it; neither imports the other.
139
+ *
140
+ * Nothing in it is declared — a frond is `local` because this process scanned it, `remote`
141
+ * because it answered a call nobody here hosts. `remotes:` states an intent, and the two
142
+ * disagree exactly when something is misconfigured.
143
+ */
144
+ export interface TopologyReport {
145
+ /** When this process started counting — an edge count is read against it. */
146
+ since: number;
147
+ /** Calls running right now: the one signal a static shape cannot carry. */
148
+ active: number;
149
+ fronds: FrondPlacement[];
150
+ edges: Edge[];
151
+ }
152
+ /**
153
+ * The shape a card must have to be walked — `fronds`, and each frond's `doors`.
154
+ *
155
+ * A card crosses a process boundary, so it is judged like anything else that does.
156
+ * The check lives beside the type because two readers walk it: the boot indexes a
157
+ * remote's doors, and `fougere sync` writes classes from them. `TypeError:
158
+ * card.fronds is not iterable` was what a malformed card produced at the boot,
159
+ * naming neither the remote nor the address.
160
+ *
161
+ * The descriptor behind a door is NOT checked here — `reconstruct` refuses it, and
162
+ * only where one is consumed.
163
+ */
164
+ export declare function assertIdentityCard(value: unknown, source: string): IdentityCard;
96
165
  /**
97
166
  * The door built in front of a handler — the framework's second port, after `EntityOrm`.
98
167
  *
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/wire/call.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAA8B,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAG5C,oEAAoE;AACpE,MAAM,WAAW,SAAS;IACxB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,2FAA2F;AAC3F,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,iBAAiB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE7F,4EAA4E;AAC5E,eAAO,MAAM,UAAU,QAAQ,CAAC;AAEhC;;;;;GA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gB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,YAAY,CA6CvE;AAqCD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAEvE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAErE"}
@@ -7,11 +7,44 @@
7
7
  * they never reshape it.
8
8
  */
9
9
  import { describe as describeSchema } from '@fougere/schema';
10
- import { factsAnnouncedBy } from './emit.js';
11
- import { FougereError, ErrorCode } from './middleware.js';
12
- import { resolveIsReadOp } from './operation.js';
10
+ import { factsAnnouncedBy } from '../emit.js';
11
+ import { FougereError, ErrorCode } from './errors.js';
12
+ import { createTransportEntry } from '../entry/TransportEntry.js';
13
13
  /** Reserved namespace — calls the runner answers itself, never a façade. */
14
14
  export const RPC_ENTITY = 'rpc';
15
+ /**
16
+ * The shape a card must have to be walked — `fronds`, and each frond's `doors`.
17
+ *
18
+ * A card crosses a process boundary, so it is judged like anything else that does.
19
+ * The check lives beside the type because two readers walk it: the boot indexes a
20
+ * remote's doors, and `fougere sync` writes classes from them. `TypeError:
21
+ * card.fronds is not iterable` was what a malformed card produced at the boot,
22
+ * naming neither the remote nor the address.
23
+ *
24
+ * The descriptor behind a door is NOT checked here — `reconstruct` refuses it, and
25
+ * only where one is consumed.
26
+ */
27
+ export function assertIdentityCard(value, source) {
28
+ const card = value;
29
+ const fronds = Array.isArray(card?.fronds) ? card.fronds : undefined;
30
+ if (!fronds)
31
+ throw cardRefusal(source, 'no fronds array');
32
+ for (const frond of fronds) {
33
+ if (!frond || typeof frond.name !== 'string')
34
+ throw cardRefusal(source, 'a frond with no name');
35
+ if (!Array.isArray(frond.doors))
36
+ throw cardRefusal(source, `frond '${frond.name}' has no valid doors array`);
37
+ }
38
+ return card;
39
+ }
40
+ function cardRefusal(source, what) {
41
+ return new FougereError({
42
+ code: ErrorCode.INTERNAL_ERROR,
43
+ message: `${source} answered an invalid identity card: ${what}.\n`
44
+ + ` A card is what tells this process what the other one hosts, so nothing can be routed from it.\n`
45
+ + ` - Check that the address serves a Fougere app, and that its version still speaks this card.`,
46
+ });
47
+ }
15
48
  /**
16
49
  * The container key of a façade — THE one place that spells the format.
17
50
  *
@@ -55,11 +88,7 @@ export function contractsKeyOf(entityName, surface) {
55
88
  * named surface, an entity with no façade of its own is simply not there.
56
89
  */
57
90
  export function identityCardOf(app, surface) {
58
- /**
59
- * Every entity of every frond, by name — a fact is announced where it is USED, which is
60
- * not always where it is declared. Same reason the boot builds this map to judge one.
61
- */
62
- const declared = new Map(app.fronds.flatMap((frond) => frond.entities.map((entity) => [entity.name, entity.entityClass])));
91
+ const declared = app.fronds.schemas();
63
92
  return {
64
93
  fronds: app.fronds.map((frond) => {
65
94
  // What the frond answers to, not what it stores. This walked `frond.entities`, so a
@@ -111,29 +140,23 @@ function facadeOps(app, entityName, surface) {
111
140
  catch {
112
141
  return [];
113
142
  }
114
- // The façade is the list of names; the contracts are the terms. Registered
115
- // together, so a door that serves fewer ops also describes fewer.
116
- let contracts;
117
- try {
118
- contracts = app.container.resolve(contractsKeyOf(entityName, surface));
119
- }
120
- catch {
121
- contracts = undefined;
143
+ // The façade is the list of names; the model is the resolved terms.
144
+ const effective = app.operationsFor(entityName, surface);
145
+ if (!effective) {
146
+ throw new Error(`Facade '${facadeKeyOf(entityName, surface)}' exists without an effective operation table.`);
122
147
  }
123
- // `resolveIsReadOp` takes the overrides for a reason: `kind` is exactly the field
124
- // frond.config.ts exists to state, for the op whose name the convention reads wrong.
125
- // Called without them, the card announced `query` for an op its own author had
126
- // declared a command — and the card is what a remote consumer builds its calls on.
127
- const overrides = app.fronds.find((f) => f.entities.some((e) => e.name === entityName))?.operationsOverrides;
128
148
  return Object.keys(facade).map((name) => {
129
- const contract = contracts?.get(name);
149
+ const contract = effective.get(name);
150
+ if (!contract) {
151
+ throw new Error(`Facade '${facadeKeyOf(entityName, surface)}' serves '${name}' without an effective contract.`);
152
+ }
130
153
  return {
131
154
  name,
132
155
  ...(contract?.description && { description: contract.description }),
133
156
  ...(contract?.input && { input: describeSchema(contract.input, name) }),
134
157
  ...(contract?.output && { output: describeSchema(contract.output, name) }),
135
158
  ...(contract?.cardinality && { cardinality: contract.cardinality }),
136
- kind: resolveIsReadOp(name, overrides) ? 'query' : 'command',
159
+ kind: contract.kind,
137
160
  };
138
161
  });
139
162
  }
@@ -144,7 +167,7 @@ function facadeOps(app, entityName, surface) {
144
167
  * judged here. A miss is a typed NOT_FOUND, never a forward to another remote.
145
168
  */
146
169
  export function createLocalRunner(app, surface) {
147
- return runnerFor(app, (key) => app.container.resolve(key), surface);
170
+ return createTransportEntry(app.local, surface);
148
171
  }
149
172
  /**
150
173
  * Build the app runner — same judgment, but resolution follows the app's
@@ -159,56 +182,6 @@ export function createLocalRunner(app, surface) {
159
182
  * is simply which URL `remotes:` points at.
160
183
  */
161
184
  export function createAppRunner(app, surface) {
162
- return runnerFor(app, (key) => app.resolve(key), surface);
163
- }
164
- function runnerFor(app, resolveFacade, surface) {
165
- return async (call, invocation) => {
166
- if (call.entity === RPC_ENTITY) {
167
- if (call.op === 'discover')
168
- return identityCardOf(app, surface);
169
- throw new FougereError({
170
- code: ErrorCode.NOT_FOUND,
171
- message: `Unknown rpc operation '${call.op}'`,
172
- entity: RPC_ENTITY,
173
- operation: call.op,
174
- });
175
- }
176
- let facade;
177
- try {
178
- facade = resolveFacade(facadeKeyOf(call.entity, surface));
179
- }
180
- catch {
181
- // What IS hosted, so a wrong entity name (or a missing frond) reads at a glance.
182
- const hosted = app.fronds.flatMap((frond) => frond.entities.map((e) => e.name)).sort();
183
- throw new FougereError({
184
- code: ErrorCode.NOT_FOUND,
185
- message: (surface
186
- ? `Entity '${call.entity}' is not served on surface '${surface}'`
187
- : `Entity '${call.entity}' is not hosted here`)
188
- + (hosted.length ? `. Hosted here: ${hosted.join(', ')}.` : '. This app hosts no entity.'),
189
- entity: call.entity,
190
- operation: call.op,
191
- });
192
- }
193
- // Own properties only: a façade is a plain object, so a bare lookup reaches
194
- // Object.prototype — `constructor` echoed the invocation back, `toString`
195
- // answered. An op is what the façade declares, not what JS inherits.
196
- const fn = Object.hasOwn(facade, call.op) ? facade[call.op] : undefined;
197
- if (typeof fn !== 'function') {
198
- // Name what IS served: the façade is right here, and `op` is a bare string all
199
- // the way from `useQuery` — so a typo is the ordinary case, not the exotic one.
200
- const served = Object.keys(facade).filter((key) => typeof facade[key] === 'function');
201
- throw new FougereError({
202
- code: ErrorCode.NOT_FOUND,
203
- message: `Unknown operation '${call.op}' on '${call.entity}'. `
204
- + (served.length ? `It serves ${served.join(', ')}.` : 'It serves nothing.'),
205
- entity: call.entity,
206
- operation: call.op,
207
- });
208
- }
209
- // A call's result is JSON-shaped: undefined has no wire form, it
210
- // normalizes to null at the contract edge — identically on every transport.
211
- return (await fn(invocation)) ?? null;
212
- };
185
+ return createTransportEntry(app, surface);
213
186
  }
214
187
  //# sourceMappingURL=call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.js","sourceRoot":"","sources":["../../src/wire/call.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAyB,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAelE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC;AAqIhC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc,EAAE,MAAc;IAC/D,MAAM,IAAI,GAAG,KAAiC,CAAC;IAC/C,MAAM,MAAM,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,kCAAkC,CAC/F,CAAC;QACJ,CAAC;QAED,OAAO;YACL,IAAI;YACJ,GAAG,CAAC,QAAQ,EAAE,WAAW,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC;YACnE,GAAG,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;YACvE,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;YAC1E,GAAG,CAAC,QAAQ,EAAE,WAAW,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC;YACnE,IAAI,EAAE,QAAQ,CAAC,IAAI;SACpB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAQ,EAAE,OAAgB;IAC1D,OAAO,oBAAoB,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,GAAQ,EAAE,OAAgB;IACxD,OAAO,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAC5C,CAAC"}
@@ -1,22 +1,12 @@
1
1
  /**
2
- * App-level middlewareintercepts handler facade operations.
2
+ * The error vocabulary what a refusal IS, independently of who hears it.
3
3
  *
4
- * Works regardless of entry point (HTTP, Nitro, event bus, CLI, tests).
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.
5
8
  */
6
- export interface OperationContext {
7
- /** Entity name (e.g. 'product'). */
8
- entity: string;
9
- /** Operation name (e.g. 'create', 'findById', 'searchByTitle'). */
10
- operation: string;
11
- /** Arguments passed to the operation. */
12
- args: unknown[];
13
- /** Extensible bag — middlewares deposit data here (user, permissions, etc.). */
14
- state: Record<string, unknown>;
15
- /** Transport-agnostic invocation context (params, query, body, state). */
16
- invocation?: import('./invocation.js').InvocationContext;
17
- }
18
- export type AppNext = () => Promise<unknown>;
19
- export type AppMiddleware = (ctx: OperationContext, next: AppNext) => Promise<unknown>;
9
+ import type { ValidationError } from '@fougere/schema';
20
10
  /** Semantic error codes — transport-agnostic. Each bridge maps them to its own format. */
21
11
  export declare enum ErrorCode {
22
12
  VALIDATION_FAILED = "VALIDATION_FAILED",
@@ -69,7 +59,16 @@ export declare class FougereError extends Error {
69
59
  static fromJSON(json: unknown): FougereError;
70
60
  }
71
61
  /**
72
- * Execute a middleware chain (onion model) then the handler.
62
+ * The refusals behind a VALIDATION_FAILED, or nothing the ONE place that reads
63
+ * `details` under that code.
64
+ *
65
+ * `details` is `unknown` because it is genuinely polymorphic: `StorageGuard.judge` puts a
66
+ * `string[]` there under INTERNAL_ERROR, `fromJSON` puts `{ originalCode, details }`
67
+ * there for a code it does not know. So the shape is not the field's, it is a reading
68
+ * of the PAIR (code, details) — which is why this is a reader and not a narrower type.
69
+ *
70
+ * It judges rather than casts: five call sites asserted `{ path, message }[]` by hand,
71
+ * and a malformed VALIDATION_FAILED would have been accepted as structured refusals.
73
72
  */
74
- export declare function runMiddlewares(middlewares: AppMiddleware[], ctx: OperationContext, handler: AppNext): Promise<unknown>;
75
- //# sourceMappingURL=middleware.d.ts.map
73
+ export declare function validationErrorsOf(error: unknown): ValidationError[] | undefined;
74
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/wire/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIvD,0FAA0F;AAC1F,oBAAY,SAAS;IAEnB,iBAAiB,sBAAsB;IACvC,WAAW,gBAAgB;IAG3B,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IAGvB,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,kBAAkB,uBAAuB;IAGzC,mBAAmB,wBAAwB;IAC3C,iBAAiB,sBAAsB;IACvC,oBAAoB,yBAAyB;IAC7C,iBAAiB,sBAAsB;IACvC,eAAe,oBAAoB;IAGnC,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAC3B,mBAAmB,wBAAwB;IAC3C,eAAe,oBAAoB;CACpC;AAID,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;gBAEf,OAAO,EAAE,mBAAmB;IASxC,MAAM;;;;;;;IAUN;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY;CAW7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,eAAe,EAAE,GAAG,SAAS,CAWhF"}
@@ -1,7 +1,10 @@
1
1
  /**
2
- * App-level middlewareintercepts handler facade operations.
2
+ * The error vocabulary what a refusal IS, independently of who hears it.
3
3
  *
4
- * Works regardless of entry point (HTTP, Nitro, event bus, CLI, tests).
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.
5
8
  */
6
9
  // ── ErrorCode ──────────────────────────────────
7
10
  /** Semantic error codes — transport-agnostic. Each bridge maps them to its own format. */
@@ -72,18 +75,27 @@ export class FougereError extends Error {
72
75
  });
73
76
  }
74
77
  }
75
- // ── Runner ──────────────────────────────────────
76
78
  /**
77
- * Execute a middleware chain (onion model) then the handler.
79
+ * The refusals behind a VALIDATION_FAILED, or nothing the ONE place that reads
80
+ * `details` under that code.
81
+ *
82
+ * `details` is `unknown` because it is genuinely polymorphic: `StorageGuard.judge` puts a
83
+ * `string[]` there under INTERNAL_ERROR, `fromJSON` puts `{ originalCode, details }`
84
+ * there for a code it does not know. So the shape is not the field's, it is a reading
85
+ * of the PAIR (code, details) — which is why this is a reader and not a narrower type.
86
+ *
87
+ * It judges rather than casts: five call sites asserted `{ path, message }[]` by hand,
88
+ * and a malformed VALIDATION_FAILED would have been accepted as structured refusals.
78
89
  */
79
- export function runMiddlewares(middlewares, ctx, handler) {
80
- let index = 0;
81
- const next = () => {
82
- if (index < middlewares.length) {
83
- return middlewares[index++](ctx, next);
84
- }
85
- return handler();
86
- };
87
- return next();
90
+ export function validationErrorsOf(error) {
91
+ if (!(error instanceof FougereError) || error.code !== ErrorCode.VALIDATION_FAILED)
92
+ return undefined;
93
+ const { details } = error;
94
+ if (!Array.isArray(details))
95
+ return undefined;
96
+ const refusals = details.filter((entry) => typeof entry === 'object' && entry !== null
97
+ && typeof entry.path === 'string'
98
+ && typeof entry.message === 'string');
99
+ return refusals.length === details.length ? refusals : undefined;
88
100
  }
89
- //# sourceMappingURL=middleware.js.map
101
+ //# sourceMappingURL=errors.js.map
@@ -0,0 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C,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;SAChF,CAAC,CAAC;IACL,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,IAAI,CAAC,CAAC,KAAK,YAAY,YAAY,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,iBAAiB;QAAE,OAAO,SAAS,CAAC;IACrG,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAC7B,CAAC,KAAK,EAA4B,EAAE,CAClC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;WACxC,OAAQ,KAAyB,CAAC,IAAI,KAAK,QAAQ;WACnD,OAAQ,KAAyB,CAAC,OAAO,KAAK,QAAQ,CAC5D,CAAC;IACF,OAAO,QAAQ,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC"}
@@ -1,11 +1,10 @@
1
1
  /**
2
- * HTTP error mapping — used by HTTP bridges (REST, Next, Inertia).
2
+ * HTTP reading of an error — used by HTTP bridges (REST, Next, Inertia).
3
3
  *
4
- * Not imported by GraphQL, CLI, or event bus bridges.
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.
5
6
  */
6
- import { FougereError, ErrorCode } from './middleware.js';
7
- /** Map a FougereError code to its HTTP status. */
8
- export declare function httpStatusFor(code: ErrorCode): number;
7
+ import { FougereError } from './errors.js';
9
8
  /**
10
9
  * Serialize an application error for an untrusted caller.
11
10
  *
@@ -19,4 +18,4 @@ export declare function toHttpError(err: unknown): {
19
18
  status: number;
20
19
  body: ReturnType<FougereError['toJSON']>;
21
20
  };
22
- //# sourceMappingURL=errors.d.ts.map
21
+ //# sourceMappingURL=http-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-error.d.ts","sourceRoot":"","sources":["../../src/wire/http-error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAa,MAAM,aAAa,CAAC;AAsCtD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAUnF;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAA;CAAE,CAYtG"}
@@ -1,10 +1,11 @@
1
1
  /**
2
- * HTTP error mapping — used by HTTP bridges (REST, Next, Inertia).
2
+ * HTTP reading of an error — used by HTTP bridges (REST, Next, Inertia).
3
3
  *
4
- * Not imported by GraphQL, CLI, or event bus bridges.
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.
5
6
  */
6
- import { FougereError, ErrorCode } from './middleware.js';
7
- import { Logger } from './builtins/logger.js';
7
+ import { FougereError, ErrorCode } from './errors.js';
8
+ import { Logger } from '../builtins/logger.js';
8
9
  /**
9
10
  * An INTERNAL_ERROR is the one class of error whose message never leaves: it was not
10
11
  * written for a caller and may quote a path, a query or a row. Masking it is right, and
@@ -35,7 +36,7 @@ const HTTP_STATUS = {
35
36
  [ErrorCode.GATEWAY_TIMEOUT]: 504,
36
37
  };
37
38
  /** Map a FougereError code to its HTTP status. */
38
- export function httpStatusFor(code) {
39
+ function httpStatusFor(code) {
39
40
  return HTTP_STATUS[code] ?? 500;
40
41
  }
41
42
  /**
@@ -71,4 +72,4 @@ export function toHttpError(err) {
71
72
  });
72
73
  return { status: 500, body: toPublicError(framed) };
73
74
  }
74
- //# sourceMappingURL=errors.js.map
75
+ //# sourceMappingURL=http-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-error.js","sourceRoot":"","sources":["../../src/wire/http-error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C;;;;;;GAMG;AACH,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;AAEhC,MAAM,WAAW,GAA8B;IAC7C,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,GAAG;IAClC,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,GAAG;IAC5B,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,GAAG;IAC7B,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,GAAG;IAC1B,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,GAAG;IAC1B,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,GAAG;IACrB,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,GAAG;IACzB,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,GAAG;IACvB,CAAC,SAAS,CAAC,kBAAkB,CAAC,EAAE,GAAG;IACnC,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,GAAG;IACpC,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,GAAG;IAClC,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,GAAG;IACrC,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,GAAG;IAClC,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,GAAG;IAChC,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,GAAG;IAC/B,CAAC,SAAS,CAAC,eAAe,CAAC,EAAE,GAAG;IAChC,CAAC,SAAS,CAAC,WAAW,CAAC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AAC;QAC9B,IAAI,EAAE,SAAS,CAAC,cAAc;QAC9B,OAAO,EAAG,GAA4B,EAAE,OAAO,IAAI,gBAAgB;QACnE,KAAK,EAAE,GAAG;KACX,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;AACtD,CAAC"}
@@ -0,0 +1,4 @@
1
+ /** Compatibility entry point. New code imports the invocation value from contract. */
2
+ export { Invocation, EMPTY_INVOCATION, canonicalInvocation, } from '../contract/Invocation.js';
3
+ export type { InvocationContext, InvocationInput, } from '../contract/Invocation.js';
4
+ //# sourceMappingURL=invocation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invocation.d.ts","sourceRoot":"","sources":["../../src/wire/invocation.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAC"}