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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (510) hide show
  1. package/README.md +1 -1
  2. package/dist/boot/AppLifecycle.d.ts +1 -1
  3. package/dist/boot/AppLifecycle.d.ts.map +1 -1
  4. package/dist/boot/AppLifecycle.js +13 -2
  5. package/dist/boot/AppLifecycle.js.map +1 -1
  6. package/dist/boot/Emissions.d.ts +13 -90
  7. package/dist/boot/Emissions.d.ts.map +1 -1
  8. package/dist/boot/Emissions.js +21 -118
  9. package/dist/boot/Emissions.js.map +1 -1
  10. package/dist/boot/ambient-port.d.ts +3 -24
  11. package/dist/boot/ambient-port.d.ts.map +1 -1
  12. package/dist/boot/ambient.als.d.ts.map +1 -1
  13. package/dist/boot/ambient.als.js +7 -12
  14. package/dist/boot/ambient.als.js.map +1 -1
  15. package/dist/boot/ambient.queue.d.ts +2 -5
  16. package/dist/boot/ambient.queue.d.ts.map +1 -1
  17. package/dist/boot/ambient.queue.js.map +1 -1
  18. package/dist/boot/apply.d.ts +1 -13
  19. package/dist/boot/apply.d.ts.map +1 -1
  20. package/dist/boot/apply.js +9 -16
  21. package/dist/boot/apply.js.map +1 -1
  22. package/dist/boot/auth.d.ts +2 -12
  23. package/dist/boot/auth.d.ts.map +1 -1
  24. package/dist/boot/boot.d.ts +3 -16
  25. package/dist/boot/boot.d.ts.map +1 -1
  26. package/dist/boot/boot.js +4 -11
  27. package/dist/boot/boot.js.map +1 -1
  28. package/dist/boot/bootstrap.d.ts.map +1 -1
  29. package/dist/boot/bootstrap.js +84 -130
  30. package/dist/boot/bootstrap.js.map +1 -1
  31. package/dist/boot/card.d.ts +1 -17
  32. package/dist/boot/card.d.ts.map +1 -1
  33. package/dist/boot/card.js +3 -32
  34. package/dist/boot/card.js.map +1 -1
  35. package/dist/boot/frame.d.ts +8 -32
  36. package/dist/boot/frame.d.ts.map +1 -1
  37. package/dist/boot/frame.js +17 -56
  38. package/dist/boot/frame.js.map +1 -1
  39. package/dist/boot/hosted.d.ts +2 -24
  40. package/dist/boot/hosted.d.ts.map +1 -1
  41. package/dist/boot/hosted.js +10 -15
  42. package/dist/boot/hosted.js.map +1 -1
  43. package/dist/boot/ownership.d.ts +3 -36
  44. package/dist/boot/ownership.d.ts.map +1 -1
  45. package/dist/boot/ownership.js +5 -40
  46. package/dist/boot/ownership.js.map +1 -1
  47. package/dist/boot/ports.d.ts +1 -14
  48. package/dist/boot/ports.d.ts.map +1 -1
  49. package/dist/boot/ports.js +1 -14
  50. package/dist/boot/ports.js.map +1 -1
  51. package/dist/boot/remote.d.ts +5 -38
  52. package/dist/boot/remote.d.ts.map +1 -1
  53. package/dist/boot/remote.js +8 -41
  54. package/dist/boot/remote.js.map +1 -1
  55. package/dist/boot/runner.d.ts +4 -21
  56. package/dist/boot/runner.d.ts.map +1 -1
  57. package/dist/boot/runner.js +4 -17
  58. package/dist/boot/runner.js.map +1 -1
  59. package/dist/boot/seed.d.ts +4 -31
  60. package/dist/boot/seed.d.ts.map +1 -1
  61. package/dist/boot/seed.js +6 -37
  62. package/dist/boot/seed.js.map +1 -1
  63. package/dist/boot/statement-drift.d.ts +2 -21
  64. package/dist/boot/statement-drift.d.ts.map +1 -1
  65. package/dist/boot/statement-drift.js +4 -9
  66. package/dist/boot/statement-drift.js.map +1 -1
  67. package/dist/boot/together.d.ts +4 -8
  68. package/dist/boot/together.d.ts.map +1 -1
  69. package/dist/boot/together.js +15 -50
  70. package/dist/boot/together.js.map +1 -1
  71. package/dist/boot/types.d.ts +31 -173
  72. package/dist/boot/types.d.ts.map +1 -1
  73. package/dist/builtin/config.d.ts +7 -0
  74. package/dist/builtin/config.d.ts.map +1 -0
  75. package/dist/builtin/config.js +15 -0
  76. package/dist/builtin/config.js.map +1 -0
  77. package/dist/{builtins → builtin}/logger.d.ts +4 -25
  78. package/dist/builtin/logger.d.ts.map +1 -0
  79. package/dist/{builtins → builtin}/logger.js +5 -32
  80. package/dist/builtin/logger.js.map +1 -0
  81. package/dist/config-loader.d.ts +9 -67
  82. package/dist/config-loader.d.ts.map +1 -1
  83. package/dist/config-loader.js +5 -18
  84. package/dist/config-loader.js.map +1 -1
  85. package/dist/contract.d.ts +15 -31
  86. package/dist/contract.d.ts.map +1 -1
  87. package/dist/contract.js +13 -26
  88. package/dist/contract.js.map +1 -1
  89. package/dist/criterion.d.ts +37 -0
  90. package/dist/criterion.d.ts.map +1 -0
  91. package/dist/criterion.js +28 -0
  92. package/dist/criterion.js.map +1 -0
  93. package/dist/crypto/encoding.d.ts +2 -15
  94. package/dist/crypto/encoding.d.ts.map +1 -1
  95. package/dist/crypto/encoding.js +2 -15
  96. package/dist/crypto/encoding.js.map +1 -1
  97. package/dist/crypto/node.d.ts.map +1 -1
  98. package/dist/crypto/node.js +1 -7
  99. package/dist/crypto/node.js.map +1 -1
  100. package/dist/crypto/port.d.ts +2 -18
  101. package/dist/crypto/port.d.ts.map +1 -1
  102. package/dist/crypto/port.js +1 -17
  103. package/dist/crypto/port.js.map +1 -1
  104. package/dist/crypto/webcrypto.d.ts.map +1 -1
  105. package/dist/crypto/webcrypto.js +1 -12
  106. package/dist/crypto/webcrypto.js.map +1 -1
  107. package/dist/declare.d.ts +19 -37
  108. package/dist/declare.d.ts.map +1 -1
  109. package/dist/declare.js +23 -30
  110. package/dist/declare.js.map +1 -1
  111. package/dist/define.d.ts +2 -3
  112. package/dist/define.d.ts.map +1 -1
  113. package/dist/define.js +2 -3
  114. package/dist/define.js.map +1 -1
  115. package/dist/descriptor/Fronds.d.ts +3 -28
  116. package/dist/descriptor/Fronds.d.ts.map +1 -1
  117. package/dist/descriptor/Fronds.js +6 -31
  118. package/dist/descriptor/Fronds.js.map +1 -1
  119. package/dist/descriptor/frond.d.ts +25 -60
  120. package/dist/descriptor/frond.d.ts.map +1 -1
  121. package/dist/descriptor/frond.js +5 -1
  122. package/dist/descriptor/frond.js.map +1 -1
  123. package/dist/dispatch/ArgumentResolver.d.ts +1 -1
  124. package/dist/dispatch/ArgumentResolver.d.ts.map +1 -1
  125. package/dist/dispatch/ArgumentResolver.js +5 -5
  126. package/dist/dispatch/ArgumentResolver.js.map +1 -1
  127. package/dist/dispatch/DispatchEvent.d.ts +2 -2
  128. package/dist/dispatch/DispatchEvent.d.ts.map +1 -1
  129. package/dist/dispatch/DispatchLifecycle.d.ts +1 -7
  130. package/dist/dispatch/DispatchLifecycle.d.ts.map +1 -1
  131. package/dist/dispatch/DispatchLifecycle.js +1 -7
  132. package/dist/dispatch/DispatchLifecycle.js.map +1 -1
  133. package/dist/dispatch/DispatchPort.d.ts +1 -1
  134. package/dist/dispatch/DispatchPort.d.ts.map +1 -1
  135. package/dist/dispatch/Dispatcher.d.ts +1 -1
  136. package/dist/dispatch/Dispatcher.d.ts.map +1 -1
  137. package/dist/dispatch/Dispatcher.js +2 -2
  138. package/dist/dispatch/Dispatcher.js.map +1 -1
  139. package/dist/{boot → dispatch}/HandlerFacade.d.ts +25 -38
  140. package/dist/dispatch/HandlerFacade.d.ts.map +1 -0
  141. package/dist/{boot → dispatch}/HandlerFacade.js +65 -74
  142. package/dist/dispatch/HandlerFacade.js.map +1 -0
  143. package/dist/dispatch/LocalRoutePolicy.d.ts +1 -1
  144. package/dist/dispatch/LocalRoutePolicy.d.ts.map +1 -1
  145. package/dist/dispatch/LocalRoutePolicy.js +4 -4
  146. package/dist/dispatch/LocalRoutePolicy.js.map +1 -1
  147. package/dist/dispatch/OperationRoute.d.ts +2 -2
  148. package/dist/dispatch/OperationRoute.d.ts.map +1 -1
  149. package/dist/dispatch/OutputView.d.ts +3 -2
  150. package/dist/dispatch/OutputView.d.ts.map +1 -1
  151. package/dist/dispatch/OutputView.js +19 -1
  152. package/dist/dispatch/OutputView.js.map +1 -1
  153. package/dist/dispatch/Route.d.ts +2 -2
  154. package/dist/dispatch/Route.d.ts.map +1 -1
  155. package/dist/dispatch/RoutePolicy.d.ts +1 -1
  156. package/dist/dispatch/RoutePolicy.d.ts.map +1 -1
  157. package/dist/dispatch/RouteRegistry.d.ts +1 -1
  158. package/dist/dispatch/RouteRegistry.d.ts.map +1 -1
  159. package/dist/dispatch/RouteRegistry.js +2 -2
  160. package/dist/dispatch/RouteRegistry.js.map +1 -1
  161. package/dist/dispatch/RouteResolver.d.ts +2 -4
  162. package/dist/dispatch/RouteResolver.d.ts.map +1 -1
  163. package/dist/dispatch/StorageGuard.d.ts +40 -8
  164. package/dist/dispatch/StorageGuard.d.ts.map +1 -1
  165. package/dist/dispatch/StorageGuard.js +151 -20
  166. package/dist/dispatch/StorageGuard.js.map +1 -1
  167. package/dist/dispatch/presenterArguments.d.ts +7 -0
  168. package/dist/dispatch/presenterArguments.d.ts.map +1 -0
  169. package/dist/dispatch/presenterArguments.js +12 -0
  170. package/dist/dispatch/presenterArguments.js.map +1 -0
  171. package/dist/dispatch/remoteRoutes.d.ts +7 -0
  172. package/dist/dispatch/remoteRoutes.d.ts.map +1 -0
  173. package/dist/dispatch/{RemoteRouteResolver.js → remoteRoutes.js} +6 -10
  174. package/dist/dispatch/remoteRoutes.js.map +1 -0
  175. package/dist/dispatch/routeNotFound.d.ts +9 -0
  176. package/dist/dispatch/routeNotFound.d.ts.map +1 -0
  177. package/dist/dispatch/routeNotFound.js +21 -0
  178. package/dist/dispatch/routeNotFound.js.map +1 -0
  179. package/dist/dispatch/validateInput.d.ts +5 -0
  180. package/dist/dispatch/validateInput.d.ts.map +1 -0
  181. package/dist/dispatch/validateInput.js +20 -0
  182. package/dist/dispatch/validateInput.js.map +1 -0
  183. package/dist/effective-operation.d.ts +1 -24
  184. package/dist/effective-operation.d.ts.map +1 -1
  185. package/dist/effective-operation.js +21 -50
  186. package/dist/effective-operation.js.map +1 -1
  187. package/dist/emit.d.ts +4 -42
  188. package/dist/emit.d.ts.map +1 -1
  189. package/dist/emit.js +3 -39
  190. package/dist/emit.js.map +1 -1
  191. package/dist/entry/facade.d.ts +8 -0
  192. package/dist/entry/facade.d.ts.map +1 -0
  193. package/dist/entry/facade.js +28 -0
  194. package/dist/entry/facade.js.map +1 -0
  195. package/dist/entry/transport.d.ts +5 -0
  196. package/dist/entry/transport.d.ts.map +1 -0
  197. package/dist/entry/transport.js +11 -0
  198. package/dist/entry/transport.js.map +1 -0
  199. package/dist/frond-config.d.ts +7 -70
  200. package/dist/frond-config.d.ts.map +1 -1
  201. package/dist/frond-config.js +1 -9
  202. package/dist/frond-config.js.map +1 -1
  203. package/dist/identity-keys.d.ts +2 -5
  204. package/dist/identity-keys.d.ts.map +1 -1
  205. package/dist/identity-keys.js +3 -16
  206. package/dist/identity-keys.js.map +1 -1
  207. package/dist/identity.d.ts +4 -30
  208. package/dist/identity.d.ts.map +1 -1
  209. package/dist/identity.js +11 -73
  210. package/dist/identity.js.map +1 -1
  211. package/dist/imports.d.ts +1 -7
  212. package/dist/imports.d.ts.map +1 -1
  213. package/dist/imports.js +1 -7
  214. package/dist/imports.js.map +1 -1
  215. package/dist/index.d.ts +17 -24
  216. package/dist/index.d.ts.map +1 -1
  217. package/dist/index.js +10 -18
  218. package/dist/index.js.map +1 -1
  219. package/dist/loader.d.ts +1 -8
  220. package/dist/loader.d.ts.map +1 -1
  221. package/dist/loader.js +1 -8
  222. package/dist/loader.js.map +1 -1
  223. package/dist/node.d.ts +2 -11
  224. package/dist/node.d.ts.map +1 -1
  225. package/dist/node.js +2 -11
  226. package/dist/node.js.map +1 -1
  227. package/dist/prefab/collector.d.ts +1 -22
  228. package/dist/prefab/collector.d.ts.map +1 -1
  229. package/dist/prefab/collector.js +1 -22
  230. package/dist/prefab/collector.js.map +1 -1
  231. package/dist/prefab/crud.d.ts +16 -32
  232. package/dist/prefab/crud.d.ts.map +1 -1
  233. package/dist/prefab/crud.js +31 -58
  234. package/dist/prefab/crud.js.map +1 -1
  235. package/dist/prefab/mirror.d.ts +2 -24
  236. package/dist/prefab/mirror.d.ts.map +1 -1
  237. package/dist/prefab/mirror.js +2 -20
  238. package/dist/prefab/mirror.js.map +1 -1
  239. package/dist/prefab/prefab.d.ts +1 -7
  240. package/dist/prefab/prefab.d.ts.map +1 -1
  241. package/dist/prefab/prefab.js +1 -7
  242. package/dist/prefab/prefab.js.map +1 -1
  243. package/dist/prefab/presenter.d.ts +2 -36
  244. package/dist/prefab/presenter.d.ts.map +1 -1
  245. package/dist/prefab/presenter.js +2 -36
  246. package/dist/prefab/presenter.js.map +1 -1
  247. package/dist/prefab/repository.d.ts +5 -73
  248. package/dist/prefab/repository.d.ts.map +1 -1
  249. package/dist/prefab/repository.js +3 -16
  250. package/dist/prefab/repository.js.map +1 -1
  251. package/dist/scan/adapters.d.ts +3 -0
  252. package/dist/scan/adapters.d.ts.map +1 -0
  253. package/dist/scan/adapters.js +25 -0
  254. package/dist/scan/adapters.js.map +1 -0
  255. package/dist/scan/bundling.d.ts +1 -12
  256. package/dist/scan/bundling.d.ts.map +1 -1
  257. package/dist/scan/bundling.js +1 -12
  258. package/dist/scan/bundling.js.map +1 -1
  259. package/dist/scan/contract.d.ts +27 -0
  260. package/dist/scan/contract.d.ts.map +1 -0
  261. package/dist/scan/contract.js +46 -0
  262. package/dist/scan/contract.js.map +1 -0
  263. package/dist/scan/conventions.d.ts +6 -40
  264. package/dist/scan/conventions.d.ts.map +1 -1
  265. package/dist/scan/conventions.js +5 -34
  266. package/dist/scan/conventions.js.map +1 -1
  267. package/dist/scan/emit.d.ts +1 -5
  268. package/dist/scan/emit.d.ts.map +1 -1
  269. package/dist/scan/emit.js +10 -78
  270. package/dist/scan/emit.js.map +1 -1
  271. package/dist/scan/handler-parser.d.ts +4 -26
  272. package/dist/scan/handler-parser.d.ts.map +1 -1
  273. package/dist/scan/handler-parser.js +26 -83
  274. package/dist/scan/handler-parser.js.map +1 -1
  275. package/dist/scan/result.d.ts +3 -16
  276. package/dist/scan/result.d.ts.map +1 -1
  277. package/dist/scan/scanner.d.ts +2 -27
  278. package/dist/scan/scanner.d.ts.map +1 -1
  279. package/dist/scan/scanner.js +45 -133
  280. package/dist/scan/scanner.js.map +1 -1
  281. package/dist/scan/statement.d.ts.map +1 -1
  282. package/dist/scan/statement.js +60 -37
  283. package/dist/scan/statement.js.map +1 -1
  284. package/dist/source.d.ts +53 -0
  285. package/dist/source.d.ts.map +1 -0
  286. package/dist/source.js +18 -0
  287. package/dist/source.js.map +1 -0
  288. package/dist/storage.d.ts +13 -210
  289. package/dist/storage.d.ts.map +1 -1
  290. package/dist/storage.js +4 -68
  291. package/dist/storage.js.map +1 -1
  292. package/dist/store.d.ts +18 -0
  293. package/dist/store.d.ts.map +1 -0
  294. package/dist/store.js +179 -0
  295. package/dist/store.js.map +1 -0
  296. package/dist/verify.d.ts +5 -38
  297. package/dist/verify.d.ts.map +1 -1
  298. package/dist/verify.js +17 -37
  299. package/dist/verify.js.map +1 -1
  300. package/dist/wire/CallLog.d.ts +32 -0
  301. package/dist/wire/CallLog.d.ts.map +1 -0
  302. package/dist/{contract → wire}/CallLog.js.map +1 -1
  303. package/dist/wire/Invocation.d.ts +32 -0
  304. package/dist/wire/Invocation.d.ts.map +1 -0
  305. package/dist/wire/Invocation.js +66 -0
  306. package/dist/wire/Invocation.js.map +1 -0
  307. package/dist/{contract → wire}/RouteAddress.d.ts +5 -0
  308. package/dist/wire/RouteAddress.d.ts.map +1 -0
  309. package/dist/{contract → wire}/RouteAddress.js +7 -0
  310. package/dist/wire/RouteAddress.js.map +1 -0
  311. package/dist/wire/binding.d.ts +5 -21
  312. package/dist/wire/binding.d.ts.map +1 -1
  313. package/dist/wire/binding.js +5 -10
  314. package/dist/wire/binding.js.map +1 -1
  315. package/dist/wire/call.d.ts +24 -133
  316. package/dist/wire/call.d.ts.map +1 -1
  317. package/dist/wire/call.js +15 -41
  318. package/dist/wire/call.js.map +1 -1
  319. package/dist/wire/drift.d.ts +3 -28
  320. package/dist/wire/drift.d.ts.map +1 -1
  321. package/dist/wire/drift.js +4 -23
  322. package/dist/wire/drift.js.map +1 -1
  323. package/dist/wire/errors.d.ts +4 -24
  324. package/dist/wire/errors.d.ts.map +1 -1
  325. package/dist/wire/errors.js +4 -24
  326. package/dist/wire/errors.js.map +1 -1
  327. package/dist/wire/http-error.d.ts +2 -13
  328. package/dist/wire/http-error.d.ts.map +1 -1
  329. package/dist/wire/http-error.js +5 -19
  330. package/dist/wire/http-error.js.map +1 -1
  331. package/dist/wire/loggerMiddleware.d.ts +2 -8
  332. package/dist/wire/loggerMiddleware.d.ts.map +1 -1
  333. package/dist/wire/loggerMiddleware.js +1 -7
  334. package/dist/wire/loggerMiddleware.js.map +1 -1
  335. package/dist/wire/middleware.d.ts +3 -7
  336. package/dist/wire/middleware.d.ts.map +1 -1
  337. package/dist/wire/middleware.js +1 -5
  338. package/dist/wire/middleware.js.map +1 -1
  339. package/dist/wire/operation.d.ts +7 -43
  340. package/dist/wire/operation.d.ts.map +1 -1
  341. package/dist/wire/operation.js +4 -15
  342. package/dist/wire/operation.js.map +1 -1
  343. package/dist/wire/signature.d.ts +4 -25
  344. package/dist/wire/signature.d.ts.map +1 -1
  345. package/package.json +3 -3
  346. package/src/boot/AppLifecycle.ts +15 -2
  347. package/src/boot/Emissions.ts +21 -118
  348. package/src/boot/ambient-port.ts +3 -24
  349. package/src/boot/ambient.als.ts +7 -12
  350. package/src/boot/ambient.queue.ts +2 -5
  351. package/src/boot/apply.ts +9 -16
  352. package/src/boot/auth.ts +2 -12
  353. package/src/boot/boot.ts +6 -21
  354. package/src/boot/bootstrap.ts +95 -140
  355. package/src/boot/card.ts +4 -33
  356. package/src/boot/frame.ts +24 -64
  357. package/src/boot/hosted.ts +12 -34
  358. package/src/boot/ownership.ts +5 -39
  359. package/src/boot/ports.ts +1 -14
  360. package/src/boot/remote.ts +11 -58
  361. package/src/boot/runner.ts +5 -22
  362. package/src/boot/seed.ts +6 -37
  363. package/src/boot/statement-drift.ts +5 -24
  364. package/src/boot/together.ts +18 -51
  365. package/src/boot/types.ts +31 -173
  366. package/src/{builtins → builtin}/config.ts +1 -7
  367. package/src/{builtins → builtin}/logger.ts +6 -39
  368. package/src/config-loader.ts +12 -71
  369. package/src/contract.ts +19 -39
  370. package/src/criterion.ts +54 -0
  371. package/src/crypto/encoding.ts +2 -15
  372. package/src/crypto/node.ts +1 -7
  373. package/src/crypto/port.ts +2 -18
  374. package/src/crypto/webcrypto.ts +1 -12
  375. package/src/declare.ts +42 -41
  376. package/src/define.ts +2 -3
  377. package/src/descriptor/Fronds.ts +6 -31
  378. package/src/descriptor/frond.ts +26 -60
  379. package/src/dispatch/ArgumentResolver.ts +6 -6
  380. package/src/dispatch/DispatchEvent.ts +2 -2
  381. package/src/dispatch/DispatchLifecycle.ts +1 -7
  382. package/src/dispatch/DispatchPort.ts +1 -1
  383. package/src/dispatch/Dispatcher.ts +3 -3
  384. package/src/dispatch/HandlerFacade.ts +231 -0
  385. package/src/dispatch/LocalRoutePolicy.ts +4 -4
  386. package/src/dispatch/OperationRoute.ts +2 -2
  387. package/src/dispatch/OutputView.ts +24 -2
  388. package/src/dispatch/Route.ts +2 -2
  389. package/src/dispatch/RoutePolicy.ts +1 -1
  390. package/src/dispatch/RouteRegistry.ts +2 -2
  391. package/src/dispatch/RouteResolver.ts +2 -4
  392. package/src/dispatch/StorageGuard.ts +175 -19
  393. package/src/dispatch/presenterArguments.ts +25 -0
  394. package/src/dispatch/{RemoteRouteResolver.ts → remoteRoutes.ts} +7 -9
  395. package/src/dispatch/routeNotFound.ts +33 -0
  396. package/src/dispatch/validateInput.ts +28 -0
  397. package/src/effective-operation.ts +21 -50
  398. package/src/emit.ts +5 -63
  399. package/src/entry/facade.ts +44 -0
  400. package/src/entry/transport.ts +16 -0
  401. package/src/frond-config.ts +7 -70
  402. package/src/identity-keys.ts +3 -16
  403. package/src/identity.ts +12 -80
  404. package/src/imports.ts +2 -31
  405. package/src/index.ts +17 -24
  406. package/src/loader.ts +2 -16
  407. package/src/node.ts +2 -11
  408. package/src/prefab/collector.ts +1 -22
  409. package/src/prefab/crud.ts +37 -76
  410. package/src/prefab/mirror.ts +4 -44
  411. package/src/prefab/prefab.ts +2 -21
  412. package/src/prefab/presenter.ts +2 -36
  413. package/src/prefab/repository.ts +7 -83
  414. package/src/scan/adapters.ts +32 -0
  415. package/src/scan/bundling.ts +1 -12
  416. package/src/scan/contract.ts +80 -0
  417. package/src/scan/conventions.ts +6 -40
  418. package/src/scan/emit.ts +11 -80
  419. package/src/scan/handler-parser.ts +27 -96
  420. package/src/scan/result.ts +3 -16
  421. package/src/scan/scanner.ts +46 -132
  422. package/src/scan/statement.ts +73 -41
  423. package/src/source.ts +63 -0
  424. package/src/storage.ts +14 -234
  425. package/src/store.ts +191 -0
  426. package/src/verify.ts +16 -57
  427. package/src/wire/CallLog.ts +30 -0
  428. package/src/{contract → wire}/Invocation.ts +24 -17
  429. package/src/{contract → wire}/RouteAddress.ts +7 -0
  430. package/src/wire/binding.ts +9 -25
  431. package/src/wire/call.ts +30 -133
  432. package/src/wire/drift.ts +5 -30
  433. package/src/wire/errors.ts +4 -24
  434. package/src/wire/http-error.ts +5 -19
  435. package/src/wire/loggerMiddleware.ts +2 -8
  436. package/src/wire/middleware.ts +3 -7
  437. package/src/wire/operation.ts +8 -48
  438. package/src/wire/signature.ts +4 -25
  439. package/dist/boot/HandlerFacade.d.ts.map +0 -1
  440. package/dist/boot/HandlerFacade.js.map +0 -1
  441. package/dist/builtins/config.d.ts +0 -13
  442. package/dist/builtins/config.d.ts.map +0 -1
  443. package/dist/builtins/config.js +0 -21
  444. package/dist/builtins/config.js.map +0 -1
  445. package/dist/builtins/logger.d.ts.map +0 -1
  446. package/dist/builtins/logger.js.map +0 -1
  447. package/dist/contract/Call.d.ts +0 -10
  448. package/dist/contract/Call.d.ts.map +0 -1
  449. package/dist/contract/Call.js +0 -15
  450. package/dist/contract/Call.js.map +0 -1
  451. package/dist/contract/CallLog.d.ts +0 -57
  452. package/dist/contract/CallLog.d.ts.map +0 -1
  453. package/dist/contract/Invocation.d.ts +0 -27
  454. package/dist/contract/Invocation.d.ts.map +0 -1
  455. package/dist/contract/Invocation.js +0 -59
  456. package/dist/contract/Invocation.js.map +0 -1
  457. package/dist/contract/RouteAddress.d.ts.map +0 -1
  458. package/dist/contract/RouteAddress.js.map +0 -1
  459. package/dist/dispatch/InputValidator.d.ts +0 -7
  460. package/dist/dispatch/InputValidator.d.ts.map +0 -1
  461. package/dist/dispatch/InputValidator.js +0 -22
  462. package/dist/dispatch/InputValidator.js.map +0 -1
  463. package/dist/dispatch/OperationExecutor.d.ts +0 -25
  464. package/dist/dispatch/OperationExecutor.d.ts.map +0 -1
  465. package/dist/dispatch/OperationExecutor.js +0 -32
  466. package/dist/dispatch/OperationExecutor.js.map +0 -1
  467. package/dist/dispatch/OutputProjector.d.ts +0 -12
  468. package/dist/dispatch/OutputProjector.d.ts.map +0 -1
  469. package/dist/dispatch/OutputProjector.js +0 -30
  470. package/dist/dispatch/OutputProjector.js.map +0 -1
  471. package/dist/dispatch/PresenterArgumentResolver.d.ts +0 -12
  472. package/dist/dispatch/PresenterArgumentResolver.d.ts.map +0 -1
  473. package/dist/dispatch/PresenterArgumentResolver.js +0 -20
  474. package/dist/dispatch/PresenterArgumentResolver.js.map +0 -1
  475. package/dist/dispatch/RemoteRouteResolver.d.ts +0 -13
  476. package/dist/dispatch/RemoteRouteResolver.d.ts.map +0 -1
  477. package/dist/dispatch/RemoteRouteResolver.js.map +0 -1
  478. package/dist/dispatch/RouteNotFoundError.d.ts +0 -10
  479. package/dist/dispatch/RouteNotFoundError.d.ts.map +0 -1
  480. package/dist/dispatch/RouteNotFoundError.js +0 -24
  481. package/dist/dispatch/RouteNotFoundError.js.map +0 -1
  482. package/dist/entry/DynamicFacade.d.ts +0 -10
  483. package/dist/entry/DynamicFacade.d.ts.map +0 -1
  484. package/dist/entry/DynamicFacade.js +0 -27
  485. package/dist/entry/DynamicFacade.js.map +0 -1
  486. package/dist/entry/FacadeEntry.d.ts +0 -11
  487. package/dist/entry/FacadeEntry.d.ts.map +0 -1
  488. package/dist/entry/FacadeEntry.js +0 -26
  489. package/dist/entry/FacadeEntry.js.map +0 -1
  490. package/dist/entry/TransportEntry.d.ts +0 -13
  491. package/dist/entry/TransportEntry.d.ts.map +0 -1
  492. package/dist/entry/TransportEntry.js +0 -24
  493. package/dist/entry/TransportEntry.js.map +0 -1
  494. package/dist/rows.d.ts +0 -40
  495. package/dist/rows.d.ts.map +0 -1
  496. package/dist/rows.js +0 -146
  497. package/dist/rows.js.map +0 -1
  498. package/src/boot/HandlerFacade.ts +0 -242
  499. package/src/contract/Call.ts +0 -18
  500. package/src/contract/CallLog.ts +0 -55
  501. package/src/dispatch/InputValidator.ts +0 -28
  502. package/src/dispatch/OperationExecutor.ts +0 -60
  503. package/src/dispatch/OutputProjector.ts +0 -32
  504. package/src/dispatch/PresenterArgumentResolver.ts +0 -25
  505. package/src/dispatch/RouteNotFoundError.ts +0 -29
  506. package/src/entry/DynamicFacade.ts +0 -28
  507. package/src/entry/FacadeEntry.ts +0 -32
  508. package/src/entry/TransportEntry.ts +0 -30
  509. package/src/rows.ts +0 -155
  510. /package/dist/{contract → wire}/CallLog.js +0 -0
