@fougere/core 0.6.0-alpha.0 → 0.7.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (493) hide show
  1. package/README.md +1 -1
  2. package/dist/boot/Emissions.d.ts +13 -90
  3. package/dist/boot/Emissions.d.ts.map +1 -1
  4. package/dist/boot/Emissions.js +21 -118
  5. package/dist/boot/Emissions.js.map +1 -1
  6. package/dist/boot/ambient-port.d.ts +3 -24
  7. package/dist/boot/ambient-port.d.ts.map +1 -1
  8. package/dist/boot/ambient.als.d.ts.map +1 -1
  9. package/dist/boot/ambient.als.js +7 -12
  10. package/dist/boot/ambient.als.js.map +1 -1
  11. package/dist/boot/ambient.queue.d.ts +2 -5
  12. package/dist/boot/ambient.queue.d.ts.map +1 -1
  13. package/dist/boot/ambient.queue.js.map +1 -1
  14. package/dist/boot/apply.d.ts +1 -13
  15. package/dist/boot/apply.d.ts.map +1 -1
  16. package/dist/boot/apply.js +3 -15
  17. package/dist/boot/apply.js.map +1 -1
  18. package/dist/boot/auth.d.ts +2 -12
  19. package/dist/boot/auth.d.ts.map +1 -1
  20. package/dist/boot/boot.d.ts +3 -16
  21. package/dist/boot/boot.d.ts.map +1 -1
  22. package/dist/boot/boot.js +3 -10
  23. package/dist/boot/boot.js.map +1 -1
  24. package/dist/boot/bootstrap.d.ts.map +1 -1
  25. package/dist/boot/bootstrap.js +61 -127
  26. package/dist/boot/bootstrap.js.map +1 -1
  27. package/dist/boot/card.d.ts +1 -17
  28. package/dist/boot/card.d.ts.map +1 -1
  29. package/dist/boot/card.js +3 -32
  30. package/dist/boot/card.js.map +1 -1
  31. package/dist/boot/frame.d.ts +8 -32
  32. package/dist/boot/frame.d.ts.map +1 -1
  33. package/dist/boot/frame.js +20 -54
  34. package/dist/boot/frame.js.map +1 -1
  35. package/dist/boot/hosted.d.ts +2 -24
  36. package/dist/boot/hosted.d.ts.map +1 -1
  37. package/dist/boot/hosted.js +10 -15
  38. package/dist/boot/hosted.js.map +1 -1
  39. package/dist/boot/ownership.d.ts +3 -36
  40. package/dist/boot/ownership.d.ts.map +1 -1
  41. package/dist/boot/ownership.js +5 -40
  42. package/dist/boot/ownership.js.map +1 -1
  43. package/dist/boot/ports.d.ts +1 -14
  44. package/dist/boot/ports.d.ts.map +1 -1
  45. package/dist/boot/ports.js +1 -14
  46. package/dist/boot/ports.js.map +1 -1
  47. package/dist/boot/remote.d.ts +5 -38
  48. package/dist/boot/remote.d.ts.map +1 -1
  49. package/dist/boot/remote.js +8 -41
  50. package/dist/boot/remote.js.map +1 -1
  51. package/dist/boot/runner.d.ts +4 -21
  52. package/dist/boot/runner.d.ts.map +1 -1
  53. package/dist/boot/runner.js +4 -17
  54. package/dist/boot/runner.js.map +1 -1
  55. package/dist/boot/seed.d.ts +4 -31
  56. package/dist/boot/seed.d.ts.map +1 -1
  57. package/dist/boot/seed.js +6 -37
  58. package/dist/boot/seed.js.map +1 -1
  59. package/dist/boot/statement-drift.d.ts +2 -21
  60. package/dist/boot/statement-drift.d.ts.map +1 -1
  61. package/dist/boot/statement-drift.js +4 -9
  62. package/dist/boot/statement-drift.js.map +1 -1
  63. package/dist/boot/together.d.ts +4 -8
  64. package/dist/boot/together.d.ts.map +1 -1
  65. package/dist/boot/together.js +15 -50
  66. package/dist/boot/together.js.map +1 -1
  67. package/dist/boot/types.d.ts +28 -173
  68. package/dist/boot/types.d.ts.map +1 -1
  69. package/dist/builtin/config.d.ts +7 -0
  70. package/dist/builtin/config.d.ts.map +1 -0
  71. package/dist/builtin/config.js +15 -0
  72. package/dist/builtin/config.js.map +1 -0
  73. package/dist/{builtins → builtin}/logger.d.ts +4 -25
  74. package/dist/builtin/logger.d.ts.map +1 -0
  75. package/dist/{builtins → builtin}/logger.js +5 -32
  76. package/dist/builtin/logger.js.map +1 -0
  77. package/dist/config-loader.d.ts +9 -67
  78. package/dist/config-loader.d.ts.map +1 -1
  79. package/dist/config-loader.js +5 -18
  80. package/dist/config-loader.js.map +1 -1
  81. package/dist/contract.d.ts +13 -31
  82. package/dist/contract.d.ts.map +1 -1
  83. package/dist/contract.js +10 -26
  84. package/dist/contract.js.map +1 -1
  85. package/dist/crypto/encoding.d.ts +2 -15
  86. package/dist/crypto/encoding.d.ts.map +1 -1
  87. package/dist/crypto/encoding.js +2 -15
  88. package/dist/crypto/encoding.js.map +1 -1
  89. package/dist/crypto/node.d.ts.map +1 -1
  90. package/dist/crypto/node.js +1 -7
  91. package/dist/crypto/node.js.map +1 -1
  92. package/dist/crypto/port.d.ts +2 -18
  93. package/dist/crypto/port.d.ts.map +1 -1
  94. package/dist/crypto/port.js +1 -17
  95. package/dist/crypto/port.js.map +1 -1
  96. package/dist/crypto/webcrypto.d.ts.map +1 -1
  97. package/dist/crypto/webcrypto.js +1 -12
  98. package/dist/crypto/webcrypto.js.map +1 -1
  99. package/dist/declare.d.ts +6 -36
  100. package/dist/declare.d.ts.map +1 -1
  101. package/dist/declare.js +4 -29
  102. package/dist/declare.js.map +1 -1
  103. package/dist/define.d.ts +2 -3
  104. package/dist/define.d.ts.map +1 -1
  105. package/dist/define.js +2 -3
  106. package/dist/define.js.map +1 -1
  107. package/dist/descriptor/Fronds.d.ts +3 -28
  108. package/dist/descriptor/Fronds.d.ts.map +1 -1
  109. package/dist/descriptor/Fronds.js +6 -31
  110. package/dist/descriptor/Fronds.js.map +1 -1
  111. package/dist/descriptor/frond.d.ts +14 -63
  112. package/dist/descriptor/frond.d.ts.map +1 -1
  113. package/dist/dispatch/ArgumentResolver.d.ts +1 -1
  114. package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
  115. package/dist/dispatch/ArgumentResolver.js +5 -5
  116. package/dist/dispatch/ArgumentResolver.js.map +1 -1
  117. package/dist/dispatch/DispatchEvent.d.ts +2 -2
  118. package/dist/dispatch/DispatchEvent.d.ts.map +1 -1
  119. package/dist/dispatch/DispatchLifecycle.d.ts +1 -7
  120. package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -1
  121. package/dist/dispatch/DispatchLifecycle.js +1 -7
  122. package/dist/dispatch/DispatchLifecycle.js.map +1 -1
  123. package/dist/dispatch/DispatchPort.d.ts +1 -1
  124. package/dist/dispatch/DispatchPort.d.ts.map +1 -1
  125. package/dist/dispatch/Dispatcher.d.ts +1 -1
  126. package/dist/dispatch/Dispatcher.d.ts.map +1 -1
  127. package/dist/dispatch/Dispatcher.js +2 -2
  128. package/dist/dispatch/Dispatcher.js.map +1 -1
  129. package/dist/{boot → dispatch}/HandlerFacade.d.ts +25 -38
  130. package/dist/dispatch/HandlerFacade.d.ts.map +1 -0
  131. package/dist/{boot → dispatch}/HandlerFacade.js +65 -74
  132. package/dist/dispatch/HandlerFacade.js.map +1 -0
  133. package/dist/dispatch/LocalRoutePolicy.d.ts +1 -1
  134. package/dist/dispatch/LocalRoutePolicy.d.ts.map +1 -1
  135. package/dist/dispatch/LocalRoutePolicy.js +4 -4
  136. package/dist/dispatch/LocalRoutePolicy.js.map +1 -1
  137. package/dist/dispatch/OperationRoute.d.ts +2 -2
  138. package/dist/dispatch/OperationRoute.d.ts.map +1 -1
  139. package/dist/dispatch/OutputView.d.ts +3 -2
  140. package/dist/dispatch/OutputView.d.ts.map +1 -1
  141. package/dist/dispatch/OutputView.js +19 -1
  142. package/dist/dispatch/OutputView.js.map +1 -1
  143. package/dist/dispatch/Route.d.ts +2 -2
  144. package/dist/dispatch/Route.d.ts.map +1 -1
  145. package/dist/dispatch/RoutePolicy.d.ts +1 -1
  146. package/dist/dispatch/RoutePolicy.d.ts.map +1 -1
  147. package/dist/dispatch/RouteRegistry.d.ts +1 -1
  148. package/dist/dispatch/RouteRegistry.d.ts.map +1 -1
  149. package/dist/dispatch/RouteRegistry.js +2 -2
  150. package/dist/dispatch/RouteRegistry.js.map +1 -1
  151. package/dist/dispatch/RouteResolver.d.ts +2 -4
  152. package/dist/dispatch/RouteResolver.d.ts.map +1 -1
  153. package/dist/dispatch/StorageGuard.d.ts +8 -7
  154. package/dist/dispatch/StorageGuard.d.ts.map +1 -1
  155. package/dist/dispatch/StorageGuard.js +61 -18
  156. package/dist/dispatch/StorageGuard.js.map +1 -1
  157. package/dist/dispatch/presenterArguments.d.ts +7 -0
  158. package/dist/dispatch/presenterArguments.d.ts.map +1 -0
  159. package/dist/dispatch/presenterArguments.js +12 -0
  160. package/dist/dispatch/presenterArguments.js.map +1 -0
  161. package/dist/dispatch/remoteRoutes.d.ts +7 -0
  162. package/dist/dispatch/remoteRoutes.d.ts.map +1 -0
  163. package/dist/dispatch/{RemoteRouteResolver.js → remoteRoutes.js} +6 -10
  164. package/dist/dispatch/remoteRoutes.js.map +1 -0
  165. package/dist/dispatch/routeNotFound.d.ts +9 -0
  166. package/dist/dispatch/routeNotFound.d.ts.map +1 -0
  167. package/dist/dispatch/routeNotFound.js +21 -0
  168. package/dist/dispatch/routeNotFound.js.map +1 -0
  169. package/dist/dispatch/validateInput.d.ts +5 -0
  170. package/dist/dispatch/validateInput.d.ts.map +1 -0
  171. package/dist/dispatch/validateInput.js +20 -0
  172. package/dist/dispatch/validateInput.js.map +1 -0
  173. package/dist/effective-operation.d.ts +1 -24
  174. package/dist/effective-operation.d.ts.map +1 -1
  175. package/dist/effective-operation.js +21 -50
  176. package/dist/effective-operation.js.map +1 -1
  177. package/dist/emit.d.ts +4 -42
  178. package/dist/emit.d.ts.map +1 -1
  179. package/dist/emit.js +3 -39
  180. package/dist/emit.js.map +1 -1
  181. package/dist/entry/facade.d.ts +8 -0
  182. package/dist/entry/facade.d.ts.map +1 -0
  183. package/dist/entry/facade.js +28 -0
  184. package/dist/entry/facade.js.map +1 -0
  185. package/dist/entry/transport.d.ts +5 -0
  186. package/dist/entry/transport.d.ts.map +1 -0
  187. package/dist/entry/transport.js +11 -0
  188. package/dist/entry/transport.js.map +1 -0
  189. package/dist/frond-config.d.ts +7 -70
  190. package/dist/frond-config.d.ts.map +1 -1
  191. package/dist/frond-config.js +1 -9
  192. package/dist/frond-config.js.map +1 -1
  193. package/dist/identity-keys.d.ts +2 -5
  194. package/dist/identity-keys.d.ts.map +1 -1
  195. package/dist/identity-keys.js +3 -16
  196. package/dist/identity-keys.js.map +1 -1
  197. package/dist/identity.d.ts +4 -30
  198. package/dist/identity.d.ts.map +1 -1
  199. package/dist/identity.js +11 -73
  200. package/dist/identity.js.map +1 -1
  201. package/dist/imports.d.ts +1 -7
  202. package/dist/imports.d.ts.map +1 -1
  203. package/dist/imports.js +1 -7
  204. package/dist/imports.js.map +1 -1
  205. package/dist/index.d.ts +17 -24
  206. package/dist/index.d.ts.map +1 -1
  207. package/dist/index.js +10 -18
  208. package/dist/index.js.map +1 -1
  209. package/dist/loader.d.ts +1 -8
  210. package/dist/loader.d.ts.map +1 -1
  211. package/dist/loader.js +1 -8
  212. package/dist/loader.js.map +1 -1
  213. package/dist/node.d.ts +2 -11
  214. package/dist/node.d.ts.map +1 -1
  215. package/dist/node.js +2 -11
  216. package/dist/node.js.map +1 -1
  217. package/dist/prefab/collector.d.ts +1 -22
  218. package/dist/prefab/collector.d.ts.map +1 -1
  219. package/dist/prefab/collector.js +1 -22
  220. package/dist/prefab/collector.js.map +1 -1
  221. package/dist/prefab/crud.d.ts +16 -32
  222. package/dist/prefab/crud.d.ts.map +1 -1
  223. package/dist/prefab/crud.js +31 -58
  224. package/dist/prefab/crud.js.map +1 -1
  225. package/dist/prefab/mirror.d.ts +2 -24
  226. package/dist/prefab/mirror.d.ts.map +1 -1
  227. package/dist/prefab/mirror.js +2 -20
  228. package/dist/prefab/mirror.js.map +1 -1
  229. package/dist/prefab/prefab.d.ts +1 -7
  230. package/dist/prefab/prefab.d.ts.map +1 -1
  231. package/dist/prefab/prefab.js +1 -7
  232. package/dist/prefab/prefab.js.map +1 -1
  233. package/dist/prefab/presenter.d.ts +2 -36
  234. package/dist/prefab/presenter.d.ts.map +1 -1
  235. package/dist/prefab/presenter.js +2 -36
  236. package/dist/prefab/presenter.js.map +1 -1
  237. package/dist/prefab/repository.d.ts +5 -73
  238. package/dist/prefab/repository.d.ts.map +1 -1
  239. package/dist/prefab/repository.js +3 -16
  240. package/dist/prefab/repository.js.map +1 -1
  241. package/dist/scan/adapters.d.ts +3 -0
  242. package/dist/scan/adapters.d.ts.map +1 -0
  243. package/dist/scan/adapters.js +25 -0
  244. package/dist/scan/adapters.js.map +1 -0
  245. package/dist/scan/bundling.d.ts +1 -12
  246. package/dist/scan/bundling.d.ts.map +1 -1
  247. package/dist/scan/bundling.js +1 -12
  248. package/dist/scan/bundling.js.map +1 -1
  249. package/dist/scan/conventions.d.ts +6 -40
  250. package/dist/scan/conventions.d.ts.map +1 -1
  251. package/dist/scan/conventions.js +5 -34
  252. package/dist/scan/conventions.js.map +1 -1
  253. package/dist/scan/emit.d.ts +1 -5
  254. package/dist/scan/emit.d.ts.map +1 -1
  255. package/dist/scan/emit.js +4 -38
  256. package/dist/scan/emit.js.map +1 -1
  257. package/dist/scan/handler-parser.d.ts +4 -26
  258. package/dist/scan/handler-parser.d.ts.map +1 -1
  259. package/dist/scan/handler-parser.js +26 -83
  260. package/dist/scan/handler-parser.js.map +1 -1
  261. package/dist/scan/result.d.ts +3 -16
  262. package/dist/scan/result.d.ts.map +1 -1
  263. package/dist/scan/scanner.d.ts +2 -27
  264. package/dist/scan/scanner.d.ts.map +1 -1
  265. package/dist/scan/scanner.js +28 -127
  266. package/dist/scan/scanner.js.map +1 -1
  267. package/dist/scan/statement.d.ts.map +1 -1
  268. package/dist/scan/statement.js +4 -30
  269. package/dist/scan/statement.js.map +1 -1
  270. package/dist/source.d.ts +41 -0
  271. package/dist/source.d.ts.map +1 -0
  272. package/dist/source.js +10 -0
  273. package/dist/source.js.map +1 -0
  274. package/dist/storage.d.ts +13 -210
  275. package/dist/storage.d.ts.map +1 -1
  276. package/dist/storage.js +4 -68
  277. package/dist/storage.js.map +1 -1
  278. package/dist/store.d.ts +18 -0
  279. package/dist/store.d.ts.map +1 -0
  280. package/dist/store.js +146 -0
  281. package/dist/store.js.map +1 -0
  282. package/dist/verify.d.ts +5 -38
  283. package/dist/verify.d.ts.map +1 -1
  284. package/dist/verify.js +17 -37
  285. package/dist/verify.js.map +1 -1
  286. package/dist/wire/CallLog.d.ts +32 -0
  287. package/dist/wire/CallLog.d.ts.map +1 -0
  288. package/dist/{contract → wire}/CallLog.js.map +1 -1
  289. package/dist/wire/Invocation.d.ts +32 -0
  290. package/dist/wire/Invocation.d.ts.map +1 -0
  291. package/dist/wire/Invocation.js +66 -0
  292. package/dist/wire/Invocation.js.map +1 -0
  293. package/dist/{contract → wire}/RouteAddress.d.ts +5 -0
  294. package/dist/wire/RouteAddress.d.ts.map +1 -0
  295. package/dist/{contract → wire}/RouteAddress.js +7 -0
  296. package/dist/wire/RouteAddress.js.map +1 -0
  297. package/dist/wire/binding.d.ts +5 -21
  298. package/dist/wire/binding.d.ts.map +1 -1
  299. package/dist/wire/binding.js +5 -10
  300. package/dist/wire/binding.js.map +1 -1
  301. package/dist/wire/call.d.ts +24 -133
  302. package/dist/wire/call.d.ts.map +1 -1
  303. package/dist/wire/call.js +15 -41
  304. package/dist/wire/call.js.map +1 -1
  305. package/dist/wire/drift.d.ts +3 -28
  306. package/dist/wire/drift.d.ts.map +1 -1
  307. package/dist/wire/drift.js +4 -23
  308. package/dist/wire/drift.js.map +1 -1
  309. package/dist/wire/errors.d.ts +4 -24
  310. package/dist/wire/errors.d.ts.map +1 -1
  311. package/dist/wire/errors.js +4 -24
  312. package/dist/wire/errors.js.map +1 -1
  313. package/dist/wire/http-error.d.ts +2 -13
  314. package/dist/wire/http-error.d.ts.map +1 -1
  315. package/dist/wire/http-error.js +5 -19
  316. package/dist/wire/http-error.js.map +1 -1
  317. package/dist/wire/loggerMiddleware.d.ts +2 -8
  318. package/dist/wire/loggerMiddleware.d.ts.map +1 -1
  319. package/dist/wire/loggerMiddleware.js +1 -7
  320. package/dist/wire/loggerMiddleware.js.map +1 -1
  321. package/dist/wire/middleware.d.ts +3 -7
  322. package/dist/wire/middleware.d.ts.map +1 -1
  323. package/dist/wire/middleware.js +1 -5
  324. package/dist/wire/middleware.js.map +1 -1
  325. package/dist/wire/operation.d.ts +7 -43
  326. package/dist/wire/operation.d.ts.map +1 -1
  327. package/dist/wire/operation.js +4 -15
  328. package/dist/wire/operation.js.map +1 -1
  329. package/dist/wire/signature.d.ts +4 -25
  330. package/dist/wire/signature.d.ts.map +1 -1
  331. package/package.json +3 -3
  332. package/src/boot/Emissions.ts +21 -118
  333. package/src/boot/ambient-port.ts +3 -24
  334. package/src/boot/ambient.als.ts +7 -12
  335. package/src/boot/ambient.queue.ts +2 -5
  336. package/src/boot/apply.ts +3 -15
  337. package/src/boot/auth.ts +2 -12
  338. package/src/boot/boot.ts +5 -20
  339. package/src/boot/bootstrap.ts +69 -136
  340. package/src/boot/card.ts +4 -33
  341. package/src/boot/frame.ts +28 -62
  342. package/src/boot/hosted.ts +12 -34
  343. package/src/boot/ownership.ts +5 -39
  344. package/src/boot/ports.ts +1 -14
  345. package/src/boot/remote.ts +11 -58
  346. package/src/boot/runner.ts +5 -22
  347. package/src/boot/seed.ts +6 -37
  348. package/src/boot/statement-drift.ts +5 -24
  349. package/src/boot/together.ts +18 -51
  350. package/src/boot/types.ts +28 -173
  351. package/src/{builtins → builtin}/config.ts +1 -7
  352. package/src/{builtins → builtin}/logger.ts +6 -39
  353. package/src/config-loader.ts +12 -71
  354. package/src/contract.ts +15 -39
  355. package/src/crypto/encoding.ts +2 -15
  356. package/src/crypto/node.ts +1 -7
  357. package/src/crypto/port.ts +2 -18
  358. package/src/crypto/webcrypto.ts +1 -12
  359. package/src/declare.ts +8 -39
  360. package/src/define.ts +2 -3
  361. package/src/descriptor/Fronds.ts +6 -31
  362. package/src/descriptor/frond.ts +14 -63
  363. package/src/dispatch/ArgumentResolver.ts +6 -6
  364. package/src/dispatch/DispatchEvent.ts +2 -2
  365. package/src/dispatch/DispatchLifecycle.ts +1 -7
  366. package/src/dispatch/DispatchPort.ts +1 -1
  367. package/src/dispatch/Dispatcher.ts +3 -3
  368. package/src/dispatch/HandlerFacade.ts +231 -0
  369. package/src/dispatch/LocalRoutePolicy.ts +4 -4
  370. package/src/dispatch/OperationRoute.ts +2 -2
  371. package/src/dispatch/OutputView.ts +24 -2
  372. package/src/dispatch/Route.ts +2 -2
  373. package/src/dispatch/RoutePolicy.ts +1 -1
  374. package/src/dispatch/RouteRegistry.ts +2 -2
  375. package/src/dispatch/RouteResolver.ts +2 -4
  376. package/src/dispatch/StorageGuard.ts +70 -18
  377. package/src/dispatch/presenterArguments.ts +25 -0
  378. package/src/dispatch/{RemoteRouteResolver.ts → remoteRoutes.ts} +7 -9
  379. package/src/dispatch/routeNotFound.ts +33 -0
  380. package/src/dispatch/validateInput.ts +28 -0
  381. package/src/effective-operation.ts +21 -50
  382. package/src/emit.ts +5 -63
  383. package/src/entry/facade.ts +44 -0
  384. package/src/entry/transport.ts +16 -0
  385. package/src/frond-config.ts +7 -70
  386. package/src/identity-keys.ts +3 -16
  387. package/src/identity.ts +12 -80
  388. package/src/imports.ts +2 -31
  389. package/src/index.ts +17 -24
  390. package/src/loader.ts +2 -16
  391. package/src/node.ts +2 -11
  392. package/src/prefab/collector.ts +1 -22
  393. package/src/prefab/crud.ts +37 -76
  394. package/src/prefab/mirror.ts +4 -44
  395. package/src/prefab/prefab.ts +2 -21
  396. package/src/prefab/presenter.ts +2 -36
  397. package/src/prefab/repository.ts +7 -83
  398. package/src/scan/adapters.ts +32 -0
  399. package/src/scan/bundling.ts +1 -12
  400. package/src/scan/conventions.ts +6 -40
  401. package/src/scan/emit.ts +4 -38
  402. package/src/scan/handler-parser.ts +27 -96
  403. package/src/scan/result.ts +3 -16
  404. package/src/scan/scanner.ts +27 -126
  405. package/src/scan/statement.ts +4 -30
  406. package/src/source.ts +44 -0
  407. package/src/storage.ts +14 -234
  408. package/src/store.ts +152 -0
  409. package/src/verify.ts +16 -57
  410. package/src/wire/CallLog.ts +30 -0
  411. package/src/{contract → wire}/Invocation.ts +24 -17
  412. package/src/{contract → wire}/RouteAddress.ts +7 -0
  413. package/src/wire/binding.ts +9 -25
  414. package/src/wire/call.ts +30 -133
  415. package/src/wire/drift.ts +5 -30
  416. package/src/wire/errors.ts +4 -24
  417. package/src/wire/http-error.ts +5 -19
  418. package/src/wire/loggerMiddleware.ts +2 -8
  419. package/src/wire/middleware.ts +3 -7
  420. package/src/wire/operation.ts +8 -48
  421. package/src/wire/signature.ts +4 -25
  422. package/dist/boot/HandlerFacade.d.ts.map +0 -1
  423. package/dist/boot/HandlerFacade.js.map +0 -1
  424. package/dist/builtins/config.d.ts +0 -13
  425. package/dist/builtins/config.d.ts.map +0 -1
  426. package/dist/builtins/config.js +0 -21
  427. package/dist/builtins/config.js.map +0 -1
  428. package/dist/builtins/logger.d.ts.map +0 -1
  429. package/dist/builtins/logger.js.map +0 -1
  430. package/dist/contract/Call.d.ts +0 -10
  431. package/dist/contract/Call.d.ts.map +0 -1
  432. package/dist/contract/Call.js +0 -15
  433. package/dist/contract/Call.js.map +0 -1
  434. package/dist/contract/CallLog.d.ts +0 -57
  435. package/dist/contract/CallLog.d.ts.map +0 -1
  436. package/dist/contract/Invocation.d.ts +0 -27
  437. package/dist/contract/Invocation.d.ts.map +0 -1
  438. package/dist/contract/Invocation.js +0 -59
  439. package/dist/contract/Invocation.js.map +0 -1
  440. package/dist/contract/RouteAddress.d.ts.map +0 -1
  441. package/dist/contract/RouteAddress.js.map +0 -1
  442. package/dist/dispatch/InputValidator.d.ts +0 -7
  443. package/dist/dispatch/InputValidator.d.ts.map +0 -1
  444. package/dist/dispatch/InputValidator.js +0 -22
  445. package/dist/dispatch/InputValidator.js.map +0 -1
  446. package/dist/dispatch/OperationExecutor.d.ts +0 -25
  447. package/dist/dispatch/OperationExecutor.d.ts.map +0 -1
  448. package/dist/dispatch/OperationExecutor.js +0 -32
  449. package/dist/dispatch/OperationExecutor.js.map +0 -1
  450. package/dist/dispatch/OutputProjector.d.ts +0 -12
  451. package/dist/dispatch/OutputProjector.d.ts.map +0 -1
  452. package/dist/dispatch/OutputProjector.js +0 -30
  453. package/dist/dispatch/OutputProjector.js.map +0 -1
  454. package/dist/dispatch/PresenterArgumentResolver.d.ts +0 -12
  455. package/dist/dispatch/PresenterArgumentResolver.d.ts.map +0 -1
  456. package/dist/dispatch/PresenterArgumentResolver.js +0 -20
  457. package/dist/dispatch/PresenterArgumentResolver.js.map +0 -1
  458. package/dist/dispatch/RemoteRouteResolver.d.ts +0 -13
  459. package/dist/dispatch/RemoteRouteResolver.d.ts.map +0 -1
  460. package/dist/dispatch/RemoteRouteResolver.js.map +0 -1
  461. package/dist/dispatch/RouteNotFoundError.d.ts +0 -10
  462. package/dist/dispatch/RouteNotFoundError.d.ts.map +0 -1
  463. package/dist/dispatch/RouteNotFoundError.js +0 -24
  464. package/dist/dispatch/RouteNotFoundError.js.map +0 -1
  465. package/dist/entry/DynamicFacade.d.ts +0 -10
  466. package/dist/entry/DynamicFacade.d.ts.map +0 -1
  467. package/dist/entry/DynamicFacade.js +0 -27
  468. package/dist/entry/DynamicFacade.js.map +0 -1
  469. package/dist/entry/FacadeEntry.d.ts +0 -11
  470. package/dist/entry/FacadeEntry.d.ts.map +0 -1
  471. package/dist/entry/FacadeEntry.js +0 -26
  472. package/dist/entry/FacadeEntry.js.map +0 -1
  473. package/dist/entry/TransportEntry.d.ts +0 -13
  474. package/dist/entry/TransportEntry.d.ts.map +0 -1
  475. package/dist/entry/TransportEntry.js +0 -24
  476. package/dist/entry/TransportEntry.js.map +0 -1
  477. package/dist/rows.d.ts +0 -40
  478. package/dist/rows.d.ts.map +0 -1
  479. package/dist/rows.js +0 -146
  480. package/dist/rows.js.map +0 -1
  481. package/src/boot/HandlerFacade.ts +0 -242
  482. package/src/contract/Call.ts +0 -18
  483. package/src/contract/CallLog.ts +0 -55
  484. package/src/dispatch/InputValidator.ts +0 -28
  485. package/src/dispatch/OperationExecutor.ts +0 -60
  486. package/src/dispatch/OutputProjector.ts +0 -32
  487. package/src/dispatch/PresenterArgumentResolver.ts +0 -25
  488. package/src/dispatch/RouteNotFoundError.ts +0 -29
  489. package/src/entry/DynamicFacade.ts +0 -28
  490. package/src/entry/FacadeEntry.ts +0 -32
  491. package/src/entry/TransportEntry.ts +0 -30
  492. package/src/rows.ts +0 -155
  493. /package/dist/{contract → wire}/CallLog.js +0 -0
