@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
@@ -2,13 +2,7 @@
2
2
  * Logger middleware — logs every operation with timing.
3
3
  */
4
4
  import type { AppMiddleware } from './middleware.js';
5
- import type { Logger } from '../builtins/logger.js';
6
- /**
7
- * Create a logger middleware that logs operation entry, exit, and errors.
8
- *
9
- * ```ts
10
- * app.use(loggerMiddleware(app.resolve('Logger')))
11
- * ```
12
- */
5
+ import type { Logger } from '../builtin/logger.js';
6
+ /** Create a logger middleware that logs operation entry, exit, and errors. */
13
7
  export declare function loggerMiddleware(logger: Logger): AppMiddleware;
14
8
  //# sourceMappingURL=loggerMiddleware.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loggerMiddleware.d.ts","sourceRoot":"","sources":["../../src/wire/loggerMiddleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAe9D"}
1
+ {"version":3,"file":"loggerMiddleware.d.ts","sourceRoot":"","sources":["../../src/wire/loggerMiddleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAe9D"}
@@ -1,10 +1,4 @@
1
- /**
2
- * Create a logger middleware that logs operation entry, exit, and errors.
3
- *
4
- * ```ts
5
- * app.use(loggerMiddleware(app.resolve('Logger')))
6
- * ```
7
- */
1
+ /** Create a logger middleware that logs operation entry, exit, and errors. */
8
2
  export function loggerMiddleware(logger) {
9
3
  return async (ctx, next) => {
10
4
  const start = performance.now();
@@ -1 +1 @@
1
- {"version":3,"file":"loggerMiddleware.js","sourceRoot":"","sources":["../../src/wire/loggerMiddleware.ts"],"names":[],"mappings":"AAMA;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;YAC5B,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,KAAK,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAC9D,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"loggerMiddleware.js","sourceRoot":"","sources":["../../src/wire/loggerMiddleware.ts"],"names":[],"mappings":"AAMA,8EAA8E;AAC9E,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QACzB,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;YAC5B,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,KAAK,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO,MAAM,CAAC;QAChB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YAC9D,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -1,8 +1,4 @@
1
- /**
2
- * App-level middleware — intercepts handler facade operations.
3
- *
4
- * Works regardless of entry point (HTTP, Nitro, event bus, CLI, tests).
5
- */
1
+ /** App-level middleware — intercepts handler facade operations. */
6
2
  export interface OperationContext {
7
3
  /** Entity name (e.g. 'product'). */
8
4
  entity: string;
@@ -17,8 +13,8 @@ export interface OperationContext {
17
13
  args: unknown[];
18
14
  /** Extensible bag — middlewares deposit data here (user, permissions, etc.). */
19
15
  state: Record<string, unknown>;
20
- /** Transport-agnostic invocation context (params, query, body, state). */
21
- invocation?: import('../contract/Invocation.js').InvocationContext;
16
+ /** Transport-agnostic invocation context (params, query, input, state). */
17
+ invocation?: import('../wire/Invocation.js').InvocationContext;
22
18
  }
23
19
  export type AppNext = () => Promise<unknown>;
24
20
  export type AppMiddleware = (ctx: OperationContext, next: AppNext) => Promise<unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,OAAO,2BAA2B,EAAE,iBAAiB,CAAC;CACpE;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAIvF;;GAEG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,aAAa,EAAE,EAC5B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CASlB"}
1
+ {"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAGnE,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,uBAAuB,EAAE,iBAAiB,CAAC;CAChE;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAIvF;;GAEG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,aAAa,EAAE,EAC5B,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CASlB"}
@@ -1,8 +1,4 @@
1
- /**
2
- * App-level middleware — intercepts handler facade operations.
3
- *
4
- * Works regardless of entry point (HTTP, Nitro, event bus, CLI, tests).
5
- */
1
+ /** App-level middleware — intercepts handler facade operations. */
6
2
  // ── Runner ──────────────────────────────────────
7
3
  /**
8
4
  * Execute a middleware chain (onion model) then the handler.
@@ -1 +1 @@
1
- {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH,mDAAmD;AAEnD;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,WAA4B,EAC5B,GAAqB,EACrB,OAAgB;IAEhB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAG,GAAqB,EAAE;QAClC,IAAI,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC,CAAC;IACF,OAAO,IAAI,EAAE,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/wire/middleware.ts"],"names":[],"mappings":"AAAA,mEAAmE;AAwBnE,mDAAmD;AAEnD;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,WAA4B,EAC5B,GAAqB,EACrB,OAAgB;IAEhB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAG,GAAqB,EAAE;QAClC,IAAI,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;YAC/B,OAAO,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,OAAO,EAAE,CAAC;IACnB,CAAC,CAAC;IACF,OAAO,IAAI,EAAE,CAAC;AAChB,CAAC"}
@@ -1,14 +1,7 @@
1
1
  import type { SchemaView } from '@fougere/schema';
2
2
  import type { BindingPlan } from './binding.js';
3
3
  import type { Signature, TypeRef, Param } from './signature.js';
4
- /**
5
- * The contract of one operation — everything the façade needs to serve a call.
6
- *
7
- * Produced two ways, indistinguishable once here: the scan DERIVES it from a
8
- * method's parsed signature, a prefab handler DECLARES it outright. The façade
9
- * consumes contracts and nothing else — it knows no operation by name, and a
10
- * declared contract survives a scan that resolved nothing.
11
- */
4
+ /** The contract of one operation — everything the façade needs to serve a call. */
12
5
  export interface OperationContract {
13
6
  /** Judged on the way in. The view carries its own mode (`partial()` → patch). */
14
7
  input?: SchemaView;
@@ -16,42 +9,14 @@ export interface OperationContract {
16
9
  output?: SchemaView;
17
10
  /** Where each argument is read from in the invocation. */
18
11
  binding?: BindingPlan;
19
- /**
20
- * The operation in words, for a caller that meets it over the wire and has to
21
- * choose. Same three producers as the rest: the scan derives it from the method's
22
- * doc comment, a prefab declares it, config states it and wins.
23
- */
12
+ /** The operation in words, for a caller that meets it over the wire and has to choose. */
24
13
  description?: string;
25
- /**
26
- * How MUCH comes back — the half of the return type that `output` cannot say.
27
- *
28
- * `output` is the shape of ONE row; it is silent on whether the op hands back one,
29
- * several, or a page. The prefab knows (`list` returns a `ListResult`, `findById`
30
- * returns `T | undefined`) and the card did not, so anything generating a signature
31
- * from the card would have written `list(): Promise<Post[]>` — false, and a false
32
- * signature is worse than none.
33
- *
34
- * `none` says there is no shaped output at all (a boolean, a void), not that the op
35
- * returns nothing.
36
- */
14
+ /** How MUCH comes back — the half of the return type that `output` cannot say. */
37
15
  cardinality?: 'one' | 'maybe' | 'many' | 'page' | 'none';
38
- /**
39
- * The argument names and TYPES — the one thing `binding` cannot say.
40
- *
41
- * `binding` says where an argument is read from, `cardinality` how much comes back;
42
- * neither gives a type, and a GraphQL argument needs one. So this is not the scan's
43
- * private material: a prefab fills it too, from signatures it wrote itself. `binding`
44
- * still wins on where an argument comes from.
45
- */
16
+ /** The argument names and TYPES — the one thing `binding` cannot say. */
46
17
  signature?: Signature;
47
18
  }
48
- /**
49
- * Read an op's cardinality off its parsed return type.
50
- *
51
- * `Promise` is unwrapped first — it says when, not how much. `ListResult<T>` extends
52
- * `Array<T>`, so it must be recognised BEFORE the array test or a page would read as
53
- * a plain list and lose its `total`/`hasMore`.
54
- */
19
+ /** Read an op's cardinality off its parsed return type. */
55
20
  export declare function cardinalityOf(type: TypeRef | undefined): OperationContract['cardinality'];
56
21
  /** Map of operation name → its contract. */
57
22
  export type OperationsMap = Map<string, OperationContract>;
@@ -69,9 +34,8 @@ export declare function knownVerbs(): {
69
34
  command: string[];
70
35
  };
71
36
  /**
72
- * Infer only when the leading word names one convention and a composed clause does not
73
- * name the opposite one. This is intentionally partial: `ofBook`, `computeReport` and
74
- * `getOrCreateUser` have no inferred kind instead of falling through to command/query.
37
+ * Infer only when the leading word names one convention and a composed clause does not name the
38
+ * opposite one.
75
39
  */
76
40
  export declare function inferOperationKind(name: string): OperationKindInference;
77
41
  /** Explicit config is authoritative; otherwise the finite convention may decline. */
@@ -1 +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vB;AAED,2DAA2D;AAC3D,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAQzF;AAKD,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAE3D,YAAY,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAQ/B,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhD,+FAA+F;AAC/F,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAuBD,oFAAoF;AACpF,wBAAgB,UAAU,IAAI;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAEnE;AAYD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,CA4BvE;AAED,qFAAqF;AACrF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,GACnD,aAAa,GAAG,SAAS,CAE3B;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,GACnD,OAAO,CAET"}
@@ -1,10 +1,4 @@
1
- /**
2
- * Read an op's cardinality off its parsed return type.
3
- *
4
- * `Promise` is unwrapped first — it says when, not how much. `ListResult<T>` extends
5
- * `Array<T>`, so it must be recognised BEFORE the array test or a page would read as
6
- * a plain list and lose its `total`/`hasMore`.
7
- */
1
+ /** Read an op's cardinality off its parsed return type. */
8
2
  export function cardinalityOf(type) {
9
3
  if (!type)
10
4
  return undefined;
@@ -21,11 +15,7 @@ export function cardinalityOf(type) {
21
15
  }
22
16
  /** A return that carries no schema — the card has nothing to project onto it. */
23
17
  const PRIMITIVE_RETURNS = new Set(['boolean', 'string', 'number', 'void', 'undefined', 'unknown', 'any']);
24
- /**
25
- * Deliberately finite: these are verbs whose leading use carries a stable read meaning.
26
- * `stats` and `check` preserve conventions already used by the project; the rest are the
27
- * ordinary query vocabulary shared by the built-in adapters.
28
- */
18
+ /** Deliberately finite. */
29
19
  const QUERY_VERBS = new Set([
30
20
  'all', 'check', 'count', 'exists', 'fetch', 'find', 'get', 'has', 'health', 'list',
31
21
  'load', 'mine', 'ping', 'quote', 'read', 'search', 'stats', 'status', 'who',
@@ -57,9 +47,8 @@ function wordsOf(name) {
57
47
  .map((word) => word.toLowerCase());
58
48
  }
59
49
  /**
60
- * Infer only when the leading word names one convention and a composed clause does not
61
- * name the opposite one. This is intentionally partial: `ofBook`, `computeReport` and
62
- * `getOrCreateUser` have no inferred kind instead of falling through to command/query.
50
+ * Infer only when the leading word names one convention and a composed clause does not name the
51
+ * opposite one.
63
52
  */
64
53
  export function inferOperationKind(name) {
65
54
  const words = wordsOf(name);
@@ -1 +1 @@
1
- {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../src/wire/operation.ts"],"names":[],"mappings":"AAiDA;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,IAAyB;IACrD,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAClE,IAAI,CAAC,KAAK;QAAE,OAAO,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AC,IAAI,EAAE,SAAS,CAAC,KAAK,OAAO,CAAC;AAC3D,CAAC;AAED,SAAS,oBAAoB,CAC3B,IAAY,EACZ,SAAoD;IAEpD,MAAM,IAAI,GAAG,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACnD,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACtB,MAAM,IAAI,KAAK,CACb,qCAAqC,IAAI,KAAK;UAC5C,sBAAsB,IAAI,mDAAmD,CAChF,CAAC;AACJ,CAAC"}
@@ -1,8 +1,4 @@
1
- /**
2
- * A method's signature, as a contract is built from it — the shape, never the reading.
3
- *
4
- * The scan derives one from source; `frond.config.ts` states one. Neither owns the shape.
5
- */
1
+ /** A method's signature, as a contract is built from it — the shape, never the reading. */
6
2
  /** A type reference — primitives, entities, arrays, generics. */
7
3
  export interface TypeRef {
8
4
  /** Raw type text as written in source (e.g. 'Pagination<Post>'). */
@@ -11,13 +7,7 @@ export interface TypeRef {
11
7
  name: string;
12
8
  /** Whether this is an array (T[] or Array<T>) — true at any depth. */
13
9
  array?: boolean;
14
- /**
15
- * How MANY array levels: `string[]` is 1, `string[][]` is 2. `array` only ever said
16
- * "at least one", which sufficed while one level meant one thing. It stopped sufficing
17
- * when a presenter method started taking the page — there the outer level IS the page
18
- * and what remains is the field, so telling `string[]` from `string[][]` is telling a
19
- * computed string from a computed list.
20
- */
10
+ /** How MANY array levels. */
21
11
  arrayDepth?: number;
22
12
  /** Generic type arguments (e.g. for Pagination<Post> → [{ name: 'Post' }]). */
23
13
  generics?: TypeRef[];
@@ -39,20 +29,9 @@ export interface Signature {
39
29
  name: string;
40
30
  params: Param[];
41
31
  returnType?: TypeRef;
42
- /**
43
- * Came from a base class, not from the file being scanned. What a prefab
44
- * handler declares about its own ops beats this — the scan reads a signature
45
- * and guesses, the builder knows.
46
- */
32
+ /** Came from a base class, not from the file being scanned. */
47
33
  inherited?: boolean;
48
- /**
49
- * The operation in words — the first sentence of the method's doc comment.
50
- *
51
- * Not a new thing to write: handlers already carry it (`/** Judge: the author,
52
- * a draft… *&#47;`), the AST already holds it, and nothing read it. A caller that
53
- * discovers an operation over the wire has its name and its schema; what the
54
- * operation is FOR lived only in the source.
55
- */
34
+ /** The operation in words — the first sentence of the method's doc comment. */
56
35
  description?: string;
57
36
  }
58
37
  //# sourceMappingURL=signature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/wire/signature.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,iEAAiE;AACjE,MAAM,WAAW,OAAO;IACtB,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,oCAAoC;AACpC,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,0BAA0B;AAC1B,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
1
+ {"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../src/wire/signature.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,iEAAiE;AACjE,MAAM,WAAW,OAAO;IACtB,oEAAoE;IACpE,GAAG,EAAE,MAAM,CAAC;IACZ,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,oCAAoC;AACpC,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,0BAA0B;AAC1B,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fougere/core",
3
- "version": "0.6.0-alpha.0",
3
+ "version": "0.7.0-alpha.0",
4
4
  "description": "The core — scan, call contract, façades, remote stand-ins.",
5
5
  "keywords": [
6
6
  "fougere",
@@ -56,8 +56,8 @@
56
56
  "dependencies": {
57
57
  "@typescript/typescript6": "^6.0.2",
58
58
  "dequal": "^2.0.3",
59
- "@fougere/container": "0.6.0-alpha.0",
60
- "@fougere/schema": "0.6.0-alpha.0"
59
+ "@fougere/container": "0.7.0-alpha.0",
60
+ "@fougere/schema": "0.7.0-alpha.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/node": "^22.0.0"
@@ -3,8 +3,8 @@ import type { Container } from '@fougere/container';
3
3
  import { validationErrorsOf } from '../wire/errors.js';
4
4
  import { emitKeyOf, factsAnnouncedBy } from '../emit.js';
5
5
  import { ambient } from '#ambient';
6
- import { EMPTY_INVOCATION } from '../contract/Invocation.js';
7
- import type { Logger } from '../builtins/logger.js';
6
+ import { EMPTY_INVOCATION } from '../wire/Invocation.js';
7
+ import type { Logger } from '../builtin/logger.js';
8
8
  import type { Fronds } from '../descriptor/Fronds.js';
9
9
  import type { OperationsMap } from '../wire/operation.js';
10
10
 
@@ -17,25 +17,15 @@ interface Listener {
17
17
  /** Carries an announced fact out of this process — see `CreateAppOptions.onEmit`. */
18
18
  type Carrier = (fact: string, payload: unknown) => void | Promise<void>;
19
19
 
20
- /**
21
- * Emissions — the only place in Fougere where an initiator names a SUBJECT.
22
- *
23
- * It was eight closures over four collections in the middle of the boot, which is a
24
- * class that had not been named: the announced set, the subscriber index, the chain
25
- * carried in async context, and the shapes a fact is judged against.
26
- *
27
- * **It is a resolver, not a channel.** It answers *who*, then hands over to the door
28
- * that already exists — so a subscriber keeps its judge, its binding and its
29
- * middlewares, and nothing here is durable.
30
- */
20
+ /** Emissions — the only place in Fougere where an initiator names a SUBJECT. */
31
21
  export class Emissions {
32
22
  /** Who listens to what. Filled as each door's contracts are resolved. */
33
23
  private readonly subscribers = new Map<string, Listener[]>();
34
24
 
35
25
  /**
36
- * What is announced here, read from the DEPS and not from the subscribers: a handler
37
- * declaring `Emit<PostPublished>` must resolve it whether or not anybody listens, and
38
- * announcing to nobody is legal.
26
+ * What is announced here, read from the DEPS and not from the subscribers: a handler declaring
27
+ * `Emit<PostPublished>` must resolve it whether or not anybody listens, and announcing to nobody
28
+ * is legal.
39
29
  */
40
30
  private readonly announced: Set<string>;
41
31
 
@@ -52,13 +42,6 @@ export class Emissions {
52
42
  /**
53
43
  * Who listens to what — read from the PLAN, where `{ kind: 'fact' }` is a sentence
54
44
  * `computeBindingPlan` already wrote, so nothing re-derives what a parameter is.
55
- *
56
- * It is called for a frond hosted here AND for one declared remote. A remote frond is
57
- * still scanned — only its hosting is elsewhere — so its subscriptions are known, and
58
- * its door resolves to a doublure. That is the whole reason an emission crosses a
59
- * process without a line of transport code: the emitter learned the signature locally
60
- * and calls the same key. Noting only the hosted ones left the index EMPTY under a
61
- * split, and a fact announced to a remote listener reached nobody, in silence.
62
45
  */
63
46
  note(contracts: OperationsMap, door: string): void {
64
47
  for (const [op, contract] of contracts) {
@@ -71,7 +54,7 @@ export class Emissions {
71
54
  }
72
55
  }
73
56
 
74
- /** The shape a fact is judged by, when the fact is a declared entity. */
57
+ /** The shape a fact is validated by, when the fact is a declared entity. */
75
58
  shapeOf(fact: string): SchemaView | undefined {
76
59
  return this.shapes.get(fact);
77
60
  }
@@ -81,13 +64,7 @@ export class Emissions {
81
64
  return [...this.subscribers.keys()];
82
65
  }
83
66
 
84
- /**
85
- * Register one emission value per fact — announced here, or merely listened to.
86
- *
87
- * A process that only subscribes still needs the value, because `deliver` is what a
88
- * carrier calls and it goes through the same door. Called once every door has been
89
- * built, so the two sets are complete.
90
- */
67
+ /** Register one emission value per fact — announced here, or merely listened to. */
91
68
  register(): void {
92
69
  for (const fact of new Set([...this.announced, ...this.subscribers.keys()])) {
93
70
  this.container.registerValue(emitKeyOf(fact), (raw: unknown) => this.announce(fact, raw));
@@ -97,69 +74,27 @@ export class Emissions {
97
74
  }
98
75
  }
99
76
 
100
- /**
101
- * Announcing. Dispatch, never delivery — the emitter is handed back the moment every
102
- * subscriber has been HANDED the fact, not when any of them is done.
103
- *
104
- * The `EventBus` this replaces did `await Promise.all(handlers)` and passed their
105
- * rejections up, which made a publication hostage to its own indexer.
106
- */
77
+ /** Announcing. */
107
78
  private async announce(fact: string, raw: unknown): Promise<void> {
108
79
  /**
109
- * A fact announced inside a frame that then rolls back is a lie, and nothing can take
110
- * it back: announcing is DISPATCH — every subscriber has been handed the fact and the
111
- * carrier has already put it on the wire — while the frame's writes are still
112
- * provisional.
113
- *
114
- * Refused rather than deferred to the commit. Deferring would make `Emit<T>` behave
115
- * differently depending on where it is called from, which is the hidden runtime the
116
- * doctrine refuses; and it opens a window between the commit and the announcement whose
117
- * only remedy is an outbox — a table, therefore durability, the one thing Fougere says
118
- * it does not hold.
119
- *
120
- * A fact designates something that HAS happened. `run` returning is when that becomes
121
- * true, so that is where the announcement belongs.
80
+ * A fact announced inside a frame that then rolls back is a lie, and nothing can take it back:
81
+ * announcing is DISPATCH — every subscriber has been handed the fact and the carrier has
82
+ * already put it on the wire — while the frame's writes are still provisional.
122
83
  */
123
84
  await ambient.beforeAnnounce(fact);
124
85
 
125
86
  const payload = this.stamped(fact, raw);
126
87
 
127
- /**
128
- * Whoever is not in this process — and it is the ONLY way to reach them.
129
- *
130
- * The local dispatch finds its listeners by having READ their code, so it stops at
131
- * the repository boundary: another team's Frond is not on this disk, and the
132
- * emission reaches nobody. A carrier hands the fact to a name instead, and the far
133
- * side subscribes to that same name from ITS own code. Neither reads the other.
134
- *
135
- * `deliver` deliberately does NOT come here: a hub that resolved this value to hand
136
- * on an incoming reading echoed it straight back to the whole fleet.
137
- */
138
- const carried = this.carry?.(fact, payload);
139
- if (carried) void Promise.resolve(carried).catch((cause) => this.log.error(`${fact} — carrier refused it`, cause));
88
+ /** Whoever is not in this process — and it is the ONLY way to reach them. */
89
+ const delivery = this.carry?.(fact, payload);
90
+ if (delivery) void Promise.resolve(delivery).catch((cause) => this.log.error(`${fact} — carrier refused it`, cause));
140
91
 
141
92
  for (const { door, op, done } of this.handToListeners(fact, payload)) {
142
93
  void done.catch((cause) => this.log.error(`${fact} → ${door}.${op}`, this.describeRefusal(fact, cause) ?? cause));
143
94
  }
144
95
  }
145
96
 
146
- /**
147
- * Receiving. **The opposite rule, deliberately**: this one waits, and it tells.
148
- *
149
- * `deliver` is what a CARRIER calls, and a carrier's whole job is to know whether the
150
- * fact landed — at-least-once is retrying what failed, so a delivery that cannot report
151
- * makes durability impossible to build on top. It used to be the announcement itself:
152
- * it resolved before any subscriber had run and swallowed every failure into a log, so a
153
- * queue calling it could only ever ack blindly.
154
- *
155
- * That is not a contradiction of "dispatch is not delivery". That rule protects the
156
- * EMITTER, which must not become hostage to a subscriber; a carrier is not the emitter,
157
- * it is precisely the party whose business this is.
158
- *
159
- * What it still does not do is HOLD anything. A fact refused here is refused, and the
160
- * carrier decides whether it comes back — which is the whole of Fougere's position on
161
- * durability: the channel goes underneath, it is not reimplemented here.
162
- */
97
+ /** Receiving. */
163
98
  async deliver(fact: string, payload: unknown): Promise<void> {
164
99
  const handed = this.handToListeners(fact, payload);
165
100
  const settled = await Promise.allSettled(handed.map((h) => h.done));
@@ -180,22 +115,8 @@ export class Emissions {
180
115
  }
181
116
 
182
117
  /**
183
- * The announcement realizes the fact's own `lifecycle.create` — a `created()` stamped,
184
- * an id generated, a default applied.
185
- *
186
- * `applyCreate` (`schema/src/schema/axis/lifecycle/apply.ts`) is where the split is realized:
187
- * the judge never fills a hole, the STORAGE does, at the point of persistence. A fact has no storage, so nobody did — the judge declared an
188
- * absent `created()` legal and omitted it, and a subscriber received a value missing a
189
- * field its own type promises. Announcing is a fact's point of persistence.
190
- *
191
- * Announcing only, never `deliver`: a fact that arrives from elsewhere was stamped by
192
- * its sender, and stamping it again would give one fact a different identity in every
193
- * process that relayed it.
194
- *
195
- * **A typed emitter cannot reach this yet.** `Emit<T>` names the ROW type, where a
196
- * `created()` field is present and required, so `announce({ id, title })` is a compile
197
- * error and the author writes `at: new Date()` anyway. So this runs for a payload built
198
- * outside the type — a bridge, a replay, a test — and is inert for everyone else.
118
+ * The announcement realizes the fact's own `lifecycle.create` — a `created()` stamped, an id
119
+ * generated, a default applied.
199
120
  */
200
121
  private stamped(fact: string, raw: unknown): unknown {
201
122
  const shape = this.shapes.get(fact);
@@ -204,16 +125,7 @@ export class Emissions {
204
125
  : raw;
205
126
  }
206
127
 
207
- /**
208
- * Hand the fact to every listener in THIS process, and give back one promise each.
209
- *
210
- * The call goes THROUGH the door, so a subscriber meets the same judge, the same binding
211
- * and the same middlewares as any caller. Nothing new answers for correctness — that is
212
- * the dividend of a subscriber being an ordinary op rather than a special kind.
213
- *
214
- * It returns the promises rather than settling them, because the two callers want
215
- * opposite things and only one of them is wrong to wait.
216
- */
128
+ /** Hand the fact to every listener in THIS process, and give back one promise each. */
217
129
  private handToListeners(fact: string, payload: unknown): (Listener & { done: Promise<unknown> })[] {
218
130
  const walked = ambient.currentChain();
219
131
  if (walked.includes(fact)) {
@@ -239,21 +151,12 @@ export class Emissions {
239
151
  } catch (cause) {
240
152
  throw new Error(`${fact} → ${door} could not be reached`, { cause });
241
153
  }
242
- return facade[op]({ ...EMPTY_INVOCATION, body: payload });
154
+ return facade[op]({ ...EMPTY_INVOCATION, input: payload });
243
155
  }),
244
156
  }));
245
157
  }
246
158
 
247
- /**
248
- * A subscriber refusing the SHAPE, said in one line instead of dumped as an error.
249
- *
250
- * This is the one refusal nobody else will ever see. A door hands its 400 back to the
251
- * caller who can fix it; a fact is dispatched, not delivered, so the sender learns
252
- * nothing and the log is the whole of the evidence. The most likely cause is also the
253
- * one a stack trace hides worst — this process's copy is older than the sender's — so
254
- * the line names the fields and the remedy, and hedges because a genuinely bad payload
255
- * produces the same refusal.
256
- */
159
+ /** A subscriber refusing the SHAPE, said in one line instead of dumped as an error. */
257
160
  private describeRefusal(fact: string, cause: unknown): string | undefined {
258
161
  const refusals = validationErrorsOf(cause);
259
162
  if (!refusals?.length) return undefined;
@@ -1,20 +1,9 @@
1
- /**
2
- * What a call needs to know about the call it is inside, and the two ways to answer it.
3
- *
4
- * One realization reads an async context (`ambient.als.ts`), the other cannot and waits
5
- * its turn instead (`ambient.queue.ts`). `#ambient` in package.json picks one per runtime,
6
- * so a bundle for a host without async context never names `node:async_hooks`.
7
- */
1
+ /** What a call needs to know about the call it is inside, and the two ways to answer it. */
8
2
  export interface Ambient {
9
3
  /** True when this runtime has no async context, and the boot says so. */
10
4
  readonly degraded: boolean;
11
5
 
12
- /**
13
- * Run `fn` as the frame `key`. A frame opened inside another must not proceed.
14
- *
15
- * Measured on SQLite: a second transaction on the same connection WAITS for the first,
16
- * so a nested frame hangs on one engine and returns when split across two.
17
- */
6
+ /** Run `fn` as the frame `key`. */
18
7
  enterFrame<R>(key: string, fn: () => Promise<R>): Promise<R>;
19
8
 
20
9
  /**
@@ -23,17 +12,7 @@ export interface Ambient {
23
12
  */
24
13
  beforeAnnounce(fact: string): Promise<void>;
25
14
 
26
- /**
27
- * The facts already being announced up the stack, so a fact cannot cause itself.
28
- *
29
- * A CHAIN and not a depth: `A → B → D` and `A → C → D` is a diamond, perfectly legal,
30
- * while `A → … → A` never ends. Empty where it cannot be followed.
31
- *
32
- * Detecting this at boot was the first idea and it was wrong: `Emit<G>` is a CONSTRUCTOR
33
- * dependency, so it belongs to the handler and not to one of its methods. A handler that
34
- * subscribes to `A` in one method and emits `G` from another would have been refused for
35
- * a cycle it never walks.
36
- */
15
+ /** The facts already being announced up the stack, so a fact cannot cause itself. */
37
16
  currentChain(): readonly string[];
38
17
 
39
18
  /** Run `fn` with `fact` appended to the emission chain. */
@@ -1,9 +1,4 @@
1
- /**
2
- * The realization that can tell whose frame is open: an async context.
3
- *
4
- * Chosen by `#ambient` wherever `node:async_hooks` exists — Node, Deno, Bun, and workerd
5
- * with `nodejs_als`. Every refusal here is immediate and names its cause.
6
- */
1
+ /** The realization that can tell whose frame is open: an async context. */
7
2
  import { AsyncLocalStorage } from 'node:async_hooks';
8
3
  import type { Ambient } from './ambient-port.js';
9
4
 
@@ -14,10 +9,10 @@ export const ambient: Ambient = {
14
9
  degraded: false,
15
10
 
16
11
  enterFrame<R>(key: string, fn: () => Promise<R>): Promise<R> {
17
- const held = frame.getStore();
18
- if (held !== undefined) {
12
+ const open = frame.getStore();
13
+ if (open !== undefined) {
19
14
  return Promise.reject(new Error(
20
- `Together<[…]> (${key}) cannot be opened inside ${held}: on one engine the second `
15
+ `Together<[…]> (${key}) cannot be opened inside ${open}: on one engine the second `
21
16
  + `transaction waits for the first and the call hangs. Two frames that must both hold `
22
17
  + `are ONE frame — declare a single Together naming every member.`,
23
18
  ));
@@ -26,10 +21,10 @@ export const ambient: Ambient = {
26
21
  },
27
22
 
28
23
  beforeAnnounce(fact: string): Promise<void> {
29
- const held = frame.getStore();
30
- if (held === undefined) return Promise.resolve();
24
+ const open = frame.getStore();
25
+ if (open === undefined) return Promise.resolve();
31
26
  return Promise.reject(new Error(
32
- `${fact} cannot be announced inside Together<[…]> (${held}): announcing is dispatch, `
27
+ `${fact} cannot be announced inside Together<[…]> (${open}): announcing is dispatch, `
33
28
  + `so subscribers and the carrier would have it while these writes can still be taken `
34
29
  + `back. Announce after run() returns, when it is true.`,
35
30
  ));
@@ -1,9 +1,6 @@
1
1
  /**
2
- * The realization for a runtime with no async context: it cannot tell whose frame is
3
- * open, so it never guesses — it waits its turn.
4
- *
5
- * Two consequences the boot reports rather than hides: frames run one at a time, and a
6
- * frame opened inside another is not refused, it waits for itself and times out.
2
+ * The realization for a runtime with no async context: it cannot tell whose frame is open, so it
3
+ * never guesses — it waits its turn.
7
4
  */
8
5
  import type { Ambient } from './ambient-port.js';
9
6