@@ -1,5 +1,5 @@
1
1
  import type { AuthConfig } from './boot/auth.js';
2
- import type { LogLevel } from './builtins/logger.js';
2
+ import type { LogLevel } from './builtin/logger.js';
3
3
  import type { ConventionsInput } from './scan/conventions.js';
4
4
  export interface FougereConfig {
5
5
  /** Database configuration — the DEFAULT source, the one an entity lands in unnamed. */
@@ -7,72 +7,26 @@ export interface FougereConfig {
7
7
  dialect: 'sqlite';
8
8
  path?: string;
9
9
  } | false;
10
- /**
11
- * The other places rows live — a name, an engine, and the entities it holds.
12
- *
13
- * A fact about the APP, stated beside `remotes:` because it is the same kind of
14
- * statement: `remotes:` says where a CALL goes, this says where a ROW is. Neither
15
- * belongs on the entity, which describes itself and not its deployment.
16
- *
17
- * Only the exception is declared: everything unnamed stays in `db`. Membership is
18
- * per ENTITY rather than per frond — two fronds may share a database, and one frond
19
- * may hold entities in two — so the entity is the truth and a frond-wide shorthand
20
- * waits for a case that needs it.
21
- *
22
- * A `ref()` across two sources gets no foreign key: two databases share no
23
- * constraint. The DDL stops pretending rather than the `ref` being refused.
24
- */
10
+ /** The other places rows live — a name, an engine, and the entities it holds. */
25
11
  sources?: Record<string, {
26
12
  dialect?: 'sqlite';
27
13
  path?: string;
28
14
  entities: string[];
29
15
  }>;
30
16
  /**
31
- * The names the scan reads instead of deriving them — the import scope, the fronds
32
- * directory, the seven convention directories.
33
- *
34
- * Only what differs is stated. Read BEFORE the fronds are discovered, which is what
35
- * lets it name the prefix they are found under: nothing in this file may import
36
- * `@fronds/*`, or the name would be needed to read the file that declares it.
17
+ * The names the scan reads instead of deriving them — the import scope, the fronds directory,
18
+ * the seven convention directories.
37
19
  */
38
20
  conventions?: ConventionsInput;
39
- /**
40
- * How much every logger says. The one key a running app CONSULTS rather than
41
- * consumes, so re-reading this file changes it without rebuilding anything.
42
- *
43
- * `FOUGERE_LOG_LEVEL` still wins — it is how the CLI speaks, and the precedence is
44
- * the usual one (CLI over config file).
45
- */
21
+ /** How much every logger says. */
46
22
  logLevel?: LogLevel;
47
23
  /** Remote fronds — frondName → base URL. */
48
24
  remotes?: Record<string, string>;
49
- /**
50
- * Which realization answers which port — port class name → implementation class name.
51
- *
52
- * A fact about the APP, stated beside `remotes:` for the same reason `sources:` is:
53
- * `remotes:` says where a CALL goes, `sources:` says where a ROW is, this says who
54
- * performs an ACTION. None of the three belongs inside the frond, which describes
55
- * itself and not its deployment — a `billing` frond naming Stripe would be the one
56
- * thing the framework refuses.
57
- *
58
- * Only the exception is declared. One class extending a port answers it by
59
- * convention and this key stays absent; two make the boot refuse until one is named.
60
- */
25
+ /** Which realization answers which port — port class name → implementation class name. */
61
26
  ports?: Record<string, string>;
62
27
  /** Auth declaration — picks a provider package and forwards options to it. */
63
28
  auth?: AuthConfig;
64
- /**
65
- * Which protocol adapters this app serves.
66
- *
67
- * A fact about the APP, declared once beside `db`, `remotes` and `auth` — not a
68
- * property of whichever host runs it. Before this existed the same decision was
69
- * spelled five different ways: Nuxt mounted REST unconditionally, the Web hosts
70
- * served it if you happened to create a route file, and Express if you happened to
71
- * call a middleware. One decision, five dialects, no canonical place.
72
- *
73
- * Absent means not served. The call envelope is not listed here: it is the wire the
74
- * client primitives use, not a projection an app chooses to publish.
75
- */
29
+ /** Which protocol adapters this app serves. */
76
30
  adapters?: AdapterConfig;
77
31
  }