package/dist/boot/card.js CHANGED
@@ -1,29 +1,8 @@
1
- /**
2
- * What an app says about ITSELF — the `rpc.discover` answer, built from the app.
3
- *
4
- * The shape is `wire/`'s: it crosses a process boundary. Building one needs an App,
5
- * which is why the function lives here and the shape does not.
6
- */
1
+ /** What an app says about ITSELF — the `rpc.discover` answer, built from the app. */
7
2
  import { Card } from '@fougere/schema';
8
3
  import { factsAnnouncedBy } from '../emit.js';
9
4
  import { facadeKeyOf } from '../wire/call.js';
10
- /**
11
- * Serialize what the app hosts, for one audience. Served on `rpc.discover`,
12
- * cached by callers.
13
- *
14
- * Hosting means answering: an entity with no façade declares no operation, so
15
- * it is not among the DOORS — publishing its shape would hand an anonymous caller
16
- * the structure of tables it can never reach (the auth tables, typically), and
17
- * `fougere sync` would rebuild a schema with nothing to call on it.
18
- *
19
- * `facts` is the one thing that shape-without-a-door rule does not cover, and the
20
- * reason is the opposite of a leak: an entity nobody exposed is silent, whereas a
21
- * fact was explicitly declared to leave.
22
- *
23
- * `surface` makes that sentence audience-aware rather than app-wide: a door
24
- * answers with what IT serves. Nothing falls back to the full façade — under a
25
- * named surface, an entity with no façade of its own is simply not there.
26
- */
5
+ /** Serialize what the app hosts, for one audience. */
27
6
  export function identityCardOf(app, surface) {
28
7
  const declared = app.fronds.schemas();
29
8
  return {
@@ -52,15 +31,7 @@ export function identityCardOf(app, surface) {
52
31
  ...(entity ? { schema: Card.fromSchema(entity.entityClass, address).descriptor } : {}),
53
32
  }];
54
33
  }),