78
32
  /** Protocol adapters, by the name of the package that provides them. */
@@ -84,22 +38,10 @@ export interface AdapterConfig {
84
38
  /** A surface of your own; the framework only records that you declared it. */
85
39
  [adapter: string]: boolean | undefined;
86
40
  }
87
- /**
88
- * Load the root fougere.config.{ts,js,mjs} from the given directory.
89
- *
90
- * `fresh` re-reads a file that may have changed since the last load — what a host
91
- * calls when it decides to reconsider its config, and the only way `applyConfig` has
92
- * anything new to apply.
93
- */
41
+ /** Load the root fougere.config.{ts,js,mjs} from the given directory. */
94
42
  export declare function loadConfig(root: string, options?: {
95
43
  fresh?: boolean;
96
44
  }): Promise<FougereConfig>;
97
- /**
98
- * Load config along the workspace→app frontier. The workspace-root config is
99
- * the base (canonical topology: `remotes`, shared `db`); the app-root config
100
- * overrides. Same `root` boundary the fronds already cascade along. When both
101
- * roots resolve to the same dir (single app, no workspace), this is the plain
102
- * root config — idempotent, no behavior change.
103
- */
45
+ /** Load config along the workspace→app frontier. */
104
46
  export declare function loadCascadedConfig(workspaceRoot: string, appRoot: string): Promise<FougereConfig>;