55
- /**
56
- * What leaves on its own — the same list on every surface, deliberately.
57
- *
58
- * A door has an audience; a fact does not. `Emit<T>` names a subject and *the
59
- * number of readers is not the emitter's business* (`emit.ts`), so narrowing this
60
- * by `surface` would invent an axis the primitive refuses. The consequence is
61
- * stated rather than hidden: a fact's SHAPE is readable by anyone who can read the
62
- * card at all. What must not be published must not be announced.
63
- */
34
+ /** What leaves on its own — the same list on every surface, deliberately. */
64
35
  facts: factsAnnouncedBy(frond.handlers).map((name) => {
65
36
  const entityClass = declared.get(name);
66
37
  return { name, ...(entityClass ? { schema: Card.fromSchema(entityClass, name).descriptor } : {}) };
@@ -1 +1 @@
1
- {"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/boot/card.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAkD,MAAM,iBAAiB,CAAC;AAK9F;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,cAAc,CAAC,GAAQ,EAAE,OAAgB;IACvD,MAAM,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAEtC,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YAC/B,oFAAoF;YACpF,mFAAmF;YACnF,oFAAoF;YACpF,oFAAoF;YACpF,wEAAwE;YACxE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YAChF,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC;oBAC5B,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;oBAC9C,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO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IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,WAAW,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,gDAAgD,CAC5F,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtC,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,WAAW,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,aAAa,IAAI,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,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;YACnF,GAAG,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;YACtF,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"}
@@ -1,23 +1,9 @@
1
1
  /**
2
- * The compensated realization of a frame — what `Together` becomes when its members do
3
- * not share an engine.
4
- *
5
- * A transaction is the engine's own answer and costs nothing to use: the members are
6
- * rebuilt over it and the engine gives both the unwind and the isolation. Across engines
7
- * there is no such thing, so the unwind is built here: every write through the port is
8
- * recorded with the image that preceded it, and a failure replays the inverses in reverse
9
- * order.
10
- *
11
- * **It gives all-or-nothing, never isolation.** Between two writes a reader sees the half,
12
- * and nothing here can hide it — that is the whole difference between the two realizations
13
- * and the reason the boot says which one it built.
14
- *
15
- * The port is thirteen known gestures, which is what makes the inverse derivable rather
16
- * than declared: a saga asks its author for an `undo` per step because its steps are
17
- * arbitrary code. Here they are not.
2
+ * The compensated realization of a frame — what `Together` becomes when its members do not share
3
+ * an engine.
18
4
  */
19
- import { type Fields } from '@fougere/schema';
20
- import type { Logger } from '../builtins/logger.js';
5
+ import { type SchemaView } from '@fougere/schema';
6
+ import type { Logger } from '../builtin/logger.js';
21
7
  /** One write that landed, and how to take it back. */
22
8
  export interface Undo {
23
9
  /** What it will undo, in the sentence a failure report needs. */
@@ -25,20 +11,10 @@ export interface Undo {
25
11
  run(): Promise<void>;
26
12
  }
27
13
  /**
28
- * The storage a member is handed inside a compensated frame: the same port, writing the same
29
- * rows, leaving an inverse behind each time.
30
- *
31
- * `Object.create` for the same reason `StorageGuard` uses it — the storage keeps every gesture
32
- * it had, including the ones this knows nothing about.
33
- */
34
- export declare function recording<T extends object>(storage: T, entity: string, fields: Fields, journal: Undo[]): T;
35
- /**
36
- * Replay the inverses, most recent first, and report rather than pretend.
37
- *
38
- * Every one is attempted even after one fails: stopping at the first would leave writes
39
- * standing that could have been taken back. What cannot be undone is named — the caller is
40
- * about to tell a user their transfer failed, and "it failed and here is what is still in
41
- * the database" is the only honest version of that sentence.
14
+ * The storage a member is handed inside a compensated frame: the same port, writing the same rows,
15
+ * leaving an inverse behind each time.
42
16
  */
17
+ export declare function recording<T extends object>(storage: T, entity: string, schema: SchemaView, journal: Undo[]): T;
18
+ /** Replay the inverses, most recent first, and report rather than pretend. */
43
19
  export declare function unwind(journal: readonly Undo[], cause: unknown, log: Logger): Promise<never>;
44
20
  //# sourceMappingURL=frame.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/boot/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AAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAkBlG"}
@@ -1,44 +1,15 @@
1
1
  /**
2
- * The compensated realization of a frame — what `Together` becomes when its members do
3
- * not share an engine.
4
- *
5
- * A transaction is the engine's own answer and costs nothing to use: the members are
6
- * rebuilt over it and the engine gives both the unwind and the isolation. Across engines
7
- * there is no such thing, so the unwind is built here: every write through the port is
8
- * recorded with the image that preceded it, and a failure replays the inverses in reverse
9
- * order.
10
- *
11
- * **It gives all-or-nothing, never isolation.** Between two writes a reader sees the half,
12
- * and nothing here can hide it — that is the whole difference between the two realizations
13
- * and the reason the boot says which one it built.
14
- *
15
- * The port is thirteen known gestures, which is what makes the inverse derivable rather
16
- * than declared: a saga asks its author for an `undo` per step because its steps are
17
- * arbitrary code. Here they are not.
2
+ * The compensated realization of a frame — what `Together` becomes when its members do not share
3
+ * an engine.
18
4
  */
19
- import { FieldGroup, FieldSet, Unique } from '@fougere/schema';
5
+ import { FieldSet, Role } from '@fougere/schema';
20
6
  import { dequal } from 'dequal';
21
7
  const pick = (row, keys) => Object.fromEntries(keys.map((key) => [key, row[key]]));
22
- /**
23
- * Whether an upsert's conflict can be something other than the primary key.
24
- *
25
- * The inverse of an upsert is derivable exactly when the conflict is the primary key: read
26
- * the rows by key first, then restore the ones that were there and delete the ones that
27
- * were not. `SqlStorage` spells `onConflict(pk)` on SQLite and Postgres, so that holds —
28
- * but MySQL's `onDuplicateKeyUpdate` fires on ANY unique constraint, and a row that
29
- * conflicts on a unique email while carrying a different key would be restored under a key
30
- * the write never touched.
31
- *
32
- * So the question is asked of the DECLARATION, not of the engine: an entity whose only
33
- * unique constraint is its key upserts unambiguously everywhere. This file knows no dialect
34
- * and should not learn one.
35
- */
36
- function mayConflictElsewhere(fields) {
37
- const groups = FieldGroup.groupsOf(fields, Unique);
38
- if (groups.length > 0)
8
+ /** Whether an upsert's conflict can be something other than the primary key. */
9
+ function mayConflictElsewhere(schema) {
10
+ if ((schema.getUnique() ?? []).length > 0)
39
11
  return true;
40
- // A sole `unique()` carries a one-member group, which `groupsOf` filters out.
41
- return Object.values(fields).some((field) => FieldGroup.on(field, Unique).length > 0);
12
+ return Object.values(schema.getFields()).some((field) => Role.of(field).isUnique);
42
13
  }
43
14
  /** Refused where it is used, naming the group that makes the inverse ambiguous. */
44
15
  function refuseAmbiguousUpsert(entity, gesture) {
@@ -48,17 +19,14 @@ function refuseAmbiguousUpsert(entity, gesture) {
48
19
  `create/update explicitly.`);
49
20
  }
50
21
  /**
51
- * The storage a member is handed inside a compensated frame: the same port, writing the same
52
- * rows, leaving an inverse behind each time.
53
- *
54
- * `Object.create` for the same reason `StorageGuard` uses it — the storage keeps every gesture
55
- * it had, including the ones this knows nothing about.
22
+ * The storage a member is handed inside a compensated frame: the same port, writing the same rows,
23
+ * leaving an inverse behind each time.
56
24
  */
57
- export function recording(storage, entity, fields, journal) {
25
+ export function recording(storage, entity, schema, journal) {
58
26
  const base = storage;
59
27
  if (typeof base.create !== 'function' || typeof base.update !== 'function')
60
28
  return storage;
61
- const key = FieldSet.of(fields).primary;
29
+ const key = FieldSet.of(schema.getFields()).primary;
62
30
  if (!key) {
63
31
  throw new Error(`${entity} declares no primary field, so a write to it cannot be taken back by ` +
64
32
  `identity — and this frame has no transaction to do it instead.`);
@@ -86,9 +54,14 @@ export function recording(storage, entity, fields, journal) {
86
54
  const current = await base.findById.call(this, id);
87
55
  if (!current)
88
56
  throw new Error(`${entity}#${id} is gone`);
57
+ // Reading and restoring are two statements, and there is no transaction here to make
58
+ // them one — a write landing between them is overwritten unseen. So this names what it
59
+ // FOUND, and claims nothing about what it did not: the frame was built because no
60
+ // engine could isolate it, and a check does not put the isolation back.
89
61
  const moved = touched.filter((field) => !dequal(current[field], wrote[field]));
90
62
  if (moved.length > 0) {
91
- throw new Error(`${entity}#${id} was changed by someone else since (${moved.join(', ')})`);
63
+ throw new Error(`${entity}#${id} no longer holds what this frame wrote (${moved.join(', ')}), so ` +
64
+ `restoring the previous values would drop whatever replaced them`);
92
65
  }
93
66
  await base.update.call(this, id, pick(before, touched));
94
67
  },
@@ -124,7 +97,7 @@ export function recording(storage, entity, fields, journal) {
124
97
  };
125
98
  if (typeof base.upsert === 'function') {
126
99
  recorded.upsert = async function (input, ...rest) {
127
- if (mayConflictElsewhere(fields))
100
+ if (mayConflictElsewhere(schema))
128
101
  refuseAmbiguousUpsert(entity, 'upsert');
129
102
  const undo = await undoUpsert.call(this, [input]);
130
103
  const row = await base.upsert.call(this, input, ...rest);
@@ -134,7 +107,7 @@ export function recording(storage, entity, fields, journal) {
134
107
  }
135
108
  if (typeof base.upsertAll === 'function') {
136
109
  recorded.upsertAll = async function (inputs, ...rest) {
137
- if (mayConflictElsewhere(fields))
110
+ if (mayConflictElsewhere(schema))
138
111
  refuseAmbiguousUpsert(entity, 'upsertAll');
139
112
  const undo = await undoUpsert.call(this, inputs);
140
113
  const written = await base.upsertAll.call(this, inputs, ...rest);
@@ -144,14 +117,7 @@ export function recording(storage, entity, fields, journal) {
144
117
  }
145
118
  return recorded;
146
119
  }
147
- /**
148
- * Replay the inverses, most recent first, and report rather than pretend.
149
- *
150
- * Every one is attempted even after one fails: stopping at the first would leave writes
151
- * standing that could have been taken back. What cannot be undone is named — the caller is
152
- * about to tell a user their transfer failed, and "it failed and here is what is still in
153
- * the database" is the only honest version of that sentence.
154
- */
120
+ /** Replay the inverses, most recent first, and report rather than pretend. */
155
121
  export async function unwind(journal, cause, log) {
156
122
  const stuck = [];
157
123
  for (const undo of [...journal].reverse()) {
@@ -1 +1 @@
1
- {"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/boot/frame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AA2Bh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AAC,SAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;YAClE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAwB,EAAE,KAAc,EAAE,GAAW;IAChF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1C,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;QACnB,CAAC;QAAC,OAAO,OAAO,EAAE,CAAC;YACjB,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,MAAO,OAAiB,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3D,GAAG,CAAC,KAAK,CAAC,wBAAwB,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,KAAK,CAAC;IAEpC,MAAM,IAAI,KAAK,CACb,wBAAwB,KAAK,CAAC,MAAM,OAAO,OAAO,CAAC,MAAM,qCAAqC;QAC9F,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,uDAAuD;QAC1E,GAAI,KAAe,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,EAC/C,EAAE,KAAK,EAAE,CACV,CAAC;AACJ,CAAC"}
@@ -1,21 +1,4 @@
1
- /**
2
- * What this app hosts — what it STATED, or what a scan FOUND.
3
- *
4
- * The PRESENCE of the key is the decision, the way `remotes:` states a topology: an app
5
- * that passes `fronds:` is saying "do not scan", and one that passes `scan:` is handing
6
- * over what a scanner read. There is no mode to configure because there is no third
7
- * behaviour to name.
8
- *
9
- * Both may arrive, and then they MERGE — but only where a scan costs nothing at runtime.
10
- * Under Nuxt the scan is a build artifact, so an app may state the frond it wants to own
11
- * and leave the rest to what the build found. Anywhere the scan would run at START, half a
12
- * statement buys nothing the whole one does: the disk is read either way.
13
- *
14
- * Merging is per frond NAME and per member. A stated frond wins outright on the members it
15
- * names — stating `entities: [Post]` where a scan found `[Post, Author]` yields `[Post]`,
16
- * because the point of stating is to decide. Empty is what "I named none" looks like, and
17
- * `frond()` builds every member, so an empty one is filled rather than enforced.
18
- */
1
+ /** What this app hosts — what it STATED, or what a scan FOUND. */
19
2
  import type { FrondDescriptor } from '../descriptor/frond.js';
20
3
  import type { ScanResult } from '../scan/result.js';
21
4
  /** Where an app's fronds come from — either, or both. */
@@ -25,11 +8,6 @@ export interface HostedSources {
25
8
  /** What a scanner found, and what it could not do. */
26
9
  scan?: ScanResult | (() => Promise<ScanResult> | ScanResult);
27
10
  }
28
- /**
29
- * What the app hosts, and what the scan — if it ran — could not do.
30
- *
31
- * Neither key is EMPTY rather than refused: whether an app with no frond is legitimate
32
- * depends on what else it declares, and this function is handed none of that.
33
- */
11
+ /** What the app hosts, and what the scan — if it ran — could not do. */
34
12
  export declare function hostedBy(sources: HostedSources): Promise<ScanResult>;
35
13
  //# sourceMappingURL=hosted.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hosted.d.ts","sourceRoot":"","sources":["../../src/boot/hosted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,sDAAsD;IACtD,IAAI,CAAC,EAAE,UAAU,GAAG,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC;CAC9D;AA2BD;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAY1E"}
1
+ {"version":3,"file":"hosted.d.ts","sourceRoot":"","sources":["../../src/boot/hosted.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,sDAAsD;IACtD,IAAI,CAAC,EAAE,UAAU,GAAG,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC;CAC9D;AA2BD,wEAAwE;AACxE,wBAAsB,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAY1E"}
@@ -1,15 +1,15 @@
1
1
  import { Fronds } from '../descriptor/Fronds.js';
2
- /** A stated frond, completed by what a scan found under the same name. */
3
- function completed(stated, found) {
2
+ /** A frond the host passed, completed by what a scan found under the same name. */
3
+ function completed(given, found) {
4
4
  if (!found)
5
- return stated;
5
+ return given;
6
6
  // Written out rather than looped: a loop over the key union asks TypeScript to prove
7
- // `found[k]` fits `stated[k]` for every k at once, which it cannot — and the cast that
7
+ // `found[k]` fits `given[k]` for every k at once, which it cannot — and the cast that
8
8
  // silences it would also silence a member added to the descriptor and forgotten here.
9
- const fill = (member) => (stated[member].length === 0 ? found[member] : stated[member]);
9
+ const fill = (member) => (given[member].length === 0 ? found[member] : given[member]);
10
10
  return {
11
11
  ...found,
12
- ...stated,
12
+ ...given,
13
13
  providers: fill('providers'),
14
14
  entities: fill('entities'),
15
15
  handlers: fill('handlers'),
@@ -18,12 +18,7 @@ function completed(stated, found) {
18
18
  seeds: fill('seeds'),
19
19
  };
20
20
  }
21
- /**
22
- * What the app hosts, and what the scan — if it ran — could not do.
23
- *
24
- * Neither key is EMPTY rather than refused: whether an app with no frond is legitimate
25
- * depends on what else it declares, and this function is handed none of that.
26
- */
21
+ /** What the app hosts, and what the scan — if it ran — could not do. */
27
22
  export async function hostedBy(sources) {
28
23
  const scanned = sources.scan
29
24
  ? await (typeof sources.scan === 'function' ? sources.scan() : sources.scan)
@@ -31,8 +26,8 @@ export async function hostedBy(sources) {
31
26
  if (!sources.fronds)
32
27
  return scanned ?? { fronds: Fronds.hosting([]), diagnostics: [] };
33
28
  const found = scanned?.fronds ?? [];
34
- const stated = sources.fronds.map((f) => completed(f, found.find((s) => s.name === f.name)));
35
- const unstated = found.filter((f) => !sources.fronds.some((s) => s.name === f.name));
36
- return { fronds: Fronds.hosting([...stated, ...unstated]), diagnostics: scanned?.diagnostics ?? [] };
29
+ const configured = sources.fronds.map((f) => completed(f, found.find((s) => s.name === f.name)));
30
+ const discovered = found.filter((f) => !sources.fronds.some((s) => s.name === f.name));
31
+ return { fronds: Fronds.hosting([...configured, ...discovered]), diagnostics: scanned?.diagnostics ?? [] };
37
32
  }
38
33
  //# sourceMappingURL=hosted.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hosted.js","sourceRoot":"","sources":["../../src/boot/hosted.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAajD,0EAA0E;AAC1E,SAAS,SAAS,CAAC,MAAuB,EAAE,KAAkC;IAC5E,IAAI,CAAC,KAAK;QAAE,OAAO,MAAM,CAAC;IAE1B,qFAAqF;IACrF,uFAAuF;IACvF,sFAAsF;IACtF,MAAM,IAAI,GAAG,CAAqB,MAAS,EAAsB,EAAE,CACjE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC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MAAM,CAAC,OAAO,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;QAC5E,CAAC,CAAC,SAAS,CAAC;IAEd,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,OAAO,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IAEvF,MAAM,KAAK,GAAG,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC;IACpC,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjG,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAExF,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,UAAU,EAAE,GAAG,UAAU,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,EAAE,EAAE,CAAC;AAC7G,CAAC"}
@@ -1,41 +1,8 @@
1
1
  import type { FrondDescriptor, ProviderEntry } from '../descriptor/frond.js';
2
- /**
3
- * Who owns an entity's storage.
4
- *
5
- * `Repository(Commande, Stock)` states it — an aggregate is the only thing that claims
6
- * entities it is not named after, and the arity is what says so. A repository of ONE owns
7
- * nothing: a boundary between one thing and nothing is not a boundary, and the judge is
8
- * already on that entity's rows.
9
- */
2
+ /** Who owns an entity's storage. */
10
3
  export declare function ownersOf(providers: readonly ProviderEntry[]): Map<string, string>;
11
- /**
12
- * `Storage<E>` is not a word of the user's vocabulary — `<E>Repository` is the one way in.
13
- *
14
- * A door judges and projects; a HOLDER keeps the storage. So the rule is not about which
15
- * directory a file sits in but about which of the two a class is: a handler, a presenter and
16
- * a collector may never name the port, and a provider may name only the storage of what its
17
- * prefab was built on — which is `Repository` and `Mirror`, without either being named here.
18
- *
19
- * What it buys beyond one word instead of two: an entity that becomes owned later needs no
20
- * call site to move, because none of them ever spelled the storage.
21
- *
22
- * `known` answers what the key's suffix cannot: `FileStorage` is an ordinary class name.
23
- *
24
- * Refused at boot rather than reported by `verify`, which nothing calls at startup.
25
- */
4
+ /** `Storage<E>` is not a word of the user's vocabulary — `<E>Repository` is the one way in. */
26
5
  export declare function refuseStorageInUserCode(frond: FrondDescriptor, owners: Map<string, string>, known: (entity: string) => boolean): void;
27
- /**
28
- * An owned entity has no automatic CRUD — said at boot, not at the first request.
29
- *
30
- * `HandlerFacade.deps()` asks for `<E>Repository` when a handler inherits the five gestures
31
- * and declares no constructor of its own, and an owned entity has no such key. That alone
32
- * refuses — but LAZILY, at the first call, on the container's own sentence: measured, the app
33
- * booted clean and answered every request with `'LedgerRepository' is not registered`. A
34
- * receiver that starts and then rejects everything is found in production, which is the
35
- * reason `serve()` checks its address at boot rather than per call.
36
- *
37
- * Recognized by FORM, like the façade recognizes it: a prototype carrying `list` and
38
- * `findById` needs storage of its own, whether `Crud()` put them there or an author did.
39
- */
6
+ /** An owned entity has no automatic CRUD — said at boot, not at the first request. */
40
7
  export declare function refuseCrudOnOwned(frond: FrondDescriptor, owners: Map<string, string>): void;
41
8
  //# sourceMappingURL=ownership.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../src/boot/ownership.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAK7E;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBjF;AAaD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,GACjC,IAAI,CAoCN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAiB3F"}
1
+ {"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../src/boot/ownership.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAM7E,oCAAoC;AACpC,wBAAgB,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAqBjF;AAaD,+FAA+F;AAC/F,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC3B,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,GACjC,IAAI,CAoCN;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAe3F"}
@@ -1,15 +1,9 @@
1
1
  import { lowerFirst } from '@fougere/schema';
2
+ import { inheritsCrud } from '../prefab/crud.js';
2
3
  import { targetOf } from '../prefab/prefab.js';
3
4
  import { ownedBy, repositoryKeyOf } from '../prefab/repository.js';
4
5
  import { entityOfStorageKey } from '../storage.js';
5
- /**
6
- * Who owns an entity's storage.
7
- *
8
- * `Repository(Commande, Stock)` states it — an aggregate is the only thing that claims
9
- * entities it is not named after, and the arity is what says so. A repository of ONE owns
10
- * nothing: a boundary between one thing and nothing is not a boundary, and the judge is
11
- * already on that entity's rows.
12
- */
6
+ /** Who owns an entity's storage. */
13
7
  export function ownersOf(providers) {
14
8
  const owners = new Map();
15
9
  for (const provider of providers) {
@@ -42,21 +36,7 @@ function builtOn(ctor) {
42
36
  const target = targetOf(ctor);
43
37
  return target?.name ? [lowerFirst(target.name)] : [];
44
38
  }
45
- /**
46
- * `Storage<E>` is not a word of the user's vocabulary — `<E>Repository` is the one way in.
47
- *
48
- * A door judges and projects; a HOLDER keeps the storage. So the rule is not about which
49
- * directory a file sits in but about which of the two a class is: a handler, a presenter and
50
- * a collector may never name the port, and a provider may name only the storage of what its
51
- * prefab was built on — which is `Repository` and `Mirror`, without either being named here.
52
- *
53
- * What it buys beyond one word instead of two: an entity that becomes owned later needs no
54
- * call site to move, because none of them ever spelled the storage.
55
- *
56
- * `known` answers what the key's suffix cannot: `FileStorage` is an ordinary class name.
57
- *
58
- * Refused at boot rather than reported by `verify`, which nothing calls at startup.
59
- */
39
+ /** `Storage<E>` is not a word of the user's vocabulary — `<E>Repository` is the one way in. */
60
40
  export function refuseStorageInUserCode(frond, owners, known) {
61
41
  const doors = [
62
42
  ...frond.handlers.map((h) => ({ ...h, kind: 'handler' })),
@@ -89,26 +69,11 @@ export function refuseStorageInUserCode(frond, owners, known) {
89
69
  }
90
70
  }
91
71
  }
92
- /**
93
- * An owned entity has no automatic CRUD — said at boot, not at the first request.
94
- *
95
- * `HandlerFacade.deps()` asks for `<E>Repository` when a handler inherits the five gestures
96
- * and declares no constructor of its own, and an owned entity has no such key. That alone
97
- * refuses — but LAZILY, at the first call, on the container's own sentence: measured, the app
98
- * booted clean and answered every request with `'LedgerRepository' is not registered`. A
99
- * receiver that starts and then rejects everything is found in production, which is the
100
- * reason `serve()` checks its address at boot rather than per call.
101
- *
102
- * Recognized by FORM, like the façade recognizes it: a prototype carrying `list` and
103
- * `findById` needs storage of its own, whether `Crud()` put them there or an author did.
104
- */
72
+ /** An owned entity has no automatic CRUD — said at boot, not at the first request. */
105
73
  export function refuseCrudOnOwned(frond, owners) {
106
74
  for (const handler of frond.handlers) {
107
75
  const owner = owners.get(handler.address);
108
- if (!owner || handler.deps.length > 0)
109
- continue;
110
- const proto = handler.ctor.prototype;
111
- if (typeof proto?.list !== 'function' || typeof proto?.findById !== 'function')
76
+ if (!owner || handler.deps.length > 0 || !inheritsCrud(handler.ctor))
112
77
  continue;
113
78
  throw new Error(`[aggregate] ${handler.ctor.name} takes the five gestures on ${handler.address}, `
114
79
  + `which ${owner} owns.\n`
@@ -1 +1 @@
1
- {"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../src/boot/ownership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,SAAmC;IAC1D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,SAAS;QAC/B,KAAK,MAAM,MAAM,IAAI,KAAK,EAAE,CAAC;YAC3B,MAAM,IAAI,GAAG,UAAU,CAAE,MAA2B,CAAC,IAAI,CAAC,CAAC;YAC3D,MAAM,KAAK,GAAG,MAAM,CAA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I,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;YAAE,SAAS;QAE/E,MAAM,IAAI,KAAK,CACb,eAAe,OAAO,CAAC,IAAI,CAAC,IAAI,+BAA+B,OAAO,CAAC,OAAO,IAAI;cAChF,SAAS,KAAK,UAAU;cACxB,qFAAqF;cACrF,uCAAuC;cACvC,4BAA4B,KAAK,mBAAmB;cACpD,2BAA2B,OAAO,CAAC,OAAO,KAAK,KAAK,QAAQ;cAC5D,KAAK,OAAO,CAAC,QAAQ,EAAE,CAC1B,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,17 +1,4 @@
1
1
  import type { ProviderEntry } from '../descriptor/frond.js';
2
- /**
3
- * A port is a class something already answers under. Nothing declares one — the
4
- * prototype chain states it, so `class StripePayment extends Payment` IS the whole
5
- * registration, and so is `class MyLogger extends Logger` over a builtin.
6
- *
7
- * This is the fourth reading of the rule the other three already apply: the type
8
- * names the SUBJECT (`Storage<E>`, `Emit<F>`, `Facade<H>`) and the container
9
- * holds the realization. Providers were the one case where the type named the
10
- * realization instead, so `constructor(private payment: Payment)` resolved to the
11
- * base class and a handler got an object whose method did not exist.
12
- *
13
- * Only the DIRECT base binds. A deeper chain binds each link to its own child, and
14
- * a case that wants otherwise states it in `ports:` — which wins over all of this.
15
- */
2
+ /** A port is a class something already answers under. */
16
3
  export declare function portBindings(providers: ProviderEntry[], answers: (name: string) => boolean, chosen: Record<string, string> | undefined): Map<string, ProviderEntry>;
17
4
  //# sourceMappingURL=ports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../src/boot/ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,aAAa,EAAE,EAC1B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,EAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACzC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CA6C5B"}
1
+ {"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../src/boot/ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,yDAAyD;AACzD,wBAAgB,YAAY,CAC1B,SAAS,EAAE,aAAa,EAAE,EAC1B,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,EAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACzC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CA6C5B"}
@@ -1,17 +1,4 @@
1
- /**
2
- * A port is a class something already answers under. Nothing declares one — the
3
- * prototype chain states it, so `class StripePayment extends Payment` IS the whole
4
- * registration, and so is `class MyLogger extends Logger` over a builtin.
5
- *
6
- * This is the fourth reading of the rule the other three already apply: the type
7
- * names the SUBJECT (`Storage<E>`, `Emit<F>`, `Facade<H>`) and the container
8
- * holds the realization. Providers were the one case where the type named the
9
- * realization instead, so `constructor(private payment: Payment)` resolved to the
10
- * base class and a handler got an object whose method did not exist.
11
- *
12
- * Only the DIRECT base binds. A deeper chain binds each link to its own child, and
13
- * a case that wants otherwise states it in `ports:` — which wins over all of this.
14
- */
1
+ /** A port is a class something already answers under. */
15
2
  export function portBindings(providers, answers, chosen) {
16
3
  // port class name → the classes that extend it, in scan order.
17
4
  const candidates = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"ports.js","sourceRoot":"","sources":["../../src/boot/ports.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,YAAY,CAC1B,SAA0B,EAC1B,OAAkC,EAClC,MAA0C;IAE1C,+DAA+D;IAC/D,MAAM,UAAU,GAAG,IAAI,GAAG,EAA2B,CAAC;IACtD,KAAK,MAAM,Q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