105
47
  //# sourceMappingURL=config-loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../src/config-loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAK9D,MAAM,WAAW,aAAa;IAC5B,uFAAuF;IACvF,EAAE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AAyE;AACzE,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAEpG;AAiBD,oDAAoD;AACpD,wBAAsB,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAIvG"}
@@ -18,22 +18,15 @@ async function loadConfigFrom(dir, fresh) {
18
18
  }
19
19
  return {};
20
20
  }
21
- /**
22
- * Load the root fougere.config.{ts,js,mjs} from the given directory.
23
- *
24
- * `fresh` re-reads a file that may have changed since the last load — what a host
25
- * calls when it decides to reconsider its config, and the only way `applyConfig` has
26
- * anything new to apply.
27
- */
21
+ /** Load the root fougere.config.{ts,js,mjs} from the given directory. */
28
22
  export async function loadConfig(root, options) {
29
23
  return loadConfigFrom(root, options?.fresh);
30
24
  }
31
25
  // ── Merging ──────────────────────────────────────
32
26
  /**
33
- * Override a config with another, the invariant of every cascade level:
34
- * scalar keys replace, but `remotes` (the topology) MERGES — an override adds
35
- * or redirects a frond without erasing the others. Used for workspace→app and
36
- * for global→CLI alike.
27
+ * Override a config with another, the invariant of every cascade level: scalar keys replace, but
28
+ * `remotes` (the topology) MERGES — an override adds or redirects a frond without erasing the
29
+ * others.
37
30
  */
38
31
  function mergeGlobal(base, override) {
39
32
  const merged = { ...base, ...override };
@@ -42,13 +35,7 @@ function mergeGlobal(base, override) {
42
35
  }
43
36
  return merged;
44
37
  }
45
- /**
46
- * Load config along the workspace→app frontier. The workspace-root config is
47
- * the base (canonical topology: `remotes`, shared `db`); the app-root config
48
- * overrides. Same `root` boundary the fronds already cascade along. When both
49
- * roots resolve to the same dir (single app, no workspace), this is the plain
50
- * root config — idempotent, no behavior change.
51
- */
38
+ /** Load config along the workspace→app frontier. */
52
39
  export async function loadCascadedConfig(workspaceRoot, appRoot) {
53
40
  const base = await loadConfig(workspaceRoot);
54
41
  if (resolve(workspaceRoot) === resolve(appRoot))
@@ -1 +1 @@
1
- {"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../src/config-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAIrC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAkF9C,oDAAoD;AAEpD,MAAM,YAAY,GAAG,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;AAEtF,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,KAAe;IACxD,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAChC,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,gFAAgF;YAChF,gFAAgF;YAChF,kFAAkF;YAClF,2EAA2E;YAC3E,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,OAAO,CAAE,GAAmC,CAAC,OAAO,IAAI,GAAG,CAAkB,CAAC;QAChF,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY,EAAE,OAA6B;IAC1E,OAAO,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED,oDAAoD;AAEpD;;;;;GAKG;AACH,SAAS,WAAW,CAAC,IAAmB,EAAE,QAAgC;IACxE,MAAM,MAAM,GAAkB,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EA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,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,OAAO,CAAE,GAAmC,CAAC,OAAO,IAAI,GAAG,CAAkB,CAAC;QAChF,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY,EAAE,OAA6B;IAC1E,OAAO,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED,oDAAoD;AAEpD;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAmB,EAAE,QAAgC;IACxE,MAAM,MAAM,GAAkB,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAE,CAAC;IACvD,IAAI,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACrC,MAAM,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC5D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,oDAAoD;AACpD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,aAAqB,EAAE,OAAe;IAC7E,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,aAAa,CAAC,CAAC;IAC7C,IAAI,OAAO,CAAC,aAAa,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,OAAO,WAAW,CAAC,IAAI,EAAE,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC;AACtD,CAAC"}
@@ -1,41 +1,27 @@
1
- import { type InvocationContext } from './contract/Invocation.js';
1
+ import { type InvocationContext } from './wire/Invocation.js';
2
2
  import type { FrondCall } from './wire/call.js';
3
3
  export { FougereError, ErrorCode, validationErrorsOf } from './wire/errors.js';
4
+ export { comparisonOf, comparisonsIn, unknownIn, COMPARISONS } from './criterion.js';
5
+ export type { Comparison, ComparisonName } from './criterion.js';
4
6
  export { toPublicError } from './wire/http-error.js';
5
7
  export type { FougereErrorOptions } from './wire/errors.js';
6
- export { canonicalInvocation, EMPTY_INVOCATION } from './contract/Invocation.js';
7
- export type { InvocationContext } from './contract/Invocation.js';
8
- export { Invocation } from './contract/Invocation.js';
9
- export type { InvocationInput } from './contract/Invocation.js';
10
- export { Call } from './contract/Call.js';
11
- export { RouteAddress } from './contract/RouteAddress.js';
12
- export type { RouteAddressInput } from './contract/RouteAddress.js';
8
+ export { canonicalInvocation, EMPTY_INVOCATION } from './wire/Invocation.js';
9
+ export type { InvocationContext } from './wire/Invocation.js';
10
+ export { Invocation } from './wire/Invocation.js';
11
+ export type { PartialInvocation } from './wire/Invocation.js';
12
+ export { Call } from './wire/call.js';
13
+ export { RouteAddress } from './wire/RouteAddress.js';
14
+ export type { RouteAddressInput } from './wire/RouteAddress.js';
13
15
  export type { FrondCall, Transport, SignedCall } from './wire/call.js';
14
16
  export { MAX_BODY_BYTES } from './wire/call.js';
15
17
  export { RPC_ENTITY } from './wire/call.js';
16
- export type { CallPage, CallRecord } from './contract/CallLog.js';
18
+ export type { CallPage, CallRecord } from './wire/CallLog.js';
17
19
  export { driftOf, agrees, explain } from './wire/drift.js';
18
20
  export type { CardDrift } from './wire/drift.js';
19
- /**
20
- * What `rpc.discover` answers. It belongs here and not to the runtime: the
21
- * reserved op travels on the same wire as every other call, so a consumer that
22
- * only sends — a browser bundle, a frond written elsewhere — needs its shape and
23
- * nothing else. Type-only, so `call.js` never enters the runtime graph.
24
- *
25
- * Stated once, on purpose: two private copies of this interface have already gone
26
- * stale (the CLI's, then the Rust demo's) the day an op stopped being a bare name.
27
- */
21
+ /** What `rpc.discover` answers. */
28
22
  export type { IdentityCard, CardOp, TopologyReport, FrondPlacement, Edge } from './wire/call.js';
29
23
  export { assertIdentityCard } from './wire/call.js';
30
- /**
31
- * The key a class name is filed under — 'Post' → 'post'. Re-exported rather than
32
- * respelled: a card writes it and a foreign key derives from it, so the convention
33
- * belongs to the schema, and a second copy here is a second opinion. It travels
34
- * through this subpath because a consumer of the wire (a browser bundle) may hold no
35
- * schema dependency of its own — that audience only. Inside the package it is read from
36
- * `@fougere/schema` directly: routing four modules through here bought nothing and put
37
- * this file inside a cycle.
38
- */
24
+ /** The key a class name is filed under — 'Post' → 'post'. */
39
25
  export { lowerFirst } from '@fougere/schema';
40
26
  /** A call, fully fabricated: the designation and its completed invocation. */
41
27
  export interface CallValue {
@@ -43,10 +29,8 @@ export interface CallValue {
43
29
  invocation: InvocationContext;
44
30
  }
45
31
  /**
46
- * Fabricate the call value — one designation, two spellings:
47
- * `callValueOf(Post, 'list', { query })` (class + verb) or
48
- * `callValueOf({ entity, op }, input)` (raw, for dynamic bridges).
49
- * Missing invocation fields complete to the empty invocation.
32
+ * Fabricate the call value — one designation, two spellings: `callValueOf(Post, 'list', { query
33
+ * })` (class + verb) or `callValueOf({ entity, op }, input)` (raw, for dynamic bridges).
50
34
  */
51
35
  export declare function callValueOf(target: {
52
36
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAWA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjF,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;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AAE,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,6DAA6D;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,8EAA8E;AAC9E,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,iBAAiB,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EACpC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,EAC/C,KAAK,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACjC,SAAS,CAMX"}
package/dist/contract.js CHANGED
@@ -1,23 +1,20 @@
1
1
  /**
2
- * Contract surface — what a sender needs to speak to a receiver, and
3
- * nothing that assumes a runtime: the error vocabulary, the invocation
4
- * shape, the call value, the naming convention.
5
- *
6
- * Browser-safe by design: no node builtin may enter this module's import
7
- * graph. Published as the `@fougere/core/contract` subpath so client
8
- * bundles never touch the full index (scanner, config loader). `@fougere/schema`
9
- * is allowed in — measured, it imports no node builtin either.
2
+ * Contract surface — what a sender needs to speak to a receiver, and nothing that assumes a
3
+ * runtime: the error vocabulary, the invocation shape, the call value, the naming convention.
10
4
  */
11
5
  import { lowerFirst } from '@fougere/schema';
12
- import { canonicalInvocation } from './contract/Invocation.js';
6
+ import { canonicalInvocation } from './wire/Invocation.js';
13
7
  export { FougereError, ErrorCode, validationErrorsOf } from './wire/errors.js';
8
+ // What a read may ask about one field. Here rather than on the main entry because an
9
+ // adapter reads it to compile a query, and an adapter carries no boot.
10
+ export { comparisonOf, comparisonsIn, unknownIn, COMPARISONS } from './criterion.js';
14
11
  // A receiver turns a refusal into what may cross a process boundary, and it is not
15
12
  // core's boot — reaching it through the main entry dragged the scanner into a bundle.
16
13
  export { toPublicError } from './wire/http-error.js';
17
- export { canonicalInvocation, EMPTY_INVOCATION } from './contract/Invocation.js';
18
- export { Invocation } from './contract/Invocation.js';
19
- export { Call } from './contract/Call.js';
20
- export { RouteAddress } from './contract/RouteAddress.js';
14
+ export { canonicalInvocation, EMPTY_INVOCATION } from './wire/Invocation.js';
15
+ export { Invocation } from './wire/Invocation.js';
16
+ export { Call } from './wire/call.js';
17
+ export { RouteAddress } from './wire/RouteAddress.js';
21
18
  export { MAX_BODY_BYTES } from './wire/call.js';
22
19
  // The reserved entity, VALUE and not type: a consumer that wants to leave it alone — a
23
20
  // call log ignoring its own reader — has to be able to name it.
@@ -26,21 +23,11 @@ export { RPC_ENTITY } from './wire/call.js';
26
23
  // purpose: a panel showing the drift holds only the two cards, never the app.
27
24
  export { driftOf, agrees, explain } from './wire/drift.js';
28
25
  export { assertIdentityCard } from './wire/call.js';
29
- /**
30
- * The key a class name is filed under — 'Post' → 'post'. Re-exported rather than
31
- * respelled: a card writes it and a foreign key derives from it, so the convention
32
- * belongs to the schema, and a second copy here is a second opinion. It travels
33
- * through this subpath because a consumer of the wire (a browser bundle) may hold no
34
- * schema dependency of its own — that audience only. Inside the package it is read from
35
- * `@fougere/schema` directly: routing four modules through here bought nothing and put
36
- * this file inside a cycle.
37
- */
26
+ /** The key a class name is filed under — 'Post' → 'post'. */
38
27
  export { lowerFirst } from '@fougere/schema';
39
28
  /**
40
- * Fabricate the call value — one designation, two spellings:
41
- * `callValueOf(Post, 'list', { query })` (class + verb) or
42
- * `callValueOf({ entity, op }, input)` (raw, for dynamic bridges).
43
- * Missing invocation fields complete to the empty invocation.
29
+ * Fabricate the call value — one designation, two spellings: `callValueOf(Post, 'list', { query
30
+ * })` (class + verb) or `callValueOf({ entity, op }, input)` (raw, for dynamic bridges).
44
31
  */
45
32
  export function callValueOf(target, opOrInput, input) {
46
33
  const [call, given] = typeof opOrInput === 'string'
@@ -1 +1 @@
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AA+C,EAC/C,KAAkC;IAElC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GACjB,OAAO,SAAS,KAAK,QAAQ;QAC3B,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAE,MAA2B,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC;QACnF,CAAC,CAAC,CAAC,MAAmB,EAAE,SAAS,CAAC,CAAC;IACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,37 @@
1
+ /** What a read may ask about one field, and how a storage tells the two forms apart. */
2
+ import { type Field } from '@fougere/schema';
3
+ /**
4
+ * The comparisons a criterion may name.
5
+ *
6
+ * `eq` and `in` are not here: a bare value already means equality and an array already
7
+ * means membership, and giving them a second spelling would make one criterion sayable
8
+ * two ways. What is added is what those two could not say at all.
9
+ */
10
+ export interface Comparison {
11
+ gte?: unknown;
12
+ lte?: unknown;
13
+ gt?: unknown;
14
+ lt?: unknown;
15
+ ne?: unknown;
16
+ /** Both bounds, inclusive — `between: [1500, 4000]`. */
17
+ between?: [unknown, unknown];
18
+ contains?: string;
19
+ notIn?: readonly unknown[];
20
+ isNull?: boolean;
21
+ }
22
+ export declare const COMPARISONS: readonly ["gte", "lte", "gt", "lt", "ne", "between", "contains", "notIn", "isNull"];
23
+ export type ComparisonName = (typeof COMPARISONS)[number];
24
+ /**
25
+ * Is this criterion a comparison, or a value that happens to be an object?
26
+ *
27
+ * Read off the FIELD, never off the value. `json()` admits any shape, so `{ gte: … }` is
28
+ * a legal thing to store — telling the two apart by looking at the criterion would make a
29
+ * stored object unfilterable the day its keys happened to spell an operator. The shape
30
+ * knows, and it is the only thing that does.
31
+ */
32
+ export declare function comparisonOf(field: Field | undefined, asked: unknown): Comparison | undefined;
33
+ /** The comparisons a criterion names, in the order the caller wrote them. */
34
+ export declare function comparisonsIn(comparison: Comparison): [ComparisonName, unknown][];
35
+ /** What a comparison names that this vocabulary does not — a typo, said as one. */
36
+ export declare function unknownIn(comparison: Comparison): string[];
37
+ //# sourceMappingURL=criterion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criterion.d.ts","sourceRoot":"","sources":["../src/criterion.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAE,KAAK,KAAK,EAAU,MAAM,iBAAiB,CAAC;AAErD;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,wDAAwD;IACxD,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,WAAW,qFAAsF,CAAC;AAE/G,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAM7F;AAED,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,EAAE,CAIjF;AAED,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,EAAE,CAE1D"}
@@ -0,0 +1,28 @@
1
+ /** What a read may ask about one field, and how a storage tells the two forms apart. */
2
+ import { Shapes } from '@fougere/schema';
3
+ export const COMPARISONS = ['gte', 'lte', 'gt', 'lt', 'ne', 'between', 'contains', 'notIn', 'isNull'];
4
+ /**
5
+ * Is this criterion a comparison, or a value that happens to be an object?
6
+ *
7
+ * Read off the FIELD, never off the value. `json()` admits any shape, so `{ gte: … }` is
8
+ * a legal thing to store — telling the two apart by looking at the criterion would make a
9
+ * stored object unfilterable the day its keys happened to spell an operator. The shape
10
+ * knows, and it is the only thing that does.
11
+ */
12
+ export function comparisonOf(field, asked) {
13
+ if (asked === null || typeof asked !== 'object' || Array.isArray(asked))
14
+ return undefined;
15
+ // `Shapes.of` answers with `null` already taken out — `optional(json())` is an object.
16
+ if (!field || Shapes.of(field.shape).base?.type === 'object')
17
+ return undefined;
18
+ return asked;
19
+ }
20
+ /** The comparisons a criterion names, in the order the caller wrote them. */
21
+ export function comparisonsIn(comparison) {
22
+ return Object.entries(comparison).filter((entry) => COMPARISONS.includes(entry[0]));
23
+ }
24
+ /** What a comparison names that this vocabulary does not — a typo, said as one. */
25
+ export function unknownIn(comparison) {
26
+ return Object.keys(comparison).filter((name) => !COMPARISONS.includes(name));
27
+ }
28
+ //# sourceMappingURL=criterion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"criterion.js","sourceRoot":"","sources":["../src/criterion.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,EAAc,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAsBrD,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAI/G;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB,EAAE,KAAc;IACnE,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC1F,uFAAuF;IACvF,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAE/E,OAAO,KAAmB,CAAC;AAC7B,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAAC,UAAsB;IAClD,OAAO,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,MAAM,CACtC,CAAC,KAAK,EAAsC,EAAE,CAAE,WAAiC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACrG,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,SAAS,CAAC,UAAsB;IAC9C,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAE,WAAiC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACtG,CAAC"}
@@ -1,11 +1,4 @@
1
- /**
2
- * What both realizations spell identically — bytes in, bytes out, no platform.
3
- *
4
- * `Buffer` did all of this and does not exist on a Worker; `atob`/`btoa` exist on both.
5
- * Nothing here is a policy decision, which is why it sits beside the port rather than
6
- * inside either half: two copies of a base64url would be two chances to disagree on the
7
- * padding, and the disagreement would show up as a bad signature.
8
- */
1
+ /** What both realizations spell identically — bytes in, bytes out, no platform. */
9
2
  export declare const bytesOf: (text: string) => Uint8Array;
10
3
  export declare const textOf: (bytes: Uint8Array) => string;
11
4
  /** Base64url, unpadded — what JWS puts between the dots. */
@@ -14,12 +7,6 @@ export declare function unb64url(input: string): Uint8Array;
14
7
  /** Plain base64, padded — what an environment variable carries a PEM as. */
15
8
  export declare function b64(input: Uint8Array | string): string;
16
9
  export declare const unb64: (input: string) => Uint8Array;
17
- /**
18
- * The DER a PEM wraps. WebCrypto imports DER and knows nothing about the armour.
19
- *
20
- * The label is not checked: a caller asking for a private key and handed a public one
21
- * fails at `importKey` with a message about the key, which is the truer error than one
22
- * about a header line.
23
- */
10
+ /** The DER a PEM wraps. */
24
11
  export declare function derOf(pem: string): Uint8Array;
25
12
  //# sourceMappingURL=encoding.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../src/crypto/encoding.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,KAAG,UAAkC,CAAC;AAC1E,eAAO,MAAM,MAAM,GAAI,OAAO,UAAU,KAAG,MAA+B,CAAC;AAE3E,4DAA4D;AAC5D,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAOzD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAKlD;AAED,4EAA4E;AAC5E,wBAAgB,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAKtD;AAED,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG,UAKrC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAI7C"}
1
+ {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../src/crypto/encoding.ts"],"names":[],"mappings":"AAAA,mFAAmF;AAKnF,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,KAAG,UAAkC,CAAC;AAC1E,eAAO,MAAM,MAAM,GAAI,OAAO,UAAU,KAAG,MAA+B,CAAC;AAE3E,4DAA4D;AAC5D,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAOzD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAKlD;AAED,4EAA4E;AAC5E,wBAAgB,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAKtD;AAED,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG,UAKrC,CAAC;AAEF,2BAA2B;AAC3B,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAI7C"}
@@ -1,11 +1,4 @@
1
- /**
2
- * What both realizations spell identically — bytes in, bytes out, no platform.
3
- *
4
- * `Buffer` did all of this and does not exist on a Worker; `atob`/`btoa` exist on both.
5
- * Nothing here is a policy decision, which is why it sits beside the port rather than
6
- * inside either half: two copies of a base64url would be two chances to disagree on the
7
- * padding, and the disagreement would show up as a bad signature.
8
- */
1
+ /** What both realizations spell identically — bytes in, bytes out, no platform. */
9
2
  const encoder = new TextEncoder();
10
3
  const decoder = new TextDecoder();
11
4
  export const bytesOf = (text) => encoder.encode(text);
@@ -42,13 +35,7 @@ export const unb64 = (input) => {
42
35
  bytes[i] = binary.charCodeAt(i);
43
36
  return bytes;
44
37
  };
45
- /**
46
- * The DER a PEM wraps. WebCrypto imports DER and knows nothing about the armour.
47
- *
48
- * The label is not checked: a caller asking for a private key and handed a public one
49
- * fails at `importKey` with a message about the key, which is the truer error than one
50
- * about a header line.
51
- */
38
+ /** The DER a PEM wraps. */
52
39
  export function derOf(pem) {
53
40
  const body = pem.replace(/-----(BEGIN|END)[^-]+-----/g, '').replace(/\s+/g, '');
54
41
  if (body.length === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"encoding.js","sourceRoot":"","sources":["../../src/crypto/encoding.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAElC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAc,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAiB,EAAU,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,C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AI,IAAI,KAAK;QAAE,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAc,EAAE;IACjD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;QAAE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC3E,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,2BAA2B;AAC3B,MAAM,UAAU,KAAK,CAAC,GAAW;IAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAChF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IACvF,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/crypto/node.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEzE,eAAO,MAAM,MAAM,EAAE,UAiBpB,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/crypto/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEzE,eAAO,MAAM,MAAM,EAAE,UAiBpB,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,10 +1,4 @@
1
- /**
2
- * Ed25519 through `node:crypto` — the default realization, and the fast one.
3
- *
4
- * `sign`/`verify` are synchronous here and stay synchronous: the promise is put around
5
- * the answer, never around the work. That is the whole reason this file exists rather
6
- * than everyone sharing the WebCrypto half.
7
- */
1
+ /** Ed25519 through `node:crypto` — the default realization, and the fast one. */
8
2
  import { createHash, createPrivateKey, createPublicKey, sign, verify } from 'node:crypto';
9
3
  export const crypto = {
10
4
  async sha256(data) {
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/crypto/node.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1F,MAAM,CAAC,MAAM,MAAM,GAAe;IAChC,KAAK,CAAC,MAAM,CAAC,IAAI;QACf,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,aAAa;QAC1B,oFAAoF;QACpF,MAAM,GAAG,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAC5C,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChF,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,GAAG;QAClB,MAA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AAK,EAAE,CAAC,CAAC;QAC1D,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,IAAI,OAAO,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7F,CAAC;CACF,CAAC"}
@@ -1,20 +1,4 @@
1
- /**
2
- * The two Ed25519 gestures a signed call needs, and the one hash that binds it.
3
- *
4
- * Node signs 59% faster than WebCrypto on the same curve (measured 2026-08-23: 14.30 µs
5
- * against 22.72 µs per signature, 34.42 against 41.81 to verify), so this is a PORT with
6
- * two realizations and not one implementation at the lowest common denominator. `#crypto`
7
- * resolves to `crypto/node.ts` everywhere except under the `workerd` condition — the
8
- * bundler picks at build time, and neither half ever appears in the other's output.
9
- *
10
- * The shape is async because WebCrypto is. On Node that costs one microtask, which the
11
- * same measurement puts inside the noise of the signature itself (14.30 sync against
12
- * 14.28 awaited) — awaiting is free, converting is not.
13
- *
14
- * A KEY IS PARSED ONCE. `crypto.subtle.importKey` is async and per-key, so an interface
15
- * shaped `sign(key, data)` would import on every call; `signerOf(pem)` hands back
16
- * something that holds the parsed key, and a boot builds it once.
17
- */
1
+ /** The two Ed25519 gestures a signed call needs, and the one hash that binds it. */
18
2
  /** A parsed private key. */
19
3
  export interface Signer {
20
4
  sign(data: Uint8Array): Promise<Uint8Array>;
@@ -32,7 +16,7 @@ export interface PublicJwk {
32
16
  [key: string]: unknown;
33
17
  }
34
18
  export interface CryptoPort {
35
- /** SHA-256. What binds a body to an envelope without carrying the body. */
19
+ /** SHA-256. What binds an input to an envelope without carrying the input. */
36
20
  sha256(data: Uint8Array): Promise<Uint8Array>;
37
21
  /** From a PKCS#8 PEM — what `fougere keys` writes. */
38
22
  signerOf(privateKeyPem: string): Promise<Signer>;
@@ -1 +1 @@
1
- {"version":3,"file":"port.d.ts","sourceRoot":"","sources":["../../src/crypto/port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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AC,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,8EAA8E;IAC9E,MAAM,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9C,sDAAsD;IACtD,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,uEAAuE;IACvE,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CACxD"}
@@ -1,19 +1,3 @@
1
- /**
2
- * The two Ed25519 gestures a signed call needs, and the one hash that binds it.
3
- *
4
- * Node signs 59% faster than WebCrypto on the same curve (measured 2026-08-23: 14.30 µs
5
- * against 22.72 µs per signature, 34.42 against 41.81 to verify), so this is a PORT with
6
- * two realizations and not one implementation at the lowest common denominator. `#crypto`
7
- * resolves to `crypto/node.ts` everywhere except under the `workerd` condition — the
8
- * bundler picks at build time, and neither half ever appears in the other's output.
9
- *
10
- * The shape is async because WebCrypto is. On Node that costs one microtask, which the
11
- * same measurement puts inside the noise of the signature itself (14.30 sync against
12
- * 14.28 awaited) — awaiting is free, converting is not.
13
- *
14
- * A KEY IS PARSED ONCE. `crypto.subtle.importKey` is async and per-key, so an interface
15
- * shaped `sign(key, data)` would import on every call; `signerOf(pem)` hands back
16
- * something that holds the parsed key, and a boot builds it once.
17
- */
1
+ /** The two Ed25519 gestures a signed call needs, and the one hash that binds it. */
18
2
  export {};
19
3
  //# sourceMappingURL=port.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"port.js","sourceRoot":"","sources":["../../src/crypto/port.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG"}
1
+ {"version":3,"file":"port.js","sourceRoot":"","sources":["../../src/crypto/port.ts"],"names":[],"mappings":"AAAA,oFAAoF"}
@@ -1 +1 @@
1
- {"version":3,"file":"webcrypto.d.ts","sourceRoot":"","sources":["../../src/crypto/webcrypto.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAqBzE,eAAO,MAAM,MAAM,EAAE,UAkBpB,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"webcrypto.d.ts","sourceRoot":"","sources":["../../src/crypto/webcrypto.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAqBzE,eAAO,MAAM,MAAM,EAAE,UAkBpB,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,15 +1,4 @@
1
- /**
2
- * Ed25519 through WebCrypto — what a runtime with no `node:` builtin has.
3
- *
4
- * Verified in real workerd with no compatibility flag (2026-08-23): sign, verify, a JWK
5
- * import, an SPKI import and SHA-256 all answer. `Ed25519` is the algorithm name; the
6
- * older `NODE-ED25519` spelling is not used, and a runtime that only knows that one will
7
- * refuse at `importKey` rather than silently signing with something else.
8
- *
9
- * The four gestures are declared here rather than pulled from `lib.dom`: this package
10
- * compiles with `lib: ["ESNext"]` and naming DOM would make every consumer carry a
11
- * browser's globals to read a server type. What the file needs IS the declaration.
12
- */
1
+ /** Ed25519 through WebCrypto — what a runtime with no `node:` builtin has. */
13
2
  import { derOf } from './encoding.js';
14
3
  const ED25519 = { name: 'Ed25519' };
15
4
  /** Read at call time — a Worker has the global, and reading it at module load does not. */
@@ -1 +1 @@
1
- {"version":3,"file":"webcrypto.js","sourceRoot":"","sources":["../../src/crypto/webcrypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,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